From efe2310ed7ee5ed29a994d65f2a541d3e6dc2110 Mon Sep 17 00:00:00 2001 From: sebavan Date: Sat, 19 Sep 2026 01:46:40 +0200 Subject: [PATCH 1/3] fix worker management --- dist/spector.bundle.js | 2 +- dist/spector.d.ts | 5 +- documentation/apis.md | 6 +- extensions/background.js | 42 ++- extensions/contentScript.js | 58 +++- extensions/contentScriptProxy.js | 17 +- extensions/manifest.json | 2 +- extensions/moduleWorkerInjector.js | 137 ++++++-- extensions/popup.html | 16 +- extensions/popup.js | 28 +- extensions/result.js | 12 +- extensions/spector.bundle.func.js | 2 +- extensions/spector.bundle.js | 2 +- readme.md | 12 +- sample/js/workerAutoInject/dynamicImport.js | 11 + sample/js/workerAutoInject/moduleParent.js | 9 + sample/js/workerAutoInject/nestedClassic.js | 18 + sample/js/workerAutoInject/nestedModule.js | 1 + sample/js/workerAutoInject/safeClassic.js | 9 + .../workerAutoInjectDependency.js | 1 + sample/js/workerAutoInjectHarness.js | 102 ++++++ sample/workerAutoInject.html | 203 +++++++++++ src/backend/spies/workerSpy.ts | 22 +- src/embeddedFrontend/styles/resultView.scss | 2 +- src/spector.ts | 5 +- .../e2e/fixtures/worker-dynamic-dependency.js | 1 + test/e2e/fixtures/worker-dynamic-import.js | 11 + test/e2e/fixtures/worker-host.html | 31 ++ .../fixtures/worker-module-offscreen-data.txt | 1 + .../worker-module-offscreen-renderer.js | 35 ++ test/e2e/fixtures/worker-module-offscreen.js | 7 + test/e2e/fixtures/worker-module-parent.js | 9 + .../fixtures/worker-module-safe-dependency.js | 1 + test/e2e/fixtures/worker-module-safe.js | 8 + test/e2e/fixtures/worker-nested-child.js | 1 + test/e2e/fixtures/worker-nested-parent.js | 17 + test/e2e/fixtures/worker-safe.js | 6 + test/e2e/fixtures/worker-spector-stub.js | 1 + test/e2e/workerInterception.spec.ts | 301 +++++++++++++++++ ...esult-view-captures-tab-chromium-win32.png | Bin 19206 -> 21177 bytes test/integration/visual/result-view.spec.ts | 4 +- test/unit/backend/spies/workerSpy.test.ts | 31 +- .../extensions/moduleWorkerInjector.test.ts | 18 + test/unit/extensions/workerAutoInject.test.ts | 318 ++++++++++++++++++ 44 files changed, 1447 insertions(+), 78 deletions(-) create mode 100644 sample/js/workerAutoInject/dynamicImport.js create mode 100644 sample/js/workerAutoInject/moduleParent.js create mode 100644 sample/js/workerAutoInject/nestedClassic.js create mode 100644 sample/js/workerAutoInject/nestedModule.js create mode 100644 sample/js/workerAutoInject/safeClassic.js create mode 100644 sample/js/workerAutoInject/workerAutoInjectDependency.js create mode 100644 sample/js/workerAutoInjectHarness.js create mode 100644 sample/workerAutoInject.html create mode 100644 test/e2e/fixtures/worker-dynamic-dependency.js create mode 100644 test/e2e/fixtures/worker-dynamic-import.js create mode 100644 test/e2e/fixtures/worker-host.html create mode 100644 test/e2e/fixtures/worker-module-offscreen-data.txt create mode 100644 test/e2e/fixtures/worker-module-offscreen-renderer.js create mode 100644 test/e2e/fixtures/worker-module-offscreen.js create mode 100644 test/e2e/fixtures/worker-module-parent.js create mode 100644 test/e2e/fixtures/worker-module-safe-dependency.js create mode 100644 test/e2e/fixtures/worker-module-safe.js create mode 100644 test/e2e/fixtures/worker-nested-child.js create mode 100644 test/e2e/fixtures/worker-nested-parent.js create mode 100644 test/e2e/fixtures/worker-safe.js create mode 100644 test/e2e/fixtures/worker-spector-stub.js create mode 100644 test/e2e/workerInterception.spec.ts create mode 100644 test/unit/extensions/workerAutoInject.test.ts diff --git a/dist/spector.bundle.js b/dist/spector.bundle.js index ff7e2e9..662efd1 100644 --- a/dist/spector.bundle.js +++ b/dist/spector.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see spector.bundle.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("SPECTOR",[],t):"object"==typeof exports?exports.SPECTOR=t():e.SPECTOR=t()}(self,()=>(()=>{var e={377(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.captureMenuComponent{position:absolute;padding:7px;z-index:99999;top:10px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuComponent.active{visibility:visible;display:block}.captureMenuComponent,.captureMenuComponent:after,.captureMenuComponent:before{box-sizing:content-box}.captureMenuLogComponent{position:absolute;padding:7px;z-index:80000;top:66px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuLogComponent.active{visibility:visible;display:block}.captureMenuLogComponent,.captureMenuLogComponent:after,.captureMenuLogComponent:before{box-sizing:content-box}.captureMenuLogComponent span.error{color:red}.canvasListComponent{float:left;width:50%;height:100%}.canvasListComponent [commandName=onCanvasSelection]{vertical-align:center;line-height:40px;white-space:nowrap;text-overflow:ellipsis;width:190px;display:inline-block;overflow:hidden;margin:0px 5px}.canvasListComponent [commandName=onCanvasSelection]:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.canvasListComponent ul{margin:0px;padding:7px;list-style:none;position:absolute;top:54px;left:-2px;width:400px;border:2px solid #222;background-color:#2c2c2c}.canvasListComponent ul li{margin:5px}.canvasListComponent ul li:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.captureMenuActionsComponent{float:left;width:30%;height:100%;margin-top:7.5px}.captureMenuActionsComponent div{float:left}.captureMenuActionsComponent [commandName=onCaptureRequested]{border-radius:50%;background:#2c2c2c;border:2px solid red;width:21px;height:21px}.captureMenuActionsComponent [commandName=onCaptureRequested]:hover{background:red;cursor:pointer;transition:background .3s;-webkit-transition:background .3s;-moz-transition:background .3s}.captureMenuActionsComponent [commandName=onPlayRequested],.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPlayRequested]:before,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{content:"";position:absolute;display:inline-block;margin-top:6px;margin-left:4px;width:7px;height:7px;border-top:2px solid #f9f9f9;border-right:2px solid #f9f9f9;background-color:#f9f9f9;-moz-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg);z-index:-20}.captureMenuActionsComponent [commandName=onPlayRequested]:after,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:after{content:"";position:absolute;display:inline-block;width:8px;height:20px;background-color:#2c2c2c;z-index:-10}.captureMenuActionsComponent [commandName=onPlayRequested]:hover,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPauseRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPauseRequested]:before{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:12px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:after{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:7px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{background-color:#2c2c2c}.fpsCounterComponent{float:left;width:20%;vertical-align:center;line-height:40px;white-space:nowrap}',""]);const a=o},160(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.resultViewComponent{position:absolute;z-index:99999;border:1px solid #000;top:0;left:0;bottom:0;right:0;background-color:#222;opacity:1;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.resultViewComponent.active{visibility:visible;display:block}.resultViewComponent,.resultViewComponent:after,.resultViewComponent:before{box-sizing:content-box}.resultViewMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.resultViewMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.resultViewMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.resultViewMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.resultViewMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.resultViewMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.resultViewMenuComponent a.clearSearch{padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.resultViewMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}@media all and (max-width: 1024px){.resultViewMenuComponent .resultViewMenuOpen{display:block;visibility:visible}.resultViewMenuComponent li:not(.resultViewMenuSmall){display:none;visibility:hidden}.resultViewMenuComponent li{background:#2c2c2c}.resultViewMenuComponent li.searchContainer{background:rgb(69.5,69.5,69.5)}.resultViewMenuComponent{padding:0px;position:absolute;overflow-y:visible;top:0px;left:0px;right:0px;bottom:0px;z-index:999999;display:block}.resultViewMenuComponent a.active{background:#2c2c2c}}.resultViewMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:40px;position:relative;top:-1px;box-sizing:border-box}.resultViewMenuComponent input:focus{border:0;outline:0 none}.resultViewMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.resultViewMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.resultViewMenuComponent ::-webkit-input-placeholder{color:#ccc}.resultViewMenuComponent :-moz-placeholder{color:#ccc}.resultViewMenuComponent ::-moz-placeholder{color:#ccc}.resultViewMenuComponent :-ms-input-placeholder{color:#ccc}.resultViewContentComponent{position:absolute;top:40px;left:0;bottom:0;right:0}.informationColumnLeftComponent{position:absolute;top:0;left:0;bottom:0;right:50%;overflow:auto;overflow-x:hidden;overflow-y:visible}.informationColumnRightComponent{position:absolute;top:0;left:50%;bottom:0;right:0;overflow:auto;overflow-x:hidden;overflow-y:visible}.captureListComponent{position:absolute;top:40px;left:0;bottom:0;right:0;background:#222;z-index:9000;display:none;visibility:hidden;overflow-y:visible;overflow-x:hidden}.captureListComponent.active{display:block;visibility:visible}.captureListComponent .openCaptureFile{border:1px dashed #f9f9f9;display:block;margin:5px;padding:5px;text-align:center;font-style:italic}.captureListComponent .openCaptureFile span{line-height:100%;vertical-align:middle}.captureListComponent ul{margin:0px;padding:0px;list-style:none;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-start}.captureListComponent ul li{margin:5px;border:1px solid #606060}.captureListComponent ul li img{width:295px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;display:block}.captureListComponent ul li span{display:block;text-align:center;border:5px solid #222}.captureListComponent ul li span .captureListItemSave{color:#f9f9f9;font-size:16px;margin-left:10px;position:relative;padding:3px 8px 3px 32px}.captureListComponent ul li span .captureListItemSave:before,.captureListComponent ul li span .captureListItemSave:after{box-sizing:border-box;content:"";position:absolute}.captureListComponent ul li span .captureListItemSave:before{background:#d9d9d9;border-color:#f9f9f9;border-style:solid;border-width:7px 2px 1px;border-radius:1px;height:16px;left:8px;top:5px;width:16px}.captureListComponent ul li span .captureListItemSave:after{background:#f9f9f9;border-color:#d9d9d9;border-style:solid;border-width:1px 1px 1px 4px;height:5px;left:13px;top:5px;width:7px}.captureListComponent ul li:hover{cursor:pointer}.captureListComponent ul li.active span{background:#f0640d;border:5px solid #f0640d}.captureListComponent ul li.active span .captureListItemSave:before{background:#f0640d}.captureListComponent ul li.active span .captureListItemSave:after{border-color:#f0640d}.visualStateListComponent{position:absolute;top:0;left:0;bottom:0;padding:5px;right:80%;overflow-y:visible;overflow-x:hidden}.visualStateListComponent ul{margin:0px;padding:0px;list-style:none}.visualStateListComponent ul li{margin:20px 15px 0px 15px;border:1px solid #606060}.visualStateListComponent ul li img{display:block;padding:0px;box-sizing:border-box;max-height:600px;width:100%;margin:0 auto;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.visualStateListComponent ul li:hover{cursor:pointer}.visualStateListComponent ul li span{border:5px solid #222;background:#222;box-sizing:border-box;display:inline-block;width:100%;margin:0px;padding:5px;word-wrap:break-word}.visualStateListComponent ul li.active{border:2px solid #f0640d}.commandListComponent{position:absolute;top:0;left:20%;right:40%;bottom:0;color:hsl(0,0%,82.6470588235%)}.commandListComponent ul{margin:0px;padding:0px;list-style:none;overflow-y:visible;overflow-x:hidden;height:100%}.commandListComponent ul li{padding:8px}.commandListComponent ul li span{word-wrap:break-word;line-height:22px}.commandListComponent ul li:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.commandListComponent ul li:nth-child(even){background:#2c2c2c}.commandListComponent ul li:nth-child(odd){background:#222}.commandListComponent ul li .important{font-weight:800}.commandListComponent ul li .important.deprecated{color:red}.commandListComponent ul li .important.unused{color:#ff0}.commandListComponent ul li .important.disabled{color:gray}.commandListComponent ul li .important.redundant{color:orange}.commandListComponent ul li .important.valid{color:#adff2f}.commandListComponent ul li .marker{font-size:16px;font-weight:900;color:#adff2f}.commandListComponent ul li.active{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.commandListComponent ul li.drawCall{background:#5db0d7;color:#222}.commandListComponent ul li a{margin-left:5px;margin-right:5px;color:#5db0d7;background:#222;padding:5px;font-weight:900;display:inline-block}.commandDetailComponent{position:absolute;top:0;left:60%;right:0;bottom:0;overflow-y:visible;overflow-x:hidden}.jsonGroupComponent{display:block;margin:10px;padding:10px;padding-bottom:5px}.jsonGroupComponent .jsonGroupComponentTitle{display:block;font-size:16px;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:5px;margin-bottom:5px;text-transform:capitalize}.jsonGroupComponent ul{margin:0px;padding:0px;list-style:none}.jsonGroupComponent ul li:nth-child(even){background:#222}.jsonGroupComponent ul li:nth-child(odd){background:#222}.jsonItemComponentKey{color:#f0640d}.jsonItemComponentValue{white-space:pre-wrap}.jsonItemImageHolder{width:50%;margin:auto}.jsonItemImageHolder .jsonItemImage{margin:5px;display:block;border:1px solid #606060;width:100%}.jsonItemImageHolder .jsonItemImage img{width:100%;display:block;margin:auto;max-width:256px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.jsonItemImageHolder .jsonItemImage span{margin:0px;padding:5px;word-wrap:break-word;display:inline-block;width:100%;box-sizing:border-box}[commandName=onOpenSourceClicked]:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.jsonVisualStateItemComponent{text-align:center;padding:10px}.jsonVisualStateItemComponent img{background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;border:1px solid #606060;margin:5px;width:100%;max-width:512px;max-height:800px}.jsonVisualStateItemComponent span{display:block}.jsonContentComponent{position:absolute;top:0;left:0;right:0;bottom:0;padding:10px;overflow-y:visible;overflow-x:hidden}.jsonItemComponentValue{word-break:break-all;white-space:normal}.jsonSourceItemComponentOpen{font-weight:bold;color:#5db0d7;text-decoration:underline}.sourceCodeMenuComponentContainer{position:absolute;left:0;top:0;bottom:48px;right:40%}.sourceCodeMenuComponentFooter{position:absolute;left:0;right:40%;bottom:0;padding:0 15px}.sourceCodeFormatError{color:#f0640d;margin-left:15px}.sourceCodeDiagnosticsNotice{color:#5db0d7;margin-left:15px}.sourceCodeDiagnosticsNotice a{color:#c9c9c9;text-decoration:underline}.sourceCodeMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.sourceCodeMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.sourceCodeMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.sourceCodeMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.sourceCodeMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.sourceCodeMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.sourceCodeMenuComponent a.clearSearch{display:inline-block;padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.sourceCodeMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}.sourceCodeMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:100%;position:relative;top:-1px;box-sizing:border-box}.sourceCodeMenuComponent input:focus{border:0;outline:0 none}.sourceCodeMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.sourceCodeMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.sourceCodeMenuComponent ::-webkit-input-placeholder{color:#ccc}.sourceCodeMenuComponent :-moz-placeholder{color:#ccc}.sourceCodeMenuComponent ::-moz-placeholder{color:#ccc}.sourceCodeMenuComponent :-ms-input-placeholder{color:#ccc}.sourceCodeComponent{position:absolute;top:42px;left:0;bottom:48px;right:40%;background:#222;z-index:9000;overflow-x:visible;overflow:auto}.sourceCodeComponent .sourceCodeComponentTitle{font-size:16px;font-weight:800;line-height:50px;color:#f0640d;padding:1em;margin:.5em 0}.compareViewComponent{position:absolute;top:50px;left:0px;right:0px;bottom:0px;overflow:hidden;display:flex;flex-direction:column;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:13px}.compareViewComponent .compareViewEmpty,.compareViewComponent .compareViewEmptyRow,.compareViewComponent .compareDetailEmpty{padding:1em;color:#c9c9c9;text-align:center}.compareViewComponent .compareViewHeader{flex:0 0 auto;display:flex;align-items:center;gap:16px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid rgb(8.5,8.5,8.5);white-space:nowrap}.compareViewComponent .compareViewHeader .compareViewLabel{color:#5db0d7}.compareViewComponent .compareViewHeader .compareViewSummary span{margin-right:8px;font-weight:700}.compareViewComponent .compareViewHeader .compareViewSummary span.added{color:#adff2f}.compareViewComponent .compareViewHeader .compareViewSummary span.removed{color:#ff5a5a}.compareViewComponent .compareViewHeader .compareViewSummary span.changed{color:#f0640d}.compareViewComponent .compareViewHeader .compareViewSummary span.unchanged{color:#c9c9c9}.compareViewComponent .compareViewHeader .compareViewToggle{margin-left:auto;cursor:pointer;user-select:none}.compareViewComponent .compareViewHeader .compareViewToggle input{vertical-align:middle;margin-right:4px}.compareViewComponent .compareViewBody{flex:1 1 auto;display:flex;min-height:0}.compareViewComponent .compareViewLegend{flex:0 0 130px;box-sizing:border-box;padding:10px;background:#2c2c2c;border-right:2px solid #222}.compareViewComponent .compareViewLegend .compareLegendRow{display:flex;align-items:center;gap:8px;margin:8px 0}.compareViewComponent .compareViewLegend .compareLegendRow.unchanged{opacity:.5}.compareViewComponent .compareViewLegend .compareLegendChip{width:12px;height:12px;border-radius:2px;background:#c9c9c9}.compareViewComponent .compareViewLegend .added .compareLegendChip{background:#adff2f}.compareViewComponent .compareViewLegend .removed .compareLegendChip{background:#ff5a5a}.compareViewComponent .compareViewLegend .changed .compareLegendChip{background:#f0640d}.compareViewComponent .compareViewList{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;margin:0;padding:0;list-style:none}.compareViewComponent .compareViewList .compareRow{display:flex;align-items:baseline;padding:3px 10px;line-height:20px;cursor:pointer;white-space:nowrap}.compareViewComponent .compareViewList .compareRow:nth-child(odd){background:#222}.compareViewComponent .compareViewList .compareRow:nth-child(even){background:#2c2c2c}.compareViewComponent .compareViewList .compareRow .compareSign{flex:0 0 14px;font-weight:800}.compareViewComponent .compareViewList .compareRow .compareRowText{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.compareViewComponent .compareViewList .compareRow .compareCmdName{font-weight:700}.compareViewComponent .compareViewList .compareRow.added .compareSign,.compareViewComponent .compareViewList .compareRow.added .compareCmdName{color:#adff2f}.compareViewComponent .compareViewList .compareRow.removed .compareSign,.compareViewComponent .compareViewList .compareRow.removed .compareCmdName{color:#ff5a5a}.compareViewComponent .compareViewList .compareRow.changed .compareSign,.compareViewComponent .compareViewList .compareRow.changed .compareCmdName{color:#f0640d}.compareViewComponent .compareViewList .compareRow.unchanged{opacity:.55}.compareViewComponent .compareViewList .compareRow.selected{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.compareViewComponent .compareViewList .compareRow.selected .compareSign,.compareViewComponent .compareViewList .compareRow.selected .compareCmdName{color:#222}.compareViewComponent .compareViewList .compareViewEmptyRow{cursor:default}.compareViewComponent .compareViewDetail{flex:0 0 42%;box-sizing:border-box;overflow-y:auto;border-left:2px solid #222;padding:4px 12px 12px}.compareViewComponent .compareViewDetail .compareDetailGroup{margin:12px 0}.compareViewComponent .compareViewDetail .compareDetailGroup ul{margin:0;padding:0;list-style:none}.compareViewComponent .compareViewDetail .compareDetailGroup li{padding:2px 0;white-space:pre-wrap;word-break:break-word}.compareViewComponent .compareViewDetail .compareDetailTitle{display:block;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin-bottom:6px;text-transform:capitalize}.compareViewComponent .compareViewDetail .compareDetailKey{color:#f0640d}.compareViewComponent .compareViewDetail .compareCmdName{font-weight:700}.compareViewComponent .compareViewDetail .compareCmdName.added{color:#adff2f}.compareViewComponent .compareViewDetail .compareCmdName.removed{color:#ff5a5a}.compareViewComponent .compareViewDetail .compareCmdName.changed{color:#f0640d}.compareViewComponent .compareViewDetail .compareArrow{color:#c9c9c9}.compareViewComponent .compareViewDetail .compareOld{opacity:.7;text-decoration:line-through}.compareViewComponent .compareViewDetail .compareNew{color:#f9f9f9}.compareViewComponent .compareViewDetail .compareCommandLink{color:#5db0d7;text-decoration:none;cursor:pointer;border-bottom:1px dotted currentColor}.compareViewComponent .compareViewDetail .compareCommandLink:hover{color:#f0640d}.compareViewComponent .compareViewDetail .compareTextureItem{padding-bottom:6px}.compareViewComponent .compareViewDetail .compareImageDiff{display:flex;align-items:center;margin-top:4px}.compareViewComponent .compareViewDetail .compareThumb{width:48px;height:48px;object-fit:contain;margin:2px 6px 2px 0;border:1px solid rgb(8.5,8.5,8.5);background:#222;image-rendering:pixelated}.jsonItemImageClickable{cursor:zoom-in}.textureViewerOverlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:100000;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.6);font-family:Consolas,monaco,monospace;font-size:13px;color:#f9f9f9}.textureViewerOverlay .textureViewerModal{width:min(900px,92vw);height:min(640px,90vh);display:flex;flex-direction:column;overflow:hidden;background:#222;border:1px solid #000;box-shadow:0 10px 40px rgba(0,0,0,.6)}.textureViewerOverlay .textureViewerHeader{flex:0 0 auto;display:flex;align-items:center;gap:12px;height:40px;padding:0 12px;background:#2c2c2c;border-bottom:2px solid #222}.textureViewerOverlay .textureViewerHeader .textureViewerTitle{color:#5db0d7}.textureViewerOverlay .textureViewerHeader .textureViewerMeta{color:#c9c9c9;font-size:12px}.textureViewerOverlay .textureViewerHeader .textureViewerClose{margin-left:auto;width:26px;height:26px;display:flex;align-items:center;justify-content:center;border-radius:3px;color:#c9c9c9;cursor:pointer}.textureViewerOverlay .textureViewerHeader .textureViewerClose:hover{color:#f9f9f9;background:hsla(0,0%,100%,.08)}.textureViewerOverlay .textureViewerToolbar{flex:0 0 auto;display:flex;align-items:center;flex-wrap:wrap;gap:14px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid #000;font-size:12px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup{display:flex;align-items:center;gap:6px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup .lbl{color:#c9c9c9;margin-right:2px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroupEnd{margin-left:auto}.textureViewerOverlay .textureViewerToolbar .channel{width:26px;height:24px;display:flex;align-items:center;justify-content:center;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#777;font-weight:800;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .channel.on.r{background:#e14b4b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.g{background:#4bd44b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.b{background:#4b8fe1;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.a{background:#dedede;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .tvBtn{height:24px;padding:0 10px;display:inline-flex;align-items:center;gap:6px;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#f9f9f9;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .tvBtn:hover{background:#333}.textureViewerOverlay .textureViewerToolbar .tvBtn.active{background:#f0640d;color:#1a1a1a;border-color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary{border-color:#f0640d;color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary:hover{background:#f0640d;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .seg{display:flex}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn{border-radius:0;border-right-width:0}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:first-child{border-radius:3px 0 0 3px}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:last-child{border-radius:0 3px 3px 0;border-right-width:1px}.textureViewerOverlay .textureViewerToolbar .zoomVal{min-width:44px;text-align:center;color:#c9c9c9}.textureViewerOverlay .textureViewerBody{flex:1 1 auto;display:flex;min-height:0}.textureViewerOverlay .textureViewerViewport{flex:1 1 auto;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#141414}.textureViewerOverlay .textureViewerViewport.checker{background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}.textureViewerOverlay .textureViewerCanvas{image-rendering:pixelated;cursor:crosshair;box-shadow:0 0 0 1px #000}.textureViewerOverlay .textureViewerLoupe{position:absolute;display:none;width:120px;height:120px;pointer-events:none;image-rendering:pixelated;border:1px solid #000;box-shadow:0 2px 8px rgba(0,0,0,.6);background:#000;left:16px;top:16px}.textureViewerOverlay .textureViewerRail{flex:0 0 210px;box-sizing:border-box;padding:12px;overflow-y:auto;background:#2c2c2c;border-left:2px solid #222}.textureViewerOverlay .textureViewerRail .railTitle{color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin:0 0 8px;text-transform:capitalize}.textureViewerOverlay .textureViewerRail .kv{display:flex;justify-content:space-between;margin:4px 0}.textureViewerOverlay .textureViewerRail .kv .k{color:#f0640d}.textureViewerOverlay .textureViewerRail .kv .v{color:#f9f9f9}.textureViewerOverlay .textureViewerRail .swatch{width:100%;height:34px;margin:8px 0;border:1px solid #000;background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0}.textureViewerOverlay .textureViewerRail .swatch .swatchInner{width:100%;height:100%}.textureViewerOverlay .textureViewerRail .hint{color:#c9c9c9;margin-top:10px;line-height:1.5}',""]);const a=o},636(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,".ace-monokai {\n color: #f9f9f9;\n font-size: 14px;\n}\n\n.ace-monokai .ace_entity.ace_name.ace_tag,\n.ace-monokai .ace_keyword,\n.ace-monokai .ace_meta.ace_tag,\n.ace-monokai .ace_storage {\n color: #F0640D\n}\n\n.ace-monokai .ace_constant.ace_character,\n.ace-monokai .ace_constant.ace_other {\n color: #5db0d7;\n}\n\n.ace-monokai .ace_marker-layer .ace_selection {\n background: #a6e22e\n}\n\n.ace-monokai .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #a6e22e;\n}\n\n.ace-monokai .ace_marker-layer .ace_active-line {\n background: #2c2c2c\n}\n.ace-monokai .ace_gutter-active-line {\n background-color: #2c2c2c\n}\n.ace-monokai .ace_marker-layer .ace_selected-word {\n border: 1px solid #a6e22e\n}\n\n.ace-monokai .ace_constant.ace_language {\n color: #e6db74\n}\n.ace-monokai .ace_constant.ace_numeric {\n color: #ae81ff\n}\n\n.ace-monokai .ace_gutter {\n background: #222;\n color: #8F908A;\n}",""]);const a=o},314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var a=0;a0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},601(e){"use strict";e.exports=function(e){return e[1]}},832(e,t,n){e=n.nmd(e),function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,n,r){"string"==typeof e?(2==arguments.length&&(r=n),t.modules[e]||(t.payloads[e]=r,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var n,r,i=function(e,t,n){if("string"==typeof t){var r=a(e,t);if(null!=r)return n&&n(),r}else if("[object Array]"===Object.prototype.toString.call(t)){for(var i=[],o=0,l=t.length;o1&&function(e,t,n){if(Array.prototype.indexOf)return e.indexOf("",n);for(var r=0;r-1&&(n=RegExp(this.source,i.replace.call(((r=this).global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),"g","")),i.replace.call(e.slice(a.index),n,function(){for(var e=1;ea.index&&this.lastIndex--}return a},o||(RegExp.prototype.test=function(e){var t=i.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError("Function.prototype.bind called on incompatible "+t);var n=d.call(arguments,1),i=function(){if(this instanceof i){var r=t.apply(this,n.concat(d.call(arguments)));return Object(r)===r?r:this}return t.apply(e,n.concat(d.call(arguments)))};return t.prototype&&(r.prototype=t.prototype,i.prototype=new r,r.prototype=null),i});var i,s,o,a,l,u=Function.prototype.call,c=Array.prototype,h=Object.prototype,d=c.slice,f=u.bind(h.toString),p=u.bind(h.hasOwnProperty);if((l=p(h,"__defineGetter__"))&&(i=u.bind(h.__defineGetter__),s=u.bind(h.__defineSetter__),o=u.bind(h.__lookupGetter__),a=u.bind(h.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,n=[];if(n.splice.apply(n,e(20)),n.splice.apply(n,e(26)),t=n.length,n.splice(5,0,"XXX"),n.length,t+1==n.length)return!0}()){var m=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?m.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(d.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):null==e?e=0:e<0&&(e=Math.max(n+e,0)),e+ta)for(h=u;h--;)this[l+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else for(this.length=c+s,h=0;h>>0;if("[object Function]"!=f(e))throw new TypeError;for(;++i>>0,i=Array(r),s=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var o=0;o>>0,s=[],o=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var a=0;a>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,s=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s++];break}if(++s>=r)throw new TypeError("reduce of empty array with no initial value")}for(;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,s=r-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s--];break}if(--s<0)throw new TypeError("reduceRight of empty array with no initial value")}do{s in this&&(i=e.call(void 0,i,n[s],s,t))}while(s--);return i}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=C&&"[object String]"==f(this)?this.split(""):L(this),n=t.length>>>0;if(!n)return-1;var r=0;for(arguments.length>1&&(r=N(arguments[1])),r=r>=0?r:Math.max(0,n+r);r>>0;if(!n)return-1;var r=n-1;for(arguments.length>1&&(r=Math.min(r,N(arguments[1]))),r=r>=0?r:n-Math.abs(r);r>=0;r--)if(r in t&&e===t[r])return r;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:h)}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(p(e,t)){var n;if(n={enumerable:!0,configurable:!0},l){var r=e.__proto__;e.__proto__=h;var i=o(e,t),s=a(e,t);if(e.__proto__=r,i||s)return i&&(n.get=i),s&&(n.set=s),n}return n.value=e[t],n}}),Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),Object.create||(g=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var n;if(null===e)n=g();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var r=function(){};r.prototype=e,(n=new r).__proto__=e}return void 0!==t&&Object.defineProperties(n,t),n}),Object.defineProperty){var S=D({}),A="undefined"==typeof document||D(document.createElement("div"));if(!S||!A)var _=Object.defineProperty}Object.defineProperty&&!_||(Object.defineProperty=function(e,t,n){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof n&&"function"!=typeof n||null===n)throw new TypeError("Property description must be an object: "+n);if(_)try{return _.call(Object,e,t,n)}catch(e){}if(p(n,"value"))if(l&&(o(e,t)||a(e,t))){var r=e.__proto__;e.__proto__=h,delete e[t],e[t]=n.value,e.__proto__=r}else e[t]=n.value;else{if(!l)throw new TypeError("getters & setters can not be defined on this javascript engine");p(n,"get")&&i(e,t,n.get),p(n,"set")&&s(e,t,n.set)}return e}),Object.defineProperties||(Object.defineProperties=function(e,t){for(var n in t)p(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=(E=Object.freeze,function(e){return"function"==typeof e?e:E(e)})}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";p(e,t);)t+="?";e[t]=!0;var n=p(e,t);return delete e[t],n}),!Object.keys){var y=!0,b=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],T=b.length;for(var R in{toString:null})y=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)p(e,n)&&t.push(n);if(y)for(var r=0,i=T;r0||-1)*Math.floor(Math.abs(e))),e}var L=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,n){"use strict";e("./regexp"),e("./es5-shim"),"undefined"==typeof Element||Element.prototype.remove||Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,n){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var r="object"==typeof navigator?navigator:{},i=(/mac|win|linux/i.exec(r.platform)||["other"])[0].toLowerCase(),s=r.userAgent||"",o=r.appName||"";t.isWin="win"==i,t.isMac="mac"==i,t.isLinux="linux"==i,t.isIE="Microsoft Internet Explorer"==o||o.indexOf("MSAppHost")>=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,t.isAIR=s.indexOf("AdobeAIR")>=0,t.isAndroid=s.indexOf("Android")>=0,t.isChromeOS=s.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./useragent");if(t.buildDom=function e(t,n,r){if("string"==typeof t&&t){var i=document.createTextNode(t);return n&&n.appendChild(i),i}if(!Array.isArray(t))return t;if("string"!=typeof t[0]||!t[0]){for(var s=[],o=0;o=1.5,"undefined"!=typeof document){var i=document.createElement("div");t.HI_DPI&&void 0!==i.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),r.isEdge||void 0===i.style.animationName||(t.HAS_CSS_ANIMATION=!0),i=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./oop"),i=function(){var e,t,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in n.FUNCTION_KEYS)e=n.FUNCTION_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);for(t in n.PRINTABLE_KEYS)e=n.PRINTABLE_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);return r.mixin(n,n.MODIFIER_KEYS),r.mixin(n,n.PRINTABLE_KEYS),r.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)n.KEY_MODS[t]=e.filter(function(e){return t&n.KEY_MODS[e]}).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();r.mixin(t,i),t.keyCodeToString=function(e){var t=i[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./keys"),i=e("./useragent"),s=null,o=0;t.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var r=function(){n.call(e,window.event)};n._wrapper=r,e.attachEvent("on"+t,r)}},t.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,n,r){function i(e){n&&n(e),r&&r(e),t.removeListener(document,"mousemove",n,!0),t.removeListener(document,"mouseup",i,!0),t.removeListener(document,"dragstart",i,!0)}return t.addListener(document,"mousemove",n,!0),t.addListener(document,"mouseup",i,!0),t.addListener(document,"dragstart",i,!0),i},t.addMouseWheelListener=function(e,n){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),n(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}n(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),n(e)})},t.addMultiMouseDownListener=function(e,n,r,s){var o,a,l,u=0,c={2:"dblclick",3:"tripleclick",4:"quadclick"};function h(e){if(0!==t.getButton(e)?u=0:e.detail>1?++u>4&&(u=1):u=1,i.isIE){var h=Math.abs(e.clientX-o)>5||Math.abs(e.clientY-a)>5;l&&!h||(u=1),l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),1==u&&(o=e.clientX,a=e.clientY)}if(e._clicks=u,r[s]("mousedown",e),u>4)u=0;else if(u>1)return r[s](c[u],e)}function d(e){u=2,l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),r[s]("mousedown",e),r[s](c[u],e)}Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",h),i.isOldIE&&t.addListener(e,"dblclick",d)})};var a=i.isMac&&i.isOpera&&!("KeyboardEvent"in window)?function(e){return(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)}:function(e){return(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};function l(e,t,n){var l=a(t);if(!i.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(l|=8),s.altGr){if(!(3&~l))return;s.altGr=0}if(18===n||17===n){var u="location"in t?t.location:t.keyLocation;17===n&&1===u?1==s[n]&&(o=t.timeStamp):18===n&&3===l&&2===u&&t.timeStamp-o<50&&(s.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),l||13!==n||3!==(u="location"in t?t.location:t.keyLocation)||(e(t,l,-n),!t.defaultPrevented)){if(i.isChromeOS&&8&l){if(e(t,l,n),t.defaultPrevented)return;l&=-9}return!!(l||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&e(t,l,n)}}function u(){s=Object.create(null)}if(t.getModifierString=function(e){return r.KEY_MODS[a(e)]},t.addCommandKeyListener=function(e,n){var r=t.addListener;if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var o=null;r(e,"keydown",function(e){o=e.keyCode}),r(e,"keypress",function(e){return l(n,e,o)})}else{var a=null;r(e,"keydown",function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=l(n,e,e.keyCode);return a=e.defaultPrevented,t}),r(e,"keypress",function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),r(e,"keyup",function(e){s[e.keyCode]=null}),s||(u(),r(window,"focus",u))}},"object"==typeof window&&window.postMessage&&!i.isOldIE){var c=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+c++,i=function(s){s.data==r&&(t.stopPropagation(s),t.removeListener(n,"message",i),e())};t.addListener(n,"message",i),n.postMessage(r,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function n(){t.$idleBlocked?setTimeout(n,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,n=e.end,r=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(r.row,r.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(r.row,r.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else this.end.rowt)var i={row:t+1,column:0};else this.start.row0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;nDate.now()-50)||(r=!1)},cancel:function(){r=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("../lib/dom"),o=e("../lib/lang"),a=e("../clipboard"),l=i.isChrome<18,u=i.isIE,c=i.isChrome>63,h=400,d=e("../lib/keys"),f=d.KEY_MODS,p=i.isIOS,m=p?/\s/:/\n/;t.TextInput=function(e,t){var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild);var g=!1,E=!1,v=!1,C=!1,D="";i.isMobile||(n.style.fontSize="1px");var S=!1,A=!1,_="",y=0,b=0,T=0;try{var R=document.activeElement===n}catch(e){}r.addListener(n,"blur",function(e){A||(t.onBlur(e),R=!1)}),r.addListener(n,"focus",function(e){if(!A){if(R=!0,i.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),i.isEdge?setTimeout(x):x()}}),this.$focusScroll=!1,this.focus=function(){if(D||c||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var t=0!=n.getBoundingClientRect().top}catch(e){return}var r=[];if(t)for(var i=n.parentElement;i&&1==i.nodeType;)r.push(i),i.setAttribute("ace_nocontext",!0),i=!i.parentElement&&i.getRootNode?i.getRootNode().host:i.parentElement;n.focus({preventScroll:!0}),t&&r.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="","0px"==n.style.top&&(n.style.top=e)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return R},t.on("beforeEndOperation",function(){t.curOp&&"insertstring"==t.curOp.command.name||(v&&(_=n.value="",U()),x())});var x=p?function(e){if(R&&(!g||e)&&!C){e||(e="");var r="\n ab"+e+"cde fg\n";r!=n.value&&(n.value=_=r);var i=4+(e.length||(t.selection.isEmpty()?0:1));4==y&&b==i||n.setSelectionRange(4,i),y=4,b=i}}:function(){if(!v&&!C&&(R||F)){v=!0;var e=t.selection,r=e.getRange(),i=e.cursor.row,s=r.start.column,o=r.end.column,a=t.session.getLine(i);if(r.start.row!=i){var l=t.session.getLine(i-1);s=r.start.rowi+1?u.length:o,o+=a.length+1,a=a+"\n"+u}a.length>h&&(s0&&_[h]==e[h];)h++,o--;for(l=l.slice(h),h=1;a>0&&_.length-h>y-1&&_[_.length-h]==e[e.length-h];)h++,a--;u-=h-1,c-=h-1;var d=l.length-h+1;return d<0&&(o=-d,d=0),l=l.slice(0,d),r||l||u||o||a||c?(C=!0,l&&!o&&!a&&!u&&!c||S?t.onTextInput(l):t.onTextInput(l,{extendLeft:o,extendRight:a,restoreStart:u,restoreEnd:c}),C=!1,_=e,y=i,b=s,T=c,l):""},L=function(e){if(v)return B();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var r=n.value,i=N(r,!0);(r.length>500||m.test(i))&&x()},O=function(e,t,n){var r=e.clipboardData||window.clipboardData;if(r&&!l){var i=u||n?"Text":"text/plain";try{return t?!1!==r.setData(i,t):r.getData(i)}catch(e){if(!n)return O(e,t,!0)}}},I=function(e,i){var s=t.getCopyText();if(!s)return r.preventDefault(e);O(e,s)?(p&&(x(s),g=s,setTimeout(function(){g=!1},10)),i?t.onCut():t.onCopy(),r.preventDefault(e)):(g=!0,n.value=s,n.select(),setTimeout(function(){g=!1,x(),i?t.onCut():t.onCopy()}))},k=function(e){I(e,!0)},M=function(e){I(e,!1)},P=function(e){var s=O(e);a.pasteCancelled()||("string"==typeof s?(s&&t.onPaste(s,e),i.isIE&&setTimeout(x),r.preventDefault(e)):(n.value="",E=!0))};r.addCommandKeyListener(n,t.onCommandKey.bind(t)),r.addListener(n,"select",function(e){v||(g?g=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=_.length&&e.value===_&&_&&e.selectionEnd!==b}(n)&&(t.selectAll(),x()))}),r.addListener(n,"input",L),r.addListener(n,"cut",k),r.addListener(n,"copy",M),r.addListener(n,"paste",P),"oncut"in n&&"oncopy"in n&&"onpaste"in n||r.addListener(e,"keydown",function(e){if((!i.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:M(e);break;case 86:P(e);break;case 88:k(e)}});var B=function(){if(v&&t.onCompositionUpdate&&!t.$readOnly){if(S)return $();if(v.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;N(e),v.markerRange&&(v.context&&(v.markerRange.start.column=v.selectionStart=v.context.compositionStartOffset),v.markerRange.end.column=v.markerRange.start.column+b-v.selectionStart+T)}}},U=function(e){t.onCompositionEnd&&!t.$readOnly&&(v=!1,t.onCompositionEnd(),t.off("mousedown",$),e&&L())};function $(){A=!0,n.blur(),n.focus(),A=!1}var G,V=o.delayedCall(B,50).schedule.bind(null,null);function W(){clearTimeout(G),G=setTimeout(function(){D&&(n.style.cssText=D,D=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()},0)}r.addListener(n,"compositionstart",function(e){if(!v&&t.onCompositionStart&&!t.$readOnly&&(v={},!S)){setTimeout(B,0),t.on("mousedown",$);var r=t.getSelectionRange();r.end.row=r.start.row,r.end.column=r.start.column,v.markerRange=r,v.selectionStart=y,t.onCompositionStart(v),v.useTextareaForIME?(n.value="",_="",y=0,b=0):(n.msGetInputContext&&(v.context=n.msGetInputContext()),n.getInputContext&&(v.context=n.getInputContext()))}}),r.addListener(n,"compositionupdate",B),r.addListener(n,"keyup",function(e){27==e.keyCode&&n.value.lengthb&&"\n"==_[s]?o=d.end:rb&&_.slice(0,s).split("\n").length>2?o=d.down:s>b&&" "==_[s-1]?(o=d.right,a=f.option):(s>b||s==b&&b!=y&&r==s)&&(o=d.right),r!==s&&(a|=f.shift),o){if(!t.onCommandKey({},a,o)&&t.commands){o=d.keyCodeToString(o);var l=t.commands.findKeyCommand(a,o);l&&t.execCommand(l)}y=r,b=s,x("")}}};document.addEventListener("selectionchange",s),t.on("destroy",function(){document.removeEventListener("selectionchange",s)})}(0,t,n)}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/useragent");function i(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function s(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)n=2*t.row-e.start.row-e.end.row;else n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,s=e.getButton();return 0!==s?((i.getSelectionRange().isEmpty()||1==s)&&i.selection.moveToPosition(n),void(2==s&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||i.isFocused()||(i.focus(),!this.$focusTimeout||this.$clickSelection||i.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(-1==r)e=this.$clickSelection.end;else if(1==r)e=this.$clickSelection.start;else{var i=s(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(i.start),a=this.$clickSelection.comparePoint(i.end);if(-1==o&&a<=0)t=this.$clickSelection.end,i.end.row==r.row&&i.end.column==r.column||(r=i.start);else if(1==a&&o>=0)t=this.$clickSelection.start,i.start.row==r.row&&i.start.column==r.column||(r=i.end);else if(-1==o&&1==a)r=i.end,t=i.start;else{var l=s(this.$clickSelection,r);r=l.cursor,t=l.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e,t,n,r,i=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,n=this.x,r=this.y,Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))),s=Date.now();(i>0||s-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session.getBracketRange(t);r?(r.isEmpty()&&(r.start.column--,r.end.column++),this.setState("select")):(r=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=r,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,s=i?e.wheelX/i:n.vx,o=i?e.wheelY/i:n.vy;i<550&&(s=(s+n.vx)/2,o=(o+n.vy)/2);var a=Math.abs(s/o),l=!1;return a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?n.allowed=r:r-n.allowed<550&&(Math.abs(s)<=1.5*Math.abs(n.vx)&&Math.abs(o)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=r):n.allowed=0),n.t=r,n.vx=s,n.vy=o,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(i.prototype),t.DefaultHandlers=i}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}(function(){this.$init=function(){return this.$element=r.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){r.addCssClass(this.getElement(),e)},this.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(i.prototype),t.Tooltip=i}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/event"),o=e("../tooltip").Tooltip;function a(e){o.call(this,e)}i.inherits(a,o),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),s=this.getHeight();(e+=15)+i>n&&(e-=e+i-n),(t+=15)+s>r&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=function(e){var t,n,i,o=e.editor,l=o.renderer.$gutterLayer,u=new a(o.container);function c(){t&&(t=clearTimeout(t)),i&&(u.hide(),i=null,o._signal("hideGutterTooltip",u),o.removeEventListener("mousewheel",c))}function h(e){u.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",function(t){if(o.isFocused()&&0==t.getButton()&&"foldWidgets"!=l.getRegion(t)){var n=t.getDocumentPosition().row,r=o.session.selection;if(t.getShiftKey())r.selectTo(n,0);else{if(2==t.domEvent.detail)return o.selectAll(),t.preventDefault();e.$clickSelection=o.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}),e.editor.setDefaultHandler("guttermousemove",function(s){var a=s.domEvent.target||s.domEvent.srcElement;if(r.hasCssClass(a,"ace_fold-widget"))return c();i&&e.$tooltipFollowsMouse&&h(s),n=s,t||(t=setTimeout(function(){t=null,n&&!e.isMousePressed?function(){var t=n.getDocumentPosition().row,r=l.$annotations[t];if(!r)return c();if(t==o.session.getLength()){var s=o.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(s>o.session.documentToScreenRow(a.row,a.column))return c()}if(i!=r)if(i=r.text.join("
"),u.setHtml(i),u.show(),o._signal("showGutterTooltip",u),o.on("mousewheel",c),e.$tooltipFollowsMouse)h(n);else{var d=n.domEvent.target.getBoundingClientRect(),f=u.getElement().style;f.left=d.right+"px",f.top=d.bottom+"px"}}():c()},50))}),s.addListener(o.renderer.$gutter,"mouseout",function(e){n=null,i&&!t&&(t=setTimeout(function(){t=null,c()},50))}),o.on("changeSession",c)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent");function o(e){var t=e.editor,n=r.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),t.addEventListener("mousedown",this.onMouseDown.bind(e));var o,l,u,c,h,d,f,p,m,g,E,v=t.container,C=0;function D(){var e=d;(function(e,n){var r=Date.now(),i=!n||e.row!=n.row,s=!n||e.column!=n.column;!g||i||s?(t.moveCursorToPosition(e),g=r,E={x:l,y:u}):a(E.x,E.y,l,u)>5?g=null:r-g>=200&&(t.renderer.scrollCursorIntoView(),g=null)})(d=t.renderer.screenToTextCoordinates(l,u),e),function(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,s=t.renderer.layerConfig.characterWidth,o=t.renderer.scroller.getBoundingClientRect(),a={x:{left:l-o.left,right:o.right-l},y:{top:u-o.top,bottom:o.bottom-u}},c=Math.min(a.x.left,a.x.right),h=Math.min(a.y.top,a.y.bottom),d={row:e.row,column:e.column};c/s<=2&&(d.column+=a.x.left=200&&t.renderer.scrollCursorIntoView(d):m=r:m=null}(d,e)}function S(){h=t.selection.toOrientedRange(),o=t.session.addMarker(h,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(c),D(),c=setInterval(D,20),C=0,i.addListener(document,"mousemove",y)}function A(){clearInterval(c),t.session.removeMarker(o),o=null,t.selection.fromOrientedRange(h),t.isFocused()&&!p&&t.$resetCursorStyle(),h=null,d=null,C=0,m=null,g=null,i.removeListener(document,"mousemove",y)}this.onDragStart=function(e){if(this.cancelDrag||!v.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}h=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?"copy":"copyMove",s.isOpera&&(t.container.appendChild(n),n.scrollTop=0),i.setDragImage&&i.setDragImage(n,0,0),s.isOpera&&t.container.removeChild(n),i.clearData(),i.setData("Text",t.session.getTextRange()),p=!0,this.setState("drag")},this.onDragEnd=function(e){if(v.draggable=!1,p=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;f||"move"!=n||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||S(),C++,e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||(S(),C++),null!==_&&(_=null),e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragLeave=function(e){if(--C<=0&&o)return A(),f=null,i.preventDefault(e)},this.onDrop=function(e){if(d){var n=e.dataTransfer;if(p)switch(f){case"move":h=h.contains(d.row,d.column)?{start:d,end:d}:t.moveText(h,d);break;case"copy":h=t.moveText(h,d,!0)}else{var r=n.getData("Text");h={start:d,end:t.session.insert(d,r)},t.focus(),f=null}return A(),i.preventDefault(e)}},i.addListener(v,"dragstart",this.onDragStart.bind(e)),i.addListener(v,"dragend",this.onDragEnd.bind(e)),i.addListener(v,"dragenter",this.onDragEnter.bind(e)),i.addListener(v,"dragover",this.onDragOver.bind(e)),i.addListener(v,"dragleave",this.onDragLeave.bind(e)),i.addListener(v,"drop",this.onDrop.bind(e));var _=null;function y(){null==_&&(_=setTimeout(function(){null!=_&&o&&A()},20))}function b(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function T(e){var t=["copy","copymove","all","uninitialized"],n=s.isMac?e.altKey:e.ctrlKey,r="uninitialized";try{r=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var i="none";return n&&t.indexOf(r)>=0?i="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(r)>=0?i="move":t.indexOf(r)>=0&&(i="copy"),i}}function a(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=s.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;s.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton();if(1===(e.domEvent.detail||1)&&0===r&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var i=e.domEvent.target||e.domEvent.srcElement;"unselectable"in i&&(i.unselectable="on"),t.getDragDelay()?(s.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(o.prototype),t.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./mouse_event").MouseEvent,i=e("../lib/dom");t.addTouchListeners=function(e,t){var n,s,o,a,l,u,c,h,d,f="scroll",p=0,m=0,g=0,E=0;function v(){var e,n,r;d||(e=window.navigator&&window.navigator.clipboard,n=!1,r=function(r){var s,o,a=r.target.getAttribute("action");if("more"==a||!n)return n=!n,s=t.getCopyText(),o=t.session.getUndoManager().hasUndo(),void d.replaceChild(i.buildDom(n?["span",!s&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],s&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],s&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],o&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),d.firstChild);"paste"==a?e.readText().then(function(e){t.execCommand(a,e)}):a&&("cut"!=a&&"copy"!=a||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(a)),d.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&t.focus()},d=i.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){f="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),r(e)},onclick:r},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container));var s=t.selection.cursor,o=t.renderer.textToScreenCoordinates(s.row,s.column),a=t.container.getBoundingClientRect();d.style.top=o.pageY-a.top-3+"px",d.style.right="10px",d.style.display="",d.firstChild.style.display="none",t.on("input",C)}function C(e){d&&(d.style.display="none"),t.off("input",C)}function D(){l=null,clearTimeout(l);var e=t.selection.getRange(),n=e.contains(c.row,c.column);!e.isEmpty()&&n||(t.selection.moveToPosition(c),t.selection.selectWord()),f="wait",v()}e.addEventListener("contextmenu",function(e){h&&t.textInput.getElement().focus()}),e.addEventListener("touchstart",function(e){var i=e.touches;if(l||i.length>1)return clearTimeout(l),l=null,o=-1,void(f="zoom");h=t.$mouseHandler.isMousePressed=!0;var u=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,v=e.timeStamp;a=v;var C=i[0],S=C.clientX,A=C.clientY;Math.abs(n-S)+Math.abs(s-A)>u&&(o=-1),n=e.clientX=S,s=e.clientY=A,g=E=0;var _=new r(e,t);if(c=_.getDocumentPosition(),v-o<500&&1==i.length&&!p)m++,e.preventDefault(),e.button=0,function(){l=null,clearTimeout(l),t.selection.moveToPosition(c);var e=m>=2?t.selection.getLineRange(c.row):t.session.getBracketRange(c);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),f="wait"}();else{m=0;var y=t.selection.cursor,b=t.selection.isEmpty()?y:t.selection.anchor,T=t.renderer.$cursorLayer.getPixelPosition(y,!0),R=t.renderer.$cursorLayer.getPixelPosition(b,!0),x=t.renderer.scroller.getBoundingClientRect(),w=function(e,t){return(e/=d)*e+(t=t/u-.75)*t};if(e.clientXN?"cursor":"anchor"),f=N<3.5?"anchor":F<3.5?"cursor":"scroll",l=setTimeout(D,450)}o=v}),e.addEventListener("touchend",function(e){h=t.$mouseHandler.isMousePressed=!1,u&&clearInterval(u),"zoom"==f?(f="",p=0):l?(t.selection.moveToPosition(c),p=0,v()):"scroll"==f?(p+=60,u=setInterval(function(){p--<=0&&(clearInterval(u),u=null),Math.abs(g)<.01&&(g=0),Math.abs(E)<.01&&(E=0),p<20&&(g*=.9),p<20&&(E*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*g,10*E),e==t.session.getScrollTop()&&(p=0)},10),e.preventDefault(),C()):v(),clearTimeout(l),l=null}),e.addEventListener("touchmove",function(e){l&&(clearTimeout(l),l=null);var i=e.touches;if(!(i.length>1||"zoom"==f)){var o=i[0],u=n-o.clientX,c=s-o.clientY;if("wait"==f){if(!(u*u+c*c>4))return e.preventDefault();f="cursor"}n=o.clientX,s=o.clientY,e.clientX=o.clientX,e.clientY=o.clientY;var h=e.timeStamp,d=h-a;if(a=h,"scroll"==f){var p=new r(e,t);p.speed=1,p.wheelX=u,p.wheelY=c,10*Math.abs(u)1&&(i=n[n.length-2]);var o=l[t+"Path"];return null==o?o=l.basePath:"/"==r&&(t=r=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+t+r+i+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,r){var i,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{i=e(n)}catch(e){}if(i&&!t.$loading[n])return r&&r(i);if(t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r),!(t.$loading[n].length>1)){var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var r=t.$loading[n];t.$loading[n]=null,r.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,o),a),u()}};var u=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),u=function(){})};function c(i){if(a&&a.document){l.packaged=i||e.packaged||r.packaged||a.define&&n.amdD.packaged;for(var s={},o="",u=document.currentScript||document._currentScript,c=(u&&u.ownerDocument||document).getElementsByTagName("script"),d=0;d=e){for(s=h+1;s=e;)s++;for(a=h,l=s-1;a=t.length||2!=(l=n[i-1])&&3!=l||2!=(u=t[i+1])&&3!=u?4:(s&&(u=3),u==l?u:4);case 10:return 2==(l=i>0?n[i-1]:5)&&i+10&&2==n[i-1])return 2;if(s)return 4;for(f=i+1,d=t.length;f=1425&&m<=2303||64286==m;if(l=t[f],g&&(1==l||7==l))return 1}return i<1||5==(l=t[i-1])?4:n[i-1];case 5:return s=!1,o=!0,r;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:s=!1;case h:return 4}}function g(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?t>191?0:d[t]:5==n?/[\u0591-\u05f4]/.test(e)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?12:/[\u0660-\u0669\u066b-\u066c]/.test(e)?3:1642==t?c:/[\u06f0-\u06f9]/.test(e)?2:7:32==n&&t<=8287?f[255&t]:254==n&&t>=65136?7:4}t.L=0,t.R=1,t.EN=2,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,n,c){if(e.length<2)return{};var d=e.split(""),f=new Array(d.length),E=new Array(d.length),v=[];r=c?1:0,function(e,t,n,c){var h=r?u:l,d=null,f=null,p=null,E=0,v=null,C=-1,D=null,S=null,A=[];if(!c)for(D=0,c=[];D0)if(16==v){for(D=C;D-1){for(D=C;D=0&&8==c[_];_--)t[_]=r}}(d,v,d.length,n);for(var C=0;C7&&n[C]<13||4===n[C]||n[C]===h)?v[C]=t.ON_R:C>0&&"ل"===d[C-1]&&/\u0622|\u0623|\u0625|\u0627/.test(d[C])&&(v[C-1]=v[C]=t.R_H,C++);for(d[d.length-1]===t.DOT&&(v[d.length-1]=t.B),"‫"===d[0]&&(v[0]=t.RLE),C=0;C=0&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,r=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===r;)r=n,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[e];s&&(void 0===t&&(t=this.getSplitIndex()),t>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&s[i]%2!=0&&i++;for(var a=0;at&&s[i]%2==0&&(o+=this.charWidths[s[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(e,t){var n,r=this.bidiMap,i=r.bidiLevels,s=[],o=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,u=!1,c=!1,h=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,f=0;f=a&&dn+s/2;){if(n+=s,r===i.length-1){s=0;break}s=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!=0&&i[r]%2==0?(e0&&i[r-1]%2==0&&i[r]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&0===s&&i[r-1]%2==0||!this.isRtlDir&&0===r&&i[r]%2!=0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!=0&&0!==s&&r--,t=this.bidiMap.logicalFromVisual[r]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(o.prototype),t.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")})};(function(){r.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},this.$setSelection=function(e,t,n,r){var i=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||s)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n,r="number"==typeof e?e:this.lead.row,i=this.session.getFoldLine(r);return i?(r=i.start.row,n=i.end.row):n=r,!0===t?new o(r,0,n,this.session.getLine(n).length):new o(r,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i)this.moveCursorTo(i.end.row,i.end.column);else{if(this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t)),t>=n.length)return this.moveCursorTo(e,n.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(s)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)}},this.$shortWordEndIndex=function(e){var t,n=0,r=/\s/,i=this.session.tokenRe;if(i.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&r.test(t);)n++;if(n<1)for(i.lastIndex=0;(t=e[n])&&!i.test(t);)if(i.lastIndex=0,n++,r.test(t)){if(n>2){n--;break}for(;(t=e[n])&&r.test(t);)n++;if(n>2)break}}return i.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do{e++,r=this.doc.getLine(e)}while(e0&&/^\s*$/.test(r));n=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(t,n-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n,r=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(r.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(r.column),r.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=r.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?r.column=this.$desiredColumn:this.$desiredColumn=r.column);var i=this.session.screenToDocumentPosition(r.row+e,r.column,n);0!==e&&0===t&&i.row===this.lead.row&&i.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[i.row]&&(i.row>0||e>0)&&i.row++,this.moveCursorTo(i.row,i.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch(e){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,n){"use strict";var r=e("./config"),i=2e3,s=function(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],r=[],i=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",a=[],l=0;l1?this.$applyToken:u.token),h>1&&(/\\\d/.test(u.regex)?c=u.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(h=1,c=this.removeCapturingGroups(u.regex)),u.splitRegex||"string"==typeof u.token||a.push(u)),s[i]=l,i+=h,r.push(c),u.onMatch||(u.onMatch=null)}}r.length||(s[0]=0,r.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){i=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var r=[],i=0,s=n.length;ic){var E=e.substring(c,g-m.length);d.type==f?d.value+=E:(d.type&&u.push(d),d={type:f,value:E})}for(var v=0;vi){for(h>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});c1&&n[0]!==r&&n.unshift("#tmp",r),{tokens:u,state:n.length?n:r}},this.reportError=r.reportError}).call(s.prototype),t.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var n in e){for(var r=e[n],i=0;i=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(void 0!==n)return n;for(n=0;t>0;)n+=e[t-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)}}).call(i.prototype),t.TokenIterator=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r,i=e("../../lib/oop"),s=e("../behaviour").Behaviour,o=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],u=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],c={},h={'"':'"',"'":"'"},d=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,c.rangeCount!=e.multiSelect.rangeCount&&(c={rangeCount:e.multiSelect.rangeCount})),c[t])return r=c[t];r=c[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},f=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},p=function(e){this.add("braces","insertion",function(t,n,i,s,o){var l=i.getCursorPosition(),u=s.doc.getLine(l.row);if("{"==o){d(i);var c=i.getSelectionRange(),h=s.doc.getTextRange(c);if(""!==h&&"{"!==h&&i.getWrapBehavioursEnabled())return f(c,h,"{","}");if(p.isSaneInsertion(i,s))return/[\]\}\)]/.test(u[l.column])||i.inMultiSelectMode||e&&e.braces?(p.recordAutoInsert(i,s,"}"),{text:"{}",selection:[1,1]}):(p.recordMaybeInsert(i,s,"{"),{text:"{",selection:[1,1]})}else if("}"==o){if(d(i),"}"==u.substring(l.column,l.column+1)&&null!==s.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&p.isAutoInsertedClosing(l,u,o))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==o||"\r\n"==o){d(i);var m="";if(p.isMaybeInsertedClosing(l,u)&&(m=a.stringRepeat("}",r.maybeInsertedBrackets),p.clearMaybeInsertedClosing()),"}"===u.substring(l.column,l.column+1)){var g=s.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!g)return null;var E=this.$getIndent(s.getLine(g.row))}else{if(!m)return void p.clearMaybeInsertedClosing();E=this.$getIndent(u)}var v=E+s.getTabString();return{text:"\n"+v+"\n"+E+m,selection:[1,v.length,1,v.length]}}p.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,i,s){var o=i.doc.getTextRange(s);if(!s.isMultiLine()&&"{"==o){if(d(n),"}"==i.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s;r.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if("("==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"(",")");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(")"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"("==s&&(d(n),")"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("brackets","insertion",function(e,t,n,r,i){if("["==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"[","]");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if("]"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"["==s&&(d(n),"]"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("string_dquotes","insertion",function(e,t,n,r,i){var s=r.$mode.$quotes||h;if(1==i.length&&s[i]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(i))return;d(n);var o=i,a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(!(""===l||1==l.length&&s[l])&&n.getWrapBehavioursEnabled())return f(a,l,o,o);if(!l){var u=n.getCursorPosition(),c=r.doc.getLine(u.row),p=c.substring(u.column-1,u.column),m=c.substring(u.column,u.column+1),g=r.getTokenAt(u.row,u.column),E=r.getTokenAt(u.row,u.column+1);if("\\"==p&&g&&/escape/.test(g.type))return null;var v,C=g&&/string|escape/.test(g.type),D=!E||/string|escape/.test(E.type);if(m==o)(v=C!==D)&&/string\.end/.test(E.type)&&(v=!1);else{if(C&&!D)return null;if(C&&D)return null;var S=r.$mode.tokenRe;S.lastIndex=0;var A=S.test(p);S.lastIndex=0;var _=S.test(p);if(A||_)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;var y=c[u.column-2];if(p==o&&(y==o||S.test(y)))return null;v=!0}return{text:v?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.$mode.$quotes||h,o=r.doc.getTextRange(i);if(!i.isMultiLine()&&s.hasOwnProperty(o)&&(d(n),r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==o))return i.end.column++,i})};p.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new o(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",l)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var i=new o(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",l))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",u)},p.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},p.recordAutoInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isAutoInsertedClosing(i,s,r.autoInsertedLineEnd[0])||(r.autoInsertedBrackets=0),r.autoInsertedRow=i.row,r.autoInsertedLineEnd=n+s.substr(i.column),r.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isMaybeInsertedClosing(i,s)||(r.maybeInsertedBrackets=0),r.maybeInsertedRow=i.row,r.maybeInsertedLineStart=s.substr(0,i.column)+n,r.maybeInsertedLineEnd=s.substr(i.column),r.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return r.autoInsertedBrackets>0&&e.row===r.autoInsertedRow&&n===r.autoInsertedLineEnd[0]&&t.substr(e.column)===r.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return r.maybeInsertedBrackets>0&&e.row===r.maybeInsertedRow&&t.substr(e.column)===r.maybeInsertedLineEnd&&t.substr(0,e.column)==r.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){r.autoInsertedLineEnd=r.autoInsertedLineEnd.substr(1),r.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){r&&(r.maybeInsertedBrackets=0,r.maybeInsertedRow=-1)},i.inherits(p,s),t.CstyleBehaviour=p}),ace.define("ace/unicode",["require","exports","module"],function(e,t,n){"use strict";for(var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,s=[],o=0;o2?r%u!=u-1:r%u==0})}else{if(!this.blockComment)return!1;var f=this.blockComment.start,p=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+l.escapeRegExp(f)+")"),g=new RegExp("(?:"+l.escapeRegExp(p)+")\\s*$"),E=function(e,t){C(e,t)||s&&!/\S/.test(e)||(i.insertInLine({row:t,column:e.length},p),i.insertInLine({row:t,column:a},f))},v=function(e,t){var n;(n=e.match(g))&&i.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(m))&&i.removeInLine(t,n[1].length,n[0].length)},C=function(e,n){if(m.test(e))return!0;for(var r=t.getTokens(n),i=0;ie.length&&(S=e.length)}),a==1/0&&(a=S,s=!1,o=!1),c&&a%u!=0&&(a=Math.floor(a/u)*u),D(o?v:E)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(i){!i.start&&i[0]&&(i=i[0]);var s,o,a=(m=new u(t,r.row,r.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var h,d;a&&/comment/.test(a.type);){if(-1!=(g=a.value.indexOf(i.start))){var f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g;h=new c(f,p,f,p+i.start.length);break}a=m.stepBackward()}var m;for(a=(m=new u(t,r.row,r.column)).getCurrentToken();a&&/comment/.test(a.type);){var g;if(-1!=(g=a.value.indexOf(i.end))){f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g,d=new c(f,p,f,p+i.end.length);break}a=m.stepForward()}d&&t.remove(d),h&&(t.remove(h),s=h.start.row,o=-i.start.length)}else o=i.start.length,s=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);l.start.row==s&&(l.start.column+=o),l.end.row==s&&(l.end.column+=o),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var n=e[t],i=n.prototype.$id,s=r.$modes[i];s||(r.$modes[i]=s=new n),r.$modes[t]||(r.$modes[t]=s),this.$embeds.push(t),this.$modes[t]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;tthis.row)){var n=function(t,n,r){var i="insert"==t.action,s=(i?1:-1)*(t.end.row-t.start.row),o=(i?1:-1)*(t.end.column-t.start.column),a=t.start,l=i?a:t.end;return e(n,a,r)?{row:n.row,column:n.column}:e(l,n,!r)?{row:n.row+s,column:n.column+(n.row==l.row?o:0)}:{row:a.row,column:a.column}}(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(e,t,n){var r;if(r=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=r.row||this.column!=r.column){var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=e("./anchor").Anchor,l=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new a(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();void 0===e?e=n:e<0?e=0:e>=n&&(e=n-1,t=void 0);var r=this.getLine(e);return null==t&&(t=r.length),{row:e,column:t=Math.min(Math.max(t,0),r.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof o||(e=o.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,r=n.length-t+1,i=e.start.row,s=e.start.column,o=0,a=0;o20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,-1==r&&(r=t),s<=r&&n.fireUpdateEvent(s,r)}}};(function(){r.implement(this,i),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens}}).call(s.prototype),t.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=(e("./lib/oop"),e("./range").Range),s=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,n,s){if(this.regExp)for(var o=s.firstRow,a=s.lastRow,l=o;l<=a;l++){var u=this.cache[l];null==u&&((u=r.getMatchOffsets(n.getLine(l),this.regExp)).length>this.MAX_RANGES&&(u=u.slice(0,this.MAX_RANGES)),u=u.map(function(e){return new i(l,e.offset,l,e.offset+e.length)}),this.cache[l]=u.length?u:"");for(var c=u.length;c--;)t.drawSingleLineMarker(e,u[c].toScreenRange(n),this.clazz,s)}}}).call(s.prototype),t.SearchHighlight=s}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range;function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var r,i,s=0,o=this.folds,a=!0;null==t&&(t=this.end.row,n=this.end.column);for(var l=0;l0)){var l=r(e,o.start);return 0===a?t&&0!==l?-s-2:s:l>0||0===l&&!t?s:-s-1}}return-s-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},this.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],n=this.ranges,i=(n=n.sort(function(e,t){return r(e.start,t.start)}))[0],s=1;s=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=r);o++);if("insert"==e.action){for(var l=i-r,u=-t.column+n.column;or);o++)if(c.start.row==r&&c.start.column>=t.column&&(c.start.column==t.column&&this.$bias<=0||(c.start.column+=u,c.start.row+=l)),c.end.row==r&&c.end.column>=t.column){if(c.end.column==t.column&&this.$bias<0)continue;c.end.column==t.column&&u>0&&oc.start.column&&c.end.column==s[o+1].start.column&&(c.end.column-=u),c.end.column+=u,c.end.row+=l}}else for(l=r-i,u=t.column-n.column;oi);o++)c.end.rowt.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=u,c.end.row+=l):c.end.row>i&&(c.end.row+=l),c.start.rowt.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=u,c.start.row+=l):c.start.row>i&&(c.start.row+=l);if(0!=l&&o=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;for(t&&(r=n.indexOf(t)),-1==r&&(r=0);r=e)return i}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,r=t-e+1,i=0;i=t){a=e?r-=t-a:r=0);break}o>=e&&(r-=a>=e?o-a:o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n,r=this.$foldData,o=!1;e instanceof s?n=e:(n=new s(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,u=n.end.row,c=n.end.column,h=this.getFoldAt(a,l,1),d=this.getFoldAt(u,c,-1);if(h&&d==h)return h.addSubFold(n);h&&!h.range.isStart(a,l)&&this.removeFold(h),d&&!d.range.isEnd(u,c)&&this.removeFold(d);var f=this.getFoldsInRange(n.range);f.length>0&&(this.removeFolds(f),f.forEach(function(e){n.addSubFold(e)}));for(var p=0;p0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;if(null==e?(n=new r(0,0,this.getLength(),0),t=!0):n="number"==typeof e?new r(e,0,e,this.getLine(e).length):"row"in e?r.fromPoints(e,e):e,i=this.getFoldsInRangeList(n),t)this.removeFolds(i);else for(var s=i;s.length;)this.expandFolds(s),s=this.getFoldsInRangeList(n);if(i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){null==r&&(r=e.start.row),null==i&&(i=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var s=this.doc,o="";return e.walk(function(e,t,n,a){if(!(tc)break}while(s&&l.test(s.type));s=i.stepBackward()}else s=i.getCurrentToken();return u.end.row=i.getCurrentTokenRow(),u.end.column=i.getCurrentTokenColumn()+s.value.length-2,u}},this.foldAll=function(e,t,n){null==n&&(n=1e5);var r=this.foldWidgets;if(r){t=t||this.getLength();for(var i=e=e||0;i=e){i=s.end.row;try{var o=this.addFold("...",s);o&&(o.collapseChildren=n)}catch(e){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};for(var r,i=e-1;i>=0;){var s=n[i];if(null==s&&(s=n[i]=this.getFoldWidget(i)),"start"==s){var o=this.getFoldWidgetRange(i);if(r||(r=o),o&&o.end.row>=e)break}i--}return{range:-1!==i&&o,firstRange:r}},this.onFoldWidgetClick=function(e,t){var n={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var r=t.target||t.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),r=this.getLine(e),i="end"===n?-1:1,s=this.getFoldAt(e,-1===i?0:r.length,i);if(s)return t.children||t.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()&&(s=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(s.range))return this.removeFold(s),s;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,u=a.range.end.row;this.foldAll(l,u,t.all?1e4:0)}else t.children?(u=o?o.end.row:this.getLength(),this.foldAll(e+1,u,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var r=this.getParentFoldRangeData(t,!0);if(n=r.range||r.firstRange){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold("...",n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){"use strict";var r=e("../token_iterator").TokenIterator,i=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(""==n)return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t,n=this.getLine(e.row),r=!0,s=n.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(o||(s=n.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),r=!1),!o)return null;if(o[1]){if(!(a=this.$findClosingBracket(o[1],e)))return null;t=i.fromPoints(e,a),r||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a;if(!(a=this.$findOpeningBracket(o[2],e)))return null;t=i.fromPoints(a,e),r||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn()-2,u=a.value;;){for(;l>=0;){var c=u.charAt(l);if(c==i){if(0==(s-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else c==e&&(s+=1);l-=1}do{a=o.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(u=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn();;){for(var u=a.value,c=u.length;ln&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>1,s=e[i];if(t>s)n=i+1;else{if(!(t=t);s++);return(n=r[s])?(n.index=s,n.start=i-n.value.length,n):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe)),r)var i=this.tokenRe;else i=/^\s+$/.test(n.slice(t-1,t+1))?/\s/:this.nonTokenRe;var s=t;if(s>0){do{s--}while(s>=0&&n.charAt(s).match(i));s++}for(var o=t;oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,s=this.$foldData[i],o=s?s.start.row:1/0,a=t.length,l=0;lo){if((l=s.end.row+1)>=a)break;o=(s=this.$foldData[i++])?s.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>r&&(r=n[l])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var r=e[n];"insert"==r.action||"remove"==r.action?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;ne.end.column&&(s.start.column+=u),s.end.row==e.end.row&&s.end.column>e.end.column&&(s.end.column+=u)),o&&s.start.row>=e.end.row&&(s.start.row+=o,s.end.row+=o)}if(s.end=this.insert(s.start,r),i.length){var a=e.start,l=s.start,u=(o=l.row-a.row,l.column-a.column);this.addFolds(i.map(function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=u),e.end.row==a.row&&(e.end.column+=u),e.start.row+=o,e.end.row+=o,e}))}return s},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},this.outdentRows=function(e){for(var t=e.collapseRows(),n=new c(0,0,0,0),r=this.getTabSize(),i=t.start.row;i<=t.end.row;++i){var s=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o0){var i;if((i=this.getRowFoldEnd(t+n))>this.doc.getLength()-1)return 0;r=i-t}else e=this.$clipRowToDocument(e),r=(t=this.$clipRowToDocument(t))-e+1;var s=new c(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(e){return(e=e.clone()).start.row+=r,e.end.row+=r,e}),a=0==n?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+r,a),o.length&&this.addFolds(o),r},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1&&(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,i=e.end,s=r.row,o=i.row,a=o-s,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[t?"$wrapData":"$rowLengthCache"].splice(s,a);var u=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var c=0;if(m=this.getFoldLine(i.row)){m.addRemoveChars(i.row,i.column,r.column-i.column),m.shiftRow(-a);var h=this.getFoldLine(s);h&&h!==m&&(h.merge(m),m=h),c=u.indexOf(m)+1}for(;c=i.row&&m.shiftRow(-a);o=s}else{var d=Array(a);d.unshift(s,0);var f=t?this.$wrapData:this.$rowLengthCache;if(f.splice.apply(f,d),u=this.$foldData,c=0,m=this.getFoldLine(s)){var p=m.range.compareInside(r.row,r.column);0==p?(m=m.split(r.row,r.column))&&(m.shiftRow(a),m.addRemoveChars(o,0,i.column-r.column)):-1==p&&(m.addRemoveChars(s,0,i.column-r.column),m.shiftRow(a)),c=u.indexOf(m)+1}for(;c=s&&m.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===n&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(m=this.getFoldLine(s))&&m.addRemoveChars(s,r.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),l},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(n,r){var i,s,o=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,u=this.$wrapLimit,c=n;for(r=Math.min(r,o.length-1);c<=r;)(s=this.getFoldLine(c,s))?(i=[],s.walk(function(n,r,s,a){var l;if(null!=n){(l=this.$getDisplayTokens(n,i.length))[0]=e;for(var u=1;u=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}this.$computeWrapSplits=function(n,r,i){if(0==n.length)return[];var s=[],o=n.length,a=0,l=0,u=this.$wrapAsCode,c=this.$indentedSoftWrap,h=r<=Math.max(2*i,8)||!1===c?0:Math.floor(r/2);function d(e){for(var t=e-a,r=a;rr-f;){var p=a+r-f;if(n[p-1]>=10&&n[p]>=10)d(p);else if(n[p]!=e&&n[p]!=t){for(var m=Math.max(p-(r-(r>>2)),a-1);p>m&&n[p]m&&n[p]m&&9==n[p];)p--}else for(;p>m&&n[p]<10;)p--;p>m?d(++p):(2==n[p=a+r]&&p--,d(p-f))}else{for(;p!=a-1&&n[p]!=e;p--);if(p>a){d(p);continue}for(p=a+r;p39&&o<48||o>57&&o<64?i.push(9):o>=4352&&n(o)?i.push(1,2):i.push(1)}return i},this.$getStringScreenWidth=function(e,t,r){if(0==t)return[0,0];var i,s;for(null==t&&(t=1/0),r=r||0,s=0;s=4352&&n(i)?r+=2:r+=1,!(r>t));s++);return[r,s]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0){a=u[c],s=this.$docRowCache[c];var d=e>u[h-1]}else d=!h;for(var f=this.getLength()-1,p=this.getNextFoldLine(s),m=p?p.start.row:1/0;a<=e&&!(a+(l=this.getRowLength(s))>e||s>=f);)a+=l,++s>m&&(s=p.end.row+1,m=(p=this.getNextFoldLine(s,p))?p.start.row:1/0),d&&(this.$docRowCache.push(s),this.$screenRowCache.push(a));if(p&&p.start.row<=s)r=this.getFoldDisplayLine(p),s=p.start.row;else{if(a+l<=e||s>f)return{row:f,column:this.getLine(f).length};r=this.getLine(s),p=null}var g=0,E=Math.floor(e-a);if(this.$useWrapMode){var v=this.$wrapData[s];v&&(i=v[E],E>0&&v.length&&(g=v.indent,o=v[E-1]||v[v.length-1],r=r.substring(o)))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+E,s,E)&&(t=this.$bidiHandler.offsetToCol(n)),o+=this.$getStringScreenWidth(r,t-g)[1],this.$useWrapMode&&o>=i&&(o=i-1),p?p.idxToPosition(o):{row:s,column:o}},this.documentToScreenPosition=function(e,t){if(void 0===t)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r,i=0,s=null;(r=this.getFoldAt(e,t,1))&&(e=r.start.row,t=r.start.column);var o,a=0,l=this.$docRowCache,u=this.$getRowCacheIndex(l,e),c=l.length;if(c&&u>=0){a=l[u],i=this.$screenRowCache[u];var h=e>l[c-1]}else h=!c;for(var d=this.getNextFoldLine(a),f=d?d.start.row:1/0;a=f){if((o=d.end.row+1)>e)break;f=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;i+=this.getRowLength(a),a=o,h&&(this.$docRowCache.push(a),this.$screenRowCache.push(i))}var p="";d&&a>=f?(p=this.getFoldDisplayLine(d,e,t),s=d.start.row):(p=this.getLine(e).substring(0,t),s=e);var m=0;if(this.$useWrapMode){var g=this.$wrapData[s];if(g){for(var E=0;p.length>=g[E];)i++,E++;p=p.substring(g[E-1]||0,p.length),m=E>0?g.indent:0}}return{row:i,column:m+this.$getStringScreenWidth(p)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,r=0,i=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);ri&&(r=t.end.row+1,i=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var o=this.$foldData,a=0;an);s++);return[r,s]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=n}.call(p.prototype),e("./edit_session/folding").Folding.call(p.prototype),e("./edit_session/bracket_match").BracketMatch.call(p.prototype),o.defineOptions(p.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=p}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(){this.$options={}};(function(){this.set=function(e){return i.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i,o){return r=new s(e,n,i,o),!(n==o&&t.start&&t.start.start&&0!=t.skipCurrent&&r.isEqual(t.start)&&(r=null,1))}),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],a=t.re;if(t.$isMultiLine){var l,u=a.length,c=i.length-u;e:for(var h=a.offset||0;h<=c;h++){for(var d=0;dm||(o.push(l=new s(h,m,h+u-1,g)),u>2&&(h=h+u-2))}}else for(var E=0;ES&&o[d].end.row==n.end.row;)d--;for(o=o.slice(E,d+1),E=0,d=o.length;E=a;n--)if(h(n,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(n=l,a=o.row;n>=a;n--)if(h(n,Number.MAX_VALUE,e))return}};else u=function(e){var n=o.row;if(!h(n,o.column,e)){for(n+=1;n<=l;n++)if(h(n,0,e))return;if(0!=t.wrap)for(n=a,l=o.row;n<=l;n++)if(h(n,0,e))return}};if(t.$isMultiLine)var c=n.length,h=function(t,i,s){var o=r?t-c+1:t;if(!(o<0)){var a=e.getLine(o),l=a.search(n[0]);if(!(!r&&li))return!!s(o,l,o+c-1,h)||void 0}}};else h=r?function(t,r,i){var s,o=e.getLine(t),a=[],l=0;for(n.lastIndex=0;s=n.exec(o);){var u=s[0].length;if(l=s.index,!u){if(l>=o.length)break;n.lastIndex=l+=1}if(s.index+u>r)break;a.push(s.index,u)}for(var c=a.length-1;c>=0;c-=2){var h=a[c-1];if(i(t,h,t,h+(u=a[c])))return!0}}:function(t,r,i){var s,o,a=e.getLine(t);for(n.lastIndex=r;o=n.exec(a);){var l=o[0].length;if(i(t,s=o.index,t,s+l))return!0;if(!l&&(n.lastIndex=s+=1,s>=a.length))return!1}};return{forEach:u}}}).call(o.prototype),t.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/keys"),i=e("../lib/useragent"),s=r.KEY_MODS;function o(e,t){this.platform=t||(i.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function a(e,t){o.call(this,e,t),this.$singleCommand=!1}a.prototype=o.prototype,function(){function e(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var n=e&&("string"==typeof e?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var s=r[i];if(s==e)delete r[i];else if(Array.isArray(s)){var o=s.indexOf(e);-1!=o&&(s.splice(o,1),1==s.length&&(r[i]=s[0]))}}},this.bindKey=function(e,t,n){if("object"==typeof e&&e&&(null==n&&(n=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach(function(e){var r="";if(-1!=e.indexOf(" ")){var i=e.split(/\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=s[t.hashId]+t.key;r+=(r?" ":"")+n,this._addCommandToBinding(r,"chainKeys")},this),r+=" "}var o=this.parseKeys(e),a=s[o.hashId]+o.key;this._addCommandToBinding(r+a,t,n)},this)},this._addCommandToBinding=function(t,n,r){var i,s=this.commandKeyBinding;if(n)if(!s[t]||this.$singleCommand)s[t]=n;else{Array.isArray(s[t])?-1!=(i=s[t].indexOf(n))&&s[t].splice(i,1):s[t]=[s[t]],"number"!=typeof r&&(r=e(n));var o=s[t];for(i=0;ir);i++);o.splice(i,0,n)}else delete s[t]},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(n){if("string"==typeof n)return this.bindKey(n,t);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=t),this.addCommand(n))}},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),i=r[n];if(r.FUNCTION_KEYS[i])n=r.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:n.toUpperCase(),hashId:-1}}for(var s=0,o=t.length;o--;){var a=r.KEY_MODS[t[o]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[o]+" in "+e),!1;s|=a}return{key:n,hashId:s}},this.findKeyCommand=function(e,t){var n=s[e]+t;return this.commandKeyBinding[n]},this.handleKeyboard=function(e,t,n,r){if(!(r<0)){var i=s[t]+n,o=this.commandKeyBinding[i];return e.$keyChain&&(e.$keyChain+=" "+i,o=this.commandKeyBinding[e.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(e.$keyChain&&(t&&4!=t||1!=n.length?(-1==t||r>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-i.length-1)),{command:o}):(e.$keyChain=e.$keyChain||i,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(o.prototype),t.HashHandler=o,t.MultiHashHandler=a}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){i.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};r.inherits(o,i),function(){r.implement(this,s),this.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var i={editor:t,command:e,args:n};return i.returnValue=this._emit("exec",i),this._signal("afterExec",i),!1!==i.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map(function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=e("../config"),s=e("../range").Range;function o(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(e){i.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,a=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(n.row),u=n.row+1;u<=i.row+1;u++){var c=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(u)));0!==c.length&&(c=" "+c),l+=c}i.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;o=i.lastRow||r.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var i=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&-1!==n.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var n=this;E.loadModule(["keybinding",e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||i.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=t.findMatchingBracket(e.getCursorPosition());if(n)var r=new f(n.row,n.column,n.row,n.column+1);else t.$mode.getMatching&&(r=t.$mode.getMatching(e.session));r&&(t.$bracketHighlight=t.addMarker(r,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=e.getCursorPosition(),r=new v(e.session,n.row,n.column),i=r.getCurrentToken();if(!i||!/\b(?:tag-open|tag-name)/.test(i.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1==i.type.indexOf("tag-open")||(i=r.stepForward())){var s=i.value,o=0,a=r.stepBackward();if("<"==a.value)do{a=i,(i=r.stepForward())&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"=0);else{do{i=a,a=r.stepBackward(),i&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var n=new f(e.row,e.column,e.row,1/0);n.id=t.addMarker(n,"ace_active-line","screenLine"),t.$highlightLineMarker=n}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var n=t.start.column,r=t.end.column,i=e.getLine(t.start.row),s=i.substring(n,r);if(!(s.length>5e3)&&/[\w\d]/.test(s)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),a=i.substring(n-1,r+1);if(o.test(a))return o}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var r=this.selection.getAllRanges(),i=0;ia.search(/\S|$/)){var l=a.substr(i.column).search(/\S|$/);n.doc.removeInLine(i.row,i.column,i.column+l)}}this.clearSelection();var u=i.column,c=n.getState(i.row),h=(a=n.getLine(i.row),r.checkOutdent(c,a,e));if(n.insert(i,e),s&&s.selection&&(2==s.selection.length?this.selection.setSelectionRange(new f(i.row,u+s.selection[0],i.row,u+s.selection[1])):this.selection.setSelectionRange(new f(i.row+s.selection[0],s.selection[1],i.row+s.selection[2],s.selection[3]))),n.getDocument().isNewLine(e)){var d=r.getNextLineIndent(c,a.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},d)}h&&r.autoOutdent(c,n,i.row)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(e,t){var n;(t.extendLeft||t.extendRight)&&((n=this.selection.getRange()).start.column-=t.extendLeft,n.end.column+=t.extendRight,this.selection.setRange(n),e||n.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((n=this.selection.getRange()).start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,"deletion",this,n,t);if(0===t.end.column){var s=n.getTextRange(t);if("\n"==s[s.length-1]){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var n,r,i=this.session.getLine(e.row);tt.toLowerCase()?1:0});var i=new f(0,0,0,0);for(r=e.first;r<=e.last;r++){var s=t.getLine(r);i.start.row=r,i.end.row=r,i.end.column=s.length,t.replace(i,n[r-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var r=this.session.getLine(e);n.lastIndex=t)return{value:i[0],start:i.index,end:i.index+i[0].length}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new f(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var s=this.getNumberAt(t,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,a=s.start+s.value.length-o,l=parseFloat(s.value);l*=Math.pow(10,a),o!==s.end&&n=a&&o<=l&&(n=t,u.selection.clearSelection(),u.moveCursorTo(e,a+r),u.selection.selectTo(e,l+r)),a=l});for(var c,h=this.$toggleWordPairs,d=0;df+1)break;f=p.last}for(c--,a=this.session.$moveLines(d,f,t?0:e),t&&-1==e&&(h=c+1);h<=c;)o[h].moveBy(a,0),h++;t||(a=0),l+=a}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);!0===t?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):!1===t&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,i*r.lineHeight),null!=t&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new v(this.session,n.row,n.column),i=r.getCurrentToken(),s=i||r.stepForward();if(s){var o,a,l=!1,u={},c=n.column-s.start,h={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;c=0;--s)this.$tryReplace(n[s],e)&&r++;return this.selection.setSelectionRange(i),r},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return null!==(t=this.$search.replace(n,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&r.mixin(t,e);var i=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(i)||this.$search.$options.needle)||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var s=this.$search.find(this.session);return t.preventScroll?s:s?(this.revealRange(s,n),s):(t.backwards?i.start=i.end:i.end=i.start,void this.selection.setRange(i))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(e){var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var s=this.on("changeSelection",function(){r=!0}),o=this.renderer.on("beforeRender",function(){r&&(t=n.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,s=e.$cursorLayer.$pixelPos,o=e.layerConfig,a=s.top-o.offset;null!=(r=s.top>=0&&a+t.top<0||!(s.topwindow.innerHeight)&&null)&&(i.style.top=a+"px",i.style.left=s.left+"px",i.style.height=o.lineHeight+"px",i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",o))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,i.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},this.prompt=function(e,t,n){var r=this;E.loadModule("./ext/prompt",function(i){i.prompt(r,e,t,n)})}}.call(D.prototype),E.defineOptions(D.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?S.attach(this):S.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?S.attach(this):S.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.renderer.$composition||this.getValue();if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),i.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!e&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),i.addCssClass(this.container,"ace_hasPlaceholder");var t=i.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var S={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=D}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,n){this.$fromUndo||e!=this.$lastDelta&&(!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,r=n.length;r--;){var i=n[r][0];if(i.id<=e)break;i.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?a(e):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(r.prototype);var i=e("./range").Range,s=i.comparePoints;function o(e){return{row:e.row,column:e.column}}function a(e){if(e=e||this,Array.isArray(e))return e.map(a).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function u(e,t){var n="insert"==e.action,r="insert"==t.action;if(n&&r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}else if(!n&&r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(!n&&!r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}return[t,e]}function c(e,t){for(var n=e.length;n--;)for(var r=0;r=0?d(e,t,-1):(s(e.start,t.start)<=0||d(e,i.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!n&&r)s(t.start,e.end)>=0?d(t,e,-1):(s(t.start,e.start)<=0||d(t,i.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{var o,a;if(!(s(t.end,e.start)<=0))return s(e.start,t.start)<0&&(o=e,e=p(e,t.start)),s(e.end,t.end)>0&&(a=p(e,t.end)),f(t.end,e.start,e.end,-1),a&&!o&&(e.lines=a.lines,e.start=a.start,e.end=a.end,a=e),[t,o,a].filter(Boolean);d(e,t,-1)}return[t,e]}function d(e,t,n){f(e.start,t.start,t.end,n),f(e.end,t.start,t.end,n)}function f(e,t,n,r){e.row==(1==r?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function p(e,t){var n=e.lines,r=e.end;e.end=o(t);var i=e.end.row-e.start.row,s=n.splice(i,n.length),a=i?t.column:t.column-e.start.column;return n.push(s[0].substring(0,a)),s[0]=s[0].substr(a),{start:o(t),end:r,lines:s,action:e.action}}function m(e,t){t=function(e){return{start:o(e.start),end:o(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var n=e.length;n--;){for(var r=e[n],i=0;is&&(l=i.end.row+1,s=(i=t.getNextFoldLine(l,i))?i.start.row:1/0),l>r){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,e,this.session,u),this.$lines.push(o)),this.$renderCell(o,e,i,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,i=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(i=t.getLength()+r-1);var s=n?n.getWidth(t,i,e):i.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();(s+=o.left+o.right)===this.gutterWidth||isNaN(s)||(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(r.row>this.$cursorRow){var i=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&i&&i.start.row==t[n-1].row))break;r=t[n-1]}r.element.className="ace_gutter-active-line "+r.element.className,this.$cursorCell=r;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;if(this.oldLastRow=n,!t||r0;i--)this.$lines.shift();if(r>n)for(i=this.session.getFoldedRowCount(n+1,r);i>0;i--)this.$lines.pop();e.firstRowr&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,n){for(var r=[],i=t,s=this.session.getNextFoldLine(i),o=s?s.start.row:1/0;i>o&&(i=s.end.row+1,o=(s=this.session.getNextFoldLine(i,s))?s.start.row:1/0),!(i>n);){var a=this.$lines.createCell(i,e,this.session,u);this.$renderCell(a,e,s,i),r.push(a),i++}return r},this.$renderCell=function(e,t,n,i){var s=e.element,o=this.session,a=s.childNodes[0],l=s.childNodes[1],u=o.$firstLineNumber,c=o.$breakpoints,h=o.$decorations,d=o.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&o.foldWidgets,p=n?n.start.row:Number.MAX_VALUE,m="ace_gutter-cell ";if(this.$highlightGutterLine&&(i==this.$cursorRow||n&&i=p&&this.$cursorRow<=n.end.row)&&(m+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),c[i]&&(m+=c[i]),h[i]&&(m+=h[i]),this.$annotations[i]&&(m+=this.$annotations[i].className),s.className!=m&&(s.className=m),f){var g=f[i];null==g&&(g=f[i]=o.getFoldWidget(i))}if(g){m="ace_fold-widget ace_"+g,"start"==g&&i==p&&in.right-t.right?"foldWidgets":void 0}}).call(l.prototype),t.Gutter=l}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/dom"),s=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){function e(e,t,n,r){return(e?1:0)|(t?2:0)|(n?4:0)|(r?8:0)}this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},this.update=function(e){if(e){var t;for(var n in this.config=e,this.i=0,this.markers){var r=this.markers[n];if(r.range){var i=r.range.clipRows(e.firstRow,e.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),r.renderer){var s=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,s,e)}else"fullLine"==r.type?this.drawFullLineMarker(t,i,r.clazz,e):"screenLine"==r.type?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?"text"==r.type?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+" ace_start ace_br15",e)}else r.update(t,this,this.session,e)}if(-1!=this.i)for(;this.if,c==u),s,c==u?0:1,o)},this.drawMultiLineMarker=function(e,t,n,r,i){var s=this.$padding,o=r.lineHeight,a=this.$getTop(t.start.row,r),l=s+t.start.column*r.characterWidth;if(i=i||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((u=t.clone()).end.row=u.start.row,u.end.column=this.session.getLine(u.start.row).length,this.drawBidiSingleLineMarker(e,u,n+" ace_br1 ace_start",r,null,i)):this.elt(n+" ace_br1 ace_start","height:"+o+"px;right:0;top:"+a+"px;left:"+l+"px;"+(i||"")),this.session.$bidiHandler.isBidiRow(t.end.row)){var u;(u=t.clone()).start.row=u.end.row,u.start.column=0,this.drawBidiSingleLineMarker(e,u,n+" ace_br12",r,null,i)}else{a=this.$getTop(t.end.row,r);var c=t.end.column*r.characterWidth;this.elt(n+" ace_br12","height:"+o+"px;width:"+c+"px;top:"+a+"px;left:"+s+"px;"+(i||""))}if(!((o=(t.end.row-t.start.row-1)*r.lineHeight)<=0)){a=this.$getTop(t.start.row+1,r);var h=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+o+"px;right:0;top:"+a+"px;left:"+s+"px;"+(i||""))}},this.drawSingleLineMarker=function(e,t,n,r,i,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,i,s);var o=r.lineHeight,a=(t.end.column+(i||0)-t.start.column)*r.characterWidth,l=this.$getTop(t.start.row,r),u=this.$padding+t.start.column*r.characterWidth;this.elt(n,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+u+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(e,t,n,r,i,s){var o=r.lineHeight,a=this.$getTop(t.start.row,r),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(n,"height:"+o+"px;width:"+e.width+(i||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-s),this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))},this.drawScreenLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))}}).call(s.prototype),t.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=function(e){this.dom=i,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){r.implement(this,a),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;nc&&(a=l.end.row+1,c=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(a>i);){var h=s[o++];if(h){this.dom.removeChildren(h),this.$renderLine(h,a,a==c&&l),u&&(h.style.top=this.$lines.computeLineTop(a,e,this.session)+"px");var d=e.lineHeight*this.session.getRowLength(a)+"px";h.style.height!=d&&(u=!0,h.style.height=d)}a++}if(u)for(;o0;i--)this.$lines.shift();if(t.lastRow>e.lastRow)for(i=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);i>0;i--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,n){for(var r=[],s=t,o=this.session.getNextFoldLine(s),a=o?o.start.row:1/0;s>a&&(s=o.end.row+1,a=(o=this.session.getNextFoldLine(s,o))?o.start.row:1/0),!(s>n);){var l=this.$lines.createCell(s,e,this.session),u=l.element;this.dom.removeChildren(u),i.setStyle(u.style,"height",this.$lines.computeLineHeight(s,e,this.session)+"px"),i.setStyle(u.style,"top",this.$lines.computeLineTop(s,e,this.session)+"px"),this.$renderLine(u,s,s==a&&o),this.$useLineGroups()?u.className="ace_line_group":u.className="ace_line",r.push(l),s++}return r},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,n=e.lastRow,r=this.$lines;r.getLength();)r.pop();r.push(this.$renderLinesFragment(e,t,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,r){for(var i,o=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),u=0;i=a.exec(r);){var c=i[1],h=i[2],d=i[3],f=i[4],p=i[5];if(o.showInvisibles||!h){var m=u!=i.index?r.slice(u,i.index):"";if(u=i.index+i[0].length,m&&l.appendChild(this.dom.createTextNode(m,this.element)),c){var g=o.session.getScreenTabSize(t+i.index);l.appendChild(o.$tabStrings[g].cloneNode(!0)),t+=g-1}else h?o.showInvisibles?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",v.textContent=s.stringRepeat(o.SPACE_CHAR,h.length),l.appendChild(v)):l.appendChild(this.com.createTextNode(h,this.element)):d?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",v.textContent=s.stringRepeat(o.SPACE_CHAR,d.length),l.appendChild(v)):f?(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className=o.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",v.textContent=o.showInvisibles?o.SPACE_CHAR:f,l.appendChild(v)):p&&(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className="ace_cjk",v.textContent=p,l.appendChild(v))}}if(l.appendChild(this.dom.createTextNode(u?r.slice(u):r,this.element)),this.$textToken[n.type])e.appendChild(l);else{var E="ace_"+n.type.replace(/\./g," ace_"),v=this.dom.createElement("span");"fold"==n.type&&(v.style.width=n.value.length*this.config.characterWidth+"px"),v.className=E,v.appendChild(l),e.appendChild(v)}return t+r.length},this.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(" "==t[0]){for(var i=(r-=r%this.tabSize)/this.tabSize,s=0;s=o;)a=this.$renderToken(l,a,c,h.substring(0,o-r)),h=h.substring(o-r),r=o,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(s.stringRepeat(" ",n.indent),this.element)),a=0,o=n[++i]||Number.MAX_VALUE;0!=h.length&&(r+=h.length,a=this.$renderToken(l,a,c,h))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(e,t){var n=0,r=t[0],i=r.value;this.displayIndentGuides&&(i=this.renderIndentGuide(e,i)),i&&(n=this.$renderToken(e,n,r,i));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,r,i);n=this.$renderToken(e,n,r,i)}},this.$renderOverflowMessage=function(e,t,n,r,i){n&&this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=i?"":"",e.appendChild(s)},this.$renderLine=function(e,t,n){if(n||0==n||(n=this.session.getFoldLine(t)),n)var r=this.$getFoldLineTokens(t,n);else r=this.session.getTokens(t);var i=e;if(r.length){var s=this.session.getRowSplitData(t);s&&s.length?(this.$renderWrappedLine(e,r,s),i=e.lastChild):(i=e,this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i)),this.$renderSimpleLine(i,r))}else this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i));if(this.showInvisibles&&i){n&&(t=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,i.appendChild(o)}},this.$getFoldLineTokens=function(e,t){var n=this.session,r=[],i=n.getTokens(e);return t.walk(function(e,t,s,o,a){null!=e?r.push({type:"fold",value:e}):(a&&(i=n.getTokens(t)),i.length&&function(e,t,n){for(var i=0,s=0;s+e[i].value.lengthn-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),s=t+o.length,i+=1);sn?r.push({type:e[i].type,value:o.substring(0,n-s)}):r.push(e[i]),s+=o.length,i+=1}}(i,o,s))},t.end.row,this.session.getLine(t.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),t.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)r.setStyle(t[n].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){r.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){r.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&r.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}else this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||o.top<0)&&n>1)){var a=this.cursors[i++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,o,e,t[n],this.session):this.isCursorInView(o,e)?(r.setStyle(l,"display","block"),r.translate(a,o.left,o.top),r.setStyle(l,"width",Math.round(e.characterWidth)+"px"),r.setStyle(l,"height",e.lineHeight+"px")):r.setStyle(l,"display","none")}}for(;this.cursors.length>i;)this.removeCursor();var u=this.session.getOverwrite();this.$setOverwrite(u),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(i.prototype),t.Cursor=i}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,a=32768,l=function(e){this.element=i.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){r.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(l.prototype);var u=function(e,t){l.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=i.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};r.inherits(u,l),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>a?(this.coeff=a/e,e=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(u.prototype);var c=function(e,t){l.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};r.inherits(c,l),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(c.prototype),t.ScrollBar=u,t.ScrollBarV=u,t.ScrollBarH=c,t.VScrollBar=u,t.HScrollBar=c}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){"use strict";var r=e("./lib/event"),i=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(r.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(i.prototype),t.RenderLoop=i}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,u=256,c="function"==typeof ResizeObserver,h=200,d=t.FontMetrics=function(e){this.el=i.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.innerHTML=s.stringRepeat("X",u),this.$characterSize={width:0,height:0},c?this.$addObserver():this.checkForSizeChanges()};(function(){r.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){var n=t[0].contentRect;e.checkForSizeChanges({height:n.height,width:n.width/u})}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/u};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.innerHTML=s.stringRepeat(e,u),this.$main.getBoundingClientRect().width/u},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=i.buildDom([e(0,0),e(h,0),e(0,h),e(h,h)],this.el)},this.transformCoordinates=function(e,t){function n(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function r(e,t){return[e[0]-t[0],e[1]-t[1]]}function i(e,t){return[e[0]+t[0],e[1]+t[1]]}function s(e,t){return[e*t[0],e*t[1]]}function o(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=s(1/this.$getZoom(this.el),e)),this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),u=o(this.els[2]),c=o(this.els[3]),d=n(r(c,l),r(c,u),r(i(l,u),i(c,a))),f=s(1+d[0],r(l,a)),p=s(1+d[1],r(u,a));if(t){var m=t,g=d[0]*m[0]/h+d[1]*m[1]/h+1,E=i(s(m[0],f),s(m[1],p));return i(s(1/g/h,E),a)}var v=r(e,a),C=n(r(f,s(d[0],v)),r(p,s(d[1],v)),v);return s(h,C)}}).call(d.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./config"),o=e("./layer/gutter").Gutter,a=e("./layer/marker").Marker,l=e("./layer/text").Text,u=e("./layer/cursor").Cursor,c=e("./scrollbar").HScrollBar,h=e("./scrollbar").VScrollBar,d=e("./renderloop").RenderLoop,f=e("./layer/font_metrics").FontMetrics,p=e("./lib/event_emitter").EventEmitter,m='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);opacity: 0.7;transform-origin: left;text-indent: 10px;}',g=e("./lib/useragent"),E=g.isIE;i.importCssString(m,"ace_editor.css");var v=function(e,t){var n=this;this.container=e||i.createElement("div"),i.addCssClass(this.container,"ace_editor"),i.HI_DPI&&i.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=i.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=i.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=i.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var r=this.$textLayer=new l(this.content);this.canvas=r.element,this.$markerFront=new a(this.content),this.$cursorLayer=new u(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new f(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!g.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,p),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),i.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,n){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,r){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var i=this.container;r||(r=i.clientHeight||i.scrollHeight),n||(n=i.clientWidth||i.scrollWidth);var s=this.$updateCachedSize(e,t,n,r);if(!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var s=0,o=this.$size,a={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if(r&&(e||o.height!=r)&&(o.height=r,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL),n&&(e||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,i.setStyle(this.scrollBarH.element.style,"left",t+"px"),i.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),i.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";i.setStyle(this.scrollBarH.element.style,"right",l),i.setStyle(this.scroller.style,"right",l),i.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(s|=this.CHANGE_FULL)}return o.$dirty=!n||!r,s&&this._signal("resize",a),s},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=i.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=i.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var n=this.$cursorLayer.$pixelPos;if(n){t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var r=this.layerConfig,s=n.top,o=n.left;s-=r.offset;var a=t&&t.useTextareaForIME?this.lineHeight:E?0:1;if(s<0||s>r.height-a)i.translate(this.textarea,0,0);else{var l=1,u=this.$size.height-a;if(t)if(t.useTextareaForIME){var c=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(c)[0]}else s+=this.lineHeight+2;else s+=this.lineHeight;(o-=this.scrollLeft)>this.$size.scrollerWidth-l&&(o=this.$size.scrollerWidth-l),o+=this.gutterWidth+this.margin.left,i.setStyle(e,"height",a+"px"),i.setStyle(e,"width",l+"px"),i.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-l),Math.min(s,u))}}}else i.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},this.setMargin=function(e,t,n,r){var i=this.margin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),i.translate(this.content,-this.scrollLeft,-n.offset);var s=n.width+2*this.$padding+"px",o=n.minHeight+"px";i.setStyle(this.content.style,"width",s),i.setStyle(this.content.style,"height",o)}if(e&this.CHANGE_H_SCROLL&&(i.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender")}else this.$changes|=e},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=!(n<=2*this.lineHeight)&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||r!=this.$vScroll){r!=this.$vScroll&&(this.$vScroll=r,this.scrollBarV.setVisible(r));var i=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,i,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength()*this.lineHeight,i=this.$getLongestLine(),s=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-i-2*this.$padding<0),o=this.$horizScroll!==s;o&&(this.$horizScroll=s,this.scrollBarH.setVisible(s));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,u=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;r+=u;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,r-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,i+2*this.$padding-t.scrollerWidth+c.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-r+u<0||this.scrollTop>c.top),d=a!==h;d&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var f,p,m=this.scrollTop%this.lineHeight,g=Math.ceil(l/this.lineHeight)-1,E=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),v=E+g,C=this.lineHeight;E=e.screenToDocumentRow(E,0);var D=e.getFoldLine(E);D&&(E=D.start.row),f=e.documentToScreenRow(E,0),p=e.getRowLength(E)*C,v=Math.min(e.screenToDocumentRow(v,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(v)*C+p,m=this.scrollTop-f*C;var S=0;return(this.layerConfig.width!=i||o)&&(S=this.CHANGE_H_SCROLL),(o||d)&&(S|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(i=this.$getLongestLine())),this.layerConfig={width:i,padding:this.$padding,firstRow:E,firstRowScreen:f,lastRow:v,lineHeight:C,characterWidth:this.characterWidth,minHeight:l,maxHeight:r,offset:m,gutterOffset:C?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/C)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(i-this.$padding),S},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1||tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t,n){if(0!==this.$size.scrollerHeight){var r=this.$cursorLayer.getPixelPosition(e),i=r.left,s=r.top,o=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+o>s?(t&&l+o>s+this.lineHeight&&(s-=t*this.$size.scrollerHeight),0===s&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):l+this.$size.scrollerHeight-ai?(i=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:a,side:s-a>0?1:-1,offsetX:i}},this.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),a=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),i)},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),s=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+s-this.scrollTop}},this.visualizeFocus=function(){i.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){i.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),e.useTextareaForIME=this.$useTextareaForIME,this.$useTextareaForIME?(i.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),i.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText,this.$composition=null,this.$cursorLayer.element.style.display="")},this.addToken=function(e,t,n,r){var i=this.session;i.bgTokenizer.lines[n]=null;var s={type:t,value:e},o=i.getTokens(n);if(null==r)o.push(s);else for(var a=0,l=0;l50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,n){var r=null,i=!1,a=Object.create(s),u=[],c=new l({messageBuffer:u,terminate:function(){},postMessage:function(e){u.push(e),r&&(i?setTimeout(h):h())}});c.setEmitSync=function(e){i=e};var h=function(){var e=u.shift();e.command?r[e.command].apply(r,e.args):e.event&&a._signal(e.event,e.data)};return a.postMessage=function(e){c.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},o.loadModule(["worker",t],function(e){for(r=new e[n](a);u.length;)h()}),c},t.WorkerClient=l,t.createWorker=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(e,t,n,r,i,s){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,i),this.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,s=t.start.column-this.pos.column;if(this.updateAnchors(e),i&&(this.length+=n),i&&!this.session.$fromUndo)if("insert"===e.action)for(var o=this.others.length-1;o>=0;o--){var a={row:(l=this.others[o]).row,column:l.column+s};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(o=this.others.length-1;o>=0;o--){var l;a={row:(l=this.others[o]).row,column:l.column+s},this.doc.remove(new r(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,i){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),i,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)}},this.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new r,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{n=this.getRange();var r=this.isBackwards(),s=n.start.row,o=n.end.row;if(s==o){if(r)var a=n.end,l=n.start;else a=n.start,l=n.end;return this.addRange(i.fromPoints(l,l)),void this.addRange(i.fromPoints(a,a))}var u=[],c=this.getLineRange(s,!0);c.start.column=n.start.column,u.push(c);for(var h=s+1;h1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(r,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],s=e.column0;)E--;if(E>0)for(var v=0;r[v].isEmpty();)v++;for(var C=E;C>=v;C--)r[C].isEmpty()&&r.splice(C,1)}return r}}.call(s.prototype);var d=e("./editor").Editor;function f(e,t){return e.row==t.row&&e.column==t.column}function p(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",o),e.commands.addCommands(u.defaultCommands),function(e){if(e.textInput){var t=e.textInput.getElement(),n=!1;a.addListener(t,"keydown",function(t){var i=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&i?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&r()}),a.addListener(t,"keyup",r),a.addListener(t,"blur",r)}function r(t){n&&(e.renderer.setMouseCursor(""),n=!1)}}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var r=e[n];if(r.marker){this.session.removeMarker(r.marker);var i=t.indexOf(r);-1!=i&&t.splice(i,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(u.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(u.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?r=n.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?r=n.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});else{var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return r}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var r,i=n&&n.keepOrder,o=1==n||n&&n.$byLines,a=this.session,l=this.selection,u=l.rangeList,c=(i?l:u).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var h=l._eventRegistry;l._eventRegistry={};var d=new s(a);this.inVirtualSelectionMode=!0;for(var f=c.length;f--;){if(o)for(;f>0&&c[f].start.row==c[f-1].end.row;)f--;d.fromOrientedRange(c[f]),d.index=f,this.selection=a.selection=d;var p=e.exec?e.exec(this,t||{}):e(this,t||{});r||void 0===p||(r=p),d.toOrientedRange(c[f])}d.detach(),this.selection=a.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=h,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),r}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],r=0;ro&&(o=n.column),rc?e.insert(r,l.stringRepeat(" ",s-c)):e.remove(new i(r.row,r.column,r.row,r.column-s+c)),t.start.column=t.end.column=o,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var c=this.selection.getRange(),h=c.start.row,d=c.end.row,f=h==d;if(f){var p,m=this.session.getLength();do{p=this.session.getLine(d)}while(/[=:]/.test(p)&&++d0);h<0&&(h=0),d>=m&&(d=m-1)}var g=this.session.removeFullLines(h,d);g=this.$reAlignText(g,f),this.session.insert({row:h,column:0},g.join("\n")+"\n"),f||(c.start.column=0,c.end.column=g[g.length-1].length),this.selection.setRange(c)}},this.$reAlignText=function(e,t){var n,r,i,s=!0,o=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==n?(n=t[1].length,r=t[2].length,i=t[3].length,t):(n+r+i!=t[1].length+t[2].length+t[3].length&&(o=!1),n!=t[1].length&&(s=!1),n>t[1].length&&(n=t[1].length),rt[3].length&&(i=t[3].length),t):[e]}).map(t?u:s?o?function(e){return e[2]?a(n+r-e[2].length)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:u:function(e){return e[2]?a(n)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function a(e){return l.stringRepeat(" ",e)}function u(e){return e[2]?a(n)+e[2]+a(r-e[2].length+i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=p,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){p(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,s=e.getLine(t),o=s.search(i);if(-1!=o){for(var a=n||s.length,l=e.getLength(),u=t,c=t;++tu){var f=e.getLine(c).length;return new r(u,a,c,f)}}},this.openingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i+1},a=e.$findClosingBracket(t,o,s);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>o.row&&(a.row--,a.column=e.getLine(a.row).length),r.fromPoints(o,a)}},this.closingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i},a=e.$findOpeningBracket(t,o);if(a)return a.column++,o.column--,r.fromPoints(a,o)}}).call(i.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}e("./range").Range,function(){this.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(n&&e.action){for(var r=e.data,i=r.start.row,s=r.end.row,o="add"==e.action,a=i+1;a0&&!r[i];)i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=s;o++){var a=r[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var u=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(u-=t.scrollLeft),a.el.style.left=u+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}.call(i.prototype),t.LineWidgets=i}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,n){"use strict";var r=e("../line_widgets").LineWidgets,i=e("../lib/dom"),s=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var o=e.getCursorPosition(),a=o.row,l=n.widgetManager.getWidgetsAtRow(a).filter(function(e){return"errorMarker"==e.type})[0];l?l.destroy():a-=t;var u,c=function(e,t,n){var r=e.getAnnotations().sort(s.comparePoints);if(r.length){var i=function(e,t,n){for(var r=0,i=e.length-1;r<=i;){var s=r+i>>1,o=n(t,e[s]);if(o>0)r=s+1;else{if(!(o<0))return s;i=s-1}}return-(r+1)}(r,{row:t,column:-1},s.comparePoints);i<0&&(i=-i-1),i>=r.length?i=n>0?0:r.length-1:0===i&&n<0&&(i=r.length-1);var o=r[i];if(o&&n){if(o.row===t){do{o=r[i+=n]}while(o&&o.row===t);if(!o)return r.slice()}var a=[];t=o.row;do{a[n<0?"unshift":"push"](o),o=r[i+=n]}while(o&&o.row==t);return a.length&&a}}}(n,a,t);if(c){var h=c[0];o.column=(h.pos&&"number"!=typeof h.column?h.pos.sc:h.column)||0,o.row=h.row,u=e.renderer.$gutterLayer.$annotations[o.row]}else{if(l)return;u={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(o.row),e.selection.moveToPosition(o);var d={row:o.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},f=d.el.appendChild(i.createElement("div")),p=d.el.appendChild(i.createElement("div"));p.className="error_widget_arrow "+u.className;var m=e.renderer.$cursorLayer.getPixelPosition(o).left;p.style.left=m+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",f.className="error_widget "+u.className,f.innerHTML=u.text.join("
"),f.appendChild(i.createElement("div"));var g=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(g),n.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(g),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t,r){"use strict";e("./lib/fixoldbrowsers");var i=e("./lib/dom"),s=e("./lib/event"),o=e("./range").Range,a=e("./editor").Editor,l=e("./edit_session").EditSession,u=e("./undomanager").UndoManager,c=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,t.define=n.amdD,t.edit=function(e,n){if("string"==typeof e){var r=e;if(!(e=document.getElementById(r)))throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof a)return e.env.editor;var o="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;o=l.value,e=i.createElement("pre"),l.parentNode.replaceChild(e,l)}else e&&(o=e.textContent,e.innerHTML="");var u=t.createEditSession(o),h=new a(new c(e),u,n),d={document:u,editor:h,onResize:h.resize.bind(h,null)};return l&&(d.textarea=l),s.addListener(window,"resize",d.onResize),h.on("destroy",function(){s.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),h.container.env=h.env=d,h},t.createEditSession=function(e,t){var n=new l(e,t);return n.setUndoManager(new u),n},t.Range=o,t.Editor=a,t.EditSession=l,t.UndoManager=u,t.VirtualRenderer=c,t.version=t.config.version}),ace.require(["ace/ace"],function(t){for(var n in t&&(t.config.init(!0),t.define=ace.define),window.ace||(window.ace=t),t)t.hasOwnProperty(n)&&(window.ace[n]=t[n]);window.ace.default=window.ace,e&&(e.exports=window.ace)}),e.exports={ace}},247(e,t,n){"use strict";var r=n(982),i=n(159),s=n(961);function o(e){var t="https://react.dev/errors/"+e;if(1P||(e.current=M[P],M[P]=null,P--)}function $(e,t){P++,M[P]=e.current,e.current=t}var G,V,W=B(null),H=B(null),j=B(null),z=B(null);function X(e,t){switch($(j,t),$(H,e),$(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=Eh(t=gh(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(W),$(W,e)}function K(){U(W),U(H),U(j)}function Y(e){null!==e.memoizedState&&$(z,e);var t=W.current,n=Eh(t,e.type);t!==n&&($(H,e),$(W,n))}function q(e){H.current===e&&(U(W),U(H)),z.current===e&&(U(z),ud._currentValue=k)}function Q(e){if(void 0===G)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);G=t&&t[1]||"",V=-1)":-1--i||l[r]!==u[i]){var c="\n"+l[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}}while(1<=r&&0<=i);break}}}finally{Z=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Q(n):""}function ee(e,t){switch(e.tag){case 26:case 27:case 5:return Q(e.type);case 16:return Q("Lazy");case 13:return e.child!==t&&null!==t?Q("Suspense Fallback"):Q("Suspense");case 19:return Q("SuspenseList");case 0:case 15:return J(e.type,!1);case 11:return J(e.type.render,!1);case 1:return J(e.type,!0);case 31:return Q("Activity");default:return""}}function te(e){try{var t="",n=null;do{t+=ee(e,n),n=e,e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var ne=Object.prototype.hasOwnProperty,re=r.unstable_scheduleCallback,ie=r.unstable_cancelCallback,se=r.unstable_shouldYield,oe=r.unstable_requestPaint,ae=r.unstable_now,le=r.unstable_getCurrentPriorityLevel,ue=r.unstable_ImmediatePriority,ce=r.unstable_UserBlockingPriority,he=r.unstable_NormalPriority,de=r.unstable_LowPriority,fe=r.unstable_IdlePriority,pe=r.log,me=r.unstable_setDisableYieldValue,ge=null,Ee=null;function ve(e){if("function"==typeof pe&&me(e),Ee&&"function"==typeof Ee.setStrictMode)try{Ee.setStrictMode(ge,e)}catch(e){}}var Ce=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(De(e)/Se|0)|0},De=Math.log,Se=Math.LN2,Ae=256,_e=262144,ye=4194304;function be(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Te(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var i=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var a=134217727&r;return 0!==a?0!==(r=a&~s)?i=be(r):0!==(o&=a)?i=be(o):n||0!==(n=a&~e)&&(i=be(n)):0!==(a=r&~s)?i=be(a):0!==o?i=be(o):n||0!==(n=r&~e)&&(i=be(n)),0===i?0:0!==t&&t!==i&&0===(t&s)&&((s=i&-i)>=(n=t&-t)||32===s&&4194048&n)?t:i}function Re(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function we(){var e=ye;return!(62914560&(ye<<=1))&&(ye=4194304),e}function Fe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ne(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Le(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ce(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function Oe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ce(n),i=1<=bn),xn=String.fromCharCode(32),wn=!1;function Fn(e,t){switch(e){case"keyup":return-1!==_n.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Ln=!1,On={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function In(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!On[e.type]:"textarea"===t}function kn(e,t,n,r){It?kt?kt.push(r):kt=[r]:It=r,0<(t=nh(t,"onChange")).length&&(n=new tn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Mn=null,Pn=null;function Bn(e){Kc(e,0)}function Un(e){if(ft(Qe(e)))return e}function $n(e,t){if("change"===e)return t}var Gn=!1;if($t){var Vn;if($t){var Wn="oninput"in document;if(!Wn){var Hn=document.createElement("div");Hn.setAttribute("oninput","return;"),Wn="function"==typeof Hn.oninput}Vn=Wn}else Vn=!1;Gn=Vn&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Jn(r)}}function tr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?tr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function nr(e){for(var t=pt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=pt((e=t.contentWindow).document)}return t}function rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var ir=$t&&"documentMode"in document&&11>=document.documentMode,sr=null,or=null,ar=null,lr=!1;function ur(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;lr||null==sr||sr!==pt(r)||(r="selectionStart"in(r=sr)&&rr(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},ar&&Zn(ar,r)||(ar=r,0<(r=nh(or,"onSelect")).length&&(t=new tn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=sr)))}function cr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var hr={animationend:cr("Animation","AnimationEnd"),animationiteration:cr("Animation","AnimationIteration"),animationstart:cr("Animation","AnimationStart"),transitionrun:cr("Transition","TransitionRun"),transitionstart:cr("Transition","TransitionStart"),transitioncancel:cr("Transition","TransitionCancel"),transitionend:cr("Transition","TransitionEnd")},dr={},fr={};function pr(e){if(dr[e])return dr[e];if(!hr[e])return e;var t,n=hr[e];for(t in n)if(n.hasOwnProperty(t)&&t in fr)return dr[e]=n[t];return e}$t&&(fr=document.createElement("div").style,"AnimationEvent"in window||(delete hr.animationend.animation,delete hr.animationiteration.animation,delete hr.animationstart.animation),"TransitionEvent"in window||delete hr.transitionend.transition);var mr=pr("animationend"),gr=pr("animationiteration"),Er=pr("animationstart"),vr=pr("transitionrun"),Cr=pr("transitionstart"),Dr=pr("transitioncancel"),Sr=pr("transitionend"),Ar=new Map,_r="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function yr(e,t){Ar.set(e,t),nt(t,[e])}_r.push("scrollEnd");var br="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Tr=[],Rr=0,xr=0;function wr(){for(var e=Rr,t=xr=Rr=0;t>=o,i-=o,ti=1<<32-Ce(t)+i|n<p?(m=h,h=null):m=h.sibling;var g=f(i,h,a[p],l);if(null===g){null===h&&(h=m);break}e&&h&&null===g.alternate&&t(i,h),o=s(g,o,p),null===c?u=g:c.sibling=g,c=g,h=m}if(p===a.length)return n(i,h),ci&&ri(i,p),u;if(null===h){for(;pm?(g=p,p=null):g=p.sibling;var C=f(i,p,v.value,u);if(null===C){null===p&&(p=g);break}e&&p&&null===C.alternate&&t(i,p),a=s(C,a,m),null===h?c=C:h.sibling=C,h=C,p=g}if(v.done)return n(i,p),ci&&ri(i,m),c;if(null===p){for(;!v.done;m++,v=l.next())null!==(v=d(i,v.value,u))&&(a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return ci&&ri(i,m),c}for(p=r(p);!v.done;m++,v=l.next())null!==(v=E(p,i,m,v.value,u))&&(e&&null!==v.alternate&&p.delete(null===v.key?m:v.key),a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return e&&p.forEach(function(e){return t(i,e)}),ci&&ri(i,m),c}(l,u,c=C.call(c),h)}if("function"==typeof c.then)return v(l,u,ls(c),h);if(c.$$typeof===D)return v(l,u,Li(l,c),h);cs(l,c)}return"string"==typeof c&&""!==c||"number"==typeof c||"bigint"==typeof c?(c=""+c,null!==u&&6===u.tag?(n(l,u.sibling),(h=i(u,c)).return=l,l=h):(n(l,u),(h=Wr(c,l.mode,h)).return=l,l=h),a(l)):n(l,u)}return function(e,t,n,r){try{as=0;var i=v(e,t,n,r);return os=null,i}catch(t){if(t===qi||t===Zi)throw t;var s=Pr(29,t,null,e.mode);return s.lanes=r,s.return=e,s}}}var ds=hs(!0),fs=hs(!1),ps=!1;function ms(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Es(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vs(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&du){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ir(e),Or(e,null,n),t}return Fr(e,r,t,n),Ir(e)}function Cs(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Oe(e,n)}}function Ds(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===s?i=s=o:s=s.next=o,n=n.next}while(null!==n);null===s?i=s=t:s=s.next=t}else i=s=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ss=!1;function As(){if(Ss&&null!==Wi)throw Wi}function _s(e,t,n,r){Ss=!1;var i=e.updateQueue;ps=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var l=a,u=l.next;l.next=null,null===o?s=u:o.next=u,o=l;var c=e.alternate;null!==c&&(a=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===a?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l)}if(null!==s){var h=i.baseState;for(o=0,c=u=l=null,a=s;;){var f=-536870913&a.lane,p=f!==a.lane;if(p?(mu&f)===f:(r&f)===f){0!==f&&f===Vi&&(Ss=!0),null!==c&&(c=c.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var m=e,g=a;f=t;var E=n;switch(g.tag){case 1:if("function"==typeof(m=g.payload)){h=m.call(E,h,f);break e}h=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(f="function"==typeof(m=g.payload)?m.call(E,h,f):m))break e;h=d({},h,f);break e;case 2:ps=!0}}null!==(f=a.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=i.callbacks)?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===c?(u=c=p,l=h):c=c.next=p,o|=f;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(p=a).next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}null===c&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null===s&&(i.shared.lanes=0),_u|=o,e.lanes=o,e.memoizedState=h}}function ys(e,t){if("function"!=typeof e)throw Error(o(191,e));e.call(t)}function bs(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;es?s:8;var o,a,l,u=O.T,c={};O.T=c,ca(e,!1,t,n);try{var h=i(),d=O.S;null!==d&&d(c,h),null!==h&&"object"==typeof h&&"function"==typeof h.then?ua(e,t,(o=r,a=[],l={status:"pending",value:null,reason:null,then:function(e){a.push(e)}},h.then(function(){l.status="fulfilled",l.value=o;for(var e=0;e<\/script>",s=s.removeChild(s.firstChild);break;case"select":s="string"==typeof r.is?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s="string"==typeof r.is?a.createElement(i,{is:r.is}):a.createElement(i)}}s[$e]=t,s[Ge]=r;e:for(a=t.child;null!==a;){if(5===a.tag||6===a.tag)s.appendChild(a.stateNode);else if(4!==a.tag&&27!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;null===a.sibling;){if(null===a.return||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=s;e:switch(hh(s,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&ol(t)}}return hl(t),al(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&ol(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));if(e=j.current,Ei(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(i=li))switch(i.tag){case 27:case 5:r=i.memoizedProps}e[$e]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||lh(e.nodeValue,n)))||pi(t,!0)}else(e=mh(e).createTextNode(r))[$e]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(r=Ei(t),null!==n){if(null===e){if(!r)throw Error(o(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(o(557));e[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Ps(t),t):(Ps(t),null);if(128&t.flags)throw Error(o(558))}return hl(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=Ei(t),null!==r&&null!==r.dehydrated){if(null===e){if(!i)throw Error(o(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(o(317));i[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),i=!1}else i=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return 256&t.flags?(Ps(t),t):(Ps(t),null)}return Ps(t),128&t.flags?(t.lanes=n,t):(n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(i=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(i=r.alternate.memoizedState.cachePool.pool),s=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(s=r.memoizedState.cachePool.pool),s!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ul(t,t.updateQueue),hl(t),null);case 4:return K(),null===e&&Zc(t.stateNode.containerInfo),hl(t),null;case 10:return bi(t.type),hl(t),null;case 19:if(U(Bs),null===(r=t.memoizedState))return hl(t),null;if(i=!!(128&t.flags),null===(s=r.rendering))if(i)cl(r,!1);else{if(0!==Au||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(s=Us(e))){for(t.flags|=128,cl(r,!1),e=s.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)$r(n,e),n=n.sibling;return $(Bs,1&Bs.current|2),ci&&ri(t,r.treeForkCount),t.child}e=e.sibling}null!==r.tail&&ae()>Ou&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=Us(s))){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),cl(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!ci)return hl(t),null}else 2*ae()-r.renderingStartTime>Ou&&536870912!==n&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=r.last)?e.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ae(),e.sibling=null,n=Bs.current,$(Bs,i?1&n|2:1&n),ci&&ri(t,r.treeForkCount),e):(hl(t),null);case 22:case 23:return Ps(t),Fs(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?!!(536870912&n)&&!(128&t.flags)&&(hl(t),6&t.subtreeFlags&&(t.flags|=8192)):hl(t),null!==(n=t.updateQueue)&&ul(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&U(zi),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),bi(Pi),hl(t),null;case 25:case 30:return null}throw Error(o(156,t.tag))}function fl(e,t){switch(oi(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return bi(Pi),K(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return q(t),null;case 31:if(null!==t.memoizedState){if(Ps(t),null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Ps(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return U(Bs),null;case 4:return K(),null;case 10:return bi(t.type),null;case 22:case 23:return Ps(t),Fs(),null!==e&&U(zi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return bi(Pi),null;default:return null}}function pl(e,t){switch(oi(t),t.tag){case 3:bi(Pi),K();break;case 26:case 27:case 5:q(t);break;case 4:K();break;case 31:null!==t.memoizedState&&Ps(t);break;case 13:Ps(t);break;case 19:U(Bs);break;case 10:bi(t.type);break;case 22:case 23:Ps(t),Fs(),null!==e&&U(zi);break;case 24:bi(Pi)}}function ml(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var s=n.create,o=n.inst;r=s(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ac(t,t.return,e)}}function gl(e,t,n){try{var r=t.updateQueue,i=null!==r?r.lastEffect:null;if(null!==i){var s=i.next;r=s;do{if((r.tag&e)===e){var o=r.inst,a=o.destroy;if(void 0!==a){o.destroy=void 0,i=t;var l=n,u=a;try{u()}catch(e){Ac(i,l,e)}}}r=r.next}while(r!==s)}}catch(e){Ac(t,t.return,e)}}function El(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{bs(t,n)}catch(t){Ac(e,e.return,t)}}}function vl(e,t,n){n.props=Aa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ac(e,t,n)}}function Cl(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(n){Ac(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(n){Ac(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){Ac(e,t,n)}else n.current=null}function Sl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ac(e,e.return,t)}}function Al(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,a=null,l=null,u=null,c=null,h=null;for(p in n){var d=n[p];if(n.hasOwnProperty(p)&&null!=d)switch(p){case"checked":case"value":break;case"defaultValue":u=d;default:r.hasOwnProperty(p)||uh(e,t,p,null,r,d)}}for(var f in r){var p=r[f];if(d=n[f],r.hasOwnProperty(f)&&(null!=p||null!=d))switch(f){case"type":s=p;break;case"name":i=p;break;case"checked":c=p;break;case"defaultChecked":h=p;break;case"value":a=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(o(137,t));break;default:p!==d&&uh(e,t,f,p,r,d)}}return void Et(e,a,l,u,c,h,s,i);case"select":for(s in p=a=l=f=null,n)if(u=n[s],n.hasOwnProperty(s)&&null!=u)switch(s){case"value":break;case"multiple":p=u;default:r.hasOwnProperty(s)||uh(e,t,s,null,r,u)}for(i in r)if(s=r[i],u=n[i],r.hasOwnProperty(i)&&(null!=s||null!=u))switch(i){case"value":f=s;break;case"defaultValue":l=s;break;case"multiple":a=s;default:s!==u&&uh(e,t,i,s,r,u)}return t=l,n=a,r=p,void(null!=f?Dt(e,!!n,f,!1):!!r!=!!n&&(null!=t?Dt(e,!!n,t,!0):Dt(e,!!n,n?[]:"",!1)));case"textarea":for(l in p=f=null,n)if(i=n[l],n.hasOwnProperty(l)&&null!=i&&!r.hasOwnProperty(l))switch(l){case"value":case"children":break;default:uh(e,t,l,null,r,i)}for(a in r)if(i=r[a],s=n[a],r.hasOwnProperty(a)&&(null!=i||null!=s))switch(a){case"value":f=i;break;case"defaultValue":p=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(o(91));break;default:i!==s&&uh(e,t,a,i,r,s)}return void St(e,f,p);case"option":for(var m in n)f=n[m],n.hasOwnProperty(m)&&null!=f&&!r.hasOwnProperty(m)&&("selected"===m?e.selected=!1:uh(e,t,m,null,r,f));for(u in r)f=r[u],p=n[u],!r.hasOwnProperty(u)||f===p||null==f&&null==p||("selected"===u?e.selected=f&&"function"!=typeof f&&"symbol"!=typeof f:uh(e,t,u,f,r,p));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)f=n[g],n.hasOwnProperty(g)&&null!=f&&!r.hasOwnProperty(g)&&uh(e,t,g,null,r,f);for(c in r)if(f=r[c],p=n[c],r.hasOwnProperty(c)&&f!==p&&(null!=f||null!=p))switch(c){case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(o(137,t));break;default:uh(e,t,c,f,r,p)}return;default:if(Rt(t)){for(var E in n)f=n[E],n.hasOwnProperty(E)&&void 0!==f&&!r.hasOwnProperty(E)&&ch(e,t,E,void 0,r,f);for(h in r)f=r[h],p=n[h],!r.hasOwnProperty(h)||f===p||void 0===f&&void 0===p||ch(e,t,h,f,r,p);return}}for(var v in n)f=n[v],n.hasOwnProperty(v)&&null!=f&&!r.hasOwnProperty(v)&&uh(e,t,v,null,r,f);for(d in r)f=r[d],p=n[d],!r.hasOwnProperty(d)||f===p||null==f&&null==p||uh(e,t,d,f,r,p)}(r,e.type,n,t),r[Ge]=t}catch(t){Ac(e,e.return,t)}}function _l(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&bh(e.type)||4===e.tag}function yl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||_l(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&bh(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function bl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Nt));else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(bl(e,t,n),e=e.sibling;null!==e;)bl(e,t,n),e=e.sibling}function Tl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Tl(e,t,n),e=e.sibling;null!==e;)Tl(e,t,n),e=e.sibling}function Rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);hh(t,r,n),t[$e]=e,t[Ge]=n}catch(t){Ac(e,e.return,t)}}var xl=!1,wl=!1,Fl=!1,Nl="function"==typeof WeakSet?WeakSet:Set,Ll=null;function Ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Xl(e,n),4&r&&ml(5,n);break;case 1:if(Xl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){Ac(n,n.return,e)}else{var i=Aa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ac(n,n.return,e)}}64&r&&El(n),512&r&&Cl(n,n.return);break;case 3:if(Xl(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{bs(e,t)}catch(e){Ac(n,n.return,e)}}break;case 27:null===t&&4&r&&Rl(n);case 26:case 5:Xl(e,n),null===t&&4&r&&Sl(n),512&r&&Cl(n,n.return);break;case 12:Xl(e,n);break;case 31:Xl(e,n),4&r&&Ul(e,n);break;case 13:Xl(e,n),4&r&&$l(e,n),64&r&&null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Tc.bind(null,n));break;case 22:if(!(r=null!==n.memoizedState||xl)){t=null!==t&&null!==t.memoizedState||wl,i=xl;var s=wl;xl=r,(wl=t)&&!s?Yl(e,n,!!(8772&n.subtreeFlags)):Xl(e,n),xl=i,wl=s}break;case 30:break;default:Xl(e,n)}}function Il(e){var t=e.alternate;null!==t&&(e.alternate=null,Il(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&Ke(t),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var kl=null,Ml=!1;function Pl(e,t,n){for(n=n.child;null!==n;)Bl(e,t,n),n=n.sibling}function Bl(e,t,n){if(Ee&&"function"==typeof Ee.onCommitFiberUnmount)try{Ee.onCommitFiberUnmount(ge,n)}catch(e){}switch(n.tag){case 26:wl||Dl(n,t),Pl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:wl||Dl(n,t);var r=kl,i=Ml;bh(n.type)&&(kl=n.stateNode,Ml=!1),Pl(e,t,n),Ph(n.stateNode),kl=r,Ml=i;break;case 5:wl||Dl(n,t);case 6:if(r=kl,i=Ml,kl=null,Pl(e,t,n),Ml=i,null!==(kl=r))if(Ml)try{(9===kl.nodeType?kl.body:"HTML"===kl.nodeName?kl.ownerDocument.body:kl).removeChild(n.stateNode)}catch(e){Ac(n,t,e)}else try{kl.removeChild(n.stateNode)}catch(e){Ac(n,t,e)}break;case 18:null!==kl&&(Ml?(Th(9===(e=kl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Gd(e)):Th(kl,n.stateNode));break;case 4:r=kl,i=Ml,kl=n.stateNode.containerInfo,Ml=!0,Pl(e,t,n),kl=r,Ml=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),wl||gl(4,n,t),Pl(e,t,n);break;case 1:wl||(Dl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&vl(n,t,r)),Pl(e,t,n);break;case 21:Pl(e,t,n);break;case 22:wl=(r=wl)||null!==n.memoizedState,Pl(e,t,n),wl=r;break;default:Pl(e,t,n)}}function Ul(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)){e=e.dehydrated;try{Gd(e)}catch(e){Ac(t,t.return,e)}}}function $l(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{Gd(e)}catch(e){Ac(t,t.return,e)}}function Gl(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Nl),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Nl),t;default:throw Error(o(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Rc.bind(null,e,t);t.then(r,r)}})}function Vl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r title"))),hh(s,r,n),s[$e]=e,Je(s),r=s;break e;case"link":var a=td("link","href",i).get(r+(n.href||""));if(a)for(var l=0;la)break;var c=l.transferSize,h=l.initiatorType;c&&dh(h)&&(o+=c*((l=l.responseEnd)id?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}(h,p)))return Uu=s,e.cancelPendingCommit=p(pc.bind(null,e,t,s,n,r,i,o,a,l,c,h,null,d,f)),void Qu(e,s,o,!u)}pc(e,t,s,n,r,i,o,a,l)}function qu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var r=0;rg&&(o=g,g=m,m=o);var E=er(a,m),v=er(a,g);if(E&&v&&(1!==f.rangeCount||f.anchorNode!==E.node||f.anchorOffset!==E.offset||f.focusNode!==v.node||f.focusOffset!==v.offset)){var C=h.createRange();C.setStart(E.node,E.offset),f.removeAllRanges(),m>g?(f.addRange(C),f.extend(v.node,v.offset)):(C.setEnd(v.node,v.offset),f.addRange(C))}}}}for(h=[],f=a;f=f.parentNode;)1===f.nodeType&&h.push({element:f,left:f.scrollLeft,top:f.scrollTop});for("function"==typeof a.focus&&a.focus(),a=0;an?32:n,O.T=null,n=Gu,Gu=null;var s=Pu,a=Uu;if(Mu=0,Bu=Pu=null,Uu=0,6&du)throw Error(o(331));var l=du;if(du|=4,au(s.current),Jl(s,s.current,a,n),du=l,kc(0,!1),Ee&&"function"==typeof Ee.onPostCommitFiberRoot)try{Ee.onPostCommitFiberRoot(ge,s)}catch(e){}return!0}finally{I.p=i,O.T=r,vc(e,t)}}function Sc(e,t,n){t=Xr(n,t),null!==(e=vs(e,t=xa(e.stateNode,t,2),2))&&(Ne(e,2),Ic(e))}function Ac(e,t,n){if(3===e.tag)Sc(e,e,n);else for(;null!==t;){if(3===t.tag){Sc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===ku||!ku.has(r))){e=Xr(n,e),null!==(r=vs(t,n=wa(2),2))&&(Fa(n,r,t,e),Ne(r,2),Ic(r));break}}t=t.return}}function _c(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hu;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(Du=!0,i.add(n),e=yc.bind(null,e,t,n),t.then(e,e))}function yc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,fu===e&&(mu&n)===n&&(4===Au||3===Au&&(62914560&mu)===mu&&300>ae()-Nu?!(2&du)&&ec(e,0):bu|=n,Ru===mu&&(Ru=0)),Ic(e)}function bc(e,t){0===t&&(t=we()),null!==(e=Lr(e,t))&&(Ne(e,t),Ic(e))}function Tc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),bc(e,n)}function Rc(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}null!==r&&r.delete(t),bc(e,n)}var xc=null,wc=null,Fc=!1,Nc=!1,Lc=!1,Oc=0;function Ic(e){e!==wc&&null===e.next&&(null===wc?xc=wc=e:wc=wc.next=e),Nc=!0,Fc||(Fc=!0,_h(function(){6&du?re(ue,Mc):Pc()}))}function kc(e,t){if(!Lc&&Nc){Lc=!0;do{for(var n=!1,r=xc;null!==r;){if(!t)if(0!==e){var i=r.pendingLanes;if(0===i)var s=0;else{var o=r.suspendedLanes,a=r.pingedLanes;s=(1<<31-Ce(42|e)+1)-1,s=201326741&(s&=i&~(o&~a))?201326741&s|1:s?2|s:0}0!==s&&(n=!0,$c(r,s))}else s=mu,!(3&(s=Te(r,r===fu?s:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Re(r,s)||(n=!0,$c(r,s));r=r.next}}while(n);Lc=!1}}function Mc(){Pc()}function Pc(){Nc=Fc=!1;var e,t=0;0!==Oc&&((e=window.event)&&"popstate"===e.type?e!==Ch&&(Ch=e,1):(Ch=null,0))&&(t=Oc);for(var n=ae(),r=null,i=xc;null!==i;){var s=i.next,o=Bc(i,n);0===o?(i.next=null,null===r?xc=s:r.next=s,null===s&&(wc=r)):(r=i,(0!==t||3&o)&&(Nc=!0)),i=s}0!==Mu&&5!==Mu||kc(t,!1),0!==Oc&&(Oc=0)}function Bc(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=-62914561&e.pendingLanes;0 title"):null)}function rd(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var id=0;function sd(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)ad(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var od=null;function ad(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,od=new Map,t.forEach(ld,e),od=null,sd.call(e))}function ld(e,t){if(!(4&t.state.loading)){var n=od.get(e);if(n)var r=n.get(null);else{n=new Map,od.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s>>1,i=e[r];if(!(0>>1;rs(l,n))us(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[a]=n,r=a);else{if(!(us(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var u=[],c=[],h=1,d=null,f=3,p=!1,m=!1,g=!1,E=!1,v="function"==typeof setTimeout?setTimeout:null,C="function"==typeof clearTimeout?clearTimeout:null,D="undefined"!=typeof setImmediate?setImmediate:null;function S(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function A(e){if(g=!1,S(e),!m)if(null!==r(u))m=!0,y||(y=!0,_());else{var t=r(c);null!==t&&L(A,t.startTime-e)}}var _,y=!1,b=-1,T=5,R=-1;function x(){return!(!E&&t.unstable_now()-Re&&x());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var a=o(d.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof a){d.callback=a,S(e),n=!0;break t}d===r(u)&&i(u),S(e)}else i(u);d=r(u)}if(null!==d)n=!0;else{var l=r(c);null!==l&&L(A,l.startTime-e),n=!1}}break e}finally{d=null,f=s,p=!1}n=void 0}}finally{n?_():y=!1}}}if("function"==typeof D)_=function(){D(w)};else if("undefined"!=typeof MessageChannel){var F=new MessageChannel,N=F.port2;F.port1.onmessage=w,_=function(){N.postMessage(null)}}else _=function(){v(w,0)};function L(e,n){b=v(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125o?(e.sortIndex=s,n(c,e),null===r(u)&&e===r(c)&&(g?(C(b),b=-1):g=!0,L(A,s-o))):(e.sortIndex=a,n(u,e),m||p||(m=!0,y||(y=!0,_()))),e},t.unstable_shouldYield=x,t.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}},982(e,t,n){"use strict";e.exports=n(477)},902(e,t,n){"use strict";var r=n(72),i=n.n(r),s=n(825),o=n.n(s),a=n(659),l=n.n(a),u=n(56),c=n.n(u),h=n(540),d=n.n(h),f=n(113),p=n.n(f),m=n(636),g={};g.styleTagTransform=p(),g.setAttributes=c(),g.insert=l().bind(null,"html"),g.domAPI=o(),g.insertStyleElement=d(),i()(m.A,g),m.A&&m.A.locals&&m.A.locals},72(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},878(e,t,n){"use strict";n.r(t),n.d(t,{EmbeddedFrontend:()=>Id,Spector:()=>kd});var r={};n.r(r),n.d(r,{LX:()=>Jo,ll:()=>ea});var i,s={};n.r(s),n.d(s,{SyntaxError:()=>Xc,parse:()=>Yc});class o{static isBuildableProgram(e){return!!e&&!!e[this.rebuildProgramFunctionName]}static rebuildProgram(e,t,n,r,i){this.isBuildableProgram(e)&&e[this.rebuildProgramFunctionName](t,n,r,i)}}o.rebuildProgramFunctionName="__SPECTOR_rebuildProgram",function(e){e[e.noLog=0]="noLog",e[e.error=1]="error",e[e.warning=2]="warning",e[e.info=3]="info"}(i||(i={}));class a{static error(e,...t){this.level>0&&console.error(e,t)}static warn(e,...t){this.level>1&&console.warn(e,t)}static info(e,...t){this.level>2&&console.log(e,t)}}a.level=i.warning;class l{constructor(){this.callbacks=[],this.counter=-1}add(e,t){return this.counter++,t&&(e=e.bind(t)),this.callbacks[this.counter]=e,this.counter}remove(e){delete this.callbacks[e]}clear(){this.callbacks={}}trigger(e){for(const t in this.callbacks)this.callbacks.hasOwnProperty(t)&&this.callbacks[t](e)}}class u{constructor(){if("undefined"!=typeof performance&&performance.now)this.nowFunction=()=>performance.now();else{const e=new Date;this.nowFunction=e.getTime.bind(e)}}static get now(){return u.instance.nowFunction()}}u.instance=new u;class c{constructor(e){this.options=e}appendAnalysis(e){e.analyses=e.analyses||[];const t=this.getAnalysis(e);e.analyses.push(t)}getAnalysis(e){const t={analyserName:this.analyserName};return this.appendToAnalysis(e,t),t}}class h extends c{get analyserName(){return h.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={};for(const t of e.commands)n[t.name]=n[t.name]||0,n[t.name]++;const r=Object.keys(n).map(e=>[e,n[e]]);r.sort((e,t)=>{const n=t[1]-e[1];return 0===n?e[0].localeCompare(t[0]):n});for(const e of r)t[e[0]]=e[1]}}h.analyserName="Commands";const d=["drawArrays","drawElements","drawArraysInstanced","drawArraysInstancedANGLE","drawElementsInstanced","drawElementsInstancedANGLE","drawRangeElements","multiDrawArraysWEBGL","multiDrawElementsWEBGL","multiDrawArraysInstancedWEBGL","multiDrawElementsInstancedWEBGL","multiDrawArraysInstancedBaseInstanceWEBGL","multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL","drawArraysInstancedBaseInstanceWEBGL","drawElementsInstancedBaseVertexBaseInstanceWEBGL"];class f extends c{get analyserName(){return f.analyserName}appendToAnalysis(e,t){if(e.commands){t.total=e.commands.length,t.draw=0,t.clear=0;for(const n of e.commands)"clear"===n.name?t.clear++:d.indexOf(n.name)>-1&&t.draw++}}}f.analyserName="CommandsSummary";class p{static isWebGlConstant(e){return null!==g[e]&&void 0!==g[e]}static stringifyWebGlConstant(e,t){if(null==e)return"";if(0===e){return this.zeroMeaningByCommand[t]||"0"}if(1===e){return this.oneMeaningByCommand[t]||"1"}const n=g[e];return n?n.name:e+""}}p.DEPTH_BUFFER_BIT={name:"DEPTH_BUFFER_BIT",value:256,description:"Passed to clear to clear the current depth buffer."},p.STENCIL_BUFFER_BIT={name:"STENCIL_BUFFER_BIT",value:1024,description:"Passed to clear to clear the current stencil buffer."},p.COLOR_BUFFER_BIT={name:"COLOR_BUFFER_BIT",value:16384,description:"Passed to clear to clear the current color buffer."},p.POINTS={name:"POINTS",value:0,description:"Passed to drawElements or drawArrays to draw single points."},p.LINES={name:"LINES",value:1,description:"Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it."},p.LINE_LOOP={name:"LINE_LOOP",value:2,description:"Passed to drawElements or drawArrays to draw lines. Each set of two vertices is treated as a separate line segment."},p.LINE_STRIP={name:"LINE_STRIP",value:3,description:"Passed to drawElements or drawArrays to draw a connected group of line segments from the first vertex to the last."},p.TRIANGLES={name:"TRIANGLES",value:4,description:"Passed to drawElements or drawArrays to draw triangles. Each set of three vertices creates a separate triangle."},p.TRIANGLE_STRIP={name:"TRIANGLE_STRIP",value:5,description:"Passed to drawElements or drawArrays to draw a connected group of triangles."},p.TRIANGLE_FAN={name:"TRIANGLE_FAN",value:6,description:"Passed to drawElements or drawArrays to draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan."},p.ZERO={name:"ZERO",value:0,description:"Passed to blendFunc or blendFuncSeparate to turn off a component."},p.ONE={name:"ONE",value:1,description:"Passed to blendFunc or blendFuncSeparate to turn on a component."},p.SRC_COLOR={name:"SRC_COLOR",value:768,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source elements color."},p.ONE_MINUS_SRC_COLOR={name:"ONE_MINUS_SRC_COLOR",value:769,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source elements color."},p.SRC_ALPHA={name:"SRC_ALPHA",value:770,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source's alpha."},p.ONE_MINUS_SRC_ALPHA={name:"ONE_MINUS_SRC_ALPHA",value:771,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source's alpha."},p.DST_ALPHA={name:"DST_ALPHA",value:772,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's alpha."},p.ONE_MINUS_DST_ALPHA={name:"ONE_MINUS_DST_ALPHA",value:773,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's alpha."},p.DST_COLOR={name:"DST_COLOR",value:774,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's color."},p.ONE_MINUS_DST_COLOR={name:"ONE_MINUS_DST_COLOR",value:775,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's color."},p.SRC_ALPHA_SATURATE={name:"SRC_ALPHA_SATURATE",value:776,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the minimum of source's alpha or one minus the destination's alpha."},p.CONSTANT_COLOR={name:"CONSTANT_COLOR",value:32769,description:"Passed to blendFunc or blendFuncSeparate to specify a constant color blend function."},p.ONE_MINUS_CONSTANT_COLOR={name:"ONE_MINUS_CONSTANT_COLOR",value:32770,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant color blend function."},p.CONSTANT_ALPHA={name:"CONSTANT_ALPHA",value:32771,description:"Passed to blendFunc or blendFuncSeparate to specify a constant alpha blend function."},p.ONE_MINUS_CONSTANT_ALPHA={name:"ONE_MINUS_CONSTANT_ALPHA",value:32772,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant alpha blend function."},p.FUNC_ADD={name:"FUNC_ADD",value:32774,description:"Passed to blendEquation or blendEquationSeparate to set an addition blend function."},p.FUNC_SUBSTRACT={name:"FUNC_SUBSTRACT",value:32778,description:"Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination)."},p.FUNC_REVERSE_SUBTRACT={name:"FUNC_REVERSE_SUBTRACT",value:32779,description:"Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source)."},p.BLEND_EQUATION={name:"BLEND_EQUATION",value:32777,description:"Passed to getParameter to get the current RGB blend function."},p.BLEND_EQUATION_RGB={name:"BLEND_EQUATION_RGB",value:32777,description:"Passed to getParameter to get the current RGB blend function. Same as BLEND_EQUATION"},p.BLEND_EQUATION_ALPHA={name:"BLEND_EQUATION_ALPHA",value:34877,description:"Passed to getParameter to get the current alpha blend function. Same as BLEND_EQUATION"},p.BLEND_DST_RGB={name:"BLEND_DST_RGB",value:32968,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_SRC_RGB={name:"BLEND_SRC_RGB",value:32969,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_DST_ALPHA={name:"BLEND_DST_ALPHA",value:32970,description:"Passed to getParameter to get the current destination alpha blend function."},p.BLEND_SRC_ALPHA={name:"BLEND_SRC_ALPHA",value:32971,description:"Passed to getParameter to get the current source alpha blend function."},p.BLEND_COLOR={name:"BLEND_COLOR",value:32773,description:"Passed to getParameter to return a the current blend color."},p.ARRAY_BUFFER_BINDING={name:"ARRAY_BUFFER_BINDING",value:34964,description:"Passed to getParameter to get the array buffer binding."},p.ELEMENT_ARRAY_BUFFER_BINDING={name:"ELEMENT_ARRAY_BUFFER_BINDING",value:34965,description:"Passed to getParameter to get the current element array buffer."},p.LINE_WIDTH={name:"LINE_WIDTH",value:2849,description:"Passed to getParameter to get the current lineWidth (set by the lineWidth method)."},p.ALIASED_POINT_SIZE_RANGE={name:"ALIASED_POINT_SIZE_RANGE",value:33901,description:"Passed to getParameter to get the current size of a point drawn with gl.POINTS"},p.ALIASED_LINE_WIDTH_RANGE={name:"ALIASED_LINE_WIDTH_RANGE",value:33902,description:"Passed to getParameter to get the range of available widths for a line. Returns a length-2 array with the lo value at 0, and hight at 1."},p.CULL_FACE_MODE={name:"CULL_FACE_MODE",value:2885,description:"Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK"},p.FRONT_FACE={name:"FRONT_FACE",value:2886,description:"Passed to getParameter to determine the current value of frontFace. Should return CW or CCW."},p.DEPTH_RANGE={name:"DEPTH_RANGE",value:2928,description:"Passed to getParameter to return a length-2 array of floats giving the current depth range."},p.DEPTH_WRITEMASK={name:"DEPTH_WRITEMASK",value:2930,description:"Passed to getParameter to determine if the depth write mask is enabled."},p.DEPTH_CLEAR_VALUE={name:"DEPTH_CLEAR_VALUE",value:2931,description:"Passed to getParameter to determine the current depth clear value."},p.DEPTH_FUNC={name:"DEPTH_FUNC",value:2932,description:"Passed to getParameter to get the current depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_CLEAR_VALUE={name:"STENCIL_CLEAR_VALUE",value:2961,description:"Passed to getParameter to get the value the stencil will be cleared to."},p.STENCIL_FUNC={name:"STENCIL_FUNC",value:2962,description:"Passed to getParameter to get the current stencil function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_FAIL={name:"STENCIL_FAIL",value:2964,description:"Passed to getParameter to get the current stencil fail function. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_FAIL={name:"STENCIL_PASS_DEPTH_FAIL",value:2965,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test fail. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_PASS={name:"STENCIL_PASS_DEPTH_PASS",value:2966,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test pass. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_REF={name:"STENCIL_REF",value:2967,description:"Passed to getParameter to get the reference value used for stencil tests."},p.STENCIL_VALUE_MASK={name:"STENCIL_VALUE_MASK",value:2963,description:" "},p.STENCIL_WRITEMASK={name:"STENCIL_WRITEMASK",value:2968,description:" "},p.STENCIL_BACK_FUNC={name:"STENCIL_BACK_FUNC",value:34816,description:" "},p.STENCIL_BACK_FAIL={name:"STENCIL_BACK_FAIL",value:34817,description:" "},p.STENCIL_BACK_PASS_DEPTH_FAIL={name:"STENCIL_BACK_PASS_DEPTH_FAIL",value:34818,description:" "},p.STENCIL_BACK_PASS_DEPTH_PASS={name:"STENCIL_BACK_PASS_DEPTH_PASS",value:34819,description:" "},p.STENCIL_BACK_REF={name:"STENCIL_BACK_REF",value:36003,description:" "},p.STENCIL_BACK_VALUE_MASK={name:"STENCIL_BACK_VALUE_MASK",value:36004,description:" "},p.STENCIL_BACK_WRITEMASK={name:"STENCIL_BACK_WRITEMASK",value:36005,description:" "},p.VIEWPORT={name:"VIEWPORT",value:2978,description:"Returns an Int32Array with four elements for the current viewport dimensions."},p.SCISSOR_BOX={name:"SCISSOR_BOX",value:3088,description:"Returns an Int32Array with four elements for the current scissor box dimensions."},p.COLOR_CLEAR_VALUE={name:"COLOR_CLEAR_VALUE",value:3106,description:" "},p.COLOR_WRITEMASK={name:"COLOR_WRITEMASK",value:3107,description:" "},p.UNPACK_ALIGNMENT={name:"UNPACK_ALIGNMENT",value:3317,description:" "},p.PACK_ALIGNMENT={name:"PACK_ALIGNMENT",value:3333,description:" "},p.MAX_TEXTURE_SIZE={name:"MAX_TEXTURE_SIZE",value:3379,description:" "},p.MAX_VIEWPORT_DIMS={name:"MAX_VIEWPORT_DIMS",value:3386,description:" "},p.SUBPIXEL_BITS={name:"SUBPIXEL_BITS",value:3408,description:" "},p.RED_BITS={name:"RED_BITS",value:3410,description:" "},p.GREEN_BITS={name:"GREEN_BITS",value:3411,description:" "},p.BLUE_BITS={name:"BLUE_BITS",value:3412,description:" "},p.ALPHA_BITS={name:"ALPHA_BITS",value:3413,description:" "},p.DEPTH_BITS={name:"DEPTH_BITS",value:3414,description:" "},p.STENCIL_BITS={name:"STENCIL_BITS",value:3415,description:" "},p.POLYGON_OFFSET_UNITS={name:"POLYGON_OFFSET_UNITS",value:10752,description:" "},p.POLYGON_OFFSET_FACTOR={name:"POLYGON_OFFSET_FACTOR",value:32824,description:" "},p.TEXTURE_BINDING_2D={name:"TEXTURE_BINDING_2D",value:32873,description:" "},p.SAMPLE_BUFFERS={name:"SAMPLE_BUFFERS",value:32936,description:" "},p.SAMPLES={name:"SAMPLES",value:32937,description:" "},p.SAMPLE_COVERAGE_VALUE={name:"SAMPLE_COVERAGE_VALUE",value:32938,description:" "},p.SAMPLE_COVERAGE_INVERT={name:"SAMPLE_COVERAGE_INVERT",value:32939,description:" "},p.COMPRESSED_TEXTURE_FORMATS={name:"COMPRESSED_TEXTURE_FORMATS",value:34467,description:" "},p.VENDOR={name:"VENDOR",value:7936,description:" "},p.RENDERER={name:"RENDERER",value:7937,description:" "},p.VERSION={name:"VERSION",value:7938,description:" "},p.IMPLEMENTATION_COLOR_READ_TYPE={name:"IMPLEMENTATION_COLOR_READ_TYPE",value:35738,description:" "},p.IMPLEMENTATION_COLOR_READ_FORMAT={name:"IMPLEMENTATION_COLOR_READ_FORMAT",value:35739,description:" "},p.BROWSER_DEFAULT_WEBGL={name:"BROWSER_DEFAULT_WEBGL",value:37444,description:" "},p.STATIC_DRAW={name:"STATIC_DRAW",value:35044,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and not change often."},p.STREAM_DRAW={name:"STREAM_DRAW",value:35040,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to not be used often."},p.DYNAMIC_DRAW={name:"DYNAMIC_DRAW",value:35048,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and change often."},p.ARRAY_BUFFER={name:"ARRAY_BUFFER",value:34962,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.ELEMENT_ARRAY_BUFFER={name:"ELEMENT_ARRAY_BUFFER",value:34963,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.BUFFER_SIZE={name:"BUFFER_SIZE",value:34660,description:"Passed to getBufferParameter to get a buffer's size."},p.BUFFER_USAGE={name:"BUFFER_USAGE",value:34661,description:"Passed to getBufferParameter to get the hint for the buffer passed in when it was created."},p.CURRENT_VERTEX_ATTRIB={name:"CURRENT_VERTEX_ATTRIB",value:34342,description:"Passed to getVertexAttrib to read back the current vertex attribute."},p.VERTEX_ATTRIB_ARRAY_ENABLED={name:"VERTEX_ATTRIB_ARRAY_ENABLED",value:34338,description:" "},p.VERTEX_ATTRIB_ARRAY_SIZE={name:"VERTEX_ATTRIB_ARRAY_SIZE",value:34339,description:" "},p.VERTEX_ATTRIB_ARRAY_STRIDE={name:"VERTEX_ATTRIB_ARRAY_STRIDE",value:34340,description:" "},p.VERTEX_ATTRIB_ARRAY_TYPE={name:"VERTEX_ATTRIB_ARRAY_TYPE",value:34341,description:" "},p.VERTEX_ATTRIB_ARRAY_NORMALIZED={name:"VERTEX_ATTRIB_ARRAY_NORMALIZED",value:34922,description:" "},p.VERTEX_ATTRIB_ARRAY_POINTER={name:"VERTEX_ATTRIB_ARRAY_POINTER",value:34373,description:" "},p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING={name:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",value:34975,description:" "},p.CULL_FACE={name:"CULL_FACE",value:2884,description:"Passed to enable/disable to turn on/off culling. Can also be used with getParameter to find the current culling method."},p.FRONT={name:"FRONT",value:1028,description:"Passed to cullFace to specify that only front faces should be drawn."},p.BACK={name:"BACK",value:1029,description:"Passed to cullFace to specify that only back faces should be drawn."},p.FRONT_AND_BACK={name:"FRONT_AND_BACK",value:1032,description:"Passed to cullFace to specify that front and back faces should be drawn."},p.BLEND={name:"BLEND",value:3042,description:"Passed to enable/disable to turn on/off blending. Can also be used with getParameter to find the current blending method."},p.DEPTH_TEST={name:"DEPTH_TEST",value:2929,description:"Passed to enable/disable to turn on/off the depth test. Can also be used with getParameter to query the depth test."},p.DITHER={name:"DITHER",value:3024,description:"Passed to enable/disable to turn on/off dithering. Can also be used with getParameter to find the current dithering method."},p.POLYGON_OFFSET_FILL={name:"POLYGON_OFFSET_FILL",value:32823,description:"Passed to enable/disable to turn on/off the polygon offset. Useful for rendering hidden-line images, decals, and or solids with highlighted edges. Can also be used with getParameter to query the scissor test."},p.SAMPLE_ALPHA_TO_COVERAGE={name:"SAMPLE_ALPHA_TO_COVERAGE",value:32926,description:"Passed to enable/disable to turn on/off the alpha to coverage. Used in multi-sampling alpha channels."},p.SAMPLE_COVERAGE={name:"SAMPLE_COVERAGE",value:32928,description:"Passed to enable/disable to turn on/off the sample coverage. Used in multi-sampling."},p.SCISSOR_TEST={name:"SCISSOR_TEST",value:3089,description:"Passed to enable/disable to turn on/off the scissor test. Can also be used with getParameter to query the scissor test."},p.STENCIL_TEST={name:"STENCIL_TEST",value:2960,description:"Passed to enable/disable to turn on/off the stencil test. Can also be used with getParameter to query the stencil test."},p.NO_ERROR={name:"NO_ERROR",value:0,description:"Returned from getError."},p.INVALID_ENUM={name:"INVALID_ENUM",value:1280,description:"Returned from getError."},p.INVALID_VALUE={name:"INVALID_VALUE",value:1281,description:"Returned from getError."},p.INVALID_OPERATION={name:"INVALID_OPERATION",value:1282,description:"Returned from getError."},p.OUT_OF_MEMORY={name:"OUT_OF_MEMORY",value:1285,description:"Returned from getError."},p.CONTEXT_LOST_WEBGL={name:"CONTEXT_LOST_WEBGL",value:37442,description:"Returned from getError."},p.CW={name:"CW",value:2304,description:"Passed to frontFace to specify the front face of a polygon is drawn in the clockwise direction"},p.CCW={name:"CCW",value:2305,description:"Passed to frontFace to specify the front face of a polygon is drawn in the counter clockwise direction"},p.DONT_CARE={name:"DONT_CARE",value:4352,description:"There is no preference for this behavior."},p.FASTEST={name:"FASTEST",value:4353,description:"The most efficient behavior should be used."},p.NICEST={name:"NICEST",value:4354,description:"The most correct or the highest quality option should be used."},p.GENERATE_MIPMAP_HINT={name:"GENERATE_MIPMAP_HINT",value:33170,description:"Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap()."},p.BYTE={name:"BYTE",value:5120,description:" "},p.UNSIGNED_BYTE={name:"UNSIGNED_BYTE",value:5121,description:" "},p.SHORT={name:"SHORT",value:5122,description:" "},p.UNSIGNED_SHORT={name:"UNSIGNED_SHORT",value:5123,description:" "},p.INT={name:"INT",value:5124,description:" "},p.UNSIGNED_INT={name:"UNSIGNED_INT",value:5125,description:" "},p.FLOAT={name:"FLOAT",value:5126,description:" "},p.DEPTH_COMPONENT={name:"DEPTH_COMPONENT",value:6402,description:" "},p.ALPHA={name:"ALPHA",value:6406,description:" "},p.RGB={name:"RGB",value:6407,description:" "},p.RGBA={name:"RGBA",value:6408,description:" "},p.LUMINANCE={name:"LUMINANCE",value:6409,description:" "},p.LUMINANCE_ALPHA={name:"LUMINANCE_ALPHA",value:6410,description:" "},p.UNSIGNED_SHORT_4_4_4_4={name:"UNSIGNED_SHORT_4_4_4_4",value:32819,description:" "},p.UNSIGNED_SHORT_5_5_5_1={name:"UNSIGNED_SHORT_5_5_5_1",value:32820,description:" "},p.UNSIGNED_SHORT_5_6_5={name:"UNSIGNED_SHORT_5_6_5",value:33635,description:" "},p.FRAGMENT_SHADER={name:"FRAGMENT_SHADER",value:35632,description:"Passed to createShader to define a fragment shader."},p.VERTEX_SHADER={name:"VERTEX_SHADER",value:35633,description:"Passed to createShader to define a vertex shader"},p.COMPILE_STATUS={name:"COMPILE_STATUS",value:35713,description:"Passed to getShaderParamter to get the status of the compilation. Returns false if the shader was not compiled. You can then query getShaderInfoLog to find the exact error"},p.DELETE_STATUS={name:"DELETE_STATUS",value:35712,description:"Passed to getShaderParamter to determine if a shader was deleted via deleteShader. Returns true if it was, false otherwise."},p.LINK_STATUS={name:"LINK_STATUS",value:35714,description:"Passed to getProgramParameter after calling linkProgram to determine if a program was linked correctly. Returns false if there were errors. Use getProgramInfoLog to find the exact error."},p.VALIDATE_STATUS={name:"VALIDATE_STATUS",value:35715,description:"Passed to getProgramParameter after calling validateProgram to determine if it is valid. Returns false if errors were found."},p.ATTACHED_SHADERS={name:"ATTACHED_SHADERS",value:35717,description:"Passed to getProgramParameter after calling attachShader to determine if the shader was attached correctly. Returns false if errors occurred."},p.COMPLETION_STATUS_KHR={name:"COMPLETION_STATUS_KHR",value:37297,description:"Passed to getProgramParameter (KHR_parallel_shader_compile) to query whether an asynchronous shader/program link has completed. Returns true once the program is ready to use without blocking."},p.ACTIVE_ATTRIBUTES={name:"ACTIVE_ATTRIBUTES",value:35721,description:"Passed to getProgramParameter to get the number of attributes active in a program."},p.ACTIVE_UNIFORMS={name:"ACTIVE_UNIFORMS",value:35718,description:"Passed to getProgramParamter to get the number of uniforms active in a program."},p.MAX_VERTEX_ATTRIBS={name:"MAX_VERTEX_ATTRIBS",value:34921,description:" "},p.MAX_VERTEX_UNIFORM_VECTORS={name:"MAX_VERTEX_UNIFORM_VECTORS",value:36347,description:" "},p.MAX_VARYING_VECTORS={name:"MAX_VARYING_VECTORS",value:36348,description:" "},p.MAX_COMBINED_TEXTURE_IMAGE_UNITS={name:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",value:35661,description:" "},p.MAX_VERTEX_TEXTURE_IMAGE_UNITS={name:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",value:35660,description:" "},p.MAX_TEXTURE_IMAGE_UNITS={name:"MAX_TEXTURE_IMAGE_UNITS",value:34930,description:"Implementation dependent number of maximum texture units. At least 8."},p.MAX_FRAGMENT_UNIFORM_VECTORS={name:"MAX_FRAGMENT_UNIFORM_VECTORS",value:36349,description:" "},p.SHADER_TYPE={name:"SHADER_TYPE",value:35663,description:" "},p.SHADING_LANGUAGE_VERSION={name:"SHADING_LANGUAGE_VERSION",value:35724,description:" "},p.CURRENT_PROGRAM={name:"CURRENT_PROGRAM",value:35725,description:" "},p.NEVER={name:"NEVER",value:512,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn."},p.ALWAYS={name:"ALWAYS",value:519,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn."},p.LESS={name:"LESS",value:513,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value."},p.EQUAL={name:"EQUAL",value:514,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value."},p.LEQUAL={name:"LEQUAL",value:515,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value."},p.GREATER={name:"GREATER",value:516,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value."},p.GEQUAL={name:"GEQUAL",value:518,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value."},p.NOTEQUAL={name:"NOTEQUAL",value:517,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value."},p.KEEP={name:"KEEP",value:7680,description:" "},p.REPLACE={name:"REPLACE",value:7681,description:" "},p.INCR={name:"INCR",value:7682,description:" "},p.DECR={name:"DECR",value:7683,description:" "},p.INVERT={name:"INVERT",value:5386,description:" "},p.INCR_WRAP={name:"INCR_WRAP",value:34055,description:" "},p.DECR_WRAP={name:"DECR_WRAP",value:34056,description:" "},p.NEAREST={name:"NEAREST",value:9728,description:" "},p.LINEAR={name:"LINEAR",value:9729,description:" "},p.NEAREST_MIPMAP_NEAREST={name:"NEAREST_MIPMAP_NEAREST",value:9984,description:" "},p.LINEAR_MIPMAP_NEAREST={name:"LINEAR_MIPMAP_NEAREST",value:9985,description:" "},p.NEAREST_MIPMAP_LINEAR={name:"NEAREST_MIPMAP_LINEAR",value:9986,description:" "},p.LINEAR_MIPMAP_LINEAR={name:"LINEAR_MIPMAP_LINEAR",value:9987,description:" "},p.TEXTURE_MAG_FILTER={name:"TEXTURE_MAG_FILTER",value:10240,description:" "},p.TEXTURE_MIN_FILTER={name:"TEXTURE_MIN_FILTER",value:10241,description:" "},p.TEXTURE_WRAP_S={name:"TEXTURE_WRAP_S",value:10242,description:" "},p.TEXTURE_WRAP_T={name:"TEXTURE_WRAP_T",value:10243,description:" "},p.TEXTURE_2D={name:"TEXTURE_2D",value:3553,description:" "},p.TEXTURE={name:"TEXTURE",value:5890,description:" "},p.TEXTURE_CUBE_MAP={name:"TEXTURE_CUBE_MAP",value:34067,description:" "},p.TEXTURE_BINDING_CUBE_MAP={name:"TEXTURE_BINDING_CUBE_MAP",value:34068,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_X={name:"TEXTURE_CUBE_MAP_POSITIVE_X",value:34069,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_X={name:"TEXTURE_CUBE_MAP_NEGATIVE_X",value:34070,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Y={name:"TEXTURE_CUBE_MAP_POSITIVE_Y",value:34071,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Y={name:"TEXTURE_CUBE_MAP_NEGATIVE_Y",value:34072,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Z={name:"TEXTURE_CUBE_MAP_POSITIVE_Z",value:34073,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Z={name:"TEXTURE_CUBE_MAP_NEGATIVE_Z",value:34074,description:" "},p.MAX_CUBE_MAP_TEXTURE_SIZE={name:"MAX_CUBE_MAP_TEXTURE_SIZE",value:34076,description:" "},p.TEXTURE0={name:"TEXTURE0",value:33984,description:"A texture unit."},p.TEXTURE1={name:"TEXTURE1",value:33985,description:"A texture unit."},p.TEXTURE2={name:"TEXTURE2",value:33986,description:"A texture unit."},p.TEXTURE3={name:"TEXTURE3",value:33987,description:"A texture unit."},p.TEXTURE4={name:"TEXTURE4",value:33988,description:"A texture unit."},p.TEXTURE5={name:"TEXTURE5",value:33989,description:"A texture unit."},p.TEXTURE6={name:"TEXTURE6",value:33990,description:"A texture unit."},p.TEXTURE7={name:"TEXTURE7",value:33991,description:"A texture unit."},p.TEXTURE8={name:"TEXTURE8",value:33992,description:"A texture unit."},p.TEXTURE9={name:"TEXTURE9",value:33993,description:"A texture unit."},p.TEXTURE10={name:"TEXTURE10",value:33994,description:"A texture unit."},p.TEXTURE11={name:"TEXTURE11",value:33995,description:"A texture unit."},p.TEXTURE12={name:"TEXTURE12",value:33996,description:"A texture unit."},p.TEXTURE13={name:"TEXTURE13",value:33997,description:"A texture unit."},p.TEXTURE14={name:"TEXTURE14",value:33998,description:"A texture unit."},p.TEXTURE15={name:"TEXTURE15",value:33999,description:"A texture unit."},p.TEXTURE16={name:"TEXTURE16",value:34e3,description:"A texture unit."},p.TEXTURE17={name:"TEXTURE17",value:34001,description:"A texture unit."},p.TEXTURE18={name:"TEXTURE18",value:34002,description:"A texture unit."},p.TEXTURE19={name:"TEXTURE19",value:34003,description:"A texture unit."},p.TEXTURE20={name:"TEXTURE20",value:34004,description:"A texture unit."},p.TEXTURE21={name:"TEXTURE21",value:34005,description:"A texture unit."},p.TEXTURE22={name:"TEXTURE22",value:34006,description:"A texture unit."},p.TEXTURE23={name:"TEXTURE23",value:34007,description:"A texture unit."},p.TEXTURE24={name:"TEXTURE24",value:34008,description:"A texture unit."},p.TEXTURE25={name:"TEXTURE25",value:34009,description:"A texture unit."},p.TEXTURE26={name:"TEXTURE26",value:34010,description:"A texture unit."},p.TEXTURE27={name:"TEXTURE27",value:34011,description:"A texture unit."},p.TEXTURE28={name:"TEXTURE28",value:34012,description:"A texture unit."},p.TEXTURE29={name:"TEXTURE29",value:34013,description:"A texture unit."},p.TEXTURE30={name:"TEXTURE30",value:34014,description:"A texture unit."},p.TEXTURE31={name:"TEXTURE31",value:34015,description:"A texture unit."},p.ACTIVE_TEXTURE={name:"ACTIVE_TEXTURE",value:34016,description:"The current active texture unit."},p.REPEAT={name:"REPEAT",value:10497,description:" "},p.CLAMP_TO_EDGE={name:"CLAMP_TO_EDGE",value:33071,description:" "},p.MIRRORED_REPEAT={name:"MIRRORED_REPEAT",value:33648,description:" "},p.FLOAT_VEC2={name:"FLOAT_VEC2",value:35664,description:" "},p.FLOAT_VEC3={name:"FLOAT_VEC3",value:35665,description:" "},p.FLOAT_VEC4={name:"FLOAT_VEC4",value:35666,description:" "},p.INT_VEC2={name:"INT_VEC2",value:35667,description:" "},p.INT_VEC3={name:"INT_VEC3",value:35668,description:" "},p.INT_VEC4={name:"INT_VEC4",value:35669,description:" "},p.BOOL={name:"BOOL",value:35670,description:" "},p.BOOL_VEC2={name:"BOOL_VEC2",value:35671,description:" "},p.BOOL_VEC3={name:"BOOL_VEC3",value:35672,description:" "},p.BOOL_VEC4={name:"BOOL_VEC4",value:35673,description:" "},p.FLOAT_MAT2={name:"FLOAT_MAT2",value:35674,description:" "},p.FLOAT_MAT3={name:"FLOAT_MAT3",value:35675,description:" "},p.FLOAT_MAT4={name:"FLOAT_MAT4",value:35676,description:" "},p.SAMPLER_2D={name:"SAMPLER_2D",value:35678,description:" "},p.SAMPLER_CUBE={name:"SAMPLER_CUBE",value:35680,description:" "},p.LOW_FLOAT={name:"LOW_FLOAT",value:36336,description:" "},p.MEDIUM_FLOAT={name:"MEDIUM_FLOAT",value:36337,description:" "},p.HIGH_FLOAT={name:"HIGH_FLOAT",value:36338,description:" "},p.LOW_INT={name:"LOW_INT",value:36339,description:" "},p.MEDIUM_INT={name:"MEDIUM_INT",value:36340,description:" "},p.HIGH_INT={name:"HIGH_INT",value:36341,description:" "},p.FRAMEBUFFER={name:"FRAMEBUFFER",value:36160,description:" "},p.RENDERBUFFER={name:"RENDERBUFFER",value:36161,description:" "},p.RGBA4={name:"RGBA4",value:32854,description:" "},p.RGB5_A1={name:"RGB5_A1",value:32855,description:" "},p.RGB565={name:"RGB565",value:36194,description:" "},p.DEPTH_COMPONENT16={name:"DEPTH_COMPONENT16",value:33189,description:" "},p.STENCIL_INDEX={name:"STENCIL_INDEX",value:6401,description:" "},p.STENCIL_INDEX8={name:"STENCIL_INDEX8",value:36168,description:" "},p.DEPTH_STENCIL={name:"DEPTH_STENCIL",value:34041,description:" "},p.RENDERBUFFER_WIDTH={name:"RENDERBUFFER_WIDTH",value:36162,description:" "},p.RENDERBUFFER_HEIGHT={name:"RENDERBUFFER_HEIGHT",value:36163,description:" "},p.RENDERBUFFER_INTERNAL_FORMAT={name:"RENDERBUFFER_INTERNAL_FORMAT",value:36164,description:" "},p.RENDERBUFFER_RED_SIZE={name:"RENDERBUFFER_RED_SIZE",value:36176,description:" "},p.RENDERBUFFER_GREEN_SIZE={name:"RENDERBUFFER_GREEN_SIZE",value:36177,description:" "},p.RENDERBUFFER_BLUE_SIZE={name:"RENDERBUFFER_BLUE_SIZE",value:36178,description:" "},p.RENDERBUFFER_ALPHA_SIZE={name:"RENDERBUFFER_ALPHA_SIZE",value:36179,description:" "},p.RENDERBUFFER_DEPTH_SIZE={name:"RENDERBUFFER_DEPTH_SIZE",value:36180,description:" "},p.RENDERBUFFER_STENCIL_SIZE={name:"RENDERBUFFER_STENCIL_SIZE",value:36181,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",value:36048,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",value:36049,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",value:36050,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",value:36051,description:" "},p.COLOR_ATTACHMENT0={name:"COLOR_ATTACHMENT0",value:36064,description:" "},p.DEPTH_ATTACHMENT={name:"DEPTH_ATTACHMENT",value:36096,description:" "},p.STENCIL_ATTACHMENT={name:"STENCIL_ATTACHMENT",value:36128,description:" "},p.DEPTH_STENCIL_ATTACHMENT={name:"DEPTH_STENCIL_ATTACHMENT",value:33306,description:" "},p.NONE={name:"NONE",value:0,description:" "},p.FRAMEBUFFER_COMPLETE={name:"FRAMEBUFFER_COMPLETE",value:36053,description:" "},p.FRAMEBUFFER_INCOMPLETE_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",value:36054,description:" "},p.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",value:36055,description:" "},p.FRAMEBUFFER_INCOMPLETE_DIMENSIONS={name:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",value:36057,description:" "},p.FRAMEBUFFER_UNSUPPORTED={name:"FRAMEBUFFER_UNSUPPORTED",value:36061,description:" "},p.FRAMEBUFFER_BINDING={name:"FRAMEBUFFER_BINDING",value:36006,description:" "},p.RENDERBUFFER_BINDING={name:"RENDERBUFFER_BINDING",value:36007,description:" "},p.MAX_RENDERBUFFER_SIZE={name:"MAX_RENDERBUFFER_SIZE",value:34024,description:" "},p.INVALID_FRAMEBUFFER_OPERATION={name:"INVALID_FRAMEBUFFER_OPERATION",value:1286,description:" "},p.UNPACK_FLIP_Y_WEBGL={name:"UNPACK_FLIP_Y_WEBGL",value:37440,description:" "},p.UNPACK_PREMULTIPLY_ALPHA_WEBGL={name:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",value:37441,description:" "},p.UNPACK_COLORSPACE_CONVERSION_WEBGL={name:"UNPACK_COLORSPACE_CONVERSION_WEBGL",value:37443,description:" "},p.READ_BUFFER={name:"READ_BUFFER",value:3074,description:" "},p.UNPACK_ROW_LENGTH={name:"UNPACK_ROW_LENGTH",value:3314,description:" "},p.UNPACK_SKIP_ROWS={name:"UNPACK_SKIP_ROWS",value:3315,description:" "},p.UNPACK_SKIP_PIXELS={name:"UNPACK_SKIP_PIXELS",value:3316,description:" "},p.PACK_ROW_LENGTH={name:"PACK_ROW_LENGTH",value:3330,description:" "},p.PACK_SKIP_ROWS={name:"PACK_SKIP_ROWS",value:3331,description:" "},p.PACK_SKIP_PIXELS={name:"PACK_SKIP_PIXELS",value:3332,description:" "},p.TEXTURE_BINDING_3D={name:"TEXTURE_BINDING_3D",value:32874,description:" "},p.UNPACK_SKIP_IMAGES={name:"UNPACK_SKIP_IMAGES",value:32877,description:" "},p.UNPACK_IMAGE_HEIGHT={name:"UNPACK_IMAGE_HEIGHT",value:32878,description:" "},p.MAX_3D_TEXTURE_SIZE={name:"MAX_3D_TEXTURE_SIZE",value:32883,description:" "},p.MAX_ELEMENTS_VERTICES={name:"MAX_ELEMENTS_VERTICES",value:33e3,description:" "},p.MAX_ELEMENTS_INDICES={name:"MAX_ELEMENTS_INDICES",value:33001,description:" "},p.MAX_TEXTURE_LOD_BIAS={name:"MAX_TEXTURE_LOD_BIAS",value:34045,description:" "},p.MAX_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_FRAGMENT_UNIFORM_COMPONENTS",value:35657,description:" "},p.MAX_VERTEX_UNIFORM_COMPONENTS={name:"MAX_VERTEX_UNIFORM_COMPONENTS",value:35658,description:" "},p.MAX_ARRAY_TEXTURE_LAYERS={name:"MAX_ARRAY_TEXTURE_LAYERS",value:35071,description:" "},p.MIN_PROGRAM_TEXEL_OFFSET={name:"MIN_PROGRAM_TEXEL_OFFSET",value:35076,description:" "},p.MAX_PROGRAM_TEXEL_OFFSET={name:"MAX_PROGRAM_TEXEL_OFFSET",value:35077,description:" "},p.MAX_VARYING_COMPONENTS={name:"MAX_VARYING_COMPONENTS",value:35659,description:" "},p.FRAGMENT_SHADER_DERIVATIVE_HINT={name:"FRAGMENT_SHADER_DERIVATIVE_HINT",value:35723,description:" "},p.RASTERIZER_DISCARD={name:"RASTERIZER_DISCARD",value:35977,description:" "},p.VERTEX_ARRAY_BINDING={name:"VERTEX_ARRAY_BINDING",value:34229,description:" "},p.MAX_VERTEX_OUTPUT_COMPONENTS={name:"MAX_VERTEX_OUTPUT_COMPONENTS",value:37154,description:" "},p.MAX_FRAGMENT_INPUT_COMPONENTS={name:"MAX_FRAGMENT_INPUT_COMPONENTS",value:37157,description:" "},p.MAX_SERVER_WAIT_TIMEOUT={name:"MAX_SERVER_WAIT_TIMEOUT",value:37137,description:" "},p.MAX_ELEMENT_INDEX={name:"MAX_ELEMENT_INDEX",value:36203,description:" "},p.RED={name:"RED",value:6403,description:" "},p.RGB8={name:"RGB8",value:32849,description:" "},p.RGBA8={name:"RGBA8",value:32856,description:" "},p.RGB10_A2={name:"RGB10_A2",value:32857,description:" "},p.TEXTURE_3D={name:"TEXTURE_3D",value:32879,description:" "},p.TEXTURE_WRAP_R={name:"TEXTURE_WRAP_R",value:32882,description:" "},p.TEXTURE_MIN_LOD={name:"TEXTURE_MIN_LOD",value:33082,description:" "},p.TEXTURE_MAX_LOD={name:"TEXTURE_MAX_LOD",value:33083,description:" "},p.TEXTURE_BASE_LEVEL={name:"TEXTURE_BASE_LEVEL",value:33084,description:" "},p.TEXTURE_MAX_LEVEL={name:"TEXTURE_MAX_LEVEL",value:33085,description:" "},p.TEXTURE_COMPARE_MODE={name:"TEXTURE_COMPARE_MODE",value:34892,description:" "},p.TEXTURE_COMPARE_FUNC={name:"TEXTURE_COMPARE_FUNC",value:34893,description:" "},p.SRGB={name:"SRGB",value:35904,description:" "},p.SRGB8={name:"SRGB8",value:35905,description:" "},p.SRGB8_ALPHA8={name:"SRGB8_ALPHA8",value:35907,description:" "},p.COMPARE_REF_TO_TEXTURE={name:"COMPARE_REF_TO_TEXTURE",value:34894,description:" "},p.RGBA32F={name:"RGBA32F",value:34836,description:" "},p.RGB32F={name:"RGB32F",value:34837,description:" "},p.RGBA16F={name:"RGBA16F",value:34842,description:" "},p.RGB16F={name:"RGB16F",value:34843,description:" "},p.TEXTURE_2D_ARRAY={name:"TEXTURE_2D_ARRAY",value:35866,description:" "},p.TEXTURE_BINDING_2D_ARRAY={name:"TEXTURE_BINDING_2D_ARRAY",value:35869,description:" "},p.R11F_G11F_B10F={name:"R11F_G11F_B10F",value:35898,description:" "},p.RGB9_E5={name:"RGB9_E5",value:35901,description:" "},p.RGBA32UI={name:"RGBA32UI",value:36208,description:" "},p.RGB32UI={name:"RGB32UI",value:36209,description:" "},p.RGBA16UI={name:"RGBA16UI",value:36214,description:" "},p.RGB16UI={name:"RGB16UI",value:36215,description:" "},p.RGBA8UI={name:"RGBA8UI",value:36220,description:" "},p.RGB8UI={name:"RGB8UI",value:36221,description:" "},p.RGBA32I={name:"RGBA32I",value:36226,description:" "},p.RGB32I={name:"RGB32I",value:36227,description:" "},p.RGBA16I={name:"RGBA16I",value:36232,description:" "},p.RGB16I={name:"RGB16I",value:36233,description:" "},p.RGBA8I={name:"RGBA8I",value:36238,description:" "},p.RGB8I={name:"RGB8I",value:36239,description:" "},p.RED_INTEGER={name:"RED_INTEGER",value:36244,description:" "},p.RGB_INTEGER={name:"RGB_INTEGER",value:36248,description:" "},p.RGBA_INTEGER={name:"RGBA_INTEGER",value:36249,description:" "},p.R8={name:"R8",value:33321,description:" "},p.RG8={name:"RG8",value:33323,description:" "},p.R16F={name:"R16F",value:33325,description:" "},p.R32F={name:"R32F",value:33326,description:" "},p.RG16F={name:"RG16F",value:33327,description:" "},p.RG32F={name:"RG32F",value:33328,description:" "},p.R8I={name:"R8I",value:33329,description:" "},p.R8UI={name:"R8UI",value:33330,description:" "},p.R16I={name:"R16I",value:33331,description:" "},p.R16UI={name:"R16UI",value:33332,description:" "},p.R32I={name:"R32I",value:33333,description:" "},p.R32UI={name:"R32UI",value:33334,description:" "},p.RG8I={name:"RG8I",value:33335,description:" "},p.RG8UI={name:"RG8UI",value:33336,description:" "},p.RG16I={name:"RG16I",value:33337,description:" "},p.RG16UI={name:"RG16UI",value:33338,description:" "},p.RG32I={name:"RG32I",value:33339,description:" "},p.RG32UI={name:"RG32UI",value:33340,description:" "},p.R8_SNORM={name:"R8_SNORM",value:36756,description:" "},p.RG8_SNORM={name:"RG8_SNORM",value:36757,description:" "},p.RGB8_SNORM={name:"RGB8_SNORM",value:36758,description:" "},p.RGBA8_SNORM={name:"RGBA8_SNORM",value:36759,description:" "},p.RGB10_A2UI={name:"RGB10_A2UI",value:36975,description:" "},p.TEXTURE_IMMUTABLE_FORMAT={name:"TEXTURE_IMMUTABLE_FORMAT",value:37167,description:" "},p.TEXTURE_IMMUTABLE_LEVELS={name:"TEXTURE_IMMUTABLE_LEVELS",value:33503,description:" "},p.UNSIGNED_INT_2_10_10_10_REV={name:"UNSIGNED_INT_2_10_10_10_REV",value:33640,description:" "},p.UNSIGNED_INT_10F_11F_11F_REV={name:"UNSIGNED_INT_10F_11F_11F_REV",value:35899,description:" "},p.UNSIGNED_INT_5_9_9_9_REV={name:"UNSIGNED_INT_5_9_9_9_REV",value:35902,description:" "},p.FLOAT_32_UNSIGNED_INT_24_8_REV={name:"FLOAT_32_UNSIGNED_INT_24_8_REV",value:36269,description:" "},p.UNSIGNED_INT_24_8={name:"UNSIGNED_INT_24_8",value:34042,description:" "},p.HALF_FLOAT={name:"HALF_FLOAT",value:5131,description:" "},p.RG={name:"RG",value:33319,description:" "},p.RG_INTEGER={name:"RG_INTEGER",value:33320,description:" "},p.INT_2_10_10_10_REV={name:"INT_2_10_10_10_REV",value:36255,description:" "},p.CURRENT_QUERY={name:"CURRENT_QUERY",value:34917,description:" "},p.QUERY_RESULT={name:"QUERY_RESULT",value:34918,description:" "},p.QUERY_RESULT_AVAILABLE={name:"QUERY_RESULT_AVAILABLE",value:34919,description:" "},p.ANY_SAMPLES_PASSED={name:"ANY_SAMPLES_PASSED",value:35887,description:" "},p.ANY_SAMPLES_PASSED_CONSERVATIVE={name:"ANY_SAMPLES_PASSED_CONSERVATIVE",value:36202,description:" "},p.MAX_DRAW_BUFFERS={name:"MAX_DRAW_BUFFERS",value:34852,description:" "},p.DRAW_BUFFER0={name:"DRAW_BUFFER0",value:34853,description:" "},p.DRAW_BUFFER1={name:"DRAW_BUFFER1",value:34854,description:" "},p.DRAW_BUFFER2={name:"DRAW_BUFFER2",value:34855,description:" "},p.DRAW_BUFFER3={name:"DRAW_BUFFER3",value:34856,description:" "},p.DRAW_BUFFER4={name:"DRAW_BUFFER4",value:34857,description:" "},p.DRAW_BUFFER5={name:"DRAW_BUFFER5",value:34858,description:" "},p.DRAW_BUFFER6={name:"DRAW_BUFFER6",value:34859,description:" "},p.DRAW_BUFFER7={name:"DRAW_BUFFER7",value:34860,description:" "},p.DRAW_BUFFER8={name:"DRAW_BUFFER8",value:34861,description:" "},p.DRAW_BUFFER9={name:"DRAW_BUFFER9",value:34862,description:" "},p.DRAW_BUFFER10={name:"DRAW_BUFFER10",value:34863,description:" "},p.DRAW_BUFFER11={name:"DRAW_BUFFER11",value:34864,description:" "},p.DRAW_BUFFER12={name:"DRAW_BUFFER12",value:34865,description:" "},p.DRAW_BUFFER13={name:"DRAW_BUFFER13",value:34866,description:" "},p.DRAW_BUFFER14={name:"DRAW_BUFFER14",value:34867,description:" "},p.DRAW_BUFFER15={name:"DRAW_BUFFER15",value:34868,description:" "},p.MAX_COLOR_ATTACHMENTS={name:"MAX_COLOR_ATTACHMENTS",value:36063,description:" "},p.COLOR_ATTACHMENT1={name:"COLOR_ATTACHMENT1",value:36065,description:" "},p.COLOR_ATTACHMENT2={name:"COLOR_ATTACHMENT2",value:36066,description:" "},p.COLOR_ATTACHMENT3={name:"COLOR_ATTACHMENT3",value:36067,description:" "},p.COLOR_ATTACHMENT4={name:"COLOR_ATTACHMENT4",value:36068,description:" "},p.COLOR_ATTACHMENT5={name:"COLOR_ATTACHMENT5",value:36069,description:" "},p.COLOR_ATTACHMENT6={name:"COLOR_ATTACHMENT6",value:36070,description:" "},p.COLOR_ATTACHMENT7={name:"COLOR_ATTACHMENT7",value:36071,description:" "},p.COLOR_ATTACHMENT8={name:"COLOR_ATTACHMENT8",value:36072,description:" "},p.COLOR_ATTACHMENT9={name:"COLOR_ATTACHMENT9",value:36073,description:" "},p.COLOR_ATTACHMENT10={name:"COLOR_ATTACHMENT10",value:36074,description:" "},p.COLOR_ATTACHMENT11={name:"COLOR_ATTACHMENT11",value:36075,description:" "},p.COLOR_ATTACHMENT12={name:"COLOR_ATTACHMENT12",value:36076,description:" "},p.COLOR_ATTACHMENT13={name:"COLOR_ATTACHMENT13",value:36077,description:" "},p.COLOR_ATTACHMENT14={name:"COLOR_ATTACHMENT14",value:36078,description:" "},p.COLOR_ATTACHMENT15={name:"COLOR_ATTACHMENT15",value:36079,description:" "},p.SAMPLER_3D={name:"SAMPLER_3D",value:35679,description:" "},p.SAMPLER_2D_SHADOW={name:"SAMPLER_2D_SHADOW",value:35682,description:" "},p.SAMPLER_2D_ARRAY={name:"SAMPLER_2D_ARRAY",value:36289,description:" "},p.SAMPLER_2D_ARRAY_SHADOW={name:"SAMPLER_2D_ARRAY_SHADOW",value:36292,description:" "},p.SAMPLER_CUBE_SHADOW={name:"SAMPLER_CUBE_SHADOW",value:36293,description:" "},p.INT_SAMPLER_2D={name:"INT_SAMPLER_2D",value:36298,description:" "},p.INT_SAMPLER_3D={name:"INT_SAMPLER_3D",value:36299,description:" "},p.INT_SAMPLER_CUBE={name:"INT_SAMPLER_CUBE",value:36300,description:" "},p.INT_SAMPLER_2D_ARRAY={name:"INT_SAMPLER_2D_ARRAY",value:36303,description:" "},p.UNSIGNED_INT_SAMPLER_2D={name:"UNSIGNED_INT_SAMPLER_2D",value:36306,description:" "},p.UNSIGNED_INT_SAMPLER_3D={name:"UNSIGNED_INT_SAMPLER_3D",value:36307,description:" "},p.UNSIGNED_INT_SAMPLER_CUBE={name:"UNSIGNED_INT_SAMPLER_CUBE",value:36308,description:" "},p.UNSIGNED_INT_SAMPLER_2D_ARRAY={name:"UNSIGNED_INT_SAMPLER_2D_ARRAY",value:36311,description:" "},p.MAX_SAMPLES={name:"MAX_SAMPLES",value:36183,description:" "},p.SAMPLER_BINDING={name:"SAMPLER_BINDING",value:35097,description:" "},p.PIXEL_PACK_BUFFER={name:"PIXEL_PACK_BUFFER",value:35051,description:" "},p.PIXEL_UNPACK_BUFFER={name:"PIXEL_UNPACK_BUFFER",value:35052,description:" "},p.PIXEL_PACK_BUFFER_BINDING={name:"PIXEL_PACK_BUFFER_BINDING",value:35053,description:" "},p.PIXEL_UNPACK_BUFFER_BINDING={name:"PIXEL_UNPACK_BUFFER_BINDING",value:35055,description:" "},p.COPY_READ_BUFFER={name:"COPY_READ_BUFFER",value:36662,description:" "},p.COPY_WRITE_BUFFER={name:"COPY_WRITE_BUFFER",value:36663,description:" "},p.COPY_READ_BUFFER_BINDING={name:"COPY_READ_BUFFER_BINDING",value:36662,description:" "},p.COPY_WRITE_BUFFER_BINDING={name:"COPY_WRITE_BUFFER_BINDING",value:36663,description:" "},p.FLOAT_MAT2x3={name:"FLOAT_MAT2x3",value:35685,description:" "},p.FLOAT_MAT2x4={name:"FLOAT_MAT2x4",value:35686,description:" "},p.FLOAT_MAT3x2={name:"FLOAT_MAT3x2",value:35687,description:" "},p.FLOAT_MAT3x4={name:"FLOAT_MAT3x4",value:35688,description:" "},p.FLOAT_MAT4x2={name:"FLOAT_MAT4x2",value:35689,description:" "},p.FLOAT_MAT4x3={name:"FLOAT_MAT4x3",value:35690,description:" "},p.UNSIGNED_INT_VEC2={name:"UNSIGNED_INT_VEC2",value:36294,description:" "},p.UNSIGNED_INT_VEC3={name:"UNSIGNED_INT_VEC3",value:36295,description:" "},p.UNSIGNED_INT_VEC4={name:"UNSIGNED_INT_VEC4",value:36296,description:" "},p.UNSIGNED_NORMALIZED={name:"UNSIGNED_NORMALIZED",value:35863,description:" "},p.SIGNED_NORMALIZED={name:"SIGNED_NORMALIZED",value:36764,description:" "},p.VERTEX_ATTRIB_ARRAY_INTEGER={name:"VERTEX_ATTRIB_ARRAY_INTEGER",value:35069,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR={name:"VERTEX_ATTRIB_ARRAY_DIVISOR",value:35070,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_MODE={name:"TRANSFORM_FEEDBACK_BUFFER_MODE",value:35967,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",value:35968,description:" "},p.TRANSFORM_FEEDBACK_VARYINGS={name:"TRANSFORM_FEEDBACK_VARYINGS",value:35971,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_START={name:"TRANSFORM_FEEDBACK_BUFFER_START",value:35972,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_SIZE={name:"TRANSFORM_FEEDBACK_BUFFER_SIZE",value:35973,description:" "},p.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN={name:"TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",value:35976,description:" "},p.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",value:35978,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",value:35979,description:" "},p.INTERLEAVED_ATTRIBS={name:"INTERLEAVED_ATTRIBS",value:35980,description:" "},p.SEPARATE_ATTRIBS={name:"SEPARATE_ATTRIBS",value:35981,description:" "},p.TRANSFORM_FEEDBACK_BUFFER={name:"TRANSFORM_FEEDBACK_BUFFER",value:35982,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_BINDING={name:"TRANSFORM_FEEDBACK_BUFFER_BINDING",value:35983,description:" "},p.TRANSFORM_FEEDBACK={name:"TRANSFORM_FEEDBACK",value:36386,description:" "},p.TRANSFORM_FEEDBACK_PAUSED={name:"TRANSFORM_FEEDBACK_PAUSED",value:36387,description:" "},p.TRANSFORM_FEEDBACK_ACTIVE={name:"TRANSFORM_FEEDBACK_ACTIVE",value:36388,description:" "},p.TRANSFORM_FEEDBACK_BINDING={name:"TRANSFORM_FEEDBACK_BINDING",value:36389,description:" "},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",value:33296,description:" "},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",value:33297,description:" "},p.FRAMEBUFFER_ATTACHMENT_RED_SIZE={name:"FRAMEBUFFER_ATTACHMENT_RED_SIZE",value:33298,description:" "},p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE={name:"FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",value:33299,description:" "},p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE={name:"FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",value:33300,description:" "},p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE={name:"FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",value:33301,description:" "},p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE={name:"FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",value:33302,description:" "},p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE={name:"FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",value:33303,description:" "},p.FRAMEBUFFER_DEFAULT={name:"FRAMEBUFFER_DEFAULT",value:33304,description:" "},p.DEPTH24_STENCIL8={name:"DEPTH24_STENCIL8",value:35056,description:" "},p.DRAW_FRAMEBUFFER_BINDING={name:"DRAW_FRAMEBUFFER_BINDING",value:36006,description:" "},p.READ_FRAMEBUFFER={name:"READ_FRAMEBUFFER",value:36008,description:" "},p.DRAW_FRAMEBUFFER={name:"DRAW_FRAMEBUFFER",value:36009,description:" "},p.READ_FRAMEBUFFER_BINDING={name:"READ_FRAMEBUFFER_BINDING",value:36010,description:" "},p.RENDERBUFFER_SAMPLES={name:"RENDERBUFFER_SAMPLES",value:36011,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",value:36052,description:" "},p.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE={name:"FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",value:36182,description:" "},p.UNIFORM_BUFFER={name:"UNIFORM_BUFFER",value:35345,description:" "},p.UNIFORM_BUFFER_BINDING={name:"UNIFORM_BUFFER_BINDING",value:35368,description:" "},p.UNIFORM_BUFFER_START={name:"UNIFORM_BUFFER_START",value:35369,description:" "},p.UNIFORM_BUFFER_SIZE={name:"UNIFORM_BUFFER_SIZE",value:35370,description:" "},p.MAX_VERTEX_UNIFORM_BLOCKS={name:"MAX_VERTEX_UNIFORM_BLOCKS",value:35371,description:" "},p.MAX_FRAGMENT_UNIFORM_BLOCKS={name:"MAX_FRAGMENT_UNIFORM_BLOCKS",value:35373,description:" "},p.MAX_COMBINED_UNIFORM_BLOCKS={name:"MAX_COMBINED_UNIFORM_BLOCKS",value:35374,description:" "},p.MAX_UNIFORM_BUFFER_BINDINGS={name:"MAX_UNIFORM_BUFFER_BINDINGS",value:35375,description:" "},p.MAX_UNIFORM_BLOCK_SIZE={name:"MAX_UNIFORM_BLOCK_SIZE",value:35376,description:" "},p.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS={name:"MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",value:35377,description:" "},p.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",value:35379,description:" "},p.UNIFORM_BUFFER_OFFSET_ALIGNMENT={name:"UNIFORM_BUFFER_OFFSET_ALIGNMENT",value:35380,description:" "},p.ACTIVE_UNIFORM_BLOCKS={name:"ACTIVE_UNIFORM_BLOCKS",value:35382,description:" "},p.UNIFORM_TYPE={name:"UNIFORM_TYPE",value:35383,description:" "},p.UNIFORM_SIZE={name:"UNIFORM_SIZE",value:35384,description:" "},p.UNIFORM_BLOCK_INDEX={name:"UNIFORM_BLOCK_INDEX",value:35386,description:" "},p.UNIFORM_OFFSET={name:"UNIFORM_OFFSET",value:35387,description:" "},p.UNIFORM_ARRAY_STRIDE={name:"UNIFORM_ARRAY_STRIDE",value:35388,description:" "},p.UNIFORM_MATRIX_STRIDE={name:"UNIFORM_MATRIX_STRIDE",value:35389,description:" "},p.UNIFORM_IS_ROW_MAJOR={name:"UNIFORM_IS_ROW_MAJOR",value:35390,description:" "},p.UNIFORM_BLOCK_BINDING={name:"UNIFORM_BLOCK_BINDING",value:35391,description:" "},p.UNIFORM_BLOCK_DATA_SIZE={name:"UNIFORM_BLOCK_DATA_SIZE",value:35392,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORMS={name:"UNIFORM_BLOCK_ACTIVE_UNIFORMS",value:35394,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES={name:"UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",value:35395,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",value:35396,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",value:35398,description:" "},p.OBJECT_TYPE={name:"OBJECT_TYPE",value:37138,description:" "},p.SYNC_CONDITION={name:"SYNC_CONDITION",value:37139,description:" "},p.SYNC_STATUS={name:"SYNC_STATUS",value:37140,description:" "},p.SYNC_FLAGS={name:"SYNC_FLAGS",value:37141,description:" "},p.SYNC_FENCE={name:"SYNC_FENCE",value:37142,description:" "},p.SYNC_GPU_COMMANDS_COMPLETE={name:"SYNC_GPU_COMMANDS_COMPLETE",value:37143,description:" "},p.UNSIGNALED={name:"UNSIGNALED",value:37144,description:" "},p.SIGNALED={name:"SIGNALED",value:37145,description:" "},p.ALREADY_SIGNALED={name:"ALREADY_SIGNALED",value:37146,description:" "},p.TIMEOUT_EXPIRED={name:"TIMEOUT_EXPIRED",value:37147,description:" "},p.CONDITION_SATISFIED={name:"CONDITION_SATISFIED",value:37148,description:" "},p.WAIT_FAILED={name:"WAIT_FAILED",value:37149,description:" "},p.SYNC_FLUSH_COMMANDS_BIT={name:"SYNC_FLUSH_COMMANDS_BIT",value:1,description:" "},p.COLOR={name:"COLOR",value:6144,description:" "},p.DEPTH={name:"DEPTH",value:6145,description:" "},p.STENCIL={name:"STENCIL",value:6146,description:" "},p.MIN={name:"MIN",value:32775,description:" "},p.MAX={name:"MAX",value:32776,description:" "},p.DEPTH_COMPONENT24={name:"DEPTH_COMPONENT24",value:33190,description:" "},p.STREAM_READ={name:"STREAM_READ",value:35041,description:" "},p.STREAM_COPY={name:"STREAM_COPY",value:35042,description:" "},p.STATIC_READ={name:"STATIC_READ",value:35045,description:" "},p.STATIC_COPY={name:"STATIC_COPY",value:35046,description:" "},p.DYNAMIC_READ={name:"DYNAMIC_READ",value:35049,description:" "},p.DYNAMIC_COPY={name:"DYNAMIC_COPY",value:35050,description:" "},p.DEPTH_COMPONENT32F={name:"DEPTH_COMPONENT32F",value:36012,description:" "},p.DEPTH32F_STENCIL8={name:"DEPTH32F_STENCIL8",value:36013,description:" "},p.INVALID_INDEX={name:"INVALID_INDEX",value:4294967295,description:" "},p.TIMEOUT_IGNORED={name:"TIMEOUT_IGNORED",value:-1,description:" "},p.MAX_CLIENT_WAIT_TIMEOUT_WEBGL={name:"MAX_CLIENT_WAIT_TIMEOUT_WEBGL",value:37447,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE={name:"VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",value:35070,description:"Describes the frequency divisor used for instanced rendering.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_VENDOR_WEBGL={name:"UNMASKED_VENDOR_WEBGL",value:37445,description:"Passed to getParameter to get the vendor string of the graphics driver.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_RENDERER_WEBGL={name:"UNMASKED_RENDERER_WEBGL",value:37446,description:"Passed to getParameter to get the renderer string of the graphics driver.",extensionName:"WEBGL_debug_renderer_info"},p.MAX_TEXTURE_MAX_ANISOTROPY_EXT={name:"MAX_TEXTURE_MAX_ANISOTROPY_EXT",value:34047,description:"Returns the maximum available anisotropy.",extensionName:"EXT_texture_filter_anisotropic"},p.TEXTURE_MAX_ANISOTROPY_EXT={name:"TEXTURE_MAX_ANISOTROPY_EXT",value:34046,description:"Passed to texParameter to set the desired maximum anisotropy for a texture.",extensionName:"EXT_texture_filter_anisotropic"},p.COMPRESSED_RGB_S3TC_DXT1_EXT={name:"COMPRESSED_RGB_S3TC_DXT1_EXT",value:33776,description:"A DXT1-compressed image in an RGB image format.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT1_EXT={name:"COMPRESSED_RGBA_S3TC_DXT1_EXT",value:33777,description:"A DXT1-compressed image in an RGB image format with a simple on/off alpha value.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT3_EXT={name:"COMPRESSED_RGBA_S3TC_DXT3_EXT",value:33778,description:"A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT5_EXT={name:"COMPRESSED_RGBA_S3TC_DXT5_EXT",value:33779,description:"A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_R11_EAC={name:"COMPRESSED_R11_EAC",value:37488,description:"One-channel (red) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_R11_EAC={name:"COMPRESSED_SIGNED_R11_EAC",value:37489,description:"One-channel (red) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RG11_EAC={name:"COMPRESSED_RG11_EAC",value:37490,description:"Two-channel (red and green) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_RG11_EAC={name:"COMPRESSED_SIGNED_RG11_EAC",value:37491,description:"Two-channel (red and green) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_ETC2={name:"COMPRESSED_RGB8_ETC2",value:37492,description:"Compresses RBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGBA8_ETC2_EAC={name:"COMPRESSED_RGBA8_ETC2_EAC",value:37493,description:"Compresses RGBA8 data. The RGB part is encoded the same as RGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ETC2={name:"COMPRESSED_SRGB8_ETC2",value:37494,description:"Compresses sRBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC={name:"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",value:37495,description:"Compresses sRGBA8 data. The sRGB part is encoded the same as SRGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37496,description:"Similar to RGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37497,description:"Similar to SRGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_4BPPV1_IMG",value:35840,description:"RGB compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",value:35842,description:"RGBA compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_2BPPV1_IMG",value:35841,description:"RGB compression in 2-bit mode. One block for each 8×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",value:35843,description:"RGBA compression in 2-bit mode. One block for each 8×4 pixe",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_ETC1_WEBGL={name:"COMPRESSED_RGB_ETC1_WEBGL",value:36196,description:"Compresses 24-bit RGB data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc1"},p.COMPRESSED_RGB_ATC_WEBGL={name:"COMPRESSED_RGB_ATC_WEBGL",value:35986,description:"Compresses RGB textures with no alpha channel.",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",value:35986,description:"Compresses RGBA textures using explicit alpha encoding (useful when alpha transitions are sharp).",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",value:34798,description:"Compresses RGBA textures using interpolated alpha encoding (useful when alpha transitions are gradient).",extensionName:"WEBGL_compressed_texture_atc"},p.UNSIGNED_INT_24_8_WEBGL={name:"UNSIGNED_INT_24_8_WEBGL",value:34042,description:"Unsigned integer type for 24-bit depth texture data.",extensionName:"WEBGL_depth_texture"},p.HALF_FLOAT_OES={name:"HALF_FLOAT_OES",value:36193,description:"Half floating-point type (16-bit).",extensionName:"OES_texture_half_float"},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",value:33297,description:" ",extensionName:"WEBGL_color_buffer_float"},p.UNSIGNED_NORMALIZED_EXT={name:"UNSIGNED_NORMALIZED_EXT",value:35863,description:" ",extensionName:"WEBGL_color_buffer_float"},p.MIN_EXT={name:"MIN_EXT",value:32775,description:"Produces the minimum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.MAX_EXT={name:"MAX_EXT",value:32776,description:"Produces the maximum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.SRGB_EXT={name:"SRGB_EXT",value:35904,description:"Unsized sRGB format that leaves the precision up to the driver.",extensionName:"EXT_sRGB"},p.SRGB_ALPHA_EXT={name:"SRGB_ALPHA_EXT",value:35906,description:"Unsized sRGB format with unsized alpha component.",extensionName:"EXT_sRGB"},p.SRGB8_ALPHA8_EXT={name:"SRGB8_ALPHA8_EXT",value:35907,description:"Sized (8-bit) sRGB and alpha formats.",extensionName:"EXT_sRGB"},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",value:33296,description:"Returns the framebuffer color encoding.",extensionName:"EXT_sRGB"},p.FRAGMENT_SHADER_DERIVATIVE_HINT_OES={name:"FRAGMENT_SHADER_DERIVATIVE_HINT_OES",value:35723,description:"Indicates the accuracy of the derivative calculation for the GLSL built-in functions: dFdx, dFdy, and fwidth.",extensionName:"OES_standard_derivatives"},p.COLOR_ATTACHMENT0_WEBGL={name:"COLOR_ATTACHMENT0_WEBGL",value:36064,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT1_WEBGL={name:"COLOR_ATTACHMENT1_WEBGL",value:36065,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT2_WEBGL={name:"COLOR_ATTACHMENT2_WEBGL",value:36066,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT3_WEBGL={name:"COLOR_ATTACHMENT3_WEBGL",value:36067,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT4_WEBGL={name:"COLOR_ATTACHMENT4_WEBGL",value:36068,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT5_WEBGL={name:"COLOR_ATTACHMENT5_WEBGL",value:36069,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT6_WEBGL={name:"COLOR_ATTACHMENT6_WEBGL",value:36070,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT7_WEBGL={name:"COLOR_ATTACHMENT7_WEBGL",value:36071,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT8_WEBGL={name:"COLOR_ATTACHMENT8_WEBGL",value:36072,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT9_WEBGL={name:"COLOR_ATTACHMENT9_WEBGL",value:36073,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT10_WEBGL={name:"COLOR_ATTACHMENT10_WEBGL",value:36074,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT11_WEBGL={name:"COLOR_ATTACHMENT11_WEBGL",value:36075,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT12_WEBGL={name:"COLOR_ATTACHMENT12_WEBGL",value:36076,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT13_WEBGL={name:"COLOR_ATTACHMENT13_WEBGL",value:36077,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT14_WEBGL={name:"COLOR_ATTACHMENT14_WEBGL",value:36078,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT15_WEBGL={name:"COLOR_ATTACHMENT15_WEBGL",value:36079,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER0_WEBGL={name:"DRAW_BUFFER0_WEBGL",value:34853,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER1_WEBGL={name:"DRAW_BUFFER1_WEBGL",value:34854,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER2_WEBGL={name:"DRAW_BUFFER2_WEBGL",value:34855,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER3_WEBGL={name:"DRAW_BUFFER3_WEBGL",value:34856,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER4_WEBGL={name:"DRAW_BUFFER4_WEBGL",value:34857,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER5_WEBGL={name:"DRAW_BUFFER5_WEBGL",value:34858,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER6_WEBGL={name:"DRAW_BUFFER6_WEBGL",value:34859,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER7_WEBGL={name:"DRAW_BUFFER7_WEBGL",value:34860,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER8_WEBGL={name:"DRAW_BUFFER8_WEBGL",value:34861,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER9_WEBGL={name:"DRAW_BUFFER9_WEBGL",value:34862,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER10_WEBGL={name:"DRAW_BUFFER10_WEBGL",value:34863,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER11_WEBGL={name:"DRAW_BUFFER11_WEBGL",value:34864,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER12_WEBGL={name:"DRAW_BUFFER12_WEBGL",value:34865,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER13_WEBGL={name:"DRAW_BUFFER13_WEBGL",value:34866,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER14_WEBGL={name:"DRAW_BUFFER14_WEBGL",value:34867,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER15_WEBGL={name:"DRAW_BUFFER15_WEBGL",value:34868,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.MAX_COLOR_ATTACHMENTS_WEBGL={name:"MAX_COLOR_ATTACHMENTS_WEBGL",value:36063,description:"Maximum number of framebuffer color attachment points",extensionName:"WEBGL_draw_buffers"},p.MAX_DRAW_BUFFERS_WEBGL={name:"MAX_DRAW_BUFFERS_WEBGL",value:34852,description:"Maximum number of draw buffers",extensionName:"WEBGL_draw_buffers"},p.VERTEX_ARRAY_BINDING_OES={name:"VERTEX_ARRAY_BINDING_OES",value:34229,description:"The bound vertex array object (VAO).",extensionName:"VERTEX_ARRAY_BINDING_OES"},p.QUERY_COUNTER_BITS_EXT={name:"QUERY_COUNTER_BITS_EXT",value:34916,description:"The number of bits used to hold the query result for the given target.",extensionName:"EXT_disjoint_timer_query"},p.CURRENT_QUERY_EXT={name:"CURRENT_QUERY_EXT",value:34917,description:"The currently active query.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_EXT={name:"QUERY_RESULT_EXT",value:34918,description:"The query result.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_AVAILABLE_EXT={name:"QUERY_RESULT_AVAILABLE_EXT",value:34919,description:"A Boolean indicating whether or not a query result is available.",extensionName:"EXT_disjoint_timer_query"},p.TIME_ELAPSED_EXT={name:"TIME_ELAPSED_EXT",value:35007,description:"Elapsed time (in nanoseconds).",extensionName:"EXT_disjoint_timer_query"},p.TIMESTAMP_EXT={name:"TIMESTAMP_EXT",value:36392,description:"The current time.",extensionName:"EXT_disjoint_timer_query"},p.GPU_DISJOINT_EXT={name:"GPU_DISJOINT_EXT",value:36795,description:"A Boolean indicating whether or not the GPU performed any disjoint operation.",extensionName:"EXT_disjoint_timer_query"},p.zeroMeaningByCommand={getError:"NO_ERROR",blendFunc:"ZERO",blendFuncSeparate:"ZERO",readBuffer:"NONE",getFramebufferAttachmentParameter:"NONE",texParameterf:"NONE",texParameteri:"NONE",drawArrays:"POINTS",drawElements:"POINTS",drawArraysInstanced:"POINTS",drawArraysInstancedAngle:"POINTS",drawBuffers:"POINTS",drawElementsInstanced:"POINTS",drawRangeElements:"POINTS"},p.oneMeaningByCommand={blendFunc:"ONE",blendFuncSeparate:"ONE",drawArrays:"LINES",drawElements:"LINES",drawArraysInstanced:"LINES",drawArraysInstancedAngle:"LINES",drawBuffers:"LINES",drawElementsInstanced:"LINES",drawRangeElements:"LINES"};const m={},g={};!function(){for(const e in p)if(p.hasOwnProperty(e)){const t=p[e];m[t.name]=t,g[t.value]=t}}();class E extends c{get analyserName(){return E.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={total:0,totalTriangles:0,totalTriangleStrip:0,totalTriangleFan:0,totalLines:0,totalLineStrip:0,totalLineLoop:0,totalPoints:0};for(const t of e.commands)"drawArrays"===t.name&&t.commandArguments.length>=3||"drawArraysInstanced"===t.name&&t.commandArguments.length>=3||"drawArraysInstancedANGLE"===t.name&&t.commandArguments.length>=3?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[2]):"drawElements"===t.name&&t.commandArguments.length>=2||"drawElementsInstanced"===t.name&&t.commandArguments.length>=2||"drawElementsInstancedANGLE"===t.name&&t.commandArguments.length>=2?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[1]):"drawRangeElements"===t.name&&t.commandArguments.length>=4&&this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[3]);t.total=n.total,t.triangles=n.totalTriangles,t.triangleStrip=n.totalTriangleStrip,t.triangleFan=n.totalTriangleFan,t.lines=n.totalLines,t.lineStrip=n.totalLineStrip,t.lineLoop=n.totalLineLoop,t.points=n.totalPoints}appendToPrimitives(e,t,n){t===p.POINTS.value?e.totalPoints+=n:t===p.LINES.value?e.totalLines+=n:t===p.LINE_STRIP.value?e.totalLineStrip+=n:t===p.LINE_LOOP.value?e.totalLineLoop+=n:t===p.TRIANGLES.value?e.totalTriangles+=n:t===p.TRIANGLE_STRIP.value?e.totalTriangleStrip+=n:t===p.TRIANGLE_FAN.value&&(e.totalTriangleFan+=n),e.total+=n}}E.analyserName="Primitives";class v{constructor(e){this.contextInformation=e,this.analysers=[],this.initAnalysers()}appendAnalyses(e){for(const t in this.analysers)this.analysers.hasOwnProperty(t)&&this.analysers[t].appendAnalysis(e)}initAnalysers(){this.analysers.push(new h(this.contextInformation),new f(this.contextInformation),new E(this.contextInformation))}}class C{static getStackTrace(e=0,t=0){const n=[];try{throw new Error("Errorator.")}catch(e){if(e.stack){const t=e.stack.split("\n");for(let e=0,r=t.length;e0;t++)n.shift();for(let e=0;e0;e++)n.pop()}return n}}class D{static getWebGlObjectTag(e){return e[D.SPECTOROBJECTTAGKEY]}static attachWebGlObjectTag(e,t){t.displayText=D.stringifyWebGlObjectTag(t),e[D.SPECTOROBJECTTAGKEY]=t}static stringifyWebGlObjectTag(e){return e?`${e.typeName} - ID: ${e.id}`:"No tag available."}}D.SPECTOROBJECTTAGKEY="__SPECTOR_Object_TAG";class S{get type(){return("undefined"!=typeof globalThis?globalThis:self)[this.typeName]||null}constructor(){this.id=0}tagWebGlObject(e){if(!this.type)return;let t;if(!e)return t;if(t=D.getWebGlObjectTag(e),t)return t;if(e instanceof this.type){const n=this.getNextId();return t={typeName:this.typeName,id:n},D.attachWebGlObjectTag(e,t),t}return t}getNextId(){return this.id++}}class A{constructor(e){this.options=e}createCapture(e,t,n){const r=C.getStackTrace(4,1),i=0===e.name.indexOf("uniform")?this.stringifyUniform(e.arguments):this.stringify(e.arguments,e.result),s={id:t,startTime:e.startTime,commandEndTime:e.endTime,endTime:0,name:e.name,commandArguments:e.arguments,result:e.result,stackTrace:r,status:0,marker:n,text:i};this.transformCapture(s);for(let e=0;e50&&(s.commandArguments[e]="Array Length: "+t.length)}if(s.commandArguments){const e=[];for(let t=0;t0&&(n+=": "+this.stringifyArgs(e).join(", ")),null!=t&&(n+=" -> "+this.stringifyResult(t)),n}stringifyUniform(e){let t=this.spiedCommandName;if(e&&e.length>0){const n=[];n.push(this.stringifyValue(e[0]));for(let t=1;t0&&"number"==typeof s)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");else{const e=this.stringifyValue(s);r.push(e)}}return r}}_.commandName="bufferSubData";class y{static storeOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]||(e[n]=e[t])}static resetOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]&&(e[t]=e[n],delete e[n])}static storePrototypeOriginFunction(e,t){if(!e)return;if(!e.prototype[t])return;const n=this.getOriginFunctionName(t);e.prototype[n]||(e.prototype[n]=e.prototype[t])}static executePrototypeOriginFunction(e,t,n,r){if(!e)return;const i=this.getOriginFunctionName(n);return t.prototype[i]?(e[i]||(e[i]=t.prototype[i]),this.executeFunction(e,i,r)):void 0}static executeOriginFunction(e,t,n){if(!e)return;const r=this.getOriginFunctionName(t);return e[r]?this.executeFunction(e,r,n):void 0}static executeFunction(e,t,n){const r=n;if(void 0===r||0===r.length)return e[t]();switch(r.length){case 1:return e[t](r[0]);case 2:return e[t](r[0],r[1]);case 3:return e[t](r[0],r[1],r[2]);case 4:return e[t](r[0],r[1],r[2],r[3]);case 5:return e[t](r[0],r[1],r[2],r[3],r[4]);case 6:return e[t](r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6]);case 8:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]);case 9:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8]);case 10:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9]);case 11:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10]);case 12:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11]);case 13:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12]);case 14:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13]);case 15:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14]);case 16:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);case 17:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16]);case 18:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17]);case 19:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18]);case 20:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19]);default:return e[t].apply(e,r)}}static getOriginFunctionName(e){return this.originFunctionPrefix+e}}y.originFunctionPrefix="__SPECTOR_Origin_";class b extends A{get spiedCommandName(){return b.commandName}stringifyArgs(e){const t=[];if(e.length>0){const n=e[0],r=this.stringifyValue(n);t.push(r)}if(e.length>1){const n=""+e[1];t.push(n)}return e.length>2&&t.push(e[2]),t}}b.commandName="bindAttribLocation";class T extends A{get spiedCommandName(){return T.commandName}stringifyArgs(e){const t=[],n=this.options.context.getParameter(p.READ_FRAMEBUFFER_BINDING.value),r=this.options.tagWebGlObject(n);t.push("READ FROM: "+this.stringifyValue(r));const i=this.options.context.getParameter(p.DRAW_FRAMEBUFFER_BINDING.value),s=this.options.tagWebGlObject(i);t.push("WRITE TO: "+this.stringifyValue(s));for(let n=0;n<8;n++)t.push(e[n]);return(e[8]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[8]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[8]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t.push(p.stringifyWebGlConstant(e[9],"blitFrameBuffer")),t}}T.commandName="blitFrameBuffer";class R extends A{get spiedCommandName(){return R.commandName}stringifyArgs(e){const t=[];return(e[0]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[0]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[0]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t}}R.commandName="clear";class x{static getProgramData(e,t){const n={LINK_STATUS:e.getProgramParameter(t,p.LINK_STATUS.value),VALIDATE_STATUS:e.getProgramParameter(t,p.VALIDATE_STATUS.value),infoLog:e.getProgramInfoLog(t)||""},r=e.getAttachedShaders(t)||[],i=new Array(2);let s=0;for(const t of r){const n=this.getShaderData(e,t);s+=n.source.length,n.shaderType===p.FRAGMENT_SHADER.name?i[1]=n:i[0]=n}return{programStatus:n,shaders:i,length:s}}static getShaderData(e,t){const n=e.getShaderSource(t)||"",r=e.getExtension("WEBGL_debug_shaders"),i=r?r.getTranslatedShaderSource(t):null,s=e.getShaderParameter(t,p.SHADER_TYPE.value)===p.FRAGMENT_SHADER.value;let o=t&&t.__SPECTOR_Metadata&&t.__SPECTOR_Metadata.name?t.__SPECTOR_Metadata.name:this.readNameFromShaderSource(n);return o||(o=s?"Fragment":"Vertex"),{COMPILE_STATUS:e.getShaderParameter(t,p.COMPILE_STATUS.value),shaderType:s?p.FRAGMENT_SHADER.name:p.VERTEX_SHADER.name,name:o,source:n,translatedSource:i,infoLog:e.getShaderInfoLog(t)||""}}static readNameFromShaderSource(e){try{let t,n="";const r=/#define[\s]+SHADER_NAME[\s]+([\S]+)(\n|$)/gi;if(t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),""===n){const r=/#define[\s]+SHADER_NAME_B64[\s]+([\S]+)(\n|$)/gi;t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),n&&(n=decodeURIComponent(atob(n)))}return n}catch(e){return null}}}class w extends A{constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.shader=x.getShaderData(this.options.context,t)}finally{n&&n(!0)}}getShaderDisplayText(e){return this.stringifyValue(e.commandArguments[0])}}class F extends w{get spiedCommandName(){return F.commandName}transformCapture(e){if(super.transformCapture(e),e.shader){const t=e.shader.COMPILE_STATUS?"compiled":"failed";e.text=`${this.spiedCommandName}: ${this.getShaderDisplayText(e)} -> ${t}`}}}F.commandName="compileShader";const N=["lineWidth"];class L extends A{get spiedCommandName(){return this.internalSpiedCommandName}constructor(e,t){super(e),this.internalSpiedCommandName=t,this.isDeprecated=N.indexOf(this.spiedCommandName)>-1}transformCapture(e){this.isDeprecated&&(e.status=50)}}class O extends A{get spiedCommandName(){return O.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}O.commandName="disableVertexAttribArray";class I extends A{get spiedCommandName(){return I.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(e[1]+" indices"),t.push(e[2]),t}}I.commandName="drawArrays";class k extends A{get spiedCommandName(){return k.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}k.commandName="drawArraysInstanced";class M extends A{get spiedCommandName(){return M.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstancedANGLE")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}M.commandName="drawArraysInstancedANGLE";class P extends A{get spiedCommandName(){return P.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElements")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElements")),t.push(e[3]),t}}P.commandName="drawElements";class B extends A{get spiedCommandName(){return B.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstancedANGLE")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstancedANGLE")),t.push(e[3]),t.push(e[4]),t}}B.commandName="drawElementsInstancedANGLE";class U extends A{get spiedCommandName(){return U.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t}}U.commandName="drawElementsInstanced";class $ extends A{get spiedCommandName(){return $.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawRangeElements")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(p.stringifyWebGlConstant(e[4],"drawRangeElements")),t.push(e[5]),t}}$.commandName="drawRangeElements";class G extends A{get spiedCommandName(){return G.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}G.commandName="getActiveAttrib";class V extends A{get spiedCommandName(){return V.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}V.commandName="getActiveUniform";class W extends A{get spiedCommandName(){return W.commandName}stringifyResult(e){var t;if(null!=e)return null!==(t=null==e?void 0:e.toFixed(0))&&void 0!==t?t:"0"}}W.commandName="getAttribLocation";class H extends A{get spiedCommandName(){return H.commandName}stringifyResult(e){return e?"true":"false"}}H.commandName="getExtension";class j extends A{get spiedCommandName(){return j.commandName}stringifyResult(e){if(!e)return"null";const t=D.getWebGlObjectTag(e);return t?t.displayText:e}}j.commandName="getParameter";class z extends A{get spiedCommandName(){return z.commandName}stringifyResult(e){if(e)return`min: ${e.rangeMin}, max: ${e.rangeMax}, precision: ${e.precision}`}}z.commandName="getShaderPrecisionFormat";class X extends w{get spiedCommandName(){return X.commandName}stringifyResult(e){if("string"!=typeof e||0===e.trim().length)return"No messages";const t=e.split(/\r?\n/).filter(e=>e.trim().length>0).length;return t+(1===t?" message":" messages")}}X.commandName="getShaderInfoLog";class K extends A{get spiedCommandName(){return K.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}K.commandName="getTransformFeedbackVarying";class Y extends A{get spiedCommandName(){return Y.commandName}constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.program=x.getProgramData(this.options.context,t)}finally{n&&n(!0)}const r=e.program.programStatus.LINK_STATUS?"linked":"failed";e.text=`${this.spiedCommandName}: ${this.stringifyValue(t)} -> ${r}`}}Y.commandName="linkProgram";class q extends A{get spiedCommandName(){return q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"multiDrawArraysInstancedBaseInstanceWEBGL")),t.push(`drawCount=${e[9]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t}}q.commandName="multiDrawArraysInstancedBaseInstanceWEBGL";class Q extends A{get spiedCommandName(){return Q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[7]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t}}Q.commandName="multiDrawArraysInstancedWEBGL";class Z extends A{get spiedCommandName(){return Z.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[5]}`),t.push(e[2]),t.push(e[4]),t}}Z.commandName="multiDrawArraysWEBGL";class J extends A{get spiedCommandName(){return J.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[11]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t.push(e[10]),t}}J.commandName="multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL";class ee extends A{get spiedCommandName(){return ee.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[8]}`),t.push(e[2]),t.push(e[5]),t.push(e[7]),t}}ee.commandName="multiDrawElementsInstancedWEBGL";class te extends A{get spiedCommandName(){return te.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[6]}`),t.push(e[2]),t.push(e[5]),t}}te.commandName="multiDrawElementsWEBGL";class ne extends A{get spiedCommandName(){return ne.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(`baseInstance = ${e[4]}`),t}}ne.commandName="drawArraysInstancedBaseInstanceWEBGL";class re extends A{get spiedCommandName(){return re.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t.push(`baseVertex = ${e[5]}`),t.push(`baseInstance = ${e[6]}`),t}}re.commandName="drawElementsInstancedBaseVertexBaseInstanceWEBGL";class ie extends A{get spiedCommandName(){return ie.commandName}stringifyArgs(e){var t,n;const r=[];for(let i=0;i<4;i++)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");return r}}function se(e){return null==e?"":`${e.toFixed(0)} (0b${(e>>>0).toString(2)})`}ie.commandName="scissor";class oe extends A{get spiedCommandName(){return oe.commandName}stringifyArgs(e){const t=[];return t.push(se(e[0])),t}}oe.commandName="stencilMask";class ae extends A{get spiedCommandName(){return ae.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilMaskSeparate")),t.push(se(e[1])),t}}ae.commandName="stencilMaskSeparate";class le extends A{get spiedCommandName(){return le.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFunc")),t.push(se(e[1])),t.push(se(e[2])),t}}le.commandName="stencilFunc";class ue extends A{get spiedCommandName(){return ue.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFuncSeparate")),t.push(p.stringifyWebGlConstant(e[1],"stencilFuncSeparate")),t.push(se(e[2])),t.push(se(e[3])),t}}ue.commandName="stencilFuncSeparate";class ce extends A{get spiedCommandName(){return ce.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t.push(e[1]),t.push(p.stringifyWebGlConstant(e[2],"vertexAttribPointer")),t.push(e[3]),t.push(e[4]),t.push(e[5]),t}}ce.commandName="vertexAttribPointer";class he extends A{get spiedCommandName(){return he.commandName}stringifyArgs(e){const t=[];for(let n=0;n<4;n++)t.push(e[n].toFixed(0));return t}}he.commandName="viewport";class de extends A{get spiedCommandName(){return de.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}de.commandName="enableVertexAttribArray";class fe extends w{get spiedCommandName(){return fe.commandName}stringifyArgs(e){const t="string"==typeof e[1]?e[1]:"";return[this.stringifyValue(e[0]),t.length+" chars"]}transformCapture(e){super.transformCapture(e);const t=e.commandArguments[1];e.shader&&"string"==typeof t&&(e.shader.source=t,e.shader.COMPILE_STATUS=null,e.shader.translatedSource="",e.shader.infoLog="")}}fe.commandName="shaderSource";class pe{constructor(e){this.spiedCommandName=e.spiedCommandName,this.spiedCommandRunningContext=e.spiedCommandRunningContext,this.spiedCommand=this.spiedCommandRunningContext[this.spiedCommandName],y.storeOriginFunction(this.spiedCommandRunningContext,this.spiedCommandName),this.callback=e.callback,this.commandOptions={context:e.context,contextVersion:e.contextVersion,extensions:e.extensions,toggleCapture:e.toggleCapture},this.initCustomCommands(),this.initCommand()}spy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.overloadedCommand}unSpy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.spiedCommand}createCapture(e,t,n){return this.command.createCapture(e,t,n)}initCommand(){pe.customCommandsConstructors[this.spiedCommandName]?this.command=pe.customCommandsConstructors[this.spiedCommandName](this.commandOptions):this.command=new L(this.commandOptions,this.spiedCommandName),this.overloadedCommand=this.getSpy()}getSpy(){const e=this;return function(){const t=u.now,n=y.executeOriginFunction(e.spiedCommandRunningContext,e.spiedCommandName,arguments),r=u.now;try{const i={name:e.spiedCommandName,arguments,result:n,startTime:t,endTime:r};e.callback(e,i)}catch(e){}return n}}initCustomCommands(){pe.customCommandsConstructors||(pe.customCommandsConstructors={[b.commandName]:e=>new b(e),[T.commandName]:e=>new T(e),[_.commandName]:e=>new _(e),[R.commandName]:e=>new R(e),[F.commandName]:e=>new F(e),[O.commandName]:e=>new O(e),[I.commandName]:e=>new I(e),[k.commandName]:e=>new k(e),[M.commandName]:e=>new M(e),[P.commandName]:e=>new P(e),[U.commandName]:e=>new U(e),[B.commandName]:e=>new B(e),[$.commandName]:e=>new $(e),[G.commandName]:e=>new G(e),[V.commandName]:e=>new V(e),[W.commandName]:e=>new W(e),[H.commandName]:e=>new H(e),[j.commandName]:e=>new j(e),[X.commandName]:e=>new X(e),[z.commandName]:e=>new z(e),[K.commandName]:e=>new K(e),[Y.commandName]:e=>new Y(e),[q.commandName]:e=>new q(e),[Q.commandName]:e=>new Q(e),[Z.commandName]:e=>new Z(e),[J.commandName]:e=>new J(e),[ee.commandName]:e=>new ee(e),[te.commandName]:e=>new te(e),[ne.commandName]:e=>new ne(e),[re.commandName]:e=>new re(e),[ie.commandName]:e=>new ie(e),[fe.commandName]:e=>new fe(e),[oe.commandName]:e=>new oe(e),[ae.commandName]:e=>new ae(e),[le.commandName]:e=>new le(e),[ue.commandName]:e=>new ue(e),[ce.commandName]:e=>new ce(e),[he.commandName]:e=>new he(e),[de.commandName]:e=>new de(e)})}}class me{constructor(e){this.options=e,this.context=e.context,this.contextVersion=e.contextVersion,this.extensions=e.extensions,this.toggleCapture=e.toggleCapture,this.consumeCommands=this.getConsumeCommands(),this.changeCommandsByState=this.getChangeCommandsByState(),this.commandNameToStates=this.getCommandNameToStates()}get requireStartAndStopStates(){return!0}startCapture(e,t,n){return this.quickCapture=t,this.fullCapture=n,this.capturedCommandsByState={},e&&this.requireStartAndStopStates&&(this.currentState={},this.readFromContextNoSideEffects()),this.copyCurrentStateToPrevious(),this.currentState={},this.previousState}stopCapture(){return this.requireStartAndStopStates&&this.readFromContextNoSideEffects(),this.analyse(void 0),this.currentState}registerCallbacks(e){for(const t in this.changeCommandsByState)if(this.changeCommandsByState.hasOwnProperty(t))for(const n of this.changeCommandsByState[t])e[n]=e[n]||[],e[n].push(this.onChangeCommand.bind(this));for(const t of this.consumeCommands)e[t]=e[t]||[],e[t].push(this.onConsumeCommand.bind(this))}getStateData(){return this.currentState}getConsumeCommands(){return[]}getChangeCommandsByState(){return{}}copyCurrentStateToPrevious(){this.currentState&&(this.previousState=this.currentState)}onChangeCommand(e){const t=this.commandNameToStates[e.name];for(const n of t){if(!this.isValidChangeCommand(e,n))return;this.capturedCommandsByState[n]=this.capturedCommandsByState[n]||[],this.capturedCommandsByState[n].push(e)}}isValidChangeCommand(e,t){return!0}onConsumeCommand(e){this.isValidConsumeCommand(e)&&(this.readFromContextNoSideEffects(),this.analyse(e),this.storeCommandIds(),e[this.stateName]=this.currentState,this.startCapture(!1,this.quickCapture,this.fullCapture))}isValidConsumeCommand(e){return this.lastCommandName=null==e?void 0:e.name,!0}analyse(e){for(const t in this.capturedCommandsByState)if(this.capturedCommandsByState.hasOwnProperty(t)){const n=this.capturedCommandsByState[t],r=n.length-1;if(r>=0)if(e){for(let t=0;t1&&this.parameters.push(this.getWebgl2Parameters());const e={};for(let t=1;t<=this.contextVersion&&!(t>this.parameters.length);t++)if(this.parameters[t-1])for(const n of this.parameters[t-1])if(n.changeCommands)for(const t of n.changeCommands)e[n.constant.name]=e[n.constant.name]||[],e[n.constant.name].push(t);return e}readFromContext(){for(let e=1;e<=this.contextVersion&&!(e>this.parameters.length);e++)for(const t of this.parameters[e-1]){const e=this.readParameterFromContext(t);if(null==e){const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n;continue}const n=D.getWebGlObjectTag(e);if(n)this.currentState[t.constant.name]=n;else{const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n}}}readParameterFromContext(e){return e.constant.extensionName&&!this.extensions[e.constant.extensionName]?`Extension ${e.constant.extensionName} is unavailable.`:this.context.getParameter(e.constant.value)}stringifyParameterValue(e,t){if(null===e)return"null";if(void 0===e)return"undefined";if(30===t.returnType)return se(e);if("number"==typeof e&&p.isWebGlConstant(e)){if(20===t.returnType){const n=t.changeCommands&&t.changeCommands[0]||"";return p.stringifyWebGlConstant(e,n)}return e}if(e.length&&"string"!=typeof e){const t=[];for(let n=0;n1?r=this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value):this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.value)===p.RENDERBUFFER.value&&(r=e.getRenderbufferParameter(e.RENDERBUFFER,e.RENDERBUFFER_STENCIL_SIZE))):r=this.readParameterFromContext({constant:p.STENCIL_BITS}),this.currentState[p.STENCIL_BITS.name]=""+r}isValidChangeCommand(e,t){return"enable"===e.name||"disable"===e.name?e.commandArguments[0]===p.STENCIL_TEST.value:"stencilOp"===e.name||"stencilOpSeparate"===e.name?xe.stencilOpStates.indexOf(e.commandArguments[0])>0:"stencilFunc"===e.name||"stencilFuncSeparate"===e.name?xe.stencilFuncStates.indexOf(e.commandArguments[0])>0:"stencilMask"!==e.name&&"stencilMaskSeparate"!==e.name||xe.stencilMaskStates.indexOf(e.commandArguments[0])>0}getConsumeCommands(){return d}isStateEnable(e,t){return this.context.isEnabled(p.STENCIL_TEST.value)}}xe.stateName="StencilState",xe.stencilOpStates=[p.STENCIL_BACK_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_PASS.value,p.STENCIL_FAIL.value,p.STENCIL_PASS_DEPTH_FAIL.value,p.STENCIL_PASS_DEPTH_PASS.value],xe.stencilFuncStates=[p.STENCIL_BACK_FUNC.value,p.STENCIL_BACK_REF.value,p.STENCIL_BACK_VALUE_MASK.value,p.STENCIL_FUNC.value,p.STENCIL_REF.value,p.STENCIL_VALUE_MASK.value],xe.stencilMaskStates=[p.STENCIL_BACK_WRITEMASK.value,p.STENCIL_WRITEMASK.value];class we{static isSupportedCombination(e,t,n){return e=e||p.UNSIGNED_BYTE.value,((t=t||p.RGBA.value)===p.RGB.value||t===p.RGBA.value)&&(n===p.RGB.value||n===p.RGBA.value||n===p.RGBA8.value||n===p.RGBA16F.value||n===p.RGBA32F.value||n===p.RGB16F.value||n===p.RGB32F.value||n===p.R11F_G11F_B10F.value||n===p.SRGB8.value||n===p.SRGB8_ALPHA8.value)&&this.isSupportedComponentType(e)}static readPixels(e,t,n,r,i,s){e.getError(),s===p.UNSIGNED_NORMALIZED.value&&(s=p.UNSIGNED_BYTE.value);const o=r*i*4;let a;if(s===p.UNSIGNED_BYTE.value?a=new Uint8Array(o):(s=p.FLOAT.value,a=new Float32Array(o)),e.readPixels(t,n,r,i,e.RGBA,s,a),e.getError())return;if(s===p.UNSIGNED_BYTE.value)return a;const l=new Uint8Array(r*i*4);for(let e=0;e1){const e=this.context.getParameter(p.MAX_DRAW_BUFFERS.value);for(let n=0;n1?this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value):p.UNSIGNED_BYTE.value;l===p.RENDERBUFFER.value?this.readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,c,u):l===p.TEXTURE.value&&this.readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,c,u)}readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,l,u){let c=0,h=0;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,c=e.samples,h=e.internalFormat,!c&&!we.isSupportedCombination(l,p.RGBA.value,h))return}else s+=r,o+=i;if(r=i=0,c){const a=e,u=e.createRenderbuffer(),c=e.getParameter(e.RENDERBUFFER_BINDING);e.bindRenderbuffer(e.RENDERBUFFER,u),e.renderbufferStorage(e.RENDERBUFFER,h,s,o),e.bindRenderbuffer(e.RENDERBUFFER,c),e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u);const d=a.getParameter(a.READ_FRAMEBUFFER_BINDING),f=a.getParameter(a.DRAW_FRAMEBUFFER_BINDING);a.bindFramebuffer(a.READ_FRAMEBUFFER,t),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,this.captureFrameBuffer),a.blitFramebuffer(0,0,s,o,0,0,s,o,e.COLOR_BUFFER_BIT,e.NEAREST),a.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),a.bindFramebuffer(a.READ_FRAMEBUFFER,d),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,f),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t),e.deleteRenderbuffer(u)}else e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,l,u){let c=0;this.contextVersion>1&&(c=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value));const h=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL.value),d=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE.value);d>0?g[d].name:p.TEXTURE_2D.name;let f=!1,m=l;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,void 0!==e.type&&(m=e.type),f=e.target===p.TEXTURE_2D_ARRAY.name,!we.isSupportedCombination(e.type,e.format,e.internalFormat))return}else s+=r,o+=i;r=i=0,e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),c>0||f?e.framebufferTextureLayer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,u,h,c):e.framebufferTexture2D(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,d||p.TEXTURE_2D.value,u,h),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,d,c,m),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}getCapture(e,t,n,r,i,s,o,l,u){i=Math.floor(i),s=Math.floor(s);const c={attachmentName:t,src:null,textureCubeMapFace:o?g[o].name:null,textureLayer:l,raw:null};if(!this.quickCapture)try{const t=we.readPixels(e,n,r,i,s,u);if(t){c.raw=Ne.encode(t,i,s),this.workingCanvas.width=i,this.workingCanvas.height=s;const e=this.workingContext2D.createImageData(i,s);if(e.data.set(t),this.workingContext2D.putImageData(e,0,0),this.fullCapture)this.captureCanvas.width=this.workingCanvas.width,this.captureCanvas.height=this.workingCanvas.height;else{const e=i/s;e<1?(this.captureCanvas.width=Le.captureBaseSize*e,this.captureCanvas.height=Le.captureBaseSize):e>1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this.captureContext2D.drawImage(this.workingCanvas,0,0,i,s,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",c.src=Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D)}}catch(e){a.warn("Spector can not capture the visual state: "+e)}this.currentState.Attachments.push(c)}analyse(e){}}Le.stateName="VisualState",Le.captureBaseSize=256;class Oe{constructor(e){this.context=e.context,this.captureFrameBuffer=e.context.createFramebuffer(),this.workingCanvas=Fe.createCanvas(1,1),this.workingContext2D=Fe.get2DContext(this.workingCanvas),this.captureCanvas=Fe.createCanvas(1,1),this.captureContext2D=Fe.get2DContext(this.captureCanvas),Fe.setImageSmoothing(this.captureContext2D,!0)}appendTextureState(e,t,n=null,r){if(!t)return;const i=t.__SPECTOR_Object_CustomData;if(i&&(this.fullCapture=r,i.type&&(e.textureType=this.getWebGlConstant(i.type)),i.format&&(e.format=this.getWebGlConstant(i.format)),i.internalFormat&&(e.internalFormat=this.getWebGlConstant(i.internalFormat)),e.width=i.width,e.height=i.height,i.depth&&(e.depth=i.depth),n)){const r="NEAREST"===e.samplerMagFilter||"NEAREST"===e.magFilter,s=this.getTextureVisualState(n,t,i,r);if(s){e.visual=s.visual;for(const t in s.visualPixels)if(s.visualPixels.hasOwnProperty(t)){e.visualPixels=s.visualPixels;break}}}}getTextureVisualState(e,t,n,r){try{const i=this.context,s={},o={};if(!we.isSupportedCombination(n.type,n.format,n.internalFormat))return{visual:s,visualPixels:o};const a=this.context.getParameter(p.FRAMEBUFFER_BINDING.value);i.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer);try{const a=0,l=n.width,u=n.height;if(e===p.TEXTURE_3D&&n.depth){const e=i;for(let c=0;c2&&c2&&c1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}return this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this._setSmoothing(!o),this.captureContext2D.drawImage(this.workingCanvas,0,0,r,i,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",{src:Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D),raw:l}}catch(e){}return{src:void 0,raw:null}}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}_setSmoothing(e){Fe.setImageSmoothing(this.captureContext2D,e)}}Oe.captureBaseSize=64,Oe.cubeMapFaces=[p.TEXTURE_CUBE_MAP_POSITIVE_X,p.TEXTURE_CUBE_MAP_POSITIVE_Y,p.TEXTURE_CUBE_MAP_POSITIVE_Z,p.TEXTURE_CUBE_MAP_NEGATIVE_X,p.TEXTURE_CUBE_MAP_NEGATIVE_Y,p.TEXTURE_CUBE_MAP_NEGATIVE_Z];class Ie{constructor(e){this.context=e.context}getUboValue(e,t,n,r){const i=Ie.uboTypes[r];if(!i)return;const s=new i.arrayBufferView(n*i.lengthMultiplier),o=this.context,a=o.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,e);if(a){const n=o.getIndexedParameter(p.UNIFORM_BUFFER_START.value,e),r=o.getParameter(p.UNIFORM_BUFFER_BINDING.value);try{o.bindBuffer(p.UNIFORM_BUFFER.value,a),o.getBufferSubData(p.UNIFORM_BUFFER.value,n+t,s)}catch(e){return}r&&o.bindBuffer(p.UNIFORM_BUFFER.value,r)}return Array.prototype.slice.call(s)}}Ie.uboTypes={[p.BOOL.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.BOOL_VEC2.value]:{arrayBufferView:Uint8Array,lengthMultiplier:2},[p.BOOL_VEC3.value]:{arrayBufferView:Uint8Array,lengthMultiplier:3},[p.BOOL_VEC4.value]:{arrayBufferView:Uint8Array,lengthMultiplier:4},[p.INT.value]:{arrayBufferView:Int32Array,lengthMultiplier:1},[p.INT_VEC2.value]:{arrayBufferView:Int32Array,lengthMultiplier:2},[p.INT_VEC3.value]:{arrayBufferView:Int32Array,lengthMultiplier:3},[p.INT_VEC4.value]:{arrayBufferView:Int32Array,lengthMultiplier:4},[p.UNSIGNED_INT.value]:{arrayBufferView:Uint32Array,lengthMultiplier:1},[p.UNSIGNED_INT_VEC2.value]:{arrayBufferView:Uint32Array,lengthMultiplier:2},[p.UNSIGNED_INT_VEC3.value]:{arrayBufferView:Uint32Array,lengthMultiplier:3},[p.UNSIGNED_INT_VEC4.value]:{arrayBufferView:Uint32Array,lengthMultiplier:4},[p.FLOAT.value]:{arrayBufferView:Float32Array,lengthMultiplier:1},[p.FLOAT_VEC2.value]:{arrayBufferView:Float32Array,lengthMultiplier:2},[p.FLOAT_VEC3.value]:{arrayBufferView:Float32Array,lengthMultiplier:3},[p.FLOAT_VEC4.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT2x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT3.value]:{arrayBufferView:Float32Array,lengthMultiplier:9},[p.FLOAT_MAT3x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT3x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.FLOAT_MAT4.value]:{arrayBufferView:Float32Array,lengthMultiplier:16},[p.FLOAT_MAT4x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT4x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.SAMPLER_2D.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.SAMPLER_CUBE.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1}};class ke extends S{get typeName(){return"WebGLBuffer"}}class Me extends S{get typeName(){return"WebGLFramebuffer"}}class Pe extends S{get typeName(){return"WebGLProgram"}static saveInGlobalStore(e){const t=D.getWebGlObjectTag(e);t&&(this.store[t.id]=e)}static getFromGlobalStore(e){return this.store[e]}static updateInGlobalStore(e,t){if(!t)return;const n=this.getFromGlobalStore(e);if(!n)return;const r=D.getWebGlObjectTag(n);r&&(D.attachWebGlObjectTag(t,r),this.store[r.id]=t)}}Pe.store={};class Be extends S{get typeName(){return"WebGLQuery"}}class Ue extends S{get typeName(){return"WebGLRenderbuffer"}}class $e extends S{get typeName(){return"WebGLSampler"}}class Ge extends S{get typeName(){return"WebGLShader"}}class Ve extends S{get typeName(){return"WebGLSync"}}class We extends S{get typeName(){return"WebGLTexture"}}class He extends S{get typeName(){return"WebGLTransformFeedback"}}class je extends S{get typeName(){return"WebGLUniformLocation"}}class ze extends S{get typeName(){return"WebGLVertexArrayObject"}}class Xe extends me{get stateName(){return Xe.stateName}get requireStartAndStopStates(){return!1}constructor(e){super(e),this.drawCallTextureInputState=new Oe(e),this.drawCallUboInputState=new Ie(e)}getConsumeCommands(){return d}getChangeCommandsByState(){return{}}readFromContext(){var e,t;const n=this.context.getParameter(p.CURRENT_PROGRAM.value);if(!n)return;this.currentState.frameBuffer=this.readFrameBufferFromContext();const r=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData:x.getProgramData(this.context,n);if(this.currentState.programStatus=Object.assign({},r.programStatus),this.currentState.programStatus.program=this.getSpectorData(n),this.currentState.programStatus.RECOMPILABLE=o.isBuildableProgram(n),this.currentState.programStatus.RECOMPILABLE&&Pe.saveInGlobalStore(n),this.currentState.shaders=r.shaders,(null===(e=this.lastCommandName)||void 0===e?void 0:e.indexOf("Elements"))>=0){const e=this.context.getParameter(this.context.ELEMENT_ARRAY_BUFFER_BINDING);e&&(this.currentState.elementArray={},this.currentState.elementArray.arrayBuffer=this.getSpectorData(e))}const i=this.context.getProgramParameter(n,p.ACTIVE_ATTRIBUTES.value);this.currentState.attributes=[];for(let e=0;e1){const e=this.context.getProgramParameter(n,p.ACTIVE_UNIFORM_BLOCKS.value);this.currentState.uniformBlocks=[];for(let t=0;t1){const e=this.context;t.colorAttachments=[];const n=e.getParameter(p.MAX_DRAW_BUFFERS.value);for(let e=0;e1&&(r.alphaSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE.value),r.blueSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE.value),r.encoding=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.value)),r.componentType=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value)),r.depthSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE.value),r.greenSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE.value),r.redSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_RED_SIZE.value),r.stencilSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value),n===p.TEXTURE.value&&(r.textureLayer=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value))),r}readAttributeFromContext(e,t){const n=this.context.getActiveAttrib(e,t),r=this.context.getAttribLocation(e,n.name);if(-1===r)return{name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:-1};const i=this.context.getVertexAttrib(r,p.CURRENT_VERTEX_ATTRIB.value),s=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING.value),o={name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:r,offsetPointer:this.context.getVertexAttribOffset(r,p.VERTEX_ATTRIB_ARRAY_POINTER.value),bufferBinding:this.getSpectorData(s),enabled:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_ENABLED.value),arraySize:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_SIZE.value),stride:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_STRIDE.value),arrayType:this.getWebGlConstant(this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_TYPE.value)),normalized:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_NORMALIZED.value),vertexAttrib:Array.prototype.slice.call(i)};return this.extensions[p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.extensionName]?o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.value):this.contextVersion>1&&(o.integer=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_INTEGER.value),o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR.value)),this.appendBufferCustomData(o,s),o}readUniformFromContext(e,t){const n=this.context.getActiveUniform(e,t),r=this.context.getUniformLocation(e,n.name);if(r){if(n.size>1&&n.name&&n.name.indexOf("[0]")===n.name.length-3){const t=[];for(let r=0;r1){r.baseLevel=this.context.getTexParameter(t.value,p.TEXTURE_BASE_LEVEL.value),r.immutable=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_FORMAT.value),r.immutableLevels=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_LEVELS.value),r.maxLevel=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LEVEL.value);const e=this.context.getParameter(p.SAMPLER_BINDING.value);if(e){r.sampler=this.getSpectorData(e);const t=this.context;r.samplerMaxLod=t.getSamplerParameter(e,p.TEXTURE_MAX_LOD.value),r.samplerMinLod=t.getSamplerParameter(e,p.TEXTURE_MIN_LOD.value),r.samplerCompareFunc=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_FUNC.value)),r.samplerCompareMode=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_MODE.value)),r.samplerWrapS=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_S.value)),r.samplerWrapT=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_T.value)),r.samplerWrapR=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_R.value)),r.samplerMagFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MAG_FILTER.value)),r.samplerMinFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MIN_FILTER.value))}else r.maxLod=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LOD.value),r.minLod=this.context.getTexParameter(t.value,p.TEXTURE_MIN_LOD.value),r.compareFunc=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_FUNC.value)),r.compareMode=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_MODE.value)),r.wrapR=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_WRAP_R.value))}const i=this.getTextureStorage(t);if(i){const e=this.quickCapture?null:t;this.drawCallTextureInputState.appendTextureState(r,i,e,this.fullCapture)}return this.context.activeTexture(n),r}getTextureStorage(e){return e===p.TEXTURE_2D?this.context.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP?this.context.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):e===p.TEXTURE_3D?this.context.getParameter(p.TEXTURE_BINDING_3D.value):e===p.TEXTURE_2D_ARRAY?this.context.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):void 0}readUniformsFromContextIntoState(e,t,n,r){const i=this.context,s=i.getActiveUniforms(e,t,p.UNIFORM_TYPE.value),o=i.getActiveUniforms(e,t,p.UNIFORM_SIZE.value),a=i.getActiveUniforms(e,t,p.UNIFORM_BLOCK_INDEX.value),l=i.getActiveUniforms(e,t,p.UNIFORM_OFFSET.value),u=i.getActiveUniforms(e,t,p.UNIFORM_ARRAY_STRIDE.value),c=i.getActiveUniforms(e,t,p.UNIFORM_MATRIX_STRIDE.value),h=i.getActiveUniforms(e,t,p.UNIFORM_IS_ROW_MAJOR.value);for(let d=0;d-1&&(t.blockName=i.getActiveUniformBlockName(e,t.blockIndice)),t.offset=l[d],t.arrayStride=u[d],t.matrixStride=c[d],t.rowMajor=h[d],t.blockIndice>-1){const e=r[a[d]].bindingPoint;t.value=this.drawCallUboInputState.getUboValue(e,t.offset,t.size,s[d])}}}readTransformFeedbackFromContext(e,t){const n=this.context,r=n.getTransformFeedbackVarying(e,t),i=n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value,t),s={name:r.name,size:r.size,type:this.getWebGlConstant(r.type),buffer:this.getSpectorData(i),bufferSize:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_SIZE.value,t),bufferStart:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_START.value,t)};return this.appendBufferCustomData(s,i),s}readUniformBlockFromContext(e,t){const n=this.context,r=n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_BINDING.value),i=n.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,r),s={name:n.getActiveUniformBlockName(e,t),bindingPoint:r,size:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_DATA_SIZE.value),activeUniformCount:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_ACTIVE_UNIFORMS.value),vertex:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER.value),fragment:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER.value),buffer:this.getSpectorData(i)};return this.appendBufferCustomData(s,i),s}appendBufferCustomData(e,t){if(t){const n=t.__SPECTOR_Object_CustomData;n&&(n.usage&&(e.bufferUsage=this.getWebGlConstant(n.usage)),e.bufferLength=n.length,n.offset&&(e.bufferOffset=n.offset),n.sourceLength&&(e.bufferSourceLength=n.sourceLength))}}getWebGlConstant(e){const t=g[e];return t?t.name:e}}Xe.stateName="DrawCall",Xe.samplerTypes={[p.SAMPLER_2D.value]:p.TEXTURE_2D,[p.SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.SAMPLER_3D.value]:p.TEXTURE_3D,[p.SAMPLER_2D_SHADOW.value]:p.TEXTURE_2D,[p.SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_2D_ARRAY_SHADOW.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_CUBE_SHADOW.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.UNSIGNED_INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.UNSIGNED_INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.UNSIGNED_INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.UNSIGNED_INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY};class Ke{constructor(e){this.contextInformation=e,this.stateTrackers=[],this.onCommandCapturedCallbacks={},this.initStateTrackers()}startCapture(e,t,n){for(const r of this.stateTrackers){const i=r.startCapture(!0,t,n);r.requireStartAndStopStates&&(e.initState[r.stateName]=i)}}stopCapture(e){for(const t of this.stateTrackers){const n=t.stopCapture();t.requireStartAndStopStates&&(e.endState[t.stateName]=n)}}captureState(e){const t=this.onCommandCapturedCallbacks[e.name];if(t)for(const n of t)n(e)}initStateTrackers(){this.stateTrackers.push(new Ee(this.contextInformation),new ve(this.contextInformation),new Ce(this.contextInformation),new De(this.contextInformation),new Se(this.contextInformation),new Ae(this.contextInformation),new _e(this.contextInformation),new ye(this.contextInformation),new be(this.contextInformation),new Te(this.contextInformation),new Re(this.contextInformation),new xe(this.contextInformation),new Le(this.contextInformation),new Xe(this.contextInformation));for(const e of this.stateTrackers)e.registerCallbacks(this.onCommandCapturedCallbacks)}}class Ye{static initializeByteSizeFormat(){this.byteSizePerInternalFormat||(this.byteSizePerInternalFormat={[p.R8.value]:1,[p.R16F.value]:2,[p.R32F.value]:4,[p.R8UI.value]:1,[p.RG8.value]:2,[p.RG16F.value]:4,[p.RG32F.value]:8,[p.ALPHA.value]:1,[p.RGB.value]:3,[p.RGBA.value]:4,[p.LUMINANCE.value]:1,[p.LUMINANCE_ALPHA.value]:2,[p.DEPTH_COMPONENT.value]:1,[p.DEPTH_STENCIL.value]:2,[p.SRGB_EXT.value]:3,[p.SRGB_ALPHA_EXT.value]:4,[p.RGB8.value]:3,[p.SRGB8.value]:3,[p.RGB565.value]:2,[p.R11F_G11F_B10F.value]:4,[p.RGB9_E5.value]:2,[p.RGB16F.value]:6,[p.RGB32F.value]:12,[p.RGB8UI.value]:3,[p.RGBA8.value]:4,[p.RGB5_A1.value]:2,[p.RGBA16F.value]:8,[p.RGBA32F.value]:16,[p.RGBA8UI.value]:4,[p.COMPRESSED_R11_EAC.value]:4,[p.COMPRESSED_SIGNED_R11_EAC.value]:4,[p.COMPRESSED_RG11_EAC.value]:4,[p.COMPRESSED_SIGNED_RG11_EAC.value]:4,[p.COMPRESSED_RGB8_ETC2.value]:4,[p.COMPRESSED_RGBA8_ETC2_EAC.value]:4,[p.COMPRESSED_SRGB8_ETC2.value]:4,[p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC.value]:4,[p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_RGB_S3TC_DXT1_EXT.value]:.5,[p.COMPRESSED_RGBA_S3TC_DXT3_EXT.value]:1,[p.COMPRESSED_RGBA_S3TC_DXT5_EXT.value]:1,[p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGB_ETC1_WEBGL.value]:.5,[p.COMPRESSED_RGB_ATC_WEBGL.value]:.5,[p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL.value]:1,[p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL.value]:1})}constructor(e){this.options=e,this.createCommandNames=this.getCreateCommandNames(),this.updateCommandNames=this.getUpdateCommandNames(),this.deleteCommandNames=this.getDeleteCommandNames(),this.startTime=u.now,this.memoryPerSecond={},this.totalMemory=0,this.frameMemory=0,this.capturing=!1,Ye.initializeByteSizeFormat()}registerCallbacks(e){for(const t of this.createCommandNames)e[t]=e[t]||[],e[t].push(this.createWithoutSideEffects.bind(this));for(const t of this.updateCommandNames)e[t]=e[t]||[],e[t].push(this.updateWithoutSideEffects.bind(this));for(const t of this.deleteCommandNames)e[t]=e[t]||[],e[t].push(this.deleteWithoutSideEffects.bind(this))}startCapture(){this.frameMemory=0,this.capturing=!0}stopCapture(){this.frameMemory=0,this.capturing=!1}appendRecordedInformation(e){e.frameMemory[this.objectName]=this.frameMemory,e.memory[this.objectName]=this.memoryPerSecond}create(e){}createWithoutSideEffects(e){this.options.toggleCapture(!1);try{this.create(e)}finally{this.options.toggleCapture(!0)}}updateWithoutSideEffects(e){if(e&&0!==e.arguments.length){this.options.toggleCapture(!1);try{const t=e.arguments[0],n=this.getBoundInstance(t);if(!n)return;if(!D.getWebGlObjectTag(n))return;const r=this.getWebGlConstant(t),i=this.update(e,r,n);this.changeMemorySize(i)}finally{this.options.toggleCapture(!0)}}}deleteWithoutSideEffects(e){if(!e||!e.arguments||e.arguments.length<1)return;const t=e.arguments[0];if(t){this.options.toggleCapture(!1);try{const e=this.delete(t);this.changeMemorySize(-e)}finally{this.options.toggleCapture(!0)}}}changeMemorySize(e){this.totalMemory+=e,this.capturing&&(this.frameMemory+=e);const t=u.now-this.startTime,n=Math.round(t/1e3);this.memoryPerSecond[n]=this.totalMemory}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}getByteSizeForInternalFormat(e){return Ye.byteSizePerInternalFormat[e]||4}readPixelStoreState(){const e=this.options.context,t={UNPACK_FLIP_Y_WEBGL:e.getParameter(p.UNPACK_FLIP_Y_WEBGL.value),UNPACK_PREMULTIPLY_ALPHA_WEBGL:e.getParameter(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL.value),UNPACK_COLORSPACE_CONVERSION_WEBGL:e.getParameter(p.UNPACK_COLORSPACE_CONVERSION_WEBGL.value),UNPACK_ALIGNMENT:e.getParameter(p.UNPACK_ALIGNMENT.value)};return e instanceof WebGL2RenderingContext&&(t.UNPACK_ROW_LENGTH=e.getParameter(p.UNPACK_ROW_LENGTH.value),t.UNPACK_IMAGE_HEIGHT=e.getParameter(p.UNPACK_IMAGE_HEIGHT.value),t.UNPACK_SKIP_PIXELS=e.getParameter(p.UNPACK_SKIP_PIXELS.value),t.UNPACK_SKIP_ROWS=e.getParameter(p.UNPACK_SKIP_ROWS.value),t.UNPACK_SKIP_IMAGES=e.getParameter(p.UNPACK_SKIP_IMAGES.value)),t}}class qe extends Ye{get objectName(){return"Buffer"}getCreateCommandNames(){return["createBuffer"]}getUpdateCommandNames(){return["bufferData"]}getDeleteCommandNames(){return["deleteBuffer"]}getBoundInstance(e){const t=this.options.context;return e===p.ARRAY_BUFFER.value?t.getParameter(p.ARRAY_BUFFER_BINDING.value):e===p.ELEMENT_ARRAY_BUFFER.value?t.getParameter(p.ELEMENT_ARRAY_BUFFER_BINDING.value):e===p.COPY_READ_BUFFER.value?t.getParameter(p.COPY_READ_BUFFER_BINDING.value):e===p.COPY_WRITE_BUFFER.value?t.getParameter(p.COPY_WRITE_BUFFER_BINDING.value):e===p.TRANSFORM_FEEDBACK_BUFFER.value?t.getParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value):e===p.UNIFORM_BUFFER.value?t.getParameter(p.UNIFORM_BUFFER_BINDING.value):e===p.PIXEL_PACK_BUFFER.value?t.getParameter(p.PIXEL_PACK_BUFFER_BINDING.value):e===p.PIXEL_UNPACK_BUFFER.value?t.getParameter(p.PIXEL_UNPACK_BUFFER_BINDING.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(t,e);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){const n=this.getLength(t);return t.arguments.length>=4?{target:e,length:n,usage:t.arguments[2],offset:t.arguments[3],sourceLength:t.arguments[1]?t.arguments[1].length:-1}:3===t.arguments.length?{target:e,length:n,usage:t.arguments[2]}:void 0}getLength(e){const t=e.arguments[1],n=e.arguments[3],r=e.arguments[4];if("number"==typeof t)return t;if("number"==typeof r&&r>0)return r;const i=t.byteLength||t.length||0;return"number"==typeof n&&n>0?i-n:i}}class Qe extends Ye{get objectName(){return"Renderbuffer"}getCreateCommandNames(){return["createRenderbuffer"]}getUpdateCommandNames(){return["renderbufferStorage","renderbufferStorageMultisample"]}getDeleteCommandNames(){return["deleteRenderbuffer"]}getBoundInstance(e){const t=this.options.context;if(e===p.RENDERBUFFER.value)return t.getParameter(p.RENDERBUFFER_BINDING.value)}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(e,t);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return r.length=r.width*r.height*this.getByteSizeForInternalFormat(r.internalFormat),n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){return 4===e.arguments.length?{target:t,internalFormat:e.arguments[1],width:e.arguments[2],height:e.arguments[3],length:0,samples:0}:{target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,samples:e.arguments[1]}}}class Ze extends Ye{get objectName(){return"Texture2d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage2D","compressedTexImage2D","texStorage2D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D.value?t.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP_POSITIVE_X.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Y.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Z.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_X.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Y.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Z.value?t.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target===p.TEXTURE_2D_ARRAY.name||t.target===p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else{const e="TEXTURE_2D"===t?1:6;let n=r.internalFormat;n===p.RGBA.value&&(r.type===p.FLOAT.value&&(n=p.RGBA32F.value),r.type===p.HALF_FLOAT_OES.value&&(n=p.RGBA16F.value)),r.length=r.width*r.height*e*this.getByteSizeForInternalFormat(n)}return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage2D"===e.name?this.getTexImage2DCustomData(e,t,n):"compressedTexImage2D"===e.name?this.getCompressedTexImage2DCustomData(e,t,n):"texStorage2D"===e.name?this.getTexStorage2DCustomData(e,t,n):void 0}getTexStorage2DCustomData(e,t,n){let r;return 5===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!1}),r}getCompressedTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=7&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!0}),r}getTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8?r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],format:e.arguments[6],type:e.arguments[7],length:0,isCompressed:!1}:6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[5].width,height:e.arguments[5].height,format:e.arguments[3],type:e.arguments[4],length:0,isCompressed:!1}),r}}class Je extends Ye{get objectName(){return"Texture3d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage3D","compressedTexImage3D","texStorage3D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D_ARRAY.value?t.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):e===p.TEXTURE_3D.value?t.getParameter(p.TEXTURE_BINDING_3D.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target!==p.TEXTURE_2D_ARRAY.name&&t.target!==p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){if(e.arguments.length>=2&&0!==e.arguments[1])return 0;const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else r.length=r.width*r.height*r.depth*this.getByteSizeForInternalFormat(r.internalFormat);return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage3D"===e.name?this.getTexImage3DCustomData(e,t,n):"compressedTexImage3D"===e.name?this.getCompressedTexImage3DCustomData(e,t,n):"texStorage3D"===e.name?this.getTexStorage3DCustomData(e,t,n):void 0}getTexStorage3DCustomData(e,t,n){let r;return 6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!1}),r}getCompressedTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!0}),r}getTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=9&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],format:e.arguments[7],type:e.arguments[8],length:0,isCompressed:!1}),r}}class et extends Ye{get objectName(){return"Program"}getCreateCommandNames(){return["createProgram"]}getUpdateCommandNames(){return["linkProgram"]}getDeleteCommandNames(){return["deleteProgram"]}getBoundInstance(e){return e}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){if(e.arguments.length>=1&&!e.arguments[0])return 0;const r=this.getCustomData(n);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e){const t=this.options.context;return x.getProgramData(t,e)}}class tt{constructor(e){this.contextInformation=e,this.onCommandCallbacks={},this.recorders=[],this.initRecorders()}recordCommand(e){const t=this.onCommandCallbacks[e.name];if(t)for(const n of t)n(e)}startCapture(){for(const e of this.recorders)e.startCapture()}stopCapture(){for(const e of this.recorders)e.stopCapture()}appendRecordedInformation(e){for(const t of this.recorders)t.appendRecordedInformation(e)}initRecorders(){this.recorders.push(new qe(this.contextInformation),new Qe(this.contextInformation),new Ze(this.contextInformation),new Je(this.contextInformation),new et(this.contextInformation));for(const e of this.recorders)e.registerCallbacks(this.onCommandCallbacks)}}class nt{constructor(e){this.contextInformation=e,this.webGlObjects=[],this.initWebglObjects()}tagWebGlObjects(e){for(const t of this.webGlObjects){for(let n=0;n0&&this.currentCapture.commands.length===this.maxCommands&&this.onMaxCommand.trigger(this)}}}spyContext(e){const t=[];for(const n in e)n&&t.push(n);for(let n=0;n{this.spyRequestAnimationFrame("requestAnimationFrame",e.display)})}spyRequestAnimationFrame(e,t){const n=this;y.storeOriginFunction(t,e),t[e]=function(){const r=arguments[0],i=n.getCallback(n,r,()=>{n.spiedScope[e](r)});return y.executeOriginFunction(t,e,[i])}}spySetTimer(e){const t=this,n=this.spiedScope,r="setTimeout"===e;y.storeOriginFunction(n,e),n[e]=function(){const i=arguments[0],s=arguments[1],o=Array.prototype.slice.call(arguments);return at.setTimerCommonValues.indexOf(s)>-1&&(o[0]=t.getCallback(t,i,r?()=>{n[e](i)}:null)),y.executeOriginFunction(n,e,o)}}getCallback(e,t,n=null){return function(){const r=u.now;if(e.lastFrame=++e.lastFrame%e.speedRatio,e.willPlayNextFrame||e.speedRatio&&!e.lastFrame){try{e.onFrameStart.trigger(e)}catch(t){e.onError.trigger(t)}try{t.apply(e.spiedScope,arguments)}catch(t){e.onError.trigger(t)}e.lastSixtyFramesCurrentIndex=(e.lastSixtyFramesCurrentIndex+1)%at.fpsWindowSize,e.lastSixtyFramesDuration[e.lastSixtyFramesCurrentIndex]=r-e.lastSixtyFramesPreviousStart;try{e.onFrameEnd.trigger(e)}catch(t){e.onError.trigger(t)}e.willPlayNextFrame=!1}else n&&n();e.lastSixtyFramesPreviousStart=r}}}at.requestAnimationFrameFunctions=["requestAnimationFrame","msRequestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame"],at.setTimerFunctions=["setTimeout","setInterval"],at.setTimerCommonValues=[0,15,16,33,32,40],at.fpsWindowSize=60;class lt{constructor(e){this.canvas=e,this.onContextRequested=new l,this.init()}init(){const e=this,t=function(){const t="undefined"!=typeof HTMLCanvasElement&&this instanceof HTMLCanvasElement?HTMLCanvasElement:OffscreenCanvas,n=e.canvas?y.executeOriginFunction(this,"getContext",arguments):y.executePrototypeOriginFunction(this,t,"getContext",arguments);if(arguments.length>0){const e=arguments[0];if("webgl"!==e&&"experimental-webgl"!==e&&"webgl2"!==e&&"experimental-webgl2"!==e)return n}if(n){const t=Array.prototype.slice.call(arguments),r="webgl2"===t[0]||"experimental-webgl2"===t[0]?2:1;e.onContextRequested.trigger({context:n,contextVersion:r})}return n};this.canvas?(y.storeOriginFunction(this.canvas,"getContext"),this.canvas.getContext=t):("undefined"!=typeof HTMLCanvasElement&&(y.storePrototypeOriginFunction(HTMLCanvasElement,"getContext"),HTMLCanvasElement.prototype.getContext=t),"undefined"!=typeof OffscreenCanvas&&(y.storePrototypeOriginFunction(OffscreenCanvas,"getContext"),OffscreenCanvas.prototype.getContext=t))}}class ut{static startIntercepting(e){if(ut.intercepting)return;if("undefined"==typeof Worker)return;ut.workerBundleUrl=e,ut.originalWorkerConstructor=Worker,ut.intercepting=!0;const t=Worker;globalThis.Worker=function(e,n){const r=e.toString();if(n&&"module"===n.type)return new t(e,n);try{let i;try{i=new URL(r,location.href).href}catch(r){return new t(e,n)}const s=new XMLHttpRequest;if(s.open("GET",i,!1),s.send(),200===s.status){const e=ut.rewriteImportScripts(s.responseText,i),o="(function(){\n var __spectorBase = "+JSON.stringify(i)+';\n self.__SPECTOR_workerBaseUrl = __spectorBase;\n function __spectorResolve(u) {\n if (u == null) return u;\n if (typeof u !== "string") {\n if (u instanceof URL) return u;\n try { u = String(u); } catch (e) { return u; }\n }\n if (/^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i.test(u)) return u;\n try { return new URL(u, __spectorBase).href; }\n catch (e) { return u; }\n }\n self.__SPECTOR_resolveWorkerUrl = __spectorResolve;\n var __origImportScripts = self.importScripts;\n if (typeof __origImportScripts === "function") {\n self.importScripts = function() {\n var args = new Array(arguments.length);\n for (var i = 0; i < arguments.length; i++) args[i] = __spectorResolve(arguments[i]);\n return __origImportScripts.apply(self, args);\n };\n }\n var __origFetch = self.fetch;\n if (typeof __origFetch === "function") {\n self.fetch = function(input, init) {\n try {\n if (typeof input === "string") {\n input = __spectorResolve(input);\n } else if (input && typeof input === "object" && "url" in input && typeof Request === "function") {\n var r = input;\n var resolved = __spectorResolve(r.url);\n if (resolved !== r.url) input = new Request(resolved, r);\n }\n } catch (e) { /* fall through with original input */ }\n return __origFetch.call(self, input, init);\n };\n }\n if (typeof XMLHttpRequest === "function" && XMLHttpRequest.prototype && XMLHttpRequest.prototype.open) {\n var __origXhrOpen = XMLHttpRequest.prototype.open;\n XMLHttpRequest.prototype.open = function(method, url) {\n var args = Array.prototype.slice.call(arguments);\n args[1] = __spectorResolve(url);\n return __origXhrOpen.apply(this, args);\n };\n }\n if (typeof Worker === "function") {\n var __OrigWorker = Worker;\n self.Worker = function(scriptURL, options) {\n var resolved = __spectorResolve(scriptURL);\n return new __OrigWorker(resolved, options);\n };\n self.Worker.prototype = __OrigWorker.prototype;\n }\n})();\n',a="importScripts("+JSON.stringify(ut.workerBundleUrl)+");\n",l=new Blob([o+a+e],{type:"application/javascript"}),u=URL.createObjectURL(l),c=new t(u,n);return ut.spiedWorkers.push({worker:c,originalUrl:r}),c}}catch(e){console.warn("[Spector.js] Could not inject into Worker ("+r+"):",e)}const i=new t(e,n);return ut.spiedWorkers.push({worker:i,originalUrl:r}),i},globalThis.Worker.prototype=t.prototype}static stopIntercepting(){ut.intercepting&&(globalThis.Worker=ut.originalWorkerConstructor,ut.intercepting=!1)}static rewriteImportScripts(e,t){const n=/(['"`])((?:\\.|(?!\1).)*)\1/g;return e.replace(/importScripts\s*\(([^)]*)\)/g,(e,r)=>"importScripts("+r.replace(n,(e,n,r)=>{if("`"===n&&-1!==r.indexOf("${"))return e;let i;try{i=new URL(r,t).href}catch(t){return e}return n+i+n})+")")}static getSpiedWorkers(){return ut.spiedWorkers}static isIntercepting(){return ut.intercepting}}ut.spiedWorkers=[],ut.intercepting=!1;class ct{static getDelay(){return ct.delayMs}static setDelay(e){ct.delayMs="number"==typeof e&&e>0?e:0}static shouldForceIncomplete(e,t,n,r){return!(r<=0)&&e===p.COMPLETION_STATUS_KHR.value&&void 0!==t&&n-tthis._state,this.subscribe=e=>(this._listeners.add(e),()=>{this._listeners.delete(e)}),this._state=e}setState(e){this._state=e(this._state),this._emitChange()}setSnapshot(e){this._state=e,this._emitChange()}_emitChange(){for(const e of this._listeners)e()}}function pt(e){return(0,dt.useSyncExternalStore)(e.subscribe,e.getSnapshot)}var mt=n(848);const gt=(0,dt.createContext)(null);function Et(){const e=(0,dt.useContext)(gt);if(!e)throw new Error("CaptureMenuContext not provided — CaptureMenuRoot must be rendered inside CaptureMenuContext.Provider");return e}function vt({canvas:e}){const t=Et();return(0,mt.jsx)("li",{onClick:()=>t.handleCanvasSelected(e),children:(0,mt.jsx)("span",{children:`Id: ${e.id} - Size: ${e.width}*${e.height}`})})}function Ct(){const e=Et(),t=pt(e.store),n=t.selectedCanvas?`${t.selectedCanvas.id} (${t.selectedCanvas.width}*${t.selectedCanvas.height})`:"Choose Canvas...";return(0,mt.jsxs)("div",{className:"canvasListComponent",children:[(0,mt.jsx)("span",{commandName:"onCanvasSelection",onClick:e.handleCanvasListToggle,children:n}),(0,mt.jsx)("ul",{style:{display:t.showCanvasList?"block":"none",visibility:t.showCanvasList?"visible":"hidden"},children:t.canvases.map((e,t)=>(0,mt.jsx)(vt,{canvas:e},e.id||t))})]})}function Dt(){const e=Et(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"captureMenuActionsComponent",children:[(0,mt.jsx)("div",{commandName:"onCaptureRequested",onClick:e.handleCaptureRequested}),t.isPlaying?(0,mt.jsx)("div",{commandName:"onPauseRequested",onClick:e.handlePauseRequested}):(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("div",{commandName:"onPlayRequested",onClick:e.handlePlayRequested}),(0,mt.jsx)("div",{commandName:"onPlayNextFrameRequested",onClick:e.handlePlayNextFrameRequested})]})]})}function St(){const e=pt(Et().store);return(0,mt.jsxs)("span",{className:"fpsCounterComponent",children:[e.fps.toFixed(2)," Fps"]})}function At(){const e=pt(Et().store);return(0,mt.jsxs)("div",{children:[(0,mt.jsxs)("div",{className:"captureMenuComponent "+(e.visible?"active":""),children:[(0,mt.jsx)(Ct,{}),(0,mt.jsx)(Dt,{}),(0,mt.jsx)(St,{})]}),(0,mt.jsx)("div",{className:"captureMenuLogComponent "+(e.logVisible?"active":""),children:(0,mt.jsx)("span",{className:e.logLevel===i.error?"error":"",children:e.logText})})]})}class _t{constructor(e={}){this.options=e,this.handleCanvasListToggle=()=>{this.store.getSnapshot(),this.store.setState(e=>Object.assign(Object.assign({},e),{selectedCanvas:null,showCanvasList:!e.showCanvasList,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!e.showCanvasList&&!this._hideLog})),this.onCanvasSelected.trigger(null),this._isTrackingCanvas&&this.trackPageCanvases()},this.handleCanvasSelected=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{selectedCanvas:e,showCanvasList:!1,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)},this.handleCaptureRequested=()=>{const e=this.getSelectedCanvasInformation();e&&this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.PleaseWaitHelpText,logVisible:!this._hideLog})),setTimeout(()=>{this.onCaptureRequested.trigger(e)},200)},this.handlePauseRequested=()=>{this.onPauseRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!1}))},this.handlePlayRequested=()=>{this.onPlayRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!0}))},this.handlePlayNextFrameRequested=()=>{this.onPlayNextFrameRequested.trigger(this.getSelectedCanvasInformation())},this._rootPlaceHolder=e.rootPlaceHolder||document.body,this._hideLog=!!e.hideLog,this._isTrackingCanvas=!1,this._extraCanvasEntries=[],this.onCanvasSelected=new l,this.onCaptureRequested=new l,this.onPauseRequested=new l,this.onPlayRequested=new l,this.onPlayNextFrameRequested=new l,this.store=new ft({visible:!0,logText:_t.SelectCanvasHelpText,logLevel:i.info,logVisible:!this._hideLog,canvases:[],selectedCanvas:null,showCanvasList:!1,isPlaying:!0,fps:0}),this._container=document.createElement("div"),this._container.className="spector-react-capture-menu",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(gt.Provider,{value:this},(0,dt.createElement)(At)))}getSelectedCanvasInformation(){return this.store.getSnapshot().selectedCanvas}trackPageCanvases(){if(this._isTrackingCanvas=!0,document.body){const e=document.body.querySelectorAll("canvas");this.updateCanvasesList(e)}}updateCanvasesList(e){const t=[];for(let n=0;nObject.assign(Object.assign({},n),{canvases:t,selectedCanvas:e,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}captureComplete(e){e?this.store.setState(t=>Object.assign(Object.assign({},t),{logLevel:i.error,logText:e,logVisible:!this._hideLog})):this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog}))}setFPS(e){this.store.setState(t=>Object.assign(Object.assign({},t),{fps:e}))}_updateCanvasesInternal(e){for(const t of this._extraCanvasEntries)e.push(t);this.store.getSnapshot().showCanvasList?this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e})):1===e.length?(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:e[0],logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e[0])):(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:null,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(null))}}_t.SelectCanvasHelpText="Please, select a canvas in the list above.",_t.ActionsHelpText="Record with the red button, you can also pause or continue playing the current scene.",_t.PleaseWaitHelpText="Capturing, be patient (this can take up to 3 minutes)...";const yt=(0,dt.createContext)(null);function bt(){const e=(0,dt.useContext)(yt);if(!e)throw new Error("ResultViewContext not provided — ResultViewRoot must be rendered inside ResultViewContext.Provider");return e}function Tt(){const e=bt(),t=pt(e.store),n=(0,dt.useRef)(null),r=(0,dt.useCallback)(e=>{e.preventDefault();const t=e.currentTarget.parentElement,n=t.parentElement;if(!n)return;const r=n.querySelectorAll("li:not(.resultViewMenuSmall)");if("true"===t.getAttribute("open")){t.setAttribute("open","false");for(let e=0;e{e.handleSearchTextChange(t.target.value)},[e]),s=(0,dt.useCallback)(t=>{t.stopPropagation(),e.handleSearchTextChange("")},[e]),o=(0,dt.useCallback)(t=>n=>{n.preventDefault(),e.handleMenuStatusChange(t)},[e]),a=(0,dt.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),e.handleClose()},[e]);return(0,mt.jsxs)("ul",{className:"resultViewMenuComponent",ref:n,children:[(0,mt.jsx)("li",{className:"resultViewMenuOpen resultViewMenuSmall",children:(0,mt.jsx)("a",{href:"#",role:"button",onClick:r,children:"Menu"})}),(0,mt.jsxs)("li",{className:"searchContainer",children:[(0,mt.jsx)("input",{type:"text",placeholder:"Search...",value:t.searchText,commandName:"onSearchTextChanged",commandEventBinding:"change",onChange:i}),(0,mt.jsx)("a",{className:"clearSearch",commandName:"onSearchTextCleared",onClick:s,children:"X"})]}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:0===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCapturesClicked",onClick:o(0),children:"Captures"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:10===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInformationClicked",onClick:o(10),children:"Information"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:20===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInitStateClicked",onClick:o(20),children:"Init State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:40===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCommandsClicked",onClick:o(40),children:"Commands"+(t.commandCount>0?" ("+t.commandCount+")":"")})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:60===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCompareClicked",onClick:o(60),children:"Compare"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:30===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onEndStateClicked",onClick:o(30),children:"End State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{role:"button",commandName:"onCloseClicked",onClick:a,children:"Close"})})]})}function Rt({children:e}){return(0,mt.jsx)("div",{className:"resultViewContentComponent",children:e})}function xt({capture:e,active:t,onCaptureSelected:n,onSaveRequested:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),r()},[r]),s=(0,dt.useCallback)(()=>{n()},[n]),o=new Date(e.startTime).toTimeString().split(" ")[0];return(0,mt.jsxs)("li",{className:t?"active":"",onClick:s,children:[e.endState.VisualState.Attachments?e.endState.VisualState.Attachments.map((e,t)=>(0,mt.jsx)("img",{src:encodeURI(e.src)},t)):(0,mt.jsx)("span",{children:e.endState.VisualState.FrameBufferStatus}),(0,mt.jsxs)("span",{children:[o,(0,mt.jsx)("a",{href:"#",className:"captureListItemSave",commandName:"onSaveRequested",onClick:i})]})]})}function wt({active:e,captures:t,onCaptureSelected:n,onSaveRequested:r,onCaptureLoaded:i}){const s=(0,dt.useRef)(null),o=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault()},[]),l=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),function(e,t){let n=null;if(e&&e.dataTransfer&&e.dataTransfer.files&&(n=e.dataTransfer.files),e&&e.target&&e.target.files&&(n=e.target.files),n&&n.length>0)for(let e=0;e{a.error("Error while reading file: "+r.name+e)},i.onload=e=>{try{const n=JSON.parse(e.target.result);t(n)}catch(e){a.error("Error while reading file: "+r.name+e)}},i.readAsText(r)}}(e.nativeEvent,i)},[i]);return(0,mt.jsxs)("div",{className:"captureListComponent "+(e?"active":""),children:[(0,mt.jsx)("div",{className:"openCaptureFile",ref:s,onDragEnter:o,onDragOver:o,onDrop:l,children:(0,mt.jsx)("span",{children:"Drag files here to open a previously saved capture."})}),(0,mt.jsx)("ul",{children:t.map((e,t)=>(0,mt.jsx)(xt,{capture:e.capture,active:e.active,onCaptureSelected:()=>n(t),onSaveRequested:()=>r(e.capture)},t))})]})}function Ft({children:e}){return(0,mt.jsx)("div",{className:"visualStateListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Nt({item:e,onVisualStateSelected:t}){const n=(0,dt.useRef)(null);(0,dt.useEffect)(()=>{e.active&&n.current&&setTimeout(()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const r=(0,dt.useCallback)(()=>{t()},[t]),i=e.VisualState;return(0,mt.jsxs)("li",{ref:n,className:e.active?"active":"",onClick:r,commandName:"onVisualStateSelected",children:[i.Attachments?i.Attachments.map((e,t)=>e.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{src:encodeURI(e.src)}),i.Attachments.length>1&&(0,mt.jsx)("span",{children:e.attachmentName}),!!e.textureLayer&&(0,mt.jsx)("span",{children:"Layer: "+e.textureLayer}),!!e.textureCubeMapFace&&(0,mt.jsx)("span",{children:e.textureCubeMapFace})]},t):null):(0,mt.jsx)("span",{children:i.FrameBufferStatus}),(0,mt.jsx)("span",{children:i.FrameBuffer?"Frame buffer: "+i.FrameBuffer.__SPECTOR_Object_TAG.id:"Canvas frame buffer"})]})}function Lt({children:e}){return(0,mt.jsx)("div",{className:"commandListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Ot({command:e,onCommandSelected:t,onVertexSelected:n,onFragmentSelected:r,onShaderSelected:i}){var s;const o=(0,dt.useRef)(null),a=e.capture,l=function(e){switch(e){case 50:return"deprecated";case 10:return"unused";case 20:return"disabled";case 30:return"redundant";case 40:return"valid";default:return"unknown"}}(a.status),u=!!a.VisualState;let c="";u&&(c=" drawCall"),e.active&&(c=" active"),(0,dt.useEffect)(()=>{e.active&&o.current&&setTimeout(()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const h=(0,dt.useCallback)(e=>{t()},[t]),d=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==n||n()},[n]),f=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==r||r()},[r]),p=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==i||i()},[i]);let m=null;if(u&&"clear"!==a.name)try{const e=a.DrawCall.shaders[0],t=a.DrawCall.shaders[1];m=(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("a",{href:"#",onClick:d,children:e.name}),(0,mt.jsx)("a",{href:"#",onClick:f,children:t.name})]})}catch(e){}const g=(null===(s=a.shader)||void 0===s?void 0:s.source)?(0,mt.jsx)("a",{href:"#",commandName:"onShaderSourceSelected",onClick:p,children:"Source"}):null;return(0,mt.jsxs)("li",{ref:o,className:c,onClick:h,commandName:"onCommandSelected",children:[a.marker&&(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.marker+" "}),"LOG"===a.name?(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.text+" "}):(0,mt.jsx)("span",{dangerouslySetInnerHTML:{__html:a.text.replace(a.name,`${a.name}`)}}),g,m]})}function It({children:e}){return(0,mt.jsx)("div",{className:"commandDetailComponent",children:e})}function kt({left:e,children:t}){return(0,mt.jsx)("div",{className:e?"informationColumnLeftComponent":"informationColumnRightComponent",children:t})}function Mt({children:e}){return(0,mt.jsx)("div",{className:"jsonContentComponent",children:e})}function Pt(e,t,n,r){return{row:Math.max(0,parseInt(t,10)-1),column:n?Math.max(0,parseInt(n,10)-1):0,text:r.trim()||e,type:e.toLowerCase()}}var Bt,Ut,$t=Object.create,Gt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor,Wt=Object.getOwnPropertyNames,Ht=Object.getPrototypeOf,jt=Object.prototype.hasOwnProperty,zt=e=>{throw TypeError(e)},Xt=(e,t)=>{for(var n in t)Gt(e,n,{get:t[n],enumerable:!0})},Kt=(e,t,n)=>(((e,t)=>{t.has(e)||zt("Cannot access private method")})(e,t),n),Yt=(Bt=e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=/\r\n|[\n\r\u2028\u2029]/;e.codeFrameColumns=function(e,n,r={}){let i=new Proxy({},{get:()=>e=>e}),s=e.split(t),{start:o,end:a,markerLines:l}=function(e,t,n){let r=Object.assign({column:0,line:-1},e.start),i=Object.assign({},r,e.end),{linesAbove:s=2,linesBelow:o=3}=n||{},a=r.line,l=r.column,u=i.line,c=i.column,h=Math.max(a-(s+1),0),d=Math.min(t.length,u+o);-1===a&&(h=0),-1===u&&(d=t.length);let f=u-a,p={};if(f)for(let e=0;e<=f;e++){let n=e+a;if(l)if(0===e){let e=t[n-1].length;p[n]=[l,e-l+1]}else if(e===f)p[n]=[0,c];else{let r=t[n-e].length;p[n]=[0,r]}else p[n]=!0}else p[a]=l===c?!l||[l,0]:[l,c-l];return{start:h,end:d,markerLines:p}}(n,s,r),u=n.start&&"number"==typeof n.start.column,c=String(a).length,h=e.split(t,a).slice(o,a).map((e,t)=>{let n=o+1+t,s=` ${` ${n}`.slice(-c)} |`,a=l[n],u=!l[n+1];if(a){let t="";if(Array.isArray(a)){let n=e.slice(0,Math.max(a[0]-1,0)).replace(/[^\t]/g," "),o=a[1]||1;t=["\n ",i.gutter(s.replace(/\d/g," "))," ",n,i.marker("^").repeat(o)].join(""),u&&r.message&&(t+=" "+i.message(r.message))}return[i.marker(">"),i.gutter(s),e.length>0?` ${e}`:"",t].join("")}return` ${i.gutter(s)}${e.length>0?` ${e}`:""}`}).join("\n");return r.message&&!u&&(h=`${" ".repeat(c+1)}${r.message}\n${h}`),h}},()=>(Ut||Bt((Ut={exports:{}}).exports),Ut.exports));Xt({},{__debug:()=>Hs,check:()=>Vs,doc:()=>vs,format:()=>Gs,formatWithCursor:()=>$s,getSupportInfo:()=>Ws,util:()=>_s,version:()=>As});var qt=(e,t,n,r)=>{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Qt=class{diff(e,t,n={}){let r;"function"==typeof n?(r=n,n={}):"callback"in n&&(r=n.callback);let i=this.castInput(e,n),s=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),a=this.removeEmpty(this.tokenize(s,n));return this.diffWithOptionsObj(o,a,n,r)}diffWithOptionsObj(e,t,n,r){var i;let s=e=>(e=this.postProcess(e,n),r?void setTimeout(function(){r(e)},0):e),o=t.length,a=e.length,l=1,u=o+a;null!=n.maxEditLength&&(u=Math.min(u,n.maxEditLength));let c=null!==(i=n.timeout)&&void 0!==i?i:1/0,h=Date.now()+c,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=a&&f+1>=o)return s(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,g=()=>{for(let r=Math.max(p,-l);r<=Math.min(m,l);r+=2){let i,l=d[r-1],u=d[r+1];l&&(d[r-1]=void 0);let c=!1;if(u){let e=u.oldPos-r;c=u&&0<=e&&e=a&&f+1>=o)return s(this.buildValues(i.lastComponent,t,e))||!0;d[r]=i,i.oldPos+1>=a&&(m=Math.min(m,r-1)),f+1>=o&&(p=Math.max(p,r+1))}else d[r]=void 0}l++};if(r)!function e(){setTimeout(function(){if(l>u||Date.now()>h)return r(void 0);g()||e()},0)}();else for(;l<=u&&Date.now()<=h;){let e=g();if(e)return e}}addToPath(e,t,n,r,i){let s=e.lastComponent;return s&&!i.oneChangePerToken&&s.added===t&&s.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:s.count+1,added:t,removed:n,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:s}}}extractCommon(e,t,n,r,i){let s=t.length,o=n.length,a=e.oldPos,l=a-r,u=0;for(;l+1e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(a,a+e.count));a+=e.count,e.added||(l+=e.count)}}return i}},Zt=new class extends Qt{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Jt(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}function en(e,t){let n;switch(t){case"\n":n=/\n/gu;break;case"\r":n=/\r/gu;break;case"\r\n":n=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let r=e.match(n);return r?r.length:0}var tn="string",nn="array",rn="cursor",sn="indent",on="align",an="trim",ln="group",un="fill",cn="if-break",hn="indent-if-break",dn="line-suffix",fn="line-suffix-boundary",pn="line",mn="label",gn="break-parent",En=new Set([rn,sn,on,an,ln,un,cn,hn,dn,fn,pn,mn,gn]),vn=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},Cn=function(e){if("string"==typeof e)return tn;if(Array.isArray(e))return nn;if(!e)return;let{type:t}=e;return En.has(t)?t:void 0};var Dn=class extends Error{name="InvalidDocError";constructor(e){super(function(e){let t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(Cn(e))throw new Error("doc is valid.");let n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;let r=(e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e))([...En].map(e=>`'${e}'`));return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},Sn=Dn,An={},_n=function(e,t,n,r){let i=[e];for(;i.length>0;){let e=i.pop();if(e===An){n(i.pop());continue}n&&i.push(e,An);let s=Cn(e);if(!s)throw new Sn(e);if(!1!==(null==t?void 0:t(e)))switch(s){case nn:case un:{let t=s===nn?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case cn:i.push(e.flatContents,e.breakContents);break;case ln:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case on:case sn:case hn:case mn:case dn:i.push(e.contents);break;case tn:case rn:case an:case fn:case pn:case gn:break;default:throw new Sn(e)}}};function yn(e,t){if("string"==typeof e)return t(e);let n=new Map;return function e(r){if(n.has(r))return n.get(r);let i=function(n){switch(Cn(n)){case nn:return t(n.map(e));case un:return t({...n,parts:n.parts.map(e)});case cn:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case ln:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case on:case sn:case hn:case mn:case dn:return t({...n,contents:e(n.contents)});case tn:case rn:case an:case fn:case pn:case gn:return t(n);default:throw new Sn(n)}}(r);return n.set(r,i),i}(e)}function bn(e,t,n){let r=n,i=!1;return _n(e,function(e){if(i)return!1;let n=t(e);void 0!==n&&(i=!0,r=n)}),r}function Tn(e){if(e.type===ln&&e.break||e.type===pn&&e.hard||e.type===gn)return!0}function Rn(e){if(e.length>0){let t=vn(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function xn(e){return e.type!==pn||e.hard?e.type===cn?e.flatContents:e:e.soft?"":" "}function wn(e){for(e=[...e];e.length>=2&&vn(!1,e,-2).type===pn&&vn(!1,e,-1).type===gn;)e.length-=2;if(e.length>0){let t=Fn(vn(!1,e,-1));e[e.length-1]=t}return e}function Fn(e){switch(Cn(e)){case sn:case hn:case ln:case dn:case mn:{let t=Fn(e.contents);return{...e,contents:t}}case cn:return{...e,breakContents:Fn(e.breakContents),flatContents:Fn(e.flatContents)};case un:return{...e,parts:wn(e.parts)};case nn:return wn(e);case tn:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return tfunction(e){switch(Cn(e)){case un:if(e.parts.every(e=>""===e))return"";break;case ln:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===ln&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case on:case sn:case hn:case dn:if(!e.contents)return"";break;case cn:if(!e.flatContents&&!e.breakContents)return"";break;case nn:{let t=[];for(let n of e){if(!n)continue;let[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof vn(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case tn:case rn:case an:case fn:case pn:case mn:case gn:break;default:throw new Sn(e)}return e}(e))}(e))}function Ln(e){if(e.type===pn)return!0}function On(e,t){return e.type===mn?{...e,contents:t(e.contents)}:t(e)}var In=()=>{},kn=In,Mn=In,Pn=In;function Bn(e){return kn(e),{type:sn,contents:e}}function Un(e,t){return kn(t),{type:on,contents:t,n:e}}function $n(e,t={}){return kn(e),Mn(t.expandedStates,!0),{type:ln,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Gn(e){return kn(e),{type:dn,contents:e}}var Vn={type:fn},Wn={type:gn},Hn={type:an},jn={type:pn,hard:!0},zn={type:pn,hard:!0,literal:!0},Xn={type:pn},Kn={type:pn,soft:!0},Yn=[jn,Wn],qn=[zn,Wn],Qn={type:rn};function Zn(e,t){kn(e),Mn(t);let n=[];for(let r=0;r0){for(let e=0;e!(function(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}(e)||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e)),nr=/[^\x20-\x7F]/u,rr=function(e){if(!e)return 0;if(!nr.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(let n of e){let e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=tr(e)?1:2)}return t},ir=Symbol("MODE_BREAK"),sr=Symbol("MODE_FLAT"),or=Symbol("cursor"),ar=Symbol("DOC_FILL_PRINTED_LENGTH");function lr(e,t){return cr(e,{type:"indent"},t)}function ur(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?cr(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:cr(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function cr(e,t,n){let r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t],i="",s=0,o=0,a=0;for(let e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function hr(e){let t=0,n=0,r=e.length;e:for(;r--;){let i=e[r];if(i!==or)for(let n=i.length-1;n>=0;n--){let s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(or);return t}function dr(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length,a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}let{mode:e,doc:u}=a.pop(),c=Cn(u);switch(c){case tn:l.push(u),n-=rr(u);break;case nn:case un:{let t=c===nn?u:u.parts,n=u[ar]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case sn:case on:case hn:case mn:a.push({mode:e,doc:u.contents});break;case an:n+=hr(l);break;case ln:{if(s&&u.break)return!1;let t=u.break?ir:e,n=u.expandedStates&&t===ir?vn(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case cn:{let t=(u.groupId?i[u.groupId]||sr:e)===ir?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case pn:if(e===ir||u.hard)return!0;u.soft||(l.push(" "),n--);break;case dn:r=!0;break;case fn:if(r)return!1}}return!1}function fr(e,t){let n={},r=t.printWidth,i=Jt(t.endOfLine),s=0,o=[{ind:{value:"",length:0,queue:[]},mode:ir,doc:e}],a=[],l=!1,u=[],c=0;for(function(e){let t=new Set,n=[];_n(e,function(e){if(e.type===gn&&Rn(n),e.type===ln){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===ln&&n.pop().break&&Rn(n)},!0)}(e);o.length>0;){let{ind:e,mode:h,doc:d}=o.pop();switch(Cn(d)){case tn:{let e="\n"!==i?qt(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=rr(e));break}case nn:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case rn:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(or),c++;break;case sn:o.push({ind:lr(e,t),mode:h,doc:d.contents});break;case on:o.push({ind:ur(e,d.n,t),mode:h,doc:d.contents});break;case an:s-=hr(a);break;case ln:switch(h){case sr:if(!l){o.push({ind:e,mode:d.break?ir:sr,doc:d.contents});break}case ir:{l=!1;let t={ind:e,mode:sr,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&dr(t,o,i,a,n))o.push(t);else if(d.expandedStates){let t=vn(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:ir,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:ir,doc:t});break}{let t=d.expandedStates[r],s={ind:e,mode:sr,doc:t};if(dr(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:ir,doc:d.contents});break}}d.id&&(n[d.id]=vn(!1,o,-1).mode);break;case un:{let t=r-s,i=d[ar]??0,{parts:a}=d,l=a.length-i;if(0===l)break;let c=a[i+0],f=a[i+1],p={ind:e,mode:sr,doc:c},m={ind:e,mode:ir,doc:c},g=dr(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}let E={ind:e,mode:sr,doc:f},v={ind:e,mode:ir,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}let C=a[i+2],D={ind:e,mode:h,doc:{...d,[ar]:i+2}};dr({ind:e,mode:sr,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case cn:case hn:{let t=d.groupId?n[d.groupId]:h;if(t===ir){let t=d.type===cn?d.breakContents:d.negate?d.contents:Bn(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===sr){let t=d.type===cn?d.flatContents:d.negate?Bn(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case dn:u.push({ind:e,mode:h,doc:d.contents});break;case fn:u.length>0&&o.push({ind:e,mode:h,doc:jn});break;case pn:switch(h){case sr:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case ir:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=hr(a),a.push(i+e.value),s=e.length)}break;case mn:o.push({ind:e,mode:h,doc:d.contents});break;case gn:break;default:throw new Sn(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}let h=a.indexOf(or);if(-1!==h){let e=a.indexOf(or,h+1);if(-1===e)return{formatted:a.filter(e=>e!==or).join("")};let t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}var pr,mr,gr,Er=function(e,t,n=0){let r=0;for(let i=n;i=0;n-=2)if(!Array.isArray(t[n])&&--e<0)return n;return-1},gr=function*(){let{stack:e}=this;for(let t=e.length-3;t>=0;t-=2){let n=e[t];Array.isArray(n)||(yield n)}};var vr=class{constructor(e){((e,t)=>{t.has(e)?zt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,void 0)})(this,pr),this.stack=[e]}get key(){let{stack:e,siblings:t}=this;return vn(!1,e,null===t?-2:-4)??null}get index(){return null===this.siblings?null:vn(!1,this.stack,-2)}get node(){return vn(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return null!==this.siblings}get siblings(){let{stack:e}=this,t=vn(!1,e,-3);return Array.isArray(t)?t:null}get next(){let{siblings:e}=this;return null===e?null:e[this.index+1]}get previous(){let{siblings:e}=this;return null===e?null:e[this.index-1]}get isFirst(){return 0===this.index}get isLast(){let{siblings:e,index:t}=this;return null!==e&&t===e.length-1}get isRoot(){return 1===this.stack.length}get root(){return this.stack[0]}get ancestors(){return[...Kt(this,pr,gr).call(this)]}getName(){let{stack:e}=this,{length:t}=e;return t>1?vn(!1,e,-2):null}getValue(){return vn(!1,this.stack,-1)}getNode(e=0){let t=Kt(this,pr,mr).call(this,e);return-1===t?null:this.stack[t]}getParentNode(e=0){return this.getNode(e+1)}call(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{return e(this)}finally{n.length=r}}callParent(e,t=0){let n=Kt(this,pr,mr).call(this,t+1),r=this.stack.splice(n+1);try{return e(this)}finally{this.stack.push(...r)}}each(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{for(let t=0;t{n[r]=e(t,r,i)},...t),n}match(...e){let t=this.stack.length-1,n=null,r=this.stack[t--];for(let i of e){if(void 0===r)return!1;let e=null;if("number"==typeof n&&(e=n,n=this.stack[t--],r=this.stack[t--]),i&&!i(r,n,e))return!1;n=this.stack[t--],r=this.stack[t--]}return!0}findAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return t}hasAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return!0;return!1}},Cr=new Proxy(()=>{},{get:()=>Cr}),Dr=Cr;function*Sr(e,t){let{getVisitorKeys:n,filter:r=()=>!0}=t,i=e=>function(e){return null!==e&&"object"==typeof e}(e)&&r(e);for(let t of n(e)){let n=e[t];if(Array.isArray(n))for(let e of n)i(e)&&(yield e);else i(n)&&(yield n)}}function Ar(e){return(t,n,r)=>{let i=!(null==r||!r.backwards);if(!1===n)return!1;let{length:s}=t,o=n;for(;o>=0&&oObject.keys(e).filter(e=>!wr.has(e)),Nr=function(e){return e?t=>e(t,wr):Fr};function Lr(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=function(e){let t=e.type||e.kind||"(unknown type)",n=String(e.name||e.id&&("object"==typeof e.id?e.id.name:e.id)||e.key&&("object"==typeof e.key?e.key.name:e.key)||e.value&&("object"==typeof e.value?"":String(e.value))||e.operator||"");return n.length>20&&(n=n.slice(0,19)+"…"),t+(n?" "+n:"")}(e)}function Or(e,t){t.leading=!0,t.trailing=!1,Lr(e,t)}function Ir(e,t,n){t.leading=!1,t.trailing=!1,n&&(t.marker=n),Lr(e,t)}function kr(e,t){t.leading=!1,t.trailing=!0,Lr(e,t)}var Mr=new WeakMap;function Pr(e,t){if(Mr.has(e))return Mr.get(e);let{printer:{getCommentChildNodes:n,canAttachComment:r,getVisitorKeys:i},locStart:s,locEnd:o}=t;if(!r)return[];let a=((null==n?void 0:n(e,t))??[...Sr(e,{getVisitorKeys:Nr(i)})]).flatMap(e=>r(e)?[e]:Pr(e,t));return a.sort((e,t)=>s(e)-s(t)||o(e)-o(t)),Mr.set(e,a),a}function Br(e,t,n,r){let i,s,{locStart:o,locEnd:a}=n,l=o(t),u=a(t),c=Pr(e,n),h=0,d=c.length;for(;h>1,r=c[e],f=o(r),p=a(r);if(f<=l&&u<=p)return Br(r,t,n,r);if(p<=l)i=r,h=e+1;else{if(!(u<=f))throw new Error("Comment location overlaps with node location");s=r,d=e}}if("TemplateLiteral"===(null==r?void 0:r.type)){let{quasis:e}=r,o=Hr(e,t,n);i&&Hr(e,i,n)!==o&&(i=null),s&&Hr(e,s,n)!==o&&(s=null)}return{enclosingNode:r,precedingNode:i,followingNode:s}}var Ur=()=>!1,$r=e=>!/[\S\n\u2028\u2029]/u.test(e);function Gr(e,t,n,r){let{comment:i,precedingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=o(i);if(s)for(let t=r-1;t>=0;t--){let{comment:r,precedingNode:i}=n[t];if(i!==s||!$r(e.slice(a(r),l)))break;l=o(r)}return xr(e,l,{backwards:!0})}function Vr(e,t,n,r){let{comment:i,followingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=a(i);if(s)for(let t=r+1;t0;--s){let{comment:i,precedingNode:u,followingNode:c}=e[s-1];Dr.strictEqual(u,o),Dr.strictEqual(c,a);let h=t.originalText.slice(t.locEnd(i),l);if(!((null==(r=(n=t.printer).isGap)?void 0:r.call(n,h,t))??/^[\s(]*$/u.test(h)))break;l=t.locStart(i)}for(let[t,{comment:n}]of e.entries())t1&&e.comments.sort((e,n)=>t.locStart(e)-t.locStart(n));e.length=0}function Hr(e,t,n){let r=n.locStart(t)-1;for(let t=1;t"string"==typeof e||"function"==typeof e,choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>"string"==typeof e||"object"==typeof e,cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:"Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.",cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:"Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.",cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function qr({plugins:e=[],showDeprecated:t=!1}={}){let n=e.flatMap(e=>e.languages??[]),r=[];for(let i of function(e){let t=[];for(let[n,r]of Object.entries(e)){let e={name:n,...r};Array.isArray(e.default)&&(e.default=vn(!1,e.default,-1).value),t.push(e)}return t}(Object.assign({},...e.map(({options:e})=>e),Yr)))!t&&i.deprecated||(Array.isArray(i.choices)&&(t||(i.choices=i.choices.filter(e=>!e.deprecated)),"parser"===i.name&&(i.choices=[...i.choices,...Qr(i.choices,n,e)])),i.pluginDefaults=Object.fromEntries(e.filter(e=>{var t;return void 0!==(null==(t=e.defaultOptions)?void 0:t[i.name])}).map(e=>[e.name,e.defaultOptions[i.name]])),r.push(i));return{languages:n,options:r}}function*Qr(e,t,n){let r=new Set(e.map(e=>e.value));for(let e of t)if(e.parsers)for(let t of e.parsers)if(!r.has(t)){r.add(t);let i=n.find(e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t)),s=e.name;null!=i&&i.name&&(s+=` (plugin: ${i.name})`),yield{value:t,description:s}}}var Zr,Jr,ei,ti,ni,ri="windows"===(null==(Zr=globalThis.Deno)?void 0:Zr.build.os)||(null==(ei=null==(Jr=globalThis.navigator)?void 0:Jr.platform)?void 0:ei.startsWith("Win"))||(null==(ni=null==(ti=globalThis.process)?void 0:ti.platform)?void 0:ni.startsWith("win"))||!1;function ii(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function si(e,t){if(!t)return;let n=(e=>String(e).split(/[/\\]/u).pop())(t).toLowerCase();return e.find(({filenames:e})=>null==e?void 0:e.some(e=>e.toLowerCase()===n))??e.find(({extensions:e})=>null==e?void 0:e.some(e=>n.endsWith(e)))}function oi(e,t){if(t){if(String(t).startsWith("file:"))try{t=function(e){return ri?function(e){e=ii(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return""!==e.hostname&&(t=`\\\\${e.hostname}${t}`),t}(e):function(e){return e=ii(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}(e)}(t)}catch{return}if("string"==typeof t)return e.find(({isSupported:e})=>null==e?void 0:e({filepath:t}))}}var ai=function(e,t){let n=((e,t)=>{if(!e||null!=t)return t.toReversed||!Array.isArray(t)?t.toReversed():[...t].reverse()})(!1,e.plugins).flatMap(e=>e.languages??[]),r=function(e,t){if(t)return e.find(({name:e})=>e.toLowerCase()===t)??e.find(({aliases:e})=>null==e?void 0:e.includes(t))??e.find(({extensions:e})=>null==e?void 0:e.includes(`.${t}`))}(n,t.language)??si(n,t.physicalFile)??si(n,t.file)??oi(n,t.physicalFile)??oi(n,t.file)??void t.physicalFile;return null==r?void 0:r.parsers[0]},li={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(e=>li.value(e)).join(", ")}]`;let t=Object.keys(e);return 0===t.length?"{}":`{ ${t.map(t=>`${li.key(t)}: ${li.value(e[t])}`).join(", ")} }`},pair:({key:e,value:t})=>li.value({[e]:t})},ui=new Proxy(String,{get:()=>ui}),ci=ui,hi=Symbol.for("vnopts.VALUE_NOT_EXIST"),di=Symbol.for("vnopts.VALUE_UNCHANGED"),fi=" ".repeat(2);function pi(e,t,n,r){return[`Invalid ${ci.red(r.key(e))} value.`,`Expected ${ci.blue(n)},`,`but received ${t===hi?ci.gray("nothing"):ci.red(r.value(t))}.`].join(" ")}function mi({text:e,list:t},n){let r=[];return e&&r.push(`- ${ci.blue(e)}`),t&&r.push([`- ${ci.blue(t.title)}:`].concat(t.values.map(e=>mi(e,n-fi.length).replace(/^|\n/g,`$&${fi}`))).join("\n")),gi(r,n)}function gi(e,t){if(1===e.length)return e[0];let[n,r]=e,[i,s]=e.map(e=>e.split("\n",1)[0].length);return i>t&&i>s?r:n}var Ei=[],vi=[],Ci=(e,t,{descriptor:n,logger:r,schemas:i})=>{let s=[`Ignored unknown option ${ci.yellow(n.pair({key:e,value:t}))}.`],o=Object.keys(i).sort().find(t=>function(e,t){if(e===t)return 0;let n=e;e.length>t.length&&(e=t,t=n);let r=e.length,i=t.length;for(;r>0&&e.charCodeAt(~-r)===t.charCodeAt(~-i);)r--,i--;let s=0;for(;sa?u>a?a+1:u:u>l?l+1:u;return a}(e,t)<3);o&&s.push(`Did you mean ${ci.blue(n.key(o))}?`),r.warn(s.join(" "))},Di=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"],Si=class{static create(e){return function(e,t){let n=new e(t),r=Object.create(n);for(let e of Di)e in t&&(r[e]=Ai(t[e],n,Si.prototype[e].length));return r}(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,t){return!1}deprecated(e,t){return!1}forward(e,t){}redirect(e,t){}overlap(e,t,n){return e}preprocess(e,t){return e}postprocess(e,t){return di}};function Ai(e,t,n){return"function"==typeof e?(...r)=>e(...r.slice(0,n-1),t,...r.slice(n-1)):()=>e}var _i=class extends Si{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},yi=class extends Si{expected(){return"anything"}validate(){return!0}},bi=class extends Si{constructor({valueSchema:e,name:t=e.name,...n}){super({...n,name:t}),this._valueSchema=e}expected(e){let{text:t,list:n}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:t&&`an array of ${t}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(e,t){if(!Array.isArray(e))return!1;let n=[];for(let r of e){let e=t.normalizeValidateResult(this._valueSchema.validate(r,t),r);!0!==e&&n.push(e.value)}return 0===n.length||{value:n}}deprecated(e,t){let n=[];for(let r of e){let e=t.normalizeDeprecatedResult(this._valueSchema.deprecated(r,t),r);!1!==e&&n.push(...e.map(({value:e})=>({value:[e]})))}return n}forward(e,t){let n=[];for(let r of e){let e=t.normalizeForwardResult(this._valueSchema.forward(r,t),r);n.push(...e.map(Ti))}return n}redirect(e,t){let n=[],r=[];for(let i of e){let e=t.normalizeRedirectResult(this._valueSchema.redirect(i,t),i);"remain"in e&&n.push(e.remain),r.push(...e.redirect.map(Ti))}return 0===n.length?{redirect:r}:{redirect:r,remain:n}}overlap(e,t){return e.concat(t)}};function Ti({from:e,to:t}){return{from:[e],to:t}}var Ri=class extends Si{expected(){return"true or false"}validate(e){return"boolean"==typeof e}};function xi(e,t){let n=Object.create(null);for(let r of e){let e=r[t];if(n[e])throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n[e]=r}return n}function wi(e,t){if(e===t)return 0;let n=typeof e,r=typeof t,i=["undefined","object","boolean","number","string"];return n!==r?i.indexOf(n)-i.indexOf(r):"string"!==n?Number(e)-Number(t):e.localeCompare(t)}function Fi(e){return void 0===e?{}:e}function Ni(e){if("string"==typeof e)return{text:e};let{text:t,list:n}=e;return function(e){if(!e)throw new Error("Unexpected `expected` result, there should be at least one field.")}(void 0!==(t||n)),n?{text:t,list:{title:n.title,values:n.values.map(Ni)}}:{text:t}}function Li(e,t){return!0===e||(!1===e?{value:t}:e)}function Oi(e,t,n=!1){return!1!==e&&(!0===e?!!n||[{value:t}]:"value"in e?[e]:0!==e.length&&e)}function Ii(e,t){return"string"==typeof e||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function ki(e,t){return void 0===e?[]:Array.isArray(e)?e.map(e=>Ii(e,t)):[Ii(e,t)]}function Mi(e,t){let n=ki("object"==typeof e&&"redirect"in e?e.redirect:e,t);return 0===n.length?{remain:t,redirect:n}:"object"==typeof e&&"remain"in e?{remain:e.remain,redirect:n}:{redirect:n}}var Pi,Bi=class extends Si{constructor(e){super(e),this._choices=function(e,t){let n=new Map;for(let r of e){let e=r[t];if(n.has(e))throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n.set(e,r)}return n}(e.choices.map(e=>e&&"object"==typeof e?e:{value:e}),"value")}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(e=>this._choices.get(e)).filter(({hidden:e})=>!e).map(e=>e.value).sort(wi).map(e.value),n=t.slice(0,-2),r=t.slice(-2);return{text:n.concat(r.join(" or ")).join(", "),list:{title:"one of the following values",values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return!(!t||!t.deprecated)&&{value:e}}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},Ui=class extends Si{expected(){return"a number"}validate(e,t){return"number"==typeof e}},$i=class extends Ui{expected(){return"an integer"}validate(e,t){return!0===t.normalizeValidateResult(super.validate(e,t),e)&&function(e){return e===Math.floor(e)}(e)}},Gi=class extends Si{expected(){return"a string"}validate(e){return"string"==typeof e}},Vi=li,Wi=Ci,Hi=(e,t,n)=>{let{text:r,list:i}=n.normalizeExpectedResult(n.schemas[e].expected(n)),s=[];return r&&s.push(pi(e,t,r,n.descriptor)),i&&s.push([pi(e,t,i.title,n.descriptor)].concat(i.values.map(e=>mi(e,n.loggerPrintWidth))).join("\n")),gi(s,n.loggerPrintWidth)},ji=(e,t,{descriptor:n})=>{let r=[`${ci.yellow("string"==typeof e?n.key(e):n.pair(e))} is deprecated`];return t&&r.push(`we now treat it as ${ci.blue("string"==typeof t?n.key(t):n.pair(t))}`),r.join("; ")+"."},zi=class{constructor(e,t){let{logger:n=console,loggerPrintWidth:r=80,descriptor:i=Vi,unknown:s=Wi,invalid:o=Hi,deprecated:a=ji,missing:l=()=>!1,required:u=()=>!1,preprocess:c=e=>e,postprocess:h=()=>di}=t||{};this._utils={descriptor:i,logger:n||{warn:()=>{}},loggerPrintWidth:r,schemas:xi(e,"name"),normalizeDefaultResult:Fi,normalizeExpectedResult:Ni,normalizeDeprecatedResult:Oi,normalizeForwardResult:ki,normalizeRedirectResult:Mi,normalizeValidateResult:Li},this._unknownHandler=s,this._invalidHandler=function(e){return(...t)=>{let n=e(...t);return"string"==typeof n?new Error(n):n}}(o),this._deprecatedHandler=a,this._identifyMissing=(e,t)=>!(e in t)||l(e,t),this._identifyRequired=u,this._preprocess=c,this._postprocess=h,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=function(){let e=Object.create(null);return t=>{let n=JSON.stringify(t);return!!e[n]||(e[n]=!0,!1)}}()}normalize(e){let t={},n=[this._preprocess(e,this._utils)],r=()=>{for(;0!==n.length;){let e=n.shift(),r=this._applyNormalization(e,t);n.push(...r)}};r();for(let e of Object.keys(this._utils.schemas)){let r=this._utils.schemas[e];if(!(e in t)){let t=Fi(r.default(this._utils));"value"in t&&n.push({[e]:t.value})}}r();for(let e of Object.keys(this._utils.schemas)){if(!(e in t))continue;let n=this._utils.schemas[e],r=t[e],i=n.postprocess(r,this._utils);i!==di&&(this._applyValidation(i,e,n),t[e]=i)}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let n=[],{knownKeys:r,unknownKeys:i}=this._partitionOptionKeys(e);for(let i of r){let r=this._utils.schemas[i],s=r.preprocess(e[i],this._utils);this._applyValidation(s,i,r);let o=({from:e,to:t})=>{n.push("string"==typeof t?{[t]:e}:{[t.key]:t.value})},a=({value:e,redirectTo:t})=>{let n=Oi(r.deprecated(e,this._utils),s,!0);if(!1!==n)if(!0===n)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,t,this._utils));else for(let{value:e}of n){let n={key:i,value:e};if(!this._hasDeprecationWarned(n)){let r="string"==typeof t?{key:t,value:e}:t;this._utils.logger.warn(this._deprecatedHandler(n,r,this._utils))}}};ki(r.forward(s,this._utils),s).forEach(o);let l=Mi(r.redirect(s,this._utils),s);if(l.redirect.forEach(o),"remain"in l){let e=l.remain;t[i]=i in t?r.overlap(t[i],e,this._utils):e,a({value:e})}for(let{from:e,to:t}of l.redirect)a({value:e,redirectTo:t})}for(let r of i){let i=e[r];this._applyUnknownHandler(r,i,t,(e,t)=>{n.push({[e]:t})})}return n}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,hi,this._utils)}_partitionOptionKeys(e){let[t,n]=function(e,t){let n=[],r=[];for(let i of e)t(i)?n.push(i):r.push(i);return[n,r]}(Object.keys(e).filter(t=>!this._identifyMissing(t,e)),e=>e in this._utils.schemas);return{knownKeys:t,unknownKeys:n}}_applyValidation(e,t,n){let r=Li(n.validate(e,this._utils),e);if(!0!==r)throw this._invalidHandler(t,r.value,this._utils)}_applyUnknownHandler(e,t,n,r){let i=this._unknownHandler(e,t,this._utils);if(i)for(let e of Object.keys(i)){if(this._identifyMissing(e,i))continue;let t=i[e];e in this._utils.schemas?r(e,t):n[e]=t}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==di){if(t.delete)for(let n of t.delete)delete e[n];if(t.override){let{knownKeys:n,unknownKeys:r}=this._partitionOptionKeys(t.override);for(let r of n){let n=t.override[r];this._applyValidation(n,r,this._utils.schemas[r]),e[r]=n}for(let n of r){let r=t.override[n];this._applyUnknownHandler(n,r,e,(t,n)=>{let r=this._utils.schemas[t];this._applyValidation(n,t,r),e[t]=n})}}}}};function Xi(e,{isCLI:t,optionInfos:n,FlagSchema:r}){let i,{name:s}=e,o={name:s},a={};switch(e.type){case"int":i=$i,t&&(o.preprocess=Number);break;case"string":case"path":i=Gi;break;case"choice":i=Bi,o.choices=e.choices.map(t=>null!=t&&t.redirect?{...t,redirect:{to:{key:e.name,value:t.redirect}}}:t);break;case"boolean":i=Ri;break;case"flag":i=r,o.flags=n.flatMap(e=>[e.alias,e.description&&e.name,e.oppositeDescription&&`no-${e.name}`].filter(Boolean));break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?o.validate=(t,n,r)=>e.exception(t)||n.validate(t,r):o.validate=(e,t,n)=>void 0===e||t.validate(e,n),e.redirect&&(a.redirect=t=>t?{to:"string"==typeof e.redirect?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(a.deprecated=!0),t&&!e.array){let e=o.preprocess||(e=>e);o.preprocess=(t,n,r)=>n.preprocess(e(Array.isArray(t)?vn(!1,t,-1):t),r)}return e.array?bi.create({...t?{preprocess:e=>Array.isArray(e)?e:[e]}:{},...a,valueSchema:i.create(o)}):i.create({...o,...a})}var Ki=(e,t,n)=>{if(!e||null!=t){if(t.findLast)return t.findLast(n);for(let e=t.length-1;e>=0;e--){let r=t[e];if(n(r,e,t))return r}}};function Yi(e,t){if(!t)throw new Error("parserName is required.");let n=Ki(!1,e,e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t));if(n)return n;let r=`Couldn't resolve parser "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}function qi({plugins:e,parser:t}){return Qi(Yi(e,t),t)}function Qi(e,t){let n=e.parsers[t];return"function"==typeof n?n():n}var Zi={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null},Ji=async function(e,t={}){var n;let r={...e};if(!r.parser){if(!r.filepath)throw new Kr("No parser and no file path given, couldn't infer a parser.");if(r.parser=ai(r,{physicalFile:r.filepath}),!r.parser)throw new Kr(`No parser could be inferred for file "${r.filepath}".`)}let i=qr({plugins:e.plugins,showDeprecated:!0}).options,s={...Zi,...Object.fromEntries(i.filter(e=>void 0!==e.default).map(e=>[e.name,e.default]))},o=Yi(r.plugins,r.parser),a=await Qi(o,r.parser);r.astFormat=a.astFormat,r.locEnd=a.locEnd,r.locStart=a.locStart;let l=null!=(n=o.printers)&&n[a.astFormat]?o:function(e,t){if(!t)throw new Error("astFormat is required.");let n=Ki(!1,e,e=>e.printers&&Object.prototype.hasOwnProperty.call(e.printers,t));if(n)return n;let r=`Couldn't find plugin for AST format "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}(r.plugins,a.astFormat),u=await function(e,t){let n=e.printers[t];return"function"==typeof n?n():n}(l,a.astFormat);r.printer=u;let c={...s,...l.defaultOptions?Object.fromEntries(Object.entries(l.defaultOptions).filter(([,e])=>void 0!==e)):{}};for(let[e,t]of Object.entries(c))(null===r[e]||void 0===r[e])&&(r[e]=t);return"json"===r.parser&&(r.trailingComma="none"),function(e,t,{logger:n=!1,isCLI:r=!1,passThrough:i=!1,FlagSchema:s,descriptor:o}={}){if(r){if(!s)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=li;let a=i?Array.isArray(i)?(e,t)=>i.includes(e)?{[e]:t}:void 0:(e,t)=>({[e]:t}):(e,t,n)=>{let{_:r,...i}=n.schemas;return Ci(e,t,{...n,schemas:i})},l=function(e,{isCLI:t,FlagSchema:n}){let r=[];t&&r.push(yi.create({name:"_"}));for(let i of e)r.push(Xi(i,{isCLI:t,optionInfos:e,FlagSchema:n})),i.alias&&t&&r.push(_i.create({name:i.alias,sourceName:i.name}));return r}(t,{isCLI:r,FlagSchema:s}),u=new zi(l,{logger:n,unknown:a,descriptor:o}),c=!1!==n;c&&Pi&&(u._hasDeprecationWarned=Pi);let h=u.normalize(e);return c&&(Pi=u._hasDeprecationWarned),h}(r,i,{passThrough:Object.keys(Zi),...t})},es=((e,t,n)=>(n=null!=e?$t(Ht(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of Wt(t))!jt.call(e,n)&&void 0!==n&&Gt(e,n,{get:()=>t[n],enumerable:!(r=Vt(t,n))||r.enumerable});return e})(Gt(n,"default",{value:e,enumerable:!0}),e)))(Yt()),ts=async function(e,t){let n,r=await qi(t),i=r.preprocess?r.preprocess(e,t):e;t.originalText=i;try{n=await r.parse(i,t,t)}catch(t){!function(e,t){let{loc:n}=e;if(n){let r=(0,es.codeFrameColumns)(t,n,{highlightCode:!0});throw e.message+="\n"+r,e.codeFrame=r,e}throw e}(t,e)}return{text:i,ast:n}};async function ns(e,t){({ast:e}=await is(e,t));let n=new Map,r=new vr(e),i=()=>{},s=new Map;await async function(e,t,n,r,i){let{embeddedLanguageFormatting:s,printer:{embed:o,hasPrettierIgnore:a=()=>!1,getVisitorKeys:l}}=n;if(!o||"auto"!==s)return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let u=Nr(o.getVisitorKeys??l),c=[];!function t(){let{node:r}=e;if(null===r||"object"!=typeof r||a(e))return;for(let n of u(r))Array.isArray(r[n])?e.each(t,n):e.call(t,n);let s=o(e,n);if(s){if("function"==typeof s)return void c.push({print:s,node:r,pathStack:[...e.stack]});i.set(r,s)}}();let h=e.stack;for(let{print:r,node:s,pathStack:o}of c)try{e.stack=o;let a=await r(d,t,e,n);a&&i.set(s,a)}catch(e){if(globalThis.PRETTIER_DEBUG)throw e}function d(e,t){return async function(e,t,n,r){let i=await Ji({...n,...t,parentParser:n.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:s}=await ts(e,i);return Nn(await r(s,i))}(e,t,n,r)}e.stack=h}(r,a,t,ns,s);let o=await rs(r,t,a,void 0,s);if(function(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:n}=e;for(let e of t){if(!e.printed&&!n.has(e))throw new Error('Comment "'+e.value.trim()+'" was not printed. Please report this error!');delete e.printed}}(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return[Qn,o];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[o,Qn]}return o;function a(e,t){return void 0===e||e===r?l(t):Array.isArray(e)?r.call(()=>l(t),...e):r.call(()=>l(t),e)}function l(e){i(r);let o=r.node;if(null==o)return"";let l=o&&"object"==typeof o&&void 0===e;if(l&&n.has(o))return n.get(o);let u=rs(r,t,a,e,s);return l&&n.set(o,u),u}}function rs(e,t,n,r,i){var s;let o,{node:a}=e,{printer:l}=t;switch(o=null!=(s=l.hasPrettierIgnore)&&s.call(l,e)?function(e,t){let{originalText:n,[Symbol.for("comments")]:r,locStart:i,locEnd:s,[Symbol.for("printedComments")]:o}=t,{node:a}=e,l=i(a),u=s(a);for(let e of r)i(e)>=l&&s(e)<=u&&o.add(e);return n.slice(l,u)}(e,t):i.has(a)?i.get(a):l.print(e,t,n,r),a){case t.cursorNode:o=On(o,e=>[Qn,e,Qn]);break;case t.nodeBeforeCursor:o=On(o,e=>[e,Qn]);break;case t.nodeAfterCursor:o=On(o,e=>[Qn,e])}return l.printComment&&(!l.willPrintOwnComments||!l.willPrintOwnComments(e,t))&&(o=function(e,t,n){let{leading:r,trailing:i}=function(e,t){let n=e.node;if(!n)return{};let r=t[Symbol.for("printedComments")];if(0===(n.comments||[]).filter(e=>!r.has(e)).length)return{leading:"",trailing:""};let i,s=[],o=[];return e.each(()=>{let n=e.node;if(null!=r&&r.has(n))return;let{leading:a,trailing:l}=n;a?s.push(function(e,t){var n;let r=e.node,i=[zr(e,t)],{printer:s,originalText:o,locStart:a,locEnd:l}=t;if(null==(n=s.isBlockComment)?void 0:n.call(s,r)){let e=xr(o,l(r))?xr(o,a(r),{backwards:!0})?Yn:Xn:" ";i.push(e)}else i.push(Yn);let u=Rr(o,yr(o,l(r)));return!1!==u&&xr(o,u)&&i.push(Yn),i}(e,t)):l&&(i=function(e,t,n){var r;let i=e.node,s=zr(e,t),{printer:o,originalText:a,locStart:l}=t,u=null==(r=o.isBlockComment)?void 0:r.call(o,i);if(null!=n&&n.hasLineSuffix&&(null==n||!n.isBlock)||xr(a,l(i),{backwards:!0})){let e=jr(a,l(i));return{doc:Gn([Yn,e?Yn:"",s]),isBlock:u,hasLineSuffix:!0}}return!u||null!=n&&n.hasLineSuffix?{doc:[Gn([" ",s]),Wn],isBlock:u,hasLineSuffix:!0}:{doc:[" ",s],isBlock:u,hasLineSuffix:!1}}(e,t,i),o.push(i.doc))},"comments"),{leading:s,trailing:o}}(e,n);return r||i?On(t,e=>[r,e,i]):t}(e,o,t)),o}async function is(e,t){let n=e.comments??[];t[Symbol.for("comments")]=n,t[Symbol.for("printedComments")]=new Set,function(e,t){let{comments:n}=e;if(delete e.comments,!function(e){return Array.isArray(e)&&e.length>0}(n)||!t.printer.canAttachComment)return;let r=[],{printer:{experimentalFeatures:{avoidAstMutation:i=!1}={},handleComments:s={}},originalText:o}=t,{ownLine:a=Ur,endOfLine:l=Ur,remaining:u=Ur}=s,c=n.map((r,i)=>({...Br(e,r,t),comment:r,text:o,options:t,ast:e,isLastComment:n.length-1===i}));for(let[e,t]of c.entries()){let n,{comment:s,precedingNode:o,enclosingNode:h,followingNode:d,text:f,options:p,ast:m,isLastComment:g}=t;if(i?n=[t]:(s.enclosingNode=h,s.precedingNode=o,s.followingNode=d,n=[s,f,p,m,g]),Gr(f,p,c,e))s.placement="ownLine",a(...n)||(d?Or(d,s):o?kr(o,s):Ir(h||m,s));else if(Vr(f,p,c,e))s.placement="endOfLine",l(...n)||(o?kr(o,s):d?Or(d,s):Ir(h||m,s));else if(s.placement="remaining",!u(...n))if(o&&d){let e=r.length;e>0&&r[e-1].followingNode!==d&&Wr(r,p),r.push(t)}else o?kr(o,s):d?Or(d,s):Ir(h||m,s)}if(Wr(r,t),!i)for(let e of n)delete e.precedingNode,delete e.enclosingNode,delete e.followingNode}(e,t);let{printer:{preprocess:r}}=t;return{ast:e=r?await r(e,t):e,comments:n}}var ss=function(e,t){let{cursorOffset:n,locStart:r,locEnd:i}=t,s=Nr(t.printer.getVisitorKeys),o=e=>r(e)<=n&&i(e)>=n,a=e,l=[e];for(let t of function*(e,t){let n=[e];for(let e=0;e0&&(void 0===u||void 0===c);){a=l.pop();let e=void 0!==u,t=void 0!==c;for(let o of Sr(a,{getVisitorKeys:s})){if(!e){let e=i(o);e<=n&&e>h&&(u=o,h=e)}if(!t){let e=r(o);e>=n&&e{if(!e||null!=t){if(t.findLastIndex)return t.findLastIndex(n);for(let e=t.length-1;e>=0;e--)if(n(t[e],e,t))return e;return-1}})(!1,e,e=>"Program"!==e.type&&"File"!==e.type);return-1===t?e:e.slice(0,t+1)}function as(e,t,n,r,i=[],s){let{locStart:o,locEnd:a}=n,l=o(e),u=a(e);if(!(t>u||t=0&&(t={...t,...ss(r,t)});let s=await ns(r,t);n>0&&(s=Jn([Yn,s],n,t.tabWidth));let o=fr(s,t);if(n>0){let e=o.formatted.trim();void 0!==o.cursorNodeStart&&(o.cursorNodeStart-=o.formatted.indexOf(e),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>e.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=e+Jt(t.endOfLine)}let a=t[Symbol.for("comments")];if(t.cursorOffset>=0){let e,n,r,s;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&o.cursorNodeText)if(r=o.cursorNodeStart,s=o.cursorNodeText,t.cursorNode)e=t.locStart(t.cursorNode),n=i.slice(e,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");e=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let r=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):i.length;n=i.slice(e,r)}else e=0,n=i,r=0,s=o.formatted;let l=t.cursorOffset-e;if(n===s)return{formatted:o.formatted,cursorOffset:r+l,comments:a};let u=n.split("");u.splice(l,0,hs);let c=function(e,t){return Zt.diff(e,t,void 0)}(u,s.split("")),h=r;for(let e of c)if(e.removed){if(e.value.includes(hs))break}else h+=e.count;return{formatted:o.formatted,cursorOffset:h,comments:a}}return{formatted:o.formatted,cursorOffset:-1,comments:a}}function fs(e,t,n){return"number"!=typeof t||Number.isNaN(t)||t<0||t>e.length?n:t}function ps(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i}=t;return n=fs(e,n,-1),r=fs(e,r,0),i=fs(e,i,e.length),{...t,cursorOffset:n,rangeStart:r,rangeEnd:i}}function ms(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s}=ps(e,t),o="\ufeff"===e.charAt(0);if(o&&(e=e.slice(1),n--,r--,i--),"auto"===s&&(s=function(e){let t=e.indexOf("\r");return-1!==t?"\n"===e.charAt(t+1)?"crlf":"cr":"lf"}(e)),e.includes("\r")){let t=t=>en(e.slice(0,Math.max(t,0)),"\r\n");n-=t(n),r-=t(r),i-=t(i),e=function(e){return qt(!1,e,/\r\n?/gu,"\n")}(e)}return{hasBOM:o,text:e,options:ps(e,{...t,cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s})}}async function gs(e,t){let n=await qi(t);return!n.hasPragma||n.hasPragma(e)}async function Es(e,t){let n,{hasBOM:r,text:i,options:s}=ms(e,await Ji(t));return s.rangeStart>=s.rangeEnd&&""!==i||s.requirePragma&&!await gs(i,s)||s.checkIgnorePragma&&await async function(e,t){var n;let r=await qi(t);return null==(n=r.hasIgnorePragma)?void 0:n.call(r,e)}(i,s)?{formatted:e,cursorOffset:t.cursorOffset,comments:[]}:(s.rangeStart>0||s.rangeEndr);let a=e.slice(r,i).search(/\S/u),l=-1===a;if(!l)for(r+=a;i>r&&!/\S/u.test(e[i-1]);--i);let u,c,h=as(n,r,t,(e,n)=>cs(t,e,n),[],"rangeStart"),d=l?h:as(n,i,t,e=>cs(t,e),[],"rangeEnd");if(!h||!d)return{rangeStart:0,rangeEnd:0};if((({parser:e})=>"json"===e||"json5"===e||"jsonc"===e||"json-stringify"===e)(t)){let e=function(e,t){let n=[e.node,...e.parentNodes],r=new Set([t.node,...t.parentNodes]);return n.find(e=>ls.has(e.type)&&r.has(e))}(h,d);u=e,c=e}else({startNode:u,endNode:c}=function(e,t,{locStart:n,locEnd:r}){let i=e.node,s=t.node;if(i===s)return{startNode:i,endNode:s};let o=n(e.node);for(let e of os(t.parentNodes)){if(!(n(e)>=o))break;s=e}let a=r(t.node);for(let t of os(e.parentNodes)){if(!(r(t)<=a))break;if(i=t,i===s)break}return{startNode:i,endNode:s}}(h,d,t));return{rangeStart:Math.min(s(u),s(c)),rangeEnd:Math.max(o(u),o(c))}}(r,t,n),o=r.slice(i,s),a=Math.min(i,r.lastIndexOf("\n",i)+1),l=r.slice(a,i).match(/^\s*/u)[0],u=Er(l,t.tabWidth),c=await ds(o,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>i&&t.cursorOffset<=s?t.cursorOffset-i:-1,endOfLine:"lf"},u),h=c.formatted.trimEnd(),{cursorOffset:d}=t;d>s?d+=h.length-o.length:c.cursorOffset>=0&&(d=c.cursorOffset+i);let f=r.slice(0,i)+h+r.slice(s);if("lf"!==t.endOfLine){let e=Jt(t.endOfLine);d>=0&&"\r\n"===e&&(d+=en(f.slice(0,d),"\n")),f=qt(!1,f,"\n",e)}return{formatted:f,cursorOffset:d,comments:c.comments}}(i,s):(!s.requirePragma&&s.insertPragma&&s.printer.insertPragma&&!await gs(i,s)&&(i=s.printer.insertPragma(i)),n=await ds(i,s)),r&&(n.formatted="\ufeff"+n.formatted,n.cursorOffset>=0&&n.cursorOffset++),n)}var vs={};Xt(vs,{builders:()=>Cs,printer:()=>Ds,utils:()=>Ss});var Cs={join:Zn,line:Xn,softline:Kn,hardline:Yn,literalline:qn,group:$n,conditionalGroup:function(e,t){return $n(e[0],{...t,expandedStates:e})},fill:function(e){return Pn(e),{type:un,parts:e}},lineSuffix:Gn,lineSuffixBoundary:Vn,cursor:Qn,breakParent:Wn,ifBreak:function(e,t="",n={}){return kn(e),""!==t&&kn(t),{type:cn,breakContents:e,flatContents:t,groupId:n.groupId}},trim:Hn,indent:Bn,indentIfBreak:function(e,t){return kn(e),{type:hn,contents:e,groupId:t.groupId,negate:t.negate}},align:Un,addAlignmentToDoc:Jn,markAsRoot:function(e){return Un({type:"root"},e)},dedentToRoot:function(e){return Un(Number.NEGATIVE_INFINITY,e)},dedent:function(e){return Un(-1,e)},hardlineWithoutBreakParent:jn,literallineWithoutBreakParent:zn,label:function(e,t){return kn(t),e?{type:mn,label:e,contents:t}:t},concat:e=>e},Ds={printDocToString:fr},Ss={willBreak:function(e){return bn(e,Tn,!1)},traverseDoc:_n,findInDoc:bn,mapDoc:yn,removeLines:function(e){return yn(e,xn)},stripTrailingHardline:Nn,replaceEndOfLine:function(e,t=qn){return yn(e,e=>"string"==typeof e?Zn(t,e.split("\n")):e)},canBreak:function(e){return bn(e,Ln,!1)}},As="3.6.2",_s={};Xt(_s,{addDanglingComment:()=>Ir,addLeadingComment:()=>Or,addTrailingComment:()=>kr,getAlignmentSize:()=>Er,getIndentSize:()=>xs,getMaxContinuousCount:()=>ws,getNextNonSpaceNonCommentCharacter:()=>Fs,getNextNonSpaceNonCommentCharacterIndex:()=>Ms,getPreferredQuote:()=>Ls,getStringWidth:()=>rr,hasNewline:()=>xr,hasNewlineInRange:()=>Os,hasSpaces:()=>Is,isNextLineEmpty:()=>Bs,isNextLineEmptyAfterIndex:()=>Rs,isPreviousLineEmpty:()=>Ps,makeString:()=>ks,skip:()=>Ar,skipEverythingButNewLine:()=>Tr,skipInlineComment:()=>ys,skipNewline:()=>Rr,skipSpaces:()=>yr,skipToLineEnd:()=>br,skipTrailingComment:()=>bs,skipWhitespace:()=>_r});var ys=function(e,t){if(!1===t)return!1;if("/"===e.charAt(t)&&"*"===e.charAt(t+1))for(let n=t+2;nMath.max(e,n.length/t.length),0)},Fs=function(e,t){let n=Ts(e,t);return!1===n?"":e.charAt(n)},Ns="'",Ls=function(e,t){let n=!0===t||t===Ns?Ns:'"',r=n===Ns?'"':Ns,i=0,s=0;for(let t of e)t===n?i++:t===r&&s++;return i>s?r:n},Os=function(e,t,n){for(let r=t;ri===r?i:s===t?"\\"+s:s||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(i)?i:"\\"+i));return t+i+t};function Ms(e,t){return 2===arguments.length||"number"==typeof t?Ts(e,t):function(e,t,n){return Ts(e,n(t))}(...arguments)}function Ps(e,t){return 2===arguments.length||"number"==typeof t?jr(e,t):function(e,t,n){return jr(e,n(t))}(...arguments)}function Bs(e,t){return 2===arguments.length||"number"==typeof t?Rs(e,t):function(e,t,n){return Rs(e,n(t))}(...arguments)}function Us(e,t=1){return async(...n)=>{let r=n[t]??{},i=r.plugins??[];return n[t]={...r,plugins:Array.isArray(i)?i:Object.values(i)},e(...n)}}var $s=Us(Es);async function Gs(e,t){let{formatted:n}=await $s(e,{...t,cursorOffset:-1});return n}async function Vs(e,t){return await Gs(e,t)===e}var Ws=Us(qr,0),Hs={parse:Us(async function(e,t,n){let{text:r,options:i}=ms(e,await Ji(t)),s=await ts(r,i);return n&&(n.preprocessForPrint&&(s.ast=await is(s.ast,i)),n.massage&&(s.ast=function(e,t){let{printer:{massageAstNode:n,getVisitorKeys:r}}=t;if(!n)return e;let i=Nr(r),s=n.ignoredProperties??new Set;return function e(t,r){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>e(t,r)).filter(Boolean);let o={},a=new Set(i(t));for(let n in t)!Object.prototype.hasOwnProperty.call(t,n)||s.has(n)||(a.has(n)?o[n]=e(t[n],t):o[n]=t[n]);let l=n(t,o,r);return null!==l?l??o:void 0}(e)}(s.ast,i))),s}),formatAST:Us(async function(e,t){return t=await Ji(t),fr(await ns(e,t),t)}),formatDoc:Us(async function(e,t){let n=function(e){let t=Object.create(null),n=new Set;return function e(t,n,i){var s,o;if("string"==typeof t)return JSON.stringify(t);if(Array.isArray(t)){let n=t.map(e).filter(Boolean);return 1===n.length?n[0]:`[${n.join(", ")}]`}if(t.type===pn){let e=(null==(s=null==i?void 0:i[n+1])?void 0:s.type)===gn;return t.literal?e?"literalline":"literallineWithoutBreakParent":t.hard?e?"hardline":"hardlineWithoutBreakParent":t.soft?"softline":"line"}if(t.type===gn)return(null==(o=null==i?void 0:i[n-1])?void 0:o.type)===pn&&i[n-1].hard?void 0:"breakParent";if(t.type===an)return"trim";if(t.type===sn)return"indent("+e(t.contents)+")";if(t.type===on)return t.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+e(t.contents)+")":t.n<0?"dedent("+e(t.contents)+")":"root"===t.n.type?"markAsRoot("+e(t.contents)+")":"align("+JSON.stringify(t.n)+", "+e(t.contents)+")";if(t.type===cn)return"ifBreak("+e(t.breakContents)+(t.flatContents?", "+e(t.flatContents):"")+(t.groupId?(t.flatContents?"":', ""')+`, { groupId: ${r(t.groupId)} }`:"")+")";if(t.type===hn){let n=[];t.negate&&n.push("negate: true"),t.groupId&&n.push(`groupId: ${r(t.groupId)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return`indentIfBreak(${e(t.contents)}${i})`}if(t.type===ln){let n=[];t.break&&"propagated"!==t.break&&n.push("shouldBreak: true"),t.id&&n.push(`id: ${r(t.id)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return t.expandedStates?`conditionalGroup([${t.expandedStates.map(t=>e(t)).join(",")}]${i})`:`group(${e(t.contents)}${i})`}if(t.type===un)return`fill([${t.parts.map(t=>e(t)).join(", ")}])`;if(t.type===dn)return"lineSuffix("+e(t.contents)+")";if(t.type===fn)return"lineSuffixBoundary";if(t.type===mn)return`label(${JSON.stringify(t.label)}, ${e(t.contents)})`;if(t.type===rn)return"cursor";throw new Error("Unknown doc type "+t.type)}(er(e));function r(e){if("symbol"!=typeof e)return JSON.stringify(String(e));if(e in t)return t[e];let r=e.description||"symbol";for(let i=0;;i++){let s=r+(i>0?` #${i}`:"");if(!n.has(s))return n.add(s),t[e]=`Symbol.for(${JSON.stringify(s)})`}}}(e),{formatted:r}=await Es(n,{...t,parser:"__js_expression"});return r}),printToDoc:Us(async function(e,t){t=await Ji(t);let{ast:n}=await ts(e,t);return t.cursorOffset>=0&&(t={...t,...ss(n,t)}),ns(n,t)}),printDocToString:Us(async function(e,t){return fr(e,await Ji(t))})},js=Object.defineProperty;((e,t)=>{for(var n in t)js(e,n,{get:t[n],enumerable:!0})})({},{builders:()=>Jo,printer:()=>ea,utils:()=>ta});var zs="string",Xs="array",Ks="cursor",Ys="indent",qs="align",Qs="trim",Zs="group",Js="fill",eo="if-break",to="indent-if-break",no="line-suffix",ro="line-suffix-boundary",io="line",so="label",oo="break-parent",ao=new Set([Ks,Ys,qs,Qs,Zs,Js,eo,to,no,ro,io,so,oo]),lo=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},uo=function(e){if("string"==typeof e)return zs;if(Array.isArray(e))return Xs;if(!e)return;const{type:t}=e;return ao.has(t)?t:void 0};var co=class extends Error{name="InvalidDocError";constructor(e){super(function(e){const t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(uo(e))throw new Error("doc is valid.");const n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;const r=(i=[...ao].map(e=>`'${e}'`),new Intl.ListFormat("en-US",{type:"disjunction"}).format(i));var i;return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},ho={},fo=function(e,t,n,r){const i=[e];for(;i.length>0;){const e=i.pop();if(e===ho){n(i.pop());continue}n&&i.push(e,ho);const s=uo(e);if(!s)throw new co(e);if(!1!==(null==t?void 0:t(e)))switch(s){case Xs:case Js:{const t=s===Xs?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case eo:i.push(e.flatContents,e.breakContents);break;case Zs:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case qs:case Ys:case to:case so:case no:i.push(e.contents);break;case zs:case Ks:case Qs:case ro:case io:case oo:break;default:throw new co(e)}}};function po(e,t){if("string"==typeof e)return t(e);const n=new Map;return function e(r){if(n.has(r))return n.get(r);const i=function(n){switch(uo(n)){case Xs:return t(n.map(e));case Js:return t({...n,parts:n.parts.map(e)});case eo:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case Zs:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case qs:case Ys:case to:case so:case no:return t({...n,contents:e(n.contents)});case zs:case Ks:case Qs:case ro:case io:case oo:return t(n);default:throw new co(n)}}(r);return n.set(r,i),i}(e)}function mo(e,t,n){let r=n,i=!1;return fo(e,function(e){if(i)return!1;const n=t(e);void 0!==n&&(i=!0,r=n)}),r}function go(e){return!(e.type!==Zs||!e.break)||!(e.type!==io||!e.hard)||e.type===oo||void 0}function Eo(e){if(e.length>0){const t=lo(!1,e,-1);t.expandedStates||t.break||(t.break="propagated")}return null}function vo(e){return e.type!==io||e.hard?e.type===eo?e.flatContents:e:e.soft?"":" "}function Co(e){for(e=[...e];e.length>=2&&lo(!1,e,-2).type===io&&lo(!1,e,-1).type===oo;)e.length-=2;if(e.length>0){const t=Do(lo(!1,e,-1));e[e.length-1]=t}return e}function Do(e){switch(uo(e)){case Ys:case to:case Zs:case no:case so:{const t=Do(e.contents);return{...e,contents:t}}case eo:return{...e,breakContents:Do(e.breakContents),flatContents:Do(e.flatContents)};case Js:return{...e,parts:Co(e.parts)};case Xs:return Co(e);case zs:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return t{},_o=Ao,yo=Ao,bo=Ao;function To(e){return _o(e),{type:Ys,contents:e}}function Ro(e,t){return _o(t),{type:qs,contents:t,n:e}}function xo(e,t={}){return _o(e),yo(t.expandedStates,!0),{type:Zs,id:t.id,contents:e,break:Boolean(t.shouldBreak),expandedStates:t.expandedStates}}var wo={type:ro},Fo={type:oo},No={type:Qs},Lo={type:io,hard:!0},Oo={type:io,hard:!0,literal:!0},Io={type:io},ko={type:io,soft:!0},Mo=[Lo,Fo],Po=[Oo,Fo],Bo={type:Ks};function Uo(e,t){_o(e),yo(t);const n=[];for(let r=0;r{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Go=e=>{return!(12288===(t=e)||t>=65281&&t<=65376||t>=65504&&t<=65510||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e));var t},Vo=/[^\x20-\x7F]/u,Wo=function(e){if(!e)return 0;if(!Vo.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(const n of e){const e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=Go(e)?1:2)}return t},Ho=Symbol("MODE_BREAK"),jo=Symbol("MODE_FLAT"),zo=Symbol("cursor"),Xo=Symbol("DOC_FILL_PRINTED_LENGTH");function Ko(e,t){return qo(e,{type:"indent"},t)}function Yo(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?qo(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:qo(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function qo(e,t,n){const r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t];let i="",s=0,o=0,a=0;for(const e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function Qo(e){let t=0,n=0,r=e.length;e:for(;r--;){const i=e[r];if(i!==zo)for(let n=i.length-1;n>=0;n--){const s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(zo);return t}function Zo(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length;const a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}const{mode:e,doc:u}=a.pop(),c=uo(u);switch(c){case zs:l.push(u),n-=Wo(u);break;case Xs:case Js:{const t=c===Xs?u:u.parts,n=u[Xo]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case Ys:case qs:case to:case so:a.push({mode:e,doc:u.contents});break;case Qs:n+=Qo(l);break;case Zs:{if(s&&u.break)return!1;const t=u.break?Ho:e,n=u.expandedStates&&t===Ho?lo(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case eo:{const t=(u.groupId?i[u.groupId]||jo:e)===Ho?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case io:if(e===Ho||u.hard)return!0;u.soft||(l.push(" "),n--);break;case no:r=!0;break;case ro:if(r)return!1}}return!1}var Jo={join:Uo,line:Io,softline:ko,hardline:Mo,literalline:Po,group:xo,conditionalGroup:function(e,t){return xo(e[0],{...t,expandedStates:e})},fill:function(e){return bo(e),{type:Js,parts:e}},lineSuffix:function(e){return _o(e),{type:no,contents:e}},lineSuffixBoundary:wo,cursor:Bo,breakParent:Fo,ifBreak:function(e,t="",n={}){return _o(e),""!==t&&_o(t),{type:eo,breakContents:e,flatContents:t,groupId:n.groupId}},trim:No,indent:To,indentIfBreak:function(e,t){return _o(e),{type:to,contents:e,groupId:t.groupId,negate:t.negate}},align:Ro,addAlignmentToDoc:function(e,t,n){_o(e);let r=e;if(t>0){for(let e=0;ee},ea={printDocToString:function(e,t){const n={},r=t.printWidth,i=function(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}(t.endOfLine);let s=0;const o=[{ind:{value:"",length:0,queue:[]},mode:Ho,doc:e}],a=[];let l=!1;const u=[];let c=0;for(function(e){const t=new Set,n=[];fo(e,function(e){if(e.type===oo&&Eo(n),e.type===Zs){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===Zs&&n.pop().break&&Eo(n)},!0)}(e);o.length>0;){const{ind:e,mode:h,doc:d}=o.pop();switch(uo(d)){case zs:{const e="\n"!==i?$o(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=Wo(e));break}case Xs:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case Ks:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(zo),c++;break;case Ys:o.push({ind:Ko(e,t),mode:h,doc:d.contents});break;case qs:o.push({ind:Yo(e,d.n,t),mode:h,doc:d.contents});break;case Qs:s-=Qo(a);break;case Zs:switch(h){case jo:if(!l){o.push({ind:e,mode:d.break?Ho:jo,doc:d.contents});break}case Ho:{l=!1;const t={ind:e,mode:jo,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&Zo(t,o,i,a,n))o.push(t);else if(d.expandedStates){const t=lo(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:Ho,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:Ho,doc:t});break}{const t=d.expandedStates[r],s={ind:e,mode:jo,doc:t};if(Zo(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:Ho,doc:d.contents});break}}d.id&&(n[d.id]=lo(!1,o,-1).mode);break;case Js:{const t=r-s,i=d[Xo]??0,{parts:a}=d,l=a.length-i;if(0===l)break;const c=a[i+0],f=a[i+1],p={ind:e,mode:jo,doc:c},m={ind:e,mode:Ho,doc:c},g=Zo(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}const E={ind:e,mode:jo,doc:f},v={ind:e,mode:Ho,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}const C=a[i+2],D={ind:e,mode:h,doc:{...d,[Xo]:i+2}};Zo({ind:e,mode:jo,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case eo:case to:{const t=d.groupId?n[d.groupId]:h;if(t===Ho){const t=d.type===eo?d.breakContents:d.negate?d.contents:To(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===jo){const t=d.type===eo?d.flatContents:d.negate?To(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case no:u.push({ind:e,mode:h,doc:d.contents});break;case ro:u.length>0&&o.push({ind:e,mode:h,doc:Lo});break;case io:switch(h){case jo:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case Ho:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=Qo(a),a.push(i+e.value),s=e.length)}break;case so:o.push({ind:e,mode:h,doc:d.contents});break;case oo:break;default:throw new co(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}const h=a.indexOf(zo);if(-1!==h){const e=a.indexOf(zo,h+1);if(-1===e)return{formatted:a.filter(e=>e!==zo).join("")};const t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}},ta={willBreak:function(e){return mo(e,go,!1)},traverseDoc:fo,findInDoc:mo,mapDoc:po,removeLines:function(e){return po(e,vo)},stripTrailingHardline:function(e){return Do(function(e){return po(e,e=>function(e){switch(uo(e)){case Js:if(e.parts.every(e=>""===e))return"";break;case Zs:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===Zs&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case qs:case Ys:case to:case no:if(!e.contents)return"";break;case eo:if(!e.flatContents&&!e.breakContents)return"";break;case Xs:{const t=[];for(const n of e){if(!n)continue;const[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof lo(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case zs:case Ks:case Qs:case ro:case io:case so:case oo:break;default:throw new co(e)}return e}(e))}(e))},replaceEndOfLine:function(e,t=Po){return po(e,e=>"string"==typeof e?Uo(t,e.split("\n")):e)},canBreak:function(e){return mo(e,So,!1)}};function na(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}class ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class ia extends ra{constructor(e){super([]),this.idx=1,Object.assign(this,ma(e))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class sa extends ra{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ma(e))}}class oa extends ra{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ma(e))}}class aa extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class la extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ua extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ca extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ha extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class da extends ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ma(e))}}class fa{constructor(e){this.idx=1,Object.assign(this,ma(e))}accept(e){e.visit(this)}}function pa(e){function t(e){return e.map(pa)}if(e instanceof ia){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return"string"==typeof e.label&&(t.label=e.label),t}if(e instanceof oa)return{type:"Alternative",definition:t(e.definition)};if(e instanceof aa)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof la)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof ua)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ha)return{type:"RepetitionWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ca)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof da)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof fa){const t={type:"Terminal",name:e.terminalType.name,label:(n=e.terminalType,"string"==typeof(r=n).LABEL&&""!==r.LABEL?n.LABEL:n.name),idx:e.idx};"string"==typeof e.label&&(t.terminalLabel=e.label);const i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=i instanceof RegExp?i.source:i),t}if(e instanceof sa)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match");var n,r}function ma(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}class ga{visit(e){const t=e;switch(t.constructor){case ia:return this.visitNonTerminal(t);case oa:return this.visitAlternative(t);case aa:return this.visitOption(t);case la:return this.visitRepetitionMandatory(t);case ua:return this.visitRepetitionMandatoryWithSeparator(t);case ha:return this.visitRepetitionWithSeparator(t);case ca:return this.visitRepetition(t);case da:return this.visitAlternation(t);case fa:return this.visitTerminal(t);case sa:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Ea(e,t=[]){return!!(e instanceof aa||e instanceof ca||e instanceof ha)||(e instanceof da?e.definition.some(e=>Ea(e,t)):!(e instanceof ia&&t.includes(e))&&e instanceof ra&&(e instanceof ia&&t.push(e),e.definition.every(e=>Ea(e,t))))}function va(e){if(e instanceof ia)return"SUBRULE";if(e instanceof aa)return"OPTION";if(e instanceof da)return"OR";if(e instanceof la)return"AT_LEAST_ONE";if(e instanceof ua)return"AT_LEAST_ONE_SEP";if(e instanceof ha)return"MANY_SEP";if(e instanceof ca)return"MANY";if(e instanceof fa)return"CONSUME";throw Error("non exhaustive match")}class Ca{walk(e,t=[]){e.definition.forEach((n,r)=>{const i=e.definition.slice(r+1);if(n instanceof ia)this.walkProdRef(n,i,t);else if(n instanceof fa)this.walkTerminal(n,i,t);else if(n instanceof oa)this.walkFlat(n,i,t);else if(n instanceof aa)this.walkOption(n,i,t);else if(n instanceof la)this.walkAtLeastOne(n,i,t);else if(n instanceof ua)this.walkAtLeastOneSep(n,i,t);else if(n instanceof ha)this.walkManySep(n,i,t);else if(n instanceof ca)this.walkMany(n,i,t);else{if(!(n instanceof da))throw Error("non exhaustive match");this.walkOr(n,i,t)}})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);e.definition.forEach(e=>{const t=new oa({definition:[e]});this.walk(t,r)})}}function Da(e,t,n){return[new aa({definition:[new fa({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Sa(e){if(e instanceof ia)return Sa(e.referencedRule);if(e instanceof fa)return[e.terminalType];if(function(e){return e instanceof oa||e instanceof aa||e instanceof ca||e instanceof la||e instanceof ua||e instanceof ha||e instanceof fa||e instanceof sa}(e))return function(e){let t=[];const n=e.definition;let r,i=0,s=n.length>i,o=!0;for(;s&&o;)r=n[i],o=Ea(r),t=t.concat(Sa(r)),i+=1,s=n.length>i;return[...new Set(t)]}(e);if(function(e){return e instanceof da}(e))return function(e){const t=e.definition.map(e=>Sa(e));return[...new Set(t.flat())]}(e);throw Error("non exhaustive match")}const Aa="_~IN~_";class _a extends Ca{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=(i=e.referencedRule,s=e.idx,i.name+s+Aa+this.topProd.name);var i,s;const o=t.concat(n),a=Sa(new oa({definition:o}));this.follows[r]=a}}function ya(e){return e.charCodeAt(0)}function ba(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function Ta(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t],e[t]=!0}function Ra(e){if(void 0===e)throw Error("Internal Error - Should never get here!");return!0}function xa(){throw Error("Internal Error - Should never get here!")}function wa(e){return"Character"===e.type}const Fa=[];for(let e=ya("0");e<=ya("9");e++)Fa.push(e);const Na=[ya("_")].concat(Fa);for(let e=ya("a");e<=ya("z");e++)Na.push(e);for(let e=ya("A");e<=ya("Z");e++)Na.push(e);const La=[ya(" "),ya("\f"),ya("\n"),ya("\r"),ya("\t"),ya("\v"),ya("\t"),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya("\u2028"),ya("\u2029"),ya(" "),ya(" "),ya(" "),ya("\ufeff")],Oa=/[0-9a-fA-F]/,Ia=/[0-9]/,ka=/[1-9]/;class Ma{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}function Pa(e){console&&console.error&&console.error(`Error: ${e}`)}function Ba(e){console&&console.warn&&console.warn(`Warning: ${e}`)}let Ua={};const $a=new class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Ta(n,"global");break;case"i":Ta(n,"ignoreCase");break;case"m":Ta(n,"multiLine");break;case"u":Ta(n,"unicode");break;case"y":Ta(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":let t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}}Ra(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return xa()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;Ra(t)}if(!0!==e||void 0!==t)return Ra(t)?("?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t):void 0}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),Ra(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):xa()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ya("\n"),ya("\r"),ya("\u2028"),ya("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=Fa;break;case"D":e=Fa,t=!0;break;case"s":e=La;break;case"S":e=La,t=!0;break;case"w":e=Na;break;case"W":e=Na,t=!0}return Ra(e)?{type:"Set",value:e,complement:t}:xa()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ya("\f");break;case"n":e=ya("\n");break;case"r":e=ya("\r");break;case"t":e=ya("\t");break;case"v":e=ya("\v")}return Ra(e)?{type:"Character",value:e}:xa()}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:ya("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:ya(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:ya(this.popChar())}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const t=this.classAtom();if(t.type,wa(t)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,wa(n)){if(n.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};function Ga(e){const t=e.toString();if(Ua.hasOwnProperty(t))return Ua[t];{const e=$a.pattern(t);return Ua[t]=e,e}}const Va="Complement Sets are not supported for first char optimization",Wa='Unable to use "first char" lexer optimizations:\n';function Ha(e,t=!1){try{const t=Ga(e);return ja(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===Va)t&&Ba(`${Wa}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),Pa(`${Wa}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function ja(e,t,n){switch(e.type){case"Disjunction":for(let r=0;r{if("number"==typeof e)za(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)za(e,t,n);else{for(let e=r.from;e<=r.to&&e=ul){const e=r.from>=ul?r.from:ul,n=r.to,i=hl(e),s=hl(n);for(let e=i;e<=s;e++)t[e]=e}}}});break;case"Group":ja(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}const o=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===Ka(s)||"Group"!==s.type&&!1===o)break}break;default:throw Error("non exhaustive match!")}return Object.values(t)}function za(e,t,n){const r=hl(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=hl(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=hl(e.charCodeAt(0));t[n]=n}}}(e,t)}function Xa(e,t){return e.value.find(e=>{if("number"==typeof e)return t.includes(e);{const n=e;return void 0!==t.find(e=>n.from<=e&&e<=n.to)}})}function Ka(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(Array.isArray(e.value)?e.value.every(Ka):Ka(e.value))}class Ya extends Ma{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e);case"Lookbehind":return void this.visitLookbehind(e);case"NegativeLookbehind":return void this.visitNegativeLookbehind(e)}super.visitChildren(e)}}visitCharacter(e){this.targetCharCodes.includes(e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===Xa(e,this.targetCharCodes)&&(this.found=!0):void 0!==Xa(e,this.targetCharCodes)&&(this.found=!0)}}function qa(e,t){if(t instanceof RegExp){const n=Ga(t),r=new Ya(e);return r.visit(n),r.found}for(const n of t){const t=n.charCodeAt(0);if(e.includes(t))return!0}return!1}const Qa="PATTERN",Za="defaultMode",Ja="modes";const el=/[^\\][$]/,tl=/[^\\[][\^]|^\^/;function nl(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function rl(e){const t=e.PATTERN;if(t instanceof RegExp)return!1;if("function"==typeof t)return!0;if(Object.hasOwn(t,"exec"))return!0;if("string"==typeof t)return!1;throw Error("non exhaustive match")}function il(e){return"string"==typeof e&&1===e.length&&e.charCodeAt(0)}const sl={test:function(e){const t=e.length;for(let n=this.lastIndex;n"string"==typeof e?e.charCodeAt(0):e)}function ll(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const ul=256;let cl=[];function hl(e){return ee.CATEGORIES).flat().filter(Boolean);const e=n.filter(e=>!t.includes(e));t=t.concat(e),0===e.length?r=!1:n=e}return t}(e);!function(e){e.forEach(e=>{var t;Cl(e)||(gl[ml]=e,e.tokenTypeIdx=ml++),Dl(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Dl(e)||(e.CATEGORIES=[]),t=e,Object.hasOwn(null!=t?t:{},"categoryMatches")||(e.categoryMatches=[]),function(e){return Object.hasOwn(null!=e?e:{},"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})})}(t),function(e){e.forEach(e=>{vl([],e)})}(t),function(e){e.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(t=>{e.categoryMatches.push(gl[t].tokenTypeIdx)})})}(t),t.forEach(e=>{e.isParent=e.categoryMatches.length>0})}function vl(e,t){e.forEach(e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),t.CATEGORIES.forEach(n=>{const r=e.concat(t);r.includes(n)||vl(r,n)})}function Cl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}function Dl(e){return Object.hasOwn(null!=e?e:{},"CATEGORIES")}function Sl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}var Al;!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"}(Al||(Al={}));const _l={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:{buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i,s)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`},traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(_l);class yl{constructor(e,t=_l){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=Object.assign({},_l,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===_l.lineTerminatorsPattern)this.config.lineTerminatorsPattern=sl;else if(this.config.lineTerminatorCharacters===_l.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Array.isArray(e)?n={modes:{defaultMode:[...e]},defaultMode:Za}:(r=!1,n=Object.assign({},e))}),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){const t=[];return Object.hasOwn(e,Za)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+Za+"> property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(e,Ja)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(e,Ja)&&Object.hasOwn(e,Za)&&!Object.hasOwn(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${Za}: <${e.defaultMode}>which does not exist\n`,type:Al.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(e,Ja)&&Object.keys(e.modes).forEach(n=>{const r=e.modes[n];r.forEach((e,i)=>{void 0===e?t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:Al.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(e,"LONGER_ALT")&&(Array.isArray(e.LONGER_ALT)?e.LONGER_ALT:[e.LONGER_ALT]).forEach(i=>{void 0===i||r.includes(i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${e.name}> outside of mode <${n}>\n`,type:Al.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(function(e,t,n){const r=[];let i=!1;const s=Object.values(e.modes||{}).flat().filter(Boolean).filter(e=>e[Qa]!==yl.NA),o=al(n);return t&&s.forEach(e=>{const t=ol(e,o);if(!1!==t){const n=function(e,t){if(t.issue===Al.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Al.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else Object.hasOwn(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):qa(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:Al.NO_LINE_BREAKS_FLAGS}),r}(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},Object.entries(n.modes).forEach(([e,t])=>{n.modes[e]=t.filter(e=>void 0!==e)});const i=Object.keys(n.modes);if(Object.entries(n.modes).forEach(([e,n])=>{this.TRACE_INIT(`Mode: <${e}> processing`,()=>{if(this.modes.push(e),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e,t){let n=[];const r=function(e){const t=e.filter(e=>!Object.hasOwn(e,Qa));return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:Al.MISSING_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(e);n=n.concat(r.errors);const i=function(e){const t=e.filter(e=>{const t=e[Qa];return!(t instanceof RegExp||"function"==typeof t||Object.hasOwn(t,"exec")||"string"==typeof t)});return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Al.INVALID_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=e.filter(e=>e[Qa]instanceof RegExp);return t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return el.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return tl.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){return e.filter(e=>{const t=e[Qa];return t instanceof RegExp&&(t.multiline||t.global)}).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Al.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){const t=[];let n=e.map(n=>e.reduce((e,r)=>(n.PATTERN.source!==r.PATTERN.source||t.includes(r)||r.PATTERN===yl.NA||(t.push(r),e.push(r)),e),[]));return n=n.filter(Boolean),n.filter(e=>e.length>1).map(e=>{const t=e.map(e=>e.name);return{message:`The same RegExp pattern ->${e[0].PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:Al.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}(n)),t=t.concat(function(e){return e.filter(e=>e.PATTERN.test("")).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:Al.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}(n)),t}(s)),n=n.concat(function(e){const t=e.filter(e=>{if(!Object.hasOwn(e,"GROUP"))return!1;const t=e.GROUP;return t!==yl.SKIPPED&&t!==yl.NA&&!("string"==typeof t)});return t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Al.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}(s)),n=n.concat(function(e,t){return e.filter(e=>void 0!==e.PUSH_MODE&&!t.includes(e.PUSH_MODE)).map(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:Al.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}(s,t)),n=n.concat(function(e){const t=[],n=e.reduce((e,t,n)=>{const r=t.PATTERN;return r===yl.NA||("string"==typeof r?e.push({str:r,idx:n,tokenType:t}):r instanceof RegExp&&(i=r,void 0===[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(e=>-1!==i.source.indexOf(e)))&&e.push({str:r.source,idx:n,tokenType:t})),e;var i},[]);return e.forEach((e,r)=>{n.forEach(({str:n,idx:i,tokenType:s})=>{if(r${s.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:Al.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}})}),t}(s)),n}(n,i))}),0===this.lexerDefinitionErrors.length){let r;El(n),this.TRACE_INIT("analyzeTokenTypes",()=>{r=function(e,t){const n=(t=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()},t)).tracer;let r;n("initCharCodeToOptimizedIndexMap",()=>{!function(){if(0===cl.length){cl=new Array(65536);for(let e=0;e<65536;e++)cl[e]=e>255?255+~~(e/255):e}}()}),n("Reject Lexer.NA",()=>{r=e.filter(e=>e[Qa]!==yl.NA)});let i,s,o,a,l,u,c,h,d,f,p,m=!1;n("Transform Patterns",()=>{m=!1,i=r.map(e=>{const t=e[Qa];if(t instanceof RegExp){const e=t.source;return 1!==e.length||"^"===e||"$"===e||"."===e||t.ignoreCase?2!==e.length||"\\"!==e[0]||["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(e[1])?nl(t):e[1]:e}if("function"==typeof t)return m=!0,{exec:t};if("object"==typeof t)return m=!0,t;if("string"==typeof t){if(1===t.length)return t;{const e=t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return nl(new RegExp(e))}}throw Error("non exhaustive match")})}),n("misc mapping",()=>{s=r.map(e=>e.tokenTypeIdx),o=r.map(e=>{const t=e.GROUP;if(t!==yl.SKIPPED){if("string"==typeof t)return t;if(void 0===t)return!1;throw Error("non exhaustive match")}}),a=r.map(e=>{const t=e.LONGER_ALT;if(t)return Array.isArray(t)?t.map(e=>r.indexOf(e)):[r.indexOf(t)]}),l=r.map(e=>e.PUSH_MODE),u=r.map(e=>Object.hasOwn(e,"POP_MODE"))}),n("Line Terminator Handling",()=>{const e=al(t.lineTerminatorCharacters);c=r.map(e=>!1),"onlyOffset"!==t.positionTracking&&(c=r.map(t=>Object.hasOwn(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===ol(t,e)&&qa(e,t.PATTERN)))}),n("Misc Mapping #2",()=>{h=r.map(rl),d=i.map(il),f=r.reduce((e,t)=>{const n=t.GROUP;return"string"==typeof n&&n!==yl.SKIPPED&&(e[n]=[]),e},{}),p=i.map((e,t)=>({pattern:i[t],longerAlt:a[t],canLineTerminator:c[t],isCustom:h[t],short:d[t],group:o[t],push:l[t],pop:u[t],tokenTypeIdx:s[t],tokenType:r[t]}))});let g=!0,E=[];return t.safeMode||n("First Char Optimization",()=>{E=r.reduce((e,n,r)=>{if("string"==typeof n.PATTERN){const t=hl(n.PATTERN.charCodeAt(0));ll(e,t,p[r])}else if(Array.isArray(n.START_CHARS_HINT)){let t;n.START_CHARS_HINT.forEach(n=>{const i=hl("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,ll(e,i,p[r]))})}else if(n.PATTERN instanceof RegExp)if(n.PATTERN.unicode)g=!1,t.ensureOptimizations&&Pa(`${Wa}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=Ha(n.PATTERN,t.ensureOptimizations);0===i.length&&(g=!1),i.forEach(t=>{ll(e,t,p[r])})}else t.ensureOptimizations&&Pa(`${Wa}\tTokenType: <${n.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return e},[])}),{emptyGroups:f,patternIdxToConfig:p,charCodeToPatternIdxToConfig:E,hasCustom:m,canBeOptimized:g}}(n,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[e]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[e]=r.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[e]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}this.lexerDefinitionWarning.forEach(e=>{Ba(e.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(r&&(this.handleModes=()=>{}),!1===this.trackStartLines&&(this.computeNewColumn=e=>e),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=()=>{}),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const e=Object.entries(this.canModeBeOptimized).reduce((e,[t,n])=>(!1===n&&e.push(t),e),[]);if(t.ensureOptimizations&&e.length>0)throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Ua={}}),this.TRACE_INIT("toFastProperties",()=>{na(this)})})}tokenize(e,t=this.defaultMode){if(this.lexerDefinitionErrors.length>0){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,s,o,a,l,u,c,h,d,f,p,m,g;const E=e,v=E.length;let C=0,D=0;const S=this.hasCustom?0:Math.floor(e.length/10),A=new Array(S),_=[];let y=this.trackStartLines?1:void 0,b=this.trackStartLines?1:void 0;const T=function(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(!Array.isArray(r))throw Error("non exhaustive match");t[n]=[]}),t}(this.emptyGroups),R=this.trackStartLines,x=this.config.lineTerminatorsPattern;let w=0,F=[],N=[];const L=[],O=[];Object.freeze(O);let I=!1;const k=e=>{if(1===L.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);_.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{L.pop();const e=L.at(-1);F=this.patternIdxToConfig[e],N=this.charCodeToPatternIdxToConfig[e],w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}};function M(e){L.push(e),N=this.charCodeToPatternIdxToConfig[e],F=this.patternIdxToConfig[e],w=F.length,w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}let P;M.call(this,t);const B=this.config.recoveryEnabled;for(;Ca.length){a=s,c=s.length,l=u,P=t;break}}}break}}if(-1!==c){if(h=P.group,void 0!==h&&(a=null!==a?a:e.substring(C,C+c),d=P.tokenTypeIdx,f=this.createTokenInstance(a,C,d,P.tokenType,y,b,c),this.handlePayload(f,l),!1===h?D=this.addToken(A,D,f):T[h].push(f)),!0===R&&!0===P.canLineTerminator){let t,n,r=0;x.lastIndex=0;do{a=null!==a?a:e.substring(C,C+c),t=x.test(a),!0===t&&(n=x.lastIndex-1,r++)}while(!0===t);0!==r?(y+=r,b=c-n,this.updateTokenEndLineColumnLocation(f,h,n,r,y,b,c)):b=this.computeNewColumn(b,c)}else b=this.computeNewColumn(b,c);C+=c,this.handleModes(P,k,M,f)}else{const t=C,n=y,i=b;let s=!1===B;for(;!1===s&&C`Expecting ${Tl(e)?`--\x3e ${bl(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o="\nbut found: '"+t[0].image+"'";return r?s+r+o:s+`one of these possible Token sequences:\n${e.reduce((e,t)=>e.concat(t),[]).map(e=>`[${e.map(e=>bl(e)).join(", ")}]`).map((e,t)=>` ${t+1}. ${e}`).join("\n")}`+o},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",s="\nbut found: '"+t[0].image+"'";return n?i+n+s:i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map(e=>`[${e.map(e=>bl(e)).join(",")}]`).join(" ,")}>`+s}};Object.freeze(Bl);const Ul={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},$l={buildDuplicateFoundError(e,t){const n=e.name,r=t[0],i=r.idx,s=va(r),o=(a=r)instanceof fa?a.terminalType.name:a instanceof ia?a.nonTerminalName:"";var a;let l=`->${s}${i>0?i:""}<- ${o?`with argument: ->${o}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,"\n"),l},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=e.prefixPath.map(e=>bl(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=0===e.alternation.idx?"":e.alternation.idx,n=0===e.prefixPath.length;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule,\n`;return r+=n?"These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n":`<${e.prefixPath.map(e=>bl(e)).join(", ")}> may appears as a prefix path in all these alternatives.\n`,r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=va(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${t} --\x3e ${e.leftRecursionPath.map(e=>e.name).concat([t]).join(" --\x3e ")}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof sa?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class Gl extends ga{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:rc.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Vl extends Ca{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){0===this.ruleStack.length?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Wl extends Vl{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const e=t.concat(n),r=new oa({definition:e});this.possibleTokTypes=Sa(r),this.found=!0}}}class Hl extends Ca{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class jl extends Hl{walkMany(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}}class zl extends Hl{walkManySep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}}class Xl extends Hl{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}}class Kl extends Hl{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}}function Yl(e,t,n=[]){n=[...n];let r=[],i=0;function s(s){const o=Yl(s.concat(e.slice(i+1)),t,n);return r.concat(o)}for(;n.length{0!==e.definition.length&&(r=s(e.definition))}),r;if(!(t instanceof fa))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:e.slice(i)}),r}function ql(e,t,n,r){const i=[...n];i.push(e.name);const s=[...r];return s.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:s}}var Ql;function Zl(e){if(e instanceof aa||"Option"===e)return Ql.OPTION;if(e instanceof ca||"Repetition"===e)return Ql.REPETITION;if(e instanceof la||"RepetitionMandatory"===e)return Ql.REPETITION_MANDATORY;if(e instanceof ua||"RepetitionMandatoryWithSeparator"===e)return Ql.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ha||"RepetitionWithSeparator"===e)return Ql.REPETITION_WITH_SEPARATOR;if(e instanceof da||"Alternation"===e)return Ql.ALTERNATION;throw Error("non exhaustive match")}function Jl(e,t,n,r){const i=e.length,s=e.every(e=>e.every(e=>1===e.length));if(t)return function(t){const r=t.map(e=>e.GATE);for(let t=0;te.flat()).reduce((e,t,n)=>(t.forEach(t=>{t.tokenTypeIdx in e||(e[t.tokenTypeIdx]=n),t.categoryMatches.forEach(t=>{Object.hasOwn(e,t)||(e[t]=n)})}),e),{});return function(){const e=this.LA_FAST(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t1===e.length),i=e.length;if(r&&!n){const t=e.flat();if(1===t.length&&0===t[0].categoryMatches.length){const e=t[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===e}}{const e=t.reduce((e,t,n)=>(e[t.tokenTypeIdx]=!0,t.categoryMatches.forEach(t=>{e[t]=!0}),e),[]);return function(){const t=this.LA_FAST(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;nYl([e],1)),r=ru(n.length),i=n.map(e=>{const t={};return e.forEach(e=>{iu(e.partialPath).forEach(e=>{t[e]=!0})}),t});let s=n;for(let e=1;e<=t;e++){const n=s;s=ru(n.length);for(let o=0;o{iu(e.partialPath).forEach(e=>{i[o][e]=!0})})}}}}return r}function au(e,t,n,r){const i=new nu(e,Ql.ALTERNATION,r);return t.accept(i),ou(i.result,n)}function lu(e,t,n,r){const i=new nu(e,n);t.accept(i);const s=i.result,o=new tu(t,e,n).startWalking();return ou([new oa({definition:s}),new oa({definition:o})],r)}function uu(e,t){e:for(let n=0;ne.every(e=>e.every(e=>0===e.categoryMatches.length)))}function hu(e){return`${va(e)}_#_${e.idx}_#_${du(e)}`}function du(e){return e instanceof fa?e.terminalType.name:e instanceof ia?e.nonTerminalName:""}class fu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function pu(e,t,n,r=[]){const i=[],s=mu(t.definition);if(0===s.length)return[];{const t=e.name;s.includes(e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:rc.LEFT_RECURSION,ruleName:t});const o=r.concat([e]),a=s.filter(e=>!o.includes(e)).flatMap(t=>{const i=[...r];return i.push(t),pu(e,t,n,i)});return i.concat(a)}}function mu(e){let t=[];if(0===e.length)return t;const n=e[0];if(n instanceof ia)t.push(n.referencedRule);else if(n instanceof oa||n instanceof aa||n instanceof la||n instanceof ua||n instanceof ha||n instanceof ca)t=t.concat(mu(n.definition));else if(n instanceof da)t=n.definition.map(e=>mu(e.definition)).flat();else if(!(n instanceof fa))throw Error("non exhaustive match");const r=Ea(n),i=e.length>1;if(r&&i){const n=e.slice(1);return t.concat(mu(n))}return t}class gu extends ga{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}class Eu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}const vu="MismatchedTokenException",Cu="NoViableAltException",Du="EarlyExitException",Su="NotAllInputParsedException",Au=[vu,Cu,Du,Su];function _u(e){return Au.includes(e.name)}Object.freeze(Au);class yu extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class bu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=vu}}class Tu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Cu}}class Ru extends yu{constructor(e,t){super(e,t),this.name=Su}}class xu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Du}}const wu={},Fu="InRuleRecoveryException";class Nu extends Error{constructor(e){super(e),this.name=Fu}}function Lu(e,t,n,r,i,s,o){const a=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[a];if(void 0===l){const e=this.getCurrRuleFullName();l=new s(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[a]=l}let u=l.token,c=l.occurrence;const h=l.isEndOfRule;0===this.RULE_STACK_IDX&&h&&void 0===u&&(u=Ml,c=1),void 0!==u&&void 0!==c&&this.shouldInRepetitionRecoveryBeTried(u,c,o)&&this.tryInRepetitionRecovery(e,t,n,u)}const Ou=1024,Iu=1280,ku=1536;function Mu(e,t,n){return n|t|e}class Pu{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:tc.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(0===t.length){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return e.flatMap(e=>pu(e,e,$l))}validateEmptyOrAlternatives(e){return e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.slice(0,-1).flatMap((r,i)=>0===function(e,t,n){const r="EXIT_NONE_TERMINAL",i=[r],s="EXIT_ALTERNATIVE";let o=!1;const a=t.length,l=a-1-1,u=[],c=[];for(c.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});0!==c.length;){const e=c.pop();if(e===s){o&&c.at(-1).idx<=l&&c.pop();continue}const h=e.def,d=e.idx,f=e.ruleStack,p=e.occurrenceStack;if(0===h.length)continue;const m=h[0];if(m===r){const e={idx:d,def:h.slice(1),ruleStack:f.slice(0,-1),occurrenceStack:p.slice(0,-1)};c.push(e)}else if(m instanceof fa)if(d=0;e--){const t={idx:d,def:m.definition[e].definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p};c.push(t),c.push(s)}else if(m instanceof oa)c.push({idx:d,def:m.definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p});else{if(!(m instanceof sa))throw Error("non exhaustive match");c.push(ql(m,d,f,p))}}return u}([r],[],fl).length?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:rc.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}(e,$l))}validateAmbiguousAlternationAlternatives(e,t){return e.flatMap(e=>function(e,t,n){const r=new gu;e.accept(r);let i=r.alternations;i=i.filter(e=>!0!==e.ignoreAmbiguities);return i.flatMap(r=>{const i=r.idx,s=r.maxLookahead||t,o=au(i,e,s,r),a=function(e,t,n,r){const i=[];return e.reduce((n,r,s)=>(!0===t.definition[s].ignoreAmbiguities||r.forEach(r=>{const o=[s];e.forEach((e,n)=>{s!==n&&uu(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&o.push(n)}),o.length>1&&!uu(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]).map(e=>{const i=e.alts.map(e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}(o,r,e,n),l=function(e,t,n,r){const i=e.reduce((e,t,n)=>{const r=t.map(e=>({idx:n,path:e}));return e.concat(r)},[]);return i.flatMap(e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const s=e.idx,o=e.path;return i.filter(e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx{const n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}));var n,r}).map(e=>{const i=[e.idx+1,s+1],o=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})})}(o,r,e,n);return a.concat(l)})}(e,t,$l))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return e.forEach(e=>{const i=new Eu;e.accept(i),i.allProductions.forEach(i=>{const s=Zl(i),o=i.maxLookahead||t;if(0===lu(i.idx,e,s,o)[0].flat().length){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:rc.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}(e,t,$l)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,s){const o=au(e,t,n);return s(o,r,cu(o)?pl:fl,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Jl)}buildLookaheadForOptional(e){return function(e,t,n,r,i,s){const o=lu(e,t,i,n),a=cu(o)?pl:fl;return s(o[0],a,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Zl(e.prodType),eu)}}const Bu=new class extends ga{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function Uu(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset"function"==typeof e.GATE);return s.hasPredicates=o,n.definition.push(s),i.forEach(e=>{const t=new oa({definition:[]});s.definition.push(t),Object.hasOwn(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Object.hasOwn(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),Hu}function Zu(e){return 0===e?"":`${e}`}function Ju(e){if(e<0||e>zu){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${zu+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const ec=Pl(Ml,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ec);const tc=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Bl,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),nc=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var rc,ic,sc;!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(rc||(rc={}));class oc{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",()=>{na(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=function(e){const t=Object.assign({errMsgProvider:Ul},e),n={};return e.rules.forEach(e=>{n[e.name]=e}),function(e,t){const n=new Gl(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(0===n.length&&!1===this.skipValidations){const e=function(e){var t;const n=null!==(t=e.errMsgProvider)&&void 0!==t?t:$l;return function(e,t,n,r){const i=e.flatMap(e=>function(e,t){const n=new fu;e.accept(n);const r=n.allProductions,i=Object.groupBy(r,hu),s=Object.fromEntries(Object.entries(i).filter(([e,t])=>t.length>1));return Object.values(s).map(n=>{const r=n[0],i=t.buildDuplicateFoundError(e,n),s=va(r),o={message:i,type:rc.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:s,occurrence:r.idx},a=du(r);return a&&(o.parameter=a),o})}(e,n)),s=function(e,t,n){const r=[],i=t.map(e=>e.name);return e.forEach(e=>{const t=e.name;if(i.includes(t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:rc.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}(e,t,n),o=e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:rc.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}(e,n)),a=e.flatMap(t=>function(e,t,n,r){const i=[],s=t.reduce((t,n)=>n.name===e.name?t+1:t,0);if(s>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:rc.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n));return i.concat(s,o,a)}(e.rules,e.tokenTypes,n,e.grammarName)}({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:$l,grammarName:t}),n=function(e){return e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}).map(e=>Object.assign({type:rc.CUSTOM_LOOKAHEAD_VALIDATION},e))}({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(e,n)}}),0===this.definitionErrors.length&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const e=function(e){const t={};return e.forEach(e=>{const n=new _a(e).startWalking();Object.assign(t,n)}),t}(Object.values(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!oc.DEFER_DEFINITION_ERRORS_HANDLING&&0!==this.definitionErrors.length)throw e=this.definitionErrors.map(e=>e.message),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initGastRecorder(t),n.initPerformanceTracer(t),Object.hasOwn(t,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=Object.hasOwn(t,"skipValidations")?t.skipValidations:tc.skipValidations}}oc.DEFER_DEFINITION_ERRORS_HANDLING=!1,ic=oc,sc=[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:tc.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Lu)}getTokenToInsert(e){const t=Pl(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let a=!1;const l=this.LA_FAST(1);let u=this.LA_FAST(1);const c=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),n=new bu(t,l,this.LA(0));n.resyncedTokens=o.slice(0,-1),this.SAVE_ERROR(n)};for(;!a;){if(this.tokenMatcher(u,r))return void c();if(n.call(this))return c(),void e.apply(this,t);this.tokenMatcher(u,i)?a=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o))}this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA_FAST(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getNextPossibleTokenTypes(e){const t=e.ruleStack[0],n=this.getGAstProductions()[t];return new Wl(n,e).startWalking()}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new Nu("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(0===t.length)return!1;const n=this.LA_FAST(1);return void 0!==t.find(e=>this.tokenMatcher(n,e))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(t).includes(e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA_FAST(1),n=2;for(;;){const r=e.find(e=>fl(t,e));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(0===this.RULE_STACK_IDX)return wu;const e=this.currRuleShortName,t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK,n=this.RULE_STACK_IDX+1,r=new Array(n);for(let i=0;ithis.getFollowSetFromFollowKey(e)).flat()}getFollowSetFromFollowKey(e){if(e===wu)return[Ml];const t=e.ruleName+e.idxInCallingRule+Aa+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Ml)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA_FAST(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return t.slice(0,-1)}attemptInRepetitionRecovery(e,t,n,r,i,s,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){const e=this.RULE_STACK_IDX+1,t=new Array(e);for(let n=0;n{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:o}=function(e){Bu.reset(),e.accept(Bu);const t=Bu.dslMethods;return Bu.reset(),t}(e);t.forEach(t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${va(t)}${n}`,()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=Mu(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),n.forEach(t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,va(t))}),r.forEach(t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,va(t))}),i.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Ou,"RepetitionMandatory",t.maxLookahead,va(t))}),s.forEach(t=>{this.computeLookaheadFunc(e,t.idx,ku,"RepetitionMandatoryWithSeparator",t.maxLookahead,va(t))}),o.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Iu,"RepetitionWithSeparator",t.maxLookahead,va(t))})})})}computeLookaheadFunc(e,t,n,r,i,s){this.TRACE_INIT(`${s}${0===t?"":t}`,()=>{const s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=Mu(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,s)})}getKeyForAutomaticLookahead(e,t){return Mu(this.currRuleShortName,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:tc.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=$u,this.setNodeLocationFromNode=$u,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Uu,this.setNodeLocationFromNode=Uu,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{}}else this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{}}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA_FAST(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];var r,i,s;i=t,s=e,void 0===(r=n).children[s]?r.children[s]=[i]:r.children[s].push(i),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(void 0===this.baseCstVisitorConstructor){const e=function(e,t){const n=function(){};Gu(n,e+"BaseSemantics");const r={visit:function(e,t){if(Array.isArray(e)&&(e=e[0]),void 0!==e)return this[e.name](e.children,t)},validateVisitor:function(){const e=function(e,t){const n=function(e,t){return t.filter(t=>"function"==typeof e[t]==0).map(t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Wu.MISSING_METHOD,methodName:t})).filter(Boolean)}(e,t);return n}(this,t);if(0!==e.length){const t=e.map(e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(void 0===this.baseCstVisitorWithDefaultsConstructor){const e=function(e,t,n){const r=function(){};Gu(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return t.forEach(e=>{i[e]=Vu}),(r.prototype=i).constructor=r,r}(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):ec}LA_FAST(e){const t=this.currIdx+e;return this.tokVector[t]}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?ec:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=pl,this.subruleIdx=0,this.currRuleShortName=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(Array.isArray(e)){if(0===e.length)throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(Array.isArray(e))this.tokensMap=e.reduce((e,t)=>(e[t.name]=t,e),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(Sl)){const t=Object.values(e.modes).flat(),n=[...new Set(t)];this.tokensMap=n.reduce((e,t)=>(e[t.name]=t,e),{})}else{if("object"!=typeof e||null===e)throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=Object.assign({},e)}this.tokensMap.EOF=Ml;const n=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every(e=>{var t;return 0==(null===(t=e.categoryMatches)||void 0===t?void 0:t.length)});this.tokenMatcher=n?pl:fl,El(Object.values(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:nc.resyncEnabled,i=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:nc.recoveryValueFunc,s=this.ruleShortNameIdx<<12;let o;return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,o=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...t){this.onBeforeParse(e);try{return o.apply(this,t)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:t,coreRule:o})}invokeRuleCatch(e,t,n){const r=0===this.RULE_STACK_IDX,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(_u(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(Ou,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,Ou,e,Xl)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(ku,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Kl],t,ku,e,Kl)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let s=!0;for(;!0===i.call(this)&&!0===s;)s=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,jl,s)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(Iu,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,zl],t,Iu,e,zl)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,ku,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=Array.isArray(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX]),this.cstFinallyStateUpdate()}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.coreRule.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw _u(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA_FAST(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new bu(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===Fu?n:e}}}saveRecogState(){const e=this.errors,t=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);const t=e.RULE_STACK;for(let e=0;e=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX])}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=n,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ml)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let e=0;e${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:rc.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){var n;const r=null!==(n=e.coreRule)&&void 0!==n?n:e;return function(){this.isBackTrackingStack.push(1);const e=this.saveRecogState();try{return r.apply(this,t),!0}catch(e){if(_u(e))return!1;throw e}finally{this.reloadRecogState(e),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Object.values(this.gastProductionsCache).map(pa)}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:tc.errorMessageProvider}SAVE_ERROR(e){if(_u(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=lu(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],s=[];for(let e=1;e<=this.maxLookahead;e++)s.push(this.LA(e));const o=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:s,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new xu(o,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=au(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));const s=this.LA(0),o=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:s,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Tu(o,this.LA(1),s))}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const n=t>0?t:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return ec}topLevelRuleRecord(e,t){try{const n=new sa({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}}optionInternalRecord(e,t){return qu.call(this,aa,e,t)}atLeastOneInternalRecord(e,t){qu.call(this,la,t,e)}atLeastOneSepFirstInternalRecord(e,t){qu.call(this,ua,t,e,ju)}manyInternalRecord(e,t){qu.call(this,ca,t,e)}manySepFirstInternalRecord(e,t){qu.call(this,ha,t,e,ju)}orInternalRecord(e,t){return Qu.call(this,e,t)}subruleInternalRecord(e,t,n){if(Ju(t),!e||!Object.hasOwn(e,"ruleName")){const n=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=e.ruleName,s=new ia({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(s),this.outputCst?Yu:Hu}consumeInternalRecord(e,t,n){if(Ju(t),!Cl(e)){const n=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=new fa({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),Ku}},class{initPerformanceTracer(e){if(Object.hasOwn(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=tc.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()}}],sc.forEach(e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach(n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(ic.prototype,n,r):ic.prototype[n]=e.prototype[n]})});class ac extends oc{constructor(e,t=tc){const n=Object.assign({},t);n.outputCst=!1,super(e,n)}}function lc(e){return void 0!==e.lineNoCont?e.lineNoCont:e.startLine}class uc{visit(e){return e&&this[e.kind](e)}arraySpecifier(e){this.visit(e.size)}binaryExpression(e){this.visit(e.lhs),this.visit(e.rhs)}methodCall(e){this.visit(e.on),this.visit(e.functionCall)}functionCall(e){this.visit(e.callee);for(const t of e.args)this.visit(t)}arrayAccess(e){this.visit(e.on),this.visit(e.index)}translationUnit(e){for(const t of e.declarations)this.visit(t)}assignmentExpression(e){this.visit(e.lhs),this.visit(e.rhs)}fieldAccess(e){this.visit(e.on)}conditionalExpression(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}postfixExpression(e){this.visit(e.on)}commaExpression(e){this.visit(e.lhs),this.visit(e.rhs)}unaryExpression(e){this.visit(e.on)}functionDefinition(e){this.visit(e.returnType);for(const t of e.params)this.visit(t);this.visit(e.body)}functionPrototype(e){this.visit(e.returnType);for(const t of e.params)this.visit(t)}parameterDeclaration(e){this.visit(e.arraySpecifier),this.visit(e.typeSpecifier)}typeSpecifier(e){hc(e.typeSpecifierNonArray)&&this.visit(e.typeSpecifierNonArray),this.visit(e.arraySpecifier)}compoundStatement(e){for(const t of e.statements)this.visit(t)}returnStatement(e){this.visit(e.what)}continueStatement(e){}breakStatement(e){}discardStatement(e){}declarator(e){this.visit(e.arraySpecifier),this.visit(e.init)}doWhileStatement(e){this.visit(e.statement),this.visit(e.conditionExpression)}whileStatement(e){this.visit(e.conditionExpression),this.visit(e.statement)}forStatement(e){this.visit(e.initExpression),this.visit(e.conditionExpression),this.visit(e.loopExpression),this.visit(e.statement)}expressionStatement(e){this.visit(e.expression)}initDeclaratorListDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}precisionDeclaration(e){this.visit(e.typeSpecifierNoPrec)}selectionStatement(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}storageQualifier(e){}switchStatement(e){this.visit(e.initExpression);for(const t of e.cases)this.visit(t)}caseLabel(e){this.visit(e.case_)}caseBlock(e){this.visit(e.caseLabel);for(const t of e.statements)this.visit(t)}fullySpecifiedType(e){this.visit(e.typeQualifier),this.visit(e.typeSpecifier)}typeQualifier(e){this.visit(e.storageQualifier),this.visit(e.layoutQualifier)}structSpecifier(e){for(const t of e.declarations)this.visit(t)}layoutQualifier(e){}invariantDeclaration(e){}structDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}variableExpression(e){}constantExpression(e){}uniformBlock(e){this.visit(e.typeQualifier);for(const t of e.declarations)this.visit(t);this.visit(e.arraySpecifier)}ppDefine(e){this.visit(e.node)}ppDir(e){}ppExtension(e){}ppCall(e){}ppPragma(e){}}function cc(e){return"tokenType"in e}function hc(e){return"kind"in e}function dc(e,t){const n=e.split("\n"),r=t.startLine,i=t.endLine;return"./src/compiler.lambda:"+r+":"+(t.startColumn-1)+"\n"+n.map((e,t)=>[t+1,e]).slice(r-2,i+2).map(([e,n])=>{var s,o,a;return e>=r&&e<=i&&(s=n,o=6+(r===e?t.startColumn-1:0),a=6+(i===e?t.endColumn:n.length),n=s+"\n"+"-".repeat(o)+"^".repeat(a-o)),(""+e).padStart(5)+" "+n}).join("\n")}const fc=["active","asm","atomic_uint","attribute","cast","class","coherent","common","double","dvec2","dvec3","dvec4","enum","extern","external","filter","fixed","fvec2","fvec3","fvec4","goto","half","hvec2","hvec3","hvec4","iimage1D","iimage1DArray","iimage2D","iimage2DArray","iimage3D","iimageBuffer","iimageCube","image1D","image1DArray","image2D","image2DArray","image3D","imageBuffer","imageCube","inline","input","interface","isampler1D","isampler1DArray","isampler2DMS","isampler2DMSArray","isampler2DRect","isamplerBuffer","long","namespace","noinline","noperspective","output","partition","patch","public","readonly","resource","restrict","sample","sampler1D","sampler1DArray","sampler1DArrayShadow","sampler1DShadow","sampler2DMS","sampler2DMSArray","sampler2DRect","sampler2DRectShadow","sampler3DRect","samplerBuffer","short","sizeof","static","subroutine","superp","template","this","typedef","uimage1D","uimage1DArray","uimage2D","uimage2DArray","uimage3D","uimageBuffer","uimageCube","union","unsigned","usampler1D","usampler1DArray","usampler2DMS","usampler2DMSArray","usampler2DRect","usamplerBuffer","using","volatile","volatile","writeonly"];var pc;!function(e){e.ASSIGN_OP=kl({name:"ASSIGN_OP",pattern:yl.NA}),e.UNARY_OP=kl({name:"UNARY_OP",pattern:yl.NA}),e.POSTFIX_OP=kl({name:"POSTFIX_OP",pattern:yl.NA}),e.PRECISION_QUALIFIER=kl({name:"PRECISION_QUALIFIER",pattern:yl.NA}),e.INTERPOLATION_QUALIFIER=kl({name:"INTERPOLATION_QUALIFIER",pattern:yl.NA}),e.MULTIPLICATIVE_OP=kl({name:"MULTIPLICATIVE_OP",pattern:yl.NA}),e.ADDITIVE_OP=kl({name:"ADDITIVE_OP",pattern:yl.NA}),e.SHIFT_OP=kl({name:"SHIFT_OP",pattern:yl.NA}),e.RELATIONAL_OP=kl({name:"RELATIONAL_OP",pattern:yl.NA}),e.EQUALITY_OP=kl({name:"EQUALITY_OP",pattern:yl.NA}),e.PARAMETER_QUALIFIER=kl({name:"PARAMETER_QUALIFIER",pattern:yl.NA}),e.WHITESPACE=kl({name:"WHITESPACE",pattern:/\s+/,group:yl.SKIPPED}),e.LINE_COMMENT=kl({name:"LINE_COMMENT",pattern:/\/\/[^\r\n]*/,group:"COMMENTS"}),e.MULTILINE_COMMENT=kl({name:"MULTILINE_COMMENT",pattern:/\/\*[\s\S]*?\*\//,group:"COMMENTS"}),e.MULASSIGN=kl({name:"MULASSIGN",pattern:"*=",label:"'*='",categories:e.ASSIGN_OP}),e.DIVASSIGN=kl({name:"DIVASSIGN",pattern:"/=",label:"'/='",categories:e.ASSIGN_OP}),e.MODASSIGN=kl({name:"MODASSIGN",pattern:"%=",label:"'%='",categories:e.ASSIGN_OP}),e.ADDASSIGN=kl({name:"ADDASSIGN",pattern:"+=",label:"'+='",categories:e.ASSIGN_OP}),e.SUBASSIGN=kl({name:"SUBASSIGN",pattern:"-=",label:"'-='",categories:e.ASSIGN_OP}),e.LEFTASSIGN=kl({name:"LEFTASSIGN",pattern:"<<=",label:"'<<='",categories:e.ASSIGN_OP}),e.RIGHTASSIGN=kl({name:"RIGHTASSIGN",pattern:">>=",label:"'>>='",categories:e.ASSIGN_OP}),e.ANDASSIGN=kl({name:"ANDASSIGN",pattern:"&=",label:"'&='",categories:e.ASSIGN_OP}),e.XORASSIGN=kl({name:"XORASSIGN",pattern:"^=",label:"'^='",categories:e.ASSIGN_OP}),e.ORASSIGN=kl({name:"ORASSIGN",pattern:"|=",label:"'|='",categories:e.ASSIGN_OP}),e.INC_OP=kl({name:"INC_OP",pattern:"++",label:"'++'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.QUESTION=kl({name:"QUESTION",pattern:"?",label:"'?'"}),e.COLON=kl({name:"COLON",pattern:":",label:"':'"}),e.DEC_OP=kl({name:"DEC_OP",pattern:"--",label:"'--'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.AND_OP=kl({name:"AND_OP",pattern:"&&",label:"'&&'"}),e.XOR_OP=kl({name:"XOR_OP",pattern:"^^",label:"'^^'"}),e.OR_OP=kl({name:"OR_OP",pattern:"||",label:"'||'"}),e.LEFT_OP=kl({name:"LEFT_OP",pattern:"<<",label:"'<<'",categories:e.SHIFT_OP}),e.RIGHT_OP=kl({name:"RIGHT_OP",pattern:">>",label:"'>>'",categories:e.SHIFT_OP}),e.EQ_OP=kl({name:"EQ_OP",pattern:"==",label:"'=='",categories:e.EQUALITY_OP}),e.NE_OP=kl({name:"NE_OP",pattern:"!=",label:"'!='",categories:e.EQUALITY_OP}),e.LE_OP=kl({name:"LE_OP",pattern:"<=",label:"'<='",categories:e.RELATIONAL_OP}),e.GE_OP=kl({name:"GE_OP",pattern:">=",label:"'>='",categories:e.RELATIONAL_OP}),e.LEFT_ANGLE=kl({name:"LEFT_ANGLE",pattern:"<",label:"'<'",categories:e.RELATIONAL_OP}),e.RIGHT_ANGLE=kl({name:"RIGHT_ANGLE",pattern:">",label:"'>'",categories:e.RELATIONAL_OP}),e.PLUS=kl({name:"PLUS",pattern:"+",label:"'+'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.TILDE=kl({name:"TILDE",pattern:"~",label:"'~'",categories:e.UNARY_OP}),e.BANG=kl({name:"BANG",pattern:"!",label:"'!'",categories:e.UNARY_OP}),e.CARET=kl({name:"CARET",pattern:"^",label:"'^'"}),e.AMPERSAND=kl({name:"AND",pattern:"&",label:"'&'"}),e.VERTICAL_BAR=kl({name:"VERTICAL_BAR",pattern:"|",label:"'|'"}),e.SLASH=kl({name:"SLASH",pattern:"/",label:"'/'",categories:e.MULTIPLICATIVE_OP}),e.PERCENT=kl({name:"PERCENT",pattern:"%",label:"'%'",categories:e.MULTIPLICATIVE_OP}),e.STAR=kl({name:"STAR",pattern:"*",label:"'*'",categories:e.MULTIPLICATIVE_OP}),e.DASH=kl({name:"DASH",pattern:"-",label:"'-'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.COMMA=kl({name:"COMMA",pattern:",",label:"','"}),e.EQUAL=kl({name:"EQUAL",pattern:"=",label:"'='",categories:e.ASSIGN_OP}),e.LEFT_PAREN=kl({name:"LEFT_PAREN",pattern:"(",label:"'('"}),e.RIGHT_PAREN=kl({name:"RIGHT_PAREN",pattern:")",label:"')'"}),e.LEFT_BRACKET=kl({name:"LEFT_BRACKET",pattern:"[",label:"'['"}),e.RIGHT_BRACKET=kl({name:"RIGHT_BRACKET",pattern:"]",label:"']'"}),e.LEFT_BRACE=kl({name:"LEFT_BRACE",pattern:"{",label:"'{'"}),e.RIGHT_BRACE=kl({name:"RIGHT_BRACE",pattern:"}",label:"'}'"}),e.SEMICOLON=kl({name:"SEMICOLON",pattern:";",label:"';'"}),e.IDENTIFIER=kl({name:"IDENTIFIER",pattern:yl.NA}),e.NON_PP_IDENTIFIER=kl({name:"NON_PP_IDENTIFIER",pattern:/[a-z_]\w*/i,categories:e.IDENTIFIER}),e.PP=kl({name:"PP",pattern:yl.NA,categories:e.IDENTIFIER});const t=(t,n)=>kl({name:t,pattern:n,categories:e.PP,longer_alt:e.NON_PP_IDENTIFIER});e.DEFINE=t("DEFINE","define"),e.UNDEF=t("UNDEF","undef"),e.ENDIF=t("ENDIF","endif"),e.IFDEF=t("IFDEF","ifdef"),e.IFNDEF=t("IFNDEF","ifndef"),e.ELIF=t("ELIF","elif"),e.ERROR=t("ERROR","error"),e.VERSION=t("VERSION","version"),e.PRAGMA_DIRECTIVE=kl({name:"PRAGMA_DIRECTIVE",pattern:/#\s*pragma\s+[^\r\n]*/}),e.LINE=t("LINE","line"),e.EXTENSION=t("EXTENSION","extension"),e.INCLUDE=t("INCLUDE","include"),e.HASH_INCLUDE_MODULE=kl({name:"HASH_INCLUDE_MODULE",pattern:/#\s*include\s*<[\w\-./\\$@ ]+>/}),e.HASH=kl({name:"HASH",pattern:"#"}),e.KEYWORD=kl({name:"KEYWORD",pattern:yl.NA});const n=(t,n)=>kl({name:t,pattern:t.toLowerCase(),label:"'"+t.toLowerCase()+"'",longer_alt:e.NON_PP_IDENTIFIER,categories:n?[e.KEYWORD,n]:e.KEYWORD});e.CONST=n("CONST"),e.UNIFORM=n("UNIFORM"),e.LAYOUT=n("LAYOUT"),e.CENTROID=n("CENTROID"),e.FLAT=n("FLAT",e.INTERPOLATION_QUALIFIER),e.SMOOTH=n("SMOOTH",e.INTERPOLATION_QUALIFIER),e.BREAK=n("BREAK"),e.CONTINUE=n("CONTINUE"),e.DO=n("DO"),e.PRECISION=n("PRECISION"),e.FOR=n("FOR"),e.WHILE=n("WHILE"),e.SWITCH=n("SWITCH"),e.CASE=n("CASE"),e.DEFAULT=n("DEFAULT"),e.IF=n("IF"),e.ELSE=n("ELSE"),e.INVARIANT=n("INVARIANT"),e.INOUT=n("INOUT",e.PARAMETER_QUALIFIER),e.OUT=n("OUT",e.PARAMETER_QUALIFIER),e.VOID=n("VOID"),e.STRUCT=n("STRUCT"),e.DISCARD=n("DISCARD"),e.RETURN=n("RETURN"),e.LOWP=n("LOWP",e.PRECISION_QUALIFIER),e.MEDIUMP=n("MEDIUMP",e.PRECISION_QUALIFIER),e.HIGHP=n("HIGHP",e.PRECISION_QUALIFIER),e.CONSTANT=kl({name:"CONSTANT",pattern:yl.NA}),e.BASIC_TYPE=kl({name:"BASIC_TYPE",pattern:yl.NA});const r=t=>kl({name:t.toUpperCase(),pattern:t,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE});e.BOOL=r("bool"),e.INT=r("int"),e.FLOAT=r("float"),e.MAT2X3=r("mat2x3"),e.MAT2X4=r("mat2x4"),e.MAT2X2=kl({name:"mat2x2".toUpperCase(),pattern:/mat2(?:x2)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat2"}),e.MAT3X2=r("mat3x2"),e.MAT3X4=r("mat3x4"),e.MAT3X3=kl({name:"mat3x3".toUpperCase(),pattern:/mat3(?:x3)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat3"}),e.MAT4X2=r("mat4x2"),e.MAT4X3=r("mat4x3"),e.MAT4X4=kl({name:"MAT4X4",pattern:/mat4(?:x4)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat4"}),e.VEC2=r("vec2"),e.VEC3=r("vec3"),e.VEC4=r("vec4"),e.IVEC2=r("ivec2"),e.IVEC3=r("ivec3"),e.IVEC4=r("ivec4"),e.BVEC2=r("bvec2"),e.BVEC3=r("bvec3"),e.BVEC4=r("bvec4"),e.UINT=r("uint"),e.UVEC2=r("uvec2"),e.UVEC3=r("uvec3"),e.UVEC4=r("uvec4"),e.USAMPLERCUBE=r("usamplerCube"),e.USAMPLER3D=r("usampler3D"),e.USAMPLER2DARRAY=r("usampler2DArray"),e.USAMPLER2D=r("usampler2D"),e.SAMPLERCUBESHADOW=r("samplerCubeShadow"),e.SAMPLERCUBE=r("samplerCube"),e.SAMPLER3D=r("sampler3D"),e.SAMPLER2DSHADOW=r("sampler2DShadow"),e.SAMPLER2DARRAYSHADOW=r("sampler2DArrayShadow"),e.SAMPLER2DARRAY=r("sampler2DArray"),e.SAMPLER2D=r("sampler2D"),e.ISAMPLERCUBE=r("isamplerCube"),e.ISAMPLER3D=r("isampler3D"),e.ISAMPLER2DARRAY=r("isampler2DArray"),e.ISAMPLER2D=r("isampler2D"),e.IN=n("IN",e.PARAMETER_QUALIFIER),e.VARYING=n("VARYING"),e.ATTRIBUTE=n("ATTRIBUTE"),e.BOOLCONSTANT=kl({name:"BOOLCONSTANT",pattern:/true|false/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.CONSTANT}),e.FLOATCONSTANT=kl({name:"FLOATCONSTANT",pattern:/((\d+\.\d*|\.\d+)(e[+-]?\d+)?|\d+e[+-]?\d+)f?/i,categories:e.CONSTANT}),e.DOT=kl({name:"DOT",pattern:".",label:"'.'"}),e.UINTCONSTANT=kl({name:"UINTCONSTANT",pattern:/0x[\da-f]+u|\d+u/i,categories:e.CONSTANT}),e.INTCONSTANT=kl({name:"INTCONSTANT",pattern:/0x[\da-f]+|\d+/i,categories:e.CONSTANT}),e.STRING=kl({name:"STRING",pattern:/"([^"\\]+|\\")+"/})}(pc||(pc={}));const mc=Object.values(pc).filter(e=>e!==pc.NON_PP_IDENTIFIER).flatMap(e=>Array.isArray(e)?e:[e]);mc.push(pc.NON_PP_IDENTIFIER);const gc=new yl(mc,{ensureOptimizations:!1});new class extends uc{constructor(){super(...arguments),this.markError=()=>{}}eval(e,t,n){return this.isDefined=t,this.markError=n,super.visit(e)}constantExpression(e){if(e.const_.tokenType!==pc.INTCONSTANT)throw new Error("XX");return+e.const_.image}unaryExpression(e){switch(e.op.tokenType){case pc.NON_PP_IDENTIFIER:return+this.isDefined(e.on.var.image);case pc.DASH:return-this.visit(e.on);case pc.TILDE:return~this.visit(e.on);case pc.BANG:return+!this.visit(e.on);case pc.PLUS:return this.visit(e.on);default:throw new Error(e.op.tokenType.name)}}binaryExpression(e){const t=this.visit(e.lhs);switch(e.op.tokenType){case pc.AND_OP:return t&&this.visit(e.rhs);case pc.OR_OP:return t||this.visit(e.rhs);default:{const n=this.visit(e.rhs);return 0|function(e,t,n){switch(e){case pc.PLUS:return t+n;case pc.DASH:return t-n;case pc.STAR:return t*n;case pc.PERCENT:return t%n;case pc.SLASH:return t/n;case pc.LEFT_OP:return t<>n;case pc.EQ_OP:return t===n;case pc.NE_OP:return t!==n;case pc.LE_OP:return t<=n;case pc.GE_OP:return t>=n;case pc.LEFT_ANGLE:return tn;case pc.XOR_OP:return t!==n;case pc.AND_OP:return t&&n;case pc.OR_OP:return t||n;case pc.AMPERSAND:return t&n;case pc.CARET:return t^n;case pc.VERTICAL_BAR:return t|n;default:throw new Error}}(e.op.tokenType,t,n)}}}variableExpression(e){return this.markError("P0001",e.var,"undefined identifier "+e.var.image),0}};const Ec=new class extends ac{getTokensOnLine(){const e=[],t=lc(this.LA(0));let n;for(;lc(n=this.LA(1))===t;)e.push(n),this.SKIP_TOKEN();return e}constructor(){super(mc,{skipValidations:!0}),this.multiplicativeExpression=this.RR("multiplicativeExpression",()=>this.LEFT_ASSOC(this.preprocessing?this.ppUnaryExpression:this.unaryExpression,pc.MULTIPLICATIVE_OP)),this.additiveExpression=this.RR("additiveExpression",()=>this.LEFT_ASSOC(this.multiplicativeExpression,pc.ADDITIVE_OP)),this.shiftExpression=this.RR("shiftExpression",()=>this.LEFT_ASSOC(this.additiveExpression,pc.SHIFT_OP)),this.relationalExpression=this.RR("relationalExpression",()=>this.LEFT_ASSOC(this.shiftExpression,pc.RELATIONAL_OP)),this.equalityExpression=this.RR("equalityExpression",()=>this.LEFT_ASSOC(this.relationalExpression,pc.EQUALITY_OP)),this.andExpression=this.RR("andExpression",()=>this.LEFT_ASSOC(this.equalityExpression,pc.AMPERSAND)),this.exclusiveOrExpression=this.RR("exclusiveOrExpression",()=>this.LEFT_ASSOC(this.andExpression,pc.CARET)),this.inclusiveOrExpression=this.RR("inclusiveOrExpression",()=>this.LEFT_ASSOC(this.exclusiveOrExpression,pc.VERTICAL_BAR)),this.logicalAndExpression=this.RR("logicalAndExpression",()=>this.LEFT_ASSOC(this.inclusiveOrExpression,pc.AND_OP)),this.logicalXorExpression=this.RR("logicalXorExpression",()=>this.LEFT_ASSOC(this.logicalAndExpression,pc.XOR_OP)),this.logicalOrExpression=this.RR("logicalOrExpression",()=>this.LEFT_ASSOC(this.logicalXorExpression,pc.OR_OP)),this.assignmentExpression=this.RR("assignmentExpression",()=>{const e=this.SUBRULE(this.conditionalExpression);return this.OPTION(()=>{const t=this.CONSUME(pc.ASSIGN_OP),n=this.SUBRULE1(this.assignmentExpression);return{kind:"assignmentExpression",lhs:e,op:t,rhs:n}})??e}),this.expression=this.RR("expression",()=>{let e;return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.SUBRULE(this.assignmentExpression);return e=e?{kind:"commaExpression",lhs:e,rhs:t}:t}}),e}),this.conditionalExpression=this.RR("conditionalExpression",()=>{const e=this.SUBRULE1(this.logicalOrExpression);return this.OPTION(()=>({kind:"conditionalExpression",condition:e,QUESTION:this.CONSUME(pc.QUESTION),yes:this.SUBRULE2(this.expression),COLON:this.CONSUME(pc.COLON),no:this.SUBRULE3(this.assignmentExpression)}))??e}),this.switchStatement=this.RR("switchStatement",()=>{this.CONSUME(pc.SWITCH),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);this.CONSUME(pc.RIGHT_PAREN),this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.caseBlock))),this.CONSUME(pc.RIGHT_BRACE),{kind:"switchStatement",initExpression:e,cases:t}}),this.caseBlock=this.RR("caseBlock",()=>{const e=this.SUBRULE(this.caseLabel),t=[];return this.MANY1(()=>t.push(this.SUBRULE(this.statement))),{kind:"caseBlock",caseLabel:e,statements:t}}),this.jumpStatement=this.RR("jumpStatement",()=>{const e=this.OR([{ALT:()=>(this.CONSUME(pc.CONTINUE),{kind:"continueStatement"})},{ALT:()=>(this.CONSUME(pc.BREAK),{kind:"breakStatement"})},{ALT:()=>(this.CONSUME(pc.DISCARD),{kind:"discardStatement"})},{ALT:()=>(this.CONSUME(pc.RETURN),{kind:"returnStatement",what:this.OPTION(()=>this.SUBRULE(this.expression))})}]);return this.CONSUME(pc.SEMICOLON),e}),this.primaryExpression=this.RR("primaryExpression",()=>this.OR([{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),e}},{ALT:()=>({kind:"variableExpression",var:this.CONSUME(pc.IDENTIFIER)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.CONSTANT)})}])),this.constantExpression=this.RR("constantExpression",()=>this.SUBRULE(this.conditionalExpression)),this.layoutQualifier=this.RR("layoutQualifier",()=>{this.CONSUME(pc.LAYOUT),this.CONSUME(pc.LEFT_PAREN);const e=[];return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.CONSUME(pc.IDENTIFIER);let n;this.OPTION(()=>{this.CONSUME(pc.EQUAL),n=this.OR([{ALT:()=>this.CONSUME(pc.INTCONSTANT)},{ALT:()=>this.CONSUME(pc.UINTCONSTANT)}])}),e.push({IDENTIFIER:t,init:n})}}),this.CONSUME(pc.RIGHT_PAREN),{kind:"layoutQualifier",layoutQualifierIds:e}}),this.storageQualifier=this.RR("storageQualifier",()=>{let e,t,n,r,i,s,o;return this.OR([{ALT:()=>e=this.CONSUME(pc.CONST)},{ALT:()=>{t=this.OPTION(()=>this.CONSUME(pc.CENTROID)),this.OR9([{ALT:()=>n=this.CONSUME(pc.IN)},{ALT:()=>r=this.CONSUME(pc.OUT)},{ALT:()=>s=this.CONSUME(pc.VARYING)},{ALT:()=>o=this.CONSUME(pc.ATTRIBUTE)}])}},{ALT:()=>i=this.CONSUME(pc.UNIFORM)}]),{kind:"storageQualifier",CONST:e,CENTROID:t,IN:n,OUT:r,VARYING:s,ATTRIBUTE:o,UNIFORM:i}}),this.typeQualifier=this.RR("typeQualifier",()=>{let e,t,n,r;return this.OR([{ALT:()=>e=this.SUBRULE(this.storageQualifier)},{ALT:()=>{t=this.SUBRULE1(this.layoutQualifier),e=this.OPTION1(()=>this.SUBRULE2(this.storageQualifier))}},{ALT:()=>{n=this.CONSUME(pc.INTERPOLATION_QUALIFIER),e=this.OPTION2(()=>this.SUBRULE3(this.storageQualifier))}},{ALT:()=>{r=this.CONSUME(pc.INVARIANT),n=this.OPTION3(()=>this.CONSUME1(pc.INTERPOLATION_QUALIFIER)),e=this.SUBRULE7(this.storageQualifier)}}]),{kind:"typeQualifier",storageQualifier:e,layoutQualifier:t,interpolationQualifier:n,invariantQualifier:r}}),this.precisionQualifier=this.RR("precisionQualifier",()=>this.CONSUME(pc.PRECISION_QUALIFIER)),this.arraySpecifier=this.RR("arraySpecifier",()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.OPTION3(()=>this.SUBRULE(this.constantExpression));return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arraySpecifier",size:e}}),this.typeSpecifierNonArray=this.RR("typeSpecifierNonArray",()=>this.OR([{ALT:()=>this.CONSUME(pc.BASIC_TYPE)},{ALT:()=>this.CONSUME(pc.VOID)},{ALT:()=>this.SUBRULE(this.structSpecifier)},{ALT:()=>this.CONSUME(pc.IDENTIFIER)}])),this.typeSpecifierNoPrec=this.RR("typeSpecifierNoPrec",()=>{const e=this.SUBRULE(this.typeSpecifierNonArray);return{kind:"typeSpecifier",precisionQualifier:void 0,arraySpecifier:this.OPTION1(()=>this.SUBRULE(this.arraySpecifier)),typeSpecifierNonArray:e}}),this.functionCall=this.RR("functionCall",()=>{const e=this.SUBRULE(this.typeSpecifierNoPrec);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({DEF:()=>t.push(this.SUBRULE(this.assignmentExpression)),SEP:pc.COMMA}),this.CONSUME(pc.RIGHT_PAREN),{kind:"functionCall",callee:e,args:t}}),this.functionCallHeader=this.RULE("functionCallHeader",()=>{this.SUBRULE(this.typeSpecifierNoPrec),this.CONSUME(pc.LEFT_PAREN)}),this.postfixExpression=this.RR("postfixExpression",()=>{const e=this.LA(1);let t=this.OR1([{GATE:this.BACKTRACK(this.functionCallHeader),ALT:()=>this.SUBRULE1(this.functionCall)},{ALT:()=>this.SUBRULE(this.primaryExpression)}]);return this.MANY(()=>{t=this.OR2([{ALT:()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arrayAccess",on:t,index:e}}},{ALT:()=>{this.CONSUME1(pc.DOT);const e=this.SUBRULE2(this.functionCall);return{kind:"methodCall",on:t,functionCall:e}}},{ALT:()=>{this.CONSUME2(pc.DOT);const e=this.CONSUME(pc.IDENTIFIER);return{kind:"fieldAccess",on:t,field:e}}},{ALT:()=>{const e=this.CONSUME(pc.POSTFIX_OP);return{kind:"postfixExpression",on:t,op:e}}}]),this.FINALIZE(t,e)}),t}),this.unaryExpression=this.RR("unaryExpression",()=>this.OR([{ALT:()=>this.SUBRULE1(this.postfixExpression)},{ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.UNARY_OP),on:this.SUBRULE2(this.unaryExpression)})}])),this.ppUnaryExpression=this.RR("ppUnaryExpression",()=>this.OR([{GATE:()=>this.LA(1).tokenType===pc.NON_PP_IDENTIFIER&&"defined"===this.LA(1).image,ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.IDENTIFIER),on:{kind:"variableExpression",var:this.OR1([{ALT:()=>this.SUBRULE(this.ppIdentifier)},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE1(this.ppIdentifier);return this.CONSUME(pc.RIGHT_PAREN),e}}])}})},{ALT:()=>({kind:"unaryExpression",op:this.OR2([{ALT:()=>this.CONSUME(pc.PLUS)},{ALT:()=>this.CONSUME(pc.DASH)},{ALT:()=>this.CONSUME(pc.TILDE)},{ALT:()=>this.CONSUME(pc.BANG)}]),on:this.SUBRULE2(this.ppUnaryExpression)})},{ALT:()=>this.SUBRULE(this.ppPrimaryExpression)}])),this.ppPrimaryExpression=this.RR("ppPrimaryExpression",()=>this.OR([{ALT:()=>({kind:"variableExpression",var:this.SUBRULE(this.ppIdentifier)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.INTCONSTANT)})},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.ppConstantExpression);return this.CONSUME(pc.RIGHT_PAREN),e}}])),this.ppConstantExpression=this.RR("ppConstantExpression",()=>{try{return this.preprocessing=!0,this.LEFT_ASSOC(this.logicalAndExpression,pc.OR_OP)}finally{this.preprocessing=!1}}),this.typeSpecifier=this.RR("typeSpecifier",()=>{const e=this.OPTION(()=>this.SUBRULE(this.precisionQualifier)),t=this.SUBRULE(this.typeSpecifierNoPrec);return Object.assign({},t,{precisionQualifier:e})}),this.parameterDeclaration=this.RR("parameterDeclaration",()=>{const e=this.OPTION(()=>this.CONSUME(pc.CONST)),t=this.OPTION1(()=>this.CONSUME(pc.PARAMETER_QUALIFIER)),n=this.SUBRULE(this.typeSpecifier);let r,i;return this.OPTION2(()=>{r=this.CONSUME2(pc.IDENTIFIER),i=this.OPTION3(()=>this.SUBRULE(this.arraySpecifier))}),{kind:"parameterDeclaration",parameterTypeQualifier:e,pName:r,arraySpecifier:i,parameterQualifier:t,typeSpecifier:n}}),this.fullySpecifiedType=this.RR("fullySpecifiedType",()=>({kind:"fullySpecifiedType",typeQualifier:this.OPTION(()=>this.SUBRULE(this.typeQualifier)),typeSpecifier:this.SUBRULE(this.typeSpecifier)})),this.structDeclaration=this.RR("structDeclaration",()=>{const e=this.SUBRULE(this.fullySpecifiedType),t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME(pc.IDENTIFIER),arraySpecifier:this.OPTION(()=>this.SUBRULE(this.arraySpecifier)),init:void 0};return t.push(e),e})}),this.CONSUME(pc.SEMICOLON),{kind:"structDeclaration",fsType:e,declarators:t}}),this.structSpecifier=this.RR("structSpecifier",()=>{this.CONSUME(pc.STRUCT);const e=this.OPTION2(()=>this.CONSUME(pc.IDENTIFIER));this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),{kind:"structSpecifier",name:e,declarations:t}}),this.initializer=this.RR("initializer",()=>this.SUBRULE(this.assignmentExpression)),this.singleDeclaration=this.RULE("singleDeclaration",()=>this.OR([{ALT:()=>{this.SUBRULE(this.fullySpecifiedType),this.OPTION1(()=>{this.CONSUME1(pc.IDENTIFIER),this.OPTION2(()=>{this.CONSUME(pc.LEFT_BRACKET),this.OPTION3(()=>this.SUBRULE(this.constantExpression)),this.CONSUME(pc.RIGHT_BRACKET)}),this.OPTION4(()=>{this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)})})}},{ALT:()=>({kind:"invariantDeclaration",INVARIANT:this.CONSUME(pc.INVARIANT),IDENTIFIER:this.CONSUME2(pc.IDENTIFIER)})}])),this.initDeclaratorList=this.RR("initDeclaratorList",()=>this.SUBRULE(this.externalDeclaration,{ARGS:[!1,!1]})),this.expressionStatement=this.RR("expressionStatement",()=>{const e=this.OPTION(()=>this.SUBRULE(this.expression));return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:e}}),this.condition=this.RR("condition",()=>this.OR({MAX_LOOKAHEAD:4,DEF:[{GATE:this.BACKTRACK(this.singleDeclaration),ALT:()=>{const e=this.SUBRULE2(this.fullySpecifiedType),t=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.EQUAL),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:[{kind:"declarator",name:t,init:this.SUBRULE3(this.initializer),arraySpecifier:void 0}]}}},{ALT:()=>this.SUBRULE(this.expression)}]})),this.caseLabel=this.RR("caseLabel",()=>this.OR([{ALT:()=>{this.CONSUME(pc.CASE);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.COLON),{kind:"caseLabel",case_:e}}},{ALT:()=>(this.CONSUME2(pc.DEFAULT),this.CONSUME2(pc.COLON),{kind:"caseLabel",case_:void 0})}])),this.selectionStatement=this.RR("selectionStatement",()=>{this.CONSUME(pc.IF),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),{kind:"selectionStatement",condition:e,yes:this.SUBRULE2(this.statement,{ARGS:[!0]}),no:this.OPTION(()=>(this.CONSUME(pc.ELSE),this.SUBRULE3(this.statement,{ARGS:[!0]})))}}),this.statement=this.RR("statement",e=>this.OR([{ALT:()=>this.SUBRULE(this.ppDirective),IGNORE_AMBIGUITIES:!0},{ALT:()=>{const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:{kind:"variableExpression",var:e}}},IGNORE_AMBIGUITIES:!0},{GATE:this.BACKTRACK(this.expressionStatement),ALT:()=>this.SUBRULE(this.expressionStatement)},{ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.selectionStatement)},{ALT:()=>this.SUBRULE(this.switchStatement)},{ALT:()=>this.SUBRULE(this.iterationStatement)},{ALT:()=>this.SUBRULE(this.jumpStatement)},{ALT:()=>this.SUBRULE(this.compoundStatement,{ARGS:[!!e]})}])),this.compoundStatement=this.RR("compoundStatement",e=>{if("object"==typeof e)throw new Error;this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.statement))),this.CONSUME(pc.RIGHT_BRACE),{kind:"compoundStatement",statements:t,newScope:!!e}}),this.iterationStatement=this.RR("iterationStatement",()=>this.OR([{ALT:()=>{this.CONSUME(pc.WHILE),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.condition);return this.CONSUME(pc.RIGHT_PAREN),{kind:"whileStatement",conditionExpression:e,statement:this.SUBRULE(this.statement)}}},{ALT:()=>{this.CONSUME2(pc.DO);const e=this.SUBRULE2(this.statement,{ARGS:[!0]});this.CONSUME2(pc.WHILE),this.CONSUME2(pc.LEFT_PAREN);const t=this.SUBRULE2(this.expression);return this.CONSUME2(pc.RIGHT_PAREN),this.CONSUME2(pc.SEMICOLON),{kind:"doWhileStatement",statement:e,conditionExpression:t}}},{ALT:()=>{this.CONSUME3(pc.FOR),this.CONSUME3(pc.LEFT_PAREN);const e=this.OR3([{GATE:this.BACKTRACK(this.initDeclaratorList),ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.expressionStatement)}]),t=this.OPTION3(()=>this.SUBRULE3(this.condition));this.CONSUME4(pc.SEMICOLON);const n=this.OPTION4(()=>this.SUBRULE4(this.expression));return this.CONSUME3(pc.RIGHT_PAREN),{kind:"forStatement",initExpression:e,conditionExpression:t,loopExpression:n,statement:this.SUBRULE3(this.statement)}}}])),this.translationUnit=this.RR("translationUnit",()=>{const e=[];return this.AT_LEAST_ONE(()=>e.push(this.SUBRULE(this.externalDeclaration,{ARGS:[!0,!0]}))),{kind:"translationUnit",declarations:e}}),this.uniformBlock=this.RR("uniformBlock",()=>{const e=this.SUBRULE(this.typeQualifier),t=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_BRACE);const n=[];let r,i;return this.MANY(()=>n.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),this.OPTION(()=>{r=this.CONSUME1(pc.IDENTIFIER),i=this.OPTION1(()=>this.SUBRULE(this.arraySpecifier))}),this.CONSUME(pc.SEMICOLON),{kind:"uniformBlock",typeQualifier:e,blockName:t,declarations:n,namespace:r,arraySpecifier:i}}),this.uniformBlockHeader=this.RULE("uniformBlockHeader",()=>{this.OPTION(()=>this.SUBRULE(this.layoutQualifier)),this.CONSUME(pc.UNIFORM),this.CONSUME(pc.IDENTIFIER),this.CONSUME(pc.LEFT_BRACE)}),this.typeQualifierDeclaration=this.RR("typeQualifierDeclaration",()=>{const e=this.SUBRULE(this.typeQualifier);return this.CONSUME(pc.SEMICOLON),{kind:"typeQualifierDeclaration",typeQualifier:e}}),this.externalDeclaration=this.RR("externalDeclaration",(e,t)=>this.OR([{ALT:()=>this.SUBRULE(this.ppCall)},{ALT:()=>this.SUBRULE(this.ppDirective)},{GATE:this.BACKTRACK(this.typeQualifierDeclaration),ALT:()=>this.SUBRULE(this.typeQualifierDeclaration)},{GATE:e?this.BACKTRACK(this.uniformBlockHeader):()=>!1,ALT:()=>this.SUBRULE(this.uniformBlock)},{ALT:()=>{const e=this.SUBRULE(this.fullySpecifiedType);return this.OR2([{GATE:t?void 0:()=>!1,ALT:()=>{const t=this.CONSUME1(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const n=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>n.push(this.SUBRULE(this.parameterDeclaration))}),this.CONSUME(pc.RIGHT_PAREN),this.OR3([{ALT:()=>(this.CONSUME(pc.SEMICOLON),{kind:"functionPrototype",name:t,returnType:e,params:n})},{ALT:()=>{const r=this.SUBRULE(this.compoundStatement);return{kind:"functionDefinition",name:t,returnType:e,params:n,body:r}},IGNORE_AMBIGUITIES:!1}])}},{ALT:()=>{const t=[];return this.MANY_SEP2({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME3(pc.IDENTIFIER),arraySpecifier:this.OPTION5(()=>this.SUBRULE(this.arraySpecifier)),init:this.OPTION7(()=>(this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)))};return t.push(e),e})}),this.CONSUME2(pc.SEMICOLON),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:t}}}])}},{ALT:()=>{this.CONSUME(pc.PRECISION);const e=this.CONSUME(pc.PRECISION_QUALIFIER),t=this.SUBRULE(this.typeSpecifierNoPrec);return this.CONSUME3(pc.SEMICOLON),{kind:"precisionDeclaration",precisionQualifier:e,typeSpecifierNoPrec:t}}}])),this.ppDefine=this.RR("ppDefine",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.DEFINE);const e=this.CONSUME(pc.IDENTIFIER),t=this.LA(1).tokenType===pc.LEFT_PAREN&&e.endOffset+1===this.LA(1).startOffset,n={kind:"ppDefine",what:e,params:this.OPTION({GATE:()=>t,DEF:()=>{this.CONSUME(pc.LEFT_PAREN);const e=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>e.push(this.SUBRULE(this.ppIdentifier))}),this.CONSUME(pc.RIGHT_PAREN),e}}),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(n),n}),this.ppInclude=this.RR("ppInclude",()=>{let e="";return this.OR([{ALT:()=>{const t=this.CONSUME(pc.HASH_INCLUDE_MODULE);e=t.image.substring(t.image.indexOf("<"))}},{ALT:()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.INCLUDE),e=this.CONSUME(pc.STRING).image}}]),{kind:"ppInclude",what:e}}),this.ppCall=this.RR("ppCall",()=>{const e=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>{const e=[];this.MANY(()=>this.OR({DEF:[{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>e.push(this.CONSUME(pc.BASIC_TYPE))},{ALT:()=>e.push(this.CONSUME(pc.ASSIGN_OP))},{ALT:()=>e.push(this.CONSUME(pc.SHIFT_OP))},{ALT:()=>e.push(this.CONSUME(pc.CONSTANT))},{ALT:()=>e.push(this.CONSUME(pc.KEYWORD))},{ALT:()=>e.push(this.CONSUME2(pc.IDENTIFIER))}]})),t.push({tokens:e,node:void 0})},MAX_LOOKAHEAD:1}),this.CONSUME(pc.RIGHT_PAREN),{kind:"ppCall",callee:e,args:t}}),this.ppCallArg=this.RULE("ppCallArg",()=>{const e=[];return e.push(this.CONSUME(pc.LEFT_PAREN)),this.MANY(()=>this.OR([{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>(e.push(this.LA(1)),this.SKIP_TOKEN())}])),e.push(this.CONSUME(pc.RIGHT_PAREN)),e}),this.ppNone=this.RR("ppNone",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.ELSE)},{ALT:()=>this.CONSUME(pc.ENDIF)}]),tokens:[],node:void 0};return this.ppDefs.push(e),e}),this.ppMulti=this.RR("ppMulti",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IF)},{ALT:()=>this.CONSUME(pc.ELIF)},{ALT:()=>this.CONSUME(pc.ERROR)},{ALT:()=>this.CONSUME(pc.VERSION)},{ALT:()=>this.CONSUME(pc.LINE)}]),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(e),e}),this.ppPragma=this.RR("ppPragma",()=>({kind:"ppPragma",dir:this.CONSUME(pc.PRAGMA_DIRECTIVE)})),this.ppSingle=this.RR("ppSingle",()=>(this.CONSUME(pc.HASH),{kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IFDEF)},{ALT:()=>this.CONSUME(pc.IFNDEF)}]),tokens:[this.CONSUME(pc.IDENTIFIER)],node:void 0})),this.ppExtension=this.RR("ppExtension",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.EXTENSION);const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.COLON),{kind:"ppExtension",extension:e,behavior:this.CONSUME1(pc.IDENTIFIER)}}),this.ppDirective=this.RR("ppDirective",()=>this.OR([{ALT:()=>this.SUBRULE(this.ppDefine)},{ALT:()=>this.SUBRULE(this.ppExtension)},{ALT:()=>this.SUBRULE(this.ppNone)},{ALT:()=>this.SUBRULE(this.ppSingle)},{ALT:()=>this.SUBRULE(this.ppMulti)},{ALT:()=>this.SUBRULE(this.ppPragma)},{ALT:()=>this.SUBRULE(this.ppInclude)}])),this.ppIdentifier=this.RR("ppIdentifier",()=>this.OR([{ALT:()=>this.CONSUME(pc.IDENTIFIER)},{ALT:()=>this.CONSUME(pc.KEYWORD)},{ALT:()=>this.CONSUME(pc.BASIC_TYPE)}])),this.ppDefs=[],this.performSelfAnalysis()}reset(){super.reset(),this.ppDefs=[],this.backtracking=!1,this.preprocessing=!1}LEFT_ASSOC(e,t){const n=this.LA(1);let r=this.SUBRULE1(e);return this.MANY(()=>{const i=this.CONSUME(t),s=this.SUBRULE2(e);return r={kind:"binaryExpression",lhs:r,rhs:s,op:i,firstToken:n,lastToken:this.LA(0)},r}),r}ANNOTATE(e){return(...t)=>{const n=this.LA(1),r=e(...t);return r&&hc(r)&&!r.firstToken&&this.FINALIZE(r,n),r}}BACKTRACK(e,t){const n=super.BACKTRACK(e,t);return function(){try{return this.backtracking=!0,n.call(this)}finally{this.backtracking=!1}}}RR(e,t,n){return super.RULE(e,this.ANNOTATE(t),n)}FINALIZE(e,t){this.RECORDING_PHASE||this.backtracking||(e.firstToken=t,e.lastToken=this.LA(0))}isAtEof(){return this.LA(1).tokenType===Ml}};const{ll:{printDocToString:vc},LX:{indentIfBreak:Cc,group:Dc,indent:Sc,join:Ac,line:_c,softline:yc,hardline:bc,fill:Tc,lineSuffixBoundary:Rc}}=r,xc=new class extends uc{constructor(){super(...arguments),this.result=void 0}visit(e){if(!this.result){const t=this.result=[];return super.visit(e),this.result=void 0,t}e&&this.result.push(e)}};function wc(e){return(cc(e)?e:e.lastToken).endOffset+1}const Fc={"glsl-parser":{parse(e,t){const n=function(e){const t=function(e){const t=[];let n="",r=0,i=0;return{result:e.replace(/\\(\r\n|\n\r|\r|\n)(.*?)(?:(?=\\?[\r\n])|$)/g,(s,o,a,l)=>{r++,i+=function(e,t){let n=t;for(;n>=0&&"\r"!==e[n]&&"\n"!==e[n];)n--;return t-n-1}(e,l),t.push({originalOffset:l+1+o.length,newOffset:l-n.length,length:a.length,lineDiff:-r,columnDiff:i}),n+=" "+o;let u="";return e.length>l+s.length&&"\\"===e[l+s.length]||(u=n,n="",r=0,i=0),a+u}),changes:t}}(e),n=gc.tokenize(t.result);!function(e,t){if(t.errors.length)throw new Error("LEXER ERROR: "+t.errors.map(t=>t.message+":\n"+dc(e,{startLine:t.line,startColumn:t.column,endLine:t.line,endColumn:t.column+t.length})).join())}(t.result,n),function(e,t){let n=0;function r(e,t){const n=t.originalOffset-t.newOffset;e.startOffset>=t.newOffset&&(e.lineNoCont=e.startLine,e.startOffset+=n,e.startLine-=t.lineDiff,e.startColumn-=t.columnDiff),e.endOffset+=n,e.endLine-=t.lineDiff,e.endColumn-=t.columnDiff}for(const i of t){for(;e[n]&&e[n].endOffset0)throw new Error("PARSE ERROR: "+t.map(t=>t.message+"\n"+t.context.ruleStack.join(" > ")+"\n"+dc(e,t.token)).join("\n"))}(t.result,Ec.errors);const i=Ec.ppDefs;function s(e,t){Ec.input=e;const n=t(Ec);return Ec.isAtEof()&&0===Ec.errors.length?n:void 0}for(const e of i)e.node=s(e.tokens,e=>e.externalDeclaration(!0,!0))??s(e.tokens,e=>e.statement())??s(e.tokens,e=>e.expression());return r.comments=n.groups.COMMENTS,r}(e);return n.comments?.forEach(e=>e.value=JSON.stringify(e)),n},astFormat:"glsl-ast",locStart:function(e){return(cc(e)?e:e.firstToken).startOffset},locEnd:wc}};function Nc(e){switch(e){case pc.STAR:case pc.SLASH:case pc.PERCENT:return 4;case pc.PLUS:case pc.DASH:return 5;case pc.LEFT_OP:case pc.RIGHT_OP:return 6;case pc.LEFT_ANGLE:case pc.RIGHT_ANGLE:case pc.LE_OP:case pc.GE_OP:return 7;case pc.EQ_OP:case pc.NE_OP:return 8;case pc.AMPERSAND:return 9;case pc.CARET:return 10;case pc.VERTICAL_BAR:return 11;case pc.AND_OP:case pc.XOR_OP:return 12;case pc.OR_OP:return 13;case pc.COMMA:return 17;default:throw new Error}}function Lc(e,t){switch(e.kind){default:return 1;case"variableExpression":return t?.find(t=>t.image===e.var.image)?18:1;case"arrayAccess":case"functionCall":case"fieldAccess":case"postfixExpression":return 2;case"unaryExpression":return 3;case"binaryExpression":return Nc(e.op.tokenType);case"conditionalExpression":return 15;case"assignmentExpression":return 16;case"commaExpression":return 17}}function Oc(e,t){return t?["(",e,")"]:e}function Ic(e,t,n,r){const i="binaryExpression"===n.kind&&"binaryExpression"===n.lhs.kind&&Nc(n.lhs.op.tokenType)===Nc(n.op.tokenType)||"commaExpression"===n.kind&&"commaExpression"===n.lhs.kind,s="binaryExpression"===n.kind?n.op.tokenType:pc.COMMA;let o;return i?(o=e.call(e=>Ic(e,t,e.getValue(),r),"lhs"),o.push("commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))),o):[Oc(e.call(t,"lhs"),Lc(n.lhs,r)>Nc(s)),"commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))]}function kc(e,t,n){return"expressionStatement"!==e.kind||e.expression?"compoundStatement"===e.kind||n?[" ",t]:Sc([_c,t]):";"}function Mc(e,t){return vc(e,Object.assign({},t,{printWidth:t.printWidth-2})).formatted.trim().replace(/^.*(?=[\r\n])/gm,e=>e+" ".repeat(t.printWidth-2-e.length+1)+"\\")}function Pc(e){return"assignmentExpression"===e.kind}function Bc(e){return"assignmentExpression"===e.kind||"declarator"===e.kind}function Uc(e,t,n,r,i,s){const o=function(e,t,n){if(!n)return"only-left";const r=!Pc(n);return e.match(Pc,Bc,e=>!r||"expressionStatement"!==e.kind&&"initDeclaratorListDeclaration"!==e.kind)?r?"chain-tail":"chain":!r&&Pc(n.rhs)||(t.originalText,0)||"binaryExpression"===n.kind||"commaExpression"===n.kind||"conditionalExpression"===n.kind&&"binaryExpression"===n.condition.kind?"break-after-operator":"constantExpression"===n.kind?"never-break-after-operator":"fluid"}(e,t,s);switch(o){case"break-after-operator":return Dc([Dc(n),r,Dc(Sc([_c,i]))]);case"never-break-after-operator":return Dc([Dc(n),r," ",i]);case"fluid":{const e=Symbol("assignment");return Dc([Dc(n),r,Dc(Sc(_c),{id:e}),Rc,Cc(i,{groupId:e})])}case"chain":return[Dc(n),r,_c,i];case"chain-tail":return[Dc(n),r,Sc([_c,i])];case"only-left":return n;default:throw new Error}}const $c={"glsl-ast":{print(e,t,n){const r=t.inMacro,i=e.getValue();if(!i)return[];if(cc(i))return i.image;const s=t=>e.call(n,t);try{switch(i.kind){case"translationUnit":{const r=[];return e.each((e,i)=>{const s=e.getValue();r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc),r.push(bc)},"declarations"),r}case"precisionDeclaration":return["precision ",i.precisionQualifier.image," ",e.call(n,"typeSpecifierNoPrec"),";"];case"fullySpecifiedType":{const e=[];return i.typeQualifier&&e.push(s("typeQualifier")," "),e.push(s("typeSpecifier")),e}case"typeSpecifier":{const e=[];return i.precisionQualifier&&e.push(i.precisionQualifier.image," "),e.push(s("typeSpecifierNonArray")),i.arraySpecifier&&e.push(s("arraySpecifier")),e}case"typeQualifier":{const e=[];return i.invariantQualifier&&e.push("invariant"),i.interpolationQualifier&&e.push(i.interpolationQualifier.image),i.layoutQualifier&&e.push(s("layoutQualifier")),i.storageQualifier&&e.push(s("storageQualifier")),Ac(" ",e)}case"storageQualifier":{const t=[];return i.CONST&&t.push("const"),i.CENTROID&&e.getParentNode().interpolationQualifier?.tokenType!==pc.FLAT&&t.push("centroid"),i.IN&&t.push("in"),i.OUT&&t.push("out"),i.VARYING&&t.push("varying"),i.ATTRIBUTE&&t.push("attribute"),i.UNIFORM&&t.push("uniform"),Ac(" ",t)}case"functionPrototype":case"functionDefinition":return[Dc([s("returnType")," ",s("name"),"(",Sc([yc,Ac([",",_c],e.map(n,"params"))]),yc,")"]),"functionPrototype"===i.kind?";":[" ",s("body")]];case"parameterDeclaration":return[i.parameterTypeQualifier?[s("parameterTypeQualifier")," "]:"",i.parameterQualifier?.tokenType===pc.OUT||i.parameterQualifier?.tokenType===pc.INOUT?i.parameterQualifier?.image+" ":"",s("typeSpecifier")," ",s("pName"),s("arraySpecifier")];case"initDeclaratorListDeclaration":case"structDeclaration":{const t=e.map(n,"declarators"),r="forStatement"===e.getParentNode().kind,o=i.declarators.some(e=>e.init);return Dc([s("fsType"),0===t.length?"":" ",1===t.length?t:Dc(Sc(Ac([",",o&&!r?bc:_c],t))),";"])}case"declarator":{const n=s("arraySpecifier"),r=[i.name.image,n];return Uc(e,t,r," =",s("init"),i.init)}case"arraySpecifier":return Dc(["[",Sc([yc,s("size")]),yc,"]"]);case"arrayAccess":return[Oc(s("on"),Lc(i.on,r)>2),"[",s("index"),"]"];case"structSpecifier":{const r=[];return e.each((e,i,s)=>{const o=e.getValue();r.push(bc),r.push(n(e)),i!==s.length-1&&_s.isNextLineEmpty(t.originalText,o,wc)&&r.push(bc)},"declarations"),Dc(["struct",i.name?" "+i.name.image:""," {",Sc(r),bc,"}"])}case"compoundStatement":{const r=[],s=!!i.comments?.some(e=>!e.leading&&!e.trailing&&!e.printed);return e.each((e,i)=>{const s=e.getValue();0!==i&&r.push(bc),r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc)},"statements"),s&&e.each(e=>{const t=e.getValue();t.leading||t.trailing||(r.push(n(e)),t.printed=!0)},"comments"),Dc(["{",r.length?[Sc([bc,r]),bc]:"","}"])}case"returnStatement":return i.what?["return"," ",s("what"),";"]:"return;";case"breakStatement":return"break;";case"continueStatement":return"continue;";case"discardStatement":return"discard;";case"selectionStatement":{const e=[],t=kc(i.yes,s("yes"),!1),n=Dc(["if (",Dc([Sc([yc,s("condition")]),yc]),")",t]);if(e.push(n),i.no){const t=i.yes.comments?.some(e=>e.trailing&&e.tokenType===pc.LINE_COMMENT)||i.yes.comments?.findLast(e=>!e.leading&&!e.trailing)?.tokenType===pc.LINE_COMMENT,n="compoundStatement"===i.yes.kind&&!t;e.push(n?" ":bc),e.push("else",Dc(kc(i.no,s("no"),"selectionStatement"===i.no.kind)))}return e}case"forStatement":{const e=kc(i.statement,s("statement"),!1),t=!1,n=t?[t,yc]:"";return"expressionStatement"!==i.initExpression.kind||i.initExpression.expression||i.conditionExpression||i.loopExpression?[n,Dc(["for (",Dc([Sc([yc,s("initExpression"),_c,s("conditionExpression"),";",_c,s("loopExpression")]),yc]),")",e])]:[n,Dc(["for (;;)",e])]}case"whileStatement":{const e=kc(i.statement,s("statement"),!1);return["while (",Dc(s("conditionExpression")),")",e]}case"doWhileStatement":return["do ",s("statement")," while (",Dc(s("conditionExpression")),");"];case"functionCall":return function(t){const r=e.map(n,"args");let i,o;if(void 0===t.callee.arraySpecifier&&cc(t.callee.typeSpecifierNonArray)&&void 0!==(i=function(e){switch(e){case pc.MAT2X2:return[2,2];case pc.MAT2X3:return[2,3];case pc.MAT2X4:return[2,4];case pc.MAT3X2:return[3,2];case pc.MAT3X3:return[3,3];case pc.MAT3X4:return[3,4];case pc.MAT4X2:return[4,2];case pc.MAT4X3:return[4,3];case pc.MAT4X4:return[4,4];default:return}}(t.callee.typeSpecifierNonArray.tokenType))&&i[0]*i[1]===t.args.length){const e=t.args.every(e=>"constantExpression"===e.kind&&(e.const_.tokenType===pc.FLOATCONSTANT||e.const_.tokenType===pc.INTCONSTANT)||"unaryExpression"===e.kind&&(e.op.tokenType===pc.PLUS||e.op.tokenType===pc.DASH)&&"constantExpression"===e.on.kind&&(e.on.const_.tokenType===pc.FLOATCONSTANT||e.on.const_.tokenType===pc.INTCONSTANT));if(e){const e=[],n=[];let s=0,a=0;for(let i=0;i2),".",s("functionCall")];case"postfixExpression":return[Oc(s("on"),Lc(i.on,r)>2),s("op")];case"unaryExpression":return[s("op"),Oc(s("on"),Lc(i.on,r)>3)];case"assignmentExpression":{const n=s("lhs");return Uc(e,t,n," "+i.op.image,s("rhs"),i.rhs)}case"conditionalExpression":return[Oc(s("condition"),Lc(i.condition,r)>=15),Sc([_c,"? ",s("yes"),_c,": ",s("no")])];case"commaExpression":case"binaryExpression":{const t=Ic(e,n,i,r),s=e.getParentNode();if("selectionStatement"===s.kind||"whileStatement"===s.kind||"switchStatement"===s.kind||"doWhileStatement"===s.kind)return t;const o=()=>{const t=e.getParentNode();return!!t&&("functionCall"===t.kind&&"commaExpression"===i.kind||"binaryExpression"===t.kind&&((n=t.op.tokenType)===pc.CARET||n===pc.VERTICAL_BAR||n===pc.AMPERSAND));var n},a=e.getParentNode(1);if("returnStatement"===s.kind||"forStatement"===s.kind||"conditionalExpression"===s.kind&&"returnStatement"!==a.kind&&"functionCall"!==a.kind||"assignmentExpression"===s.kind||"declarator"===s.kind)return Dc(t);{const e=t.slice(0,1),n=t.slice(e.length);return Dc(Oc([...e,Sc(n)],o()))}}case"expressionStatement":return[s("expression"),";"];case"fieldAccess":return[Oc(s("on"),Lc(i.on,r)>2),".",s("field")];case"constantExpression":{const e=i.const_;return e.tokenType===pc.FLOATCONSTANT?function(e){const t=e.indexOf(".");return 0===t&&(e="0"+e),e=e.replace("E","e"),-1!==t&&(e=(e=(e=(e=e.replace(".e","e")).replace(/(?=4):Tc(Ac(_c,e.map(n,"tokens")))])]);return t.inMacro=void 0,Mc(r,t)}case"ppDir":return Mc(Dc(["#",i.dir.image," ",Sc(i.node?s("node"):Tc(Ac(_c,e.map(n,"tokens"))))]),t);case"ppPragma":return i.dir.image.replace(/^#\s+/,"#").replace(/^#pragma\s{2,}/,"#pragma ");case"ppCall":return Dc([i.callee.image,"(",Ac([",",_c],e.map((e,t,n)=>n[t].tokens.map(e=>e.image),"args")),")"]);case"ppInclude":return["#include ",i.what];case"ppExtension":return["#extension ",i.extension.image," : ",i.behavior.image];case"switchStatement":return["switch (",Dc([Sc([yc,s("initExpression")]),yc]),") {",i.cases.length?Sc([bc,Ac(bc,e.map(n,"cases"))]):"",bc,"}"];case"caseBlock":{const r=s("caseLabel"),i=[];return e.each((e,r)=>{const s=e.getValue();i.push(bc),i.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&i.push(bc)},"statements"),[r,Sc(i)]}case"caseLabel":return void 0===i.case_?"default:":["case ",s("case_"),":"];case"layoutQualifier":return["layout(",Ac(", ",i.layoutQualifierIds.map(e=>void 0===e.init?e.IDENTIFIER.image:[e.IDENTIFIER.image," = ",e.init.image])),")"];case"uniformBlock":return[s("typeQualifier")," ",i.blockName.image," {",Sc([bc,Ac(bc,e.map(n,"declarations"))]),bc,"};"];case"typeQualifierDeclaration":return[s("typeQualifier"),";"];default:throw new Error("unexpected n type "+i.kind+"\n"+JSON.stringify(i).substring(0,100))}}catch(e){throw console.error("error printing "+JSON.stringify(i).substring(0,100)+"\n"),e}},embed(e,t){const n=e.getValue();return!cc(n)||n.tokenType!==pc.LINE_COMMENT&&n.tokenType!==pc.MULTILINE_COMMENT?null:(e,t,n,r)=>{}},getVisitorKeys:(e,t)=>cc(e)?[]:Object.keys(e).filter(e=>!t.has(e)),getCommentChildNodes:e=>cc(e)?[]:xc.visit(e),canAttachComment:e=>!0,printComment:function(e,t){const n=e.getValue();return n.tokenType===pc.MULTILINE_COMMENT&&"*"===n.image[2]?"/**\n"+n.image.substring(3,n.image.length-2).split("\n").map(e=>" *"===e?"":e.startsWith(" * ")?e.substring(3):e).join("\n").trim().split("\n").map(e=>""===e?" *":" * "+e).join("\n")+"\n */":n.image},hasPrettierIgnore(e){const t=e.getValue();return(t&&hc(t)&&t.comments?.some(e=>/\/\/\s*prettier-ignore\b.*/.test(e.image)))??!1}}},Gc={parsers:Fc,printers:$c};function Vc(e){return e.replace(/^([^\n]*;)\n(?=(?:[A-Za-z_]\w*\s+)+[A-Za-z_]\w*\s*\()/gm,"$1\n\n").replace(/^}\n(?=\S)/gm,"}\n\n")}var Wc,Hc,jc=(Wc={program:function(e){return jc(e.program)+jc(e.wsEnd)},segment:function(e){return jc(e.blocks)},text:function(e){return jc(e.text)},literal:function(e){return jc(e.wsStart)+jc(e.literal)+jc(e.wsEnd)},identifier:function(e){return jc(e.identifier)+jc(e.wsEnd)},binary:function(e){return jc(e.left)+jc(e.operator)+jc(e.right)},group:function(e){return jc(e.lp)+jc(e.expression)+jc(e.rp)},unary:function(e){return jc(e.operator)+jc(e.expression)},unary_defined:function(e){return jc(e.operator)+jc(e.lp)+jc(e.identifier)+jc(e.rp)},int_constant:function(e){return jc(e.token)+jc(e.wsEnd)},elseif:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},if:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},ifdef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},ifndef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},else:function(e){return jc(e.token)+jc(e.wsEnd)+jc(e.body)},error:function(e){return jc(e.error)+jc(e.message)+jc(e.wsEnd)},undef:function(e){return jc(e.undef)+jc(e.identifier)+jc(e.wsEnd)},define:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.body)+jc(e.wsEnd)},define_arguments:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.lp)+jc(e.args)+jc(e.rp)+jc(e.body)+jc(e.wsEnd)},conditional:function(e){return jc(e.wsStart)+jc(e.ifPart)+jc(e.elseIfParts)+jc(e.elsePart)+jc(e.endif)+jc(e.wsEnd)},version:function(e){return jc(e.version)+jc(e.value)+jc(e.profile)+jc(e.wsEnd)},pragma:function(e){return jc(e.pragma)+jc(e.body)+jc(e.wsEnd)},line:function(e){return jc(e.line)+jc(e.value)+jc(e.wsEnd)},extension:function(e){return jc(e.extension)+jc(e.name)+jc(e.colon)+jc(e.behavior)+jc(e.wsEnd)}},Hc=function(e){return"string"==typeof e?e:null==e?"":Array.isArray(e)?e.map(Hc).join(""):e.type in Wc?Wc[e.type](e):"NO GENERATOR FOR ".concat(e.type)+e});const zc=jc;function Xc(e,t,n,r){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Xc.prototype),i.expected=t,i.found=n,i.location=r,i.name="SyntaxError",i}function Kc(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}function Yc(e,t){var n,r={},i=(t=void 0!==t?t:{}).grammarSource,s={program:An,constant_expression:hr},o=An,a="<<",l=">>",u="<=",c=">=",h="==",d="!=",f="&&",p="||",m="(",g=")",E=",",v="!",C="-",D="~",S="+",A="*",_="/",y="%",b="<",T=">",R="|",x="^",w="&",F=":",N="#",L="define",O="line",I="undef",k="error",M="pragma",P="defined",B="if",U="ifdef",$="ifndef",G="elif",V="else",W="endif",H="version",j="extension",z="0",X="//",K="/*",Y="*/",q=/^[A-Za-z_]/,Q=/^[A-Za-z_0-9]/,Z=/^[uU]/,J=/^[1-9]/,ee=/^[0-7]/,te=/^[xX]/,ne=/^[0-9a-fA-F]/,re=/^[0-9]/,ie=/^[\n\r]/,se=/^[^\n\r]/,oe=/^[ \t]/,ae=gn("<<",!1),le=gn(">>",!1),ue=gn("<=",!1),ce=gn(">=",!1),he=gn("==",!1),de=gn("!=",!1),fe=gn("&&",!1),pe=gn("||",!1),me=gn("(",!1),ge=gn(")",!1),Ee=gn(",",!1),ve=gn("!",!1),Ce=gn("-",!1),De=gn("~",!1),Se=gn("+",!1),Ae=gn("*",!1),_e=gn("/",!1),ye=gn("%",!1),be=gn("<",!1),Te=gn(">",!1),Re=gn("|",!1),xe=gn("^",!1),we=gn("&",!1),Fe=gn(":",!1),Ne=gn("#",!1),Le=gn("define",!1),Oe=(gn("include",!1),gn("line",!1)),Ie=gn("undef",!1),ke=gn("error",!1),Me=gn("pragma",!1),Pe=gn("defined",!1),Be=gn("if",!1),Ue=gn("ifdef",!1),$e=gn("ifndef",!1),Ge=gn("elif",!1),Ve=gn("else",!1),We=gn("endif",!1),He=gn("version",!1),je=gn("extension",!1),ze=En([["A","Z"],["a","z"],"_"],!1,!1),Xe=En([["A","Z"],["a","z"],"_",["0","9"]],!1,!1),Ke=vn("number"),Ye=En(["u","U"],!1,!1),qe=En([["1","9"]],!1,!1),Qe=gn("0",!1),Ze=En([["0","7"]],!1,!1),Je=En(["x","X"],!1,!1),et=En([["0","9"],["a","f"],["A","F"]],!1,!1),tt=En([["0","9"]],!1,!1),nt=vn("control line"),rt=En(["\n","\r"],!1,!1),it=vn("token string"),st=En(["\n","\r"],!0,!1),ot=vn("text"),at=vn("if"),lt=vn("primary expression"),ut=vn("unary expression"),ct=vn("multiplicative expression"),ht=vn("additive expression"),dt=vn("shift expression"),ft=vn("relational expression"),pt=vn("equality expression"),mt=vn("and expression"),gt=vn("exclusive or expression"),Et=vn("inclusive or expression"),vt=vn("logical and expression"),Ct=vn("logical or expression"),Dt=vn("constant expression"),St=vn("whitespace or comment"),At=gn("//",!1),_t=gn("/*",!1),yt=gn("*/",!1),bt={type:"any"},Tt=vn("whitespace"),Rt=En([" ","\t"],!1,!1),xt=function(e,t){return gr("program",{program:e.blocks,wsEnd:t})},wt=function(e,t){return gr("int_constant",{token:e,wsEnd:t})},Ft=function(e,t){return gr("literal",{literal:e,wsEnd:t})},Nt=function(e){return"#"},Lt=function(e,t,n){return gr("literal",{literal:t,wsStart:e,wsEnd:n})},Ot=function(e,t){return gr("identifier",{identifier:e,wsEnd:t})},It=function(e){return gr("identifier",{identifier:e})},kt=function(e){return gr("text",{text:e.join("")})},Mt=function(e){return gr("segment",{blocks:e})},Pt=function(e,t,n,r,i){return[r,...i.flat()]},Bt=function(e,t,n,r,i,s){return gr("define_arguments",{define:e,identifier:t,lp:n,args:r||[],rp:i,body:s})},Ut=function(e,t,n){return gr("define",{define:e,identifier:t,body:n})},$t=function(e,t){return gr("line",{line:e,value:t})},Gt=function(e,t){return gr("undef",{undef:e,identifier:t})},Vt=function(e,t){return gr("error",{error:e,message:t})},Wt=function(e,t){return gr("pragma",{pragma:e,body:t})},Ht=function(e,t,n){return gr("version",{version:e,value:t,profile:n})},jt=function(e,t,n,r){return gr("extension",{extension:e,name:t,colon:n,behavior:r})},zt=function(e,t){return{...e,wsEnd:t}},Xt=function(e,t,n){return{...e,body:n,wsEnd:t}},Kt=function(e,t,n,r,i){return gr("elseif",{token:t,expression:n,wsEnd:r,body:i})},Yt=function(e,t,n,r,i){return gr("else",{token:n,wsEnd:r,body:i})},qt=function(e,t,n,r,i){return gr("conditional",{ifPart:e,elseIfParts:t,elsePart:n,endif:r,wsEnd:i})},Qt=function(e,t){return gr("ifdef",{token:e,identifier:t})},Zt=function(e,t){return gr("ifndef",{token:e,identifier:t})},Jt=function(e,t){return gr("if",{token:e,expression:t})},en=function(e,t,n){return gr("group",{lp:e,expression:t,rp:n})},tn=function(e,t,n,r){return gr("unary_defined",{operator:e,lp:t,identifier:n,rp:r})},nn=function(e,t){return gr("unary",{operator:e,expression:t})},rn=function(e,t){return Cr(e,t)},sn=function(e,t){return vr(e,t)},on=function(e,t,n){return Er(t,n)},an=function(e,t){return Er(e,t.flat())},ln=function(e){return e},un=function(e){return e},cn=0,hn=[{line:1,column:1}],dn=0,fn=[],pn=0,mn={};if("startRule"in t){if(!(t.startRule in s))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=s[t.startRule]}function gn(e,t){return{type:"literal",text:e,ignoreCase:t}}function En(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function vn(e){return{type:"other",description:e}}function Cn(t){var n,r=hn[t];if(r)return r;for(n=t-1;!hn[n];)n--;for(r={line:(r=hn[n]).line,column:r.column};ndn&&(dn=cn,fn=[]),fn.push(e))}function An(){var e,t,n,i=75*cn+0,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Qn())!==r?(n=dr(),e=xt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}function _n(){var t,n,i,s=75*cn+2,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===a?(n=a,cn+=2):(n=r,0===pn&&Sn(ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function yn(){var t,n,i,s=75*cn+3,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===l?(n=l,cn+=2):(n=r,0===pn&&Sn(le)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function bn(){var t,n,i,s=75*cn+4,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===u?(n=u,cn+=2):(n=r,0===pn&&Sn(ue)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Tn(){var t,n,i,s=75*cn+5,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===c?(n=c,cn+=2):(n=r,0===pn&&Sn(ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Rn(){var t,n,i,s=75*cn+6,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===h?(n=h,cn+=2):(n=r,0===pn&&Sn(he)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function xn(){var t,n,i,s=75*cn+7,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===d?(n=d,cn+=2):(n=r,0===pn&&Sn(de)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function wn(){var t,n,i,s=75*cn+8,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===f?(n=f,cn+=2):(n=r,0===pn&&Sn(fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Fn(){var t,n,i,s=75*cn+9,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===p?(n=p,cn+=2):(n=r,0===pn&&Sn(pe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Nn(){var t,n,i,s=75*cn+10,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,40===e.charCodeAt(cn)?(n=m,cn++):(n=r,0===pn&&Sn(me)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Ln(){var t,n,i,s=75*cn+11,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,41===e.charCodeAt(cn)?(n=g,cn++):(n=r,0===pn&&Sn(ge)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function On(){var t,n,i,s=75*cn+12,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,44===e.charCodeAt(cn)?(n=E,cn++):(n=r,0===pn&&Sn(Ee)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function In(){var t,n,i,s=75*cn+14,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,45===e.charCodeAt(cn)?(n=C,cn++):(n=r,0===pn&&Sn(Ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function kn(){var t,n,i,s=75*cn+16,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,43===e.charCodeAt(cn)?(n=S,cn++):(n=r,0===pn&&Sn(Se)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Mn(){var t,n,i,s=75*cn+17,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,42===e.charCodeAt(cn)?(n=A,cn++):(n=r,0===pn&&Sn(Ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Pn(){var t,n,i,s=75*cn+18,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,47===e.charCodeAt(cn)?(n=_,cn++):(n=r,0===pn&&Sn(_e)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Bn(){var t,n,i,s=75*cn+19,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,37===e.charCodeAt(cn)?(n=y,cn++):(n=r,0===pn&&Sn(ye)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Un(){var t,n,i,s=75*cn+20,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,60===e.charCodeAt(cn)?(n=b,cn++):(n=r,0===pn&&Sn(be)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function $n(){var t,n,i,s=75*cn+21,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,62===e.charCodeAt(cn)?(n=T,cn++):(n=r,0===pn&&Sn(Te)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Gn(){var t,n,i,s=75*cn+22,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,124===e.charCodeAt(cn)?(n=R,cn++):(n=r,0===pn&&Sn(Re)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Vn(){var t,n,i,s=75*cn+23,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,94===e.charCodeAt(cn)?(n=x,cn++):(n=r,0===pn&&Sn(xe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Wn(){var t,n,i,s=75*cn+24,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,38===e.charCodeAt(cn)?(n=w,cn++):(n=r,0===pn&&Sn(we)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Hn(){var t,n,i,s=75*cn+26,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,35===e.charCodeAt(cn)?(i=N,cn++):(i=r,0===pn&&Sn(Ne)),(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Nt(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function jn(){var t,n,i,s,o,a,l=75*cn+27,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===L?(a=L,cn+=6):(a=r,0===pn&&Sn(Le)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function zn(){var t,n,i,s,o,a,l=75*cn+37,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===G?(a=G,cn+=4):(a=r,0===pn&&Sn(Ge)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function Xn(){var t,n,i,s,o,a,l=75*cn+42,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Ot(n,i)):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t}function Kn(){var t,n,i,s,o=75*cn+44,a=mn[o];return a?(cn=a.nextPos,a.result):(pn++,t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+46,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,J.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(qe)),i!==r){for(s=[],o=qn();o!==r;)s.push(o),o=qn();n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o=75*cn+47,a=mn[o];if(a)return cn=a.nextPos,a.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r){for(i=[],ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));s!==r;)i.push(s),ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));t=n=[n,i]}else cn=t,t=r;return mn[o]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+48,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r)if(te.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Je)),i!==r){for(s=[],ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));o!==r;)s.push(o),ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));t=n=[n,i,s]}else cn=t,t=r;else cn=t,t=r;return mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),t=n!==r?e.substring(t,cn):n)),pn--,t===r&&(n=r,0===pn&&Sn(Ke)),mn[o]={nextPos:cn,result:t},t)}function Yn(){var t,n=75*cn+45,i=mn[n];return i?(cn=i.nextPos,i.result):(Z.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(Ye)),mn[n]={nextPos:cn,result:t},t)}function qn(){var t,n=75*cn+49,i=mn[n];return i?(cn=i.nextPos,i.result):(re.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(tt)),mn[n]={nextPos:cn,result:t},t)}function Qn(){var e,t,n,i,s,o=75*cn+50,a=mn[o];if(a)return cn=a.nextPos,a.result;if(cn,t=[],(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}if(n!==r){for(;n!==r;)if(t.push(n),(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}}else t=r;return t!==r&&(t=Mt(t)),e=t,mn[o]={nextPos:cn,result:e},e}function Zn(){var t,n,i,s,o,a,l,u,c,h,d,f=75*cn+51,p=mn[f];if(p)return cn=p.nextPos,p.result;if(pn++,t=function(){var t,n,i,s,o,a,l,u,c=75*cn+54,h=mn[c];if(h)return cn=h.nextPos,h.result;if(t=cn,n=cn,i=function(){var t,n,i,s=75*cn+55,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+35,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===U?(a=U,cn+=5):(a=r,0===pn&&Sn(Ue)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Qt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+36,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===$?(a=$,cn+=6):(a=r,0===pn&&Sn($e)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Zt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+34,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,2)===B?(a=B,cn+=2):(a=r,0===pn&&Sn(Be)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r?((i=Jn())===r&&(i=null),t=Jt(n,i)):(cn=t,t=r))),pn--,t===r&&(n=r,0===pn&&Sn(at)),mn[s]={nextPos:cn,result:t},t)}(),i!==r?(ie.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(rt)),s!==r?((o=Qn())===r&&(o=null),n=Xt(i,s,o)):(cn=n,n=r)):(cn=n,n=r),n!==r){for(i=[],s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s=cn,o=function(){var t,n,i,s,o,a,l=75*cn+38,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===V?(a=V,cn+=4):(a=r,0===pn&&Sn(Ve)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a!==r?((l=Qn())===r&&(l=null),s=Yt(n,i,o,a,l)):(cn=s,s=r)):(cn=s,s=r),s===r&&(s=null),o=function(){var t,n,i,s,o,a,l=75*cn+39,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===W?(a=W,cn+=5):(a=r,0===pn&&Sn(We)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a===r&&(a=null),t=qt(n,i,s,o,a)):(cn=t,t=r)}else cn=t,t=r;return mn[c]={nextPos:cn,result:t},t}(),t===r){if(t=cn,n=cn,(i=jn())!==r)if(s=function(){var t,n,i,s,o,a,l=75*cn+43,u=mn[l];if(u)return cn=u.nextPos,u.result;if(cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r&&(n=It(n)),t=n,mn[l]={nextPos:cn,result:t},t}(),s!==r)if((o=Nn())!==r){if(a=cn,(l=Xn())!==r){for(u=[],c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);c!==r;)u.push(c),c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);a=Pt(i,s,o,l,u)}else cn=a,a=r;a===r&&(a=null),(l=Ln())!==r?((u=Jn())===r&&(u=null),n=Bt(i,s,o,a,l,u)):(cn=n,n=r)}else cn=n,n=r;else cn=n,n=r;else cn=n,n=r;if(n===r&&(n=cn,(i=jn())!==r&&(s=Xn())!==r?((o=Jn())===r&&(o=null),n=Ut(i,s,o)):(cn=n,n=r),n===r)){if(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+29,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===O?(a=O,cn+=4):(a=r,0===pn&&Sn(Oe)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r){if(s=cn,o=[],(a=qn())!==r)for(;a!==r;)o.push(a),a=qn();else o=r;(s=o!==r?e.substring(s,cn):o)!==r?n=$t(i,s):(cn=n,n=r)}else cn=n,n=r;n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+30,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===I?(a=I,cn+=5):(a=r,0===pn&&Sn(Ie)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?n=Gt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+31,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===k?(a=k,cn+=5):(a=r,0===pn&&Sn(ke)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Vt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+32,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===M?(a=M,cn+=6):(a=r,0===pn&&Sn(Me)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Wt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+40,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,7)===H?(a=H,cn+=7):(a=r,0===pn&&Sn(He)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Kn())!==r?((o=Jn())===r&&(o=null),n=Ht(i,s,o)):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+41,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,9)===j?(a=j,cn+=9):(a=r,0===pn&&Sn(je)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?(o=function(){var t,n,i,s=75*cn+25,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,58===e.charCodeAt(cn)?(n=F,cn++):(n=r,0===pn&&Sn(Fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),o!==r&&(a=Jn())!==r?n=jt(i,s,o,a):(cn=n,n=r)):(cn=n,n=r))))))}n!==r?(ie.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(rt)),i===r&&(i=null),t=zt(n,i)):(cn=t,t=r)}return pn--,t===r&&(n=r,0===pn&&Sn(nt)),mn[f]={nextPos:cn,result:t},t}function Jn(){var t,n,i,s=75*cn+52,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st)),i!==r)for(;i!==r;)n.push(i),se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(it)),mn[s]={nextPos:cn,result:t},t}function er(){var t,n,i,s,o,a,l=75*cn+53,u=mn[l];if(u)return cn=u.nextPos,u.result;if(pn++,t=cn,n=cn,i=cn,pn++,s=cn,(o=pr())===r&&(o=null),35===e.charCodeAt(cn)?(a=N,cn++):(a=r,0===pn&&Sn(Ne)),a!==r?s=o=[o,a]:(cn=s,s=r),pn--,s===r?i=void 0:(cn=i,i=r),i!==r){if(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st)),o!==r)for(;o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));else s=r;s!==r?(ie.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(rt)),o===r&&(o=null),n=i=[i,s,o]):(cn=n,n=r)}else cn=n,n=r;return n===r&&(ie.test(e.charAt(cn))?(n=e.charAt(cn),cn++):(n=r,0===pn&&Sn(rt))),t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(ot)),mn[l]={nextPos:cn,result:t},t}function tr(){var t,n,i,s,o,a=75*cn+57,l=mn[a];return l?(cn=l.nextPos,l.result):(pn++,t=cn,n=function(){var t,n,i,s,o=75*cn+33,a=mn[o];return a?(cn=a.nextPos,a.result):(t=cn,n=dr(),e.substr(cn,7)===P?(i=P,cn+=7):(i=r,0===pn&&Sn(Pe)),i!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[o]={nextPos:cn,result:t},t)}(),n!==r?((i=Nn())===r&&(i=null),(s=Xn())!==r?((o=Ln())===r&&(o=null),t=tn(n,i,s,o)):(cn=t,t=r)):(cn=t,t=r),t===r&&(t=cn,(n=kn())===r&&(n=In())===r&&(n=function(){var t,n,i,s=75*cn+13,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,33===e.charCodeAt(cn)?(n=v,cn++):(n=r,0===pn&&Sn(ve)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),n===r&&(n=function(){var t,n,i,s=75*cn+15,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,126===e.charCodeAt(cn)?(n=D,cn++):(n=r,0===pn&&Sn(De)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}())),n!==r&&(i=tr())!==r?t=nn(n,i):(cn=t,t=r),t===r&&(t=function(){var e,t,n,i,s=75*cn+56,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,e=function(){var e,t,n,i=75*cn+1,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Kn())!==r?(n=dr(),e=wt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}(),e===r&&(e=cn,(t=Nn())!==r&&(n=hr())!==r&&(i=Ln())!==r?e=en(t,n,i):(cn=e,e=r),e===r&&(e=Xn())),pn--,e===r&&(t=r,0===pn&&Sn(lt)),mn[s]={nextPos:cn,result:e},e)}())),pn--,t===r&&(n=r,0===pn&&Sn(ut)),mn[a]={nextPos:cn,result:t},t)}function nr(){var e,t,n,i,s,o,a=75*cn+58,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=tr())!==r){for(n=[],i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ct)),mn[a]={nextPos:cn,result:e},e}function rr(){var e,t,n,i,s,o,a=75*cn+59,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=nr())!==r){for(n=[],i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ht)),mn[a]={nextPos:cn,result:e},e}function ir(){var e,t,n,i,s,o,a=75*cn+60,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=rr())!==r){for(n=[],i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(dt)),mn[a]={nextPos:cn,result:e},e}function sr(){var e,t,n,i,s,o,a=75*cn+61,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ir())!==r){for(n=[],i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ft)),mn[a]={nextPos:cn,result:e},e}function or(){var e,t,n,i,s,o,a=75*cn+62,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=sr())!==r){for(n=[],i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(pt)),mn[a]={nextPos:cn,result:e},e}function ar(){var e,t,n,i,s,o,a=75*cn+63,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=or())!==r){for(n=[],i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(mt)),mn[a]={nextPos:cn,result:e},e}function lr(){var e,t,n,i,s,o,a=75*cn+64,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ar())!==r){for(n=[],i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(gt)),mn[a]={nextPos:cn,result:e},e}function ur(){var e,t,n,i,s,o,a=75*cn+65,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=lr())!==r){for(n=[],i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Et)),mn[a]={nextPos:cn,result:e},e}function cr(){var e,t,n,i,s,o,a=75*cn+66,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ur())!==r){for(n=[],i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(vt)),mn[a]={nextPos:cn,result:e},e}function hr(){var e,t=75*cn+68,n=mn[t];return n?(cn=n.nextPos,n.result):(pn++,e=function(){var e,t,n,i,s,o,a=75*cn+67,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=cr())!==r){for(n=[],i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Ct)),mn[a]={nextPos:cn,result:e},e}(),pn--,e===r&&0===pn&&Sn(Dt),mn[t]={nextPos:cn,result:e},e)}function dr(){var e,t,n,i,s,o,a=75*cn+69,l=mn[a];if(l)return cn=l.nextPos,l.result;for(pn++,cn,(t=pr())===r&&(t=null),n=[],i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);return e=sn(t,n),pn--,t=r,0===pn&&Sn(St),mn[a]={nextPos:cn,result:e},e}function fr(){var t,n,i,s,o,a,l=75*cn+70,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=function(){var t,n,i,s,o,a=75*cn+71,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,e.substr(cn,2)===X?(i=X,cn+=2):(i=r,0===pn&&Sn(At)),i!==r){for(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),t===r)if(t=cn,n=function(){var t,n,i,s,o,a,l,u=75*cn+72,c=mn[u];if(c)return cn=c.nextPos,c.result;if(t=cn,n=cn,e.substr(cn,2)===K?(i=K,cn+=2):(i=r,0===pn&&Sn(_t)),i!==r){for(s=[],o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);o!==r;)s.push(o),o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);e.substr(cn,2)===Y?(o=Y,cn+=2):(o=r,0===pn&&Sn(yt)),o!==r?n=i=[i,s,o]:(cn=n,n=r)}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[u]={nextPos:cn,result:t},t}(),n!==r){for(i=[],s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);t=an(n,i)}else cn=t,t=r;return mn[l]={nextPos:cn,result:t},t}function pr(){var t,n,i,s=75*cn+73,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt)),i!==r)for(;i!==r;)n.push(i),oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(Tt)),mn[s]={nextPos:cn,result:t},t}function mr(){var t,n,i,s=75*cn+74,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,pn++,Q.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Xe)),pn--,i===r?n=void 0:(cn=n,n=r),n!==r?(i=dr(),t=un(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}e=lh(e);const gr=(e,t)=>({type:e,...t}),Er=(...e)=>e.flat().filter(e=>null!=e&&""!==e&&0!==e.length),vr=(...e)=>{return(t=Er(e.flat())).length>1?t:t[0];var t},Cr=(...e)=>e.flat().reduce((e,[t,n])=>({type:"binary",operator:t,left:e,right:n}));if((n=o())!==r&&cn===e.length)return n;throw n!==r&&cn0){for(t=1,n=1;ts.length)throw new Error("'".concat(t,"': Too many arguments for macro"));if(u.length>":return t(n)>>t(r);case"<":return t(n)":return t(n)>t(r);case"<=":return t(n)<=t(r);case">=":return t(n)>=t(r);case"==":return t(n)==t(r);case"!=":return t(n)!=t(r);case"&":return t(n)&t(r);case"^":return t(n)^t(r);case"|":return t(n)|t(r);case"&&":return t(n)&&t(r);case"||":return t(n)||t(r);default:throw new Error("Preprocessing error: Unknown binary operator ".concat(i))}},unary:function(e,t){switch(e.operator.literal){case"+":return t(e.expression);case"-":return-1*t(e.expression);case"!":return!t(e.expression);case"~":return~t(e.expression);default:throw new Error("Preprocessing error: Unknown unary operator ".concat(e.operator.literal))}}},(r=function(e){var t=n[e.type];if(!t)throw new Error("No evaluate() evaluator for ".concat(e.type));return t(e,r)})(e);var n,r}((n=sh(r,t).trim(),eh(s)(n,{grammarSource:"expression",startRule:"constant_expression"})),t)},lh=function(e,t){return void 0===t&&(t={}),e.replace(/\\[\n\r]/g,"")},uh=function(e,t){void 0===t&&(t={});var n,r,i,s,o=Object.entries(t.defines||{}).reduce(function(e,t){var n,r=t[0],i=t[1];return th(th({},e),((n={})[r]={body:i},n))},{}),a=(void 0===(n=t.preserve)&&(n={}),function(e){var t=null==n?void 0:n[e.node.type];return"function"==typeof t?t(e):t});return r={conditional:{enter:function(e){var t=e,n=t.node;a(t)||(function(e,t){return"if"===t.type?!!t.expression&&oh(ah(t.expression,e)):"ifdef"===t.type?t.identifier.identifier in e:"ifndef"===t.type?!(t.identifier.identifier in e):void 0}(o,n.ifPart)?t.replaceWith(n.ifPart.body):n.elseIfParts.reduce(function(e,n){return e||oh(ah(n.expression,o))&&(t.replaceWith(n.body),!0)},!1)||(n.elsePart?t.replaceWith(n.elsePart.body):t.remove()))}},text:{enter:function(e){var t=e;t.node.text=sh(t.node.text,o)}},define_arguments:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body,s=n.args;o[r]={args:s,body:i},!a(t)&&t.remove()}},define:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body;o[r]={body:i},!a(t)&&t.remove()}},undef:{enter:function(e){var t=e;delete o[t.node.identifier.identifier],!a(t)&&t.remove()}},error:{enter:function(e){var n=e;if(t.stopOnError)throw new Error(n.node.message);!a(n)&&n.remove()}},pragma:{enter:function(e){var t=e;!a(t)&&t.remove()}},version:{enter:function(e){var t=e;!a(t)&&t.remove()}},extension:{enter:function(e){var t=e;!a(t)&&t.remove()}},line:{enter:function(e){var t=e;!a(t)&&t.remove()}}},i=!1,(s=function(e,t,n,o,a){var l;if(!i){var u=r[e.type],c=function(e,t,n,r,i){return{node:e,parent:t,parentPath:n,key:r,index:i,stop:function(){this.stopped=!0},skip:function(){this.skipped=!0},remove:function(){this.removed=!0},replaceWith:function(e){this.replaced=e},findParent:function(e){return n?e(n)?n:n.findParent(e):n}}}(e,t,n,o,a),h=t;if(null==u?void 0:u.enter){if(u.enter(c),c.removed){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));return"number"==typeof a?h[o].splice(a,1):h[o]=null,c}if(c.replaced){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));"number"==typeof a?h[o].splice(a,1,c.replaced):h[o]=c.replaced}if(c.skipped)return c}if(c.stopped)i=!0;else if(c.replaced){var d=c.replaced;s(d,t,n,o,a)}else Object.entries(e).filter(function(e){return e[0],function(e){return function(e){return!!(null==e?void 0:e.type)}(e)||Array.isArray(e)}(e[1])}).forEach(function(t){var n=t[0],r=t[1];if(Array.isArray(r))for(var o=0,a=0;o-a{let e=!0;return n?(i({source:o,formatted:null,error:""}),function(e){return Gs(e,{parser:"glsl-parser",plugins:[Gc],printWidth:80,tabWidth:4,useTabs:!1}).then(Vc)}(o).then(t=>{e&&i({source:o,formatted:t,error:""})}).catch(t=>{if(!e)return;const n=dh(t);a.error("shader formatting failed: "+n),i({source:o,formatted:null,error:n})}),()=>{e=!1}):(i({source:o,formatted:null,error:""}),()=>{e=!1})},[n,o]);const c=n&&r.source===o?r.formatted:null;return{source:c||o,formatted:!!c,preprocessed:u,error:(r.source===o?r.error:"")||l}}(C.source,C.preprocessed,e.beautify),S=D.source,A=C.edited,_=[e.fragment?e.sourceFragmentLog:e.sourceVertexLog,e.programLog].filter(e=>!!e).join("\n"),y=!e.translated&&!D.preprocessed&&!D.formatted,b=function(e,t,n,r){return!(e||t||!n||r)}(t,A,_,y);(0,dt.useLayoutEffect)(()=>{g.current={programId:e.programId,sourceVertex:e.sourceVertex,sourceFragment:e.sourceFragment}},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!d.current)return;if(!f.current){const e=ace.edit(d.current);e.setTheme("ace/theme/monokai"),e.getSession().setMode("ace/mode/glsl"),e.setShowPrintMargin(!1),f.current=e}const t=f.current;t.setReadOnly(!e.editable||e.translated),t.getValue()!==S&&t.setValue(S,-1);const n=()=>{const n=t.getValue();e.fragment?m.current.fragment=n:m.current.vertex=n,v(t=>e.fragment?t.fragment?t:Object.assign(Object.assign({},t),{fragment:!0}):t.vertex?t:Object.assign(Object.assign({},t),{vertex:!0})),function(e,t,n,r){e&&n(!1),t&&r(!1)}(e.beautify,e.preprocessed,c,h),-1!==p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{if(p.current=-1,!function(e,t){return e.programId===t.programId&&e.sourceVertex===t.sourceVertex&&e.sourceFragment===t.sourceFragment}(g.current,e))return;const t={sourceVertex:m.current.vertex,sourceFragment:m.current.fragment,translatedSourceVertex:e.translatedSourceVertex,translatedSourceFragment:e.translatedSourceFragment,programId:e.programId};u(t)},1500)},r=e.editable&&!e.translated;return r&&t.getSession().on("change",n),()=>{r&&t.getSession().off("change",n)}},[S,e.editable,e.translated,e.fragment,e.beautify,e.preprocessed,e.sourceVertex,e.sourceFragment,e.translatedSourceVertex,e.translatedSourceFragment,e.programId,c,h,u]),(0,dt.useEffect)(()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),m.current={baseProgramId:e.programId,baseVertex:e.sourceVertex,baseFragment:e.sourceFragment,vertex:e.sourceVertex,fragment:e.sourceFragment},v({vertex:!1,fragment:!1})},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!f.current)return;const e=t||(y&&!A?_:"");f.current.getSession().setAnnotations(function(e){if(!e)return[];const t=[],n=e.split(/\r?\n/);for(const e of n){const n=e.replace(/\0/g,"").trim();if(!n)continue;let r=/^(error|warning|info)\s*:\s*\d+\s*:\s*(\d+)(?:\s*:\s*(\d+))?\s*:\s*(.*)$/i.exec(n);if(r){t.push(Pt(r[1],r[2],r[3],r[4]));continue}if(r=/^\d+\s*\(\s*(\d+)\s*\)\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[2],r[1],"",r[3]));continue}if(r=/^\d+\s*:\s*(\d+)(?:\s*\(\s*(\d+)\s*\))?\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[3],r[1],r[2],r[4]));continue}const i=/\b(error|warning|info)\b/i.exec(n);t.push({row:0,column:0,text:n,type:i?i[1].toLowerCase():"info"})}return t}(e))},[_,y,t,D.formatted,D.preprocessed,A,e.beautify,e.fragment,e.programLog,e.sourceFragmentLog,e.sourceVertexLog,e.translated]),(0,dt.useEffect)(()=>()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),f.current&&(f.current.destroy(),f.current=null)},[]);const T=(0,dt.useCallback)(e=>{e.preventDefault(),n()},[n]),R=(0,dt.useCallback)(e=>{e.preventDefault(),r()},[r]),x=(0,dt.useCallback)(e=>{e.preventDefault(),null==i||i()},[i]),w=(0,dt.useCallback)(e=>{e.preventDefault(),null==o||o()},[o]),F=(0,dt.useCallback)(e=>{e.preventDefault(),l()},[l]),N=!e.singleShader||!e.fragment,L=!e.singleShader||e.fragment,O=D.error;return(0,mt.jsxs)("div",{className:"sourceCodeComponentContainer",children:[(0,mt.jsx)("div",{className:"sourceCodeMenuComponentContainer",children:(0,mt.jsxs)("ul",{className:"sourceCodeMenuComponent",children:[N&&e.translatedSourceVertex&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:!e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedVertexSourceClicked",onClick:x,children:"Translated Vertex"})}),L&&e.translatedSourceFragment&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedFragmentSourceClicked",onClick:w,children:"Translated Fragment"})}),N&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment||e.translated?"":"active",href:"#",role:"button",commandName:"onVertexSourceClicked",onClick:T,children:"Vertex"})}),L&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&!e.translated?"active":"",href:"#",role:"button",commandName:"onFragmentSourceClicked",onClick:R,children:"Fragment"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onSourceCodeCloseClicked",onClick:F,children:"Close"})})]})}),(0,mt.jsx)("div",{className:"sourceCodeComponent",ref:d}),(0,mt.jsx)(hh,{beautify:e.beautify,capturedDiagnosticsHidden:b,fragment:e.fragment,preprocessed:e.preprocessed,processingError:O,onBeautifyChanged:c,onFragmentSourceClicked:r,onPreprocessChanged:h,onVertexSourceClicked:n})]})}function hh({beautify:e,capturedDiagnosticsHidden:t,fragment:n,preprocessed:r,processingError:i,onBeautifyChanged:s,onFragmentSourceClicked:o,onPreprocessChanged:a,onVertexSourceClicked:l}){const u=(0,dt.useCallback)(e=>{s(e.target.checked)},[s]),c=(0,dt.useCallback)(e=>{a(e.target.checked)},[a]),h=(0,dt.useCallback)(e=>{e.preventDefault(),(n?o:l)(),s(!1),a(!1)},[n,s,o,a,l]);return(0,mt.jsx)("div",{className:"sourceCodeMenuComponentFooter",children:(0,mt.jsxs)("p",{children:[(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onBeautifyChanged",checked:e,onChange:u})," Beautify"]}),(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onPreprocessChanged",checked:r,onChange:c})," Preprocess"]}),i&&(0,mt.jsx)("span",{className:"sourceCodeFormatError",role:"alert",title:i,children:"Shader processing failed"}),t&&(0,mt.jsxs)("span",{className:"sourceCodeDiagnosticsNotice",role:"status",children:["Captured diagnostics hidden."," ",(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onShowCapturedDiagnostics",onClick:h,children:"Show original with diagnostics"})]})]})})}function dh(e){return e instanceof Error?e.message:String(e)}function fh({title:e,children:t}){const n=e?e.replace(/([A-Z])/g," $1").trim():"";return(0,mt.jsxs)("div",{className:"jsonGroupComponent",children:[(0,mt.jsx)("div",{className:"jsonGroupComponentTitle",children:n}),(0,mt.jsx)("ul",{children:t})]})}function ph({itemKey:e,value:t}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsx)("span",{className:"jsonItemComponentValue",children:t})]})}function mh({itemKey:e,value:t,pixelated:n,raw:r}){const i=bt();return(0,mt.jsx)("li",{className:"jsonItemImageHolder",children:(0,mt.jsxs)("div",{className:"jsonItemImage jsonItemImageClickable",children:[(0,mt.jsx)("img",{src:t,style:n?{imageRendering:"pixelated"}:void 0,title:"Open in texture viewer",onClick:()=>i.openTextureViewer({src:t,label:e,pixelated:n,raw:r||null})}),(0,mt.jsx)("span",{children:e})]})})}function gh({itemKey:e,value:t,help:n}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("span",{className:"jsonItemComponentValue",children:[t+" (",(0,mt.jsx)("a",{href:n,target:"_blank",className:"jsonSourceItemComponentOpen",children:"Open help page"}),")"]})]})}function Eh({visualState:e}){const t=bt();return(0,mt.jsxs)("div",{className:"jsonVisualStateItemComponent",children:[e.Attachments?e.Attachments.map((n,r)=>n.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{className:"jsonItemImageClickable",src:encodeURI(n.src),title:"Open in texture viewer",onClick:()=>t.openTextureViewer({src:n.src,label:n.attachmentName||"Attachment",pixelated:!1,raw:n.raw||null})}),e.Attachments.length>1&&(0,mt.jsx)("span",{children:n.attachmentName})]},r):null):(0,mt.jsx)("span",{children:e.FrameBufferStatus}),(0,mt.jsx)("span",{children:e.FrameBuffer?e.FrameBuffer.__SPECTOR_Object_TAG.displayText:"Canvas frame buffer"})]})}function vh({itemKey:e,shader:t,programLog:n,onOpen:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),null==r||r(t,n)},[r,n,t]),s=t.source?t.source.length:0,o=`${t.name||"Shader"} (${s} chars)`;return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("a",{href:"#",role:"button",className:"jsonSourceItemComponentOpen",commandName:"onShaderSourceOpen",onClick:i,children:["Open ",o]})]})}function Ch({items:e,onShaderSourceOpen:t}){return e&&0!==e.length?(0,mt.jsx)(mt.Fragment,{children:e.map((e,n)=>{switch(e.type){case"group":return(0,mt.jsx)(fh,{title:e.title,children:(0,mt.jsx)(Ch,{items:e.children,onShaderSourceOpen:t})},n);case"item":return(0,mt.jsx)(ph,{itemKey:e.key,value:e.value},n);case"image":return(0,mt.jsx)(mh,{itemKey:e.key,value:e.value,pixelated:e.pixelated,raw:e.raw},n);case"help":return(0,mt.jsx)(gh,{itemKey:e.key,value:e.value,help:e.help},n);case"shaderSource":return(0,mt.jsx)(vh,{itemKey:e.key,shader:e.shader,programLog:e.programLog,onOpen:t},n);case"visualState":return(0,mt.jsx)(Eh,{visualState:e.visualState},n);default:return null}})}):null}const Dh={added:"+",removed:"-",changed:"~",unchanged:" "};function Sh(e){const t=void 0===e.indexA?"_":String(e.indexA),n=void 0===e.indexB?"_":String(e.indexB);return e.type+"#"+t+"#"+n}function Ah(e){return!(!e.previousImage&&!e.currentImage)}function _h(){const e=bt(),t=pt(e.store),[n,r]=(0,dt.useState)(null);if((0,dt.useEffect)(()=>{r(null)},[t.compareRows]),!t.canCompare)return(0,mt.jsx)("div",{className:"compareViewComponent",children:(0,mt.jsx)("div",{className:"compareViewEmpty",children:"Capture the same page at least twice, then select a capture to compare it against the previous one."})});const{added:i,removed:s,changed:o,unchanged:a}=t.compareSummary,l=t.compareOnlyDifferences?t.compareRows.filter(e=>"unchanged"!==e.type):t.compareRows,u=l.find(e=>Sh(e)===n)||(l.length>0?l[0]:null),c=u?Sh(u):"";return(0,mt.jsxs)("div",{className:"compareViewComponent",children:[(0,mt.jsxs)("div",{className:"compareViewHeader",children:[(0,mt.jsx)("span",{className:"compareViewLabel",children:t.compareLabel}),(0,mt.jsxs)("span",{className:"compareViewSummary",children:[(0,mt.jsxs)("span",{className:"added",children:["+",i]}),(0,mt.jsxs)("span",{className:"removed",children:["-",s]}),(0,mt.jsxs)("span",{className:"changed",children:["~",o]}),(0,mt.jsxs)("span",{className:"unchanged",children:["=",a]})]}),(0,mt.jsxs)("label",{className:"compareViewToggle",children:[(0,mt.jsx)("input",{type:"checkbox",checked:t.compareOnlyDifferences,onChange:t=>e.handleCompareOnlyDifferencesChange(t.target.checked)}),"Differences only"]})]}),(0,mt.jsxs)("div",{className:"compareViewBody",children:[(0,mt.jsx)(yh,{}),(0,mt.jsx)("ul",{className:"compareViewList",children:0===l.length?(0,mt.jsx)("li",{className:"compareViewEmptyRow",children:"No differences between these two captures."}):l.map(e=>{const t=Sh(e);return(0,mt.jsx)(bh,{row:e,selected:t===c,onSelect:()=>r(t)},t)})}),(0,mt.jsx)("div",{className:"compareViewDetail",children:u?(0,mt.jsx)(Th,{row:u,onSelectCommand:e.handleCompareCommandSelected,onOpenTexture:(t,n)=>e.openTextureViewer({src:t,label:n,pixelated:!1,raw:null})}):(0,mt.jsx)("div",{className:"compareDetailEmpty",children:"Select a call to see its details."})})]})]})}function yh(){return(0,mt.jsxs)("div",{className:"compareViewLegend",children:[(0,mt.jsxs)("div",{className:"compareLegendRow added",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Added"]}),(0,mt.jsxs)("div",{className:"compareLegendRow removed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Removed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow changed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Changed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow unchanged",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Unchanged"]})]})}function bh(e){const{row:t,selected:n,onSelect:r}=e,i="removed"===t.type?t.previousText:t.currentText,s=i&&0===i.indexOf(t.name)?i.slice(t.name.length):"",o="compareRow "+t.type+(n?" selected":"");return(0,mt.jsxs)("li",{className:o,onClick:r,title:i,children:[(0,mt.jsx)("span",{className:"compareSign",children:Dh[t.type]}),(0,mt.jsxs)("span",{className:"compareRowText",children:[(0,mt.jsx)("span",{className:"compareCmdName",children:t.name}),s]})]})}function Th(e){const{row:t,onSelectCommand:n,onOpenTexture:r}=e,i=t.fieldDiffs||[],s=i.filter(e=>!Ah(e)),o=i.filter(Ah),a="changed"===t.type&&t.previousText!==t.currentText,l="removed"===t.type?t.previousText:t.currentText;return(0,mt.jsxs)("div",{className:"compareDetail",children:[(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Command"}),(0,mt.jsxs)("ul",{children:[(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"name"}),":"," ",(0,mt.jsx)("span",{className:"compareCmdName "+t.type,children:t.name})]}),(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"call"}),":"," ",a?(0,mt.jsxs)("span",{className:"compareTextChange",children:[(0,mt.jsx)("span",{className:"compareOld",children:t.previousText}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:t.currentText})]}):(0,mt.jsx)("span",{className:"compareNew",children:l})]}),void 0!==t.commandId&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",className:"compareCommandLink",title:"Show this command in the Commands view",onClick:e=>{e.preventDefault(),n(t.commandId)},children:"Show in Commands view →"})})]})]}),s.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Uniform & state changes"}),(0,mt.jsx)("ul",{children:s.map((e,t)=>(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),":"," ",(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:e.current})]},t))})]}),o.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Texture changes"}),(0,mt.jsx)("ul",{children:o.map((e,t)=>(0,mt.jsxs)("li",{className:"compareTextureItem",children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),(0,mt.jsxs)("div",{className:"compareImageDiff",children:[e.previousImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.previousImage,title:"Open in texture viewer",onClick:()=>r(e.previousImage,e.path+" (previous)")}):(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),e.currentImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.currentImage,title:"Open in texture viewer",onClick:()=>r(e.currentImage,e.path+" (current)")}):(0,mt.jsx)("span",{className:"compareNew",children:e.current})]})]},t))})]})]})}function Rh(e){const t=(255&e).toString(16);return 1===t.length?"0"+t:t}function xh(e,t,n,r){return"#"+Rh(e)+Rh(t)+Rh(n)+Rh(r)}function wh(e,t,n,r){const i=e=>(e/255).toFixed(2);return i(e)+", "+i(t)+", "+i(n)+", "+i(r)}function Fh(){const e=bt(),t=pt(e.store).textureViewer;return t.open?(0,mt.jsx)(Lh,{viewer:t,onClose:e.closeTextureViewer}):null}const Nh=120;function Lh(e){const{viewer:t,onClose:n}=e,r=(0,dt.useRef)(null),i=(0,dt.useRef)(null),s=(0,dt.useRef)(null),o=(0,dt.useRef)(null),[a,l]=(0,dt.useState)({r:!0,g:!0,b:!0,a:!0}),[u,c]=(0,dt.useState)(1),[h,d]=(0,dt.useState)("checker"),[f,p]=(0,dt.useState)(null),[m,g]=(0,dt.useState)(null),[E,v]=(0,dt.useState)(!1);(0,dt.useEffect)(()=>{let e=!1;const n=t=>{e||(o.current=t,p({width:t.width,height:t.height}),c(kh(t.width,t.height)),v(!0))};if(t.raw){const r=function(e){try{if(!e.data||e.width<=0||e.height<=0)return null;const t=function(e){const t=atob(e),n=new Uint8ClampedArray(t.length);for(let e=0;e{e=!0}}const r=new Image;return r.onload=()=>{const e=document.createElement("canvas");e.width=r.naturalWidth||1,e.height=r.naturalHeight||1;const t=e.getContext("2d");if(!t)return;t.drawImage(r,0,0);const i=t.getImageData(0,0,e.width,e.height);n({data:new Uint8ClampedArray(i.data),width:e.width,height:e.height})},r.src=t.src,()=>{e=!0}},[t.src,t.raw]),(0,dt.useEffect)(()=>{const e=o.current,t=r.current;if(!E||!e||!t)return;const n=function(e,t,n){let r=e.current;return r||(r=document.createElement("canvas"),e.current=r),r.width!==t&&(r.width=t),r.height!==n&&(r.height=n),r}(s,e.width,e.height),i=n.getContext("2d"),l=t.getContext("2d");if(!i||!l)return;const c=function(e,t){const n=new Uint8ClampedArray(e.length),r=t.a&&!t.r&&!t.g&&!t.b;for(let i=0;i{const e=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]);const C="textureViewerViewport"+("checker"===h?" checker":""),D="black"===h?{background:"#000"}:"white"===h?{background:"#fff"}:void 0;return(0,mt.jsx)("div",{className:"textureViewerOverlay",onClick:n,children:(0,mt.jsxs)("div",{className:"textureViewerModal",onClick:e=>e.stopPropagation(),children:[(0,mt.jsxs)("div",{className:"textureViewerHeader",children:[(0,mt.jsx)("span",{className:"textureViewerTitle",children:t.label}),(0,mt.jsxs)("span",{className:"textureViewerMeta",children:[f?f.width+" × "+f.height:"",!t.raw&&f?" · thumbnail":""]}),(0,mt.jsx)("span",{className:"textureViewerClose",title:"Close (Esc)",onClick:n,children:"✕"})]}),(0,mt.jsxs)("div",{className:"textureViewerToolbar",children:[(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Channels"}),(0,mt.jsx)(Oh,{channel:"r",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"g",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"b",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"a",mask:a,setMask:l})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"tvBtn",title:"Force alpha = 1 to reveal RGB hidden behind transparency",onClick:()=>l({r:!0,g:!0,b:!0,a:!1}),children:"Opaque"}),(0,mt.jsx)("span",{className:"tvBtn",title:"Show the alpha channel as grayscale",onClick:()=>l({r:!1,g:!1,b:!1,a:!0}),children:"Alpha → gray"})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"BG"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)(Ih,{value:"checker",glyph:"▦",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"black",glyph:"■",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"white",glyph:"□",background:h,setBackground:d})]})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Zoom"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.max(1,e/2)),children:"−"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(f?kh(f.width,f.height):1),children:"Fit"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.min(32,2*e)),children:"+"})]}),(0,mt.jsxs)("span",{className:"zoomVal",children:[Math.round(100*u),"%"]})]}),(0,mt.jsx)("div",{className:"textureViewerGroup textureViewerGroupEnd",children:(0,mt.jsx)("span",{className:"tvBtn primary",onClick:()=>{const e=s.current;e&&e.toBlob(e=>{if(!e)return;const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=((t.label||"texture").replace(/[^a-z0-9_\-]+/gi,"_").replace(/^_+|_+$/g,"")||"texture")+".png",r.click(),setTimeout(()=>URL.revokeObjectURL(n),0)})},children:"⭳ Save PNG"})})]}),(0,mt.jsxs)("div",{className:"textureViewerBody",children:[(0,mt.jsxs)("div",{className:C,style:D,children:[(0,mt.jsx)("canvas",{ref:r,className:"textureViewerCanvas",onMouseMove:e=>{const t=o.current,n=r.current,a=i.current,l=s.current;if(!t||!n)return;const c=n.getBoundingClientRect(),h=Math.floor((e.clientX-c.left)/u),d=Math.floor((e.clientY-c.top)/u);if(h<0||d<0||h>=t.width||d>=t.height)return g(null),void(a&&(a.style.display="none"));const f=4*(d*t.width+h);g({x:h,y:d,r:t.data[f],g:t.data[f+1],b:t.data[f+2],a:t.data[f+3]}),function(e,t,n,r){if(!e||!t)return;const i=e.getContext("2d");if(!i)return;i.imageSmoothingEnabled=!1,i.clearRect(0,0,Nh,Nh),i.drawImage(t,n-7,r-7,15,15,0,0,Nh,Nh),i.strokeStyle="#F0640D",i.lineWidth=2,i.strokeRect(56,56,8,8),e.style.display="block"}(a,l,h,d)},onMouseLeave:()=>{g(null),i.current&&(i.current.style.display="none")}}),(0,mt.jsx)("canvas",{ref:i,className:"textureViewerLoupe",width:Nh,height:Nh})]}),(0,mt.jsxs)("div",{className:"textureViewerRail",children:[(0,mt.jsx)("div",{className:"railTitle",children:"Pixel inspector"}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"position"}),(0,mt.jsx)("span",{className:"v",children:m?m.x+", "+m.y:"—"})]}),(0,mt.jsx)("div",{className:"swatch",children:(0,mt.jsx)("div",{className:"swatchInner",style:m?{background:"rgba("+m.r+","+m.g+","+m.b+","+m.a/255+")"}:void 0})}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"R"}),(0,mt.jsx)("span",{className:"v",children:m?m.r:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"G"}),(0,mt.jsx)("span",{className:"v",children:m?m.g:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"B"}),(0,mt.jsx)("span",{className:"v",children:m?m.b:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"A"}),(0,mt.jsx)("span",{className:"v",children:m?m.a:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"hex"}),(0,mt.jsx)("span",{className:"v",children:m?xh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"norm"}),(0,mt.jsx)("span",{className:"v",children:m?wh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"hint",children:["Move over the texture to sample pixels. Toggle channels to isolate RGB / alpha.",(0,mt.jsx)("b",{children:" Opaque"})," reveals colour hidden behind transparency (#183)."]})]})]})]})})}function Oh(e){const{channel:t,mask:n,setMask:r}=e,i=n[t],s="channel "+t+(i?" on":"");return(0,mt.jsx)("span",{className:s,onClick:()=>r(Object.assign(Object.assign({},n),{[t]:!i})),children:t.toUpperCase()})}function Ih(e){const{value:t,glyph:n,background:r,setBackground:i}=e;return(0,mt.jsx)("span",{className:"tvBtn"+(r===t?" active":""),onClick:()=>i(t),children:n})}function kh(e,t){return Math.max(1,Math.min(16,Math.floor(480/Math.max(e,t))||1))}function Mh(){const e=bt(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"resultViewComponent "+(t.visible?"active":""),children:[(0,mt.jsx)(Tt,{}),(0,mt.jsxs)(Rt,{children:[0===t.menuStatus&&(0,mt.jsx)(wt,{active:!0,captures:t.captures,onCaptureSelected:t=>{e.selectCapture(t),e.handleMenuStatusChange(40)},onSaveRequested:e.handleSaveRequested,onCaptureLoaded:e.handleCaptureLoaded}),40===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(Ft,{children:t.visualStates.map((t,n)=>(0,mt.jsx)(Nt,{item:t,onVisualStateSelected:()=>e.handleVisualStateSelected(n)},n))}),(0,mt.jsx)(Lt,{children:t.commands.map((t,n)=>(0,mt.jsx)(Ot,{command:t,onCommandSelected:()=>e.handleCommandSelected(n),onVertexSelected:()=>e.handleVertexSelected(n),onFragmentSelected:()=>e.handleFragmentSelected(n),onShaderSelected:()=>e.handleShaderSelected(n)},n))}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]}),10===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(kt,{left:!0,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationLeft})})}),(0,mt.jsx)(kt,{left:!1,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationRight})})})]}),20===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.initStateData})}),30===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.endStateData})}),60===t.menuStatus&&(0,mt.jsx)(_h,{}),50===t.menuStatus&&t.sourceCodeState&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(ch,{state:t.sourceCodeState,errorMessage:t.sourceCodeError,onVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!1),onFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!1),onTranslatedVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!0),onTranslatedFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!0),onCloseClicked:e.handleSourceCodeClose,onSourceCodeChanged:e.handleSourceCodeChanged,onBeautifyChanged:e.handleBeautifyChanged,onPreprocessChanged:e.handlePreprocessChanged}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]})]}),(0,mt.jsx)(Fh,{})]})}class Ph{static getMDNLink(e){const t=Ph.WebGL2Functions[e];if(t)return Ph.WebGL2RootUrl+t;const n=Ph.WebGLFunctions[e];if(n)return Ph.WebGLRootUrl+n;const r=Ph.AngleInstancedArraysExtFunctions[e];return r?Ph.AngleInstancedArraysExtRootUrl+r:Ph.WebGLRootUrl+e}}Ph.WebGL2RootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/",Ph.WebGLRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/",Ph.AngleInstancedArraysExtRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/",Ph.WebGL2Functions={beginQuery:"beginQuery",beginTransformFeedback:"beginTransformFeedback",bindBufferBase:"bindBufferBase",bindBufferRange:"bindBufferRange",bindSampler:"bindSampler",bindTransformFeedback:"bindTransformFeedback",bindVertexArray:"bindVertexArray",blitFramebuffer:"blitFramebuffer",clearBufferfv:"clearBuffer",clearBufferiv:"clearBuffer",clearBufferuiv:"clearBuffer",clearBufferfi:"clearBuffer",clientWaitSync:"clientWaitSync",compressedTexImage3D:"compressedTexImage3D",compressedTexSubImage3D:"compressedTexSubImage3D",copyBufferSubData:"copyBufferSubData",copyTexSubImage3D:"copyTexSubImage3D",createQuery:"createQuery",createSampler:"createSampler",createTransformFeedback:"createTransformFeedback",createVertexArray:"createVertexArray",deleteQuery:"deleteQuery",deleteSampler:"deleteSampler",deleteSync:"deleteSync",deleteTransformFeedback:"deleteTransformFeedback",deleteVertexArray:"deleteVertexArray",drawArraysInstanced:"drawArraysInstanced",drawBuffers:"drawBuffers",drawElementsInstanced:"drawElementsInstanced",drawRangeElements:"drawRangeElements",endQuery:"endQuery",endTransformFeedback:"endTransformFeedback",fenceSync:"fenceSync",framebufferTextureLayer:"framebufferTextureLayer",getActiveUniformBlockName:"getActiveUniformBlockName",getActiveUniformBlockParameter:"getActiveUniformBlockParameter",getActiveUniforms:"getActiveUniforms",getBufferSubData:"getBufferSubData",getFragDataLocation:"getFragDataLocation",getIndexedParameter:"getIndexedParameter",getInternalformatParameter:"getInternalformatParameter",getQuery:"getQuery",getQueryParameter:"getQueryParameter",getSamplerParameter:"getSamplerParameter",getSyncParameter:"getSyncParameter",getTransformFeedbackVarying:"getTransformFeedbackVarying",getUniformBlockIndex:"getUniformBlockIndex",getUniformIndices:"getUniformIndices",invalidateFramebuffer:"invalidateFramebuffer",invalidateSubFramebuffer:"invalidateSubFramebuffer",isQuery:"isQuery",isSampler:"isSampler",isSync:"isSync",isTransformFeedback:"isTransformFeedback",isVertexArray:"isVertexArray",pauseTransformFeedback:"pauseTransformFeedback",readBuffer:"readBuffer",renderbufferStorageMultisample:"renderbufferStorageMultisample",resumeTransformFeedback:"resumeTransformFeedback",samplerParameteri:"samplerParameter",samplerParameterf:"samplerParameter",texImage3D:"texImage3D",texStorage2D:"texStorage2D",texStorage3D:"texStorage3D",texSubImage3D:"texSubImage3D",transformFeedbackVaryings:"transformFeedbackVaryings",uniform1ui:"uniform",uniform2ui:"uniform",uniform3ui:"uniform",uniform4ui:"uniform",uniform1fv:"uniform",uniform2fv:"uniform",uniform3fv:"uniform",uniform4fv:"uniform",uniform1iv:"uniform",uniform2iv:"uniform",uniform3iv:"uniform",uniform4iv:"uniform",uniform1uiv:"uniform",uniform2uiv:"uniform",uniform3uiv:"uniform",uniform4uiv:"uniform",uniformBlockBinding:"uniformBlockBinding",uniformMatrix2fv:"uniformMatrix",uniformMatrix3x2fv:"uniformMatrix",uniformMatrix4x2fv:"uniformMatrix",uniformMatrix2x3fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4x3fv:"uniformMatrix",uniformMatrix2x4fv:"uniformMatrix",uniformMatrix3x4fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttribDivisor:"vertexAttribDivisor",vertexAttribI4i:"vertexAttribI",vertexAttribI4ui:"vertexAttribI",vertexAttribI4iv:"vertexAttribI",vertexAttribI4uiv:"vertexAttribI",vertexAttribIPointer:"vertexAttribIPointer",waitSync:"waitSync"},Ph.WebGLFunctions={uniform1f:"uniform",uniform1fv:"uniform",uniform1i:"uniform",uniform1iv:"uniform",uniform2f:"uniform",uniform2fv:"uniform",uniform2i:"uniform",uniform2iv:"uniform",uniform3f:"uniform",uniform3i:"uniform",uniform3iv:"uniform",uniform4f:"uniform",uniform4fv:"uniform",uniform4i:"uniform",uniform4iv:"uniform",uniformMatrix2fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttrib1f:"vertexAttrib",vertexAttrib2f:"vertexAttrib",vertexAttrib3f:"vertexAttrib",vertexAttrib4f:"vertexAttrib",vertexAttrib1fv:"vertexAttrib",vertexAttrib2fv:"vertexAttrib",vertexAttrib3fv:"vertexAttrib",vertexAttrib4fv:"vertexAttrib"},Ph.AngleInstancedArraysExtFunctions={drawArraysInstancedANGLE:"drawArraysInstancedANGLE",drawElementsInstancedANGLE:"drawElementsInstancedANGLE",vertexAttribDivisorANGLE:"vertexAttribDivisorANGLE"};const Bh={activeTexture:[["texture"]],attachShader:[["program","shader"]],beginQuery:[["target","query"]],beginTransformFeedback:[["primitiveMode"]],bindAttribLocation:[["program","index","name"]],bindBuffer:[["target","buffer"]],bindBufferBase:[["target","index","buffer"]],bindBufferRange:[["target","index","buffer","offset","size"]],bindFramebuffer:[["target","framebuffer"]],bindRenderbuffer:[["target","renderbuffer"]],bindSampler:[["unit","sampler"]],bindTexture:[["target","texture"]],bindTransformFeedback:[["target","tf"]],bindVertexArray:[["array"]],blendColor:[["red","green","blue","alpha"]],blendEquation:[["mode"]],blendEquationSeparate:[["modeRGB","modeAlpha"]],blendFunc:[["sfactor","dfactor"]],blendFuncSeparate:[["srcRGB","dstRGB","srcAlpha","dstAlpha"]],blitFramebuffer:[["srcX0","srcY0","srcX1","srcY1","dstX0","dstY0","dstX1","dstY1","mask","filter"]],bufferData:[["target","data","usage"],["target","size","usage"],["target","srcData","usage"],["target","srcData","usage","srcOffset","length"]],bufferSubData:[["target","dstByteOffset","srcData"],["target","offset","data"],["target","dstByteOffset","srcData","srcOffset","length"]],checkFramebufferStatus:[["target"]],clear:[["mask"]],clearBufferfi:[["buffer","drawbuffer","depth","stencil"]],clearBufferfv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferiv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferuiv:[["buffer","drawbuffer","values","srcOffset"]],clearColor:[["red","green","blue","alpha"]],clearDepth:[["depth"]],clearStencil:[["s"]],clientWaitSync:[["sync","flags","timeout"]],colorMask:[["red","green","blue","alpha"]],compileShader:[["shader"]],compressedTexImage2D:[["target","level","internalformat","width","height","border","data"],["target","level","internalformat","width","height","border","imageSize","offset"],["target","level","internalformat","width","height","border","srcData","srcOffset","srcLengthOverride"]],compressedTexImage3D:[["target","level","internalformat","width","height","depth","border","imageSize","offset"],["target","level","internalformat","width","height","depth","border","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage2D:[["target","level","xoffset","yoffset","width","height","format","data"],["target","level","xoffset","yoffset","width","height","format","imageSize","offset"],["target","level","xoffset","yoffset","width","height","format","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","imageSize","offset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","srcData","srcOffset","srcLengthOverride"]],copyBufferSubData:[["readTarget","writeTarget","readOffset","writeOffset","size"]],copyTexImage2D:[["target","level","internalformat","x","y","width","height","border"]],copyTexSubImage2D:[["target","level","xoffset","yoffset","x","y","width","height"]],copyTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","x","y","width","height"]],createBuffer:[[]],createFramebuffer:[[]],createProgram:[[]],createQuery:[[]],createRenderbuffer:[[]],createSampler:[[]],createShader:[["type"]],createTexture:[[]],createTransformFeedback:[[]],createVertexArray:[[]],cullFace:[["mode"]],deleteBuffer:[["buffer"]],deleteFramebuffer:[["framebuffer"]],deleteProgram:[["program"]],deleteQuery:[["query"]],deleteRenderbuffer:[["renderbuffer"]],deleteSampler:[["sampler"]],deleteShader:[["shader"]],deleteSync:[["sync"]],deleteTexture:[["texture"]],deleteTransformFeedback:[["tf"]],deleteVertexArray:[["vertexArray"]],depthFunc:[["func"]],depthMask:[["flag"]],depthRange:[["zNear","zFar"]],detachShader:[["program","shader"]],disable:[["cap"]],disableVertexAttribArray:[["index"]],drawArrays:[["mode","first","count"]],drawArraysInstanced:[["mode","first","count","instanceCount"]],drawBuffers:[["buffers"]],drawElements:[["mode","count","type","offset"]],drawElementsInstanced:[["mode","count","type","offset","instanceCount"]],drawRangeElements:[["mode","start","end","count","type","offset"]],enable:[["cap"]],enableVertexAttribArray:[["index"]],endQuery:[["target"]],endTransformFeedback:[[]],fenceSync:[["condition","flags"]],finish:[[]],flush:[[]],framebufferRenderbuffer:[["target","attachment","renderbuffertarget","renderbuffer"]],framebufferTexture2D:[["target","attachment","textarget","texture","level"]],framebufferTextureLayer:[["target","attachment","texture","level","layer"]],frontFace:[["mode"]],generateMipmap:[["target"]],getActiveAttrib:[["program","index"]],getActiveUniform:[["program","index"]],getActiveUniformBlockName:[["program","uniformBlockIndex"]],getActiveUniformBlockParameter:[["program","uniformBlockIndex","pname"]],getActiveUniforms:[["program","uniformIndices","pname"]],getAttachedShaders:[["program"]],getAttribLocation:[["program","name"]],getBufferParameter:[["target","pname"]],getBufferSubData:[["target","srcByteOffset","dstBuffer","dstOffset","length"]],getContextAttributes:[[]],getError:[[]],getExtension:[["extensionName"],["name"]],getFragDataLocation:[["program","name"]],getFramebufferAttachmentParameter:[["target","attachment","pname"]],getIndexedParameter:[["target","index"]],getInternalformatParameter:[["target","internalformat","pname"]],getParameter:[["pname"]],getProgramInfoLog:[["program"]],getProgramParameter:[["program","pname"]],getQuery:[["target","pname"]],getQueryParameter:[["query","pname"]],getRenderbufferParameter:[["target","pname"]],getSamplerParameter:[["sampler","pname"]],getShaderInfoLog:[["shader"]],getShaderParameter:[["shader","pname"]],getShaderPrecisionFormat:[["shadertype","precisiontype"]],getShaderSource:[["shader"]],getSupportedExtensions:[[]],getSyncParameter:[["sync","pname"]],getTexParameter:[["target","pname"]],getTransformFeedbackVarying:[["program","index"]],getUniform:[["program","location"]],getUniformBlockIndex:[["program","uniformBlockName"]],getUniformIndices:[["program","uniformNames"]],getUniformLocation:[["program","name"]],getVertexAttrib:[["index","pname"]],getVertexAttribOffset:[["index","pname"]],hint:[["target","mode"]],invalidateFramebuffer:[["target","attachments"]],invalidateSubFramebuffer:[["target","attachments","x","y","width","height"]],isBuffer:[["buffer"]],isContextLost:[[]],isEnabled:[["cap"]],isFramebuffer:[["framebuffer"]],isProgram:[["program"]],isQuery:[["query"]],isRenderbuffer:[["renderbuffer"]],isSampler:[["sampler"]],isShader:[["shader"]],isSync:[["sync"]],isTexture:[["texture"]],isTransformFeedback:[["tf"]],isVertexArray:[["vertexArray"]],lineWidth:[["width"]],linkProgram:[["program"]],pauseTransformFeedback:[[]],pixelStorei:[["pname","param"]],polygonOffset:[["factor","units"]],readBuffer:[["src"]],readPixels:[["x","y","width","height","format","type","dstData"],["x","y","width","height","format","type","offset"],["x","y","width","height","format","type","pixels"],["x","y","width","height","format","type","dstData","dstOffset"]],renderbufferStorage:[["target","internalformat","width","height"]],renderbufferStorageMultisample:[["target","samples","internalformat","width","height"]],resumeTransformFeedback:[[]],sampleCoverage:[["value","invert"]],samplerParameterf:[["sampler","pname","param"]],samplerParameteri:[["sampler","pname","param"]],scissor:[["x","y","width","height"]],shaderSource:[["shader","source"]],stencilFunc:[["func","ref","mask"]],stencilFuncSeparate:[["face","func","ref","mask"]],stencilMask:[["mask"]],stencilMaskSeparate:[["face","mask"]],stencilOp:[["fail","zfail","zpass"]],stencilOpSeparate:[["face","fail","zfail","zpass"]],texImage2D:[["target","level","internalformat","format","type","source"],["target","level","internalformat","width","height","border","format","type","pboOffset"],["target","level","internalformat","width","height","border","format","type","pixels"],["target","level","internalformat","width","height","border","format","type","source"],["target","level","internalformat","width","height","border","format","type","srcData","srcOffset"]],texImage3D:[["target","level","internalformat","width","height","depth","border","format","type","pboOffset"],["target","level","internalformat","width","height","depth","border","format","type","source"],["target","level","internalformat","width","height","depth","border","format","type","srcData"],["target","level","internalformat","width","height","depth","border","format","type","srcData","srcOffset"]],texParameterf:[["target","pname","param"]],texParameteri:[["target","pname","param"]],texStorage2D:[["target","levels","internalformat","width","height"]],texStorage3D:[["target","levels","internalformat","width","height","depth"]],texSubImage2D:[["target","level","xoffset","yoffset","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","pboOffset"],["target","level","xoffset","yoffset","width","height","format","type","pixels"],["target","level","xoffset","yoffset","width","height","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","srcData","srcOffset"]],texSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","pboOffset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","source"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","srcData","srcOffset"]],transformFeedbackVaryings:[["program","varyings","bufferMode"]],uniform1f:[["location","x"]],uniform1fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1i:[["location","x"]],uniform1iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1ui:[["location","v0"]],uniform1uiv:[["location","data","srcOffset","srcLength"]],uniform2f:[["location","x","y"]],uniform2fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2i:[["location","x","y"]],uniform2iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2ui:[["location","v0","v1"]],uniform2uiv:[["location","data","srcOffset","srcLength"]],uniform3f:[["location","x","y","z"]],uniform3fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3i:[["location","x","y","z"]],uniform3iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3ui:[["location","v0","v1","v2"]],uniform3uiv:[["location","data","srcOffset","srcLength"]],uniform4f:[["location","x","y","z","w"]],uniform4fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4i:[["location","x","y","z","w"]],uniform4iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4ui:[["location","v0","v1","v2","v3"]],uniform4uiv:[["location","data","srcOffset","srcLength"]],uniformBlockBinding:[["program","uniformBlockIndex","uniformBlockBinding"]],uniformMatrix2fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x3fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x3fv:[["location","transpose","data","srcOffset","srcLength"]],useProgram:[["program"]],validateProgram:[["program"]],vertexAttrib1f:[["index","x"]],vertexAttrib1fv:[["index","values"]],vertexAttrib2f:[["index","x","y"]],vertexAttrib2fv:[["index","values"]],vertexAttrib3f:[["index","x","y","z"]],vertexAttrib3fv:[["index","values"]],vertexAttrib4f:[["index","x","y","z","w"]],vertexAttrib4fv:[["index","values"]],vertexAttribDivisor:[["index","divisor"]],vertexAttribI4i:[["index","x","y","z","w"]],vertexAttribI4iv:[["index","values"]],vertexAttribI4ui:[["index","x","y","z","w"]],vertexAttribI4uiv:[["index","values"]],vertexAttribIPointer:[["index","size","type","stride","offset"]],vertexAttribPointer:[["index","size","type","normalized","stride","offset"]],viewport:[["x","y","width","height"]],waitSync:[["sync","flags","timeout"]]};class Uh{static getNames(e,t){const n=Bh[e];if(!n||0===n.length)return null;for(const e of n)if(e.length===t)return e;let r=null;for(const e of n)e.length>=t&&(null===r||e.lengthi.length&&(i=e);return i}static getName(e,t,n){const r=Uh.getNames(e,n);return r&&t>=0&&t{const e={};for(let t=0;t<64;t++)e["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;return e})();class qh{constructor(e){this.sources=e.sources||[],this.names=e.names||[],this.sourceRoot=e.sourceRoot||"",this.lines=qh.parseMappings(e.mappings||"")}originalPositionFor(e,t){const n={source:null,line:null,column:null,name:null},r=e-1;if(r<0||r>=this.lines.length)return n;const i=this.lines[r];if(!i||0===i.length)return n;const s=this.findSegment(i,t);if(!s)return n;const o=s.sourceIndex>=0&&s.sourceIndex=0&&s.nameIndex>1,o=e[s];o.generatedColumn<=t?(i=o,n=s+1):r=s-1}return i}static parseMappings(e){const t=[];let n=0,r=0,i=0,s=0;const o=e.split(";");for(let e=0;e0){const e=a.split(",");for(let t=0;t=4&&(n+=o[1],r+=o[2],i+=o[3],a.sourceIndex=n,a.originalLine=r,a.originalColumn=i,o.length>=5&&(s+=o[4],a.nameIndex=s)),l.push(a)}}l.sort((e,t)=>e.generatedColumn-t.generatedColumn),t.push(l)}return t}static decodeSegment(e){const t=[];let n=0;for(;n>>=1,t.push(o?-r:r)}return t}}var Qh=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})};class Zh{constructor(e){this.cache=new Map,this.inflight=new Map,this.fetchFn=e||("undefined"!=typeof fetch?fetch.bind(globalThis):void 0)}resolveFrames(e){return Qh(this,void 0,void 0,function*(){return e&&0!==e.length?Promise.all(e.map(e=>this.resolveFrame(e))):e||[]})}resolveFrame(e){return Qh(this,void 0,void 0,function*(){const t=Zh.parseFrame(e);if(!t)return e;let n;try{n=yield this.getConsumer(t.url)}catch(t){return e}if(!n)return e;const r=n.originalPositionFor(t.line,t.column);return r.source&&null!==r.line?Zh.formatFrame(t.functionName,r.name,r.source,r.line,r.column||0):e})}static parseFrame(e){if(!e)return null;let t=e.match(/^(.*?)\s*\((.+):(\d+):(\d+)\)\s*$/);return t?{functionName:t[1].trim(),url:t[2],line:parseInt(t[3],10),column:parseInt(t[4],10)}:(t=e.match(/^\s*(.+):(\d+):(\d+)\s*$/),t?{functionName:"",url:t[1].trim(),line:parseInt(t[2],10),column:parseInt(t[3],10)}:null)}static formatFrame(e,t,n,r,i){const s=t||e,o=n+":"+r+":"+i;return s?s+" ("+o+")":o}getConsumer(e){return Qh(this,void 0,void 0,function*(){if(this.cache.has(e))return this.cache.get(e);const t=this.inflight.get(e);if(t)return t;const n=this.loadConsumer(e).then(t=>(this.cache.set(e,t),this.inflight.delete(e),t)).catch(()=>(this.cache.set(e,null),this.inflight.delete(e),null));return this.inflight.set(e,n),n})}loadConsumer(e){return Qh(this,void 0,void 0,function*(){if(!this.fetchFn)return null;const t=yield this.fetchFn(e);if(!t.ok)return null;const n=yield t.text(),r=Zh.extractSourceMappingURL(n);if(!r)return null;let i;if(0===r.indexOf("data:"))i=Zh.parseDataUri(r);else{const t=Zh.resolveUrl(r,e),n=yield this.fetchFn(t);if(!n.ok)return null;i=yield n.json()}return i&&"string"==typeof i.mappings?new qh(i):null})}static extractSourceMappingURL(e){const t=/\/\/[#@]\s*sourceMappingURL=(\S+)\s*$/gm;let n,r=null;for(;null!==(n=t.exec(e));)r=n[1];return r}static parseDataUri(e){const t=e.indexOf(",");if(-1===t)return null;const n=e.substring(0,t),r=e.substring(t+1);try{const e=/;base64/i.test(n)?Zh.decodeBase64(r):decodeURIComponent(r);return JSON.parse(e)}catch(e){return null}}static decodeBase64(e){if("function"==typeof atob)return atob(e);const t=globalThis.Buffer;if(t)return t.from(e,"base64").toString("utf-8");throw new Error("No base64 decoder available.")}static resolveUrl(e,t){try{return new URL(e,t).href}catch(t){return e}}}function Jh(e){return e&&(e.text||e.name)||""}function ed(e,t){const n=[];if(!e||!t)return n;const r=e.DrawCall,i=t.DrawCall;ad("uniform",r&&r.uniforms,i&&i.uniforms,n),ad("uniformBlock",r&&r.uniformBlocks,i&&i.uniformBlocks,n);const s=sd(e,t);for(const r of s){if(td[r])continue;const i=e[r],s=t[r];(rd(i)||rd(s))&&od(i,s,r,n)}return n}const td={id:!0,name:!0,commandArguments:!0,result:!0,status:!0,marker:!0,text:!0,startTime:!0,commandEndTime:!0,endTime:!0,stackTrace:!0,consumeCommandId:!0,VisualState:!0},nd={__SPECTOR_Object_TAG:!0,__SPECTOR_Object_CustomData:!0,__SPECTOR_Metadata:!0,customData:!0,visual:!0,visualPixels:!0,VisualState:!0,texture:!0,sampler:!0,location:!0,source:!0,translatedSource:!0,analyserName:!0,uniforms:!0,uniformBlocks:!0,length:!0};function rd(e){return null!==e&&"object"==typeof e}function id(e){if(!rd(e))return null;const t=e.__SPECTOR_Object_TAG||("string"==typeof e.typeName&&"id"in e?e:null);return t&&"string"==typeof t.typeName?t.typeName:null}function sd(e,t){const n=[],r={},i=e=>{if(rd(e))for(const t in e)e.hasOwnProperty(t)&&!r[t]&&(r[t]=!0,n.push(t))};return i(e),i(t),n}function od(e,t,n,r,i=0){const s=id(e),o=id(t);if(null!==s||null!==o){const e=null!==s?s:"(absent)",t=null!==o?o:"(absent)";return void(e!==t&&r.push({path:n,previous:e,current:t}))}const a=rd(e),l=rd(t);if(!a&&!l){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}if(a!==l||i>=8){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}for(const s of sd(e,t))nd[s]||od(e?e[s]:void 0,t?t[s]:void 0,n+"."+s,r,i+1)}function ad(e,t,n,r){const i=hd(t),s=hd(n),o=[],a={};for(const e in i)i.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const e in s)s.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const t of o){const n=i.hasOwnProperty(t)?i[t]:void 0,o=s.hasOwnProperty(t)?s[t]:void 0,a=n?dd(n.value):"(absent)",l=o?dd(o.value):"(absent)";a!==l&&r.push({path:e+" "+t,previous:a,current:l}),ld(e+" "+t,n,o,r)}}function ld(e,t,n,r){const i=t&&t.texture,s=n&&n.texture;(rd(i)||rd(s))&&cd(e+" texture",i,s,r);const o=t&&t.textures,a=n&&n.textures,l=Array.isArray(o)?o.length:0,u=Array.isArray(a)?a.length:0,c=Math.max(l,u);for(let t=0;t0?o[t]:void 0,u>0?a[t]:void 0,r)}const ud=["width","height","depth","format","internalFormat","textureType"];function cd(e,t,n,r){(rd(t)||rd(n))&&(function(e,t,n,r){for(const i of ud){const s=t?t[i]:void 0,o=n?n[i]:void 0;if(void 0===s&&void 0===o)continue;const a=dd(s),l=dd(o);a!==l&&r.push({path:e+" "+i,previous:a,current:l})}}(e,t,n,r),function(e,t,n,r){if(rd(t)||rd(n))for(const i of sd(t,n)){const s=t?t[i]:void 0,o=n?n[i]:void 0,a="string"==typeof s,l="string"==typeof o;(a||l)&&s!==o&&r.push({path:e+" ("+i+")",previous:a?"(image)":"(absent)",current:l?"(image)":"(absent)",previousImage:a?s:void 0,currentImage:l?o:void 0})}}(e,t&&t.visual,n&&n.visual,r))}function hd(e){const t={};if(Array.isArray(e))for(const n of e)n&&"string"==typeof n.name&&(t[n.name]=n);return t}function dd(e){if(void 0===e)return"(absent)";if(null===e)return"null";try{return JSON.stringify(e)}catch(t){return String(e)}}function fd(e,t){for(let n=0;n{if(this.store.getSnapshot().currentCapture)switch(e){case 0:this._displayCaptures();break;case 40:this._displayCurrentCapture();break;case 10:this._displayInformation();break;case 20:this._displayInitState();break;case 30:this._displayEndState();break;case 60:this._displayCompare()}else this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))},this.handleSearchTextChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{searchText:e})),this._search(e)},this.handleCompareOnlyDifferencesChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{compareOnlyDifferences:e}))},this.handleCompareCommandSelected=e=>{null!=e&&(this._currentCommandId=e,this._displayCurrentCapture())},this.handleCommandSelected=e=>{this.selectCommand(e)},this.openTextureViewer=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{textureViewer:{open:!0,src:e.src,label:e.label,pixelated:e.pixelated,raw:e.raw||null}}))},this.closeTextureViewer=()=>{this.store.setState(e=>Object.assign(Object.assign({},e),{textureViewer:Object.assign(Object.assign({},e.textureViewer),{open:!1})}))},this.handleVisualStateSelected=e=>{this.selectVisualState(e)},this.handleVertexSelected=e=>{this.selectCommand(e),this._openShader(!1)},this.handleFragmentSelected=e=>{this.selectCommand(e),this._openShader(!0)},this.handleShaderSelected=e=>{var t;const n=null===(t=this.store.getSnapshot().commands[e])||void 0===t?void 0:t.capture.shader;n&&(this.selectCommand(e),this._openCapturedShader(n))},this.handleShaderSourceOpen=(e,t)=>{this._openCapturedShader(e,t)},this.handleSourceCodeChanged=e=>{this.onSourceCodeChanged.trigger(e)},this.handleSourceCodeClose=()=>{this._displayCurrentCapture()},this.handleSourceCodeTabChange=(e,t)=>{this.store.setState(n=>n.sourceCodeState?Object.assign(Object.assign({},n),{sourceCodeState:Object.assign(Object.assign({},n.sourceCodeState),{fragment:e,translated:t})}):n)},this.handleBeautifyChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{beautify:e})}):t)},this.handlePreprocessChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{preprocessed:e})}):t)},this.handleSaveRequested=e=>{this.saveCapture(e)},this.handleCaptureLoaded=e=>{this.addCapture(e)},this.handleClose=()=>{this.hide()},this._rootPlaceHolder=e||document.body,this.onSourceCodeChanged=new l,this.store=new ft(Object.assign({},pd)),this._container=document.createElement("div"),this._container.className="spector-react-result-view",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(yt.Provider,{value:this},(0,dt.createElement)(Mh))),this._rootPlaceHolder.addEventListener("keydown",e=>{if(40!==this.store.getSnapshot().menuStatus)return;const t=e.keyCode;38===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousCommand()):40===t?(e.preventDefault(),e.stopPropagation(),this._selectNextCommand()):33===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousVisualState()):34===t&&(e.preventDefault(),e.stopPropagation(),this._selectNextVisualState())})}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}addCapture(e){return this.store.setState(t=>{const n=t.captures.map(e=>({capture:e.capture,active:!1}));return Object.assign(Object.assign({},t),{captures:[{capture:e,active:!0},...n],currentCapture:e})}),this._currentCommandId=-1,this._displayCurrentCapture(),0}selectCapture(e){this._currentCommandId=-1,this.store.setState(t=>{var n,r;const i=t.captures.map((t,n)=>({capture:t.capture,active:n===e}));return Object.assign(Object.assign({},t),{captures:i,currentCapture:null!==(r=null===(n=i[e])||void 0===n?void 0:n.capture)&&void 0!==r?r:null})}),this._displayCurrentCapture()}selectCommand(e){const t=this.store.getSnapshot();if(e<0||e>=t.commands.length)return;const n=t.commands[e];this._currentCommandId=n.capture.id;const r=n.visualStateIndex,i=this._buildCommandDetail(e,t.commands,t.visualStates);this.store.setState(t=>Object.assign(Object.assign({},t),{commands:t.commands.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentCommandIndex:e,visualStates:t.visualStates.map((e,t)=>e.active!==(t===r)?Object.assign(Object.assign({},e),{active:t===r}):e),currentVisualStateIndex:r,commandDetailData:i}))}selectVisualState(e){const t=this.store.getSnapshot();if(e<0||e>=t.visualStates.length)return;const n=t.visualStates[e].commandIndex;if(n===Number.MIN_VALUE)return void this._displayInitState();if(n===Number.MAX_VALUE)return void this._displayEndState();n>=0&&(this._currentCommandId=t.commands[n].capture.id);const r=n>=0?this._buildCommandDetail(n,t.commands,t.visualStates):t.commandDetailData;this.store.setState(t=>Object.assign(Object.assign({},t),{visualStates:t.visualStates.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentVisualStateIndex:e,commands:n>=0?t.commands.map((e,t)=>e.active!==(t===n)?Object.assign(Object.assign({},e),{active:t===n}):e):t.commands,currentCommandIndex:n>=0?n:t.currentCommandIndex,commandDetailData:r}))}showSourceCodeError(e){this.store.setState(t=>Object.assign(Object.assign({},t),{sourceCodeError:e}))}saveCapture(e){const t=JSON.stringify(e,null,4),n=new Blob([t],{type:"octet/stream"}),r="capture "+new Date(e.startTime).toTimeString().split(" ")[0]+".json",i=document.createElement("a"),s=window.URL.createObjectURL(n);i.setAttribute("href",s),i.setAttribute("download",r),i.click()}_displayCaptures(){this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))}_displayCompare(){const e=this.store.getSnapshot(),t=e.captures.findIndex(e=>e.active),n=t>=0?e.captures[t]:null,r=n?e.captures[t+1]:null;if(!n||!r)return void this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:60,canCompare:!1,compareRows:[],compareSummary:{added:0,removed:0,changed:0,unchanged:0},compareLabel:""}));const i=function(e,t){const n=function(e,t){const n=e.length,r=t.length,i=e.map(Jh),s=t.map(Jh),o=[];for(let e=0;e<=n;e++)o.push(new Array(r+1).fill(0));for(let e=n-1;e>=0;e--)for(let t=r-1;t>=0;t--)o[e][t]=i[e]===s[t]?o[e+1][t+1]+1:Math.max(o[e+1][t],o[e][t+1]);const a=[];let l=[];const u=()=>{for(const e of l)a.push(e);l=[]};let c=0,h=0;for(;c0?a.push({type:"changed",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id,fieldDiffs:n}):a.push({type:"unchanged",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id}),c++,h++}else if(o[c+1][h]>=o[c][h+1])l.push({type:"removed",name:e[c].name,previousText:e[c].text,indexA:c}),c++;else{const n=fd(l,t[h].name);n?a.push({type:"changed",name:t[h].name,previousText:n.previousText,currentText:t[h].text,indexA:n.indexA,indexB:h,commandId:t[h].id,fieldDiffs:ed(e[n.indexA],t[h])}):(u(),a.push({type:"added",name:t[h].name,currentText:t[h].text,indexB:h,commandId:t[h].id})),h++}for(;cObject.assign(Object.assign({},e),{menuStatus:60,canCompare:!0,compareRows:i.rows,compareSummary:i.summary,compareLabel:s}))}static _captureLabel(e){try{return new Date(e.startTime).toTimeString().split(" ")[0]}catch(e){return"capture"}}_displayInformation(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];zh(n,"Canvas",t.canvas,e.searchText),zh(n,"Context",t.context,e.searchText);const r=[];for(const n of t.analyses){const t="Primitives"===n.analyserName?"Vertices count":n.analyserName;zh(r,t,n,e.searchText)}zh(r,"Frame Memory Changes",t.frameMemory,e.searchText),zh(r,"Total Memory (seconds since application start: bytes)",t.memory,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:10,commandCount:t.commands.length,informationLeft:n,informationRight:r}))}_displayInitState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.initState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:20,commandCount:t.commands.length,initStateData:n}))}_displayEndState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.endState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:30,commandCount:t.commands.length,endStateData:n}))}_displayCurrentCapture(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=e.searchText,r=e.captures.map(e=>({capture:e.capture,active:e.capture===t})),i=[];i.push({VisualState:t.initState.VisualState,time:t.startTime,commandIndex:Number.MIN_VALUE,active:!1,previousVisualStateIndex:-1,nextVisualStateIndex:-1});const s=[];let o=0,a=!1,l=-1,u=-1;for(let e=0;e0?c-1:-1,nextCommandIndex:-1,visualStateIndex:o,active:!1};if(c>0&&(s[c-1].nextCommandIndex=c),r.VisualState){const e=i.length,t=i.length-1,n={VisualState:r.VisualState,time:r.endTime,commandIndex:c,active:!1,previousVisualStateIndex:t,nextVisualStateIndex:-1};i[t].nextVisualStateIndex=e,i.push(n),o=e,a=!0}else a||(i[0].commandIndex=c,a=!0);h.visualStateIndex=o,s.push(h),(-1===this._currentCommandId&&0===c||this._currentCommandId===r.id)&&(l=c,u=o)}l>=0&&(s[l].active=!0,this._currentCommandId=s[l].capture.id),u>=0&&(i[u].active=!0);let c=[];l>=0&&(c=this._buildCommandDetail(l,s,i)),this.store.setState(e=>Object.assign(Object.assign({},e),{captures:r,menuStatus:40,commandCount:t.commands.length,commands:s,currentCommandIndex:l,visualStates:i,currentVisualStateIndex:u,sourceCodeState:null,sourceCodeError:"",commandDetailData:c}))}_openShader(e){const t=this.store.getSnapshot();if(t.currentCommandIndex<0||t.currentCommandIndex>=t.commands.length)return;const n=t.commands[t.currentCommandIndex].capture.DrawCall;if(!n||!n.shaders||n.shaders.length<2)return;const r={programId:n.programStatus.program.__SPECTOR_Object_TAG.id,nameVertex:n.shaders[0].name,nameFragment:n.shaders[1].name,sourceVertex:n.shaders[0].source,sourceFragment:n.shaders[1].source,translatedSourceVertex:n.shaders[0].translatedSource,translatedSourceFragment:n.shaders[1].translatedSource,fragment:e,translated:!1,editable:n.programStatus.RECOMPILABLE,beautify:!0,preprocessed:!1,singleShader:!1,sourceVertexLog:n.shaders[0].infoLog||"",sourceFragmentLog:n.shaders[1].infoLog||"",programLog:n.programStatus.infoLog||""},i=this._buildCommandDetail(t.currentCommandIndex,t.commands,t.visualStates);this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:"",commandDetailData:i}))}_openCapturedShader(e,t=""){if(!e||"string"!=typeof e.source)return;const n="FRAGMENT_SHADER"===e.shaderType,r={programId:-1,nameVertex:n?"":e.name,nameFragment:n?e.name:"",sourceVertex:n?"":e.source,sourceFragment:n?e.source:"",translatedSourceVertex:n?"":e.translatedSource||"",translatedSourceFragment:n&&e.translatedSource||"",fragment:n,translated:!1,editable:!1,beautify:!0,preprocessed:!1,singleShader:!0,sourceVertexLog:n?"":e.infoLog||"",sourceFragmentLog:n&&e.infoLog||"",programLog:t};this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:""}))}_buildCommandDetail(e,t,n){if(e<0||e>=t.length)return[];const r=t[e],i=n[r.visualStateIndex],s=this._resolvedStackTraces.get(r.capture.id),o=function(e,t,n){const r=[];t&&r.push({type:"visualState",visualState:t});let i="Unknown";switch(e.status){case 50:i="Deprecated";break;case 10:i="Unused";break;case 20:i="Disabled";break;case 30:i="Redundant";break;case 40:i="Valid"}const s=Ph.getMDNLink(e.name);e.result?zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,result:e.result,status:i},""):"LOG"!==e.name&&zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,status:i},"");for(const t in e)"VisualState"!==t&&"result"!==t&&("commandArguments"===t&&Array.isArray(e.commandArguments)?Kh(r,e.name,e.commandArguments):Xh(r,t,e)||("stackTrace"===t&&Array.isArray(e.stackTrace)?zh(r,"stackTrace",n||e.stackTrace,""):"object"==typeof e[t]&&zh(r,t,e[t],"")));return r}(r.capture,null==i?void 0:i.VisualState,s);return s||this._resolveStackTraceAsync(r.capture),o}_resolveStackTraceAsync(e){const t=e.id;this._resolvedStackTraces.has(t)||this._resolvingStackTraces.has(t)||e.stackTrace&&0!==e.stackTrace.length&&(this._resolvingStackTraces.add(t),this._sourceMapResolver.resolveFrames(e.stackTrace).then(n=>{this._resolvingStackTraces.delete(t),this._resolvedStackTraces.set(t,n);let r=!1;for(let t=0;tObject.assign(Object.assign({},t),{commandDetailData:e}))}}).catch(()=>{this._resolvingStackTraces.delete(t)}))}_selectPreviousCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.previousCommandIndex<0||this.selectCommand(t.previousCommandIndex)}_selectNextCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.nextCommandIndex<0||this.selectCommand(t.nextCommandIndex)}_selectPreviousVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.previousVisualStateIndex<0||this.selectVisualState(t.previousVisualStateIndex)}_selectNextVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.nextVisualStateIndex<0||this.selectVisualState(t.nextVisualStateIndex)}_search(e){switch(this.store.getSnapshot().menuStatus){case 0:case 40:this._displayCurrentCapture();break;case 30:this._displayEndState();break;case 10:this._displayInformation();break;case 20:this._displayInitState()}this.store.setState(e=>Object.assign(Object.assign({},e),{searchText:""}))}}class gd{constructor(e,t={}){this.worker=e,this.captureTimeout=t.captureTimeout||1e4,this.disposed=!1,this.captureTimer=null,this.onCapture=new l,this.onCaptureStarted=new l,this.onError=new l,this.onFps=new l,this.onContextReady=new l,this.messageHandler=this.handleMessage.bind(this),this.worker.addEventListener("message",this.messageHandler)}triggerCapture(e=0,t=0,n=!1,r=!1){if(this.disposed)return;this.clearCaptureTimer();const i={type:"spector:trigger-capture",version:1,canvasIndex:e,commandCount:t,quickCapture:n,fullCapture:r};this.worker.postMessage(i),this.captureTimer=setTimeout(()=>{this.onError.trigger("Capture timed out after "+this.captureTimeout+"ms"),this.captureTimer=null},this.captureTimeout)}dispose(){this.disposed||(this.disposed=!0,this.clearCaptureTimer(),this.worker.removeEventListener("message",this.messageHandler),this.onCapture.clear(),this.onCaptureStarted.clear(),this.onError.clear(),this.onFps.clear(),this.onContextReady.clear())}handleMessage(e){const t=e.data;if(!function(e){return null!=e&&"object"==typeof e&&"string"==typeof e.type&&0===e.type.indexOf("spector:")}(t))return;const n=t;switch(n.type){case"spector:context-ready":this.onContextReady.trigger({canvasCount:n.canvasCount,canvasWidth:n.canvasWidth,canvasHeight:n.canvasHeight});break;case"spector:capture-started":this.onCaptureStarted.trigger(void 0);break;case"spector:capture-complete":this.clearCaptureTimer(),this.onCapture.trigger(n.capture);break;case"spector:error":this.clearCaptureTimer(),this.onError.trigger(n.error);break;case"spector:fps":this.onFps.trigger(n.fps)}}clearCaptureTimer(){null!=this.captureTimer&&(clearTimeout(this.captureTimer),this.captureTimer=null)}}var Ed=n(72),vd=n.n(Ed),Cd=n(825),Dd=n.n(Cd),Sd=n(659),Ad=n.n(Sd),_d=n(56),yd=n.n(_d),bd=n(540),Td=n.n(bd),Rd=n(113),xd=n.n(Rd),wd=n(377),Fd={};Fd.styleTagTransform=xd(),Fd.setAttributes=yd(),Fd.insert=Ad().bind(null,"html"),Fd.domAPI=Dd(),Fd.insertStyleElement=Td(),vd()(wd.A,Fd),wd.A&&wd.A.locals&&wd.A.locals;var Nd=n(160),Ld={};Ld.styleTagTransform=xd(),Ld.setAttributes=yd(),Ld.insert=Ad().bind(null,"html"),Ld.domAPI=Dd(),Ld.insertStyleElement=Td(),vd()(Nd.A,Ld),Nd.A&&Nd.A.locals&&Nd.A.locals;class Od{constructor(e){this.timeSpy=e,this.init()}spyXRSession(e){this.currentXRSession&&this.unspyXRSession();for(const e of at.getRequestAnimationFrameFunctionNames())y.resetOriginFunction(this.timeSpy.getSpiedScope(),e);this.timeSpy.spyRequestAnimationFrame("requestAnimationFrame",e),this.currentXRSession=e}unspyXRSession(){if(this.currentXRSession){y.resetOriginFunction(this.currentXRSession,"requestAnimationFrame"),this.currentXRSession=void 0;for(const e of at.getRequestAnimationFrameFunctionNames())this.timeSpy.spyRequestAnimationFrame(e,this.timeSpy.getSpiedScope())}}init(){if(!navigator.xr)return;class e extends XRWebGLLayer{constructor(e,t,n){super(e,t,n),this.glContext=t}getContext(){return this.glContext}}class t extends XRWebGLBinding{constructor(e,t){super(e,t),this.glContext=t}createProjectionLayer(e){const t=super.createProjectionLayer(e);return t.glContext=this.glContext,t}}window.XRWebGLLayer=e,window.XRWebGLBinding=t;const n=navigator.xr.requestSession;Object.defineProperty(navigator.xr,"requestSessionInternal",{writable:!0}),navigator.xr.requestSessionInternal=n,Object.defineProperty(navigator.xr,"requestSession",{writable:!0}),navigator.xr.requestSession=(e,t)=>((e,t)=>navigator.xr.requestSessionInternal(e,t).then(e=>{const t=e;return t._updateRenderState=e.updateRenderState,t.updateRenderState=e=>function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){if(e.baseLayer){const n=e.baseLayer;t.glContext=n.getContext()}if(e.layers)for(const n of e.layers){const e=n;e.glContext&&(t.glContext=e.glContext)}return t._updateRenderState(e)}),this.spyXRSession(t),e.addEventListener("end",()=>{this.unspyXRSession()}),Promise.resolve(e)}))(e,t)}}const Id={CaptureMenu:_t,ResultView:md};class kd{static getFirstAvailable3dContext(e){return this.tryGetContextFromHelperField(e)||this.tryGetContextFromCanvas(e,"webgl")||this.tryGetContextFromCanvas(e,"experimental-webgl")||this.tryGetContextFromCanvas(e,"webgl2")||this.tryGetContextFromCanvas(e,"experimental-webgl2")}static tryGetContextFromHelperField(e){const t=e instanceof HTMLCanvasElement?e.getAttribute("__spector_context_type"):e.__spector_context_type;if(t)return this.tryGetContextFromCanvas(e,t)}static tryGetContextFromCanvas(e,t){let n;try{n=e.getContext(t)}catch(e){}return n}constructor(e={}){this.noFrameTimeout=-1,this.options=Object.assign({enableXRCapture:!1},e),this.captureNextFrames=0,this.captureNextCommands=0,this.quickCapture=!1,this.fullCapture=!1,this.retry=0,this.contexts=[],this.workerBridges=new Map,this.timeSpy=new at,this.onCaptureStarted=new l,this.onCapture=new l,this.onError=new l,this.timeSpy.onFrameStart.add(this.onFrameStart,this),this.timeSpy.onFrameEnd.add(this.onFrameEnd,this),this.timeSpy.onError.add(this.onErrorInternal,this),ct.install(),this.options.enableXRCapture&&(this.xrSpy=new Od(this.timeSpy))}displayUI(e=!1){this.captureMenu||(this.getCaptureUI(),this.captureMenu.onPauseRequested.add(this.pause,this),this.captureMenu.onPlayRequested.add(this.play,this),this.captureMenu.onPlayNextFrameRequested.add(this.playNextFrame,this),this.captureMenu.onCaptureRequested.add(e=>{e&&(e.ref instanceof Worker?this.captureWorker(e.ref):this.captureCanvas(e.ref))},this),setInterval(()=>{this.captureMenu.setFPS(this.getFps())},1e3),e||this.captureMenu.trackPageCanvases(),this.captureMenu.display()),this.resultView||(this.getResultUI(),this.onCapture.add(e=>{this.resultView.display(),this.resultView.addCapture(e)}))}getResultUI(){return this.resultView||(this.resultView=new md,this.resultView.onSourceCodeChanged.add(e=>{this.rebuildProgramFromProgramId(e.programId,e.sourceVertex,e.sourceFragment,t=>{this.referenceNewProgram(e.programId,t),this.resultView.showSourceCodeError(null)},e=>{this.resultView.showSourceCodeError(e)})})),this.resultView}getCaptureUI(){return this.captureMenu||(this.captureMenu=new _t),this.captureMenu}rebuildProgramFromProgramId(e,t,n,r,i){const s=Pe.getFromGlobalStore(e);this.rebuildProgram(s,t,n,r,i)}rebuildProgram(e,t,n,r,i){o.rebuildProgram(e,t,n,r,i)}referenceNewProgram(e,t){Pe.updateInGlobalStore(e,t)}pause(){this.timeSpy.changeSpeedRatio(0)}play(){this.timeSpy.changeSpeedRatio(1)}playNextFrame(){this.timeSpy.playNextFrame()}drawOnlyEveryXFrame(e){this.timeSpy.changeSpeedRatio(e)}getFps(){return this.timeSpy.getFps()}spyCanvases(){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt,this.canvasSpy.onContextRequested.add(this.spyContext,this))}spyCanvas(e){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt(e),this.canvasSpy.onContextRequested.add(this.spyContext,this))}getAvailableContexts(){return this.contexts}setShaderCompileDelay(e){ct.install(),ct.setDelay(e)}clearShaderCompileDelay(){ct.setDelay(0)}getShaderCompileDelay(){return ct.getDelay()}captureCanvas(e,t=0,n=!1,r=!1){const i=this.getAvailableContextSpyByCanvas(e);if(i)this.captureContextSpy(i,t,n,r);else{const i=kd.getFirstAvailable3dContext(e);i?this.captureContext(i,t,n,r):a.error("No webgl context available on the chosen canvas.")}}captureContext(e,t=0,n=!1,r=!1){let i=this.getAvailableContextSpyByCanvas(e.canvas);i||(i=e.getIndexedParameter?new ot({context:e,version:2,recordAlways:!1}):new ot({context:e,version:1,recordAlways:!1}),i.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:i.context.canvas,contextSpy:i})),i&&this.captureContextSpy(i,t,n,r)}captureXRContext(e=0,t=!1,n=!1){this.captureContext(this.getXRContext(),e,t,n)}captureContextSpy(e,t=0,n=!1,r=!1){this.quickCapture=n,this.fullCapture=r,this.capturingContext?this.onErrorInternal("Already capturing a context."):(this.retry=0,this.capturingContext=e,this.capturingContext.setMarker(this.marker),(t=Math.min(t,1e4))>0?this.captureCommands(t):this.captureFrames(1),this.noFrameTimeout=setTimeout(()=>{t>0?this.stopCapture():this.capturingContext&&this.retry>1?this.onErrorInternal("No frames with gl commands detected. Try moving the camera."):this.onErrorInternal("No frames detected. Try moving the camera or implementing requestAnimationFrame.")},1e4))}captureNextFrame(e,t=!1,n=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,0,t,n):this.captureContext(e,0,t,n)}startCapture(e,t,n=!1,r=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,t,n,r):this.captureContext(e,t,n,r)}stopCapture(){if(this.capturingContext){const e=this.capturingContext.stopCapture();if(e.commands.length>0)return this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),this.triggerCapture(e),this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,e;0===this.captureNextCommands&&(this.retry++,this.captureFrames(1))}}setMarker(e){this.marker=e,this.capturingContext&&this.capturingContext.setMarker(e)}clearMarker(){this.marker=null,this.capturingContext&&this.capturingContext.clearMarker()}addRequestAnimationFrameFunctionName(e){this.timeSpy.addRequestAnimationFrameFunctionName(e)}setSpiedScope(e){this.timeSpy.setSpiedScope(e)}log(e){this.capturingContext&&this.capturingContext.log(e)}spyWorkers(e="spector.worker.bundle.js"){ut.startIntercepting(e)}stopSpyingWorkers(){ut.stopIntercepting()}spyWorker(e){let t=this.workerBridges.get(e);return t||(t=new gd(e),t.onCapture.add(e=>{this.triggerCapture(e)},this),t.onError.add(e=>{this.onErrorInternal(e)},this),t.onContextReady.add(t=>{if(this.captureMenu){const n=this.workerBridges.size;this.captureMenu.addCanvasInformation({id:"Worker "+n,width:t.canvasWidth,height:t.canvasHeight,ref:e})}},this),t.onFps.add(e=>{this.captureMenu&&this.captureMenu.setFPS(e)},this),this.workerBridges.set(e,t),t)}captureWorker(e,t=0,n=!1,r=!1){this.workerBridges.has(e)||this.spyWorker(e);const i=this;e.addEventListener("message",function t(n){n.data&&"spector:capture-complete"===n.data.type&&(e.removeEventListener("message",t),i.triggerCapture(n.data.capture))}),e.postMessage({type:"spector:trigger-capture",version:1,canvasIndex:0,commandCount:t,quickCapture:n,fullCapture:r})}captureFrames(e){this.captureNextFrames=e,this.captureNextCommands=0,this.playNextFrame()}captureCommands(e){this.captureNextFrames=0,this.captureNextCommands=e,this.play(),this.capturingContext?(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(e,this.quickCapture,this.fullCapture)):(this.onErrorInternal("No context to capture from."),this.captureNextCommands=0)}spyContext(e){let t=this.getAvailableContextSpyByCanvas(e.context.canvas);t||(t=new ot({context:e.context,version:e.contextVersion,recordAlways:!0}),t.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:t.context.canvas,contextSpy:t})),t.spy()}getAvailableContextSpyByCanvas(e){for(const t of this.contexts)if(t.canvas===e)return t.contextSpy}getXRContext(){return this.options.enableXRCapture||a.error("Cannot retrieve WebXR context if capturing WebXR is disabled."),this.xrSpy.currentXRSession||a.error("No currently active WebXR session."),this.xrSpy.currentXRSession.glContext}onFrameStart(){this.captureNextCommands>0||(this.captureNextFrames>0?(this.capturingContext&&(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(0,this.quickCapture,this.fullCapture)),this.captureNextFrames--):this.capturingContext=void 0)}onFrameEnd(){this.captureNextCommands>0||0===this.captureNextFrames&&this.stopCapture()}triggerCapture(e){this.captureMenu&&this.captureMenu.captureComplete(null),this.onCapture.trigger(e)}onErrorInternal(e){if(a.error(e),this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),!this.capturingContext)throw e;this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,this.retry=0,this.captureMenu&&this.captureMenu.captureComplete(e),this.onError.trigger(e)}}},180(e,t,n){e=n.nmd(e),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/lang"),s=e("../lib/event"),o='.ace_search {background-color: #ddd;color: #666;border: 1px solid #cbcbcb;border-top: 0 none;overflow: hidden;margin: 0;padding: 4px 6px 0 4px;position: absolute;top: 0;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {margin: 0 20px 4px 0;overflow: hidden;line-height: 1.9;}.ace_replace_form {margin-right: 0;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {border-radius: 3px 0 0 3px;background-color: white;color: black;border: 1px solid #cbcbcb;border-right: 0 none;outline: 0;padding: 0;font-size: inherit;margin: 0;line-height: inherit;padding: 0 6px;min-width: 17em;vertical-align: top;min-height: 1.8em;box-sizing: content-box;}.ace_searchbtn {border: 1px solid #cbcbcb;line-height: inherit;display: inline-block;padding: 0 6px;background: #fff;border-right: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;margin: 0;position: relative;color: #666;}.ace_searchbtn:last-child {border-radius: 0 3px 3px 0;border-right: 1px solid #cbcbcb;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn:hover {background-color: #eef1f6;}.ace_searchbtn.prev, .ace_searchbtn.next {padding: 0px 0.7em}.ace_searchbtn.prev:after, .ace_searchbtn.next:after {content: "";border: solid 2px #888;width: 0.5em;height: 0.5em;border-width: 2px 0 0 2px;display:inline-block;transform: rotate(-45deg);}.ace_searchbtn.next:after {border-width: 0 2px 2px 0 ;}.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;font: 16px/16px Arial;padding: 0;height: 14px;width: 14px;top: 9px;right: 7px;position: absolute;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;box-sizing: border-box!important;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;clear: both;}.ace_search_counter {float: left;font-family: arial;padding: 0 8px;}',a=e("../keyboard/hash_handler").HashHandler,l=e("../lib/keys");r.importCssString(o,"ace_searchbox");var u=function(e,t,n){var i=r.createElement("div");r.buildDom(["div",{class:"ace_search right"},["span",{action:"hide",class:"ace_searchbtn_close"}],["div",{class:"ace_search_form"},["input",{class:"ace_search_field",placeholder:"Search for",spellcheck:"false"}],["span",{action:"findPrev",class:"ace_searchbtn prev"},"​"],["span",{action:"findNext",class:"ace_searchbtn next"},"​"],["span",{action:"findAll",class:"ace_searchbtn",title:"Alt-Enter"},"All"]],["div",{class:"ace_replace_form"},["input",{class:"ace_search_field",placeholder:"Replace with",spellcheck:"false"}],["span",{action:"replaceAndFindNext",class:"ace_searchbtn"},"Replace"],["span",{action:"replaceAll",class:"ace_searchbtn"},"All"]],["div",{class:"ace_search_options"},["span",{action:"toggleReplace",class:"ace_button",title:"Toggle Replace mode",style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{class:"ace_search_counter"}],["span",{action:"toggleRegexpMode",class:"ace_button",title:"RegExp Search"},".*"],["span",{action:"toggleCaseSensitive",class:"ace_button",title:"CaseSensitive Search"},"Aa"],["span",{action:"toggleWholeWords",class:"ace_button",title:"Whole Word Search"},"\\b"],["span",{action:"searchInSelection",class:"ace_button",title:"Search In Selection"},"S"]]],i),this.element=i.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),r.importCssString(o,"ace_searchbox",e.container)};(function(){this.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},this.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;s.addListener(e,"mousedown",function(e){setTimeout(function(){t.activeInput.focus()},0),s.stopPropagation(e)}),s.addListener(e,"click",function(e){var n=(e.target||e.srcElement).getAttribute("action");n&&t[n]?t[n]():t.$searchBarKb.commands[n]&&t.$searchBarKb.commands[n].exec(t),s.stopPropagation(e)}),s.addCommandKeyListener(e,function(e,n,r){var i=l.keyCodeToString(r),o=t.$searchBarKb.findKeyCommand(n,i);o&&o.exec&&(o.exec(t),s.stopEvent(e))}),this.$onChange=i.delayedCall(function(){t.find(!1,!1)}),s.addListener(this.searchInput,"input",function(){t.$onChange.schedule(20)}),s.addListener(this.searchInput,"focus",function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()}),s.addListener(this.replaceInput,"focus",function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()})},this.$closeSearchBarKb=new a([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new a,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.editor.getReadOnly()||(e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus())},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),this.setSearchRange=function(e){this.searchRange=e,e?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(e){r.setCssClass(this.replaceOption,"checked",this.searchRange),r.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var t=this.editor.getReadOnly();this.replaceOption.style.display=t?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!t?"":"none",this.find(!1,!1,e)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,n){var i=!this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n,range:this.searchRange})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",i),this.editor._emit("findSearchBox",{match:!i}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,n=0,r=0;if(t){var i=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),s=e.session.doc.positionToIndex(e.selection.anchor);this.searchRange&&(s-=e.session.doc.positionToIndex(this.searchRange.start));for(var o,a=t.lastIndex=0;(o=t.exec(i))&&(n++,(a=o.index)<=s&&r++,!(n>999))&&(o[0]||(t.lastIndex=a+=1,!(a>=i.length))););}this.searchCounter.textContent=r+" of "+(n>999?"999+":n)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(u.prototype),t.SearchBox=u,t.Search=function(e,t){(e.searchBox||new u(e)).show(e.session.getTextRange(),t)}}),ace.require(["ace/ext/searchbox"],function(t){e&&(e.exports=t)})},49(e,t,n){e=n.nmd(e),ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=t.cFunctions="\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b",a=function(){var e=this.$keywords=this.createKeywordMapper({"keyword.control":"break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while|catch|operator|try|throw|using","storage.type":"asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|class|wchar_t|template|char16_t|char32_t","storage.modifier":"const|extern|register|restrict|static|volatile|inline|private|protected|public|friend|explicit|virtual|export|mutable|typename|constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local","keyword.operator":"and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace","variable.language":"this","constant.language":"NULL|true|false|TRUE|FALSE|nullptr"},"identifier"),t=/\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source,n="%"+/(\d+\$)?/.source+/[#0\- +']*/.source+/[,;:_]?/.source+/((-?\d+)|\*(-?\d+\$)?)?/.source+/(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source+/(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source+/(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source;this.$rules={start:[{token:"comment",regex:"//$",next:"start"},{token:"comment",regex:"//",next:"singleLineComment"},i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string",regex:"'(?:"+t+"|.)?'"},{token:"string.start",regex:'"',stateName:"qqstring",next:[{token:"string",regex:/\\\s*$/,next:"qqstring"},{token:"constant.language.escape",regex:t},{token:"constant.language.escape",regex:n},{token:"string.end",regex:'"|$',next:"start"},{defaultToken:"string"}]},{token:"string.start",regex:'R"\\(',stateName:"rawString",next:[{token:"string.end",regex:'\\)"',next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"keyword",regex:"#\\s*(?:include|import|pragma|line|define|undef|version)\\b",next:"directive"},{token:"keyword",regex:"#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b"},{token:"support.function.C99.c",regex:o},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*"},{token:"keyword.operator",regex:/--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],singleLineComment:[{token:"comment",regex:/\\$/,next:"singleLineComment"},{token:"comment",regex:/$/,next:"start"},{defaultToken:"comment"}],directive:[{token:"constant.other.multiline",regex:/\\/},{token:"constant.other.multiline",regex:/.*\\/},{token:"constant.other",regex:"\\s*<.+?>",next:"start"},{token:"constant.other",regex:'\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',next:"start"},{token:"constant.other",regex:"\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",next:"start"},{token:"constant.other",regex:/[^\\\/]+/,next:"start"}]},this.embedRules(i,"doc-",[i.getEndRule("start")]),this.normalizeRules()};r.inherits(a,s),t.c_cppHighlightRules=a}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var i=n[1].length,s=e.findMatchingBracket({row:t,column:i});if(!s||s.row==t)return 0;var o=this.$getIndent(e.getLine(s.row));e.replace(new r(t,0,t,i-1),o)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i,s=e.getLine(n);if(this.startRegionRe.test(s))return this.getCommentRegionBlock(e,s,n);if(i=s.match(this.foldingStartMarker)){var o=i.index;if(i[1])return this.openingBracketBlock(e,i[1],n,o);var a=e.getCommentFoldRange(n,o+i[0].length,1);return a&&!a.isMultiLine()&&(r?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(i=s.match(this.foldingStopMarker))?(o=i.index+i[0].length,i[1]?this.closingBracketBlock(e,i[1],n,o):e.getCommentFoldRange(n,o,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length,a=t+=1,l=e.getLength();++tu)break;var c=this.getFoldWidgetRange(e,"all",t);if(c){if(c.start.row<=s)break;if(c.isMultiLine())t=c.end.row;else if(r==u)break}a=t}}return new i(s,o,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\s*$/),s=e.getLength(),o=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++no)return new i(o,r,n,t.length)}}.call(o.prototype)}),ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./c_cpp_highlight_rules").c_cppHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&"comment"==s[s.length-1].type)return r;if("start"==e)(a=t.match(/^.*[\{\(\[]\s*$/))&&(r+=n);else if("doc-start"==e){if("start"==o)return"";var a;(a=t.match(/^\s*(\/?)\*/))&&(a[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/c_cpp"}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/glsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/c_cpp_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp_highlight_rules").c_cppHighlightRules,s=function(){var e=this.createKeywordMapper({"variable.language":"this",keyword:"layout|attribute|const|uniform|varying|break|continue|do|for|while|if|else|in|out|inout|float|int|void|bool|true|false|lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|samplerCube|struct","constant.language":"radians|degrees|sin|cos|tan|asin|acos|atan|pow|exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|normalize|faceforward|reflect|refract|matrixCompMult|lessThan|lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|texture2DProjLod|textureCube|textureCubeLod|gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|gl_DepthRangeParameters|gl_DepthRange|gl_Position|gl_PointSize|gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData"},"identifier");this.$rules=(new i).$rules,this.$rules.start.forEach(function(t){"function"==typeof t.token&&(t.token=e)})};r.inherits(s,i),t.glslHighlightRules=s}),ace.define("ace/mode/glsl",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/glsl_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp").Mode,s=e("./glsl_highlight_rules").glslHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.$id="ace/mode/glsl"}.call(u.prototype),t.Mode=u}),ace.require(["ace/mode/glsl"],function(t){e&&(e.exports=t)})},429(e,t,n){e=n.nmd(e),ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.require(["ace/theme/monokai"],function(t){e&&(e.exports=t)})}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r](s,s.exports,n),s.loaded=!0,s.exports}return n.amdD=function(){throw new Error("define cannot be used indirect")},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.nc=void 0,n(832),n(49),n(429),n(902),n(180),n(878)})()); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("SPECTOR",[],t):"object"==typeof exports?exports.SPECTOR=t():e.SPECTOR=t()}(self,()=>(()=>{var e={377(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.captureMenuComponent{position:absolute;padding:7px;z-index:99999;top:10px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuComponent.active{visibility:visible;display:block}.captureMenuComponent,.captureMenuComponent:after,.captureMenuComponent:before{box-sizing:content-box}.captureMenuLogComponent{position:absolute;padding:7px;z-index:80000;top:66px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuLogComponent.active{visibility:visible;display:block}.captureMenuLogComponent,.captureMenuLogComponent:after,.captureMenuLogComponent:before{box-sizing:content-box}.captureMenuLogComponent span.error{color:red}.canvasListComponent{float:left;width:50%;height:100%}.canvasListComponent [commandName=onCanvasSelection]{vertical-align:center;line-height:40px;white-space:nowrap;text-overflow:ellipsis;width:190px;display:inline-block;overflow:hidden;margin:0px 5px}.canvasListComponent [commandName=onCanvasSelection]:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.canvasListComponent ul{margin:0px;padding:7px;list-style:none;position:absolute;top:54px;left:-2px;width:400px;border:2px solid #222;background-color:#2c2c2c}.canvasListComponent ul li{margin:5px}.canvasListComponent ul li:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.captureMenuActionsComponent{float:left;width:30%;height:100%;margin-top:7.5px}.captureMenuActionsComponent div{float:left}.captureMenuActionsComponent [commandName=onCaptureRequested]{border-radius:50%;background:#2c2c2c;border:2px solid red;width:21px;height:21px}.captureMenuActionsComponent [commandName=onCaptureRequested]:hover{background:red;cursor:pointer;transition:background .3s;-webkit-transition:background .3s;-moz-transition:background .3s}.captureMenuActionsComponent [commandName=onPlayRequested],.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPlayRequested]:before,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{content:"";position:absolute;display:inline-block;margin-top:6px;margin-left:4px;width:7px;height:7px;border-top:2px solid #f9f9f9;border-right:2px solid #f9f9f9;background-color:#f9f9f9;-moz-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg);z-index:-20}.captureMenuActionsComponent [commandName=onPlayRequested]:after,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:after{content:"";position:absolute;display:inline-block;width:8px;height:20px;background-color:#2c2c2c;z-index:-10}.captureMenuActionsComponent [commandName=onPlayRequested]:hover,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPauseRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPauseRequested]:before{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:12px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:after{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:7px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{background-color:#2c2c2c}.fpsCounterComponent{float:left;width:20%;vertical-align:center;line-height:40px;white-space:nowrap}',""]);const a=o},160(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.resultViewComponent{position:absolute;z-index:99999;border:1px solid #000;top:0;left:0;bottom:0;right:0;background-color:#222;opacity:1;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.resultViewComponent.active{visibility:visible;display:block}.resultViewComponent,.resultViewComponent:after,.resultViewComponent:before{box-sizing:content-box}.resultViewMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.resultViewMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.resultViewMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.resultViewMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.resultViewMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.resultViewMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.resultViewMenuComponent a.clearSearch{padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.resultViewMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}@media all and (max-width: 1024px){.resultViewMenuComponent .resultViewMenuOpen{display:block;visibility:visible}.resultViewMenuComponent li:not(.resultViewMenuSmall){display:none;visibility:hidden}.resultViewMenuComponent li{background:#2c2c2c}.resultViewMenuComponent li.searchContainer{background:rgb(69.5,69.5,69.5)}.resultViewMenuComponent{padding:0px;position:absolute;overflow-y:visible;top:0px;left:0px;right:0px;bottom:0px;z-index:999999;display:block}.resultViewMenuComponent a.active{background:#2c2c2c}}.resultViewMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:40px;position:relative;top:-1px;box-sizing:border-box}.resultViewMenuComponent input:focus{border:0;outline:0 none}.resultViewMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.resultViewMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.resultViewMenuComponent ::-webkit-input-placeholder{color:#ccc}.resultViewMenuComponent :-moz-placeholder{color:#ccc}.resultViewMenuComponent ::-moz-placeholder{color:#ccc}.resultViewMenuComponent :-ms-input-placeholder{color:#ccc}.resultViewContentComponent{position:absolute;top:40px;left:0;bottom:0;right:0}.informationColumnLeftComponent{position:absolute;top:0;left:0;bottom:0;right:50%;overflow:auto;overflow-x:hidden;overflow-y:visible}.informationColumnRightComponent{position:absolute;top:0;left:50%;bottom:0;right:0;overflow:auto;overflow-x:hidden;overflow-y:visible}.captureListComponent{position:absolute;top:40px;left:0;bottom:0;right:0;background:#222;z-index:9000;display:none;visibility:hidden;overflow-y:visible;overflow-x:hidden}.captureListComponent.active{display:block;visibility:visible}.captureListComponent .openCaptureFile{border:1px dashed #f9f9f9;display:block;margin:5px;padding:5px;text-align:center;font-style:italic}.captureListComponent .openCaptureFile span{line-height:100%;vertical-align:middle}.captureListComponent ul{margin:0px;padding:0px;list-style:none;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-start}.captureListComponent ul li{margin:5px;border:1px solid #606060}.captureListComponent ul li img{width:295px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;display:block}.captureListComponent ul li span{display:block;text-align:center;border:5px solid #222}.captureListComponent ul li span .captureListItemSave{color:#f9f9f9;font-size:16px;margin-left:10px;position:relative;padding:3px 8px 3px 32px}.captureListComponent ul li span .captureListItemSave:before,.captureListComponent ul li span .captureListItemSave:after{box-sizing:border-box;content:"";position:absolute}.captureListComponent ul li span .captureListItemSave:before{background:#222;border-color:#f9f9f9;border-style:solid;border-width:7px 2px 1px;border-radius:1px;height:16px;left:8px;top:5px;width:16px}.captureListComponent ul li span .captureListItemSave:after{background:#f9f9f9;border-color:#d9d9d9;border-style:solid;border-width:1px 1px 1px 4px;height:5px;left:13px;top:5px;width:7px}.captureListComponent ul li:hover{cursor:pointer}.captureListComponent ul li.active span{background:#f0640d;border:5px solid #f0640d}.captureListComponent ul li.active span .captureListItemSave:before{background:#f0640d}.captureListComponent ul li.active span .captureListItemSave:after{border-color:#f0640d}.visualStateListComponent{position:absolute;top:0;left:0;bottom:0;padding:5px;right:80%;overflow-y:visible;overflow-x:hidden}.visualStateListComponent ul{margin:0px;padding:0px;list-style:none}.visualStateListComponent ul li{margin:20px 15px 0px 15px;border:1px solid #606060}.visualStateListComponent ul li img{display:block;padding:0px;box-sizing:border-box;max-height:600px;width:100%;margin:0 auto;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.visualStateListComponent ul li:hover{cursor:pointer}.visualStateListComponent ul li span{border:5px solid #222;background:#222;box-sizing:border-box;display:inline-block;width:100%;margin:0px;padding:5px;word-wrap:break-word}.visualStateListComponent ul li.active{border:2px solid #f0640d}.commandListComponent{position:absolute;top:0;left:20%;right:40%;bottom:0;color:hsl(0,0%,82.6470588235%)}.commandListComponent ul{margin:0px;padding:0px;list-style:none;overflow-y:visible;overflow-x:hidden;height:100%}.commandListComponent ul li{padding:8px}.commandListComponent ul li span{word-wrap:break-word;line-height:22px}.commandListComponent ul li:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.commandListComponent ul li:nth-child(even){background:#2c2c2c}.commandListComponent ul li:nth-child(odd){background:#222}.commandListComponent ul li .important{font-weight:800}.commandListComponent ul li .important.deprecated{color:red}.commandListComponent ul li .important.unused{color:#ff0}.commandListComponent ul li .important.disabled{color:gray}.commandListComponent ul li .important.redundant{color:orange}.commandListComponent ul li .important.valid{color:#adff2f}.commandListComponent ul li .marker{font-size:16px;font-weight:900;color:#adff2f}.commandListComponent ul li.active{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.commandListComponent ul li.drawCall{background:#5db0d7;color:#222}.commandListComponent ul li a{margin-left:5px;margin-right:5px;color:#5db0d7;background:#222;padding:5px;font-weight:900;display:inline-block}.commandDetailComponent{position:absolute;top:0;left:60%;right:0;bottom:0;overflow-y:visible;overflow-x:hidden}.jsonGroupComponent{display:block;margin:10px;padding:10px;padding-bottom:5px}.jsonGroupComponent .jsonGroupComponentTitle{display:block;font-size:16px;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:5px;margin-bottom:5px;text-transform:capitalize}.jsonGroupComponent ul{margin:0px;padding:0px;list-style:none}.jsonGroupComponent ul li:nth-child(even){background:#222}.jsonGroupComponent ul li:nth-child(odd){background:#222}.jsonItemComponentKey{color:#f0640d}.jsonItemComponentValue{white-space:pre-wrap}.jsonItemImageHolder{width:50%;margin:auto}.jsonItemImageHolder .jsonItemImage{margin:5px;display:block;border:1px solid #606060;width:100%}.jsonItemImageHolder .jsonItemImage img{width:100%;display:block;margin:auto;max-width:256px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.jsonItemImageHolder .jsonItemImage span{margin:0px;padding:5px;word-wrap:break-word;display:inline-block;width:100%;box-sizing:border-box}[commandName=onOpenSourceClicked]:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.jsonVisualStateItemComponent{text-align:center;padding:10px}.jsonVisualStateItemComponent img{background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;border:1px solid #606060;margin:5px;width:100%;max-width:512px;max-height:800px}.jsonVisualStateItemComponent span{display:block}.jsonContentComponent{position:absolute;top:0;left:0;right:0;bottom:0;padding:10px;overflow-y:visible;overflow-x:hidden}.jsonItemComponentValue{word-break:break-all;white-space:normal}.jsonSourceItemComponentOpen{font-weight:bold;color:#5db0d7;text-decoration:underline}.sourceCodeMenuComponentContainer{position:absolute;left:0;top:0;bottom:48px;right:40%}.sourceCodeMenuComponentFooter{position:absolute;left:0;right:40%;bottom:0;padding:0 15px}.sourceCodeFormatError{color:#f0640d;margin-left:15px}.sourceCodeDiagnosticsNotice{color:#5db0d7;margin-left:15px}.sourceCodeDiagnosticsNotice a{color:#c9c9c9;text-decoration:underline}.sourceCodeMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.sourceCodeMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.sourceCodeMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.sourceCodeMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.sourceCodeMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.sourceCodeMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.sourceCodeMenuComponent a.clearSearch{display:inline-block;padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.sourceCodeMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}.sourceCodeMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:100%;position:relative;top:-1px;box-sizing:border-box}.sourceCodeMenuComponent input:focus{border:0;outline:0 none}.sourceCodeMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.sourceCodeMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.sourceCodeMenuComponent ::-webkit-input-placeholder{color:#ccc}.sourceCodeMenuComponent :-moz-placeholder{color:#ccc}.sourceCodeMenuComponent ::-moz-placeholder{color:#ccc}.sourceCodeMenuComponent :-ms-input-placeholder{color:#ccc}.sourceCodeComponent{position:absolute;top:42px;left:0;bottom:48px;right:40%;background:#222;z-index:9000;overflow-x:visible;overflow:auto}.sourceCodeComponent .sourceCodeComponentTitle{font-size:16px;font-weight:800;line-height:50px;color:#f0640d;padding:1em;margin:.5em 0}.compareViewComponent{position:absolute;top:50px;left:0px;right:0px;bottom:0px;overflow:hidden;display:flex;flex-direction:column;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:13px}.compareViewComponent .compareViewEmpty,.compareViewComponent .compareViewEmptyRow,.compareViewComponent .compareDetailEmpty{padding:1em;color:#c9c9c9;text-align:center}.compareViewComponent .compareViewHeader{flex:0 0 auto;display:flex;align-items:center;gap:16px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid rgb(8.5,8.5,8.5);white-space:nowrap}.compareViewComponent .compareViewHeader .compareViewLabel{color:#5db0d7}.compareViewComponent .compareViewHeader .compareViewSummary span{margin-right:8px;font-weight:700}.compareViewComponent .compareViewHeader .compareViewSummary span.added{color:#adff2f}.compareViewComponent .compareViewHeader .compareViewSummary span.removed{color:#ff5a5a}.compareViewComponent .compareViewHeader .compareViewSummary span.changed{color:#f0640d}.compareViewComponent .compareViewHeader .compareViewSummary span.unchanged{color:#c9c9c9}.compareViewComponent .compareViewHeader .compareViewToggle{margin-left:auto;cursor:pointer;user-select:none}.compareViewComponent .compareViewHeader .compareViewToggle input{vertical-align:middle;margin-right:4px}.compareViewComponent .compareViewBody{flex:1 1 auto;display:flex;min-height:0}.compareViewComponent .compareViewLegend{flex:0 0 130px;box-sizing:border-box;padding:10px;background:#2c2c2c;border-right:2px solid #222}.compareViewComponent .compareViewLegend .compareLegendRow{display:flex;align-items:center;gap:8px;margin:8px 0}.compareViewComponent .compareViewLegend .compareLegendRow.unchanged{opacity:.5}.compareViewComponent .compareViewLegend .compareLegendChip{width:12px;height:12px;border-radius:2px;background:#c9c9c9}.compareViewComponent .compareViewLegend .added .compareLegendChip{background:#adff2f}.compareViewComponent .compareViewLegend .removed .compareLegendChip{background:#ff5a5a}.compareViewComponent .compareViewLegend .changed .compareLegendChip{background:#f0640d}.compareViewComponent .compareViewList{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;margin:0;padding:0;list-style:none}.compareViewComponent .compareViewList .compareRow{display:flex;align-items:baseline;padding:3px 10px;line-height:20px;cursor:pointer;white-space:nowrap}.compareViewComponent .compareViewList .compareRow:nth-child(odd){background:#222}.compareViewComponent .compareViewList .compareRow:nth-child(even){background:#2c2c2c}.compareViewComponent .compareViewList .compareRow .compareSign{flex:0 0 14px;font-weight:800}.compareViewComponent .compareViewList .compareRow .compareRowText{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.compareViewComponent .compareViewList .compareRow .compareCmdName{font-weight:700}.compareViewComponent .compareViewList .compareRow.added .compareSign,.compareViewComponent .compareViewList .compareRow.added .compareCmdName{color:#adff2f}.compareViewComponent .compareViewList .compareRow.removed .compareSign,.compareViewComponent .compareViewList .compareRow.removed .compareCmdName{color:#ff5a5a}.compareViewComponent .compareViewList .compareRow.changed .compareSign,.compareViewComponent .compareViewList .compareRow.changed .compareCmdName{color:#f0640d}.compareViewComponent .compareViewList .compareRow.unchanged{opacity:.55}.compareViewComponent .compareViewList .compareRow.selected{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.compareViewComponent .compareViewList .compareRow.selected .compareSign,.compareViewComponent .compareViewList .compareRow.selected .compareCmdName{color:#222}.compareViewComponent .compareViewList .compareViewEmptyRow{cursor:default}.compareViewComponent .compareViewDetail{flex:0 0 42%;box-sizing:border-box;overflow-y:auto;border-left:2px solid #222;padding:4px 12px 12px}.compareViewComponent .compareViewDetail .compareDetailGroup{margin:12px 0}.compareViewComponent .compareViewDetail .compareDetailGroup ul{margin:0;padding:0;list-style:none}.compareViewComponent .compareViewDetail .compareDetailGroup li{padding:2px 0;white-space:pre-wrap;word-break:break-word}.compareViewComponent .compareViewDetail .compareDetailTitle{display:block;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin-bottom:6px;text-transform:capitalize}.compareViewComponent .compareViewDetail .compareDetailKey{color:#f0640d}.compareViewComponent .compareViewDetail .compareCmdName{font-weight:700}.compareViewComponent .compareViewDetail .compareCmdName.added{color:#adff2f}.compareViewComponent .compareViewDetail .compareCmdName.removed{color:#ff5a5a}.compareViewComponent .compareViewDetail .compareCmdName.changed{color:#f0640d}.compareViewComponent .compareViewDetail .compareArrow{color:#c9c9c9}.compareViewComponent .compareViewDetail .compareOld{opacity:.7;text-decoration:line-through}.compareViewComponent .compareViewDetail .compareNew{color:#f9f9f9}.compareViewComponent .compareViewDetail .compareCommandLink{color:#5db0d7;text-decoration:none;cursor:pointer;border-bottom:1px dotted currentColor}.compareViewComponent .compareViewDetail .compareCommandLink:hover{color:#f0640d}.compareViewComponent .compareViewDetail .compareTextureItem{padding-bottom:6px}.compareViewComponent .compareViewDetail .compareImageDiff{display:flex;align-items:center;margin-top:4px}.compareViewComponent .compareViewDetail .compareThumb{width:48px;height:48px;object-fit:contain;margin:2px 6px 2px 0;border:1px solid rgb(8.5,8.5,8.5);background:#222;image-rendering:pixelated}.jsonItemImageClickable{cursor:zoom-in}.textureViewerOverlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:100000;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.6);font-family:Consolas,monaco,monospace;font-size:13px;color:#f9f9f9}.textureViewerOverlay .textureViewerModal{width:min(900px,92vw);height:min(640px,90vh);display:flex;flex-direction:column;overflow:hidden;background:#222;border:1px solid #000;box-shadow:0 10px 40px rgba(0,0,0,.6)}.textureViewerOverlay .textureViewerHeader{flex:0 0 auto;display:flex;align-items:center;gap:12px;height:40px;padding:0 12px;background:#2c2c2c;border-bottom:2px solid #222}.textureViewerOverlay .textureViewerHeader .textureViewerTitle{color:#5db0d7}.textureViewerOverlay .textureViewerHeader .textureViewerMeta{color:#c9c9c9;font-size:12px}.textureViewerOverlay .textureViewerHeader .textureViewerClose{margin-left:auto;width:26px;height:26px;display:flex;align-items:center;justify-content:center;border-radius:3px;color:#c9c9c9;cursor:pointer}.textureViewerOverlay .textureViewerHeader .textureViewerClose:hover{color:#f9f9f9;background:hsla(0,0%,100%,.08)}.textureViewerOverlay .textureViewerToolbar{flex:0 0 auto;display:flex;align-items:center;flex-wrap:wrap;gap:14px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid #000;font-size:12px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup{display:flex;align-items:center;gap:6px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup .lbl{color:#c9c9c9;margin-right:2px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroupEnd{margin-left:auto}.textureViewerOverlay .textureViewerToolbar .channel{width:26px;height:24px;display:flex;align-items:center;justify-content:center;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#777;font-weight:800;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .channel.on.r{background:#e14b4b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.g{background:#4bd44b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.b{background:#4b8fe1;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.a{background:#dedede;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .tvBtn{height:24px;padding:0 10px;display:inline-flex;align-items:center;gap:6px;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#f9f9f9;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .tvBtn:hover{background:#333}.textureViewerOverlay .textureViewerToolbar .tvBtn.active{background:#f0640d;color:#1a1a1a;border-color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary{border-color:#f0640d;color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary:hover{background:#f0640d;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .seg{display:flex}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn{border-radius:0;border-right-width:0}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:first-child{border-radius:3px 0 0 3px}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:last-child{border-radius:0 3px 3px 0;border-right-width:1px}.textureViewerOverlay .textureViewerToolbar .zoomVal{min-width:44px;text-align:center;color:#c9c9c9}.textureViewerOverlay .textureViewerBody{flex:1 1 auto;display:flex;min-height:0}.textureViewerOverlay .textureViewerViewport{flex:1 1 auto;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#141414}.textureViewerOverlay .textureViewerViewport.checker{background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}.textureViewerOverlay .textureViewerCanvas{image-rendering:pixelated;cursor:crosshair;box-shadow:0 0 0 1px #000}.textureViewerOverlay .textureViewerLoupe{position:absolute;display:none;width:120px;height:120px;pointer-events:none;image-rendering:pixelated;border:1px solid #000;box-shadow:0 2px 8px rgba(0,0,0,.6);background:#000;left:16px;top:16px}.textureViewerOverlay .textureViewerRail{flex:0 0 210px;box-sizing:border-box;padding:12px;overflow-y:auto;background:#2c2c2c;border-left:2px solid #222}.textureViewerOverlay .textureViewerRail .railTitle{color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin:0 0 8px;text-transform:capitalize}.textureViewerOverlay .textureViewerRail .kv{display:flex;justify-content:space-between;margin:4px 0}.textureViewerOverlay .textureViewerRail .kv .k{color:#f0640d}.textureViewerOverlay .textureViewerRail .kv .v{color:#f9f9f9}.textureViewerOverlay .textureViewerRail .swatch{width:100%;height:34px;margin:8px 0;border:1px solid #000;background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0}.textureViewerOverlay .textureViewerRail .swatch .swatchInner{width:100%;height:100%}.textureViewerOverlay .textureViewerRail .hint{color:#c9c9c9;margin-top:10px;line-height:1.5}',""]);const a=o},636(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,".ace-monokai {\n color: #f9f9f9;\n font-size: 14px;\n}\n\n.ace-monokai .ace_entity.ace_name.ace_tag,\n.ace-monokai .ace_keyword,\n.ace-monokai .ace_meta.ace_tag,\n.ace-monokai .ace_storage {\n color: #F0640D\n}\n\n.ace-monokai .ace_constant.ace_character,\n.ace-monokai .ace_constant.ace_other {\n color: #5db0d7;\n}\n\n.ace-monokai .ace_marker-layer .ace_selection {\n background: #a6e22e\n}\n\n.ace-monokai .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #a6e22e;\n}\n\n.ace-monokai .ace_marker-layer .ace_active-line {\n background: #2c2c2c\n}\n.ace-monokai .ace_gutter-active-line {\n background-color: #2c2c2c\n}\n.ace-monokai .ace_marker-layer .ace_selected-word {\n border: 1px solid #a6e22e\n}\n\n.ace-monokai .ace_constant.ace_language {\n color: #e6db74\n}\n.ace-monokai .ace_constant.ace_numeric {\n color: #ae81ff\n}\n\n.ace-monokai .ace_gutter {\n background: #222;\n color: #8F908A;\n}",""]);const a=o},314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var a=0;a0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},601(e){"use strict";e.exports=function(e){return e[1]}},832(e,t,n){e=n.nmd(e),function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,n,r){"string"==typeof e?(2==arguments.length&&(r=n),t.modules[e]||(t.payloads[e]=r,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var n,r,i=function(e,t,n){if("string"==typeof t){var r=a(e,t);if(null!=r)return n&&n(),r}else if("[object Array]"===Object.prototype.toString.call(t)){for(var i=[],o=0,l=t.length;o1&&function(e,t,n){if(Array.prototype.indexOf)return e.indexOf("",n);for(var r=0;r-1&&(n=RegExp(this.source,i.replace.call(((r=this).global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),"g","")),i.replace.call(e.slice(a.index),n,function(){for(var e=1;ea.index&&this.lastIndex--}return a},o||(RegExp.prototype.test=function(e){var t=i.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError("Function.prototype.bind called on incompatible "+t);var n=d.call(arguments,1),i=function(){if(this instanceof i){var r=t.apply(this,n.concat(d.call(arguments)));return Object(r)===r?r:this}return t.apply(e,n.concat(d.call(arguments)))};return t.prototype&&(r.prototype=t.prototype,i.prototype=new r,r.prototype=null),i});var i,s,o,a,l,u=Function.prototype.call,c=Array.prototype,h=Object.prototype,d=c.slice,f=u.bind(h.toString),p=u.bind(h.hasOwnProperty);if((l=p(h,"__defineGetter__"))&&(i=u.bind(h.__defineGetter__),s=u.bind(h.__defineSetter__),o=u.bind(h.__lookupGetter__),a=u.bind(h.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,n=[];if(n.splice.apply(n,e(20)),n.splice.apply(n,e(26)),t=n.length,n.splice(5,0,"XXX"),n.length,t+1==n.length)return!0}()){var m=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?m.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(d.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):null==e?e=0:e<0&&(e=Math.max(n+e,0)),e+ta)for(h=u;h--;)this[l+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else for(this.length=c+s,h=0;h>>0;if("[object Function]"!=f(e))throw new TypeError;for(;++i>>0,i=Array(r),s=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var o=0;o>>0,s=[],o=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var a=0;a>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,s=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s++];break}if(++s>=r)throw new TypeError("reduce of empty array with no initial value")}for(;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,s=r-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s--];break}if(--s<0)throw new TypeError("reduceRight of empty array with no initial value")}do{s in this&&(i=e.call(void 0,i,n[s],s,t))}while(s--);return i}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=C&&"[object String]"==f(this)?this.split(""):L(this),n=t.length>>>0;if(!n)return-1;var r=0;for(arguments.length>1&&(r=N(arguments[1])),r=r>=0?r:Math.max(0,n+r);r>>0;if(!n)return-1;var r=n-1;for(arguments.length>1&&(r=Math.min(r,N(arguments[1]))),r=r>=0?r:n-Math.abs(r);r>=0;r--)if(r in t&&e===t[r])return r;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:h)}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(p(e,t)){var n;if(n={enumerable:!0,configurable:!0},l){var r=e.__proto__;e.__proto__=h;var i=o(e,t),s=a(e,t);if(e.__proto__=r,i||s)return i&&(n.get=i),s&&(n.set=s),n}return n.value=e[t],n}}),Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),Object.create||(g=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var n;if(null===e)n=g();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var r=function(){};r.prototype=e,(n=new r).__proto__=e}return void 0!==t&&Object.defineProperties(n,t),n}),Object.defineProperty){var S=D({}),A="undefined"==typeof document||D(document.createElement("div"));if(!S||!A)var _=Object.defineProperty}Object.defineProperty&&!_||(Object.defineProperty=function(e,t,n){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof n&&"function"!=typeof n||null===n)throw new TypeError("Property description must be an object: "+n);if(_)try{return _.call(Object,e,t,n)}catch(e){}if(p(n,"value"))if(l&&(o(e,t)||a(e,t))){var r=e.__proto__;e.__proto__=h,delete e[t],e[t]=n.value,e.__proto__=r}else e[t]=n.value;else{if(!l)throw new TypeError("getters & setters can not be defined on this javascript engine");p(n,"get")&&i(e,t,n.get),p(n,"set")&&s(e,t,n.set)}return e}),Object.defineProperties||(Object.defineProperties=function(e,t){for(var n in t)p(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=(E=Object.freeze,function(e){return"function"==typeof e?e:E(e)})}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";p(e,t);)t+="?";e[t]=!0;var n=p(e,t);return delete e[t],n}),!Object.keys){var y=!0,b=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],T=b.length;for(var R in{toString:null})y=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)p(e,n)&&t.push(n);if(y)for(var r=0,i=T;r0||-1)*Math.floor(Math.abs(e))),e}var L=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,n){"use strict";e("./regexp"),e("./es5-shim"),"undefined"==typeof Element||Element.prototype.remove||Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,n){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var r="object"==typeof navigator?navigator:{},i=(/mac|win|linux/i.exec(r.platform)||["other"])[0].toLowerCase(),s=r.userAgent||"",o=r.appName||"";t.isWin="win"==i,t.isMac="mac"==i,t.isLinux="linux"==i,t.isIE="Microsoft Internet Explorer"==o||o.indexOf("MSAppHost")>=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,t.isAIR=s.indexOf("AdobeAIR")>=0,t.isAndroid=s.indexOf("Android")>=0,t.isChromeOS=s.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./useragent");if(t.buildDom=function e(t,n,r){if("string"==typeof t&&t){var i=document.createTextNode(t);return n&&n.appendChild(i),i}if(!Array.isArray(t))return t;if("string"!=typeof t[0]||!t[0]){for(var s=[],o=0;o=1.5,"undefined"!=typeof document){var i=document.createElement("div");t.HI_DPI&&void 0!==i.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),r.isEdge||void 0===i.style.animationName||(t.HAS_CSS_ANIMATION=!0),i=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./oop"),i=function(){var e,t,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in n.FUNCTION_KEYS)e=n.FUNCTION_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);for(t in n.PRINTABLE_KEYS)e=n.PRINTABLE_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);return r.mixin(n,n.MODIFIER_KEYS),r.mixin(n,n.PRINTABLE_KEYS),r.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)n.KEY_MODS[t]=e.filter(function(e){return t&n.KEY_MODS[e]}).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();r.mixin(t,i),t.keyCodeToString=function(e){var t=i[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./keys"),i=e("./useragent"),s=null,o=0;t.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var r=function(){n.call(e,window.event)};n._wrapper=r,e.attachEvent("on"+t,r)}},t.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,n,r){function i(e){n&&n(e),r&&r(e),t.removeListener(document,"mousemove",n,!0),t.removeListener(document,"mouseup",i,!0),t.removeListener(document,"dragstart",i,!0)}return t.addListener(document,"mousemove",n,!0),t.addListener(document,"mouseup",i,!0),t.addListener(document,"dragstart",i,!0),i},t.addMouseWheelListener=function(e,n){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),n(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}n(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),n(e)})},t.addMultiMouseDownListener=function(e,n,r,s){var o,a,l,u=0,c={2:"dblclick",3:"tripleclick",4:"quadclick"};function h(e){if(0!==t.getButton(e)?u=0:e.detail>1?++u>4&&(u=1):u=1,i.isIE){var h=Math.abs(e.clientX-o)>5||Math.abs(e.clientY-a)>5;l&&!h||(u=1),l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),1==u&&(o=e.clientX,a=e.clientY)}if(e._clicks=u,r[s]("mousedown",e),u>4)u=0;else if(u>1)return r[s](c[u],e)}function d(e){u=2,l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),r[s]("mousedown",e),r[s](c[u],e)}Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",h),i.isOldIE&&t.addListener(e,"dblclick",d)})};var a=i.isMac&&i.isOpera&&!("KeyboardEvent"in window)?function(e){return(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)}:function(e){return(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};function l(e,t,n){var l=a(t);if(!i.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(l|=8),s.altGr){if(!(3&~l))return;s.altGr=0}if(18===n||17===n){var u="location"in t?t.location:t.keyLocation;17===n&&1===u?1==s[n]&&(o=t.timeStamp):18===n&&3===l&&2===u&&t.timeStamp-o<50&&(s.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),l||13!==n||3!==(u="location"in t?t.location:t.keyLocation)||(e(t,l,-n),!t.defaultPrevented)){if(i.isChromeOS&&8&l){if(e(t,l,n),t.defaultPrevented)return;l&=-9}return!!(l||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&e(t,l,n)}}function u(){s=Object.create(null)}if(t.getModifierString=function(e){return r.KEY_MODS[a(e)]},t.addCommandKeyListener=function(e,n){var r=t.addListener;if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var o=null;r(e,"keydown",function(e){o=e.keyCode}),r(e,"keypress",function(e){return l(n,e,o)})}else{var a=null;r(e,"keydown",function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=l(n,e,e.keyCode);return a=e.defaultPrevented,t}),r(e,"keypress",function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),r(e,"keyup",function(e){s[e.keyCode]=null}),s||(u(),r(window,"focus",u))}},"object"==typeof window&&window.postMessage&&!i.isOldIE){var c=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+c++,i=function(s){s.data==r&&(t.stopPropagation(s),t.removeListener(n,"message",i),e())};t.addListener(n,"message",i),n.postMessage(r,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function n(){t.$idleBlocked?setTimeout(n,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,n=e.end,r=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(r.row,r.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(r.row,r.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else this.end.rowt)var i={row:t+1,column:0};else this.start.row0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;nDate.now()-50)||(r=!1)},cancel:function(){r=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("../lib/dom"),o=e("../lib/lang"),a=e("../clipboard"),l=i.isChrome<18,u=i.isIE,c=i.isChrome>63,h=400,d=e("../lib/keys"),f=d.KEY_MODS,p=i.isIOS,m=p?/\s/:/\n/;t.TextInput=function(e,t){var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild);var g=!1,E=!1,v=!1,C=!1,D="";i.isMobile||(n.style.fontSize="1px");var S=!1,A=!1,_="",y=0,b=0,T=0;try{var R=document.activeElement===n}catch(e){}r.addListener(n,"blur",function(e){A||(t.onBlur(e),R=!1)}),r.addListener(n,"focus",function(e){if(!A){if(R=!0,i.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),i.isEdge?setTimeout(x):x()}}),this.$focusScroll=!1,this.focus=function(){if(D||c||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var t=0!=n.getBoundingClientRect().top}catch(e){return}var r=[];if(t)for(var i=n.parentElement;i&&1==i.nodeType;)r.push(i),i.setAttribute("ace_nocontext",!0),i=!i.parentElement&&i.getRootNode?i.getRootNode().host:i.parentElement;n.focus({preventScroll:!0}),t&&r.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="","0px"==n.style.top&&(n.style.top=e)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return R},t.on("beforeEndOperation",function(){t.curOp&&"insertstring"==t.curOp.command.name||(v&&(_=n.value="",U()),x())});var x=p?function(e){if(R&&(!g||e)&&!C){e||(e="");var r="\n ab"+e+"cde fg\n";r!=n.value&&(n.value=_=r);var i=4+(e.length||(t.selection.isEmpty()?0:1));4==y&&b==i||n.setSelectionRange(4,i),y=4,b=i}}:function(){if(!v&&!C&&(R||F)){v=!0;var e=t.selection,r=e.getRange(),i=e.cursor.row,s=r.start.column,o=r.end.column,a=t.session.getLine(i);if(r.start.row!=i){var l=t.session.getLine(i-1);s=r.start.rowi+1?u.length:o,o+=a.length+1,a=a+"\n"+u}a.length>h&&(s0&&_[h]==e[h];)h++,o--;for(l=l.slice(h),h=1;a>0&&_.length-h>y-1&&_[_.length-h]==e[e.length-h];)h++,a--;u-=h-1,c-=h-1;var d=l.length-h+1;return d<0&&(o=-d,d=0),l=l.slice(0,d),r||l||u||o||a||c?(C=!0,l&&!o&&!a&&!u&&!c||S?t.onTextInput(l):t.onTextInput(l,{extendLeft:o,extendRight:a,restoreStart:u,restoreEnd:c}),C=!1,_=e,y=i,b=s,T=c,l):""},L=function(e){if(v)return B();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var r=n.value,i=N(r,!0);(r.length>500||m.test(i))&&x()},O=function(e,t,n){var r=e.clipboardData||window.clipboardData;if(r&&!l){var i=u||n?"Text":"text/plain";try{return t?!1!==r.setData(i,t):r.getData(i)}catch(e){if(!n)return O(e,t,!0)}}},I=function(e,i){var s=t.getCopyText();if(!s)return r.preventDefault(e);O(e,s)?(p&&(x(s),g=s,setTimeout(function(){g=!1},10)),i?t.onCut():t.onCopy(),r.preventDefault(e)):(g=!0,n.value=s,n.select(),setTimeout(function(){g=!1,x(),i?t.onCut():t.onCopy()}))},k=function(e){I(e,!0)},M=function(e){I(e,!1)},P=function(e){var s=O(e);a.pasteCancelled()||("string"==typeof s?(s&&t.onPaste(s,e),i.isIE&&setTimeout(x),r.preventDefault(e)):(n.value="",E=!0))};r.addCommandKeyListener(n,t.onCommandKey.bind(t)),r.addListener(n,"select",function(e){v||(g?g=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=_.length&&e.value===_&&_&&e.selectionEnd!==b}(n)&&(t.selectAll(),x()))}),r.addListener(n,"input",L),r.addListener(n,"cut",k),r.addListener(n,"copy",M),r.addListener(n,"paste",P),"oncut"in n&&"oncopy"in n&&"onpaste"in n||r.addListener(e,"keydown",function(e){if((!i.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:M(e);break;case 86:P(e);break;case 88:k(e)}});var B=function(){if(v&&t.onCompositionUpdate&&!t.$readOnly){if(S)return $();if(v.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;N(e),v.markerRange&&(v.context&&(v.markerRange.start.column=v.selectionStart=v.context.compositionStartOffset),v.markerRange.end.column=v.markerRange.start.column+b-v.selectionStart+T)}}},U=function(e){t.onCompositionEnd&&!t.$readOnly&&(v=!1,t.onCompositionEnd(),t.off("mousedown",$),e&&L())};function $(){A=!0,n.blur(),n.focus(),A=!1}var G,V=o.delayedCall(B,50).schedule.bind(null,null);function W(){clearTimeout(G),G=setTimeout(function(){D&&(n.style.cssText=D,D=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()},0)}r.addListener(n,"compositionstart",function(e){if(!v&&t.onCompositionStart&&!t.$readOnly&&(v={},!S)){setTimeout(B,0),t.on("mousedown",$);var r=t.getSelectionRange();r.end.row=r.start.row,r.end.column=r.start.column,v.markerRange=r,v.selectionStart=y,t.onCompositionStart(v),v.useTextareaForIME?(n.value="",_="",y=0,b=0):(n.msGetInputContext&&(v.context=n.msGetInputContext()),n.getInputContext&&(v.context=n.getInputContext()))}}),r.addListener(n,"compositionupdate",B),r.addListener(n,"keyup",function(e){27==e.keyCode&&n.value.lengthb&&"\n"==_[s]?o=d.end:rb&&_.slice(0,s).split("\n").length>2?o=d.down:s>b&&" "==_[s-1]?(o=d.right,a=f.option):(s>b||s==b&&b!=y&&r==s)&&(o=d.right),r!==s&&(a|=f.shift),o){if(!t.onCommandKey({},a,o)&&t.commands){o=d.keyCodeToString(o);var l=t.commands.findKeyCommand(a,o);l&&t.execCommand(l)}y=r,b=s,x("")}}};document.addEventListener("selectionchange",s),t.on("destroy",function(){document.removeEventListener("selectionchange",s)})}(0,t,n)}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/useragent");function i(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function s(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)n=2*t.row-e.start.row-e.end.row;else n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,s=e.getButton();return 0!==s?((i.getSelectionRange().isEmpty()||1==s)&&i.selection.moveToPosition(n),void(2==s&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||i.isFocused()||(i.focus(),!this.$focusTimeout||this.$clickSelection||i.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(-1==r)e=this.$clickSelection.end;else if(1==r)e=this.$clickSelection.start;else{var i=s(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(i.start),a=this.$clickSelection.comparePoint(i.end);if(-1==o&&a<=0)t=this.$clickSelection.end,i.end.row==r.row&&i.end.column==r.column||(r=i.start);else if(1==a&&o>=0)t=this.$clickSelection.start,i.start.row==r.row&&i.start.column==r.column||(r=i.end);else if(-1==o&&1==a)r=i.end,t=i.start;else{var l=s(this.$clickSelection,r);r=l.cursor,t=l.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e,t,n,r,i=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,n=this.x,r=this.y,Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))),s=Date.now();(i>0||s-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session.getBracketRange(t);r?(r.isEmpty()&&(r.start.column--,r.end.column++),this.setState("select")):(r=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=r,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,s=i?e.wheelX/i:n.vx,o=i?e.wheelY/i:n.vy;i<550&&(s=(s+n.vx)/2,o=(o+n.vy)/2);var a=Math.abs(s/o),l=!1;return a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?n.allowed=r:r-n.allowed<550&&(Math.abs(s)<=1.5*Math.abs(n.vx)&&Math.abs(o)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=r):n.allowed=0),n.t=r,n.vx=s,n.vy=o,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(i.prototype),t.DefaultHandlers=i}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}(function(){this.$init=function(){return this.$element=r.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){r.addCssClass(this.getElement(),e)},this.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(i.prototype),t.Tooltip=i}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/event"),o=e("../tooltip").Tooltip;function a(e){o.call(this,e)}i.inherits(a,o),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),s=this.getHeight();(e+=15)+i>n&&(e-=e+i-n),(t+=15)+s>r&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=function(e){var t,n,i,o=e.editor,l=o.renderer.$gutterLayer,u=new a(o.container);function c(){t&&(t=clearTimeout(t)),i&&(u.hide(),i=null,o._signal("hideGutterTooltip",u),o.removeEventListener("mousewheel",c))}function h(e){u.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",function(t){if(o.isFocused()&&0==t.getButton()&&"foldWidgets"!=l.getRegion(t)){var n=t.getDocumentPosition().row,r=o.session.selection;if(t.getShiftKey())r.selectTo(n,0);else{if(2==t.domEvent.detail)return o.selectAll(),t.preventDefault();e.$clickSelection=o.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}),e.editor.setDefaultHandler("guttermousemove",function(s){var a=s.domEvent.target||s.domEvent.srcElement;if(r.hasCssClass(a,"ace_fold-widget"))return c();i&&e.$tooltipFollowsMouse&&h(s),n=s,t||(t=setTimeout(function(){t=null,n&&!e.isMousePressed?function(){var t=n.getDocumentPosition().row,r=l.$annotations[t];if(!r)return c();if(t==o.session.getLength()){var s=o.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(s>o.session.documentToScreenRow(a.row,a.column))return c()}if(i!=r)if(i=r.text.join("
"),u.setHtml(i),u.show(),o._signal("showGutterTooltip",u),o.on("mousewheel",c),e.$tooltipFollowsMouse)h(n);else{var d=n.domEvent.target.getBoundingClientRect(),f=u.getElement().style;f.left=d.right+"px",f.top=d.bottom+"px"}}():c()},50))}),s.addListener(o.renderer.$gutter,"mouseout",function(e){n=null,i&&!t&&(t=setTimeout(function(){t=null,c()},50))}),o.on("changeSession",c)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent");function o(e){var t=e.editor,n=r.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),t.addEventListener("mousedown",this.onMouseDown.bind(e));var o,l,u,c,h,d,f,p,m,g,E,v=t.container,C=0;function D(){var e=d;(function(e,n){var r=Date.now(),i=!n||e.row!=n.row,s=!n||e.column!=n.column;!g||i||s?(t.moveCursorToPosition(e),g=r,E={x:l,y:u}):a(E.x,E.y,l,u)>5?g=null:r-g>=200&&(t.renderer.scrollCursorIntoView(),g=null)})(d=t.renderer.screenToTextCoordinates(l,u),e),function(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,s=t.renderer.layerConfig.characterWidth,o=t.renderer.scroller.getBoundingClientRect(),a={x:{left:l-o.left,right:o.right-l},y:{top:u-o.top,bottom:o.bottom-u}},c=Math.min(a.x.left,a.x.right),h=Math.min(a.y.top,a.y.bottom),d={row:e.row,column:e.column};c/s<=2&&(d.column+=a.x.left=200&&t.renderer.scrollCursorIntoView(d):m=r:m=null}(d,e)}function S(){h=t.selection.toOrientedRange(),o=t.session.addMarker(h,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(c),D(),c=setInterval(D,20),C=0,i.addListener(document,"mousemove",y)}function A(){clearInterval(c),t.session.removeMarker(o),o=null,t.selection.fromOrientedRange(h),t.isFocused()&&!p&&t.$resetCursorStyle(),h=null,d=null,C=0,m=null,g=null,i.removeListener(document,"mousemove",y)}this.onDragStart=function(e){if(this.cancelDrag||!v.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}h=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?"copy":"copyMove",s.isOpera&&(t.container.appendChild(n),n.scrollTop=0),i.setDragImage&&i.setDragImage(n,0,0),s.isOpera&&t.container.removeChild(n),i.clearData(),i.setData("Text",t.session.getTextRange()),p=!0,this.setState("drag")},this.onDragEnd=function(e){if(v.draggable=!1,p=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;f||"move"!=n||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||S(),C++,e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||(S(),C++),null!==_&&(_=null),e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragLeave=function(e){if(--C<=0&&o)return A(),f=null,i.preventDefault(e)},this.onDrop=function(e){if(d){var n=e.dataTransfer;if(p)switch(f){case"move":h=h.contains(d.row,d.column)?{start:d,end:d}:t.moveText(h,d);break;case"copy":h=t.moveText(h,d,!0)}else{var r=n.getData("Text");h={start:d,end:t.session.insert(d,r)},t.focus(),f=null}return A(),i.preventDefault(e)}},i.addListener(v,"dragstart",this.onDragStart.bind(e)),i.addListener(v,"dragend",this.onDragEnd.bind(e)),i.addListener(v,"dragenter",this.onDragEnter.bind(e)),i.addListener(v,"dragover",this.onDragOver.bind(e)),i.addListener(v,"dragleave",this.onDragLeave.bind(e)),i.addListener(v,"drop",this.onDrop.bind(e));var _=null;function y(){null==_&&(_=setTimeout(function(){null!=_&&o&&A()},20))}function b(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function T(e){var t=["copy","copymove","all","uninitialized"],n=s.isMac?e.altKey:e.ctrlKey,r="uninitialized";try{r=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var i="none";return n&&t.indexOf(r)>=0?i="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(r)>=0?i="move":t.indexOf(r)>=0&&(i="copy"),i}}function a(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=s.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;s.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton();if(1===(e.domEvent.detail||1)&&0===r&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var i=e.domEvent.target||e.domEvent.srcElement;"unselectable"in i&&(i.unselectable="on"),t.getDragDelay()?(s.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(o.prototype),t.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./mouse_event").MouseEvent,i=e("../lib/dom");t.addTouchListeners=function(e,t){var n,s,o,a,l,u,c,h,d,f="scroll",p=0,m=0,g=0,E=0;function v(){var e,n,r;d||(e=window.navigator&&window.navigator.clipboard,n=!1,r=function(r){var s,o,a=r.target.getAttribute("action");if("more"==a||!n)return n=!n,s=t.getCopyText(),o=t.session.getUndoManager().hasUndo(),void d.replaceChild(i.buildDom(n?["span",!s&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],s&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],s&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],o&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),d.firstChild);"paste"==a?e.readText().then(function(e){t.execCommand(a,e)}):a&&("cut"!=a&&"copy"!=a||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(a)),d.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&t.focus()},d=i.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){f="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),r(e)},onclick:r},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container));var s=t.selection.cursor,o=t.renderer.textToScreenCoordinates(s.row,s.column),a=t.container.getBoundingClientRect();d.style.top=o.pageY-a.top-3+"px",d.style.right="10px",d.style.display="",d.firstChild.style.display="none",t.on("input",C)}function C(e){d&&(d.style.display="none"),t.off("input",C)}function D(){l=null,clearTimeout(l);var e=t.selection.getRange(),n=e.contains(c.row,c.column);!e.isEmpty()&&n||(t.selection.moveToPosition(c),t.selection.selectWord()),f="wait",v()}e.addEventListener("contextmenu",function(e){h&&t.textInput.getElement().focus()}),e.addEventListener("touchstart",function(e){var i=e.touches;if(l||i.length>1)return clearTimeout(l),l=null,o=-1,void(f="zoom");h=t.$mouseHandler.isMousePressed=!0;var u=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,v=e.timeStamp;a=v;var C=i[0],S=C.clientX,A=C.clientY;Math.abs(n-S)+Math.abs(s-A)>u&&(o=-1),n=e.clientX=S,s=e.clientY=A,g=E=0;var _=new r(e,t);if(c=_.getDocumentPosition(),v-o<500&&1==i.length&&!p)m++,e.preventDefault(),e.button=0,function(){l=null,clearTimeout(l),t.selection.moveToPosition(c);var e=m>=2?t.selection.getLineRange(c.row):t.session.getBracketRange(c);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),f="wait"}();else{m=0;var y=t.selection.cursor,b=t.selection.isEmpty()?y:t.selection.anchor,T=t.renderer.$cursorLayer.getPixelPosition(y,!0),R=t.renderer.$cursorLayer.getPixelPosition(b,!0),x=t.renderer.scroller.getBoundingClientRect(),w=function(e,t){return(e/=d)*e+(t=t/u-.75)*t};if(e.clientXN?"cursor":"anchor"),f=N<3.5?"anchor":F<3.5?"cursor":"scroll",l=setTimeout(D,450)}o=v}),e.addEventListener("touchend",function(e){h=t.$mouseHandler.isMousePressed=!1,u&&clearInterval(u),"zoom"==f?(f="",p=0):l?(t.selection.moveToPosition(c),p=0,v()):"scroll"==f?(p+=60,u=setInterval(function(){p--<=0&&(clearInterval(u),u=null),Math.abs(g)<.01&&(g=0),Math.abs(E)<.01&&(E=0),p<20&&(g*=.9),p<20&&(E*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*g,10*E),e==t.session.getScrollTop()&&(p=0)},10),e.preventDefault(),C()):v(),clearTimeout(l),l=null}),e.addEventListener("touchmove",function(e){l&&(clearTimeout(l),l=null);var i=e.touches;if(!(i.length>1||"zoom"==f)){var o=i[0],u=n-o.clientX,c=s-o.clientY;if("wait"==f){if(!(u*u+c*c>4))return e.preventDefault();f="cursor"}n=o.clientX,s=o.clientY,e.clientX=o.clientX,e.clientY=o.clientY;var h=e.timeStamp,d=h-a;if(a=h,"scroll"==f){var p=new r(e,t);p.speed=1,p.wheelX=u,p.wheelY=c,10*Math.abs(u)1&&(i=n[n.length-2]);var o=l[t+"Path"];return null==o?o=l.basePath:"/"==r&&(t=r=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+t+r+i+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,r){var i,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{i=e(n)}catch(e){}if(i&&!t.$loading[n])return r&&r(i);if(t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r),!(t.$loading[n].length>1)){var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var r=t.$loading[n];t.$loading[n]=null,r.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,o),a),u()}};var u=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),u=function(){})};function c(i){if(a&&a.document){l.packaged=i||e.packaged||r.packaged||a.define&&n.amdD.packaged;for(var s={},o="",u=document.currentScript||document._currentScript,c=(u&&u.ownerDocument||document).getElementsByTagName("script"),d=0;d=e){for(s=h+1;s=e;)s++;for(a=h,l=s-1;a=t.length||2!=(l=n[i-1])&&3!=l||2!=(u=t[i+1])&&3!=u?4:(s&&(u=3),u==l?u:4);case 10:return 2==(l=i>0?n[i-1]:5)&&i+10&&2==n[i-1])return 2;if(s)return 4;for(f=i+1,d=t.length;f=1425&&m<=2303||64286==m;if(l=t[f],g&&(1==l||7==l))return 1}return i<1||5==(l=t[i-1])?4:n[i-1];case 5:return s=!1,o=!0,r;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:s=!1;case h:return 4}}function g(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?t>191?0:d[t]:5==n?/[\u0591-\u05f4]/.test(e)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?12:/[\u0660-\u0669\u066b-\u066c]/.test(e)?3:1642==t?c:/[\u06f0-\u06f9]/.test(e)?2:7:32==n&&t<=8287?f[255&t]:254==n&&t>=65136?7:4}t.L=0,t.R=1,t.EN=2,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,n,c){if(e.length<2)return{};var d=e.split(""),f=new Array(d.length),E=new Array(d.length),v=[];r=c?1:0,function(e,t,n,c){var h=r?u:l,d=null,f=null,p=null,E=0,v=null,C=-1,D=null,S=null,A=[];if(!c)for(D=0,c=[];D0)if(16==v){for(D=C;D-1){for(D=C;D=0&&8==c[_];_--)t[_]=r}}(d,v,d.length,n);for(var C=0;C7&&n[C]<13||4===n[C]||n[C]===h)?v[C]=t.ON_R:C>0&&"ل"===d[C-1]&&/\u0622|\u0623|\u0625|\u0627/.test(d[C])&&(v[C-1]=v[C]=t.R_H,C++);for(d[d.length-1]===t.DOT&&(v[d.length-1]=t.B),"‫"===d[0]&&(v[0]=t.RLE),C=0;C=0&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,r=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===r;)r=n,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[e];s&&(void 0===t&&(t=this.getSplitIndex()),t>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&s[i]%2!=0&&i++;for(var a=0;at&&s[i]%2==0&&(o+=this.charWidths[s[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(e,t){var n,r=this.bidiMap,i=r.bidiLevels,s=[],o=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,u=!1,c=!1,h=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,f=0;f=a&&dn+s/2;){if(n+=s,r===i.length-1){s=0;break}s=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!=0&&i[r]%2==0?(e0&&i[r-1]%2==0&&i[r]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&0===s&&i[r-1]%2==0||!this.isRtlDir&&0===r&&i[r]%2!=0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!=0&&0!==s&&r--,t=this.bidiMap.logicalFromVisual[r]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(o.prototype),t.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")})};(function(){r.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},this.$setSelection=function(e,t,n,r){var i=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||s)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n,r="number"==typeof e?e:this.lead.row,i=this.session.getFoldLine(r);return i?(r=i.start.row,n=i.end.row):n=r,!0===t?new o(r,0,n,this.session.getLine(n).length):new o(r,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i)this.moveCursorTo(i.end.row,i.end.column);else{if(this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t)),t>=n.length)return this.moveCursorTo(e,n.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(s)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)}},this.$shortWordEndIndex=function(e){var t,n=0,r=/\s/,i=this.session.tokenRe;if(i.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&r.test(t);)n++;if(n<1)for(i.lastIndex=0;(t=e[n])&&!i.test(t);)if(i.lastIndex=0,n++,r.test(t)){if(n>2){n--;break}for(;(t=e[n])&&r.test(t);)n++;if(n>2)break}}return i.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do{e++,r=this.doc.getLine(e)}while(e0&&/^\s*$/.test(r));n=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(t,n-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n,r=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(r.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(r.column),r.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=r.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?r.column=this.$desiredColumn:this.$desiredColumn=r.column);var i=this.session.screenToDocumentPosition(r.row+e,r.column,n);0!==e&&0===t&&i.row===this.lead.row&&i.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[i.row]&&(i.row>0||e>0)&&i.row++,this.moveCursorTo(i.row,i.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch(e){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,n){"use strict";var r=e("./config"),i=2e3,s=function(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],r=[],i=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",a=[],l=0;l1?this.$applyToken:u.token),h>1&&(/\\\d/.test(u.regex)?c=u.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(h=1,c=this.removeCapturingGroups(u.regex)),u.splitRegex||"string"==typeof u.token||a.push(u)),s[i]=l,i+=h,r.push(c),u.onMatch||(u.onMatch=null)}}r.length||(s[0]=0,r.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){i=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var r=[],i=0,s=n.length;ic){var E=e.substring(c,g-m.length);d.type==f?d.value+=E:(d.type&&u.push(d),d={type:f,value:E})}for(var v=0;vi){for(h>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});c1&&n[0]!==r&&n.unshift("#tmp",r),{tokens:u,state:n.length?n:r}},this.reportError=r.reportError}).call(s.prototype),t.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var n in e){for(var r=e[n],i=0;i=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(void 0!==n)return n;for(n=0;t>0;)n+=e[t-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)}}).call(i.prototype),t.TokenIterator=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r,i=e("../../lib/oop"),s=e("../behaviour").Behaviour,o=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],u=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],c={},h={'"':'"',"'":"'"},d=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,c.rangeCount!=e.multiSelect.rangeCount&&(c={rangeCount:e.multiSelect.rangeCount})),c[t])return r=c[t];r=c[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},f=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},p=function(e){this.add("braces","insertion",function(t,n,i,s,o){var l=i.getCursorPosition(),u=s.doc.getLine(l.row);if("{"==o){d(i);var c=i.getSelectionRange(),h=s.doc.getTextRange(c);if(""!==h&&"{"!==h&&i.getWrapBehavioursEnabled())return f(c,h,"{","}");if(p.isSaneInsertion(i,s))return/[\]\}\)]/.test(u[l.column])||i.inMultiSelectMode||e&&e.braces?(p.recordAutoInsert(i,s,"}"),{text:"{}",selection:[1,1]}):(p.recordMaybeInsert(i,s,"{"),{text:"{",selection:[1,1]})}else if("}"==o){if(d(i),"}"==u.substring(l.column,l.column+1)&&null!==s.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&p.isAutoInsertedClosing(l,u,o))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==o||"\r\n"==o){d(i);var m="";if(p.isMaybeInsertedClosing(l,u)&&(m=a.stringRepeat("}",r.maybeInsertedBrackets),p.clearMaybeInsertedClosing()),"}"===u.substring(l.column,l.column+1)){var g=s.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!g)return null;var E=this.$getIndent(s.getLine(g.row))}else{if(!m)return void p.clearMaybeInsertedClosing();E=this.$getIndent(u)}var v=E+s.getTabString();return{text:"\n"+v+"\n"+E+m,selection:[1,v.length,1,v.length]}}p.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,i,s){var o=i.doc.getTextRange(s);if(!s.isMultiLine()&&"{"==o){if(d(n),"}"==i.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s;r.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if("("==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"(",")");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(")"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"("==s&&(d(n),")"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("brackets","insertion",function(e,t,n,r,i){if("["==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"[","]");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if("]"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"["==s&&(d(n),"]"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("string_dquotes","insertion",function(e,t,n,r,i){var s=r.$mode.$quotes||h;if(1==i.length&&s[i]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(i))return;d(n);var o=i,a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(!(""===l||1==l.length&&s[l])&&n.getWrapBehavioursEnabled())return f(a,l,o,o);if(!l){var u=n.getCursorPosition(),c=r.doc.getLine(u.row),p=c.substring(u.column-1,u.column),m=c.substring(u.column,u.column+1),g=r.getTokenAt(u.row,u.column),E=r.getTokenAt(u.row,u.column+1);if("\\"==p&&g&&/escape/.test(g.type))return null;var v,C=g&&/string|escape/.test(g.type),D=!E||/string|escape/.test(E.type);if(m==o)(v=C!==D)&&/string\.end/.test(E.type)&&(v=!1);else{if(C&&!D)return null;if(C&&D)return null;var S=r.$mode.tokenRe;S.lastIndex=0;var A=S.test(p);S.lastIndex=0;var _=S.test(p);if(A||_)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;var y=c[u.column-2];if(p==o&&(y==o||S.test(y)))return null;v=!0}return{text:v?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.$mode.$quotes||h,o=r.doc.getTextRange(i);if(!i.isMultiLine()&&s.hasOwnProperty(o)&&(d(n),r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==o))return i.end.column++,i})};p.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new o(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",l)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var i=new o(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",l))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",u)},p.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},p.recordAutoInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isAutoInsertedClosing(i,s,r.autoInsertedLineEnd[0])||(r.autoInsertedBrackets=0),r.autoInsertedRow=i.row,r.autoInsertedLineEnd=n+s.substr(i.column),r.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isMaybeInsertedClosing(i,s)||(r.maybeInsertedBrackets=0),r.maybeInsertedRow=i.row,r.maybeInsertedLineStart=s.substr(0,i.column)+n,r.maybeInsertedLineEnd=s.substr(i.column),r.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return r.autoInsertedBrackets>0&&e.row===r.autoInsertedRow&&n===r.autoInsertedLineEnd[0]&&t.substr(e.column)===r.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return r.maybeInsertedBrackets>0&&e.row===r.maybeInsertedRow&&t.substr(e.column)===r.maybeInsertedLineEnd&&t.substr(0,e.column)==r.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){r.autoInsertedLineEnd=r.autoInsertedLineEnd.substr(1),r.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){r&&(r.maybeInsertedBrackets=0,r.maybeInsertedRow=-1)},i.inherits(p,s),t.CstyleBehaviour=p}),ace.define("ace/unicode",["require","exports","module"],function(e,t,n){"use strict";for(var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,s=[],o=0;o2?r%u!=u-1:r%u==0})}else{if(!this.blockComment)return!1;var f=this.blockComment.start,p=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+l.escapeRegExp(f)+")"),g=new RegExp("(?:"+l.escapeRegExp(p)+")\\s*$"),E=function(e,t){C(e,t)||s&&!/\S/.test(e)||(i.insertInLine({row:t,column:e.length},p),i.insertInLine({row:t,column:a},f))},v=function(e,t){var n;(n=e.match(g))&&i.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(m))&&i.removeInLine(t,n[1].length,n[0].length)},C=function(e,n){if(m.test(e))return!0;for(var r=t.getTokens(n),i=0;ie.length&&(S=e.length)}),a==1/0&&(a=S,s=!1,o=!1),c&&a%u!=0&&(a=Math.floor(a/u)*u),D(o?v:E)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(i){!i.start&&i[0]&&(i=i[0]);var s,o,a=(m=new u(t,r.row,r.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var h,d;a&&/comment/.test(a.type);){if(-1!=(g=a.value.indexOf(i.start))){var f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g;h=new c(f,p,f,p+i.start.length);break}a=m.stepBackward()}var m;for(a=(m=new u(t,r.row,r.column)).getCurrentToken();a&&/comment/.test(a.type);){var g;if(-1!=(g=a.value.indexOf(i.end))){f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g,d=new c(f,p,f,p+i.end.length);break}a=m.stepForward()}d&&t.remove(d),h&&(t.remove(h),s=h.start.row,o=-i.start.length)}else o=i.start.length,s=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);l.start.row==s&&(l.start.column+=o),l.end.row==s&&(l.end.column+=o),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var n=e[t],i=n.prototype.$id,s=r.$modes[i];s||(r.$modes[i]=s=new n),r.$modes[t]||(r.$modes[t]=s),this.$embeds.push(t),this.$modes[t]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;tthis.row)){var n=function(t,n,r){var i="insert"==t.action,s=(i?1:-1)*(t.end.row-t.start.row),o=(i?1:-1)*(t.end.column-t.start.column),a=t.start,l=i?a:t.end;return e(n,a,r)?{row:n.row,column:n.column}:e(l,n,!r)?{row:n.row+s,column:n.column+(n.row==l.row?o:0)}:{row:a.row,column:a.column}}(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(e,t,n){var r;if(r=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=r.row||this.column!=r.column){var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=e("./anchor").Anchor,l=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new a(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();void 0===e?e=n:e<0?e=0:e>=n&&(e=n-1,t=void 0);var r=this.getLine(e);return null==t&&(t=r.length),{row:e,column:t=Math.min(Math.max(t,0),r.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof o||(e=o.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,r=n.length-t+1,i=e.start.row,s=e.start.column,o=0,a=0;o20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,-1==r&&(r=t),s<=r&&n.fireUpdateEvent(s,r)}}};(function(){r.implement(this,i),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens}}).call(s.prototype),t.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=(e("./lib/oop"),e("./range").Range),s=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,n,s){if(this.regExp)for(var o=s.firstRow,a=s.lastRow,l=o;l<=a;l++){var u=this.cache[l];null==u&&((u=r.getMatchOffsets(n.getLine(l),this.regExp)).length>this.MAX_RANGES&&(u=u.slice(0,this.MAX_RANGES)),u=u.map(function(e){return new i(l,e.offset,l,e.offset+e.length)}),this.cache[l]=u.length?u:"");for(var c=u.length;c--;)t.drawSingleLineMarker(e,u[c].toScreenRange(n),this.clazz,s)}}}).call(s.prototype),t.SearchHighlight=s}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range;function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var r,i,s=0,o=this.folds,a=!0;null==t&&(t=this.end.row,n=this.end.column);for(var l=0;l0)){var l=r(e,o.start);return 0===a?t&&0!==l?-s-2:s:l>0||0===l&&!t?s:-s-1}}return-s-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},this.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],n=this.ranges,i=(n=n.sort(function(e,t){return r(e.start,t.start)}))[0],s=1;s=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=r);o++);if("insert"==e.action){for(var l=i-r,u=-t.column+n.column;or);o++)if(c.start.row==r&&c.start.column>=t.column&&(c.start.column==t.column&&this.$bias<=0||(c.start.column+=u,c.start.row+=l)),c.end.row==r&&c.end.column>=t.column){if(c.end.column==t.column&&this.$bias<0)continue;c.end.column==t.column&&u>0&&oc.start.column&&c.end.column==s[o+1].start.column&&(c.end.column-=u),c.end.column+=u,c.end.row+=l}}else for(l=r-i,u=t.column-n.column;oi);o++)c.end.rowt.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=u,c.end.row+=l):c.end.row>i&&(c.end.row+=l),c.start.rowt.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=u,c.start.row+=l):c.start.row>i&&(c.start.row+=l);if(0!=l&&o=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;for(t&&(r=n.indexOf(t)),-1==r&&(r=0);r=e)return i}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,r=t-e+1,i=0;i=t){a=e?r-=t-a:r=0);break}o>=e&&(r-=a>=e?o-a:o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n,r=this.$foldData,o=!1;e instanceof s?n=e:(n=new s(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,u=n.end.row,c=n.end.column,h=this.getFoldAt(a,l,1),d=this.getFoldAt(u,c,-1);if(h&&d==h)return h.addSubFold(n);h&&!h.range.isStart(a,l)&&this.removeFold(h),d&&!d.range.isEnd(u,c)&&this.removeFold(d);var f=this.getFoldsInRange(n.range);f.length>0&&(this.removeFolds(f),f.forEach(function(e){n.addSubFold(e)}));for(var p=0;p0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;if(null==e?(n=new r(0,0,this.getLength(),0),t=!0):n="number"==typeof e?new r(e,0,e,this.getLine(e).length):"row"in e?r.fromPoints(e,e):e,i=this.getFoldsInRangeList(n),t)this.removeFolds(i);else for(var s=i;s.length;)this.expandFolds(s),s=this.getFoldsInRangeList(n);if(i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){null==r&&(r=e.start.row),null==i&&(i=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var s=this.doc,o="";return e.walk(function(e,t,n,a){if(!(tc)break}while(s&&l.test(s.type));s=i.stepBackward()}else s=i.getCurrentToken();return u.end.row=i.getCurrentTokenRow(),u.end.column=i.getCurrentTokenColumn()+s.value.length-2,u}},this.foldAll=function(e,t,n){null==n&&(n=1e5);var r=this.foldWidgets;if(r){t=t||this.getLength();for(var i=e=e||0;i=e){i=s.end.row;try{var o=this.addFold("...",s);o&&(o.collapseChildren=n)}catch(e){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};for(var r,i=e-1;i>=0;){var s=n[i];if(null==s&&(s=n[i]=this.getFoldWidget(i)),"start"==s){var o=this.getFoldWidgetRange(i);if(r||(r=o),o&&o.end.row>=e)break}i--}return{range:-1!==i&&o,firstRange:r}},this.onFoldWidgetClick=function(e,t){var n={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var r=t.target||t.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),r=this.getLine(e),i="end"===n?-1:1,s=this.getFoldAt(e,-1===i?0:r.length,i);if(s)return t.children||t.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()&&(s=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(s.range))return this.removeFold(s),s;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,u=a.range.end.row;this.foldAll(l,u,t.all?1e4:0)}else t.children?(u=o?o.end.row:this.getLength(),this.foldAll(e+1,u,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var r=this.getParentFoldRangeData(t,!0);if(n=r.range||r.firstRange){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold("...",n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){"use strict";var r=e("../token_iterator").TokenIterator,i=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(""==n)return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t,n=this.getLine(e.row),r=!0,s=n.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(o||(s=n.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),r=!1),!o)return null;if(o[1]){if(!(a=this.$findClosingBracket(o[1],e)))return null;t=i.fromPoints(e,a),r||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a;if(!(a=this.$findOpeningBracket(o[2],e)))return null;t=i.fromPoints(a,e),r||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn()-2,u=a.value;;){for(;l>=0;){var c=u.charAt(l);if(c==i){if(0==(s-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else c==e&&(s+=1);l-=1}do{a=o.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(u=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn();;){for(var u=a.value,c=u.length;ln&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>1,s=e[i];if(t>s)n=i+1;else{if(!(t=t);s++);return(n=r[s])?(n.index=s,n.start=i-n.value.length,n):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe)),r)var i=this.tokenRe;else i=/^\s+$/.test(n.slice(t-1,t+1))?/\s/:this.nonTokenRe;var s=t;if(s>0){do{s--}while(s>=0&&n.charAt(s).match(i));s++}for(var o=t;oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,s=this.$foldData[i],o=s?s.start.row:1/0,a=t.length,l=0;lo){if((l=s.end.row+1)>=a)break;o=(s=this.$foldData[i++])?s.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>r&&(r=n[l])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var r=e[n];"insert"==r.action||"remove"==r.action?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;ne.end.column&&(s.start.column+=u),s.end.row==e.end.row&&s.end.column>e.end.column&&(s.end.column+=u)),o&&s.start.row>=e.end.row&&(s.start.row+=o,s.end.row+=o)}if(s.end=this.insert(s.start,r),i.length){var a=e.start,l=s.start,u=(o=l.row-a.row,l.column-a.column);this.addFolds(i.map(function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=u),e.end.row==a.row&&(e.end.column+=u),e.start.row+=o,e.end.row+=o,e}))}return s},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},this.outdentRows=function(e){for(var t=e.collapseRows(),n=new c(0,0,0,0),r=this.getTabSize(),i=t.start.row;i<=t.end.row;++i){var s=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o0){var i;if((i=this.getRowFoldEnd(t+n))>this.doc.getLength()-1)return 0;r=i-t}else e=this.$clipRowToDocument(e),r=(t=this.$clipRowToDocument(t))-e+1;var s=new c(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(e){return(e=e.clone()).start.row+=r,e.end.row+=r,e}),a=0==n?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+r,a),o.length&&this.addFolds(o),r},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1&&(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,i=e.end,s=r.row,o=i.row,a=o-s,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[t?"$wrapData":"$rowLengthCache"].splice(s,a);var u=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var c=0;if(m=this.getFoldLine(i.row)){m.addRemoveChars(i.row,i.column,r.column-i.column),m.shiftRow(-a);var h=this.getFoldLine(s);h&&h!==m&&(h.merge(m),m=h),c=u.indexOf(m)+1}for(;c=i.row&&m.shiftRow(-a);o=s}else{var d=Array(a);d.unshift(s,0);var f=t?this.$wrapData:this.$rowLengthCache;if(f.splice.apply(f,d),u=this.$foldData,c=0,m=this.getFoldLine(s)){var p=m.range.compareInside(r.row,r.column);0==p?(m=m.split(r.row,r.column))&&(m.shiftRow(a),m.addRemoveChars(o,0,i.column-r.column)):-1==p&&(m.addRemoveChars(s,0,i.column-r.column),m.shiftRow(a)),c=u.indexOf(m)+1}for(;c=s&&m.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===n&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(m=this.getFoldLine(s))&&m.addRemoveChars(s,r.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),l},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(n,r){var i,s,o=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,u=this.$wrapLimit,c=n;for(r=Math.min(r,o.length-1);c<=r;)(s=this.getFoldLine(c,s))?(i=[],s.walk(function(n,r,s,a){var l;if(null!=n){(l=this.$getDisplayTokens(n,i.length))[0]=e;for(var u=1;u=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}this.$computeWrapSplits=function(n,r,i){if(0==n.length)return[];var s=[],o=n.length,a=0,l=0,u=this.$wrapAsCode,c=this.$indentedSoftWrap,h=r<=Math.max(2*i,8)||!1===c?0:Math.floor(r/2);function d(e){for(var t=e-a,r=a;rr-f;){var p=a+r-f;if(n[p-1]>=10&&n[p]>=10)d(p);else if(n[p]!=e&&n[p]!=t){for(var m=Math.max(p-(r-(r>>2)),a-1);p>m&&n[p]m&&n[p]m&&9==n[p];)p--}else for(;p>m&&n[p]<10;)p--;p>m?d(++p):(2==n[p=a+r]&&p--,d(p-f))}else{for(;p!=a-1&&n[p]!=e;p--);if(p>a){d(p);continue}for(p=a+r;p39&&o<48||o>57&&o<64?i.push(9):o>=4352&&n(o)?i.push(1,2):i.push(1)}return i},this.$getStringScreenWidth=function(e,t,r){if(0==t)return[0,0];var i,s;for(null==t&&(t=1/0),r=r||0,s=0;s=4352&&n(i)?r+=2:r+=1,!(r>t));s++);return[r,s]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0){a=u[c],s=this.$docRowCache[c];var d=e>u[h-1]}else d=!h;for(var f=this.getLength()-1,p=this.getNextFoldLine(s),m=p?p.start.row:1/0;a<=e&&!(a+(l=this.getRowLength(s))>e||s>=f);)a+=l,++s>m&&(s=p.end.row+1,m=(p=this.getNextFoldLine(s,p))?p.start.row:1/0),d&&(this.$docRowCache.push(s),this.$screenRowCache.push(a));if(p&&p.start.row<=s)r=this.getFoldDisplayLine(p),s=p.start.row;else{if(a+l<=e||s>f)return{row:f,column:this.getLine(f).length};r=this.getLine(s),p=null}var g=0,E=Math.floor(e-a);if(this.$useWrapMode){var v=this.$wrapData[s];v&&(i=v[E],E>0&&v.length&&(g=v.indent,o=v[E-1]||v[v.length-1],r=r.substring(o)))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+E,s,E)&&(t=this.$bidiHandler.offsetToCol(n)),o+=this.$getStringScreenWidth(r,t-g)[1],this.$useWrapMode&&o>=i&&(o=i-1),p?p.idxToPosition(o):{row:s,column:o}},this.documentToScreenPosition=function(e,t){if(void 0===t)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r,i=0,s=null;(r=this.getFoldAt(e,t,1))&&(e=r.start.row,t=r.start.column);var o,a=0,l=this.$docRowCache,u=this.$getRowCacheIndex(l,e),c=l.length;if(c&&u>=0){a=l[u],i=this.$screenRowCache[u];var h=e>l[c-1]}else h=!c;for(var d=this.getNextFoldLine(a),f=d?d.start.row:1/0;a=f){if((o=d.end.row+1)>e)break;f=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;i+=this.getRowLength(a),a=o,h&&(this.$docRowCache.push(a),this.$screenRowCache.push(i))}var p="";d&&a>=f?(p=this.getFoldDisplayLine(d,e,t),s=d.start.row):(p=this.getLine(e).substring(0,t),s=e);var m=0;if(this.$useWrapMode){var g=this.$wrapData[s];if(g){for(var E=0;p.length>=g[E];)i++,E++;p=p.substring(g[E-1]||0,p.length),m=E>0?g.indent:0}}return{row:i,column:m+this.$getStringScreenWidth(p)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,r=0,i=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);ri&&(r=t.end.row+1,i=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var o=this.$foldData,a=0;an);s++);return[r,s]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=n}.call(p.prototype),e("./edit_session/folding").Folding.call(p.prototype),e("./edit_session/bracket_match").BracketMatch.call(p.prototype),o.defineOptions(p.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=p}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(){this.$options={}};(function(){this.set=function(e){return i.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i,o){return r=new s(e,n,i,o),!(n==o&&t.start&&t.start.start&&0!=t.skipCurrent&&r.isEqual(t.start)&&(r=null,1))}),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],a=t.re;if(t.$isMultiLine){var l,u=a.length,c=i.length-u;e:for(var h=a.offset||0;h<=c;h++){for(var d=0;dm||(o.push(l=new s(h,m,h+u-1,g)),u>2&&(h=h+u-2))}}else for(var E=0;ES&&o[d].end.row==n.end.row;)d--;for(o=o.slice(E,d+1),E=0,d=o.length;E=a;n--)if(h(n,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(n=l,a=o.row;n>=a;n--)if(h(n,Number.MAX_VALUE,e))return}};else u=function(e){var n=o.row;if(!h(n,o.column,e)){for(n+=1;n<=l;n++)if(h(n,0,e))return;if(0!=t.wrap)for(n=a,l=o.row;n<=l;n++)if(h(n,0,e))return}};if(t.$isMultiLine)var c=n.length,h=function(t,i,s){var o=r?t-c+1:t;if(!(o<0)){var a=e.getLine(o),l=a.search(n[0]);if(!(!r&&li))return!!s(o,l,o+c-1,h)||void 0}}};else h=r?function(t,r,i){var s,o=e.getLine(t),a=[],l=0;for(n.lastIndex=0;s=n.exec(o);){var u=s[0].length;if(l=s.index,!u){if(l>=o.length)break;n.lastIndex=l+=1}if(s.index+u>r)break;a.push(s.index,u)}for(var c=a.length-1;c>=0;c-=2){var h=a[c-1];if(i(t,h,t,h+(u=a[c])))return!0}}:function(t,r,i){var s,o,a=e.getLine(t);for(n.lastIndex=r;o=n.exec(a);){var l=o[0].length;if(i(t,s=o.index,t,s+l))return!0;if(!l&&(n.lastIndex=s+=1,s>=a.length))return!1}};return{forEach:u}}}).call(o.prototype),t.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/keys"),i=e("../lib/useragent"),s=r.KEY_MODS;function o(e,t){this.platform=t||(i.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function a(e,t){o.call(this,e,t),this.$singleCommand=!1}a.prototype=o.prototype,function(){function e(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var n=e&&("string"==typeof e?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var s=r[i];if(s==e)delete r[i];else if(Array.isArray(s)){var o=s.indexOf(e);-1!=o&&(s.splice(o,1),1==s.length&&(r[i]=s[0]))}}},this.bindKey=function(e,t,n){if("object"==typeof e&&e&&(null==n&&(n=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach(function(e){var r="";if(-1!=e.indexOf(" ")){var i=e.split(/\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=s[t.hashId]+t.key;r+=(r?" ":"")+n,this._addCommandToBinding(r,"chainKeys")},this),r+=" "}var o=this.parseKeys(e),a=s[o.hashId]+o.key;this._addCommandToBinding(r+a,t,n)},this)},this._addCommandToBinding=function(t,n,r){var i,s=this.commandKeyBinding;if(n)if(!s[t]||this.$singleCommand)s[t]=n;else{Array.isArray(s[t])?-1!=(i=s[t].indexOf(n))&&s[t].splice(i,1):s[t]=[s[t]],"number"!=typeof r&&(r=e(n));var o=s[t];for(i=0;ir);i++);o.splice(i,0,n)}else delete s[t]},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(n){if("string"==typeof n)return this.bindKey(n,t);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=t),this.addCommand(n))}},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),i=r[n];if(r.FUNCTION_KEYS[i])n=r.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:n.toUpperCase(),hashId:-1}}for(var s=0,o=t.length;o--;){var a=r.KEY_MODS[t[o]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[o]+" in "+e),!1;s|=a}return{key:n,hashId:s}},this.findKeyCommand=function(e,t){var n=s[e]+t;return this.commandKeyBinding[n]},this.handleKeyboard=function(e,t,n,r){if(!(r<0)){var i=s[t]+n,o=this.commandKeyBinding[i];return e.$keyChain&&(e.$keyChain+=" "+i,o=this.commandKeyBinding[e.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(e.$keyChain&&(t&&4!=t||1!=n.length?(-1==t||r>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-i.length-1)),{command:o}):(e.$keyChain=e.$keyChain||i,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(o.prototype),t.HashHandler=o,t.MultiHashHandler=a}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){i.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};r.inherits(o,i),function(){r.implement(this,s),this.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var i={editor:t,command:e,args:n};return i.returnValue=this._emit("exec",i),this._signal("afterExec",i),!1!==i.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map(function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=e("../config"),s=e("../range").Range;function o(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(e){i.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,a=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(n.row),u=n.row+1;u<=i.row+1;u++){var c=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(u)));0!==c.length&&(c=" "+c),l+=c}i.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;o=i.lastRow||r.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var i=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&-1!==n.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var n=this;E.loadModule(["keybinding",e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||i.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=t.findMatchingBracket(e.getCursorPosition());if(n)var r=new f(n.row,n.column,n.row,n.column+1);else t.$mode.getMatching&&(r=t.$mode.getMatching(e.session));r&&(t.$bracketHighlight=t.addMarker(r,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=e.getCursorPosition(),r=new v(e.session,n.row,n.column),i=r.getCurrentToken();if(!i||!/\b(?:tag-open|tag-name)/.test(i.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1==i.type.indexOf("tag-open")||(i=r.stepForward())){var s=i.value,o=0,a=r.stepBackward();if("<"==a.value)do{a=i,(i=r.stepForward())&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"=0);else{do{i=a,a=r.stepBackward(),i&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var n=new f(e.row,e.column,e.row,1/0);n.id=t.addMarker(n,"ace_active-line","screenLine"),t.$highlightLineMarker=n}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var n=t.start.column,r=t.end.column,i=e.getLine(t.start.row),s=i.substring(n,r);if(!(s.length>5e3)&&/[\w\d]/.test(s)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),a=i.substring(n-1,r+1);if(o.test(a))return o}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var r=this.selection.getAllRanges(),i=0;ia.search(/\S|$/)){var l=a.substr(i.column).search(/\S|$/);n.doc.removeInLine(i.row,i.column,i.column+l)}}this.clearSelection();var u=i.column,c=n.getState(i.row),h=(a=n.getLine(i.row),r.checkOutdent(c,a,e));if(n.insert(i,e),s&&s.selection&&(2==s.selection.length?this.selection.setSelectionRange(new f(i.row,u+s.selection[0],i.row,u+s.selection[1])):this.selection.setSelectionRange(new f(i.row+s.selection[0],s.selection[1],i.row+s.selection[2],s.selection[3]))),n.getDocument().isNewLine(e)){var d=r.getNextLineIndent(c,a.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},d)}h&&r.autoOutdent(c,n,i.row)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(e,t){var n;(t.extendLeft||t.extendRight)&&((n=this.selection.getRange()).start.column-=t.extendLeft,n.end.column+=t.extendRight,this.selection.setRange(n),e||n.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((n=this.selection.getRange()).start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,"deletion",this,n,t);if(0===t.end.column){var s=n.getTextRange(t);if("\n"==s[s.length-1]){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var n,r,i=this.session.getLine(e.row);tt.toLowerCase()?1:0});var i=new f(0,0,0,0);for(r=e.first;r<=e.last;r++){var s=t.getLine(r);i.start.row=r,i.end.row=r,i.end.column=s.length,t.replace(i,n[r-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var r=this.session.getLine(e);n.lastIndex=t)return{value:i[0],start:i.index,end:i.index+i[0].length}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new f(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var s=this.getNumberAt(t,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,a=s.start+s.value.length-o,l=parseFloat(s.value);l*=Math.pow(10,a),o!==s.end&&n=a&&o<=l&&(n=t,u.selection.clearSelection(),u.moveCursorTo(e,a+r),u.selection.selectTo(e,l+r)),a=l});for(var c,h=this.$toggleWordPairs,d=0;df+1)break;f=p.last}for(c--,a=this.session.$moveLines(d,f,t?0:e),t&&-1==e&&(h=c+1);h<=c;)o[h].moveBy(a,0),h++;t||(a=0),l+=a}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);!0===t?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):!1===t&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,i*r.lineHeight),null!=t&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new v(this.session,n.row,n.column),i=r.getCurrentToken(),s=i||r.stepForward();if(s){var o,a,l=!1,u={},c=n.column-s.start,h={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;c=0;--s)this.$tryReplace(n[s],e)&&r++;return this.selection.setSelectionRange(i),r},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return null!==(t=this.$search.replace(n,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&r.mixin(t,e);var i=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(i)||this.$search.$options.needle)||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var s=this.$search.find(this.session);return t.preventScroll?s:s?(this.revealRange(s,n),s):(t.backwards?i.start=i.end:i.end=i.start,void this.selection.setRange(i))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(e){var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var s=this.on("changeSelection",function(){r=!0}),o=this.renderer.on("beforeRender",function(){r&&(t=n.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,s=e.$cursorLayer.$pixelPos,o=e.layerConfig,a=s.top-o.offset;null!=(r=s.top>=0&&a+t.top<0||!(s.topwindow.innerHeight)&&null)&&(i.style.top=a+"px",i.style.left=s.left+"px",i.style.height=o.lineHeight+"px",i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",o))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,i.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},this.prompt=function(e,t,n){var r=this;E.loadModule("./ext/prompt",function(i){i.prompt(r,e,t,n)})}}.call(D.prototype),E.defineOptions(D.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?S.attach(this):S.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?S.attach(this):S.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.renderer.$composition||this.getValue();if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),i.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!e&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),i.addCssClass(this.container,"ace_hasPlaceholder");var t=i.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var S={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=D}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,n){this.$fromUndo||e!=this.$lastDelta&&(!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,r=n.length;r--;){var i=n[r][0];if(i.id<=e)break;i.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?a(e):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(r.prototype);var i=e("./range").Range,s=i.comparePoints;function o(e){return{row:e.row,column:e.column}}function a(e){if(e=e||this,Array.isArray(e))return e.map(a).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function u(e,t){var n="insert"==e.action,r="insert"==t.action;if(n&&r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}else if(!n&&r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(!n&&!r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}return[t,e]}function c(e,t){for(var n=e.length;n--;)for(var r=0;r=0?d(e,t,-1):(s(e.start,t.start)<=0||d(e,i.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!n&&r)s(t.start,e.end)>=0?d(t,e,-1):(s(t.start,e.start)<=0||d(t,i.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{var o,a;if(!(s(t.end,e.start)<=0))return s(e.start,t.start)<0&&(o=e,e=p(e,t.start)),s(e.end,t.end)>0&&(a=p(e,t.end)),f(t.end,e.start,e.end,-1),a&&!o&&(e.lines=a.lines,e.start=a.start,e.end=a.end,a=e),[t,o,a].filter(Boolean);d(e,t,-1)}return[t,e]}function d(e,t,n){f(e.start,t.start,t.end,n),f(e.end,t.start,t.end,n)}function f(e,t,n,r){e.row==(1==r?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function p(e,t){var n=e.lines,r=e.end;e.end=o(t);var i=e.end.row-e.start.row,s=n.splice(i,n.length),a=i?t.column:t.column-e.start.column;return n.push(s[0].substring(0,a)),s[0]=s[0].substr(a),{start:o(t),end:r,lines:s,action:e.action}}function m(e,t){t=function(e){return{start:o(e.start),end:o(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var n=e.length;n--;){for(var r=e[n],i=0;is&&(l=i.end.row+1,s=(i=t.getNextFoldLine(l,i))?i.start.row:1/0),l>r){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,e,this.session,u),this.$lines.push(o)),this.$renderCell(o,e,i,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,i=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(i=t.getLength()+r-1);var s=n?n.getWidth(t,i,e):i.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();(s+=o.left+o.right)===this.gutterWidth||isNaN(s)||(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(r.row>this.$cursorRow){var i=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&i&&i.start.row==t[n-1].row))break;r=t[n-1]}r.element.className="ace_gutter-active-line "+r.element.className,this.$cursorCell=r;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;if(this.oldLastRow=n,!t||r0;i--)this.$lines.shift();if(r>n)for(i=this.session.getFoldedRowCount(n+1,r);i>0;i--)this.$lines.pop();e.firstRowr&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,n){for(var r=[],i=t,s=this.session.getNextFoldLine(i),o=s?s.start.row:1/0;i>o&&(i=s.end.row+1,o=(s=this.session.getNextFoldLine(i,s))?s.start.row:1/0),!(i>n);){var a=this.$lines.createCell(i,e,this.session,u);this.$renderCell(a,e,s,i),r.push(a),i++}return r},this.$renderCell=function(e,t,n,i){var s=e.element,o=this.session,a=s.childNodes[0],l=s.childNodes[1],u=o.$firstLineNumber,c=o.$breakpoints,h=o.$decorations,d=o.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&o.foldWidgets,p=n?n.start.row:Number.MAX_VALUE,m="ace_gutter-cell ";if(this.$highlightGutterLine&&(i==this.$cursorRow||n&&i=p&&this.$cursorRow<=n.end.row)&&(m+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),c[i]&&(m+=c[i]),h[i]&&(m+=h[i]),this.$annotations[i]&&(m+=this.$annotations[i].className),s.className!=m&&(s.className=m),f){var g=f[i];null==g&&(g=f[i]=o.getFoldWidget(i))}if(g){m="ace_fold-widget ace_"+g,"start"==g&&i==p&&in.right-t.right?"foldWidgets":void 0}}).call(l.prototype),t.Gutter=l}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/dom"),s=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){function e(e,t,n,r){return(e?1:0)|(t?2:0)|(n?4:0)|(r?8:0)}this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},this.update=function(e){if(e){var t;for(var n in this.config=e,this.i=0,this.markers){var r=this.markers[n];if(r.range){var i=r.range.clipRows(e.firstRow,e.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),r.renderer){var s=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,s,e)}else"fullLine"==r.type?this.drawFullLineMarker(t,i,r.clazz,e):"screenLine"==r.type?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?"text"==r.type?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+" ace_start ace_br15",e)}else r.update(t,this,this.session,e)}if(-1!=this.i)for(;this.if,c==u),s,c==u?0:1,o)},this.drawMultiLineMarker=function(e,t,n,r,i){var s=this.$padding,o=r.lineHeight,a=this.$getTop(t.start.row,r),l=s+t.start.column*r.characterWidth;if(i=i||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((u=t.clone()).end.row=u.start.row,u.end.column=this.session.getLine(u.start.row).length,this.drawBidiSingleLineMarker(e,u,n+" ace_br1 ace_start",r,null,i)):this.elt(n+" ace_br1 ace_start","height:"+o+"px;right:0;top:"+a+"px;left:"+l+"px;"+(i||"")),this.session.$bidiHandler.isBidiRow(t.end.row)){var u;(u=t.clone()).start.row=u.end.row,u.start.column=0,this.drawBidiSingleLineMarker(e,u,n+" ace_br12",r,null,i)}else{a=this.$getTop(t.end.row,r);var c=t.end.column*r.characterWidth;this.elt(n+" ace_br12","height:"+o+"px;width:"+c+"px;top:"+a+"px;left:"+s+"px;"+(i||""))}if(!((o=(t.end.row-t.start.row-1)*r.lineHeight)<=0)){a=this.$getTop(t.start.row+1,r);var h=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+o+"px;right:0;top:"+a+"px;left:"+s+"px;"+(i||""))}},this.drawSingleLineMarker=function(e,t,n,r,i,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,i,s);var o=r.lineHeight,a=(t.end.column+(i||0)-t.start.column)*r.characterWidth,l=this.$getTop(t.start.row,r),u=this.$padding+t.start.column*r.characterWidth;this.elt(n,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+u+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(e,t,n,r,i,s){var o=r.lineHeight,a=this.$getTop(t.start.row,r),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(n,"height:"+o+"px;width:"+e.width+(i||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-s),this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))},this.drawScreenLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))}}).call(s.prototype),t.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=function(e){this.dom=i,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){r.implement(this,a),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;nc&&(a=l.end.row+1,c=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(a>i);){var h=s[o++];if(h){this.dom.removeChildren(h),this.$renderLine(h,a,a==c&&l),u&&(h.style.top=this.$lines.computeLineTop(a,e,this.session)+"px");var d=e.lineHeight*this.session.getRowLength(a)+"px";h.style.height!=d&&(u=!0,h.style.height=d)}a++}if(u)for(;o0;i--)this.$lines.shift();if(t.lastRow>e.lastRow)for(i=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);i>0;i--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,n){for(var r=[],s=t,o=this.session.getNextFoldLine(s),a=o?o.start.row:1/0;s>a&&(s=o.end.row+1,a=(o=this.session.getNextFoldLine(s,o))?o.start.row:1/0),!(s>n);){var l=this.$lines.createCell(s,e,this.session),u=l.element;this.dom.removeChildren(u),i.setStyle(u.style,"height",this.$lines.computeLineHeight(s,e,this.session)+"px"),i.setStyle(u.style,"top",this.$lines.computeLineTop(s,e,this.session)+"px"),this.$renderLine(u,s,s==a&&o),this.$useLineGroups()?u.className="ace_line_group":u.className="ace_line",r.push(l),s++}return r},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,n=e.lastRow,r=this.$lines;r.getLength();)r.pop();r.push(this.$renderLinesFragment(e,t,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,r){for(var i,o=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),u=0;i=a.exec(r);){var c=i[1],h=i[2],d=i[3],f=i[4],p=i[5];if(o.showInvisibles||!h){var m=u!=i.index?r.slice(u,i.index):"";if(u=i.index+i[0].length,m&&l.appendChild(this.dom.createTextNode(m,this.element)),c){var g=o.session.getScreenTabSize(t+i.index);l.appendChild(o.$tabStrings[g].cloneNode(!0)),t+=g-1}else h?o.showInvisibles?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",v.textContent=s.stringRepeat(o.SPACE_CHAR,h.length),l.appendChild(v)):l.appendChild(this.com.createTextNode(h,this.element)):d?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",v.textContent=s.stringRepeat(o.SPACE_CHAR,d.length),l.appendChild(v)):f?(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className=o.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",v.textContent=o.showInvisibles?o.SPACE_CHAR:f,l.appendChild(v)):p&&(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className="ace_cjk",v.textContent=p,l.appendChild(v))}}if(l.appendChild(this.dom.createTextNode(u?r.slice(u):r,this.element)),this.$textToken[n.type])e.appendChild(l);else{var E="ace_"+n.type.replace(/\./g," ace_"),v=this.dom.createElement("span");"fold"==n.type&&(v.style.width=n.value.length*this.config.characterWidth+"px"),v.className=E,v.appendChild(l),e.appendChild(v)}return t+r.length},this.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(" "==t[0]){for(var i=(r-=r%this.tabSize)/this.tabSize,s=0;s=o;)a=this.$renderToken(l,a,c,h.substring(0,o-r)),h=h.substring(o-r),r=o,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(s.stringRepeat(" ",n.indent),this.element)),a=0,o=n[++i]||Number.MAX_VALUE;0!=h.length&&(r+=h.length,a=this.$renderToken(l,a,c,h))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(e,t){var n=0,r=t[0],i=r.value;this.displayIndentGuides&&(i=this.renderIndentGuide(e,i)),i&&(n=this.$renderToken(e,n,r,i));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,r,i);n=this.$renderToken(e,n,r,i)}},this.$renderOverflowMessage=function(e,t,n,r,i){n&&this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=i?"":"",e.appendChild(s)},this.$renderLine=function(e,t,n){if(n||0==n||(n=this.session.getFoldLine(t)),n)var r=this.$getFoldLineTokens(t,n);else r=this.session.getTokens(t);var i=e;if(r.length){var s=this.session.getRowSplitData(t);s&&s.length?(this.$renderWrappedLine(e,r,s),i=e.lastChild):(i=e,this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i)),this.$renderSimpleLine(i,r))}else this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i));if(this.showInvisibles&&i){n&&(t=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,i.appendChild(o)}},this.$getFoldLineTokens=function(e,t){var n=this.session,r=[],i=n.getTokens(e);return t.walk(function(e,t,s,o,a){null!=e?r.push({type:"fold",value:e}):(a&&(i=n.getTokens(t)),i.length&&function(e,t,n){for(var i=0,s=0;s+e[i].value.lengthn-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),s=t+o.length,i+=1);sn?r.push({type:e[i].type,value:o.substring(0,n-s)}):r.push(e[i]),s+=o.length,i+=1}}(i,o,s))},t.end.row,this.session.getLine(t.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),t.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)r.setStyle(t[n].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){r.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){r.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&r.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}else this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||o.top<0)&&n>1)){var a=this.cursors[i++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,o,e,t[n],this.session):this.isCursorInView(o,e)?(r.setStyle(l,"display","block"),r.translate(a,o.left,o.top),r.setStyle(l,"width",Math.round(e.characterWidth)+"px"),r.setStyle(l,"height",e.lineHeight+"px")):r.setStyle(l,"display","none")}}for(;this.cursors.length>i;)this.removeCursor();var u=this.session.getOverwrite();this.$setOverwrite(u),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(i.prototype),t.Cursor=i}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,a=32768,l=function(e){this.element=i.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){r.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(l.prototype);var u=function(e,t){l.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=i.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};r.inherits(u,l),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>a?(this.coeff=a/e,e=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(u.prototype);var c=function(e,t){l.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};r.inherits(c,l),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(c.prototype),t.ScrollBar=u,t.ScrollBarV=u,t.ScrollBarH=c,t.VScrollBar=u,t.HScrollBar=c}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){"use strict";var r=e("./lib/event"),i=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(r.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(i.prototype),t.RenderLoop=i}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,u=256,c="function"==typeof ResizeObserver,h=200,d=t.FontMetrics=function(e){this.el=i.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.innerHTML=s.stringRepeat("X",u),this.$characterSize={width:0,height:0},c?this.$addObserver():this.checkForSizeChanges()};(function(){r.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){var n=t[0].contentRect;e.checkForSizeChanges({height:n.height,width:n.width/u})}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/u};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.innerHTML=s.stringRepeat(e,u),this.$main.getBoundingClientRect().width/u},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=i.buildDom([e(0,0),e(h,0),e(0,h),e(h,h)],this.el)},this.transformCoordinates=function(e,t){function n(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function r(e,t){return[e[0]-t[0],e[1]-t[1]]}function i(e,t){return[e[0]+t[0],e[1]+t[1]]}function s(e,t){return[e*t[0],e*t[1]]}function o(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=s(1/this.$getZoom(this.el),e)),this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),u=o(this.els[2]),c=o(this.els[3]),d=n(r(c,l),r(c,u),r(i(l,u),i(c,a))),f=s(1+d[0],r(l,a)),p=s(1+d[1],r(u,a));if(t){var m=t,g=d[0]*m[0]/h+d[1]*m[1]/h+1,E=i(s(m[0],f),s(m[1],p));return i(s(1/g/h,E),a)}var v=r(e,a),C=n(r(f,s(d[0],v)),r(p,s(d[1],v)),v);return s(h,C)}}).call(d.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./config"),o=e("./layer/gutter").Gutter,a=e("./layer/marker").Marker,l=e("./layer/text").Text,u=e("./layer/cursor").Cursor,c=e("./scrollbar").HScrollBar,h=e("./scrollbar").VScrollBar,d=e("./renderloop").RenderLoop,f=e("./layer/font_metrics").FontMetrics,p=e("./lib/event_emitter").EventEmitter,m='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);opacity: 0.7;transform-origin: left;text-indent: 10px;}',g=e("./lib/useragent"),E=g.isIE;i.importCssString(m,"ace_editor.css");var v=function(e,t){var n=this;this.container=e||i.createElement("div"),i.addCssClass(this.container,"ace_editor"),i.HI_DPI&&i.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=i.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=i.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=i.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var r=this.$textLayer=new l(this.content);this.canvas=r.element,this.$markerFront=new a(this.content),this.$cursorLayer=new u(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new f(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!g.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,p),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),i.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,n){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,r){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var i=this.container;r||(r=i.clientHeight||i.scrollHeight),n||(n=i.clientWidth||i.scrollWidth);var s=this.$updateCachedSize(e,t,n,r);if(!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var s=0,o=this.$size,a={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if(r&&(e||o.height!=r)&&(o.height=r,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL),n&&(e||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,i.setStyle(this.scrollBarH.element.style,"left",t+"px"),i.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),i.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";i.setStyle(this.scrollBarH.element.style,"right",l),i.setStyle(this.scroller.style,"right",l),i.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(s|=this.CHANGE_FULL)}return o.$dirty=!n||!r,s&&this._signal("resize",a),s},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=i.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=i.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var n=this.$cursorLayer.$pixelPos;if(n){t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var r=this.layerConfig,s=n.top,o=n.left;s-=r.offset;var a=t&&t.useTextareaForIME?this.lineHeight:E?0:1;if(s<0||s>r.height-a)i.translate(this.textarea,0,0);else{var l=1,u=this.$size.height-a;if(t)if(t.useTextareaForIME){var c=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(c)[0]}else s+=this.lineHeight+2;else s+=this.lineHeight;(o-=this.scrollLeft)>this.$size.scrollerWidth-l&&(o=this.$size.scrollerWidth-l),o+=this.gutterWidth+this.margin.left,i.setStyle(e,"height",a+"px"),i.setStyle(e,"width",l+"px"),i.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-l),Math.min(s,u))}}}else i.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},this.setMargin=function(e,t,n,r){var i=this.margin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),i.translate(this.content,-this.scrollLeft,-n.offset);var s=n.width+2*this.$padding+"px",o=n.minHeight+"px";i.setStyle(this.content.style,"width",s),i.setStyle(this.content.style,"height",o)}if(e&this.CHANGE_H_SCROLL&&(i.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender")}else this.$changes|=e},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=!(n<=2*this.lineHeight)&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||r!=this.$vScroll){r!=this.$vScroll&&(this.$vScroll=r,this.scrollBarV.setVisible(r));var i=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,i,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength()*this.lineHeight,i=this.$getLongestLine(),s=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-i-2*this.$padding<0),o=this.$horizScroll!==s;o&&(this.$horizScroll=s,this.scrollBarH.setVisible(s));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,u=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;r+=u;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,r-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,i+2*this.$padding-t.scrollerWidth+c.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-r+u<0||this.scrollTop>c.top),d=a!==h;d&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var f,p,m=this.scrollTop%this.lineHeight,g=Math.ceil(l/this.lineHeight)-1,E=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),v=E+g,C=this.lineHeight;E=e.screenToDocumentRow(E,0);var D=e.getFoldLine(E);D&&(E=D.start.row),f=e.documentToScreenRow(E,0),p=e.getRowLength(E)*C,v=Math.min(e.screenToDocumentRow(v,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(v)*C+p,m=this.scrollTop-f*C;var S=0;return(this.layerConfig.width!=i||o)&&(S=this.CHANGE_H_SCROLL),(o||d)&&(S|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(i=this.$getLongestLine())),this.layerConfig={width:i,padding:this.$padding,firstRow:E,firstRowScreen:f,lastRow:v,lineHeight:C,characterWidth:this.characterWidth,minHeight:l,maxHeight:r,offset:m,gutterOffset:C?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/C)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(i-this.$padding),S},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1||tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t,n){if(0!==this.$size.scrollerHeight){var r=this.$cursorLayer.getPixelPosition(e),i=r.left,s=r.top,o=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+o>s?(t&&l+o>s+this.lineHeight&&(s-=t*this.$size.scrollerHeight),0===s&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):l+this.$size.scrollerHeight-ai?(i=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:a,side:s-a>0?1:-1,offsetX:i}},this.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),a=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),i)},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),s=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+s-this.scrollTop}},this.visualizeFocus=function(){i.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){i.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),e.useTextareaForIME=this.$useTextareaForIME,this.$useTextareaForIME?(i.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),i.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText,this.$composition=null,this.$cursorLayer.element.style.display="")},this.addToken=function(e,t,n,r){var i=this.session;i.bgTokenizer.lines[n]=null;var s={type:t,value:e},o=i.getTokens(n);if(null==r)o.push(s);else for(var a=0,l=0;l50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,n){var r=null,i=!1,a=Object.create(s),u=[],c=new l({messageBuffer:u,terminate:function(){},postMessage:function(e){u.push(e),r&&(i?setTimeout(h):h())}});c.setEmitSync=function(e){i=e};var h=function(){var e=u.shift();e.command?r[e.command].apply(r,e.args):e.event&&a._signal(e.event,e.data)};return a.postMessage=function(e){c.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},o.loadModule(["worker",t],function(e){for(r=new e[n](a);u.length;)h()}),c},t.WorkerClient=l,t.createWorker=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(e,t,n,r,i,s){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,i),this.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,s=t.start.column-this.pos.column;if(this.updateAnchors(e),i&&(this.length+=n),i&&!this.session.$fromUndo)if("insert"===e.action)for(var o=this.others.length-1;o>=0;o--){var a={row:(l=this.others[o]).row,column:l.column+s};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(o=this.others.length-1;o>=0;o--){var l;a={row:(l=this.others[o]).row,column:l.column+s},this.doc.remove(new r(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,i){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),i,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)}},this.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new r,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{n=this.getRange();var r=this.isBackwards(),s=n.start.row,o=n.end.row;if(s==o){if(r)var a=n.end,l=n.start;else a=n.start,l=n.end;return this.addRange(i.fromPoints(l,l)),void this.addRange(i.fromPoints(a,a))}var u=[],c=this.getLineRange(s,!0);c.start.column=n.start.column,u.push(c);for(var h=s+1;h1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(r,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],s=e.column0;)E--;if(E>0)for(var v=0;r[v].isEmpty();)v++;for(var C=E;C>=v;C--)r[C].isEmpty()&&r.splice(C,1)}return r}}.call(s.prototype);var d=e("./editor").Editor;function f(e,t){return e.row==t.row&&e.column==t.column}function p(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",o),e.commands.addCommands(u.defaultCommands),function(e){if(e.textInput){var t=e.textInput.getElement(),n=!1;a.addListener(t,"keydown",function(t){var i=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&i?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&r()}),a.addListener(t,"keyup",r),a.addListener(t,"blur",r)}function r(t){n&&(e.renderer.setMouseCursor(""),n=!1)}}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var r=e[n];if(r.marker){this.session.removeMarker(r.marker);var i=t.indexOf(r);-1!=i&&t.splice(i,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(u.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(u.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?r=n.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?r=n.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});else{var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return r}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var r,i=n&&n.keepOrder,o=1==n||n&&n.$byLines,a=this.session,l=this.selection,u=l.rangeList,c=(i?l:u).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var h=l._eventRegistry;l._eventRegistry={};var d=new s(a);this.inVirtualSelectionMode=!0;for(var f=c.length;f--;){if(o)for(;f>0&&c[f].start.row==c[f-1].end.row;)f--;d.fromOrientedRange(c[f]),d.index=f,this.selection=a.selection=d;var p=e.exec?e.exec(this,t||{}):e(this,t||{});r||void 0===p||(r=p),d.toOrientedRange(c[f])}d.detach(),this.selection=a.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=h,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),r}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],r=0;ro&&(o=n.column),rc?e.insert(r,l.stringRepeat(" ",s-c)):e.remove(new i(r.row,r.column,r.row,r.column-s+c)),t.start.column=t.end.column=o,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var c=this.selection.getRange(),h=c.start.row,d=c.end.row,f=h==d;if(f){var p,m=this.session.getLength();do{p=this.session.getLine(d)}while(/[=:]/.test(p)&&++d0);h<0&&(h=0),d>=m&&(d=m-1)}var g=this.session.removeFullLines(h,d);g=this.$reAlignText(g,f),this.session.insert({row:h,column:0},g.join("\n")+"\n"),f||(c.start.column=0,c.end.column=g[g.length-1].length),this.selection.setRange(c)}},this.$reAlignText=function(e,t){var n,r,i,s=!0,o=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==n?(n=t[1].length,r=t[2].length,i=t[3].length,t):(n+r+i!=t[1].length+t[2].length+t[3].length&&(o=!1),n!=t[1].length&&(s=!1),n>t[1].length&&(n=t[1].length),rt[3].length&&(i=t[3].length),t):[e]}).map(t?u:s?o?function(e){return e[2]?a(n+r-e[2].length)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:u:function(e){return e[2]?a(n)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function a(e){return l.stringRepeat(" ",e)}function u(e){return e[2]?a(n)+e[2]+a(r-e[2].length+i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=p,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){p(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,s=e.getLine(t),o=s.search(i);if(-1!=o){for(var a=n||s.length,l=e.getLength(),u=t,c=t;++tu){var f=e.getLine(c).length;return new r(u,a,c,f)}}},this.openingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i+1},a=e.$findClosingBracket(t,o,s);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>o.row&&(a.row--,a.column=e.getLine(a.row).length),r.fromPoints(o,a)}},this.closingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i},a=e.$findOpeningBracket(t,o);if(a)return a.column++,o.column--,r.fromPoints(a,o)}}).call(i.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}e("./range").Range,function(){this.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(n&&e.action){for(var r=e.data,i=r.start.row,s=r.end.row,o="add"==e.action,a=i+1;a0&&!r[i];)i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=s;o++){var a=r[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var u=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(u-=t.scrollLeft),a.el.style.left=u+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}.call(i.prototype),t.LineWidgets=i}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,n){"use strict";var r=e("../line_widgets").LineWidgets,i=e("../lib/dom"),s=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var o=e.getCursorPosition(),a=o.row,l=n.widgetManager.getWidgetsAtRow(a).filter(function(e){return"errorMarker"==e.type})[0];l?l.destroy():a-=t;var u,c=function(e,t,n){var r=e.getAnnotations().sort(s.comparePoints);if(r.length){var i=function(e,t,n){for(var r=0,i=e.length-1;r<=i;){var s=r+i>>1,o=n(t,e[s]);if(o>0)r=s+1;else{if(!(o<0))return s;i=s-1}}return-(r+1)}(r,{row:t,column:-1},s.comparePoints);i<0&&(i=-i-1),i>=r.length?i=n>0?0:r.length-1:0===i&&n<0&&(i=r.length-1);var o=r[i];if(o&&n){if(o.row===t){do{o=r[i+=n]}while(o&&o.row===t);if(!o)return r.slice()}var a=[];t=o.row;do{a[n<0?"unshift":"push"](o),o=r[i+=n]}while(o&&o.row==t);return a.length&&a}}}(n,a,t);if(c){var h=c[0];o.column=(h.pos&&"number"!=typeof h.column?h.pos.sc:h.column)||0,o.row=h.row,u=e.renderer.$gutterLayer.$annotations[o.row]}else{if(l)return;u={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(o.row),e.selection.moveToPosition(o);var d={row:o.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},f=d.el.appendChild(i.createElement("div")),p=d.el.appendChild(i.createElement("div"));p.className="error_widget_arrow "+u.className;var m=e.renderer.$cursorLayer.getPixelPosition(o).left;p.style.left=m+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",f.className="error_widget "+u.className,f.innerHTML=u.text.join("
"),f.appendChild(i.createElement("div"));var g=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(g),n.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(g),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t,r){"use strict";e("./lib/fixoldbrowsers");var i=e("./lib/dom"),s=e("./lib/event"),o=e("./range").Range,a=e("./editor").Editor,l=e("./edit_session").EditSession,u=e("./undomanager").UndoManager,c=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,t.define=n.amdD,t.edit=function(e,n){if("string"==typeof e){var r=e;if(!(e=document.getElementById(r)))throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof a)return e.env.editor;var o="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;o=l.value,e=i.createElement("pre"),l.parentNode.replaceChild(e,l)}else e&&(o=e.textContent,e.innerHTML="");var u=t.createEditSession(o),h=new a(new c(e),u,n),d={document:u,editor:h,onResize:h.resize.bind(h,null)};return l&&(d.textarea=l),s.addListener(window,"resize",d.onResize),h.on("destroy",function(){s.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),h.container.env=h.env=d,h},t.createEditSession=function(e,t){var n=new l(e,t);return n.setUndoManager(new u),n},t.Range=o,t.Editor=a,t.EditSession=l,t.UndoManager=u,t.VirtualRenderer=c,t.version=t.config.version}),ace.require(["ace/ace"],function(t){for(var n in t&&(t.config.init(!0),t.define=ace.define),window.ace||(window.ace=t),t)t.hasOwnProperty(n)&&(window.ace[n]=t[n]);window.ace.default=window.ace,e&&(e.exports=window.ace)}),e.exports={ace}},247(e,t,n){"use strict";var r=n(982),i=n(159),s=n(961);function o(e){var t="https://react.dev/errors/"+e;if(1P||(e.current=M[P],M[P]=null,P--)}function $(e,t){P++,M[P]=e.current,e.current=t}var G,V,W=B(null),H=B(null),j=B(null),z=B(null);function X(e,t){switch($(j,t),$(H,e),$(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=Eh(t=gh(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(W),$(W,e)}function K(){U(W),U(H),U(j)}function Y(e){null!==e.memoizedState&&$(z,e);var t=W.current,n=Eh(t,e.type);t!==n&&($(H,e),$(W,n))}function q(e){H.current===e&&(U(W),U(H)),z.current===e&&(U(z),ud._currentValue=k)}function Q(e){if(void 0===G)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);G=t&&t[1]||"",V=-1)":-1--i||l[r]!==u[i]){var c="\n"+l[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}}while(1<=r&&0<=i);break}}}finally{Z=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Q(n):""}function ee(e,t){switch(e.tag){case 26:case 27:case 5:return Q(e.type);case 16:return Q("Lazy");case 13:return e.child!==t&&null!==t?Q("Suspense Fallback"):Q("Suspense");case 19:return Q("SuspenseList");case 0:case 15:return J(e.type,!1);case 11:return J(e.type.render,!1);case 1:return J(e.type,!0);case 31:return Q("Activity");default:return""}}function te(e){try{var t="",n=null;do{t+=ee(e,n),n=e,e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var ne=Object.prototype.hasOwnProperty,re=r.unstable_scheduleCallback,ie=r.unstable_cancelCallback,se=r.unstable_shouldYield,oe=r.unstable_requestPaint,ae=r.unstable_now,le=r.unstable_getCurrentPriorityLevel,ue=r.unstable_ImmediatePriority,ce=r.unstable_UserBlockingPriority,he=r.unstable_NormalPriority,de=r.unstable_LowPriority,fe=r.unstable_IdlePriority,pe=r.log,me=r.unstable_setDisableYieldValue,ge=null,Ee=null;function ve(e){if("function"==typeof pe&&me(e),Ee&&"function"==typeof Ee.setStrictMode)try{Ee.setStrictMode(ge,e)}catch(e){}}var Ce=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(De(e)/Se|0)|0},De=Math.log,Se=Math.LN2,Ae=256,_e=262144,ye=4194304;function be(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Te(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var i=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var a=134217727&r;return 0!==a?0!==(r=a&~s)?i=be(r):0!==(o&=a)?i=be(o):n||0!==(n=a&~e)&&(i=be(n)):0!==(a=r&~s)?i=be(a):0!==o?i=be(o):n||0!==(n=r&~e)&&(i=be(n)),0===i?0:0!==t&&t!==i&&0===(t&s)&&((s=i&-i)>=(n=t&-t)||32===s&&4194048&n)?t:i}function Re(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function we(){var e=ye;return!(62914560&(ye<<=1))&&(ye=4194304),e}function Fe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ne(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Le(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ce(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function Oe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ce(n),i=1<=bn),xn=String.fromCharCode(32),wn=!1;function Fn(e,t){switch(e){case"keyup":return-1!==_n.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Ln=!1,On={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function In(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!On[e.type]:"textarea"===t}function kn(e,t,n,r){It?kt?kt.push(r):kt=[r]:It=r,0<(t=nh(t,"onChange")).length&&(n=new tn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Mn=null,Pn=null;function Bn(e){Kc(e,0)}function Un(e){if(ft(Qe(e)))return e}function $n(e,t){if("change"===e)return t}var Gn=!1;if($t){var Vn;if($t){var Wn="oninput"in document;if(!Wn){var Hn=document.createElement("div");Hn.setAttribute("oninput","return;"),Wn="function"==typeof Hn.oninput}Vn=Wn}else Vn=!1;Gn=Vn&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Jn(r)}}function tr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?tr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function nr(e){for(var t=pt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=pt((e=t.contentWindow).document)}return t}function rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var ir=$t&&"documentMode"in document&&11>=document.documentMode,sr=null,or=null,ar=null,lr=!1;function ur(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;lr||null==sr||sr!==pt(r)||(r="selectionStart"in(r=sr)&&rr(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},ar&&Zn(ar,r)||(ar=r,0<(r=nh(or,"onSelect")).length&&(t=new tn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=sr)))}function cr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var hr={animationend:cr("Animation","AnimationEnd"),animationiteration:cr("Animation","AnimationIteration"),animationstart:cr("Animation","AnimationStart"),transitionrun:cr("Transition","TransitionRun"),transitionstart:cr("Transition","TransitionStart"),transitioncancel:cr("Transition","TransitionCancel"),transitionend:cr("Transition","TransitionEnd")},dr={},fr={};function pr(e){if(dr[e])return dr[e];if(!hr[e])return e;var t,n=hr[e];for(t in n)if(n.hasOwnProperty(t)&&t in fr)return dr[e]=n[t];return e}$t&&(fr=document.createElement("div").style,"AnimationEvent"in window||(delete hr.animationend.animation,delete hr.animationiteration.animation,delete hr.animationstart.animation),"TransitionEvent"in window||delete hr.transitionend.transition);var mr=pr("animationend"),gr=pr("animationiteration"),Er=pr("animationstart"),vr=pr("transitionrun"),Cr=pr("transitionstart"),Dr=pr("transitioncancel"),Sr=pr("transitionend"),Ar=new Map,_r="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function yr(e,t){Ar.set(e,t),nt(t,[e])}_r.push("scrollEnd");var br="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Tr=[],Rr=0,xr=0;function wr(){for(var e=Rr,t=xr=Rr=0;t>=o,i-=o,ti=1<<32-Ce(t)+i|n<p?(m=h,h=null):m=h.sibling;var g=f(i,h,a[p],l);if(null===g){null===h&&(h=m);break}e&&h&&null===g.alternate&&t(i,h),o=s(g,o,p),null===c?u=g:c.sibling=g,c=g,h=m}if(p===a.length)return n(i,h),ci&&ri(i,p),u;if(null===h){for(;pm?(g=p,p=null):g=p.sibling;var C=f(i,p,v.value,u);if(null===C){null===p&&(p=g);break}e&&p&&null===C.alternate&&t(i,p),a=s(C,a,m),null===h?c=C:h.sibling=C,h=C,p=g}if(v.done)return n(i,p),ci&&ri(i,m),c;if(null===p){for(;!v.done;m++,v=l.next())null!==(v=d(i,v.value,u))&&(a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return ci&&ri(i,m),c}for(p=r(p);!v.done;m++,v=l.next())null!==(v=E(p,i,m,v.value,u))&&(e&&null!==v.alternate&&p.delete(null===v.key?m:v.key),a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return e&&p.forEach(function(e){return t(i,e)}),ci&&ri(i,m),c}(l,u,c=C.call(c),h)}if("function"==typeof c.then)return v(l,u,ls(c),h);if(c.$$typeof===D)return v(l,u,Li(l,c),h);cs(l,c)}return"string"==typeof c&&""!==c||"number"==typeof c||"bigint"==typeof c?(c=""+c,null!==u&&6===u.tag?(n(l,u.sibling),(h=i(u,c)).return=l,l=h):(n(l,u),(h=Wr(c,l.mode,h)).return=l,l=h),a(l)):n(l,u)}return function(e,t,n,r){try{as=0;var i=v(e,t,n,r);return os=null,i}catch(t){if(t===qi||t===Zi)throw t;var s=Pr(29,t,null,e.mode);return s.lanes=r,s.return=e,s}}}var ds=hs(!0),fs=hs(!1),ps=!1;function ms(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Es(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vs(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&du){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ir(e),Or(e,null,n),t}return Fr(e,r,t,n),Ir(e)}function Cs(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Oe(e,n)}}function Ds(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===s?i=s=o:s=s.next=o,n=n.next}while(null!==n);null===s?i=s=t:s=s.next=t}else i=s=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ss=!1;function As(){if(Ss&&null!==Wi)throw Wi}function _s(e,t,n,r){Ss=!1;var i=e.updateQueue;ps=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var l=a,u=l.next;l.next=null,null===o?s=u:o.next=u,o=l;var c=e.alternate;null!==c&&(a=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===a?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l)}if(null!==s){var h=i.baseState;for(o=0,c=u=l=null,a=s;;){var f=-536870913&a.lane,p=f!==a.lane;if(p?(mu&f)===f:(r&f)===f){0!==f&&f===Vi&&(Ss=!0),null!==c&&(c=c.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var m=e,g=a;f=t;var E=n;switch(g.tag){case 1:if("function"==typeof(m=g.payload)){h=m.call(E,h,f);break e}h=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(f="function"==typeof(m=g.payload)?m.call(E,h,f):m))break e;h=d({},h,f);break e;case 2:ps=!0}}null!==(f=a.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=i.callbacks)?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===c?(u=c=p,l=h):c=c.next=p,o|=f;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(p=a).next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}null===c&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null===s&&(i.shared.lanes=0),_u|=o,e.lanes=o,e.memoizedState=h}}function ys(e,t){if("function"!=typeof e)throw Error(o(191,e));e.call(t)}function bs(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;es?s:8;var o,a,l,u=O.T,c={};O.T=c,ca(e,!1,t,n);try{var h=i(),d=O.S;null!==d&&d(c,h),null!==h&&"object"==typeof h&&"function"==typeof h.then?ua(e,t,(o=r,a=[],l={status:"pending",value:null,reason:null,then:function(e){a.push(e)}},h.then(function(){l.status="fulfilled",l.value=o;for(var e=0;e<\/script>",s=s.removeChild(s.firstChild);break;case"select":s="string"==typeof r.is?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s="string"==typeof r.is?a.createElement(i,{is:r.is}):a.createElement(i)}}s[$e]=t,s[Ge]=r;e:for(a=t.child;null!==a;){if(5===a.tag||6===a.tag)s.appendChild(a.stateNode);else if(4!==a.tag&&27!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;null===a.sibling;){if(null===a.return||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=s;e:switch(hh(s,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&ol(t)}}return hl(t),al(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&ol(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));if(e=j.current,Ei(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(i=li))switch(i.tag){case 27:case 5:r=i.memoizedProps}e[$e]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||lh(e.nodeValue,n)))||pi(t,!0)}else(e=mh(e).createTextNode(r))[$e]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(r=Ei(t),null!==n){if(null===e){if(!r)throw Error(o(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(o(557));e[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Ps(t),t):(Ps(t),null);if(128&t.flags)throw Error(o(558))}return hl(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=Ei(t),null!==r&&null!==r.dehydrated){if(null===e){if(!i)throw Error(o(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(o(317));i[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),i=!1}else i=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return 256&t.flags?(Ps(t),t):(Ps(t),null)}return Ps(t),128&t.flags?(t.lanes=n,t):(n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(i=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(i=r.alternate.memoizedState.cachePool.pool),s=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(s=r.memoizedState.cachePool.pool),s!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ul(t,t.updateQueue),hl(t),null);case 4:return K(),null===e&&Zc(t.stateNode.containerInfo),hl(t),null;case 10:return bi(t.type),hl(t),null;case 19:if(U(Bs),null===(r=t.memoizedState))return hl(t),null;if(i=!!(128&t.flags),null===(s=r.rendering))if(i)cl(r,!1);else{if(0!==Au||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(s=Us(e))){for(t.flags|=128,cl(r,!1),e=s.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)$r(n,e),n=n.sibling;return $(Bs,1&Bs.current|2),ci&&ri(t,r.treeForkCount),t.child}e=e.sibling}null!==r.tail&&ae()>Ou&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=Us(s))){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),cl(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!ci)return hl(t),null}else 2*ae()-r.renderingStartTime>Ou&&536870912!==n&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=r.last)?e.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ae(),e.sibling=null,n=Bs.current,$(Bs,i?1&n|2:1&n),ci&&ri(t,r.treeForkCount),e):(hl(t),null);case 22:case 23:return Ps(t),Fs(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?!!(536870912&n)&&!(128&t.flags)&&(hl(t),6&t.subtreeFlags&&(t.flags|=8192)):hl(t),null!==(n=t.updateQueue)&&ul(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&U(zi),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),bi(Pi),hl(t),null;case 25:case 30:return null}throw Error(o(156,t.tag))}function fl(e,t){switch(oi(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return bi(Pi),K(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return q(t),null;case 31:if(null!==t.memoizedState){if(Ps(t),null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Ps(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return U(Bs),null;case 4:return K(),null;case 10:return bi(t.type),null;case 22:case 23:return Ps(t),Fs(),null!==e&&U(zi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return bi(Pi),null;default:return null}}function pl(e,t){switch(oi(t),t.tag){case 3:bi(Pi),K();break;case 26:case 27:case 5:q(t);break;case 4:K();break;case 31:null!==t.memoizedState&&Ps(t);break;case 13:Ps(t);break;case 19:U(Bs);break;case 10:bi(t.type);break;case 22:case 23:Ps(t),Fs(),null!==e&&U(zi);break;case 24:bi(Pi)}}function ml(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var s=n.create,o=n.inst;r=s(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ac(t,t.return,e)}}function gl(e,t,n){try{var r=t.updateQueue,i=null!==r?r.lastEffect:null;if(null!==i){var s=i.next;r=s;do{if((r.tag&e)===e){var o=r.inst,a=o.destroy;if(void 0!==a){o.destroy=void 0,i=t;var l=n,u=a;try{u()}catch(e){Ac(i,l,e)}}}r=r.next}while(r!==s)}}catch(e){Ac(t,t.return,e)}}function El(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{bs(t,n)}catch(t){Ac(e,e.return,t)}}}function vl(e,t,n){n.props=Aa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ac(e,t,n)}}function Cl(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(n){Ac(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(n){Ac(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){Ac(e,t,n)}else n.current=null}function Sl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ac(e,e.return,t)}}function Al(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,a=null,l=null,u=null,c=null,h=null;for(p in n){var d=n[p];if(n.hasOwnProperty(p)&&null!=d)switch(p){case"checked":case"value":break;case"defaultValue":u=d;default:r.hasOwnProperty(p)||uh(e,t,p,null,r,d)}}for(var f in r){var p=r[f];if(d=n[f],r.hasOwnProperty(f)&&(null!=p||null!=d))switch(f){case"type":s=p;break;case"name":i=p;break;case"checked":c=p;break;case"defaultChecked":h=p;break;case"value":a=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(o(137,t));break;default:p!==d&&uh(e,t,f,p,r,d)}}return void Et(e,a,l,u,c,h,s,i);case"select":for(s in p=a=l=f=null,n)if(u=n[s],n.hasOwnProperty(s)&&null!=u)switch(s){case"value":break;case"multiple":p=u;default:r.hasOwnProperty(s)||uh(e,t,s,null,r,u)}for(i in r)if(s=r[i],u=n[i],r.hasOwnProperty(i)&&(null!=s||null!=u))switch(i){case"value":f=s;break;case"defaultValue":l=s;break;case"multiple":a=s;default:s!==u&&uh(e,t,i,s,r,u)}return t=l,n=a,r=p,void(null!=f?Dt(e,!!n,f,!1):!!r!=!!n&&(null!=t?Dt(e,!!n,t,!0):Dt(e,!!n,n?[]:"",!1)));case"textarea":for(l in p=f=null,n)if(i=n[l],n.hasOwnProperty(l)&&null!=i&&!r.hasOwnProperty(l))switch(l){case"value":case"children":break;default:uh(e,t,l,null,r,i)}for(a in r)if(i=r[a],s=n[a],r.hasOwnProperty(a)&&(null!=i||null!=s))switch(a){case"value":f=i;break;case"defaultValue":p=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(o(91));break;default:i!==s&&uh(e,t,a,i,r,s)}return void St(e,f,p);case"option":for(var m in n)f=n[m],n.hasOwnProperty(m)&&null!=f&&!r.hasOwnProperty(m)&&("selected"===m?e.selected=!1:uh(e,t,m,null,r,f));for(u in r)f=r[u],p=n[u],!r.hasOwnProperty(u)||f===p||null==f&&null==p||("selected"===u?e.selected=f&&"function"!=typeof f&&"symbol"!=typeof f:uh(e,t,u,f,r,p));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)f=n[g],n.hasOwnProperty(g)&&null!=f&&!r.hasOwnProperty(g)&&uh(e,t,g,null,r,f);for(c in r)if(f=r[c],p=n[c],r.hasOwnProperty(c)&&f!==p&&(null!=f||null!=p))switch(c){case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(o(137,t));break;default:uh(e,t,c,f,r,p)}return;default:if(Rt(t)){for(var E in n)f=n[E],n.hasOwnProperty(E)&&void 0!==f&&!r.hasOwnProperty(E)&&ch(e,t,E,void 0,r,f);for(h in r)f=r[h],p=n[h],!r.hasOwnProperty(h)||f===p||void 0===f&&void 0===p||ch(e,t,h,f,r,p);return}}for(var v in n)f=n[v],n.hasOwnProperty(v)&&null!=f&&!r.hasOwnProperty(v)&&uh(e,t,v,null,r,f);for(d in r)f=r[d],p=n[d],!r.hasOwnProperty(d)||f===p||null==f&&null==p||uh(e,t,d,f,r,p)}(r,e.type,n,t),r[Ge]=t}catch(t){Ac(e,e.return,t)}}function _l(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&bh(e.type)||4===e.tag}function yl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||_l(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&bh(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function bl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Nt));else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(bl(e,t,n),e=e.sibling;null!==e;)bl(e,t,n),e=e.sibling}function Tl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Tl(e,t,n),e=e.sibling;null!==e;)Tl(e,t,n),e=e.sibling}function Rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);hh(t,r,n),t[$e]=e,t[Ge]=n}catch(t){Ac(e,e.return,t)}}var xl=!1,wl=!1,Fl=!1,Nl="function"==typeof WeakSet?WeakSet:Set,Ll=null;function Ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Xl(e,n),4&r&&ml(5,n);break;case 1:if(Xl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){Ac(n,n.return,e)}else{var i=Aa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ac(n,n.return,e)}}64&r&&El(n),512&r&&Cl(n,n.return);break;case 3:if(Xl(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{bs(e,t)}catch(e){Ac(n,n.return,e)}}break;case 27:null===t&&4&r&&Rl(n);case 26:case 5:Xl(e,n),null===t&&4&r&&Sl(n),512&r&&Cl(n,n.return);break;case 12:Xl(e,n);break;case 31:Xl(e,n),4&r&&Ul(e,n);break;case 13:Xl(e,n),4&r&&$l(e,n),64&r&&null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Tc.bind(null,n));break;case 22:if(!(r=null!==n.memoizedState||xl)){t=null!==t&&null!==t.memoizedState||wl,i=xl;var s=wl;xl=r,(wl=t)&&!s?Yl(e,n,!!(8772&n.subtreeFlags)):Xl(e,n),xl=i,wl=s}break;case 30:break;default:Xl(e,n)}}function Il(e){var t=e.alternate;null!==t&&(e.alternate=null,Il(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&Ke(t),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var kl=null,Ml=!1;function Pl(e,t,n){for(n=n.child;null!==n;)Bl(e,t,n),n=n.sibling}function Bl(e,t,n){if(Ee&&"function"==typeof Ee.onCommitFiberUnmount)try{Ee.onCommitFiberUnmount(ge,n)}catch(e){}switch(n.tag){case 26:wl||Dl(n,t),Pl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:wl||Dl(n,t);var r=kl,i=Ml;bh(n.type)&&(kl=n.stateNode,Ml=!1),Pl(e,t,n),Ph(n.stateNode),kl=r,Ml=i;break;case 5:wl||Dl(n,t);case 6:if(r=kl,i=Ml,kl=null,Pl(e,t,n),Ml=i,null!==(kl=r))if(Ml)try{(9===kl.nodeType?kl.body:"HTML"===kl.nodeName?kl.ownerDocument.body:kl).removeChild(n.stateNode)}catch(e){Ac(n,t,e)}else try{kl.removeChild(n.stateNode)}catch(e){Ac(n,t,e)}break;case 18:null!==kl&&(Ml?(Th(9===(e=kl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Gd(e)):Th(kl,n.stateNode));break;case 4:r=kl,i=Ml,kl=n.stateNode.containerInfo,Ml=!0,Pl(e,t,n),kl=r,Ml=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),wl||gl(4,n,t),Pl(e,t,n);break;case 1:wl||(Dl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&vl(n,t,r)),Pl(e,t,n);break;case 21:Pl(e,t,n);break;case 22:wl=(r=wl)||null!==n.memoizedState,Pl(e,t,n),wl=r;break;default:Pl(e,t,n)}}function Ul(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)){e=e.dehydrated;try{Gd(e)}catch(e){Ac(t,t.return,e)}}}function $l(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{Gd(e)}catch(e){Ac(t,t.return,e)}}function Gl(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Nl),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Nl),t;default:throw Error(o(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Rc.bind(null,e,t);t.then(r,r)}})}function Vl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r title"))),hh(s,r,n),s[$e]=e,Je(s),r=s;break e;case"link":var a=td("link","href",i).get(r+(n.href||""));if(a)for(var l=0;la)break;var c=l.transferSize,h=l.initiatorType;c&&dh(h)&&(o+=c*((l=l.responseEnd)id?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}(h,p)))return Uu=s,e.cancelPendingCommit=p(pc.bind(null,e,t,s,n,r,i,o,a,l,c,h,null,d,f)),void Qu(e,s,o,!u)}pc(e,t,s,n,r,i,o,a,l)}function qu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var r=0;rg&&(o=g,g=m,m=o);var E=er(a,m),v=er(a,g);if(E&&v&&(1!==f.rangeCount||f.anchorNode!==E.node||f.anchorOffset!==E.offset||f.focusNode!==v.node||f.focusOffset!==v.offset)){var C=h.createRange();C.setStart(E.node,E.offset),f.removeAllRanges(),m>g?(f.addRange(C),f.extend(v.node,v.offset)):(C.setEnd(v.node,v.offset),f.addRange(C))}}}}for(h=[],f=a;f=f.parentNode;)1===f.nodeType&&h.push({element:f,left:f.scrollLeft,top:f.scrollTop});for("function"==typeof a.focus&&a.focus(),a=0;an?32:n,O.T=null,n=Gu,Gu=null;var s=Pu,a=Uu;if(Mu=0,Bu=Pu=null,Uu=0,6&du)throw Error(o(331));var l=du;if(du|=4,au(s.current),Jl(s,s.current,a,n),du=l,kc(0,!1),Ee&&"function"==typeof Ee.onPostCommitFiberRoot)try{Ee.onPostCommitFiberRoot(ge,s)}catch(e){}return!0}finally{I.p=i,O.T=r,vc(e,t)}}function Sc(e,t,n){t=Xr(n,t),null!==(e=vs(e,t=xa(e.stateNode,t,2),2))&&(Ne(e,2),Ic(e))}function Ac(e,t,n){if(3===e.tag)Sc(e,e,n);else for(;null!==t;){if(3===t.tag){Sc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===ku||!ku.has(r))){e=Xr(n,e),null!==(r=vs(t,n=wa(2),2))&&(Fa(n,r,t,e),Ne(r,2),Ic(r));break}}t=t.return}}function _c(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hu;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(Du=!0,i.add(n),e=yc.bind(null,e,t,n),t.then(e,e))}function yc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,fu===e&&(mu&n)===n&&(4===Au||3===Au&&(62914560&mu)===mu&&300>ae()-Nu?!(2&du)&&ec(e,0):bu|=n,Ru===mu&&(Ru=0)),Ic(e)}function bc(e,t){0===t&&(t=we()),null!==(e=Lr(e,t))&&(Ne(e,t),Ic(e))}function Tc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),bc(e,n)}function Rc(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}null!==r&&r.delete(t),bc(e,n)}var xc=null,wc=null,Fc=!1,Nc=!1,Lc=!1,Oc=0;function Ic(e){e!==wc&&null===e.next&&(null===wc?xc=wc=e:wc=wc.next=e),Nc=!0,Fc||(Fc=!0,_h(function(){6&du?re(ue,Mc):Pc()}))}function kc(e,t){if(!Lc&&Nc){Lc=!0;do{for(var n=!1,r=xc;null!==r;){if(!t)if(0!==e){var i=r.pendingLanes;if(0===i)var s=0;else{var o=r.suspendedLanes,a=r.pingedLanes;s=(1<<31-Ce(42|e)+1)-1,s=201326741&(s&=i&~(o&~a))?201326741&s|1:s?2|s:0}0!==s&&(n=!0,$c(r,s))}else s=mu,!(3&(s=Te(r,r===fu?s:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Re(r,s)||(n=!0,$c(r,s));r=r.next}}while(n);Lc=!1}}function Mc(){Pc()}function Pc(){Nc=Fc=!1;var e,t=0;0!==Oc&&((e=window.event)&&"popstate"===e.type?e!==Ch&&(Ch=e,1):(Ch=null,0))&&(t=Oc);for(var n=ae(),r=null,i=xc;null!==i;){var s=i.next,o=Bc(i,n);0===o?(i.next=null,null===r?xc=s:r.next=s,null===s&&(wc=r)):(r=i,(0!==t||3&o)&&(Nc=!0)),i=s}0!==Mu&&5!==Mu||kc(t,!1),0!==Oc&&(Oc=0)}function Bc(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=-62914561&e.pendingLanes;0 title"):null)}function rd(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var id=0;function sd(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)ad(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var od=null;function ad(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,od=new Map,t.forEach(ld,e),od=null,sd.call(e))}function ld(e,t){if(!(4&t.state.loading)){var n=od.get(e);if(n)var r=n.get(null);else{n=new Map,od.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s>>1,i=e[r];if(!(0>>1;rs(l,n))us(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[a]=n,r=a);else{if(!(us(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var u=[],c=[],h=1,d=null,f=3,p=!1,m=!1,g=!1,E=!1,v="function"==typeof setTimeout?setTimeout:null,C="function"==typeof clearTimeout?clearTimeout:null,D="undefined"!=typeof setImmediate?setImmediate:null;function S(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function A(e){if(g=!1,S(e),!m)if(null!==r(u))m=!0,y||(y=!0,_());else{var t=r(c);null!==t&&L(A,t.startTime-e)}}var _,y=!1,b=-1,T=5,R=-1;function x(){return!(!E&&t.unstable_now()-Re&&x());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var a=o(d.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof a){d.callback=a,S(e),n=!0;break t}d===r(u)&&i(u),S(e)}else i(u);d=r(u)}if(null!==d)n=!0;else{var l=r(c);null!==l&&L(A,l.startTime-e),n=!1}}break e}finally{d=null,f=s,p=!1}n=void 0}}finally{n?_():y=!1}}}if("function"==typeof D)_=function(){D(w)};else if("undefined"!=typeof MessageChannel){var F=new MessageChannel,N=F.port2;F.port1.onmessage=w,_=function(){N.postMessage(null)}}else _=function(){v(w,0)};function L(e,n){b=v(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125o?(e.sortIndex=s,n(c,e),null===r(u)&&e===r(c)&&(g?(C(b),b=-1):g=!0,L(A,s-o))):(e.sortIndex=a,n(u,e),m||p||(m=!0,y||(y=!0,_()))),e},t.unstable_shouldYield=x,t.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}},982(e,t,n){"use strict";e.exports=n(477)},902(e,t,n){"use strict";var r=n(72),i=n.n(r),s=n(825),o=n.n(s),a=n(659),l=n.n(a),u=n(56),c=n.n(u),h=n(540),d=n.n(h),f=n(113),p=n.n(f),m=n(636),g={};g.styleTagTransform=p(),g.setAttributes=c(),g.insert=l().bind(null,"html"),g.domAPI=o(),g.insertStyleElement=d(),i()(m.A,g),m.A&&m.A.locals&&m.A.locals},72(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},878(e,t,n){"use strict";n.r(t),n.d(t,{EmbeddedFrontend:()=>Id,Spector:()=>kd});var r={};n.r(r),n.d(r,{LX:()=>Jo,ll:()=>ea});var i,s={};n.r(s),n.d(s,{SyntaxError:()=>Xc,parse:()=>Yc});class o{static isBuildableProgram(e){return!!e&&!!e[this.rebuildProgramFunctionName]}static rebuildProgram(e,t,n,r,i){this.isBuildableProgram(e)&&e[this.rebuildProgramFunctionName](t,n,r,i)}}o.rebuildProgramFunctionName="__SPECTOR_rebuildProgram",function(e){e[e.noLog=0]="noLog",e[e.error=1]="error",e[e.warning=2]="warning",e[e.info=3]="info"}(i||(i={}));class a{static error(e,...t){this.level>0&&console.error(e,t)}static warn(e,...t){this.level>1&&console.warn(e,t)}static info(e,...t){this.level>2&&console.log(e,t)}}a.level=i.warning;class l{constructor(){this.callbacks=[],this.counter=-1}add(e,t){return this.counter++,t&&(e=e.bind(t)),this.callbacks[this.counter]=e,this.counter}remove(e){delete this.callbacks[e]}clear(){this.callbacks={}}trigger(e){for(const t in this.callbacks)this.callbacks.hasOwnProperty(t)&&this.callbacks[t](e)}}class u{constructor(){if("undefined"!=typeof performance&&performance.now)this.nowFunction=()=>performance.now();else{const e=new Date;this.nowFunction=e.getTime.bind(e)}}static get now(){return u.instance.nowFunction()}}u.instance=new u;class c{constructor(e){this.options=e}appendAnalysis(e){e.analyses=e.analyses||[];const t=this.getAnalysis(e);e.analyses.push(t)}getAnalysis(e){const t={analyserName:this.analyserName};return this.appendToAnalysis(e,t),t}}class h extends c{get analyserName(){return h.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={};for(const t of e.commands)n[t.name]=n[t.name]||0,n[t.name]++;const r=Object.keys(n).map(e=>[e,n[e]]);r.sort((e,t)=>{const n=t[1]-e[1];return 0===n?e[0].localeCompare(t[0]):n});for(const e of r)t[e[0]]=e[1]}}h.analyserName="Commands";const d=["drawArrays","drawElements","drawArraysInstanced","drawArraysInstancedANGLE","drawElementsInstanced","drawElementsInstancedANGLE","drawRangeElements","multiDrawArraysWEBGL","multiDrawElementsWEBGL","multiDrawArraysInstancedWEBGL","multiDrawElementsInstancedWEBGL","multiDrawArraysInstancedBaseInstanceWEBGL","multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL","drawArraysInstancedBaseInstanceWEBGL","drawElementsInstancedBaseVertexBaseInstanceWEBGL"];class f extends c{get analyserName(){return f.analyserName}appendToAnalysis(e,t){if(e.commands){t.total=e.commands.length,t.draw=0,t.clear=0;for(const n of e.commands)"clear"===n.name?t.clear++:d.indexOf(n.name)>-1&&t.draw++}}}f.analyserName="CommandsSummary";class p{static isWebGlConstant(e){return null!==g[e]&&void 0!==g[e]}static stringifyWebGlConstant(e,t){if(null==e)return"";if(0===e){return this.zeroMeaningByCommand[t]||"0"}if(1===e){return this.oneMeaningByCommand[t]||"1"}const n=g[e];return n?n.name:e+""}}p.DEPTH_BUFFER_BIT={name:"DEPTH_BUFFER_BIT",value:256,description:"Passed to clear to clear the current depth buffer."},p.STENCIL_BUFFER_BIT={name:"STENCIL_BUFFER_BIT",value:1024,description:"Passed to clear to clear the current stencil buffer."},p.COLOR_BUFFER_BIT={name:"COLOR_BUFFER_BIT",value:16384,description:"Passed to clear to clear the current color buffer."},p.POINTS={name:"POINTS",value:0,description:"Passed to drawElements or drawArrays to draw single points."},p.LINES={name:"LINES",value:1,description:"Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it."},p.LINE_LOOP={name:"LINE_LOOP",value:2,description:"Passed to drawElements or drawArrays to draw lines. Each set of two vertices is treated as a separate line segment."},p.LINE_STRIP={name:"LINE_STRIP",value:3,description:"Passed to drawElements or drawArrays to draw a connected group of line segments from the first vertex to the last."},p.TRIANGLES={name:"TRIANGLES",value:4,description:"Passed to drawElements or drawArrays to draw triangles. Each set of three vertices creates a separate triangle."},p.TRIANGLE_STRIP={name:"TRIANGLE_STRIP",value:5,description:"Passed to drawElements or drawArrays to draw a connected group of triangles."},p.TRIANGLE_FAN={name:"TRIANGLE_FAN",value:6,description:"Passed to drawElements or drawArrays to draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan."},p.ZERO={name:"ZERO",value:0,description:"Passed to blendFunc or blendFuncSeparate to turn off a component."},p.ONE={name:"ONE",value:1,description:"Passed to blendFunc or blendFuncSeparate to turn on a component."},p.SRC_COLOR={name:"SRC_COLOR",value:768,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source elements color."},p.ONE_MINUS_SRC_COLOR={name:"ONE_MINUS_SRC_COLOR",value:769,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source elements color."},p.SRC_ALPHA={name:"SRC_ALPHA",value:770,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source's alpha."},p.ONE_MINUS_SRC_ALPHA={name:"ONE_MINUS_SRC_ALPHA",value:771,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source's alpha."},p.DST_ALPHA={name:"DST_ALPHA",value:772,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's alpha."},p.ONE_MINUS_DST_ALPHA={name:"ONE_MINUS_DST_ALPHA",value:773,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's alpha."},p.DST_COLOR={name:"DST_COLOR",value:774,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's color."},p.ONE_MINUS_DST_COLOR={name:"ONE_MINUS_DST_COLOR",value:775,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's color."},p.SRC_ALPHA_SATURATE={name:"SRC_ALPHA_SATURATE",value:776,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the minimum of source's alpha or one minus the destination's alpha."},p.CONSTANT_COLOR={name:"CONSTANT_COLOR",value:32769,description:"Passed to blendFunc or blendFuncSeparate to specify a constant color blend function."},p.ONE_MINUS_CONSTANT_COLOR={name:"ONE_MINUS_CONSTANT_COLOR",value:32770,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant color blend function."},p.CONSTANT_ALPHA={name:"CONSTANT_ALPHA",value:32771,description:"Passed to blendFunc or blendFuncSeparate to specify a constant alpha blend function."},p.ONE_MINUS_CONSTANT_ALPHA={name:"ONE_MINUS_CONSTANT_ALPHA",value:32772,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant alpha blend function."},p.FUNC_ADD={name:"FUNC_ADD",value:32774,description:"Passed to blendEquation or blendEquationSeparate to set an addition blend function."},p.FUNC_SUBSTRACT={name:"FUNC_SUBSTRACT",value:32778,description:"Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination)."},p.FUNC_REVERSE_SUBTRACT={name:"FUNC_REVERSE_SUBTRACT",value:32779,description:"Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source)."},p.BLEND_EQUATION={name:"BLEND_EQUATION",value:32777,description:"Passed to getParameter to get the current RGB blend function."},p.BLEND_EQUATION_RGB={name:"BLEND_EQUATION_RGB",value:32777,description:"Passed to getParameter to get the current RGB blend function. Same as BLEND_EQUATION"},p.BLEND_EQUATION_ALPHA={name:"BLEND_EQUATION_ALPHA",value:34877,description:"Passed to getParameter to get the current alpha blend function. Same as BLEND_EQUATION"},p.BLEND_DST_RGB={name:"BLEND_DST_RGB",value:32968,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_SRC_RGB={name:"BLEND_SRC_RGB",value:32969,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_DST_ALPHA={name:"BLEND_DST_ALPHA",value:32970,description:"Passed to getParameter to get the current destination alpha blend function."},p.BLEND_SRC_ALPHA={name:"BLEND_SRC_ALPHA",value:32971,description:"Passed to getParameter to get the current source alpha blend function."},p.BLEND_COLOR={name:"BLEND_COLOR",value:32773,description:"Passed to getParameter to return a the current blend color."},p.ARRAY_BUFFER_BINDING={name:"ARRAY_BUFFER_BINDING",value:34964,description:"Passed to getParameter to get the array buffer binding."},p.ELEMENT_ARRAY_BUFFER_BINDING={name:"ELEMENT_ARRAY_BUFFER_BINDING",value:34965,description:"Passed to getParameter to get the current element array buffer."},p.LINE_WIDTH={name:"LINE_WIDTH",value:2849,description:"Passed to getParameter to get the current lineWidth (set by the lineWidth method)."},p.ALIASED_POINT_SIZE_RANGE={name:"ALIASED_POINT_SIZE_RANGE",value:33901,description:"Passed to getParameter to get the current size of a point drawn with gl.POINTS"},p.ALIASED_LINE_WIDTH_RANGE={name:"ALIASED_LINE_WIDTH_RANGE",value:33902,description:"Passed to getParameter to get the range of available widths for a line. Returns a length-2 array with the lo value at 0, and hight at 1."},p.CULL_FACE_MODE={name:"CULL_FACE_MODE",value:2885,description:"Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK"},p.FRONT_FACE={name:"FRONT_FACE",value:2886,description:"Passed to getParameter to determine the current value of frontFace. Should return CW or CCW."},p.DEPTH_RANGE={name:"DEPTH_RANGE",value:2928,description:"Passed to getParameter to return a length-2 array of floats giving the current depth range."},p.DEPTH_WRITEMASK={name:"DEPTH_WRITEMASK",value:2930,description:"Passed to getParameter to determine if the depth write mask is enabled."},p.DEPTH_CLEAR_VALUE={name:"DEPTH_CLEAR_VALUE",value:2931,description:"Passed to getParameter to determine the current depth clear value."},p.DEPTH_FUNC={name:"DEPTH_FUNC",value:2932,description:"Passed to getParameter to get the current depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_CLEAR_VALUE={name:"STENCIL_CLEAR_VALUE",value:2961,description:"Passed to getParameter to get the value the stencil will be cleared to."},p.STENCIL_FUNC={name:"STENCIL_FUNC",value:2962,description:"Passed to getParameter to get the current stencil function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_FAIL={name:"STENCIL_FAIL",value:2964,description:"Passed to getParameter to get the current stencil fail function. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_FAIL={name:"STENCIL_PASS_DEPTH_FAIL",value:2965,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test fail. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_PASS={name:"STENCIL_PASS_DEPTH_PASS",value:2966,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test pass. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_REF={name:"STENCIL_REF",value:2967,description:"Passed to getParameter to get the reference value used for stencil tests."},p.STENCIL_VALUE_MASK={name:"STENCIL_VALUE_MASK",value:2963,description:" "},p.STENCIL_WRITEMASK={name:"STENCIL_WRITEMASK",value:2968,description:" "},p.STENCIL_BACK_FUNC={name:"STENCIL_BACK_FUNC",value:34816,description:" "},p.STENCIL_BACK_FAIL={name:"STENCIL_BACK_FAIL",value:34817,description:" "},p.STENCIL_BACK_PASS_DEPTH_FAIL={name:"STENCIL_BACK_PASS_DEPTH_FAIL",value:34818,description:" "},p.STENCIL_BACK_PASS_DEPTH_PASS={name:"STENCIL_BACK_PASS_DEPTH_PASS",value:34819,description:" "},p.STENCIL_BACK_REF={name:"STENCIL_BACK_REF",value:36003,description:" "},p.STENCIL_BACK_VALUE_MASK={name:"STENCIL_BACK_VALUE_MASK",value:36004,description:" "},p.STENCIL_BACK_WRITEMASK={name:"STENCIL_BACK_WRITEMASK",value:36005,description:" "},p.VIEWPORT={name:"VIEWPORT",value:2978,description:"Returns an Int32Array with four elements for the current viewport dimensions."},p.SCISSOR_BOX={name:"SCISSOR_BOX",value:3088,description:"Returns an Int32Array with four elements for the current scissor box dimensions."},p.COLOR_CLEAR_VALUE={name:"COLOR_CLEAR_VALUE",value:3106,description:" "},p.COLOR_WRITEMASK={name:"COLOR_WRITEMASK",value:3107,description:" "},p.UNPACK_ALIGNMENT={name:"UNPACK_ALIGNMENT",value:3317,description:" "},p.PACK_ALIGNMENT={name:"PACK_ALIGNMENT",value:3333,description:" "},p.MAX_TEXTURE_SIZE={name:"MAX_TEXTURE_SIZE",value:3379,description:" "},p.MAX_VIEWPORT_DIMS={name:"MAX_VIEWPORT_DIMS",value:3386,description:" "},p.SUBPIXEL_BITS={name:"SUBPIXEL_BITS",value:3408,description:" "},p.RED_BITS={name:"RED_BITS",value:3410,description:" "},p.GREEN_BITS={name:"GREEN_BITS",value:3411,description:" "},p.BLUE_BITS={name:"BLUE_BITS",value:3412,description:" "},p.ALPHA_BITS={name:"ALPHA_BITS",value:3413,description:" "},p.DEPTH_BITS={name:"DEPTH_BITS",value:3414,description:" "},p.STENCIL_BITS={name:"STENCIL_BITS",value:3415,description:" "},p.POLYGON_OFFSET_UNITS={name:"POLYGON_OFFSET_UNITS",value:10752,description:" "},p.POLYGON_OFFSET_FACTOR={name:"POLYGON_OFFSET_FACTOR",value:32824,description:" "},p.TEXTURE_BINDING_2D={name:"TEXTURE_BINDING_2D",value:32873,description:" "},p.SAMPLE_BUFFERS={name:"SAMPLE_BUFFERS",value:32936,description:" "},p.SAMPLES={name:"SAMPLES",value:32937,description:" "},p.SAMPLE_COVERAGE_VALUE={name:"SAMPLE_COVERAGE_VALUE",value:32938,description:" "},p.SAMPLE_COVERAGE_INVERT={name:"SAMPLE_COVERAGE_INVERT",value:32939,description:" "},p.COMPRESSED_TEXTURE_FORMATS={name:"COMPRESSED_TEXTURE_FORMATS",value:34467,description:" "},p.VENDOR={name:"VENDOR",value:7936,description:" "},p.RENDERER={name:"RENDERER",value:7937,description:" "},p.VERSION={name:"VERSION",value:7938,description:" "},p.IMPLEMENTATION_COLOR_READ_TYPE={name:"IMPLEMENTATION_COLOR_READ_TYPE",value:35738,description:" "},p.IMPLEMENTATION_COLOR_READ_FORMAT={name:"IMPLEMENTATION_COLOR_READ_FORMAT",value:35739,description:" "},p.BROWSER_DEFAULT_WEBGL={name:"BROWSER_DEFAULT_WEBGL",value:37444,description:" "},p.STATIC_DRAW={name:"STATIC_DRAW",value:35044,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and not change often."},p.STREAM_DRAW={name:"STREAM_DRAW",value:35040,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to not be used often."},p.DYNAMIC_DRAW={name:"DYNAMIC_DRAW",value:35048,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and change often."},p.ARRAY_BUFFER={name:"ARRAY_BUFFER",value:34962,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.ELEMENT_ARRAY_BUFFER={name:"ELEMENT_ARRAY_BUFFER",value:34963,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.BUFFER_SIZE={name:"BUFFER_SIZE",value:34660,description:"Passed to getBufferParameter to get a buffer's size."},p.BUFFER_USAGE={name:"BUFFER_USAGE",value:34661,description:"Passed to getBufferParameter to get the hint for the buffer passed in when it was created."},p.CURRENT_VERTEX_ATTRIB={name:"CURRENT_VERTEX_ATTRIB",value:34342,description:"Passed to getVertexAttrib to read back the current vertex attribute."},p.VERTEX_ATTRIB_ARRAY_ENABLED={name:"VERTEX_ATTRIB_ARRAY_ENABLED",value:34338,description:" "},p.VERTEX_ATTRIB_ARRAY_SIZE={name:"VERTEX_ATTRIB_ARRAY_SIZE",value:34339,description:" "},p.VERTEX_ATTRIB_ARRAY_STRIDE={name:"VERTEX_ATTRIB_ARRAY_STRIDE",value:34340,description:" "},p.VERTEX_ATTRIB_ARRAY_TYPE={name:"VERTEX_ATTRIB_ARRAY_TYPE",value:34341,description:" "},p.VERTEX_ATTRIB_ARRAY_NORMALIZED={name:"VERTEX_ATTRIB_ARRAY_NORMALIZED",value:34922,description:" "},p.VERTEX_ATTRIB_ARRAY_POINTER={name:"VERTEX_ATTRIB_ARRAY_POINTER",value:34373,description:" "},p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING={name:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",value:34975,description:" "},p.CULL_FACE={name:"CULL_FACE",value:2884,description:"Passed to enable/disable to turn on/off culling. Can also be used with getParameter to find the current culling method."},p.FRONT={name:"FRONT",value:1028,description:"Passed to cullFace to specify that only front faces should be drawn."},p.BACK={name:"BACK",value:1029,description:"Passed to cullFace to specify that only back faces should be drawn."},p.FRONT_AND_BACK={name:"FRONT_AND_BACK",value:1032,description:"Passed to cullFace to specify that front and back faces should be drawn."},p.BLEND={name:"BLEND",value:3042,description:"Passed to enable/disable to turn on/off blending. Can also be used with getParameter to find the current blending method."},p.DEPTH_TEST={name:"DEPTH_TEST",value:2929,description:"Passed to enable/disable to turn on/off the depth test. Can also be used with getParameter to query the depth test."},p.DITHER={name:"DITHER",value:3024,description:"Passed to enable/disable to turn on/off dithering. Can also be used with getParameter to find the current dithering method."},p.POLYGON_OFFSET_FILL={name:"POLYGON_OFFSET_FILL",value:32823,description:"Passed to enable/disable to turn on/off the polygon offset. Useful for rendering hidden-line images, decals, and or solids with highlighted edges. Can also be used with getParameter to query the scissor test."},p.SAMPLE_ALPHA_TO_COVERAGE={name:"SAMPLE_ALPHA_TO_COVERAGE",value:32926,description:"Passed to enable/disable to turn on/off the alpha to coverage. Used in multi-sampling alpha channels."},p.SAMPLE_COVERAGE={name:"SAMPLE_COVERAGE",value:32928,description:"Passed to enable/disable to turn on/off the sample coverage. Used in multi-sampling."},p.SCISSOR_TEST={name:"SCISSOR_TEST",value:3089,description:"Passed to enable/disable to turn on/off the scissor test. Can also be used with getParameter to query the scissor test."},p.STENCIL_TEST={name:"STENCIL_TEST",value:2960,description:"Passed to enable/disable to turn on/off the stencil test. Can also be used with getParameter to query the stencil test."},p.NO_ERROR={name:"NO_ERROR",value:0,description:"Returned from getError."},p.INVALID_ENUM={name:"INVALID_ENUM",value:1280,description:"Returned from getError."},p.INVALID_VALUE={name:"INVALID_VALUE",value:1281,description:"Returned from getError."},p.INVALID_OPERATION={name:"INVALID_OPERATION",value:1282,description:"Returned from getError."},p.OUT_OF_MEMORY={name:"OUT_OF_MEMORY",value:1285,description:"Returned from getError."},p.CONTEXT_LOST_WEBGL={name:"CONTEXT_LOST_WEBGL",value:37442,description:"Returned from getError."},p.CW={name:"CW",value:2304,description:"Passed to frontFace to specify the front face of a polygon is drawn in the clockwise direction"},p.CCW={name:"CCW",value:2305,description:"Passed to frontFace to specify the front face of a polygon is drawn in the counter clockwise direction"},p.DONT_CARE={name:"DONT_CARE",value:4352,description:"There is no preference for this behavior."},p.FASTEST={name:"FASTEST",value:4353,description:"The most efficient behavior should be used."},p.NICEST={name:"NICEST",value:4354,description:"The most correct or the highest quality option should be used."},p.GENERATE_MIPMAP_HINT={name:"GENERATE_MIPMAP_HINT",value:33170,description:"Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap()."},p.BYTE={name:"BYTE",value:5120,description:" "},p.UNSIGNED_BYTE={name:"UNSIGNED_BYTE",value:5121,description:" "},p.SHORT={name:"SHORT",value:5122,description:" "},p.UNSIGNED_SHORT={name:"UNSIGNED_SHORT",value:5123,description:" "},p.INT={name:"INT",value:5124,description:" "},p.UNSIGNED_INT={name:"UNSIGNED_INT",value:5125,description:" "},p.FLOAT={name:"FLOAT",value:5126,description:" "},p.DEPTH_COMPONENT={name:"DEPTH_COMPONENT",value:6402,description:" "},p.ALPHA={name:"ALPHA",value:6406,description:" "},p.RGB={name:"RGB",value:6407,description:" "},p.RGBA={name:"RGBA",value:6408,description:" "},p.LUMINANCE={name:"LUMINANCE",value:6409,description:" "},p.LUMINANCE_ALPHA={name:"LUMINANCE_ALPHA",value:6410,description:" "},p.UNSIGNED_SHORT_4_4_4_4={name:"UNSIGNED_SHORT_4_4_4_4",value:32819,description:" "},p.UNSIGNED_SHORT_5_5_5_1={name:"UNSIGNED_SHORT_5_5_5_1",value:32820,description:" "},p.UNSIGNED_SHORT_5_6_5={name:"UNSIGNED_SHORT_5_6_5",value:33635,description:" "},p.FRAGMENT_SHADER={name:"FRAGMENT_SHADER",value:35632,description:"Passed to createShader to define a fragment shader."},p.VERTEX_SHADER={name:"VERTEX_SHADER",value:35633,description:"Passed to createShader to define a vertex shader"},p.COMPILE_STATUS={name:"COMPILE_STATUS",value:35713,description:"Passed to getShaderParamter to get the status of the compilation. Returns false if the shader was not compiled. You can then query getShaderInfoLog to find the exact error"},p.DELETE_STATUS={name:"DELETE_STATUS",value:35712,description:"Passed to getShaderParamter to determine if a shader was deleted via deleteShader. Returns true if it was, false otherwise."},p.LINK_STATUS={name:"LINK_STATUS",value:35714,description:"Passed to getProgramParameter after calling linkProgram to determine if a program was linked correctly. Returns false if there were errors. Use getProgramInfoLog to find the exact error."},p.VALIDATE_STATUS={name:"VALIDATE_STATUS",value:35715,description:"Passed to getProgramParameter after calling validateProgram to determine if it is valid. Returns false if errors were found."},p.ATTACHED_SHADERS={name:"ATTACHED_SHADERS",value:35717,description:"Passed to getProgramParameter after calling attachShader to determine if the shader was attached correctly. Returns false if errors occurred."},p.COMPLETION_STATUS_KHR={name:"COMPLETION_STATUS_KHR",value:37297,description:"Passed to getProgramParameter (KHR_parallel_shader_compile) to query whether an asynchronous shader/program link has completed. Returns true once the program is ready to use without blocking."},p.ACTIVE_ATTRIBUTES={name:"ACTIVE_ATTRIBUTES",value:35721,description:"Passed to getProgramParameter to get the number of attributes active in a program."},p.ACTIVE_UNIFORMS={name:"ACTIVE_UNIFORMS",value:35718,description:"Passed to getProgramParamter to get the number of uniforms active in a program."},p.MAX_VERTEX_ATTRIBS={name:"MAX_VERTEX_ATTRIBS",value:34921,description:" "},p.MAX_VERTEX_UNIFORM_VECTORS={name:"MAX_VERTEX_UNIFORM_VECTORS",value:36347,description:" "},p.MAX_VARYING_VECTORS={name:"MAX_VARYING_VECTORS",value:36348,description:" "},p.MAX_COMBINED_TEXTURE_IMAGE_UNITS={name:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",value:35661,description:" "},p.MAX_VERTEX_TEXTURE_IMAGE_UNITS={name:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",value:35660,description:" "},p.MAX_TEXTURE_IMAGE_UNITS={name:"MAX_TEXTURE_IMAGE_UNITS",value:34930,description:"Implementation dependent number of maximum texture units. At least 8."},p.MAX_FRAGMENT_UNIFORM_VECTORS={name:"MAX_FRAGMENT_UNIFORM_VECTORS",value:36349,description:" "},p.SHADER_TYPE={name:"SHADER_TYPE",value:35663,description:" "},p.SHADING_LANGUAGE_VERSION={name:"SHADING_LANGUAGE_VERSION",value:35724,description:" "},p.CURRENT_PROGRAM={name:"CURRENT_PROGRAM",value:35725,description:" "},p.NEVER={name:"NEVER",value:512,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn."},p.ALWAYS={name:"ALWAYS",value:519,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn."},p.LESS={name:"LESS",value:513,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value."},p.EQUAL={name:"EQUAL",value:514,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value."},p.LEQUAL={name:"LEQUAL",value:515,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value."},p.GREATER={name:"GREATER",value:516,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value."},p.GEQUAL={name:"GEQUAL",value:518,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value."},p.NOTEQUAL={name:"NOTEQUAL",value:517,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value."},p.KEEP={name:"KEEP",value:7680,description:" "},p.REPLACE={name:"REPLACE",value:7681,description:" "},p.INCR={name:"INCR",value:7682,description:" "},p.DECR={name:"DECR",value:7683,description:" "},p.INVERT={name:"INVERT",value:5386,description:" "},p.INCR_WRAP={name:"INCR_WRAP",value:34055,description:" "},p.DECR_WRAP={name:"DECR_WRAP",value:34056,description:" "},p.NEAREST={name:"NEAREST",value:9728,description:" "},p.LINEAR={name:"LINEAR",value:9729,description:" "},p.NEAREST_MIPMAP_NEAREST={name:"NEAREST_MIPMAP_NEAREST",value:9984,description:" "},p.LINEAR_MIPMAP_NEAREST={name:"LINEAR_MIPMAP_NEAREST",value:9985,description:" "},p.NEAREST_MIPMAP_LINEAR={name:"NEAREST_MIPMAP_LINEAR",value:9986,description:" "},p.LINEAR_MIPMAP_LINEAR={name:"LINEAR_MIPMAP_LINEAR",value:9987,description:" "},p.TEXTURE_MAG_FILTER={name:"TEXTURE_MAG_FILTER",value:10240,description:" "},p.TEXTURE_MIN_FILTER={name:"TEXTURE_MIN_FILTER",value:10241,description:" "},p.TEXTURE_WRAP_S={name:"TEXTURE_WRAP_S",value:10242,description:" "},p.TEXTURE_WRAP_T={name:"TEXTURE_WRAP_T",value:10243,description:" "},p.TEXTURE_2D={name:"TEXTURE_2D",value:3553,description:" "},p.TEXTURE={name:"TEXTURE",value:5890,description:" "},p.TEXTURE_CUBE_MAP={name:"TEXTURE_CUBE_MAP",value:34067,description:" "},p.TEXTURE_BINDING_CUBE_MAP={name:"TEXTURE_BINDING_CUBE_MAP",value:34068,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_X={name:"TEXTURE_CUBE_MAP_POSITIVE_X",value:34069,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_X={name:"TEXTURE_CUBE_MAP_NEGATIVE_X",value:34070,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Y={name:"TEXTURE_CUBE_MAP_POSITIVE_Y",value:34071,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Y={name:"TEXTURE_CUBE_MAP_NEGATIVE_Y",value:34072,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Z={name:"TEXTURE_CUBE_MAP_POSITIVE_Z",value:34073,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Z={name:"TEXTURE_CUBE_MAP_NEGATIVE_Z",value:34074,description:" "},p.MAX_CUBE_MAP_TEXTURE_SIZE={name:"MAX_CUBE_MAP_TEXTURE_SIZE",value:34076,description:" "},p.TEXTURE0={name:"TEXTURE0",value:33984,description:"A texture unit."},p.TEXTURE1={name:"TEXTURE1",value:33985,description:"A texture unit."},p.TEXTURE2={name:"TEXTURE2",value:33986,description:"A texture unit."},p.TEXTURE3={name:"TEXTURE3",value:33987,description:"A texture unit."},p.TEXTURE4={name:"TEXTURE4",value:33988,description:"A texture unit."},p.TEXTURE5={name:"TEXTURE5",value:33989,description:"A texture unit."},p.TEXTURE6={name:"TEXTURE6",value:33990,description:"A texture unit."},p.TEXTURE7={name:"TEXTURE7",value:33991,description:"A texture unit."},p.TEXTURE8={name:"TEXTURE8",value:33992,description:"A texture unit."},p.TEXTURE9={name:"TEXTURE9",value:33993,description:"A texture unit."},p.TEXTURE10={name:"TEXTURE10",value:33994,description:"A texture unit."},p.TEXTURE11={name:"TEXTURE11",value:33995,description:"A texture unit."},p.TEXTURE12={name:"TEXTURE12",value:33996,description:"A texture unit."},p.TEXTURE13={name:"TEXTURE13",value:33997,description:"A texture unit."},p.TEXTURE14={name:"TEXTURE14",value:33998,description:"A texture unit."},p.TEXTURE15={name:"TEXTURE15",value:33999,description:"A texture unit."},p.TEXTURE16={name:"TEXTURE16",value:34e3,description:"A texture unit."},p.TEXTURE17={name:"TEXTURE17",value:34001,description:"A texture unit."},p.TEXTURE18={name:"TEXTURE18",value:34002,description:"A texture unit."},p.TEXTURE19={name:"TEXTURE19",value:34003,description:"A texture unit."},p.TEXTURE20={name:"TEXTURE20",value:34004,description:"A texture unit."},p.TEXTURE21={name:"TEXTURE21",value:34005,description:"A texture unit."},p.TEXTURE22={name:"TEXTURE22",value:34006,description:"A texture unit."},p.TEXTURE23={name:"TEXTURE23",value:34007,description:"A texture unit."},p.TEXTURE24={name:"TEXTURE24",value:34008,description:"A texture unit."},p.TEXTURE25={name:"TEXTURE25",value:34009,description:"A texture unit."},p.TEXTURE26={name:"TEXTURE26",value:34010,description:"A texture unit."},p.TEXTURE27={name:"TEXTURE27",value:34011,description:"A texture unit."},p.TEXTURE28={name:"TEXTURE28",value:34012,description:"A texture unit."},p.TEXTURE29={name:"TEXTURE29",value:34013,description:"A texture unit."},p.TEXTURE30={name:"TEXTURE30",value:34014,description:"A texture unit."},p.TEXTURE31={name:"TEXTURE31",value:34015,description:"A texture unit."},p.ACTIVE_TEXTURE={name:"ACTIVE_TEXTURE",value:34016,description:"The current active texture unit."},p.REPEAT={name:"REPEAT",value:10497,description:" "},p.CLAMP_TO_EDGE={name:"CLAMP_TO_EDGE",value:33071,description:" "},p.MIRRORED_REPEAT={name:"MIRRORED_REPEAT",value:33648,description:" "},p.FLOAT_VEC2={name:"FLOAT_VEC2",value:35664,description:" "},p.FLOAT_VEC3={name:"FLOAT_VEC3",value:35665,description:" "},p.FLOAT_VEC4={name:"FLOAT_VEC4",value:35666,description:" "},p.INT_VEC2={name:"INT_VEC2",value:35667,description:" "},p.INT_VEC3={name:"INT_VEC3",value:35668,description:" "},p.INT_VEC4={name:"INT_VEC4",value:35669,description:" "},p.BOOL={name:"BOOL",value:35670,description:" "},p.BOOL_VEC2={name:"BOOL_VEC2",value:35671,description:" "},p.BOOL_VEC3={name:"BOOL_VEC3",value:35672,description:" "},p.BOOL_VEC4={name:"BOOL_VEC4",value:35673,description:" "},p.FLOAT_MAT2={name:"FLOAT_MAT2",value:35674,description:" "},p.FLOAT_MAT3={name:"FLOAT_MAT3",value:35675,description:" "},p.FLOAT_MAT4={name:"FLOAT_MAT4",value:35676,description:" "},p.SAMPLER_2D={name:"SAMPLER_2D",value:35678,description:" "},p.SAMPLER_CUBE={name:"SAMPLER_CUBE",value:35680,description:" "},p.LOW_FLOAT={name:"LOW_FLOAT",value:36336,description:" "},p.MEDIUM_FLOAT={name:"MEDIUM_FLOAT",value:36337,description:" "},p.HIGH_FLOAT={name:"HIGH_FLOAT",value:36338,description:" "},p.LOW_INT={name:"LOW_INT",value:36339,description:" "},p.MEDIUM_INT={name:"MEDIUM_INT",value:36340,description:" "},p.HIGH_INT={name:"HIGH_INT",value:36341,description:" "},p.FRAMEBUFFER={name:"FRAMEBUFFER",value:36160,description:" "},p.RENDERBUFFER={name:"RENDERBUFFER",value:36161,description:" "},p.RGBA4={name:"RGBA4",value:32854,description:" "},p.RGB5_A1={name:"RGB5_A1",value:32855,description:" "},p.RGB565={name:"RGB565",value:36194,description:" "},p.DEPTH_COMPONENT16={name:"DEPTH_COMPONENT16",value:33189,description:" "},p.STENCIL_INDEX={name:"STENCIL_INDEX",value:6401,description:" "},p.STENCIL_INDEX8={name:"STENCIL_INDEX8",value:36168,description:" "},p.DEPTH_STENCIL={name:"DEPTH_STENCIL",value:34041,description:" "},p.RENDERBUFFER_WIDTH={name:"RENDERBUFFER_WIDTH",value:36162,description:" "},p.RENDERBUFFER_HEIGHT={name:"RENDERBUFFER_HEIGHT",value:36163,description:" "},p.RENDERBUFFER_INTERNAL_FORMAT={name:"RENDERBUFFER_INTERNAL_FORMAT",value:36164,description:" "},p.RENDERBUFFER_RED_SIZE={name:"RENDERBUFFER_RED_SIZE",value:36176,description:" "},p.RENDERBUFFER_GREEN_SIZE={name:"RENDERBUFFER_GREEN_SIZE",value:36177,description:" "},p.RENDERBUFFER_BLUE_SIZE={name:"RENDERBUFFER_BLUE_SIZE",value:36178,description:" "},p.RENDERBUFFER_ALPHA_SIZE={name:"RENDERBUFFER_ALPHA_SIZE",value:36179,description:" "},p.RENDERBUFFER_DEPTH_SIZE={name:"RENDERBUFFER_DEPTH_SIZE",value:36180,description:" "},p.RENDERBUFFER_STENCIL_SIZE={name:"RENDERBUFFER_STENCIL_SIZE",value:36181,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",value:36048,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",value:36049,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",value:36050,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",value:36051,description:" "},p.COLOR_ATTACHMENT0={name:"COLOR_ATTACHMENT0",value:36064,description:" "},p.DEPTH_ATTACHMENT={name:"DEPTH_ATTACHMENT",value:36096,description:" "},p.STENCIL_ATTACHMENT={name:"STENCIL_ATTACHMENT",value:36128,description:" "},p.DEPTH_STENCIL_ATTACHMENT={name:"DEPTH_STENCIL_ATTACHMENT",value:33306,description:" "},p.NONE={name:"NONE",value:0,description:" "},p.FRAMEBUFFER_COMPLETE={name:"FRAMEBUFFER_COMPLETE",value:36053,description:" "},p.FRAMEBUFFER_INCOMPLETE_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",value:36054,description:" "},p.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",value:36055,description:" "},p.FRAMEBUFFER_INCOMPLETE_DIMENSIONS={name:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",value:36057,description:" "},p.FRAMEBUFFER_UNSUPPORTED={name:"FRAMEBUFFER_UNSUPPORTED",value:36061,description:" "},p.FRAMEBUFFER_BINDING={name:"FRAMEBUFFER_BINDING",value:36006,description:" "},p.RENDERBUFFER_BINDING={name:"RENDERBUFFER_BINDING",value:36007,description:" "},p.MAX_RENDERBUFFER_SIZE={name:"MAX_RENDERBUFFER_SIZE",value:34024,description:" "},p.INVALID_FRAMEBUFFER_OPERATION={name:"INVALID_FRAMEBUFFER_OPERATION",value:1286,description:" "},p.UNPACK_FLIP_Y_WEBGL={name:"UNPACK_FLIP_Y_WEBGL",value:37440,description:" "},p.UNPACK_PREMULTIPLY_ALPHA_WEBGL={name:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",value:37441,description:" "},p.UNPACK_COLORSPACE_CONVERSION_WEBGL={name:"UNPACK_COLORSPACE_CONVERSION_WEBGL",value:37443,description:" "},p.READ_BUFFER={name:"READ_BUFFER",value:3074,description:" "},p.UNPACK_ROW_LENGTH={name:"UNPACK_ROW_LENGTH",value:3314,description:" "},p.UNPACK_SKIP_ROWS={name:"UNPACK_SKIP_ROWS",value:3315,description:" "},p.UNPACK_SKIP_PIXELS={name:"UNPACK_SKIP_PIXELS",value:3316,description:" "},p.PACK_ROW_LENGTH={name:"PACK_ROW_LENGTH",value:3330,description:" "},p.PACK_SKIP_ROWS={name:"PACK_SKIP_ROWS",value:3331,description:" "},p.PACK_SKIP_PIXELS={name:"PACK_SKIP_PIXELS",value:3332,description:" "},p.TEXTURE_BINDING_3D={name:"TEXTURE_BINDING_3D",value:32874,description:" "},p.UNPACK_SKIP_IMAGES={name:"UNPACK_SKIP_IMAGES",value:32877,description:" "},p.UNPACK_IMAGE_HEIGHT={name:"UNPACK_IMAGE_HEIGHT",value:32878,description:" "},p.MAX_3D_TEXTURE_SIZE={name:"MAX_3D_TEXTURE_SIZE",value:32883,description:" "},p.MAX_ELEMENTS_VERTICES={name:"MAX_ELEMENTS_VERTICES",value:33e3,description:" "},p.MAX_ELEMENTS_INDICES={name:"MAX_ELEMENTS_INDICES",value:33001,description:" "},p.MAX_TEXTURE_LOD_BIAS={name:"MAX_TEXTURE_LOD_BIAS",value:34045,description:" "},p.MAX_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_FRAGMENT_UNIFORM_COMPONENTS",value:35657,description:" "},p.MAX_VERTEX_UNIFORM_COMPONENTS={name:"MAX_VERTEX_UNIFORM_COMPONENTS",value:35658,description:" "},p.MAX_ARRAY_TEXTURE_LAYERS={name:"MAX_ARRAY_TEXTURE_LAYERS",value:35071,description:" "},p.MIN_PROGRAM_TEXEL_OFFSET={name:"MIN_PROGRAM_TEXEL_OFFSET",value:35076,description:" "},p.MAX_PROGRAM_TEXEL_OFFSET={name:"MAX_PROGRAM_TEXEL_OFFSET",value:35077,description:" "},p.MAX_VARYING_COMPONENTS={name:"MAX_VARYING_COMPONENTS",value:35659,description:" "},p.FRAGMENT_SHADER_DERIVATIVE_HINT={name:"FRAGMENT_SHADER_DERIVATIVE_HINT",value:35723,description:" "},p.RASTERIZER_DISCARD={name:"RASTERIZER_DISCARD",value:35977,description:" "},p.VERTEX_ARRAY_BINDING={name:"VERTEX_ARRAY_BINDING",value:34229,description:" "},p.MAX_VERTEX_OUTPUT_COMPONENTS={name:"MAX_VERTEX_OUTPUT_COMPONENTS",value:37154,description:" "},p.MAX_FRAGMENT_INPUT_COMPONENTS={name:"MAX_FRAGMENT_INPUT_COMPONENTS",value:37157,description:" "},p.MAX_SERVER_WAIT_TIMEOUT={name:"MAX_SERVER_WAIT_TIMEOUT",value:37137,description:" "},p.MAX_ELEMENT_INDEX={name:"MAX_ELEMENT_INDEX",value:36203,description:" "},p.RED={name:"RED",value:6403,description:" "},p.RGB8={name:"RGB8",value:32849,description:" "},p.RGBA8={name:"RGBA8",value:32856,description:" "},p.RGB10_A2={name:"RGB10_A2",value:32857,description:" "},p.TEXTURE_3D={name:"TEXTURE_3D",value:32879,description:" "},p.TEXTURE_WRAP_R={name:"TEXTURE_WRAP_R",value:32882,description:" "},p.TEXTURE_MIN_LOD={name:"TEXTURE_MIN_LOD",value:33082,description:" "},p.TEXTURE_MAX_LOD={name:"TEXTURE_MAX_LOD",value:33083,description:" "},p.TEXTURE_BASE_LEVEL={name:"TEXTURE_BASE_LEVEL",value:33084,description:" "},p.TEXTURE_MAX_LEVEL={name:"TEXTURE_MAX_LEVEL",value:33085,description:" "},p.TEXTURE_COMPARE_MODE={name:"TEXTURE_COMPARE_MODE",value:34892,description:" "},p.TEXTURE_COMPARE_FUNC={name:"TEXTURE_COMPARE_FUNC",value:34893,description:" "},p.SRGB={name:"SRGB",value:35904,description:" "},p.SRGB8={name:"SRGB8",value:35905,description:" "},p.SRGB8_ALPHA8={name:"SRGB8_ALPHA8",value:35907,description:" "},p.COMPARE_REF_TO_TEXTURE={name:"COMPARE_REF_TO_TEXTURE",value:34894,description:" "},p.RGBA32F={name:"RGBA32F",value:34836,description:" "},p.RGB32F={name:"RGB32F",value:34837,description:" "},p.RGBA16F={name:"RGBA16F",value:34842,description:" "},p.RGB16F={name:"RGB16F",value:34843,description:" "},p.TEXTURE_2D_ARRAY={name:"TEXTURE_2D_ARRAY",value:35866,description:" "},p.TEXTURE_BINDING_2D_ARRAY={name:"TEXTURE_BINDING_2D_ARRAY",value:35869,description:" "},p.R11F_G11F_B10F={name:"R11F_G11F_B10F",value:35898,description:" "},p.RGB9_E5={name:"RGB9_E5",value:35901,description:" "},p.RGBA32UI={name:"RGBA32UI",value:36208,description:" "},p.RGB32UI={name:"RGB32UI",value:36209,description:" "},p.RGBA16UI={name:"RGBA16UI",value:36214,description:" "},p.RGB16UI={name:"RGB16UI",value:36215,description:" "},p.RGBA8UI={name:"RGBA8UI",value:36220,description:" "},p.RGB8UI={name:"RGB8UI",value:36221,description:" "},p.RGBA32I={name:"RGBA32I",value:36226,description:" "},p.RGB32I={name:"RGB32I",value:36227,description:" "},p.RGBA16I={name:"RGBA16I",value:36232,description:" "},p.RGB16I={name:"RGB16I",value:36233,description:" "},p.RGBA8I={name:"RGBA8I",value:36238,description:" "},p.RGB8I={name:"RGB8I",value:36239,description:" "},p.RED_INTEGER={name:"RED_INTEGER",value:36244,description:" "},p.RGB_INTEGER={name:"RGB_INTEGER",value:36248,description:" "},p.RGBA_INTEGER={name:"RGBA_INTEGER",value:36249,description:" "},p.R8={name:"R8",value:33321,description:" "},p.RG8={name:"RG8",value:33323,description:" "},p.R16F={name:"R16F",value:33325,description:" "},p.R32F={name:"R32F",value:33326,description:" "},p.RG16F={name:"RG16F",value:33327,description:" "},p.RG32F={name:"RG32F",value:33328,description:" "},p.R8I={name:"R8I",value:33329,description:" "},p.R8UI={name:"R8UI",value:33330,description:" "},p.R16I={name:"R16I",value:33331,description:" "},p.R16UI={name:"R16UI",value:33332,description:" "},p.R32I={name:"R32I",value:33333,description:" "},p.R32UI={name:"R32UI",value:33334,description:" "},p.RG8I={name:"RG8I",value:33335,description:" "},p.RG8UI={name:"RG8UI",value:33336,description:" "},p.RG16I={name:"RG16I",value:33337,description:" "},p.RG16UI={name:"RG16UI",value:33338,description:" "},p.RG32I={name:"RG32I",value:33339,description:" "},p.RG32UI={name:"RG32UI",value:33340,description:" "},p.R8_SNORM={name:"R8_SNORM",value:36756,description:" "},p.RG8_SNORM={name:"RG8_SNORM",value:36757,description:" "},p.RGB8_SNORM={name:"RGB8_SNORM",value:36758,description:" "},p.RGBA8_SNORM={name:"RGBA8_SNORM",value:36759,description:" "},p.RGB10_A2UI={name:"RGB10_A2UI",value:36975,description:" "},p.TEXTURE_IMMUTABLE_FORMAT={name:"TEXTURE_IMMUTABLE_FORMAT",value:37167,description:" "},p.TEXTURE_IMMUTABLE_LEVELS={name:"TEXTURE_IMMUTABLE_LEVELS",value:33503,description:" "},p.UNSIGNED_INT_2_10_10_10_REV={name:"UNSIGNED_INT_2_10_10_10_REV",value:33640,description:" "},p.UNSIGNED_INT_10F_11F_11F_REV={name:"UNSIGNED_INT_10F_11F_11F_REV",value:35899,description:" "},p.UNSIGNED_INT_5_9_9_9_REV={name:"UNSIGNED_INT_5_9_9_9_REV",value:35902,description:" "},p.FLOAT_32_UNSIGNED_INT_24_8_REV={name:"FLOAT_32_UNSIGNED_INT_24_8_REV",value:36269,description:" "},p.UNSIGNED_INT_24_8={name:"UNSIGNED_INT_24_8",value:34042,description:" "},p.HALF_FLOAT={name:"HALF_FLOAT",value:5131,description:" "},p.RG={name:"RG",value:33319,description:" "},p.RG_INTEGER={name:"RG_INTEGER",value:33320,description:" "},p.INT_2_10_10_10_REV={name:"INT_2_10_10_10_REV",value:36255,description:" "},p.CURRENT_QUERY={name:"CURRENT_QUERY",value:34917,description:" "},p.QUERY_RESULT={name:"QUERY_RESULT",value:34918,description:" "},p.QUERY_RESULT_AVAILABLE={name:"QUERY_RESULT_AVAILABLE",value:34919,description:" "},p.ANY_SAMPLES_PASSED={name:"ANY_SAMPLES_PASSED",value:35887,description:" "},p.ANY_SAMPLES_PASSED_CONSERVATIVE={name:"ANY_SAMPLES_PASSED_CONSERVATIVE",value:36202,description:" "},p.MAX_DRAW_BUFFERS={name:"MAX_DRAW_BUFFERS",value:34852,description:" "},p.DRAW_BUFFER0={name:"DRAW_BUFFER0",value:34853,description:" "},p.DRAW_BUFFER1={name:"DRAW_BUFFER1",value:34854,description:" "},p.DRAW_BUFFER2={name:"DRAW_BUFFER2",value:34855,description:" "},p.DRAW_BUFFER3={name:"DRAW_BUFFER3",value:34856,description:" "},p.DRAW_BUFFER4={name:"DRAW_BUFFER4",value:34857,description:" "},p.DRAW_BUFFER5={name:"DRAW_BUFFER5",value:34858,description:" "},p.DRAW_BUFFER6={name:"DRAW_BUFFER6",value:34859,description:" "},p.DRAW_BUFFER7={name:"DRAW_BUFFER7",value:34860,description:" "},p.DRAW_BUFFER8={name:"DRAW_BUFFER8",value:34861,description:" "},p.DRAW_BUFFER9={name:"DRAW_BUFFER9",value:34862,description:" "},p.DRAW_BUFFER10={name:"DRAW_BUFFER10",value:34863,description:" "},p.DRAW_BUFFER11={name:"DRAW_BUFFER11",value:34864,description:" "},p.DRAW_BUFFER12={name:"DRAW_BUFFER12",value:34865,description:" "},p.DRAW_BUFFER13={name:"DRAW_BUFFER13",value:34866,description:" "},p.DRAW_BUFFER14={name:"DRAW_BUFFER14",value:34867,description:" "},p.DRAW_BUFFER15={name:"DRAW_BUFFER15",value:34868,description:" "},p.MAX_COLOR_ATTACHMENTS={name:"MAX_COLOR_ATTACHMENTS",value:36063,description:" "},p.COLOR_ATTACHMENT1={name:"COLOR_ATTACHMENT1",value:36065,description:" "},p.COLOR_ATTACHMENT2={name:"COLOR_ATTACHMENT2",value:36066,description:" "},p.COLOR_ATTACHMENT3={name:"COLOR_ATTACHMENT3",value:36067,description:" "},p.COLOR_ATTACHMENT4={name:"COLOR_ATTACHMENT4",value:36068,description:" "},p.COLOR_ATTACHMENT5={name:"COLOR_ATTACHMENT5",value:36069,description:" "},p.COLOR_ATTACHMENT6={name:"COLOR_ATTACHMENT6",value:36070,description:" "},p.COLOR_ATTACHMENT7={name:"COLOR_ATTACHMENT7",value:36071,description:" "},p.COLOR_ATTACHMENT8={name:"COLOR_ATTACHMENT8",value:36072,description:" "},p.COLOR_ATTACHMENT9={name:"COLOR_ATTACHMENT9",value:36073,description:" "},p.COLOR_ATTACHMENT10={name:"COLOR_ATTACHMENT10",value:36074,description:" "},p.COLOR_ATTACHMENT11={name:"COLOR_ATTACHMENT11",value:36075,description:" "},p.COLOR_ATTACHMENT12={name:"COLOR_ATTACHMENT12",value:36076,description:" "},p.COLOR_ATTACHMENT13={name:"COLOR_ATTACHMENT13",value:36077,description:" "},p.COLOR_ATTACHMENT14={name:"COLOR_ATTACHMENT14",value:36078,description:" "},p.COLOR_ATTACHMENT15={name:"COLOR_ATTACHMENT15",value:36079,description:" "},p.SAMPLER_3D={name:"SAMPLER_3D",value:35679,description:" "},p.SAMPLER_2D_SHADOW={name:"SAMPLER_2D_SHADOW",value:35682,description:" "},p.SAMPLER_2D_ARRAY={name:"SAMPLER_2D_ARRAY",value:36289,description:" "},p.SAMPLER_2D_ARRAY_SHADOW={name:"SAMPLER_2D_ARRAY_SHADOW",value:36292,description:" "},p.SAMPLER_CUBE_SHADOW={name:"SAMPLER_CUBE_SHADOW",value:36293,description:" "},p.INT_SAMPLER_2D={name:"INT_SAMPLER_2D",value:36298,description:" "},p.INT_SAMPLER_3D={name:"INT_SAMPLER_3D",value:36299,description:" "},p.INT_SAMPLER_CUBE={name:"INT_SAMPLER_CUBE",value:36300,description:" "},p.INT_SAMPLER_2D_ARRAY={name:"INT_SAMPLER_2D_ARRAY",value:36303,description:" "},p.UNSIGNED_INT_SAMPLER_2D={name:"UNSIGNED_INT_SAMPLER_2D",value:36306,description:" "},p.UNSIGNED_INT_SAMPLER_3D={name:"UNSIGNED_INT_SAMPLER_3D",value:36307,description:" "},p.UNSIGNED_INT_SAMPLER_CUBE={name:"UNSIGNED_INT_SAMPLER_CUBE",value:36308,description:" "},p.UNSIGNED_INT_SAMPLER_2D_ARRAY={name:"UNSIGNED_INT_SAMPLER_2D_ARRAY",value:36311,description:" "},p.MAX_SAMPLES={name:"MAX_SAMPLES",value:36183,description:" "},p.SAMPLER_BINDING={name:"SAMPLER_BINDING",value:35097,description:" "},p.PIXEL_PACK_BUFFER={name:"PIXEL_PACK_BUFFER",value:35051,description:" "},p.PIXEL_UNPACK_BUFFER={name:"PIXEL_UNPACK_BUFFER",value:35052,description:" "},p.PIXEL_PACK_BUFFER_BINDING={name:"PIXEL_PACK_BUFFER_BINDING",value:35053,description:" "},p.PIXEL_UNPACK_BUFFER_BINDING={name:"PIXEL_UNPACK_BUFFER_BINDING",value:35055,description:" "},p.COPY_READ_BUFFER={name:"COPY_READ_BUFFER",value:36662,description:" "},p.COPY_WRITE_BUFFER={name:"COPY_WRITE_BUFFER",value:36663,description:" "},p.COPY_READ_BUFFER_BINDING={name:"COPY_READ_BUFFER_BINDING",value:36662,description:" "},p.COPY_WRITE_BUFFER_BINDING={name:"COPY_WRITE_BUFFER_BINDING",value:36663,description:" "},p.FLOAT_MAT2x3={name:"FLOAT_MAT2x3",value:35685,description:" "},p.FLOAT_MAT2x4={name:"FLOAT_MAT2x4",value:35686,description:" "},p.FLOAT_MAT3x2={name:"FLOAT_MAT3x2",value:35687,description:" "},p.FLOAT_MAT3x4={name:"FLOAT_MAT3x4",value:35688,description:" "},p.FLOAT_MAT4x2={name:"FLOAT_MAT4x2",value:35689,description:" "},p.FLOAT_MAT4x3={name:"FLOAT_MAT4x3",value:35690,description:" "},p.UNSIGNED_INT_VEC2={name:"UNSIGNED_INT_VEC2",value:36294,description:" "},p.UNSIGNED_INT_VEC3={name:"UNSIGNED_INT_VEC3",value:36295,description:" "},p.UNSIGNED_INT_VEC4={name:"UNSIGNED_INT_VEC4",value:36296,description:" "},p.UNSIGNED_NORMALIZED={name:"UNSIGNED_NORMALIZED",value:35863,description:" "},p.SIGNED_NORMALIZED={name:"SIGNED_NORMALIZED",value:36764,description:" "},p.VERTEX_ATTRIB_ARRAY_INTEGER={name:"VERTEX_ATTRIB_ARRAY_INTEGER",value:35069,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR={name:"VERTEX_ATTRIB_ARRAY_DIVISOR",value:35070,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_MODE={name:"TRANSFORM_FEEDBACK_BUFFER_MODE",value:35967,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",value:35968,description:" "},p.TRANSFORM_FEEDBACK_VARYINGS={name:"TRANSFORM_FEEDBACK_VARYINGS",value:35971,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_START={name:"TRANSFORM_FEEDBACK_BUFFER_START",value:35972,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_SIZE={name:"TRANSFORM_FEEDBACK_BUFFER_SIZE",value:35973,description:" "},p.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN={name:"TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",value:35976,description:" "},p.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",value:35978,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",value:35979,description:" "},p.INTERLEAVED_ATTRIBS={name:"INTERLEAVED_ATTRIBS",value:35980,description:" "},p.SEPARATE_ATTRIBS={name:"SEPARATE_ATTRIBS",value:35981,description:" "},p.TRANSFORM_FEEDBACK_BUFFER={name:"TRANSFORM_FEEDBACK_BUFFER",value:35982,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_BINDING={name:"TRANSFORM_FEEDBACK_BUFFER_BINDING",value:35983,description:" "},p.TRANSFORM_FEEDBACK={name:"TRANSFORM_FEEDBACK",value:36386,description:" "},p.TRANSFORM_FEEDBACK_PAUSED={name:"TRANSFORM_FEEDBACK_PAUSED",value:36387,description:" "},p.TRANSFORM_FEEDBACK_ACTIVE={name:"TRANSFORM_FEEDBACK_ACTIVE",value:36388,description:" "},p.TRANSFORM_FEEDBACK_BINDING={name:"TRANSFORM_FEEDBACK_BINDING",value:36389,description:" "},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",value:33296,description:" "},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",value:33297,description:" "},p.FRAMEBUFFER_ATTACHMENT_RED_SIZE={name:"FRAMEBUFFER_ATTACHMENT_RED_SIZE",value:33298,description:" "},p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE={name:"FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",value:33299,description:" "},p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE={name:"FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",value:33300,description:" "},p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE={name:"FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",value:33301,description:" "},p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE={name:"FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",value:33302,description:" "},p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE={name:"FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",value:33303,description:" "},p.FRAMEBUFFER_DEFAULT={name:"FRAMEBUFFER_DEFAULT",value:33304,description:" "},p.DEPTH24_STENCIL8={name:"DEPTH24_STENCIL8",value:35056,description:" "},p.DRAW_FRAMEBUFFER_BINDING={name:"DRAW_FRAMEBUFFER_BINDING",value:36006,description:" "},p.READ_FRAMEBUFFER={name:"READ_FRAMEBUFFER",value:36008,description:" "},p.DRAW_FRAMEBUFFER={name:"DRAW_FRAMEBUFFER",value:36009,description:" "},p.READ_FRAMEBUFFER_BINDING={name:"READ_FRAMEBUFFER_BINDING",value:36010,description:" "},p.RENDERBUFFER_SAMPLES={name:"RENDERBUFFER_SAMPLES",value:36011,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",value:36052,description:" "},p.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE={name:"FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",value:36182,description:" "},p.UNIFORM_BUFFER={name:"UNIFORM_BUFFER",value:35345,description:" "},p.UNIFORM_BUFFER_BINDING={name:"UNIFORM_BUFFER_BINDING",value:35368,description:" "},p.UNIFORM_BUFFER_START={name:"UNIFORM_BUFFER_START",value:35369,description:" "},p.UNIFORM_BUFFER_SIZE={name:"UNIFORM_BUFFER_SIZE",value:35370,description:" "},p.MAX_VERTEX_UNIFORM_BLOCKS={name:"MAX_VERTEX_UNIFORM_BLOCKS",value:35371,description:" "},p.MAX_FRAGMENT_UNIFORM_BLOCKS={name:"MAX_FRAGMENT_UNIFORM_BLOCKS",value:35373,description:" "},p.MAX_COMBINED_UNIFORM_BLOCKS={name:"MAX_COMBINED_UNIFORM_BLOCKS",value:35374,description:" "},p.MAX_UNIFORM_BUFFER_BINDINGS={name:"MAX_UNIFORM_BUFFER_BINDINGS",value:35375,description:" "},p.MAX_UNIFORM_BLOCK_SIZE={name:"MAX_UNIFORM_BLOCK_SIZE",value:35376,description:" "},p.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS={name:"MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",value:35377,description:" "},p.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",value:35379,description:" "},p.UNIFORM_BUFFER_OFFSET_ALIGNMENT={name:"UNIFORM_BUFFER_OFFSET_ALIGNMENT",value:35380,description:" "},p.ACTIVE_UNIFORM_BLOCKS={name:"ACTIVE_UNIFORM_BLOCKS",value:35382,description:" "},p.UNIFORM_TYPE={name:"UNIFORM_TYPE",value:35383,description:" "},p.UNIFORM_SIZE={name:"UNIFORM_SIZE",value:35384,description:" "},p.UNIFORM_BLOCK_INDEX={name:"UNIFORM_BLOCK_INDEX",value:35386,description:" "},p.UNIFORM_OFFSET={name:"UNIFORM_OFFSET",value:35387,description:" "},p.UNIFORM_ARRAY_STRIDE={name:"UNIFORM_ARRAY_STRIDE",value:35388,description:" "},p.UNIFORM_MATRIX_STRIDE={name:"UNIFORM_MATRIX_STRIDE",value:35389,description:" "},p.UNIFORM_IS_ROW_MAJOR={name:"UNIFORM_IS_ROW_MAJOR",value:35390,description:" "},p.UNIFORM_BLOCK_BINDING={name:"UNIFORM_BLOCK_BINDING",value:35391,description:" "},p.UNIFORM_BLOCK_DATA_SIZE={name:"UNIFORM_BLOCK_DATA_SIZE",value:35392,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORMS={name:"UNIFORM_BLOCK_ACTIVE_UNIFORMS",value:35394,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES={name:"UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",value:35395,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",value:35396,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",value:35398,description:" "},p.OBJECT_TYPE={name:"OBJECT_TYPE",value:37138,description:" "},p.SYNC_CONDITION={name:"SYNC_CONDITION",value:37139,description:" "},p.SYNC_STATUS={name:"SYNC_STATUS",value:37140,description:" "},p.SYNC_FLAGS={name:"SYNC_FLAGS",value:37141,description:" "},p.SYNC_FENCE={name:"SYNC_FENCE",value:37142,description:" "},p.SYNC_GPU_COMMANDS_COMPLETE={name:"SYNC_GPU_COMMANDS_COMPLETE",value:37143,description:" "},p.UNSIGNALED={name:"UNSIGNALED",value:37144,description:" "},p.SIGNALED={name:"SIGNALED",value:37145,description:" "},p.ALREADY_SIGNALED={name:"ALREADY_SIGNALED",value:37146,description:" "},p.TIMEOUT_EXPIRED={name:"TIMEOUT_EXPIRED",value:37147,description:" "},p.CONDITION_SATISFIED={name:"CONDITION_SATISFIED",value:37148,description:" "},p.WAIT_FAILED={name:"WAIT_FAILED",value:37149,description:" "},p.SYNC_FLUSH_COMMANDS_BIT={name:"SYNC_FLUSH_COMMANDS_BIT",value:1,description:" "},p.COLOR={name:"COLOR",value:6144,description:" "},p.DEPTH={name:"DEPTH",value:6145,description:" "},p.STENCIL={name:"STENCIL",value:6146,description:" "},p.MIN={name:"MIN",value:32775,description:" "},p.MAX={name:"MAX",value:32776,description:" "},p.DEPTH_COMPONENT24={name:"DEPTH_COMPONENT24",value:33190,description:" "},p.STREAM_READ={name:"STREAM_READ",value:35041,description:" "},p.STREAM_COPY={name:"STREAM_COPY",value:35042,description:" "},p.STATIC_READ={name:"STATIC_READ",value:35045,description:" "},p.STATIC_COPY={name:"STATIC_COPY",value:35046,description:" "},p.DYNAMIC_READ={name:"DYNAMIC_READ",value:35049,description:" "},p.DYNAMIC_COPY={name:"DYNAMIC_COPY",value:35050,description:" "},p.DEPTH_COMPONENT32F={name:"DEPTH_COMPONENT32F",value:36012,description:" "},p.DEPTH32F_STENCIL8={name:"DEPTH32F_STENCIL8",value:36013,description:" "},p.INVALID_INDEX={name:"INVALID_INDEX",value:4294967295,description:" "},p.TIMEOUT_IGNORED={name:"TIMEOUT_IGNORED",value:-1,description:" "},p.MAX_CLIENT_WAIT_TIMEOUT_WEBGL={name:"MAX_CLIENT_WAIT_TIMEOUT_WEBGL",value:37447,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE={name:"VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",value:35070,description:"Describes the frequency divisor used for instanced rendering.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_VENDOR_WEBGL={name:"UNMASKED_VENDOR_WEBGL",value:37445,description:"Passed to getParameter to get the vendor string of the graphics driver.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_RENDERER_WEBGL={name:"UNMASKED_RENDERER_WEBGL",value:37446,description:"Passed to getParameter to get the renderer string of the graphics driver.",extensionName:"WEBGL_debug_renderer_info"},p.MAX_TEXTURE_MAX_ANISOTROPY_EXT={name:"MAX_TEXTURE_MAX_ANISOTROPY_EXT",value:34047,description:"Returns the maximum available anisotropy.",extensionName:"EXT_texture_filter_anisotropic"},p.TEXTURE_MAX_ANISOTROPY_EXT={name:"TEXTURE_MAX_ANISOTROPY_EXT",value:34046,description:"Passed to texParameter to set the desired maximum anisotropy for a texture.",extensionName:"EXT_texture_filter_anisotropic"},p.COMPRESSED_RGB_S3TC_DXT1_EXT={name:"COMPRESSED_RGB_S3TC_DXT1_EXT",value:33776,description:"A DXT1-compressed image in an RGB image format.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT1_EXT={name:"COMPRESSED_RGBA_S3TC_DXT1_EXT",value:33777,description:"A DXT1-compressed image in an RGB image format with a simple on/off alpha value.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT3_EXT={name:"COMPRESSED_RGBA_S3TC_DXT3_EXT",value:33778,description:"A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT5_EXT={name:"COMPRESSED_RGBA_S3TC_DXT5_EXT",value:33779,description:"A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_R11_EAC={name:"COMPRESSED_R11_EAC",value:37488,description:"One-channel (red) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_R11_EAC={name:"COMPRESSED_SIGNED_R11_EAC",value:37489,description:"One-channel (red) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RG11_EAC={name:"COMPRESSED_RG11_EAC",value:37490,description:"Two-channel (red and green) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_RG11_EAC={name:"COMPRESSED_SIGNED_RG11_EAC",value:37491,description:"Two-channel (red and green) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_ETC2={name:"COMPRESSED_RGB8_ETC2",value:37492,description:"Compresses RBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGBA8_ETC2_EAC={name:"COMPRESSED_RGBA8_ETC2_EAC",value:37493,description:"Compresses RGBA8 data. The RGB part is encoded the same as RGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ETC2={name:"COMPRESSED_SRGB8_ETC2",value:37494,description:"Compresses sRBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC={name:"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",value:37495,description:"Compresses sRGBA8 data. The sRGB part is encoded the same as SRGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37496,description:"Similar to RGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37497,description:"Similar to SRGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_4BPPV1_IMG",value:35840,description:"RGB compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",value:35842,description:"RGBA compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_2BPPV1_IMG",value:35841,description:"RGB compression in 2-bit mode. One block for each 8×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",value:35843,description:"RGBA compression in 2-bit mode. One block for each 8×4 pixe",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_ETC1_WEBGL={name:"COMPRESSED_RGB_ETC1_WEBGL",value:36196,description:"Compresses 24-bit RGB data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc1"},p.COMPRESSED_RGB_ATC_WEBGL={name:"COMPRESSED_RGB_ATC_WEBGL",value:35986,description:"Compresses RGB textures with no alpha channel.",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",value:35986,description:"Compresses RGBA textures using explicit alpha encoding (useful when alpha transitions are sharp).",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",value:34798,description:"Compresses RGBA textures using interpolated alpha encoding (useful when alpha transitions are gradient).",extensionName:"WEBGL_compressed_texture_atc"},p.UNSIGNED_INT_24_8_WEBGL={name:"UNSIGNED_INT_24_8_WEBGL",value:34042,description:"Unsigned integer type for 24-bit depth texture data.",extensionName:"WEBGL_depth_texture"},p.HALF_FLOAT_OES={name:"HALF_FLOAT_OES",value:36193,description:"Half floating-point type (16-bit).",extensionName:"OES_texture_half_float"},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",value:33297,description:" ",extensionName:"WEBGL_color_buffer_float"},p.UNSIGNED_NORMALIZED_EXT={name:"UNSIGNED_NORMALIZED_EXT",value:35863,description:" ",extensionName:"WEBGL_color_buffer_float"},p.MIN_EXT={name:"MIN_EXT",value:32775,description:"Produces the minimum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.MAX_EXT={name:"MAX_EXT",value:32776,description:"Produces the maximum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.SRGB_EXT={name:"SRGB_EXT",value:35904,description:"Unsized sRGB format that leaves the precision up to the driver.",extensionName:"EXT_sRGB"},p.SRGB_ALPHA_EXT={name:"SRGB_ALPHA_EXT",value:35906,description:"Unsized sRGB format with unsized alpha component.",extensionName:"EXT_sRGB"},p.SRGB8_ALPHA8_EXT={name:"SRGB8_ALPHA8_EXT",value:35907,description:"Sized (8-bit) sRGB and alpha formats.",extensionName:"EXT_sRGB"},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",value:33296,description:"Returns the framebuffer color encoding.",extensionName:"EXT_sRGB"},p.FRAGMENT_SHADER_DERIVATIVE_HINT_OES={name:"FRAGMENT_SHADER_DERIVATIVE_HINT_OES",value:35723,description:"Indicates the accuracy of the derivative calculation for the GLSL built-in functions: dFdx, dFdy, and fwidth.",extensionName:"OES_standard_derivatives"},p.COLOR_ATTACHMENT0_WEBGL={name:"COLOR_ATTACHMENT0_WEBGL",value:36064,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT1_WEBGL={name:"COLOR_ATTACHMENT1_WEBGL",value:36065,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT2_WEBGL={name:"COLOR_ATTACHMENT2_WEBGL",value:36066,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT3_WEBGL={name:"COLOR_ATTACHMENT3_WEBGL",value:36067,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT4_WEBGL={name:"COLOR_ATTACHMENT4_WEBGL",value:36068,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT5_WEBGL={name:"COLOR_ATTACHMENT5_WEBGL",value:36069,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT6_WEBGL={name:"COLOR_ATTACHMENT6_WEBGL",value:36070,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT7_WEBGL={name:"COLOR_ATTACHMENT7_WEBGL",value:36071,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT8_WEBGL={name:"COLOR_ATTACHMENT8_WEBGL",value:36072,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT9_WEBGL={name:"COLOR_ATTACHMENT9_WEBGL",value:36073,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT10_WEBGL={name:"COLOR_ATTACHMENT10_WEBGL",value:36074,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT11_WEBGL={name:"COLOR_ATTACHMENT11_WEBGL",value:36075,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT12_WEBGL={name:"COLOR_ATTACHMENT12_WEBGL",value:36076,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT13_WEBGL={name:"COLOR_ATTACHMENT13_WEBGL",value:36077,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT14_WEBGL={name:"COLOR_ATTACHMENT14_WEBGL",value:36078,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT15_WEBGL={name:"COLOR_ATTACHMENT15_WEBGL",value:36079,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER0_WEBGL={name:"DRAW_BUFFER0_WEBGL",value:34853,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER1_WEBGL={name:"DRAW_BUFFER1_WEBGL",value:34854,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER2_WEBGL={name:"DRAW_BUFFER2_WEBGL",value:34855,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER3_WEBGL={name:"DRAW_BUFFER3_WEBGL",value:34856,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER4_WEBGL={name:"DRAW_BUFFER4_WEBGL",value:34857,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER5_WEBGL={name:"DRAW_BUFFER5_WEBGL",value:34858,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER6_WEBGL={name:"DRAW_BUFFER6_WEBGL",value:34859,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER7_WEBGL={name:"DRAW_BUFFER7_WEBGL",value:34860,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER8_WEBGL={name:"DRAW_BUFFER8_WEBGL",value:34861,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER9_WEBGL={name:"DRAW_BUFFER9_WEBGL",value:34862,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER10_WEBGL={name:"DRAW_BUFFER10_WEBGL",value:34863,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER11_WEBGL={name:"DRAW_BUFFER11_WEBGL",value:34864,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER12_WEBGL={name:"DRAW_BUFFER12_WEBGL",value:34865,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER13_WEBGL={name:"DRAW_BUFFER13_WEBGL",value:34866,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER14_WEBGL={name:"DRAW_BUFFER14_WEBGL",value:34867,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER15_WEBGL={name:"DRAW_BUFFER15_WEBGL",value:34868,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.MAX_COLOR_ATTACHMENTS_WEBGL={name:"MAX_COLOR_ATTACHMENTS_WEBGL",value:36063,description:"Maximum number of framebuffer color attachment points",extensionName:"WEBGL_draw_buffers"},p.MAX_DRAW_BUFFERS_WEBGL={name:"MAX_DRAW_BUFFERS_WEBGL",value:34852,description:"Maximum number of draw buffers",extensionName:"WEBGL_draw_buffers"},p.VERTEX_ARRAY_BINDING_OES={name:"VERTEX_ARRAY_BINDING_OES",value:34229,description:"The bound vertex array object (VAO).",extensionName:"VERTEX_ARRAY_BINDING_OES"},p.QUERY_COUNTER_BITS_EXT={name:"QUERY_COUNTER_BITS_EXT",value:34916,description:"The number of bits used to hold the query result for the given target.",extensionName:"EXT_disjoint_timer_query"},p.CURRENT_QUERY_EXT={name:"CURRENT_QUERY_EXT",value:34917,description:"The currently active query.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_EXT={name:"QUERY_RESULT_EXT",value:34918,description:"The query result.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_AVAILABLE_EXT={name:"QUERY_RESULT_AVAILABLE_EXT",value:34919,description:"A Boolean indicating whether or not a query result is available.",extensionName:"EXT_disjoint_timer_query"},p.TIME_ELAPSED_EXT={name:"TIME_ELAPSED_EXT",value:35007,description:"Elapsed time (in nanoseconds).",extensionName:"EXT_disjoint_timer_query"},p.TIMESTAMP_EXT={name:"TIMESTAMP_EXT",value:36392,description:"The current time.",extensionName:"EXT_disjoint_timer_query"},p.GPU_DISJOINT_EXT={name:"GPU_DISJOINT_EXT",value:36795,description:"A Boolean indicating whether or not the GPU performed any disjoint operation.",extensionName:"EXT_disjoint_timer_query"},p.zeroMeaningByCommand={getError:"NO_ERROR",blendFunc:"ZERO",blendFuncSeparate:"ZERO",readBuffer:"NONE",getFramebufferAttachmentParameter:"NONE",texParameterf:"NONE",texParameteri:"NONE",drawArrays:"POINTS",drawElements:"POINTS",drawArraysInstanced:"POINTS",drawArraysInstancedAngle:"POINTS",drawBuffers:"POINTS",drawElementsInstanced:"POINTS",drawRangeElements:"POINTS"},p.oneMeaningByCommand={blendFunc:"ONE",blendFuncSeparate:"ONE",drawArrays:"LINES",drawElements:"LINES",drawArraysInstanced:"LINES",drawArraysInstancedAngle:"LINES",drawBuffers:"LINES",drawElementsInstanced:"LINES",drawRangeElements:"LINES"};const m={},g={};!function(){for(const e in p)if(p.hasOwnProperty(e)){const t=p[e];m[t.name]=t,g[t.value]=t}}();class E extends c{get analyserName(){return E.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={total:0,totalTriangles:0,totalTriangleStrip:0,totalTriangleFan:0,totalLines:0,totalLineStrip:0,totalLineLoop:0,totalPoints:0};for(const t of e.commands)"drawArrays"===t.name&&t.commandArguments.length>=3||"drawArraysInstanced"===t.name&&t.commandArguments.length>=3||"drawArraysInstancedANGLE"===t.name&&t.commandArguments.length>=3?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[2]):"drawElements"===t.name&&t.commandArguments.length>=2||"drawElementsInstanced"===t.name&&t.commandArguments.length>=2||"drawElementsInstancedANGLE"===t.name&&t.commandArguments.length>=2?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[1]):"drawRangeElements"===t.name&&t.commandArguments.length>=4&&this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[3]);t.total=n.total,t.triangles=n.totalTriangles,t.triangleStrip=n.totalTriangleStrip,t.triangleFan=n.totalTriangleFan,t.lines=n.totalLines,t.lineStrip=n.totalLineStrip,t.lineLoop=n.totalLineLoop,t.points=n.totalPoints}appendToPrimitives(e,t,n){t===p.POINTS.value?e.totalPoints+=n:t===p.LINES.value?e.totalLines+=n:t===p.LINE_STRIP.value?e.totalLineStrip+=n:t===p.LINE_LOOP.value?e.totalLineLoop+=n:t===p.TRIANGLES.value?e.totalTriangles+=n:t===p.TRIANGLE_STRIP.value?e.totalTriangleStrip+=n:t===p.TRIANGLE_FAN.value&&(e.totalTriangleFan+=n),e.total+=n}}E.analyserName="Primitives";class v{constructor(e){this.contextInformation=e,this.analysers=[],this.initAnalysers()}appendAnalyses(e){for(const t in this.analysers)this.analysers.hasOwnProperty(t)&&this.analysers[t].appendAnalysis(e)}initAnalysers(){this.analysers.push(new h(this.contextInformation),new f(this.contextInformation),new E(this.contextInformation))}}class C{static getStackTrace(e=0,t=0){const n=[];try{throw new Error("Errorator.")}catch(e){if(e.stack){const t=e.stack.split("\n");for(let e=0,r=t.length;e0;t++)n.shift();for(let e=0;e0;e++)n.pop()}return n}}class D{static getWebGlObjectTag(e){return e[D.SPECTOROBJECTTAGKEY]}static attachWebGlObjectTag(e,t){t.displayText=D.stringifyWebGlObjectTag(t),e[D.SPECTOROBJECTTAGKEY]=t}static stringifyWebGlObjectTag(e){return e?`${e.typeName} - ID: ${e.id}`:"No tag available."}}D.SPECTOROBJECTTAGKEY="__SPECTOR_Object_TAG";class S{get type(){return("undefined"!=typeof globalThis?globalThis:self)[this.typeName]||null}constructor(){this.id=0}tagWebGlObject(e){if(!this.type)return;let t;if(!e)return t;if(t=D.getWebGlObjectTag(e),t)return t;if(e instanceof this.type){const n=this.getNextId();return t={typeName:this.typeName,id:n},D.attachWebGlObjectTag(e,t),t}return t}getNextId(){return this.id++}}class A{constructor(e){this.options=e}createCapture(e,t,n){const r=C.getStackTrace(4,1),i=0===e.name.indexOf("uniform")?this.stringifyUniform(e.arguments):this.stringify(e.arguments,e.result),s={id:t,startTime:e.startTime,commandEndTime:e.endTime,endTime:0,name:e.name,commandArguments:e.arguments,result:e.result,stackTrace:r,status:0,marker:n,text:i};this.transformCapture(s);for(let e=0;e50&&(s.commandArguments[e]="Array Length: "+t.length)}if(s.commandArguments){const e=[];for(let t=0;t0&&(n+=": "+this.stringifyArgs(e).join(", ")),null!=t&&(n+=" -> "+this.stringifyResult(t)),n}stringifyUniform(e){let t=this.spiedCommandName;if(e&&e.length>0){const n=[];n.push(this.stringifyValue(e[0]));for(let t=1;t0&&"number"==typeof s)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");else{const e=this.stringifyValue(s);r.push(e)}}return r}}_.commandName="bufferSubData";class y{static storeOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]||(e[n]=e[t])}static resetOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]&&(e[t]=e[n],delete e[n])}static storePrototypeOriginFunction(e,t){if(!e)return;if(!e.prototype[t])return;const n=this.getOriginFunctionName(t);e.prototype[n]||(e.prototype[n]=e.prototype[t])}static executePrototypeOriginFunction(e,t,n,r){if(!e)return;const i=this.getOriginFunctionName(n);return t.prototype[i]?(e[i]||(e[i]=t.prototype[i]),this.executeFunction(e,i,r)):void 0}static executeOriginFunction(e,t,n){if(!e)return;const r=this.getOriginFunctionName(t);return e[r]?this.executeFunction(e,r,n):void 0}static executeFunction(e,t,n){const r=n;if(void 0===r||0===r.length)return e[t]();switch(r.length){case 1:return e[t](r[0]);case 2:return e[t](r[0],r[1]);case 3:return e[t](r[0],r[1],r[2]);case 4:return e[t](r[0],r[1],r[2],r[3]);case 5:return e[t](r[0],r[1],r[2],r[3],r[4]);case 6:return e[t](r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6]);case 8:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]);case 9:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8]);case 10:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9]);case 11:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10]);case 12:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11]);case 13:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12]);case 14:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13]);case 15:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14]);case 16:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);case 17:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16]);case 18:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17]);case 19:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18]);case 20:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19]);default:return e[t].apply(e,r)}}static getOriginFunctionName(e){return this.originFunctionPrefix+e}}y.originFunctionPrefix="__SPECTOR_Origin_";class b extends A{get spiedCommandName(){return b.commandName}stringifyArgs(e){const t=[];if(e.length>0){const n=e[0],r=this.stringifyValue(n);t.push(r)}if(e.length>1){const n=""+e[1];t.push(n)}return e.length>2&&t.push(e[2]),t}}b.commandName="bindAttribLocation";class T extends A{get spiedCommandName(){return T.commandName}stringifyArgs(e){const t=[],n=this.options.context.getParameter(p.READ_FRAMEBUFFER_BINDING.value),r=this.options.tagWebGlObject(n);t.push("READ FROM: "+this.stringifyValue(r));const i=this.options.context.getParameter(p.DRAW_FRAMEBUFFER_BINDING.value),s=this.options.tagWebGlObject(i);t.push("WRITE TO: "+this.stringifyValue(s));for(let n=0;n<8;n++)t.push(e[n]);return(e[8]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[8]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[8]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t.push(p.stringifyWebGlConstant(e[9],"blitFrameBuffer")),t}}T.commandName="blitFrameBuffer";class R extends A{get spiedCommandName(){return R.commandName}stringifyArgs(e){const t=[];return(e[0]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[0]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[0]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t}}R.commandName="clear";class x{static getProgramData(e,t){const n={LINK_STATUS:e.getProgramParameter(t,p.LINK_STATUS.value),VALIDATE_STATUS:e.getProgramParameter(t,p.VALIDATE_STATUS.value),infoLog:e.getProgramInfoLog(t)||""},r=e.getAttachedShaders(t)||[],i=new Array(2);let s=0;for(const t of r){const n=this.getShaderData(e,t);s+=n.source.length,n.shaderType===p.FRAGMENT_SHADER.name?i[1]=n:i[0]=n}return{programStatus:n,shaders:i,length:s}}static getShaderData(e,t){const n=e.getShaderSource(t)||"",r=e.getExtension("WEBGL_debug_shaders"),i=r?r.getTranslatedShaderSource(t):null,s=e.getShaderParameter(t,p.SHADER_TYPE.value)===p.FRAGMENT_SHADER.value;let o=t&&t.__SPECTOR_Metadata&&t.__SPECTOR_Metadata.name?t.__SPECTOR_Metadata.name:this.readNameFromShaderSource(n);return o||(o=s?"Fragment":"Vertex"),{COMPILE_STATUS:e.getShaderParameter(t,p.COMPILE_STATUS.value),shaderType:s?p.FRAGMENT_SHADER.name:p.VERTEX_SHADER.name,name:o,source:n,translatedSource:i,infoLog:e.getShaderInfoLog(t)||""}}static readNameFromShaderSource(e){try{let t,n="";const r=/#define[\s]+SHADER_NAME[\s]+([\S]+)(\n|$)/gi;if(t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),""===n){const r=/#define[\s]+SHADER_NAME_B64[\s]+([\S]+)(\n|$)/gi;t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),n&&(n=decodeURIComponent(atob(n)))}return n}catch(e){return null}}}class w extends A{constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.shader=x.getShaderData(this.options.context,t)}finally{n&&n(!0)}}getShaderDisplayText(e){return this.stringifyValue(e.commandArguments[0])}}class F extends w{get spiedCommandName(){return F.commandName}transformCapture(e){if(super.transformCapture(e),e.shader){const t=e.shader.COMPILE_STATUS?"compiled":"failed";e.text=`${this.spiedCommandName}: ${this.getShaderDisplayText(e)} -> ${t}`}}}F.commandName="compileShader";const N=["lineWidth"];class L extends A{get spiedCommandName(){return this.internalSpiedCommandName}constructor(e,t){super(e),this.internalSpiedCommandName=t,this.isDeprecated=N.indexOf(this.spiedCommandName)>-1}transformCapture(e){this.isDeprecated&&(e.status=50)}}class O extends A{get spiedCommandName(){return O.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}O.commandName="disableVertexAttribArray";class I extends A{get spiedCommandName(){return I.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(e[1]+" indices"),t.push(e[2]),t}}I.commandName="drawArrays";class k extends A{get spiedCommandName(){return k.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}k.commandName="drawArraysInstanced";class M extends A{get spiedCommandName(){return M.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstancedANGLE")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}M.commandName="drawArraysInstancedANGLE";class P extends A{get spiedCommandName(){return P.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElements")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElements")),t.push(e[3]),t}}P.commandName="drawElements";class B extends A{get spiedCommandName(){return B.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstancedANGLE")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstancedANGLE")),t.push(e[3]),t.push(e[4]),t}}B.commandName="drawElementsInstancedANGLE";class U extends A{get spiedCommandName(){return U.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t}}U.commandName="drawElementsInstanced";class $ extends A{get spiedCommandName(){return $.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawRangeElements")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(p.stringifyWebGlConstant(e[4],"drawRangeElements")),t.push(e[5]),t}}$.commandName="drawRangeElements";class G extends A{get spiedCommandName(){return G.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}G.commandName="getActiveAttrib";class V extends A{get spiedCommandName(){return V.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}V.commandName="getActiveUniform";class W extends A{get spiedCommandName(){return W.commandName}stringifyResult(e){var t;if(null!=e)return null!==(t=null==e?void 0:e.toFixed(0))&&void 0!==t?t:"0"}}W.commandName="getAttribLocation";class H extends A{get spiedCommandName(){return H.commandName}stringifyResult(e){return e?"true":"false"}}H.commandName="getExtension";class j extends A{get spiedCommandName(){return j.commandName}stringifyResult(e){if(!e)return"null";const t=D.getWebGlObjectTag(e);return t?t.displayText:e}}j.commandName="getParameter";class z extends A{get spiedCommandName(){return z.commandName}stringifyResult(e){if(e)return`min: ${e.rangeMin}, max: ${e.rangeMax}, precision: ${e.precision}`}}z.commandName="getShaderPrecisionFormat";class X extends w{get spiedCommandName(){return X.commandName}stringifyResult(e){if("string"!=typeof e||0===e.trim().length)return"No messages";const t=e.split(/\r?\n/).filter(e=>e.trim().length>0).length;return t+(1===t?" message":" messages")}}X.commandName="getShaderInfoLog";class K extends A{get spiedCommandName(){return K.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}K.commandName="getTransformFeedbackVarying";class Y extends A{get spiedCommandName(){return Y.commandName}constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.program=x.getProgramData(this.options.context,t)}finally{n&&n(!0)}const r=e.program.programStatus.LINK_STATUS?"linked":"failed";e.text=`${this.spiedCommandName}: ${this.stringifyValue(t)} -> ${r}`}}Y.commandName="linkProgram";class q extends A{get spiedCommandName(){return q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"multiDrawArraysInstancedBaseInstanceWEBGL")),t.push(`drawCount=${e[9]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t}}q.commandName="multiDrawArraysInstancedBaseInstanceWEBGL";class Q extends A{get spiedCommandName(){return Q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[7]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t}}Q.commandName="multiDrawArraysInstancedWEBGL";class Z extends A{get spiedCommandName(){return Z.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[5]}`),t.push(e[2]),t.push(e[4]),t}}Z.commandName="multiDrawArraysWEBGL";class J extends A{get spiedCommandName(){return J.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[11]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t.push(e[10]),t}}J.commandName="multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL";class ee extends A{get spiedCommandName(){return ee.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[8]}`),t.push(e[2]),t.push(e[5]),t.push(e[7]),t}}ee.commandName="multiDrawElementsInstancedWEBGL";class te extends A{get spiedCommandName(){return te.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[6]}`),t.push(e[2]),t.push(e[5]),t}}te.commandName="multiDrawElementsWEBGL";class ne extends A{get spiedCommandName(){return ne.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(`baseInstance = ${e[4]}`),t}}ne.commandName="drawArraysInstancedBaseInstanceWEBGL";class re extends A{get spiedCommandName(){return re.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t.push(`baseVertex = ${e[5]}`),t.push(`baseInstance = ${e[6]}`),t}}re.commandName="drawElementsInstancedBaseVertexBaseInstanceWEBGL";class ie extends A{get spiedCommandName(){return ie.commandName}stringifyArgs(e){var t,n;const r=[];for(let i=0;i<4;i++)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");return r}}function se(e){return null==e?"":`${e.toFixed(0)} (0b${(e>>>0).toString(2)})`}ie.commandName="scissor";class oe extends A{get spiedCommandName(){return oe.commandName}stringifyArgs(e){const t=[];return t.push(se(e[0])),t}}oe.commandName="stencilMask";class ae extends A{get spiedCommandName(){return ae.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilMaskSeparate")),t.push(se(e[1])),t}}ae.commandName="stencilMaskSeparate";class le extends A{get spiedCommandName(){return le.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFunc")),t.push(se(e[1])),t.push(se(e[2])),t}}le.commandName="stencilFunc";class ue extends A{get spiedCommandName(){return ue.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFuncSeparate")),t.push(p.stringifyWebGlConstant(e[1],"stencilFuncSeparate")),t.push(se(e[2])),t.push(se(e[3])),t}}ue.commandName="stencilFuncSeparate";class ce extends A{get spiedCommandName(){return ce.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t.push(e[1]),t.push(p.stringifyWebGlConstant(e[2],"vertexAttribPointer")),t.push(e[3]),t.push(e[4]),t.push(e[5]),t}}ce.commandName="vertexAttribPointer";class he extends A{get spiedCommandName(){return he.commandName}stringifyArgs(e){const t=[];for(let n=0;n<4;n++)t.push(e[n].toFixed(0));return t}}he.commandName="viewport";class de extends A{get spiedCommandName(){return de.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}de.commandName="enableVertexAttribArray";class fe extends w{get spiedCommandName(){return fe.commandName}stringifyArgs(e){const t="string"==typeof e[1]?e[1]:"";return[this.stringifyValue(e[0]),t.length+" chars"]}transformCapture(e){super.transformCapture(e);const t=e.commandArguments[1];e.shader&&"string"==typeof t&&(e.shader.source=t,e.shader.COMPILE_STATUS=null,e.shader.translatedSource="",e.shader.infoLog="")}}fe.commandName="shaderSource";class pe{constructor(e){this.spiedCommandName=e.spiedCommandName,this.spiedCommandRunningContext=e.spiedCommandRunningContext,this.spiedCommand=this.spiedCommandRunningContext[this.spiedCommandName],y.storeOriginFunction(this.spiedCommandRunningContext,this.spiedCommandName),this.callback=e.callback,this.commandOptions={context:e.context,contextVersion:e.contextVersion,extensions:e.extensions,toggleCapture:e.toggleCapture},this.initCustomCommands(),this.initCommand()}spy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.overloadedCommand}unSpy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.spiedCommand}createCapture(e,t,n){return this.command.createCapture(e,t,n)}initCommand(){pe.customCommandsConstructors[this.spiedCommandName]?this.command=pe.customCommandsConstructors[this.spiedCommandName](this.commandOptions):this.command=new L(this.commandOptions,this.spiedCommandName),this.overloadedCommand=this.getSpy()}getSpy(){const e=this;return function(){const t=u.now,n=y.executeOriginFunction(e.spiedCommandRunningContext,e.spiedCommandName,arguments),r=u.now;try{const i={name:e.spiedCommandName,arguments,result:n,startTime:t,endTime:r};e.callback(e,i)}catch(e){}return n}}initCustomCommands(){pe.customCommandsConstructors||(pe.customCommandsConstructors={[b.commandName]:e=>new b(e),[T.commandName]:e=>new T(e),[_.commandName]:e=>new _(e),[R.commandName]:e=>new R(e),[F.commandName]:e=>new F(e),[O.commandName]:e=>new O(e),[I.commandName]:e=>new I(e),[k.commandName]:e=>new k(e),[M.commandName]:e=>new M(e),[P.commandName]:e=>new P(e),[U.commandName]:e=>new U(e),[B.commandName]:e=>new B(e),[$.commandName]:e=>new $(e),[G.commandName]:e=>new G(e),[V.commandName]:e=>new V(e),[W.commandName]:e=>new W(e),[H.commandName]:e=>new H(e),[j.commandName]:e=>new j(e),[X.commandName]:e=>new X(e),[z.commandName]:e=>new z(e),[K.commandName]:e=>new K(e),[Y.commandName]:e=>new Y(e),[q.commandName]:e=>new q(e),[Q.commandName]:e=>new Q(e),[Z.commandName]:e=>new Z(e),[J.commandName]:e=>new J(e),[ee.commandName]:e=>new ee(e),[te.commandName]:e=>new te(e),[ne.commandName]:e=>new ne(e),[re.commandName]:e=>new re(e),[ie.commandName]:e=>new ie(e),[fe.commandName]:e=>new fe(e),[oe.commandName]:e=>new oe(e),[ae.commandName]:e=>new ae(e),[le.commandName]:e=>new le(e),[ue.commandName]:e=>new ue(e),[ce.commandName]:e=>new ce(e),[he.commandName]:e=>new he(e),[de.commandName]:e=>new de(e)})}}class me{constructor(e){this.options=e,this.context=e.context,this.contextVersion=e.contextVersion,this.extensions=e.extensions,this.toggleCapture=e.toggleCapture,this.consumeCommands=this.getConsumeCommands(),this.changeCommandsByState=this.getChangeCommandsByState(),this.commandNameToStates=this.getCommandNameToStates()}get requireStartAndStopStates(){return!0}startCapture(e,t,n){return this.quickCapture=t,this.fullCapture=n,this.capturedCommandsByState={},e&&this.requireStartAndStopStates&&(this.currentState={},this.readFromContextNoSideEffects()),this.copyCurrentStateToPrevious(),this.currentState={},this.previousState}stopCapture(){return this.requireStartAndStopStates&&this.readFromContextNoSideEffects(),this.analyse(void 0),this.currentState}registerCallbacks(e){for(const t in this.changeCommandsByState)if(this.changeCommandsByState.hasOwnProperty(t))for(const n of this.changeCommandsByState[t])e[n]=e[n]||[],e[n].push(this.onChangeCommand.bind(this));for(const t of this.consumeCommands)e[t]=e[t]||[],e[t].push(this.onConsumeCommand.bind(this))}getStateData(){return this.currentState}getConsumeCommands(){return[]}getChangeCommandsByState(){return{}}copyCurrentStateToPrevious(){this.currentState&&(this.previousState=this.currentState)}onChangeCommand(e){const t=this.commandNameToStates[e.name];for(const n of t){if(!this.isValidChangeCommand(e,n))return;this.capturedCommandsByState[n]=this.capturedCommandsByState[n]||[],this.capturedCommandsByState[n].push(e)}}isValidChangeCommand(e,t){return!0}onConsumeCommand(e){this.isValidConsumeCommand(e)&&(this.readFromContextNoSideEffects(),this.analyse(e),this.storeCommandIds(),e[this.stateName]=this.currentState,this.startCapture(!1,this.quickCapture,this.fullCapture))}isValidConsumeCommand(e){return this.lastCommandName=null==e?void 0:e.name,!0}analyse(e){for(const t in this.capturedCommandsByState)if(this.capturedCommandsByState.hasOwnProperty(t)){const n=this.capturedCommandsByState[t],r=n.length-1;if(r>=0)if(e){for(let t=0;t1&&this.parameters.push(this.getWebgl2Parameters());const e={};for(let t=1;t<=this.contextVersion&&!(t>this.parameters.length);t++)if(this.parameters[t-1])for(const n of this.parameters[t-1])if(n.changeCommands)for(const t of n.changeCommands)e[n.constant.name]=e[n.constant.name]||[],e[n.constant.name].push(t);return e}readFromContext(){for(let e=1;e<=this.contextVersion&&!(e>this.parameters.length);e++)for(const t of this.parameters[e-1]){const e=this.readParameterFromContext(t);if(null==e){const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n;continue}const n=D.getWebGlObjectTag(e);if(n)this.currentState[t.constant.name]=n;else{const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n}}}readParameterFromContext(e){return e.constant.extensionName&&!this.extensions[e.constant.extensionName]?`Extension ${e.constant.extensionName} is unavailable.`:this.context.getParameter(e.constant.value)}stringifyParameterValue(e,t){if(null===e)return"null";if(void 0===e)return"undefined";if(30===t.returnType)return se(e);if("number"==typeof e&&p.isWebGlConstant(e)){if(20===t.returnType){const n=t.changeCommands&&t.changeCommands[0]||"";return p.stringifyWebGlConstant(e,n)}return e}if(e.length&&"string"!=typeof e){const t=[];for(let n=0;n1?r=this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value):this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.value)===p.RENDERBUFFER.value&&(r=e.getRenderbufferParameter(e.RENDERBUFFER,e.RENDERBUFFER_STENCIL_SIZE))):r=this.readParameterFromContext({constant:p.STENCIL_BITS}),this.currentState[p.STENCIL_BITS.name]=""+r}isValidChangeCommand(e,t){return"enable"===e.name||"disable"===e.name?e.commandArguments[0]===p.STENCIL_TEST.value:"stencilOp"===e.name||"stencilOpSeparate"===e.name?xe.stencilOpStates.indexOf(e.commandArguments[0])>0:"stencilFunc"===e.name||"stencilFuncSeparate"===e.name?xe.stencilFuncStates.indexOf(e.commandArguments[0])>0:"stencilMask"!==e.name&&"stencilMaskSeparate"!==e.name||xe.stencilMaskStates.indexOf(e.commandArguments[0])>0}getConsumeCommands(){return d}isStateEnable(e,t){return this.context.isEnabled(p.STENCIL_TEST.value)}}xe.stateName="StencilState",xe.stencilOpStates=[p.STENCIL_BACK_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_PASS.value,p.STENCIL_FAIL.value,p.STENCIL_PASS_DEPTH_FAIL.value,p.STENCIL_PASS_DEPTH_PASS.value],xe.stencilFuncStates=[p.STENCIL_BACK_FUNC.value,p.STENCIL_BACK_REF.value,p.STENCIL_BACK_VALUE_MASK.value,p.STENCIL_FUNC.value,p.STENCIL_REF.value,p.STENCIL_VALUE_MASK.value],xe.stencilMaskStates=[p.STENCIL_BACK_WRITEMASK.value,p.STENCIL_WRITEMASK.value];class we{static isSupportedCombination(e,t,n){return e=e||p.UNSIGNED_BYTE.value,((t=t||p.RGBA.value)===p.RGB.value||t===p.RGBA.value)&&(n===p.RGB.value||n===p.RGBA.value||n===p.RGBA8.value||n===p.RGBA16F.value||n===p.RGBA32F.value||n===p.RGB16F.value||n===p.RGB32F.value||n===p.R11F_G11F_B10F.value||n===p.SRGB8.value||n===p.SRGB8_ALPHA8.value)&&this.isSupportedComponentType(e)}static readPixels(e,t,n,r,i,s){e.getError(),s===p.UNSIGNED_NORMALIZED.value&&(s=p.UNSIGNED_BYTE.value);const o=r*i*4;let a;if(s===p.UNSIGNED_BYTE.value?a=new Uint8Array(o):(s=p.FLOAT.value,a=new Float32Array(o)),e.readPixels(t,n,r,i,e.RGBA,s,a),e.getError())return;if(s===p.UNSIGNED_BYTE.value)return a;const l=new Uint8Array(r*i*4);for(let e=0;e1){const e=this.context.getParameter(p.MAX_DRAW_BUFFERS.value);for(let n=0;n1?this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value):p.UNSIGNED_BYTE.value;l===p.RENDERBUFFER.value?this.readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,c,u):l===p.TEXTURE.value&&this.readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,c,u)}readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,l,u){let c=0,h=0;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,c=e.samples,h=e.internalFormat,!c&&!we.isSupportedCombination(l,p.RGBA.value,h))return}else s+=r,o+=i;if(r=i=0,c){const a=e,u=e.createRenderbuffer(),c=e.getParameter(e.RENDERBUFFER_BINDING);e.bindRenderbuffer(e.RENDERBUFFER,u),e.renderbufferStorage(e.RENDERBUFFER,h,s,o),e.bindRenderbuffer(e.RENDERBUFFER,c),e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u);const d=a.getParameter(a.READ_FRAMEBUFFER_BINDING),f=a.getParameter(a.DRAW_FRAMEBUFFER_BINDING);a.bindFramebuffer(a.READ_FRAMEBUFFER,t),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,this.captureFrameBuffer),a.blitFramebuffer(0,0,s,o,0,0,s,o,e.COLOR_BUFFER_BIT,e.NEAREST),a.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),a.bindFramebuffer(a.READ_FRAMEBUFFER,d),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,f),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t),e.deleteRenderbuffer(u)}else e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,l,u){let c=0;this.contextVersion>1&&(c=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value));const h=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL.value),d=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE.value);d>0?g[d].name:p.TEXTURE_2D.name;let f=!1,m=l;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,void 0!==e.type&&(m=e.type),f=e.target===p.TEXTURE_2D_ARRAY.name,!we.isSupportedCombination(e.type,e.format,e.internalFormat))return}else s+=r,o+=i;r=i=0,e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),c>0||f?e.framebufferTextureLayer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,u,h,c):e.framebufferTexture2D(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,d||p.TEXTURE_2D.value,u,h),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,d,c,m),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}getCapture(e,t,n,r,i,s,o,l,u){i=Math.floor(i),s=Math.floor(s);const c={attachmentName:t,src:null,textureCubeMapFace:o?g[o].name:null,textureLayer:l,raw:null};if(!this.quickCapture)try{const t=we.readPixels(e,n,r,i,s,u);if(t){c.raw=Ne.encode(t,i,s),this.workingCanvas.width=i,this.workingCanvas.height=s;const e=this.workingContext2D.createImageData(i,s);if(e.data.set(t),this.workingContext2D.putImageData(e,0,0),this.fullCapture)this.captureCanvas.width=this.workingCanvas.width,this.captureCanvas.height=this.workingCanvas.height;else{const e=i/s;e<1?(this.captureCanvas.width=Le.captureBaseSize*e,this.captureCanvas.height=Le.captureBaseSize):e>1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this.captureContext2D.drawImage(this.workingCanvas,0,0,i,s,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",c.src=Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D)}}catch(e){a.warn("Spector can not capture the visual state: "+e)}this.currentState.Attachments.push(c)}analyse(e){}}Le.stateName="VisualState",Le.captureBaseSize=256;class Oe{constructor(e){this.context=e.context,this.captureFrameBuffer=e.context.createFramebuffer(),this.workingCanvas=Fe.createCanvas(1,1),this.workingContext2D=Fe.get2DContext(this.workingCanvas),this.captureCanvas=Fe.createCanvas(1,1),this.captureContext2D=Fe.get2DContext(this.captureCanvas),Fe.setImageSmoothing(this.captureContext2D,!0)}appendTextureState(e,t,n=null,r){if(!t)return;const i=t.__SPECTOR_Object_CustomData;if(i&&(this.fullCapture=r,i.type&&(e.textureType=this.getWebGlConstant(i.type)),i.format&&(e.format=this.getWebGlConstant(i.format)),i.internalFormat&&(e.internalFormat=this.getWebGlConstant(i.internalFormat)),e.width=i.width,e.height=i.height,i.depth&&(e.depth=i.depth),n)){const r="NEAREST"===e.samplerMagFilter||"NEAREST"===e.magFilter,s=this.getTextureVisualState(n,t,i,r);if(s){e.visual=s.visual;for(const t in s.visualPixels)if(s.visualPixels.hasOwnProperty(t)){e.visualPixels=s.visualPixels;break}}}}getTextureVisualState(e,t,n,r){try{const i=this.context,s={},o={};if(!we.isSupportedCombination(n.type,n.format,n.internalFormat))return{visual:s,visualPixels:o};const a=this.context.getParameter(p.FRAMEBUFFER_BINDING.value);i.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer);try{const a=0,l=n.width,u=n.height;if(e===p.TEXTURE_3D&&n.depth){const e=i;for(let c=0;c2&&c2&&c1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}return this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this._setSmoothing(!o),this.captureContext2D.drawImage(this.workingCanvas,0,0,r,i,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",{src:Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D),raw:l}}catch(e){}return{src:void 0,raw:null}}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}_setSmoothing(e){Fe.setImageSmoothing(this.captureContext2D,e)}}Oe.captureBaseSize=64,Oe.cubeMapFaces=[p.TEXTURE_CUBE_MAP_POSITIVE_X,p.TEXTURE_CUBE_MAP_POSITIVE_Y,p.TEXTURE_CUBE_MAP_POSITIVE_Z,p.TEXTURE_CUBE_MAP_NEGATIVE_X,p.TEXTURE_CUBE_MAP_NEGATIVE_Y,p.TEXTURE_CUBE_MAP_NEGATIVE_Z];class Ie{constructor(e){this.context=e.context}getUboValue(e,t,n,r){const i=Ie.uboTypes[r];if(!i)return;const s=new i.arrayBufferView(n*i.lengthMultiplier),o=this.context,a=o.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,e);if(a){const n=o.getIndexedParameter(p.UNIFORM_BUFFER_START.value,e),r=o.getParameter(p.UNIFORM_BUFFER_BINDING.value);try{o.bindBuffer(p.UNIFORM_BUFFER.value,a),o.getBufferSubData(p.UNIFORM_BUFFER.value,n+t,s)}catch(e){return}r&&o.bindBuffer(p.UNIFORM_BUFFER.value,r)}return Array.prototype.slice.call(s)}}Ie.uboTypes={[p.BOOL.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.BOOL_VEC2.value]:{arrayBufferView:Uint8Array,lengthMultiplier:2},[p.BOOL_VEC3.value]:{arrayBufferView:Uint8Array,lengthMultiplier:3},[p.BOOL_VEC4.value]:{arrayBufferView:Uint8Array,lengthMultiplier:4},[p.INT.value]:{arrayBufferView:Int32Array,lengthMultiplier:1},[p.INT_VEC2.value]:{arrayBufferView:Int32Array,lengthMultiplier:2},[p.INT_VEC3.value]:{arrayBufferView:Int32Array,lengthMultiplier:3},[p.INT_VEC4.value]:{arrayBufferView:Int32Array,lengthMultiplier:4},[p.UNSIGNED_INT.value]:{arrayBufferView:Uint32Array,lengthMultiplier:1},[p.UNSIGNED_INT_VEC2.value]:{arrayBufferView:Uint32Array,lengthMultiplier:2},[p.UNSIGNED_INT_VEC3.value]:{arrayBufferView:Uint32Array,lengthMultiplier:3},[p.UNSIGNED_INT_VEC4.value]:{arrayBufferView:Uint32Array,lengthMultiplier:4},[p.FLOAT.value]:{arrayBufferView:Float32Array,lengthMultiplier:1},[p.FLOAT_VEC2.value]:{arrayBufferView:Float32Array,lengthMultiplier:2},[p.FLOAT_VEC3.value]:{arrayBufferView:Float32Array,lengthMultiplier:3},[p.FLOAT_VEC4.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT2x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT3.value]:{arrayBufferView:Float32Array,lengthMultiplier:9},[p.FLOAT_MAT3x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT3x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.FLOAT_MAT4.value]:{arrayBufferView:Float32Array,lengthMultiplier:16},[p.FLOAT_MAT4x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT4x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.SAMPLER_2D.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.SAMPLER_CUBE.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1}};class ke extends S{get typeName(){return"WebGLBuffer"}}class Me extends S{get typeName(){return"WebGLFramebuffer"}}class Pe extends S{get typeName(){return"WebGLProgram"}static saveInGlobalStore(e){const t=D.getWebGlObjectTag(e);t&&(this.store[t.id]=e)}static getFromGlobalStore(e){return this.store[e]}static updateInGlobalStore(e,t){if(!t)return;const n=this.getFromGlobalStore(e);if(!n)return;const r=D.getWebGlObjectTag(n);r&&(D.attachWebGlObjectTag(t,r),this.store[r.id]=t)}}Pe.store={};class Be extends S{get typeName(){return"WebGLQuery"}}class Ue extends S{get typeName(){return"WebGLRenderbuffer"}}class $e extends S{get typeName(){return"WebGLSampler"}}class Ge extends S{get typeName(){return"WebGLShader"}}class Ve extends S{get typeName(){return"WebGLSync"}}class We extends S{get typeName(){return"WebGLTexture"}}class He extends S{get typeName(){return"WebGLTransformFeedback"}}class je extends S{get typeName(){return"WebGLUniformLocation"}}class ze extends S{get typeName(){return"WebGLVertexArrayObject"}}class Xe extends me{get stateName(){return Xe.stateName}get requireStartAndStopStates(){return!1}constructor(e){super(e),this.drawCallTextureInputState=new Oe(e),this.drawCallUboInputState=new Ie(e)}getConsumeCommands(){return d}getChangeCommandsByState(){return{}}readFromContext(){var e,t;const n=this.context.getParameter(p.CURRENT_PROGRAM.value);if(!n)return;this.currentState.frameBuffer=this.readFrameBufferFromContext();const r=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData:x.getProgramData(this.context,n);if(this.currentState.programStatus=Object.assign({},r.programStatus),this.currentState.programStatus.program=this.getSpectorData(n),this.currentState.programStatus.RECOMPILABLE=o.isBuildableProgram(n),this.currentState.programStatus.RECOMPILABLE&&Pe.saveInGlobalStore(n),this.currentState.shaders=r.shaders,(null===(e=this.lastCommandName)||void 0===e?void 0:e.indexOf("Elements"))>=0){const e=this.context.getParameter(this.context.ELEMENT_ARRAY_BUFFER_BINDING);e&&(this.currentState.elementArray={},this.currentState.elementArray.arrayBuffer=this.getSpectorData(e))}const i=this.context.getProgramParameter(n,p.ACTIVE_ATTRIBUTES.value);this.currentState.attributes=[];for(let e=0;e1){const e=this.context.getProgramParameter(n,p.ACTIVE_UNIFORM_BLOCKS.value);this.currentState.uniformBlocks=[];for(let t=0;t1){const e=this.context;t.colorAttachments=[];const n=e.getParameter(p.MAX_DRAW_BUFFERS.value);for(let e=0;e1&&(r.alphaSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE.value),r.blueSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE.value),r.encoding=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.value)),r.componentType=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value)),r.depthSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE.value),r.greenSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE.value),r.redSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_RED_SIZE.value),r.stencilSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value),n===p.TEXTURE.value&&(r.textureLayer=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value))),r}readAttributeFromContext(e,t){const n=this.context.getActiveAttrib(e,t),r=this.context.getAttribLocation(e,n.name);if(-1===r)return{name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:-1};const i=this.context.getVertexAttrib(r,p.CURRENT_VERTEX_ATTRIB.value),s=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING.value),o={name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:r,offsetPointer:this.context.getVertexAttribOffset(r,p.VERTEX_ATTRIB_ARRAY_POINTER.value),bufferBinding:this.getSpectorData(s),enabled:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_ENABLED.value),arraySize:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_SIZE.value),stride:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_STRIDE.value),arrayType:this.getWebGlConstant(this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_TYPE.value)),normalized:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_NORMALIZED.value),vertexAttrib:Array.prototype.slice.call(i)};return this.extensions[p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.extensionName]?o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.value):this.contextVersion>1&&(o.integer=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_INTEGER.value),o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR.value)),this.appendBufferCustomData(o,s),o}readUniformFromContext(e,t){const n=this.context.getActiveUniform(e,t),r=this.context.getUniformLocation(e,n.name);if(r){if(n.size>1&&n.name&&n.name.indexOf("[0]")===n.name.length-3){const t=[];for(let r=0;r1){r.baseLevel=this.context.getTexParameter(t.value,p.TEXTURE_BASE_LEVEL.value),r.immutable=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_FORMAT.value),r.immutableLevels=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_LEVELS.value),r.maxLevel=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LEVEL.value);const e=this.context.getParameter(p.SAMPLER_BINDING.value);if(e){r.sampler=this.getSpectorData(e);const t=this.context;r.samplerMaxLod=t.getSamplerParameter(e,p.TEXTURE_MAX_LOD.value),r.samplerMinLod=t.getSamplerParameter(e,p.TEXTURE_MIN_LOD.value),r.samplerCompareFunc=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_FUNC.value)),r.samplerCompareMode=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_MODE.value)),r.samplerWrapS=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_S.value)),r.samplerWrapT=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_T.value)),r.samplerWrapR=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_R.value)),r.samplerMagFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MAG_FILTER.value)),r.samplerMinFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MIN_FILTER.value))}else r.maxLod=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LOD.value),r.minLod=this.context.getTexParameter(t.value,p.TEXTURE_MIN_LOD.value),r.compareFunc=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_FUNC.value)),r.compareMode=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_MODE.value)),r.wrapR=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_WRAP_R.value))}const i=this.getTextureStorage(t);if(i){const e=this.quickCapture?null:t;this.drawCallTextureInputState.appendTextureState(r,i,e,this.fullCapture)}return this.context.activeTexture(n),r}getTextureStorage(e){return e===p.TEXTURE_2D?this.context.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP?this.context.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):e===p.TEXTURE_3D?this.context.getParameter(p.TEXTURE_BINDING_3D.value):e===p.TEXTURE_2D_ARRAY?this.context.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):void 0}readUniformsFromContextIntoState(e,t,n,r){const i=this.context,s=i.getActiveUniforms(e,t,p.UNIFORM_TYPE.value),o=i.getActiveUniforms(e,t,p.UNIFORM_SIZE.value),a=i.getActiveUniforms(e,t,p.UNIFORM_BLOCK_INDEX.value),l=i.getActiveUniforms(e,t,p.UNIFORM_OFFSET.value),u=i.getActiveUniforms(e,t,p.UNIFORM_ARRAY_STRIDE.value),c=i.getActiveUniforms(e,t,p.UNIFORM_MATRIX_STRIDE.value),h=i.getActiveUniforms(e,t,p.UNIFORM_IS_ROW_MAJOR.value);for(let d=0;d-1&&(t.blockName=i.getActiveUniformBlockName(e,t.blockIndice)),t.offset=l[d],t.arrayStride=u[d],t.matrixStride=c[d],t.rowMajor=h[d],t.blockIndice>-1){const e=r[a[d]].bindingPoint;t.value=this.drawCallUboInputState.getUboValue(e,t.offset,t.size,s[d])}}}readTransformFeedbackFromContext(e,t){const n=this.context,r=n.getTransformFeedbackVarying(e,t),i=n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value,t),s={name:r.name,size:r.size,type:this.getWebGlConstant(r.type),buffer:this.getSpectorData(i),bufferSize:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_SIZE.value,t),bufferStart:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_START.value,t)};return this.appendBufferCustomData(s,i),s}readUniformBlockFromContext(e,t){const n=this.context,r=n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_BINDING.value),i=n.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,r),s={name:n.getActiveUniformBlockName(e,t),bindingPoint:r,size:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_DATA_SIZE.value),activeUniformCount:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_ACTIVE_UNIFORMS.value),vertex:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER.value),fragment:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER.value),buffer:this.getSpectorData(i)};return this.appendBufferCustomData(s,i),s}appendBufferCustomData(e,t){if(t){const n=t.__SPECTOR_Object_CustomData;n&&(n.usage&&(e.bufferUsage=this.getWebGlConstant(n.usage)),e.bufferLength=n.length,n.offset&&(e.bufferOffset=n.offset),n.sourceLength&&(e.bufferSourceLength=n.sourceLength))}}getWebGlConstant(e){const t=g[e];return t?t.name:e}}Xe.stateName="DrawCall",Xe.samplerTypes={[p.SAMPLER_2D.value]:p.TEXTURE_2D,[p.SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.SAMPLER_3D.value]:p.TEXTURE_3D,[p.SAMPLER_2D_SHADOW.value]:p.TEXTURE_2D,[p.SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_2D_ARRAY_SHADOW.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_CUBE_SHADOW.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.UNSIGNED_INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.UNSIGNED_INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.UNSIGNED_INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.UNSIGNED_INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY};class Ke{constructor(e){this.contextInformation=e,this.stateTrackers=[],this.onCommandCapturedCallbacks={},this.initStateTrackers()}startCapture(e,t,n){for(const r of this.stateTrackers){const i=r.startCapture(!0,t,n);r.requireStartAndStopStates&&(e.initState[r.stateName]=i)}}stopCapture(e){for(const t of this.stateTrackers){const n=t.stopCapture();t.requireStartAndStopStates&&(e.endState[t.stateName]=n)}}captureState(e){const t=this.onCommandCapturedCallbacks[e.name];if(t)for(const n of t)n(e)}initStateTrackers(){this.stateTrackers.push(new Ee(this.contextInformation),new ve(this.contextInformation),new Ce(this.contextInformation),new De(this.contextInformation),new Se(this.contextInformation),new Ae(this.contextInformation),new _e(this.contextInformation),new ye(this.contextInformation),new be(this.contextInformation),new Te(this.contextInformation),new Re(this.contextInformation),new xe(this.contextInformation),new Le(this.contextInformation),new Xe(this.contextInformation));for(const e of this.stateTrackers)e.registerCallbacks(this.onCommandCapturedCallbacks)}}class Ye{static initializeByteSizeFormat(){this.byteSizePerInternalFormat||(this.byteSizePerInternalFormat={[p.R8.value]:1,[p.R16F.value]:2,[p.R32F.value]:4,[p.R8UI.value]:1,[p.RG8.value]:2,[p.RG16F.value]:4,[p.RG32F.value]:8,[p.ALPHA.value]:1,[p.RGB.value]:3,[p.RGBA.value]:4,[p.LUMINANCE.value]:1,[p.LUMINANCE_ALPHA.value]:2,[p.DEPTH_COMPONENT.value]:1,[p.DEPTH_STENCIL.value]:2,[p.SRGB_EXT.value]:3,[p.SRGB_ALPHA_EXT.value]:4,[p.RGB8.value]:3,[p.SRGB8.value]:3,[p.RGB565.value]:2,[p.R11F_G11F_B10F.value]:4,[p.RGB9_E5.value]:2,[p.RGB16F.value]:6,[p.RGB32F.value]:12,[p.RGB8UI.value]:3,[p.RGBA8.value]:4,[p.RGB5_A1.value]:2,[p.RGBA16F.value]:8,[p.RGBA32F.value]:16,[p.RGBA8UI.value]:4,[p.COMPRESSED_R11_EAC.value]:4,[p.COMPRESSED_SIGNED_R11_EAC.value]:4,[p.COMPRESSED_RG11_EAC.value]:4,[p.COMPRESSED_SIGNED_RG11_EAC.value]:4,[p.COMPRESSED_RGB8_ETC2.value]:4,[p.COMPRESSED_RGBA8_ETC2_EAC.value]:4,[p.COMPRESSED_SRGB8_ETC2.value]:4,[p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC.value]:4,[p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_RGB_S3TC_DXT1_EXT.value]:.5,[p.COMPRESSED_RGBA_S3TC_DXT3_EXT.value]:1,[p.COMPRESSED_RGBA_S3TC_DXT5_EXT.value]:1,[p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGB_ETC1_WEBGL.value]:.5,[p.COMPRESSED_RGB_ATC_WEBGL.value]:.5,[p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL.value]:1,[p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL.value]:1})}constructor(e){this.options=e,this.createCommandNames=this.getCreateCommandNames(),this.updateCommandNames=this.getUpdateCommandNames(),this.deleteCommandNames=this.getDeleteCommandNames(),this.startTime=u.now,this.memoryPerSecond={},this.totalMemory=0,this.frameMemory=0,this.capturing=!1,Ye.initializeByteSizeFormat()}registerCallbacks(e){for(const t of this.createCommandNames)e[t]=e[t]||[],e[t].push(this.createWithoutSideEffects.bind(this));for(const t of this.updateCommandNames)e[t]=e[t]||[],e[t].push(this.updateWithoutSideEffects.bind(this));for(const t of this.deleteCommandNames)e[t]=e[t]||[],e[t].push(this.deleteWithoutSideEffects.bind(this))}startCapture(){this.frameMemory=0,this.capturing=!0}stopCapture(){this.frameMemory=0,this.capturing=!1}appendRecordedInformation(e){e.frameMemory[this.objectName]=this.frameMemory,e.memory[this.objectName]=this.memoryPerSecond}create(e){}createWithoutSideEffects(e){this.options.toggleCapture(!1);try{this.create(e)}finally{this.options.toggleCapture(!0)}}updateWithoutSideEffects(e){if(e&&0!==e.arguments.length){this.options.toggleCapture(!1);try{const t=e.arguments[0],n=this.getBoundInstance(t);if(!n)return;if(!D.getWebGlObjectTag(n))return;const r=this.getWebGlConstant(t),i=this.update(e,r,n);this.changeMemorySize(i)}finally{this.options.toggleCapture(!0)}}}deleteWithoutSideEffects(e){if(!e||!e.arguments||e.arguments.length<1)return;const t=e.arguments[0];if(t){this.options.toggleCapture(!1);try{const e=this.delete(t);this.changeMemorySize(-e)}finally{this.options.toggleCapture(!0)}}}changeMemorySize(e){this.totalMemory+=e,this.capturing&&(this.frameMemory+=e);const t=u.now-this.startTime,n=Math.round(t/1e3);this.memoryPerSecond[n]=this.totalMemory}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}getByteSizeForInternalFormat(e){return Ye.byteSizePerInternalFormat[e]||4}readPixelStoreState(){const e=this.options.context,t={UNPACK_FLIP_Y_WEBGL:e.getParameter(p.UNPACK_FLIP_Y_WEBGL.value),UNPACK_PREMULTIPLY_ALPHA_WEBGL:e.getParameter(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL.value),UNPACK_COLORSPACE_CONVERSION_WEBGL:e.getParameter(p.UNPACK_COLORSPACE_CONVERSION_WEBGL.value),UNPACK_ALIGNMENT:e.getParameter(p.UNPACK_ALIGNMENT.value)};return e instanceof WebGL2RenderingContext&&(t.UNPACK_ROW_LENGTH=e.getParameter(p.UNPACK_ROW_LENGTH.value),t.UNPACK_IMAGE_HEIGHT=e.getParameter(p.UNPACK_IMAGE_HEIGHT.value),t.UNPACK_SKIP_PIXELS=e.getParameter(p.UNPACK_SKIP_PIXELS.value),t.UNPACK_SKIP_ROWS=e.getParameter(p.UNPACK_SKIP_ROWS.value),t.UNPACK_SKIP_IMAGES=e.getParameter(p.UNPACK_SKIP_IMAGES.value)),t}}class qe extends Ye{get objectName(){return"Buffer"}getCreateCommandNames(){return["createBuffer"]}getUpdateCommandNames(){return["bufferData"]}getDeleteCommandNames(){return["deleteBuffer"]}getBoundInstance(e){const t=this.options.context;return e===p.ARRAY_BUFFER.value?t.getParameter(p.ARRAY_BUFFER_BINDING.value):e===p.ELEMENT_ARRAY_BUFFER.value?t.getParameter(p.ELEMENT_ARRAY_BUFFER_BINDING.value):e===p.COPY_READ_BUFFER.value?t.getParameter(p.COPY_READ_BUFFER_BINDING.value):e===p.COPY_WRITE_BUFFER.value?t.getParameter(p.COPY_WRITE_BUFFER_BINDING.value):e===p.TRANSFORM_FEEDBACK_BUFFER.value?t.getParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value):e===p.UNIFORM_BUFFER.value?t.getParameter(p.UNIFORM_BUFFER_BINDING.value):e===p.PIXEL_PACK_BUFFER.value?t.getParameter(p.PIXEL_PACK_BUFFER_BINDING.value):e===p.PIXEL_UNPACK_BUFFER.value?t.getParameter(p.PIXEL_UNPACK_BUFFER_BINDING.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(t,e);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){const n=this.getLength(t);return t.arguments.length>=4?{target:e,length:n,usage:t.arguments[2],offset:t.arguments[3],sourceLength:t.arguments[1]?t.arguments[1].length:-1}:3===t.arguments.length?{target:e,length:n,usage:t.arguments[2]}:void 0}getLength(e){const t=e.arguments[1],n=e.arguments[3],r=e.arguments[4];if("number"==typeof t)return t;if("number"==typeof r&&r>0)return r;const i=t.byteLength||t.length||0;return"number"==typeof n&&n>0?i-n:i}}class Qe extends Ye{get objectName(){return"Renderbuffer"}getCreateCommandNames(){return["createRenderbuffer"]}getUpdateCommandNames(){return["renderbufferStorage","renderbufferStorageMultisample"]}getDeleteCommandNames(){return["deleteRenderbuffer"]}getBoundInstance(e){const t=this.options.context;if(e===p.RENDERBUFFER.value)return t.getParameter(p.RENDERBUFFER_BINDING.value)}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(e,t);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return r.length=r.width*r.height*this.getByteSizeForInternalFormat(r.internalFormat),n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){return 4===e.arguments.length?{target:t,internalFormat:e.arguments[1],width:e.arguments[2],height:e.arguments[3],length:0,samples:0}:{target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,samples:e.arguments[1]}}}class Ze extends Ye{get objectName(){return"Texture2d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage2D","compressedTexImage2D","texStorage2D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D.value?t.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP_POSITIVE_X.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Y.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Z.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_X.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Y.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Z.value?t.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target===p.TEXTURE_2D_ARRAY.name||t.target===p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else{const e="TEXTURE_2D"===t?1:6;let n=r.internalFormat;n===p.RGBA.value&&(r.type===p.FLOAT.value&&(n=p.RGBA32F.value),r.type===p.HALF_FLOAT_OES.value&&(n=p.RGBA16F.value)),r.length=r.width*r.height*e*this.getByteSizeForInternalFormat(n)}return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage2D"===e.name?this.getTexImage2DCustomData(e,t,n):"compressedTexImage2D"===e.name?this.getCompressedTexImage2DCustomData(e,t,n):"texStorage2D"===e.name?this.getTexStorage2DCustomData(e,t,n):void 0}getTexStorage2DCustomData(e,t,n){let r;return 5===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!1}),r}getCompressedTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=7&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!0}),r}getTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8?r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],format:e.arguments[6],type:e.arguments[7],length:0,isCompressed:!1}:6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[5].width,height:e.arguments[5].height,format:e.arguments[3],type:e.arguments[4],length:0,isCompressed:!1}),r}}class Je extends Ye{get objectName(){return"Texture3d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage3D","compressedTexImage3D","texStorage3D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D_ARRAY.value?t.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):e===p.TEXTURE_3D.value?t.getParameter(p.TEXTURE_BINDING_3D.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target!==p.TEXTURE_2D_ARRAY.name&&t.target!==p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){if(e.arguments.length>=2&&0!==e.arguments[1])return 0;const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else r.length=r.width*r.height*r.depth*this.getByteSizeForInternalFormat(r.internalFormat);return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage3D"===e.name?this.getTexImage3DCustomData(e,t,n):"compressedTexImage3D"===e.name?this.getCompressedTexImage3DCustomData(e,t,n):"texStorage3D"===e.name?this.getTexStorage3DCustomData(e,t,n):void 0}getTexStorage3DCustomData(e,t,n){let r;return 6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!1}),r}getCompressedTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!0}),r}getTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=9&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],format:e.arguments[7],type:e.arguments[8],length:0,isCompressed:!1}),r}}class et extends Ye{get objectName(){return"Program"}getCreateCommandNames(){return["createProgram"]}getUpdateCommandNames(){return["linkProgram"]}getDeleteCommandNames(){return["deleteProgram"]}getBoundInstance(e){return e}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){if(e.arguments.length>=1&&!e.arguments[0])return 0;const r=this.getCustomData(n);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e){const t=this.options.context;return x.getProgramData(t,e)}}class tt{constructor(e){this.contextInformation=e,this.onCommandCallbacks={},this.recorders=[],this.initRecorders()}recordCommand(e){const t=this.onCommandCallbacks[e.name];if(t)for(const n of t)n(e)}startCapture(){for(const e of this.recorders)e.startCapture()}stopCapture(){for(const e of this.recorders)e.stopCapture()}appendRecordedInformation(e){for(const t of this.recorders)t.appendRecordedInformation(e)}initRecorders(){this.recorders.push(new qe(this.contextInformation),new Qe(this.contextInformation),new Ze(this.contextInformation),new Je(this.contextInformation),new et(this.contextInformation));for(const e of this.recorders)e.registerCallbacks(this.onCommandCallbacks)}}class nt{constructor(e){this.contextInformation=e,this.webGlObjects=[],this.initWebglObjects()}tagWebGlObjects(e){for(const t of this.webGlObjects){for(let n=0;n0&&this.currentCapture.commands.length===this.maxCommands&&this.onMaxCommand.trigger(this)}}}spyContext(e){const t=[];for(const n in e)n&&t.push(n);for(let n=0;n{this.spyRequestAnimationFrame("requestAnimationFrame",e.display)})}spyRequestAnimationFrame(e,t){const n=this;y.storeOriginFunction(t,e),t[e]=function(){const r=arguments[0],i=n.getCallback(n,r,()=>{n.spiedScope[e](r)});return y.executeOriginFunction(t,e,[i])}}spySetTimer(e){const t=this,n=this.spiedScope,r="setTimeout"===e;y.storeOriginFunction(n,e),n[e]=function(){const i=arguments[0],s=arguments[1],o=Array.prototype.slice.call(arguments);return at.setTimerCommonValues.indexOf(s)>-1&&(o[0]=t.getCallback(t,i,r?()=>{n[e](i)}:null)),y.executeOriginFunction(n,e,o)}}getCallback(e,t,n=null){return function(){const r=u.now;if(e.lastFrame=++e.lastFrame%e.speedRatio,e.willPlayNextFrame||e.speedRatio&&!e.lastFrame){try{e.onFrameStart.trigger(e)}catch(t){e.onError.trigger(t)}try{t.apply(e.spiedScope,arguments)}catch(t){e.onError.trigger(t)}e.lastSixtyFramesCurrentIndex=(e.lastSixtyFramesCurrentIndex+1)%at.fpsWindowSize,e.lastSixtyFramesDuration[e.lastSixtyFramesCurrentIndex]=r-e.lastSixtyFramesPreviousStart;try{e.onFrameEnd.trigger(e)}catch(t){e.onError.trigger(t)}e.willPlayNextFrame=!1}else n&&n();e.lastSixtyFramesPreviousStart=r}}}at.requestAnimationFrameFunctions=["requestAnimationFrame","msRequestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame"],at.setTimerFunctions=["setTimeout","setInterval"],at.setTimerCommonValues=[0,15,16,33,32,40],at.fpsWindowSize=60;class lt{constructor(e){this.canvas=e,this.onContextRequested=new l,this.init()}init(){const e=this,t=function(){const t="undefined"!=typeof HTMLCanvasElement&&this instanceof HTMLCanvasElement?HTMLCanvasElement:OffscreenCanvas,n=e.canvas?y.executeOriginFunction(this,"getContext",arguments):y.executePrototypeOriginFunction(this,t,"getContext",arguments);if(arguments.length>0){const e=arguments[0];if("webgl"!==e&&"experimental-webgl"!==e&&"webgl2"!==e&&"experimental-webgl2"!==e)return n}if(n){const t=Array.prototype.slice.call(arguments),r="webgl2"===t[0]||"experimental-webgl2"===t[0]?2:1;e.onContextRequested.trigger({context:n,contextVersion:r})}return n};this.canvas?(y.storeOriginFunction(this.canvas,"getContext"),this.canvas.getContext=t):("undefined"!=typeof HTMLCanvasElement&&(y.storePrototypeOriginFunction(HTMLCanvasElement,"getContext"),HTMLCanvasElement.prototype.getContext=t),"undefined"!=typeof OffscreenCanvas&&(y.storePrototypeOriginFunction(OffscreenCanvas,"getContext"),OffscreenCanvas.prototype.getContext=t))}}class ut{static startIntercepting(e){if(ut.intercepting)return;if("undefined"==typeof Worker)return;ut.workerBundleUrl=e,ut.originalWorkerConstructor=Worker,ut.intercepting=!0;const t=Worker;globalThis.Worker=function(e,n){if(n&&"module"===n.type)return new t(e,n);const r=e.toString();try{let i;try{i=new URL(r,location.href).href}catch(r){return new t(e,n)}const s=new XMLHttpRequest;if(s.open("GET",i,!1),s.send(),200===s.status&&ut.shouldInjectSource(s.responseText)){const e=ut.rewriteImportScripts(s.responseText,i),o="(function(){\n var __spectorBase = "+JSON.stringify(i)+';\n self.__SPECTOR_workerBaseUrl = __spectorBase;\n function __spectorResolve(u) {\n if (u == null) return u;\n if (typeof u !== "string") {\n if (u instanceof URL) return u;\n try { u = String(u); } catch (e) { return u; }\n }\n if (/^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i.test(u)) return u;\n try { return new URL(u, __spectorBase).href; }\n catch (e) { return u; }\n }\n self.__SPECTOR_resolveWorkerUrl = __spectorResolve;\n var __origImportScripts = self.importScripts;\n if (typeof __origImportScripts === "function") {\n self.importScripts = function() {\n var args = new Array(arguments.length);\n for (var i = 0; i < arguments.length; i++) args[i] = __spectorResolve(arguments[i]);\n return __origImportScripts.apply(self, args);\n };\n }\n var __origFetch = self.fetch;\n if (typeof __origFetch === "function") {\n self.fetch = function(input, init) {\n try {\n if (typeof input === "string") {\n input = __spectorResolve(input);\n } else if (input && typeof input === "object" && "url" in input && typeof Request === "function") {\n var r = input;\n var resolved = __spectorResolve(r.url);\n if (resolved !== r.url) input = new Request(resolved, r);\n }\n } catch (e) { /* fall through with original input */ }\n return __origFetch.call(self, input, init);\n };\n }\n if (typeof XMLHttpRequest === "function" && XMLHttpRequest.prototype && XMLHttpRequest.prototype.open) {\n var __origXhrOpen = XMLHttpRequest.prototype.open;\n XMLHttpRequest.prototype.open = function(method, url) {\n var args = Array.prototype.slice.call(arguments);\n args[1] = __spectorResolve(url);\n return __origXhrOpen.apply(this, args);\n };\n }\n if (typeof Worker === "function") {\n var __OrigWorker = Worker;\n self.Worker = function(scriptURL, options) {\n var resolved = __spectorResolve(scriptURL);\n return new __OrigWorker(resolved, options);\n };\n self.Worker.prototype = __OrigWorker.prototype;\n }\n})();\n',a="importScripts("+JSON.stringify(ut.workerBundleUrl)+");\n",l=new Blob([o+a+e],{type:"application/javascript"}),u=URL.createObjectURL(l),c=new t(u,n);return ut.spiedWorkers.push({worker:c,originalUrl:r}),c}}catch(e){console.warn("[Spector.js] Could not inject into Worker ("+r+"):",e)}const i=new t(e,n);return ut.spiedWorkers.push({worker:i,originalUrl:r}),i},globalThis.Worker.prototype=t.prototype}static stopIntercepting(){ut.intercepting&&(globalThis.Worker=ut.originalWorkerConstructor,ut.intercepting=!1)}static rewriteImportScripts(e,t){const n=/(['"`])((?:\\.|(?!\1).)*)\1/g;return e.replace(/importScripts\s*\(([^)]*)\)/g,(e,r)=>"importScripts("+r.replace(n,(e,n,r)=>{if("`"===n&&-1!==r.indexOf("${"))return e;let i;try{i=new URL(r,t).href}catch(t){return e}return n+i+n})+")")}static shouldInjectSource(e){return!/\bimport\s*(?:\/\*[\s\S]*?\*\/\s*)?\(/.test(e)&&!/\bnew\s+(?:(?:self|globalThis)\s*\.\s*)?(?:Worker|SharedWorker)\s*\(/.test(e)}static getSpiedWorkers(){return ut.spiedWorkers}static isIntercepting(){return ut.intercepting}}ut.spiedWorkers=[],ut.intercepting=!1;class ct{static getDelay(){return ct.delayMs}static setDelay(e){ct.delayMs="number"==typeof e&&e>0?e:0}static shouldForceIncomplete(e,t,n,r){return!(r<=0)&&e===p.COMPLETION_STATUS_KHR.value&&void 0!==t&&n-tthis._state,this.subscribe=e=>(this._listeners.add(e),()=>{this._listeners.delete(e)}),this._state=e}setState(e){this._state=e(this._state),this._emitChange()}setSnapshot(e){this._state=e,this._emitChange()}_emitChange(){for(const e of this._listeners)e()}}function pt(e){return(0,dt.useSyncExternalStore)(e.subscribe,e.getSnapshot)}var mt=n(848);const gt=(0,dt.createContext)(null);function Et(){const e=(0,dt.useContext)(gt);if(!e)throw new Error("CaptureMenuContext not provided — CaptureMenuRoot must be rendered inside CaptureMenuContext.Provider");return e}function vt({canvas:e}){const t=Et();return(0,mt.jsx)("li",{onClick:()=>t.handleCanvasSelected(e),children:(0,mt.jsx)("span",{children:`Id: ${e.id} - Size: ${e.width}*${e.height}`})})}function Ct(){const e=Et(),t=pt(e.store),n=t.selectedCanvas?`${t.selectedCanvas.id} (${t.selectedCanvas.width}*${t.selectedCanvas.height})`:"Choose Canvas...";return(0,mt.jsxs)("div",{className:"canvasListComponent",children:[(0,mt.jsx)("span",{commandName:"onCanvasSelection",onClick:e.handleCanvasListToggle,children:n}),(0,mt.jsx)("ul",{style:{display:t.showCanvasList?"block":"none",visibility:t.showCanvasList?"visible":"hidden"},children:t.canvases.map((e,t)=>(0,mt.jsx)(vt,{canvas:e},e.id||t))})]})}function Dt(){const e=Et(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"captureMenuActionsComponent",children:[(0,mt.jsx)("div",{commandName:"onCaptureRequested",onClick:e.handleCaptureRequested}),t.isPlaying?(0,mt.jsx)("div",{commandName:"onPauseRequested",onClick:e.handlePauseRequested}):(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("div",{commandName:"onPlayRequested",onClick:e.handlePlayRequested}),(0,mt.jsx)("div",{commandName:"onPlayNextFrameRequested",onClick:e.handlePlayNextFrameRequested})]})]})}function St(){const e=pt(Et().store);return(0,mt.jsxs)("span",{className:"fpsCounterComponent",children:[e.fps.toFixed(2)," Fps"]})}function At(){const e=pt(Et().store);return(0,mt.jsxs)("div",{children:[(0,mt.jsxs)("div",{className:"captureMenuComponent "+(e.visible?"active":""),children:[(0,mt.jsx)(Ct,{}),(0,mt.jsx)(Dt,{}),(0,mt.jsx)(St,{})]}),(0,mt.jsx)("div",{className:"captureMenuLogComponent "+(e.logVisible?"active":""),children:(0,mt.jsx)("span",{className:e.logLevel===i.error?"error":"",children:e.logText})})]})}class _t{constructor(e={}){this.options=e,this.handleCanvasListToggle=()=>{this.store.getSnapshot(),this.store.setState(e=>Object.assign(Object.assign({},e),{selectedCanvas:null,showCanvasList:!e.showCanvasList,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!e.showCanvasList&&!this._hideLog})),this.onCanvasSelected.trigger(null),this._isTrackingCanvas&&this.trackPageCanvases()},this.handleCanvasSelected=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{selectedCanvas:e,showCanvasList:!1,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)},this.handleCaptureRequested=()=>{const e=this.getSelectedCanvasInformation();e&&this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.PleaseWaitHelpText,logVisible:!this._hideLog})),setTimeout(()=>{this.onCaptureRequested.trigger(e)},200)},this.handlePauseRequested=()=>{this.onPauseRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!1}))},this.handlePlayRequested=()=>{this.onPlayRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!0}))},this.handlePlayNextFrameRequested=()=>{this.onPlayNextFrameRequested.trigger(this.getSelectedCanvasInformation())},this._rootPlaceHolder=e.rootPlaceHolder||document.body,this._hideLog=!!e.hideLog,this._isTrackingCanvas=!1,this._extraCanvasEntries=[],this.onCanvasSelected=new l,this.onCaptureRequested=new l,this.onPauseRequested=new l,this.onPlayRequested=new l,this.onPlayNextFrameRequested=new l,this.store=new ft({visible:!0,logText:_t.SelectCanvasHelpText,logLevel:i.info,logVisible:!this._hideLog,canvases:[],selectedCanvas:null,showCanvasList:!1,isPlaying:!0,fps:0}),this._container=document.createElement("div"),this._container.className="spector-react-capture-menu",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(gt.Provider,{value:this},(0,dt.createElement)(At)))}getSelectedCanvasInformation(){return this.store.getSnapshot().selectedCanvas}trackPageCanvases(){if(this._isTrackingCanvas=!0,document.body){const e=document.body.querySelectorAll("canvas");this.updateCanvasesList(e)}}updateCanvasesList(e){const t=[];for(let n=0;nObject.assign(Object.assign({},n),{canvases:t,selectedCanvas:e,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}captureComplete(e){e?this.store.setState(t=>Object.assign(Object.assign({},t),{logLevel:i.error,logText:e,logVisible:!this._hideLog})):this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog}))}setFPS(e){this.store.setState(t=>Object.assign(Object.assign({},t),{fps:e}))}_updateCanvasesInternal(e){for(const t of this._extraCanvasEntries)e.push(t);this.store.getSnapshot().showCanvasList?this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e})):1===e.length?(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:e[0],logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e[0])):(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:null,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(null))}}_t.SelectCanvasHelpText="Please, select a canvas in the list above.",_t.ActionsHelpText="Record with the red button, you can also pause or continue playing the current scene.",_t.PleaseWaitHelpText="Capturing, be patient (this can take up to 3 minutes)...";const yt=(0,dt.createContext)(null);function bt(){const e=(0,dt.useContext)(yt);if(!e)throw new Error("ResultViewContext not provided — ResultViewRoot must be rendered inside ResultViewContext.Provider");return e}function Tt(){const e=bt(),t=pt(e.store),n=(0,dt.useRef)(null),r=(0,dt.useCallback)(e=>{e.preventDefault();const t=e.currentTarget.parentElement,n=t.parentElement;if(!n)return;const r=n.querySelectorAll("li:not(.resultViewMenuSmall)");if("true"===t.getAttribute("open")){t.setAttribute("open","false");for(let e=0;e{e.handleSearchTextChange(t.target.value)},[e]),s=(0,dt.useCallback)(t=>{t.stopPropagation(),e.handleSearchTextChange("")},[e]),o=(0,dt.useCallback)(t=>n=>{n.preventDefault(),e.handleMenuStatusChange(t)},[e]),a=(0,dt.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),e.handleClose()},[e]);return(0,mt.jsxs)("ul",{className:"resultViewMenuComponent",ref:n,children:[(0,mt.jsx)("li",{className:"resultViewMenuOpen resultViewMenuSmall",children:(0,mt.jsx)("a",{href:"#",role:"button",onClick:r,children:"Menu"})}),(0,mt.jsxs)("li",{className:"searchContainer",children:[(0,mt.jsx)("input",{type:"text",placeholder:"Search...",value:t.searchText,commandName:"onSearchTextChanged",commandEventBinding:"change",onChange:i}),(0,mt.jsx)("a",{className:"clearSearch",commandName:"onSearchTextCleared",onClick:s,children:"X"})]}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:0===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCapturesClicked",onClick:o(0),children:"Captures"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:10===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInformationClicked",onClick:o(10),children:"Information"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:20===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInitStateClicked",onClick:o(20),children:"Init State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:40===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCommandsClicked",onClick:o(40),children:"Commands"+(t.commandCount>0?" ("+t.commandCount+")":"")})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:60===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCompareClicked",onClick:o(60),children:"Compare"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:30===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onEndStateClicked",onClick:o(30),children:"End State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{role:"button",commandName:"onCloseClicked",onClick:a,children:"Close"})})]})}function Rt({children:e}){return(0,mt.jsx)("div",{className:"resultViewContentComponent",children:e})}function xt({capture:e,active:t,onCaptureSelected:n,onSaveRequested:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),r()},[r]),s=(0,dt.useCallback)(()=>{n()},[n]),o=new Date(e.startTime).toTimeString().split(" ")[0];return(0,mt.jsxs)("li",{className:t?"active":"",onClick:s,children:[e.endState.VisualState.Attachments?e.endState.VisualState.Attachments.map((e,t)=>(0,mt.jsx)("img",{src:encodeURI(e.src)},t)):(0,mt.jsx)("span",{children:e.endState.VisualState.FrameBufferStatus}),(0,mt.jsxs)("span",{children:[o,(0,mt.jsx)("a",{href:"#",className:"captureListItemSave",commandName:"onSaveRequested",onClick:i})]})]})}function wt({active:e,captures:t,onCaptureSelected:n,onSaveRequested:r,onCaptureLoaded:i}){const s=(0,dt.useRef)(null),o=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault()},[]),l=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),function(e,t){let n=null;if(e&&e.dataTransfer&&e.dataTransfer.files&&(n=e.dataTransfer.files),e&&e.target&&e.target.files&&(n=e.target.files),n&&n.length>0)for(let e=0;e{a.error("Error while reading file: "+r.name+e)},i.onload=e=>{try{const n=JSON.parse(e.target.result);t(n)}catch(e){a.error("Error while reading file: "+r.name+e)}},i.readAsText(r)}}(e.nativeEvent,i)},[i]);return(0,mt.jsxs)("div",{className:"captureListComponent "+(e?"active":""),children:[(0,mt.jsx)("div",{className:"openCaptureFile",ref:s,onDragEnter:o,onDragOver:o,onDrop:l,children:(0,mt.jsx)("span",{children:"Drag files here to open a previously saved capture."})}),(0,mt.jsx)("ul",{children:t.map((e,t)=>(0,mt.jsx)(xt,{capture:e.capture,active:e.active,onCaptureSelected:()=>n(t),onSaveRequested:()=>r(e.capture)},t))})]})}function Ft({children:e}){return(0,mt.jsx)("div",{className:"visualStateListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Nt({item:e,onVisualStateSelected:t}){const n=(0,dt.useRef)(null);(0,dt.useEffect)(()=>{e.active&&n.current&&setTimeout(()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const r=(0,dt.useCallback)(()=>{t()},[t]),i=e.VisualState;return(0,mt.jsxs)("li",{ref:n,className:e.active?"active":"",onClick:r,commandName:"onVisualStateSelected",children:[i.Attachments?i.Attachments.map((e,t)=>e.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{src:encodeURI(e.src)}),i.Attachments.length>1&&(0,mt.jsx)("span",{children:e.attachmentName}),!!e.textureLayer&&(0,mt.jsx)("span",{children:"Layer: "+e.textureLayer}),!!e.textureCubeMapFace&&(0,mt.jsx)("span",{children:e.textureCubeMapFace})]},t):null):(0,mt.jsx)("span",{children:i.FrameBufferStatus}),(0,mt.jsx)("span",{children:i.FrameBuffer?"Frame buffer: "+i.FrameBuffer.__SPECTOR_Object_TAG.id:"Canvas frame buffer"})]})}function Lt({children:e}){return(0,mt.jsx)("div",{className:"commandListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Ot({command:e,onCommandSelected:t,onVertexSelected:n,onFragmentSelected:r,onShaderSelected:i}){var s;const o=(0,dt.useRef)(null),a=e.capture,l=function(e){switch(e){case 50:return"deprecated";case 10:return"unused";case 20:return"disabled";case 30:return"redundant";case 40:return"valid";default:return"unknown"}}(a.status),u=!!a.VisualState;let c="";u&&(c=" drawCall"),e.active&&(c=" active"),(0,dt.useEffect)(()=>{e.active&&o.current&&setTimeout(()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const h=(0,dt.useCallback)(e=>{t()},[t]),d=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==n||n()},[n]),f=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==r||r()},[r]),p=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==i||i()},[i]);let m=null;if(u&&"clear"!==a.name)try{const e=a.DrawCall.shaders[0],t=a.DrawCall.shaders[1];m=(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("a",{href:"#",onClick:d,children:e.name}),(0,mt.jsx)("a",{href:"#",onClick:f,children:t.name})]})}catch(e){}const g=(null===(s=a.shader)||void 0===s?void 0:s.source)?(0,mt.jsx)("a",{href:"#",commandName:"onShaderSourceSelected",onClick:p,children:"Source"}):null;return(0,mt.jsxs)("li",{ref:o,className:c,onClick:h,commandName:"onCommandSelected",children:[a.marker&&(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.marker+" "}),"LOG"===a.name?(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.text+" "}):(0,mt.jsx)("span",{dangerouslySetInnerHTML:{__html:a.text.replace(a.name,`${a.name}`)}}),g,m]})}function It({children:e}){return(0,mt.jsx)("div",{className:"commandDetailComponent",children:e})}function kt({left:e,children:t}){return(0,mt.jsx)("div",{className:e?"informationColumnLeftComponent":"informationColumnRightComponent",children:t})}function Mt({children:e}){return(0,mt.jsx)("div",{className:"jsonContentComponent",children:e})}function Pt(e,t,n,r){return{row:Math.max(0,parseInt(t,10)-1),column:n?Math.max(0,parseInt(n,10)-1):0,text:r.trim()||e,type:e.toLowerCase()}}var Bt,Ut,$t=Object.create,Gt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor,Wt=Object.getOwnPropertyNames,Ht=Object.getPrototypeOf,jt=Object.prototype.hasOwnProperty,zt=e=>{throw TypeError(e)},Xt=(e,t)=>{for(var n in t)Gt(e,n,{get:t[n],enumerable:!0})},Kt=(e,t,n)=>(((e,t)=>{t.has(e)||zt("Cannot access private method")})(e,t),n),Yt=(Bt=e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=/\r\n|[\n\r\u2028\u2029]/;e.codeFrameColumns=function(e,n,r={}){let i=new Proxy({},{get:()=>e=>e}),s=e.split(t),{start:o,end:a,markerLines:l}=function(e,t,n){let r=Object.assign({column:0,line:-1},e.start),i=Object.assign({},r,e.end),{linesAbove:s=2,linesBelow:o=3}=n||{},a=r.line,l=r.column,u=i.line,c=i.column,h=Math.max(a-(s+1),0),d=Math.min(t.length,u+o);-1===a&&(h=0),-1===u&&(d=t.length);let f=u-a,p={};if(f)for(let e=0;e<=f;e++){let n=e+a;if(l)if(0===e){let e=t[n-1].length;p[n]=[l,e-l+1]}else if(e===f)p[n]=[0,c];else{let r=t[n-e].length;p[n]=[0,r]}else p[n]=!0}else p[a]=l===c?!l||[l,0]:[l,c-l];return{start:h,end:d,markerLines:p}}(n,s,r),u=n.start&&"number"==typeof n.start.column,c=String(a).length,h=e.split(t,a).slice(o,a).map((e,t)=>{let n=o+1+t,s=` ${` ${n}`.slice(-c)} |`,a=l[n],u=!l[n+1];if(a){let t="";if(Array.isArray(a)){let n=e.slice(0,Math.max(a[0]-1,0)).replace(/[^\t]/g," "),o=a[1]||1;t=["\n ",i.gutter(s.replace(/\d/g," "))," ",n,i.marker("^").repeat(o)].join(""),u&&r.message&&(t+=" "+i.message(r.message))}return[i.marker(">"),i.gutter(s),e.length>0?` ${e}`:"",t].join("")}return` ${i.gutter(s)}${e.length>0?` ${e}`:""}`}).join("\n");return r.message&&!u&&(h=`${" ".repeat(c+1)}${r.message}\n${h}`),h}},()=>(Ut||Bt((Ut={exports:{}}).exports),Ut.exports));Xt({},{__debug:()=>Hs,check:()=>Vs,doc:()=>vs,format:()=>Gs,formatWithCursor:()=>$s,getSupportInfo:()=>Ws,util:()=>_s,version:()=>As});var qt=(e,t,n,r)=>{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Qt=class{diff(e,t,n={}){let r;"function"==typeof n?(r=n,n={}):"callback"in n&&(r=n.callback);let i=this.castInput(e,n),s=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),a=this.removeEmpty(this.tokenize(s,n));return this.diffWithOptionsObj(o,a,n,r)}diffWithOptionsObj(e,t,n,r){var i;let s=e=>(e=this.postProcess(e,n),r?void setTimeout(function(){r(e)},0):e),o=t.length,a=e.length,l=1,u=o+a;null!=n.maxEditLength&&(u=Math.min(u,n.maxEditLength));let c=null!==(i=n.timeout)&&void 0!==i?i:1/0,h=Date.now()+c,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=a&&f+1>=o)return s(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,g=()=>{for(let r=Math.max(p,-l);r<=Math.min(m,l);r+=2){let i,l=d[r-1],u=d[r+1];l&&(d[r-1]=void 0);let c=!1;if(u){let e=u.oldPos-r;c=u&&0<=e&&e=a&&f+1>=o)return s(this.buildValues(i.lastComponent,t,e))||!0;d[r]=i,i.oldPos+1>=a&&(m=Math.min(m,r-1)),f+1>=o&&(p=Math.max(p,r+1))}else d[r]=void 0}l++};if(r)!function e(){setTimeout(function(){if(l>u||Date.now()>h)return r(void 0);g()||e()},0)}();else for(;l<=u&&Date.now()<=h;){let e=g();if(e)return e}}addToPath(e,t,n,r,i){let s=e.lastComponent;return s&&!i.oneChangePerToken&&s.added===t&&s.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:s.count+1,added:t,removed:n,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:s}}}extractCommon(e,t,n,r,i){let s=t.length,o=n.length,a=e.oldPos,l=a-r,u=0;for(;l+1e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(a,a+e.count));a+=e.count,e.added||(l+=e.count)}}return i}},Zt=new class extends Qt{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Jt(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}function en(e,t){let n;switch(t){case"\n":n=/\n/gu;break;case"\r":n=/\r/gu;break;case"\r\n":n=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let r=e.match(n);return r?r.length:0}var tn="string",nn="array",rn="cursor",sn="indent",on="align",an="trim",ln="group",un="fill",cn="if-break",hn="indent-if-break",dn="line-suffix",fn="line-suffix-boundary",pn="line",mn="label",gn="break-parent",En=new Set([rn,sn,on,an,ln,un,cn,hn,dn,fn,pn,mn,gn]),vn=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},Cn=function(e){if("string"==typeof e)return tn;if(Array.isArray(e))return nn;if(!e)return;let{type:t}=e;return En.has(t)?t:void 0};var Dn=class extends Error{name="InvalidDocError";constructor(e){super(function(e){let t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(Cn(e))throw new Error("doc is valid.");let n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;let r=(e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e))([...En].map(e=>`'${e}'`));return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},Sn=Dn,An={},_n=function(e,t,n,r){let i=[e];for(;i.length>0;){let e=i.pop();if(e===An){n(i.pop());continue}n&&i.push(e,An);let s=Cn(e);if(!s)throw new Sn(e);if(!1!==(null==t?void 0:t(e)))switch(s){case nn:case un:{let t=s===nn?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case cn:i.push(e.flatContents,e.breakContents);break;case ln:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case on:case sn:case hn:case mn:case dn:i.push(e.contents);break;case tn:case rn:case an:case fn:case pn:case gn:break;default:throw new Sn(e)}}};function yn(e,t){if("string"==typeof e)return t(e);let n=new Map;return function e(r){if(n.has(r))return n.get(r);let i=function(n){switch(Cn(n)){case nn:return t(n.map(e));case un:return t({...n,parts:n.parts.map(e)});case cn:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case ln:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case on:case sn:case hn:case mn:case dn:return t({...n,contents:e(n.contents)});case tn:case rn:case an:case fn:case pn:case gn:return t(n);default:throw new Sn(n)}}(r);return n.set(r,i),i}(e)}function bn(e,t,n){let r=n,i=!1;return _n(e,function(e){if(i)return!1;let n=t(e);void 0!==n&&(i=!0,r=n)}),r}function Tn(e){if(e.type===ln&&e.break||e.type===pn&&e.hard||e.type===gn)return!0}function Rn(e){if(e.length>0){let t=vn(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function xn(e){return e.type!==pn||e.hard?e.type===cn?e.flatContents:e:e.soft?"":" "}function wn(e){for(e=[...e];e.length>=2&&vn(!1,e,-2).type===pn&&vn(!1,e,-1).type===gn;)e.length-=2;if(e.length>0){let t=Fn(vn(!1,e,-1));e[e.length-1]=t}return e}function Fn(e){switch(Cn(e)){case sn:case hn:case ln:case dn:case mn:{let t=Fn(e.contents);return{...e,contents:t}}case cn:return{...e,breakContents:Fn(e.breakContents),flatContents:Fn(e.flatContents)};case un:return{...e,parts:wn(e.parts)};case nn:return wn(e);case tn:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return tfunction(e){switch(Cn(e)){case un:if(e.parts.every(e=>""===e))return"";break;case ln:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===ln&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case on:case sn:case hn:case dn:if(!e.contents)return"";break;case cn:if(!e.flatContents&&!e.breakContents)return"";break;case nn:{let t=[];for(let n of e){if(!n)continue;let[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof vn(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case tn:case rn:case an:case fn:case pn:case mn:case gn:break;default:throw new Sn(e)}return e}(e))}(e))}function Ln(e){if(e.type===pn)return!0}function On(e,t){return e.type===mn?{...e,contents:t(e.contents)}:t(e)}var In=()=>{},kn=In,Mn=In,Pn=In;function Bn(e){return kn(e),{type:sn,contents:e}}function Un(e,t){return kn(t),{type:on,contents:t,n:e}}function $n(e,t={}){return kn(e),Mn(t.expandedStates,!0),{type:ln,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Gn(e){return kn(e),{type:dn,contents:e}}var Vn={type:fn},Wn={type:gn},Hn={type:an},jn={type:pn,hard:!0},zn={type:pn,hard:!0,literal:!0},Xn={type:pn},Kn={type:pn,soft:!0},Yn=[jn,Wn],qn=[zn,Wn],Qn={type:rn};function Zn(e,t){kn(e),Mn(t);let n=[];for(let r=0;r0){for(let e=0;e!(function(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}(e)||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e)),nr=/[^\x20-\x7F]/u,rr=function(e){if(!e)return 0;if(!nr.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(let n of e){let e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=tr(e)?1:2)}return t},ir=Symbol("MODE_BREAK"),sr=Symbol("MODE_FLAT"),or=Symbol("cursor"),ar=Symbol("DOC_FILL_PRINTED_LENGTH");function lr(e,t){return cr(e,{type:"indent"},t)}function ur(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?cr(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:cr(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function cr(e,t,n){let r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t],i="",s=0,o=0,a=0;for(let e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function hr(e){let t=0,n=0,r=e.length;e:for(;r--;){let i=e[r];if(i!==or)for(let n=i.length-1;n>=0;n--){let s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(or);return t}function dr(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length,a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}let{mode:e,doc:u}=a.pop(),c=Cn(u);switch(c){case tn:l.push(u),n-=rr(u);break;case nn:case un:{let t=c===nn?u:u.parts,n=u[ar]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case sn:case on:case hn:case mn:a.push({mode:e,doc:u.contents});break;case an:n+=hr(l);break;case ln:{if(s&&u.break)return!1;let t=u.break?ir:e,n=u.expandedStates&&t===ir?vn(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case cn:{let t=(u.groupId?i[u.groupId]||sr:e)===ir?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case pn:if(e===ir||u.hard)return!0;u.soft||(l.push(" "),n--);break;case dn:r=!0;break;case fn:if(r)return!1}}return!1}function fr(e,t){let n={},r=t.printWidth,i=Jt(t.endOfLine),s=0,o=[{ind:{value:"",length:0,queue:[]},mode:ir,doc:e}],a=[],l=!1,u=[],c=0;for(function(e){let t=new Set,n=[];_n(e,function(e){if(e.type===gn&&Rn(n),e.type===ln){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===ln&&n.pop().break&&Rn(n)},!0)}(e);o.length>0;){let{ind:e,mode:h,doc:d}=o.pop();switch(Cn(d)){case tn:{let e="\n"!==i?qt(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=rr(e));break}case nn:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case rn:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(or),c++;break;case sn:o.push({ind:lr(e,t),mode:h,doc:d.contents});break;case on:o.push({ind:ur(e,d.n,t),mode:h,doc:d.contents});break;case an:s-=hr(a);break;case ln:switch(h){case sr:if(!l){o.push({ind:e,mode:d.break?ir:sr,doc:d.contents});break}case ir:{l=!1;let t={ind:e,mode:sr,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&dr(t,o,i,a,n))o.push(t);else if(d.expandedStates){let t=vn(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:ir,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:ir,doc:t});break}{let t=d.expandedStates[r],s={ind:e,mode:sr,doc:t};if(dr(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:ir,doc:d.contents});break}}d.id&&(n[d.id]=vn(!1,o,-1).mode);break;case un:{let t=r-s,i=d[ar]??0,{parts:a}=d,l=a.length-i;if(0===l)break;let c=a[i+0],f=a[i+1],p={ind:e,mode:sr,doc:c},m={ind:e,mode:ir,doc:c},g=dr(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}let E={ind:e,mode:sr,doc:f},v={ind:e,mode:ir,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}let C=a[i+2],D={ind:e,mode:h,doc:{...d,[ar]:i+2}};dr({ind:e,mode:sr,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case cn:case hn:{let t=d.groupId?n[d.groupId]:h;if(t===ir){let t=d.type===cn?d.breakContents:d.negate?d.contents:Bn(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===sr){let t=d.type===cn?d.flatContents:d.negate?Bn(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case dn:u.push({ind:e,mode:h,doc:d.contents});break;case fn:u.length>0&&o.push({ind:e,mode:h,doc:jn});break;case pn:switch(h){case sr:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case ir:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=hr(a),a.push(i+e.value),s=e.length)}break;case mn:o.push({ind:e,mode:h,doc:d.contents});break;case gn:break;default:throw new Sn(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}let h=a.indexOf(or);if(-1!==h){let e=a.indexOf(or,h+1);if(-1===e)return{formatted:a.filter(e=>e!==or).join("")};let t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}var pr,mr,gr,Er=function(e,t,n=0){let r=0;for(let i=n;i=0;n-=2)if(!Array.isArray(t[n])&&--e<0)return n;return-1},gr=function*(){let{stack:e}=this;for(let t=e.length-3;t>=0;t-=2){let n=e[t];Array.isArray(n)||(yield n)}};var vr=class{constructor(e){((e,t)=>{t.has(e)?zt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,void 0)})(this,pr),this.stack=[e]}get key(){let{stack:e,siblings:t}=this;return vn(!1,e,null===t?-2:-4)??null}get index(){return null===this.siblings?null:vn(!1,this.stack,-2)}get node(){return vn(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return null!==this.siblings}get siblings(){let{stack:e}=this,t=vn(!1,e,-3);return Array.isArray(t)?t:null}get next(){let{siblings:e}=this;return null===e?null:e[this.index+1]}get previous(){let{siblings:e}=this;return null===e?null:e[this.index-1]}get isFirst(){return 0===this.index}get isLast(){let{siblings:e,index:t}=this;return null!==e&&t===e.length-1}get isRoot(){return 1===this.stack.length}get root(){return this.stack[0]}get ancestors(){return[...Kt(this,pr,gr).call(this)]}getName(){let{stack:e}=this,{length:t}=e;return t>1?vn(!1,e,-2):null}getValue(){return vn(!1,this.stack,-1)}getNode(e=0){let t=Kt(this,pr,mr).call(this,e);return-1===t?null:this.stack[t]}getParentNode(e=0){return this.getNode(e+1)}call(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{return e(this)}finally{n.length=r}}callParent(e,t=0){let n=Kt(this,pr,mr).call(this,t+1),r=this.stack.splice(n+1);try{return e(this)}finally{this.stack.push(...r)}}each(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{for(let t=0;t{n[r]=e(t,r,i)},...t),n}match(...e){let t=this.stack.length-1,n=null,r=this.stack[t--];for(let i of e){if(void 0===r)return!1;let e=null;if("number"==typeof n&&(e=n,n=this.stack[t--],r=this.stack[t--]),i&&!i(r,n,e))return!1;n=this.stack[t--],r=this.stack[t--]}return!0}findAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return t}hasAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return!0;return!1}},Cr=new Proxy(()=>{},{get:()=>Cr}),Dr=Cr;function*Sr(e,t){let{getVisitorKeys:n,filter:r=()=>!0}=t,i=e=>function(e){return null!==e&&"object"==typeof e}(e)&&r(e);for(let t of n(e)){let n=e[t];if(Array.isArray(n))for(let e of n)i(e)&&(yield e);else i(n)&&(yield n)}}function Ar(e){return(t,n,r)=>{let i=!(null==r||!r.backwards);if(!1===n)return!1;let{length:s}=t,o=n;for(;o>=0&&oObject.keys(e).filter(e=>!wr.has(e)),Nr=function(e){return e?t=>e(t,wr):Fr};function Lr(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=function(e){let t=e.type||e.kind||"(unknown type)",n=String(e.name||e.id&&("object"==typeof e.id?e.id.name:e.id)||e.key&&("object"==typeof e.key?e.key.name:e.key)||e.value&&("object"==typeof e.value?"":String(e.value))||e.operator||"");return n.length>20&&(n=n.slice(0,19)+"…"),t+(n?" "+n:"")}(e)}function Or(e,t){t.leading=!0,t.trailing=!1,Lr(e,t)}function Ir(e,t,n){t.leading=!1,t.trailing=!1,n&&(t.marker=n),Lr(e,t)}function kr(e,t){t.leading=!1,t.trailing=!0,Lr(e,t)}var Mr=new WeakMap;function Pr(e,t){if(Mr.has(e))return Mr.get(e);let{printer:{getCommentChildNodes:n,canAttachComment:r,getVisitorKeys:i},locStart:s,locEnd:o}=t;if(!r)return[];let a=((null==n?void 0:n(e,t))??[...Sr(e,{getVisitorKeys:Nr(i)})]).flatMap(e=>r(e)?[e]:Pr(e,t));return a.sort((e,t)=>s(e)-s(t)||o(e)-o(t)),Mr.set(e,a),a}function Br(e,t,n,r){let i,s,{locStart:o,locEnd:a}=n,l=o(t),u=a(t),c=Pr(e,n),h=0,d=c.length;for(;h>1,r=c[e],f=o(r),p=a(r);if(f<=l&&u<=p)return Br(r,t,n,r);if(p<=l)i=r,h=e+1;else{if(!(u<=f))throw new Error("Comment location overlaps with node location");s=r,d=e}}if("TemplateLiteral"===(null==r?void 0:r.type)){let{quasis:e}=r,o=Hr(e,t,n);i&&Hr(e,i,n)!==o&&(i=null),s&&Hr(e,s,n)!==o&&(s=null)}return{enclosingNode:r,precedingNode:i,followingNode:s}}var Ur=()=>!1,$r=e=>!/[\S\n\u2028\u2029]/u.test(e);function Gr(e,t,n,r){let{comment:i,precedingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=o(i);if(s)for(let t=r-1;t>=0;t--){let{comment:r,precedingNode:i}=n[t];if(i!==s||!$r(e.slice(a(r),l)))break;l=o(r)}return xr(e,l,{backwards:!0})}function Vr(e,t,n,r){let{comment:i,followingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=a(i);if(s)for(let t=r+1;t0;--s){let{comment:i,precedingNode:u,followingNode:c}=e[s-1];Dr.strictEqual(u,o),Dr.strictEqual(c,a);let h=t.originalText.slice(t.locEnd(i),l);if(!((null==(r=(n=t.printer).isGap)?void 0:r.call(n,h,t))??/^[\s(]*$/u.test(h)))break;l=t.locStart(i)}for(let[t,{comment:n}]of e.entries())t1&&e.comments.sort((e,n)=>t.locStart(e)-t.locStart(n));e.length=0}function Hr(e,t,n){let r=n.locStart(t)-1;for(let t=1;t"string"==typeof e||"function"==typeof e,choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>"string"==typeof e||"object"==typeof e,cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:"Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.",cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:"Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.",cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function qr({plugins:e=[],showDeprecated:t=!1}={}){let n=e.flatMap(e=>e.languages??[]),r=[];for(let i of function(e){let t=[];for(let[n,r]of Object.entries(e)){let e={name:n,...r};Array.isArray(e.default)&&(e.default=vn(!1,e.default,-1).value),t.push(e)}return t}(Object.assign({},...e.map(({options:e})=>e),Yr)))!t&&i.deprecated||(Array.isArray(i.choices)&&(t||(i.choices=i.choices.filter(e=>!e.deprecated)),"parser"===i.name&&(i.choices=[...i.choices,...Qr(i.choices,n,e)])),i.pluginDefaults=Object.fromEntries(e.filter(e=>{var t;return void 0!==(null==(t=e.defaultOptions)?void 0:t[i.name])}).map(e=>[e.name,e.defaultOptions[i.name]])),r.push(i));return{languages:n,options:r}}function*Qr(e,t,n){let r=new Set(e.map(e=>e.value));for(let e of t)if(e.parsers)for(let t of e.parsers)if(!r.has(t)){r.add(t);let i=n.find(e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t)),s=e.name;null!=i&&i.name&&(s+=` (plugin: ${i.name})`),yield{value:t,description:s}}}var Zr,Jr,ei,ti,ni,ri="windows"===(null==(Zr=globalThis.Deno)?void 0:Zr.build.os)||(null==(ei=null==(Jr=globalThis.navigator)?void 0:Jr.platform)?void 0:ei.startsWith("Win"))||(null==(ni=null==(ti=globalThis.process)?void 0:ti.platform)?void 0:ni.startsWith("win"))||!1;function ii(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function si(e,t){if(!t)return;let n=(e=>String(e).split(/[/\\]/u).pop())(t).toLowerCase();return e.find(({filenames:e})=>null==e?void 0:e.some(e=>e.toLowerCase()===n))??e.find(({extensions:e})=>null==e?void 0:e.some(e=>n.endsWith(e)))}function oi(e,t){if(t){if(String(t).startsWith("file:"))try{t=function(e){return ri?function(e){e=ii(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return""!==e.hostname&&(t=`\\\\${e.hostname}${t}`),t}(e):function(e){return e=ii(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}(e)}(t)}catch{return}if("string"==typeof t)return e.find(({isSupported:e})=>null==e?void 0:e({filepath:t}))}}var ai=function(e,t){let n=((e,t)=>{if(!e||null!=t)return t.toReversed||!Array.isArray(t)?t.toReversed():[...t].reverse()})(!1,e.plugins).flatMap(e=>e.languages??[]),r=function(e,t){if(t)return e.find(({name:e})=>e.toLowerCase()===t)??e.find(({aliases:e})=>null==e?void 0:e.includes(t))??e.find(({extensions:e})=>null==e?void 0:e.includes(`.${t}`))}(n,t.language)??si(n,t.physicalFile)??si(n,t.file)??oi(n,t.physicalFile)??oi(n,t.file)??void t.physicalFile;return null==r?void 0:r.parsers[0]},li={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(e=>li.value(e)).join(", ")}]`;let t=Object.keys(e);return 0===t.length?"{}":`{ ${t.map(t=>`${li.key(t)}: ${li.value(e[t])}`).join(", ")} }`},pair:({key:e,value:t})=>li.value({[e]:t})},ui=new Proxy(String,{get:()=>ui}),ci=ui,hi=Symbol.for("vnopts.VALUE_NOT_EXIST"),di=Symbol.for("vnopts.VALUE_UNCHANGED"),fi=" ".repeat(2);function pi(e,t,n,r){return[`Invalid ${ci.red(r.key(e))} value.`,`Expected ${ci.blue(n)},`,`but received ${t===hi?ci.gray("nothing"):ci.red(r.value(t))}.`].join(" ")}function mi({text:e,list:t},n){let r=[];return e&&r.push(`- ${ci.blue(e)}`),t&&r.push([`- ${ci.blue(t.title)}:`].concat(t.values.map(e=>mi(e,n-fi.length).replace(/^|\n/g,`$&${fi}`))).join("\n")),gi(r,n)}function gi(e,t){if(1===e.length)return e[0];let[n,r]=e,[i,s]=e.map(e=>e.split("\n",1)[0].length);return i>t&&i>s?r:n}var Ei=[],vi=[],Ci=(e,t,{descriptor:n,logger:r,schemas:i})=>{let s=[`Ignored unknown option ${ci.yellow(n.pair({key:e,value:t}))}.`],o=Object.keys(i).sort().find(t=>function(e,t){if(e===t)return 0;let n=e;e.length>t.length&&(e=t,t=n);let r=e.length,i=t.length;for(;r>0&&e.charCodeAt(~-r)===t.charCodeAt(~-i);)r--,i--;let s=0;for(;sa?u>a?a+1:u:u>l?l+1:u;return a}(e,t)<3);o&&s.push(`Did you mean ${ci.blue(n.key(o))}?`),r.warn(s.join(" "))},Di=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"],Si=class{static create(e){return function(e,t){let n=new e(t),r=Object.create(n);for(let e of Di)e in t&&(r[e]=Ai(t[e],n,Si.prototype[e].length));return r}(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,t){return!1}deprecated(e,t){return!1}forward(e,t){}redirect(e,t){}overlap(e,t,n){return e}preprocess(e,t){return e}postprocess(e,t){return di}};function Ai(e,t,n){return"function"==typeof e?(...r)=>e(...r.slice(0,n-1),t,...r.slice(n-1)):()=>e}var _i=class extends Si{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},yi=class extends Si{expected(){return"anything"}validate(){return!0}},bi=class extends Si{constructor({valueSchema:e,name:t=e.name,...n}){super({...n,name:t}),this._valueSchema=e}expected(e){let{text:t,list:n}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:t&&`an array of ${t}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(e,t){if(!Array.isArray(e))return!1;let n=[];for(let r of e){let e=t.normalizeValidateResult(this._valueSchema.validate(r,t),r);!0!==e&&n.push(e.value)}return 0===n.length||{value:n}}deprecated(e,t){let n=[];for(let r of e){let e=t.normalizeDeprecatedResult(this._valueSchema.deprecated(r,t),r);!1!==e&&n.push(...e.map(({value:e})=>({value:[e]})))}return n}forward(e,t){let n=[];for(let r of e){let e=t.normalizeForwardResult(this._valueSchema.forward(r,t),r);n.push(...e.map(Ti))}return n}redirect(e,t){let n=[],r=[];for(let i of e){let e=t.normalizeRedirectResult(this._valueSchema.redirect(i,t),i);"remain"in e&&n.push(e.remain),r.push(...e.redirect.map(Ti))}return 0===n.length?{redirect:r}:{redirect:r,remain:n}}overlap(e,t){return e.concat(t)}};function Ti({from:e,to:t}){return{from:[e],to:t}}var Ri=class extends Si{expected(){return"true or false"}validate(e){return"boolean"==typeof e}};function xi(e,t){let n=Object.create(null);for(let r of e){let e=r[t];if(n[e])throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n[e]=r}return n}function wi(e,t){if(e===t)return 0;let n=typeof e,r=typeof t,i=["undefined","object","boolean","number","string"];return n!==r?i.indexOf(n)-i.indexOf(r):"string"!==n?Number(e)-Number(t):e.localeCompare(t)}function Fi(e){return void 0===e?{}:e}function Ni(e){if("string"==typeof e)return{text:e};let{text:t,list:n}=e;return function(e){if(!e)throw new Error("Unexpected `expected` result, there should be at least one field.")}(void 0!==(t||n)),n?{text:t,list:{title:n.title,values:n.values.map(Ni)}}:{text:t}}function Li(e,t){return!0===e||(!1===e?{value:t}:e)}function Oi(e,t,n=!1){return!1!==e&&(!0===e?!!n||[{value:t}]:"value"in e?[e]:0!==e.length&&e)}function Ii(e,t){return"string"==typeof e||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function ki(e,t){return void 0===e?[]:Array.isArray(e)?e.map(e=>Ii(e,t)):[Ii(e,t)]}function Mi(e,t){let n=ki("object"==typeof e&&"redirect"in e?e.redirect:e,t);return 0===n.length?{remain:t,redirect:n}:"object"==typeof e&&"remain"in e?{remain:e.remain,redirect:n}:{redirect:n}}var Pi,Bi=class extends Si{constructor(e){super(e),this._choices=function(e,t){let n=new Map;for(let r of e){let e=r[t];if(n.has(e))throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n.set(e,r)}return n}(e.choices.map(e=>e&&"object"==typeof e?e:{value:e}),"value")}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(e=>this._choices.get(e)).filter(({hidden:e})=>!e).map(e=>e.value).sort(wi).map(e.value),n=t.slice(0,-2),r=t.slice(-2);return{text:n.concat(r.join(" or ")).join(", "),list:{title:"one of the following values",values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return!(!t||!t.deprecated)&&{value:e}}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},Ui=class extends Si{expected(){return"a number"}validate(e,t){return"number"==typeof e}},$i=class extends Ui{expected(){return"an integer"}validate(e,t){return!0===t.normalizeValidateResult(super.validate(e,t),e)&&function(e){return e===Math.floor(e)}(e)}},Gi=class extends Si{expected(){return"a string"}validate(e){return"string"==typeof e}},Vi=li,Wi=Ci,Hi=(e,t,n)=>{let{text:r,list:i}=n.normalizeExpectedResult(n.schemas[e].expected(n)),s=[];return r&&s.push(pi(e,t,r,n.descriptor)),i&&s.push([pi(e,t,i.title,n.descriptor)].concat(i.values.map(e=>mi(e,n.loggerPrintWidth))).join("\n")),gi(s,n.loggerPrintWidth)},ji=(e,t,{descriptor:n})=>{let r=[`${ci.yellow("string"==typeof e?n.key(e):n.pair(e))} is deprecated`];return t&&r.push(`we now treat it as ${ci.blue("string"==typeof t?n.key(t):n.pair(t))}`),r.join("; ")+"."},zi=class{constructor(e,t){let{logger:n=console,loggerPrintWidth:r=80,descriptor:i=Vi,unknown:s=Wi,invalid:o=Hi,deprecated:a=ji,missing:l=()=>!1,required:u=()=>!1,preprocess:c=e=>e,postprocess:h=()=>di}=t||{};this._utils={descriptor:i,logger:n||{warn:()=>{}},loggerPrintWidth:r,schemas:xi(e,"name"),normalizeDefaultResult:Fi,normalizeExpectedResult:Ni,normalizeDeprecatedResult:Oi,normalizeForwardResult:ki,normalizeRedirectResult:Mi,normalizeValidateResult:Li},this._unknownHandler=s,this._invalidHandler=function(e){return(...t)=>{let n=e(...t);return"string"==typeof n?new Error(n):n}}(o),this._deprecatedHandler=a,this._identifyMissing=(e,t)=>!(e in t)||l(e,t),this._identifyRequired=u,this._preprocess=c,this._postprocess=h,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=function(){let e=Object.create(null);return t=>{let n=JSON.stringify(t);return!!e[n]||(e[n]=!0,!1)}}()}normalize(e){let t={},n=[this._preprocess(e,this._utils)],r=()=>{for(;0!==n.length;){let e=n.shift(),r=this._applyNormalization(e,t);n.push(...r)}};r();for(let e of Object.keys(this._utils.schemas)){let r=this._utils.schemas[e];if(!(e in t)){let t=Fi(r.default(this._utils));"value"in t&&n.push({[e]:t.value})}}r();for(let e of Object.keys(this._utils.schemas)){if(!(e in t))continue;let n=this._utils.schemas[e],r=t[e],i=n.postprocess(r,this._utils);i!==di&&(this._applyValidation(i,e,n),t[e]=i)}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let n=[],{knownKeys:r,unknownKeys:i}=this._partitionOptionKeys(e);for(let i of r){let r=this._utils.schemas[i],s=r.preprocess(e[i],this._utils);this._applyValidation(s,i,r);let o=({from:e,to:t})=>{n.push("string"==typeof t?{[t]:e}:{[t.key]:t.value})},a=({value:e,redirectTo:t})=>{let n=Oi(r.deprecated(e,this._utils),s,!0);if(!1!==n)if(!0===n)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,t,this._utils));else for(let{value:e}of n){let n={key:i,value:e};if(!this._hasDeprecationWarned(n)){let r="string"==typeof t?{key:t,value:e}:t;this._utils.logger.warn(this._deprecatedHandler(n,r,this._utils))}}};ki(r.forward(s,this._utils),s).forEach(o);let l=Mi(r.redirect(s,this._utils),s);if(l.redirect.forEach(o),"remain"in l){let e=l.remain;t[i]=i in t?r.overlap(t[i],e,this._utils):e,a({value:e})}for(let{from:e,to:t}of l.redirect)a({value:e,redirectTo:t})}for(let r of i){let i=e[r];this._applyUnknownHandler(r,i,t,(e,t)=>{n.push({[e]:t})})}return n}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,hi,this._utils)}_partitionOptionKeys(e){let[t,n]=function(e,t){let n=[],r=[];for(let i of e)t(i)?n.push(i):r.push(i);return[n,r]}(Object.keys(e).filter(t=>!this._identifyMissing(t,e)),e=>e in this._utils.schemas);return{knownKeys:t,unknownKeys:n}}_applyValidation(e,t,n){let r=Li(n.validate(e,this._utils),e);if(!0!==r)throw this._invalidHandler(t,r.value,this._utils)}_applyUnknownHandler(e,t,n,r){let i=this._unknownHandler(e,t,this._utils);if(i)for(let e of Object.keys(i)){if(this._identifyMissing(e,i))continue;let t=i[e];e in this._utils.schemas?r(e,t):n[e]=t}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==di){if(t.delete)for(let n of t.delete)delete e[n];if(t.override){let{knownKeys:n,unknownKeys:r}=this._partitionOptionKeys(t.override);for(let r of n){let n=t.override[r];this._applyValidation(n,r,this._utils.schemas[r]),e[r]=n}for(let n of r){let r=t.override[n];this._applyUnknownHandler(n,r,e,(t,n)=>{let r=this._utils.schemas[t];this._applyValidation(n,t,r),e[t]=n})}}}}};function Xi(e,{isCLI:t,optionInfos:n,FlagSchema:r}){let i,{name:s}=e,o={name:s},a={};switch(e.type){case"int":i=$i,t&&(o.preprocess=Number);break;case"string":case"path":i=Gi;break;case"choice":i=Bi,o.choices=e.choices.map(t=>null!=t&&t.redirect?{...t,redirect:{to:{key:e.name,value:t.redirect}}}:t);break;case"boolean":i=Ri;break;case"flag":i=r,o.flags=n.flatMap(e=>[e.alias,e.description&&e.name,e.oppositeDescription&&`no-${e.name}`].filter(Boolean));break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?o.validate=(t,n,r)=>e.exception(t)||n.validate(t,r):o.validate=(e,t,n)=>void 0===e||t.validate(e,n),e.redirect&&(a.redirect=t=>t?{to:"string"==typeof e.redirect?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(a.deprecated=!0),t&&!e.array){let e=o.preprocess||(e=>e);o.preprocess=(t,n,r)=>n.preprocess(e(Array.isArray(t)?vn(!1,t,-1):t),r)}return e.array?bi.create({...t?{preprocess:e=>Array.isArray(e)?e:[e]}:{},...a,valueSchema:i.create(o)}):i.create({...o,...a})}var Ki=(e,t,n)=>{if(!e||null!=t){if(t.findLast)return t.findLast(n);for(let e=t.length-1;e>=0;e--){let r=t[e];if(n(r,e,t))return r}}};function Yi(e,t){if(!t)throw new Error("parserName is required.");let n=Ki(!1,e,e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t));if(n)return n;let r=`Couldn't resolve parser "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}function qi({plugins:e,parser:t}){return Qi(Yi(e,t),t)}function Qi(e,t){let n=e.parsers[t];return"function"==typeof n?n():n}var Zi={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null},Ji=async function(e,t={}){var n;let r={...e};if(!r.parser){if(!r.filepath)throw new Kr("No parser and no file path given, couldn't infer a parser.");if(r.parser=ai(r,{physicalFile:r.filepath}),!r.parser)throw new Kr(`No parser could be inferred for file "${r.filepath}".`)}let i=qr({plugins:e.plugins,showDeprecated:!0}).options,s={...Zi,...Object.fromEntries(i.filter(e=>void 0!==e.default).map(e=>[e.name,e.default]))},o=Yi(r.plugins,r.parser),a=await Qi(o,r.parser);r.astFormat=a.astFormat,r.locEnd=a.locEnd,r.locStart=a.locStart;let l=null!=(n=o.printers)&&n[a.astFormat]?o:function(e,t){if(!t)throw new Error("astFormat is required.");let n=Ki(!1,e,e=>e.printers&&Object.prototype.hasOwnProperty.call(e.printers,t));if(n)return n;let r=`Couldn't find plugin for AST format "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}(r.plugins,a.astFormat),u=await function(e,t){let n=e.printers[t];return"function"==typeof n?n():n}(l,a.astFormat);r.printer=u;let c={...s,...l.defaultOptions?Object.fromEntries(Object.entries(l.defaultOptions).filter(([,e])=>void 0!==e)):{}};for(let[e,t]of Object.entries(c))(null===r[e]||void 0===r[e])&&(r[e]=t);return"json"===r.parser&&(r.trailingComma="none"),function(e,t,{logger:n=!1,isCLI:r=!1,passThrough:i=!1,FlagSchema:s,descriptor:o}={}){if(r){if(!s)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=li;let a=i?Array.isArray(i)?(e,t)=>i.includes(e)?{[e]:t}:void 0:(e,t)=>({[e]:t}):(e,t,n)=>{let{_:r,...i}=n.schemas;return Ci(e,t,{...n,schemas:i})},l=function(e,{isCLI:t,FlagSchema:n}){let r=[];t&&r.push(yi.create({name:"_"}));for(let i of e)r.push(Xi(i,{isCLI:t,optionInfos:e,FlagSchema:n})),i.alias&&t&&r.push(_i.create({name:i.alias,sourceName:i.name}));return r}(t,{isCLI:r,FlagSchema:s}),u=new zi(l,{logger:n,unknown:a,descriptor:o}),c=!1!==n;c&&Pi&&(u._hasDeprecationWarned=Pi);let h=u.normalize(e);return c&&(Pi=u._hasDeprecationWarned),h}(r,i,{passThrough:Object.keys(Zi),...t})},es=((e,t,n)=>(n=null!=e?$t(Ht(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of Wt(t))!jt.call(e,n)&&void 0!==n&&Gt(e,n,{get:()=>t[n],enumerable:!(r=Vt(t,n))||r.enumerable});return e})(Gt(n,"default",{value:e,enumerable:!0}),e)))(Yt()),ts=async function(e,t){let n,r=await qi(t),i=r.preprocess?r.preprocess(e,t):e;t.originalText=i;try{n=await r.parse(i,t,t)}catch(t){!function(e,t){let{loc:n}=e;if(n){let r=(0,es.codeFrameColumns)(t,n,{highlightCode:!0});throw e.message+="\n"+r,e.codeFrame=r,e}throw e}(t,e)}return{text:i,ast:n}};async function ns(e,t){({ast:e}=await is(e,t));let n=new Map,r=new vr(e),i=()=>{},s=new Map;await async function(e,t,n,r,i){let{embeddedLanguageFormatting:s,printer:{embed:o,hasPrettierIgnore:a=()=>!1,getVisitorKeys:l}}=n;if(!o||"auto"!==s)return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let u=Nr(o.getVisitorKeys??l),c=[];!function t(){let{node:r}=e;if(null===r||"object"!=typeof r||a(e))return;for(let n of u(r))Array.isArray(r[n])?e.each(t,n):e.call(t,n);let s=o(e,n);if(s){if("function"==typeof s)return void c.push({print:s,node:r,pathStack:[...e.stack]});i.set(r,s)}}();let h=e.stack;for(let{print:r,node:s,pathStack:o}of c)try{e.stack=o;let a=await r(d,t,e,n);a&&i.set(s,a)}catch(e){if(globalThis.PRETTIER_DEBUG)throw e}function d(e,t){return async function(e,t,n,r){let i=await Ji({...n,...t,parentParser:n.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:s}=await ts(e,i);return Nn(await r(s,i))}(e,t,n,r)}e.stack=h}(r,a,t,ns,s);let o=await rs(r,t,a,void 0,s);if(function(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:n}=e;for(let e of t){if(!e.printed&&!n.has(e))throw new Error('Comment "'+e.value.trim()+'" was not printed. Please report this error!');delete e.printed}}(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return[Qn,o];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[o,Qn]}return o;function a(e,t){return void 0===e||e===r?l(t):Array.isArray(e)?r.call(()=>l(t),...e):r.call(()=>l(t),e)}function l(e){i(r);let o=r.node;if(null==o)return"";let l=o&&"object"==typeof o&&void 0===e;if(l&&n.has(o))return n.get(o);let u=rs(r,t,a,e,s);return l&&n.set(o,u),u}}function rs(e,t,n,r,i){var s;let o,{node:a}=e,{printer:l}=t;switch(o=null!=(s=l.hasPrettierIgnore)&&s.call(l,e)?function(e,t){let{originalText:n,[Symbol.for("comments")]:r,locStart:i,locEnd:s,[Symbol.for("printedComments")]:o}=t,{node:a}=e,l=i(a),u=s(a);for(let e of r)i(e)>=l&&s(e)<=u&&o.add(e);return n.slice(l,u)}(e,t):i.has(a)?i.get(a):l.print(e,t,n,r),a){case t.cursorNode:o=On(o,e=>[Qn,e,Qn]);break;case t.nodeBeforeCursor:o=On(o,e=>[e,Qn]);break;case t.nodeAfterCursor:o=On(o,e=>[Qn,e])}return l.printComment&&(!l.willPrintOwnComments||!l.willPrintOwnComments(e,t))&&(o=function(e,t,n){let{leading:r,trailing:i}=function(e,t){let n=e.node;if(!n)return{};let r=t[Symbol.for("printedComments")];if(0===(n.comments||[]).filter(e=>!r.has(e)).length)return{leading:"",trailing:""};let i,s=[],o=[];return e.each(()=>{let n=e.node;if(null!=r&&r.has(n))return;let{leading:a,trailing:l}=n;a?s.push(function(e,t){var n;let r=e.node,i=[zr(e,t)],{printer:s,originalText:o,locStart:a,locEnd:l}=t;if(null==(n=s.isBlockComment)?void 0:n.call(s,r)){let e=xr(o,l(r))?xr(o,a(r),{backwards:!0})?Yn:Xn:" ";i.push(e)}else i.push(Yn);let u=Rr(o,yr(o,l(r)));return!1!==u&&xr(o,u)&&i.push(Yn),i}(e,t)):l&&(i=function(e,t,n){var r;let i=e.node,s=zr(e,t),{printer:o,originalText:a,locStart:l}=t,u=null==(r=o.isBlockComment)?void 0:r.call(o,i);if(null!=n&&n.hasLineSuffix&&(null==n||!n.isBlock)||xr(a,l(i),{backwards:!0})){let e=jr(a,l(i));return{doc:Gn([Yn,e?Yn:"",s]),isBlock:u,hasLineSuffix:!0}}return!u||null!=n&&n.hasLineSuffix?{doc:[Gn([" ",s]),Wn],isBlock:u,hasLineSuffix:!0}:{doc:[" ",s],isBlock:u,hasLineSuffix:!1}}(e,t,i),o.push(i.doc))},"comments"),{leading:s,trailing:o}}(e,n);return r||i?On(t,e=>[r,e,i]):t}(e,o,t)),o}async function is(e,t){let n=e.comments??[];t[Symbol.for("comments")]=n,t[Symbol.for("printedComments")]=new Set,function(e,t){let{comments:n}=e;if(delete e.comments,!function(e){return Array.isArray(e)&&e.length>0}(n)||!t.printer.canAttachComment)return;let r=[],{printer:{experimentalFeatures:{avoidAstMutation:i=!1}={},handleComments:s={}},originalText:o}=t,{ownLine:a=Ur,endOfLine:l=Ur,remaining:u=Ur}=s,c=n.map((r,i)=>({...Br(e,r,t),comment:r,text:o,options:t,ast:e,isLastComment:n.length-1===i}));for(let[e,t]of c.entries()){let n,{comment:s,precedingNode:o,enclosingNode:h,followingNode:d,text:f,options:p,ast:m,isLastComment:g}=t;if(i?n=[t]:(s.enclosingNode=h,s.precedingNode=o,s.followingNode=d,n=[s,f,p,m,g]),Gr(f,p,c,e))s.placement="ownLine",a(...n)||(d?Or(d,s):o?kr(o,s):Ir(h||m,s));else if(Vr(f,p,c,e))s.placement="endOfLine",l(...n)||(o?kr(o,s):d?Or(d,s):Ir(h||m,s));else if(s.placement="remaining",!u(...n))if(o&&d){let e=r.length;e>0&&r[e-1].followingNode!==d&&Wr(r,p),r.push(t)}else o?kr(o,s):d?Or(d,s):Ir(h||m,s)}if(Wr(r,t),!i)for(let e of n)delete e.precedingNode,delete e.enclosingNode,delete e.followingNode}(e,t);let{printer:{preprocess:r}}=t;return{ast:e=r?await r(e,t):e,comments:n}}var ss=function(e,t){let{cursorOffset:n,locStart:r,locEnd:i}=t,s=Nr(t.printer.getVisitorKeys),o=e=>r(e)<=n&&i(e)>=n,a=e,l=[e];for(let t of function*(e,t){let n=[e];for(let e=0;e0&&(void 0===u||void 0===c);){a=l.pop();let e=void 0!==u,t=void 0!==c;for(let o of Sr(a,{getVisitorKeys:s})){if(!e){let e=i(o);e<=n&&e>h&&(u=o,h=e)}if(!t){let e=r(o);e>=n&&e{if(!e||null!=t){if(t.findLastIndex)return t.findLastIndex(n);for(let e=t.length-1;e>=0;e--)if(n(t[e],e,t))return e;return-1}})(!1,e,e=>"Program"!==e.type&&"File"!==e.type);return-1===t?e:e.slice(0,t+1)}function as(e,t,n,r,i=[],s){let{locStart:o,locEnd:a}=n,l=o(e),u=a(e);if(!(t>u||t=0&&(t={...t,...ss(r,t)});let s=await ns(r,t);n>0&&(s=Jn([Yn,s],n,t.tabWidth));let o=fr(s,t);if(n>0){let e=o.formatted.trim();void 0!==o.cursorNodeStart&&(o.cursorNodeStart-=o.formatted.indexOf(e),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>e.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=e+Jt(t.endOfLine)}let a=t[Symbol.for("comments")];if(t.cursorOffset>=0){let e,n,r,s;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&o.cursorNodeText)if(r=o.cursorNodeStart,s=o.cursorNodeText,t.cursorNode)e=t.locStart(t.cursorNode),n=i.slice(e,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");e=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let r=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):i.length;n=i.slice(e,r)}else e=0,n=i,r=0,s=o.formatted;let l=t.cursorOffset-e;if(n===s)return{formatted:o.formatted,cursorOffset:r+l,comments:a};let u=n.split("");u.splice(l,0,hs);let c=function(e,t){return Zt.diff(e,t,void 0)}(u,s.split("")),h=r;for(let e of c)if(e.removed){if(e.value.includes(hs))break}else h+=e.count;return{formatted:o.formatted,cursorOffset:h,comments:a}}return{formatted:o.formatted,cursorOffset:-1,comments:a}}function fs(e,t,n){return"number"!=typeof t||Number.isNaN(t)||t<0||t>e.length?n:t}function ps(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i}=t;return n=fs(e,n,-1),r=fs(e,r,0),i=fs(e,i,e.length),{...t,cursorOffset:n,rangeStart:r,rangeEnd:i}}function ms(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s}=ps(e,t),o="\ufeff"===e.charAt(0);if(o&&(e=e.slice(1),n--,r--,i--),"auto"===s&&(s=function(e){let t=e.indexOf("\r");return-1!==t?"\n"===e.charAt(t+1)?"crlf":"cr":"lf"}(e)),e.includes("\r")){let t=t=>en(e.slice(0,Math.max(t,0)),"\r\n");n-=t(n),r-=t(r),i-=t(i),e=function(e){return qt(!1,e,/\r\n?/gu,"\n")}(e)}return{hasBOM:o,text:e,options:ps(e,{...t,cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s})}}async function gs(e,t){let n=await qi(t);return!n.hasPragma||n.hasPragma(e)}async function Es(e,t){let n,{hasBOM:r,text:i,options:s}=ms(e,await Ji(t));return s.rangeStart>=s.rangeEnd&&""!==i||s.requirePragma&&!await gs(i,s)||s.checkIgnorePragma&&await async function(e,t){var n;let r=await qi(t);return null==(n=r.hasIgnorePragma)?void 0:n.call(r,e)}(i,s)?{formatted:e,cursorOffset:t.cursorOffset,comments:[]}:(s.rangeStart>0||s.rangeEndr);let a=e.slice(r,i).search(/\S/u),l=-1===a;if(!l)for(r+=a;i>r&&!/\S/u.test(e[i-1]);--i);let u,c,h=as(n,r,t,(e,n)=>cs(t,e,n),[],"rangeStart"),d=l?h:as(n,i,t,e=>cs(t,e),[],"rangeEnd");if(!h||!d)return{rangeStart:0,rangeEnd:0};if((({parser:e})=>"json"===e||"json5"===e||"jsonc"===e||"json-stringify"===e)(t)){let e=function(e,t){let n=[e.node,...e.parentNodes],r=new Set([t.node,...t.parentNodes]);return n.find(e=>ls.has(e.type)&&r.has(e))}(h,d);u=e,c=e}else({startNode:u,endNode:c}=function(e,t,{locStart:n,locEnd:r}){let i=e.node,s=t.node;if(i===s)return{startNode:i,endNode:s};let o=n(e.node);for(let e of os(t.parentNodes)){if(!(n(e)>=o))break;s=e}let a=r(t.node);for(let t of os(e.parentNodes)){if(!(r(t)<=a))break;if(i=t,i===s)break}return{startNode:i,endNode:s}}(h,d,t));return{rangeStart:Math.min(s(u),s(c)),rangeEnd:Math.max(o(u),o(c))}}(r,t,n),o=r.slice(i,s),a=Math.min(i,r.lastIndexOf("\n",i)+1),l=r.slice(a,i).match(/^\s*/u)[0],u=Er(l,t.tabWidth),c=await ds(o,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>i&&t.cursorOffset<=s?t.cursorOffset-i:-1,endOfLine:"lf"},u),h=c.formatted.trimEnd(),{cursorOffset:d}=t;d>s?d+=h.length-o.length:c.cursorOffset>=0&&(d=c.cursorOffset+i);let f=r.slice(0,i)+h+r.slice(s);if("lf"!==t.endOfLine){let e=Jt(t.endOfLine);d>=0&&"\r\n"===e&&(d+=en(f.slice(0,d),"\n")),f=qt(!1,f,"\n",e)}return{formatted:f,cursorOffset:d,comments:c.comments}}(i,s):(!s.requirePragma&&s.insertPragma&&s.printer.insertPragma&&!await gs(i,s)&&(i=s.printer.insertPragma(i)),n=await ds(i,s)),r&&(n.formatted="\ufeff"+n.formatted,n.cursorOffset>=0&&n.cursorOffset++),n)}var vs={};Xt(vs,{builders:()=>Cs,printer:()=>Ds,utils:()=>Ss});var Cs={join:Zn,line:Xn,softline:Kn,hardline:Yn,literalline:qn,group:$n,conditionalGroup:function(e,t){return $n(e[0],{...t,expandedStates:e})},fill:function(e){return Pn(e),{type:un,parts:e}},lineSuffix:Gn,lineSuffixBoundary:Vn,cursor:Qn,breakParent:Wn,ifBreak:function(e,t="",n={}){return kn(e),""!==t&&kn(t),{type:cn,breakContents:e,flatContents:t,groupId:n.groupId}},trim:Hn,indent:Bn,indentIfBreak:function(e,t){return kn(e),{type:hn,contents:e,groupId:t.groupId,negate:t.negate}},align:Un,addAlignmentToDoc:Jn,markAsRoot:function(e){return Un({type:"root"},e)},dedentToRoot:function(e){return Un(Number.NEGATIVE_INFINITY,e)},dedent:function(e){return Un(-1,e)},hardlineWithoutBreakParent:jn,literallineWithoutBreakParent:zn,label:function(e,t){return kn(t),e?{type:mn,label:e,contents:t}:t},concat:e=>e},Ds={printDocToString:fr},Ss={willBreak:function(e){return bn(e,Tn,!1)},traverseDoc:_n,findInDoc:bn,mapDoc:yn,removeLines:function(e){return yn(e,xn)},stripTrailingHardline:Nn,replaceEndOfLine:function(e,t=qn){return yn(e,e=>"string"==typeof e?Zn(t,e.split("\n")):e)},canBreak:function(e){return bn(e,Ln,!1)}},As="3.6.2",_s={};Xt(_s,{addDanglingComment:()=>Ir,addLeadingComment:()=>Or,addTrailingComment:()=>kr,getAlignmentSize:()=>Er,getIndentSize:()=>xs,getMaxContinuousCount:()=>ws,getNextNonSpaceNonCommentCharacter:()=>Fs,getNextNonSpaceNonCommentCharacterIndex:()=>Ms,getPreferredQuote:()=>Ls,getStringWidth:()=>rr,hasNewline:()=>xr,hasNewlineInRange:()=>Os,hasSpaces:()=>Is,isNextLineEmpty:()=>Bs,isNextLineEmptyAfterIndex:()=>Rs,isPreviousLineEmpty:()=>Ps,makeString:()=>ks,skip:()=>Ar,skipEverythingButNewLine:()=>Tr,skipInlineComment:()=>ys,skipNewline:()=>Rr,skipSpaces:()=>yr,skipToLineEnd:()=>br,skipTrailingComment:()=>bs,skipWhitespace:()=>_r});var ys=function(e,t){if(!1===t)return!1;if("/"===e.charAt(t)&&"*"===e.charAt(t+1))for(let n=t+2;nMath.max(e,n.length/t.length),0)},Fs=function(e,t){let n=Ts(e,t);return!1===n?"":e.charAt(n)},Ns="'",Ls=function(e,t){let n=!0===t||t===Ns?Ns:'"',r=n===Ns?'"':Ns,i=0,s=0;for(let t of e)t===n?i++:t===r&&s++;return i>s?r:n},Os=function(e,t,n){for(let r=t;ri===r?i:s===t?"\\"+s:s||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(i)?i:"\\"+i));return t+i+t};function Ms(e,t){return 2===arguments.length||"number"==typeof t?Ts(e,t):function(e,t,n){return Ts(e,n(t))}(...arguments)}function Ps(e,t){return 2===arguments.length||"number"==typeof t?jr(e,t):function(e,t,n){return jr(e,n(t))}(...arguments)}function Bs(e,t){return 2===arguments.length||"number"==typeof t?Rs(e,t):function(e,t,n){return Rs(e,n(t))}(...arguments)}function Us(e,t=1){return async(...n)=>{let r=n[t]??{},i=r.plugins??[];return n[t]={...r,plugins:Array.isArray(i)?i:Object.values(i)},e(...n)}}var $s=Us(Es);async function Gs(e,t){let{formatted:n}=await $s(e,{...t,cursorOffset:-1});return n}async function Vs(e,t){return await Gs(e,t)===e}var Ws=Us(qr,0),Hs={parse:Us(async function(e,t,n){let{text:r,options:i}=ms(e,await Ji(t)),s=await ts(r,i);return n&&(n.preprocessForPrint&&(s.ast=await is(s.ast,i)),n.massage&&(s.ast=function(e,t){let{printer:{massageAstNode:n,getVisitorKeys:r}}=t;if(!n)return e;let i=Nr(r),s=n.ignoredProperties??new Set;return function e(t,r){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>e(t,r)).filter(Boolean);let o={},a=new Set(i(t));for(let n in t)!Object.prototype.hasOwnProperty.call(t,n)||s.has(n)||(a.has(n)?o[n]=e(t[n],t):o[n]=t[n]);let l=n(t,o,r);return null!==l?l??o:void 0}(e)}(s.ast,i))),s}),formatAST:Us(async function(e,t){return t=await Ji(t),fr(await ns(e,t),t)}),formatDoc:Us(async function(e,t){let n=function(e){let t=Object.create(null),n=new Set;return function e(t,n,i){var s,o;if("string"==typeof t)return JSON.stringify(t);if(Array.isArray(t)){let n=t.map(e).filter(Boolean);return 1===n.length?n[0]:`[${n.join(", ")}]`}if(t.type===pn){let e=(null==(s=null==i?void 0:i[n+1])?void 0:s.type)===gn;return t.literal?e?"literalline":"literallineWithoutBreakParent":t.hard?e?"hardline":"hardlineWithoutBreakParent":t.soft?"softline":"line"}if(t.type===gn)return(null==(o=null==i?void 0:i[n-1])?void 0:o.type)===pn&&i[n-1].hard?void 0:"breakParent";if(t.type===an)return"trim";if(t.type===sn)return"indent("+e(t.contents)+")";if(t.type===on)return t.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+e(t.contents)+")":t.n<0?"dedent("+e(t.contents)+")":"root"===t.n.type?"markAsRoot("+e(t.contents)+")":"align("+JSON.stringify(t.n)+", "+e(t.contents)+")";if(t.type===cn)return"ifBreak("+e(t.breakContents)+(t.flatContents?", "+e(t.flatContents):"")+(t.groupId?(t.flatContents?"":', ""')+`, { groupId: ${r(t.groupId)} }`:"")+")";if(t.type===hn){let n=[];t.negate&&n.push("negate: true"),t.groupId&&n.push(`groupId: ${r(t.groupId)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return`indentIfBreak(${e(t.contents)}${i})`}if(t.type===ln){let n=[];t.break&&"propagated"!==t.break&&n.push("shouldBreak: true"),t.id&&n.push(`id: ${r(t.id)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return t.expandedStates?`conditionalGroup([${t.expandedStates.map(t=>e(t)).join(",")}]${i})`:`group(${e(t.contents)}${i})`}if(t.type===un)return`fill([${t.parts.map(t=>e(t)).join(", ")}])`;if(t.type===dn)return"lineSuffix("+e(t.contents)+")";if(t.type===fn)return"lineSuffixBoundary";if(t.type===mn)return`label(${JSON.stringify(t.label)}, ${e(t.contents)})`;if(t.type===rn)return"cursor";throw new Error("Unknown doc type "+t.type)}(er(e));function r(e){if("symbol"!=typeof e)return JSON.stringify(String(e));if(e in t)return t[e];let r=e.description||"symbol";for(let i=0;;i++){let s=r+(i>0?` #${i}`:"");if(!n.has(s))return n.add(s),t[e]=`Symbol.for(${JSON.stringify(s)})`}}}(e),{formatted:r}=await Es(n,{...t,parser:"__js_expression"});return r}),printToDoc:Us(async function(e,t){t=await Ji(t);let{ast:n}=await ts(e,t);return t.cursorOffset>=0&&(t={...t,...ss(n,t)}),ns(n,t)}),printDocToString:Us(async function(e,t){return fr(e,await Ji(t))})},js=Object.defineProperty;((e,t)=>{for(var n in t)js(e,n,{get:t[n],enumerable:!0})})({},{builders:()=>Jo,printer:()=>ea,utils:()=>ta});var zs="string",Xs="array",Ks="cursor",Ys="indent",qs="align",Qs="trim",Zs="group",Js="fill",eo="if-break",to="indent-if-break",no="line-suffix",ro="line-suffix-boundary",io="line",so="label",oo="break-parent",ao=new Set([Ks,Ys,qs,Qs,Zs,Js,eo,to,no,ro,io,so,oo]),lo=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},uo=function(e){if("string"==typeof e)return zs;if(Array.isArray(e))return Xs;if(!e)return;const{type:t}=e;return ao.has(t)?t:void 0};var co=class extends Error{name="InvalidDocError";constructor(e){super(function(e){const t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(uo(e))throw new Error("doc is valid.");const n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;const r=(i=[...ao].map(e=>`'${e}'`),new Intl.ListFormat("en-US",{type:"disjunction"}).format(i));var i;return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},ho={},fo=function(e,t,n,r){const i=[e];for(;i.length>0;){const e=i.pop();if(e===ho){n(i.pop());continue}n&&i.push(e,ho);const s=uo(e);if(!s)throw new co(e);if(!1!==(null==t?void 0:t(e)))switch(s){case Xs:case Js:{const t=s===Xs?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case eo:i.push(e.flatContents,e.breakContents);break;case Zs:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case qs:case Ys:case to:case so:case no:i.push(e.contents);break;case zs:case Ks:case Qs:case ro:case io:case oo:break;default:throw new co(e)}}};function po(e,t){if("string"==typeof e)return t(e);const n=new Map;return function e(r){if(n.has(r))return n.get(r);const i=function(n){switch(uo(n)){case Xs:return t(n.map(e));case Js:return t({...n,parts:n.parts.map(e)});case eo:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case Zs:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case qs:case Ys:case to:case so:case no:return t({...n,contents:e(n.contents)});case zs:case Ks:case Qs:case ro:case io:case oo:return t(n);default:throw new co(n)}}(r);return n.set(r,i),i}(e)}function mo(e,t,n){let r=n,i=!1;return fo(e,function(e){if(i)return!1;const n=t(e);void 0!==n&&(i=!0,r=n)}),r}function go(e){return!(e.type!==Zs||!e.break)||!(e.type!==io||!e.hard)||e.type===oo||void 0}function Eo(e){if(e.length>0){const t=lo(!1,e,-1);t.expandedStates||t.break||(t.break="propagated")}return null}function vo(e){return e.type!==io||e.hard?e.type===eo?e.flatContents:e:e.soft?"":" "}function Co(e){for(e=[...e];e.length>=2&&lo(!1,e,-2).type===io&&lo(!1,e,-1).type===oo;)e.length-=2;if(e.length>0){const t=Do(lo(!1,e,-1));e[e.length-1]=t}return e}function Do(e){switch(uo(e)){case Ys:case to:case Zs:case no:case so:{const t=Do(e.contents);return{...e,contents:t}}case eo:return{...e,breakContents:Do(e.breakContents),flatContents:Do(e.flatContents)};case Js:return{...e,parts:Co(e.parts)};case Xs:return Co(e);case zs:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return t{},_o=Ao,yo=Ao,bo=Ao;function To(e){return _o(e),{type:Ys,contents:e}}function Ro(e,t){return _o(t),{type:qs,contents:t,n:e}}function xo(e,t={}){return _o(e),yo(t.expandedStates,!0),{type:Zs,id:t.id,contents:e,break:Boolean(t.shouldBreak),expandedStates:t.expandedStates}}var wo={type:ro},Fo={type:oo},No={type:Qs},Lo={type:io,hard:!0},Oo={type:io,hard:!0,literal:!0},Io={type:io},ko={type:io,soft:!0},Mo=[Lo,Fo],Po=[Oo,Fo],Bo={type:Ks};function Uo(e,t){_o(e),yo(t);const n=[];for(let r=0;r{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Go=e=>{return!(12288===(t=e)||t>=65281&&t<=65376||t>=65504&&t<=65510||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e));var t},Vo=/[^\x20-\x7F]/u,Wo=function(e){if(!e)return 0;if(!Vo.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(const n of e){const e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=Go(e)?1:2)}return t},Ho=Symbol("MODE_BREAK"),jo=Symbol("MODE_FLAT"),zo=Symbol("cursor"),Xo=Symbol("DOC_FILL_PRINTED_LENGTH");function Ko(e,t){return qo(e,{type:"indent"},t)}function Yo(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?qo(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:qo(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function qo(e,t,n){const r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t];let i="",s=0,o=0,a=0;for(const e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function Qo(e){let t=0,n=0,r=e.length;e:for(;r--;){const i=e[r];if(i!==zo)for(let n=i.length-1;n>=0;n--){const s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(zo);return t}function Zo(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length;const a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}const{mode:e,doc:u}=a.pop(),c=uo(u);switch(c){case zs:l.push(u),n-=Wo(u);break;case Xs:case Js:{const t=c===Xs?u:u.parts,n=u[Xo]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case Ys:case qs:case to:case so:a.push({mode:e,doc:u.contents});break;case Qs:n+=Qo(l);break;case Zs:{if(s&&u.break)return!1;const t=u.break?Ho:e,n=u.expandedStates&&t===Ho?lo(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case eo:{const t=(u.groupId?i[u.groupId]||jo:e)===Ho?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case io:if(e===Ho||u.hard)return!0;u.soft||(l.push(" "),n--);break;case no:r=!0;break;case ro:if(r)return!1}}return!1}var Jo={join:Uo,line:Io,softline:ko,hardline:Mo,literalline:Po,group:xo,conditionalGroup:function(e,t){return xo(e[0],{...t,expandedStates:e})},fill:function(e){return bo(e),{type:Js,parts:e}},lineSuffix:function(e){return _o(e),{type:no,contents:e}},lineSuffixBoundary:wo,cursor:Bo,breakParent:Fo,ifBreak:function(e,t="",n={}){return _o(e),""!==t&&_o(t),{type:eo,breakContents:e,flatContents:t,groupId:n.groupId}},trim:No,indent:To,indentIfBreak:function(e,t){return _o(e),{type:to,contents:e,groupId:t.groupId,negate:t.negate}},align:Ro,addAlignmentToDoc:function(e,t,n){_o(e);let r=e;if(t>0){for(let e=0;ee},ea={printDocToString:function(e,t){const n={},r=t.printWidth,i=function(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}(t.endOfLine);let s=0;const o=[{ind:{value:"",length:0,queue:[]},mode:Ho,doc:e}],a=[];let l=!1;const u=[];let c=0;for(function(e){const t=new Set,n=[];fo(e,function(e){if(e.type===oo&&Eo(n),e.type===Zs){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===Zs&&n.pop().break&&Eo(n)},!0)}(e);o.length>0;){const{ind:e,mode:h,doc:d}=o.pop();switch(uo(d)){case zs:{const e="\n"!==i?$o(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=Wo(e));break}case Xs:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case Ks:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(zo),c++;break;case Ys:o.push({ind:Ko(e,t),mode:h,doc:d.contents});break;case qs:o.push({ind:Yo(e,d.n,t),mode:h,doc:d.contents});break;case Qs:s-=Qo(a);break;case Zs:switch(h){case jo:if(!l){o.push({ind:e,mode:d.break?Ho:jo,doc:d.contents});break}case Ho:{l=!1;const t={ind:e,mode:jo,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&Zo(t,o,i,a,n))o.push(t);else if(d.expandedStates){const t=lo(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:Ho,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:Ho,doc:t});break}{const t=d.expandedStates[r],s={ind:e,mode:jo,doc:t};if(Zo(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:Ho,doc:d.contents});break}}d.id&&(n[d.id]=lo(!1,o,-1).mode);break;case Js:{const t=r-s,i=d[Xo]??0,{parts:a}=d,l=a.length-i;if(0===l)break;const c=a[i+0],f=a[i+1],p={ind:e,mode:jo,doc:c},m={ind:e,mode:Ho,doc:c},g=Zo(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}const E={ind:e,mode:jo,doc:f},v={ind:e,mode:Ho,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}const C=a[i+2],D={ind:e,mode:h,doc:{...d,[Xo]:i+2}};Zo({ind:e,mode:jo,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case eo:case to:{const t=d.groupId?n[d.groupId]:h;if(t===Ho){const t=d.type===eo?d.breakContents:d.negate?d.contents:To(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===jo){const t=d.type===eo?d.flatContents:d.negate?To(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case no:u.push({ind:e,mode:h,doc:d.contents});break;case ro:u.length>0&&o.push({ind:e,mode:h,doc:Lo});break;case io:switch(h){case jo:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case Ho:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=Qo(a),a.push(i+e.value),s=e.length)}break;case so:o.push({ind:e,mode:h,doc:d.contents});break;case oo:break;default:throw new co(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}const h=a.indexOf(zo);if(-1!==h){const e=a.indexOf(zo,h+1);if(-1===e)return{formatted:a.filter(e=>e!==zo).join("")};const t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}},ta={willBreak:function(e){return mo(e,go,!1)},traverseDoc:fo,findInDoc:mo,mapDoc:po,removeLines:function(e){return po(e,vo)},stripTrailingHardline:function(e){return Do(function(e){return po(e,e=>function(e){switch(uo(e)){case Js:if(e.parts.every(e=>""===e))return"";break;case Zs:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===Zs&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case qs:case Ys:case to:case no:if(!e.contents)return"";break;case eo:if(!e.flatContents&&!e.breakContents)return"";break;case Xs:{const t=[];for(const n of e){if(!n)continue;const[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof lo(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case zs:case Ks:case Qs:case ro:case io:case so:case oo:break;default:throw new co(e)}return e}(e))}(e))},replaceEndOfLine:function(e,t=Po){return po(e,e=>"string"==typeof e?Uo(t,e.split("\n")):e)},canBreak:function(e){return mo(e,So,!1)}};function na(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}class ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class ia extends ra{constructor(e){super([]),this.idx=1,Object.assign(this,ma(e))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class sa extends ra{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ma(e))}}class oa extends ra{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ma(e))}}class aa extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class la extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ua extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ca extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ha extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class da extends ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ma(e))}}class fa{constructor(e){this.idx=1,Object.assign(this,ma(e))}accept(e){e.visit(this)}}function pa(e){function t(e){return e.map(pa)}if(e instanceof ia){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return"string"==typeof e.label&&(t.label=e.label),t}if(e instanceof oa)return{type:"Alternative",definition:t(e.definition)};if(e instanceof aa)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof la)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof ua)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ha)return{type:"RepetitionWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ca)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof da)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof fa){const t={type:"Terminal",name:e.terminalType.name,label:(n=e.terminalType,"string"==typeof(r=n).LABEL&&""!==r.LABEL?n.LABEL:n.name),idx:e.idx};"string"==typeof e.label&&(t.terminalLabel=e.label);const i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=i instanceof RegExp?i.source:i),t}if(e instanceof sa)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match");var n,r}function ma(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}class ga{visit(e){const t=e;switch(t.constructor){case ia:return this.visitNonTerminal(t);case oa:return this.visitAlternative(t);case aa:return this.visitOption(t);case la:return this.visitRepetitionMandatory(t);case ua:return this.visitRepetitionMandatoryWithSeparator(t);case ha:return this.visitRepetitionWithSeparator(t);case ca:return this.visitRepetition(t);case da:return this.visitAlternation(t);case fa:return this.visitTerminal(t);case sa:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Ea(e,t=[]){return!!(e instanceof aa||e instanceof ca||e instanceof ha)||(e instanceof da?e.definition.some(e=>Ea(e,t)):!(e instanceof ia&&t.includes(e))&&e instanceof ra&&(e instanceof ia&&t.push(e),e.definition.every(e=>Ea(e,t))))}function va(e){if(e instanceof ia)return"SUBRULE";if(e instanceof aa)return"OPTION";if(e instanceof da)return"OR";if(e instanceof la)return"AT_LEAST_ONE";if(e instanceof ua)return"AT_LEAST_ONE_SEP";if(e instanceof ha)return"MANY_SEP";if(e instanceof ca)return"MANY";if(e instanceof fa)return"CONSUME";throw Error("non exhaustive match")}class Ca{walk(e,t=[]){e.definition.forEach((n,r)=>{const i=e.definition.slice(r+1);if(n instanceof ia)this.walkProdRef(n,i,t);else if(n instanceof fa)this.walkTerminal(n,i,t);else if(n instanceof oa)this.walkFlat(n,i,t);else if(n instanceof aa)this.walkOption(n,i,t);else if(n instanceof la)this.walkAtLeastOne(n,i,t);else if(n instanceof ua)this.walkAtLeastOneSep(n,i,t);else if(n instanceof ha)this.walkManySep(n,i,t);else if(n instanceof ca)this.walkMany(n,i,t);else{if(!(n instanceof da))throw Error("non exhaustive match");this.walkOr(n,i,t)}})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);e.definition.forEach(e=>{const t=new oa({definition:[e]});this.walk(t,r)})}}function Da(e,t,n){return[new aa({definition:[new fa({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Sa(e){if(e instanceof ia)return Sa(e.referencedRule);if(e instanceof fa)return[e.terminalType];if(function(e){return e instanceof oa||e instanceof aa||e instanceof ca||e instanceof la||e instanceof ua||e instanceof ha||e instanceof fa||e instanceof sa}(e))return function(e){let t=[];const n=e.definition;let r,i=0,s=n.length>i,o=!0;for(;s&&o;)r=n[i],o=Ea(r),t=t.concat(Sa(r)),i+=1,s=n.length>i;return[...new Set(t)]}(e);if(function(e){return e instanceof da}(e))return function(e){const t=e.definition.map(e=>Sa(e));return[...new Set(t.flat())]}(e);throw Error("non exhaustive match")}const Aa="_~IN~_";class _a extends Ca{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=(i=e.referencedRule,s=e.idx,i.name+s+Aa+this.topProd.name);var i,s;const o=t.concat(n),a=Sa(new oa({definition:o}));this.follows[r]=a}}function ya(e){return e.charCodeAt(0)}function ba(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function Ta(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t],e[t]=!0}function Ra(e){if(void 0===e)throw Error("Internal Error - Should never get here!");return!0}function xa(){throw Error("Internal Error - Should never get here!")}function wa(e){return"Character"===e.type}const Fa=[];for(let e=ya("0");e<=ya("9");e++)Fa.push(e);const Na=[ya("_")].concat(Fa);for(let e=ya("a");e<=ya("z");e++)Na.push(e);for(let e=ya("A");e<=ya("Z");e++)Na.push(e);const La=[ya(" "),ya("\f"),ya("\n"),ya("\r"),ya("\t"),ya("\v"),ya("\t"),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya("\u2028"),ya("\u2029"),ya(" "),ya(" "),ya(" "),ya("\ufeff")],Oa=/[0-9a-fA-F]/,Ia=/[0-9]/,ka=/[1-9]/;class Ma{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}function Pa(e){console&&console.error&&console.error(`Error: ${e}`)}function Ba(e){console&&console.warn&&console.warn(`Warning: ${e}`)}let Ua={};const $a=new class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Ta(n,"global");break;case"i":Ta(n,"ignoreCase");break;case"m":Ta(n,"multiLine");break;case"u":Ta(n,"unicode");break;case"y":Ta(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":let t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}}Ra(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return xa()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;Ra(t)}if(!0!==e||void 0!==t)return Ra(t)?("?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t):void 0}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),Ra(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):xa()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ya("\n"),ya("\r"),ya("\u2028"),ya("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=Fa;break;case"D":e=Fa,t=!0;break;case"s":e=La;break;case"S":e=La,t=!0;break;case"w":e=Na;break;case"W":e=Na,t=!0}return Ra(e)?{type:"Set",value:e,complement:t}:xa()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ya("\f");break;case"n":e=ya("\n");break;case"r":e=ya("\r");break;case"t":e=ya("\t");break;case"v":e=ya("\v")}return Ra(e)?{type:"Character",value:e}:xa()}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:ya("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:ya(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:ya(this.popChar())}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const t=this.classAtom();if(t.type,wa(t)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,wa(n)){if(n.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};function Ga(e){const t=e.toString();if(Ua.hasOwnProperty(t))return Ua[t];{const e=$a.pattern(t);return Ua[t]=e,e}}const Va="Complement Sets are not supported for first char optimization",Wa='Unable to use "first char" lexer optimizations:\n';function Ha(e,t=!1){try{const t=Ga(e);return ja(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===Va)t&&Ba(`${Wa}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),Pa(`${Wa}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function ja(e,t,n){switch(e.type){case"Disjunction":for(let r=0;r{if("number"==typeof e)za(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)za(e,t,n);else{for(let e=r.from;e<=r.to&&e=ul){const e=r.from>=ul?r.from:ul,n=r.to,i=hl(e),s=hl(n);for(let e=i;e<=s;e++)t[e]=e}}}});break;case"Group":ja(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}const o=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===Ka(s)||"Group"!==s.type&&!1===o)break}break;default:throw Error("non exhaustive match!")}return Object.values(t)}function za(e,t,n){const r=hl(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=hl(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=hl(e.charCodeAt(0));t[n]=n}}}(e,t)}function Xa(e,t){return e.value.find(e=>{if("number"==typeof e)return t.includes(e);{const n=e;return void 0!==t.find(e=>n.from<=e&&e<=n.to)}})}function Ka(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(Array.isArray(e.value)?e.value.every(Ka):Ka(e.value))}class Ya extends Ma{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e);case"Lookbehind":return void this.visitLookbehind(e);case"NegativeLookbehind":return void this.visitNegativeLookbehind(e)}super.visitChildren(e)}}visitCharacter(e){this.targetCharCodes.includes(e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===Xa(e,this.targetCharCodes)&&(this.found=!0):void 0!==Xa(e,this.targetCharCodes)&&(this.found=!0)}}function qa(e,t){if(t instanceof RegExp){const n=Ga(t),r=new Ya(e);return r.visit(n),r.found}for(const n of t){const t=n.charCodeAt(0);if(e.includes(t))return!0}return!1}const Qa="PATTERN",Za="defaultMode",Ja="modes";const el=/[^\\][$]/,tl=/[^\\[][\^]|^\^/;function nl(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function rl(e){const t=e.PATTERN;if(t instanceof RegExp)return!1;if("function"==typeof t)return!0;if(Object.hasOwn(t,"exec"))return!0;if("string"==typeof t)return!1;throw Error("non exhaustive match")}function il(e){return"string"==typeof e&&1===e.length&&e.charCodeAt(0)}const sl={test:function(e){const t=e.length;for(let n=this.lastIndex;n"string"==typeof e?e.charCodeAt(0):e)}function ll(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const ul=256;let cl=[];function hl(e){return ee.CATEGORIES).flat().filter(Boolean);const e=n.filter(e=>!t.includes(e));t=t.concat(e),0===e.length?r=!1:n=e}return t}(e);!function(e){e.forEach(e=>{var t;Cl(e)||(gl[ml]=e,e.tokenTypeIdx=ml++),Dl(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Dl(e)||(e.CATEGORIES=[]),t=e,Object.hasOwn(null!=t?t:{},"categoryMatches")||(e.categoryMatches=[]),function(e){return Object.hasOwn(null!=e?e:{},"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})})}(t),function(e){e.forEach(e=>{vl([],e)})}(t),function(e){e.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(t=>{e.categoryMatches.push(gl[t].tokenTypeIdx)})})}(t),t.forEach(e=>{e.isParent=e.categoryMatches.length>0})}function vl(e,t){e.forEach(e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),t.CATEGORIES.forEach(n=>{const r=e.concat(t);r.includes(n)||vl(r,n)})}function Cl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}function Dl(e){return Object.hasOwn(null!=e?e:{},"CATEGORIES")}function Sl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}var Al;!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"}(Al||(Al={}));const _l={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:{buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i,s)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`},traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(_l);class yl{constructor(e,t=_l){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=Object.assign({},_l,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===_l.lineTerminatorsPattern)this.config.lineTerminatorsPattern=sl;else if(this.config.lineTerminatorCharacters===_l.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Array.isArray(e)?n={modes:{defaultMode:[...e]},defaultMode:Za}:(r=!1,n=Object.assign({},e))}),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){const t=[];return Object.hasOwn(e,Za)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+Za+"> property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(e,Ja)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(e,Ja)&&Object.hasOwn(e,Za)&&!Object.hasOwn(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${Za}: <${e.defaultMode}>which does not exist\n`,type:Al.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(e,Ja)&&Object.keys(e.modes).forEach(n=>{const r=e.modes[n];r.forEach((e,i)=>{void 0===e?t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:Al.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(e,"LONGER_ALT")&&(Array.isArray(e.LONGER_ALT)?e.LONGER_ALT:[e.LONGER_ALT]).forEach(i=>{void 0===i||r.includes(i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${e.name}> outside of mode <${n}>\n`,type:Al.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(function(e,t,n){const r=[];let i=!1;const s=Object.values(e.modes||{}).flat().filter(Boolean).filter(e=>e[Qa]!==yl.NA),o=al(n);return t&&s.forEach(e=>{const t=ol(e,o);if(!1!==t){const n=function(e,t){if(t.issue===Al.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Al.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else Object.hasOwn(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):qa(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:Al.NO_LINE_BREAKS_FLAGS}),r}(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},Object.entries(n.modes).forEach(([e,t])=>{n.modes[e]=t.filter(e=>void 0!==e)});const i=Object.keys(n.modes);if(Object.entries(n.modes).forEach(([e,n])=>{this.TRACE_INIT(`Mode: <${e}> processing`,()=>{if(this.modes.push(e),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e,t){let n=[];const r=function(e){const t=e.filter(e=>!Object.hasOwn(e,Qa));return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:Al.MISSING_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(e);n=n.concat(r.errors);const i=function(e){const t=e.filter(e=>{const t=e[Qa];return!(t instanceof RegExp||"function"==typeof t||Object.hasOwn(t,"exec")||"string"==typeof t)});return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Al.INVALID_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=e.filter(e=>e[Qa]instanceof RegExp);return t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return el.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return tl.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){return e.filter(e=>{const t=e[Qa];return t instanceof RegExp&&(t.multiline||t.global)}).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Al.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){const t=[];let n=e.map(n=>e.reduce((e,r)=>(n.PATTERN.source!==r.PATTERN.source||t.includes(r)||r.PATTERN===yl.NA||(t.push(r),e.push(r)),e),[]));return n=n.filter(Boolean),n.filter(e=>e.length>1).map(e=>{const t=e.map(e=>e.name);return{message:`The same RegExp pattern ->${e[0].PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:Al.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}(n)),t=t.concat(function(e){return e.filter(e=>e.PATTERN.test("")).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:Al.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}(n)),t}(s)),n=n.concat(function(e){const t=e.filter(e=>{if(!Object.hasOwn(e,"GROUP"))return!1;const t=e.GROUP;return t!==yl.SKIPPED&&t!==yl.NA&&!("string"==typeof t)});return t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Al.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}(s)),n=n.concat(function(e,t){return e.filter(e=>void 0!==e.PUSH_MODE&&!t.includes(e.PUSH_MODE)).map(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:Al.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}(s,t)),n=n.concat(function(e){const t=[],n=e.reduce((e,t,n)=>{const r=t.PATTERN;return r===yl.NA||("string"==typeof r?e.push({str:r,idx:n,tokenType:t}):r instanceof RegExp&&(i=r,void 0===[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(e=>-1!==i.source.indexOf(e)))&&e.push({str:r.source,idx:n,tokenType:t})),e;var i},[]);return e.forEach((e,r)=>{n.forEach(({str:n,idx:i,tokenType:s})=>{if(r${s.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:Al.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}})}),t}(s)),n}(n,i))}),0===this.lexerDefinitionErrors.length){let r;El(n),this.TRACE_INIT("analyzeTokenTypes",()=>{r=function(e,t){const n=(t=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()},t)).tracer;let r;n("initCharCodeToOptimizedIndexMap",()=>{!function(){if(0===cl.length){cl=new Array(65536);for(let e=0;e<65536;e++)cl[e]=e>255?255+~~(e/255):e}}()}),n("Reject Lexer.NA",()=>{r=e.filter(e=>e[Qa]!==yl.NA)});let i,s,o,a,l,u,c,h,d,f,p,m=!1;n("Transform Patterns",()=>{m=!1,i=r.map(e=>{const t=e[Qa];if(t instanceof RegExp){const e=t.source;return 1!==e.length||"^"===e||"$"===e||"."===e||t.ignoreCase?2!==e.length||"\\"!==e[0]||["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(e[1])?nl(t):e[1]:e}if("function"==typeof t)return m=!0,{exec:t};if("object"==typeof t)return m=!0,t;if("string"==typeof t){if(1===t.length)return t;{const e=t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return nl(new RegExp(e))}}throw Error("non exhaustive match")})}),n("misc mapping",()=>{s=r.map(e=>e.tokenTypeIdx),o=r.map(e=>{const t=e.GROUP;if(t!==yl.SKIPPED){if("string"==typeof t)return t;if(void 0===t)return!1;throw Error("non exhaustive match")}}),a=r.map(e=>{const t=e.LONGER_ALT;if(t)return Array.isArray(t)?t.map(e=>r.indexOf(e)):[r.indexOf(t)]}),l=r.map(e=>e.PUSH_MODE),u=r.map(e=>Object.hasOwn(e,"POP_MODE"))}),n("Line Terminator Handling",()=>{const e=al(t.lineTerminatorCharacters);c=r.map(e=>!1),"onlyOffset"!==t.positionTracking&&(c=r.map(t=>Object.hasOwn(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===ol(t,e)&&qa(e,t.PATTERN)))}),n("Misc Mapping #2",()=>{h=r.map(rl),d=i.map(il),f=r.reduce((e,t)=>{const n=t.GROUP;return"string"==typeof n&&n!==yl.SKIPPED&&(e[n]=[]),e},{}),p=i.map((e,t)=>({pattern:i[t],longerAlt:a[t],canLineTerminator:c[t],isCustom:h[t],short:d[t],group:o[t],push:l[t],pop:u[t],tokenTypeIdx:s[t],tokenType:r[t]}))});let g=!0,E=[];return t.safeMode||n("First Char Optimization",()=>{E=r.reduce((e,n,r)=>{if("string"==typeof n.PATTERN){const t=hl(n.PATTERN.charCodeAt(0));ll(e,t,p[r])}else if(Array.isArray(n.START_CHARS_HINT)){let t;n.START_CHARS_HINT.forEach(n=>{const i=hl("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,ll(e,i,p[r]))})}else if(n.PATTERN instanceof RegExp)if(n.PATTERN.unicode)g=!1,t.ensureOptimizations&&Pa(`${Wa}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=Ha(n.PATTERN,t.ensureOptimizations);0===i.length&&(g=!1),i.forEach(t=>{ll(e,t,p[r])})}else t.ensureOptimizations&&Pa(`${Wa}\tTokenType: <${n.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return e},[])}),{emptyGroups:f,patternIdxToConfig:p,charCodeToPatternIdxToConfig:E,hasCustom:m,canBeOptimized:g}}(n,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[e]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[e]=r.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[e]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}this.lexerDefinitionWarning.forEach(e=>{Ba(e.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(r&&(this.handleModes=()=>{}),!1===this.trackStartLines&&(this.computeNewColumn=e=>e),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=()=>{}),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const e=Object.entries(this.canModeBeOptimized).reduce((e,[t,n])=>(!1===n&&e.push(t),e),[]);if(t.ensureOptimizations&&e.length>0)throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Ua={}}),this.TRACE_INIT("toFastProperties",()=>{na(this)})})}tokenize(e,t=this.defaultMode){if(this.lexerDefinitionErrors.length>0){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,s,o,a,l,u,c,h,d,f,p,m,g;const E=e,v=E.length;let C=0,D=0;const S=this.hasCustom?0:Math.floor(e.length/10),A=new Array(S),_=[];let y=this.trackStartLines?1:void 0,b=this.trackStartLines?1:void 0;const T=function(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(!Array.isArray(r))throw Error("non exhaustive match");t[n]=[]}),t}(this.emptyGroups),R=this.trackStartLines,x=this.config.lineTerminatorsPattern;let w=0,F=[],N=[];const L=[],O=[];Object.freeze(O);let I=!1;const k=e=>{if(1===L.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);_.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{L.pop();const e=L.at(-1);F=this.patternIdxToConfig[e],N=this.charCodeToPatternIdxToConfig[e],w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}};function M(e){L.push(e),N=this.charCodeToPatternIdxToConfig[e],F=this.patternIdxToConfig[e],w=F.length,w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}let P;M.call(this,t);const B=this.config.recoveryEnabled;for(;Ca.length){a=s,c=s.length,l=u,P=t;break}}}break}}if(-1!==c){if(h=P.group,void 0!==h&&(a=null!==a?a:e.substring(C,C+c),d=P.tokenTypeIdx,f=this.createTokenInstance(a,C,d,P.tokenType,y,b,c),this.handlePayload(f,l),!1===h?D=this.addToken(A,D,f):T[h].push(f)),!0===R&&!0===P.canLineTerminator){let t,n,r=0;x.lastIndex=0;do{a=null!==a?a:e.substring(C,C+c),t=x.test(a),!0===t&&(n=x.lastIndex-1,r++)}while(!0===t);0!==r?(y+=r,b=c-n,this.updateTokenEndLineColumnLocation(f,h,n,r,y,b,c)):b=this.computeNewColumn(b,c)}else b=this.computeNewColumn(b,c);C+=c,this.handleModes(P,k,M,f)}else{const t=C,n=y,i=b;let s=!1===B;for(;!1===s&&C`Expecting ${Tl(e)?`--\x3e ${bl(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o="\nbut found: '"+t[0].image+"'";return r?s+r+o:s+`one of these possible Token sequences:\n${e.reduce((e,t)=>e.concat(t),[]).map(e=>`[${e.map(e=>bl(e)).join(", ")}]`).map((e,t)=>` ${t+1}. ${e}`).join("\n")}`+o},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",s="\nbut found: '"+t[0].image+"'";return n?i+n+s:i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map(e=>`[${e.map(e=>bl(e)).join(",")}]`).join(" ,")}>`+s}};Object.freeze(Bl);const Ul={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},$l={buildDuplicateFoundError(e,t){const n=e.name,r=t[0],i=r.idx,s=va(r),o=(a=r)instanceof fa?a.terminalType.name:a instanceof ia?a.nonTerminalName:"";var a;let l=`->${s}${i>0?i:""}<- ${o?`with argument: ->${o}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,"\n"),l},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=e.prefixPath.map(e=>bl(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=0===e.alternation.idx?"":e.alternation.idx,n=0===e.prefixPath.length;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule,\n`;return r+=n?"These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n":`<${e.prefixPath.map(e=>bl(e)).join(", ")}> may appears as a prefix path in all these alternatives.\n`,r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=va(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${t} --\x3e ${e.leftRecursionPath.map(e=>e.name).concat([t]).join(" --\x3e ")}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof sa?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class Gl extends ga{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:rc.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Vl extends Ca{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){0===this.ruleStack.length?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Wl extends Vl{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const e=t.concat(n),r=new oa({definition:e});this.possibleTokTypes=Sa(r),this.found=!0}}}class Hl extends Ca{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class jl extends Hl{walkMany(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}}class zl extends Hl{walkManySep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}}class Xl extends Hl{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}}class Kl extends Hl{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}}function Yl(e,t,n=[]){n=[...n];let r=[],i=0;function s(s){const o=Yl(s.concat(e.slice(i+1)),t,n);return r.concat(o)}for(;n.length{0!==e.definition.length&&(r=s(e.definition))}),r;if(!(t instanceof fa))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:e.slice(i)}),r}function ql(e,t,n,r){const i=[...n];i.push(e.name);const s=[...r];return s.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:s}}var Ql;function Zl(e){if(e instanceof aa||"Option"===e)return Ql.OPTION;if(e instanceof ca||"Repetition"===e)return Ql.REPETITION;if(e instanceof la||"RepetitionMandatory"===e)return Ql.REPETITION_MANDATORY;if(e instanceof ua||"RepetitionMandatoryWithSeparator"===e)return Ql.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ha||"RepetitionWithSeparator"===e)return Ql.REPETITION_WITH_SEPARATOR;if(e instanceof da||"Alternation"===e)return Ql.ALTERNATION;throw Error("non exhaustive match")}function Jl(e,t,n,r){const i=e.length,s=e.every(e=>e.every(e=>1===e.length));if(t)return function(t){const r=t.map(e=>e.GATE);for(let t=0;te.flat()).reduce((e,t,n)=>(t.forEach(t=>{t.tokenTypeIdx in e||(e[t.tokenTypeIdx]=n),t.categoryMatches.forEach(t=>{Object.hasOwn(e,t)||(e[t]=n)})}),e),{});return function(){const e=this.LA_FAST(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t1===e.length),i=e.length;if(r&&!n){const t=e.flat();if(1===t.length&&0===t[0].categoryMatches.length){const e=t[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===e}}{const e=t.reduce((e,t,n)=>(e[t.tokenTypeIdx]=!0,t.categoryMatches.forEach(t=>{e[t]=!0}),e),[]);return function(){const t=this.LA_FAST(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;nYl([e],1)),r=ru(n.length),i=n.map(e=>{const t={};return e.forEach(e=>{iu(e.partialPath).forEach(e=>{t[e]=!0})}),t});let s=n;for(let e=1;e<=t;e++){const n=s;s=ru(n.length);for(let o=0;o{iu(e.partialPath).forEach(e=>{i[o][e]=!0})})}}}}return r}function au(e,t,n,r){const i=new nu(e,Ql.ALTERNATION,r);return t.accept(i),ou(i.result,n)}function lu(e,t,n,r){const i=new nu(e,n);t.accept(i);const s=i.result,o=new tu(t,e,n).startWalking();return ou([new oa({definition:s}),new oa({definition:o})],r)}function uu(e,t){e:for(let n=0;ne.every(e=>e.every(e=>0===e.categoryMatches.length)))}function hu(e){return`${va(e)}_#_${e.idx}_#_${du(e)}`}function du(e){return e instanceof fa?e.terminalType.name:e instanceof ia?e.nonTerminalName:""}class fu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function pu(e,t,n,r=[]){const i=[],s=mu(t.definition);if(0===s.length)return[];{const t=e.name;s.includes(e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:rc.LEFT_RECURSION,ruleName:t});const o=r.concat([e]),a=s.filter(e=>!o.includes(e)).flatMap(t=>{const i=[...r];return i.push(t),pu(e,t,n,i)});return i.concat(a)}}function mu(e){let t=[];if(0===e.length)return t;const n=e[0];if(n instanceof ia)t.push(n.referencedRule);else if(n instanceof oa||n instanceof aa||n instanceof la||n instanceof ua||n instanceof ha||n instanceof ca)t=t.concat(mu(n.definition));else if(n instanceof da)t=n.definition.map(e=>mu(e.definition)).flat();else if(!(n instanceof fa))throw Error("non exhaustive match");const r=Ea(n),i=e.length>1;if(r&&i){const n=e.slice(1);return t.concat(mu(n))}return t}class gu extends ga{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}class Eu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}const vu="MismatchedTokenException",Cu="NoViableAltException",Du="EarlyExitException",Su="NotAllInputParsedException",Au=[vu,Cu,Du,Su];function _u(e){return Au.includes(e.name)}Object.freeze(Au);class yu extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class bu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=vu}}class Tu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Cu}}class Ru extends yu{constructor(e,t){super(e,t),this.name=Su}}class xu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Du}}const wu={},Fu="InRuleRecoveryException";class Nu extends Error{constructor(e){super(e),this.name=Fu}}function Lu(e,t,n,r,i,s,o){const a=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[a];if(void 0===l){const e=this.getCurrRuleFullName();l=new s(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[a]=l}let u=l.token,c=l.occurrence;const h=l.isEndOfRule;0===this.RULE_STACK_IDX&&h&&void 0===u&&(u=Ml,c=1),void 0!==u&&void 0!==c&&this.shouldInRepetitionRecoveryBeTried(u,c,o)&&this.tryInRepetitionRecovery(e,t,n,u)}const Ou=1024,Iu=1280,ku=1536;function Mu(e,t,n){return n|t|e}class Pu{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:tc.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(0===t.length){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return e.flatMap(e=>pu(e,e,$l))}validateEmptyOrAlternatives(e){return e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.slice(0,-1).flatMap((r,i)=>0===function(e,t,n){const r="EXIT_NONE_TERMINAL",i=[r],s="EXIT_ALTERNATIVE";let o=!1;const a=t.length,l=a-1-1,u=[],c=[];for(c.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});0!==c.length;){const e=c.pop();if(e===s){o&&c.at(-1).idx<=l&&c.pop();continue}const h=e.def,d=e.idx,f=e.ruleStack,p=e.occurrenceStack;if(0===h.length)continue;const m=h[0];if(m===r){const e={idx:d,def:h.slice(1),ruleStack:f.slice(0,-1),occurrenceStack:p.slice(0,-1)};c.push(e)}else if(m instanceof fa)if(d=0;e--){const t={idx:d,def:m.definition[e].definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p};c.push(t),c.push(s)}else if(m instanceof oa)c.push({idx:d,def:m.definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p});else{if(!(m instanceof sa))throw Error("non exhaustive match");c.push(ql(m,d,f,p))}}return u}([r],[],fl).length?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:rc.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}(e,$l))}validateAmbiguousAlternationAlternatives(e,t){return e.flatMap(e=>function(e,t,n){const r=new gu;e.accept(r);let i=r.alternations;i=i.filter(e=>!0!==e.ignoreAmbiguities);return i.flatMap(r=>{const i=r.idx,s=r.maxLookahead||t,o=au(i,e,s,r),a=function(e,t,n,r){const i=[];return e.reduce((n,r,s)=>(!0===t.definition[s].ignoreAmbiguities||r.forEach(r=>{const o=[s];e.forEach((e,n)=>{s!==n&&uu(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&o.push(n)}),o.length>1&&!uu(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]).map(e=>{const i=e.alts.map(e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}(o,r,e,n),l=function(e,t,n,r){const i=e.reduce((e,t,n)=>{const r=t.map(e=>({idx:n,path:e}));return e.concat(r)},[]);return i.flatMap(e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const s=e.idx,o=e.path;return i.filter(e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx{const n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}));var n,r}).map(e=>{const i=[e.idx+1,s+1],o=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})})}(o,r,e,n);return a.concat(l)})}(e,t,$l))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return e.forEach(e=>{const i=new Eu;e.accept(i),i.allProductions.forEach(i=>{const s=Zl(i),o=i.maxLookahead||t;if(0===lu(i.idx,e,s,o)[0].flat().length){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:rc.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}(e,t,$l)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,s){const o=au(e,t,n);return s(o,r,cu(o)?pl:fl,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Jl)}buildLookaheadForOptional(e){return function(e,t,n,r,i,s){const o=lu(e,t,i,n),a=cu(o)?pl:fl;return s(o[0],a,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Zl(e.prodType),eu)}}const Bu=new class extends ga{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function Uu(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset"function"==typeof e.GATE);return s.hasPredicates=o,n.definition.push(s),i.forEach(e=>{const t=new oa({definition:[]});s.definition.push(t),Object.hasOwn(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Object.hasOwn(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),Hu}function Zu(e){return 0===e?"":`${e}`}function Ju(e){if(e<0||e>zu){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${zu+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const ec=Pl(Ml,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ec);const tc=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Bl,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),nc=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var rc,ic,sc;!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(rc||(rc={}));class oc{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",()=>{na(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=function(e){const t=Object.assign({errMsgProvider:Ul},e),n={};return e.rules.forEach(e=>{n[e.name]=e}),function(e,t){const n=new Gl(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(0===n.length&&!1===this.skipValidations){const e=function(e){var t;const n=null!==(t=e.errMsgProvider)&&void 0!==t?t:$l;return function(e,t,n,r){const i=e.flatMap(e=>function(e,t){const n=new fu;e.accept(n);const r=n.allProductions,i=Object.groupBy(r,hu),s=Object.fromEntries(Object.entries(i).filter(([e,t])=>t.length>1));return Object.values(s).map(n=>{const r=n[0],i=t.buildDuplicateFoundError(e,n),s=va(r),o={message:i,type:rc.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:s,occurrence:r.idx},a=du(r);return a&&(o.parameter=a),o})}(e,n)),s=function(e,t,n){const r=[],i=t.map(e=>e.name);return e.forEach(e=>{const t=e.name;if(i.includes(t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:rc.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}(e,t,n),o=e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:rc.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}(e,n)),a=e.flatMap(t=>function(e,t,n,r){const i=[],s=t.reduce((t,n)=>n.name===e.name?t+1:t,0);if(s>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:rc.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n));return i.concat(s,o,a)}(e.rules,e.tokenTypes,n,e.grammarName)}({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:$l,grammarName:t}),n=function(e){return e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}).map(e=>Object.assign({type:rc.CUSTOM_LOOKAHEAD_VALIDATION},e))}({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(e,n)}}),0===this.definitionErrors.length&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const e=function(e){const t={};return e.forEach(e=>{const n=new _a(e).startWalking();Object.assign(t,n)}),t}(Object.values(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!oc.DEFER_DEFINITION_ERRORS_HANDLING&&0!==this.definitionErrors.length)throw e=this.definitionErrors.map(e=>e.message),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initGastRecorder(t),n.initPerformanceTracer(t),Object.hasOwn(t,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=Object.hasOwn(t,"skipValidations")?t.skipValidations:tc.skipValidations}}oc.DEFER_DEFINITION_ERRORS_HANDLING=!1,ic=oc,sc=[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:tc.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Lu)}getTokenToInsert(e){const t=Pl(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let a=!1;const l=this.LA_FAST(1);let u=this.LA_FAST(1);const c=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),n=new bu(t,l,this.LA(0));n.resyncedTokens=o.slice(0,-1),this.SAVE_ERROR(n)};for(;!a;){if(this.tokenMatcher(u,r))return void c();if(n.call(this))return c(),void e.apply(this,t);this.tokenMatcher(u,i)?a=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o))}this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA_FAST(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getNextPossibleTokenTypes(e){const t=e.ruleStack[0],n=this.getGAstProductions()[t];return new Wl(n,e).startWalking()}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new Nu("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(0===t.length)return!1;const n=this.LA_FAST(1);return void 0!==t.find(e=>this.tokenMatcher(n,e))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(t).includes(e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA_FAST(1),n=2;for(;;){const r=e.find(e=>fl(t,e));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(0===this.RULE_STACK_IDX)return wu;const e=this.currRuleShortName,t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK,n=this.RULE_STACK_IDX+1,r=new Array(n);for(let i=0;ithis.getFollowSetFromFollowKey(e)).flat()}getFollowSetFromFollowKey(e){if(e===wu)return[Ml];const t=e.ruleName+e.idxInCallingRule+Aa+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Ml)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA_FAST(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return t.slice(0,-1)}attemptInRepetitionRecovery(e,t,n,r,i,s,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){const e=this.RULE_STACK_IDX+1,t=new Array(e);for(let n=0;n{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:o}=function(e){Bu.reset(),e.accept(Bu);const t=Bu.dslMethods;return Bu.reset(),t}(e);t.forEach(t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${va(t)}${n}`,()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=Mu(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),n.forEach(t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,va(t))}),r.forEach(t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,va(t))}),i.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Ou,"RepetitionMandatory",t.maxLookahead,va(t))}),s.forEach(t=>{this.computeLookaheadFunc(e,t.idx,ku,"RepetitionMandatoryWithSeparator",t.maxLookahead,va(t))}),o.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Iu,"RepetitionWithSeparator",t.maxLookahead,va(t))})})})}computeLookaheadFunc(e,t,n,r,i,s){this.TRACE_INIT(`${s}${0===t?"":t}`,()=>{const s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=Mu(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,s)})}getKeyForAutomaticLookahead(e,t){return Mu(this.currRuleShortName,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:tc.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=$u,this.setNodeLocationFromNode=$u,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Uu,this.setNodeLocationFromNode=Uu,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{}}else this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{}}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA_FAST(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];var r,i,s;i=t,s=e,void 0===(r=n).children[s]?r.children[s]=[i]:r.children[s].push(i),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(void 0===this.baseCstVisitorConstructor){const e=function(e,t){const n=function(){};Gu(n,e+"BaseSemantics");const r={visit:function(e,t){if(Array.isArray(e)&&(e=e[0]),void 0!==e)return this[e.name](e.children,t)},validateVisitor:function(){const e=function(e,t){const n=function(e,t){return t.filter(t=>"function"==typeof e[t]==0).map(t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Wu.MISSING_METHOD,methodName:t})).filter(Boolean)}(e,t);return n}(this,t);if(0!==e.length){const t=e.map(e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(void 0===this.baseCstVisitorWithDefaultsConstructor){const e=function(e,t,n){const r=function(){};Gu(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return t.forEach(e=>{i[e]=Vu}),(r.prototype=i).constructor=r,r}(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):ec}LA_FAST(e){const t=this.currIdx+e;return this.tokVector[t]}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?ec:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=pl,this.subruleIdx=0,this.currRuleShortName=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(Array.isArray(e)){if(0===e.length)throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(Array.isArray(e))this.tokensMap=e.reduce((e,t)=>(e[t.name]=t,e),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(Sl)){const t=Object.values(e.modes).flat(),n=[...new Set(t)];this.tokensMap=n.reduce((e,t)=>(e[t.name]=t,e),{})}else{if("object"!=typeof e||null===e)throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=Object.assign({},e)}this.tokensMap.EOF=Ml;const n=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every(e=>{var t;return 0==(null===(t=e.categoryMatches)||void 0===t?void 0:t.length)});this.tokenMatcher=n?pl:fl,El(Object.values(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:nc.resyncEnabled,i=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:nc.recoveryValueFunc,s=this.ruleShortNameIdx<<12;let o;return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,o=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...t){this.onBeforeParse(e);try{return o.apply(this,t)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:t,coreRule:o})}invokeRuleCatch(e,t,n){const r=0===this.RULE_STACK_IDX,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(_u(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(Ou,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,Ou,e,Xl)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(ku,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Kl],t,ku,e,Kl)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let s=!0;for(;!0===i.call(this)&&!0===s;)s=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,jl,s)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(Iu,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,zl],t,Iu,e,zl)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,ku,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=Array.isArray(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX]),this.cstFinallyStateUpdate()}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.coreRule.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw _u(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA_FAST(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new bu(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===Fu?n:e}}}saveRecogState(){const e=this.errors,t=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);const t=e.RULE_STACK;for(let e=0;e=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX])}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=n,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ml)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let e=0;e${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:rc.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){var n;const r=null!==(n=e.coreRule)&&void 0!==n?n:e;return function(){this.isBackTrackingStack.push(1);const e=this.saveRecogState();try{return r.apply(this,t),!0}catch(e){if(_u(e))return!1;throw e}finally{this.reloadRecogState(e),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Object.values(this.gastProductionsCache).map(pa)}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:tc.errorMessageProvider}SAVE_ERROR(e){if(_u(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=lu(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],s=[];for(let e=1;e<=this.maxLookahead;e++)s.push(this.LA(e));const o=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:s,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new xu(o,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=au(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));const s=this.LA(0),o=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:s,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Tu(o,this.LA(1),s))}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const n=t>0?t:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return ec}topLevelRuleRecord(e,t){try{const n=new sa({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}}optionInternalRecord(e,t){return qu.call(this,aa,e,t)}atLeastOneInternalRecord(e,t){qu.call(this,la,t,e)}atLeastOneSepFirstInternalRecord(e,t){qu.call(this,ua,t,e,ju)}manyInternalRecord(e,t){qu.call(this,ca,t,e)}manySepFirstInternalRecord(e,t){qu.call(this,ha,t,e,ju)}orInternalRecord(e,t){return Qu.call(this,e,t)}subruleInternalRecord(e,t,n){if(Ju(t),!e||!Object.hasOwn(e,"ruleName")){const n=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=e.ruleName,s=new ia({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(s),this.outputCst?Yu:Hu}consumeInternalRecord(e,t,n){if(Ju(t),!Cl(e)){const n=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=new fa({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),Ku}},class{initPerformanceTracer(e){if(Object.hasOwn(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=tc.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()}}],sc.forEach(e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach(n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(ic.prototype,n,r):ic.prototype[n]=e.prototype[n]})});class ac extends oc{constructor(e,t=tc){const n=Object.assign({},t);n.outputCst=!1,super(e,n)}}function lc(e){return void 0!==e.lineNoCont?e.lineNoCont:e.startLine}class uc{visit(e){return e&&this[e.kind](e)}arraySpecifier(e){this.visit(e.size)}binaryExpression(e){this.visit(e.lhs),this.visit(e.rhs)}methodCall(e){this.visit(e.on),this.visit(e.functionCall)}functionCall(e){this.visit(e.callee);for(const t of e.args)this.visit(t)}arrayAccess(e){this.visit(e.on),this.visit(e.index)}translationUnit(e){for(const t of e.declarations)this.visit(t)}assignmentExpression(e){this.visit(e.lhs),this.visit(e.rhs)}fieldAccess(e){this.visit(e.on)}conditionalExpression(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}postfixExpression(e){this.visit(e.on)}commaExpression(e){this.visit(e.lhs),this.visit(e.rhs)}unaryExpression(e){this.visit(e.on)}functionDefinition(e){this.visit(e.returnType);for(const t of e.params)this.visit(t);this.visit(e.body)}functionPrototype(e){this.visit(e.returnType);for(const t of e.params)this.visit(t)}parameterDeclaration(e){this.visit(e.arraySpecifier),this.visit(e.typeSpecifier)}typeSpecifier(e){hc(e.typeSpecifierNonArray)&&this.visit(e.typeSpecifierNonArray),this.visit(e.arraySpecifier)}compoundStatement(e){for(const t of e.statements)this.visit(t)}returnStatement(e){this.visit(e.what)}continueStatement(e){}breakStatement(e){}discardStatement(e){}declarator(e){this.visit(e.arraySpecifier),this.visit(e.init)}doWhileStatement(e){this.visit(e.statement),this.visit(e.conditionExpression)}whileStatement(e){this.visit(e.conditionExpression),this.visit(e.statement)}forStatement(e){this.visit(e.initExpression),this.visit(e.conditionExpression),this.visit(e.loopExpression),this.visit(e.statement)}expressionStatement(e){this.visit(e.expression)}initDeclaratorListDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}precisionDeclaration(e){this.visit(e.typeSpecifierNoPrec)}selectionStatement(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}storageQualifier(e){}switchStatement(e){this.visit(e.initExpression);for(const t of e.cases)this.visit(t)}caseLabel(e){this.visit(e.case_)}caseBlock(e){this.visit(e.caseLabel);for(const t of e.statements)this.visit(t)}fullySpecifiedType(e){this.visit(e.typeQualifier),this.visit(e.typeSpecifier)}typeQualifier(e){this.visit(e.storageQualifier),this.visit(e.layoutQualifier)}structSpecifier(e){for(const t of e.declarations)this.visit(t)}layoutQualifier(e){}invariantDeclaration(e){}structDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}variableExpression(e){}constantExpression(e){}uniformBlock(e){this.visit(e.typeQualifier);for(const t of e.declarations)this.visit(t);this.visit(e.arraySpecifier)}ppDefine(e){this.visit(e.node)}ppDir(e){}ppExtension(e){}ppCall(e){}ppPragma(e){}}function cc(e){return"tokenType"in e}function hc(e){return"kind"in e}function dc(e,t){const n=e.split("\n"),r=t.startLine,i=t.endLine;return"./src/compiler.lambda:"+r+":"+(t.startColumn-1)+"\n"+n.map((e,t)=>[t+1,e]).slice(r-2,i+2).map(([e,n])=>{var s,o,a;return e>=r&&e<=i&&(s=n,o=6+(r===e?t.startColumn-1:0),a=6+(i===e?t.endColumn:n.length),n=s+"\n"+"-".repeat(o)+"^".repeat(a-o)),(""+e).padStart(5)+" "+n}).join("\n")}const fc=["active","asm","atomic_uint","attribute","cast","class","coherent","common","double","dvec2","dvec3","dvec4","enum","extern","external","filter","fixed","fvec2","fvec3","fvec4","goto","half","hvec2","hvec3","hvec4","iimage1D","iimage1DArray","iimage2D","iimage2DArray","iimage3D","iimageBuffer","iimageCube","image1D","image1DArray","image2D","image2DArray","image3D","imageBuffer","imageCube","inline","input","interface","isampler1D","isampler1DArray","isampler2DMS","isampler2DMSArray","isampler2DRect","isamplerBuffer","long","namespace","noinline","noperspective","output","partition","patch","public","readonly","resource","restrict","sample","sampler1D","sampler1DArray","sampler1DArrayShadow","sampler1DShadow","sampler2DMS","sampler2DMSArray","sampler2DRect","sampler2DRectShadow","sampler3DRect","samplerBuffer","short","sizeof","static","subroutine","superp","template","this","typedef","uimage1D","uimage1DArray","uimage2D","uimage2DArray","uimage3D","uimageBuffer","uimageCube","union","unsigned","usampler1D","usampler1DArray","usampler2DMS","usampler2DMSArray","usampler2DRect","usamplerBuffer","using","volatile","volatile","writeonly"];var pc;!function(e){e.ASSIGN_OP=kl({name:"ASSIGN_OP",pattern:yl.NA}),e.UNARY_OP=kl({name:"UNARY_OP",pattern:yl.NA}),e.POSTFIX_OP=kl({name:"POSTFIX_OP",pattern:yl.NA}),e.PRECISION_QUALIFIER=kl({name:"PRECISION_QUALIFIER",pattern:yl.NA}),e.INTERPOLATION_QUALIFIER=kl({name:"INTERPOLATION_QUALIFIER",pattern:yl.NA}),e.MULTIPLICATIVE_OP=kl({name:"MULTIPLICATIVE_OP",pattern:yl.NA}),e.ADDITIVE_OP=kl({name:"ADDITIVE_OP",pattern:yl.NA}),e.SHIFT_OP=kl({name:"SHIFT_OP",pattern:yl.NA}),e.RELATIONAL_OP=kl({name:"RELATIONAL_OP",pattern:yl.NA}),e.EQUALITY_OP=kl({name:"EQUALITY_OP",pattern:yl.NA}),e.PARAMETER_QUALIFIER=kl({name:"PARAMETER_QUALIFIER",pattern:yl.NA}),e.WHITESPACE=kl({name:"WHITESPACE",pattern:/\s+/,group:yl.SKIPPED}),e.LINE_COMMENT=kl({name:"LINE_COMMENT",pattern:/\/\/[^\r\n]*/,group:"COMMENTS"}),e.MULTILINE_COMMENT=kl({name:"MULTILINE_COMMENT",pattern:/\/\*[\s\S]*?\*\//,group:"COMMENTS"}),e.MULASSIGN=kl({name:"MULASSIGN",pattern:"*=",label:"'*='",categories:e.ASSIGN_OP}),e.DIVASSIGN=kl({name:"DIVASSIGN",pattern:"/=",label:"'/='",categories:e.ASSIGN_OP}),e.MODASSIGN=kl({name:"MODASSIGN",pattern:"%=",label:"'%='",categories:e.ASSIGN_OP}),e.ADDASSIGN=kl({name:"ADDASSIGN",pattern:"+=",label:"'+='",categories:e.ASSIGN_OP}),e.SUBASSIGN=kl({name:"SUBASSIGN",pattern:"-=",label:"'-='",categories:e.ASSIGN_OP}),e.LEFTASSIGN=kl({name:"LEFTASSIGN",pattern:"<<=",label:"'<<='",categories:e.ASSIGN_OP}),e.RIGHTASSIGN=kl({name:"RIGHTASSIGN",pattern:">>=",label:"'>>='",categories:e.ASSIGN_OP}),e.ANDASSIGN=kl({name:"ANDASSIGN",pattern:"&=",label:"'&='",categories:e.ASSIGN_OP}),e.XORASSIGN=kl({name:"XORASSIGN",pattern:"^=",label:"'^='",categories:e.ASSIGN_OP}),e.ORASSIGN=kl({name:"ORASSIGN",pattern:"|=",label:"'|='",categories:e.ASSIGN_OP}),e.INC_OP=kl({name:"INC_OP",pattern:"++",label:"'++'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.QUESTION=kl({name:"QUESTION",pattern:"?",label:"'?'"}),e.COLON=kl({name:"COLON",pattern:":",label:"':'"}),e.DEC_OP=kl({name:"DEC_OP",pattern:"--",label:"'--'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.AND_OP=kl({name:"AND_OP",pattern:"&&",label:"'&&'"}),e.XOR_OP=kl({name:"XOR_OP",pattern:"^^",label:"'^^'"}),e.OR_OP=kl({name:"OR_OP",pattern:"||",label:"'||'"}),e.LEFT_OP=kl({name:"LEFT_OP",pattern:"<<",label:"'<<'",categories:e.SHIFT_OP}),e.RIGHT_OP=kl({name:"RIGHT_OP",pattern:">>",label:"'>>'",categories:e.SHIFT_OP}),e.EQ_OP=kl({name:"EQ_OP",pattern:"==",label:"'=='",categories:e.EQUALITY_OP}),e.NE_OP=kl({name:"NE_OP",pattern:"!=",label:"'!='",categories:e.EQUALITY_OP}),e.LE_OP=kl({name:"LE_OP",pattern:"<=",label:"'<='",categories:e.RELATIONAL_OP}),e.GE_OP=kl({name:"GE_OP",pattern:">=",label:"'>='",categories:e.RELATIONAL_OP}),e.LEFT_ANGLE=kl({name:"LEFT_ANGLE",pattern:"<",label:"'<'",categories:e.RELATIONAL_OP}),e.RIGHT_ANGLE=kl({name:"RIGHT_ANGLE",pattern:">",label:"'>'",categories:e.RELATIONAL_OP}),e.PLUS=kl({name:"PLUS",pattern:"+",label:"'+'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.TILDE=kl({name:"TILDE",pattern:"~",label:"'~'",categories:e.UNARY_OP}),e.BANG=kl({name:"BANG",pattern:"!",label:"'!'",categories:e.UNARY_OP}),e.CARET=kl({name:"CARET",pattern:"^",label:"'^'"}),e.AMPERSAND=kl({name:"AND",pattern:"&",label:"'&'"}),e.VERTICAL_BAR=kl({name:"VERTICAL_BAR",pattern:"|",label:"'|'"}),e.SLASH=kl({name:"SLASH",pattern:"/",label:"'/'",categories:e.MULTIPLICATIVE_OP}),e.PERCENT=kl({name:"PERCENT",pattern:"%",label:"'%'",categories:e.MULTIPLICATIVE_OP}),e.STAR=kl({name:"STAR",pattern:"*",label:"'*'",categories:e.MULTIPLICATIVE_OP}),e.DASH=kl({name:"DASH",pattern:"-",label:"'-'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.COMMA=kl({name:"COMMA",pattern:",",label:"','"}),e.EQUAL=kl({name:"EQUAL",pattern:"=",label:"'='",categories:e.ASSIGN_OP}),e.LEFT_PAREN=kl({name:"LEFT_PAREN",pattern:"(",label:"'('"}),e.RIGHT_PAREN=kl({name:"RIGHT_PAREN",pattern:")",label:"')'"}),e.LEFT_BRACKET=kl({name:"LEFT_BRACKET",pattern:"[",label:"'['"}),e.RIGHT_BRACKET=kl({name:"RIGHT_BRACKET",pattern:"]",label:"']'"}),e.LEFT_BRACE=kl({name:"LEFT_BRACE",pattern:"{",label:"'{'"}),e.RIGHT_BRACE=kl({name:"RIGHT_BRACE",pattern:"}",label:"'}'"}),e.SEMICOLON=kl({name:"SEMICOLON",pattern:";",label:"';'"}),e.IDENTIFIER=kl({name:"IDENTIFIER",pattern:yl.NA}),e.NON_PP_IDENTIFIER=kl({name:"NON_PP_IDENTIFIER",pattern:/[a-z_]\w*/i,categories:e.IDENTIFIER}),e.PP=kl({name:"PP",pattern:yl.NA,categories:e.IDENTIFIER});const t=(t,n)=>kl({name:t,pattern:n,categories:e.PP,longer_alt:e.NON_PP_IDENTIFIER});e.DEFINE=t("DEFINE","define"),e.UNDEF=t("UNDEF","undef"),e.ENDIF=t("ENDIF","endif"),e.IFDEF=t("IFDEF","ifdef"),e.IFNDEF=t("IFNDEF","ifndef"),e.ELIF=t("ELIF","elif"),e.ERROR=t("ERROR","error"),e.VERSION=t("VERSION","version"),e.PRAGMA_DIRECTIVE=kl({name:"PRAGMA_DIRECTIVE",pattern:/#\s*pragma\s+[^\r\n]*/}),e.LINE=t("LINE","line"),e.EXTENSION=t("EXTENSION","extension"),e.INCLUDE=t("INCLUDE","include"),e.HASH_INCLUDE_MODULE=kl({name:"HASH_INCLUDE_MODULE",pattern:/#\s*include\s*<[\w\-./\\$@ ]+>/}),e.HASH=kl({name:"HASH",pattern:"#"}),e.KEYWORD=kl({name:"KEYWORD",pattern:yl.NA});const n=(t,n)=>kl({name:t,pattern:t.toLowerCase(),label:"'"+t.toLowerCase()+"'",longer_alt:e.NON_PP_IDENTIFIER,categories:n?[e.KEYWORD,n]:e.KEYWORD});e.CONST=n("CONST"),e.UNIFORM=n("UNIFORM"),e.LAYOUT=n("LAYOUT"),e.CENTROID=n("CENTROID"),e.FLAT=n("FLAT",e.INTERPOLATION_QUALIFIER),e.SMOOTH=n("SMOOTH",e.INTERPOLATION_QUALIFIER),e.BREAK=n("BREAK"),e.CONTINUE=n("CONTINUE"),e.DO=n("DO"),e.PRECISION=n("PRECISION"),e.FOR=n("FOR"),e.WHILE=n("WHILE"),e.SWITCH=n("SWITCH"),e.CASE=n("CASE"),e.DEFAULT=n("DEFAULT"),e.IF=n("IF"),e.ELSE=n("ELSE"),e.INVARIANT=n("INVARIANT"),e.INOUT=n("INOUT",e.PARAMETER_QUALIFIER),e.OUT=n("OUT",e.PARAMETER_QUALIFIER),e.VOID=n("VOID"),e.STRUCT=n("STRUCT"),e.DISCARD=n("DISCARD"),e.RETURN=n("RETURN"),e.LOWP=n("LOWP",e.PRECISION_QUALIFIER),e.MEDIUMP=n("MEDIUMP",e.PRECISION_QUALIFIER),e.HIGHP=n("HIGHP",e.PRECISION_QUALIFIER),e.CONSTANT=kl({name:"CONSTANT",pattern:yl.NA}),e.BASIC_TYPE=kl({name:"BASIC_TYPE",pattern:yl.NA});const r=t=>kl({name:t.toUpperCase(),pattern:t,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE});e.BOOL=r("bool"),e.INT=r("int"),e.FLOAT=r("float"),e.MAT2X3=r("mat2x3"),e.MAT2X4=r("mat2x4"),e.MAT2X2=kl({name:"mat2x2".toUpperCase(),pattern:/mat2(?:x2)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat2"}),e.MAT3X2=r("mat3x2"),e.MAT3X4=r("mat3x4"),e.MAT3X3=kl({name:"mat3x3".toUpperCase(),pattern:/mat3(?:x3)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat3"}),e.MAT4X2=r("mat4x2"),e.MAT4X3=r("mat4x3"),e.MAT4X4=kl({name:"MAT4X4",pattern:/mat4(?:x4)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat4"}),e.VEC2=r("vec2"),e.VEC3=r("vec3"),e.VEC4=r("vec4"),e.IVEC2=r("ivec2"),e.IVEC3=r("ivec3"),e.IVEC4=r("ivec4"),e.BVEC2=r("bvec2"),e.BVEC3=r("bvec3"),e.BVEC4=r("bvec4"),e.UINT=r("uint"),e.UVEC2=r("uvec2"),e.UVEC3=r("uvec3"),e.UVEC4=r("uvec4"),e.USAMPLERCUBE=r("usamplerCube"),e.USAMPLER3D=r("usampler3D"),e.USAMPLER2DARRAY=r("usampler2DArray"),e.USAMPLER2D=r("usampler2D"),e.SAMPLERCUBESHADOW=r("samplerCubeShadow"),e.SAMPLERCUBE=r("samplerCube"),e.SAMPLER3D=r("sampler3D"),e.SAMPLER2DSHADOW=r("sampler2DShadow"),e.SAMPLER2DARRAYSHADOW=r("sampler2DArrayShadow"),e.SAMPLER2DARRAY=r("sampler2DArray"),e.SAMPLER2D=r("sampler2D"),e.ISAMPLERCUBE=r("isamplerCube"),e.ISAMPLER3D=r("isampler3D"),e.ISAMPLER2DARRAY=r("isampler2DArray"),e.ISAMPLER2D=r("isampler2D"),e.IN=n("IN",e.PARAMETER_QUALIFIER),e.VARYING=n("VARYING"),e.ATTRIBUTE=n("ATTRIBUTE"),e.BOOLCONSTANT=kl({name:"BOOLCONSTANT",pattern:/true|false/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.CONSTANT}),e.FLOATCONSTANT=kl({name:"FLOATCONSTANT",pattern:/((\d+\.\d*|\.\d+)(e[+-]?\d+)?|\d+e[+-]?\d+)f?/i,categories:e.CONSTANT}),e.DOT=kl({name:"DOT",pattern:".",label:"'.'"}),e.UINTCONSTANT=kl({name:"UINTCONSTANT",pattern:/0x[\da-f]+u|\d+u/i,categories:e.CONSTANT}),e.INTCONSTANT=kl({name:"INTCONSTANT",pattern:/0x[\da-f]+|\d+/i,categories:e.CONSTANT}),e.STRING=kl({name:"STRING",pattern:/"([^"\\]+|\\")+"/})}(pc||(pc={}));const mc=Object.values(pc).filter(e=>e!==pc.NON_PP_IDENTIFIER).flatMap(e=>Array.isArray(e)?e:[e]);mc.push(pc.NON_PP_IDENTIFIER);const gc=new yl(mc,{ensureOptimizations:!1});new class extends uc{constructor(){super(...arguments),this.markError=()=>{}}eval(e,t,n){return this.isDefined=t,this.markError=n,super.visit(e)}constantExpression(e){if(e.const_.tokenType!==pc.INTCONSTANT)throw new Error("XX");return+e.const_.image}unaryExpression(e){switch(e.op.tokenType){case pc.NON_PP_IDENTIFIER:return+this.isDefined(e.on.var.image);case pc.DASH:return-this.visit(e.on);case pc.TILDE:return~this.visit(e.on);case pc.BANG:return+!this.visit(e.on);case pc.PLUS:return this.visit(e.on);default:throw new Error(e.op.tokenType.name)}}binaryExpression(e){const t=this.visit(e.lhs);switch(e.op.tokenType){case pc.AND_OP:return t&&this.visit(e.rhs);case pc.OR_OP:return t||this.visit(e.rhs);default:{const n=this.visit(e.rhs);return 0|function(e,t,n){switch(e){case pc.PLUS:return t+n;case pc.DASH:return t-n;case pc.STAR:return t*n;case pc.PERCENT:return t%n;case pc.SLASH:return t/n;case pc.LEFT_OP:return t<>n;case pc.EQ_OP:return t===n;case pc.NE_OP:return t!==n;case pc.LE_OP:return t<=n;case pc.GE_OP:return t>=n;case pc.LEFT_ANGLE:return tn;case pc.XOR_OP:return t!==n;case pc.AND_OP:return t&&n;case pc.OR_OP:return t||n;case pc.AMPERSAND:return t&n;case pc.CARET:return t^n;case pc.VERTICAL_BAR:return t|n;default:throw new Error}}(e.op.tokenType,t,n)}}}variableExpression(e){return this.markError("P0001",e.var,"undefined identifier "+e.var.image),0}};const Ec=new class extends ac{getTokensOnLine(){const e=[],t=lc(this.LA(0));let n;for(;lc(n=this.LA(1))===t;)e.push(n),this.SKIP_TOKEN();return e}constructor(){super(mc,{skipValidations:!0}),this.multiplicativeExpression=this.RR("multiplicativeExpression",()=>this.LEFT_ASSOC(this.preprocessing?this.ppUnaryExpression:this.unaryExpression,pc.MULTIPLICATIVE_OP)),this.additiveExpression=this.RR("additiveExpression",()=>this.LEFT_ASSOC(this.multiplicativeExpression,pc.ADDITIVE_OP)),this.shiftExpression=this.RR("shiftExpression",()=>this.LEFT_ASSOC(this.additiveExpression,pc.SHIFT_OP)),this.relationalExpression=this.RR("relationalExpression",()=>this.LEFT_ASSOC(this.shiftExpression,pc.RELATIONAL_OP)),this.equalityExpression=this.RR("equalityExpression",()=>this.LEFT_ASSOC(this.relationalExpression,pc.EQUALITY_OP)),this.andExpression=this.RR("andExpression",()=>this.LEFT_ASSOC(this.equalityExpression,pc.AMPERSAND)),this.exclusiveOrExpression=this.RR("exclusiveOrExpression",()=>this.LEFT_ASSOC(this.andExpression,pc.CARET)),this.inclusiveOrExpression=this.RR("inclusiveOrExpression",()=>this.LEFT_ASSOC(this.exclusiveOrExpression,pc.VERTICAL_BAR)),this.logicalAndExpression=this.RR("logicalAndExpression",()=>this.LEFT_ASSOC(this.inclusiveOrExpression,pc.AND_OP)),this.logicalXorExpression=this.RR("logicalXorExpression",()=>this.LEFT_ASSOC(this.logicalAndExpression,pc.XOR_OP)),this.logicalOrExpression=this.RR("logicalOrExpression",()=>this.LEFT_ASSOC(this.logicalXorExpression,pc.OR_OP)),this.assignmentExpression=this.RR("assignmentExpression",()=>{const e=this.SUBRULE(this.conditionalExpression);return this.OPTION(()=>{const t=this.CONSUME(pc.ASSIGN_OP),n=this.SUBRULE1(this.assignmentExpression);return{kind:"assignmentExpression",lhs:e,op:t,rhs:n}})??e}),this.expression=this.RR("expression",()=>{let e;return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.SUBRULE(this.assignmentExpression);return e=e?{kind:"commaExpression",lhs:e,rhs:t}:t}}),e}),this.conditionalExpression=this.RR("conditionalExpression",()=>{const e=this.SUBRULE1(this.logicalOrExpression);return this.OPTION(()=>({kind:"conditionalExpression",condition:e,QUESTION:this.CONSUME(pc.QUESTION),yes:this.SUBRULE2(this.expression),COLON:this.CONSUME(pc.COLON),no:this.SUBRULE3(this.assignmentExpression)}))??e}),this.switchStatement=this.RR("switchStatement",()=>{this.CONSUME(pc.SWITCH),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);this.CONSUME(pc.RIGHT_PAREN),this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.caseBlock))),this.CONSUME(pc.RIGHT_BRACE),{kind:"switchStatement",initExpression:e,cases:t}}),this.caseBlock=this.RR("caseBlock",()=>{const e=this.SUBRULE(this.caseLabel),t=[];return this.MANY1(()=>t.push(this.SUBRULE(this.statement))),{kind:"caseBlock",caseLabel:e,statements:t}}),this.jumpStatement=this.RR("jumpStatement",()=>{const e=this.OR([{ALT:()=>(this.CONSUME(pc.CONTINUE),{kind:"continueStatement"})},{ALT:()=>(this.CONSUME(pc.BREAK),{kind:"breakStatement"})},{ALT:()=>(this.CONSUME(pc.DISCARD),{kind:"discardStatement"})},{ALT:()=>(this.CONSUME(pc.RETURN),{kind:"returnStatement",what:this.OPTION(()=>this.SUBRULE(this.expression))})}]);return this.CONSUME(pc.SEMICOLON),e}),this.primaryExpression=this.RR("primaryExpression",()=>this.OR([{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),e}},{ALT:()=>({kind:"variableExpression",var:this.CONSUME(pc.IDENTIFIER)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.CONSTANT)})}])),this.constantExpression=this.RR("constantExpression",()=>this.SUBRULE(this.conditionalExpression)),this.layoutQualifier=this.RR("layoutQualifier",()=>{this.CONSUME(pc.LAYOUT),this.CONSUME(pc.LEFT_PAREN);const e=[];return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.CONSUME(pc.IDENTIFIER);let n;this.OPTION(()=>{this.CONSUME(pc.EQUAL),n=this.OR([{ALT:()=>this.CONSUME(pc.INTCONSTANT)},{ALT:()=>this.CONSUME(pc.UINTCONSTANT)}])}),e.push({IDENTIFIER:t,init:n})}}),this.CONSUME(pc.RIGHT_PAREN),{kind:"layoutQualifier",layoutQualifierIds:e}}),this.storageQualifier=this.RR("storageQualifier",()=>{let e,t,n,r,i,s,o;return this.OR([{ALT:()=>e=this.CONSUME(pc.CONST)},{ALT:()=>{t=this.OPTION(()=>this.CONSUME(pc.CENTROID)),this.OR9([{ALT:()=>n=this.CONSUME(pc.IN)},{ALT:()=>r=this.CONSUME(pc.OUT)},{ALT:()=>s=this.CONSUME(pc.VARYING)},{ALT:()=>o=this.CONSUME(pc.ATTRIBUTE)}])}},{ALT:()=>i=this.CONSUME(pc.UNIFORM)}]),{kind:"storageQualifier",CONST:e,CENTROID:t,IN:n,OUT:r,VARYING:s,ATTRIBUTE:o,UNIFORM:i}}),this.typeQualifier=this.RR("typeQualifier",()=>{let e,t,n,r;return this.OR([{ALT:()=>e=this.SUBRULE(this.storageQualifier)},{ALT:()=>{t=this.SUBRULE1(this.layoutQualifier),e=this.OPTION1(()=>this.SUBRULE2(this.storageQualifier))}},{ALT:()=>{n=this.CONSUME(pc.INTERPOLATION_QUALIFIER),e=this.OPTION2(()=>this.SUBRULE3(this.storageQualifier))}},{ALT:()=>{r=this.CONSUME(pc.INVARIANT),n=this.OPTION3(()=>this.CONSUME1(pc.INTERPOLATION_QUALIFIER)),e=this.SUBRULE7(this.storageQualifier)}}]),{kind:"typeQualifier",storageQualifier:e,layoutQualifier:t,interpolationQualifier:n,invariantQualifier:r}}),this.precisionQualifier=this.RR("precisionQualifier",()=>this.CONSUME(pc.PRECISION_QUALIFIER)),this.arraySpecifier=this.RR("arraySpecifier",()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.OPTION3(()=>this.SUBRULE(this.constantExpression));return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arraySpecifier",size:e}}),this.typeSpecifierNonArray=this.RR("typeSpecifierNonArray",()=>this.OR([{ALT:()=>this.CONSUME(pc.BASIC_TYPE)},{ALT:()=>this.CONSUME(pc.VOID)},{ALT:()=>this.SUBRULE(this.structSpecifier)},{ALT:()=>this.CONSUME(pc.IDENTIFIER)}])),this.typeSpecifierNoPrec=this.RR("typeSpecifierNoPrec",()=>{const e=this.SUBRULE(this.typeSpecifierNonArray);return{kind:"typeSpecifier",precisionQualifier:void 0,arraySpecifier:this.OPTION1(()=>this.SUBRULE(this.arraySpecifier)),typeSpecifierNonArray:e}}),this.functionCall=this.RR("functionCall",()=>{const e=this.SUBRULE(this.typeSpecifierNoPrec);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({DEF:()=>t.push(this.SUBRULE(this.assignmentExpression)),SEP:pc.COMMA}),this.CONSUME(pc.RIGHT_PAREN),{kind:"functionCall",callee:e,args:t}}),this.functionCallHeader=this.RULE("functionCallHeader",()=>{this.SUBRULE(this.typeSpecifierNoPrec),this.CONSUME(pc.LEFT_PAREN)}),this.postfixExpression=this.RR("postfixExpression",()=>{const e=this.LA(1);let t=this.OR1([{GATE:this.BACKTRACK(this.functionCallHeader),ALT:()=>this.SUBRULE1(this.functionCall)},{ALT:()=>this.SUBRULE(this.primaryExpression)}]);return this.MANY(()=>{t=this.OR2([{ALT:()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arrayAccess",on:t,index:e}}},{ALT:()=>{this.CONSUME1(pc.DOT);const e=this.SUBRULE2(this.functionCall);return{kind:"methodCall",on:t,functionCall:e}}},{ALT:()=>{this.CONSUME2(pc.DOT);const e=this.CONSUME(pc.IDENTIFIER);return{kind:"fieldAccess",on:t,field:e}}},{ALT:()=>{const e=this.CONSUME(pc.POSTFIX_OP);return{kind:"postfixExpression",on:t,op:e}}}]),this.FINALIZE(t,e)}),t}),this.unaryExpression=this.RR("unaryExpression",()=>this.OR([{ALT:()=>this.SUBRULE1(this.postfixExpression)},{ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.UNARY_OP),on:this.SUBRULE2(this.unaryExpression)})}])),this.ppUnaryExpression=this.RR("ppUnaryExpression",()=>this.OR([{GATE:()=>this.LA(1).tokenType===pc.NON_PP_IDENTIFIER&&"defined"===this.LA(1).image,ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.IDENTIFIER),on:{kind:"variableExpression",var:this.OR1([{ALT:()=>this.SUBRULE(this.ppIdentifier)},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE1(this.ppIdentifier);return this.CONSUME(pc.RIGHT_PAREN),e}}])}})},{ALT:()=>({kind:"unaryExpression",op:this.OR2([{ALT:()=>this.CONSUME(pc.PLUS)},{ALT:()=>this.CONSUME(pc.DASH)},{ALT:()=>this.CONSUME(pc.TILDE)},{ALT:()=>this.CONSUME(pc.BANG)}]),on:this.SUBRULE2(this.ppUnaryExpression)})},{ALT:()=>this.SUBRULE(this.ppPrimaryExpression)}])),this.ppPrimaryExpression=this.RR("ppPrimaryExpression",()=>this.OR([{ALT:()=>({kind:"variableExpression",var:this.SUBRULE(this.ppIdentifier)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.INTCONSTANT)})},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.ppConstantExpression);return this.CONSUME(pc.RIGHT_PAREN),e}}])),this.ppConstantExpression=this.RR("ppConstantExpression",()=>{try{return this.preprocessing=!0,this.LEFT_ASSOC(this.logicalAndExpression,pc.OR_OP)}finally{this.preprocessing=!1}}),this.typeSpecifier=this.RR("typeSpecifier",()=>{const e=this.OPTION(()=>this.SUBRULE(this.precisionQualifier)),t=this.SUBRULE(this.typeSpecifierNoPrec);return Object.assign({},t,{precisionQualifier:e})}),this.parameterDeclaration=this.RR("parameterDeclaration",()=>{const e=this.OPTION(()=>this.CONSUME(pc.CONST)),t=this.OPTION1(()=>this.CONSUME(pc.PARAMETER_QUALIFIER)),n=this.SUBRULE(this.typeSpecifier);let r,i;return this.OPTION2(()=>{r=this.CONSUME2(pc.IDENTIFIER),i=this.OPTION3(()=>this.SUBRULE(this.arraySpecifier))}),{kind:"parameterDeclaration",parameterTypeQualifier:e,pName:r,arraySpecifier:i,parameterQualifier:t,typeSpecifier:n}}),this.fullySpecifiedType=this.RR("fullySpecifiedType",()=>({kind:"fullySpecifiedType",typeQualifier:this.OPTION(()=>this.SUBRULE(this.typeQualifier)),typeSpecifier:this.SUBRULE(this.typeSpecifier)})),this.structDeclaration=this.RR("structDeclaration",()=>{const e=this.SUBRULE(this.fullySpecifiedType),t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME(pc.IDENTIFIER),arraySpecifier:this.OPTION(()=>this.SUBRULE(this.arraySpecifier)),init:void 0};return t.push(e),e})}),this.CONSUME(pc.SEMICOLON),{kind:"structDeclaration",fsType:e,declarators:t}}),this.structSpecifier=this.RR("structSpecifier",()=>{this.CONSUME(pc.STRUCT);const e=this.OPTION2(()=>this.CONSUME(pc.IDENTIFIER));this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),{kind:"structSpecifier",name:e,declarations:t}}),this.initializer=this.RR("initializer",()=>this.SUBRULE(this.assignmentExpression)),this.singleDeclaration=this.RULE("singleDeclaration",()=>this.OR([{ALT:()=>{this.SUBRULE(this.fullySpecifiedType),this.OPTION1(()=>{this.CONSUME1(pc.IDENTIFIER),this.OPTION2(()=>{this.CONSUME(pc.LEFT_BRACKET),this.OPTION3(()=>this.SUBRULE(this.constantExpression)),this.CONSUME(pc.RIGHT_BRACKET)}),this.OPTION4(()=>{this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)})})}},{ALT:()=>({kind:"invariantDeclaration",INVARIANT:this.CONSUME(pc.INVARIANT),IDENTIFIER:this.CONSUME2(pc.IDENTIFIER)})}])),this.initDeclaratorList=this.RR("initDeclaratorList",()=>this.SUBRULE(this.externalDeclaration,{ARGS:[!1,!1]})),this.expressionStatement=this.RR("expressionStatement",()=>{const e=this.OPTION(()=>this.SUBRULE(this.expression));return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:e}}),this.condition=this.RR("condition",()=>this.OR({MAX_LOOKAHEAD:4,DEF:[{GATE:this.BACKTRACK(this.singleDeclaration),ALT:()=>{const e=this.SUBRULE2(this.fullySpecifiedType),t=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.EQUAL),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:[{kind:"declarator",name:t,init:this.SUBRULE3(this.initializer),arraySpecifier:void 0}]}}},{ALT:()=>this.SUBRULE(this.expression)}]})),this.caseLabel=this.RR("caseLabel",()=>this.OR([{ALT:()=>{this.CONSUME(pc.CASE);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.COLON),{kind:"caseLabel",case_:e}}},{ALT:()=>(this.CONSUME2(pc.DEFAULT),this.CONSUME2(pc.COLON),{kind:"caseLabel",case_:void 0})}])),this.selectionStatement=this.RR("selectionStatement",()=>{this.CONSUME(pc.IF),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),{kind:"selectionStatement",condition:e,yes:this.SUBRULE2(this.statement,{ARGS:[!0]}),no:this.OPTION(()=>(this.CONSUME(pc.ELSE),this.SUBRULE3(this.statement,{ARGS:[!0]})))}}),this.statement=this.RR("statement",e=>this.OR([{ALT:()=>this.SUBRULE(this.ppDirective),IGNORE_AMBIGUITIES:!0},{ALT:()=>{const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:{kind:"variableExpression",var:e}}},IGNORE_AMBIGUITIES:!0},{GATE:this.BACKTRACK(this.expressionStatement),ALT:()=>this.SUBRULE(this.expressionStatement)},{ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.selectionStatement)},{ALT:()=>this.SUBRULE(this.switchStatement)},{ALT:()=>this.SUBRULE(this.iterationStatement)},{ALT:()=>this.SUBRULE(this.jumpStatement)},{ALT:()=>this.SUBRULE(this.compoundStatement,{ARGS:[!!e]})}])),this.compoundStatement=this.RR("compoundStatement",e=>{if("object"==typeof e)throw new Error;this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.statement))),this.CONSUME(pc.RIGHT_BRACE),{kind:"compoundStatement",statements:t,newScope:!!e}}),this.iterationStatement=this.RR("iterationStatement",()=>this.OR([{ALT:()=>{this.CONSUME(pc.WHILE),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.condition);return this.CONSUME(pc.RIGHT_PAREN),{kind:"whileStatement",conditionExpression:e,statement:this.SUBRULE(this.statement)}}},{ALT:()=>{this.CONSUME2(pc.DO);const e=this.SUBRULE2(this.statement,{ARGS:[!0]});this.CONSUME2(pc.WHILE),this.CONSUME2(pc.LEFT_PAREN);const t=this.SUBRULE2(this.expression);return this.CONSUME2(pc.RIGHT_PAREN),this.CONSUME2(pc.SEMICOLON),{kind:"doWhileStatement",statement:e,conditionExpression:t}}},{ALT:()=>{this.CONSUME3(pc.FOR),this.CONSUME3(pc.LEFT_PAREN);const e=this.OR3([{GATE:this.BACKTRACK(this.initDeclaratorList),ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.expressionStatement)}]),t=this.OPTION3(()=>this.SUBRULE3(this.condition));this.CONSUME4(pc.SEMICOLON);const n=this.OPTION4(()=>this.SUBRULE4(this.expression));return this.CONSUME3(pc.RIGHT_PAREN),{kind:"forStatement",initExpression:e,conditionExpression:t,loopExpression:n,statement:this.SUBRULE3(this.statement)}}}])),this.translationUnit=this.RR("translationUnit",()=>{const e=[];return this.AT_LEAST_ONE(()=>e.push(this.SUBRULE(this.externalDeclaration,{ARGS:[!0,!0]}))),{kind:"translationUnit",declarations:e}}),this.uniformBlock=this.RR("uniformBlock",()=>{const e=this.SUBRULE(this.typeQualifier),t=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_BRACE);const n=[];let r,i;return this.MANY(()=>n.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),this.OPTION(()=>{r=this.CONSUME1(pc.IDENTIFIER),i=this.OPTION1(()=>this.SUBRULE(this.arraySpecifier))}),this.CONSUME(pc.SEMICOLON),{kind:"uniformBlock",typeQualifier:e,blockName:t,declarations:n,namespace:r,arraySpecifier:i}}),this.uniformBlockHeader=this.RULE("uniformBlockHeader",()=>{this.OPTION(()=>this.SUBRULE(this.layoutQualifier)),this.CONSUME(pc.UNIFORM),this.CONSUME(pc.IDENTIFIER),this.CONSUME(pc.LEFT_BRACE)}),this.typeQualifierDeclaration=this.RR("typeQualifierDeclaration",()=>{const e=this.SUBRULE(this.typeQualifier);return this.CONSUME(pc.SEMICOLON),{kind:"typeQualifierDeclaration",typeQualifier:e}}),this.externalDeclaration=this.RR("externalDeclaration",(e,t)=>this.OR([{ALT:()=>this.SUBRULE(this.ppCall)},{ALT:()=>this.SUBRULE(this.ppDirective)},{GATE:this.BACKTRACK(this.typeQualifierDeclaration),ALT:()=>this.SUBRULE(this.typeQualifierDeclaration)},{GATE:e?this.BACKTRACK(this.uniformBlockHeader):()=>!1,ALT:()=>this.SUBRULE(this.uniformBlock)},{ALT:()=>{const e=this.SUBRULE(this.fullySpecifiedType);return this.OR2([{GATE:t?void 0:()=>!1,ALT:()=>{const t=this.CONSUME1(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const n=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>n.push(this.SUBRULE(this.parameterDeclaration))}),this.CONSUME(pc.RIGHT_PAREN),this.OR3([{ALT:()=>(this.CONSUME(pc.SEMICOLON),{kind:"functionPrototype",name:t,returnType:e,params:n})},{ALT:()=>{const r=this.SUBRULE(this.compoundStatement);return{kind:"functionDefinition",name:t,returnType:e,params:n,body:r}},IGNORE_AMBIGUITIES:!1}])}},{ALT:()=>{const t=[];return this.MANY_SEP2({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME3(pc.IDENTIFIER),arraySpecifier:this.OPTION5(()=>this.SUBRULE(this.arraySpecifier)),init:this.OPTION7(()=>(this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)))};return t.push(e),e})}),this.CONSUME2(pc.SEMICOLON),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:t}}}])}},{ALT:()=>{this.CONSUME(pc.PRECISION);const e=this.CONSUME(pc.PRECISION_QUALIFIER),t=this.SUBRULE(this.typeSpecifierNoPrec);return this.CONSUME3(pc.SEMICOLON),{kind:"precisionDeclaration",precisionQualifier:e,typeSpecifierNoPrec:t}}}])),this.ppDefine=this.RR("ppDefine",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.DEFINE);const e=this.CONSUME(pc.IDENTIFIER),t=this.LA(1).tokenType===pc.LEFT_PAREN&&e.endOffset+1===this.LA(1).startOffset,n={kind:"ppDefine",what:e,params:this.OPTION({GATE:()=>t,DEF:()=>{this.CONSUME(pc.LEFT_PAREN);const e=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>e.push(this.SUBRULE(this.ppIdentifier))}),this.CONSUME(pc.RIGHT_PAREN),e}}),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(n),n}),this.ppInclude=this.RR("ppInclude",()=>{let e="";return this.OR([{ALT:()=>{const t=this.CONSUME(pc.HASH_INCLUDE_MODULE);e=t.image.substring(t.image.indexOf("<"))}},{ALT:()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.INCLUDE),e=this.CONSUME(pc.STRING).image}}]),{kind:"ppInclude",what:e}}),this.ppCall=this.RR("ppCall",()=>{const e=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>{const e=[];this.MANY(()=>this.OR({DEF:[{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>e.push(this.CONSUME(pc.BASIC_TYPE))},{ALT:()=>e.push(this.CONSUME(pc.ASSIGN_OP))},{ALT:()=>e.push(this.CONSUME(pc.SHIFT_OP))},{ALT:()=>e.push(this.CONSUME(pc.CONSTANT))},{ALT:()=>e.push(this.CONSUME(pc.KEYWORD))},{ALT:()=>e.push(this.CONSUME2(pc.IDENTIFIER))}]})),t.push({tokens:e,node:void 0})},MAX_LOOKAHEAD:1}),this.CONSUME(pc.RIGHT_PAREN),{kind:"ppCall",callee:e,args:t}}),this.ppCallArg=this.RULE("ppCallArg",()=>{const e=[];return e.push(this.CONSUME(pc.LEFT_PAREN)),this.MANY(()=>this.OR([{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>(e.push(this.LA(1)),this.SKIP_TOKEN())}])),e.push(this.CONSUME(pc.RIGHT_PAREN)),e}),this.ppNone=this.RR("ppNone",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.ELSE)},{ALT:()=>this.CONSUME(pc.ENDIF)}]),tokens:[],node:void 0};return this.ppDefs.push(e),e}),this.ppMulti=this.RR("ppMulti",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IF)},{ALT:()=>this.CONSUME(pc.ELIF)},{ALT:()=>this.CONSUME(pc.ERROR)},{ALT:()=>this.CONSUME(pc.VERSION)},{ALT:()=>this.CONSUME(pc.LINE)}]),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(e),e}),this.ppPragma=this.RR("ppPragma",()=>({kind:"ppPragma",dir:this.CONSUME(pc.PRAGMA_DIRECTIVE)})),this.ppSingle=this.RR("ppSingle",()=>(this.CONSUME(pc.HASH),{kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IFDEF)},{ALT:()=>this.CONSUME(pc.IFNDEF)}]),tokens:[this.CONSUME(pc.IDENTIFIER)],node:void 0})),this.ppExtension=this.RR("ppExtension",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.EXTENSION);const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.COLON),{kind:"ppExtension",extension:e,behavior:this.CONSUME1(pc.IDENTIFIER)}}),this.ppDirective=this.RR("ppDirective",()=>this.OR([{ALT:()=>this.SUBRULE(this.ppDefine)},{ALT:()=>this.SUBRULE(this.ppExtension)},{ALT:()=>this.SUBRULE(this.ppNone)},{ALT:()=>this.SUBRULE(this.ppSingle)},{ALT:()=>this.SUBRULE(this.ppMulti)},{ALT:()=>this.SUBRULE(this.ppPragma)},{ALT:()=>this.SUBRULE(this.ppInclude)}])),this.ppIdentifier=this.RR("ppIdentifier",()=>this.OR([{ALT:()=>this.CONSUME(pc.IDENTIFIER)},{ALT:()=>this.CONSUME(pc.KEYWORD)},{ALT:()=>this.CONSUME(pc.BASIC_TYPE)}])),this.ppDefs=[],this.performSelfAnalysis()}reset(){super.reset(),this.ppDefs=[],this.backtracking=!1,this.preprocessing=!1}LEFT_ASSOC(e,t){const n=this.LA(1);let r=this.SUBRULE1(e);return this.MANY(()=>{const i=this.CONSUME(t),s=this.SUBRULE2(e);return r={kind:"binaryExpression",lhs:r,rhs:s,op:i,firstToken:n,lastToken:this.LA(0)},r}),r}ANNOTATE(e){return(...t)=>{const n=this.LA(1),r=e(...t);return r&&hc(r)&&!r.firstToken&&this.FINALIZE(r,n),r}}BACKTRACK(e,t){const n=super.BACKTRACK(e,t);return function(){try{return this.backtracking=!0,n.call(this)}finally{this.backtracking=!1}}}RR(e,t,n){return super.RULE(e,this.ANNOTATE(t),n)}FINALIZE(e,t){this.RECORDING_PHASE||this.backtracking||(e.firstToken=t,e.lastToken=this.LA(0))}isAtEof(){return this.LA(1).tokenType===Ml}};const{ll:{printDocToString:vc},LX:{indentIfBreak:Cc,group:Dc,indent:Sc,join:Ac,line:_c,softline:yc,hardline:bc,fill:Tc,lineSuffixBoundary:Rc}}=r,xc=new class extends uc{constructor(){super(...arguments),this.result=void 0}visit(e){if(!this.result){const t=this.result=[];return super.visit(e),this.result=void 0,t}e&&this.result.push(e)}};function wc(e){return(cc(e)?e:e.lastToken).endOffset+1}const Fc={"glsl-parser":{parse(e,t){const n=function(e){const t=function(e){const t=[];let n="",r=0,i=0;return{result:e.replace(/\\(\r\n|\n\r|\r|\n)(.*?)(?:(?=\\?[\r\n])|$)/g,(s,o,a,l)=>{r++,i+=function(e,t){let n=t;for(;n>=0&&"\r"!==e[n]&&"\n"!==e[n];)n--;return t-n-1}(e,l),t.push({originalOffset:l+1+o.length,newOffset:l-n.length,length:a.length,lineDiff:-r,columnDiff:i}),n+=" "+o;let u="";return e.length>l+s.length&&"\\"===e[l+s.length]||(u=n,n="",r=0,i=0),a+u}),changes:t}}(e),n=gc.tokenize(t.result);!function(e,t){if(t.errors.length)throw new Error("LEXER ERROR: "+t.errors.map(t=>t.message+":\n"+dc(e,{startLine:t.line,startColumn:t.column,endLine:t.line,endColumn:t.column+t.length})).join())}(t.result,n),function(e,t){let n=0;function r(e,t){const n=t.originalOffset-t.newOffset;e.startOffset>=t.newOffset&&(e.lineNoCont=e.startLine,e.startOffset+=n,e.startLine-=t.lineDiff,e.startColumn-=t.columnDiff),e.endOffset+=n,e.endLine-=t.lineDiff,e.endColumn-=t.columnDiff}for(const i of t){for(;e[n]&&e[n].endOffset0)throw new Error("PARSE ERROR: "+t.map(t=>t.message+"\n"+t.context.ruleStack.join(" > ")+"\n"+dc(e,t.token)).join("\n"))}(t.result,Ec.errors);const i=Ec.ppDefs;function s(e,t){Ec.input=e;const n=t(Ec);return Ec.isAtEof()&&0===Ec.errors.length?n:void 0}for(const e of i)e.node=s(e.tokens,e=>e.externalDeclaration(!0,!0))??s(e.tokens,e=>e.statement())??s(e.tokens,e=>e.expression());return r.comments=n.groups.COMMENTS,r}(e);return n.comments?.forEach(e=>e.value=JSON.stringify(e)),n},astFormat:"glsl-ast",locStart:function(e){return(cc(e)?e:e.firstToken).startOffset},locEnd:wc}};function Nc(e){switch(e){case pc.STAR:case pc.SLASH:case pc.PERCENT:return 4;case pc.PLUS:case pc.DASH:return 5;case pc.LEFT_OP:case pc.RIGHT_OP:return 6;case pc.LEFT_ANGLE:case pc.RIGHT_ANGLE:case pc.LE_OP:case pc.GE_OP:return 7;case pc.EQ_OP:case pc.NE_OP:return 8;case pc.AMPERSAND:return 9;case pc.CARET:return 10;case pc.VERTICAL_BAR:return 11;case pc.AND_OP:case pc.XOR_OP:return 12;case pc.OR_OP:return 13;case pc.COMMA:return 17;default:throw new Error}}function Lc(e,t){switch(e.kind){default:return 1;case"variableExpression":return t?.find(t=>t.image===e.var.image)?18:1;case"arrayAccess":case"functionCall":case"fieldAccess":case"postfixExpression":return 2;case"unaryExpression":return 3;case"binaryExpression":return Nc(e.op.tokenType);case"conditionalExpression":return 15;case"assignmentExpression":return 16;case"commaExpression":return 17}}function Oc(e,t){return t?["(",e,")"]:e}function Ic(e,t,n,r){const i="binaryExpression"===n.kind&&"binaryExpression"===n.lhs.kind&&Nc(n.lhs.op.tokenType)===Nc(n.op.tokenType)||"commaExpression"===n.kind&&"commaExpression"===n.lhs.kind,s="binaryExpression"===n.kind?n.op.tokenType:pc.COMMA;let o;return i?(o=e.call(e=>Ic(e,t,e.getValue(),r),"lhs"),o.push("commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))),o):[Oc(e.call(t,"lhs"),Lc(n.lhs,r)>Nc(s)),"commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))]}function kc(e,t,n){return"expressionStatement"!==e.kind||e.expression?"compoundStatement"===e.kind||n?[" ",t]:Sc([_c,t]):";"}function Mc(e,t){return vc(e,Object.assign({},t,{printWidth:t.printWidth-2})).formatted.trim().replace(/^.*(?=[\r\n])/gm,e=>e+" ".repeat(t.printWidth-2-e.length+1)+"\\")}function Pc(e){return"assignmentExpression"===e.kind}function Bc(e){return"assignmentExpression"===e.kind||"declarator"===e.kind}function Uc(e,t,n,r,i,s){const o=function(e,t,n){if(!n)return"only-left";const r=!Pc(n);return e.match(Pc,Bc,e=>!r||"expressionStatement"!==e.kind&&"initDeclaratorListDeclaration"!==e.kind)?r?"chain-tail":"chain":!r&&Pc(n.rhs)||(t.originalText,0)||"binaryExpression"===n.kind||"commaExpression"===n.kind||"conditionalExpression"===n.kind&&"binaryExpression"===n.condition.kind?"break-after-operator":"constantExpression"===n.kind?"never-break-after-operator":"fluid"}(e,t,s);switch(o){case"break-after-operator":return Dc([Dc(n),r,Dc(Sc([_c,i]))]);case"never-break-after-operator":return Dc([Dc(n),r," ",i]);case"fluid":{const e=Symbol("assignment");return Dc([Dc(n),r,Dc(Sc(_c),{id:e}),Rc,Cc(i,{groupId:e})])}case"chain":return[Dc(n),r,_c,i];case"chain-tail":return[Dc(n),r,Sc([_c,i])];case"only-left":return n;default:throw new Error}}const $c={"glsl-ast":{print(e,t,n){const r=t.inMacro,i=e.getValue();if(!i)return[];if(cc(i))return i.image;const s=t=>e.call(n,t);try{switch(i.kind){case"translationUnit":{const r=[];return e.each((e,i)=>{const s=e.getValue();r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc),r.push(bc)},"declarations"),r}case"precisionDeclaration":return["precision ",i.precisionQualifier.image," ",e.call(n,"typeSpecifierNoPrec"),";"];case"fullySpecifiedType":{const e=[];return i.typeQualifier&&e.push(s("typeQualifier")," "),e.push(s("typeSpecifier")),e}case"typeSpecifier":{const e=[];return i.precisionQualifier&&e.push(i.precisionQualifier.image," "),e.push(s("typeSpecifierNonArray")),i.arraySpecifier&&e.push(s("arraySpecifier")),e}case"typeQualifier":{const e=[];return i.invariantQualifier&&e.push("invariant"),i.interpolationQualifier&&e.push(i.interpolationQualifier.image),i.layoutQualifier&&e.push(s("layoutQualifier")),i.storageQualifier&&e.push(s("storageQualifier")),Ac(" ",e)}case"storageQualifier":{const t=[];return i.CONST&&t.push("const"),i.CENTROID&&e.getParentNode().interpolationQualifier?.tokenType!==pc.FLAT&&t.push("centroid"),i.IN&&t.push("in"),i.OUT&&t.push("out"),i.VARYING&&t.push("varying"),i.ATTRIBUTE&&t.push("attribute"),i.UNIFORM&&t.push("uniform"),Ac(" ",t)}case"functionPrototype":case"functionDefinition":return[Dc([s("returnType")," ",s("name"),"(",Sc([yc,Ac([",",_c],e.map(n,"params"))]),yc,")"]),"functionPrototype"===i.kind?";":[" ",s("body")]];case"parameterDeclaration":return[i.parameterTypeQualifier?[s("parameterTypeQualifier")," "]:"",i.parameterQualifier?.tokenType===pc.OUT||i.parameterQualifier?.tokenType===pc.INOUT?i.parameterQualifier?.image+" ":"",s("typeSpecifier")," ",s("pName"),s("arraySpecifier")];case"initDeclaratorListDeclaration":case"structDeclaration":{const t=e.map(n,"declarators"),r="forStatement"===e.getParentNode().kind,o=i.declarators.some(e=>e.init);return Dc([s("fsType"),0===t.length?"":" ",1===t.length?t:Dc(Sc(Ac([",",o&&!r?bc:_c],t))),";"])}case"declarator":{const n=s("arraySpecifier"),r=[i.name.image,n];return Uc(e,t,r," =",s("init"),i.init)}case"arraySpecifier":return Dc(["[",Sc([yc,s("size")]),yc,"]"]);case"arrayAccess":return[Oc(s("on"),Lc(i.on,r)>2),"[",s("index"),"]"];case"structSpecifier":{const r=[];return e.each((e,i,s)=>{const o=e.getValue();r.push(bc),r.push(n(e)),i!==s.length-1&&_s.isNextLineEmpty(t.originalText,o,wc)&&r.push(bc)},"declarations"),Dc(["struct",i.name?" "+i.name.image:""," {",Sc(r),bc,"}"])}case"compoundStatement":{const r=[],s=!!i.comments?.some(e=>!e.leading&&!e.trailing&&!e.printed);return e.each((e,i)=>{const s=e.getValue();0!==i&&r.push(bc),r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc)},"statements"),s&&e.each(e=>{const t=e.getValue();t.leading||t.trailing||(r.push(n(e)),t.printed=!0)},"comments"),Dc(["{",r.length?[Sc([bc,r]),bc]:"","}"])}case"returnStatement":return i.what?["return"," ",s("what"),";"]:"return;";case"breakStatement":return"break;";case"continueStatement":return"continue;";case"discardStatement":return"discard;";case"selectionStatement":{const e=[],t=kc(i.yes,s("yes"),!1),n=Dc(["if (",Dc([Sc([yc,s("condition")]),yc]),")",t]);if(e.push(n),i.no){const t=i.yes.comments?.some(e=>e.trailing&&e.tokenType===pc.LINE_COMMENT)||i.yes.comments?.findLast(e=>!e.leading&&!e.trailing)?.tokenType===pc.LINE_COMMENT,n="compoundStatement"===i.yes.kind&&!t;e.push(n?" ":bc),e.push("else",Dc(kc(i.no,s("no"),"selectionStatement"===i.no.kind)))}return e}case"forStatement":{const e=kc(i.statement,s("statement"),!1),t=!1,n=t?[t,yc]:"";return"expressionStatement"!==i.initExpression.kind||i.initExpression.expression||i.conditionExpression||i.loopExpression?[n,Dc(["for (",Dc([Sc([yc,s("initExpression"),_c,s("conditionExpression"),";",_c,s("loopExpression")]),yc]),")",e])]:[n,Dc(["for (;;)",e])]}case"whileStatement":{const e=kc(i.statement,s("statement"),!1);return["while (",Dc(s("conditionExpression")),")",e]}case"doWhileStatement":return["do ",s("statement")," while (",Dc(s("conditionExpression")),");"];case"functionCall":return function(t){const r=e.map(n,"args");let i,o;if(void 0===t.callee.arraySpecifier&&cc(t.callee.typeSpecifierNonArray)&&void 0!==(i=function(e){switch(e){case pc.MAT2X2:return[2,2];case pc.MAT2X3:return[2,3];case pc.MAT2X4:return[2,4];case pc.MAT3X2:return[3,2];case pc.MAT3X3:return[3,3];case pc.MAT3X4:return[3,4];case pc.MAT4X2:return[4,2];case pc.MAT4X3:return[4,3];case pc.MAT4X4:return[4,4];default:return}}(t.callee.typeSpecifierNonArray.tokenType))&&i[0]*i[1]===t.args.length){const e=t.args.every(e=>"constantExpression"===e.kind&&(e.const_.tokenType===pc.FLOATCONSTANT||e.const_.tokenType===pc.INTCONSTANT)||"unaryExpression"===e.kind&&(e.op.tokenType===pc.PLUS||e.op.tokenType===pc.DASH)&&"constantExpression"===e.on.kind&&(e.on.const_.tokenType===pc.FLOATCONSTANT||e.on.const_.tokenType===pc.INTCONSTANT));if(e){const e=[],n=[];let s=0,a=0;for(let i=0;i2),".",s("functionCall")];case"postfixExpression":return[Oc(s("on"),Lc(i.on,r)>2),s("op")];case"unaryExpression":return[s("op"),Oc(s("on"),Lc(i.on,r)>3)];case"assignmentExpression":{const n=s("lhs");return Uc(e,t,n," "+i.op.image,s("rhs"),i.rhs)}case"conditionalExpression":return[Oc(s("condition"),Lc(i.condition,r)>=15),Sc([_c,"? ",s("yes"),_c,": ",s("no")])];case"commaExpression":case"binaryExpression":{const t=Ic(e,n,i,r),s=e.getParentNode();if("selectionStatement"===s.kind||"whileStatement"===s.kind||"switchStatement"===s.kind||"doWhileStatement"===s.kind)return t;const o=()=>{const t=e.getParentNode();return!!t&&("functionCall"===t.kind&&"commaExpression"===i.kind||"binaryExpression"===t.kind&&((n=t.op.tokenType)===pc.CARET||n===pc.VERTICAL_BAR||n===pc.AMPERSAND));var n},a=e.getParentNode(1);if("returnStatement"===s.kind||"forStatement"===s.kind||"conditionalExpression"===s.kind&&"returnStatement"!==a.kind&&"functionCall"!==a.kind||"assignmentExpression"===s.kind||"declarator"===s.kind)return Dc(t);{const e=t.slice(0,1),n=t.slice(e.length);return Dc(Oc([...e,Sc(n)],o()))}}case"expressionStatement":return[s("expression"),";"];case"fieldAccess":return[Oc(s("on"),Lc(i.on,r)>2),".",s("field")];case"constantExpression":{const e=i.const_;return e.tokenType===pc.FLOATCONSTANT?function(e){const t=e.indexOf(".");return 0===t&&(e="0"+e),e=e.replace("E","e"),-1!==t&&(e=(e=(e=(e=e.replace(".e","e")).replace(/(?=4):Tc(Ac(_c,e.map(n,"tokens")))])]);return t.inMacro=void 0,Mc(r,t)}case"ppDir":return Mc(Dc(["#",i.dir.image," ",Sc(i.node?s("node"):Tc(Ac(_c,e.map(n,"tokens"))))]),t);case"ppPragma":return i.dir.image.replace(/^#\s+/,"#").replace(/^#pragma\s{2,}/,"#pragma ");case"ppCall":return Dc([i.callee.image,"(",Ac([",",_c],e.map((e,t,n)=>n[t].tokens.map(e=>e.image),"args")),")"]);case"ppInclude":return["#include ",i.what];case"ppExtension":return["#extension ",i.extension.image," : ",i.behavior.image];case"switchStatement":return["switch (",Dc([Sc([yc,s("initExpression")]),yc]),") {",i.cases.length?Sc([bc,Ac(bc,e.map(n,"cases"))]):"",bc,"}"];case"caseBlock":{const r=s("caseLabel"),i=[];return e.each((e,r)=>{const s=e.getValue();i.push(bc),i.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&i.push(bc)},"statements"),[r,Sc(i)]}case"caseLabel":return void 0===i.case_?"default:":["case ",s("case_"),":"];case"layoutQualifier":return["layout(",Ac(", ",i.layoutQualifierIds.map(e=>void 0===e.init?e.IDENTIFIER.image:[e.IDENTIFIER.image," = ",e.init.image])),")"];case"uniformBlock":return[s("typeQualifier")," ",i.blockName.image," {",Sc([bc,Ac(bc,e.map(n,"declarations"))]),bc,"};"];case"typeQualifierDeclaration":return[s("typeQualifier"),";"];default:throw new Error("unexpected n type "+i.kind+"\n"+JSON.stringify(i).substring(0,100))}}catch(e){throw console.error("error printing "+JSON.stringify(i).substring(0,100)+"\n"),e}},embed(e,t){const n=e.getValue();return!cc(n)||n.tokenType!==pc.LINE_COMMENT&&n.tokenType!==pc.MULTILINE_COMMENT?null:(e,t,n,r)=>{}},getVisitorKeys:(e,t)=>cc(e)?[]:Object.keys(e).filter(e=>!t.has(e)),getCommentChildNodes:e=>cc(e)?[]:xc.visit(e),canAttachComment:e=>!0,printComment:function(e,t){const n=e.getValue();return n.tokenType===pc.MULTILINE_COMMENT&&"*"===n.image[2]?"/**\n"+n.image.substring(3,n.image.length-2).split("\n").map(e=>" *"===e?"":e.startsWith(" * ")?e.substring(3):e).join("\n").trim().split("\n").map(e=>""===e?" *":" * "+e).join("\n")+"\n */":n.image},hasPrettierIgnore(e){const t=e.getValue();return(t&&hc(t)&&t.comments?.some(e=>/\/\/\s*prettier-ignore\b.*/.test(e.image)))??!1}}},Gc={parsers:Fc,printers:$c};function Vc(e){return e.replace(/^([^\n]*;)\n(?=(?:[A-Za-z_]\w*\s+)+[A-Za-z_]\w*\s*\()/gm,"$1\n\n").replace(/^}\n(?=\S)/gm,"}\n\n")}var Wc,Hc,jc=(Wc={program:function(e){return jc(e.program)+jc(e.wsEnd)},segment:function(e){return jc(e.blocks)},text:function(e){return jc(e.text)},literal:function(e){return jc(e.wsStart)+jc(e.literal)+jc(e.wsEnd)},identifier:function(e){return jc(e.identifier)+jc(e.wsEnd)},binary:function(e){return jc(e.left)+jc(e.operator)+jc(e.right)},group:function(e){return jc(e.lp)+jc(e.expression)+jc(e.rp)},unary:function(e){return jc(e.operator)+jc(e.expression)},unary_defined:function(e){return jc(e.operator)+jc(e.lp)+jc(e.identifier)+jc(e.rp)},int_constant:function(e){return jc(e.token)+jc(e.wsEnd)},elseif:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},if:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},ifdef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},ifndef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},else:function(e){return jc(e.token)+jc(e.wsEnd)+jc(e.body)},error:function(e){return jc(e.error)+jc(e.message)+jc(e.wsEnd)},undef:function(e){return jc(e.undef)+jc(e.identifier)+jc(e.wsEnd)},define:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.body)+jc(e.wsEnd)},define_arguments:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.lp)+jc(e.args)+jc(e.rp)+jc(e.body)+jc(e.wsEnd)},conditional:function(e){return jc(e.wsStart)+jc(e.ifPart)+jc(e.elseIfParts)+jc(e.elsePart)+jc(e.endif)+jc(e.wsEnd)},version:function(e){return jc(e.version)+jc(e.value)+jc(e.profile)+jc(e.wsEnd)},pragma:function(e){return jc(e.pragma)+jc(e.body)+jc(e.wsEnd)},line:function(e){return jc(e.line)+jc(e.value)+jc(e.wsEnd)},extension:function(e){return jc(e.extension)+jc(e.name)+jc(e.colon)+jc(e.behavior)+jc(e.wsEnd)}},Hc=function(e){return"string"==typeof e?e:null==e?"":Array.isArray(e)?e.map(Hc).join(""):e.type in Wc?Wc[e.type](e):"NO GENERATOR FOR ".concat(e.type)+e});const zc=jc;function Xc(e,t,n,r){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Xc.prototype),i.expected=t,i.found=n,i.location=r,i.name="SyntaxError",i}function Kc(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}function Yc(e,t){var n,r={},i=(t=void 0!==t?t:{}).grammarSource,s={program:An,constant_expression:hr},o=An,a="<<",l=">>",u="<=",c=">=",h="==",d="!=",f="&&",p="||",m="(",g=")",E=",",v="!",C="-",D="~",S="+",A="*",_="/",y="%",b="<",T=">",R="|",x="^",w="&",F=":",N="#",L="define",O="line",I="undef",k="error",M="pragma",P="defined",B="if",U="ifdef",$="ifndef",G="elif",V="else",W="endif",H="version",j="extension",z="0",X="//",K="/*",Y="*/",q=/^[A-Za-z_]/,Q=/^[A-Za-z_0-9]/,Z=/^[uU]/,J=/^[1-9]/,ee=/^[0-7]/,te=/^[xX]/,ne=/^[0-9a-fA-F]/,re=/^[0-9]/,ie=/^[\n\r]/,se=/^[^\n\r]/,oe=/^[ \t]/,ae=gn("<<",!1),le=gn(">>",!1),ue=gn("<=",!1),ce=gn(">=",!1),he=gn("==",!1),de=gn("!=",!1),fe=gn("&&",!1),pe=gn("||",!1),me=gn("(",!1),ge=gn(")",!1),Ee=gn(",",!1),ve=gn("!",!1),Ce=gn("-",!1),De=gn("~",!1),Se=gn("+",!1),Ae=gn("*",!1),_e=gn("/",!1),ye=gn("%",!1),be=gn("<",!1),Te=gn(">",!1),Re=gn("|",!1),xe=gn("^",!1),we=gn("&",!1),Fe=gn(":",!1),Ne=gn("#",!1),Le=gn("define",!1),Oe=(gn("include",!1),gn("line",!1)),Ie=gn("undef",!1),ke=gn("error",!1),Me=gn("pragma",!1),Pe=gn("defined",!1),Be=gn("if",!1),Ue=gn("ifdef",!1),$e=gn("ifndef",!1),Ge=gn("elif",!1),Ve=gn("else",!1),We=gn("endif",!1),He=gn("version",!1),je=gn("extension",!1),ze=En([["A","Z"],["a","z"],"_"],!1,!1),Xe=En([["A","Z"],["a","z"],"_",["0","9"]],!1,!1),Ke=vn("number"),Ye=En(["u","U"],!1,!1),qe=En([["1","9"]],!1,!1),Qe=gn("0",!1),Ze=En([["0","7"]],!1,!1),Je=En(["x","X"],!1,!1),et=En([["0","9"],["a","f"],["A","F"]],!1,!1),tt=En([["0","9"]],!1,!1),nt=vn("control line"),rt=En(["\n","\r"],!1,!1),it=vn("token string"),st=En(["\n","\r"],!0,!1),ot=vn("text"),at=vn("if"),lt=vn("primary expression"),ut=vn("unary expression"),ct=vn("multiplicative expression"),ht=vn("additive expression"),dt=vn("shift expression"),ft=vn("relational expression"),pt=vn("equality expression"),mt=vn("and expression"),gt=vn("exclusive or expression"),Et=vn("inclusive or expression"),vt=vn("logical and expression"),Ct=vn("logical or expression"),Dt=vn("constant expression"),St=vn("whitespace or comment"),At=gn("//",!1),_t=gn("/*",!1),yt=gn("*/",!1),bt={type:"any"},Tt=vn("whitespace"),Rt=En([" ","\t"],!1,!1),xt=function(e,t){return gr("program",{program:e.blocks,wsEnd:t})},wt=function(e,t){return gr("int_constant",{token:e,wsEnd:t})},Ft=function(e,t){return gr("literal",{literal:e,wsEnd:t})},Nt=function(e){return"#"},Lt=function(e,t,n){return gr("literal",{literal:t,wsStart:e,wsEnd:n})},Ot=function(e,t){return gr("identifier",{identifier:e,wsEnd:t})},It=function(e){return gr("identifier",{identifier:e})},kt=function(e){return gr("text",{text:e.join("")})},Mt=function(e){return gr("segment",{blocks:e})},Pt=function(e,t,n,r,i){return[r,...i.flat()]},Bt=function(e,t,n,r,i,s){return gr("define_arguments",{define:e,identifier:t,lp:n,args:r||[],rp:i,body:s})},Ut=function(e,t,n){return gr("define",{define:e,identifier:t,body:n})},$t=function(e,t){return gr("line",{line:e,value:t})},Gt=function(e,t){return gr("undef",{undef:e,identifier:t})},Vt=function(e,t){return gr("error",{error:e,message:t})},Wt=function(e,t){return gr("pragma",{pragma:e,body:t})},Ht=function(e,t,n){return gr("version",{version:e,value:t,profile:n})},jt=function(e,t,n,r){return gr("extension",{extension:e,name:t,colon:n,behavior:r})},zt=function(e,t){return{...e,wsEnd:t}},Xt=function(e,t,n){return{...e,body:n,wsEnd:t}},Kt=function(e,t,n,r,i){return gr("elseif",{token:t,expression:n,wsEnd:r,body:i})},Yt=function(e,t,n,r,i){return gr("else",{token:n,wsEnd:r,body:i})},qt=function(e,t,n,r,i){return gr("conditional",{ifPart:e,elseIfParts:t,elsePart:n,endif:r,wsEnd:i})},Qt=function(e,t){return gr("ifdef",{token:e,identifier:t})},Zt=function(e,t){return gr("ifndef",{token:e,identifier:t})},Jt=function(e,t){return gr("if",{token:e,expression:t})},en=function(e,t,n){return gr("group",{lp:e,expression:t,rp:n})},tn=function(e,t,n,r){return gr("unary_defined",{operator:e,lp:t,identifier:n,rp:r})},nn=function(e,t){return gr("unary",{operator:e,expression:t})},rn=function(e,t){return Cr(e,t)},sn=function(e,t){return vr(e,t)},on=function(e,t,n){return Er(t,n)},an=function(e,t){return Er(e,t.flat())},ln=function(e){return e},un=function(e){return e},cn=0,hn=[{line:1,column:1}],dn=0,fn=[],pn=0,mn={};if("startRule"in t){if(!(t.startRule in s))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=s[t.startRule]}function gn(e,t){return{type:"literal",text:e,ignoreCase:t}}function En(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function vn(e){return{type:"other",description:e}}function Cn(t){var n,r=hn[t];if(r)return r;for(n=t-1;!hn[n];)n--;for(r={line:(r=hn[n]).line,column:r.column};ndn&&(dn=cn,fn=[]),fn.push(e))}function An(){var e,t,n,i=75*cn+0,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Qn())!==r?(n=dr(),e=xt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}function _n(){var t,n,i,s=75*cn+2,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===a?(n=a,cn+=2):(n=r,0===pn&&Sn(ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function yn(){var t,n,i,s=75*cn+3,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===l?(n=l,cn+=2):(n=r,0===pn&&Sn(le)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function bn(){var t,n,i,s=75*cn+4,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===u?(n=u,cn+=2):(n=r,0===pn&&Sn(ue)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Tn(){var t,n,i,s=75*cn+5,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===c?(n=c,cn+=2):(n=r,0===pn&&Sn(ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Rn(){var t,n,i,s=75*cn+6,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===h?(n=h,cn+=2):(n=r,0===pn&&Sn(he)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function xn(){var t,n,i,s=75*cn+7,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===d?(n=d,cn+=2):(n=r,0===pn&&Sn(de)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function wn(){var t,n,i,s=75*cn+8,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===f?(n=f,cn+=2):(n=r,0===pn&&Sn(fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Fn(){var t,n,i,s=75*cn+9,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===p?(n=p,cn+=2):(n=r,0===pn&&Sn(pe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Nn(){var t,n,i,s=75*cn+10,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,40===e.charCodeAt(cn)?(n=m,cn++):(n=r,0===pn&&Sn(me)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Ln(){var t,n,i,s=75*cn+11,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,41===e.charCodeAt(cn)?(n=g,cn++):(n=r,0===pn&&Sn(ge)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function On(){var t,n,i,s=75*cn+12,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,44===e.charCodeAt(cn)?(n=E,cn++):(n=r,0===pn&&Sn(Ee)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function In(){var t,n,i,s=75*cn+14,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,45===e.charCodeAt(cn)?(n=C,cn++):(n=r,0===pn&&Sn(Ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function kn(){var t,n,i,s=75*cn+16,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,43===e.charCodeAt(cn)?(n=S,cn++):(n=r,0===pn&&Sn(Se)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Mn(){var t,n,i,s=75*cn+17,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,42===e.charCodeAt(cn)?(n=A,cn++):(n=r,0===pn&&Sn(Ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Pn(){var t,n,i,s=75*cn+18,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,47===e.charCodeAt(cn)?(n=_,cn++):(n=r,0===pn&&Sn(_e)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Bn(){var t,n,i,s=75*cn+19,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,37===e.charCodeAt(cn)?(n=y,cn++):(n=r,0===pn&&Sn(ye)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Un(){var t,n,i,s=75*cn+20,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,60===e.charCodeAt(cn)?(n=b,cn++):(n=r,0===pn&&Sn(be)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function $n(){var t,n,i,s=75*cn+21,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,62===e.charCodeAt(cn)?(n=T,cn++):(n=r,0===pn&&Sn(Te)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Gn(){var t,n,i,s=75*cn+22,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,124===e.charCodeAt(cn)?(n=R,cn++):(n=r,0===pn&&Sn(Re)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Vn(){var t,n,i,s=75*cn+23,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,94===e.charCodeAt(cn)?(n=x,cn++):(n=r,0===pn&&Sn(xe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Wn(){var t,n,i,s=75*cn+24,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,38===e.charCodeAt(cn)?(n=w,cn++):(n=r,0===pn&&Sn(we)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Hn(){var t,n,i,s=75*cn+26,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,35===e.charCodeAt(cn)?(i=N,cn++):(i=r,0===pn&&Sn(Ne)),(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Nt(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function jn(){var t,n,i,s,o,a,l=75*cn+27,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===L?(a=L,cn+=6):(a=r,0===pn&&Sn(Le)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function zn(){var t,n,i,s,o,a,l=75*cn+37,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===G?(a=G,cn+=4):(a=r,0===pn&&Sn(Ge)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function Xn(){var t,n,i,s,o,a,l=75*cn+42,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Ot(n,i)):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t}function Kn(){var t,n,i,s,o=75*cn+44,a=mn[o];return a?(cn=a.nextPos,a.result):(pn++,t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+46,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,J.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(qe)),i!==r){for(s=[],o=qn();o!==r;)s.push(o),o=qn();n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o=75*cn+47,a=mn[o];if(a)return cn=a.nextPos,a.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r){for(i=[],ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));s!==r;)i.push(s),ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));t=n=[n,i]}else cn=t,t=r;return mn[o]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+48,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r)if(te.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Je)),i!==r){for(s=[],ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));o!==r;)s.push(o),ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));t=n=[n,i,s]}else cn=t,t=r;else cn=t,t=r;return mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),t=n!==r?e.substring(t,cn):n)),pn--,t===r&&(n=r,0===pn&&Sn(Ke)),mn[o]={nextPos:cn,result:t},t)}function Yn(){var t,n=75*cn+45,i=mn[n];return i?(cn=i.nextPos,i.result):(Z.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(Ye)),mn[n]={nextPos:cn,result:t},t)}function qn(){var t,n=75*cn+49,i=mn[n];return i?(cn=i.nextPos,i.result):(re.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(tt)),mn[n]={nextPos:cn,result:t},t)}function Qn(){var e,t,n,i,s,o=75*cn+50,a=mn[o];if(a)return cn=a.nextPos,a.result;if(cn,t=[],(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}if(n!==r){for(;n!==r;)if(t.push(n),(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}}else t=r;return t!==r&&(t=Mt(t)),e=t,mn[o]={nextPos:cn,result:e},e}function Zn(){var t,n,i,s,o,a,l,u,c,h,d,f=75*cn+51,p=mn[f];if(p)return cn=p.nextPos,p.result;if(pn++,t=function(){var t,n,i,s,o,a,l,u,c=75*cn+54,h=mn[c];if(h)return cn=h.nextPos,h.result;if(t=cn,n=cn,i=function(){var t,n,i,s=75*cn+55,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+35,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===U?(a=U,cn+=5):(a=r,0===pn&&Sn(Ue)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Qt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+36,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===$?(a=$,cn+=6):(a=r,0===pn&&Sn($e)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Zt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+34,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,2)===B?(a=B,cn+=2):(a=r,0===pn&&Sn(Be)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r?((i=Jn())===r&&(i=null),t=Jt(n,i)):(cn=t,t=r))),pn--,t===r&&(n=r,0===pn&&Sn(at)),mn[s]={nextPos:cn,result:t},t)}(),i!==r?(ie.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(rt)),s!==r?((o=Qn())===r&&(o=null),n=Xt(i,s,o)):(cn=n,n=r)):(cn=n,n=r),n!==r){for(i=[],s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s=cn,o=function(){var t,n,i,s,o,a,l=75*cn+38,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===V?(a=V,cn+=4):(a=r,0===pn&&Sn(Ve)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a!==r?((l=Qn())===r&&(l=null),s=Yt(n,i,o,a,l)):(cn=s,s=r)):(cn=s,s=r),s===r&&(s=null),o=function(){var t,n,i,s,o,a,l=75*cn+39,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===W?(a=W,cn+=5):(a=r,0===pn&&Sn(We)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a===r&&(a=null),t=qt(n,i,s,o,a)):(cn=t,t=r)}else cn=t,t=r;return mn[c]={nextPos:cn,result:t},t}(),t===r){if(t=cn,n=cn,(i=jn())!==r)if(s=function(){var t,n,i,s,o,a,l=75*cn+43,u=mn[l];if(u)return cn=u.nextPos,u.result;if(cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r&&(n=It(n)),t=n,mn[l]={nextPos:cn,result:t},t}(),s!==r)if((o=Nn())!==r){if(a=cn,(l=Xn())!==r){for(u=[],c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);c!==r;)u.push(c),c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);a=Pt(i,s,o,l,u)}else cn=a,a=r;a===r&&(a=null),(l=Ln())!==r?((u=Jn())===r&&(u=null),n=Bt(i,s,o,a,l,u)):(cn=n,n=r)}else cn=n,n=r;else cn=n,n=r;else cn=n,n=r;if(n===r&&(n=cn,(i=jn())!==r&&(s=Xn())!==r?((o=Jn())===r&&(o=null),n=Ut(i,s,o)):(cn=n,n=r),n===r)){if(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+29,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===O?(a=O,cn+=4):(a=r,0===pn&&Sn(Oe)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r){if(s=cn,o=[],(a=qn())!==r)for(;a!==r;)o.push(a),a=qn();else o=r;(s=o!==r?e.substring(s,cn):o)!==r?n=$t(i,s):(cn=n,n=r)}else cn=n,n=r;n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+30,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===I?(a=I,cn+=5):(a=r,0===pn&&Sn(Ie)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?n=Gt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+31,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===k?(a=k,cn+=5):(a=r,0===pn&&Sn(ke)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Vt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+32,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===M?(a=M,cn+=6):(a=r,0===pn&&Sn(Me)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Wt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+40,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,7)===H?(a=H,cn+=7):(a=r,0===pn&&Sn(He)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Kn())!==r?((o=Jn())===r&&(o=null),n=Ht(i,s,o)):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+41,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,9)===j?(a=j,cn+=9):(a=r,0===pn&&Sn(je)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?(o=function(){var t,n,i,s=75*cn+25,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,58===e.charCodeAt(cn)?(n=F,cn++):(n=r,0===pn&&Sn(Fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),o!==r&&(a=Jn())!==r?n=jt(i,s,o,a):(cn=n,n=r)):(cn=n,n=r))))))}n!==r?(ie.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(rt)),i===r&&(i=null),t=zt(n,i)):(cn=t,t=r)}return pn--,t===r&&(n=r,0===pn&&Sn(nt)),mn[f]={nextPos:cn,result:t},t}function Jn(){var t,n,i,s=75*cn+52,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st)),i!==r)for(;i!==r;)n.push(i),se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(it)),mn[s]={nextPos:cn,result:t},t}function er(){var t,n,i,s,o,a,l=75*cn+53,u=mn[l];if(u)return cn=u.nextPos,u.result;if(pn++,t=cn,n=cn,i=cn,pn++,s=cn,(o=pr())===r&&(o=null),35===e.charCodeAt(cn)?(a=N,cn++):(a=r,0===pn&&Sn(Ne)),a!==r?s=o=[o,a]:(cn=s,s=r),pn--,s===r?i=void 0:(cn=i,i=r),i!==r){if(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st)),o!==r)for(;o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));else s=r;s!==r?(ie.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(rt)),o===r&&(o=null),n=i=[i,s,o]):(cn=n,n=r)}else cn=n,n=r;return n===r&&(ie.test(e.charAt(cn))?(n=e.charAt(cn),cn++):(n=r,0===pn&&Sn(rt))),t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(ot)),mn[l]={nextPos:cn,result:t},t}function tr(){var t,n,i,s,o,a=75*cn+57,l=mn[a];return l?(cn=l.nextPos,l.result):(pn++,t=cn,n=function(){var t,n,i,s,o=75*cn+33,a=mn[o];return a?(cn=a.nextPos,a.result):(t=cn,n=dr(),e.substr(cn,7)===P?(i=P,cn+=7):(i=r,0===pn&&Sn(Pe)),i!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[o]={nextPos:cn,result:t},t)}(),n!==r?((i=Nn())===r&&(i=null),(s=Xn())!==r?((o=Ln())===r&&(o=null),t=tn(n,i,s,o)):(cn=t,t=r)):(cn=t,t=r),t===r&&(t=cn,(n=kn())===r&&(n=In())===r&&(n=function(){var t,n,i,s=75*cn+13,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,33===e.charCodeAt(cn)?(n=v,cn++):(n=r,0===pn&&Sn(ve)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),n===r&&(n=function(){var t,n,i,s=75*cn+15,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,126===e.charCodeAt(cn)?(n=D,cn++):(n=r,0===pn&&Sn(De)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}())),n!==r&&(i=tr())!==r?t=nn(n,i):(cn=t,t=r),t===r&&(t=function(){var e,t,n,i,s=75*cn+56,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,e=function(){var e,t,n,i=75*cn+1,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Kn())!==r?(n=dr(),e=wt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}(),e===r&&(e=cn,(t=Nn())!==r&&(n=hr())!==r&&(i=Ln())!==r?e=en(t,n,i):(cn=e,e=r),e===r&&(e=Xn())),pn--,e===r&&(t=r,0===pn&&Sn(lt)),mn[s]={nextPos:cn,result:e},e)}())),pn--,t===r&&(n=r,0===pn&&Sn(ut)),mn[a]={nextPos:cn,result:t},t)}function nr(){var e,t,n,i,s,o,a=75*cn+58,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=tr())!==r){for(n=[],i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ct)),mn[a]={nextPos:cn,result:e},e}function rr(){var e,t,n,i,s,o,a=75*cn+59,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=nr())!==r){for(n=[],i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ht)),mn[a]={nextPos:cn,result:e},e}function ir(){var e,t,n,i,s,o,a=75*cn+60,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=rr())!==r){for(n=[],i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(dt)),mn[a]={nextPos:cn,result:e},e}function sr(){var e,t,n,i,s,o,a=75*cn+61,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ir())!==r){for(n=[],i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ft)),mn[a]={nextPos:cn,result:e},e}function or(){var e,t,n,i,s,o,a=75*cn+62,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=sr())!==r){for(n=[],i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(pt)),mn[a]={nextPos:cn,result:e},e}function ar(){var e,t,n,i,s,o,a=75*cn+63,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=or())!==r){for(n=[],i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(mt)),mn[a]={nextPos:cn,result:e},e}function lr(){var e,t,n,i,s,o,a=75*cn+64,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ar())!==r){for(n=[],i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(gt)),mn[a]={nextPos:cn,result:e},e}function ur(){var e,t,n,i,s,o,a=75*cn+65,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=lr())!==r){for(n=[],i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Et)),mn[a]={nextPos:cn,result:e},e}function cr(){var e,t,n,i,s,o,a=75*cn+66,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ur())!==r){for(n=[],i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(vt)),mn[a]={nextPos:cn,result:e},e}function hr(){var e,t=75*cn+68,n=mn[t];return n?(cn=n.nextPos,n.result):(pn++,e=function(){var e,t,n,i,s,o,a=75*cn+67,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=cr())!==r){for(n=[],i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Ct)),mn[a]={nextPos:cn,result:e},e}(),pn--,e===r&&0===pn&&Sn(Dt),mn[t]={nextPos:cn,result:e},e)}function dr(){var e,t,n,i,s,o,a=75*cn+69,l=mn[a];if(l)return cn=l.nextPos,l.result;for(pn++,cn,(t=pr())===r&&(t=null),n=[],i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);return e=sn(t,n),pn--,t=r,0===pn&&Sn(St),mn[a]={nextPos:cn,result:e},e}function fr(){var t,n,i,s,o,a,l=75*cn+70,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=function(){var t,n,i,s,o,a=75*cn+71,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,e.substr(cn,2)===X?(i=X,cn+=2):(i=r,0===pn&&Sn(At)),i!==r){for(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),t===r)if(t=cn,n=function(){var t,n,i,s,o,a,l,u=75*cn+72,c=mn[u];if(c)return cn=c.nextPos,c.result;if(t=cn,n=cn,e.substr(cn,2)===K?(i=K,cn+=2):(i=r,0===pn&&Sn(_t)),i!==r){for(s=[],o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);o!==r;)s.push(o),o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);e.substr(cn,2)===Y?(o=Y,cn+=2):(o=r,0===pn&&Sn(yt)),o!==r?n=i=[i,s,o]:(cn=n,n=r)}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[u]={nextPos:cn,result:t},t}(),n!==r){for(i=[],s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);t=an(n,i)}else cn=t,t=r;return mn[l]={nextPos:cn,result:t},t}function pr(){var t,n,i,s=75*cn+73,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt)),i!==r)for(;i!==r;)n.push(i),oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(Tt)),mn[s]={nextPos:cn,result:t},t}function mr(){var t,n,i,s=75*cn+74,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,pn++,Q.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Xe)),pn--,i===r?n=void 0:(cn=n,n=r),n!==r?(i=dr(),t=un(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}e=lh(e);const gr=(e,t)=>({type:e,...t}),Er=(...e)=>e.flat().filter(e=>null!=e&&""!==e&&0!==e.length),vr=(...e)=>{return(t=Er(e.flat())).length>1?t:t[0];var t},Cr=(...e)=>e.flat().reduce((e,[t,n])=>({type:"binary",operator:t,left:e,right:n}));if((n=o())!==r&&cn===e.length)return n;throw n!==r&&cn0){for(t=1,n=1;ts.length)throw new Error("'".concat(t,"': Too many arguments for macro"));if(u.length>":return t(n)>>t(r);case"<":return t(n)":return t(n)>t(r);case"<=":return t(n)<=t(r);case">=":return t(n)>=t(r);case"==":return t(n)==t(r);case"!=":return t(n)!=t(r);case"&":return t(n)&t(r);case"^":return t(n)^t(r);case"|":return t(n)|t(r);case"&&":return t(n)&&t(r);case"||":return t(n)||t(r);default:throw new Error("Preprocessing error: Unknown binary operator ".concat(i))}},unary:function(e,t){switch(e.operator.literal){case"+":return t(e.expression);case"-":return-1*t(e.expression);case"!":return!t(e.expression);case"~":return~t(e.expression);default:throw new Error("Preprocessing error: Unknown unary operator ".concat(e.operator.literal))}}},(r=function(e){var t=n[e.type];if(!t)throw new Error("No evaluate() evaluator for ".concat(e.type));return t(e,r)})(e);var n,r}((n=sh(r,t).trim(),eh(s)(n,{grammarSource:"expression",startRule:"constant_expression"})),t)},lh=function(e,t){return void 0===t&&(t={}),e.replace(/\\[\n\r]/g,"")},uh=function(e,t){void 0===t&&(t={});var n,r,i,s,o=Object.entries(t.defines||{}).reduce(function(e,t){var n,r=t[0],i=t[1];return th(th({},e),((n={})[r]={body:i},n))},{}),a=(void 0===(n=t.preserve)&&(n={}),function(e){var t=null==n?void 0:n[e.node.type];return"function"==typeof t?t(e):t});return r={conditional:{enter:function(e){var t=e,n=t.node;a(t)||(function(e,t){return"if"===t.type?!!t.expression&&oh(ah(t.expression,e)):"ifdef"===t.type?t.identifier.identifier in e:"ifndef"===t.type?!(t.identifier.identifier in e):void 0}(o,n.ifPart)?t.replaceWith(n.ifPart.body):n.elseIfParts.reduce(function(e,n){return e||oh(ah(n.expression,o))&&(t.replaceWith(n.body),!0)},!1)||(n.elsePart?t.replaceWith(n.elsePart.body):t.remove()))}},text:{enter:function(e){var t=e;t.node.text=sh(t.node.text,o)}},define_arguments:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body,s=n.args;o[r]={args:s,body:i},!a(t)&&t.remove()}},define:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body;o[r]={body:i},!a(t)&&t.remove()}},undef:{enter:function(e){var t=e;delete o[t.node.identifier.identifier],!a(t)&&t.remove()}},error:{enter:function(e){var n=e;if(t.stopOnError)throw new Error(n.node.message);!a(n)&&n.remove()}},pragma:{enter:function(e){var t=e;!a(t)&&t.remove()}},version:{enter:function(e){var t=e;!a(t)&&t.remove()}},extension:{enter:function(e){var t=e;!a(t)&&t.remove()}},line:{enter:function(e){var t=e;!a(t)&&t.remove()}}},i=!1,(s=function(e,t,n,o,a){var l;if(!i){var u=r[e.type],c=function(e,t,n,r,i){return{node:e,parent:t,parentPath:n,key:r,index:i,stop:function(){this.stopped=!0},skip:function(){this.skipped=!0},remove:function(){this.removed=!0},replaceWith:function(e){this.replaced=e},findParent:function(e){return n?e(n)?n:n.findParent(e):n}}}(e,t,n,o,a),h=t;if(null==u?void 0:u.enter){if(u.enter(c),c.removed){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));return"number"==typeof a?h[o].splice(a,1):h[o]=null,c}if(c.replaced){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));"number"==typeof a?h[o].splice(a,1,c.replaced):h[o]=c.replaced}if(c.skipped)return c}if(c.stopped)i=!0;else if(c.replaced){var d=c.replaced;s(d,t,n,o,a)}else Object.entries(e).filter(function(e){return e[0],function(e){return function(e){return!!(null==e?void 0:e.type)}(e)||Array.isArray(e)}(e[1])}).forEach(function(t){var n=t[0],r=t[1];if(Array.isArray(r))for(var o=0,a=0;o-a{let e=!0;return n?(i({source:o,formatted:null,error:""}),function(e){return Gs(e,{parser:"glsl-parser",plugins:[Gc],printWidth:80,tabWidth:4,useTabs:!1}).then(Vc)}(o).then(t=>{e&&i({source:o,formatted:t,error:""})}).catch(t=>{if(!e)return;const n=dh(t);a.error("shader formatting failed: "+n),i({source:o,formatted:null,error:n})}),()=>{e=!1}):(i({source:o,formatted:null,error:""}),()=>{e=!1})},[n,o]);const c=n&&r.source===o?r.formatted:null;return{source:c||o,formatted:!!c,preprocessed:u,error:(r.source===o?r.error:"")||l}}(C.source,C.preprocessed,e.beautify),S=D.source,A=C.edited,_=[e.fragment?e.sourceFragmentLog:e.sourceVertexLog,e.programLog].filter(e=>!!e).join("\n"),y=!e.translated&&!D.preprocessed&&!D.formatted,b=function(e,t,n,r){return!(e||t||!n||r)}(t,A,_,y);(0,dt.useLayoutEffect)(()=>{g.current={programId:e.programId,sourceVertex:e.sourceVertex,sourceFragment:e.sourceFragment}},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!d.current)return;if(!f.current){const e=ace.edit(d.current);e.setTheme("ace/theme/monokai"),e.getSession().setMode("ace/mode/glsl"),e.setShowPrintMargin(!1),f.current=e}const t=f.current;t.setReadOnly(!e.editable||e.translated),t.getValue()!==S&&t.setValue(S,-1);const n=()=>{const n=t.getValue();e.fragment?m.current.fragment=n:m.current.vertex=n,v(t=>e.fragment?t.fragment?t:Object.assign(Object.assign({},t),{fragment:!0}):t.vertex?t:Object.assign(Object.assign({},t),{vertex:!0})),function(e,t,n,r){e&&n(!1),t&&r(!1)}(e.beautify,e.preprocessed,c,h),-1!==p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{if(p.current=-1,!function(e,t){return e.programId===t.programId&&e.sourceVertex===t.sourceVertex&&e.sourceFragment===t.sourceFragment}(g.current,e))return;const t={sourceVertex:m.current.vertex,sourceFragment:m.current.fragment,translatedSourceVertex:e.translatedSourceVertex,translatedSourceFragment:e.translatedSourceFragment,programId:e.programId};u(t)},1500)},r=e.editable&&!e.translated;return r&&t.getSession().on("change",n),()=>{r&&t.getSession().off("change",n)}},[S,e.editable,e.translated,e.fragment,e.beautify,e.preprocessed,e.sourceVertex,e.sourceFragment,e.translatedSourceVertex,e.translatedSourceFragment,e.programId,c,h,u]),(0,dt.useEffect)(()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),m.current={baseProgramId:e.programId,baseVertex:e.sourceVertex,baseFragment:e.sourceFragment,vertex:e.sourceVertex,fragment:e.sourceFragment},v({vertex:!1,fragment:!1})},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!f.current)return;const e=t||(y&&!A?_:"");f.current.getSession().setAnnotations(function(e){if(!e)return[];const t=[],n=e.split(/\r?\n/);for(const e of n){const n=e.replace(/\0/g,"").trim();if(!n)continue;let r=/^(error|warning|info)\s*:\s*\d+\s*:\s*(\d+)(?:\s*:\s*(\d+))?\s*:\s*(.*)$/i.exec(n);if(r){t.push(Pt(r[1],r[2],r[3],r[4]));continue}if(r=/^\d+\s*\(\s*(\d+)\s*\)\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[2],r[1],"",r[3]));continue}if(r=/^\d+\s*:\s*(\d+)(?:\s*\(\s*(\d+)\s*\))?\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[3],r[1],r[2],r[4]));continue}const i=/\b(error|warning|info)\b/i.exec(n);t.push({row:0,column:0,text:n,type:i?i[1].toLowerCase():"info"})}return t}(e))},[_,y,t,D.formatted,D.preprocessed,A,e.beautify,e.fragment,e.programLog,e.sourceFragmentLog,e.sourceVertexLog,e.translated]),(0,dt.useEffect)(()=>()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),f.current&&(f.current.destroy(),f.current=null)},[]);const T=(0,dt.useCallback)(e=>{e.preventDefault(),n()},[n]),R=(0,dt.useCallback)(e=>{e.preventDefault(),r()},[r]),x=(0,dt.useCallback)(e=>{e.preventDefault(),null==i||i()},[i]),w=(0,dt.useCallback)(e=>{e.preventDefault(),null==o||o()},[o]),F=(0,dt.useCallback)(e=>{e.preventDefault(),l()},[l]),N=!e.singleShader||!e.fragment,L=!e.singleShader||e.fragment,O=D.error;return(0,mt.jsxs)("div",{className:"sourceCodeComponentContainer",children:[(0,mt.jsx)("div",{className:"sourceCodeMenuComponentContainer",children:(0,mt.jsxs)("ul",{className:"sourceCodeMenuComponent",children:[N&&e.translatedSourceVertex&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:!e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedVertexSourceClicked",onClick:x,children:"Translated Vertex"})}),L&&e.translatedSourceFragment&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedFragmentSourceClicked",onClick:w,children:"Translated Fragment"})}),N&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment||e.translated?"":"active",href:"#",role:"button",commandName:"onVertexSourceClicked",onClick:T,children:"Vertex"})}),L&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&!e.translated?"active":"",href:"#",role:"button",commandName:"onFragmentSourceClicked",onClick:R,children:"Fragment"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onSourceCodeCloseClicked",onClick:F,children:"Close"})})]})}),(0,mt.jsx)("div",{className:"sourceCodeComponent",ref:d}),(0,mt.jsx)(hh,{beautify:e.beautify,capturedDiagnosticsHidden:b,fragment:e.fragment,preprocessed:e.preprocessed,processingError:O,onBeautifyChanged:c,onFragmentSourceClicked:r,onPreprocessChanged:h,onVertexSourceClicked:n})]})}function hh({beautify:e,capturedDiagnosticsHidden:t,fragment:n,preprocessed:r,processingError:i,onBeautifyChanged:s,onFragmentSourceClicked:o,onPreprocessChanged:a,onVertexSourceClicked:l}){const u=(0,dt.useCallback)(e=>{s(e.target.checked)},[s]),c=(0,dt.useCallback)(e=>{a(e.target.checked)},[a]),h=(0,dt.useCallback)(e=>{e.preventDefault(),(n?o:l)(),s(!1),a(!1)},[n,s,o,a,l]);return(0,mt.jsx)("div",{className:"sourceCodeMenuComponentFooter",children:(0,mt.jsxs)("p",{children:[(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onBeautifyChanged",checked:e,onChange:u})," Beautify"]}),(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onPreprocessChanged",checked:r,onChange:c})," Preprocess"]}),i&&(0,mt.jsx)("span",{className:"sourceCodeFormatError",role:"alert",title:i,children:"Shader processing failed"}),t&&(0,mt.jsxs)("span",{className:"sourceCodeDiagnosticsNotice",role:"status",children:["Captured diagnostics hidden."," ",(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onShowCapturedDiagnostics",onClick:h,children:"Show original with diagnostics"})]})]})})}function dh(e){return e instanceof Error?e.message:String(e)}function fh({title:e,children:t}){const n=e?e.replace(/([A-Z])/g," $1").trim():"";return(0,mt.jsxs)("div",{className:"jsonGroupComponent",children:[(0,mt.jsx)("div",{className:"jsonGroupComponentTitle",children:n}),(0,mt.jsx)("ul",{children:t})]})}function ph({itemKey:e,value:t}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsx)("span",{className:"jsonItemComponentValue",children:t})]})}function mh({itemKey:e,value:t,pixelated:n,raw:r}){const i=bt();return(0,mt.jsx)("li",{className:"jsonItemImageHolder",children:(0,mt.jsxs)("div",{className:"jsonItemImage jsonItemImageClickable",children:[(0,mt.jsx)("img",{src:t,style:n?{imageRendering:"pixelated"}:void 0,title:"Open in texture viewer",onClick:()=>i.openTextureViewer({src:t,label:e,pixelated:n,raw:r||null})}),(0,mt.jsx)("span",{children:e})]})})}function gh({itemKey:e,value:t,help:n}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("span",{className:"jsonItemComponentValue",children:[t+" (",(0,mt.jsx)("a",{href:n,target:"_blank",className:"jsonSourceItemComponentOpen",children:"Open help page"}),")"]})]})}function Eh({visualState:e}){const t=bt();return(0,mt.jsxs)("div",{className:"jsonVisualStateItemComponent",children:[e.Attachments?e.Attachments.map((n,r)=>n.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{className:"jsonItemImageClickable",src:encodeURI(n.src),title:"Open in texture viewer",onClick:()=>t.openTextureViewer({src:n.src,label:n.attachmentName||"Attachment",pixelated:!1,raw:n.raw||null})}),e.Attachments.length>1&&(0,mt.jsx)("span",{children:n.attachmentName})]},r):null):(0,mt.jsx)("span",{children:e.FrameBufferStatus}),(0,mt.jsx)("span",{children:e.FrameBuffer?e.FrameBuffer.__SPECTOR_Object_TAG.displayText:"Canvas frame buffer"})]})}function vh({itemKey:e,shader:t,programLog:n,onOpen:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),null==r||r(t,n)},[r,n,t]),s=t.source?t.source.length:0,o=`${t.name||"Shader"} (${s} chars)`;return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("a",{href:"#",role:"button",className:"jsonSourceItemComponentOpen",commandName:"onShaderSourceOpen",onClick:i,children:["Open ",o]})]})}function Ch({items:e,onShaderSourceOpen:t}){return e&&0!==e.length?(0,mt.jsx)(mt.Fragment,{children:e.map((e,n)=>{switch(e.type){case"group":return(0,mt.jsx)(fh,{title:e.title,children:(0,mt.jsx)(Ch,{items:e.children,onShaderSourceOpen:t})},n);case"item":return(0,mt.jsx)(ph,{itemKey:e.key,value:e.value},n);case"image":return(0,mt.jsx)(mh,{itemKey:e.key,value:e.value,pixelated:e.pixelated,raw:e.raw},n);case"help":return(0,mt.jsx)(gh,{itemKey:e.key,value:e.value,help:e.help},n);case"shaderSource":return(0,mt.jsx)(vh,{itemKey:e.key,shader:e.shader,programLog:e.programLog,onOpen:t},n);case"visualState":return(0,mt.jsx)(Eh,{visualState:e.visualState},n);default:return null}})}):null}const Dh={added:"+",removed:"-",changed:"~",unchanged:" "};function Sh(e){const t=void 0===e.indexA?"_":String(e.indexA),n=void 0===e.indexB?"_":String(e.indexB);return e.type+"#"+t+"#"+n}function Ah(e){return!(!e.previousImage&&!e.currentImage)}function _h(){const e=bt(),t=pt(e.store),[n,r]=(0,dt.useState)(null);if((0,dt.useEffect)(()=>{r(null)},[t.compareRows]),!t.canCompare)return(0,mt.jsx)("div",{className:"compareViewComponent",children:(0,mt.jsx)("div",{className:"compareViewEmpty",children:"Capture the same page at least twice, then select a capture to compare it against the previous one."})});const{added:i,removed:s,changed:o,unchanged:a}=t.compareSummary,l=t.compareOnlyDifferences?t.compareRows.filter(e=>"unchanged"!==e.type):t.compareRows,u=l.find(e=>Sh(e)===n)||(l.length>0?l[0]:null),c=u?Sh(u):"";return(0,mt.jsxs)("div",{className:"compareViewComponent",children:[(0,mt.jsxs)("div",{className:"compareViewHeader",children:[(0,mt.jsx)("span",{className:"compareViewLabel",children:t.compareLabel}),(0,mt.jsxs)("span",{className:"compareViewSummary",children:[(0,mt.jsxs)("span",{className:"added",children:["+",i]}),(0,mt.jsxs)("span",{className:"removed",children:["-",s]}),(0,mt.jsxs)("span",{className:"changed",children:["~",o]}),(0,mt.jsxs)("span",{className:"unchanged",children:["=",a]})]}),(0,mt.jsxs)("label",{className:"compareViewToggle",children:[(0,mt.jsx)("input",{type:"checkbox",checked:t.compareOnlyDifferences,onChange:t=>e.handleCompareOnlyDifferencesChange(t.target.checked)}),"Differences only"]})]}),(0,mt.jsxs)("div",{className:"compareViewBody",children:[(0,mt.jsx)(yh,{}),(0,mt.jsx)("ul",{className:"compareViewList",children:0===l.length?(0,mt.jsx)("li",{className:"compareViewEmptyRow",children:"No differences between these two captures."}):l.map(e=>{const t=Sh(e);return(0,mt.jsx)(bh,{row:e,selected:t===c,onSelect:()=>r(t)},t)})}),(0,mt.jsx)("div",{className:"compareViewDetail",children:u?(0,mt.jsx)(Th,{row:u,onSelectCommand:e.handleCompareCommandSelected,onOpenTexture:(t,n)=>e.openTextureViewer({src:t,label:n,pixelated:!1,raw:null})}):(0,mt.jsx)("div",{className:"compareDetailEmpty",children:"Select a call to see its details."})})]})]})}function yh(){return(0,mt.jsxs)("div",{className:"compareViewLegend",children:[(0,mt.jsxs)("div",{className:"compareLegendRow added",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Added"]}),(0,mt.jsxs)("div",{className:"compareLegendRow removed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Removed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow changed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Changed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow unchanged",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Unchanged"]})]})}function bh(e){const{row:t,selected:n,onSelect:r}=e,i="removed"===t.type?t.previousText:t.currentText,s=i&&0===i.indexOf(t.name)?i.slice(t.name.length):"",o="compareRow "+t.type+(n?" selected":"");return(0,mt.jsxs)("li",{className:o,onClick:r,title:i,children:[(0,mt.jsx)("span",{className:"compareSign",children:Dh[t.type]}),(0,mt.jsxs)("span",{className:"compareRowText",children:[(0,mt.jsx)("span",{className:"compareCmdName",children:t.name}),s]})]})}function Th(e){const{row:t,onSelectCommand:n,onOpenTexture:r}=e,i=t.fieldDiffs||[],s=i.filter(e=>!Ah(e)),o=i.filter(Ah),a="changed"===t.type&&t.previousText!==t.currentText,l="removed"===t.type?t.previousText:t.currentText;return(0,mt.jsxs)("div",{className:"compareDetail",children:[(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Command"}),(0,mt.jsxs)("ul",{children:[(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"name"}),":"," ",(0,mt.jsx)("span",{className:"compareCmdName "+t.type,children:t.name})]}),(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"call"}),":"," ",a?(0,mt.jsxs)("span",{className:"compareTextChange",children:[(0,mt.jsx)("span",{className:"compareOld",children:t.previousText}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:t.currentText})]}):(0,mt.jsx)("span",{className:"compareNew",children:l})]}),void 0!==t.commandId&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",className:"compareCommandLink",title:"Show this command in the Commands view",onClick:e=>{e.preventDefault(),n(t.commandId)},children:"Show in Commands view →"})})]})]}),s.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Uniform & state changes"}),(0,mt.jsx)("ul",{children:s.map((e,t)=>(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),":"," ",(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:e.current})]},t))})]}),o.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Texture changes"}),(0,mt.jsx)("ul",{children:o.map((e,t)=>(0,mt.jsxs)("li",{className:"compareTextureItem",children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),(0,mt.jsxs)("div",{className:"compareImageDiff",children:[e.previousImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.previousImage,title:"Open in texture viewer",onClick:()=>r(e.previousImage,e.path+" (previous)")}):(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),e.currentImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.currentImage,title:"Open in texture viewer",onClick:()=>r(e.currentImage,e.path+" (current)")}):(0,mt.jsx)("span",{className:"compareNew",children:e.current})]})]},t))})]})]})}function Rh(e){const t=(255&e).toString(16);return 1===t.length?"0"+t:t}function xh(e,t,n,r){return"#"+Rh(e)+Rh(t)+Rh(n)+Rh(r)}function wh(e,t,n,r){const i=e=>(e/255).toFixed(2);return i(e)+", "+i(t)+", "+i(n)+", "+i(r)}function Fh(){const e=bt(),t=pt(e.store).textureViewer;return t.open?(0,mt.jsx)(Lh,{viewer:t,onClose:e.closeTextureViewer}):null}const Nh=120;function Lh(e){const{viewer:t,onClose:n}=e,r=(0,dt.useRef)(null),i=(0,dt.useRef)(null),s=(0,dt.useRef)(null),o=(0,dt.useRef)(null),[a,l]=(0,dt.useState)({r:!0,g:!0,b:!0,a:!0}),[u,c]=(0,dt.useState)(1),[h,d]=(0,dt.useState)("checker"),[f,p]=(0,dt.useState)(null),[m,g]=(0,dt.useState)(null),[E,v]=(0,dt.useState)(!1);(0,dt.useEffect)(()=>{let e=!1;const n=t=>{e||(o.current=t,p({width:t.width,height:t.height}),c(kh(t.width,t.height)),v(!0))};if(t.raw){const r=function(e){try{if(!e.data||e.width<=0||e.height<=0)return null;const t=function(e){const t=atob(e),n=new Uint8ClampedArray(t.length);for(let e=0;e{e=!0}}const r=new Image;return r.onload=()=>{const e=document.createElement("canvas");e.width=r.naturalWidth||1,e.height=r.naturalHeight||1;const t=e.getContext("2d");if(!t)return;t.drawImage(r,0,0);const i=t.getImageData(0,0,e.width,e.height);n({data:new Uint8ClampedArray(i.data),width:e.width,height:e.height})},r.src=t.src,()=>{e=!0}},[t.src,t.raw]),(0,dt.useEffect)(()=>{const e=o.current,t=r.current;if(!E||!e||!t)return;const n=function(e,t,n){let r=e.current;return r||(r=document.createElement("canvas"),e.current=r),r.width!==t&&(r.width=t),r.height!==n&&(r.height=n),r}(s,e.width,e.height),i=n.getContext("2d"),l=t.getContext("2d");if(!i||!l)return;const c=function(e,t){const n=new Uint8ClampedArray(e.length),r=t.a&&!t.r&&!t.g&&!t.b;for(let i=0;i{const e=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]);const C="textureViewerViewport"+("checker"===h?" checker":""),D="black"===h?{background:"#000"}:"white"===h?{background:"#fff"}:void 0;return(0,mt.jsx)("div",{className:"textureViewerOverlay",onClick:n,children:(0,mt.jsxs)("div",{className:"textureViewerModal",onClick:e=>e.stopPropagation(),children:[(0,mt.jsxs)("div",{className:"textureViewerHeader",children:[(0,mt.jsx)("span",{className:"textureViewerTitle",children:t.label}),(0,mt.jsxs)("span",{className:"textureViewerMeta",children:[f?f.width+" × "+f.height:"",!t.raw&&f?" · thumbnail":""]}),(0,mt.jsx)("span",{className:"textureViewerClose",title:"Close (Esc)",onClick:n,children:"✕"})]}),(0,mt.jsxs)("div",{className:"textureViewerToolbar",children:[(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Channels"}),(0,mt.jsx)(Oh,{channel:"r",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"g",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"b",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"a",mask:a,setMask:l})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"tvBtn",title:"Force alpha = 1 to reveal RGB hidden behind transparency",onClick:()=>l({r:!0,g:!0,b:!0,a:!1}),children:"Opaque"}),(0,mt.jsx)("span",{className:"tvBtn",title:"Show the alpha channel as grayscale",onClick:()=>l({r:!1,g:!1,b:!1,a:!0}),children:"Alpha → gray"})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"BG"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)(Ih,{value:"checker",glyph:"▦",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"black",glyph:"■",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"white",glyph:"□",background:h,setBackground:d})]})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Zoom"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.max(1,e/2)),children:"−"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(f?kh(f.width,f.height):1),children:"Fit"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.min(32,2*e)),children:"+"})]}),(0,mt.jsxs)("span",{className:"zoomVal",children:[Math.round(100*u),"%"]})]}),(0,mt.jsx)("div",{className:"textureViewerGroup textureViewerGroupEnd",children:(0,mt.jsx)("span",{className:"tvBtn primary",onClick:()=>{const e=s.current;e&&e.toBlob(e=>{if(!e)return;const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=((t.label||"texture").replace(/[^a-z0-9_\-]+/gi,"_").replace(/^_+|_+$/g,"")||"texture")+".png",r.click(),setTimeout(()=>URL.revokeObjectURL(n),0)})},children:"⭳ Save PNG"})})]}),(0,mt.jsxs)("div",{className:"textureViewerBody",children:[(0,mt.jsxs)("div",{className:C,style:D,children:[(0,mt.jsx)("canvas",{ref:r,className:"textureViewerCanvas",onMouseMove:e=>{const t=o.current,n=r.current,a=i.current,l=s.current;if(!t||!n)return;const c=n.getBoundingClientRect(),h=Math.floor((e.clientX-c.left)/u),d=Math.floor((e.clientY-c.top)/u);if(h<0||d<0||h>=t.width||d>=t.height)return g(null),void(a&&(a.style.display="none"));const f=4*(d*t.width+h);g({x:h,y:d,r:t.data[f],g:t.data[f+1],b:t.data[f+2],a:t.data[f+3]}),function(e,t,n,r){if(!e||!t)return;const i=e.getContext("2d");if(!i)return;i.imageSmoothingEnabled=!1,i.clearRect(0,0,Nh,Nh),i.drawImage(t,n-7,r-7,15,15,0,0,Nh,Nh),i.strokeStyle="#F0640D",i.lineWidth=2,i.strokeRect(56,56,8,8),e.style.display="block"}(a,l,h,d)},onMouseLeave:()=>{g(null),i.current&&(i.current.style.display="none")}}),(0,mt.jsx)("canvas",{ref:i,className:"textureViewerLoupe",width:Nh,height:Nh})]}),(0,mt.jsxs)("div",{className:"textureViewerRail",children:[(0,mt.jsx)("div",{className:"railTitle",children:"Pixel inspector"}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"position"}),(0,mt.jsx)("span",{className:"v",children:m?m.x+", "+m.y:"—"})]}),(0,mt.jsx)("div",{className:"swatch",children:(0,mt.jsx)("div",{className:"swatchInner",style:m?{background:"rgba("+m.r+","+m.g+","+m.b+","+m.a/255+")"}:void 0})}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"R"}),(0,mt.jsx)("span",{className:"v",children:m?m.r:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"G"}),(0,mt.jsx)("span",{className:"v",children:m?m.g:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"B"}),(0,mt.jsx)("span",{className:"v",children:m?m.b:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"A"}),(0,mt.jsx)("span",{className:"v",children:m?m.a:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"hex"}),(0,mt.jsx)("span",{className:"v",children:m?xh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"norm"}),(0,mt.jsx)("span",{className:"v",children:m?wh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"hint",children:["Move over the texture to sample pixels. Toggle channels to isolate RGB / alpha.",(0,mt.jsx)("b",{children:" Opaque"})," reveals colour hidden behind transparency (#183)."]})]})]})]})})}function Oh(e){const{channel:t,mask:n,setMask:r}=e,i=n[t],s="channel "+t+(i?" on":"");return(0,mt.jsx)("span",{className:s,onClick:()=>r(Object.assign(Object.assign({},n),{[t]:!i})),children:t.toUpperCase()})}function Ih(e){const{value:t,glyph:n,background:r,setBackground:i}=e;return(0,mt.jsx)("span",{className:"tvBtn"+(r===t?" active":""),onClick:()=>i(t),children:n})}function kh(e,t){return Math.max(1,Math.min(16,Math.floor(480/Math.max(e,t))||1))}function Mh(){const e=bt(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"resultViewComponent "+(t.visible?"active":""),children:[(0,mt.jsx)(Tt,{}),(0,mt.jsxs)(Rt,{children:[0===t.menuStatus&&(0,mt.jsx)(wt,{active:!0,captures:t.captures,onCaptureSelected:t=>{e.selectCapture(t),e.handleMenuStatusChange(40)},onSaveRequested:e.handleSaveRequested,onCaptureLoaded:e.handleCaptureLoaded}),40===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(Ft,{children:t.visualStates.map((t,n)=>(0,mt.jsx)(Nt,{item:t,onVisualStateSelected:()=>e.handleVisualStateSelected(n)},n))}),(0,mt.jsx)(Lt,{children:t.commands.map((t,n)=>(0,mt.jsx)(Ot,{command:t,onCommandSelected:()=>e.handleCommandSelected(n),onVertexSelected:()=>e.handleVertexSelected(n),onFragmentSelected:()=>e.handleFragmentSelected(n),onShaderSelected:()=>e.handleShaderSelected(n)},n))}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]}),10===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(kt,{left:!0,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationLeft})})}),(0,mt.jsx)(kt,{left:!1,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationRight})})})]}),20===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.initStateData})}),30===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.endStateData})}),60===t.menuStatus&&(0,mt.jsx)(_h,{}),50===t.menuStatus&&t.sourceCodeState&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(ch,{state:t.sourceCodeState,errorMessage:t.sourceCodeError,onVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!1),onFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!1),onTranslatedVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!0),onTranslatedFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!0),onCloseClicked:e.handleSourceCodeClose,onSourceCodeChanged:e.handleSourceCodeChanged,onBeautifyChanged:e.handleBeautifyChanged,onPreprocessChanged:e.handlePreprocessChanged}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]})]}),(0,mt.jsx)(Fh,{})]})}class Ph{static getMDNLink(e){const t=Ph.WebGL2Functions[e];if(t)return Ph.WebGL2RootUrl+t;const n=Ph.WebGLFunctions[e];if(n)return Ph.WebGLRootUrl+n;const r=Ph.AngleInstancedArraysExtFunctions[e];return r?Ph.AngleInstancedArraysExtRootUrl+r:Ph.WebGLRootUrl+e}}Ph.WebGL2RootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/",Ph.WebGLRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/",Ph.AngleInstancedArraysExtRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/",Ph.WebGL2Functions={beginQuery:"beginQuery",beginTransformFeedback:"beginTransformFeedback",bindBufferBase:"bindBufferBase",bindBufferRange:"bindBufferRange",bindSampler:"bindSampler",bindTransformFeedback:"bindTransformFeedback",bindVertexArray:"bindVertexArray",blitFramebuffer:"blitFramebuffer",clearBufferfv:"clearBuffer",clearBufferiv:"clearBuffer",clearBufferuiv:"clearBuffer",clearBufferfi:"clearBuffer",clientWaitSync:"clientWaitSync",compressedTexImage3D:"compressedTexImage3D",compressedTexSubImage3D:"compressedTexSubImage3D",copyBufferSubData:"copyBufferSubData",copyTexSubImage3D:"copyTexSubImage3D",createQuery:"createQuery",createSampler:"createSampler",createTransformFeedback:"createTransformFeedback",createVertexArray:"createVertexArray",deleteQuery:"deleteQuery",deleteSampler:"deleteSampler",deleteSync:"deleteSync",deleteTransformFeedback:"deleteTransformFeedback",deleteVertexArray:"deleteVertexArray",drawArraysInstanced:"drawArraysInstanced",drawBuffers:"drawBuffers",drawElementsInstanced:"drawElementsInstanced",drawRangeElements:"drawRangeElements",endQuery:"endQuery",endTransformFeedback:"endTransformFeedback",fenceSync:"fenceSync",framebufferTextureLayer:"framebufferTextureLayer",getActiveUniformBlockName:"getActiveUniformBlockName",getActiveUniformBlockParameter:"getActiveUniformBlockParameter",getActiveUniforms:"getActiveUniforms",getBufferSubData:"getBufferSubData",getFragDataLocation:"getFragDataLocation",getIndexedParameter:"getIndexedParameter",getInternalformatParameter:"getInternalformatParameter",getQuery:"getQuery",getQueryParameter:"getQueryParameter",getSamplerParameter:"getSamplerParameter",getSyncParameter:"getSyncParameter",getTransformFeedbackVarying:"getTransformFeedbackVarying",getUniformBlockIndex:"getUniformBlockIndex",getUniformIndices:"getUniformIndices",invalidateFramebuffer:"invalidateFramebuffer",invalidateSubFramebuffer:"invalidateSubFramebuffer",isQuery:"isQuery",isSampler:"isSampler",isSync:"isSync",isTransformFeedback:"isTransformFeedback",isVertexArray:"isVertexArray",pauseTransformFeedback:"pauseTransformFeedback",readBuffer:"readBuffer",renderbufferStorageMultisample:"renderbufferStorageMultisample",resumeTransformFeedback:"resumeTransformFeedback",samplerParameteri:"samplerParameter",samplerParameterf:"samplerParameter",texImage3D:"texImage3D",texStorage2D:"texStorage2D",texStorage3D:"texStorage3D",texSubImage3D:"texSubImage3D",transformFeedbackVaryings:"transformFeedbackVaryings",uniform1ui:"uniform",uniform2ui:"uniform",uniform3ui:"uniform",uniform4ui:"uniform",uniform1fv:"uniform",uniform2fv:"uniform",uniform3fv:"uniform",uniform4fv:"uniform",uniform1iv:"uniform",uniform2iv:"uniform",uniform3iv:"uniform",uniform4iv:"uniform",uniform1uiv:"uniform",uniform2uiv:"uniform",uniform3uiv:"uniform",uniform4uiv:"uniform",uniformBlockBinding:"uniformBlockBinding",uniformMatrix2fv:"uniformMatrix",uniformMatrix3x2fv:"uniformMatrix",uniformMatrix4x2fv:"uniformMatrix",uniformMatrix2x3fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4x3fv:"uniformMatrix",uniformMatrix2x4fv:"uniformMatrix",uniformMatrix3x4fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttribDivisor:"vertexAttribDivisor",vertexAttribI4i:"vertexAttribI",vertexAttribI4ui:"vertexAttribI",vertexAttribI4iv:"vertexAttribI",vertexAttribI4uiv:"vertexAttribI",vertexAttribIPointer:"vertexAttribIPointer",waitSync:"waitSync"},Ph.WebGLFunctions={uniform1f:"uniform",uniform1fv:"uniform",uniform1i:"uniform",uniform1iv:"uniform",uniform2f:"uniform",uniform2fv:"uniform",uniform2i:"uniform",uniform2iv:"uniform",uniform3f:"uniform",uniform3i:"uniform",uniform3iv:"uniform",uniform4f:"uniform",uniform4fv:"uniform",uniform4i:"uniform",uniform4iv:"uniform",uniformMatrix2fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttrib1f:"vertexAttrib",vertexAttrib2f:"vertexAttrib",vertexAttrib3f:"vertexAttrib",vertexAttrib4f:"vertexAttrib",vertexAttrib1fv:"vertexAttrib",vertexAttrib2fv:"vertexAttrib",vertexAttrib3fv:"vertexAttrib",vertexAttrib4fv:"vertexAttrib"},Ph.AngleInstancedArraysExtFunctions={drawArraysInstancedANGLE:"drawArraysInstancedANGLE",drawElementsInstancedANGLE:"drawElementsInstancedANGLE",vertexAttribDivisorANGLE:"vertexAttribDivisorANGLE"};const Bh={activeTexture:[["texture"]],attachShader:[["program","shader"]],beginQuery:[["target","query"]],beginTransformFeedback:[["primitiveMode"]],bindAttribLocation:[["program","index","name"]],bindBuffer:[["target","buffer"]],bindBufferBase:[["target","index","buffer"]],bindBufferRange:[["target","index","buffer","offset","size"]],bindFramebuffer:[["target","framebuffer"]],bindRenderbuffer:[["target","renderbuffer"]],bindSampler:[["unit","sampler"]],bindTexture:[["target","texture"]],bindTransformFeedback:[["target","tf"]],bindVertexArray:[["array"]],blendColor:[["red","green","blue","alpha"]],blendEquation:[["mode"]],blendEquationSeparate:[["modeRGB","modeAlpha"]],blendFunc:[["sfactor","dfactor"]],blendFuncSeparate:[["srcRGB","dstRGB","srcAlpha","dstAlpha"]],blitFramebuffer:[["srcX0","srcY0","srcX1","srcY1","dstX0","dstY0","dstX1","dstY1","mask","filter"]],bufferData:[["target","data","usage"],["target","size","usage"],["target","srcData","usage"],["target","srcData","usage","srcOffset","length"]],bufferSubData:[["target","dstByteOffset","srcData"],["target","offset","data"],["target","dstByteOffset","srcData","srcOffset","length"]],checkFramebufferStatus:[["target"]],clear:[["mask"]],clearBufferfi:[["buffer","drawbuffer","depth","stencil"]],clearBufferfv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferiv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferuiv:[["buffer","drawbuffer","values","srcOffset"]],clearColor:[["red","green","blue","alpha"]],clearDepth:[["depth"]],clearStencil:[["s"]],clientWaitSync:[["sync","flags","timeout"]],colorMask:[["red","green","blue","alpha"]],compileShader:[["shader"]],compressedTexImage2D:[["target","level","internalformat","width","height","border","data"],["target","level","internalformat","width","height","border","imageSize","offset"],["target","level","internalformat","width","height","border","srcData","srcOffset","srcLengthOverride"]],compressedTexImage3D:[["target","level","internalformat","width","height","depth","border","imageSize","offset"],["target","level","internalformat","width","height","depth","border","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage2D:[["target","level","xoffset","yoffset","width","height","format","data"],["target","level","xoffset","yoffset","width","height","format","imageSize","offset"],["target","level","xoffset","yoffset","width","height","format","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","imageSize","offset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","srcData","srcOffset","srcLengthOverride"]],copyBufferSubData:[["readTarget","writeTarget","readOffset","writeOffset","size"]],copyTexImage2D:[["target","level","internalformat","x","y","width","height","border"]],copyTexSubImage2D:[["target","level","xoffset","yoffset","x","y","width","height"]],copyTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","x","y","width","height"]],createBuffer:[[]],createFramebuffer:[[]],createProgram:[[]],createQuery:[[]],createRenderbuffer:[[]],createSampler:[[]],createShader:[["type"]],createTexture:[[]],createTransformFeedback:[[]],createVertexArray:[[]],cullFace:[["mode"]],deleteBuffer:[["buffer"]],deleteFramebuffer:[["framebuffer"]],deleteProgram:[["program"]],deleteQuery:[["query"]],deleteRenderbuffer:[["renderbuffer"]],deleteSampler:[["sampler"]],deleteShader:[["shader"]],deleteSync:[["sync"]],deleteTexture:[["texture"]],deleteTransformFeedback:[["tf"]],deleteVertexArray:[["vertexArray"]],depthFunc:[["func"]],depthMask:[["flag"]],depthRange:[["zNear","zFar"]],detachShader:[["program","shader"]],disable:[["cap"]],disableVertexAttribArray:[["index"]],drawArrays:[["mode","first","count"]],drawArraysInstanced:[["mode","first","count","instanceCount"]],drawBuffers:[["buffers"]],drawElements:[["mode","count","type","offset"]],drawElementsInstanced:[["mode","count","type","offset","instanceCount"]],drawRangeElements:[["mode","start","end","count","type","offset"]],enable:[["cap"]],enableVertexAttribArray:[["index"]],endQuery:[["target"]],endTransformFeedback:[[]],fenceSync:[["condition","flags"]],finish:[[]],flush:[[]],framebufferRenderbuffer:[["target","attachment","renderbuffertarget","renderbuffer"]],framebufferTexture2D:[["target","attachment","textarget","texture","level"]],framebufferTextureLayer:[["target","attachment","texture","level","layer"]],frontFace:[["mode"]],generateMipmap:[["target"]],getActiveAttrib:[["program","index"]],getActiveUniform:[["program","index"]],getActiveUniformBlockName:[["program","uniformBlockIndex"]],getActiveUniformBlockParameter:[["program","uniformBlockIndex","pname"]],getActiveUniforms:[["program","uniformIndices","pname"]],getAttachedShaders:[["program"]],getAttribLocation:[["program","name"]],getBufferParameter:[["target","pname"]],getBufferSubData:[["target","srcByteOffset","dstBuffer","dstOffset","length"]],getContextAttributes:[[]],getError:[[]],getExtension:[["extensionName"],["name"]],getFragDataLocation:[["program","name"]],getFramebufferAttachmentParameter:[["target","attachment","pname"]],getIndexedParameter:[["target","index"]],getInternalformatParameter:[["target","internalformat","pname"]],getParameter:[["pname"]],getProgramInfoLog:[["program"]],getProgramParameter:[["program","pname"]],getQuery:[["target","pname"]],getQueryParameter:[["query","pname"]],getRenderbufferParameter:[["target","pname"]],getSamplerParameter:[["sampler","pname"]],getShaderInfoLog:[["shader"]],getShaderParameter:[["shader","pname"]],getShaderPrecisionFormat:[["shadertype","precisiontype"]],getShaderSource:[["shader"]],getSupportedExtensions:[[]],getSyncParameter:[["sync","pname"]],getTexParameter:[["target","pname"]],getTransformFeedbackVarying:[["program","index"]],getUniform:[["program","location"]],getUniformBlockIndex:[["program","uniformBlockName"]],getUniformIndices:[["program","uniformNames"]],getUniformLocation:[["program","name"]],getVertexAttrib:[["index","pname"]],getVertexAttribOffset:[["index","pname"]],hint:[["target","mode"]],invalidateFramebuffer:[["target","attachments"]],invalidateSubFramebuffer:[["target","attachments","x","y","width","height"]],isBuffer:[["buffer"]],isContextLost:[[]],isEnabled:[["cap"]],isFramebuffer:[["framebuffer"]],isProgram:[["program"]],isQuery:[["query"]],isRenderbuffer:[["renderbuffer"]],isSampler:[["sampler"]],isShader:[["shader"]],isSync:[["sync"]],isTexture:[["texture"]],isTransformFeedback:[["tf"]],isVertexArray:[["vertexArray"]],lineWidth:[["width"]],linkProgram:[["program"]],pauseTransformFeedback:[[]],pixelStorei:[["pname","param"]],polygonOffset:[["factor","units"]],readBuffer:[["src"]],readPixels:[["x","y","width","height","format","type","dstData"],["x","y","width","height","format","type","offset"],["x","y","width","height","format","type","pixels"],["x","y","width","height","format","type","dstData","dstOffset"]],renderbufferStorage:[["target","internalformat","width","height"]],renderbufferStorageMultisample:[["target","samples","internalformat","width","height"]],resumeTransformFeedback:[[]],sampleCoverage:[["value","invert"]],samplerParameterf:[["sampler","pname","param"]],samplerParameteri:[["sampler","pname","param"]],scissor:[["x","y","width","height"]],shaderSource:[["shader","source"]],stencilFunc:[["func","ref","mask"]],stencilFuncSeparate:[["face","func","ref","mask"]],stencilMask:[["mask"]],stencilMaskSeparate:[["face","mask"]],stencilOp:[["fail","zfail","zpass"]],stencilOpSeparate:[["face","fail","zfail","zpass"]],texImage2D:[["target","level","internalformat","format","type","source"],["target","level","internalformat","width","height","border","format","type","pboOffset"],["target","level","internalformat","width","height","border","format","type","pixels"],["target","level","internalformat","width","height","border","format","type","source"],["target","level","internalformat","width","height","border","format","type","srcData","srcOffset"]],texImage3D:[["target","level","internalformat","width","height","depth","border","format","type","pboOffset"],["target","level","internalformat","width","height","depth","border","format","type","source"],["target","level","internalformat","width","height","depth","border","format","type","srcData"],["target","level","internalformat","width","height","depth","border","format","type","srcData","srcOffset"]],texParameterf:[["target","pname","param"]],texParameteri:[["target","pname","param"]],texStorage2D:[["target","levels","internalformat","width","height"]],texStorage3D:[["target","levels","internalformat","width","height","depth"]],texSubImage2D:[["target","level","xoffset","yoffset","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","pboOffset"],["target","level","xoffset","yoffset","width","height","format","type","pixels"],["target","level","xoffset","yoffset","width","height","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","srcData","srcOffset"]],texSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","pboOffset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","source"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","srcData","srcOffset"]],transformFeedbackVaryings:[["program","varyings","bufferMode"]],uniform1f:[["location","x"]],uniform1fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1i:[["location","x"]],uniform1iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1ui:[["location","v0"]],uniform1uiv:[["location","data","srcOffset","srcLength"]],uniform2f:[["location","x","y"]],uniform2fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2i:[["location","x","y"]],uniform2iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2ui:[["location","v0","v1"]],uniform2uiv:[["location","data","srcOffset","srcLength"]],uniform3f:[["location","x","y","z"]],uniform3fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3i:[["location","x","y","z"]],uniform3iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3ui:[["location","v0","v1","v2"]],uniform3uiv:[["location","data","srcOffset","srcLength"]],uniform4f:[["location","x","y","z","w"]],uniform4fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4i:[["location","x","y","z","w"]],uniform4iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4ui:[["location","v0","v1","v2","v3"]],uniform4uiv:[["location","data","srcOffset","srcLength"]],uniformBlockBinding:[["program","uniformBlockIndex","uniformBlockBinding"]],uniformMatrix2fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x3fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x3fv:[["location","transpose","data","srcOffset","srcLength"]],useProgram:[["program"]],validateProgram:[["program"]],vertexAttrib1f:[["index","x"]],vertexAttrib1fv:[["index","values"]],vertexAttrib2f:[["index","x","y"]],vertexAttrib2fv:[["index","values"]],vertexAttrib3f:[["index","x","y","z"]],vertexAttrib3fv:[["index","values"]],vertexAttrib4f:[["index","x","y","z","w"]],vertexAttrib4fv:[["index","values"]],vertexAttribDivisor:[["index","divisor"]],vertexAttribI4i:[["index","x","y","z","w"]],vertexAttribI4iv:[["index","values"]],vertexAttribI4ui:[["index","x","y","z","w"]],vertexAttribI4uiv:[["index","values"]],vertexAttribIPointer:[["index","size","type","stride","offset"]],vertexAttribPointer:[["index","size","type","normalized","stride","offset"]],viewport:[["x","y","width","height"]],waitSync:[["sync","flags","timeout"]]};class Uh{static getNames(e,t){const n=Bh[e];if(!n||0===n.length)return null;for(const e of n)if(e.length===t)return e;let r=null;for(const e of n)e.length>=t&&(null===r||e.lengthi.length&&(i=e);return i}static getName(e,t,n){const r=Uh.getNames(e,n);return r&&t>=0&&t{const e={};for(let t=0;t<64;t++)e["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;return e})();class qh{constructor(e){this.sources=e.sources||[],this.names=e.names||[],this.sourceRoot=e.sourceRoot||"",this.lines=qh.parseMappings(e.mappings||"")}originalPositionFor(e,t){const n={source:null,line:null,column:null,name:null},r=e-1;if(r<0||r>=this.lines.length)return n;const i=this.lines[r];if(!i||0===i.length)return n;const s=this.findSegment(i,t);if(!s)return n;const o=s.sourceIndex>=0&&s.sourceIndex=0&&s.nameIndex>1,o=e[s];o.generatedColumn<=t?(i=o,n=s+1):r=s-1}return i}static parseMappings(e){const t=[];let n=0,r=0,i=0,s=0;const o=e.split(";");for(let e=0;e0){const e=a.split(",");for(let t=0;t=4&&(n+=o[1],r+=o[2],i+=o[3],a.sourceIndex=n,a.originalLine=r,a.originalColumn=i,o.length>=5&&(s+=o[4],a.nameIndex=s)),l.push(a)}}l.sort((e,t)=>e.generatedColumn-t.generatedColumn),t.push(l)}return t}static decodeSegment(e){const t=[];let n=0;for(;n>>=1,t.push(o?-r:r)}return t}}var Qh=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})};class Zh{constructor(e){this.cache=new Map,this.inflight=new Map,this.fetchFn=e||("undefined"!=typeof fetch?fetch.bind(globalThis):void 0)}resolveFrames(e){return Qh(this,void 0,void 0,function*(){return e&&0!==e.length?Promise.all(e.map(e=>this.resolveFrame(e))):e||[]})}resolveFrame(e){return Qh(this,void 0,void 0,function*(){const t=Zh.parseFrame(e);if(!t)return e;let n;try{n=yield this.getConsumer(t.url)}catch(t){return e}if(!n)return e;const r=n.originalPositionFor(t.line,t.column);return r.source&&null!==r.line?Zh.formatFrame(t.functionName,r.name,r.source,r.line,r.column||0):e})}static parseFrame(e){if(!e)return null;let t=e.match(/^(.*?)\s*\((.+):(\d+):(\d+)\)\s*$/);return t?{functionName:t[1].trim(),url:t[2],line:parseInt(t[3],10),column:parseInt(t[4],10)}:(t=e.match(/^\s*(.+):(\d+):(\d+)\s*$/),t?{functionName:"",url:t[1].trim(),line:parseInt(t[2],10),column:parseInt(t[3],10)}:null)}static formatFrame(e,t,n,r,i){const s=t||e,o=n+":"+r+":"+i;return s?s+" ("+o+")":o}getConsumer(e){return Qh(this,void 0,void 0,function*(){if(this.cache.has(e))return this.cache.get(e);const t=this.inflight.get(e);if(t)return t;const n=this.loadConsumer(e).then(t=>(this.cache.set(e,t),this.inflight.delete(e),t)).catch(()=>(this.cache.set(e,null),this.inflight.delete(e),null));return this.inflight.set(e,n),n})}loadConsumer(e){return Qh(this,void 0,void 0,function*(){if(!this.fetchFn)return null;const t=yield this.fetchFn(e);if(!t.ok)return null;const n=yield t.text(),r=Zh.extractSourceMappingURL(n);if(!r)return null;let i;if(0===r.indexOf("data:"))i=Zh.parseDataUri(r);else{const t=Zh.resolveUrl(r,e),n=yield this.fetchFn(t);if(!n.ok)return null;i=yield n.json()}return i&&"string"==typeof i.mappings?new qh(i):null})}static extractSourceMappingURL(e){const t=/\/\/[#@]\s*sourceMappingURL=(\S+)\s*$/gm;let n,r=null;for(;null!==(n=t.exec(e));)r=n[1];return r}static parseDataUri(e){const t=e.indexOf(",");if(-1===t)return null;const n=e.substring(0,t),r=e.substring(t+1);try{const e=/;base64/i.test(n)?Zh.decodeBase64(r):decodeURIComponent(r);return JSON.parse(e)}catch(e){return null}}static decodeBase64(e){if("function"==typeof atob)return atob(e);const t=globalThis.Buffer;if(t)return t.from(e,"base64").toString("utf-8");throw new Error("No base64 decoder available.")}static resolveUrl(e,t){try{return new URL(e,t).href}catch(t){return e}}}function Jh(e){return e&&(e.text||e.name)||""}function ed(e,t){const n=[];if(!e||!t)return n;const r=e.DrawCall,i=t.DrawCall;ad("uniform",r&&r.uniforms,i&&i.uniforms,n),ad("uniformBlock",r&&r.uniformBlocks,i&&i.uniformBlocks,n);const s=sd(e,t);for(const r of s){if(td[r])continue;const i=e[r],s=t[r];(rd(i)||rd(s))&&od(i,s,r,n)}return n}const td={id:!0,name:!0,commandArguments:!0,result:!0,status:!0,marker:!0,text:!0,startTime:!0,commandEndTime:!0,endTime:!0,stackTrace:!0,consumeCommandId:!0,VisualState:!0},nd={__SPECTOR_Object_TAG:!0,__SPECTOR_Object_CustomData:!0,__SPECTOR_Metadata:!0,customData:!0,visual:!0,visualPixels:!0,VisualState:!0,texture:!0,sampler:!0,location:!0,source:!0,translatedSource:!0,analyserName:!0,uniforms:!0,uniformBlocks:!0,length:!0};function rd(e){return null!==e&&"object"==typeof e}function id(e){if(!rd(e))return null;const t=e.__SPECTOR_Object_TAG||("string"==typeof e.typeName&&"id"in e?e:null);return t&&"string"==typeof t.typeName?t.typeName:null}function sd(e,t){const n=[],r={},i=e=>{if(rd(e))for(const t in e)e.hasOwnProperty(t)&&!r[t]&&(r[t]=!0,n.push(t))};return i(e),i(t),n}function od(e,t,n,r,i=0){const s=id(e),o=id(t);if(null!==s||null!==o){const e=null!==s?s:"(absent)",t=null!==o?o:"(absent)";return void(e!==t&&r.push({path:n,previous:e,current:t}))}const a=rd(e),l=rd(t);if(!a&&!l){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}if(a!==l||i>=8){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}for(const s of sd(e,t))nd[s]||od(e?e[s]:void 0,t?t[s]:void 0,n+"."+s,r,i+1)}function ad(e,t,n,r){const i=hd(t),s=hd(n),o=[],a={};for(const e in i)i.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const e in s)s.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const t of o){const n=i.hasOwnProperty(t)?i[t]:void 0,o=s.hasOwnProperty(t)?s[t]:void 0,a=n?dd(n.value):"(absent)",l=o?dd(o.value):"(absent)";a!==l&&r.push({path:e+" "+t,previous:a,current:l}),ld(e+" "+t,n,o,r)}}function ld(e,t,n,r){const i=t&&t.texture,s=n&&n.texture;(rd(i)||rd(s))&&cd(e+" texture",i,s,r);const o=t&&t.textures,a=n&&n.textures,l=Array.isArray(o)?o.length:0,u=Array.isArray(a)?a.length:0,c=Math.max(l,u);for(let t=0;t0?o[t]:void 0,u>0?a[t]:void 0,r)}const ud=["width","height","depth","format","internalFormat","textureType"];function cd(e,t,n,r){(rd(t)||rd(n))&&(function(e,t,n,r){for(const i of ud){const s=t?t[i]:void 0,o=n?n[i]:void 0;if(void 0===s&&void 0===o)continue;const a=dd(s),l=dd(o);a!==l&&r.push({path:e+" "+i,previous:a,current:l})}}(e,t,n,r),function(e,t,n,r){if(rd(t)||rd(n))for(const i of sd(t,n)){const s=t?t[i]:void 0,o=n?n[i]:void 0,a="string"==typeof s,l="string"==typeof o;(a||l)&&s!==o&&r.push({path:e+" ("+i+")",previous:a?"(image)":"(absent)",current:l?"(image)":"(absent)",previousImage:a?s:void 0,currentImage:l?o:void 0})}}(e,t&&t.visual,n&&n.visual,r))}function hd(e){const t={};if(Array.isArray(e))for(const n of e)n&&"string"==typeof n.name&&(t[n.name]=n);return t}function dd(e){if(void 0===e)return"(absent)";if(null===e)return"null";try{return JSON.stringify(e)}catch(t){return String(e)}}function fd(e,t){for(let n=0;n{if(this.store.getSnapshot().currentCapture)switch(e){case 0:this._displayCaptures();break;case 40:this._displayCurrentCapture();break;case 10:this._displayInformation();break;case 20:this._displayInitState();break;case 30:this._displayEndState();break;case 60:this._displayCompare()}else this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))},this.handleSearchTextChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{searchText:e})),this._search(e)},this.handleCompareOnlyDifferencesChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{compareOnlyDifferences:e}))},this.handleCompareCommandSelected=e=>{null!=e&&(this._currentCommandId=e,this._displayCurrentCapture())},this.handleCommandSelected=e=>{this.selectCommand(e)},this.openTextureViewer=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{textureViewer:{open:!0,src:e.src,label:e.label,pixelated:e.pixelated,raw:e.raw||null}}))},this.closeTextureViewer=()=>{this.store.setState(e=>Object.assign(Object.assign({},e),{textureViewer:Object.assign(Object.assign({},e.textureViewer),{open:!1})}))},this.handleVisualStateSelected=e=>{this.selectVisualState(e)},this.handleVertexSelected=e=>{this.selectCommand(e),this._openShader(!1)},this.handleFragmentSelected=e=>{this.selectCommand(e),this._openShader(!0)},this.handleShaderSelected=e=>{var t;const n=null===(t=this.store.getSnapshot().commands[e])||void 0===t?void 0:t.capture.shader;n&&(this.selectCommand(e),this._openCapturedShader(n))},this.handleShaderSourceOpen=(e,t)=>{this._openCapturedShader(e,t)},this.handleSourceCodeChanged=e=>{this.onSourceCodeChanged.trigger(e)},this.handleSourceCodeClose=()=>{this._displayCurrentCapture()},this.handleSourceCodeTabChange=(e,t)=>{this.store.setState(n=>n.sourceCodeState?Object.assign(Object.assign({},n),{sourceCodeState:Object.assign(Object.assign({},n.sourceCodeState),{fragment:e,translated:t})}):n)},this.handleBeautifyChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{beautify:e})}):t)},this.handlePreprocessChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{preprocessed:e})}):t)},this.handleSaveRequested=e=>{this.saveCapture(e)},this.handleCaptureLoaded=e=>{this.addCapture(e)},this.handleClose=()=>{this.hide()},this._rootPlaceHolder=e||document.body,this.onSourceCodeChanged=new l,this.store=new ft(Object.assign({},pd)),this._container=document.createElement("div"),this._container.className="spector-react-result-view",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(yt.Provider,{value:this},(0,dt.createElement)(Mh))),this._rootPlaceHolder.addEventListener("keydown",e=>{if(40!==this.store.getSnapshot().menuStatus)return;const t=e.keyCode;38===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousCommand()):40===t?(e.preventDefault(),e.stopPropagation(),this._selectNextCommand()):33===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousVisualState()):34===t&&(e.preventDefault(),e.stopPropagation(),this._selectNextVisualState())})}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}addCapture(e){return this.store.setState(t=>{const n=t.captures.map(e=>({capture:e.capture,active:!1}));return Object.assign(Object.assign({},t),{captures:[{capture:e,active:!0},...n],currentCapture:e})}),this._currentCommandId=-1,this._displayCurrentCapture(),0}selectCapture(e){this._currentCommandId=-1,this.store.setState(t=>{var n,r;const i=t.captures.map((t,n)=>({capture:t.capture,active:n===e}));return Object.assign(Object.assign({},t),{captures:i,currentCapture:null!==(r=null===(n=i[e])||void 0===n?void 0:n.capture)&&void 0!==r?r:null})}),this._displayCurrentCapture()}selectCommand(e){const t=this.store.getSnapshot();if(e<0||e>=t.commands.length)return;const n=t.commands[e];this._currentCommandId=n.capture.id;const r=n.visualStateIndex,i=this._buildCommandDetail(e,t.commands,t.visualStates);this.store.setState(t=>Object.assign(Object.assign({},t),{commands:t.commands.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentCommandIndex:e,visualStates:t.visualStates.map((e,t)=>e.active!==(t===r)?Object.assign(Object.assign({},e),{active:t===r}):e),currentVisualStateIndex:r,commandDetailData:i}))}selectVisualState(e){const t=this.store.getSnapshot();if(e<0||e>=t.visualStates.length)return;const n=t.visualStates[e].commandIndex;if(n===Number.MIN_VALUE)return void this._displayInitState();if(n===Number.MAX_VALUE)return void this._displayEndState();n>=0&&(this._currentCommandId=t.commands[n].capture.id);const r=n>=0?this._buildCommandDetail(n,t.commands,t.visualStates):t.commandDetailData;this.store.setState(t=>Object.assign(Object.assign({},t),{visualStates:t.visualStates.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentVisualStateIndex:e,commands:n>=0?t.commands.map((e,t)=>e.active!==(t===n)?Object.assign(Object.assign({},e),{active:t===n}):e):t.commands,currentCommandIndex:n>=0?n:t.currentCommandIndex,commandDetailData:r}))}showSourceCodeError(e){this.store.setState(t=>Object.assign(Object.assign({},t),{sourceCodeError:e}))}saveCapture(e){const t=JSON.stringify(e,null,4),n=new Blob([t],{type:"octet/stream"}),r="capture "+new Date(e.startTime).toTimeString().split(" ")[0]+".json",i=document.createElement("a"),s=window.URL.createObjectURL(n);i.setAttribute("href",s),i.setAttribute("download",r),i.click()}_displayCaptures(){this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))}_displayCompare(){const e=this.store.getSnapshot(),t=e.captures.findIndex(e=>e.active),n=t>=0?e.captures[t]:null,r=n?e.captures[t+1]:null;if(!n||!r)return void this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:60,canCompare:!1,compareRows:[],compareSummary:{added:0,removed:0,changed:0,unchanged:0},compareLabel:""}));const i=function(e,t){const n=function(e,t){const n=e.length,r=t.length,i=e.map(Jh),s=t.map(Jh),o=[];for(let e=0;e<=n;e++)o.push(new Array(r+1).fill(0));for(let e=n-1;e>=0;e--)for(let t=r-1;t>=0;t--)o[e][t]=i[e]===s[t]?o[e+1][t+1]+1:Math.max(o[e+1][t],o[e][t+1]);const a=[];let l=[];const u=()=>{for(const e of l)a.push(e);l=[]};let c=0,h=0;for(;c0?a.push({type:"changed",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id,fieldDiffs:n}):a.push({type:"unchanged",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id}),c++,h++}else if(o[c+1][h]>=o[c][h+1])l.push({type:"removed",name:e[c].name,previousText:e[c].text,indexA:c}),c++;else{const n=fd(l,t[h].name);n?a.push({type:"changed",name:t[h].name,previousText:n.previousText,currentText:t[h].text,indexA:n.indexA,indexB:h,commandId:t[h].id,fieldDiffs:ed(e[n.indexA],t[h])}):(u(),a.push({type:"added",name:t[h].name,currentText:t[h].text,indexB:h,commandId:t[h].id})),h++}for(;cObject.assign(Object.assign({},e),{menuStatus:60,canCompare:!0,compareRows:i.rows,compareSummary:i.summary,compareLabel:s}))}static _captureLabel(e){try{return new Date(e.startTime).toTimeString().split(" ")[0]}catch(e){return"capture"}}_displayInformation(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];zh(n,"Canvas",t.canvas,e.searchText),zh(n,"Context",t.context,e.searchText);const r=[];for(const n of t.analyses){const t="Primitives"===n.analyserName?"Vertices count":n.analyserName;zh(r,t,n,e.searchText)}zh(r,"Frame Memory Changes",t.frameMemory,e.searchText),zh(r,"Total Memory (seconds since application start: bytes)",t.memory,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:10,commandCount:t.commands.length,informationLeft:n,informationRight:r}))}_displayInitState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.initState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:20,commandCount:t.commands.length,initStateData:n}))}_displayEndState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.endState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:30,commandCount:t.commands.length,endStateData:n}))}_displayCurrentCapture(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=e.searchText,r=e.captures.map(e=>({capture:e.capture,active:e.capture===t})),i=[];i.push({VisualState:t.initState.VisualState,time:t.startTime,commandIndex:Number.MIN_VALUE,active:!1,previousVisualStateIndex:-1,nextVisualStateIndex:-1});const s=[];let o=0,a=!1,l=-1,u=-1;for(let e=0;e0?c-1:-1,nextCommandIndex:-1,visualStateIndex:o,active:!1};if(c>0&&(s[c-1].nextCommandIndex=c),r.VisualState){const e=i.length,t=i.length-1,n={VisualState:r.VisualState,time:r.endTime,commandIndex:c,active:!1,previousVisualStateIndex:t,nextVisualStateIndex:-1};i[t].nextVisualStateIndex=e,i.push(n),o=e,a=!0}else a||(i[0].commandIndex=c,a=!0);h.visualStateIndex=o,s.push(h),(-1===this._currentCommandId&&0===c||this._currentCommandId===r.id)&&(l=c,u=o)}l>=0&&(s[l].active=!0,this._currentCommandId=s[l].capture.id),u>=0&&(i[u].active=!0);let c=[];l>=0&&(c=this._buildCommandDetail(l,s,i)),this.store.setState(e=>Object.assign(Object.assign({},e),{captures:r,menuStatus:40,commandCount:t.commands.length,commands:s,currentCommandIndex:l,visualStates:i,currentVisualStateIndex:u,sourceCodeState:null,sourceCodeError:"",commandDetailData:c}))}_openShader(e){const t=this.store.getSnapshot();if(t.currentCommandIndex<0||t.currentCommandIndex>=t.commands.length)return;const n=t.commands[t.currentCommandIndex].capture.DrawCall;if(!n||!n.shaders||n.shaders.length<2)return;const r={programId:n.programStatus.program.__SPECTOR_Object_TAG.id,nameVertex:n.shaders[0].name,nameFragment:n.shaders[1].name,sourceVertex:n.shaders[0].source,sourceFragment:n.shaders[1].source,translatedSourceVertex:n.shaders[0].translatedSource,translatedSourceFragment:n.shaders[1].translatedSource,fragment:e,translated:!1,editable:n.programStatus.RECOMPILABLE,beautify:!0,preprocessed:!1,singleShader:!1,sourceVertexLog:n.shaders[0].infoLog||"",sourceFragmentLog:n.shaders[1].infoLog||"",programLog:n.programStatus.infoLog||""},i=this._buildCommandDetail(t.currentCommandIndex,t.commands,t.visualStates);this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:"",commandDetailData:i}))}_openCapturedShader(e,t=""){if(!e||"string"!=typeof e.source)return;const n="FRAGMENT_SHADER"===e.shaderType,r={programId:-1,nameVertex:n?"":e.name,nameFragment:n?e.name:"",sourceVertex:n?"":e.source,sourceFragment:n?e.source:"",translatedSourceVertex:n?"":e.translatedSource||"",translatedSourceFragment:n&&e.translatedSource||"",fragment:n,translated:!1,editable:!1,beautify:!0,preprocessed:!1,singleShader:!0,sourceVertexLog:n?"":e.infoLog||"",sourceFragmentLog:n&&e.infoLog||"",programLog:t};this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:""}))}_buildCommandDetail(e,t,n){if(e<0||e>=t.length)return[];const r=t[e],i=n[r.visualStateIndex],s=this._resolvedStackTraces.get(r.capture.id),o=function(e,t,n){const r=[];t&&r.push({type:"visualState",visualState:t});let i="Unknown";switch(e.status){case 50:i="Deprecated";break;case 10:i="Unused";break;case 20:i="Disabled";break;case 30:i="Redundant";break;case 40:i="Valid"}const s=Ph.getMDNLink(e.name);e.result?zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,result:e.result,status:i},""):"LOG"!==e.name&&zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,status:i},"");for(const t in e)"VisualState"!==t&&"result"!==t&&("commandArguments"===t&&Array.isArray(e.commandArguments)?Kh(r,e.name,e.commandArguments):Xh(r,t,e)||("stackTrace"===t&&Array.isArray(e.stackTrace)?zh(r,"stackTrace",n||e.stackTrace,""):"object"==typeof e[t]&&zh(r,t,e[t],"")));return r}(r.capture,null==i?void 0:i.VisualState,s);return s||this._resolveStackTraceAsync(r.capture),o}_resolveStackTraceAsync(e){const t=e.id;this._resolvedStackTraces.has(t)||this._resolvingStackTraces.has(t)||e.stackTrace&&0!==e.stackTrace.length&&(this._resolvingStackTraces.add(t),this._sourceMapResolver.resolveFrames(e.stackTrace).then(n=>{this._resolvingStackTraces.delete(t),this._resolvedStackTraces.set(t,n);let r=!1;for(let t=0;tObject.assign(Object.assign({},t),{commandDetailData:e}))}}).catch(()=>{this._resolvingStackTraces.delete(t)}))}_selectPreviousCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.previousCommandIndex<0||this.selectCommand(t.previousCommandIndex)}_selectNextCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.nextCommandIndex<0||this.selectCommand(t.nextCommandIndex)}_selectPreviousVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.previousVisualStateIndex<0||this.selectVisualState(t.previousVisualStateIndex)}_selectNextVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.nextVisualStateIndex<0||this.selectVisualState(t.nextVisualStateIndex)}_search(e){switch(this.store.getSnapshot().menuStatus){case 0:case 40:this._displayCurrentCapture();break;case 30:this._displayEndState();break;case 10:this._displayInformation();break;case 20:this._displayInitState()}this.store.setState(e=>Object.assign(Object.assign({},e),{searchText:""}))}}class gd{constructor(e,t={}){this.worker=e,this.captureTimeout=t.captureTimeout||1e4,this.disposed=!1,this.captureTimer=null,this.onCapture=new l,this.onCaptureStarted=new l,this.onError=new l,this.onFps=new l,this.onContextReady=new l,this.messageHandler=this.handleMessage.bind(this),this.worker.addEventListener("message",this.messageHandler)}triggerCapture(e=0,t=0,n=!1,r=!1){if(this.disposed)return;this.clearCaptureTimer();const i={type:"spector:trigger-capture",version:1,canvasIndex:e,commandCount:t,quickCapture:n,fullCapture:r};this.worker.postMessage(i),this.captureTimer=setTimeout(()=>{this.onError.trigger("Capture timed out after "+this.captureTimeout+"ms"),this.captureTimer=null},this.captureTimeout)}dispose(){this.disposed||(this.disposed=!0,this.clearCaptureTimer(),this.worker.removeEventListener("message",this.messageHandler),this.onCapture.clear(),this.onCaptureStarted.clear(),this.onError.clear(),this.onFps.clear(),this.onContextReady.clear())}handleMessage(e){const t=e.data;if(!function(e){return null!=e&&"object"==typeof e&&"string"==typeof e.type&&0===e.type.indexOf("spector:")}(t))return;const n=t;switch(n.type){case"spector:context-ready":this.onContextReady.trigger({canvasCount:n.canvasCount,canvasWidth:n.canvasWidth,canvasHeight:n.canvasHeight});break;case"spector:capture-started":this.onCaptureStarted.trigger(void 0);break;case"spector:capture-complete":this.clearCaptureTimer(),this.onCapture.trigger(n.capture);break;case"spector:error":this.clearCaptureTimer(),this.onError.trigger(n.error);break;case"spector:fps":this.onFps.trigger(n.fps)}}clearCaptureTimer(){null!=this.captureTimer&&(clearTimeout(this.captureTimer),this.captureTimer=null)}}var Ed=n(72),vd=n.n(Ed),Cd=n(825),Dd=n.n(Cd),Sd=n(659),Ad=n.n(Sd),_d=n(56),yd=n.n(_d),bd=n(540),Td=n.n(bd),Rd=n(113),xd=n.n(Rd),wd=n(377),Fd={};Fd.styleTagTransform=xd(),Fd.setAttributes=yd(),Fd.insert=Ad().bind(null,"html"),Fd.domAPI=Dd(),Fd.insertStyleElement=Td(),vd()(wd.A,Fd),wd.A&&wd.A.locals&&wd.A.locals;var Nd=n(160),Ld={};Ld.styleTagTransform=xd(),Ld.setAttributes=yd(),Ld.insert=Ad().bind(null,"html"),Ld.domAPI=Dd(),Ld.insertStyleElement=Td(),vd()(Nd.A,Ld),Nd.A&&Nd.A.locals&&Nd.A.locals;class Od{constructor(e){this.timeSpy=e,this.init()}spyXRSession(e){this.currentXRSession&&this.unspyXRSession();for(const e of at.getRequestAnimationFrameFunctionNames())y.resetOriginFunction(this.timeSpy.getSpiedScope(),e);this.timeSpy.spyRequestAnimationFrame("requestAnimationFrame",e),this.currentXRSession=e}unspyXRSession(){if(this.currentXRSession){y.resetOriginFunction(this.currentXRSession,"requestAnimationFrame"),this.currentXRSession=void 0;for(const e of at.getRequestAnimationFrameFunctionNames())this.timeSpy.spyRequestAnimationFrame(e,this.timeSpy.getSpiedScope())}}init(){if(!navigator.xr)return;class e extends XRWebGLLayer{constructor(e,t,n){super(e,t,n),this.glContext=t}getContext(){return this.glContext}}class t extends XRWebGLBinding{constructor(e,t){super(e,t),this.glContext=t}createProjectionLayer(e){const t=super.createProjectionLayer(e);return t.glContext=this.glContext,t}}window.XRWebGLLayer=e,window.XRWebGLBinding=t;const n=navigator.xr.requestSession;Object.defineProperty(navigator.xr,"requestSessionInternal",{writable:!0}),navigator.xr.requestSessionInternal=n,Object.defineProperty(navigator.xr,"requestSession",{writable:!0}),navigator.xr.requestSession=(e,t)=>((e,t)=>navigator.xr.requestSessionInternal(e,t).then(e=>{const t=e;return t._updateRenderState=e.updateRenderState,t.updateRenderState=e=>function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){if(e.baseLayer){const n=e.baseLayer;t.glContext=n.getContext()}if(e.layers)for(const n of e.layers){const e=n;e.glContext&&(t.glContext=e.glContext)}return t._updateRenderState(e)}),this.spyXRSession(t),e.addEventListener("end",()=>{this.unspyXRSession()}),Promise.resolve(e)}))(e,t)}}const Id={CaptureMenu:_t,ResultView:md};class kd{static getFirstAvailable3dContext(e){return this.tryGetContextFromHelperField(e)||this.tryGetContextFromCanvas(e,"webgl")||this.tryGetContextFromCanvas(e,"experimental-webgl")||this.tryGetContextFromCanvas(e,"webgl2")||this.tryGetContextFromCanvas(e,"experimental-webgl2")}static tryGetContextFromHelperField(e){const t=e instanceof HTMLCanvasElement?e.getAttribute("__spector_context_type"):e.__spector_context_type;if(t)return this.tryGetContextFromCanvas(e,t)}static tryGetContextFromCanvas(e,t){let n;try{n=e.getContext(t)}catch(e){}return n}constructor(e={}){this.noFrameTimeout=-1,this.options=Object.assign({enableXRCapture:!1},e),this.captureNextFrames=0,this.captureNextCommands=0,this.quickCapture=!1,this.fullCapture=!1,this.retry=0,this.contexts=[],this.workerBridges=new Map,this.timeSpy=new at,this.onCaptureStarted=new l,this.onCapture=new l,this.onError=new l,this.timeSpy.onFrameStart.add(this.onFrameStart,this),this.timeSpy.onFrameEnd.add(this.onFrameEnd,this),this.timeSpy.onError.add(this.onErrorInternal,this),ct.install(),this.options.enableXRCapture&&(this.xrSpy=new Od(this.timeSpy))}displayUI(e=!1){this.captureMenu||(this.getCaptureUI(),this.captureMenu.onPauseRequested.add(this.pause,this),this.captureMenu.onPlayRequested.add(this.play,this),this.captureMenu.onPlayNextFrameRequested.add(this.playNextFrame,this),this.captureMenu.onCaptureRequested.add(e=>{e&&(e.ref instanceof Worker?this.captureWorker(e.ref):this.captureCanvas(e.ref))},this),setInterval(()=>{this.captureMenu.setFPS(this.getFps())},1e3),e||this.captureMenu.trackPageCanvases(),this.captureMenu.display()),this.resultView||(this.getResultUI(),this.onCapture.add(e=>{this.resultView.display(),this.resultView.addCapture(e)}))}getResultUI(){return this.resultView||(this.resultView=new md,this.resultView.onSourceCodeChanged.add(e=>{this.rebuildProgramFromProgramId(e.programId,e.sourceVertex,e.sourceFragment,t=>{this.referenceNewProgram(e.programId,t),this.resultView.showSourceCodeError(null)},e=>{this.resultView.showSourceCodeError(e)})})),this.resultView}getCaptureUI(){return this.captureMenu||(this.captureMenu=new _t),this.captureMenu}rebuildProgramFromProgramId(e,t,n,r,i){const s=Pe.getFromGlobalStore(e);this.rebuildProgram(s,t,n,r,i)}rebuildProgram(e,t,n,r,i){o.rebuildProgram(e,t,n,r,i)}referenceNewProgram(e,t){Pe.updateInGlobalStore(e,t)}pause(){this.timeSpy.changeSpeedRatio(0)}play(){this.timeSpy.changeSpeedRatio(1)}playNextFrame(){this.timeSpy.playNextFrame()}drawOnlyEveryXFrame(e){this.timeSpy.changeSpeedRatio(e)}getFps(){return this.timeSpy.getFps()}spyCanvases(){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt,this.canvasSpy.onContextRequested.add(this.spyContext,this))}spyCanvas(e){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt(e),this.canvasSpy.onContextRequested.add(this.spyContext,this))}getAvailableContexts(){return this.contexts}setShaderCompileDelay(e){ct.install(),ct.setDelay(e)}clearShaderCompileDelay(){ct.setDelay(0)}getShaderCompileDelay(){return ct.getDelay()}captureCanvas(e,t=0,n=!1,r=!1){const i=this.getAvailableContextSpyByCanvas(e);if(i)this.captureContextSpy(i,t,n,r);else{const i=kd.getFirstAvailable3dContext(e);i?this.captureContext(i,t,n,r):a.error("No webgl context available on the chosen canvas.")}}captureContext(e,t=0,n=!1,r=!1){let i=this.getAvailableContextSpyByCanvas(e.canvas);i||(i=e.getIndexedParameter?new ot({context:e,version:2,recordAlways:!1}):new ot({context:e,version:1,recordAlways:!1}),i.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:i.context.canvas,contextSpy:i})),i&&this.captureContextSpy(i,t,n,r)}captureXRContext(e=0,t=!1,n=!1){this.captureContext(this.getXRContext(),e,t,n)}captureContextSpy(e,t=0,n=!1,r=!1){this.quickCapture=n,this.fullCapture=r,this.capturingContext?this.onErrorInternal("Already capturing a context."):(this.retry=0,this.capturingContext=e,this.capturingContext.setMarker(this.marker),(t=Math.min(t,1e4))>0?this.captureCommands(t):this.captureFrames(1),this.noFrameTimeout=setTimeout(()=>{t>0?this.stopCapture():this.capturingContext&&this.retry>1?this.onErrorInternal("No frames with gl commands detected. Try moving the camera."):this.onErrorInternal("No frames detected. Try moving the camera or implementing requestAnimationFrame.")},1e4))}captureNextFrame(e,t=!1,n=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,0,t,n):this.captureContext(e,0,t,n)}startCapture(e,t,n=!1,r=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,t,n,r):this.captureContext(e,t,n,r)}stopCapture(){if(this.capturingContext){const e=this.capturingContext.stopCapture();if(e.commands.length>0)return this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),this.triggerCapture(e),this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,e;0===this.captureNextCommands&&(this.retry++,this.captureFrames(1))}}setMarker(e){this.marker=e,this.capturingContext&&this.capturingContext.setMarker(e)}clearMarker(){this.marker=null,this.capturingContext&&this.capturingContext.clearMarker()}addRequestAnimationFrameFunctionName(e){this.timeSpy.addRequestAnimationFrameFunctionName(e)}setSpiedScope(e){this.timeSpy.setSpiedScope(e)}log(e){this.capturingContext&&this.capturingContext.log(e)}spyWorkers(e="spector.worker.bundle.js"){ut.startIntercepting(e)}stopSpyingWorkers(){ut.stopIntercepting()}spyWorker(e){let t=this.workerBridges.get(e);return t||(t=new gd(e),t.onCapture.add(e=>{this.triggerCapture(e)},this),t.onError.add(e=>{this.onErrorInternal(e)},this),t.onContextReady.add(t=>{if(this.captureMenu){const n=this.workerBridges.size;this.captureMenu.addCanvasInformation({id:"Worker "+n,width:t.canvasWidth,height:t.canvasHeight,ref:e})}},this),t.onFps.add(e=>{this.captureMenu&&this.captureMenu.setFPS(e)},this),this.workerBridges.set(e,t),t)}captureWorker(e,t=0,n=!1,r=!1){this.workerBridges.has(e)||this.spyWorker(e);const i=this;e.addEventListener("message",function t(n){n.data&&"spector:capture-complete"===n.data.type&&(e.removeEventListener("message",t),i.triggerCapture(n.data.capture))}),e.postMessage({type:"spector:trigger-capture",version:1,canvasIndex:0,commandCount:t,quickCapture:n,fullCapture:r})}captureFrames(e){this.captureNextFrames=e,this.captureNextCommands=0,this.playNextFrame()}captureCommands(e){this.captureNextFrames=0,this.captureNextCommands=e,this.play(),this.capturingContext?(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(e,this.quickCapture,this.fullCapture)):(this.onErrorInternal("No context to capture from."),this.captureNextCommands=0)}spyContext(e){let t=this.getAvailableContextSpyByCanvas(e.context.canvas);t||(t=new ot({context:e.context,version:e.contextVersion,recordAlways:!0}),t.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:t.context.canvas,contextSpy:t})),t.spy()}getAvailableContextSpyByCanvas(e){for(const t of this.contexts)if(t.canvas===e)return t.contextSpy}getXRContext(){return this.options.enableXRCapture||a.error("Cannot retrieve WebXR context if capturing WebXR is disabled."),this.xrSpy.currentXRSession||a.error("No currently active WebXR session."),this.xrSpy.currentXRSession.glContext}onFrameStart(){this.captureNextCommands>0||(this.captureNextFrames>0?(this.capturingContext&&(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(0,this.quickCapture,this.fullCapture)),this.captureNextFrames--):this.capturingContext=void 0)}onFrameEnd(){this.captureNextCommands>0||0===this.captureNextFrames&&this.stopCapture()}triggerCapture(e){this.captureMenu&&this.captureMenu.captureComplete(null),this.onCapture.trigger(e)}onErrorInternal(e){if(a.error(e),this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),!this.capturingContext)throw e;this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,this.retry=0,this.captureMenu&&this.captureMenu.captureComplete(e),this.onError.trigger(e)}}},180(e,t,n){e=n.nmd(e),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/lang"),s=e("../lib/event"),o='.ace_search {background-color: #ddd;color: #666;border: 1px solid #cbcbcb;border-top: 0 none;overflow: hidden;margin: 0;padding: 4px 6px 0 4px;position: absolute;top: 0;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {margin: 0 20px 4px 0;overflow: hidden;line-height: 1.9;}.ace_replace_form {margin-right: 0;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {border-radius: 3px 0 0 3px;background-color: white;color: black;border: 1px solid #cbcbcb;border-right: 0 none;outline: 0;padding: 0;font-size: inherit;margin: 0;line-height: inherit;padding: 0 6px;min-width: 17em;vertical-align: top;min-height: 1.8em;box-sizing: content-box;}.ace_searchbtn {border: 1px solid #cbcbcb;line-height: inherit;display: inline-block;padding: 0 6px;background: #fff;border-right: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;margin: 0;position: relative;color: #666;}.ace_searchbtn:last-child {border-radius: 0 3px 3px 0;border-right: 1px solid #cbcbcb;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn:hover {background-color: #eef1f6;}.ace_searchbtn.prev, .ace_searchbtn.next {padding: 0px 0.7em}.ace_searchbtn.prev:after, .ace_searchbtn.next:after {content: "";border: solid 2px #888;width: 0.5em;height: 0.5em;border-width: 2px 0 0 2px;display:inline-block;transform: rotate(-45deg);}.ace_searchbtn.next:after {border-width: 0 2px 2px 0 ;}.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;font: 16px/16px Arial;padding: 0;height: 14px;width: 14px;top: 9px;right: 7px;position: absolute;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;box-sizing: border-box!important;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;clear: both;}.ace_search_counter {float: left;font-family: arial;padding: 0 8px;}',a=e("../keyboard/hash_handler").HashHandler,l=e("../lib/keys");r.importCssString(o,"ace_searchbox");var u=function(e,t,n){var i=r.createElement("div");r.buildDom(["div",{class:"ace_search right"},["span",{action:"hide",class:"ace_searchbtn_close"}],["div",{class:"ace_search_form"},["input",{class:"ace_search_field",placeholder:"Search for",spellcheck:"false"}],["span",{action:"findPrev",class:"ace_searchbtn prev"},"​"],["span",{action:"findNext",class:"ace_searchbtn next"},"​"],["span",{action:"findAll",class:"ace_searchbtn",title:"Alt-Enter"},"All"]],["div",{class:"ace_replace_form"},["input",{class:"ace_search_field",placeholder:"Replace with",spellcheck:"false"}],["span",{action:"replaceAndFindNext",class:"ace_searchbtn"},"Replace"],["span",{action:"replaceAll",class:"ace_searchbtn"},"All"]],["div",{class:"ace_search_options"},["span",{action:"toggleReplace",class:"ace_button",title:"Toggle Replace mode",style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{class:"ace_search_counter"}],["span",{action:"toggleRegexpMode",class:"ace_button",title:"RegExp Search"},".*"],["span",{action:"toggleCaseSensitive",class:"ace_button",title:"CaseSensitive Search"},"Aa"],["span",{action:"toggleWholeWords",class:"ace_button",title:"Whole Word Search"},"\\b"],["span",{action:"searchInSelection",class:"ace_button",title:"Search In Selection"},"S"]]],i),this.element=i.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),r.importCssString(o,"ace_searchbox",e.container)};(function(){this.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},this.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;s.addListener(e,"mousedown",function(e){setTimeout(function(){t.activeInput.focus()},0),s.stopPropagation(e)}),s.addListener(e,"click",function(e){var n=(e.target||e.srcElement).getAttribute("action");n&&t[n]?t[n]():t.$searchBarKb.commands[n]&&t.$searchBarKb.commands[n].exec(t),s.stopPropagation(e)}),s.addCommandKeyListener(e,function(e,n,r){var i=l.keyCodeToString(r),o=t.$searchBarKb.findKeyCommand(n,i);o&&o.exec&&(o.exec(t),s.stopEvent(e))}),this.$onChange=i.delayedCall(function(){t.find(!1,!1)}),s.addListener(this.searchInput,"input",function(){t.$onChange.schedule(20)}),s.addListener(this.searchInput,"focus",function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()}),s.addListener(this.replaceInput,"focus",function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()})},this.$closeSearchBarKb=new a([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new a,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.editor.getReadOnly()||(e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus())},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),this.setSearchRange=function(e){this.searchRange=e,e?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(e){r.setCssClass(this.replaceOption,"checked",this.searchRange),r.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var t=this.editor.getReadOnly();this.replaceOption.style.display=t?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!t?"":"none",this.find(!1,!1,e)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,n){var i=!this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n,range:this.searchRange})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",i),this.editor._emit("findSearchBox",{match:!i}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,n=0,r=0;if(t){var i=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),s=e.session.doc.positionToIndex(e.selection.anchor);this.searchRange&&(s-=e.session.doc.positionToIndex(this.searchRange.start));for(var o,a=t.lastIndex=0;(o=t.exec(i))&&(n++,(a=o.index)<=s&&r++,!(n>999))&&(o[0]||(t.lastIndex=a+=1,!(a>=i.length))););}this.searchCounter.textContent=r+" of "+(n>999?"999+":n)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(u.prototype),t.SearchBox=u,t.Search=function(e,t){(e.searchBox||new u(e)).show(e.session.getTextRange(),t)}}),ace.require(["ace/ext/searchbox"],function(t){e&&(e.exports=t)})},49(e,t,n){e=n.nmd(e),ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=t.cFunctions="\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b",a=function(){var e=this.$keywords=this.createKeywordMapper({"keyword.control":"break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while|catch|operator|try|throw|using","storage.type":"asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|class|wchar_t|template|char16_t|char32_t","storage.modifier":"const|extern|register|restrict|static|volatile|inline|private|protected|public|friend|explicit|virtual|export|mutable|typename|constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local","keyword.operator":"and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace","variable.language":"this","constant.language":"NULL|true|false|TRUE|FALSE|nullptr"},"identifier"),t=/\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source,n="%"+/(\d+\$)?/.source+/[#0\- +']*/.source+/[,;:_]?/.source+/((-?\d+)|\*(-?\d+\$)?)?/.source+/(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source+/(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source+/(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source;this.$rules={start:[{token:"comment",regex:"//$",next:"start"},{token:"comment",regex:"//",next:"singleLineComment"},i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string",regex:"'(?:"+t+"|.)?'"},{token:"string.start",regex:'"',stateName:"qqstring",next:[{token:"string",regex:/\\\s*$/,next:"qqstring"},{token:"constant.language.escape",regex:t},{token:"constant.language.escape",regex:n},{token:"string.end",regex:'"|$',next:"start"},{defaultToken:"string"}]},{token:"string.start",regex:'R"\\(',stateName:"rawString",next:[{token:"string.end",regex:'\\)"',next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"keyword",regex:"#\\s*(?:include|import|pragma|line|define|undef|version)\\b",next:"directive"},{token:"keyword",regex:"#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b"},{token:"support.function.C99.c",regex:o},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*"},{token:"keyword.operator",regex:/--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],singleLineComment:[{token:"comment",regex:/\\$/,next:"singleLineComment"},{token:"comment",regex:/$/,next:"start"},{defaultToken:"comment"}],directive:[{token:"constant.other.multiline",regex:/\\/},{token:"constant.other.multiline",regex:/.*\\/},{token:"constant.other",regex:"\\s*<.+?>",next:"start"},{token:"constant.other",regex:'\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',next:"start"},{token:"constant.other",regex:"\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",next:"start"},{token:"constant.other",regex:/[^\\\/]+/,next:"start"}]},this.embedRules(i,"doc-",[i.getEndRule("start")]),this.normalizeRules()};r.inherits(a,s),t.c_cppHighlightRules=a}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var i=n[1].length,s=e.findMatchingBracket({row:t,column:i});if(!s||s.row==t)return 0;var o=this.$getIndent(e.getLine(s.row));e.replace(new r(t,0,t,i-1),o)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i,s=e.getLine(n);if(this.startRegionRe.test(s))return this.getCommentRegionBlock(e,s,n);if(i=s.match(this.foldingStartMarker)){var o=i.index;if(i[1])return this.openingBracketBlock(e,i[1],n,o);var a=e.getCommentFoldRange(n,o+i[0].length,1);return a&&!a.isMultiLine()&&(r?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(i=s.match(this.foldingStopMarker))?(o=i.index+i[0].length,i[1]?this.closingBracketBlock(e,i[1],n,o):e.getCommentFoldRange(n,o,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length,a=t+=1,l=e.getLength();++tu)break;var c=this.getFoldWidgetRange(e,"all",t);if(c){if(c.start.row<=s)break;if(c.isMultiLine())t=c.end.row;else if(r==u)break}a=t}}return new i(s,o,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\s*$/),s=e.getLength(),o=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++no)return new i(o,r,n,t.length)}}.call(o.prototype)}),ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./c_cpp_highlight_rules").c_cppHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&"comment"==s[s.length-1].type)return r;if("start"==e)(a=t.match(/^.*[\{\(\[]\s*$/))&&(r+=n);else if("doc-start"==e){if("start"==o)return"";var a;(a=t.match(/^\s*(\/?)\*/))&&(a[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/c_cpp"}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/glsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/c_cpp_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp_highlight_rules").c_cppHighlightRules,s=function(){var e=this.createKeywordMapper({"variable.language":"this",keyword:"layout|attribute|const|uniform|varying|break|continue|do|for|while|if|else|in|out|inout|float|int|void|bool|true|false|lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|samplerCube|struct","constant.language":"radians|degrees|sin|cos|tan|asin|acos|atan|pow|exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|normalize|faceforward|reflect|refract|matrixCompMult|lessThan|lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|texture2DProjLod|textureCube|textureCubeLod|gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|gl_DepthRangeParameters|gl_DepthRange|gl_Position|gl_PointSize|gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData"},"identifier");this.$rules=(new i).$rules,this.$rules.start.forEach(function(t){"function"==typeof t.token&&(t.token=e)})};r.inherits(s,i),t.glslHighlightRules=s}),ace.define("ace/mode/glsl",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/glsl_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp").Mode,s=e("./glsl_highlight_rules").glslHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.$id="ace/mode/glsl"}.call(u.prototype),t.Mode=u}),ace.require(["ace/mode/glsl"],function(t){e&&(e.exports=t)})},429(e,t,n){e=n.nmd(e),ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.require(["ace/theme/monokai"],function(t){e&&(e.exports=t)})}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r](s,s.exports,n),s.loaded=!0,s.exports}return n.amdD=function(){throw new Error("define cannot be used indirect")},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.nc=void 0,n(832),n(49),n(429),n(902),n(180),n(878)})()); \ No newline at end of file diff --git a/dist/spector.d.ts b/dist/spector.d.ts index 076aa7e..b0a836b 100644 --- a/dist/spector.d.ts +++ b/dist/spector.d.ts @@ -807,8 +807,9 @@ export declare class Spector { }): void; log(value: string): void; /** - * Intercept all new Worker() calls to auto-inject Spector. - * Best-effort: will fail for CORS, CSP, or module Workers. + * Explicitly opt in to intercepting new Worker() calls to auto-inject Spector. + * Experimental/best-effort: can change Worker behavior and fails for some + * CORS/CSP policies. Module Workers are not injected. Prefer spyWorker(). * @param workerBundleUrl URL to spector.worker.bundle.js */ spyWorkers(workerBundleUrl?: string): void; diff --git a/documentation/apis.md b/documentation/apis.md index c5dfc6e..bef7783 100644 --- a/documentation/apis.md +++ b/documentation/apis.md @@ -35,11 +35,13 @@ And the following list of events: - ```onError: IEvent```: triggered when an error occured and return the error message. ### Worker / OffscreenCanvas APIs -- ```spyWorkers(workerBundleUrl?: string)``` : Intercept all `new Worker()` calls to auto-inject Spector. Best-effort — may fail with CORS, CSP, or module Workers. Defaults to `"spector.worker.bundle.js"`. +- ```spyWorkers(workerBundleUrl?: string)``` : Explicitly opt in to experimental, best-effort interception of `new Worker()` calls. Attempts to inject Spector into classic Workers; module Workers are not injected. Recognizable dynamic imports and nested Worker constructions are also bypassed, but source checks cannot establish safety. Blob wrapping, URL/base changes, and constructor interception can alter behavior; CSP/CORS restrictions can prevent injection. Defaults to `"spector.worker.bundle.js"`. Prefer `spyWorker()` when you control the Worker source. - ```stopSpyingWorkers()``` : Stop intercepting Worker construction. -- ```spyWorker(worker: Worker): WorkerBridge``` : Manually bridge a specific Worker for capture. This is the primary, reliable API. The Worker must have `spector.worker.bundle.js` loaded via `importScripts`. +- ```spyWorker(worker: Worker): WorkerBridge``` : Manually bridge a specific Worker for capture. This is the recommended API and does not replace the Worker constructor. The Worker must load `spector.worker.bundle.js` via `importScripts` (classic Workers) or `import` (module Workers). - ```captureWorker(worker: Worker, commandCount?: number, quickCapture?: boolean, fullCapture?: boolean)``` : Capture a frame from a Worker's WebGL context. If the Worker hasn't been bridged yet, `spyWorker` is called automatically. +The browser extension's **Auto-inject Workers (experimental)** checkbox is separate from `spyWorkers()` and defaults **off**, even when offscreen canvas capture was previously enabled. It includes OffscreenCanvas Workers and warns that instrumentation may alter behavior. Changes are persisted in page `sessionStorage` (`SPECTOR_WORKERAUTOINJECT`) for the tab/origin session, like the offscreen capture setting, then reload the tab's loaded frames. The MAIN-world content script reads the exact value `"true"` synchronously at `document_start`; there is no asynchronous storage race. Missing/false values leave `window.Worker` untouched, with no wrapper or preflight fetch. Disabling the checkbox restores that behavior on reload. Main-thread canvas capture and manual Worker APIs remain available. + As you notice you could use the capture without displying the UI (this is the orientation we chosed in the browser extension). ## SPECTOR.CaptureMenu diff --git a/extensions/background.js b/extensions/background.js index c2083fe..03cd27b 100644 --- a/extensions/background.js +++ b/extensions/background.js @@ -5,14 +5,24 @@ browser = (function () { chrome; })(); +function consumeLastError() { + // Reading runtime.lastError marks an expected one-way delivery failure as + // handled when the popup, tab, or content script has already closed. + if (browser.runtime && browser.runtime.lastError) { + return; + } +}; + function sendMessage(message) { browser.tabs.query({ active: true, currentWindow: true }, function(tabs) { - browser.tabs.sendMessage(tabs[0].id, message, function(response) { }); + if (tabs.length > 0) { + browser.tabs.sendMessage(tabs[0].id, message, consumeLastError); + } }); }; function sendRuntimeMessage(message) { - browser.runtime.sendMessage(message, function(response) { }); + browser.runtime.sendMessage(message, consumeLastError); }; function listenForMessage(callback) { @@ -26,14 +36,33 @@ var currentCapture = null; var currentFrameId = null; var currentTabId = null; +var clearCaptureSession = function() { + browser.storage.local.remove([ + "currentCapture", + "captureHistory", + "currentFrameInfo" + ], consumeLastError); +}; + +// Captures are useful within one browser session for comparison, but should +// not reappear after the browser is relaunched. +if (browser.runtime.onStartup) { + browser.runtime.onStartup.addListener(clearCaptureSession); +} + var refreshCanvases = function() { - var canvasesToSend = { canvases: [], captureOffScreen: false }; + var canvasesToSend = { canvases: [], captureOffScreen: false, workerAutoInject: false }; browser.tabs.query({ active: true, currentWindow: true }, function(tabs) { for (var tabId in tabInfo) { if (tabId == tabs[0].id) { for (var frameId in tabInfo[tabId]) { var infos = tabInfo[tabId][frameId]; canvasesToSend.captureOffScreen = infos.captureOffScreen; + // Subframes may navigate to origins with different session + // settings. The popup reflects the top-level page's choice. + if (infos.isTopFrame) { + canvasesToSend.workerAutoInject = infos.workerAutoInject; + } for (var i = 0; i < infos.canvases.length; i++) { var info = infos.canvases[i]; canvasesToSend.canvases.push({ @@ -111,7 +140,12 @@ listenForMessage(function(request, sender, sendResponse) { tabInfo[tabId] = { }; } - tabInfo[tabId][frameId] = { canvases: request.canvases, captureOffScreen: request.captureOffScreen }; + tabInfo[tabId][frameId] = { + canvases: request.canvases, + captureOffScreen: request.captureOffScreen, + workerAutoInject: request.workerAutoInject === true, + isTopFrame: sender.frameId === 0 + }; } else if (request.errorString) { // Close the wait message and may display an error. diff --git a/extensions/contentScript.js b/extensions/contentScript.js index c9b94eb..6575113 100644 --- a/extensions/contentScript.js +++ b/extensions/contentScript.js @@ -31,6 +31,7 @@ var spectorCaptureOnLoadTransientKey = "SPECTOR_CAPTUREONLOAD_TRANSIENT"; var spectorCaptureOnLoadQuickCaptureKey = "SPECTOR_CAPTUREONLOAD_QUICKCAPTURE"; var spectorCaptureOnLoadFullCaptureKey = "SPECTOR_CAPTUREONLOAD_FULLCAPTURE"; var captureOffScreenKey = "SPECTOR_CAPTUREOFFSCREEN"; +var workerAutoInjectKey = "SPECTOR_WORKERAUTOINJECT"; var spectorCommunicationElementId = "SPECTOR_COMMUNICATION"; var spectorCommunicationQuickCaptureElementId = "SPECTOR_COMMUNICATION_QUICKCAPTURE"; var spectorCommunicationFullCaptureElementId = "SPECTOR_COMMUNICATION_FULLCAPTURE"; @@ -59,6 +60,9 @@ if (sessionStorage.getItem(spectorCaptureOnLoadKey) === "true") { } captureOffScreen = (sessionStorage.getItem(captureOffScreenKey) === "true"); +// Read synchronously at document_start, before application Workers are created. +// Only an explicit opt-in enables interception; older capture settings do not. +var workerAutoInject = (sessionStorage.getItem(workerAutoInjectKey) === "true"); var spector; window.__SPECTOR_Canvases = []; @@ -75,7 +79,7 @@ window.__SPECTOR_Canvases = []; HTMLCanvasElement.prototype.transferControlToOffscreen = function() { var offscreen = __SPECTOR_Origin_Transfer.call(this); // Tag the source DOM canvas so we can show it later if the Worker - // doesn't report context-ready (e.g. module worker injection failed). + // doesn't report context-ready (e.g. auto-injection is disabled). this.__spector_transferred = true; this.__spector_offscreen = offscreen; return offscreen; @@ -128,7 +132,7 @@ window.__SPECTOR_Canvases = []; } // ---- Worker Interception ---- - if (typeof Worker !== 'undefined') { + if (workerAutoInject && typeof Worker !== 'undefined') { var __SPECTOR_Origin_Worker = Worker; window.__SPECTOR_Workers = []; @@ -159,26 +163,46 @@ window.__SPECTOR_Canvases = []; }); }; - window.Worker = function SpectorWorkerProxy(scriptURL, options) { - var urlStr = scriptURL.toString(); + // Best-effort bypass for recognizable URL-dependent code, not a safety + // check: aliases, imported scripts, and other syntax can evade this. + // Leaving auto-injection OFF is the compatibility guarantee. + var __SPECTOR_shouldInjectWorkerSource = function(source) { + var dynamicImportPattern = /\bimport\s*(?:\/\*[\s\S]*?\*\/\s*)?\(/; + var nestedWorkerPattern = /\bnew\s+(?:(?:self|globalThis)\s*\.\s*)?(?:Worker|SharedWorker)\s*\(/; + return !dynamicImportPattern.test(source) && !nestedWorkerPattern.test(source); + }; + window.Worker = function SpectorWorkerProxy(scriptURL, options) { // Get the Spector worker bundle URL from the hidden element injected - // by contentScriptProxy.js (ISOLATED world → DOM → MAIN world). + // by contentScriptProxy.js (ISOLATED world -> DOM -> MAIN world). var workerBundleEl = document.getElementById('TexturesId_SpectorWorkerBundleUrl'); var bundleUrl = workerBundleEl ? workerBundleEl.value : ''; + if (bundleUrl) { + try { + bundleUrl = new URL(bundleUrl, location.href).href; + } catch (e) { + bundleUrl = ''; + } + } - // Module workers — blob-wrapping breaks ALL relative URL resolution - // inside the Worker (fetch, XHR, texture loaders, etc.), not just - // import specifiers. This is unfixable without a Service Worker - // proxy. Track module workers without injecting; users must add - // the Spector worker bundle import to their source manually. + // Module Worker injection is only attempted after the explicit + // experimental opt-in. The injector preserves static relative + // imports and falls back to native construction for URL-sensitive + // module sources it cannot safely rewrite. if (options && options.type === 'module') { - var w = new __SPECTOR_Origin_Worker(scriptURL, options); - window.__SPECTOR_Workers.push({ worker: w, url: urlStr, injected: false }); + var urlStr = typeof scriptURL === 'string' ? scriptURL : 'module Worker'; + var moduleResult = window.__SPECTOR_ModuleInjector + ? window.__SPECTOR_ModuleInjector.injectModuleWorker( + scriptURL, options, bundleUrl, __SPECTOR_Origin_Worker) + : { worker: new __SPECTOR_Origin_Worker(scriptURL, options), injected: false }; + var w = moduleResult.worker; + window.__SPECTOR_Workers.push({ worker: w, url: urlStr, injected: moduleResult.injected }); __SPECTOR_trackWorker(w, urlStr); return w; } + var urlStr = scriptURL.toString(); + // Skip blob URLs — can't XHR them for injection. The blob code may // already include importScripts for the worker bundle. if (urlStr.indexOf('blob:') === 0) { @@ -202,7 +226,7 @@ window.__SPECTOR_Canvases = []; xhr.open('GET', absoluteScriptUrl, false); xhr.send(); - if (xhr.status === 200) { + if (xhr.status === 200 && __SPECTOR_shouldInjectWorkerSource(xhr.responseText)) { if (bundleUrl) { // Runtime shim: when a worker is loaded from a blob: // URL, `self.location.href` is the blob URL — which @@ -284,7 +308,7 @@ window.__SPECTOR_Canvases = []; } } } catch(e) { - // Fallback silently on CORS/CSP errors + console.warn("[Spector.js] Could not auto-inject into Worker (" + urlStr + "):", e); } var w = new __SPECTOR_Origin_Worker(scriptURL, options); @@ -462,9 +486,9 @@ if (sessionStorage.getItem(spectorLoadedKey)) { } else { // No injected Worker — capture not possible var errorEvent = new CustomEvent("SpectorOnErrorEvent", { - detail: { errorString: "Cannot capture: Spector injection into this module Worker failed. " + - "The Worker may use import maps or non-fetchable URLs. " + - "Try adding: import 'spector.worker.bundle.js' to your Worker manually." } + detail: { errorString: "Cannot capture: this Worker is not instrumented. " + + "Worker auto-injection is off by default and, when enabled, is experimental and may skip or fail on this Worker. " + + "Use the manual spyWorker() API with spector.worker.bundle.js loaded inside the Worker." } }); document.dispatchEvent(errorEvent); } diff --git a/extensions/contentScriptProxy.js b/extensions/contentScriptProxy.js index 925ef6c..2379c9a 100644 --- a/extensions/contentScriptProxy.js +++ b/extensions/contentScriptProxy.js @@ -25,6 +25,9 @@ var uniqueId = new Date().getTime() + Math.abs(Math.random() * 1000000); function sendMessage(message, cb) { message["uniqueId"] = uniqueId; window.browser.runtime.sendMessage(message, function (response) { + if (window.browser.runtime && window.browser.runtime.lastError) { + return; + } if (cb) { cb(response); } @@ -44,6 +47,7 @@ var spectorCaptureOnLoadTransientKey = "SPECTOR_CAPTUREONLOAD_TRANSIENT"; var spectorCaptureOnLoadQuickCaptureKey = "SPECTOR_CAPTUREONLOAD_QUICKCAPTURE"; var spectorCaptureOnLoadFullCaptureKey = "SPECTOR_CAPTUREONLOAD_FULLCAPTURE"; var captureOffScreenKey = "SPECTOR_CAPTUREOFFSCREEN"; +var workerAutoInjectKey = "SPECTOR_WORKERAUTOINJECT"; var spectorCommunicationElementId = "SPECTOR_COMMUNICATION"; var spectorCommunicationQuickCaptureElementId = "SPECTOR_COMMUNICATION_QUICKCAPTURE"; var spectorCommunicationFullCaptureElementId = "SPECTOR_COMMUNICATION_FULLCAPTURE"; @@ -55,6 +59,7 @@ var spectorShaderCompileDelayKey = "SPECTOR_SHADERCOMPILEDELAY"; var spectorContextTypeKey = "__spector_context_type"; var captureOffScreen = (sessionStorage.getItem(captureOffScreenKey) === "true"); +var workerAutoInject = (sessionStorage.getItem(workerAutoInjectKey) === "true"); var frameId = null; @@ -123,7 +128,7 @@ if (sessionStorage.getItem(spectorLoadedKey)) { } // Inform the extension that canvases are present (2 means injection has been done, 1 means ready to inject) - sendMessage({ canvases: uiInformation, captureOffScreen: true }, function (response) { + sendMessage({ canvases: uiInformation, captureOffScreen: true, workerAutoInject: workerAutoInject }, function (response) { frameId = response.frameId; }); }); @@ -173,7 +178,7 @@ var refreshCanvases = function() { } } if (canvasesInformation.length > 0) { - sendMessage({ canvases: canvasesInformation, captureOffScreen: false }, function (response) { + sendMessage({ canvases: canvasesInformation, captureOffScreen: false, workerAutoInject: workerAutoInject }, function (response) { frameId = response.frameId; }); } @@ -224,6 +229,14 @@ listenForMessage(function (message) { return; } + // Like offscreen capture, persist per tab/origin session before reloading + // all frames. MAIN reads this synchronously; no async storage bridge needed. + if (action === "changeWorkerAutoInject") { + sessionStorage.setItem(workerAutoInjectKey, message.workerAutoInject === true ? "true" : "false"); + setTimeout(function () { window.location.reload(); }, 50); + return; + } + // We need to reload to inject the capture loading sequence. if (action === "captureOnLoad") { sessionStorage.setItem(spectorCaptureOnLoadTransientKey, message.transient); diff --git a/extensions/manifest.json b/extensions/manifest.json index 5edfe8c..2b4b719 100644 --- a/extensions/manifest.json +++ b/extensions/manifest.json @@ -39,7 +39,7 @@ "http://*/*", "https://*/*" ], - "js" : ["spector.bundle.func.js", "contentScript.js"], + "js" : ["spector.bundle.func.js", "moduleWorkerInjector.js", "contentScript.js"], "run_at" : "document_start", "all_frames" : true, "world": "MAIN" diff --git a/extensions/moduleWorkerInjector.js b/extensions/moduleWorkerInjector.js index 1cbd048..062a0d1 100644 --- a/extensions/moduleWorkerInjector.js +++ b/extensions/moduleWorkerInjector.js @@ -7,10 +7,9 @@ * The core challenge: module workers forbid `importScripts()`, and blob-wrapped * modules lose their original base URL — breaking all relative `import` paths. * - * Solution: fetch the original script source, rewrite all relative import - * specifiers to absolute URLs (preserving the original script's base URL), - * then create a blob module that first loads the Spector bundle and then - * includes the rewritten application code. + * Solution: inspect the original entry point, inline the Spector bundle in a + * loader module, queue messages while dynamically importing the original + * module at its real URL, then replay those messages after its handlers exist. */ var SpectorModuleInjector = (function () { @@ -96,20 +95,32 @@ var SpectorModuleInjector = (function () { return source; } + /** + * Direct nested Worker construction may resolve relative URLs against the + * loader blob instead of the original module. Leave those entries native. + */ + function canSafelyInject(source) { + var nestedWorkerPattern = /\bnew\s+(?:(?:self|globalThis)\s*\.\s*)?(?:Worker|SharedWorker)\s*\(/; + return !nestedWorkerPattern.test(source); + } + /** * Attempts to inject the Spector worker bundle into a module worker. * * Strategy: * 1. Synchronously fetch the original worker script - * 2. Rewrite all relative import specifiers to absolute URLs - * 3. Create a blob module that: - * a. Dynamically imports the Spector worker bundle (via absolute URL) - * b. Contains the rewritten application code - * 4. Create the Worker from the blob URL with { type: 'module' } + * 2. Reject direct nested Worker construction that depends on blob-relative URLs + * 3. Synchronously fetch the Spector worker bundle + * 4. Create a blob loader module that: + * a. Initializes Spector + * b. Queues startup messages + * c. Imports the original module from its absolute URL + * d. Signals that application handlers are installed + * e. Replays any Worker-side startup messages + * 5. Create the Worker and queue main-thread postMessage calls until ready * - * The Spector bundle is loaded via a dynamic `import()` of its absolute URL. - * This works because `web_accessible_resources` in the extension manifest - * allows the page origin to fetch extension resources. + * The bundle is fetched in the page and inlined because Chromium can leave + * a blob module Worker pending when it imports a chrome-extension URL. * * @param {string} scriptURL - The original worker script URL * @param {object} options - The original Worker options (includes type: 'module') @@ -129,7 +140,7 @@ var SpectorModuleInjector = (function () { return { worker: new OriginalWorker(scriptURL, options), injected: false }; } - // Skip blob URLs — can't fetch them from main thread for rewriting + // Skip blob URLs — their original module URL cannot be recovered. if (urlStr.indexOf('blob:') === 0) { return { worker: new OriginalWorker(scriptURL, options), injected: false }; } @@ -143,6 +154,10 @@ var SpectorModuleInjector = (function () { return { worker: new OriginalWorker(scriptURL, options), injected: false }; } + if (new URL(absoluteScriptUrl).origin !== location.origin) { + return { worker: new OriginalWorker(scriptURL, options), injected: false }; + } + try { // Synchronously fetch the original worker script var xhr = new XMLHttpRequest(); @@ -154,27 +169,98 @@ var SpectorModuleInjector = (function () { } var originalSource = xhr.responseText; + if (!canSafelyInject(originalSource)) { + return { worker: new OriginalWorker(scriptURL, options), injected: false }; + } + + var bundleXhr = new XMLHttpRequest(); + bundleXhr.open('GET', bundleUrl, false); + bundleXhr.send(); + if (bundleXhr.status !== 200) { + return { worker: new OriginalWorker(scriptURL, options), injected: false }; + } - // Rewrite relative imports to absolute URLs - var rewrittenSource = rewriteImports(originalSource, absoluteScriptUrl); + var resolvedScriptUrl = xhr.responseURL || absoluteScriptUrl; - // Build the blob module: - // 1. Dynamically import the Spector worker bundle (fire-and-forget, - // Spector auto-initializes on load) - // 2. Include the rewritten application code - // - // We use `await import(...)` to ensure Spector is initialized before - // the application code runs (so getContext() calls are intercepted). + // Dynamic module import allows the application's relative imports + // and import.meta.url to retain their native URL semantics. Worker + // messages can be dispatched while top-level await is pending, so + // hold and replay them once the application module has evaluated. + var runtimeShim = + '(function(){\n' + + ' var __spectorBase = ' + JSON.stringify(resolvedScriptUrl) + ';\n' + + ' self.__SPECTOR_workerBaseUrl = __spectorBase;\n' + + ' function __spectorResolve(url) {\n' + + ' if (url == null || typeof url !== "string" || /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i.test(url)) return url;\n' + + ' try { return new URL(url, __spectorBase).href; } catch (e) { return url; }\n' + + ' }\n' + + ' self.__SPECTOR_resolveWorkerUrl = __spectorResolve;\n' + + ' var __originalFetch = self.fetch;\n' + + ' if (typeof __originalFetch === "function") {\n' + + ' self.fetch = function(input, init) {\n' + + ' try {\n' + + ' if (typeof input === "string") {\n' + + ' input = __spectorResolve(input);\n' + + ' } else if (input && typeof input === "object" && "url" in input && typeof Request === "function") {\n' + + ' var request = input;\n' + + ' var resolved = __spectorResolve(request.url);\n' + + ' if (resolved !== request.url) input = new Request(resolved, request);\n' + + ' }\n' + + ' } catch (e) { /* use the original input */ }\n' + + ' return __originalFetch.call(self, input, init);\n' + + ' };\n' + + ' }\n' + + ' if (typeof XMLHttpRequest === "function" && XMLHttpRequest.prototype.open) {\n' + + ' var __originalXhrOpen = XMLHttpRequest.prototype.open;\n' + + ' XMLHttpRequest.prototype.open = function(method, url) {\n' + + ' var args = Array.prototype.slice.call(arguments);\n' + + ' args[1] = __spectorResolve(url);\n' + + ' return __originalXhrOpen.apply(this, args);\n' + + ' };\n' + + ' }\n' + + '})();\n'; var blobContent = '/* Spector.js module worker injection */\n' + - 'try { await import("' + bundleUrl + '"); } catch(e) { console.warn("[Spector] Worker bundle load failed:", e); }\n' + - '\n' + - rewrittenSource; + bundleXhr.responseText + '\n' + + runtimeShim + + 'var __spectorQueuedMessages = [];\n' + + 'var __spectorQueueMessage = function(event) { __spectorQueuedMessages.push(event); };\n' + + 'self.addEventListener("message", __spectorQueueMessage);\n' + + 'try {\n' + + ' await import(' + JSON.stringify(resolvedScriptUrl) + ');\n' + + '} finally {\n' + + ' self.removeEventListener("message", __spectorQueueMessage);\n' + + '}\n' + + 'self.postMessage({ type: "spector:module-ready", version: 1 });\n' + + 'for (var __spectorMessageIndex = 0; __spectorMessageIndex < __spectorQueuedMessages.length; __spectorMessageIndex++) {\n' + + ' self.dispatchEvent(__spectorQueuedMessages[__spectorMessageIndex]);\n' + + '}\n'; var blob = new Blob([blobContent], { type: 'application/javascript' }); var blobUrl = URL.createObjectURL(blob); var worker = new OriginalWorker(blobUrl, options); + var originalPostMessage = worker.postMessage; + var queuedPostMessages = []; + var moduleReady = false; + worker.postMessage = function () { + if (moduleReady) { + return originalPostMessage.apply(worker, arguments); + } + queuedPostMessages.push(Array.prototype.slice.call(arguments)); + }; + worker.addEventListener('message', function moduleReadyHandler(event) { + if (!event.data || event.data.type !== 'spector:module-ready') { + return; + } + event.stopImmediatePropagation(); + worker.removeEventListener('message', moduleReadyHandler); + moduleReady = true; + for (var i = 0; i < queuedPostMessages.length; i++) { + originalPostMessage.apply(worker, queuedPostMessages[i]); + } + queuedPostMessages.length = 0; + }); // Revoke after a delay — the browser needs time to fetch the blob setTimeout(function () { URL.revokeObjectURL(blobUrl); }, 5000); @@ -190,6 +276,7 @@ var SpectorModuleInjector = (function () { return { rewriteImports: rewriteImports, resolveSpecifier: resolveSpecifier, + canSafelyInject: canSafelyInject, injectModuleWorker: injectModuleWorker, }; })(); diff --git a/extensions/popup.html b/extensions/popup.html index 4f086db..48585cf 100644 --- a/extensions/popup.html +++ b/extensions/popup.html @@ -35,7 +35,7 @@ .filler { position:absolute; top:120px; - bottom:140px; + bottom:290px; left:0px; right:0px; } @@ -62,7 +62,7 @@ .captureHint { position:absolute; - bottom:146px; + bottom:276px; left:0px; right:0px; text-align:center; @@ -98,6 +98,12 @@ width:25px; } + #workerAutoInjectHint { + display: block; + margin-top: 6px; + line-height: 1.4; + } + #shaderCompileDelay { background-color: #3a3a3a; color: #f9f9f9; @@ -109,7 +115,7 @@ - +

Drag previously saved captures here to open. @@ -120,6 +126,10 @@

+

+ + Includes OffscreenCanvas Workers. Best-effort; may alter Worker behavior. Off by default. Reloads this tab. +

diff --git a/extensions/popup.js b/extensions/popup.js index fdacb17..d5dbf4d 100644 --- a/extensions/popup.js +++ b/extensions/popup.js @@ -6,10 +6,18 @@ window.browser = (function () { browser; })(); +function consumeLastError() { + if (window.browser.runtime && window.browser.runtime.lastError) { + return; + } +}; + function sendMessage(message) { try { window.browser.tabs.query({ active: true, currentWindow: true }, function(tabs) { - window.browser.tabs.sendMessage(tabs[0].id, message, function(response) { }); + if (tabs.length > 0) { + window.browser.tabs.sendMessage(tabs[0].id, message, consumeLastError); + } }); } catch (e) { @@ -24,6 +32,7 @@ function listenForMessage(callback) { var ui = null; var offScreenInput = null; +var workerAutoInjectInput = null; // Display the capture UI. window.addEventListener("DOMContentLoaded", function() { @@ -39,6 +48,7 @@ window.addEventListener("DOMContentLoaded", function() { var quickCaptureInput = document.getElementById("quickCapture"); var fullCaptureInput = document.getElementById("fullCapture"); offScreenInput = document.getElementById("offScreen"); + workerAutoInjectInput = document.getElementById("workerAutoInject"); captureNowElement.addEventListener("click", (e) => { var commandCount = parseInt(captureOnLoadCountInput.value); @@ -72,6 +82,10 @@ window.addEventListener("DOMContentLoaded", function() { this.changeOffScreenStatus(offScreenInput.checked); }; + workerAutoInjectInput.onchange = () => { + this.changeWorkerAutoInjectStatus(workerAutoInjectInput.checked); + }; + var shaderCompileDelayInput = document.getElementById("shaderCompileDelay"); if (shaderCompileDelayInput) { // Restore the last selection so the dropdown reflects the active value. @@ -144,6 +158,13 @@ var changeOffScreenStatus = function(offScreen) { }); } +var changeWorkerAutoInjectStatus = function(workerAutoInject) { + sendMessage({ + action: "changeWorkerAutoInject", + workerAutoInject: workerAutoInject, + }); +} + var changeShaderCompileDelay = function(delayMs) { sendMessage({ action: "setShaderCompileDelay", @@ -196,7 +217,7 @@ var loadFiles = function(event) { 'currentCapture': JSON.parse(e.target['result']), }); - window.browser.runtime.sendMessage({ captureDone: true }, function(response) { }); + window.browser.runtime.sendMessage({ captureDone: true }, consumeLastError); } catch (exception) { @@ -219,12 +240,13 @@ var initUI = function() { } var refreshCanvases = function() { - window.browser.runtime.sendMessage({ refreshCanvases: true }, function(response) { }); + window.browser.runtime.sendMessage({ refreshCanvases: true }, consumeLastError); } var updateCanvasesListInformation = function (canvasesToSend) { ui.updateCanvasesListInformation(canvasesToSend.canvases); offScreenInput.checked = canvasesToSend.captureOffScreen; + workerAutoInjectInput.checked = canvasesToSend.workerAutoInject === true; } var refreshFps = function(fps, frameId, tabId) { diff --git a/extensions/result.js b/extensions/result.js index b37811a..a88e821 100644 --- a/extensions/result.js +++ b/extensions/result.js @@ -6,13 +6,21 @@ window.browser = (function () { browser; })(); +function consumeLastError() { + if (window.browser.runtime && window.browser.runtime.lastError) { + return; + } +}; + function sendMessage(message, tabId) { if (tabId) { - window.browser.tabs.sendMessage(tabId, message, function(response) { }); + window.browser.tabs.sendMessage(tabId, message, consumeLastError); } else { window.browser.tabs.query({ active: true, currentWindow: true }, function(tabs) { - window.browser.tabs.sendMessage(tabs[0].id, message, function(response) { }); + if (tabs.length > 0) { + window.browser.tabs.sendMessage(tabs[0].id, message, consumeLastError); + } }); } }; diff --git a/extensions/spector.bundle.func.js b/extensions/spector.bundle.func.js index d1c246c..a24e908 100644 --- a/extensions/spector.bundle.func.js +++ b/extensions/spector.bundle.func.js @@ -1,5 +1,5 @@ var spectorBundleHook = function(){ /*! For license information please see spector.bundle.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("SPECTOR",[],t):"object"==typeof exports?exports.SPECTOR=t():e.SPECTOR=t()}(self,()=>(()=>{var e={377(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.captureMenuComponent{position:absolute;padding:7px;z-index:99999;top:10px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuComponent.active{visibility:visible;display:block}.captureMenuComponent,.captureMenuComponent:after,.captureMenuComponent:before{box-sizing:content-box}.captureMenuLogComponent{position:absolute;padding:7px;z-index:80000;top:66px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuLogComponent.active{visibility:visible;display:block}.captureMenuLogComponent,.captureMenuLogComponent:after,.captureMenuLogComponent:before{box-sizing:content-box}.captureMenuLogComponent span.error{color:red}.canvasListComponent{float:left;width:50%;height:100%}.canvasListComponent [commandName=onCanvasSelection]{vertical-align:center;line-height:40px;white-space:nowrap;text-overflow:ellipsis;width:190px;display:inline-block;overflow:hidden;margin:0px 5px}.canvasListComponent [commandName=onCanvasSelection]:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.canvasListComponent ul{margin:0px;padding:7px;list-style:none;position:absolute;top:54px;left:-2px;width:400px;border:2px solid #222;background-color:#2c2c2c}.canvasListComponent ul li{margin:5px}.canvasListComponent ul li:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.captureMenuActionsComponent{float:left;width:30%;height:100%;margin-top:7.5px}.captureMenuActionsComponent div{float:left}.captureMenuActionsComponent [commandName=onCaptureRequested]{border-radius:50%;background:#2c2c2c;border:2px solid red;width:21px;height:21px}.captureMenuActionsComponent [commandName=onCaptureRequested]:hover{background:red;cursor:pointer;transition:background .3s;-webkit-transition:background .3s;-moz-transition:background .3s}.captureMenuActionsComponent [commandName=onPlayRequested],.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPlayRequested]:before,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{content:"";position:absolute;display:inline-block;margin-top:6px;margin-left:4px;width:7px;height:7px;border-top:2px solid #f9f9f9;border-right:2px solid #f9f9f9;background-color:#f9f9f9;-moz-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg);z-index:-20}.captureMenuActionsComponent [commandName=onPlayRequested]:after,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:after{content:"";position:absolute;display:inline-block;width:8px;height:20px;background-color:#2c2c2c;z-index:-10}.captureMenuActionsComponent [commandName=onPlayRequested]:hover,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPauseRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPauseRequested]:before{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:12px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:after{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:7px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{background-color:#2c2c2c}.fpsCounterComponent{float:left;width:20%;vertical-align:center;line-height:40px;white-space:nowrap}',""]);const a=o},160(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.resultViewComponent{position:absolute;z-index:99999;border:1px solid #000;top:0;left:0;bottom:0;right:0;background-color:#222;opacity:1;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.resultViewComponent.active{visibility:visible;display:block}.resultViewComponent,.resultViewComponent:after,.resultViewComponent:before{box-sizing:content-box}.resultViewMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.resultViewMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.resultViewMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.resultViewMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.resultViewMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.resultViewMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.resultViewMenuComponent a.clearSearch{padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.resultViewMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}@media all and (max-width: 1024px){.resultViewMenuComponent .resultViewMenuOpen{display:block;visibility:visible}.resultViewMenuComponent li:not(.resultViewMenuSmall){display:none;visibility:hidden}.resultViewMenuComponent li{background:#2c2c2c}.resultViewMenuComponent li.searchContainer{background:rgb(69.5,69.5,69.5)}.resultViewMenuComponent{padding:0px;position:absolute;overflow-y:visible;top:0px;left:0px;right:0px;bottom:0px;z-index:999999;display:block}.resultViewMenuComponent a.active{background:#2c2c2c}}.resultViewMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:40px;position:relative;top:-1px;box-sizing:border-box}.resultViewMenuComponent input:focus{border:0;outline:0 none}.resultViewMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.resultViewMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.resultViewMenuComponent ::-webkit-input-placeholder{color:#ccc}.resultViewMenuComponent :-moz-placeholder{color:#ccc}.resultViewMenuComponent ::-moz-placeholder{color:#ccc}.resultViewMenuComponent :-ms-input-placeholder{color:#ccc}.resultViewContentComponent{position:absolute;top:40px;left:0;bottom:0;right:0}.informationColumnLeftComponent{position:absolute;top:0;left:0;bottom:0;right:50%;overflow:auto;overflow-x:hidden;overflow-y:visible}.informationColumnRightComponent{position:absolute;top:0;left:50%;bottom:0;right:0;overflow:auto;overflow-x:hidden;overflow-y:visible}.captureListComponent{position:absolute;top:40px;left:0;bottom:0;right:0;background:#222;z-index:9000;display:none;visibility:hidden;overflow-y:visible;overflow-x:hidden}.captureListComponent.active{display:block;visibility:visible}.captureListComponent .openCaptureFile{border:1px dashed #f9f9f9;display:block;margin:5px;padding:5px;text-align:center;font-style:italic}.captureListComponent .openCaptureFile span{line-height:100%;vertical-align:middle}.captureListComponent ul{margin:0px;padding:0px;list-style:none;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-start}.captureListComponent ul li{margin:5px;border:1px solid #606060}.captureListComponent ul li img{width:295px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;display:block}.captureListComponent ul li span{display:block;text-align:center;border:5px solid #222}.captureListComponent ul li span .captureListItemSave{color:#f9f9f9;font-size:16px;margin-left:10px;position:relative;padding:3px 8px 3px 32px}.captureListComponent ul li span .captureListItemSave:before,.captureListComponent ul li span .captureListItemSave:after{box-sizing:border-box;content:"";position:absolute}.captureListComponent ul li span .captureListItemSave:before{background:#d9d9d9;border-color:#f9f9f9;border-style:solid;border-width:7px 2px 1px;border-radius:1px;height:16px;left:8px;top:5px;width:16px}.captureListComponent ul li span .captureListItemSave:after{background:#f9f9f9;border-color:#d9d9d9;border-style:solid;border-width:1px 1px 1px 4px;height:5px;left:13px;top:5px;width:7px}.captureListComponent ul li:hover{cursor:pointer}.captureListComponent ul li.active span{background:#f0640d;border:5px solid #f0640d}.captureListComponent ul li.active span .captureListItemSave:before{background:#f0640d}.captureListComponent ul li.active span .captureListItemSave:after{border-color:#f0640d}.visualStateListComponent{position:absolute;top:0;left:0;bottom:0;padding:5px;right:80%;overflow-y:visible;overflow-x:hidden}.visualStateListComponent ul{margin:0px;padding:0px;list-style:none}.visualStateListComponent ul li{margin:20px 15px 0px 15px;border:1px solid #606060}.visualStateListComponent ul li img{display:block;padding:0px;box-sizing:border-box;max-height:600px;width:100%;margin:0 auto;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.visualStateListComponent ul li:hover{cursor:pointer}.visualStateListComponent ul li span{border:5px solid #222;background:#222;box-sizing:border-box;display:inline-block;width:100%;margin:0px;padding:5px;word-wrap:break-word}.visualStateListComponent ul li.active{border:2px solid #f0640d}.commandListComponent{position:absolute;top:0;left:20%;right:40%;bottom:0;color:hsl(0,0%,82.6470588235%)}.commandListComponent ul{margin:0px;padding:0px;list-style:none;overflow-y:visible;overflow-x:hidden;height:100%}.commandListComponent ul li{padding:8px}.commandListComponent ul li span{word-wrap:break-word;line-height:22px}.commandListComponent ul li:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.commandListComponent ul li:nth-child(even){background:#2c2c2c}.commandListComponent ul li:nth-child(odd){background:#222}.commandListComponent ul li .important{font-weight:800}.commandListComponent ul li .important.deprecated{color:red}.commandListComponent ul li .important.unused{color:#ff0}.commandListComponent ul li .important.disabled{color:gray}.commandListComponent ul li .important.redundant{color:orange}.commandListComponent ul li .important.valid{color:#adff2f}.commandListComponent ul li .marker{font-size:16px;font-weight:900;color:#adff2f}.commandListComponent ul li.active{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.commandListComponent ul li.drawCall{background:#5db0d7;color:#222}.commandListComponent ul li a{margin-left:5px;margin-right:5px;color:#5db0d7;background:#222;padding:5px;font-weight:900;display:inline-block}.commandDetailComponent{position:absolute;top:0;left:60%;right:0;bottom:0;overflow-y:visible;overflow-x:hidden}.jsonGroupComponent{display:block;margin:10px;padding:10px;padding-bottom:5px}.jsonGroupComponent .jsonGroupComponentTitle{display:block;font-size:16px;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:5px;margin-bottom:5px;text-transform:capitalize}.jsonGroupComponent ul{margin:0px;padding:0px;list-style:none}.jsonGroupComponent ul li:nth-child(even){background:#222}.jsonGroupComponent ul li:nth-child(odd){background:#222}.jsonItemComponentKey{color:#f0640d}.jsonItemComponentValue{white-space:pre-wrap}.jsonItemImageHolder{width:50%;margin:auto}.jsonItemImageHolder .jsonItemImage{margin:5px;display:block;border:1px solid #606060;width:100%}.jsonItemImageHolder .jsonItemImage img{width:100%;display:block;margin:auto;max-width:256px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.jsonItemImageHolder .jsonItemImage span{margin:0px;padding:5px;word-wrap:break-word;display:inline-block;width:100%;box-sizing:border-box}[commandName=onOpenSourceClicked]:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.jsonVisualStateItemComponent{text-align:center;padding:10px}.jsonVisualStateItemComponent img{background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;border:1px solid #606060;margin:5px;width:100%;max-width:512px;max-height:800px}.jsonVisualStateItemComponent span{display:block}.jsonContentComponent{position:absolute;top:0;left:0;right:0;bottom:0;padding:10px;overflow-y:visible;overflow-x:hidden}.jsonItemComponentValue{word-break:break-all;white-space:normal}.jsonSourceItemComponentOpen{font-weight:bold;color:#5db0d7;text-decoration:underline}.sourceCodeMenuComponentContainer{position:absolute;left:0;top:0;bottom:48px;right:40%}.sourceCodeMenuComponentFooter{position:absolute;left:0;right:40%;bottom:0;padding:0 15px}.sourceCodeFormatError{color:#f0640d;margin-left:15px}.sourceCodeDiagnosticsNotice{color:#5db0d7;margin-left:15px}.sourceCodeDiagnosticsNotice a{color:#c9c9c9;text-decoration:underline}.sourceCodeMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.sourceCodeMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.sourceCodeMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.sourceCodeMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.sourceCodeMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.sourceCodeMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.sourceCodeMenuComponent a.clearSearch{display:inline-block;padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.sourceCodeMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}.sourceCodeMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:100%;position:relative;top:-1px;box-sizing:border-box}.sourceCodeMenuComponent input:focus{border:0;outline:0 none}.sourceCodeMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.sourceCodeMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.sourceCodeMenuComponent ::-webkit-input-placeholder{color:#ccc}.sourceCodeMenuComponent :-moz-placeholder{color:#ccc}.sourceCodeMenuComponent ::-moz-placeholder{color:#ccc}.sourceCodeMenuComponent :-ms-input-placeholder{color:#ccc}.sourceCodeComponent{position:absolute;top:42px;left:0;bottom:48px;right:40%;background:#222;z-index:9000;overflow-x:visible;overflow:auto}.sourceCodeComponent .sourceCodeComponentTitle{font-size:16px;font-weight:800;line-height:50px;color:#f0640d;padding:1em;margin:.5em 0}.compareViewComponent{position:absolute;top:50px;left:0px;right:0px;bottom:0px;overflow:hidden;display:flex;flex-direction:column;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:13px}.compareViewComponent .compareViewEmpty,.compareViewComponent .compareViewEmptyRow,.compareViewComponent .compareDetailEmpty{padding:1em;color:#c9c9c9;text-align:center}.compareViewComponent .compareViewHeader{flex:0 0 auto;display:flex;align-items:center;gap:16px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid rgb(8.5,8.5,8.5);white-space:nowrap}.compareViewComponent .compareViewHeader .compareViewLabel{color:#5db0d7}.compareViewComponent .compareViewHeader .compareViewSummary span{margin-right:8px;font-weight:700}.compareViewComponent .compareViewHeader .compareViewSummary span.added{color:#adff2f}.compareViewComponent .compareViewHeader .compareViewSummary span.removed{color:#ff5a5a}.compareViewComponent .compareViewHeader .compareViewSummary span.changed{color:#f0640d}.compareViewComponent .compareViewHeader .compareViewSummary span.unchanged{color:#c9c9c9}.compareViewComponent .compareViewHeader .compareViewToggle{margin-left:auto;cursor:pointer;user-select:none}.compareViewComponent .compareViewHeader .compareViewToggle input{vertical-align:middle;margin-right:4px}.compareViewComponent .compareViewBody{flex:1 1 auto;display:flex;min-height:0}.compareViewComponent .compareViewLegend{flex:0 0 130px;box-sizing:border-box;padding:10px;background:#2c2c2c;border-right:2px solid #222}.compareViewComponent .compareViewLegend .compareLegendRow{display:flex;align-items:center;gap:8px;margin:8px 0}.compareViewComponent .compareViewLegend .compareLegendRow.unchanged{opacity:.5}.compareViewComponent .compareViewLegend .compareLegendChip{width:12px;height:12px;border-radius:2px;background:#c9c9c9}.compareViewComponent .compareViewLegend .added .compareLegendChip{background:#adff2f}.compareViewComponent .compareViewLegend .removed .compareLegendChip{background:#ff5a5a}.compareViewComponent .compareViewLegend .changed .compareLegendChip{background:#f0640d}.compareViewComponent .compareViewList{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;margin:0;padding:0;list-style:none}.compareViewComponent .compareViewList .compareRow{display:flex;align-items:baseline;padding:3px 10px;line-height:20px;cursor:pointer;white-space:nowrap}.compareViewComponent .compareViewList .compareRow:nth-child(odd){background:#222}.compareViewComponent .compareViewList .compareRow:nth-child(even){background:#2c2c2c}.compareViewComponent .compareViewList .compareRow .compareSign{flex:0 0 14px;font-weight:800}.compareViewComponent .compareViewList .compareRow .compareRowText{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.compareViewComponent .compareViewList .compareRow .compareCmdName{font-weight:700}.compareViewComponent .compareViewList .compareRow.added .compareSign,.compareViewComponent .compareViewList .compareRow.added .compareCmdName{color:#adff2f}.compareViewComponent .compareViewList .compareRow.removed .compareSign,.compareViewComponent .compareViewList .compareRow.removed .compareCmdName{color:#ff5a5a}.compareViewComponent .compareViewList .compareRow.changed .compareSign,.compareViewComponent .compareViewList .compareRow.changed .compareCmdName{color:#f0640d}.compareViewComponent .compareViewList .compareRow.unchanged{opacity:.55}.compareViewComponent .compareViewList .compareRow.selected{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.compareViewComponent .compareViewList .compareRow.selected .compareSign,.compareViewComponent .compareViewList .compareRow.selected .compareCmdName{color:#222}.compareViewComponent .compareViewList .compareViewEmptyRow{cursor:default}.compareViewComponent .compareViewDetail{flex:0 0 42%;box-sizing:border-box;overflow-y:auto;border-left:2px solid #222;padding:4px 12px 12px}.compareViewComponent .compareViewDetail .compareDetailGroup{margin:12px 0}.compareViewComponent .compareViewDetail .compareDetailGroup ul{margin:0;padding:0;list-style:none}.compareViewComponent .compareViewDetail .compareDetailGroup li{padding:2px 0;white-space:pre-wrap;word-break:break-word}.compareViewComponent .compareViewDetail .compareDetailTitle{display:block;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin-bottom:6px;text-transform:capitalize}.compareViewComponent .compareViewDetail .compareDetailKey{color:#f0640d}.compareViewComponent .compareViewDetail .compareCmdName{font-weight:700}.compareViewComponent .compareViewDetail .compareCmdName.added{color:#adff2f}.compareViewComponent .compareViewDetail .compareCmdName.removed{color:#ff5a5a}.compareViewComponent .compareViewDetail .compareCmdName.changed{color:#f0640d}.compareViewComponent .compareViewDetail .compareArrow{color:#c9c9c9}.compareViewComponent .compareViewDetail .compareOld{opacity:.7;text-decoration:line-through}.compareViewComponent .compareViewDetail .compareNew{color:#f9f9f9}.compareViewComponent .compareViewDetail .compareCommandLink{color:#5db0d7;text-decoration:none;cursor:pointer;border-bottom:1px dotted currentColor}.compareViewComponent .compareViewDetail .compareCommandLink:hover{color:#f0640d}.compareViewComponent .compareViewDetail .compareTextureItem{padding-bottom:6px}.compareViewComponent .compareViewDetail .compareImageDiff{display:flex;align-items:center;margin-top:4px}.compareViewComponent .compareViewDetail .compareThumb{width:48px;height:48px;object-fit:contain;margin:2px 6px 2px 0;border:1px solid rgb(8.5,8.5,8.5);background:#222;image-rendering:pixelated}.jsonItemImageClickable{cursor:zoom-in}.textureViewerOverlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:100000;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.6);font-family:Consolas,monaco,monospace;font-size:13px;color:#f9f9f9}.textureViewerOverlay .textureViewerModal{width:min(900px,92vw);height:min(640px,90vh);display:flex;flex-direction:column;overflow:hidden;background:#222;border:1px solid #000;box-shadow:0 10px 40px rgba(0,0,0,.6)}.textureViewerOverlay .textureViewerHeader{flex:0 0 auto;display:flex;align-items:center;gap:12px;height:40px;padding:0 12px;background:#2c2c2c;border-bottom:2px solid #222}.textureViewerOverlay .textureViewerHeader .textureViewerTitle{color:#5db0d7}.textureViewerOverlay .textureViewerHeader .textureViewerMeta{color:#c9c9c9;font-size:12px}.textureViewerOverlay .textureViewerHeader .textureViewerClose{margin-left:auto;width:26px;height:26px;display:flex;align-items:center;justify-content:center;border-radius:3px;color:#c9c9c9;cursor:pointer}.textureViewerOverlay .textureViewerHeader .textureViewerClose:hover{color:#f9f9f9;background:hsla(0,0%,100%,.08)}.textureViewerOverlay .textureViewerToolbar{flex:0 0 auto;display:flex;align-items:center;flex-wrap:wrap;gap:14px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid #000;font-size:12px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup{display:flex;align-items:center;gap:6px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup .lbl{color:#c9c9c9;margin-right:2px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroupEnd{margin-left:auto}.textureViewerOverlay .textureViewerToolbar .channel{width:26px;height:24px;display:flex;align-items:center;justify-content:center;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#777;font-weight:800;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .channel.on.r{background:#e14b4b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.g{background:#4bd44b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.b{background:#4b8fe1;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.a{background:#dedede;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .tvBtn{height:24px;padding:0 10px;display:inline-flex;align-items:center;gap:6px;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#f9f9f9;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .tvBtn:hover{background:#333}.textureViewerOverlay .textureViewerToolbar .tvBtn.active{background:#f0640d;color:#1a1a1a;border-color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary{border-color:#f0640d;color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary:hover{background:#f0640d;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .seg{display:flex}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn{border-radius:0;border-right-width:0}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:first-child{border-radius:3px 0 0 3px}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:last-child{border-radius:0 3px 3px 0;border-right-width:1px}.textureViewerOverlay .textureViewerToolbar .zoomVal{min-width:44px;text-align:center;color:#c9c9c9}.textureViewerOverlay .textureViewerBody{flex:1 1 auto;display:flex;min-height:0}.textureViewerOverlay .textureViewerViewport{flex:1 1 auto;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#141414}.textureViewerOverlay .textureViewerViewport.checker{background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}.textureViewerOverlay .textureViewerCanvas{image-rendering:pixelated;cursor:crosshair;box-shadow:0 0 0 1px #000}.textureViewerOverlay .textureViewerLoupe{position:absolute;display:none;width:120px;height:120px;pointer-events:none;image-rendering:pixelated;border:1px solid #000;box-shadow:0 2px 8px rgba(0,0,0,.6);background:#000;left:16px;top:16px}.textureViewerOverlay .textureViewerRail{flex:0 0 210px;box-sizing:border-box;padding:12px;overflow-y:auto;background:#2c2c2c;border-left:2px solid #222}.textureViewerOverlay .textureViewerRail .railTitle{color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin:0 0 8px;text-transform:capitalize}.textureViewerOverlay .textureViewerRail .kv{display:flex;justify-content:space-between;margin:4px 0}.textureViewerOverlay .textureViewerRail .kv .k{color:#f0640d}.textureViewerOverlay .textureViewerRail .kv .v{color:#f9f9f9}.textureViewerOverlay .textureViewerRail .swatch{width:100%;height:34px;margin:8px 0;border:1px solid #000;background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0}.textureViewerOverlay .textureViewerRail .swatch .swatchInner{width:100%;height:100%}.textureViewerOverlay .textureViewerRail .hint{color:#c9c9c9;margin-top:10px;line-height:1.5}',""]);const a=o},636(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,".ace-monokai {\n color: #f9f9f9;\n font-size: 14px;\n}\n\n.ace-monokai .ace_entity.ace_name.ace_tag,\n.ace-monokai .ace_keyword,\n.ace-monokai .ace_meta.ace_tag,\n.ace-monokai .ace_storage {\n color: #F0640D\n}\n\n.ace-monokai .ace_constant.ace_character,\n.ace-monokai .ace_constant.ace_other {\n color: #5db0d7;\n}\n\n.ace-monokai .ace_marker-layer .ace_selection {\n background: #a6e22e\n}\n\n.ace-monokai .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #a6e22e;\n}\n\n.ace-monokai .ace_marker-layer .ace_active-line {\n background: #2c2c2c\n}\n.ace-monokai .ace_gutter-active-line {\n background-color: #2c2c2c\n}\n.ace-monokai .ace_marker-layer .ace_selected-word {\n border: 1px solid #a6e22e\n}\n\n.ace-monokai .ace_constant.ace_language {\n color: #e6db74\n}\n.ace-monokai .ace_constant.ace_numeric {\n color: #ae81ff\n}\n\n.ace-monokai .ace_gutter {\n background: #222;\n color: #8F908A;\n}",""]);const a=o},314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var a=0;a0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},601(e){"use strict";e.exports=function(e){return e[1]}},832(e,t,n){e=n.nmd(e),function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,n,r){"string"==typeof e?(2==arguments.length&&(r=n),t.modules[e]||(t.payloads[e]=r,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var n,r,i=function(e,t,n){if("string"==typeof t){var r=a(e,t);if(null!=r)return n&&n(),r}else if("[object Array]"===Object.prototype.toString.call(t)){for(var i=[],o=0,l=t.length;o1&&function(e,t,n){if(Array.prototype.indexOf)return e.indexOf("",n);for(var r=0;r-1&&(n=RegExp(this.source,i.replace.call(((r=this).global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),"g","")),i.replace.call(e.slice(a.index),n,function(){for(var e=1;ea.index&&this.lastIndex--}return a},o||(RegExp.prototype.test=function(e){var t=i.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError("Function.prototype.bind called on incompatible "+t);var n=d.call(arguments,1),i=function(){if(this instanceof i){var r=t.apply(this,n.concat(d.call(arguments)));return Object(r)===r?r:this}return t.apply(e,n.concat(d.call(arguments)))};return t.prototype&&(r.prototype=t.prototype,i.prototype=new r,r.prototype=null),i});var i,s,o,a,l,u=Function.prototype.call,c=Array.prototype,h=Object.prototype,d=c.slice,f=u.bind(h.toString),p=u.bind(h.hasOwnProperty);if((l=p(h,"__defineGetter__"))&&(i=u.bind(h.__defineGetter__),s=u.bind(h.__defineSetter__),o=u.bind(h.__lookupGetter__),a=u.bind(h.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,n=[];if(n.splice.apply(n,e(20)),n.splice.apply(n,e(26)),t=n.length,n.splice(5,0,"XXX"),n.length,t+1==n.length)return!0}()){var m=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?m.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(d.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):null==e?e=0:e<0&&(e=Math.max(n+e,0)),e+ta)for(h=u;h--;)this[l+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else for(this.length=c+s,h=0;h>>0;if("[object Function]"!=f(e))throw new TypeError;for(;++i>>0,i=Array(r),s=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var o=0;o>>0,s=[],o=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var a=0;a>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,s=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s++];break}if(++s>=r)throw new TypeError("reduce of empty array with no initial value")}for(;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,s=r-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s--];break}if(--s<0)throw new TypeError("reduceRight of empty array with no initial value")}do{s in this&&(i=e.call(void 0,i,n[s],s,t))}while(s--);return i}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=C&&"[object String]"==f(this)?this.split(""):L(this),n=t.length>>>0;if(!n)return-1;var r=0;for(arguments.length>1&&(r=N(arguments[1])),r=r>=0?r:Math.max(0,n+r);r>>0;if(!n)return-1;var r=n-1;for(arguments.length>1&&(r=Math.min(r,N(arguments[1]))),r=r>=0?r:n-Math.abs(r);r>=0;r--)if(r in t&&e===t[r])return r;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:h)}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(p(e,t)){var n;if(n={enumerable:!0,configurable:!0},l){var r=e.__proto__;e.__proto__=h;var i=o(e,t),s=a(e,t);if(e.__proto__=r,i||s)return i&&(n.get=i),s&&(n.set=s),n}return n.value=e[t],n}}),Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),Object.create||(g=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var n;if(null===e)n=g();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var r=function(){};r.prototype=e,(n=new r).__proto__=e}return void 0!==t&&Object.defineProperties(n,t),n}),Object.defineProperty){var S=D({}),A="undefined"==typeof document||D(document.createElement("div"));if(!S||!A)var _=Object.defineProperty}Object.defineProperty&&!_||(Object.defineProperty=function(e,t,n){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof n&&"function"!=typeof n||null===n)throw new TypeError("Property description must be an object: "+n);if(_)try{return _.call(Object,e,t,n)}catch(e){}if(p(n,"value"))if(l&&(o(e,t)||a(e,t))){var r=e.__proto__;e.__proto__=h,delete e[t],e[t]=n.value,e.__proto__=r}else e[t]=n.value;else{if(!l)throw new TypeError("getters & setters can not be defined on this javascript engine");p(n,"get")&&i(e,t,n.get),p(n,"set")&&s(e,t,n.set)}return e}),Object.defineProperties||(Object.defineProperties=function(e,t){for(var n in t)p(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=(E=Object.freeze,function(e){return"function"==typeof e?e:E(e)})}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";p(e,t);)t+="?";e[t]=!0;var n=p(e,t);return delete e[t],n}),!Object.keys){var y=!0,b=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],T=b.length;for(var R in{toString:null})y=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)p(e,n)&&t.push(n);if(y)for(var r=0,i=T;r0||-1)*Math.floor(Math.abs(e))),e}var L=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,n){"use strict";e("./regexp"),e("./es5-shim"),"undefined"==typeof Element||Element.prototype.remove||Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,n){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var r="object"==typeof navigator?navigator:{},i=(/mac|win|linux/i.exec(r.platform)||["other"])[0].toLowerCase(),s=r.userAgent||"",o=r.appName||"";t.isWin="win"==i,t.isMac="mac"==i,t.isLinux="linux"==i,t.isIE="Microsoft Internet Explorer"==o||o.indexOf("MSAppHost")>=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,t.isAIR=s.indexOf("AdobeAIR")>=0,t.isAndroid=s.indexOf("Android")>=0,t.isChromeOS=s.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./useragent");if(t.buildDom=function e(t,n,r){if("string"==typeof t&&t){var i=document.createTextNode(t);return n&&n.appendChild(i),i}if(!Array.isArray(t))return t;if("string"!=typeof t[0]||!t[0]){for(var s=[],o=0;o=1.5,"undefined"!=typeof document){var i=document.createElement("div");t.HI_DPI&&void 0!==i.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),r.isEdge||void 0===i.style.animationName||(t.HAS_CSS_ANIMATION=!0),i=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./oop"),i=function(){var e,t,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in n.FUNCTION_KEYS)e=n.FUNCTION_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);for(t in n.PRINTABLE_KEYS)e=n.PRINTABLE_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);return r.mixin(n,n.MODIFIER_KEYS),r.mixin(n,n.PRINTABLE_KEYS),r.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)n.KEY_MODS[t]=e.filter(function(e){return t&n.KEY_MODS[e]}).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();r.mixin(t,i),t.keyCodeToString=function(e){var t=i[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./keys"),i=e("./useragent"),s=null,o=0;t.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var r=function(){n.call(e,window.event)};n._wrapper=r,e.attachEvent("on"+t,r)}},t.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,n,r){function i(e){n&&n(e),r&&r(e),t.removeListener(document,"mousemove",n,!0),t.removeListener(document,"mouseup",i,!0),t.removeListener(document,"dragstart",i,!0)}return t.addListener(document,"mousemove",n,!0),t.addListener(document,"mouseup",i,!0),t.addListener(document,"dragstart",i,!0),i},t.addMouseWheelListener=function(e,n){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),n(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}n(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),n(e)})},t.addMultiMouseDownListener=function(e,n,r,s){var o,a,l,u=0,c={2:"dblclick",3:"tripleclick",4:"quadclick"};function h(e){if(0!==t.getButton(e)?u=0:e.detail>1?++u>4&&(u=1):u=1,i.isIE){var h=Math.abs(e.clientX-o)>5||Math.abs(e.clientY-a)>5;l&&!h||(u=1),l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),1==u&&(o=e.clientX,a=e.clientY)}if(e._clicks=u,r[s]("mousedown",e),u>4)u=0;else if(u>1)return r[s](c[u],e)}function d(e){u=2,l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),r[s]("mousedown",e),r[s](c[u],e)}Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",h),i.isOldIE&&t.addListener(e,"dblclick",d)})};var a=i.isMac&&i.isOpera&&!("KeyboardEvent"in window)?function(e){return(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)}:function(e){return(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};function l(e,t,n){var l=a(t);if(!i.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(l|=8),s.altGr){if(!(3&~l))return;s.altGr=0}if(18===n||17===n){var u="location"in t?t.location:t.keyLocation;17===n&&1===u?1==s[n]&&(o=t.timeStamp):18===n&&3===l&&2===u&&t.timeStamp-o<50&&(s.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),l||13!==n||3!==(u="location"in t?t.location:t.keyLocation)||(e(t,l,-n),!t.defaultPrevented)){if(i.isChromeOS&&8&l){if(e(t,l,n),t.defaultPrevented)return;l&=-9}return!!(l||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&e(t,l,n)}}function u(){s=Object.create(null)}if(t.getModifierString=function(e){return r.KEY_MODS[a(e)]},t.addCommandKeyListener=function(e,n){var r=t.addListener;if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var o=null;r(e,"keydown",function(e){o=e.keyCode}),r(e,"keypress",function(e){return l(n,e,o)})}else{var a=null;r(e,"keydown",function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=l(n,e,e.keyCode);return a=e.defaultPrevented,t}),r(e,"keypress",function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),r(e,"keyup",function(e){s[e.keyCode]=null}),s||(u(),r(window,"focus",u))}},"object"==typeof window&&window.postMessage&&!i.isOldIE){var c=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+c++,i=function(s){s.data==r&&(t.stopPropagation(s),t.removeListener(n,"message",i),e())};t.addListener(n,"message",i),n.postMessage(r,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function n(){t.$idleBlocked?setTimeout(n,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,n=e.end,r=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(r.row,r.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(r.row,r.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else this.end.rowt)var i={row:t+1,column:0};else this.start.row0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;nDate.now()-50)||(r=!1)},cancel:function(){r=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("../lib/dom"),o=e("../lib/lang"),a=e("../clipboard"),l=i.isChrome<18,u=i.isIE,c=i.isChrome>63,h=400,d=e("../lib/keys"),f=d.KEY_MODS,p=i.isIOS,m=p?/\s/:/\n/;t.TextInput=function(e,t){var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild);var g=!1,E=!1,v=!1,C=!1,D="";i.isMobile||(n.style.fontSize="1px");var S=!1,A=!1,_="",y=0,b=0,T=0;try{var R=document.activeElement===n}catch(e){}r.addListener(n,"blur",function(e){A||(t.onBlur(e),R=!1)}),r.addListener(n,"focus",function(e){if(!A){if(R=!0,i.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),i.isEdge?setTimeout(x):x()}}),this.$focusScroll=!1,this.focus=function(){if(D||c||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var t=0!=n.getBoundingClientRect().top}catch(e){return}var r=[];if(t)for(var i=n.parentElement;i&&1==i.nodeType;)r.push(i),i.setAttribute("ace_nocontext",!0),i=!i.parentElement&&i.getRootNode?i.getRootNode().host:i.parentElement;n.focus({preventScroll:!0}),t&&r.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="","0px"==n.style.top&&(n.style.top=e)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return R},t.on("beforeEndOperation",function(){t.curOp&&"insertstring"==t.curOp.command.name||(v&&(_=n.value="",U()),x())});var x=p?function(e){if(R&&(!g||e)&&!C){e||(e="");var r="\n ab"+e+"cde fg\n";r!=n.value&&(n.value=_=r);var i=4+(e.length||(t.selection.isEmpty()?0:1));4==y&&b==i||n.setSelectionRange(4,i),y=4,b=i}}:function(){if(!v&&!C&&(R||F)){v=!0;var e=t.selection,r=e.getRange(),i=e.cursor.row,s=r.start.column,o=r.end.column,a=t.session.getLine(i);if(r.start.row!=i){var l=t.session.getLine(i-1);s=r.start.rowi+1?u.length:o,o+=a.length+1,a=a+"\n"+u}a.length>h&&(s0&&_[h]==e[h];)h++,o--;for(l=l.slice(h),h=1;a>0&&_.length-h>y-1&&_[_.length-h]==e[e.length-h];)h++,a--;u-=h-1,c-=h-1;var d=l.length-h+1;return d<0&&(o=-d,d=0),l=l.slice(0,d),r||l||u||o||a||c?(C=!0,l&&!o&&!a&&!u&&!c||S?t.onTextInput(l):t.onTextInput(l,{extendLeft:o,extendRight:a,restoreStart:u,restoreEnd:c}),C=!1,_=e,y=i,b=s,T=c,l):""},L=function(e){if(v)return B();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var r=n.value,i=N(r,!0);(r.length>500||m.test(i))&&x()},O=function(e,t,n){var r=e.clipboardData||window.clipboardData;if(r&&!l){var i=u||n?"Text":"text/plain";try{return t?!1!==r.setData(i,t):r.getData(i)}catch(e){if(!n)return O(e,t,!0)}}},I=function(e,i){var s=t.getCopyText();if(!s)return r.preventDefault(e);O(e,s)?(p&&(x(s),g=s,setTimeout(function(){g=!1},10)),i?t.onCut():t.onCopy(),r.preventDefault(e)):(g=!0,n.value=s,n.select(),setTimeout(function(){g=!1,x(),i?t.onCut():t.onCopy()}))},k=function(e){I(e,!0)},M=function(e){I(e,!1)},P=function(e){var s=O(e);a.pasteCancelled()||("string"==typeof s?(s&&t.onPaste(s,e),i.isIE&&setTimeout(x),r.preventDefault(e)):(n.value="",E=!0))};r.addCommandKeyListener(n,t.onCommandKey.bind(t)),r.addListener(n,"select",function(e){v||(g?g=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=_.length&&e.value===_&&_&&e.selectionEnd!==b}(n)&&(t.selectAll(),x()))}),r.addListener(n,"input",L),r.addListener(n,"cut",k),r.addListener(n,"copy",M),r.addListener(n,"paste",P),"oncut"in n&&"oncopy"in n&&"onpaste"in n||r.addListener(e,"keydown",function(e){if((!i.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:M(e);break;case 86:P(e);break;case 88:k(e)}});var B=function(){if(v&&t.onCompositionUpdate&&!t.$readOnly){if(S)return $();if(v.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;N(e),v.markerRange&&(v.context&&(v.markerRange.start.column=v.selectionStart=v.context.compositionStartOffset),v.markerRange.end.column=v.markerRange.start.column+b-v.selectionStart+T)}}},U=function(e){t.onCompositionEnd&&!t.$readOnly&&(v=!1,t.onCompositionEnd(),t.off("mousedown",$),e&&L())};function $(){A=!0,n.blur(),n.focus(),A=!1}var G,V=o.delayedCall(B,50).schedule.bind(null,null);function W(){clearTimeout(G),G=setTimeout(function(){D&&(n.style.cssText=D,D=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()},0)}r.addListener(n,"compositionstart",function(e){if(!v&&t.onCompositionStart&&!t.$readOnly&&(v={},!S)){setTimeout(B,0),t.on("mousedown",$);var r=t.getSelectionRange();r.end.row=r.start.row,r.end.column=r.start.column,v.markerRange=r,v.selectionStart=y,t.onCompositionStart(v),v.useTextareaForIME?(n.value="",_="",y=0,b=0):(n.msGetInputContext&&(v.context=n.msGetInputContext()),n.getInputContext&&(v.context=n.getInputContext()))}}),r.addListener(n,"compositionupdate",B),r.addListener(n,"keyup",function(e){27==e.keyCode&&n.value.lengthb&&"\n"==_[s]?o=d.end:rb&&_.slice(0,s).split("\n").length>2?o=d.down:s>b&&" "==_[s-1]?(o=d.right,a=f.option):(s>b||s==b&&b!=y&&r==s)&&(o=d.right),r!==s&&(a|=f.shift),o){if(!t.onCommandKey({},a,o)&&t.commands){o=d.keyCodeToString(o);var l=t.commands.findKeyCommand(a,o);l&&t.execCommand(l)}y=r,b=s,x("")}}};document.addEventListener("selectionchange",s),t.on("destroy",function(){document.removeEventListener("selectionchange",s)})}(0,t,n)}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/useragent");function i(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function s(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)n=2*t.row-e.start.row-e.end.row;else n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,s=e.getButton();return 0!==s?((i.getSelectionRange().isEmpty()||1==s)&&i.selection.moveToPosition(n),void(2==s&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||i.isFocused()||(i.focus(),!this.$focusTimeout||this.$clickSelection||i.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(-1==r)e=this.$clickSelection.end;else if(1==r)e=this.$clickSelection.start;else{var i=s(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(i.start),a=this.$clickSelection.comparePoint(i.end);if(-1==o&&a<=0)t=this.$clickSelection.end,i.end.row==r.row&&i.end.column==r.column||(r=i.start);else if(1==a&&o>=0)t=this.$clickSelection.start,i.start.row==r.row&&i.start.column==r.column||(r=i.end);else if(-1==o&&1==a)r=i.end,t=i.start;else{var l=s(this.$clickSelection,r);r=l.cursor,t=l.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e,t,n,r,i=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,n=this.x,r=this.y,Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))),s=Date.now();(i>0||s-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session.getBracketRange(t);r?(r.isEmpty()&&(r.start.column--,r.end.column++),this.setState("select")):(r=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=r,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,s=i?e.wheelX/i:n.vx,o=i?e.wheelY/i:n.vy;i<550&&(s=(s+n.vx)/2,o=(o+n.vy)/2);var a=Math.abs(s/o),l=!1;return a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?n.allowed=r:r-n.allowed<550&&(Math.abs(s)<=1.5*Math.abs(n.vx)&&Math.abs(o)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=r):n.allowed=0),n.t=r,n.vx=s,n.vy=o,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(i.prototype),t.DefaultHandlers=i}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}(function(){this.$init=function(){return this.$element=r.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){r.addCssClass(this.getElement(),e)},this.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(i.prototype),t.Tooltip=i}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/event"),o=e("../tooltip").Tooltip;function a(e){o.call(this,e)}i.inherits(a,o),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),s=this.getHeight();(e+=15)+i>n&&(e-=e+i-n),(t+=15)+s>r&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=function(e){var t,n,i,o=e.editor,l=o.renderer.$gutterLayer,u=new a(o.container);function c(){t&&(t=clearTimeout(t)),i&&(u.hide(),i=null,o._signal("hideGutterTooltip",u),o.removeEventListener("mousewheel",c))}function h(e){u.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",function(t){if(o.isFocused()&&0==t.getButton()&&"foldWidgets"!=l.getRegion(t)){var n=t.getDocumentPosition().row,r=o.session.selection;if(t.getShiftKey())r.selectTo(n,0);else{if(2==t.domEvent.detail)return o.selectAll(),t.preventDefault();e.$clickSelection=o.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}),e.editor.setDefaultHandler("guttermousemove",function(s){var a=s.domEvent.target||s.domEvent.srcElement;if(r.hasCssClass(a,"ace_fold-widget"))return c();i&&e.$tooltipFollowsMouse&&h(s),n=s,t||(t=setTimeout(function(){t=null,n&&!e.isMousePressed?function(){var t=n.getDocumentPosition().row,r=l.$annotations[t];if(!r)return c();if(t==o.session.getLength()){var s=o.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(s>o.session.documentToScreenRow(a.row,a.column))return c()}if(i!=r)if(i=r.text.join("
"),u.setHtml(i),u.show(),o._signal("showGutterTooltip",u),o.on("mousewheel",c),e.$tooltipFollowsMouse)h(n);else{var d=n.domEvent.target.getBoundingClientRect(),f=u.getElement().style;f.left=d.right+"px",f.top=d.bottom+"px"}}():c()},50))}),s.addListener(o.renderer.$gutter,"mouseout",function(e){n=null,i&&!t&&(t=setTimeout(function(){t=null,c()},50))}),o.on("changeSession",c)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent");function o(e){var t=e.editor,n=r.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),t.addEventListener("mousedown",this.onMouseDown.bind(e));var o,l,u,c,h,d,f,p,m,g,E,v=t.container,C=0;function D(){var e=d;(function(e,n){var r=Date.now(),i=!n||e.row!=n.row,s=!n||e.column!=n.column;!g||i||s?(t.moveCursorToPosition(e),g=r,E={x:l,y:u}):a(E.x,E.y,l,u)>5?g=null:r-g>=200&&(t.renderer.scrollCursorIntoView(),g=null)})(d=t.renderer.screenToTextCoordinates(l,u),e),function(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,s=t.renderer.layerConfig.characterWidth,o=t.renderer.scroller.getBoundingClientRect(),a={x:{left:l-o.left,right:o.right-l},y:{top:u-o.top,bottom:o.bottom-u}},c=Math.min(a.x.left,a.x.right),h=Math.min(a.y.top,a.y.bottom),d={row:e.row,column:e.column};c/s<=2&&(d.column+=a.x.left=200&&t.renderer.scrollCursorIntoView(d):m=r:m=null}(d,e)}function S(){h=t.selection.toOrientedRange(),o=t.session.addMarker(h,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(c),D(),c=setInterval(D,20),C=0,i.addListener(document,"mousemove",y)}function A(){clearInterval(c),t.session.removeMarker(o),o=null,t.selection.fromOrientedRange(h),t.isFocused()&&!p&&t.$resetCursorStyle(),h=null,d=null,C=0,m=null,g=null,i.removeListener(document,"mousemove",y)}this.onDragStart=function(e){if(this.cancelDrag||!v.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}h=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?"copy":"copyMove",s.isOpera&&(t.container.appendChild(n),n.scrollTop=0),i.setDragImage&&i.setDragImage(n,0,0),s.isOpera&&t.container.removeChild(n),i.clearData(),i.setData("Text",t.session.getTextRange()),p=!0,this.setState("drag")},this.onDragEnd=function(e){if(v.draggable=!1,p=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;f||"move"!=n||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||S(),C++,e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||(S(),C++),null!==_&&(_=null),e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragLeave=function(e){if(--C<=0&&o)return A(),f=null,i.preventDefault(e)},this.onDrop=function(e){if(d){var n=e.dataTransfer;if(p)switch(f){case"move":h=h.contains(d.row,d.column)?{start:d,end:d}:t.moveText(h,d);break;case"copy":h=t.moveText(h,d,!0)}else{var r=n.getData("Text");h={start:d,end:t.session.insert(d,r)},t.focus(),f=null}return A(),i.preventDefault(e)}},i.addListener(v,"dragstart",this.onDragStart.bind(e)),i.addListener(v,"dragend",this.onDragEnd.bind(e)),i.addListener(v,"dragenter",this.onDragEnter.bind(e)),i.addListener(v,"dragover",this.onDragOver.bind(e)),i.addListener(v,"dragleave",this.onDragLeave.bind(e)),i.addListener(v,"drop",this.onDrop.bind(e));var _=null;function y(){null==_&&(_=setTimeout(function(){null!=_&&o&&A()},20))}function b(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function T(e){var t=["copy","copymove","all","uninitialized"],n=s.isMac?e.altKey:e.ctrlKey,r="uninitialized";try{r=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var i="none";return n&&t.indexOf(r)>=0?i="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(r)>=0?i="move":t.indexOf(r)>=0&&(i="copy"),i}}function a(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=s.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;s.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton();if(1===(e.domEvent.detail||1)&&0===r&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var i=e.domEvent.target||e.domEvent.srcElement;"unselectable"in i&&(i.unselectable="on"),t.getDragDelay()?(s.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(o.prototype),t.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./mouse_event").MouseEvent,i=e("../lib/dom");t.addTouchListeners=function(e,t){var n,s,o,a,l,u,c,h,d,f="scroll",p=0,m=0,g=0,E=0;function v(){var e,n,r;d||(e=window.navigator&&window.navigator.clipboard,n=!1,r=function(r){var s,o,a=r.target.getAttribute("action");if("more"==a||!n)return n=!n,s=t.getCopyText(),o=t.session.getUndoManager().hasUndo(),void d.replaceChild(i.buildDom(n?["span",!s&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],s&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],s&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],o&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),d.firstChild);"paste"==a?e.readText().then(function(e){t.execCommand(a,e)}):a&&("cut"!=a&&"copy"!=a||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(a)),d.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&t.focus()},d=i.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){f="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),r(e)},onclick:r},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container));var s=t.selection.cursor,o=t.renderer.textToScreenCoordinates(s.row,s.column),a=t.container.getBoundingClientRect();d.style.top=o.pageY-a.top-3+"px",d.style.right="10px",d.style.display="",d.firstChild.style.display="none",t.on("input",C)}function C(e){d&&(d.style.display="none"),t.off("input",C)}function D(){l=null,clearTimeout(l);var e=t.selection.getRange(),n=e.contains(c.row,c.column);!e.isEmpty()&&n||(t.selection.moveToPosition(c),t.selection.selectWord()),f="wait",v()}e.addEventListener("contextmenu",function(e){h&&t.textInput.getElement().focus()}),e.addEventListener("touchstart",function(e){var i=e.touches;if(l||i.length>1)return clearTimeout(l),l=null,o=-1,void(f="zoom");h=t.$mouseHandler.isMousePressed=!0;var u=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,v=e.timeStamp;a=v;var C=i[0],S=C.clientX,A=C.clientY;Math.abs(n-S)+Math.abs(s-A)>u&&(o=-1),n=e.clientX=S,s=e.clientY=A,g=E=0;var _=new r(e,t);if(c=_.getDocumentPosition(),v-o<500&&1==i.length&&!p)m++,e.preventDefault(),e.button=0,function(){l=null,clearTimeout(l),t.selection.moveToPosition(c);var e=m>=2?t.selection.getLineRange(c.row):t.session.getBracketRange(c);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),f="wait"}();else{m=0;var y=t.selection.cursor,b=t.selection.isEmpty()?y:t.selection.anchor,T=t.renderer.$cursorLayer.getPixelPosition(y,!0),R=t.renderer.$cursorLayer.getPixelPosition(b,!0),x=t.renderer.scroller.getBoundingClientRect(),w=function(e,t){return(e/=d)*e+(t=t/u-.75)*t};if(e.clientXN?"cursor":"anchor"),f=N<3.5?"anchor":F<3.5?"cursor":"scroll",l=setTimeout(D,450)}o=v}),e.addEventListener("touchend",function(e){h=t.$mouseHandler.isMousePressed=!1,u&&clearInterval(u),"zoom"==f?(f="",p=0):l?(t.selection.moveToPosition(c),p=0,v()):"scroll"==f?(p+=60,u=setInterval(function(){p--<=0&&(clearInterval(u),u=null),Math.abs(g)<.01&&(g=0),Math.abs(E)<.01&&(E=0),p<20&&(g*=.9),p<20&&(E*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*g,10*E),e==t.session.getScrollTop()&&(p=0)},10),e.preventDefault(),C()):v(),clearTimeout(l),l=null}),e.addEventListener("touchmove",function(e){l&&(clearTimeout(l),l=null);var i=e.touches;if(!(i.length>1||"zoom"==f)){var o=i[0],u=n-o.clientX,c=s-o.clientY;if("wait"==f){if(!(u*u+c*c>4))return e.preventDefault();f="cursor"}n=o.clientX,s=o.clientY,e.clientX=o.clientX,e.clientY=o.clientY;var h=e.timeStamp,d=h-a;if(a=h,"scroll"==f){var p=new r(e,t);p.speed=1,p.wheelX=u,p.wheelY=c,10*Math.abs(u)1&&(i=n[n.length-2]);var o=l[t+"Path"];return null==o?o=l.basePath:"/"==r&&(t=r=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+t+r+i+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,r){var i,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{i=e(n)}catch(e){}if(i&&!t.$loading[n])return r&&r(i);if(t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r),!(t.$loading[n].length>1)){var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var r=t.$loading[n];t.$loading[n]=null,r.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,o),a),u()}};var u=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),u=function(){})};function c(i){if(a&&a.document){l.packaged=i||e.packaged||r.packaged||a.define&&n.amdD.packaged;for(var s={},o="",u=document.currentScript||document._currentScript,c=(u&&u.ownerDocument||document).getElementsByTagName("script"),d=0;d=e){for(s=h+1;s=e;)s++;for(a=h,l=s-1;a=t.length||2!=(l=n[i-1])&&3!=l||2!=(u=t[i+1])&&3!=u?4:(s&&(u=3),u==l?u:4);case 10:return 2==(l=i>0?n[i-1]:5)&&i+10&&2==n[i-1])return 2;if(s)return 4;for(f=i+1,d=t.length;f=1425&&m<=2303||64286==m;if(l=t[f],g&&(1==l||7==l))return 1}return i<1||5==(l=t[i-1])?4:n[i-1];case 5:return s=!1,o=!0,r;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:s=!1;case h:return 4}}function g(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?t>191?0:d[t]:5==n?/[\u0591-\u05f4]/.test(e)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?12:/[\u0660-\u0669\u066b-\u066c]/.test(e)?3:1642==t?c:/[\u06f0-\u06f9]/.test(e)?2:7:32==n&&t<=8287?f[255&t]:254==n&&t>=65136?7:4}t.L=0,t.R=1,t.EN=2,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,n,c){if(e.length<2)return{};var d=e.split(""),f=new Array(d.length),E=new Array(d.length),v=[];r=c?1:0,function(e,t,n,c){var h=r?u:l,d=null,f=null,p=null,E=0,v=null,C=-1,D=null,S=null,A=[];if(!c)for(D=0,c=[];D0)if(16==v){for(D=C;D-1){for(D=C;D=0&&8==c[_];_--)t[_]=r}}(d,v,d.length,n);for(var C=0;C7&&n[C]<13||4===n[C]||n[C]===h)?v[C]=t.ON_R:C>0&&"ل"===d[C-1]&&/\u0622|\u0623|\u0625|\u0627/.test(d[C])&&(v[C-1]=v[C]=t.R_H,C++);for(d[d.length-1]===t.DOT&&(v[d.length-1]=t.B),"‫"===d[0]&&(v[0]=t.RLE),C=0;C=0&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,r=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===r;)r=n,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[e];s&&(void 0===t&&(t=this.getSplitIndex()),t>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&s[i]%2!=0&&i++;for(var a=0;at&&s[i]%2==0&&(o+=this.charWidths[s[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(e,t){var n,r=this.bidiMap,i=r.bidiLevels,s=[],o=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,u=!1,c=!1,h=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,f=0;f=a&&dn+s/2;){if(n+=s,r===i.length-1){s=0;break}s=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!=0&&i[r]%2==0?(e0&&i[r-1]%2==0&&i[r]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&0===s&&i[r-1]%2==0||!this.isRtlDir&&0===r&&i[r]%2!=0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!=0&&0!==s&&r--,t=this.bidiMap.logicalFromVisual[r]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(o.prototype),t.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")})};(function(){r.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},this.$setSelection=function(e,t,n,r){var i=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||s)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n,r="number"==typeof e?e:this.lead.row,i=this.session.getFoldLine(r);return i?(r=i.start.row,n=i.end.row):n=r,!0===t?new o(r,0,n,this.session.getLine(n).length):new o(r,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i)this.moveCursorTo(i.end.row,i.end.column);else{if(this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t)),t>=n.length)return this.moveCursorTo(e,n.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(s)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)}},this.$shortWordEndIndex=function(e){var t,n=0,r=/\s/,i=this.session.tokenRe;if(i.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&r.test(t);)n++;if(n<1)for(i.lastIndex=0;(t=e[n])&&!i.test(t);)if(i.lastIndex=0,n++,r.test(t)){if(n>2){n--;break}for(;(t=e[n])&&r.test(t);)n++;if(n>2)break}}return i.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do{e++,r=this.doc.getLine(e)}while(e0&&/^\s*$/.test(r));n=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(t,n-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n,r=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(r.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(r.column),r.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=r.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?r.column=this.$desiredColumn:this.$desiredColumn=r.column);var i=this.session.screenToDocumentPosition(r.row+e,r.column,n);0!==e&&0===t&&i.row===this.lead.row&&i.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[i.row]&&(i.row>0||e>0)&&i.row++,this.moveCursorTo(i.row,i.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch(e){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,n){"use strict";var r=e("./config"),i=2e3,s=function(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],r=[],i=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",a=[],l=0;l1?this.$applyToken:u.token),h>1&&(/\\\d/.test(u.regex)?c=u.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(h=1,c=this.removeCapturingGroups(u.regex)),u.splitRegex||"string"==typeof u.token||a.push(u)),s[i]=l,i+=h,r.push(c),u.onMatch||(u.onMatch=null)}}r.length||(s[0]=0,r.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){i=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var r=[],i=0,s=n.length;ic){var E=e.substring(c,g-m.length);d.type==f?d.value+=E:(d.type&&u.push(d),d={type:f,value:E})}for(var v=0;vi){for(h>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});c1&&n[0]!==r&&n.unshift("#tmp",r),{tokens:u,state:n.length?n:r}},this.reportError=r.reportError}).call(s.prototype),t.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var n in e){for(var r=e[n],i=0;i=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(void 0!==n)return n;for(n=0;t>0;)n+=e[t-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)}}).call(i.prototype),t.TokenIterator=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r,i=e("../../lib/oop"),s=e("../behaviour").Behaviour,o=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],u=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],c={},h={'"':'"',"'":"'"},d=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,c.rangeCount!=e.multiSelect.rangeCount&&(c={rangeCount:e.multiSelect.rangeCount})),c[t])return r=c[t];r=c[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},f=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},p=function(e){this.add("braces","insertion",function(t,n,i,s,o){var l=i.getCursorPosition(),u=s.doc.getLine(l.row);if("{"==o){d(i);var c=i.getSelectionRange(),h=s.doc.getTextRange(c);if(""!==h&&"{"!==h&&i.getWrapBehavioursEnabled())return f(c,h,"{","}");if(p.isSaneInsertion(i,s))return/[\]\}\)]/.test(u[l.column])||i.inMultiSelectMode||e&&e.braces?(p.recordAutoInsert(i,s,"}"),{text:"{}",selection:[1,1]}):(p.recordMaybeInsert(i,s,"{"),{text:"{",selection:[1,1]})}else if("}"==o){if(d(i),"}"==u.substring(l.column,l.column+1)&&null!==s.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&p.isAutoInsertedClosing(l,u,o))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==o||"\r\n"==o){d(i);var m="";if(p.isMaybeInsertedClosing(l,u)&&(m=a.stringRepeat("}",r.maybeInsertedBrackets),p.clearMaybeInsertedClosing()),"}"===u.substring(l.column,l.column+1)){var g=s.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!g)return null;var E=this.$getIndent(s.getLine(g.row))}else{if(!m)return void p.clearMaybeInsertedClosing();E=this.$getIndent(u)}var v=E+s.getTabString();return{text:"\n"+v+"\n"+E+m,selection:[1,v.length,1,v.length]}}p.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,i,s){var o=i.doc.getTextRange(s);if(!s.isMultiLine()&&"{"==o){if(d(n),"}"==i.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s;r.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if("("==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"(",")");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(")"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"("==s&&(d(n),")"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("brackets","insertion",function(e,t,n,r,i){if("["==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"[","]");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if("]"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"["==s&&(d(n),"]"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("string_dquotes","insertion",function(e,t,n,r,i){var s=r.$mode.$quotes||h;if(1==i.length&&s[i]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(i))return;d(n);var o=i,a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(!(""===l||1==l.length&&s[l])&&n.getWrapBehavioursEnabled())return f(a,l,o,o);if(!l){var u=n.getCursorPosition(),c=r.doc.getLine(u.row),p=c.substring(u.column-1,u.column),m=c.substring(u.column,u.column+1),g=r.getTokenAt(u.row,u.column),E=r.getTokenAt(u.row,u.column+1);if("\\"==p&&g&&/escape/.test(g.type))return null;var v,C=g&&/string|escape/.test(g.type),D=!E||/string|escape/.test(E.type);if(m==o)(v=C!==D)&&/string\.end/.test(E.type)&&(v=!1);else{if(C&&!D)return null;if(C&&D)return null;var S=r.$mode.tokenRe;S.lastIndex=0;var A=S.test(p);S.lastIndex=0;var _=S.test(p);if(A||_)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;var y=c[u.column-2];if(p==o&&(y==o||S.test(y)))return null;v=!0}return{text:v?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.$mode.$quotes||h,o=r.doc.getTextRange(i);if(!i.isMultiLine()&&s.hasOwnProperty(o)&&(d(n),r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==o))return i.end.column++,i})};p.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new o(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",l)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var i=new o(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",l))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",u)},p.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},p.recordAutoInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isAutoInsertedClosing(i,s,r.autoInsertedLineEnd[0])||(r.autoInsertedBrackets=0),r.autoInsertedRow=i.row,r.autoInsertedLineEnd=n+s.substr(i.column),r.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isMaybeInsertedClosing(i,s)||(r.maybeInsertedBrackets=0),r.maybeInsertedRow=i.row,r.maybeInsertedLineStart=s.substr(0,i.column)+n,r.maybeInsertedLineEnd=s.substr(i.column),r.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return r.autoInsertedBrackets>0&&e.row===r.autoInsertedRow&&n===r.autoInsertedLineEnd[0]&&t.substr(e.column)===r.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return r.maybeInsertedBrackets>0&&e.row===r.maybeInsertedRow&&t.substr(e.column)===r.maybeInsertedLineEnd&&t.substr(0,e.column)==r.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){r.autoInsertedLineEnd=r.autoInsertedLineEnd.substr(1),r.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){r&&(r.maybeInsertedBrackets=0,r.maybeInsertedRow=-1)},i.inherits(p,s),t.CstyleBehaviour=p}),ace.define("ace/unicode",["require","exports","module"],function(e,t,n){"use strict";for(var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,s=[],o=0;o2?r%u!=u-1:r%u==0})}else{if(!this.blockComment)return!1;var f=this.blockComment.start,p=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+l.escapeRegExp(f)+")"),g=new RegExp("(?:"+l.escapeRegExp(p)+")\\s*$"),E=function(e,t){C(e,t)||s&&!/\S/.test(e)||(i.insertInLine({row:t,column:e.length},p),i.insertInLine({row:t,column:a},f))},v=function(e,t){var n;(n=e.match(g))&&i.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(m))&&i.removeInLine(t,n[1].length,n[0].length)},C=function(e,n){if(m.test(e))return!0;for(var r=t.getTokens(n),i=0;ie.length&&(S=e.length)}),a==1/0&&(a=S,s=!1,o=!1),c&&a%u!=0&&(a=Math.floor(a/u)*u),D(o?v:E)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(i){!i.start&&i[0]&&(i=i[0]);var s,o,a=(m=new u(t,r.row,r.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var h,d;a&&/comment/.test(a.type);){if(-1!=(g=a.value.indexOf(i.start))){var f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g;h=new c(f,p,f,p+i.start.length);break}a=m.stepBackward()}var m;for(a=(m=new u(t,r.row,r.column)).getCurrentToken();a&&/comment/.test(a.type);){var g;if(-1!=(g=a.value.indexOf(i.end))){f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g,d=new c(f,p,f,p+i.end.length);break}a=m.stepForward()}d&&t.remove(d),h&&(t.remove(h),s=h.start.row,o=-i.start.length)}else o=i.start.length,s=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);l.start.row==s&&(l.start.column+=o),l.end.row==s&&(l.end.column+=o),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var n=e[t],i=n.prototype.$id,s=r.$modes[i];s||(r.$modes[i]=s=new n),r.$modes[t]||(r.$modes[t]=s),this.$embeds.push(t),this.$modes[t]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;tthis.row)){var n=function(t,n,r){var i="insert"==t.action,s=(i?1:-1)*(t.end.row-t.start.row),o=(i?1:-1)*(t.end.column-t.start.column),a=t.start,l=i?a:t.end;return e(n,a,r)?{row:n.row,column:n.column}:e(l,n,!r)?{row:n.row+s,column:n.column+(n.row==l.row?o:0)}:{row:a.row,column:a.column}}(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(e,t,n){var r;if(r=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=r.row||this.column!=r.column){var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=e("./anchor").Anchor,l=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new a(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();void 0===e?e=n:e<0?e=0:e>=n&&(e=n-1,t=void 0);var r=this.getLine(e);return null==t&&(t=r.length),{row:e,column:t=Math.min(Math.max(t,0),r.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof o||(e=o.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,r=n.length-t+1,i=e.start.row,s=e.start.column,o=0,a=0;o20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,-1==r&&(r=t),s<=r&&n.fireUpdateEvent(s,r)}}};(function(){r.implement(this,i),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens}}).call(s.prototype),t.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=(e("./lib/oop"),e("./range").Range),s=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,n,s){if(this.regExp)for(var o=s.firstRow,a=s.lastRow,l=o;l<=a;l++){var u=this.cache[l];null==u&&((u=r.getMatchOffsets(n.getLine(l),this.regExp)).length>this.MAX_RANGES&&(u=u.slice(0,this.MAX_RANGES)),u=u.map(function(e){return new i(l,e.offset,l,e.offset+e.length)}),this.cache[l]=u.length?u:"");for(var c=u.length;c--;)t.drawSingleLineMarker(e,u[c].toScreenRange(n),this.clazz,s)}}}).call(s.prototype),t.SearchHighlight=s}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range;function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var r,i,s=0,o=this.folds,a=!0;null==t&&(t=this.end.row,n=this.end.column);for(var l=0;l0)){var l=r(e,o.start);return 0===a?t&&0!==l?-s-2:s:l>0||0===l&&!t?s:-s-1}}return-s-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},this.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],n=this.ranges,i=(n=n.sort(function(e,t){return r(e.start,t.start)}))[0],s=1;s=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=r);o++);if("insert"==e.action){for(var l=i-r,u=-t.column+n.column;or);o++)if(c.start.row==r&&c.start.column>=t.column&&(c.start.column==t.column&&this.$bias<=0||(c.start.column+=u,c.start.row+=l)),c.end.row==r&&c.end.column>=t.column){if(c.end.column==t.column&&this.$bias<0)continue;c.end.column==t.column&&u>0&&oc.start.column&&c.end.column==s[o+1].start.column&&(c.end.column-=u),c.end.column+=u,c.end.row+=l}}else for(l=r-i,u=t.column-n.column;oi);o++)c.end.rowt.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=u,c.end.row+=l):c.end.row>i&&(c.end.row+=l),c.start.rowt.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=u,c.start.row+=l):c.start.row>i&&(c.start.row+=l);if(0!=l&&o=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;for(t&&(r=n.indexOf(t)),-1==r&&(r=0);r=e)return i}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,r=t-e+1,i=0;i=t){a=e?r-=t-a:r=0);break}o>=e&&(r-=a>=e?o-a:o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n,r=this.$foldData,o=!1;e instanceof s?n=e:(n=new s(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,u=n.end.row,c=n.end.column,h=this.getFoldAt(a,l,1),d=this.getFoldAt(u,c,-1);if(h&&d==h)return h.addSubFold(n);h&&!h.range.isStart(a,l)&&this.removeFold(h),d&&!d.range.isEnd(u,c)&&this.removeFold(d);var f=this.getFoldsInRange(n.range);f.length>0&&(this.removeFolds(f),f.forEach(function(e){n.addSubFold(e)}));for(var p=0;p0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;if(null==e?(n=new r(0,0,this.getLength(),0),t=!0):n="number"==typeof e?new r(e,0,e,this.getLine(e).length):"row"in e?r.fromPoints(e,e):e,i=this.getFoldsInRangeList(n),t)this.removeFolds(i);else for(var s=i;s.length;)this.expandFolds(s),s=this.getFoldsInRangeList(n);if(i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){null==r&&(r=e.start.row),null==i&&(i=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var s=this.doc,o="";return e.walk(function(e,t,n,a){if(!(tc)break}while(s&&l.test(s.type));s=i.stepBackward()}else s=i.getCurrentToken();return u.end.row=i.getCurrentTokenRow(),u.end.column=i.getCurrentTokenColumn()+s.value.length-2,u}},this.foldAll=function(e,t,n){null==n&&(n=1e5);var r=this.foldWidgets;if(r){t=t||this.getLength();for(var i=e=e||0;i=e){i=s.end.row;try{var o=this.addFold("...",s);o&&(o.collapseChildren=n)}catch(e){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};for(var r,i=e-1;i>=0;){var s=n[i];if(null==s&&(s=n[i]=this.getFoldWidget(i)),"start"==s){var o=this.getFoldWidgetRange(i);if(r||(r=o),o&&o.end.row>=e)break}i--}return{range:-1!==i&&o,firstRange:r}},this.onFoldWidgetClick=function(e,t){var n={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var r=t.target||t.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),r=this.getLine(e),i="end"===n?-1:1,s=this.getFoldAt(e,-1===i?0:r.length,i);if(s)return t.children||t.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()&&(s=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(s.range))return this.removeFold(s),s;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,u=a.range.end.row;this.foldAll(l,u,t.all?1e4:0)}else t.children?(u=o?o.end.row:this.getLength(),this.foldAll(e+1,u,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var r=this.getParentFoldRangeData(t,!0);if(n=r.range||r.firstRange){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold("...",n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){"use strict";var r=e("../token_iterator").TokenIterator,i=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(""==n)return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t,n=this.getLine(e.row),r=!0,s=n.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(o||(s=n.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),r=!1),!o)return null;if(o[1]){if(!(a=this.$findClosingBracket(o[1],e)))return null;t=i.fromPoints(e,a),r||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a;if(!(a=this.$findOpeningBracket(o[2],e)))return null;t=i.fromPoints(a,e),r||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn()-2,u=a.value;;){for(;l>=0;){var c=u.charAt(l);if(c==i){if(0==(s-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else c==e&&(s+=1);l-=1}do{a=o.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(u=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn();;){for(var u=a.value,c=u.length;ln&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>1,s=e[i];if(t>s)n=i+1;else{if(!(t=t);s++);return(n=r[s])?(n.index=s,n.start=i-n.value.length,n):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe)),r)var i=this.tokenRe;else i=/^\s+$/.test(n.slice(t-1,t+1))?/\s/:this.nonTokenRe;var s=t;if(s>0){do{s--}while(s>=0&&n.charAt(s).match(i));s++}for(var o=t;oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,s=this.$foldData[i],o=s?s.start.row:1/0,a=t.length,l=0;lo){if((l=s.end.row+1)>=a)break;o=(s=this.$foldData[i++])?s.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>r&&(r=n[l])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var r=e[n];"insert"==r.action||"remove"==r.action?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;ne.end.column&&(s.start.column+=u),s.end.row==e.end.row&&s.end.column>e.end.column&&(s.end.column+=u)),o&&s.start.row>=e.end.row&&(s.start.row+=o,s.end.row+=o)}if(s.end=this.insert(s.start,r),i.length){var a=e.start,l=s.start,u=(o=l.row-a.row,l.column-a.column);this.addFolds(i.map(function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=u),e.end.row==a.row&&(e.end.column+=u),e.start.row+=o,e.end.row+=o,e}))}return s},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},this.outdentRows=function(e){for(var t=e.collapseRows(),n=new c(0,0,0,0),r=this.getTabSize(),i=t.start.row;i<=t.end.row;++i){var s=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o0){var i;if((i=this.getRowFoldEnd(t+n))>this.doc.getLength()-1)return 0;r=i-t}else e=this.$clipRowToDocument(e),r=(t=this.$clipRowToDocument(t))-e+1;var s=new c(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(e){return(e=e.clone()).start.row+=r,e.end.row+=r,e}),a=0==n?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+r,a),o.length&&this.addFolds(o),r},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1&&(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,i=e.end,s=r.row,o=i.row,a=o-s,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[t?"$wrapData":"$rowLengthCache"].splice(s,a);var u=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var c=0;if(m=this.getFoldLine(i.row)){m.addRemoveChars(i.row,i.column,r.column-i.column),m.shiftRow(-a);var h=this.getFoldLine(s);h&&h!==m&&(h.merge(m),m=h),c=u.indexOf(m)+1}for(;c=i.row&&m.shiftRow(-a);o=s}else{var d=Array(a);d.unshift(s,0);var f=t?this.$wrapData:this.$rowLengthCache;if(f.splice.apply(f,d),u=this.$foldData,c=0,m=this.getFoldLine(s)){var p=m.range.compareInside(r.row,r.column);0==p?(m=m.split(r.row,r.column))&&(m.shiftRow(a),m.addRemoveChars(o,0,i.column-r.column)):-1==p&&(m.addRemoveChars(s,0,i.column-r.column),m.shiftRow(a)),c=u.indexOf(m)+1}for(;c=s&&m.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===n&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(m=this.getFoldLine(s))&&m.addRemoveChars(s,r.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),l},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(n,r){var i,s,o=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,u=this.$wrapLimit,c=n;for(r=Math.min(r,o.length-1);c<=r;)(s=this.getFoldLine(c,s))?(i=[],s.walk(function(n,r,s,a){var l;if(null!=n){(l=this.$getDisplayTokens(n,i.length))[0]=e;for(var u=1;u=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}this.$computeWrapSplits=function(n,r,i){if(0==n.length)return[];var s=[],o=n.length,a=0,l=0,u=this.$wrapAsCode,c=this.$indentedSoftWrap,h=r<=Math.max(2*i,8)||!1===c?0:Math.floor(r/2);function d(e){for(var t=e-a,r=a;rr-f;){var p=a+r-f;if(n[p-1]>=10&&n[p]>=10)d(p);else if(n[p]!=e&&n[p]!=t){for(var m=Math.max(p-(r-(r>>2)),a-1);p>m&&n[p]m&&n[p]m&&9==n[p];)p--}else for(;p>m&&n[p]<10;)p--;p>m?d(++p):(2==n[p=a+r]&&p--,d(p-f))}else{for(;p!=a-1&&n[p]!=e;p--);if(p>a){d(p);continue}for(p=a+r;p39&&o<48||o>57&&o<64?i.push(9):o>=4352&&n(o)?i.push(1,2):i.push(1)}return i},this.$getStringScreenWidth=function(e,t,r){if(0==t)return[0,0];var i,s;for(null==t&&(t=1/0),r=r||0,s=0;s=4352&&n(i)?r+=2:r+=1,!(r>t));s++);return[r,s]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0){a=u[c],s=this.$docRowCache[c];var d=e>u[h-1]}else d=!h;for(var f=this.getLength()-1,p=this.getNextFoldLine(s),m=p?p.start.row:1/0;a<=e&&!(a+(l=this.getRowLength(s))>e||s>=f);)a+=l,++s>m&&(s=p.end.row+1,m=(p=this.getNextFoldLine(s,p))?p.start.row:1/0),d&&(this.$docRowCache.push(s),this.$screenRowCache.push(a));if(p&&p.start.row<=s)r=this.getFoldDisplayLine(p),s=p.start.row;else{if(a+l<=e||s>f)return{row:f,column:this.getLine(f).length};r=this.getLine(s),p=null}var g=0,E=Math.floor(e-a);if(this.$useWrapMode){var v=this.$wrapData[s];v&&(i=v[E],E>0&&v.length&&(g=v.indent,o=v[E-1]||v[v.length-1],r=r.substring(o)))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+E,s,E)&&(t=this.$bidiHandler.offsetToCol(n)),o+=this.$getStringScreenWidth(r,t-g)[1],this.$useWrapMode&&o>=i&&(o=i-1),p?p.idxToPosition(o):{row:s,column:o}},this.documentToScreenPosition=function(e,t){if(void 0===t)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r,i=0,s=null;(r=this.getFoldAt(e,t,1))&&(e=r.start.row,t=r.start.column);var o,a=0,l=this.$docRowCache,u=this.$getRowCacheIndex(l,e),c=l.length;if(c&&u>=0){a=l[u],i=this.$screenRowCache[u];var h=e>l[c-1]}else h=!c;for(var d=this.getNextFoldLine(a),f=d?d.start.row:1/0;a=f){if((o=d.end.row+1)>e)break;f=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;i+=this.getRowLength(a),a=o,h&&(this.$docRowCache.push(a),this.$screenRowCache.push(i))}var p="";d&&a>=f?(p=this.getFoldDisplayLine(d,e,t),s=d.start.row):(p=this.getLine(e).substring(0,t),s=e);var m=0;if(this.$useWrapMode){var g=this.$wrapData[s];if(g){for(var E=0;p.length>=g[E];)i++,E++;p=p.substring(g[E-1]||0,p.length),m=E>0?g.indent:0}}return{row:i,column:m+this.$getStringScreenWidth(p)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,r=0,i=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);ri&&(r=t.end.row+1,i=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var o=this.$foldData,a=0;an);s++);return[r,s]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=n}.call(p.prototype),e("./edit_session/folding").Folding.call(p.prototype),e("./edit_session/bracket_match").BracketMatch.call(p.prototype),o.defineOptions(p.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=p}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(){this.$options={}};(function(){this.set=function(e){return i.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i,o){return r=new s(e,n,i,o),!(n==o&&t.start&&t.start.start&&0!=t.skipCurrent&&r.isEqual(t.start)&&(r=null,1))}),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],a=t.re;if(t.$isMultiLine){var l,u=a.length,c=i.length-u;e:for(var h=a.offset||0;h<=c;h++){for(var d=0;dm||(o.push(l=new s(h,m,h+u-1,g)),u>2&&(h=h+u-2))}}else for(var E=0;ES&&o[d].end.row==n.end.row;)d--;for(o=o.slice(E,d+1),E=0,d=o.length;E=a;n--)if(h(n,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(n=l,a=o.row;n>=a;n--)if(h(n,Number.MAX_VALUE,e))return}};else u=function(e){var n=o.row;if(!h(n,o.column,e)){for(n+=1;n<=l;n++)if(h(n,0,e))return;if(0!=t.wrap)for(n=a,l=o.row;n<=l;n++)if(h(n,0,e))return}};if(t.$isMultiLine)var c=n.length,h=function(t,i,s){var o=r?t-c+1:t;if(!(o<0)){var a=e.getLine(o),l=a.search(n[0]);if(!(!r&&li))return!!s(o,l,o+c-1,h)||void 0}}};else h=r?function(t,r,i){var s,o=e.getLine(t),a=[],l=0;for(n.lastIndex=0;s=n.exec(o);){var u=s[0].length;if(l=s.index,!u){if(l>=o.length)break;n.lastIndex=l+=1}if(s.index+u>r)break;a.push(s.index,u)}for(var c=a.length-1;c>=0;c-=2){var h=a[c-1];if(i(t,h,t,h+(u=a[c])))return!0}}:function(t,r,i){var s,o,a=e.getLine(t);for(n.lastIndex=r;o=n.exec(a);){var l=o[0].length;if(i(t,s=o.index,t,s+l))return!0;if(!l&&(n.lastIndex=s+=1,s>=a.length))return!1}};return{forEach:u}}}).call(o.prototype),t.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/keys"),i=e("../lib/useragent"),s=r.KEY_MODS;function o(e,t){this.platform=t||(i.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function a(e,t){o.call(this,e,t),this.$singleCommand=!1}a.prototype=o.prototype,function(){function e(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var n=e&&("string"==typeof e?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var s=r[i];if(s==e)delete r[i];else if(Array.isArray(s)){var o=s.indexOf(e);-1!=o&&(s.splice(o,1),1==s.length&&(r[i]=s[0]))}}},this.bindKey=function(e,t,n){if("object"==typeof e&&e&&(null==n&&(n=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach(function(e){var r="";if(-1!=e.indexOf(" ")){var i=e.split(/\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=s[t.hashId]+t.key;r+=(r?" ":"")+n,this._addCommandToBinding(r,"chainKeys")},this),r+=" "}var o=this.parseKeys(e),a=s[o.hashId]+o.key;this._addCommandToBinding(r+a,t,n)},this)},this._addCommandToBinding=function(t,n,r){var i,s=this.commandKeyBinding;if(n)if(!s[t]||this.$singleCommand)s[t]=n;else{Array.isArray(s[t])?-1!=(i=s[t].indexOf(n))&&s[t].splice(i,1):s[t]=[s[t]],"number"!=typeof r&&(r=e(n));var o=s[t];for(i=0;ir);i++);o.splice(i,0,n)}else delete s[t]},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(n){if("string"==typeof n)return this.bindKey(n,t);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=t),this.addCommand(n))}},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),i=r[n];if(r.FUNCTION_KEYS[i])n=r.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:n.toUpperCase(),hashId:-1}}for(var s=0,o=t.length;o--;){var a=r.KEY_MODS[t[o]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[o]+" in "+e),!1;s|=a}return{key:n,hashId:s}},this.findKeyCommand=function(e,t){var n=s[e]+t;return this.commandKeyBinding[n]},this.handleKeyboard=function(e,t,n,r){if(!(r<0)){var i=s[t]+n,o=this.commandKeyBinding[i];return e.$keyChain&&(e.$keyChain+=" "+i,o=this.commandKeyBinding[e.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(e.$keyChain&&(t&&4!=t||1!=n.length?(-1==t||r>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-i.length-1)),{command:o}):(e.$keyChain=e.$keyChain||i,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(o.prototype),t.HashHandler=o,t.MultiHashHandler=a}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){i.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};r.inherits(o,i),function(){r.implement(this,s),this.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var i={editor:t,command:e,args:n};return i.returnValue=this._emit("exec",i),this._signal("afterExec",i),!1!==i.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map(function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=e("../config"),s=e("../range").Range;function o(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(e){i.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,a=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(n.row),u=n.row+1;u<=i.row+1;u++){var c=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(u)));0!==c.length&&(c=" "+c),l+=c}i.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;o=i.lastRow||r.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var i=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&-1!==n.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var n=this;E.loadModule(["keybinding",e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||i.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=t.findMatchingBracket(e.getCursorPosition());if(n)var r=new f(n.row,n.column,n.row,n.column+1);else t.$mode.getMatching&&(r=t.$mode.getMatching(e.session));r&&(t.$bracketHighlight=t.addMarker(r,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=e.getCursorPosition(),r=new v(e.session,n.row,n.column),i=r.getCurrentToken();if(!i||!/\b(?:tag-open|tag-name)/.test(i.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1==i.type.indexOf("tag-open")||(i=r.stepForward())){var s=i.value,o=0,a=r.stepBackward();if("<"==a.value)do{a=i,(i=r.stepForward())&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"=0);else{do{i=a,a=r.stepBackward(),i&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var n=new f(e.row,e.column,e.row,1/0);n.id=t.addMarker(n,"ace_active-line","screenLine"),t.$highlightLineMarker=n}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var n=t.start.column,r=t.end.column,i=e.getLine(t.start.row),s=i.substring(n,r);if(!(s.length>5e3)&&/[\w\d]/.test(s)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),a=i.substring(n-1,r+1);if(o.test(a))return o}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var r=this.selection.getAllRanges(),i=0;ia.search(/\S|$/)){var l=a.substr(i.column).search(/\S|$/);n.doc.removeInLine(i.row,i.column,i.column+l)}}this.clearSelection();var u=i.column,c=n.getState(i.row),h=(a=n.getLine(i.row),r.checkOutdent(c,a,e));if(n.insert(i,e),s&&s.selection&&(2==s.selection.length?this.selection.setSelectionRange(new f(i.row,u+s.selection[0],i.row,u+s.selection[1])):this.selection.setSelectionRange(new f(i.row+s.selection[0],s.selection[1],i.row+s.selection[2],s.selection[3]))),n.getDocument().isNewLine(e)){var d=r.getNextLineIndent(c,a.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},d)}h&&r.autoOutdent(c,n,i.row)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(e,t){var n;(t.extendLeft||t.extendRight)&&((n=this.selection.getRange()).start.column-=t.extendLeft,n.end.column+=t.extendRight,this.selection.setRange(n),e||n.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((n=this.selection.getRange()).start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,"deletion",this,n,t);if(0===t.end.column){var s=n.getTextRange(t);if("\n"==s[s.length-1]){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var n,r,i=this.session.getLine(e.row);tt.toLowerCase()?1:0});var i=new f(0,0,0,0);for(r=e.first;r<=e.last;r++){var s=t.getLine(r);i.start.row=r,i.end.row=r,i.end.column=s.length,t.replace(i,n[r-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var r=this.session.getLine(e);n.lastIndex=t)return{value:i[0],start:i.index,end:i.index+i[0].length}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new f(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var s=this.getNumberAt(t,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,a=s.start+s.value.length-o,l=parseFloat(s.value);l*=Math.pow(10,a),o!==s.end&&n=a&&o<=l&&(n=t,u.selection.clearSelection(),u.moveCursorTo(e,a+r),u.selection.selectTo(e,l+r)),a=l});for(var c,h=this.$toggleWordPairs,d=0;df+1)break;f=p.last}for(c--,a=this.session.$moveLines(d,f,t?0:e),t&&-1==e&&(h=c+1);h<=c;)o[h].moveBy(a,0),h++;t||(a=0),l+=a}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);!0===t?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):!1===t&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,i*r.lineHeight),null!=t&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new v(this.session,n.row,n.column),i=r.getCurrentToken(),s=i||r.stepForward();if(s){var o,a,l=!1,u={},c=n.column-s.start,h={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;c=0;--s)this.$tryReplace(n[s],e)&&r++;return this.selection.setSelectionRange(i),r},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return null!==(t=this.$search.replace(n,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&r.mixin(t,e);var i=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(i)||this.$search.$options.needle)||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var s=this.$search.find(this.session);return t.preventScroll?s:s?(this.revealRange(s,n),s):(t.backwards?i.start=i.end:i.end=i.start,void this.selection.setRange(i))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(e){var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var s=this.on("changeSelection",function(){r=!0}),o=this.renderer.on("beforeRender",function(){r&&(t=n.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,s=e.$cursorLayer.$pixelPos,o=e.layerConfig,a=s.top-o.offset;null!=(r=s.top>=0&&a+t.top<0||!(s.topwindow.innerHeight)&&null)&&(i.style.top=a+"px",i.style.left=s.left+"px",i.style.height=o.lineHeight+"px",i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",o))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,i.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},this.prompt=function(e,t,n){var r=this;E.loadModule("./ext/prompt",function(i){i.prompt(r,e,t,n)})}}.call(D.prototype),E.defineOptions(D.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?S.attach(this):S.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?S.attach(this):S.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.renderer.$composition||this.getValue();if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),i.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!e&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),i.addCssClass(this.container,"ace_hasPlaceholder");var t=i.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var S={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=D}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,n){this.$fromUndo||e!=this.$lastDelta&&(!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,r=n.length;r--;){var i=n[r][0];if(i.id<=e)break;i.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?a(e):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(r.prototype);var i=e("./range").Range,s=i.comparePoints;function o(e){return{row:e.row,column:e.column}}function a(e){if(e=e||this,Array.isArray(e))return e.map(a).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function u(e,t){var n="insert"==e.action,r="insert"==t.action;if(n&&r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}else if(!n&&r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(!n&&!r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}return[t,e]}function c(e,t){for(var n=e.length;n--;)for(var r=0;r=0?d(e,t,-1):(s(e.start,t.start)<=0||d(e,i.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!n&&r)s(t.start,e.end)>=0?d(t,e,-1):(s(t.start,e.start)<=0||d(t,i.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{var o,a;if(!(s(t.end,e.start)<=0))return s(e.start,t.start)<0&&(o=e,e=p(e,t.start)),s(e.end,t.end)>0&&(a=p(e,t.end)),f(t.end,e.start,e.end,-1),a&&!o&&(e.lines=a.lines,e.start=a.start,e.end=a.end,a=e),[t,o,a].filter(Boolean);d(e,t,-1)}return[t,e]}function d(e,t,n){f(e.start,t.start,t.end,n),f(e.end,t.start,t.end,n)}function f(e,t,n,r){e.row==(1==r?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function p(e,t){var n=e.lines,r=e.end;e.end=o(t);var i=e.end.row-e.start.row,s=n.splice(i,n.length),a=i?t.column:t.column-e.start.column;return n.push(s[0].substring(0,a)),s[0]=s[0].substr(a),{start:o(t),end:r,lines:s,action:e.action}}function m(e,t){t=function(e){return{start:o(e.start),end:o(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var n=e.length;n--;){for(var r=e[n],i=0;is&&(l=i.end.row+1,s=(i=t.getNextFoldLine(l,i))?i.start.row:1/0),l>r){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,e,this.session,u),this.$lines.push(o)),this.$renderCell(o,e,i,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,i=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(i=t.getLength()+r-1);var s=n?n.getWidth(t,i,e):i.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();(s+=o.left+o.right)===this.gutterWidth||isNaN(s)||(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(r.row>this.$cursorRow){var i=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&i&&i.start.row==t[n-1].row))break;r=t[n-1]}r.element.className="ace_gutter-active-line "+r.element.className,this.$cursorCell=r;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;if(this.oldLastRow=n,!t||r0;i--)this.$lines.shift();if(r>n)for(i=this.session.getFoldedRowCount(n+1,r);i>0;i--)this.$lines.pop();e.firstRowr&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,n){for(var r=[],i=t,s=this.session.getNextFoldLine(i),o=s?s.start.row:1/0;i>o&&(i=s.end.row+1,o=(s=this.session.getNextFoldLine(i,s))?s.start.row:1/0),!(i>n);){var a=this.$lines.createCell(i,e,this.session,u);this.$renderCell(a,e,s,i),r.push(a),i++}return r},this.$renderCell=function(e,t,n,i){var s=e.element,o=this.session,a=s.childNodes[0],l=s.childNodes[1],u=o.$firstLineNumber,c=o.$breakpoints,h=o.$decorations,d=o.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&o.foldWidgets,p=n?n.start.row:Number.MAX_VALUE,m="ace_gutter-cell ";if(this.$highlightGutterLine&&(i==this.$cursorRow||n&&i=p&&this.$cursorRow<=n.end.row)&&(m+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),c[i]&&(m+=c[i]),h[i]&&(m+=h[i]),this.$annotations[i]&&(m+=this.$annotations[i].className),s.className!=m&&(s.className=m),f){var g=f[i];null==g&&(g=f[i]=o.getFoldWidget(i))}if(g){m="ace_fold-widget ace_"+g,"start"==g&&i==p&&in.right-t.right?"foldWidgets":void 0}}).call(l.prototype),t.Gutter=l}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/dom"),s=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){function e(e,t,n,r){return(e?1:0)|(t?2:0)|(n?4:0)|(r?8:0)}this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},this.update=function(e){if(e){var t;for(var n in this.config=e,this.i=0,this.markers){var r=this.markers[n];if(r.range){var i=r.range.clipRows(e.firstRow,e.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),r.renderer){var s=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,s,e)}else"fullLine"==r.type?this.drawFullLineMarker(t,i,r.clazz,e):"screenLine"==r.type?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?"text"==r.type?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+" ace_start ace_br15",e)}else r.update(t,this,this.session,e)}if(-1!=this.i)for(;this.if,c==u),s,c==u?0:1,o)},this.drawMultiLineMarker=function(e,t,n,r,i){var s=this.$padding,o=r.lineHeight,a=this.$getTop(t.start.row,r),l=s+t.start.column*r.characterWidth;if(i=i||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((u=t.clone()).end.row=u.start.row,u.end.column=this.session.getLine(u.start.row).length,this.drawBidiSingleLineMarker(e,u,n+" ace_br1 ace_start",r,null,i)):this.elt(n+" ace_br1 ace_start","height:"+o+"px;right:0;top:"+a+"px;left:"+l+"px;"+(i||"")),this.session.$bidiHandler.isBidiRow(t.end.row)){var u;(u=t.clone()).start.row=u.end.row,u.start.column=0,this.drawBidiSingleLineMarker(e,u,n+" ace_br12",r,null,i)}else{a=this.$getTop(t.end.row,r);var c=t.end.column*r.characterWidth;this.elt(n+" ace_br12","height:"+o+"px;width:"+c+"px;top:"+a+"px;left:"+s+"px;"+(i||""))}if(!((o=(t.end.row-t.start.row-1)*r.lineHeight)<=0)){a=this.$getTop(t.start.row+1,r);var h=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+o+"px;right:0;top:"+a+"px;left:"+s+"px;"+(i||""))}},this.drawSingleLineMarker=function(e,t,n,r,i,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,i,s);var o=r.lineHeight,a=(t.end.column+(i||0)-t.start.column)*r.characterWidth,l=this.$getTop(t.start.row,r),u=this.$padding+t.start.column*r.characterWidth;this.elt(n,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+u+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(e,t,n,r,i,s){var o=r.lineHeight,a=this.$getTop(t.start.row,r),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(n,"height:"+o+"px;width:"+e.width+(i||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-s),this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))},this.drawScreenLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))}}).call(s.prototype),t.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=function(e){this.dom=i,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){r.implement(this,a),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;nc&&(a=l.end.row+1,c=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(a>i);){var h=s[o++];if(h){this.dom.removeChildren(h),this.$renderLine(h,a,a==c&&l),u&&(h.style.top=this.$lines.computeLineTop(a,e,this.session)+"px");var d=e.lineHeight*this.session.getRowLength(a)+"px";h.style.height!=d&&(u=!0,h.style.height=d)}a++}if(u)for(;o0;i--)this.$lines.shift();if(t.lastRow>e.lastRow)for(i=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);i>0;i--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,n){for(var r=[],s=t,o=this.session.getNextFoldLine(s),a=o?o.start.row:1/0;s>a&&(s=o.end.row+1,a=(o=this.session.getNextFoldLine(s,o))?o.start.row:1/0),!(s>n);){var l=this.$lines.createCell(s,e,this.session),u=l.element;this.dom.removeChildren(u),i.setStyle(u.style,"height",this.$lines.computeLineHeight(s,e,this.session)+"px"),i.setStyle(u.style,"top",this.$lines.computeLineTop(s,e,this.session)+"px"),this.$renderLine(u,s,s==a&&o),this.$useLineGroups()?u.className="ace_line_group":u.className="ace_line",r.push(l),s++}return r},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,n=e.lastRow,r=this.$lines;r.getLength();)r.pop();r.push(this.$renderLinesFragment(e,t,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,r){for(var i,o=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),u=0;i=a.exec(r);){var c=i[1],h=i[2],d=i[3],f=i[4],p=i[5];if(o.showInvisibles||!h){var m=u!=i.index?r.slice(u,i.index):"";if(u=i.index+i[0].length,m&&l.appendChild(this.dom.createTextNode(m,this.element)),c){var g=o.session.getScreenTabSize(t+i.index);l.appendChild(o.$tabStrings[g].cloneNode(!0)),t+=g-1}else h?o.showInvisibles?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",v.textContent=s.stringRepeat(o.SPACE_CHAR,h.length),l.appendChild(v)):l.appendChild(this.com.createTextNode(h,this.element)):d?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",v.textContent=s.stringRepeat(o.SPACE_CHAR,d.length),l.appendChild(v)):f?(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className=o.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",v.textContent=o.showInvisibles?o.SPACE_CHAR:f,l.appendChild(v)):p&&(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className="ace_cjk",v.textContent=p,l.appendChild(v))}}if(l.appendChild(this.dom.createTextNode(u?r.slice(u):r,this.element)),this.$textToken[n.type])e.appendChild(l);else{var E="ace_"+n.type.replace(/\./g," ace_"),v=this.dom.createElement("span");"fold"==n.type&&(v.style.width=n.value.length*this.config.characterWidth+"px"),v.className=E,v.appendChild(l),e.appendChild(v)}return t+r.length},this.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(" "==t[0]){for(var i=(r-=r%this.tabSize)/this.tabSize,s=0;s=o;)a=this.$renderToken(l,a,c,h.substring(0,o-r)),h=h.substring(o-r),r=o,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(s.stringRepeat(" ",n.indent),this.element)),a=0,o=n[++i]||Number.MAX_VALUE;0!=h.length&&(r+=h.length,a=this.$renderToken(l,a,c,h))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(e,t){var n=0,r=t[0],i=r.value;this.displayIndentGuides&&(i=this.renderIndentGuide(e,i)),i&&(n=this.$renderToken(e,n,r,i));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,r,i);n=this.$renderToken(e,n,r,i)}},this.$renderOverflowMessage=function(e,t,n,r,i){n&&this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=i?"":"",e.appendChild(s)},this.$renderLine=function(e,t,n){if(n||0==n||(n=this.session.getFoldLine(t)),n)var r=this.$getFoldLineTokens(t,n);else r=this.session.getTokens(t);var i=e;if(r.length){var s=this.session.getRowSplitData(t);s&&s.length?(this.$renderWrappedLine(e,r,s),i=e.lastChild):(i=e,this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i)),this.$renderSimpleLine(i,r))}else this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i));if(this.showInvisibles&&i){n&&(t=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,i.appendChild(o)}},this.$getFoldLineTokens=function(e,t){var n=this.session,r=[],i=n.getTokens(e);return t.walk(function(e,t,s,o,a){null!=e?r.push({type:"fold",value:e}):(a&&(i=n.getTokens(t)),i.length&&function(e,t,n){for(var i=0,s=0;s+e[i].value.lengthn-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),s=t+o.length,i+=1);sn?r.push({type:e[i].type,value:o.substring(0,n-s)}):r.push(e[i]),s+=o.length,i+=1}}(i,o,s))},t.end.row,this.session.getLine(t.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),t.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)r.setStyle(t[n].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){r.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){r.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&r.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}else this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||o.top<0)&&n>1)){var a=this.cursors[i++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,o,e,t[n],this.session):this.isCursorInView(o,e)?(r.setStyle(l,"display","block"),r.translate(a,o.left,o.top),r.setStyle(l,"width",Math.round(e.characterWidth)+"px"),r.setStyle(l,"height",e.lineHeight+"px")):r.setStyle(l,"display","none")}}for(;this.cursors.length>i;)this.removeCursor();var u=this.session.getOverwrite();this.$setOverwrite(u),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(i.prototype),t.Cursor=i}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,a=32768,l=function(e){this.element=i.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){r.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(l.prototype);var u=function(e,t){l.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=i.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};r.inherits(u,l),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>a?(this.coeff=a/e,e=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(u.prototype);var c=function(e,t){l.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};r.inherits(c,l),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(c.prototype),t.ScrollBar=u,t.ScrollBarV=u,t.ScrollBarH=c,t.VScrollBar=u,t.HScrollBar=c}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){"use strict";var r=e("./lib/event"),i=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(r.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(i.prototype),t.RenderLoop=i}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,u=256,c="function"==typeof ResizeObserver,h=200,d=t.FontMetrics=function(e){this.el=i.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.innerHTML=s.stringRepeat("X",u),this.$characterSize={width:0,height:0},c?this.$addObserver():this.checkForSizeChanges()};(function(){r.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){var n=t[0].contentRect;e.checkForSizeChanges({height:n.height,width:n.width/u})}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/u};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.innerHTML=s.stringRepeat(e,u),this.$main.getBoundingClientRect().width/u},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=i.buildDom([e(0,0),e(h,0),e(0,h),e(h,h)],this.el)},this.transformCoordinates=function(e,t){function n(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function r(e,t){return[e[0]-t[0],e[1]-t[1]]}function i(e,t){return[e[0]+t[0],e[1]+t[1]]}function s(e,t){return[e*t[0],e*t[1]]}function o(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=s(1/this.$getZoom(this.el),e)),this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),u=o(this.els[2]),c=o(this.els[3]),d=n(r(c,l),r(c,u),r(i(l,u),i(c,a))),f=s(1+d[0],r(l,a)),p=s(1+d[1],r(u,a));if(t){var m=t,g=d[0]*m[0]/h+d[1]*m[1]/h+1,E=i(s(m[0],f),s(m[1],p));return i(s(1/g/h,E),a)}var v=r(e,a),C=n(r(f,s(d[0],v)),r(p,s(d[1],v)),v);return s(h,C)}}).call(d.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./config"),o=e("./layer/gutter").Gutter,a=e("./layer/marker").Marker,l=e("./layer/text").Text,u=e("./layer/cursor").Cursor,c=e("./scrollbar").HScrollBar,h=e("./scrollbar").VScrollBar,d=e("./renderloop").RenderLoop,f=e("./layer/font_metrics").FontMetrics,p=e("./lib/event_emitter").EventEmitter,m='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);opacity: 0.7;transform-origin: left;text-indent: 10px;}',g=e("./lib/useragent"),E=g.isIE;i.importCssString(m,"ace_editor.css");var v=function(e,t){var n=this;this.container=e||i.createElement("div"),i.addCssClass(this.container,"ace_editor"),i.HI_DPI&&i.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=i.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=i.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=i.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var r=this.$textLayer=new l(this.content);this.canvas=r.element,this.$markerFront=new a(this.content),this.$cursorLayer=new u(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new f(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!g.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,p),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),i.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,n){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,r){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var i=this.container;r||(r=i.clientHeight||i.scrollHeight),n||(n=i.clientWidth||i.scrollWidth);var s=this.$updateCachedSize(e,t,n,r);if(!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var s=0,o=this.$size,a={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if(r&&(e||o.height!=r)&&(o.height=r,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL),n&&(e||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,i.setStyle(this.scrollBarH.element.style,"left",t+"px"),i.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),i.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";i.setStyle(this.scrollBarH.element.style,"right",l),i.setStyle(this.scroller.style,"right",l),i.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(s|=this.CHANGE_FULL)}return o.$dirty=!n||!r,s&&this._signal("resize",a),s},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=i.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=i.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var n=this.$cursorLayer.$pixelPos;if(n){t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var r=this.layerConfig,s=n.top,o=n.left;s-=r.offset;var a=t&&t.useTextareaForIME?this.lineHeight:E?0:1;if(s<0||s>r.height-a)i.translate(this.textarea,0,0);else{var l=1,u=this.$size.height-a;if(t)if(t.useTextareaForIME){var c=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(c)[0]}else s+=this.lineHeight+2;else s+=this.lineHeight;(o-=this.scrollLeft)>this.$size.scrollerWidth-l&&(o=this.$size.scrollerWidth-l),o+=this.gutterWidth+this.margin.left,i.setStyle(e,"height",a+"px"),i.setStyle(e,"width",l+"px"),i.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-l),Math.min(s,u))}}}else i.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},this.setMargin=function(e,t,n,r){var i=this.margin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),i.translate(this.content,-this.scrollLeft,-n.offset);var s=n.width+2*this.$padding+"px",o=n.minHeight+"px";i.setStyle(this.content.style,"width",s),i.setStyle(this.content.style,"height",o)}if(e&this.CHANGE_H_SCROLL&&(i.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender")}else this.$changes|=e},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=!(n<=2*this.lineHeight)&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||r!=this.$vScroll){r!=this.$vScroll&&(this.$vScroll=r,this.scrollBarV.setVisible(r));var i=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,i,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength()*this.lineHeight,i=this.$getLongestLine(),s=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-i-2*this.$padding<0),o=this.$horizScroll!==s;o&&(this.$horizScroll=s,this.scrollBarH.setVisible(s));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,u=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;r+=u;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,r-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,i+2*this.$padding-t.scrollerWidth+c.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-r+u<0||this.scrollTop>c.top),d=a!==h;d&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var f,p,m=this.scrollTop%this.lineHeight,g=Math.ceil(l/this.lineHeight)-1,E=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),v=E+g,C=this.lineHeight;E=e.screenToDocumentRow(E,0);var D=e.getFoldLine(E);D&&(E=D.start.row),f=e.documentToScreenRow(E,0),p=e.getRowLength(E)*C,v=Math.min(e.screenToDocumentRow(v,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(v)*C+p,m=this.scrollTop-f*C;var S=0;return(this.layerConfig.width!=i||o)&&(S=this.CHANGE_H_SCROLL),(o||d)&&(S|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(i=this.$getLongestLine())),this.layerConfig={width:i,padding:this.$padding,firstRow:E,firstRowScreen:f,lastRow:v,lineHeight:C,characterWidth:this.characterWidth,minHeight:l,maxHeight:r,offset:m,gutterOffset:C?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/C)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(i-this.$padding),S},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1||tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t,n){if(0!==this.$size.scrollerHeight){var r=this.$cursorLayer.getPixelPosition(e),i=r.left,s=r.top,o=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+o>s?(t&&l+o>s+this.lineHeight&&(s-=t*this.$size.scrollerHeight),0===s&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):l+this.$size.scrollerHeight-ai?(i=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:a,side:s-a>0?1:-1,offsetX:i}},this.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),a=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),i)},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),s=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+s-this.scrollTop}},this.visualizeFocus=function(){i.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){i.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),e.useTextareaForIME=this.$useTextareaForIME,this.$useTextareaForIME?(i.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),i.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText,this.$composition=null,this.$cursorLayer.element.style.display="")},this.addToken=function(e,t,n,r){var i=this.session;i.bgTokenizer.lines[n]=null;var s={type:t,value:e},o=i.getTokens(n);if(null==r)o.push(s);else for(var a=0,l=0;l50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,n){var r=null,i=!1,a=Object.create(s),u=[],c=new l({messageBuffer:u,terminate:function(){},postMessage:function(e){u.push(e),r&&(i?setTimeout(h):h())}});c.setEmitSync=function(e){i=e};var h=function(){var e=u.shift();e.command?r[e.command].apply(r,e.args):e.event&&a._signal(e.event,e.data)};return a.postMessage=function(e){c.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},o.loadModule(["worker",t],function(e){for(r=new e[n](a);u.length;)h()}),c},t.WorkerClient=l,t.createWorker=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(e,t,n,r,i,s){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,i),this.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,s=t.start.column-this.pos.column;if(this.updateAnchors(e),i&&(this.length+=n),i&&!this.session.$fromUndo)if("insert"===e.action)for(var o=this.others.length-1;o>=0;o--){var a={row:(l=this.others[o]).row,column:l.column+s};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(o=this.others.length-1;o>=0;o--){var l;a={row:(l=this.others[o]).row,column:l.column+s},this.doc.remove(new r(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,i){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),i,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)}},this.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new r,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{n=this.getRange();var r=this.isBackwards(),s=n.start.row,o=n.end.row;if(s==o){if(r)var a=n.end,l=n.start;else a=n.start,l=n.end;return this.addRange(i.fromPoints(l,l)),void this.addRange(i.fromPoints(a,a))}var u=[],c=this.getLineRange(s,!0);c.start.column=n.start.column,u.push(c);for(var h=s+1;h1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(r,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],s=e.column0;)E--;if(E>0)for(var v=0;r[v].isEmpty();)v++;for(var C=E;C>=v;C--)r[C].isEmpty()&&r.splice(C,1)}return r}}.call(s.prototype);var d=e("./editor").Editor;function f(e,t){return e.row==t.row&&e.column==t.column}function p(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",o),e.commands.addCommands(u.defaultCommands),function(e){if(e.textInput){var t=e.textInput.getElement(),n=!1;a.addListener(t,"keydown",function(t){var i=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&i?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&r()}),a.addListener(t,"keyup",r),a.addListener(t,"blur",r)}function r(t){n&&(e.renderer.setMouseCursor(""),n=!1)}}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var r=e[n];if(r.marker){this.session.removeMarker(r.marker);var i=t.indexOf(r);-1!=i&&t.splice(i,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(u.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(u.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?r=n.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?r=n.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});else{var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return r}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var r,i=n&&n.keepOrder,o=1==n||n&&n.$byLines,a=this.session,l=this.selection,u=l.rangeList,c=(i?l:u).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var h=l._eventRegistry;l._eventRegistry={};var d=new s(a);this.inVirtualSelectionMode=!0;for(var f=c.length;f--;){if(o)for(;f>0&&c[f].start.row==c[f-1].end.row;)f--;d.fromOrientedRange(c[f]),d.index=f,this.selection=a.selection=d;var p=e.exec?e.exec(this,t||{}):e(this,t||{});r||void 0===p||(r=p),d.toOrientedRange(c[f])}d.detach(),this.selection=a.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=h,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),r}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],r=0;ro&&(o=n.column),rc?e.insert(r,l.stringRepeat(" ",s-c)):e.remove(new i(r.row,r.column,r.row,r.column-s+c)),t.start.column=t.end.column=o,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var c=this.selection.getRange(),h=c.start.row,d=c.end.row,f=h==d;if(f){var p,m=this.session.getLength();do{p=this.session.getLine(d)}while(/[=:]/.test(p)&&++d0);h<0&&(h=0),d>=m&&(d=m-1)}var g=this.session.removeFullLines(h,d);g=this.$reAlignText(g,f),this.session.insert({row:h,column:0},g.join("\n")+"\n"),f||(c.start.column=0,c.end.column=g[g.length-1].length),this.selection.setRange(c)}},this.$reAlignText=function(e,t){var n,r,i,s=!0,o=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==n?(n=t[1].length,r=t[2].length,i=t[3].length,t):(n+r+i!=t[1].length+t[2].length+t[3].length&&(o=!1),n!=t[1].length&&(s=!1),n>t[1].length&&(n=t[1].length),rt[3].length&&(i=t[3].length),t):[e]}).map(t?u:s?o?function(e){return e[2]?a(n+r-e[2].length)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:u:function(e){return e[2]?a(n)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function a(e){return l.stringRepeat(" ",e)}function u(e){return e[2]?a(n)+e[2]+a(r-e[2].length+i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=p,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){p(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,s=e.getLine(t),o=s.search(i);if(-1!=o){for(var a=n||s.length,l=e.getLength(),u=t,c=t;++tu){var f=e.getLine(c).length;return new r(u,a,c,f)}}},this.openingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i+1},a=e.$findClosingBracket(t,o,s);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>o.row&&(a.row--,a.column=e.getLine(a.row).length),r.fromPoints(o,a)}},this.closingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i},a=e.$findOpeningBracket(t,o);if(a)return a.column++,o.column--,r.fromPoints(a,o)}}).call(i.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}e("./range").Range,function(){this.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(n&&e.action){for(var r=e.data,i=r.start.row,s=r.end.row,o="add"==e.action,a=i+1;a0&&!r[i];)i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=s;o++){var a=r[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var u=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(u-=t.scrollLeft),a.el.style.left=u+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}.call(i.prototype),t.LineWidgets=i}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,n){"use strict";var r=e("../line_widgets").LineWidgets,i=e("../lib/dom"),s=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var o=e.getCursorPosition(),a=o.row,l=n.widgetManager.getWidgetsAtRow(a).filter(function(e){return"errorMarker"==e.type})[0];l?l.destroy():a-=t;var u,c=function(e,t,n){var r=e.getAnnotations().sort(s.comparePoints);if(r.length){var i=function(e,t,n){for(var r=0,i=e.length-1;r<=i;){var s=r+i>>1,o=n(t,e[s]);if(o>0)r=s+1;else{if(!(o<0))return s;i=s-1}}return-(r+1)}(r,{row:t,column:-1},s.comparePoints);i<0&&(i=-i-1),i>=r.length?i=n>0?0:r.length-1:0===i&&n<0&&(i=r.length-1);var o=r[i];if(o&&n){if(o.row===t){do{o=r[i+=n]}while(o&&o.row===t);if(!o)return r.slice()}var a=[];t=o.row;do{a[n<0?"unshift":"push"](o),o=r[i+=n]}while(o&&o.row==t);return a.length&&a}}}(n,a,t);if(c){var h=c[0];o.column=(h.pos&&"number"!=typeof h.column?h.pos.sc:h.column)||0,o.row=h.row,u=e.renderer.$gutterLayer.$annotations[o.row]}else{if(l)return;u={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(o.row),e.selection.moveToPosition(o);var d={row:o.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},f=d.el.appendChild(i.createElement("div")),p=d.el.appendChild(i.createElement("div"));p.className="error_widget_arrow "+u.className;var m=e.renderer.$cursorLayer.getPixelPosition(o).left;p.style.left=m+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",f.className="error_widget "+u.className,f.innerHTML=u.text.join("
"),f.appendChild(i.createElement("div"));var g=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(g),n.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(g),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t,r){"use strict";e("./lib/fixoldbrowsers");var i=e("./lib/dom"),s=e("./lib/event"),o=e("./range").Range,a=e("./editor").Editor,l=e("./edit_session").EditSession,u=e("./undomanager").UndoManager,c=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,t.define=n.amdD,t.edit=function(e,n){if("string"==typeof e){var r=e;if(!(e=document.getElementById(r)))throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof a)return e.env.editor;var o="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;o=l.value,e=i.createElement("pre"),l.parentNode.replaceChild(e,l)}else e&&(o=e.textContent,e.innerHTML="");var u=t.createEditSession(o),h=new a(new c(e),u,n),d={document:u,editor:h,onResize:h.resize.bind(h,null)};return l&&(d.textarea=l),s.addListener(window,"resize",d.onResize),h.on("destroy",function(){s.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),h.container.env=h.env=d,h},t.createEditSession=function(e,t){var n=new l(e,t);return n.setUndoManager(new u),n},t.Range=o,t.Editor=a,t.EditSession=l,t.UndoManager=u,t.VirtualRenderer=c,t.version=t.config.version}),ace.require(["ace/ace"],function(t){for(var n in t&&(t.config.init(!0),t.define=ace.define),window.ace||(window.ace=t),t)t.hasOwnProperty(n)&&(window.ace[n]=t[n]);window.ace.default=window.ace,e&&(e.exports=window.ace)}),e.exports={ace}},247(e,t,n){"use strict";var r=n(982),i=n(159),s=n(961);function o(e){var t="https://react.dev/errors/"+e;if(1P||(e.current=M[P],M[P]=null,P--)}function $(e,t){P++,M[P]=e.current,e.current=t}var G,V,W=B(null),H=B(null),j=B(null),z=B(null);function X(e,t){switch($(j,t),$(H,e),$(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=Eh(t=gh(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(W),$(W,e)}function K(){U(W),U(H),U(j)}function Y(e){null!==e.memoizedState&&$(z,e);var t=W.current,n=Eh(t,e.type);t!==n&&($(H,e),$(W,n))}function q(e){H.current===e&&(U(W),U(H)),z.current===e&&(U(z),ud._currentValue=k)}function Q(e){if(void 0===G)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);G=t&&t[1]||"",V=-1)":-1--i||l[r]!==u[i]){var c="\n"+l[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}}while(1<=r&&0<=i);break}}}finally{Z=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Q(n):""}function ee(e,t){switch(e.tag){case 26:case 27:case 5:return Q(e.type);case 16:return Q("Lazy");case 13:return e.child!==t&&null!==t?Q("Suspense Fallback"):Q("Suspense");case 19:return Q("SuspenseList");case 0:case 15:return J(e.type,!1);case 11:return J(e.type.render,!1);case 1:return J(e.type,!0);case 31:return Q("Activity");default:return""}}function te(e){try{var t="",n=null;do{t+=ee(e,n),n=e,e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var ne=Object.prototype.hasOwnProperty,re=r.unstable_scheduleCallback,ie=r.unstable_cancelCallback,se=r.unstable_shouldYield,oe=r.unstable_requestPaint,ae=r.unstable_now,le=r.unstable_getCurrentPriorityLevel,ue=r.unstable_ImmediatePriority,ce=r.unstable_UserBlockingPriority,he=r.unstable_NormalPriority,de=r.unstable_LowPriority,fe=r.unstable_IdlePriority,pe=r.log,me=r.unstable_setDisableYieldValue,ge=null,Ee=null;function ve(e){if("function"==typeof pe&&me(e),Ee&&"function"==typeof Ee.setStrictMode)try{Ee.setStrictMode(ge,e)}catch(e){}}var Ce=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(De(e)/Se|0)|0},De=Math.log,Se=Math.LN2,Ae=256,_e=262144,ye=4194304;function be(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Te(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var i=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var a=134217727&r;return 0!==a?0!==(r=a&~s)?i=be(r):0!==(o&=a)?i=be(o):n||0!==(n=a&~e)&&(i=be(n)):0!==(a=r&~s)?i=be(a):0!==o?i=be(o):n||0!==(n=r&~e)&&(i=be(n)),0===i?0:0!==t&&t!==i&&0===(t&s)&&((s=i&-i)>=(n=t&-t)||32===s&&4194048&n)?t:i}function Re(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function we(){var e=ye;return!(62914560&(ye<<=1))&&(ye=4194304),e}function Fe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ne(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Le(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ce(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function Oe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ce(n),i=1<=bn),xn=String.fromCharCode(32),wn=!1;function Fn(e,t){switch(e){case"keyup":return-1!==_n.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Ln=!1,On={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function In(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!On[e.type]:"textarea"===t}function kn(e,t,n,r){It?kt?kt.push(r):kt=[r]:It=r,0<(t=nh(t,"onChange")).length&&(n=new tn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Mn=null,Pn=null;function Bn(e){Kc(e,0)}function Un(e){if(ft(Qe(e)))return e}function $n(e,t){if("change"===e)return t}var Gn=!1;if($t){var Vn;if($t){var Wn="oninput"in document;if(!Wn){var Hn=document.createElement("div");Hn.setAttribute("oninput","return;"),Wn="function"==typeof Hn.oninput}Vn=Wn}else Vn=!1;Gn=Vn&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Jn(r)}}function tr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?tr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function nr(e){for(var t=pt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=pt((e=t.contentWindow).document)}return t}function rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var ir=$t&&"documentMode"in document&&11>=document.documentMode,sr=null,or=null,ar=null,lr=!1;function ur(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;lr||null==sr||sr!==pt(r)||(r="selectionStart"in(r=sr)&&rr(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},ar&&Zn(ar,r)||(ar=r,0<(r=nh(or,"onSelect")).length&&(t=new tn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=sr)))}function cr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var hr={animationend:cr("Animation","AnimationEnd"),animationiteration:cr("Animation","AnimationIteration"),animationstart:cr("Animation","AnimationStart"),transitionrun:cr("Transition","TransitionRun"),transitionstart:cr("Transition","TransitionStart"),transitioncancel:cr("Transition","TransitionCancel"),transitionend:cr("Transition","TransitionEnd")},dr={},fr={};function pr(e){if(dr[e])return dr[e];if(!hr[e])return e;var t,n=hr[e];for(t in n)if(n.hasOwnProperty(t)&&t in fr)return dr[e]=n[t];return e}$t&&(fr=document.createElement("div").style,"AnimationEvent"in window||(delete hr.animationend.animation,delete hr.animationiteration.animation,delete hr.animationstart.animation),"TransitionEvent"in window||delete hr.transitionend.transition);var mr=pr("animationend"),gr=pr("animationiteration"),Er=pr("animationstart"),vr=pr("transitionrun"),Cr=pr("transitionstart"),Dr=pr("transitioncancel"),Sr=pr("transitionend"),Ar=new Map,_r="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function yr(e,t){Ar.set(e,t),nt(t,[e])}_r.push("scrollEnd");var br="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Tr=[],Rr=0,xr=0;function wr(){for(var e=Rr,t=xr=Rr=0;t>=o,i-=o,ti=1<<32-Ce(t)+i|n<p?(m=h,h=null):m=h.sibling;var g=f(i,h,a[p],l);if(null===g){null===h&&(h=m);break}e&&h&&null===g.alternate&&t(i,h),o=s(g,o,p),null===c?u=g:c.sibling=g,c=g,h=m}if(p===a.length)return n(i,h),ci&&ri(i,p),u;if(null===h){for(;pm?(g=p,p=null):g=p.sibling;var C=f(i,p,v.value,u);if(null===C){null===p&&(p=g);break}e&&p&&null===C.alternate&&t(i,p),a=s(C,a,m),null===h?c=C:h.sibling=C,h=C,p=g}if(v.done)return n(i,p),ci&&ri(i,m),c;if(null===p){for(;!v.done;m++,v=l.next())null!==(v=d(i,v.value,u))&&(a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return ci&&ri(i,m),c}for(p=r(p);!v.done;m++,v=l.next())null!==(v=E(p,i,m,v.value,u))&&(e&&null!==v.alternate&&p.delete(null===v.key?m:v.key),a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return e&&p.forEach(function(e){return t(i,e)}),ci&&ri(i,m),c}(l,u,c=C.call(c),h)}if("function"==typeof c.then)return v(l,u,ls(c),h);if(c.$$typeof===D)return v(l,u,Li(l,c),h);cs(l,c)}return"string"==typeof c&&""!==c||"number"==typeof c||"bigint"==typeof c?(c=""+c,null!==u&&6===u.tag?(n(l,u.sibling),(h=i(u,c)).return=l,l=h):(n(l,u),(h=Wr(c,l.mode,h)).return=l,l=h),a(l)):n(l,u)}return function(e,t,n,r){try{as=0;var i=v(e,t,n,r);return os=null,i}catch(t){if(t===qi||t===Zi)throw t;var s=Pr(29,t,null,e.mode);return s.lanes=r,s.return=e,s}}}var ds=hs(!0),fs=hs(!1),ps=!1;function ms(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Es(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vs(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&du){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ir(e),Or(e,null,n),t}return Fr(e,r,t,n),Ir(e)}function Cs(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Oe(e,n)}}function Ds(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===s?i=s=o:s=s.next=o,n=n.next}while(null!==n);null===s?i=s=t:s=s.next=t}else i=s=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ss=!1;function As(){if(Ss&&null!==Wi)throw Wi}function _s(e,t,n,r){Ss=!1;var i=e.updateQueue;ps=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var l=a,u=l.next;l.next=null,null===o?s=u:o.next=u,o=l;var c=e.alternate;null!==c&&(a=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===a?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l)}if(null!==s){var h=i.baseState;for(o=0,c=u=l=null,a=s;;){var f=-536870913&a.lane,p=f!==a.lane;if(p?(mu&f)===f:(r&f)===f){0!==f&&f===Vi&&(Ss=!0),null!==c&&(c=c.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var m=e,g=a;f=t;var E=n;switch(g.tag){case 1:if("function"==typeof(m=g.payload)){h=m.call(E,h,f);break e}h=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(f="function"==typeof(m=g.payload)?m.call(E,h,f):m))break e;h=d({},h,f);break e;case 2:ps=!0}}null!==(f=a.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=i.callbacks)?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===c?(u=c=p,l=h):c=c.next=p,o|=f;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(p=a).next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}null===c&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null===s&&(i.shared.lanes=0),_u|=o,e.lanes=o,e.memoizedState=h}}function ys(e,t){if("function"!=typeof e)throw Error(o(191,e));e.call(t)}function bs(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;es?s:8;var o,a,l,u=O.T,c={};O.T=c,ca(e,!1,t,n);try{var h=i(),d=O.S;null!==d&&d(c,h),null!==h&&"object"==typeof h&&"function"==typeof h.then?ua(e,t,(o=r,a=[],l={status:"pending",value:null,reason:null,then:function(e){a.push(e)}},h.then(function(){l.status="fulfilled",l.value=o;for(var e=0;e<\/script>",s=s.removeChild(s.firstChild);break;case"select":s="string"==typeof r.is?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s="string"==typeof r.is?a.createElement(i,{is:r.is}):a.createElement(i)}}s[$e]=t,s[Ge]=r;e:for(a=t.child;null!==a;){if(5===a.tag||6===a.tag)s.appendChild(a.stateNode);else if(4!==a.tag&&27!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;null===a.sibling;){if(null===a.return||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=s;e:switch(hh(s,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&ol(t)}}return hl(t),al(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&ol(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));if(e=j.current,Ei(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(i=li))switch(i.tag){case 27:case 5:r=i.memoizedProps}e[$e]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||lh(e.nodeValue,n)))||pi(t,!0)}else(e=mh(e).createTextNode(r))[$e]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(r=Ei(t),null!==n){if(null===e){if(!r)throw Error(o(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(o(557));e[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Ps(t),t):(Ps(t),null);if(128&t.flags)throw Error(o(558))}return hl(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=Ei(t),null!==r&&null!==r.dehydrated){if(null===e){if(!i)throw Error(o(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(o(317));i[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),i=!1}else i=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return 256&t.flags?(Ps(t),t):(Ps(t),null)}return Ps(t),128&t.flags?(t.lanes=n,t):(n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(i=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(i=r.alternate.memoizedState.cachePool.pool),s=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(s=r.memoizedState.cachePool.pool),s!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ul(t,t.updateQueue),hl(t),null);case 4:return K(),null===e&&Zc(t.stateNode.containerInfo),hl(t),null;case 10:return bi(t.type),hl(t),null;case 19:if(U(Bs),null===(r=t.memoizedState))return hl(t),null;if(i=!!(128&t.flags),null===(s=r.rendering))if(i)cl(r,!1);else{if(0!==Au||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(s=Us(e))){for(t.flags|=128,cl(r,!1),e=s.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)$r(n,e),n=n.sibling;return $(Bs,1&Bs.current|2),ci&&ri(t,r.treeForkCount),t.child}e=e.sibling}null!==r.tail&&ae()>Ou&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=Us(s))){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),cl(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!ci)return hl(t),null}else 2*ae()-r.renderingStartTime>Ou&&536870912!==n&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=r.last)?e.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ae(),e.sibling=null,n=Bs.current,$(Bs,i?1&n|2:1&n),ci&&ri(t,r.treeForkCount),e):(hl(t),null);case 22:case 23:return Ps(t),Fs(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?!!(536870912&n)&&!(128&t.flags)&&(hl(t),6&t.subtreeFlags&&(t.flags|=8192)):hl(t),null!==(n=t.updateQueue)&&ul(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&U(zi),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),bi(Pi),hl(t),null;case 25:case 30:return null}throw Error(o(156,t.tag))}function fl(e,t){switch(oi(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return bi(Pi),K(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return q(t),null;case 31:if(null!==t.memoizedState){if(Ps(t),null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Ps(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return U(Bs),null;case 4:return K(),null;case 10:return bi(t.type),null;case 22:case 23:return Ps(t),Fs(),null!==e&&U(zi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return bi(Pi),null;default:return null}}function pl(e,t){switch(oi(t),t.tag){case 3:bi(Pi),K();break;case 26:case 27:case 5:q(t);break;case 4:K();break;case 31:null!==t.memoizedState&&Ps(t);break;case 13:Ps(t);break;case 19:U(Bs);break;case 10:bi(t.type);break;case 22:case 23:Ps(t),Fs(),null!==e&&U(zi);break;case 24:bi(Pi)}}function ml(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var s=n.create,o=n.inst;r=s(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ac(t,t.return,e)}}function gl(e,t,n){try{var r=t.updateQueue,i=null!==r?r.lastEffect:null;if(null!==i){var s=i.next;r=s;do{if((r.tag&e)===e){var o=r.inst,a=o.destroy;if(void 0!==a){o.destroy=void 0,i=t;var l=n,u=a;try{u()}catch(e){Ac(i,l,e)}}}r=r.next}while(r!==s)}}catch(e){Ac(t,t.return,e)}}function El(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{bs(t,n)}catch(t){Ac(e,e.return,t)}}}function vl(e,t,n){n.props=Aa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ac(e,t,n)}}function Cl(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(n){Ac(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(n){Ac(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){Ac(e,t,n)}else n.current=null}function Sl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ac(e,e.return,t)}}function Al(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,a=null,l=null,u=null,c=null,h=null;for(p in n){var d=n[p];if(n.hasOwnProperty(p)&&null!=d)switch(p){case"checked":case"value":break;case"defaultValue":u=d;default:r.hasOwnProperty(p)||uh(e,t,p,null,r,d)}}for(var f in r){var p=r[f];if(d=n[f],r.hasOwnProperty(f)&&(null!=p||null!=d))switch(f){case"type":s=p;break;case"name":i=p;break;case"checked":c=p;break;case"defaultChecked":h=p;break;case"value":a=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(o(137,t));break;default:p!==d&&uh(e,t,f,p,r,d)}}return void Et(e,a,l,u,c,h,s,i);case"select":for(s in p=a=l=f=null,n)if(u=n[s],n.hasOwnProperty(s)&&null!=u)switch(s){case"value":break;case"multiple":p=u;default:r.hasOwnProperty(s)||uh(e,t,s,null,r,u)}for(i in r)if(s=r[i],u=n[i],r.hasOwnProperty(i)&&(null!=s||null!=u))switch(i){case"value":f=s;break;case"defaultValue":l=s;break;case"multiple":a=s;default:s!==u&&uh(e,t,i,s,r,u)}return t=l,n=a,r=p,void(null!=f?Dt(e,!!n,f,!1):!!r!=!!n&&(null!=t?Dt(e,!!n,t,!0):Dt(e,!!n,n?[]:"",!1)));case"textarea":for(l in p=f=null,n)if(i=n[l],n.hasOwnProperty(l)&&null!=i&&!r.hasOwnProperty(l))switch(l){case"value":case"children":break;default:uh(e,t,l,null,r,i)}for(a in r)if(i=r[a],s=n[a],r.hasOwnProperty(a)&&(null!=i||null!=s))switch(a){case"value":f=i;break;case"defaultValue":p=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(o(91));break;default:i!==s&&uh(e,t,a,i,r,s)}return void St(e,f,p);case"option":for(var m in n)f=n[m],n.hasOwnProperty(m)&&null!=f&&!r.hasOwnProperty(m)&&("selected"===m?e.selected=!1:uh(e,t,m,null,r,f));for(u in r)f=r[u],p=n[u],!r.hasOwnProperty(u)||f===p||null==f&&null==p||("selected"===u?e.selected=f&&"function"!=typeof f&&"symbol"!=typeof f:uh(e,t,u,f,r,p));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)f=n[g],n.hasOwnProperty(g)&&null!=f&&!r.hasOwnProperty(g)&&uh(e,t,g,null,r,f);for(c in r)if(f=r[c],p=n[c],r.hasOwnProperty(c)&&f!==p&&(null!=f||null!=p))switch(c){case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(o(137,t));break;default:uh(e,t,c,f,r,p)}return;default:if(Rt(t)){for(var E in n)f=n[E],n.hasOwnProperty(E)&&void 0!==f&&!r.hasOwnProperty(E)&&ch(e,t,E,void 0,r,f);for(h in r)f=r[h],p=n[h],!r.hasOwnProperty(h)||f===p||void 0===f&&void 0===p||ch(e,t,h,f,r,p);return}}for(var v in n)f=n[v],n.hasOwnProperty(v)&&null!=f&&!r.hasOwnProperty(v)&&uh(e,t,v,null,r,f);for(d in r)f=r[d],p=n[d],!r.hasOwnProperty(d)||f===p||null==f&&null==p||uh(e,t,d,f,r,p)}(r,e.type,n,t),r[Ge]=t}catch(t){Ac(e,e.return,t)}}function _l(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&bh(e.type)||4===e.tag}function yl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||_l(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&bh(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function bl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Nt));else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(bl(e,t,n),e=e.sibling;null!==e;)bl(e,t,n),e=e.sibling}function Tl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Tl(e,t,n),e=e.sibling;null!==e;)Tl(e,t,n),e=e.sibling}function Rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);hh(t,r,n),t[$e]=e,t[Ge]=n}catch(t){Ac(e,e.return,t)}}var xl=!1,wl=!1,Fl=!1,Nl="function"==typeof WeakSet?WeakSet:Set,Ll=null;function Ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Xl(e,n),4&r&&ml(5,n);break;case 1:if(Xl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){Ac(n,n.return,e)}else{var i=Aa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ac(n,n.return,e)}}64&r&&El(n),512&r&&Cl(n,n.return);break;case 3:if(Xl(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{bs(e,t)}catch(e){Ac(n,n.return,e)}}break;case 27:null===t&&4&r&&Rl(n);case 26:case 5:Xl(e,n),null===t&&4&r&&Sl(n),512&r&&Cl(n,n.return);break;case 12:Xl(e,n);break;case 31:Xl(e,n),4&r&&Ul(e,n);break;case 13:Xl(e,n),4&r&&$l(e,n),64&r&&null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Tc.bind(null,n));break;case 22:if(!(r=null!==n.memoizedState||xl)){t=null!==t&&null!==t.memoizedState||wl,i=xl;var s=wl;xl=r,(wl=t)&&!s?Yl(e,n,!!(8772&n.subtreeFlags)):Xl(e,n),xl=i,wl=s}break;case 30:break;default:Xl(e,n)}}function Il(e){var t=e.alternate;null!==t&&(e.alternate=null,Il(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&Ke(t),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var kl=null,Ml=!1;function Pl(e,t,n){for(n=n.child;null!==n;)Bl(e,t,n),n=n.sibling}function Bl(e,t,n){if(Ee&&"function"==typeof Ee.onCommitFiberUnmount)try{Ee.onCommitFiberUnmount(ge,n)}catch(e){}switch(n.tag){case 26:wl||Dl(n,t),Pl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:wl||Dl(n,t);var r=kl,i=Ml;bh(n.type)&&(kl=n.stateNode,Ml=!1),Pl(e,t,n),Ph(n.stateNode),kl=r,Ml=i;break;case 5:wl||Dl(n,t);case 6:if(r=kl,i=Ml,kl=null,Pl(e,t,n),Ml=i,null!==(kl=r))if(Ml)try{(9===kl.nodeType?kl.body:"HTML"===kl.nodeName?kl.ownerDocument.body:kl).removeChild(n.stateNode)}catch(e){Ac(n,t,e)}else try{kl.removeChild(n.stateNode)}catch(e){Ac(n,t,e)}break;case 18:null!==kl&&(Ml?(Th(9===(e=kl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Gd(e)):Th(kl,n.stateNode));break;case 4:r=kl,i=Ml,kl=n.stateNode.containerInfo,Ml=!0,Pl(e,t,n),kl=r,Ml=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),wl||gl(4,n,t),Pl(e,t,n);break;case 1:wl||(Dl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&vl(n,t,r)),Pl(e,t,n);break;case 21:Pl(e,t,n);break;case 22:wl=(r=wl)||null!==n.memoizedState,Pl(e,t,n),wl=r;break;default:Pl(e,t,n)}}function Ul(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)){e=e.dehydrated;try{Gd(e)}catch(e){Ac(t,t.return,e)}}}function $l(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{Gd(e)}catch(e){Ac(t,t.return,e)}}function Gl(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Nl),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Nl),t;default:throw Error(o(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Rc.bind(null,e,t);t.then(r,r)}})}function Vl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r title"))),hh(s,r,n),s[$e]=e,Je(s),r=s;break e;case"link":var a=td("link","href",i).get(r+(n.href||""));if(a)for(var l=0;la)break;var c=l.transferSize,h=l.initiatorType;c&&dh(h)&&(o+=c*((l=l.responseEnd)id?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}(h,p)))return Uu=s,e.cancelPendingCommit=p(pc.bind(null,e,t,s,n,r,i,o,a,l,c,h,null,d,f)),void Qu(e,s,o,!u)}pc(e,t,s,n,r,i,o,a,l)}function qu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var r=0;rg&&(o=g,g=m,m=o);var E=er(a,m),v=er(a,g);if(E&&v&&(1!==f.rangeCount||f.anchorNode!==E.node||f.anchorOffset!==E.offset||f.focusNode!==v.node||f.focusOffset!==v.offset)){var C=h.createRange();C.setStart(E.node,E.offset),f.removeAllRanges(),m>g?(f.addRange(C),f.extend(v.node,v.offset)):(C.setEnd(v.node,v.offset),f.addRange(C))}}}}for(h=[],f=a;f=f.parentNode;)1===f.nodeType&&h.push({element:f,left:f.scrollLeft,top:f.scrollTop});for("function"==typeof a.focus&&a.focus(),a=0;an?32:n,O.T=null,n=Gu,Gu=null;var s=Pu,a=Uu;if(Mu=0,Bu=Pu=null,Uu=0,6&du)throw Error(o(331));var l=du;if(du|=4,au(s.current),Jl(s,s.current,a,n),du=l,kc(0,!1),Ee&&"function"==typeof Ee.onPostCommitFiberRoot)try{Ee.onPostCommitFiberRoot(ge,s)}catch(e){}return!0}finally{I.p=i,O.T=r,vc(e,t)}}function Sc(e,t,n){t=Xr(n,t),null!==(e=vs(e,t=xa(e.stateNode,t,2),2))&&(Ne(e,2),Ic(e))}function Ac(e,t,n){if(3===e.tag)Sc(e,e,n);else for(;null!==t;){if(3===t.tag){Sc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===ku||!ku.has(r))){e=Xr(n,e),null!==(r=vs(t,n=wa(2),2))&&(Fa(n,r,t,e),Ne(r,2),Ic(r));break}}t=t.return}}function _c(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hu;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(Du=!0,i.add(n),e=yc.bind(null,e,t,n),t.then(e,e))}function yc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,fu===e&&(mu&n)===n&&(4===Au||3===Au&&(62914560&mu)===mu&&300>ae()-Nu?!(2&du)&&ec(e,0):bu|=n,Ru===mu&&(Ru=0)),Ic(e)}function bc(e,t){0===t&&(t=we()),null!==(e=Lr(e,t))&&(Ne(e,t),Ic(e))}function Tc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),bc(e,n)}function Rc(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}null!==r&&r.delete(t),bc(e,n)}var xc=null,wc=null,Fc=!1,Nc=!1,Lc=!1,Oc=0;function Ic(e){e!==wc&&null===e.next&&(null===wc?xc=wc=e:wc=wc.next=e),Nc=!0,Fc||(Fc=!0,_h(function(){6&du?re(ue,Mc):Pc()}))}function kc(e,t){if(!Lc&&Nc){Lc=!0;do{for(var n=!1,r=xc;null!==r;){if(!t)if(0!==e){var i=r.pendingLanes;if(0===i)var s=0;else{var o=r.suspendedLanes,a=r.pingedLanes;s=(1<<31-Ce(42|e)+1)-1,s=201326741&(s&=i&~(o&~a))?201326741&s|1:s?2|s:0}0!==s&&(n=!0,$c(r,s))}else s=mu,!(3&(s=Te(r,r===fu?s:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Re(r,s)||(n=!0,$c(r,s));r=r.next}}while(n);Lc=!1}}function Mc(){Pc()}function Pc(){Nc=Fc=!1;var e,t=0;0!==Oc&&((e=window.event)&&"popstate"===e.type?e!==Ch&&(Ch=e,1):(Ch=null,0))&&(t=Oc);for(var n=ae(),r=null,i=xc;null!==i;){var s=i.next,o=Bc(i,n);0===o?(i.next=null,null===r?xc=s:r.next=s,null===s&&(wc=r)):(r=i,(0!==t||3&o)&&(Nc=!0)),i=s}0!==Mu&&5!==Mu||kc(t,!1),0!==Oc&&(Oc=0)}function Bc(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=-62914561&e.pendingLanes;0 title"):null)}function rd(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var id=0;function sd(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)ad(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var od=null;function ad(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,od=new Map,t.forEach(ld,e),od=null,sd.call(e))}function ld(e,t){if(!(4&t.state.loading)){var n=od.get(e);if(n)var r=n.get(null);else{n=new Map,od.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s>>1,i=e[r];if(!(0>>1;rs(l,n))us(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[a]=n,r=a);else{if(!(us(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var u=[],c=[],h=1,d=null,f=3,p=!1,m=!1,g=!1,E=!1,v="function"==typeof setTimeout?setTimeout:null,C="function"==typeof clearTimeout?clearTimeout:null,D="undefined"!=typeof setImmediate?setImmediate:null;function S(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function A(e){if(g=!1,S(e),!m)if(null!==r(u))m=!0,y||(y=!0,_());else{var t=r(c);null!==t&&L(A,t.startTime-e)}}var _,y=!1,b=-1,T=5,R=-1;function x(){return!(!E&&t.unstable_now()-Re&&x());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var a=o(d.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof a){d.callback=a,S(e),n=!0;break t}d===r(u)&&i(u),S(e)}else i(u);d=r(u)}if(null!==d)n=!0;else{var l=r(c);null!==l&&L(A,l.startTime-e),n=!1}}break e}finally{d=null,f=s,p=!1}n=void 0}}finally{n?_():y=!1}}}if("function"==typeof D)_=function(){D(w)};else if("undefined"!=typeof MessageChannel){var F=new MessageChannel,N=F.port2;F.port1.onmessage=w,_=function(){N.postMessage(null)}}else _=function(){v(w,0)};function L(e,n){b=v(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125o?(e.sortIndex=s,n(c,e),null===r(u)&&e===r(c)&&(g?(C(b),b=-1):g=!0,L(A,s-o))):(e.sortIndex=a,n(u,e),m||p||(m=!0,y||(y=!0,_()))),e},t.unstable_shouldYield=x,t.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}},982(e,t,n){"use strict";e.exports=n(477)},902(e,t,n){"use strict";var r=n(72),i=n.n(r),s=n(825),o=n.n(s),a=n(659),l=n.n(a),u=n(56),c=n.n(u),h=n(540),d=n.n(h),f=n(113),p=n.n(f),m=n(636),g={};g.styleTagTransform=p(),g.setAttributes=c(),g.insert=l().bind(null,"html"),g.domAPI=o(),g.insertStyleElement=d(),i()(m.A,g),m.A&&m.A.locals&&m.A.locals},72(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},878(e,t,n){"use strict";n.r(t),n.d(t,{EmbeddedFrontend:()=>Id,Spector:()=>kd});var r={};n.r(r),n.d(r,{LX:()=>Jo,ll:()=>ea});var i,s={};n.r(s),n.d(s,{SyntaxError:()=>Xc,parse:()=>Yc});class o{static isBuildableProgram(e){return!!e&&!!e[this.rebuildProgramFunctionName]}static rebuildProgram(e,t,n,r,i){this.isBuildableProgram(e)&&e[this.rebuildProgramFunctionName](t,n,r,i)}}o.rebuildProgramFunctionName="__SPECTOR_rebuildProgram",function(e){e[e.noLog=0]="noLog",e[e.error=1]="error",e[e.warning=2]="warning",e[e.info=3]="info"}(i||(i={}));class a{static error(e,...t){this.level>0&&console.error(e,t)}static warn(e,...t){this.level>1&&console.warn(e,t)}static info(e,...t){this.level>2&&console.log(e,t)}}a.level=i.warning;class l{constructor(){this.callbacks=[],this.counter=-1}add(e,t){return this.counter++,t&&(e=e.bind(t)),this.callbacks[this.counter]=e,this.counter}remove(e){delete this.callbacks[e]}clear(){this.callbacks={}}trigger(e){for(const t in this.callbacks)this.callbacks.hasOwnProperty(t)&&this.callbacks[t](e)}}class u{constructor(){if("undefined"!=typeof performance&&performance.now)this.nowFunction=()=>performance.now();else{const e=new Date;this.nowFunction=e.getTime.bind(e)}}static get now(){return u.instance.nowFunction()}}u.instance=new u;class c{constructor(e){this.options=e}appendAnalysis(e){e.analyses=e.analyses||[];const t=this.getAnalysis(e);e.analyses.push(t)}getAnalysis(e){const t={analyserName:this.analyserName};return this.appendToAnalysis(e,t),t}}class h extends c{get analyserName(){return h.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={};for(const t of e.commands)n[t.name]=n[t.name]||0,n[t.name]++;const r=Object.keys(n).map(e=>[e,n[e]]);r.sort((e,t)=>{const n=t[1]-e[1];return 0===n?e[0].localeCompare(t[0]):n});for(const e of r)t[e[0]]=e[1]}}h.analyserName="Commands";const d=["drawArrays","drawElements","drawArraysInstanced","drawArraysInstancedANGLE","drawElementsInstanced","drawElementsInstancedANGLE","drawRangeElements","multiDrawArraysWEBGL","multiDrawElementsWEBGL","multiDrawArraysInstancedWEBGL","multiDrawElementsInstancedWEBGL","multiDrawArraysInstancedBaseInstanceWEBGL","multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL","drawArraysInstancedBaseInstanceWEBGL","drawElementsInstancedBaseVertexBaseInstanceWEBGL"];class f extends c{get analyserName(){return f.analyserName}appendToAnalysis(e,t){if(e.commands){t.total=e.commands.length,t.draw=0,t.clear=0;for(const n of e.commands)"clear"===n.name?t.clear++:d.indexOf(n.name)>-1&&t.draw++}}}f.analyserName="CommandsSummary";class p{static isWebGlConstant(e){return null!==g[e]&&void 0!==g[e]}static stringifyWebGlConstant(e,t){if(null==e)return"";if(0===e){return this.zeroMeaningByCommand[t]||"0"}if(1===e){return this.oneMeaningByCommand[t]||"1"}const n=g[e];return n?n.name:e+""}}p.DEPTH_BUFFER_BIT={name:"DEPTH_BUFFER_BIT",value:256,description:"Passed to clear to clear the current depth buffer."},p.STENCIL_BUFFER_BIT={name:"STENCIL_BUFFER_BIT",value:1024,description:"Passed to clear to clear the current stencil buffer."},p.COLOR_BUFFER_BIT={name:"COLOR_BUFFER_BIT",value:16384,description:"Passed to clear to clear the current color buffer."},p.POINTS={name:"POINTS",value:0,description:"Passed to drawElements or drawArrays to draw single points."},p.LINES={name:"LINES",value:1,description:"Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it."},p.LINE_LOOP={name:"LINE_LOOP",value:2,description:"Passed to drawElements or drawArrays to draw lines. Each set of two vertices is treated as a separate line segment."},p.LINE_STRIP={name:"LINE_STRIP",value:3,description:"Passed to drawElements or drawArrays to draw a connected group of line segments from the first vertex to the last."},p.TRIANGLES={name:"TRIANGLES",value:4,description:"Passed to drawElements or drawArrays to draw triangles. Each set of three vertices creates a separate triangle."},p.TRIANGLE_STRIP={name:"TRIANGLE_STRIP",value:5,description:"Passed to drawElements or drawArrays to draw a connected group of triangles."},p.TRIANGLE_FAN={name:"TRIANGLE_FAN",value:6,description:"Passed to drawElements or drawArrays to draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan."},p.ZERO={name:"ZERO",value:0,description:"Passed to blendFunc or blendFuncSeparate to turn off a component."},p.ONE={name:"ONE",value:1,description:"Passed to blendFunc or blendFuncSeparate to turn on a component."},p.SRC_COLOR={name:"SRC_COLOR",value:768,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source elements color."},p.ONE_MINUS_SRC_COLOR={name:"ONE_MINUS_SRC_COLOR",value:769,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source elements color."},p.SRC_ALPHA={name:"SRC_ALPHA",value:770,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source's alpha."},p.ONE_MINUS_SRC_ALPHA={name:"ONE_MINUS_SRC_ALPHA",value:771,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source's alpha."},p.DST_ALPHA={name:"DST_ALPHA",value:772,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's alpha."},p.ONE_MINUS_DST_ALPHA={name:"ONE_MINUS_DST_ALPHA",value:773,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's alpha."},p.DST_COLOR={name:"DST_COLOR",value:774,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's color."},p.ONE_MINUS_DST_COLOR={name:"ONE_MINUS_DST_COLOR",value:775,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's color."},p.SRC_ALPHA_SATURATE={name:"SRC_ALPHA_SATURATE",value:776,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the minimum of source's alpha or one minus the destination's alpha."},p.CONSTANT_COLOR={name:"CONSTANT_COLOR",value:32769,description:"Passed to blendFunc or blendFuncSeparate to specify a constant color blend function."},p.ONE_MINUS_CONSTANT_COLOR={name:"ONE_MINUS_CONSTANT_COLOR",value:32770,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant color blend function."},p.CONSTANT_ALPHA={name:"CONSTANT_ALPHA",value:32771,description:"Passed to blendFunc or blendFuncSeparate to specify a constant alpha blend function."},p.ONE_MINUS_CONSTANT_ALPHA={name:"ONE_MINUS_CONSTANT_ALPHA",value:32772,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant alpha blend function."},p.FUNC_ADD={name:"FUNC_ADD",value:32774,description:"Passed to blendEquation or blendEquationSeparate to set an addition blend function."},p.FUNC_SUBSTRACT={name:"FUNC_SUBSTRACT",value:32778,description:"Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination)."},p.FUNC_REVERSE_SUBTRACT={name:"FUNC_REVERSE_SUBTRACT",value:32779,description:"Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source)."},p.BLEND_EQUATION={name:"BLEND_EQUATION",value:32777,description:"Passed to getParameter to get the current RGB blend function."},p.BLEND_EQUATION_RGB={name:"BLEND_EQUATION_RGB",value:32777,description:"Passed to getParameter to get the current RGB blend function. Same as BLEND_EQUATION"},p.BLEND_EQUATION_ALPHA={name:"BLEND_EQUATION_ALPHA",value:34877,description:"Passed to getParameter to get the current alpha blend function. Same as BLEND_EQUATION"},p.BLEND_DST_RGB={name:"BLEND_DST_RGB",value:32968,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_SRC_RGB={name:"BLEND_SRC_RGB",value:32969,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_DST_ALPHA={name:"BLEND_DST_ALPHA",value:32970,description:"Passed to getParameter to get the current destination alpha blend function."},p.BLEND_SRC_ALPHA={name:"BLEND_SRC_ALPHA",value:32971,description:"Passed to getParameter to get the current source alpha blend function."},p.BLEND_COLOR={name:"BLEND_COLOR",value:32773,description:"Passed to getParameter to return a the current blend color."},p.ARRAY_BUFFER_BINDING={name:"ARRAY_BUFFER_BINDING",value:34964,description:"Passed to getParameter to get the array buffer binding."},p.ELEMENT_ARRAY_BUFFER_BINDING={name:"ELEMENT_ARRAY_BUFFER_BINDING",value:34965,description:"Passed to getParameter to get the current element array buffer."},p.LINE_WIDTH={name:"LINE_WIDTH",value:2849,description:"Passed to getParameter to get the current lineWidth (set by the lineWidth method)."},p.ALIASED_POINT_SIZE_RANGE={name:"ALIASED_POINT_SIZE_RANGE",value:33901,description:"Passed to getParameter to get the current size of a point drawn with gl.POINTS"},p.ALIASED_LINE_WIDTH_RANGE={name:"ALIASED_LINE_WIDTH_RANGE",value:33902,description:"Passed to getParameter to get the range of available widths for a line. Returns a length-2 array with the lo value at 0, and hight at 1."},p.CULL_FACE_MODE={name:"CULL_FACE_MODE",value:2885,description:"Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK"},p.FRONT_FACE={name:"FRONT_FACE",value:2886,description:"Passed to getParameter to determine the current value of frontFace. Should return CW or CCW."},p.DEPTH_RANGE={name:"DEPTH_RANGE",value:2928,description:"Passed to getParameter to return a length-2 array of floats giving the current depth range."},p.DEPTH_WRITEMASK={name:"DEPTH_WRITEMASK",value:2930,description:"Passed to getParameter to determine if the depth write mask is enabled."},p.DEPTH_CLEAR_VALUE={name:"DEPTH_CLEAR_VALUE",value:2931,description:"Passed to getParameter to determine the current depth clear value."},p.DEPTH_FUNC={name:"DEPTH_FUNC",value:2932,description:"Passed to getParameter to get the current depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_CLEAR_VALUE={name:"STENCIL_CLEAR_VALUE",value:2961,description:"Passed to getParameter to get the value the stencil will be cleared to."},p.STENCIL_FUNC={name:"STENCIL_FUNC",value:2962,description:"Passed to getParameter to get the current stencil function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_FAIL={name:"STENCIL_FAIL",value:2964,description:"Passed to getParameter to get the current stencil fail function. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_FAIL={name:"STENCIL_PASS_DEPTH_FAIL",value:2965,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test fail. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_PASS={name:"STENCIL_PASS_DEPTH_PASS",value:2966,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test pass. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_REF={name:"STENCIL_REF",value:2967,description:"Passed to getParameter to get the reference value used for stencil tests."},p.STENCIL_VALUE_MASK={name:"STENCIL_VALUE_MASK",value:2963,description:" "},p.STENCIL_WRITEMASK={name:"STENCIL_WRITEMASK",value:2968,description:" "},p.STENCIL_BACK_FUNC={name:"STENCIL_BACK_FUNC",value:34816,description:" "},p.STENCIL_BACK_FAIL={name:"STENCIL_BACK_FAIL",value:34817,description:" "},p.STENCIL_BACK_PASS_DEPTH_FAIL={name:"STENCIL_BACK_PASS_DEPTH_FAIL",value:34818,description:" "},p.STENCIL_BACK_PASS_DEPTH_PASS={name:"STENCIL_BACK_PASS_DEPTH_PASS",value:34819,description:" "},p.STENCIL_BACK_REF={name:"STENCIL_BACK_REF",value:36003,description:" "},p.STENCIL_BACK_VALUE_MASK={name:"STENCIL_BACK_VALUE_MASK",value:36004,description:" "},p.STENCIL_BACK_WRITEMASK={name:"STENCIL_BACK_WRITEMASK",value:36005,description:" "},p.VIEWPORT={name:"VIEWPORT",value:2978,description:"Returns an Int32Array with four elements for the current viewport dimensions."},p.SCISSOR_BOX={name:"SCISSOR_BOX",value:3088,description:"Returns an Int32Array with four elements for the current scissor box dimensions."},p.COLOR_CLEAR_VALUE={name:"COLOR_CLEAR_VALUE",value:3106,description:" "},p.COLOR_WRITEMASK={name:"COLOR_WRITEMASK",value:3107,description:" "},p.UNPACK_ALIGNMENT={name:"UNPACK_ALIGNMENT",value:3317,description:" "},p.PACK_ALIGNMENT={name:"PACK_ALIGNMENT",value:3333,description:" "},p.MAX_TEXTURE_SIZE={name:"MAX_TEXTURE_SIZE",value:3379,description:" "},p.MAX_VIEWPORT_DIMS={name:"MAX_VIEWPORT_DIMS",value:3386,description:" "},p.SUBPIXEL_BITS={name:"SUBPIXEL_BITS",value:3408,description:" "},p.RED_BITS={name:"RED_BITS",value:3410,description:" "},p.GREEN_BITS={name:"GREEN_BITS",value:3411,description:" "},p.BLUE_BITS={name:"BLUE_BITS",value:3412,description:" "},p.ALPHA_BITS={name:"ALPHA_BITS",value:3413,description:" "},p.DEPTH_BITS={name:"DEPTH_BITS",value:3414,description:" "},p.STENCIL_BITS={name:"STENCIL_BITS",value:3415,description:" "},p.POLYGON_OFFSET_UNITS={name:"POLYGON_OFFSET_UNITS",value:10752,description:" "},p.POLYGON_OFFSET_FACTOR={name:"POLYGON_OFFSET_FACTOR",value:32824,description:" "},p.TEXTURE_BINDING_2D={name:"TEXTURE_BINDING_2D",value:32873,description:" "},p.SAMPLE_BUFFERS={name:"SAMPLE_BUFFERS",value:32936,description:" "},p.SAMPLES={name:"SAMPLES",value:32937,description:" "},p.SAMPLE_COVERAGE_VALUE={name:"SAMPLE_COVERAGE_VALUE",value:32938,description:" "},p.SAMPLE_COVERAGE_INVERT={name:"SAMPLE_COVERAGE_INVERT",value:32939,description:" "},p.COMPRESSED_TEXTURE_FORMATS={name:"COMPRESSED_TEXTURE_FORMATS",value:34467,description:" "},p.VENDOR={name:"VENDOR",value:7936,description:" "},p.RENDERER={name:"RENDERER",value:7937,description:" "},p.VERSION={name:"VERSION",value:7938,description:" "},p.IMPLEMENTATION_COLOR_READ_TYPE={name:"IMPLEMENTATION_COLOR_READ_TYPE",value:35738,description:" "},p.IMPLEMENTATION_COLOR_READ_FORMAT={name:"IMPLEMENTATION_COLOR_READ_FORMAT",value:35739,description:" "},p.BROWSER_DEFAULT_WEBGL={name:"BROWSER_DEFAULT_WEBGL",value:37444,description:" "},p.STATIC_DRAW={name:"STATIC_DRAW",value:35044,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and not change often."},p.STREAM_DRAW={name:"STREAM_DRAW",value:35040,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to not be used often."},p.DYNAMIC_DRAW={name:"DYNAMIC_DRAW",value:35048,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and change often."},p.ARRAY_BUFFER={name:"ARRAY_BUFFER",value:34962,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.ELEMENT_ARRAY_BUFFER={name:"ELEMENT_ARRAY_BUFFER",value:34963,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.BUFFER_SIZE={name:"BUFFER_SIZE",value:34660,description:"Passed to getBufferParameter to get a buffer's size."},p.BUFFER_USAGE={name:"BUFFER_USAGE",value:34661,description:"Passed to getBufferParameter to get the hint for the buffer passed in when it was created."},p.CURRENT_VERTEX_ATTRIB={name:"CURRENT_VERTEX_ATTRIB",value:34342,description:"Passed to getVertexAttrib to read back the current vertex attribute."},p.VERTEX_ATTRIB_ARRAY_ENABLED={name:"VERTEX_ATTRIB_ARRAY_ENABLED",value:34338,description:" "},p.VERTEX_ATTRIB_ARRAY_SIZE={name:"VERTEX_ATTRIB_ARRAY_SIZE",value:34339,description:" "},p.VERTEX_ATTRIB_ARRAY_STRIDE={name:"VERTEX_ATTRIB_ARRAY_STRIDE",value:34340,description:" "},p.VERTEX_ATTRIB_ARRAY_TYPE={name:"VERTEX_ATTRIB_ARRAY_TYPE",value:34341,description:" "},p.VERTEX_ATTRIB_ARRAY_NORMALIZED={name:"VERTEX_ATTRIB_ARRAY_NORMALIZED",value:34922,description:" "},p.VERTEX_ATTRIB_ARRAY_POINTER={name:"VERTEX_ATTRIB_ARRAY_POINTER",value:34373,description:" "},p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING={name:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",value:34975,description:" "},p.CULL_FACE={name:"CULL_FACE",value:2884,description:"Passed to enable/disable to turn on/off culling. Can also be used with getParameter to find the current culling method."},p.FRONT={name:"FRONT",value:1028,description:"Passed to cullFace to specify that only front faces should be drawn."},p.BACK={name:"BACK",value:1029,description:"Passed to cullFace to specify that only back faces should be drawn."},p.FRONT_AND_BACK={name:"FRONT_AND_BACK",value:1032,description:"Passed to cullFace to specify that front and back faces should be drawn."},p.BLEND={name:"BLEND",value:3042,description:"Passed to enable/disable to turn on/off blending. Can also be used with getParameter to find the current blending method."},p.DEPTH_TEST={name:"DEPTH_TEST",value:2929,description:"Passed to enable/disable to turn on/off the depth test. Can also be used with getParameter to query the depth test."},p.DITHER={name:"DITHER",value:3024,description:"Passed to enable/disable to turn on/off dithering. Can also be used with getParameter to find the current dithering method."},p.POLYGON_OFFSET_FILL={name:"POLYGON_OFFSET_FILL",value:32823,description:"Passed to enable/disable to turn on/off the polygon offset. Useful for rendering hidden-line images, decals, and or solids with highlighted edges. Can also be used with getParameter to query the scissor test."},p.SAMPLE_ALPHA_TO_COVERAGE={name:"SAMPLE_ALPHA_TO_COVERAGE",value:32926,description:"Passed to enable/disable to turn on/off the alpha to coverage. Used in multi-sampling alpha channels."},p.SAMPLE_COVERAGE={name:"SAMPLE_COVERAGE",value:32928,description:"Passed to enable/disable to turn on/off the sample coverage. Used in multi-sampling."},p.SCISSOR_TEST={name:"SCISSOR_TEST",value:3089,description:"Passed to enable/disable to turn on/off the scissor test. Can also be used with getParameter to query the scissor test."},p.STENCIL_TEST={name:"STENCIL_TEST",value:2960,description:"Passed to enable/disable to turn on/off the stencil test. Can also be used with getParameter to query the stencil test."},p.NO_ERROR={name:"NO_ERROR",value:0,description:"Returned from getError."},p.INVALID_ENUM={name:"INVALID_ENUM",value:1280,description:"Returned from getError."},p.INVALID_VALUE={name:"INVALID_VALUE",value:1281,description:"Returned from getError."},p.INVALID_OPERATION={name:"INVALID_OPERATION",value:1282,description:"Returned from getError."},p.OUT_OF_MEMORY={name:"OUT_OF_MEMORY",value:1285,description:"Returned from getError."},p.CONTEXT_LOST_WEBGL={name:"CONTEXT_LOST_WEBGL",value:37442,description:"Returned from getError."},p.CW={name:"CW",value:2304,description:"Passed to frontFace to specify the front face of a polygon is drawn in the clockwise direction"},p.CCW={name:"CCW",value:2305,description:"Passed to frontFace to specify the front face of a polygon is drawn in the counter clockwise direction"},p.DONT_CARE={name:"DONT_CARE",value:4352,description:"There is no preference for this behavior."},p.FASTEST={name:"FASTEST",value:4353,description:"The most efficient behavior should be used."},p.NICEST={name:"NICEST",value:4354,description:"The most correct or the highest quality option should be used."},p.GENERATE_MIPMAP_HINT={name:"GENERATE_MIPMAP_HINT",value:33170,description:"Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap()."},p.BYTE={name:"BYTE",value:5120,description:" "},p.UNSIGNED_BYTE={name:"UNSIGNED_BYTE",value:5121,description:" "},p.SHORT={name:"SHORT",value:5122,description:" "},p.UNSIGNED_SHORT={name:"UNSIGNED_SHORT",value:5123,description:" "},p.INT={name:"INT",value:5124,description:" "},p.UNSIGNED_INT={name:"UNSIGNED_INT",value:5125,description:" "},p.FLOAT={name:"FLOAT",value:5126,description:" "},p.DEPTH_COMPONENT={name:"DEPTH_COMPONENT",value:6402,description:" "},p.ALPHA={name:"ALPHA",value:6406,description:" "},p.RGB={name:"RGB",value:6407,description:" "},p.RGBA={name:"RGBA",value:6408,description:" "},p.LUMINANCE={name:"LUMINANCE",value:6409,description:" "},p.LUMINANCE_ALPHA={name:"LUMINANCE_ALPHA",value:6410,description:" "},p.UNSIGNED_SHORT_4_4_4_4={name:"UNSIGNED_SHORT_4_4_4_4",value:32819,description:" "},p.UNSIGNED_SHORT_5_5_5_1={name:"UNSIGNED_SHORT_5_5_5_1",value:32820,description:" "},p.UNSIGNED_SHORT_5_6_5={name:"UNSIGNED_SHORT_5_6_5",value:33635,description:" "},p.FRAGMENT_SHADER={name:"FRAGMENT_SHADER",value:35632,description:"Passed to createShader to define a fragment shader."},p.VERTEX_SHADER={name:"VERTEX_SHADER",value:35633,description:"Passed to createShader to define a vertex shader"},p.COMPILE_STATUS={name:"COMPILE_STATUS",value:35713,description:"Passed to getShaderParamter to get the status of the compilation. Returns false if the shader was not compiled. You can then query getShaderInfoLog to find the exact error"},p.DELETE_STATUS={name:"DELETE_STATUS",value:35712,description:"Passed to getShaderParamter to determine if a shader was deleted via deleteShader. Returns true if it was, false otherwise."},p.LINK_STATUS={name:"LINK_STATUS",value:35714,description:"Passed to getProgramParameter after calling linkProgram to determine if a program was linked correctly. Returns false if there were errors. Use getProgramInfoLog to find the exact error."},p.VALIDATE_STATUS={name:"VALIDATE_STATUS",value:35715,description:"Passed to getProgramParameter after calling validateProgram to determine if it is valid. Returns false if errors were found."},p.ATTACHED_SHADERS={name:"ATTACHED_SHADERS",value:35717,description:"Passed to getProgramParameter after calling attachShader to determine if the shader was attached correctly. Returns false if errors occurred."},p.COMPLETION_STATUS_KHR={name:"COMPLETION_STATUS_KHR",value:37297,description:"Passed to getProgramParameter (KHR_parallel_shader_compile) to query whether an asynchronous shader/program link has completed. Returns true once the program is ready to use without blocking."},p.ACTIVE_ATTRIBUTES={name:"ACTIVE_ATTRIBUTES",value:35721,description:"Passed to getProgramParameter to get the number of attributes active in a program."},p.ACTIVE_UNIFORMS={name:"ACTIVE_UNIFORMS",value:35718,description:"Passed to getProgramParamter to get the number of uniforms active in a program."},p.MAX_VERTEX_ATTRIBS={name:"MAX_VERTEX_ATTRIBS",value:34921,description:" "},p.MAX_VERTEX_UNIFORM_VECTORS={name:"MAX_VERTEX_UNIFORM_VECTORS",value:36347,description:" "},p.MAX_VARYING_VECTORS={name:"MAX_VARYING_VECTORS",value:36348,description:" "},p.MAX_COMBINED_TEXTURE_IMAGE_UNITS={name:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",value:35661,description:" "},p.MAX_VERTEX_TEXTURE_IMAGE_UNITS={name:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",value:35660,description:" "},p.MAX_TEXTURE_IMAGE_UNITS={name:"MAX_TEXTURE_IMAGE_UNITS",value:34930,description:"Implementation dependent number of maximum texture units. At least 8."},p.MAX_FRAGMENT_UNIFORM_VECTORS={name:"MAX_FRAGMENT_UNIFORM_VECTORS",value:36349,description:" "},p.SHADER_TYPE={name:"SHADER_TYPE",value:35663,description:" "},p.SHADING_LANGUAGE_VERSION={name:"SHADING_LANGUAGE_VERSION",value:35724,description:" "},p.CURRENT_PROGRAM={name:"CURRENT_PROGRAM",value:35725,description:" "},p.NEVER={name:"NEVER",value:512,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn."},p.ALWAYS={name:"ALWAYS",value:519,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn."},p.LESS={name:"LESS",value:513,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value."},p.EQUAL={name:"EQUAL",value:514,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value."},p.LEQUAL={name:"LEQUAL",value:515,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value."},p.GREATER={name:"GREATER",value:516,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value."},p.GEQUAL={name:"GEQUAL",value:518,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value."},p.NOTEQUAL={name:"NOTEQUAL",value:517,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value."},p.KEEP={name:"KEEP",value:7680,description:" "},p.REPLACE={name:"REPLACE",value:7681,description:" "},p.INCR={name:"INCR",value:7682,description:" "},p.DECR={name:"DECR",value:7683,description:" "},p.INVERT={name:"INVERT",value:5386,description:" "},p.INCR_WRAP={name:"INCR_WRAP",value:34055,description:" "},p.DECR_WRAP={name:"DECR_WRAP",value:34056,description:" "},p.NEAREST={name:"NEAREST",value:9728,description:" "},p.LINEAR={name:"LINEAR",value:9729,description:" "},p.NEAREST_MIPMAP_NEAREST={name:"NEAREST_MIPMAP_NEAREST",value:9984,description:" "},p.LINEAR_MIPMAP_NEAREST={name:"LINEAR_MIPMAP_NEAREST",value:9985,description:" "},p.NEAREST_MIPMAP_LINEAR={name:"NEAREST_MIPMAP_LINEAR",value:9986,description:" "},p.LINEAR_MIPMAP_LINEAR={name:"LINEAR_MIPMAP_LINEAR",value:9987,description:" "},p.TEXTURE_MAG_FILTER={name:"TEXTURE_MAG_FILTER",value:10240,description:" "},p.TEXTURE_MIN_FILTER={name:"TEXTURE_MIN_FILTER",value:10241,description:" "},p.TEXTURE_WRAP_S={name:"TEXTURE_WRAP_S",value:10242,description:" "},p.TEXTURE_WRAP_T={name:"TEXTURE_WRAP_T",value:10243,description:" "},p.TEXTURE_2D={name:"TEXTURE_2D",value:3553,description:" "},p.TEXTURE={name:"TEXTURE",value:5890,description:" "},p.TEXTURE_CUBE_MAP={name:"TEXTURE_CUBE_MAP",value:34067,description:" "},p.TEXTURE_BINDING_CUBE_MAP={name:"TEXTURE_BINDING_CUBE_MAP",value:34068,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_X={name:"TEXTURE_CUBE_MAP_POSITIVE_X",value:34069,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_X={name:"TEXTURE_CUBE_MAP_NEGATIVE_X",value:34070,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Y={name:"TEXTURE_CUBE_MAP_POSITIVE_Y",value:34071,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Y={name:"TEXTURE_CUBE_MAP_NEGATIVE_Y",value:34072,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Z={name:"TEXTURE_CUBE_MAP_POSITIVE_Z",value:34073,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Z={name:"TEXTURE_CUBE_MAP_NEGATIVE_Z",value:34074,description:" "},p.MAX_CUBE_MAP_TEXTURE_SIZE={name:"MAX_CUBE_MAP_TEXTURE_SIZE",value:34076,description:" "},p.TEXTURE0={name:"TEXTURE0",value:33984,description:"A texture unit."},p.TEXTURE1={name:"TEXTURE1",value:33985,description:"A texture unit."},p.TEXTURE2={name:"TEXTURE2",value:33986,description:"A texture unit."},p.TEXTURE3={name:"TEXTURE3",value:33987,description:"A texture unit."},p.TEXTURE4={name:"TEXTURE4",value:33988,description:"A texture unit."},p.TEXTURE5={name:"TEXTURE5",value:33989,description:"A texture unit."},p.TEXTURE6={name:"TEXTURE6",value:33990,description:"A texture unit."},p.TEXTURE7={name:"TEXTURE7",value:33991,description:"A texture unit."},p.TEXTURE8={name:"TEXTURE8",value:33992,description:"A texture unit."},p.TEXTURE9={name:"TEXTURE9",value:33993,description:"A texture unit."},p.TEXTURE10={name:"TEXTURE10",value:33994,description:"A texture unit."},p.TEXTURE11={name:"TEXTURE11",value:33995,description:"A texture unit."},p.TEXTURE12={name:"TEXTURE12",value:33996,description:"A texture unit."},p.TEXTURE13={name:"TEXTURE13",value:33997,description:"A texture unit."},p.TEXTURE14={name:"TEXTURE14",value:33998,description:"A texture unit."},p.TEXTURE15={name:"TEXTURE15",value:33999,description:"A texture unit."},p.TEXTURE16={name:"TEXTURE16",value:34e3,description:"A texture unit."},p.TEXTURE17={name:"TEXTURE17",value:34001,description:"A texture unit."},p.TEXTURE18={name:"TEXTURE18",value:34002,description:"A texture unit."},p.TEXTURE19={name:"TEXTURE19",value:34003,description:"A texture unit."},p.TEXTURE20={name:"TEXTURE20",value:34004,description:"A texture unit."},p.TEXTURE21={name:"TEXTURE21",value:34005,description:"A texture unit."},p.TEXTURE22={name:"TEXTURE22",value:34006,description:"A texture unit."},p.TEXTURE23={name:"TEXTURE23",value:34007,description:"A texture unit."},p.TEXTURE24={name:"TEXTURE24",value:34008,description:"A texture unit."},p.TEXTURE25={name:"TEXTURE25",value:34009,description:"A texture unit."},p.TEXTURE26={name:"TEXTURE26",value:34010,description:"A texture unit."},p.TEXTURE27={name:"TEXTURE27",value:34011,description:"A texture unit."},p.TEXTURE28={name:"TEXTURE28",value:34012,description:"A texture unit."},p.TEXTURE29={name:"TEXTURE29",value:34013,description:"A texture unit."},p.TEXTURE30={name:"TEXTURE30",value:34014,description:"A texture unit."},p.TEXTURE31={name:"TEXTURE31",value:34015,description:"A texture unit."},p.ACTIVE_TEXTURE={name:"ACTIVE_TEXTURE",value:34016,description:"The current active texture unit."},p.REPEAT={name:"REPEAT",value:10497,description:" "},p.CLAMP_TO_EDGE={name:"CLAMP_TO_EDGE",value:33071,description:" "},p.MIRRORED_REPEAT={name:"MIRRORED_REPEAT",value:33648,description:" "},p.FLOAT_VEC2={name:"FLOAT_VEC2",value:35664,description:" "},p.FLOAT_VEC3={name:"FLOAT_VEC3",value:35665,description:" "},p.FLOAT_VEC4={name:"FLOAT_VEC4",value:35666,description:" "},p.INT_VEC2={name:"INT_VEC2",value:35667,description:" "},p.INT_VEC3={name:"INT_VEC3",value:35668,description:" "},p.INT_VEC4={name:"INT_VEC4",value:35669,description:" "},p.BOOL={name:"BOOL",value:35670,description:" "},p.BOOL_VEC2={name:"BOOL_VEC2",value:35671,description:" "},p.BOOL_VEC3={name:"BOOL_VEC3",value:35672,description:" "},p.BOOL_VEC4={name:"BOOL_VEC4",value:35673,description:" "},p.FLOAT_MAT2={name:"FLOAT_MAT2",value:35674,description:" "},p.FLOAT_MAT3={name:"FLOAT_MAT3",value:35675,description:" "},p.FLOAT_MAT4={name:"FLOAT_MAT4",value:35676,description:" "},p.SAMPLER_2D={name:"SAMPLER_2D",value:35678,description:" "},p.SAMPLER_CUBE={name:"SAMPLER_CUBE",value:35680,description:" "},p.LOW_FLOAT={name:"LOW_FLOAT",value:36336,description:" "},p.MEDIUM_FLOAT={name:"MEDIUM_FLOAT",value:36337,description:" "},p.HIGH_FLOAT={name:"HIGH_FLOAT",value:36338,description:" "},p.LOW_INT={name:"LOW_INT",value:36339,description:" "},p.MEDIUM_INT={name:"MEDIUM_INT",value:36340,description:" "},p.HIGH_INT={name:"HIGH_INT",value:36341,description:" "},p.FRAMEBUFFER={name:"FRAMEBUFFER",value:36160,description:" "},p.RENDERBUFFER={name:"RENDERBUFFER",value:36161,description:" "},p.RGBA4={name:"RGBA4",value:32854,description:" "},p.RGB5_A1={name:"RGB5_A1",value:32855,description:" "},p.RGB565={name:"RGB565",value:36194,description:" "},p.DEPTH_COMPONENT16={name:"DEPTH_COMPONENT16",value:33189,description:" "},p.STENCIL_INDEX={name:"STENCIL_INDEX",value:6401,description:" "},p.STENCIL_INDEX8={name:"STENCIL_INDEX8",value:36168,description:" "},p.DEPTH_STENCIL={name:"DEPTH_STENCIL",value:34041,description:" "},p.RENDERBUFFER_WIDTH={name:"RENDERBUFFER_WIDTH",value:36162,description:" "},p.RENDERBUFFER_HEIGHT={name:"RENDERBUFFER_HEIGHT",value:36163,description:" "},p.RENDERBUFFER_INTERNAL_FORMAT={name:"RENDERBUFFER_INTERNAL_FORMAT",value:36164,description:" "},p.RENDERBUFFER_RED_SIZE={name:"RENDERBUFFER_RED_SIZE",value:36176,description:" "},p.RENDERBUFFER_GREEN_SIZE={name:"RENDERBUFFER_GREEN_SIZE",value:36177,description:" "},p.RENDERBUFFER_BLUE_SIZE={name:"RENDERBUFFER_BLUE_SIZE",value:36178,description:" "},p.RENDERBUFFER_ALPHA_SIZE={name:"RENDERBUFFER_ALPHA_SIZE",value:36179,description:" "},p.RENDERBUFFER_DEPTH_SIZE={name:"RENDERBUFFER_DEPTH_SIZE",value:36180,description:" "},p.RENDERBUFFER_STENCIL_SIZE={name:"RENDERBUFFER_STENCIL_SIZE",value:36181,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",value:36048,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",value:36049,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",value:36050,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",value:36051,description:" "},p.COLOR_ATTACHMENT0={name:"COLOR_ATTACHMENT0",value:36064,description:" "},p.DEPTH_ATTACHMENT={name:"DEPTH_ATTACHMENT",value:36096,description:" "},p.STENCIL_ATTACHMENT={name:"STENCIL_ATTACHMENT",value:36128,description:" "},p.DEPTH_STENCIL_ATTACHMENT={name:"DEPTH_STENCIL_ATTACHMENT",value:33306,description:" "},p.NONE={name:"NONE",value:0,description:" "},p.FRAMEBUFFER_COMPLETE={name:"FRAMEBUFFER_COMPLETE",value:36053,description:" "},p.FRAMEBUFFER_INCOMPLETE_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",value:36054,description:" "},p.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",value:36055,description:" "},p.FRAMEBUFFER_INCOMPLETE_DIMENSIONS={name:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",value:36057,description:" "},p.FRAMEBUFFER_UNSUPPORTED={name:"FRAMEBUFFER_UNSUPPORTED",value:36061,description:" "},p.FRAMEBUFFER_BINDING={name:"FRAMEBUFFER_BINDING",value:36006,description:" "},p.RENDERBUFFER_BINDING={name:"RENDERBUFFER_BINDING",value:36007,description:" "},p.MAX_RENDERBUFFER_SIZE={name:"MAX_RENDERBUFFER_SIZE",value:34024,description:" "},p.INVALID_FRAMEBUFFER_OPERATION={name:"INVALID_FRAMEBUFFER_OPERATION",value:1286,description:" "},p.UNPACK_FLIP_Y_WEBGL={name:"UNPACK_FLIP_Y_WEBGL",value:37440,description:" "},p.UNPACK_PREMULTIPLY_ALPHA_WEBGL={name:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",value:37441,description:" "},p.UNPACK_COLORSPACE_CONVERSION_WEBGL={name:"UNPACK_COLORSPACE_CONVERSION_WEBGL",value:37443,description:" "},p.READ_BUFFER={name:"READ_BUFFER",value:3074,description:" "},p.UNPACK_ROW_LENGTH={name:"UNPACK_ROW_LENGTH",value:3314,description:" "},p.UNPACK_SKIP_ROWS={name:"UNPACK_SKIP_ROWS",value:3315,description:" "},p.UNPACK_SKIP_PIXELS={name:"UNPACK_SKIP_PIXELS",value:3316,description:" "},p.PACK_ROW_LENGTH={name:"PACK_ROW_LENGTH",value:3330,description:" "},p.PACK_SKIP_ROWS={name:"PACK_SKIP_ROWS",value:3331,description:" "},p.PACK_SKIP_PIXELS={name:"PACK_SKIP_PIXELS",value:3332,description:" "},p.TEXTURE_BINDING_3D={name:"TEXTURE_BINDING_3D",value:32874,description:" "},p.UNPACK_SKIP_IMAGES={name:"UNPACK_SKIP_IMAGES",value:32877,description:" "},p.UNPACK_IMAGE_HEIGHT={name:"UNPACK_IMAGE_HEIGHT",value:32878,description:" "},p.MAX_3D_TEXTURE_SIZE={name:"MAX_3D_TEXTURE_SIZE",value:32883,description:" "},p.MAX_ELEMENTS_VERTICES={name:"MAX_ELEMENTS_VERTICES",value:33e3,description:" "},p.MAX_ELEMENTS_INDICES={name:"MAX_ELEMENTS_INDICES",value:33001,description:" "},p.MAX_TEXTURE_LOD_BIAS={name:"MAX_TEXTURE_LOD_BIAS",value:34045,description:" "},p.MAX_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_FRAGMENT_UNIFORM_COMPONENTS",value:35657,description:" "},p.MAX_VERTEX_UNIFORM_COMPONENTS={name:"MAX_VERTEX_UNIFORM_COMPONENTS",value:35658,description:" "},p.MAX_ARRAY_TEXTURE_LAYERS={name:"MAX_ARRAY_TEXTURE_LAYERS",value:35071,description:" "},p.MIN_PROGRAM_TEXEL_OFFSET={name:"MIN_PROGRAM_TEXEL_OFFSET",value:35076,description:" "},p.MAX_PROGRAM_TEXEL_OFFSET={name:"MAX_PROGRAM_TEXEL_OFFSET",value:35077,description:" "},p.MAX_VARYING_COMPONENTS={name:"MAX_VARYING_COMPONENTS",value:35659,description:" "},p.FRAGMENT_SHADER_DERIVATIVE_HINT={name:"FRAGMENT_SHADER_DERIVATIVE_HINT",value:35723,description:" "},p.RASTERIZER_DISCARD={name:"RASTERIZER_DISCARD",value:35977,description:" "},p.VERTEX_ARRAY_BINDING={name:"VERTEX_ARRAY_BINDING",value:34229,description:" "},p.MAX_VERTEX_OUTPUT_COMPONENTS={name:"MAX_VERTEX_OUTPUT_COMPONENTS",value:37154,description:" "},p.MAX_FRAGMENT_INPUT_COMPONENTS={name:"MAX_FRAGMENT_INPUT_COMPONENTS",value:37157,description:" "},p.MAX_SERVER_WAIT_TIMEOUT={name:"MAX_SERVER_WAIT_TIMEOUT",value:37137,description:" "},p.MAX_ELEMENT_INDEX={name:"MAX_ELEMENT_INDEX",value:36203,description:" "},p.RED={name:"RED",value:6403,description:" "},p.RGB8={name:"RGB8",value:32849,description:" "},p.RGBA8={name:"RGBA8",value:32856,description:" "},p.RGB10_A2={name:"RGB10_A2",value:32857,description:" "},p.TEXTURE_3D={name:"TEXTURE_3D",value:32879,description:" "},p.TEXTURE_WRAP_R={name:"TEXTURE_WRAP_R",value:32882,description:" "},p.TEXTURE_MIN_LOD={name:"TEXTURE_MIN_LOD",value:33082,description:" "},p.TEXTURE_MAX_LOD={name:"TEXTURE_MAX_LOD",value:33083,description:" "},p.TEXTURE_BASE_LEVEL={name:"TEXTURE_BASE_LEVEL",value:33084,description:" "},p.TEXTURE_MAX_LEVEL={name:"TEXTURE_MAX_LEVEL",value:33085,description:" "},p.TEXTURE_COMPARE_MODE={name:"TEXTURE_COMPARE_MODE",value:34892,description:" "},p.TEXTURE_COMPARE_FUNC={name:"TEXTURE_COMPARE_FUNC",value:34893,description:" "},p.SRGB={name:"SRGB",value:35904,description:" "},p.SRGB8={name:"SRGB8",value:35905,description:" "},p.SRGB8_ALPHA8={name:"SRGB8_ALPHA8",value:35907,description:" "},p.COMPARE_REF_TO_TEXTURE={name:"COMPARE_REF_TO_TEXTURE",value:34894,description:" "},p.RGBA32F={name:"RGBA32F",value:34836,description:" "},p.RGB32F={name:"RGB32F",value:34837,description:" "},p.RGBA16F={name:"RGBA16F",value:34842,description:" "},p.RGB16F={name:"RGB16F",value:34843,description:" "},p.TEXTURE_2D_ARRAY={name:"TEXTURE_2D_ARRAY",value:35866,description:" "},p.TEXTURE_BINDING_2D_ARRAY={name:"TEXTURE_BINDING_2D_ARRAY",value:35869,description:" "},p.R11F_G11F_B10F={name:"R11F_G11F_B10F",value:35898,description:" "},p.RGB9_E5={name:"RGB9_E5",value:35901,description:" "},p.RGBA32UI={name:"RGBA32UI",value:36208,description:" "},p.RGB32UI={name:"RGB32UI",value:36209,description:" "},p.RGBA16UI={name:"RGBA16UI",value:36214,description:" "},p.RGB16UI={name:"RGB16UI",value:36215,description:" "},p.RGBA8UI={name:"RGBA8UI",value:36220,description:" "},p.RGB8UI={name:"RGB8UI",value:36221,description:" "},p.RGBA32I={name:"RGBA32I",value:36226,description:" "},p.RGB32I={name:"RGB32I",value:36227,description:" "},p.RGBA16I={name:"RGBA16I",value:36232,description:" "},p.RGB16I={name:"RGB16I",value:36233,description:" "},p.RGBA8I={name:"RGBA8I",value:36238,description:" "},p.RGB8I={name:"RGB8I",value:36239,description:" "},p.RED_INTEGER={name:"RED_INTEGER",value:36244,description:" "},p.RGB_INTEGER={name:"RGB_INTEGER",value:36248,description:" "},p.RGBA_INTEGER={name:"RGBA_INTEGER",value:36249,description:" "},p.R8={name:"R8",value:33321,description:" "},p.RG8={name:"RG8",value:33323,description:" "},p.R16F={name:"R16F",value:33325,description:" "},p.R32F={name:"R32F",value:33326,description:" "},p.RG16F={name:"RG16F",value:33327,description:" "},p.RG32F={name:"RG32F",value:33328,description:" "},p.R8I={name:"R8I",value:33329,description:" "},p.R8UI={name:"R8UI",value:33330,description:" "},p.R16I={name:"R16I",value:33331,description:" "},p.R16UI={name:"R16UI",value:33332,description:" "},p.R32I={name:"R32I",value:33333,description:" "},p.R32UI={name:"R32UI",value:33334,description:" "},p.RG8I={name:"RG8I",value:33335,description:" "},p.RG8UI={name:"RG8UI",value:33336,description:" "},p.RG16I={name:"RG16I",value:33337,description:" "},p.RG16UI={name:"RG16UI",value:33338,description:" "},p.RG32I={name:"RG32I",value:33339,description:" "},p.RG32UI={name:"RG32UI",value:33340,description:" "},p.R8_SNORM={name:"R8_SNORM",value:36756,description:" "},p.RG8_SNORM={name:"RG8_SNORM",value:36757,description:" "},p.RGB8_SNORM={name:"RGB8_SNORM",value:36758,description:" "},p.RGBA8_SNORM={name:"RGBA8_SNORM",value:36759,description:" "},p.RGB10_A2UI={name:"RGB10_A2UI",value:36975,description:" "},p.TEXTURE_IMMUTABLE_FORMAT={name:"TEXTURE_IMMUTABLE_FORMAT",value:37167,description:" "},p.TEXTURE_IMMUTABLE_LEVELS={name:"TEXTURE_IMMUTABLE_LEVELS",value:33503,description:" "},p.UNSIGNED_INT_2_10_10_10_REV={name:"UNSIGNED_INT_2_10_10_10_REV",value:33640,description:" "},p.UNSIGNED_INT_10F_11F_11F_REV={name:"UNSIGNED_INT_10F_11F_11F_REV",value:35899,description:" "},p.UNSIGNED_INT_5_9_9_9_REV={name:"UNSIGNED_INT_5_9_9_9_REV",value:35902,description:" "},p.FLOAT_32_UNSIGNED_INT_24_8_REV={name:"FLOAT_32_UNSIGNED_INT_24_8_REV",value:36269,description:" "},p.UNSIGNED_INT_24_8={name:"UNSIGNED_INT_24_8",value:34042,description:" "},p.HALF_FLOAT={name:"HALF_FLOAT",value:5131,description:" "},p.RG={name:"RG",value:33319,description:" "},p.RG_INTEGER={name:"RG_INTEGER",value:33320,description:" "},p.INT_2_10_10_10_REV={name:"INT_2_10_10_10_REV",value:36255,description:" "},p.CURRENT_QUERY={name:"CURRENT_QUERY",value:34917,description:" "},p.QUERY_RESULT={name:"QUERY_RESULT",value:34918,description:" "},p.QUERY_RESULT_AVAILABLE={name:"QUERY_RESULT_AVAILABLE",value:34919,description:" "},p.ANY_SAMPLES_PASSED={name:"ANY_SAMPLES_PASSED",value:35887,description:" "},p.ANY_SAMPLES_PASSED_CONSERVATIVE={name:"ANY_SAMPLES_PASSED_CONSERVATIVE",value:36202,description:" "},p.MAX_DRAW_BUFFERS={name:"MAX_DRAW_BUFFERS",value:34852,description:" "},p.DRAW_BUFFER0={name:"DRAW_BUFFER0",value:34853,description:" "},p.DRAW_BUFFER1={name:"DRAW_BUFFER1",value:34854,description:" "},p.DRAW_BUFFER2={name:"DRAW_BUFFER2",value:34855,description:" "},p.DRAW_BUFFER3={name:"DRAW_BUFFER3",value:34856,description:" "},p.DRAW_BUFFER4={name:"DRAW_BUFFER4",value:34857,description:" "},p.DRAW_BUFFER5={name:"DRAW_BUFFER5",value:34858,description:" "},p.DRAW_BUFFER6={name:"DRAW_BUFFER6",value:34859,description:" "},p.DRAW_BUFFER7={name:"DRAW_BUFFER7",value:34860,description:" "},p.DRAW_BUFFER8={name:"DRAW_BUFFER8",value:34861,description:" "},p.DRAW_BUFFER9={name:"DRAW_BUFFER9",value:34862,description:" "},p.DRAW_BUFFER10={name:"DRAW_BUFFER10",value:34863,description:" "},p.DRAW_BUFFER11={name:"DRAW_BUFFER11",value:34864,description:" "},p.DRAW_BUFFER12={name:"DRAW_BUFFER12",value:34865,description:" "},p.DRAW_BUFFER13={name:"DRAW_BUFFER13",value:34866,description:" "},p.DRAW_BUFFER14={name:"DRAW_BUFFER14",value:34867,description:" "},p.DRAW_BUFFER15={name:"DRAW_BUFFER15",value:34868,description:" "},p.MAX_COLOR_ATTACHMENTS={name:"MAX_COLOR_ATTACHMENTS",value:36063,description:" "},p.COLOR_ATTACHMENT1={name:"COLOR_ATTACHMENT1",value:36065,description:" "},p.COLOR_ATTACHMENT2={name:"COLOR_ATTACHMENT2",value:36066,description:" "},p.COLOR_ATTACHMENT3={name:"COLOR_ATTACHMENT3",value:36067,description:" "},p.COLOR_ATTACHMENT4={name:"COLOR_ATTACHMENT4",value:36068,description:" "},p.COLOR_ATTACHMENT5={name:"COLOR_ATTACHMENT5",value:36069,description:" "},p.COLOR_ATTACHMENT6={name:"COLOR_ATTACHMENT6",value:36070,description:" "},p.COLOR_ATTACHMENT7={name:"COLOR_ATTACHMENT7",value:36071,description:" "},p.COLOR_ATTACHMENT8={name:"COLOR_ATTACHMENT8",value:36072,description:" "},p.COLOR_ATTACHMENT9={name:"COLOR_ATTACHMENT9",value:36073,description:" "},p.COLOR_ATTACHMENT10={name:"COLOR_ATTACHMENT10",value:36074,description:" "},p.COLOR_ATTACHMENT11={name:"COLOR_ATTACHMENT11",value:36075,description:" "},p.COLOR_ATTACHMENT12={name:"COLOR_ATTACHMENT12",value:36076,description:" "},p.COLOR_ATTACHMENT13={name:"COLOR_ATTACHMENT13",value:36077,description:" "},p.COLOR_ATTACHMENT14={name:"COLOR_ATTACHMENT14",value:36078,description:" "},p.COLOR_ATTACHMENT15={name:"COLOR_ATTACHMENT15",value:36079,description:" "},p.SAMPLER_3D={name:"SAMPLER_3D",value:35679,description:" "},p.SAMPLER_2D_SHADOW={name:"SAMPLER_2D_SHADOW",value:35682,description:" "},p.SAMPLER_2D_ARRAY={name:"SAMPLER_2D_ARRAY",value:36289,description:" "},p.SAMPLER_2D_ARRAY_SHADOW={name:"SAMPLER_2D_ARRAY_SHADOW",value:36292,description:" "},p.SAMPLER_CUBE_SHADOW={name:"SAMPLER_CUBE_SHADOW",value:36293,description:" "},p.INT_SAMPLER_2D={name:"INT_SAMPLER_2D",value:36298,description:" "},p.INT_SAMPLER_3D={name:"INT_SAMPLER_3D",value:36299,description:" "},p.INT_SAMPLER_CUBE={name:"INT_SAMPLER_CUBE",value:36300,description:" "},p.INT_SAMPLER_2D_ARRAY={name:"INT_SAMPLER_2D_ARRAY",value:36303,description:" "},p.UNSIGNED_INT_SAMPLER_2D={name:"UNSIGNED_INT_SAMPLER_2D",value:36306,description:" "},p.UNSIGNED_INT_SAMPLER_3D={name:"UNSIGNED_INT_SAMPLER_3D",value:36307,description:" "},p.UNSIGNED_INT_SAMPLER_CUBE={name:"UNSIGNED_INT_SAMPLER_CUBE",value:36308,description:" "},p.UNSIGNED_INT_SAMPLER_2D_ARRAY={name:"UNSIGNED_INT_SAMPLER_2D_ARRAY",value:36311,description:" "},p.MAX_SAMPLES={name:"MAX_SAMPLES",value:36183,description:" "},p.SAMPLER_BINDING={name:"SAMPLER_BINDING",value:35097,description:" "},p.PIXEL_PACK_BUFFER={name:"PIXEL_PACK_BUFFER",value:35051,description:" "},p.PIXEL_UNPACK_BUFFER={name:"PIXEL_UNPACK_BUFFER",value:35052,description:" "},p.PIXEL_PACK_BUFFER_BINDING={name:"PIXEL_PACK_BUFFER_BINDING",value:35053,description:" "},p.PIXEL_UNPACK_BUFFER_BINDING={name:"PIXEL_UNPACK_BUFFER_BINDING",value:35055,description:" "},p.COPY_READ_BUFFER={name:"COPY_READ_BUFFER",value:36662,description:" "},p.COPY_WRITE_BUFFER={name:"COPY_WRITE_BUFFER",value:36663,description:" "},p.COPY_READ_BUFFER_BINDING={name:"COPY_READ_BUFFER_BINDING",value:36662,description:" "},p.COPY_WRITE_BUFFER_BINDING={name:"COPY_WRITE_BUFFER_BINDING",value:36663,description:" "},p.FLOAT_MAT2x3={name:"FLOAT_MAT2x3",value:35685,description:" "},p.FLOAT_MAT2x4={name:"FLOAT_MAT2x4",value:35686,description:" "},p.FLOAT_MAT3x2={name:"FLOAT_MAT3x2",value:35687,description:" "},p.FLOAT_MAT3x4={name:"FLOAT_MAT3x4",value:35688,description:" "},p.FLOAT_MAT4x2={name:"FLOAT_MAT4x2",value:35689,description:" "},p.FLOAT_MAT4x3={name:"FLOAT_MAT4x3",value:35690,description:" "},p.UNSIGNED_INT_VEC2={name:"UNSIGNED_INT_VEC2",value:36294,description:" "},p.UNSIGNED_INT_VEC3={name:"UNSIGNED_INT_VEC3",value:36295,description:" "},p.UNSIGNED_INT_VEC4={name:"UNSIGNED_INT_VEC4",value:36296,description:" "},p.UNSIGNED_NORMALIZED={name:"UNSIGNED_NORMALIZED",value:35863,description:" "},p.SIGNED_NORMALIZED={name:"SIGNED_NORMALIZED",value:36764,description:" "},p.VERTEX_ATTRIB_ARRAY_INTEGER={name:"VERTEX_ATTRIB_ARRAY_INTEGER",value:35069,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR={name:"VERTEX_ATTRIB_ARRAY_DIVISOR",value:35070,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_MODE={name:"TRANSFORM_FEEDBACK_BUFFER_MODE",value:35967,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",value:35968,description:" "},p.TRANSFORM_FEEDBACK_VARYINGS={name:"TRANSFORM_FEEDBACK_VARYINGS",value:35971,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_START={name:"TRANSFORM_FEEDBACK_BUFFER_START",value:35972,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_SIZE={name:"TRANSFORM_FEEDBACK_BUFFER_SIZE",value:35973,description:" "},p.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN={name:"TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",value:35976,description:" "},p.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",value:35978,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",value:35979,description:" "},p.INTERLEAVED_ATTRIBS={name:"INTERLEAVED_ATTRIBS",value:35980,description:" "},p.SEPARATE_ATTRIBS={name:"SEPARATE_ATTRIBS",value:35981,description:" "},p.TRANSFORM_FEEDBACK_BUFFER={name:"TRANSFORM_FEEDBACK_BUFFER",value:35982,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_BINDING={name:"TRANSFORM_FEEDBACK_BUFFER_BINDING",value:35983,description:" "},p.TRANSFORM_FEEDBACK={name:"TRANSFORM_FEEDBACK",value:36386,description:" "},p.TRANSFORM_FEEDBACK_PAUSED={name:"TRANSFORM_FEEDBACK_PAUSED",value:36387,description:" "},p.TRANSFORM_FEEDBACK_ACTIVE={name:"TRANSFORM_FEEDBACK_ACTIVE",value:36388,description:" "},p.TRANSFORM_FEEDBACK_BINDING={name:"TRANSFORM_FEEDBACK_BINDING",value:36389,description:" "},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",value:33296,description:" "},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",value:33297,description:" "},p.FRAMEBUFFER_ATTACHMENT_RED_SIZE={name:"FRAMEBUFFER_ATTACHMENT_RED_SIZE",value:33298,description:" "},p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE={name:"FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",value:33299,description:" "},p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE={name:"FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",value:33300,description:" "},p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE={name:"FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",value:33301,description:" "},p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE={name:"FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",value:33302,description:" "},p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE={name:"FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",value:33303,description:" "},p.FRAMEBUFFER_DEFAULT={name:"FRAMEBUFFER_DEFAULT",value:33304,description:" "},p.DEPTH24_STENCIL8={name:"DEPTH24_STENCIL8",value:35056,description:" "},p.DRAW_FRAMEBUFFER_BINDING={name:"DRAW_FRAMEBUFFER_BINDING",value:36006,description:" "},p.READ_FRAMEBUFFER={name:"READ_FRAMEBUFFER",value:36008,description:" "},p.DRAW_FRAMEBUFFER={name:"DRAW_FRAMEBUFFER",value:36009,description:" "},p.READ_FRAMEBUFFER_BINDING={name:"READ_FRAMEBUFFER_BINDING",value:36010,description:" "},p.RENDERBUFFER_SAMPLES={name:"RENDERBUFFER_SAMPLES",value:36011,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",value:36052,description:" "},p.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE={name:"FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",value:36182,description:" "},p.UNIFORM_BUFFER={name:"UNIFORM_BUFFER",value:35345,description:" "},p.UNIFORM_BUFFER_BINDING={name:"UNIFORM_BUFFER_BINDING",value:35368,description:" "},p.UNIFORM_BUFFER_START={name:"UNIFORM_BUFFER_START",value:35369,description:" "},p.UNIFORM_BUFFER_SIZE={name:"UNIFORM_BUFFER_SIZE",value:35370,description:" "},p.MAX_VERTEX_UNIFORM_BLOCKS={name:"MAX_VERTEX_UNIFORM_BLOCKS",value:35371,description:" "},p.MAX_FRAGMENT_UNIFORM_BLOCKS={name:"MAX_FRAGMENT_UNIFORM_BLOCKS",value:35373,description:" "},p.MAX_COMBINED_UNIFORM_BLOCKS={name:"MAX_COMBINED_UNIFORM_BLOCKS",value:35374,description:" "},p.MAX_UNIFORM_BUFFER_BINDINGS={name:"MAX_UNIFORM_BUFFER_BINDINGS",value:35375,description:" "},p.MAX_UNIFORM_BLOCK_SIZE={name:"MAX_UNIFORM_BLOCK_SIZE",value:35376,description:" "},p.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS={name:"MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",value:35377,description:" "},p.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",value:35379,description:" "},p.UNIFORM_BUFFER_OFFSET_ALIGNMENT={name:"UNIFORM_BUFFER_OFFSET_ALIGNMENT",value:35380,description:" "},p.ACTIVE_UNIFORM_BLOCKS={name:"ACTIVE_UNIFORM_BLOCKS",value:35382,description:" "},p.UNIFORM_TYPE={name:"UNIFORM_TYPE",value:35383,description:" "},p.UNIFORM_SIZE={name:"UNIFORM_SIZE",value:35384,description:" "},p.UNIFORM_BLOCK_INDEX={name:"UNIFORM_BLOCK_INDEX",value:35386,description:" "},p.UNIFORM_OFFSET={name:"UNIFORM_OFFSET",value:35387,description:" "},p.UNIFORM_ARRAY_STRIDE={name:"UNIFORM_ARRAY_STRIDE",value:35388,description:" "},p.UNIFORM_MATRIX_STRIDE={name:"UNIFORM_MATRIX_STRIDE",value:35389,description:" "},p.UNIFORM_IS_ROW_MAJOR={name:"UNIFORM_IS_ROW_MAJOR",value:35390,description:" "},p.UNIFORM_BLOCK_BINDING={name:"UNIFORM_BLOCK_BINDING",value:35391,description:" "},p.UNIFORM_BLOCK_DATA_SIZE={name:"UNIFORM_BLOCK_DATA_SIZE",value:35392,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORMS={name:"UNIFORM_BLOCK_ACTIVE_UNIFORMS",value:35394,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES={name:"UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",value:35395,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",value:35396,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",value:35398,description:" "},p.OBJECT_TYPE={name:"OBJECT_TYPE",value:37138,description:" "},p.SYNC_CONDITION={name:"SYNC_CONDITION",value:37139,description:" "},p.SYNC_STATUS={name:"SYNC_STATUS",value:37140,description:" "},p.SYNC_FLAGS={name:"SYNC_FLAGS",value:37141,description:" "},p.SYNC_FENCE={name:"SYNC_FENCE",value:37142,description:" "},p.SYNC_GPU_COMMANDS_COMPLETE={name:"SYNC_GPU_COMMANDS_COMPLETE",value:37143,description:" "},p.UNSIGNALED={name:"UNSIGNALED",value:37144,description:" "},p.SIGNALED={name:"SIGNALED",value:37145,description:" "},p.ALREADY_SIGNALED={name:"ALREADY_SIGNALED",value:37146,description:" "},p.TIMEOUT_EXPIRED={name:"TIMEOUT_EXPIRED",value:37147,description:" "},p.CONDITION_SATISFIED={name:"CONDITION_SATISFIED",value:37148,description:" "},p.WAIT_FAILED={name:"WAIT_FAILED",value:37149,description:" "},p.SYNC_FLUSH_COMMANDS_BIT={name:"SYNC_FLUSH_COMMANDS_BIT",value:1,description:" "},p.COLOR={name:"COLOR",value:6144,description:" "},p.DEPTH={name:"DEPTH",value:6145,description:" "},p.STENCIL={name:"STENCIL",value:6146,description:" "},p.MIN={name:"MIN",value:32775,description:" "},p.MAX={name:"MAX",value:32776,description:" "},p.DEPTH_COMPONENT24={name:"DEPTH_COMPONENT24",value:33190,description:" "},p.STREAM_READ={name:"STREAM_READ",value:35041,description:" "},p.STREAM_COPY={name:"STREAM_COPY",value:35042,description:" "},p.STATIC_READ={name:"STATIC_READ",value:35045,description:" "},p.STATIC_COPY={name:"STATIC_COPY",value:35046,description:" "},p.DYNAMIC_READ={name:"DYNAMIC_READ",value:35049,description:" "},p.DYNAMIC_COPY={name:"DYNAMIC_COPY",value:35050,description:" "},p.DEPTH_COMPONENT32F={name:"DEPTH_COMPONENT32F",value:36012,description:" "},p.DEPTH32F_STENCIL8={name:"DEPTH32F_STENCIL8",value:36013,description:" "},p.INVALID_INDEX={name:"INVALID_INDEX",value:4294967295,description:" "},p.TIMEOUT_IGNORED={name:"TIMEOUT_IGNORED",value:-1,description:" "},p.MAX_CLIENT_WAIT_TIMEOUT_WEBGL={name:"MAX_CLIENT_WAIT_TIMEOUT_WEBGL",value:37447,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE={name:"VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",value:35070,description:"Describes the frequency divisor used for instanced rendering.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_VENDOR_WEBGL={name:"UNMASKED_VENDOR_WEBGL",value:37445,description:"Passed to getParameter to get the vendor string of the graphics driver.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_RENDERER_WEBGL={name:"UNMASKED_RENDERER_WEBGL",value:37446,description:"Passed to getParameter to get the renderer string of the graphics driver.",extensionName:"WEBGL_debug_renderer_info"},p.MAX_TEXTURE_MAX_ANISOTROPY_EXT={name:"MAX_TEXTURE_MAX_ANISOTROPY_EXT",value:34047,description:"Returns the maximum available anisotropy.",extensionName:"EXT_texture_filter_anisotropic"},p.TEXTURE_MAX_ANISOTROPY_EXT={name:"TEXTURE_MAX_ANISOTROPY_EXT",value:34046,description:"Passed to texParameter to set the desired maximum anisotropy for a texture.",extensionName:"EXT_texture_filter_anisotropic"},p.COMPRESSED_RGB_S3TC_DXT1_EXT={name:"COMPRESSED_RGB_S3TC_DXT1_EXT",value:33776,description:"A DXT1-compressed image in an RGB image format.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT1_EXT={name:"COMPRESSED_RGBA_S3TC_DXT1_EXT",value:33777,description:"A DXT1-compressed image in an RGB image format with a simple on/off alpha value.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT3_EXT={name:"COMPRESSED_RGBA_S3TC_DXT3_EXT",value:33778,description:"A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT5_EXT={name:"COMPRESSED_RGBA_S3TC_DXT5_EXT",value:33779,description:"A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_R11_EAC={name:"COMPRESSED_R11_EAC",value:37488,description:"One-channel (red) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_R11_EAC={name:"COMPRESSED_SIGNED_R11_EAC",value:37489,description:"One-channel (red) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RG11_EAC={name:"COMPRESSED_RG11_EAC",value:37490,description:"Two-channel (red and green) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_RG11_EAC={name:"COMPRESSED_SIGNED_RG11_EAC",value:37491,description:"Two-channel (red and green) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_ETC2={name:"COMPRESSED_RGB8_ETC2",value:37492,description:"Compresses RBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGBA8_ETC2_EAC={name:"COMPRESSED_RGBA8_ETC2_EAC",value:37493,description:"Compresses RGBA8 data. The RGB part is encoded the same as RGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ETC2={name:"COMPRESSED_SRGB8_ETC2",value:37494,description:"Compresses sRBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC={name:"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",value:37495,description:"Compresses sRGBA8 data. The sRGB part is encoded the same as SRGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37496,description:"Similar to RGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37497,description:"Similar to SRGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_4BPPV1_IMG",value:35840,description:"RGB compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",value:35842,description:"RGBA compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_2BPPV1_IMG",value:35841,description:"RGB compression in 2-bit mode. One block for each 8×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",value:35843,description:"RGBA compression in 2-bit mode. One block for each 8×4 pixe",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_ETC1_WEBGL={name:"COMPRESSED_RGB_ETC1_WEBGL",value:36196,description:"Compresses 24-bit RGB data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc1"},p.COMPRESSED_RGB_ATC_WEBGL={name:"COMPRESSED_RGB_ATC_WEBGL",value:35986,description:"Compresses RGB textures with no alpha channel.",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",value:35986,description:"Compresses RGBA textures using explicit alpha encoding (useful when alpha transitions are sharp).",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",value:34798,description:"Compresses RGBA textures using interpolated alpha encoding (useful when alpha transitions are gradient).",extensionName:"WEBGL_compressed_texture_atc"},p.UNSIGNED_INT_24_8_WEBGL={name:"UNSIGNED_INT_24_8_WEBGL",value:34042,description:"Unsigned integer type for 24-bit depth texture data.",extensionName:"WEBGL_depth_texture"},p.HALF_FLOAT_OES={name:"HALF_FLOAT_OES",value:36193,description:"Half floating-point type (16-bit).",extensionName:"OES_texture_half_float"},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",value:33297,description:" ",extensionName:"WEBGL_color_buffer_float"},p.UNSIGNED_NORMALIZED_EXT={name:"UNSIGNED_NORMALIZED_EXT",value:35863,description:" ",extensionName:"WEBGL_color_buffer_float"},p.MIN_EXT={name:"MIN_EXT",value:32775,description:"Produces the minimum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.MAX_EXT={name:"MAX_EXT",value:32776,description:"Produces the maximum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.SRGB_EXT={name:"SRGB_EXT",value:35904,description:"Unsized sRGB format that leaves the precision up to the driver.",extensionName:"EXT_sRGB"},p.SRGB_ALPHA_EXT={name:"SRGB_ALPHA_EXT",value:35906,description:"Unsized sRGB format with unsized alpha component.",extensionName:"EXT_sRGB"},p.SRGB8_ALPHA8_EXT={name:"SRGB8_ALPHA8_EXT",value:35907,description:"Sized (8-bit) sRGB and alpha formats.",extensionName:"EXT_sRGB"},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",value:33296,description:"Returns the framebuffer color encoding.",extensionName:"EXT_sRGB"},p.FRAGMENT_SHADER_DERIVATIVE_HINT_OES={name:"FRAGMENT_SHADER_DERIVATIVE_HINT_OES",value:35723,description:"Indicates the accuracy of the derivative calculation for the GLSL built-in functions: dFdx, dFdy, and fwidth.",extensionName:"OES_standard_derivatives"},p.COLOR_ATTACHMENT0_WEBGL={name:"COLOR_ATTACHMENT0_WEBGL",value:36064,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT1_WEBGL={name:"COLOR_ATTACHMENT1_WEBGL",value:36065,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT2_WEBGL={name:"COLOR_ATTACHMENT2_WEBGL",value:36066,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT3_WEBGL={name:"COLOR_ATTACHMENT3_WEBGL",value:36067,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT4_WEBGL={name:"COLOR_ATTACHMENT4_WEBGL",value:36068,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT5_WEBGL={name:"COLOR_ATTACHMENT5_WEBGL",value:36069,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT6_WEBGL={name:"COLOR_ATTACHMENT6_WEBGL",value:36070,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT7_WEBGL={name:"COLOR_ATTACHMENT7_WEBGL",value:36071,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT8_WEBGL={name:"COLOR_ATTACHMENT8_WEBGL",value:36072,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT9_WEBGL={name:"COLOR_ATTACHMENT9_WEBGL",value:36073,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT10_WEBGL={name:"COLOR_ATTACHMENT10_WEBGL",value:36074,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT11_WEBGL={name:"COLOR_ATTACHMENT11_WEBGL",value:36075,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT12_WEBGL={name:"COLOR_ATTACHMENT12_WEBGL",value:36076,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT13_WEBGL={name:"COLOR_ATTACHMENT13_WEBGL",value:36077,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT14_WEBGL={name:"COLOR_ATTACHMENT14_WEBGL",value:36078,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT15_WEBGL={name:"COLOR_ATTACHMENT15_WEBGL",value:36079,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER0_WEBGL={name:"DRAW_BUFFER0_WEBGL",value:34853,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER1_WEBGL={name:"DRAW_BUFFER1_WEBGL",value:34854,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER2_WEBGL={name:"DRAW_BUFFER2_WEBGL",value:34855,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER3_WEBGL={name:"DRAW_BUFFER3_WEBGL",value:34856,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER4_WEBGL={name:"DRAW_BUFFER4_WEBGL",value:34857,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER5_WEBGL={name:"DRAW_BUFFER5_WEBGL",value:34858,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER6_WEBGL={name:"DRAW_BUFFER6_WEBGL",value:34859,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER7_WEBGL={name:"DRAW_BUFFER7_WEBGL",value:34860,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER8_WEBGL={name:"DRAW_BUFFER8_WEBGL",value:34861,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER9_WEBGL={name:"DRAW_BUFFER9_WEBGL",value:34862,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER10_WEBGL={name:"DRAW_BUFFER10_WEBGL",value:34863,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER11_WEBGL={name:"DRAW_BUFFER11_WEBGL",value:34864,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER12_WEBGL={name:"DRAW_BUFFER12_WEBGL",value:34865,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER13_WEBGL={name:"DRAW_BUFFER13_WEBGL",value:34866,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER14_WEBGL={name:"DRAW_BUFFER14_WEBGL",value:34867,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER15_WEBGL={name:"DRAW_BUFFER15_WEBGL",value:34868,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.MAX_COLOR_ATTACHMENTS_WEBGL={name:"MAX_COLOR_ATTACHMENTS_WEBGL",value:36063,description:"Maximum number of framebuffer color attachment points",extensionName:"WEBGL_draw_buffers"},p.MAX_DRAW_BUFFERS_WEBGL={name:"MAX_DRAW_BUFFERS_WEBGL",value:34852,description:"Maximum number of draw buffers",extensionName:"WEBGL_draw_buffers"},p.VERTEX_ARRAY_BINDING_OES={name:"VERTEX_ARRAY_BINDING_OES",value:34229,description:"The bound vertex array object (VAO).",extensionName:"VERTEX_ARRAY_BINDING_OES"},p.QUERY_COUNTER_BITS_EXT={name:"QUERY_COUNTER_BITS_EXT",value:34916,description:"The number of bits used to hold the query result for the given target.",extensionName:"EXT_disjoint_timer_query"},p.CURRENT_QUERY_EXT={name:"CURRENT_QUERY_EXT",value:34917,description:"The currently active query.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_EXT={name:"QUERY_RESULT_EXT",value:34918,description:"The query result.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_AVAILABLE_EXT={name:"QUERY_RESULT_AVAILABLE_EXT",value:34919,description:"A Boolean indicating whether or not a query result is available.",extensionName:"EXT_disjoint_timer_query"},p.TIME_ELAPSED_EXT={name:"TIME_ELAPSED_EXT",value:35007,description:"Elapsed time (in nanoseconds).",extensionName:"EXT_disjoint_timer_query"},p.TIMESTAMP_EXT={name:"TIMESTAMP_EXT",value:36392,description:"The current time.",extensionName:"EXT_disjoint_timer_query"},p.GPU_DISJOINT_EXT={name:"GPU_DISJOINT_EXT",value:36795,description:"A Boolean indicating whether or not the GPU performed any disjoint operation.",extensionName:"EXT_disjoint_timer_query"},p.zeroMeaningByCommand={getError:"NO_ERROR",blendFunc:"ZERO",blendFuncSeparate:"ZERO",readBuffer:"NONE",getFramebufferAttachmentParameter:"NONE",texParameterf:"NONE",texParameteri:"NONE",drawArrays:"POINTS",drawElements:"POINTS",drawArraysInstanced:"POINTS",drawArraysInstancedAngle:"POINTS",drawBuffers:"POINTS",drawElementsInstanced:"POINTS",drawRangeElements:"POINTS"},p.oneMeaningByCommand={blendFunc:"ONE",blendFuncSeparate:"ONE",drawArrays:"LINES",drawElements:"LINES",drawArraysInstanced:"LINES",drawArraysInstancedAngle:"LINES",drawBuffers:"LINES",drawElementsInstanced:"LINES",drawRangeElements:"LINES"};const m={},g={};!function(){for(const e in p)if(p.hasOwnProperty(e)){const t=p[e];m[t.name]=t,g[t.value]=t}}();class E extends c{get analyserName(){return E.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={total:0,totalTriangles:0,totalTriangleStrip:0,totalTriangleFan:0,totalLines:0,totalLineStrip:0,totalLineLoop:0,totalPoints:0};for(const t of e.commands)"drawArrays"===t.name&&t.commandArguments.length>=3||"drawArraysInstanced"===t.name&&t.commandArguments.length>=3||"drawArraysInstancedANGLE"===t.name&&t.commandArguments.length>=3?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[2]):"drawElements"===t.name&&t.commandArguments.length>=2||"drawElementsInstanced"===t.name&&t.commandArguments.length>=2||"drawElementsInstancedANGLE"===t.name&&t.commandArguments.length>=2?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[1]):"drawRangeElements"===t.name&&t.commandArguments.length>=4&&this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[3]);t.total=n.total,t.triangles=n.totalTriangles,t.triangleStrip=n.totalTriangleStrip,t.triangleFan=n.totalTriangleFan,t.lines=n.totalLines,t.lineStrip=n.totalLineStrip,t.lineLoop=n.totalLineLoop,t.points=n.totalPoints}appendToPrimitives(e,t,n){t===p.POINTS.value?e.totalPoints+=n:t===p.LINES.value?e.totalLines+=n:t===p.LINE_STRIP.value?e.totalLineStrip+=n:t===p.LINE_LOOP.value?e.totalLineLoop+=n:t===p.TRIANGLES.value?e.totalTriangles+=n:t===p.TRIANGLE_STRIP.value?e.totalTriangleStrip+=n:t===p.TRIANGLE_FAN.value&&(e.totalTriangleFan+=n),e.total+=n}}E.analyserName="Primitives";class v{constructor(e){this.contextInformation=e,this.analysers=[],this.initAnalysers()}appendAnalyses(e){for(const t in this.analysers)this.analysers.hasOwnProperty(t)&&this.analysers[t].appendAnalysis(e)}initAnalysers(){this.analysers.push(new h(this.contextInformation),new f(this.contextInformation),new E(this.contextInformation))}}class C{static getStackTrace(e=0,t=0){const n=[];try{throw new Error("Errorator.")}catch(e){if(e.stack){const t=e.stack.split("\n");for(let e=0,r=t.length;e0;t++)n.shift();for(let e=0;e0;e++)n.pop()}return n}}class D{static getWebGlObjectTag(e){return e[D.SPECTOROBJECTTAGKEY]}static attachWebGlObjectTag(e,t){t.displayText=D.stringifyWebGlObjectTag(t),e[D.SPECTOROBJECTTAGKEY]=t}static stringifyWebGlObjectTag(e){return e?`${e.typeName} - ID: ${e.id}`:"No tag available."}}D.SPECTOROBJECTTAGKEY="__SPECTOR_Object_TAG";class S{get type(){return("undefined"!=typeof globalThis?globalThis:self)[this.typeName]||null}constructor(){this.id=0}tagWebGlObject(e){if(!this.type)return;let t;if(!e)return t;if(t=D.getWebGlObjectTag(e),t)return t;if(e instanceof this.type){const n=this.getNextId();return t={typeName:this.typeName,id:n},D.attachWebGlObjectTag(e,t),t}return t}getNextId(){return this.id++}}class A{constructor(e){this.options=e}createCapture(e,t,n){const r=C.getStackTrace(4,1),i=0===e.name.indexOf("uniform")?this.stringifyUniform(e.arguments):this.stringify(e.arguments,e.result),s={id:t,startTime:e.startTime,commandEndTime:e.endTime,endTime:0,name:e.name,commandArguments:e.arguments,result:e.result,stackTrace:r,status:0,marker:n,text:i};this.transformCapture(s);for(let e=0;e50&&(s.commandArguments[e]="Array Length: "+t.length)}if(s.commandArguments){const e=[];for(let t=0;t0&&(n+=": "+this.stringifyArgs(e).join(", ")),null!=t&&(n+=" -> "+this.stringifyResult(t)),n}stringifyUniform(e){let t=this.spiedCommandName;if(e&&e.length>0){const n=[];n.push(this.stringifyValue(e[0]));for(let t=1;t0&&"number"==typeof s)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");else{const e=this.stringifyValue(s);r.push(e)}}return r}}_.commandName="bufferSubData";class y{static storeOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]||(e[n]=e[t])}static resetOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]&&(e[t]=e[n],delete e[n])}static storePrototypeOriginFunction(e,t){if(!e)return;if(!e.prototype[t])return;const n=this.getOriginFunctionName(t);e.prototype[n]||(e.prototype[n]=e.prototype[t])}static executePrototypeOriginFunction(e,t,n,r){if(!e)return;const i=this.getOriginFunctionName(n);return t.prototype[i]?(e[i]||(e[i]=t.prototype[i]),this.executeFunction(e,i,r)):void 0}static executeOriginFunction(e,t,n){if(!e)return;const r=this.getOriginFunctionName(t);return e[r]?this.executeFunction(e,r,n):void 0}static executeFunction(e,t,n){const r=n;if(void 0===r||0===r.length)return e[t]();switch(r.length){case 1:return e[t](r[0]);case 2:return e[t](r[0],r[1]);case 3:return e[t](r[0],r[1],r[2]);case 4:return e[t](r[0],r[1],r[2],r[3]);case 5:return e[t](r[0],r[1],r[2],r[3],r[4]);case 6:return e[t](r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6]);case 8:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]);case 9:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8]);case 10:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9]);case 11:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10]);case 12:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11]);case 13:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12]);case 14:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13]);case 15:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14]);case 16:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);case 17:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16]);case 18:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17]);case 19:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18]);case 20:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19]);default:return e[t].apply(e,r)}}static getOriginFunctionName(e){return this.originFunctionPrefix+e}}y.originFunctionPrefix="__SPECTOR_Origin_";class b extends A{get spiedCommandName(){return b.commandName}stringifyArgs(e){const t=[];if(e.length>0){const n=e[0],r=this.stringifyValue(n);t.push(r)}if(e.length>1){const n=""+e[1];t.push(n)}return e.length>2&&t.push(e[2]),t}}b.commandName="bindAttribLocation";class T extends A{get spiedCommandName(){return T.commandName}stringifyArgs(e){const t=[],n=this.options.context.getParameter(p.READ_FRAMEBUFFER_BINDING.value),r=this.options.tagWebGlObject(n);t.push("READ FROM: "+this.stringifyValue(r));const i=this.options.context.getParameter(p.DRAW_FRAMEBUFFER_BINDING.value),s=this.options.tagWebGlObject(i);t.push("WRITE TO: "+this.stringifyValue(s));for(let n=0;n<8;n++)t.push(e[n]);return(e[8]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[8]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[8]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t.push(p.stringifyWebGlConstant(e[9],"blitFrameBuffer")),t}}T.commandName="blitFrameBuffer";class R extends A{get spiedCommandName(){return R.commandName}stringifyArgs(e){const t=[];return(e[0]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[0]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[0]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t}}R.commandName="clear";class x{static getProgramData(e,t){const n={LINK_STATUS:e.getProgramParameter(t,p.LINK_STATUS.value),VALIDATE_STATUS:e.getProgramParameter(t,p.VALIDATE_STATUS.value),infoLog:e.getProgramInfoLog(t)||""},r=e.getAttachedShaders(t)||[],i=new Array(2);let s=0;for(const t of r){const n=this.getShaderData(e,t);s+=n.source.length,n.shaderType===p.FRAGMENT_SHADER.name?i[1]=n:i[0]=n}return{programStatus:n,shaders:i,length:s}}static getShaderData(e,t){const n=e.getShaderSource(t)||"",r=e.getExtension("WEBGL_debug_shaders"),i=r?r.getTranslatedShaderSource(t):null,s=e.getShaderParameter(t,p.SHADER_TYPE.value)===p.FRAGMENT_SHADER.value;let o=t&&t.__SPECTOR_Metadata&&t.__SPECTOR_Metadata.name?t.__SPECTOR_Metadata.name:this.readNameFromShaderSource(n);return o||(o=s?"Fragment":"Vertex"),{COMPILE_STATUS:e.getShaderParameter(t,p.COMPILE_STATUS.value),shaderType:s?p.FRAGMENT_SHADER.name:p.VERTEX_SHADER.name,name:o,source:n,translatedSource:i,infoLog:e.getShaderInfoLog(t)||""}}static readNameFromShaderSource(e){try{let t,n="";const r=/#define[\s]+SHADER_NAME[\s]+([\S]+)(\n|$)/gi;if(t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),""===n){const r=/#define[\s]+SHADER_NAME_B64[\s]+([\S]+)(\n|$)/gi;t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),n&&(n=decodeURIComponent(atob(n)))}return n}catch(e){return null}}}class w extends A{constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.shader=x.getShaderData(this.options.context,t)}finally{n&&n(!0)}}getShaderDisplayText(e){return this.stringifyValue(e.commandArguments[0])}}class F extends w{get spiedCommandName(){return F.commandName}transformCapture(e){if(super.transformCapture(e),e.shader){const t=e.shader.COMPILE_STATUS?"compiled":"failed";e.text=`${this.spiedCommandName}: ${this.getShaderDisplayText(e)} -> ${t}`}}}F.commandName="compileShader";const N=["lineWidth"];class L extends A{get spiedCommandName(){return this.internalSpiedCommandName}constructor(e,t){super(e),this.internalSpiedCommandName=t,this.isDeprecated=N.indexOf(this.spiedCommandName)>-1}transformCapture(e){this.isDeprecated&&(e.status=50)}}class O extends A{get spiedCommandName(){return O.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}O.commandName="disableVertexAttribArray";class I extends A{get spiedCommandName(){return I.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(e[1]+" indices"),t.push(e[2]),t}}I.commandName="drawArrays";class k extends A{get spiedCommandName(){return k.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}k.commandName="drawArraysInstanced";class M extends A{get spiedCommandName(){return M.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstancedANGLE")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}M.commandName="drawArraysInstancedANGLE";class P extends A{get spiedCommandName(){return P.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElements")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElements")),t.push(e[3]),t}}P.commandName="drawElements";class B extends A{get spiedCommandName(){return B.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstancedANGLE")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstancedANGLE")),t.push(e[3]),t.push(e[4]),t}}B.commandName="drawElementsInstancedANGLE";class U extends A{get spiedCommandName(){return U.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t}}U.commandName="drawElementsInstanced";class $ extends A{get spiedCommandName(){return $.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawRangeElements")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(p.stringifyWebGlConstant(e[4],"drawRangeElements")),t.push(e[5]),t}}$.commandName="drawRangeElements";class G extends A{get spiedCommandName(){return G.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}G.commandName="getActiveAttrib";class V extends A{get spiedCommandName(){return V.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}V.commandName="getActiveUniform";class W extends A{get spiedCommandName(){return W.commandName}stringifyResult(e){var t;if(null!=e)return null!==(t=null==e?void 0:e.toFixed(0))&&void 0!==t?t:"0"}}W.commandName="getAttribLocation";class H extends A{get spiedCommandName(){return H.commandName}stringifyResult(e){return e?"true":"false"}}H.commandName="getExtension";class j extends A{get spiedCommandName(){return j.commandName}stringifyResult(e){if(!e)return"null";const t=D.getWebGlObjectTag(e);return t?t.displayText:e}}j.commandName="getParameter";class z extends A{get spiedCommandName(){return z.commandName}stringifyResult(e){if(e)return`min: ${e.rangeMin}, max: ${e.rangeMax}, precision: ${e.precision}`}}z.commandName="getShaderPrecisionFormat";class X extends w{get spiedCommandName(){return X.commandName}stringifyResult(e){if("string"!=typeof e||0===e.trim().length)return"No messages";const t=e.split(/\r?\n/).filter(e=>e.trim().length>0).length;return t+(1===t?" message":" messages")}}X.commandName="getShaderInfoLog";class K extends A{get spiedCommandName(){return K.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}K.commandName="getTransformFeedbackVarying";class Y extends A{get spiedCommandName(){return Y.commandName}constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.program=x.getProgramData(this.options.context,t)}finally{n&&n(!0)}const r=e.program.programStatus.LINK_STATUS?"linked":"failed";e.text=`${this.spiedCommandName}: ${this.stringifyValue(t)} -> ${r}`}}Y.commandName="linkProgram";class q extends A{get spiedCommandName(){return q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"multiDrawArraysInstancedBaseInstanceWEBGL")),t.push(`drawCount=${e[9]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t}}q.commandName="multiDrawArraysInstancedBaseInstanceWEBGL";class Q extends A{get spiedCommandName(){return Q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[7]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t}}Q.commandName="multiDrawArraysInstancedWEBGL";class Z extends A{get spiedCommandName(){return Z.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[5]}`),t.push(e[2]),t.push(e[4]),t}}Z.commandName="multiDrawArraysWEBGL";class J extends A{get spiedCommandName(){return J.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[11]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t.push(e[10]),t}}J.commandName="multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL";class ee extends A{get spiedCommandName(){return ee.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[8]}`),t.push(e[2]),t.push(e[5]),t.push(e[7]),t}}ee.commandName="multiDrawElementsInstancedWEBGL";class te extends A{get spiedCommandName(){return te.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[6]}`),t.push(e[2]),t.push(e[5]),t}}te.commandName="multiDrawElementsWEBGL";class ne extends A{get spiedCommandName(){return ne.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(`baseInstance = ${e[4]}`),t}}ne.commandName="drawArraysInstancedBaseInstanceWEBGL";class re extends A{get spiedCommandName(){return re.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t.push(`baseVertex = ${e[5]}`),t.push(`baseInstance = ${e[6]}`),t}}re.commandName="drawElementsInstancedBaseVertexBaseInstanceWEBGL";class ie extends A{get spiedCommandName(){return ie.commandName}stringifyArgs(e){var t,n;const r=[];for(let i=0;i<4;i++)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");return r}}function se(e){return null==e?"":`${e.toFixed(0)} (0b${(e>>>0).toString(2)})`}ie.commandName="scissor";class oe extends A{get spiedCommandName(){return oe.commandName}stringifyArgs(e){const t=[];return t.push(se(e[0])),t}}oe.commandName="stencilMask";class ae extends A{get spiedCommandName(){return ae.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilMaskSeparate")),t.push(se(e[1])),t}}ae.commandName="stencilMaskSeparate";class le extends A{get spiedCommandName(){return le.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFunc")),t.push(se(e[1])),t.push(se(e[2])),t}}le.commandName="stencilFunc";class ue extends A{get spiedCommandName(){return ue.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFuncSeparate")),t.push(p.stringifyWebGlConstant(e[1],"stencilFuncSeparate")),t.push(se(e[2])),t.push(se(e[3])),t}}ue.commandName="stencilFuncSeparate";class ce extends A{get spiedCommandName(){return ce.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t.push(e[1]),t.push(p.stringifyWebGlConstant(e[2],"vertexAttribPointer")),t.push(e[3]),t.push(e[4]),t.push(e[5]),t}}ce.commandName="vertexAttribPointer";class he extends A{get spiedCommandName(){return he.commandName}stringifyArgs(e){const t=[];for(let n=0;n<4;n++)t.push(e[n].toFixed(0));return t}}he.commandName="viewport";class de extends A{get spiedCommandName(){return de.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}de.commandName="enableVertexAttribArray";class fe extends w{get spiedCommandName(){return fe.commandName}stringifyArgs(e){const t="string"==typeof e[1]?e[1]:"";return[this.stringifyValue(e[0]),t.length+" chars"]}transformCapture(e){super.transformCapture(e);const t=e.commandArguments[1];e.shader&&"string"==typeof t&&(e.shader.source=t,e.shader.COMPILE_STATUS=null,e.shader.translatedSource="",e.shader.infoLog="")}}fe.commandName="shaderSource";class pe{constructor(e){this.spiedCommandName=e.spiedCommandName,this.spiedCommandRunningContext=e.spiedCommandRunningContext,this.spiedCommand=this.spiedCommandRunningContext[this.spiedCommandName],y.storeOriginFunction(this.spiedCommandRunningContext,this.spiedCommandName),this.callback=e.callback,this.commandOptions={context:e.context,contextVersion:e.contextVersion,extensions:e.extensions,toggleCapture:e.toggleCapture},this.initCustomCommands(),this.initCommand()}spy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.overloadedCommand}unSpy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.spiedCommand}createCapture(e,t,n){return this.command.createCapture(e,t,n)}initCommand(){pe.customCommandsConstructors[this.spiedCommandName]?this.command=pe.customCommandsConstructors[this.spiedCommandName](this.commandOptions):this.command=new L(this.commandOptions,this.spiedCommandName),this.overloadedCommand=this.getSpy()}getSpy(){const e=this;return function(){const t=u.now,n=y.executeOriginFunction(e.spiedCommandRunningContext,e.spiedCommandName,arguments),r=u.now;try{const i={name:e.spiedCommandName,arguments,result:n,startTime:t,endTime:r};e.callback(e,i)}catch(e){}return n}}initCustomCommands(){pe.customCommandsConstructors||(pe.customCommandsConstructors={[b.commandName]:e=>new b(e),[T.commandName]:e=>new T(e),[_.commandName]:e=>new _(e),[R.commandName]:e=>new R(e),[F.commandName]:e=>new F(e),[O.commandName]:e=>new O(e),[I.commandName]:e=>new I(e),[k.commandName]:e=>new k(e),[M.commandName]:e=>new M(e),[P.commandName]:e=>new P(e),[U.commandName]:e=>new U(e),[B.commandName]:e=>new B(e),[$.commandName]:e=>new $(e),[G.commandName]:e=>new G(e),[V.commandName]:e=>new V(e),[W.commandName]:e=>new W(e),[H.commandName]:e=>new H(e),[j.commandName]:e=>new j(e),[X.commandName]:e=>new X(e),[z.commandName]:e=>new z(e),[K.commandName]:e=>new K(e),[Y.commandName]:e=>new Y(e),[q.commandName]:e=>new q(e),[Q.commandName]:e=>new Q(e),[Z.commandName]:e=>new Z(e),[J.commandName]:e=>new J(e),[ee.commandName]:e=>new ee(e),[te.commandName]:e=>new te(e),[ne.commandName]:e=>new ne(e),[re.commandName]:e=>new re(e),[ie.commandName]:e=>new ie(e),[fe.commandName]:e=>new fe(e),[oe.commandName]:e=>new oe(e),[ae.commandName]:e=>new ae(e),[le.commandName]:e=>new le(e),[ue.commandName]:e=>new ue(e),[ce.commandName]:e=>new ce(e),[he.commandName]:e=>new he(e),[de.commandName]:e=>new de(e)})}}class me{constructor(e){this.options=e,this.context=e.context,this.contextVersion=e.contextVersion,this.extensions=e.extensions,this.toggleCapture=e.toggleCapture,this.consumeCommands=this.getConsumeCommands(),this.changeCommandsByState=this.getChangeCommandsByState(),this.commandNameToStates=this.getCommandNameToStates()}get requireStartAndStopStates(){return!0}startCapture(e,t,n){return this.quickCapture=t,this.fullCapture=n,this.capturedCommandsByState={},e&&this.requireStartAndStopStates&&(this.currentState={},this.readFromContextNoSideEffects()),this.copyCurrentStateToPrevious(),this.currentState={},this.previousState}stopCapture(){return this.requireStartAndStopStates&&this.readFromContextNoSideEffects(),this.analyse(void 0),this.currentState}registerCallbacks(e){for(const t in this.changeCommandsByState)if(this.changeCommandsByState.hasOwnProperty(t))for(const n of this.changeCommandsByState[t])e[n]=e[n]||[],e[n].push(this.onChangeCommand.bind(this));for(const t of this.consumeCommands)e[t]=e[t]||[],e[t].push(this.onConsumeCommand.bind(this))}getStateData(){return this.currentState}getConsumeCommands(){return[]}getChangeCommandsByState(){return{}}copyCurrentStateToPrevious(){this.currentState&&(this.previousState=this.currentState)}onChangeCommand(e){const t=this.commandNameToStates[e.name];for(const n of t){if(!this.isValidChangeCommand(e,n))return;this.capturedCommandsByState[n]=this.capturedCommandsByState[n]||[],this.capturedCommandsByState[n].push(e)}}isValidChangeCommand(e,t){return!0}onConsumeCommand(e){this.isValidConsumeCommand(e)&&(this.readFromContextNoSideEffects(),this.analyse(e),this.storeCommandIds(),e[this.stateName]=this.currentState,this.startCapture(!1,this.quickCapture,this.fullCapture))}isValidConsumeCommand(e){return this.lastCommandName=null==e?void 0:e.name,!0}analyse(e){for(const t in this.capturedCommandsByState)if(this.capturedCommandsByState.hasOwnProperty(t)){const n=this.capturedCommandsByState[t],r=n.length-1;if(r>=0)if(e){for(let t=0;t1&&this.parameters.push(this.getWebgl2Parameters());const e={};for(let t=1;t<=this.contextVersion&&!(t>this.parameters.length);t++)if(this.parameters[t-1])for(const n of this.parameters[t-1])if(n.changeCommands)for(const t of n.changeCommands)e[n.constant.name]=e[n.constant.name]||[],e[n.constant.name].push(t);return e}readFromContext(){for(let e=1;e<=this.contextVersion&&!(e>this.parameters.length);e++)for(const t of this.parameters[e-1]){const e=this.readParameterFromContext(t);if(null==e){const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n;continue}const n=D.getWebGlObjectTag(e);if(n)this.currentState[t.constant.name]=n;else{const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n}}}readParameterFromContext(e){return e.constant.extensionName&&!this.extensions[e.constant.extensionName]?`Extension ${e.constant.extensionName} is unavailable.`:this.context.getParameter(e.constant.value)}stringifyParameterValue(e,t){if(null===e)return"null";if(void 0===e)return"undefined";if(30===t.returnType)return se(e);if("number"==typeof e&&p.isWebGlConstant(e)){if(20===t.returnType){const n=t.changeCommands&&t.changeCommands[0]||"";return p.stringifyWebGlConstant(e,n)}return e}if(e.length&&"string"!=typeof e){const t=[];for(let n=0;n1?r=this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value):this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.value)===p.RENDERBUFFER.value&&(r=e.getRenderbufferParameter(e.RENDERBUFFER,e.RENDERBUFFER_STENCIL_SIZE))):r=this.readParameterFromContext({constant:p.STENCIL_BITS}),this.currentState[p.STENCIL_BITS.name]=""+r}isValidChangeCommand(e,t){return"enable"===e.name||"disable"===e.name?e.commandArguments[0]===p.STENCIL_TEST.value:"stencilOp"===e.name||"stencilOpSeparate"===e.name?xe.stencilOpStates.indexOf(e.commandArguments[0])>0:"stencilFunc"===e.name||"stencilFuncSeparate"===e.name?xe.stencilFuncStates.indexOf(e.commandArguments[0])>0:"stencilMask"!==e.name&&"stencilMaskSeparate"!==e.name||xe.stencilMaskStates.indexOf(e.commandArguments[0])>0}getConsumeCommands(){return d}isStateEnable(e,t){return this.context.isEnabled(p.STENCIL_TEST.value)}}xe.stateName="StencilState",xe.stencilOpStates=[p.STENCIL_BACK_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_PASS.value,p.STENCIL_FAIL.value,p.STENCIL_PASS_DEPTH_FAIL.value,p.STENCIL_PASS_DEPTH_PASS.value],xe.stencilFuncStates=[p.STENCIL_BACK_FUNC.value,p.STENCIL_BACK_REF.value,p.STENCIL_BACK_VALUE_MASK.value,p.STENCIL_FUNC.value,p.STENCIL_REF.value,p.STENCIL_VALUE_MASK.value],xe.stencilMaskStates=[p.STENCIL_BACK_WRITEMASK.value,p.STENCIL_WRITEMASK.value];class we{static isSupportedCombination(e,t,n){return e=e||p.UNSIGNED_BYTE.value,((t=t||p.RGBA.value)===p.RGB.value||t===p.RGBA.value)&&(n===p.RGB.value||n===p.RGBA.value||n===p.RGBA8.value||n===p.RGBA16F.value||n===p.RGBA32F.value||n===p.RGB16F.value||n===p.RGB32F.value||n===p.R11F_G11F_B10F.value||n===p.SRGB8.value||n===p.SRGB8_ALPHA8.value)&&this.isSupportedComponentType(e)}static readPixels(e,t,n,r,i,s){e.getError(),s===p.UNSIGNED_NORMALIZED.value&&(s=p.UNSIGNED_BYTE.value);const o=r*i*4;let a;if(s===p.UNSIGNED_BYTE.value?a=new Uint8Array(o):(s=p.FLOAT.value,a=new Float32Array(o)),e.readPixels(t,n,r,i,e.RGBA,s,a),e.getError())return;if(s===p.UNSIGNED_BYTE.value)return a;const l=new Uint8Array(r*i*4);for(let e=0;e1){const e=this.context.getParameter(p.MAX_DRAW_BUFFERS.value);for(let n=0;n1?this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value):p.UNSIGNED_BYTE.value;l===p.RENDERBUFFER.value?this.readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,c,u):l===p.TEXTURE.value&&this.readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,c,u)}readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,l,u){let c=0,h=0;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,c=e.samples,h=e.internalFormat,!c&&!we.isSupportedCombination(l,p.RGBA.value,h))return}else s+=r,o+=i;if(r=i=0,c){const a=e,u=e.createRenderbuffer(),c=e.getParameter(e.RENDERBUFFER_BINDING);e.bindRenderbuffer(e.RENDERBUFFER,u),e.renderbufferStorage(e.RENDERBUFFER,h,s,o),e.bindRenderbuffer(e.RENDERBUFFER,c),e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u);const d=a.getParameter(a.READ_FRAMEBUFFER_BINDING),f=a.getParameter(a.DRAW_FRAMEBUFFER_BINDING);a.bindFramebuffer(a.READ_FRAMEBUFFER,t),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,this.captureFrameBuffer),a.blitFramebuffer(0,0,s,o,0,0,s,o,e.COLOR_BUFFER_BIT,e.NEAREST),a.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),a.bindFramebuffer(a.READ_FRAMEBUFFER,d),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,f),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t),e.deleteRenderbuffer(u)}else e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,l,u){let c=0;this.contextVersion>1&&(c=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value));const h=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL.value),d=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE.value);d>0?g[d].name:p.TEXTURE_2D.name;let f=!1,m=l;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,void 0!==e.type&&(m=e.type),f=e.target===p.TEXTURE_2D_ARRAY.name,!we.isSupportedCombination(e.type,e.format,e.internalFormat))return}else s+=r,o+=i;r=i=0,e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),c>0||f?e.framebufferTextureLayer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,u,h,c):e.framebufferTexture2D(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,d||p.TEXTURE_2D.value,u,h),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,d,c,m),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}getCapture(e,t,n,r,i,s,o,l,u){i=Math.floor(i),s=Math.floor(s);const c={attachmentName:t,src:null,textureCubeMapFace:o?g[o].name:null,textureLayer:l,raw:null};if(!this.quickCapture)try{const t=we.readPixels(e,n,r,i,s,u);if(t){c.raw=Ne.encode(t,i,s),this.workingCanvas.width=i,this.workingCanvas.height=s;const e=this.workingContext2D.createImageData(i,s);if(e.data.set(t),this.workingContext2D.putImageData(e,0,0),this.fullCapture)this.captureCanvas.width=this.workingCanvas.width,this.captureCanvas.height=this.workingCanvas.height;else{const e=i/s;e<1?(this.captureCanvas.width=Le.captureBaseSize*e,this.captureCanvas.height=Le.captureBaseSize):e>1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this.captureContext2D.drawImage(this.workingCanvas,0,0,i,s,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",c.src=Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D)}}catch(e){a.warn("Spector can not capture the visual state: "+e)}this.currentState.Attachments.push(c)}analyse(e){}}Le.stateName="VisualState",Le.captureBaseSize=256;class Oe{constructor(e){this.context=e.context,this.captureFrameBuffer=e.context.createFramebuffer(),this.workingCanvas=Fe.createCanvas(1,1),this.workingContext2D=Fe.get2DContext(this.workingCanvas),this.captureCanvas=Fe.createCanvas(1,1),this.captureContext2D=Fe.get2DContext(this.captureCanvas),Fe.setImageSmoothing(this.captureContext2D,!0)}appendTextureState(e,t,n=null,r){if(!t)return;const i=t.__SPECTOR_Object_CustomData;if(i&&(this.fullCapture=r,i.type&&(e.textureType=this.getWebGlConstant(i.type)),i.format&&(e.format=this.getWebGlConstant(i.format)),i.internalFormat&&(e.internalFormat=this.getWebGlConstant(i.internalFormat)),e.width=i.width,e.height=i.height,i.depth&&(e.depth=i.depth),n)){const r="NEAREST"===e.samplerMagFilter||"NEAREST"===e.magFilter,s=this.getTextureVisualState(n,t,i,r);if(s){e.visual=s.visual;for(const t in s.visualPixels)if(s.visualPixels.hasOwnProperty(t)){e.visualPixels=s.visualPixels;break}}}}getTextureVisualState(e,t,n,r){try{const i=this.context,s={},o={};if(!we.isSupportedCombination(n.type,n.format,n.internalFormat))return{visual:s,visualPixels:o};const a=this.context.getParameter(p.FRAMEBUFFER_BINDING.value);i.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer);try{const a=0,l=n.width,u=n.height;if(e===p.TEXTURE_3D&&n.depth){const e=i;for(let c=0;c2&&c2&&c1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}return this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this._setSmoothing(!o),this.captureContext2D.drawImage(this.workingCanvas,0,0,r,i,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",{src:Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D),raw:l}}catch(e){}return{src:void 0,raw:null}}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}_setSmoothing(e){Fe.setImageSmoothing(this.captureContext2D,e)}}Oe.captureBaseSize=64,Oe.cubeMapFaces=[p.TEXTURE_CUBE_MAP_POSITIVE_X,p.TEXTURE_CUBE_MAP_POSITIVE_Y,p.TEXTURE_CUBE_MAP_POSITIVE_Z,p.TEXTURE_CUBE_MAP_NEGATIVE_X,p.TEXTURE_CUBE_MAP_NEGATIVE_Y,p.TEXTURE_CUBE_MAP_NEGATIVE_Z];class Ie{constructor(e){this.context=e.context}getUboValue(e,t,n,r){const i=Ie.uboTypes[r];if(!i)return;const s=new i.arrayBufferView(n*i.lengthMultiplier),o=this.context,a=o.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,e);if(a){const n=o.getIndexedParameter(p.UNIFORM_BUFFER_START.value,e),r=o.getParameter(p.UNIFORM_BUFFER_BINDING.value);try{o.bindBuffer(p.UNIFORM_BUFFER.value,a),o.getBufferSubData(p.UNIFORM_BUFFER.value,n+t,s)}catch(e){return}r&&o.bindBuffer(p.UNIFORM_BUFFER.value,r)}return Array.prototype.slice.call(s)}}Ie.uboTypes={[p.BOOL.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.BOOL_VEC2.value]:{arrayBufferView:Uint8Array,lengthMultiplier:2},[p.BOOL_VEC3.value]:{arrayBufferView:Uint8Array,lengthMultiplier:3},[p.BOOL_VEC4.value]:{arrayBufferView:Uint8Array,lengthMultiplier:4},[p.INT.value]:{arrayBufferView:Int32Array,lengthMultiplier:1},[p.INT_VEC2.value]:{arrayBufferView:Int32Array,lengthMultiplier:2},[p.INT_VEC3.value]:{arrayBufferView:Int32Array,lengthMultiplier:3},[p.INT_VEC4.value]:{arrayBufferView:Int32Array,lengthMultiplier:4},[p.UNSIGNED_INT.value]:{arrayBufferView:Uint32Array,lengthMultiplier:1},[p.UNSIGNED_INT_VEC2.value]:{arrayBufferView:Uint32Array,lengthMultiplier:2},[p.UNSIGNED_INT_VEC3.value]:{arrayBufferView:Uint32Array,lengthMultiplier:3},[p.UNSIGNED_INT_VEC4.value]:{arrayBufferView:Uint32Array,lengthMultiplier:4},[p.FLOAT.value]:{arrayBufferView:Float32Array,lengthMultiplier:1},[p.FLOAT_VEC2.value]:{arrayBufferView:Float32Array,lengthMultiplier:2},[p.FLOAT_VEC3.value]:{arrayBufferView:Float32Array,lengthMultiplier:3},[p.FLOAT_VEC4.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT2x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT3.value]:{arrayBufferView:Float32Array,lengthMultiplier:9},[p.FLOAT_MAT3x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT3x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.FLOAT_MAT4.value]:{arrayBufferView:Float32Array,lengthMultiplier:16},[p.FLOAT_MAT4x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT4x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.SAMPLER_2D.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.SAMPLER_CUBE.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1}};class ke extends S{get typeName(){return"WebGLBuffer"}}class Me extends S{get typeName(){return"WebGLFramebuffer"}}class Pe extends S{get typeName(){return"WebGLProgram"}static saveInGlobalStore(e){const t=D.getWebGlObjectTag(e);t&&(this.store[t.id]=e)}static getFromGlobalStore(e){return this.store[e]}static updateInGlobalStore(e,t){if(!t)return;const n=this.getFromGlobalStore(e);if(!n)return;const r=D.getWebGlObjectTag(n);r&&(D.attachWebGlObjectTag(t,r),this.store[r.id]=t)}}Pe.store={};class Be extends S{get typeName(){return"WebGLQuery"}}class Ue extends S{get typeName(){return"WebGLRenderbuffer"}}class $e extends S{get typeName(){return"WebGLSampler"}}class Ge extends S{get typeName(){return"WebGLShader"}}class Ve extends S{get typeName(){return"WebGLSync"}}class We extends S{get typeName(){return"WebGLTexture"}}class He extends S{get typeName(){return"WebGLTransformFeedback"}}class je extends S{get typeName(){return"WebGLUniformLocation"}}class ze extends S{get typeName(){return"WebGLVertexArrayObject"}}class Xe extends me{get stateName(){return Xe.stateName}get requireStartAndStopStates(){return!1}constructor(e){super(e),this.drawCallTextureInputState=new Oe(e),this.drawCallUboInputState=new Ie(e)}getConsumeCommands(){return d}getChangeCommandsByState(){return{}}readFromContext(){var e,t;const n=this.context.getParameter(p.CURRENT_PROGRAM.value);if(!n)return;this.currentState.frameBuffer=this.readFrameBufferFromContext();const r=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData:x.getProgramData(this.context,n);if(this.currentState.programStatus=Object.assign({},r.programStatus),this.currentState.programStatus.program=this.getSpectorData(n),this.currentState.programStatus.RECOMPILABLE=o.isBuildableProgram(n),this.currentState.programStatus.RECOMPILABLE&&Pe.saveInGlobalStore(n),this.currentState.shaders=r.shaders,(null===(e=this.lastCommandName)||void 0===e?void 0:e.indexOf("Elements"))>=0){const e=this.context.getParameter(this.context.ELEMENT_ARRAY_BUFFER_BINDING);e&&(this.currentState.elementArray={},this.currentState.elementArray.arrayBuffer=this.getSpectorData(e))}const i=this.context.getProgramParameter(n,p.ACTIVE_ATTRIBUTES.value);this.currentState.attributes=[];for(let e=0;e1){const e=this.context.getProgramParameter(n,p.ACTIVE_UNIFORM_BLOCKS.value);this.currentState.uniformBlocks=[];for(let t=0;t1){const e=this.context;t.colorAttachments=[];const n=e.getParameter(p.MAX_DRAW_BUFFERS.value);for(let e=0;e1&&(r.alphaSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE.value),r.blueSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE.value),r.encoding=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.value)),r.componentType=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value)),r.depthSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE.value),r.greenSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE.value),r.redSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_RED_SIZE.value),r.stencilSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value),n===p.TEXTURE.value&&(r.textureLayer=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value))),r}readAttributeFromContext(e,t){const n=this.context.getActiveAttrib(e,t),r=this.context.getAttribLocation(e,n.name);if(-1===r)return{name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:-1};const i=this.context.getVertexAttrib(r,p.CURRENT_VERTEX_ATTRIB.value),s=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING.value),o={name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:r,offsetPointer:this.context.getVertexAttribOffset(r,p.VERTEX_ATTRIB_ARRAY_POINTER.value),bufferBinding:this.getSpectorData(s),enabled:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_ENABLED.value),arraySize:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_SIZE.value),stride:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_STRIDE.value),arrayType:this.getWebGlConstant(this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_TYPE.value)),normalized:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_NORMALIZED.value),vertexAttrib:Array.prototype.slice.call(i)};return this.extensions[p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.extensionName]?o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.value):this.contextVersion>1&&(o.integer=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_INTEGER.value),o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR.value)),this.appendBufferCustomData(o,s),o}readUniformFromContext(e,t){const n=this.context.getActiveUniform(e,t),r=this.context.getUniformLocation(e,n.name);if(r){if(n.size>1&&n.name&&n.name.indexOf("[0]")===n.name.length-3){const t=[];for(let r=0;r1){r.baseLevel=this.context.getTexParameter(t.value,p.TEXTURE_BASE_LEVEL.value),r.immutable=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_FORMAT.value),r.immutableLevels=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_LEVELS.value),r.maxLevel=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LEVEL.value);const e=this.context.getParameter(p.SAMPLER_BINDING.value);if(e){r.sampler=this.getSpectorData(e);const t=this.context;r.samplerMaxLod=t.getSamplerParameter(e,p.TEXTURE_MAX_LOD.value),r.samplerMinLod=t.getSamplerParameter(e,p.TEXTURE_MIN_LOD.value),r.samplerCompareFunc=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_FUNC.value)),r.samplerCompareMode=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_MODE.value)),r.samplerWrapS=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_S.value)),r.samplerWrapT=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_T.value)),r.samplerWrapR=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_R.value)),r.samplerMagFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MAG_FILTER.value)),r.samplerMinFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MIN_FILTER.value))}else r.maxLod=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LOD.value),r.minLod=this.context.getTexParameter(t.value,p.TEXTURE_MIN_LOD.value),r.compareFunc=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_FUNC.value)),r.compareMode=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_MODE.value)),r.wrapR=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_WRAP_R.value))}const i=this.getTextureStorage(t);if(i){const e=this.quickCapture?null:t;this.drawCallTextureInputState.appendTextureState(r,i,e,this.fullCapture)}return this.context.activeTexture(n),r}getTextureStorage(e){return e===p.TEXTURE_2D?this.context.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP?this.context.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):e===p.TEXTURE_3D?this.context.getParameter(p.TEXTURE_BINDING_3D.value):e===p.TEXTURE_2D_ARRAY?this.context.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):void 0}readUniformsFromContextIntoState(e,t,n,r){const i=this.context,s=i.getActiveUniforms(e,t,p.UNIFORM_TYPE.value),o=i.getActiveUniforms(e,t,p.UNIFORM_SIZE.value),a=i.getActiveUniforms(e,t,p.UNIFORM_BLOCK_INDEX.value),l=i.getActiveUniforms(e,t,p.UNIFORM_OFFSET.value),u=i.getActiveUniforms(e,t,p.UNIFORM_ARRAY_STRIDE.value),c=i.getActiveUniforms(e,t,p.UNIFORM_MATRIX_STRIDE.value),h=i.getActiveUniforms(e,t,p.UNIFORM_IS_ROW_MAJOR.value);for(let d=0;d-1&&(t.blockName=i.getActiveUniformBlockName(e,t.blockIndice)),t.offset=l[d],t.arrayStride=u[d],t.matrixStride=c[d],t.rowMajor=h[d],t.blockIndice>-1){const e=r[a[d]].bindingPoint;t.value=this.drawCallUboInputState.getUboValue(e,t.offset,t.size,s[d])}}}readTransformFeedbackFromContext(e,t){const n=this.context,r=n.getTransformFeedbackVarying(e,t),i=n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value,t),s={name:r.name,size:r.size,type:this.getWebGlConstant(r.type),buffer:this.getSpectorData(i),bufferSize:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_SIZE.value,t),bufferStart:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_START.value,t)};return this.appendBufferCustomData(s,i),s}readUniformBlockFromContext(e,t){const n=this.context,r=n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_BINDING.value),i=n.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,r),s={name:n.getActiveUniformBlockName(e,t),bindingPoint:r,size:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_DATA_SIZE.value),activeUniformCount:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_ACTIVE_UNIFORMS.value),vertex:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER.value),fragment:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER.value),buffer:this.getSpectorData(i)};return this.appendBufferCustomData(s,i),s}appendBufferCustomData(e,t){if(t){const n=t.__SPECTOR_Object_CustomData;n&&(n.usage&&(e.bufferUsage=this.getWebGlConstant(n.usage)),e.bufferLength=n.length,n.offset&&(e.bufferOffset=n.offset),n.sourceLength&&(e.bufferSourceLength=n.sourceLength))}}getWebGlConstant(e){const t=g[e];return t?t.name:e}}Xe.stateName="DrawCall",Xe.samplerTypes={[p.SAMPLER_2D.value]:p.TEXTURE_2D,[p.SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.SAMPLER_3D.value]:p.TEXTURE_3D,[p.SAMPLER_2D_SHADOW.value]:p.TEXTURE_2D,[p.SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_2D_ARRAY_SHADOW.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_CUBE_SHADOW.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.UNSIGNED_INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.UNSIGNED_INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.UNSIGNED_INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.UNSIGNED_INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY};class Ke{constructor(e){this.contextInformation=e,this.stateTrackers=[],this.onCommandCapturedCallbacks={},this.initStateTrackers()}startCapture(e,t,n){for(const r of this.stateTrackers){const i=r.startCapture(!0,t,n);r.requireStartAndStopStates&&(e.initState[r.stateName]=i)}}stopCapture(e){for(const t of this.stateTrackers){const n=t.stopCapture();t.requireStartAndStopStates&&(e.endState[t.stateName]=n)}}captureState(e){const t=this.onCommandCapturedCallbacks[e.name];if(t)for(const n of t)n(e)}initStateTrackers(){this.stateTrackers.push(new Ee(this.contextInformation),new ve(this.contextInformation),new Ce(this.contextInformation),new De(this.contextInformation),new Se(this.contextInformation),new Ae(this.contextInformation),new _e(this.contextInformation),new ye(this.contextInformation),new be(this.contextInformation),new Te(this.contextInformation),new Re(this.contextInformation),new xe(this.contextInformation),new Le(this.contextInformation),new Xe(this.contextInformation));for(const e of this.stateTrackers)e.registerCallbacks(this.onCommandCapturedCallbacks)}}class Ye{static initializeByteSizeFormat(){this.byteSizePerInternalFormat||(this.byteSizePerInternalFormat={[p.R8.value]:1,[p.R16F.value]:2,[p.R32F.value]:4,[p.R8UI.value]:1,[p.RG8.value]:2,[p.RG16F.value]:4,[p.RG32F.value]:8,[p.ALPHA.value]:1,[p.RGB.value]:3,[p.RGBA.value]:4,[p.LUMINANCE.value]:1,[p.LUMINANCE_ALPHA.value]:2,[p.DEPTH_COMPONENT.value]:1,[p.DEPTH_STENCIL.value]:2,[p.SRGB_EXT.value]:3,[p.SRGB_ALPHA_EXT.value]:4,[p.RGB8.value]:3,[p.SRGB8.value]:3,[p.RGB565.value]:2,[p.R11F_G11F_B10F.value]:4,[p.RGB9_E5.value]:2,[p.RGB16F.value]:6,[p.RGB32F.value]:12,[p.RGB8UI.value]:3,[p.RGBA8.value]:4,[p.RGB5_A1.value]:2,[p.RGBA16F.value]:8,[p.RGBA32F.value]:16,[p.RGBA8UI.value]:4,[p.COMPRESSED_R11_EAC.value]:4,[p.COMPRESSED_SIGNED_R11_EAC.value]:4,[p.COMPRESSED_RG11_EAC.value]:4,[p.COMPRESSED_SIGNED_RG11_EAC.value]:4,[p.COMPRESSED_RGB8_ETC2.value]:4,[p.COMPRESSED_RGBA8_ETC2_EAC.value]:4,[p.COMPRESSED_SRGB8_ETC2.value]:4,[p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC.value]:4,[p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_RGB_S3TC_DXT1_EXT.value]:.5,[p.COMPRESSED_RGBA_S3TC_DXT3_EXT.value]:1,[p.COMPRESSED_RGBA_S3TC_DXT5_EXT.value]:1,[p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGB_ETC1_WEBGL.value]:.5,[p.COMPRESSED_RGB_ATC_WEBGL.value]:.5,[p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL.value]:1,[p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL.value]:1})}constructor(e){this.options=e,this.createCommandNames=this.getCreateCommandNames(),this.updateCommandNames=this.getUpdateCommandNames(),this.deleteCommandNames=this.getDeleteCommandNames(),this.startTime=u.now,this.memoryPerSecond={},this.totalMemory=0,this.frameMemory=0,this.capturing=!1,Ye.initializeByteSizeFormat()}registerCallbacks(e){for(const t of this.createCommandNames)e[t]=e[t]||[],e[t].push(this.createWithoutSideEffects.bind(this));for(const t of this.updateCommandNames)e[t]=e[t]||[],e[t].push(this.updateWithoutSideEffects.bind(this));for(const t of this.deleteCommandNames)e[t]=e[t]||[],e[t].push(this.deleteWithoutSideEffects.bind(this))}startCapture(){this.frameMemory=0,this.capturing=!0}stopCapture(){this.frameMemory=0,this.capturing=!1}appendRecordedInformation(e){e.frameMemory[this.objectName]=this.frameMemory,e.memory[this.objectName]=this.memoryPerSecond}create(e){}createWithoutSideEffects(e){this.options.toggleCapture(!1);try{this.create(e)}finally{this.options.toggleCapture(!0)}}updateWithoutSideEffects(e){if(e&&0!==e.arguments.length){this.options.toggleCapture(!1);try{const t=e.arguments[0],n=this.getBoundInstance(t);if(!n)return;if(!D.getWebGlObjectTag(n))return;const r=this.getWebGlConstant(t),i=this.update(e,r,n);this.changeMemorySize(i)}finally{this.options.toggleCapture(!0)}}}deleteWithoutSideEffects(e){if(!e||!e.arguments||e.arguments.length<1)return;const t=e.arguments[0];if(t){this.options.toggleCapture(!1);try{const e=this.delete(t);this.changeMemorySize(-e)}finally{this.options.toggleCapture(!0)}}}changeMemorySize(e){this.totalMemory+=e,this.capturing&&(this.frameMemory+=e);const t=u.now-this.startTime,n=Math.round(t/1e3);this.memoryPerSecond[n]=this.totalMemory}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}getByteSizeForInternalFormat(e){return Ye.byteSizePerInternalFormat[e]||4}readPixelStoreState(){const e=this.options.context,t={UNPACK_FLIP_Y_WEBGL:e.getParameter(p.UNPACK_FLIP_Y_WEBGL.value),UNPACK_PREMULTIPLY_ALPHA_WEBGL:e.getParameter(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL.value),UNPACK_COLORSPACE_CONVERSION_WEBGL:e.getParameter(p.UNPACK_COLORSPACE_CONVERSION_WEBGL.value),UNPACK_ALIGNMENT:e.getParameter(p.UNPACK_ALIGNMENT.value)};return e instanceof WebGL2RenderingContext&&(t.UNPACK_ROW_LENGTH=e.getParameter(p.UNPACK_ROW_LENGTH.value),t.UNPACK_IMAGE_HEIGHT=e.getParameter(p.UNPACK_IMAGE_HEIGHT.value),t.UNPACK_SKIP_PIXELS=e.getParameter(p.UNPACK_SKIP_PIXELS.value),t.UNPACK_SKIP_ROWS=e.getParameter(p.UNPACK_SKIP_ROWS.value),t.UNPACK_SKIP_IMAGES=e.getParameter(p.UNPACK_SKIP_IMAGES.value)),t}}class qe extends Ye{get objectName(){return"Buffer"}getCreateCommandNames(){return["createBuffer"]}getUpdateCommandNames(){return["bufferData"]}getDeleteCommandNames(){return["deleteBuffer"]}getBoundInstance(e){const t=this.options.context;return e===p.ARRAY_BUFFER.value?t.getParameter(p.ARRAY_BUFFER_BINDING.value):e===p.ELEMENT_ARRAY_BUFFER.value?t.getParameter(p.ELEMENT_ARRAY_BUFFER_BINDING.value):e===p.COPY_READ_BUFFER.value?t.getParameter(p.COPY_READ_BUFFER_BINDING.value):e===p.COPY_WRITE_BUFFER.value?t.getParameter(p.COPY_WRITE_BUFFER_BINDING.value):e===p.TRANSFORM_FEEDBACK_BUFFER.value?t.getParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value):e===p.UNIFORM_BUFFER.value?t.getParameter(p.UNIFORM_BUFFER_BINDING.value):e===p.PIXEL_PACK_BUFFER.value?t.getParameter(p.PIXEL_PACK_BUFFER_BINDING.value):e===p.PIXEL_UNPACK_BUFFER.value?t.getParameter(p.PIXEL_UNPACK_BUFFER_BINDING.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(t,e);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){const n=this.getLength(t);return t.arguments.length>=4?{target:e,length:n,usage:t.arguments[2],offset:t.arguments[3],sourceLength:t.arguments[1]?t.arguments[1].length:-1}:3===t.arguments.length?{target:e,length:n,usage:t.arguments[2]}:void 0}getLength(e){const t=e.arguments[1],n=e.arguments[3],r=e.arguments[4];if("number"==typeof t)return t;if("number"==typeof r&&r>0)return r;const i=t.byteLength||t.length||0;return"number"==typeof n&&n>0?i-n:i}}class Qe extends Ye{get objectName(){return"Renderbuffer"}getCreateCommandNames(){return["createRenderbuffer"]}getUpdateCommandNames(){return["renderbufferStorage","renderbufferStorageMultisample"]}getDeleteCommandNames(){return["deleteRenderbuffer"]}getBoundInstance(e){const t=this.options.context;if(e===p.RENDERBUFFER.value)return t.getParameter(p.RENDERBUFFER_BINDING.value)}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(e,t);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return r.length=r.width*r.height*this.getByteSizeForInternalFormat(r.internalFormat),n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){return 4===e.arguments.length?{target:t,internalFormat:e.arguments[1],width:e.arguments[2],height:e.arguments[3],length:0,samples:0}:{target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,samples:e.arguments[1]}}}class Ze extends Ye{get objectName(){return"Texture2d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage2D","compressedTexImage2D","texStorage2D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D.value?t.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP_POSITIVE_X.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Y.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Z.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_X.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Y.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Z.value?t.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target===p.TEXTURE_2D_ARRAY.name||t.target===p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else{const e="TEXTURE_2D"===t?1:6;let n=r.internalFormat;n===p.RGBA.value&&(r.type===p.FLOAT.value&&(n=p.RGBA32F.value),r.type===p.HALF_FLOAT_OES.value&&(n=p.RGBA16F.value)),r.length=r.width*r.height*e*this.getByteSizeForInternalFormat(n)}return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage2D"===e.name?this.getTexImage2DCustomData(e,t,n):"compressedTexImage2D"===e.name?this.getCompressedTexImage2DCustomData(e,t,n):"texStorage2D"===e.name?this.getTexStorage2DCustomData(e,t,n):void 0}getTexStorage2DCustomData(e,t,n){let r;return 5===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!1}),r}getCompressedTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=7&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!0}),r}getTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8?r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],format:e.arguments[6],type:e.arguments[7],length:0,isCompressed:!1}:6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[5].width,height:e.arguments[5].height,format:e.arguments[3],type:e.arguments[4],length:0,isCompressed:!1}),r}}class Je extends Ye{get objectName(){return"Texture3d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage3D","compressedTexImage3D","texStorage3D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D_ARRAY.value?t.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):e===p.TEXTURE_3D.value?t.getParameter(p.TEXTURE_BINDING_3D.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target!==p.TEXTURE_2D_ARRAY.name&&t.target!==p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){if(e.arguments.length>=2&&0!==e.arguments[1])return 0;const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else r.length=r.width*r.height*r.depth*this.getByteSizeForInternalFormat(r.internalFormat);return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage3D"===e.name?this.getTexImage3DCustomData(e,t,n):"compressedTexImage3D"===e.name?this.getCompressedTexImage3DCustomData(e,t,n):"texStorage3D"===e.name?this.getTexStorage3DCustomData(e,t,n):void 0}getTexStorage3DCustomData(e,t,n){let r;return 6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!1}),r}getCompressedTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!0}),r}getTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=9&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],format:e.arguments[7],type:e.arguments[8],length:0,isCompressed:!1}),r}}class et extends Ye{get objectName(){return"Program"}getCreateCommandNames(){return["createProgram"]}getUpdateCommandNames(){return["linkProgram"]}getDeleteCommandNames(){return["deleteProgram"]}getBoundInstance(e){return e}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){if(e.arguments.length>=1&&!e.arguments[0])return 0;const r=this.getCustomData(n);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e){const t=this.options.context;return x.getProgramData(t,e)}}class tt{constructor(e){this.contextInformation=e,this.onCommandCallbacks={},this.recorders=[],this.initRecorders()}recordCommand(e){const t=this.onCommandCallbacks[e.name];if(t)for(const n of t)n(e)}startCapture(){for(const e of this.recorders)e.startCapture()}stopCapture(){for(const e of this.recorders)e.stopCapture()}appendRecordedInformation(e){for(const t of this.recorders)t.appendRecordedInformation(e)}initRecorders(){this.recorders.push(new qe(this.contextInformation),new Qe(this.contextInformation),new Ze(this.contextInformation),new Je(this.contextInformation),new et(this.contextInformation));for(const e of this.recorders)e.registerCallbacks(this.onCommandCallbacks)}}class nt{constructor(e){this.contextInformation=e,this.webGlObjects=[],this.initWebglObjects()}tagWebGlObjects(e){for(const t of this.webGlObjects){for(let n=0;n0&&this.currentCapture.commands.length===this.maxCommands&&this.onMaxCommand.trigger(this)}}}spyContext(e){const t=[];for(const n in e)n&&t.push(n);for(let n=0;n{this.spyRequestAnimationFrame("requestAnimationFrame",e.display)})}spyRequestAnimationFrame(e,t){const n=this;y.storeOriginFunction(t,e),t[e]=function(){const r=arguments[0],i=n.getCallback(n,r,()=>{n.spiedScope[e](r)});return y.executeOriginFunction(t,e,[i])}}spySetTimer(e){const t=this,n=this.spiedScope,r="setTimeout"===e;y.storeOriginFunction(n,e),n[e]=function(){const i=arguments[0],s=arguments[1],o=Array.prototype.slice.call(arguments);return at.setTimerCommonValues.indexOf(s)>-1&&(o[0]=t.getCallback(t,i,r?()=>{n[e](i)}:null)),y.executeOriginFunction(n,e,o)}}getCallback(e,t,n=null){return function(){const r=u.now;if(e.lastFrame=++e.lastFrame%e.speedRatio,e.willPlayNextFrame||e.speedRatio&&!e.lastFrame){try{e.onFrameStart.trigger(e)}catch(t){e.onError.trigger(t)}try{t.apply(e.spiedScope,arguments)}catch(t){e.onError.trigger(t)}e.lastSixtyFramesCurrentIndex=(e.lastSixtyFramesCurrentIndex+1)%at.fpsWindowSize,e.lastSixtyFramesDuration[e.lastSixtyFramesCurrentIndex]=r-e.lastSixtyFramesPreviousStart;try{e.onFrameEnd.trigger(e)}catch(t){e.onError.trigger(t)}e.willPlayNextFrame=!1}else n&&n();e.lastSixtyFramesPreviousStart=r}}}at.requestAnimationFrameFunctions=["requestAnimationFrame","msRequestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame"],at.setTimerFunctions=["setTimeout","setInterval"],at.setTimerCommonValues=[0,15,16,33,32,40],at.fpsWindowSize=60;class lt{constructor(e){this.canvas=e,this.onContextRequested=new l,this.init()}init(){const e=this,t=function(){const t="undefined"!=typeof HTMLCanvasElement&&this instanceof HTMLCanvasElement?HTMLCanvasElement:OffscreenCanvas,n=e.canvas?y.executeOriginFunction(this,"getContext",arguments):y.executePrototypeOriginFunction(this,t,"getContext",arguments);if(arguments.length>0){const e=arguments[0];if("webgl"!==e&&"experimental-webgl"!==e&&"webgl2"!==e&&"experimental-webgl2"!==e)return n}if(n){const t=Array.prototype.slice.call(arguments),r="webgl2"===t[0]||"experimental-webgl2"===t[0]?2:1;e.onContextRequested.trigger({context:n,contextVersion:r})}return n};this.canvas?(y.storeOriginFunction(this.canvas,"getContext"),this.canvas.getContext=t):("undefined"!=typeof HTMLCanvasElement&&(y.storePrototypeOriginFunction(HTMLCanvasElement,"getContext"),HTMLCanvasElement.prototype.getContext=t),"undefined"!=typeof OffscreenCanvas&&(y.storePrototypeOriginFunction(OffscreenCanvas,"getContext"),OffscreenCanvas.prototype.getContext=t))}}class ut{static startIntercepting(e){if(ut.intercepting)return;if("undefined"==typeof Worker)return;ut.workerBundleUrl=e,ut.originalWorkerConstructor=Worker,ut.intercepting=!0;const t=Worker;globalThis.Worker=function(e,n){const r=e.toString();if(n&&"module"===n.type)return new t(e,n);try{let i;try{i=new URL(r,location.href).href}catch(r){return new t(e,n)}const s=new XMLHttpRequest;if(s.open("GET",i,!1),s.send(),200===s.status){const e=ut.rewriteImportScripts(s.responseText,i),o="(function(){\n var __spectorBase = "+JSON.stringify(i)+';\n self.__SPECTOR_workerBaseUrl = __spectorBase;\n function __spectorResolve(u) {\n if (u == null) return u;\n if (typeof u !== "string") {\n if (u instanceof URL) return u;\n try { u = String(u); } catch (e) { return u; }\n }\n if (/^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i.test(u)) return u;\n try { return new URL(u, __spectorBase).href; }\n catch (e) { return u; }\n }\n self.__SPECTOR_resolveWorkerUrl = __spectorResolve;\n var __origImportScripts = self.importScripts;\n if (typeof __origImportScripts === "function") {\n self.importScripts = function() {\n var args = new Array(arguments.length);\n for (var i = 0; i < arguments.length; i++) args[i] = __spectorResolve(arguments[i]);\n return __origImportScripts.apply(self, args);\n };\n }\n var __origFetch = self.fetch;\n if (typeof __origFetch === "function") {\n self.fetch = function(input, init) {\n try {\n if (typeof input === "string") {\n input = __spectorResolve(input);\n } else if (input && typeof input === "object" && "url" in input && typeof Request === "function") {\n var r = input;\n var resolved = __spectorResolve(r.url);\n if (resolved !== r.url) input = new Request(resolved, r);\n }\n } catch (e) { /* fall through with original input */ }\n return __origFetch.call(self, input, init);\n };\n }\n if (typeof XMLHttpRequest === "function" && XMLHttpRequest.prototype && XMLHttpRequest.prototype.open) {\n var __origXhrOpen = XMLHttpRequest.prototype.open;\n XMLHttpRequest.prototype.open = function(method, url) {\n var args = Array.prototype.slice.call(arguments);\n args[1] = __spectorResolve(url);\n return __origXhrOpen.apply(this, args);\n };\n }\n if (typeof Worker === "function") {\n var __OrigWorker = Worker;\n self.Worker = function(scriptURL, options) {\n var resolved = __spectorResolve(scriptURL);\n return new __OrigWorker(resolved, options);\n };\n self.Worker.prototype = __OrigWorker.prototype;\n }\n})();\n',a="importScripts("+JSON.stringify(ut.workerBundleUrl)+");\n",l=new Blob([o+a+e],{type:"application/javascript"}),u=URL.createObjectURL(l),c=new t(u,n);return ut.spiedWorkers.push({worker:c,originalUrl:r}),c}}catch(e){console.warn("[Spector.js] Could not inject into Worker ("+r+"):",e)}const i=new t(e,n);return ut.spiedWorkers.push({worker:i,originalUrl:r}),i},globalThis.Worker.prototype=t.prototype}static stopIntercepting(){ut.intercepting&&(globalThis.Worker=ut.originalWorkerConstructor,ut.intercepting=!1)}static rewriteImportScripts(e,t){const n=/(['"`])((?:\\.|(?!\1).)*)\1/g;return e.replace(/importScripts\s*\(([^)]*)\)/g,(e,r)=>"importScripts("+r.replace(n,(e,n,r)=>{if("`"===n&&-1!==r.indexOf("${"))return e;let i;try{i=new URL(r,t).href}catch(t){return e}return n+i+n})+")")}static getSpiedWorkers(){return ut.spiedWorkers}static isIntercepting(){return ut.intercepting}}ut.spiedWorkers=[],ut.intercepting=!1;class ct{static getDelay(){return ct.delayMs}static setDelay(e){ct.delayMs="number"==typeof e&&e>0?e:0}static shouldForceIncomplete(e,t,n,r){return!(r<=0)&&e===p.COMPLETION_STATUS_KHR.value&&void 0!==t&&n-tthis._state,this.subscribe=e=>(this._listeners.add(e),()=>{this._listeners.delete(e)}),this._state=e}setState(e){this._state=e(this._state),this._emitChange()}setSnapshot(e){this._state=e,this._emitChange()}_emitChange(){for(const e of this._listeners)e()}}function pt(e){return(0,dt.useSyncExternalStore)(e.subscribe,e.getSnapshot)}var mt=n(848);const gt=(0,dt.createContext)(null);function Et(){const e=(0,dt.useContext)(gt);if(!e)throw new Error("CaptureMenuContext not provided — CaptureMenuRoot must be rendered inside CaptureMenuContext.Provider");return e}function vt({canvas:e}){const t=Et();return(0,mt.jsx)("li",{onClick:()=>t.handleCanvasSelected(e),children:(0,mt.jsx)("span",{children:`Id: ${e.id} - Size: ${e.width}*${e.height}`})})}function Ct(){const e=Et(),t=pt(e.store),n=t.selectedCanvas?`${t.selectedCanvas.id} (${t.selectedCanvas.width}*${t.selectedCanvas.height})`:"Choose Canvas...";return(0,mt.jsxs)("div",{className:"canvasListComponent",children:[(0,mt.jsx)("span",{commandName:"onCanvasSelection",onClick:e.handleCanvasListToggle,children:n}),(0,mt.jsx)("ul",{style:{display:t.showCanvasList?"block":"none",visibility:t.showCanvasList?"visible":"hidden"},children:t.canvases.map((e,t)=>(0,mt.jsx)(vt,{canvas:e},e.id||t))})]})}function Dt(){const e=Et(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"captureMenuActionsComponent",children:[(0,mt.jsx)("div",{commandName:"onCaptureRequested",onClick:e.handleCaptureRequested}),t.isPlaying?(0,mt.jsx)("div",{commandName:"onPauseRequested",onClick:e.handlePauseRequested}):(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("div",{commandName:"onPlayRequested",onClick:e.handlePlayRequested}),(0,mt.jsx)("div",{commandName:"onPlayNextFrameRequested",onClick:e.handlePlayNextFrameRequested})]})]})}function St(){const e=pt(Et().store);return(0,mt.jsxs)("span",{className:"fpsCounterComponent",children:[e.fps.toFixed(2)," Fps"]})}function At(){const e=pt(Et().store);return(0,mt.jsxs)("div",{children:[(0,mt.jsxs)("div",{className:"captureMenuComponent "+(e.visible?"active":""),children:[(0,mt.jsx)(Ct,{}),(0,mt.jsx)(Dt,{}),(0,mt.jsx)(St,{})]}),(0,mt.jsx)("div",{className:"captureMenuLogComponent "+(e.logVisible?"active":""),children:(0,mt.jsx)("span",{className:e.logLevel===i.error?"error":"",children:e.logText})})]})}class _t{constructor(e={}){this.options=e,this.handleCanvasListToggle=()=>{this.store.getSnapshot(),this.store.setState(e=>Object.assign(Object.assign({},e),{selectedCanvas:null,showCanvasList:!e.showCanvasList,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!e.showCanvasList&&!this._hideLog})),this.onCanvasSelected.trigger(null),this._isTrackingCanvas&&this.trackPageCanvases()},this.handleCanvasSelected=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{selectedCanvas:e,showCanvasList:!1,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)},this.handleCaptureRequested=()=>{const e=this.getSelectedCanvasInformation();e&&this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.PleaseWaitHelpText,logVisible:!this._hideLog})),setTimeout(()=>{this.onCaptureRequested.trigger(e)},200)},this.handlePauseRequested=()=>{this.onPauseRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!1}))},this.handlePlayRequested=()=>{this.onPlayRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!0}))},this.handlePlayNextFrameRequested=()=>{this.onPlayNextFrameRequested.trigger(this.getSelectedCanvasInformation())},this._rootPlaceHolder=e.rootPlaceHolder||document.body,this._hideLog=!!e.hideLog,this._isTrackingCanvas=!1,this._extraCanvasEntries=[],this.onCanvasSelected=new l,this.onCaptureRequested=new l,this.onPauseRequested=new l,this.onPlayRequested=new l,this.onPlayNextFrameRequested=new l,this.store=new ft({visible:!0,logText:_t.SelectCanvasHelpText,logLevel:i.info,logVisible:!this._hideLog,canvases:[],selectedCanvas:null,showCanvasList:!1,isPlaying:!0,fps:0}),this._container=document.createElement("div"),this._container.className="spector-react-capture-menu",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(gt.Provider,{value:this},(0,dt.createElement)(At)))}getSelectedCanvasInformation(){return this.store.getSnapshot().selectedCanvas}trackPageCanvases(){if(this._isTrackingCanvas=!0,document.body){const e=document.body.querySelectorAll("canvas");this.updateCanvasesList(e)}}updateCanvasesList(e){const t=[];for(let n=0;nObject.assign(Object.assign({},n),{canvases:t,selectedCanvas:e,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}captureComplete(e){e?this.store.setState(t=>Object.assign(Object.assign({},t),{logLevel:i.error,logText:e,logVisible:!this._hideLog})):this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog}))}setFPS(e){this.store.setState(t=>Object.assign(Object.assign({},t),{fps:e}))}_updateCanvasesInternal(e){for(const t of this._extraCanvasEntries)e.push(t);this.store.getSnapshot().showCanvasList?this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e})):1===e.length?(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:e[0],logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e[0])):(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:null,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(null))}}_t.SelectCanvasHelpText="Please, select a canvas in the list above.",_t.ActionsHelpText="Record with the red button, you can also pause or continue playing the current scene.",_t.PleaseWaitHelpText="Capturing, be patient (this can take up to 3 minutes)...";const yt=(0,dt.createContext)(null);function bt(){const e=(0,dt.useContext)(yt);if(!e)throw new Error("ResultViewContext not provided — ResultViewRoot must be rendered inside ResultViewContext.Provider");return e}function Tt(){const e=bt(),t=pt(e.store),n=(0,dt.useRef)(null),r=(0,dt.useCallback)(e=>{e.preventDefault();const t=e.currentTarget.parentElement,n=t.parentElement;if(!n)return;const r=n.querySelectorAll("li:not(.resultViewMenuSmall)");if("true"===t.getAttribute("open")){t.setAttribute("open","false");for(let e=0;e{e.handleSearchTextChange(t.target.value)},[e]),s=(0,dt.useCallback)(t=>{t.stopPropagation(),e.handleSearchTextChange("")},[e]),o=(0,dt.useCallback)(t=>n=>{n.preventDefault(),e.handleMenuStatusChange(t)},[e]),a=(0,dt.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),e.handleClose()},[e]);return(0,mt.jsxs)("ul",{className:"resultViewMenuComponent",ref:n,children:[(0,mt.jsx)("li",{className:"resultViewMenuOpen resultViewMenuSmall",children:(0,mt.jsx)("a",{href:"#",role:"button",onClick:r,children:"Menu"})}),(0,mt.jsxs)("li",{className:"searchContainer",children:[(0,mt.jsx)("input",{type:"text",placeholder:"Search...",value:t.searchText,commandName:"onSearchTextChanged",commandEventBinding:"change",onChange:i}),(0,mt.jsx)("a",{className:"clearSearch",commandName:"onSearchTextCleared",onClick:s,children:"X"})]}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:0===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCapturesClicked",onClick:o(0),children:"Captures"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:10===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInformationClicked",onClick:o(10),children:"Information"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:20===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInitStateClicked",onClick:o(20),children:"Init State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:40===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCommandsClicked",onClick:o(40),children:"Commands"+(t.commandCount>0?" ("+t.commandCount+")":"")})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:60===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCompareClicked",onClick:o(60),children:"Compare"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:30===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onEndStateClicked",onClick:o(30),children:"End State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{role:"button",commandName:"onCloseClicked",onClick:a,children:"Close"})})]})}function Rt({children:e}){return(0,mt.jsx)("div",{className:"resultViewContentComponent",children:e})}function xt({capture:e,active:t,onCaptureSelected:n,onSaveRequested:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),r()},[r]),s=(0,dt.useCallback)(()=>{n()},[n]),o=new Date(e.startTime).toTimeString().split(" ")[0];return(0,mt.jsxs)("li",{className:t?"active":"",onClick:s,children:[e.endState.VisualState.Attachments?e.endState.VisualState.Attachments.map((e,t)=>(0,mt.jsx)("img",{src:encodeURI(e.src)},t)):(0,mt.jsx)("span",{children:e.endState.VisualState.FrameBufferStatus}),(0,mt.jsxs)("span",{children:[o,(0,mt.jsx)("a",{href:"#",className:"captureListItemSave",commandName:"onSaveRequested",onClick:i})]})]})}function wt({active:e,captures:t,onCaptureSelected:n,onSaveRequested:r,onCaptureLoaded:i}){const s=(0,dt.useRef)(null),o=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault()},[]),l=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),function(e,t){let n=null;if(e&&e.dataTransfer&&e.dataTransfer.files&&(n=e.dataTransfer.files),e&&e.target&&e.target.files&&(n=e.target.files),n&&n.length>0)for(let e=0;e{a.error("Error while reading file: "+r.name+e)},i.onload=e=>{try{const n=JSON.parse(e.target.result);t(n)}catch(e){a.error("Error while reading file: "+r.name+e)}},i.readAsText(r)}}(e.nativeEvent,i)},[i]);return(0,mt.jsxs)("div",{className:"captureListComponent "+(e?"active":""),children:[(0,mt.jsx)("div",{className:"openCaptureFile",ref:s,onDragEnter:o,onDragOver:o,onDrop:l,children:(0,mt.jsx)("span",{children:"Drag files here to open a previously saved capture."})}),(0,mt.jsx)("ul",{children:t.map((e,t)=>(0,mt.jsx)(xt,{capture:e.capture,active:e.active,onCaptureSelected:()=>n(t),onSaveRequested:()=>r(e.capture)},t))})]})}function Ft({children:e}){return(0,mt.jsx)("div",{className:"visualStateListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Nt({item:e,onVisualStateSelected:t}){const n=(0,dt.useRef)(null);(0,dt.useEffect)(()=>{e.active&&n.current&&setTimeout(()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const r=(0,dt.useCallback)(()=>{t()},[t]),i=e.VisualState;return(0,mt.jsxs)("li",{ref:n,className:e.active?"active":"",onClick:r,commandName:"onVisualStateSelected",children:[i.Attachments?i.Attachments.map((e,t)=>e.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{src:encodeURI(e.src)}),i.Attachments.length>1&&(0,mt.jsx)("span",{children:e.attachmentName}),!!e.textureLayer&&(0,mt.jsx)("span",{children:"Layer: "+e.textureLayer}),!!e.textureCubeMapFace&&(0,mt.jsx)("span",{children:e.textureCubeMapFace})]},t):null):(0,mt.jsx)("span",{children:i.FrameBufferStatus}),(0,mt.jsx)("span",{children:i.FrameBuffer?"Frame buffer: "+i.FrameBuffer.__SPECTOR_Object_TAG.id:"Canvas frame buffer"})]})}function Lt({children:e}){return(0,mt.jsx)("div",{className:"commandListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Ot({command:e,onCommandSelected:t,onVertexSelected:n,onFragmentSelected:r,onShaderSelected:i}){var s;const o=(0,dt.useRef)(null),a=e.capture,l=function(e){switch(e){case 50:return"deprecated";case 10:return"unused";case 20:return"disabled";case 30:return"redundant";case 40:return"valid";default:return"unknown"}}(a.status),u=!!a.VisualState;let c="";u&&(c=" drawCall"),e.active&&(c=" active"),(0,dt.useEffect)(()=>{e.active&&o.current&&setTimeout(()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const h=(0,dt.useCallback)(e=>{t()},[t]),d=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==n||n()},[n]),f=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==r||r()},[r]),p=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==i||i()},[i]);let m=null;if(u&&"clear"!==a.name)try{const e=a.DrawCall.shaders[0],t=a.DrawCall.shaders[1];m=(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("a",{href:"#",onClick:d,children:e.name}),(0,mt.jsx)("a",{href:"#",onClick:f,children:t.name})]})}catch(e){}const g=(null===(s=a.shader)||void 0===s?void 0:s.source)?(0,mt.jsx)("a",{href:"#",commandName:"onShaderSourceSelected",onClick:p,children:"Source"}):null;return(0,mt.jsxs)("li",{ref:o,className:c,onClick:h,commandName:"onCommandSelected",children:[a.marker&&(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.marker+" "}),"LOG"===a.name?(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.text+" "}):(0,mt.jsx)("span",{dangerouslySetInnerHTML:{__html:a.text.replace(a.name,`${a.name}`)}}),g,m]})}function It({children:e}){return(0,mt.jsx)("div",{className:"commandDetailComponent",children:e})}function kt({left:e,children:t}){return(0,mt.jsx)("div",{className:e?"informationColumnLeftComponent":"informationColumnRightComponent",children:t})}function Mt({children:e}){return(0,mt.jsx)("div",{className:"jsonContentComponent",children:e})}function Pt(e,t,n,r){return{row:Math.max(0,parseInt(t,10)-1),column:n?Math.max(0,parseInt(n,10)-1):0,text:r.trim()||e,type:e.toLowerCase()}}var Bt,Ut,$t=Object.create,Gt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor,Wt=Object.getOwnPropertyNames,Ht=Object.getPrototypeOf,jt=Object.prototype.hasOwnProperty,zt=e=>{throw TypeError(e)},Xt=(e,t)=>{for(var n in t)Gt(e,n,{get:t[n],enumerable:!0})},Kt=(e,t,n)=>(((e,t)=>{t.has(e)||zt("Cannot access private method")})(e,t),n),Yt=(Bt=e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=/\r\n|[\n\r\u2028\u2029]/;e.codeFrameColumns=function(e,n,r={}){let i=new Proxy({},{get:()=>e=>e}),s=e.split(t),{start:o,end:a,markerLines:l}=function(e,t,n){let r=Object.assign({column:0,line:-1},e.start),i=Object.assign({},r,e.end),{linesAbove:s=2,linesBelow:o=3}=n||{},a=r.line,l=r.column,u=i.line,c=i.column,h=Math.max(a-(s+1),0),d=Math.min(t.length,u+o);-1===a&&(h=0),-1===u&&(d=t.length);let f=u-a,p={};if(f)for(let e=0;e<=f;e++){let n=e+a;if(l)if(0===e){let e=t[n-1].length;p[n]=[l,e-l+1]}else if(e===f)p[n]=[0,c];else{let r=t[n-e].length;p[n]=[0,r]}else p[n]=!0}else p[a]=l===c?!l||[l,0]:[l,c-l];return{start:h,end:d,markerLines:p}}(n,s,r),u=n.start&&"number"==typeof n.start.column,c=String(a).length,h=e.split(t,a).slice(o,a).map((e,t)=>{let n=o+1+t,s=` ${` ${n}`.slice(-c)} |`,a=l[n],u=!l[n+1];if(a){let t="";if(Array.isArray(a)){let n=e.slice(0,Math.max(a[0]-1,0)).replace(/[^\t]/g," "),o=a[1]||1;t=["\n ",i.gutter(s.replace(/\d/g," "))," ",n,i.marker("^").repeat(o)].join(""),u&&r.message&&(t+=" "+i.message(r.message))}return[i.marker(">"),i.gutter(s),e.length>0?` ${e}`:"",t].join("")}return` ${i.gutter(s)}${e.length>0?` ${e}`:""}`}).join("\n");return r.message&&!u&&(h=`${" ".repeat(c+1)}${r.message}\n${h}`),h}},()=>(Ut||Bt((Ut={exports:{}}).exports),Ut.exports));Xt({},{__debug:()=>Hs,check:()=>Vs,doc:()=>vs,format:()=>Gs,formatWithCursor:()=>$s,getSupportInfo:()=>Ws,util:()=>_s,version:()=>As});var qt=(e,t,n,r)=>{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Qt=class{diff(e,t,n={}){let r;"function"==typeof n?(r=n,n={}):"callback"in n&&(r=n.callback);let i=this.castInput(e,n),s=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),a=this.removeEmpty(this.tokenize(s,n));return this.diffWithOptionsObj(o,a,n,r)}diffWithOptionsObj(e,t,n,r){var i;let s=e=>(e=this.postProcess(e,n),r?void setTimeout(function(){r(e)},0):e),o=t.length,a=e.length,l=1,u=o+a;null!=n.maxEditLength&&(u=Math.min(u,n.maxEditLength));let c=null!==(i=n.timeout)&&void 0!==i?i:1/0,h=Date.now()+c,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=a&&f+1>=o)return s(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,g=()=>{for(let r=Math.max(p,-l);r<=Math.min(m,l);r+=2){let i,l=d[r-1],u=d[r+1];l&&(d[r-1]=void 0);let c=!1;if(u){let e=u.oldPos-r;c=u&&0<=e&&e=a&&f+1>=o)return s(this.buildValues(i.lastComponent,t,e))||!0;d[r]=i,i.oldPos+1>=a&&(m=Math.min(m,r-1)),f+1>=o&&(p=Math.max(p,r+1))}else d[r]=void 0}l++};if(r)!function e(){setTimeout(function(){if(l>u||Date.now()>h)return r(void 0);g()||e()},0)}();else for(;l<=u&&Date.now()<=h;){let e=g();if(e)return e}}addToPath(e,t,n,r,i){let s=e.lastComponent;return s&&!i.oneChangePerToken&&s.added===t&&s.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:s.count+1,added:t,removed:n,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:s}}}extractCommon(e,t,n,r,i){let s=t.length,o=n.length,a=e.oldPos,l=a-r,u=0;for(;l+1e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(a,a+e.count));a+=e.count,e.added||(l+=e.count)}}return i}},Zt=new class extends Qt{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Jt(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}function en(e,t){let n;switch(t){case"\n":n=/\n/gu;break;case"\r":n=/\r/gu;break;case"\r\n":n=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let r=e.match(n);return r?r.length:0}var tn="string",nn="array",rn="cursor",sn="indent",on="align",an="trim",ln="group",un="fill",cn="if-break",hn="indent-if-break",dn="line-suffix",fn="line-suffix-boundary",pn="line",mn="label",gn="break-parent",En=new Set([rn,sn,on,an,ln,un,cn,hn,dn,fn,pn,mn,gn]),vn=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},Cn=function(e){if("string"==typeof e)return tn;if(Array.isArray(e))return nn;if(!e)return;let{type:t}=e;return En.has(t)?t:void 0};var Dn=class extends Error{name="InvalidDocError";constructor(e){super(function(e){let t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(Cn(e))throw new Error("doc is valid.");let n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;let r=(e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e))([...En].map(e=>`'${e}'`));return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},Sn=Dn,An={},_n=function(e,t,n,r){let i=[e];for(;i.length>0;){let e=i.pop();if(e===An){n(i.pop());continue}n&&i.push(e,An);let s=Cn(e);if(!s)throw new Sn(e);if(!1!==(null==t?void 0:t(e)))switch(s){case nn:case un:{let t=s===nn?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case cn:i.push(e.flatContents,e.breakContents);break;case ln:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case on:case sn:case hn:case mn:case dn:i.push(e.contents);break;case tn:case rn:case an:case fn:case pn:case gn:break;default:throw new Sn(e)}}};function yn(e,t){if("string"==typeof e)return t(e);let n=new Map;return function e(r){if(n.has(r))return n.get(r);let i=function(n){switch(Cn(n)){case nn:return t(n.map(e));case un:return t({...n,parts:n.parts.map(e)});case cn:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case ln:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case on:case sn:case hn:case mn:case dn:return t({...n,contents:e(n.contents)});case tn:case rn:case an:case fn:case pn:case gn:return t(n);default:throw new Sn(n)}}(r);return n.set(r,i),i}(e)}function bn(e,t,n){let r=n,i=!1;return _n(e,function(e){if(i)return!1;let n=t(e);void 0!==n&&(i=!0,r=n)}),r}function Tn(e){if(e.type===ln&&e.break||e.type===pn&&e.hard||e.type===gn)return!0}function Rn(e){if(e.length>0){let t=vn(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function xn(e){return e.type!==pn||e.hard?e.type===cn?e.flatContents:e:e.soft?"":" "}function wn(e){for(e=[...e];e.length>=2&&vn(!1,e,-2).type===pn&&vn(!1,e,-1).type===gn;)e.length-=2;if(e.length>0){let t=Fn(vn(!1,e,-1));e[e.length-1]=t}return e}function Fn(e){switch(Cn(e)){case sn:case hn:case ln:case dn:case mn:{let t=Fn(e.contents);return{...e,contents:t}}case cn:return{...e,breakContents:Fn(e.breakContents),flatContents:Fn(e.flatContents)};case un:return{...e,parts:wn(e.parts)};case nn:return wn(e);case tn:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return tfunction(e){switch(Cn(e)){case un:if(e.parts.every(e=>""===e))return"";break;case ln:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===ln&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case on:case sn:case hn:case dn:if(!e.contents)return"";break;case cn:if(!e.flatContents&&!e.breakContents)return"";break;case nn:{let t=[];for(let n of e){if(!n)continue;let[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof vn(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case tn:case rn:case an:case fn:case pn:case mn:case gn:break;default:throw new Sn(e)}return e}(e))}(e))}function Ln(e){if(e.type===pn)return!0}function On(e,t){return e.type===mn?{...e,contents:t(e.contents)}:t(e)}var In=()=>{},kn=In,Mn=In,Pn=In;function Bn(e){return kn(e),{type:sn,contents:e}}function Un(e,t){return kn(t),{type:on,contents:t,n:e}}function $n(e,t={}){return kn(e),Mn(t.expandedStates,!0),{type:ln,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Gn(e){return kn(e),{type:dn,contents:e}}var Vn={type:fn},Wn={type:gn},Hn={type:an},jn={type:pn,hard:!0},zn={type:pn,hard:!0,literal:!0},Xn={type:pn},Kn={type:pn,soft:!0},Yn=[jn,Wn],qn=[zn,Wn],Qn={type:rn};function Zn(e,t){kn(e),Mn(t);let n=[];for(let r=0;r0){for(let e=0;e!(function(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}(e)||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e)),nr=/[^\x20-\x7F]/u,rr=function(e){if(!e)return 0;if(!nr.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(let n of e){let e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=tr(e)?1:2)}return t},ir=Symbol("MODE_BREAK"),sr=Symbol("MODE_FLAT"),or=Symbol("cursor"),ar=Symbol("DOC_FILL_PRINTED_LENGTH");function lr(e,t){return cr(e,{type:"indent"},t)}function ur(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?cr(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:cr(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function cr(e,t,n){let r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t],i="",s=0,o=0,a=0;for(let e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function hr(e){let t=0,n=0,r=e.length;e:for(;r--;){let i=e[r];if(i!==or)for(let n=i.length-1;n>=0;n--){let s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(or);return t}function dr(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length,a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}let{mode:e,doc:u}=a.pop(),c=Cn(u);switch(c){case tn:l.push(u),n-=rr(u);break;case nn:case un:{let t=c===nn?u:u.parts,n=u[ar]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case sn:case on:case hn:case mn:a.push({mode:e,doc:u.contents});break;case an:n+=hr(l);break;case ln:{if(s&&u.break)return!1;let t=u.break?ir:e,n=u.expandedStates&&t===ir?vn(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case cn:{let t=(u.groupId?i[u.groupId]||sr:e)===ir?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case pn:if(e===ir||u.hard)return!0;u.soft||(l.push(" "),n--);break;case dn:r=!0;break;case fn:if(r)return!1}}return!1}function fr(e,t){let n={},r=t.printWidth,i=Jt(t.endOfLine),s=0,o=[{ind:{value:"",length:0,queue:[]},mode:ir,doc:e}],a=[],l=!1,u=[],c=0;for(function(e){let t=new Set,n=[];_n(e,function(e){if(e.type===gn&&Rn(n),e.type===ln){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===ln&&n.pop().break&&Rn(n)},!0)}(e);o.length>0;){let{ind:e,mode:h,doc:d}=o.pop();switch(Cn(d)){case tn:{let e="\n"!==i?qt(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=rr(e));break}case nn:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case rn:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(or),c++;break;case sn:o.push({ind:lr(e,t),mode:h,doc:d.contents});break;case on:o.push({ind:ur(e,d.n,t),mode:h,doc:d.contents});break;case an:s-=hr(a);break;case ln:switch(h){case sr:if(!l){o.push({ind:e,mode:d.break?ir:sr,doc:d.contents});break}case ir:{l=!1;let t={ind:e,mode:sr,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&dr(t,o,i,a,n))o.push(t);else if(d.expandedStates){let t=vn(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:ir,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:ir,doc:t});break}{let t=d.expandedStates[r],s={ind:e,mode:sr,doc:t};if(dr(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:ir,doc:d.contents});break}}d.id&&(n[d.id]=vn(!1,o,-1).mode);break;case un:{let t=r-s,i=d[ar]??0,{parts:a}=d,l=a.length-i;if(0===l)break;let c=a[i+0],f=a[i+1],p={ind:e,mode:sr,doc:c},m={ind:e,mode:ir,doc:c},g=dr(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}let E={ind:e,mode:sr,doc:f},v={ind:e,mode:ir,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}let C=a[i+2],D={ind:e,mode:h,doc:{...d,[ar]:i+2}};dr({ind:e,mode:sr,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case cn:case hn:{let t=d.groupId?n[d.groupId]:h;if(t===ir){let t=d.type===cn?d.breakContents:d.negate?d.contents:Bn(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===sr){let t=d.type===cn?d.flatContents:d.negate?Bn(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case dn:u.push({ind:e,mode:h,doc:d.contents});break;case fn:u.length>0&&o.push({ind:e,mode:h,doc:jn});break;case pn:switch(h){case sr:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case ir:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=hr(a),a.push(i+e.value),s=e.length)}break;case mn:o.push({ind:e,mode:h,doc:d.contents});break;case gn:break;default:throw new Sn(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}let h=a.indexOf(or);if(-1!==h){let e=a.indexOf(or,h+1);if(-1===e)return{formatted:a.filter(e=>e!==or).join("")};let t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}var pr,mr,gr,Er=function(e,t,n=0){let r=0;for(let i=n;i=0;n-=2)if(!Array.isArray(t[n])&&--e<0)return n;return-1},gr=function*(){let{stack:e}=this;for(let t=e.length-3;t>=0;t-=2){let n=e[t];Array.isArray(n)||(yield n)}};var vr=class{constructor(e){((e,t)=>{t.has(e)?zt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,void 0)})(this,pr),this.stack=[e]}get key(){let{stack:e,siblings:t}=this;return vn(!1,e,null===t?-2:-4)??null}get index(){return null===this.siblings?null:vn(!1,this.stack,-2)}get node(){return vn(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return null!==this.siblings}get siblings(){let{stack:e}=this,t=vn(!1,e,-3);return Array.isArray(t)?t:null}get next(){let{siblings:e}=this;return null===e?null:e[this.index+1]}get previous(){let{siblings:e}=this;return null===e?null:e[this.index-1]}get isFirst(){return 0===this.index}get isLast(){let{siblings:e,index:t}=this;return null!==e&&t===e.length-1}get isRoot(){return 1===this.stack.length}get root(){return this.stack[0]}get ancestors(){return[...Kt(this,pr,gr).call(this)]}getName(){let{stack:e}=this,{length:t}=e;return t>1?vn(!1,e,-2):null}getValue(){return vn(!1,this.stack,-1)}getNode(e=0){let t=Kt(this,pr,mr).call(this,e);return-1===t?null:this.stack[t]}getParentNode(e=0){return this.getNode(e+1)}call(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{return e(this)}finally{n.length=r}}callParent(e,t=0){let n=Kt(this,pr,mr).call(this,t+1),r=this.stack.splice(n+1);try{return e(this)}finally{this.stack.push(...r)}}each(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{for(let t=0;t{n[r]=e(t,r,i)},...t),n}match(...e){let t=this.stack.length-1,n=null,r=this.stack[t--];for(let i of e){if(void 0===r)return!1;let e=null;if("number"==typeof n&&(e=n,n=this.stack[t--],r=this.stack[t--]),i&&!i(r,n,e))return!1;n=this.stack[t--],r=this.stack[t--]}return!0}findAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return t}hasAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return!0;return!1}},Cr=new Proxy(()=>{},{get:()=>Cr}),Dr=Cr;function*Sr(e,t){let{getVisitorKeys:n,filter:r=()=>!0}=t,i=e=>function(e){return null!==e&&"object"==typeof e}(e)&&r(e);for(let t of n(e)){let n=e[t];if(Array.isArray(n))for(let e of n)i(e)&&(yield e);else i(n)&&(yield n)}}function Ar(e){return(t,n,r)=>{let i=!(null==r||!r.backwards);if(!1===n)return!1;let{length:s}=t,o=n;for(;o>=0&&oObject.keys(e).filter(e=>!wr.has(e)),Nr=function(e){return e?t=>e(t,wr):Fr};function Lr(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=function(e){let t=e.type||e.kind||"(unknown type)",n=String(e.name||e.id&&("object"==typeof e.id?e.id.name:e.id)||e.key&&("object"==typeof e.key?e.key.name:e.key)||e.value&&("object"==typeof e.value?"":String(e.value))||e.operator||"");return n.length>20&&(n=n.slice(0,19)+"…"),t+(n?" "+n:"")}(e)}function Or(e,t){t.leading=!0,t.trailing=!1,Lr(e,t)}function Ir(e,t,n){t.leading=!1,t.trailing=!1,n&&(t.marker=n),Lr(e,t)}function kr(e,t){t.leading=!1,t.trailing=!0,Lr(e,t)}var Mr=new WeakMap;function Pr(e,t){if(Mr.has(e))return Mr.get(e);let{printer:{getCommentChildNodes:n,canAttachComment:r,getVisitorKeys:i},locStart:s,locEnd:o}=t;if(!r)return[];let a=((null==n?void 0:n(e,t))??[...Sr(e,{getVisitorKeys:Nr(i)})]).flatMap(e=>r(e)?[e]:Pr(e,t));return a.sort((e,t)=>s(e)-s(t)||o(e)-o(t)),Mr.set(e,a),a}function Br(e,t,n,r){let i,s,{locStart:o,locEnd:a}=n,l=o(t),u=a(t),c=Pr(e,n),h=0,d=c.length;for(;h>1,r=c[e],f=o(r),p=a(r);if(f<=l&&u<=p)return Br(r,t,n,r);if(p<=l)i=r,h=e+1;else{if(!(u<=f))throw new Error("Comment location overlaps with node location");s=r,d=e}}if("TemplateLiteral"===(null==r?void 0:r.type)){let{quasis:e}=r,o=Hr(e,t,n);i&&Hr(e,i,n)!==o&&(i=null),s&&Hr(e,s,n)!==o&&(s=null)}return{enclosingNode:r,precedingNode:i,followingNode:s}}var Ur=()=>!1,$r=e=>!/[\S\n\u2028\u2029]/u.test(e);function Gr(e,t,n,r){let{comment:i,precedingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=o(i);if(s)for(let t=r-1;t>=0;t--){let{comment:r,precedingNode:i}=n[t];if(i!==s||!$r(e.slice(a(r),l)))break;l=o(r)}return xr(e,l,{backwards:!0})}function Vr(e,t,n,r){let{comment:i,followingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=a(i);if(s)for(let t=r+1;t0;--s){let{comment:i,precedingNode:u,followingNode:c}=e[s-1];Dr.strictEqual(u,o),Dr.strictEqual(c,a);let h=t.originalText.slice(t.locEnd(i),l);if(!((null==(r=(n=t.printer).isGap)?void 0:r.call(n,h,t))??/^[\s(]*$/u.test(h)))break;l=t.locStart(i)}for(let[t,{comment:n}]of e.entries())t1&&e.comments.sort((e,n)=>t.locStart(e)-t.locStart(n));e.length=0}function Hr(e,t,n){let r=n.locStart(t)-1;for(let t=1;t"string"==typeof e||"function"==typeof e,choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>"string"==typeof e||"object"==typeof e,cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:"Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.",cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:"Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.",cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function qr({plugins:e=[],showDeprecated:t=!1}={}){let n=e.flatMap(e=>e.languages??[]),r=[];for(let i of function(e){let t=[];for(let[n,r]of Object.entries(e)){let e={name:n,...r};Array.isArray(e.default)&&(e.default=vn(!1,e.default,-1).value),t.push(e)}return t}(Object.assign({},...e.map(({options:e})=>e),Yr)))!t&&i.deprecated||(Array.isArray(i.choices)&&(t||(i.choices=i.choices.filter(e=>!e.deprecated)),"parser"===i.name&&(i.choices=[...i.choices,...Qr(i.choices,n,e)])),i.pluginDefaults=Object.fromEntries(e.filter(e=>{var t;return void 0!==(null==(t=e.defaultOptions)?void 0:t[i.name])}).map(e=>[e.name,e.defaultOptions[i.name]])),r.push(i));return{languages:n,options:r}}function*Qr(e,t,n){let r=new Set(e.map(e=>e.value));for(let e of t)if(e.parsers)for(let t of e.parsers)if(!r.has(t)){r.add(t);let i=n.find(e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t)),s=e.name;null!=i&&i.name&&(s+=` (plugin: ${i.name})`),yield{value:t,description:s}}}var Zr,Jr,ei,ti,ni,ri="windows"===(null==(Zr=globalThis.Deno)?void 0:Zr.build.os)||(null==(ei=null==(Jr=globalThis.navigator)?void 0:Jr.platform)?void 0:ei.startsWith("Win"))||(null==(ni=null==(ti=globalThis.process)?void 0:ti.platform)?void 0:ni.startsWith("win"))||!1;function ii(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function si(e,t){if(!t)return;let n=(e=>String(e).split(/[/\\]/u).pop())(t).toLowerCase();return e.find(({filenames:e})=>null==e?void 0:e.some(e=>e.toLowerCase()===n))??e.find(({extensions:e})=>null==e?void 0:e.some(e=>n.endsWith(e)))}function oi(e,t){if(t){if(String(t).startsWith("file:"))try{t=function(e){return ri?function(e){e=ii(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return""!==e.hostname&&(t=`\\\\${e.hostname}${t}`),t}(e):function(e){return e=ii(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}(e)}(t)}catch{return}if("string"==typeof t)return e.find(({isSupported:e})=>null==e?void 0:e({filepath:t}))}}var ai=function(e,t){let n=((e,t)=>{if(!e||null!=t)return t.toReversed||!Array.isArray(t)?t.toReversed():[...t].reverse()})(!1,e.plugins).flatMap(e=>e.languages??[]),r=function(e,t){if(t)return e.find(({name:e})=>e.toLowerCase()===t)??e.find(({aliases:e})=>null==e?void 0:e.includes(t))??e.find(({extensions:e})=>null==e?void 0:e.includes(`.${t}`))}(n,t.language)??si(n,t.physicalFile)??si(n,t.file)??oi(n,t.physicalFile)??oi(n,t.file)??void t.physicalFile;return null==r?void 0:r.parsers[0]},li={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(e=>li.value(e)).join(", ")}]`;let t=Object.keys(e);return 0===t.length?"{}":`{ ${t.map(t=>`${li.key(t)}: ${li.value(e[t])}`).join(", ")} }`},pair:({key:e,value:t})=>li.value({[e]:t})},ui=new Proxy(String,{get:()=>ui}),ci=ui,hi=Symbol.for("vnopts.VALUE_NOT_EXIST"),di=Symbol.for("vnopts.VALUE_UNCHANGED"),fi=" ".repeat(2);function pi(e,t,n,r){return[`Invalid ${ci.red(r.key(e))} value.`,`Expected ${ci.blue(n)},`,`but received ${t===hi?ci.gray("nothing"):ci.red(r.value(t))}.`].join(" ")}function mi({text:e,list:t},n){let r=[];return e&&r.push(`- ${ci.blue(e)}`),t&&r.push([`- ${ci.blue(t.title)}:`].concat(t.values.map(e=>mi(e,n-fi.length).replace(/^|\n/g,`$&${fi}`))).join("\n")),gi(r,n)}function gi(e,t){if(1===e.length)return e[0];let[n,r]=e,[i,s]=e.map(e=>e.split("\n",1)[0].length);return i>t&&i>s?r:n}var Ei=[],vi=[],Ci=(e,t,{descriptor:n,logger:r,schemas:i})=>{let s=[`Ignored unknown option ${ci.yellow(n.pair({key:e,value:t}))}.`],o=Object.keys(i).sort().find(t=>function(e,t){if(e===t)return 0;let n=e;e.length>t.length&&(e=t,t=n);let r=e.length,i=t.length;for(;r>0&&e.charCodeAt(~-r)===t.charCodeAt(~-i);)r--,i--;let s=0;for(;sa?u>a?a+1:u:u>l?l+1:u;return a}(e,t)<3);o&&s.push(`Did you mean ${ci.blue(n.key(o))}?`),r.warn(s.join(" "))},Di=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"],Si=class{static create(e){return function(e,t){let n=new e(t),r=Object.create(n);for(let e of Di)e in t&&(r[e]=Ai(t[e],n,Si.prototype[e].length));return r}(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,t){return!1}deprecated(e,t){return!1}forward(e,t){}redirect(e,t){}overlap(e,t,n){return e}preprocess(e,t){return e}postprocess(e,t){return di}};function Ai(e,t,n){return"function"==typeof e?(...r)=>e(...r.slice(0,n-1),t,...r.slice(n-1)):()=>e}var _i=class extends Si{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},yi=class extends Si{expected(){return"anything"}validate(){return!0}},bi=class extends Si{constructor({valueSchema:e,name:t=e.name,...n}){super({...n,name:t}),this._valueSchema=e}expected(e){let{text:t,list:n}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:t&&`an array of ${t}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(e,t){if(!Array.isArray(e))return!1;let n=[];for(let r of e){let e=t.normalizeValidateResult(this._valueSchema.validate(r,t),r);!0!==e&&n.push(e.value)}return 0===n.length||{value:n}}deprecated(e,t){let n=[];for(let r of e){let e=t.normalizeDeprecatedResult(this._valueSchema.deprecated(r,t),r);!1!==e&&n.push(...e.map(({value:e})=>({value:[e]})))}return n}forward(e,t){let n=[];for(let r of e){let e=t.normalizeForwardResult(this._valueSchema.forward(r,t),r);n.push(...e.map(Ti))}return n}redirect(e,t){let n=[],r=[];for(let i of e){let e=t.normalizeRedirectResult(this._valueSchema.redirect(i,t),i);"remain"in e&&n.push(e.remain),r.push(...e.redirect.map(Ti))}return 0===n.length?{redirect:r}:{redirect:r,remain:n}}overlap(e,t){return e.concat(t)}};function Ti({from:e,to:t}){return{from:[e],to:t}}var Ri=class extends Si{expected(){return"true or false"}validate(e){return"boolean"==typeof e}};function xi(e,t){let n=Object.create(null);for(let r of e){let e=r[t];if(n[e])throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n[e]=r}return n}function wi(e,t){if(e===t)return 0;let n=typeof e,r=typeof t,i=["undefined","object","boolean","number","string"];return n!==r?i.indexOf(n)-i.indexOf(r):"string"!==n?Number(e)-Number(t):e.localeCompare(t)}function Fi(e){return void 0===e?{}:e}function Ni(e){if("string"==typeof e)return{text:e};let{text:t,list:n}=e;return function(e){if(!e)throw new Error("Unexpected `expected` result, there should be at least one field.")}(void 0!==(t||n)),n?{text:t,list:{title:n.title,values:n.values.map(Ni)}}:{text:t}}function Li(e,t){return!0===e||(!1===e?{value:t}:e)}function Oi(e,t,n=!1){return!1!==e&&(!0===e?!!n||[{value:t}]:"value"in e?[e]:0!==e.length&&e)}function Ii(e,t){return"string"==typeof e||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function ki(e,t){return void 0===e?[]:Array.isArray(e)?e.map(e=>Ii(e,t)):[Ii(e,t)]}function Mi(e,t){let n=ki("object"==typeof e&&"redirect"in e?e.redirect:e,t);return 0===n.length?{remain:t,redirect:n}:"object"==typeof e&&"remain"in e?{remain:e.remain,redirect:n}:{redirect:n}}var Pi,Bi=class extends Si{constructor(e){super(e),this._choices=function(e,t){let n=new Map;for(let r of e){let e=r[t];if(n.has(e))throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n.set(e,r)}return n}(e.choices.map(e=>e&&"object"==typeof e?e:{value:e}),"value")}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(e=>this._choices.get(e)).filter(({hidden:e})=>!e).map(e=>e.value).sort(wi).map(e.value),n=t.slice(0,-2),r=t.slice(-2);return{text:n.concat(r.join(" or ")).join(", "),list:{title:"one of the following values",values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return!(!t||!t.deprecated)&&{value:e}}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},Ui=class extends Si{expected(){return"a number"}validate(e,t){return"number"==typeof e}},$i=class extends Ui{expected(){return"an integer"}validate(e,t){return!0===t.normalizeValidateResult(super.validate(e,t),e)&&function(e){return e===Math.floor(e)}(e)}},Gi=class extends Si{expected(){return"a string"}validate(e){return"string"==typeof e}},Vi=li,Wi=Ci,Hi=(e,t,n)=>{let{text:r,list:i}=n.normalizeExpectedResult(n.schemas[e].expected(n)),s=[];return r&&s.push(pi(e,t,r,n.descriptor)),i&&s.push([pi(e,t,i.title,n.descriptor)].concat(i.values.map(e=>mi(e,n.loggerPrintWidth))).join("\n")),gi(s,n.loggerPrintWidth)},ji=(e,t,{descriptor:n})=>{let r=[`${ci.yellow("string"==typeof e?n.key(e):n.pair(e))} is deprecated`];return t&&r.push(`we now treat it as ${ci.blue("string"==typeof t?n.key(t):n.pair(t))}`),r.join("; ")+"."},zi=class{constructor(e,t){let{logger:n=console,loggerPrintWidth:r=80,descriptor:i=Vi,unknown:s=Wi,invalid:o=Hi,deprecated:a=ji,missing:l=()=>!1,required:u=()=>!1,preprocess:c=e=>e,postprocess:h=()=>di}=t||{};this._utils={descriptor:i,logger:n||{warn:()=>{}},loggerPrintWidth:r,schemas:xi(e,"name"),normalizeDefaultResult:Fi,normalizeExpectedResult:Ni,normalizeDeprecatedResult:Oi,normalizeForwardResult:ki,normalizeRedirectResult:Mi,normalizeValidateResult:Li},this._unknownHandler=s,this._invalidHandler=function(e){return(...t)=>{let n=e(...t);return"string"==typeof n?new Error(n):n}}(o),this._deprecatedHandler=a,this._identifyMissing=(e,t)=>!(e in t)||l(e,t),this._identifyRequired=u,this._preprocess=c,this._postprocess=h,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=function(){let e=Object.create(null);return t=>{let n=JSON.stringify(t);return!!e[n]||(e[n]=!0,!1)}}()}normalize(e){let t={},n=[this._preprocess(e,this._utils)],r=()=>{for(;0!==n.length;){let e=n.shift(),r=this._applyNormalization(e,t);n.push(...r)}};r();for(let e of Object.keys(this._utils.schemas)){let r=this._utils.schemas[e];if(!(e in t)){let t=Fi(r.default(this._utils));"value"in t&&n.push({[e]:t.value})}}r();for(let e of Object.keys(this._utils.schemas)){if(!(e in t))continue;let n=this._utils.schemas[e],r=t[e],i=n.postprocess(r,this._utils);i!==di&&(this._applyValidation(i,e,n),t[e]=i)}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let n=[],{knownKeys:r,unknownKeys:i}=this._partitionOptionKeys(e);for(let i of r){let r=this._utils.schemas[i],s=r.preprocess(e[i],this._utils);this._applyValidation(s,i,r);let o=({from:e,to:t})=>{n.push("string"==typeof t?{[t]:e}:{[t.key]:t.value})},a=({value:e,redirectTo:t})=>{let n=Oi(r.deprecated(e,this._utils),s,!0);if(!1!==n)if(!0===n)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,t,this._utils));else for(let{value:e}of n){let n={key:i,value:e};if(!this._hasDeprecationWarned(n)){let r="string"==typeof t?{key:t,value:e}:t;this._utils.logger.warn(this._deprecatedHandler(n,r,this._utils))}}};ki(r.forward(s,this._utils),s).forEach(o);let l=Mi(r.redirect(s,this._utils),s);if(l.redirect.forEach(o),"remain"in l){let e=l.remain;t[i]=i in t?r.overlap(t[i],e,this._utils):e,a({value:e})}for(let{from:e,to:t}of l.redirect)a({value:e,redirectTo:t})}for(let r of i){let i=e[r];this._applyUnknownHandler(r,i,t,(e,t)=>{n.push({[e]:t})})}return n}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,hi,this._utils)}_partitionOptionKeys(e){let[t,n]=function(e,t){let n=[],r=[];for(let i of e)t(i)?n.push(i):r.push(i);return[n,r]}(Object.keys(e).filter(t=>!this._identifyMissing(t,e)),e=>e in this._utils.schemas);return{knownKeys:t,unknownKeys:n}}_applyValidation(e,t,n){let r=Li(n.validate(e,this._utils),e);if(!0!==r)throw this._invalidHandler(t,r.value,this._utils)}_applyUnknownHandler(e,t,n,r){let i=this._unknownHandler(e,t,this._utils);if(i)for(let e of Object.keys(i)){if(this._identifyMissing(e,i))continue;let t=i[e];e in this._utils.schemas?r(e,t):n[e]=t}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==di){if(t.delete)for(let n of t.delete)delete e[n];if(t.override){let{knownKeys:n,unknownKeys:r}=this._partitionOptionKeys(t.override);for(let r of n){let n=t.override[r];this._applyValidation(n,r,this._utils.schemas[r]),e[r]=n}for(let n of r){let r=t.override[n];this._applyUnknownHandler(n,r,e,(t,n)=>{let r=this._utils.schemas[t];this._applyValidation(n,t,r),e[t]=n})}}}}};function Xi(e,{isCLI:t,optionInfos:n,FlagSchema:r}){let i,{name:s}=e,o={name:s},a={};switch(e.type){case"int":i=$i,t&&(o.preprocess=Number);break;case"string":case"path":i=Gi;break;case"choice":i=Bi,o.choices=e.choices.map(t=>null!=t&&t.redirect?{...t,redirect:{to:{key:e.name,value:t.redirect}}}:t);break;case"boolean":i=Ri;break;case"flag":i=r,o.flags=n.flatMap(e=>[e.alias,e.description&&e.name,e.oppositeDescription&&`no-${e.name}`].filter(Boolean));break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?o.validate=(t,n,r)=>e.exception(t)||n.validate(t,r):o.validate=(e,t,n)=>void 0===e||t.validate(e,n),e.redirect&&(a.redirect=t=>t?{to:"string"==typeof e.redirect?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(a.deprecated=!0),t&&!e.array){let e=o.preprocess||(e=>e);o.preprocess=(t,n,r)=>n.preprocess(e(Array.isArray(t)?vn(!1,t,-1):t),r)}return e.array?bi.create({...t?{preprocess:e=>Array.isArray(e)?e:[e]}:{},...a,valueSchema:i.create(o)}):i.create({...o,...a})}var Ki=(e,t,n)=>{if(!e||null!=t){if(t.findLast)return t.findLast(n);for(let e=t.length-1;e>=0;e--){let r=t[e];if(n(r,e,t))return r}}};function Yi(e,t){if(!t)throw new Error("parserName is required.");let n=Ki(!1,e,e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t));if(n)return n;let r=`Couldn't resolve parser "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}function qi({plugins:e,parser:t}){return Qi(Yi(e,t),t)}function Qi(e,t){let n=e.parsers[t];return"function"==typeof n?n():n}var Zi={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null},Ji=async function(e,t={}){var n;let r={...e};if(!r.parser){if(!r.filepath)throw new Kr("No parser and no file path given, couldn't infer a parser.");if(r.parser=ai(r,{physicalFile:r.filepath}),!r.parser)throw new Kr(`No parser could be inferred for file "${r.filepath}".`)}let i=qr({plugins:e.plugins,showDeprecated:!0}).options,s={...Zi,...Object.fromEntries(i.filter(e=>void 0!==e.default).map(e=>[e.name,e.default]))},o=Yi(r.plugins,r.parser),a=await Qi(o,r.parser);r.astFormat=a.astFormat,r.locEnd=a.locEnd,r.locStart=a.locStart;let l=null!=(n=o.printers)&&n[a.astFormat]?o:function(e,t){if(!t)throw new Error("astFormat is required.");let n=Ki(!1,e,e=>e.printers&&Object.prototype.hasOwnProperty.call(e.printers,t));if(n)return n;let r=`Couldn't find plugin for AST format "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}(r.plugins,a.astFormat),u=await function(e,t){let n=e.printers[t];return"function"==typeof n?n():n}(l,a.astFormat);r.printer=u;let c={...s,...l.defaultOptions?Object.fromEntries(Object.entries(l.defaultOptions).filter(([,e])=>void 0!==e)):{}};for(let[e,t]of Object.entries(c))(null===r[e]||void 0===r[e])&&(r[e]=t);return"json"===r.parser&&(r.trailingComma="none"),function(e,t,{logger:n=!1,isCLI:r=!1,passThrough:i=!1,FlagSchema:s,descriptor:o}={}){if(r){if(!s)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=li;let a=i?Array.isArray(i)?(e,t)=>i.includes(e)?{[e]:t}:void 0:(e,t)=>({[e]:t}):(e,t,n)=>{let{_:r,...i}=n.schemas;return Ci(e,t,{...n,schemas:i})},l=function(e,{isCLI:t,FlagSchema:n}){let r=[];t&&r.push(yi.create({name:"_"}));for(let i of e)r.push(Xi(i,{isCLI:t,optionInfos:e,FlagSchema:n})),i.alias&&t&&r.push(_i.create({name:i.alias,sourceName:i.name}));return r}(t,{isCLI:r,FlagSchema:s}),u=new zi(l,{logger:n,unknown:a,descriptor:o}),c=!1!==n;c&&Pi&&(u._hasDeprecationWarned=Pi);let h=u.normalize(e);return c&&(Pi=u._hasDeprecationWarned),h}(r,i,{passThrough:Object.keys(Zi),...t})},es=((e,t,n)=>(n=null!=e?$t(Ht(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of Wt(t))!jt.call(e,n)&&void 0!==n&&Gt(e,n,{get:()=>t[n],enumerable:!(r=Vt(t,n))||r.enumerable});return e})(Gt(n,"default",{value:e,enumerable:!0}),e)))(Yt()),ts=async function(e,t){let n,r=await qi(t),i=r.preprocess?r.preprocess(e,t):e;t.originalText=i;try{n=await r.parse(i,t,t)}catch(t){!function(e,t){let{loc:n}=e;if(n){let r=(0,es.codeFrameColumns)(t,n,{highlightCode:!0});throw e.message+="\n"+r,e.codeFrame=r,e}throw e}(t,e)}return{text:i,ast:n}};async function ns(e,t){({ast:e}=await is(e,t));let n=new Map,r=new vr(e),i=()=>{},s=new Map;await async function(e,t,n,r,i){let{embeddedLanguageFormatting:s,printer:{embed:o,hasPrettierIgnore:a=()=>!1,getVisitorKeys:l}}=n;if(!o||"auto"!==s)return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let u=Nr(o.getVisitorKeys??l),c=[];!function t(){let{node:r}=e;if(null===r||"object"!=typeof r||a(e))return;for(let n of u(r))Array.isArray(r[n])?e.each(t,n):e.call(t,n);let s=o(e,n);if(s){if("function"==typeof s)return void c.push({print:s,node:r,pathStack:[...e.stack]});i.set(r,s)}}();let h=e.stack;for(let{print:r,node:s,pathStack:o}of c)try{e.stack=o;let a=await r(d,t,e,n);a&&i.set(s,a)}catch(e){if(globalThis.PRETTIER_DEBUG)throw e}function d(e,t){return async function(e,t,n,r){let i=await Ji({...n,...t,parentParser:n.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:s}=await ts(e,i);return Nn(await r(s,i))}(e,t,n,r)}e.stack=h}(r,a,t,ns,s);let o=await rs(r,t,a,void 0,s);if(function(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:n}=e;for(let e of t){if(!e.printed&&!n.has(e))throw new Error('Comment "'+e.value.trim()+'" was not printed. Please report this error!');delete e.printed}}(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return[Qn,o];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[o,Qn]}return o;function a(e,t){return void 0===e||e===r?l(t):Array.isArray(e)?r.call(()=>l(t),...e):r.call(()=>l(t),e)}function l(e){i(r);let o=r.node;if(null==o)return"";let l=o&&"object"==typeof o&&void 0===e;if(l&&n.has(o))return n.get(o);let u=rs(r,t,a,e,s);return l&&n.set(o,u),u}}function rs(e,t,n,r,i){var s;let o,{node:a}=e,{printer:l}=t;switch(o=null!=(s=l.hasPrettierIgnore)&&s.call(l,e)?function(e,t){let{originalText:n,[Symbol.for("comments")]:r,locStart:i,locEnd:s,[Symbol.for("printedComments")]:o}=t,{node:a}=e,l=i(a),u=s(a);for(let e of r)i(e)>=l&&s(e)<=u&&o.add(e);return n.slice(l,u)}(e,t):i.has(a)?i.get(a):l.print(e,t,n,r),a){case t.cursorNode:o=On(o,e=>[Qn,e,Qn]);break;case t.nodeBeforeCursor:o=On(o,e=>[e,Qn]);break;case t.nodeAfterCursor:o=On(o,e=>[Qn,e])}return l.printComment&&(!l.willPrintOwnComments||!l.willPrintOwnComments(e,t))&&(o=function(e,t,n){let{leading:r,trailing:i}=function(e,t){let n=e.node;if(!n)return{};let r=t[Symbol.for("printedComments")];if(0===(n.comments||[]).filter(e=>!r.has(e)).length)return{leading:"",trailing:""};let i,s=[],o=[];return e.each(()=>{let n=e.node;if(null!=r&&r.has(n))return;let{leading:a,trailing:l}=n;a?s.push(function(e,t){var n;let r=e.node,i=[zr(e,t)],{printer:s,originalText:o,locStart:a,locEnd:l}=t;if(null==(n=s.isBlockComment)?void 0:n.call(s,r)){let e=xr(o,l(r))?xr(o,a(r),{backwards:!0})?Yn:Xn:" ";i.push(e)}else i.push(Yn);let u=Rr(o,yr(o,l(r)));return!1!==u&&xr(o,u)&&i.push(Yn),i}(e,t)):l&&(i=function(e,t,n){var r;let i=e.node,s=zr(e,t),{printer:o,originalText:a,locStart:l}=t,u=null==(r=o.isBlockComment)?void 0:r.call(o,i);if(null!=n&&n.hasLineSuffix&&(null==n||!n.isBlock)||xr(a,l(i),{backwards:!0})){let e=jr(a,l(i));return{doc:Gn([Yn,e?Yn:"",s]),isBlock:u,hasLineSuffix:!0}}return!u||null!=n&&n.hasLineSuffix?{doc:[Gn([" ",s]),Wn],isBlock:u,hasLineSuffix:!0}:{doc:[" ",s],isBlock:u,hasLineSuffix:!1}}(e,t,i),o.push(i.doc))},"comments"),{leading:s,trailing:o}}(e,n);return r||i?On(t,e=>[r,e,i]):t}(e,o,t)),o}async function is(e,t){let n=e.comments??[];t[Symbol.for("comments")]=n,t[Symbol.for("printedComments")]=new Set,function(e,t){let{comments:n}=e;if(delete e.comments,!function(e){return Array.isArray(e)&&e.length>0}(n)||!t.printer.canAttachComment)return;let r=[],{printer:{experimentalFeatures:{avoidAstMutation:i=!1}={},handleComments:s={}},originalText:o}=t,{ownLine:a=Ur,endOfLine:l=Ur,remaining:u=Ur}=s,c=n.map((r,i)=>({...Br(e,r,t),comment:r,text:o,options:t,ast:e,isLastComment:n.length-1===i}));for(let[e,t]of c.entries()){let n,{comment:s,precedingNode:o,enclosingNode:h,followingNode:d,text:f,options:p,ast:m,isLastComment:g}=t;if(i?n=[t]:(s.enclosingNode=h,s.precedingNode=o,s.followingNode=d,n=[s,f,p,m,g]),Gr(f,p,c,e))s.placement="ownLine",a(...n)||(d?Or(d,s):o?kr(o,s):Ir(h||m,s));else if(Vr(f,p,c,e))s.placement="endOfLine",l(...n)||(o?kr(o,s):d?Or(d,s):Ir(h||m,s));else if(s.placement="remaining",!u(...n))if(o&&d){let e=r.length;e>0&&r[e-1].followingNode!==d&&Wr(r,p),r.push(t)}else o?kr(o,s):d?Or(d,s):Ir(h||m,s)}if(Wr(r,t),!i)for(let e of n)delete e.precedingNode,delete e.enclosingNode,delete e.followingNode}(e,t);let{printer:{preprocess:r}}=t;return{ast:e=r?await r(e,t):e,comments:n}}var ss=function(e,t){let{cursorOffset:n,locStart:r,locEnd:i}=t,s=Nr(t.printer.getVisitorKeys),o=e=>r(e)<=n&&i(e)>=n,a=e,l=[e];for(let t of function*(e,t){let n=[e];for(let e=0;e0&&(void 0===u||void 0===c);){a=l.pop();let e=void 0!==u,t=void 0!==c;for(let o of Sr(a,{getVisitorKeys:s})){if(!e){let e=i(o);e<=n&&e>h&&(u=o,h=e)}if(!t){let e=r(o);e>=n&&e{if(!e||null!=t){if(t.findLastIndex)return t.findLastIndex(n);for(let e=t.length-1;e>=0;e--)if(n(t[e],e,t))return e;return-1}})(!1,e,e=>"Program"!==e.type&&"File"!==e.type);return-1===t?e:e.slice(0,t+1)}function as(e,t,n,r,i=[],s){let{locStart:o,locEnd:a}=n,l=o(e),u=a(e);if(!(t>u||t=0&&(t={...t,...ss(r,t)});let s=await ns(r,t);n>0&&(s=Jn([Yn,s],n,t.tabWidth));let o=fr(s,t);if(n>0){let e=o.formatted.trim();void 0!==o.cursorNodeStart&&(o.cursorNodeStart-=o.formatted.indexOf(e),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>e.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=e+Jt(t.endOfLine)}let a=t[Symbol.for("comments")];if(t.cursorOffset>=0){let e,n,r,s;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&o.cursorNodeText)if(r=o.cursorNodeStart,s=o.cursorNodeText,t.cursorNode)e=t.locStart(t.cursorNode),n=i.slice(e,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");e=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let r=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):i.length;n=i.slice(e,r)}else e=0,n=i,r=0,s=o.formatted;let l=t.cursorOffset-e;if(n===s)return{formatted:o.formatted,cursorOffset:r+l,comments:a};let u=n.split("");u.splice(l,0,hs);let c=function(e,t){return Zt.diff(e,t,void 0)}(u,s.split("")),h=r;for(let e of c)if(e.removed){if(e.value.includes(hs))break}else h+=e.count;return{formatted:o.formatted,cursorOffset:h,comments:a}}return{formatted:o.formatted,cursorOffset:-1,comments:a}}function fs(e,t,n){return"number"!=typeof t||Number.isNaN(t)||t<0||t>e.length?n:t}function ps(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i}=t;return n=fs(e,n,-1),r=fs(e,r,0),i=fs(e,i,e.length),{...t,cursorOffset:n,rangeStart:r,rangeEnd:i}}function ms(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s}=ps(e,t),o="\ufeff"===e.charAt(0);if(o&&(e=e.slice(1),n--,r--,i--),"auto"===s&&(s=function(e){let t=e.indexOf("\r");return-1!==t?"\n"===e.charAt(t+1)?"crlf":"cr":"lf"}(e)),e.includes("\r")){let t=t=>en(e.slice(0,Math.max(t,0)),"\r\n");n-=t(n),r-=t(r),i-=t(i),e=function(e){return qt(!1,e,/\r\n?/gu,"\n")}(e)}return{hasBOM:o,text:e,options:ps(e,{...t,cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s})}}async function gs(e,t){let n=await qi(t);return!n.hasPragma||n.hasPragma(e)}async function Es(e,t){let n,{hasBOM:r,text:i,options:s}=ms(e,await Ji(t));return s.rangeStart>=s.rangeEnd&&""!==i||s.requirePragma&&!await gs(i,s)||s.checkIgnorePragma&&await async function(e,t){var n;let r=await qi(t);return null==(n=r.hasIgnorePragma)?void 0:n.call(r,e)}(i,s)?{formatted:e,cursorOffset:t.cursorOffset,comments:[]}:(s.rangeStart>0||s.rangeEndr);let a=e.slice(r,i).search(/\S/u),l=-1===a;if(!l)for(r+=a;i>r&&!/\S/u.test(e[i-1]);--i);let u,c,h=as(n,r,t,(e,n)=>cs(t,e,n),[],"rangeStart"),d=l?h:as(n,i,t,e=>cs(t,e),[],"rangeEnd");if(!h||!d)return{rangeStart:0,rangeEnd:0};if((({parser:e})=>"json"===e||"json5"===e||"jsonc"===e||"json-stringify"===e)(t)){let e=function(e,t){let n=[e.node,...e.parentNodes],r=new Set([t.node,...t.parentNodes]);return n.find(e=>ls.has(e.type)&&r.has(e))}(h,d);u=e,c=e}else({startNode:u,endNode:c}=function(e,t,{locStart:n,locEnd:r}){let i=e.node,s=t.node;if(i===s)return{startNode:i,endNode:s};let o=n(e.node);for(let e of os(t.parentNodes)){if(!(n(e)>=o))break;s=e}let a=r(t.node);for(let t of os(e.parentNodes)){if(!(r(t)<=a))break;if(i=t,i===s)break}return{startNode:i,endNode:s}}(h,d,t));return{rangeStart:Math.min(s(u),s(c)),rangeEnd:Math.max(o(u),o(c))}}(r,t,n),o=r.slice(i,s),a=Math.min(i,r.lastIndexOf("\n",i)+1),l=r.slice(a,i).match(/^\s*/u)[0],u=Er(l,t.tabWidth),c=await ds(o,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>i&&t.cursorOffset<=s?t.cursorOffset-i:-1,endOfLine:"lf"},u),h=c.formatted.trimEnd(),{cursorOffset:d}=t;d>s?d+=h.length-o.length:c.cursorOffset>=0&&(d=c.cursorOffset+i);let f=r.slice(0,i)+h+r.slice(s);if("lf"!==t.endOfLine){let e=Jt(t.endOfLine);d>=0&&"\r\n"===e&&(d+=en(f.slice(0,d),"\n")),f=qt(!1,f,"\n",e)}return{formatted:f,cursorOffset:d,comments:c.comments}}(i,s):(!s.requirePragma&&s.insertPragma&&s.printer.insertPragma&&!await gs(i,s)&&(i=s.printer.insertPragma(i)),n=await ds(i,s)),r&&(n.formatted="\ufeff"+n.formatted,n.cursorOffset>=0&&n.cursorOffset++),n)}var vs={};Xt(vs,{builders:()=>Cs,printer:()=>Ds,utils:()=>Ss});var Cs={join:Zn,line:Xn,softline:Kn,hardline:Yn,literalline:qn,group:$n,conditionalGroup:function(e,t){return $n(e[0],{...t,expandedStates:e})},fill:function(e){return Pn(e),{type:un,parts:e}},lineSuffix:Gn,lineSuffixBoundary:Vn,cursor:Qn,breakParent:Wn,ifBreak:function(e,t="",n={}){return kn(e),""!==t&&kn(t),{type:cn,breakContents:e,flatContents:t,groupId:n.groupId}},trim:Hn,indent:Bn,indentIfBreak:function(e,t){return kn(e),{type:hn,contents:e,groupId:t.groupId,negate:t.negate}},align:Un,addAlignmentToDoc:Jn,markAsRoot:function(e){return Un({type:"root"},e)},dedentToRoot:function(e){return Un(Number.NEGATIVE_INFINITY,e)},dedent:function(e){return Un(-1,e)},hardlineWithoutBreakParent:jn,literallineWithoutBreakParent:zn,label:function(e,t){return kn(t),e?{type:mn,label:e,contents:t}:t},concat:e=>e},Ds={printDocToString:fr},Ss={willBreak:function(e){return bn(e,Tn,!1)},traverseDoc:_n,findInDoc:bn,mapDoc:yn,removeLines:function(e){return yn(e,xn)},stripTrailingHardline:Nn,replaceEndOfLine:function(e,t=qn){return yn(e,e=>"string"==typeof e?Zn(t,e.split("\n")):e)},canBreak:function(e){return bn(e,Ln,!1)}},As="3.6.2",_s={};Xt(_s,{addDanglingComment:()=>Ir,addLeadingComment:()=>Or,addTrailingComment:()=>kr,getAlignmentSize:()=>Er,getIndentSize:()=>xs,getMaxContinuousCount:()=>ws,getNextNonSpaceNonCommentCharacter:()=>Fs,getNextNonSpaceNonCommentCharacterIndex:()=>Ms,getPreferredQuote:()=>Ls,getStringWidth:()=>rr,hasNewline:()=>xr,hasNewlineInRange:()=>Os,hasSpaces:()=>Is,isNextLineEmpty:()=>Bs,isNextLineEmptyAfterIndex:()=>Rs,isPreviousLineEmpty:()=>Ps,makeString:()=>ks,skip:()=>Ar,skipEverythingButNewLine:()=>Tr,skipInlineComment:()=>ys,skipNewline:()=>Rr,skipSpaces:()=>yr,skipToLineEnd:()=>br,skipTrailingComment:()=>bs,skipWhitespace:()=>_r});var ys=function(e,t){if(!1===t)return!1;if("/"===e.charAt(t)&&"*"===e.charAt(t+1))for(let n=t+2;nMath.max(e,n.length/t.length),0)},Fs=function(e,t){let n=Ts(e,t);return!1===n?"":e.charAt(n)},Ns="'",Ls=function(e,t){let n=!0===t||t===Ns?Ns:'"',r=n===Ns?'"':Ns,i=0,s=0;for(let t of e)t===n?i++:t===r&&s++;return i>s?r:n},Os=function(e,t,n){for(let r=t;ri===r?i:s===t?"\\"+s:s||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(i)?i:"\\"+i));return t+i+t};function Ms(e,t){return 2===arguments.length||"number"==typeof t?Ts(e,t):function(e,t,n){return Ts(e,n(t))}(...arguments)}function Ps(e,t){return 2===arguments.length||"number"==typeof t?jr(e,t):function(e,t,n){return jr(e,n(t))}(...arguments)}function Bs(e,t){return 2===arguments.length||"number"==typeof t?Rs(e,t):function(e,t,n){return Rs(e,n(t))}(...arguments)}function Us(e,t=1){return async(...n)=>{let r=n[t]??{},i=r.plugins??[];return n[t]={...r,plugins:Array.isArray(i)?i:Object.values(i)},e(...n)}}var $s=Us(Es);async function Gs(e,t){let{formatted:n}=await $s(e,{...t,cursorOffset:-1});return n}async function Vs(e,t){return await Gs(e,t)===e}var Ws=Us(qr,0),Hs={parse:Us(async function(e,t,n){let{text:r,options:i}=ms(e,await Ji(t)),s=await ts(r,i);return n&&(n.preprocessForPrint&&(s.ast=await is(s.ast,i)),n.massage&&(s.ast=function(e,t){let{printer:{massageAstNode:n,getVisitorKeys:r}}=t;if(!n)return e;let i=Nr(r),s=n.ignoredProperties??new Set;return function e(t,r){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>e(t,r)).filter(Boolean);let o={},a=new Set(i(t));for(let n in t)!Object.prototype.hasOwnProperty.call(t,n)||s.has(n)||(a.has(n)?o[n]=e(t[n],t):o[n]=t[n]);let l=n(t,o,r);return null!==l?l??o:void 0}(e)}(s.ast,i))),s}),formatAST:Us(async function(e,t){return t=await Ji(t),fr(await ns(e,t),t)}),formatDoc:Us(async function(e,t){let n=function(e){let t=Object.create(null),n=new Set;return function e(t,n,i){var s,o;if("string"==typeof t)return JSON.stringify(t);if(Array.isArray(t)){let n=t.map(e).filter(Boolean);return 1===n.length?n[0]:`[${n.join(", ")}]`}if(t.type===pn){let e=(null==(s=null==i?void 0:i[n+1])?void 0:s.type)===gn;return t.literal?e?"literalline":"literallineWithoutBreakParent":t.hard?e?"hardline":"hardlineWithoutBreakParent":t.soft?"softline":"line"}if(t.type===gn)return(null==(o=null==i?void 0:i[n-1])?void 0:o.type)===pn&&i[n-1].hard?void 0:"breakParent";if(t.type===an)return"trim";if(t.type===sn)return"indent("+e(t.contents)+")";if(t.type===on)return t.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+e(t.contents)+")":t.n<0?"dedent("+e(t.contents)+")":"root"===t.n.type?"markAsRoot("+e(t.contents)+")":"align("+JSON.stringify(t.n)+", "+e(t.contents)+")";if(t.type===cn)return"ifBreak("+e(t.breakContents)+(t.flatContents?", "+e(t.flatContents):"")+(t.groupId?(t.flatContents?"":', ""')+`, { groupId: ${r(t.groupId)} }`:"")+")";if(t.type===hn){let n=[];t.negate&&n.push("negate: true"),t.groupId&&n.push(`groupId: ${r(t.groupId)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return`indentIfBreak(${e(t.contents)}${i})`}if(t.type===ln){let n=[];t.break&&"propagated"!==t.break&&n.push("shouldBreak: true"),t.id&&n.push(`id: ${r(t.id)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return t.expandedStates?`conditionalGroup([${t.expandedStates.map(t=>e(t)).join(",")}]${i})`:`group(${e(t.contents)}${i})`}if(t.type===un)return`fill([${t.parts.map(t=>e(t)).join(", ")}])`;if(t.type===dn)return"lineSuffix("+e(t.contents)+")";if(t.type===fn)return"lineSuffixBoundary";if(t.type===mn)return`label(${JSON.stringify(t.label)}, ${e(t.contents)})`;if(t.type===rn)return"cursor";throw new Error("Unknown doc type "+t.type)}(er(e));function r(e){if("symbol"!=typeof e)return JSON.stringify(String(e));if(e in t)return t[e];let r=e.description||"symbol";for(let i=0;;i++){let s=r+(i>0?` #${i}`:"");if(!n.has(s))return n.add(s),t[e]=`Symbol.for(${JSON.stringify(s)})`}}}(e),{formatted:r}=await Es(n,{...t,parser:"__js_expression"});return r}),printToDoc:Us(async function(e,t){t=await Ji(t);let{ast:n}=await ts(e,t);return t.cursorOffset>=0&&(t={...t,...ss(n,t)}),ns(n,t)}),printDocToString:Us(async function(e,t){return fr(e,await Ji(t))})},js=Object.defineProperty;((e,t)=>{for(var n in t)js(e,n,{get:t[n],enumerable:!0})})({},{builders:()=>Jo,printer:()=>ea,utils:()=>ta});var zs="string",Xs="array",Ks="cursor",Ys="indent",qs="align",Qs="trim",Zs="group",Js="fill",eo="if-break",to="indent-if-break",no="line-suffix",ro="line-suffix-boundary",io="line",so="label",oo="break-parent",ao=new Set([Ks,Ys,qs,Qs,Zs,Js,eo,to,no,ro,io,so,oo]),lo=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},uo=function(e){if("string"==typeof e)return zs;if(Array.isArray(e))return Xs;if(!e)return;const{type:t}=e;return ao.has(t)?t:void 0};var co=class extends Error{name="InvalidDocError";constructor(e){super(function(e){const t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(uo(e))throw new Error("doc is valid.");const n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;const r=(i=[...ao].map(e=>`'${e}'`),new Intl.ListFormat("en-US",{type:"disjunction"}).format(i));var i;return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},ho={},fo=function(e,t,n,r){const i=[e];for(;i.length>0;){const e=i.pop();if(e===ho){n(i.pop());continue}n&&i.push(e,ho);const s=uo(e);if(!s)throw new co(e);if(!1!==(null==t?void 0:t(e)))switch(s){case Xs:case Js:{const t=s===Xs?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case eo:i.push(e.flatContents,e.breakContents);break;case Zs:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case qs:case Ys:case to:case so:case no:i.push(e.contents);break;case zs:case Ks:case Qs:case ro:case io:case oo:break;default:throw new co(e)}}};function po(e,t){if("string"==typeof e)return t(e);const n=new Map;return function e(r){if(n.has(r))return n.get(r);const i=function(n){switch(uo(n)){case Xs:return t(n.map(e));case Js:return t({...n,parts:n.parts.map(e)});case eo:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case Zs:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case qs:case Ys:case to:case so:case no:return t({...n,contents:e(n.contents)});case zs:case Ks:case Qs:case ro:case io:case oo:return t(n);default:throw new co(n)}}(r);return n.set(r,i),i}(e)}function mo(e,t,n){let r=n,i=!1;return fo(e,function(e){if(i)return!1;const n=t(e);void 0!==n&&(i=!0,r=n)}),r}function go(e){return!(e.type!==Zs||!e.break)||!(e.type!==io||!e.hard)||e.type===oo||void 0}function Eo(e){if(e.length>0){const t=lo(!1,e,-1);t.expandedStates||t.break||(t.break="propagated")}return null}function vo(e){return e.type!==io||e.hard?e.type===eo?e.flatContents:e:e.soft?"":" "}function Co(e){for(e=[...e];e.length>=2&&lo(!1,e,-2).type===io&&lo(!1,e,-1).type===oo;)e.length-=2;if(e.length>0){const t=Do(lo(!1,e,-1));e[e.length-1]=t}return e}function Do(e){switch(uo(e)){case Ys:case to:case Zs:case no:case so:{const t=Do(e.contents);return{...e,contents:t}}case eo:return{...e,breakContents:Do(e.breakContents),flatContents:Do(e.flatContents)};case Js:return{...e,parts:Co(e.parts)};case Xs:return Co(e);case zs:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return t{},_o=Ao,yo=Ao,bo=Ao;function To(e){return _o(e),{type:Ys,contents:e}}function Ro(e,t){return _o(t),{type:qs,contents:t,n:e}}function xo(e,t={}){return _o(e),yo(t.expandedStates,!0),{type:Zs,id:t.id,contents:e,break:Boolean(t.shouldBreak),expandedStates:t.expandedStates}}var wo={type:ro},Fo={type:oo},No={type:Qs},Lo={type:io,hard:!0},Oo={type:io,hard:!0,literal:!0},Io={type:io},ko={type:io,soft:!0},Mo=[Lo,Fo],Po=[Oo,Fo],Bo={type:Ks};function Uo(e,t){_o(e),yo(t);const n=[];for(let r=0;r{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Go=e=>{return!(12288===(t=e)||t>=65281&&t<=65376||t>=65504&&t<=65510||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e));var t},Vo=/[^\x20-\x7F]/u,Wo=function(e){if(!e)return 0;if(!Vo.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(const n of e){const e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=Go(e)?1:2)}return t},Ho=Symbol("MODE_BREAK"),jo=Symbol("MODE_FLAT"),zo=Symbol("cursor"),Xo=Symbol("DOC_FILL_PRINTED_LENGTH");function Ko(e,t){return qo(e,{type:"indent"},t)}function Yo(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?qo(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:qo(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function qo(e,t,n){const r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t];let i="",s=0,o=0,a=0;for(const e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function Qo(e){let t=0,n=0,r=e.length;e:for(;r--;){const i=e[r];if(i!==zo)for(let n=i.length-1;n>=0;n--){const s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(zo);return t}function Zo(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length;const a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}const{mode:e,doc:u}=a.pop(),c=uo(u);switch(c){case zs:l.push(u),n-=Wo(u);break;case Xs:case Js:{const t=c===Xs?u:u.parts,n=u[Xo]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case Ys:case qs:case to:case so:a.push({mode:e,doc:u.contents});break;case Qs:n+=Qo(l);break;case Zs:{if(s&&u.break)return!1;const t=u.break?Ho:e,n=u.expandedStates&&t===Ho?lo(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case eo:{const t=(u.groupId?i[u.groupId]||jo:e)===Ho?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case io:if(e===Ho||u.hard)return!0;u.soft||(l.push(" "),n--);break;case no:r=!0;break;case ro:if(r)return!1}}return!1}var Jo={join:Uo,line:Io,softline:ko,hardline:Mo,literalline:Po,group:xo,conditionalGroup:function(e,t){return xo(e[0],{...t,expandedStates:e})},fill:function(e){return bo(e),{type:Js,parts:e}},lineSuffix:function(e){return _o(e),{type:no,contents:e}},lineSuffixBoundary:wo,cursor:Bo,breakParent:Fo,ifBreak:function(e,t="",n={}){return _o(e),""!==t&&_o(t),{type:eo,breakContents:e,flatContents:t,groupId:n.groupId}},trim:No,indent:To,indentIfBreak:function(e,t){return _o(e),{type:to,contents:e,groupId:t.groupId,negate:t.negate}},align:Ro,addAlignmentToDoc:function(e,t,n){_o(e);let r=e;if(t>0){for(let e=0;ee},ea={printDocToString:function(e,t){const n={},r=t.printWidth,i=function(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}(t.endOfLine);let s=0;const o=[{ind:{value:"",length:0,queue:[]},mode:Ho,doc:e}],a=[];let l=!1;const u=[];let c=0;for(function(e){const t=new Set,n=[];fo(e,function(e){if(e.type===oo&&Eo(n),e.type===Zs){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===Zs&&n.pop().break&&Eo(n)},!0)}(e);o.length>0;){const{ind:e,mode:h,doc:d}=o.pop();switch(uo(d)){case zs:{const e="\n"!==i?$o(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=Wo(e));break}case Xs:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case Ks:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(zo),c++;break;case Ys:o.push({ind:Ko(e,t),mode:h,doc:d.contents});break;case qs:o.push({ind:Yo(e,d.n,t),mode:h,doc:d.contents});break;case Qs:s-=Qo(a);break;case Zs:switch(h){case jo:if(!l){o.push({ind:e,mode:d.break?Ho:jo,doc:d.contents});break}case Ho:{l=!1;const t={ind:e,mode:jo,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&Zo(t,o,i,a,n))o.push(t);else if(d.expandedStates){const t=lo(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:Ho,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:Ho,doc:t});break}{const t=d.expandedStates[r],s={ind:e,mode:jo,doc:t};if(Zo(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:Ho,doc:d.contents});break}}d.id&&(n[d.id]=lo(!1,o,-1).mode);break;case Js:{const t=r-s,i=d[Xo]??0,{parts:a}=d,l=a.length-i;if(0===l)break;const c=a[i+0],f=a[i+1],p={ind:e,mode:jo,doc:c},m={ind:e,mode:Ho,doc:c},g=Zo(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}const E={ind:e,mode:jo,doc:f},v={ind:e,mode:Ho,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}const C=a[i+2],D={ind:e,mode:h,doc:{...d,[Xo]:i+2}};Zo({ind:e,mode:jo,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case eo:case to:{const t=d.groupId?n[d.groupId]:h;if(t===Ho){const t=d.type===eo?d.breakContents:d.negate?d.contents:To(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===jo){const t=d.type===eo?d.flatContents:d.negate?To(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case no:u.push({ind:e,mode:h,doc:d.contents});break;case ro:u.length>0&&o.push({ind:e,mode:h,doc:Lo});break;case io:switch(h){case jo:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case Ho:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=Qo(a),a.push(i+e.value),s=e.length)}break;case so:o.push({ind:e,mode:h,doc:d.contents});break;case oo:break;default:throw new co(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}const h=a.indexOf(zo);if(-1!==h){const e=a.indexOf(zo,h+1);if(-1===e)return{formatted:a.filter(e=>e!==zo).join("")};const t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}},ta={willBreak:function(e){return mo(e,go,!1)},traverseDoc:fo,findInDoc:mo,mapDoc:po,removeLines:function(e){return po(e,vo)},stripTrailingHardline:function(e){return Do(function(e){return po(e,e=>function(e){switch(uo(e)){case Js:if(e.parts.every(e=>""===e))return"";break;case Zs:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===Zs&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case qs:case Ys:case to:case no:if(!e.contents)return"";break;case eo:if(!e.flatContents&&!e.breakContents)return"";break;case Xs:{const t=[];for(const n of e){if(!n)continue;const[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof lo(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case zs:case Ks:case Qs:case ro:case io:case so:case oo:break;default:throw new co(e)}return e}(e))}(e))},replaceEndOfLine:function(e,t=Po){return po(e,e=>"string"==typeof e?Uo(t,e.split("\n")):e)},canBreak:function(e){return mo(e,So,!1)}};function na(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}class ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class ia extends ra{constructor(e){super([]),this.idx=1,Object.assign(this,ma(e))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class sa extends ra{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ma(e))}}class oa extends ra{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ma(e))}}class aa extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class la extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ua extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ca extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ha extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class da extends ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ma(e))}}class fa{constructor(e){this.idx=1,Object.assign(this,ma(e))}accept(e){e.visit(this)}}function pa(e){function t(e){return e.map(pa)}if(e instanceof ia){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return"string"==typeof e.label&&(t.label=e.label),t}if(e instanceof oa)return{type:"Alternative",definition:t(e.definition)};if(e instanceof aa)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof la)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof ua)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ha)return{type:"RepetitionWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ca)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof da)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof fa){const t={type:"Terminal",name:e.terminalType.name,label:(n=e.terminalType,"string"==typeof(r=n).LABEL&&""!==r.LABEL?n.LABEL:n.name),idx:e.idx};"string"==typeof e.label&&(t.terminalLabel=e.label);const i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=i instanceof RegExp?i.source:i),t}if(e instanceof sa)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match");var n,r}function ma(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}class ga{visit(e){const t=e;switch(t.constructor){case ia:return this.visitNonTerminal(t);case oa:return this.visitAlternative(t);case aa:return this.visitOption(t);case la:return this.visitRepetitionMandatory(t);case ua:return this.visitRepetitionMandatoryWithSeparator(t);case ha:return this.visitRepetitionWithSeparator(t);case ca:return this.visitRepetition(t);case da:return this.visitAlternation(t);case fa:return this.visitTerminal(t);case sa:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Ea(e,t=[]){return!!(e instanceof aa||e instanceof ca||e instanceof ha)||(e instanceof da?e.definition.some(e=>Ea(e,t)):!(e instanceof ia&&t.includes(e))&&e instanceof ra&&(e instanceof ia&&t.push(e),e.definition.every(e=>Ea(e,t))))}function va(e){if(e instanceof ia)return"SUBRULE";if(e instanceof aa)return"OPTION";if(e instanceof da)return"OR";if(e instanceof la)return"AT_LEAST_ONE";if(e instanceof ua)return"AT_LEAST_ONE_SEP";if(e instanceof ha)return"MANY_SEP";if(e instanceof ca)return"MANY";if(e instanceof fa)return"CONSUME";throw Error("non exhaustive match")}class Ca{walk(e,t=[]){e.definition.forEach((n,r)=>{const i=e.definition.slice(r+1);if(n instanceof ia)this.walkProdRef(n,i,t);else if(n instanceof fa)this.walkTerminal(n,i,t);else if(n instanceof oa)this.walkFlat(n,i,t);else if(n instanceof aa)this.walkOption(n,i,t);else if(n instanceof la)this.walkAtLeastOne(n,i,t);else if(n instanceof ua)this.walkAtLeastOneSep(n,i,t);else if(n instanceof ha)this.walkManySep(n,i,t);else if(n instanceof ca)this.walkMany(n,i,t);else{if(!(n instanceof da))throw Error("non exhaustive match");this.walkOr(n,i,t)}})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);e.definition.forEach(e=>{const t=new oa({definition:[e]});this.walk(t,r)})}}function Da(e,t,n){return[new aa({definition:[new fa({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Sa(e){if(e instanceof ia)return Sa(e.referencedRule);if(e instanceof fa)return[e.terminalType];if(function(e){return e instanceof oa||e instanceof aa||e instanceof ca||e instanceof la||e instanceof ua||e instanceof ha||e instanceof fa||e instanceof sa}(e))return function(e){let t=[];const n=e.definition;let r,i=0,s=n.length>i,o=!0;for(;s&&o;)r=n[i],o=Ea(r),t=t.concat(Sa(r)),i+=1,s=n.length>i;return[...new Set(t)]}(e);if(function(e){return e instanceof da}(e))return function(e){const t=e.definition.map(e=>Sa(e));return[...new Set(t.flat())]}(e);throw Error("non exhaustive match")}const Aa="_~IN~_";class _a extends Ca{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=(i=e.referencedRule,s=e.idx,i.name+s+Aa+this.topProd.name);var i,s;const o=t.concat(n),a=Sa(new oa({definition:o}));this.follows[r]=a}}function ya(e){return e.charCodeAt(0)}function ba(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function Ta(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t],e[t]=!0}function Ra(e){if(void 0===e)throw Error("Internal Error - Should never get here!");return!0}function xa(){throw Error("Internal Error - Should never get here!")}function wa(e){return"Character"===e.type}const Fa=[];for(let e=ya("0");e<=ya("9");e++)Fa.push(e);const Na=[ya("_")].concat(Fa);for(let e=ya("a");e<=ya("z");e++)Na.push(e);for(let e=ya("A");e<=ya("Z");e++)Na.push(e);const La=[ya(" "),ya("\f"),ya("\n"),ya("\r"),ya("\t"),ya("\v"),ya("\t"),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya("\u2028"),ya("\u2029"),ya(" "),ya(" "),ya(" "),ya("\ufeff")],Oa=/[0-9a-fA-F]/,Ia=/[0-9]/,ka=/[1-9]/;class Ma{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}function Pa(e){console&&console.error&&console.error(`Error: ${e}`)}function Ba(e){console&&console.warn&&console.warn(`Warning: ${e}`)}let Ua={};const $a=new class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Ta(n,"global");break;case"i":Ta(n,"ignoreCase");break;case"m":Ta(n,"multiLine");break;case"u":Ta(n,"unicode");break;case"y":Ta(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":let t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}}Ra(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return xa()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;Ra(t)}if(!0!==e||void 0!==t)return Ra(t)?("?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t):void 0}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),Ra(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):xa()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ya("\n"),ya("\r"),ya("\u2028"),ya("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=Fa;break;case"D":e=Fa,t=!0;break;case"s":e=La;break;case"S":e=La,t=!0;break;case"w":e=Na;break;case"W":e=Na,t=!0}return Ra(e)?{type:"Set",value:e,complement:t}:xa()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ya("\f");break;case"n":e=ya("\n");break;case"r":e=ya("\r");break;case"t":e=ya("\t");break;case"v":e=ya("\v")}return Ra(e)?{type:"Character",value:e}:xa()}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:ya("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:ya(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:ya(this.popChar())}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const t=this.classAtom();if(t.type,wa(t)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,wa(n)){if(n.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};function Ga(e){const t=e.toString();if(Ua.hasOwnProperty(t))return Ua[t];{const e=$a.pattern(t);return Ua[t]=e,e}}const Va="Complement Sets are not supported for first char optimization",Wa='Unable to use "first char" lexer optimizations:\n';function Ha(e,t=!1){try{const t=Ga(e);return ja(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===Va)t&&Ba(`${Wa}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),Pa(`${Wa}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function ja(e,t,n){switch(e.type){case"Disjunction":for(let r=0;r{if("number"==typeof e)za(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)za(e,t,n);else{for(let e=r.from;e<=r.to&&e=ul){const e=r.from>=ul?r.from:ul,n=r.to,i=hl(e),s=hl(n);for(let e=i;e<=s;e++)t[e]=e}}}});break;case"Group":ja(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}const o=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===Ka(s)||"Group"!==s.type&&!1===o)break}break;default:throw Error("non exhaustive match!")}return Object.values(t)}function za(e,t,n){const r=hl(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=hl(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=hl(e.charCodeAt(0));t[n]=n}}}(e,t)}function Xa(e,t){return e.value.find(e=>{if("number"==typeof e)return t.includes(e);{const n=e;return void 0!==t.find(e=>n.from<=e&&e<=n.to)}})}function Ka(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(Array.isArray(e.value)?e.value.every(Ka):Ka(e.value))}class Ya extends Ma{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e);case"Lookbehind":return void this.visitLookbehind(e);case"NegativeLookbehind":return void this.visitNegativeLookbehind(e)}super.visitChildren(e)}}visitCharacter(e){this.targetCharCodes.includes(e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===Xa(e,this.targetCharCodes)&&(this.found=!0):void 0!==Xa(e,this.targetCharCodes)&&(this.found=!0)}}function qa(e,t){if(t instanceof RegExp){const n=Ga(t),r=new Ya(e);return r.visit(n),r.found}for(const n of t){const t=n.charCodeAt(0);if(e.includes(t))return!0}return!1}const Qa="PATTERN",Za="defaultMode",Ja="modes";const el=/[^\\][$]/,tl=/[^\\[][\^]|^\^/;function nl(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function rl(e){const t=e.PATTERN;if(t instanceof RegExp)return!1;if("function"==typeof t)return!0;if(Object.hasOwn(t,"exec"))return!0;if("string"==typeof t)return!1;throw Error("non exhaustive match")}function il(e){return"string"==typeof e&&1===e.length&&e.charCodeAt(0)}const sl={test:function(e){const t=e.length;for(let n=this.lastIndex;n"string"==typeof e?e.charCodeAt(0):e)}function ll(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const ul=256;let cl=[];function hl(e){return ee.CATEGORIES).flat().filter(Boolean);const e=n.filter(e=>!t.includes(e));t=t.concat(e),0===e.length?r=!1:n=e}return t}(e);!function(e){e.forEach(e=>{var t;Cl(e)||(gl[ml]=e,e.tokenTypeIdx=ml++),Dl(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Dl(e)||(e.CATEGORIES=[]),t=e,Object.hasOwn(null!=t?t:{},"categoryMatches")||(e.categoryMatches=[]),function(e){return Object.hasOwn(null!=e?e:{},"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})})}(t),function(e){e.forEach(e=>{vl([],e)})}(t),function(e){e.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(t=>{e.categoryMatches.push(gl[t].tokenTypeIdx)})})}(t),t.forEach(e=>{e.isParent=e.categoryMatches.length>0})}function vl(e,t){e.forEach(e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),t.CATEGORIES.forEach(n=>{const r=e.concat(t);r.includes(n)||vl(r,n)})}function Cl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}function Dl(e){return Object.hasOwn(null!=e?e:{},"CATEGORIES")}function Sl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}var Al;!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"}(Al||(Al={}));const _l={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:{buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i,s)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`},traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(_l);class yl{constructor(e,t=_l){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=Object.assign({},_l,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===_l.lineTerminatorsPattern)this.config.lineTerminatorsPattern=sl;else if(this.config.lineTerminatorCharacters===_l.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Array.isArray(e)?n={modes:{defaultMode:[...e]},defaultMode:Za}:(r=!1,n=Object.assign({},e))}),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){const t=[];return Object.hasOwn(e,Za)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+Za+"> property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(e,Ja)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(e,Ja)&&Object.hasOwn(e,Za)&&!Object.hasOwn(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${Za}: <${e.defaultMode}>which does not exist\n`,type:Al.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(e,Ja)&&Object.keys(e.modes).forEach(n=>{const r=e.modes[n];r.forEach((e,i)=>{void 0===e?t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:Al.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(e,"LONGER_ALT")&&(Array.isArray(e.LONGER_ALT)?e.LONGER_ALT:[e.LONGER_ALT]).forEach(i=>{void 0===i||r.includes(i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${e.name}> outside of mode <${n}>\n`,type:Al.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(function(e,t,n){const r=[];let i=!1;const s=Object.values(e.modes||{}).flat().filter(Boolean).filter(e=>e[Qa]!==yl.NA),o=al(n);return t&&s.forEach(e=>{const t=ol(e,o);if(!1!==t){const n=function(e,t){if(t.issue===Al.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Al.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else Object.hasOwn(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):qa(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:Al.NO_LINE_BREAKS_FLAGS}),r}(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},Object.entries(n.modes).forEach(([e,t])=>{n.modes[e]=t.filter(e=>void 0!==e)});const i=Object.keys(n.modes);if(Object.entries(n.modes).forEach(([e,n])=>{this.TRACE_INIT(`Mode: <${e}> processing`,()=>{if(this.modes.push(e),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e,t){let n=[];const r=function(e){const t=e.filter(e=>!Object.hasOwn(e,Qa));return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:Al.MISSING_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(e);n=n.concat(r.errors);const i=function(e){const t=e.filter(e=>{const t=e[Qa];return!(t instanceof RegExp||"function"==typeof t||Object.hasOwn(t,"exec")||"string"==typeof t)});return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Al.INVALID_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=e.filter(e=>e[Qa]instanceof RegExp);return t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return el.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return tl.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){return e.filter(e=>{const t=e[Qa];return t instanceof RegExp&&(t.multiline||t.global)}).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Al.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){const t=[];let n=e.map(n=>e.reduce((e,r)=>(n.PATTERN.source!==r.PATTERN.source||t.includes(r)||r.PATTERN===yl.NA||(t.push(r),e.push(r)),e),[]));return n=n.filter(Boolean),n.filter(e=>e.length>1).map(e=>{const t=e.map(e=>e.name);return{message:`The same RegExp pattern ->${e[0].PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:Al.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}(n)),t=t.concat(function(e){return e.filter(e=>e.PATTERN.test("")).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:Al.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}(n)),t}(s)),n=n.concat(function(e){const t=e.filter(e=>{if(!Object.hasOwn(e,"GROUP"))return!1;const t=e.GROUP;return t!==yl.SKIPPED&&t!==yl.NA&&!("string"==typeof t)});return t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Al.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}(s)),n=n.concat(function(e,t){return e.filter(e=>void 0!==e.PUSH_MODE&&!t.includes(e.PUSH_MODE)).map(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:Al.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}(s,t)),n=n.concat(function(e){const t=[],n=e.reduce((e,t,n)=>{const r=t.PATTERN;return r===yl.NA||("string"==typeof r?e.push({str:r,idx:n,tokenType:t}):r instanceof RegExp&&(i=r,void 0===[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(e=>-1!==i.source.indexOf(e)))&&e.push({str:r.source,idx:n,tokenType:t})),e;var i},[]);return e.forEach((e,r)=>{n.forEach(({str:n,idx:i,tokenType:s})=>{if(r${s.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:Al.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}})}),t}(s)),n}(n,i))}),0===this.lexerDefinitionErrors.length){let r;El(n),this.TRACE_INIT("analyzeTokenTypes",()=>{r=function(e,t){const n=(t=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()},t)).tracer;let r;n("initCharCodeToOptimizedIndexMap",()=>{!function(){if(0===cl.length){cl=new Array(65536);for(let e=0;e<65536;e++)cl[e]=e>255?255+~~(e/255):e}}()}),n("Reject Lexer.NA",()=>{r=e.filter(e=>e[Qa]!==yl.NA)});let i,s,o,a,l,u,c,h,d,f,p,m=!1;n("Transform Patterns",()=>{m=!1,i=r.map(e=>{const t=e[Qa];if(t instanceof RegExp){const e=t.source;return 1!==e.length||"^"===e||"$"===e||"."===e||t.ignoreCase?2!==e.length||"\\"!==e[0]||["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(e[1])?nl(t):e[1]:e}if("function"==typeof t)return m=!0,{exec:t};if("object"==typeof t)return m=!0,t;if("string"==typeof t){if(1===t.length)return t;{const e=t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return nl(new RegExp(e))}}throw Error("non exhaustive match")})}),n("misc mapping",()=>{s=r.map(e=>e.tokenTypeIdx),o=r.map(e=>{const t=e.GROUP;if(t!==yl.SKIPPED){if("string"==typeof t)return t;if(void 0===t)return!1;throw Error("non exhaustive match")}}),a=r.map(e=>{const t=e.LONGER_ALT;if(t)return Array.isArray(t)?t.map(e=>r.indexOf(e)):[r.indexOf(t)]}),l=r.map(e=>e.PUSH_MODE),u=r.map(e=>Object.hasOwn(e,"POP_MODE"))}),n("Line Terminator Handling",()=>{const e=al(t.lineTerminatorCharacters);c=r.map(e=>!1),"onlyOffset"!==t.positionTracking&&(c=r.map(t=>Object.hasOwn(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===ol(t,e)&&qa(e,t.PATTERN)))}),n("Misc Mapping #2",()=>{h=r.map(rl),d=i.map(il),f=r.reduce((e,t)=>{const n=t.GROUP;return"string"==typeof n&&n!==yl.SKIPPED&&(e[n]=[]),e},{}),p=i.map((e,t)=>({pattern:i[t],longerAlt:a[t],canLineTerminator:c[t],isCustom:h[t],short:d[t],group:o[t],push:l[t],pop:u[t],tokenTypeIdx:s[t],tokenType:r[t]}))});let g=!0,E=[];return t.safeMode||n("First Char Optimization",()=>{E=r.reduce((e,n,r)=>{if("string"==typeof n.PATTERN){const t=hl(n.PATTERN.charCodeAt(0));ll(e,t,p[r])}else if(Array.isArray(n.START_CHARS_HINT)){let t;n.START_CHARS_HINT.forEach(n=>{const i=hl("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,ll(e,i,p[r]))})}else if(n.PATTERN instanceof RegExp)if(n.PATTERN.unicode)g=!1,t.ensureOptimizations&&Pa(`${Wa}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=Ha(n.PATTERN,t.ensureOptimizations);0===i.length&&(g=!1),i.forEach(t=>{ll(e,t,p[r])})}else t.ensureOptimizations&&Pa(`${Wa}\tTokenType: <${n.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return e},[])}),{emptyGroups:f,patternIdxToConfig:p,charCodeToPatternIdxToConfig:E,hasCustom:m,canBeOptimized:g}}(n,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[e]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[e]=r.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[e]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}this.lexerDefinitionWarning.forEach(e=>{Ba(e.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(r&&(this.handleModes=()=>{}),!1===this.trackStartLines&&(this.computeNewColumn=e=>e),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=()=>{}),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const e=Object.entries(this.canModeBeOptimized).reduce((e,[t,n])=>(!1===n&&e.push(t),e),[]);if(t.ensureOptimizations&&e.length>0)throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Ua={}}),this.TRACE_INIT("toFastProperties",()=>{na(this)})})}tokenize(e,t=this.defaultMode){if(this.lexerDefinitionErrors.length>0){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,s,o,a,l,u,c,h,d,f,p,m,g;const E=e,v=E.length;let C=0,D=0;const S=this.hasCustom?0:Math.floor(e.length/10),A=new Array(S),_=[];let y=this.trackStartLines?1:void 0,b=this.trackStartLines?1:void 0;const T=function(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(!Array.isArray(r))throw Error("non exhaustive match");t[n]=[]}),t}(this.emptyGroups),R=this.trackStartLines,x=this.config.lineTerminatorsPattern;let w=0,F=[],N=[];const L=[],O=[];Object.freeze(O);let I=!1;const k=e=>{if(1===L.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);_.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{L.pop();const e=L.at(-1);F=this.patternIdxToConfig[e],N=this.charCodeToPatternIdxToConfig[e],w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}};function M(e){L.push(e),N=this.charCodeToPatternIdxToConfig[e],F=this.patternIdxToConfig[e],w=F.length,w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}let P;M.call(this,t);const B=this.config.recoveryEnabled;for(;Ca.length){a=s,c=s.length,l=u,P=t;break}}}break}}if(-1!==c){if(h=P.group,void 0!==h&&(a=null!==a?a:e.substring(C,C+c),d=P.tokenTypeIdx,f=this.createTokenInstance(a,C,d,P.tokenType,y,b,c),this.handlePayload(f,l),!1===h?D=this.addToken(A,D,f):T[h].push(f)),!0===R&&!0===P.canLineTerminator){let t,n,r=0;x.lastIndex=0;do{a=null!==a?a:e.substring(C,C+c),t=x.test(a),!0===t&&(n=x.lastIndex-1,r++)}while(!0===t);0!==r?(y+=r,b=c-n,this.updateTokenEndLineColumnLocation(f,h,n,r,y,b,c)):b=this.computeNewColumn(b,c)}else b=this.computeNewColumn(b,c);C+=c,this.handleModes(P,k,M,f)}else{const t=C,n=y,i=b;let s=!1===B;for(;!1===s&&C`Expecting ${Tl(e)?`--\x3e ${bl(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o="\nbut found: '"+t[0].image+"'";return r?s+r+o:s+`one of these possible Token sequences:\n${e.reduce((e,t)=>e.concat(t),[]).map(e=>`[${e.map(e=>bl(e)).join(", ")}]`).map((e,t)=>` ${t+1}. ${e}`).join("\n")}`+o},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",s="\nbut found: '"+t[0].image+"'";return n?i+n+s:i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map(e=>`[${e.map(e=>bl(e)).join(",")}]`).join(" ,")}>`+s}};Object.freeze(Bl);const Ul={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},$l={buildDuplicateFoundError(e,t){const n=e.name,r=t[0],i=r.idx,s=va(r),o=(a=r)instanceof fa?a.terminalType.name:a instanceof ia?a.nonTerminalName:"";var a;let l=`->${s}${i>0?i:""}<- ${o?`with argument: ->${o}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,"\n"),l},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=e.prefixPath.map(e=>bl(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=0===e.alternation.idx?"":e.alternation.idx,n=0===e.prefixPath.length;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule,\n`;return r+=n?"These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n":`<${e.prefixPath.map(e=>bl(e)).join(", ")}> may appears as a prefix path in all these alternatives.\n`,r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=va(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${t} --\x3e ${e.leftRecursionPath.map(e=>e.name).concat([t]).join(" --\x3e ")}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof sa?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class Gl extends ga{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:rc.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Vl extends Ca{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){0===this.ruleStack.length?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Wl extends Vl{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const e=t.concat(n),r=new oa({definition:e});this.possibleTokTypes=Sa(r),this.found=!0}}}class Hl extends Ca{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class jl extends Hl{walkMany(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}}class zl extends Hl{walkManySep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}}class Xl extends Hl{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}}class Kl extends Hl{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}}function Yl(e,t,n=[]){n=[...n];let r=[],i=0;function s(s){const o=Yl(s.concat(e.slice(i+1)),t,n);return r.concat(o)}for(;n.length{0!==e.definition.length&&(r=s(e.definition))}),r;if(!(t instanceof fa))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:e.slice(i)}),r}function ql(e,t,n,r){const i=[...n];i.push(e.name);const s=[...r];return s.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:s}}var Ql;function Zl(e){if(e instanceof aa||"Option"===e)return Ql.OPTION;if(e instanceof ca||"Repetition"===e)return Ql.REPETITION;if(e instanceof la||"RepetitionMandatory"===e)return Ql.REPETITION_MANDATORY;if(e instanceof ua||"RepetitionMandatoryWithSeparator"===e)return Ql.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ha||"RepetitionWithSeparator"===e)return Ql.REPETITION_WITH_SEPARATOR;if(e instanceof da||"Alternation"===e)return Ql.ALTERNATION;throw Error("non exhaustive match")}function Jl(e,t,n,r){const i=e.length,s=e.every(e=>e.every(e=>1===e.length));if(t)return function(t){const r=t.map(e=>e.GATE);for(let t=0;te.flat()).reduce((e,t,n)=>(t.forEach(t=>{t.tokenTypeIdx in e||(e[t.tokenTypeIdx]=n),t.categoryMatches.forEach(t=>{Object.hasOwn(e,t)||(e[t]=n)})}),e),{});return function(){const e=this.LA_FAST(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t1===e.length),i=e.length;if(r&&!n){const t=e.flat();if(1===t.length&&0===t[0].categoryMatches.length){const e=t[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===e}}{const e=t.reduce((e,t,n)=>(e[t.tokenTypeIdx]=!0,t.categoryMatches.forEach(t=>{e[t]=!0}),e),[]);return function(){const t=this.LA_FAST(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;nYl([e],1)),r=ru(n.length),i=n.map(e=>{const t={};return e.forEach(e=>{iu(e.partialPath).forEach(e=>{t[e]=!0})}),t});let s=n;for(let e=1;e<=t;e++){const n=s;s=ru(n.length);for(let o=0;o{iu(e.partialPath).forEach(e=>{i[o][e]=!0})})}}}}return r}function au(e,t,n,r){const i=new nu(e,Ql.ALTERNATION,r);return t.accept(i),ou(i.result,n)}function lu(e,t,n,r){const i=new nu(e,n);t.accept(i);const s=i.result,o=new tu(t,e,n).startWalking();return ou([new oa({definition:s}),new oa({definition:o})],r)}function uu(e,t){e:for(let n=0;ne.every(e=>e.every(e=>0===e.categoryMatches.length)))}function hu(e){return`${va(e)}_#_${e.idx}_#_${du(e)}`}function du(e){return e instanceof fa?e.terminalType.name:e instanceof ia?e.nonTerminalName:""}class fu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function pu(e,t,n,r=[]){const i=[],s=mu(t.definition);if(0===s.length)return[];{const t=e.name;s.includes(e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:rc.LEFT_RECURSION,ruleName:t});const o=r.concat([e]),a=s.filter(e=>!o.includes(e)).flatMap(t=>{const i=[...r];return i.push(t),pu(e,t,n,i)});return i.concat(a)}}function mu(e){let t=[];if(0===e.length)return t;const n=e[0];if(n instanceof ia)t.push(n.referencedRule);else if(n instanceof oa||n instanceof aa||n instanceof la||n instanceof ua||n instanceof ha||n instanceof ca)t=t.concat(mu(n.definition));else if(n instanceof da)t=n.definition.map(e=>mu(e.definition)).flat();else if(!(n instanceof fa))throw Error("non exhaustive match");const r=Ea(n),i=e.length>1;if(r&&i){const n=e.slice(1);return t.concat(mu(n))}return t}class gu extends ga{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}class Eu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}const vu="MismatchedTokenException",Cu="NoViableAltException",Du="EarlyExitException",Su="NotAllInputParsedException",Au=[vu,Cu,Du,Su];function _u(e){return Au.includes(e.name)}Object.freeze(Au);class yu extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class bu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=vu}}class Tu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Cu}}class Ru extends yu{constructor(e,t){super(e,t),this.name=Su}}class xu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Du}}const wu={},Fu="InRuleRecoveryException";class Nu extends Error{constructor(e){super(e),this.name=Fu}}function Lu(e,t,n,r,i,s,o){const a=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[a];if(void 0===l){const e=this.getCurrRuleFullName();l=new s(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[a]=l}let u=l.token,c=l.occurrence;const h=l.isEndOfRule;0===this.RULE_STACK_IDX&&h&&void 0===u&&(u=Ml,c=1),void 0!==u&&void 0!==c&&this.shouldInRepetitionRecoveryBeTried(u,c,o)&&this.tryInRepetitionRecovery(e,t,n,u)}const Ou=1024,Iu=1280,ku=1536;function Mu(e,t,n){return n|t|e}class Pu{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:tc.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(0===t.length){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return e.flatMap(e=>pu(e,e,$l))}validateEmptyOrAlternatives(e){return e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.slice(0,-1).flatMap((r,i)=>0===function(e,t,n){const r="EXIT_NONE_TERMINAL",i=[r],s="EXIT_ALTERNATIVE";let o=!1;const a=t.length,l=a-1-1,u=[],c=[];for(c.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});0!==c.length;){const e=c.pop();if(e===s){o&&c.at(-1).idx<=l&&c.pop();continue}const h=e.def,d=e.idx,f=e.ruleStack,p=e.occurrenceStack;if(0===h.length)continue;const m=h[0];if(m===r){const e={idx:d,def:h.slice(1),ruleStack:f.slice(0,-1),occurrenceStack:p.slice(0,-1)};c.push(e)}else if(m instanceof fa)if(d=0;e--){const t={idx:d,def:m.definition[e].definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p};c.push(t),c.push(s)}else if(m instanceof oa)c.push({idx:d,def:m.definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p});else{if(!(m instanceof sa))throw Error("non exhaustive match");c.push(ql(m,d,f,p))}}return u}([r],[],fl).length?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:rc.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}(e,$l))}validateAmbiguousAlternationAlternatives(e,t){return e.flatMap(e=>function(e,t,n){const r=new gu;e.accept(r);let i=r.alternations;i=i.filter(e=>!0!==e.ignoreAmbiguities);return i.flatMap(r=>{const i=r.idx,s=r.maxLookahead||t,o=au(i,e,s,r),a=function(e,t,n,r){const i=[];return e.reduce((n,r,s)=>(!0===t.definition[s].ignoreAmbiguities||r.forEach(r=>{const o=[s];e.forEach((e,n)=>{s!==n&&uu(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&o.push(n)}),o.length>1&&!uu(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]).map(e=>{const i=e.alts.map(e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}(o,r,e,n),l=function(e,t,n,r){const i=e.reduce((e,t,n)=>{const r=t.map(e=>({idx:n,path:e}));return e.concat(r)},[]);return i.flatMap(e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const s=e.idx,o=e.path;return i.filter(e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx{const n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}));var n,r}).map(e=>{const i=[e.idx+1,s+1],o=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})})}(o,r,e,n);return a.concat(l)})}(e,t,$l))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return e.forEach(e=>{const i=new Eu;e.accept(i),i.allProductions.forEach(i=>{const s=Zl(i),o=i.maxLookahead||t;if(0===lu(i.idx,e,s,o)[0].flat().length){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:rc.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}(e,t,$l)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,s){const o=au(e,t,n);return s(o,r,cu(o)?pl:fl,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Jl)}buildLookaheadForOptional(e){return function(e,t,n,r,i,s){const o=lu(e,t,i,n),a=cu(o)?pl:fl;return s(o[0],a,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Zl(e.prodType),eu)}}const Bu=new class extends ga{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function Uu(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset"function"==typeof e.GATE);return s.hasPredicates=o,n.definition.push(s),i.forEach(e=>{const t=new oa({definition:[]});s.definition.push(t),Object.hasOwn(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Object.hasOwn(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),Hu}function Zu(e){return 0===e?"":`${e}`}function Ju(e){if(e<0||e>zu){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${zu+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const ec=Pl(Ml,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ec);const tc=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Bl,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),nc=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var rc,ic,sc;!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(rc||(rc={}));class oc{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",()=>{na(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=function(e){const t=Object.assign({errMsgProvider:Ul},e),n={};return e.rules.forEach(e=>{n[e.name]=e}),function(e,t){const n=new Gl(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(0===n.length&&!1===this.skipValidations){const e=function(e){var t;const n=null!==(t=e.errMsgProvider)&&void 0!==t?t:$l;return function(e,t,n,r){const i=e.flatMap(e=>function(e,t){const n=new fu;e.accept(n);const r=n.allProductions,i=Object.groupBy(r,hu),s=Object.fromEntries(Object.entries(i).filter(([e,t])=>t.length>1));return Object.values(s).map(n=>{const r=n[0],i=t.buildDuplicateFoundError(e,n),s=va(r),o={message:i,type:rc.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:s,occurrence:r.idx},a=du(r);return a&&(o.parameter=a),o})}(e,n)),s=function(e,t,n){const r=[],i=t.map(e=>e.name);return e.forEach(e=>{const t=e.name;if(i.includes(t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:rc.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}(e,t,n),o=e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:rc.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}(e,n)),a=e.flatMap(t=>function(e,t,n,r){const i=[],s=t.reduce((t,n)=>n.name===e.name?t+1:t,0);if(s>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:rc.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n));return i.concat(s,o,a)}(e.rules,e.tokenTypes,n,e.grammarName)}({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:$l,grammarName:t}),n=function(e){return e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}).map(e=>Object.assign({type:rc.CUSTOM_LOOKAHEAD_VALIDATION},e))}({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(e,n)}}),0===this.definitionErrors.length&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const e=function(e){const t={};return e.forEach(e=>{const n=new _a(e).startWalking();Object.assign(t,n)}),t}(Object.values(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!oc.DEFER_DEFINITION_ERRORS_HANDLING&&0!==this.definitionErrors.length)throw e=this.definitionErrors.map(e=>e.message),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initGastRecorder(t),n.initPerformanceTracer(t),Object.hasOwn(t,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=Object.hasOwn(t,"skipValidations")?t.skipValidations:tc.skipValidations}}oc.DEFER_DEFINITION_ERRORS_HANDLING=!1,ic=oc,sc=[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:tc.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Lu)}getTokenToInsert(e){const t=Pl(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let a=!1;const l=this.LA_FAST(1);let u=this.LA_FAST(1);const c=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),n=new bu(t,l,this.LA(0));n.resyncedTokens=o.slice(0,-1),this.SAVE_ERROR(n)};for(;!a;){if(this.tokenMatcher(u,r))return void c();if(n.call(this))return c(),void e.apply(this,t);this.tokenMatcher(u,i)?a=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o))}this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA_FAST(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getNextPossibleTokenTypes(e){const t=e.ruleStack[0],n=this.getGAstProductions()[t];return new Wl(n,e).startWalking()}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new Nu("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(0===t.length)return!1;const n=this.LA_FAST(1);return void 0!==t.find(e=>this.tokenMatcher(n,e))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(t).includes(e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA_FAST(1),n=2;for(;;){const r=e.find(e=>fl(t,e));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(0===this.RULE_STACK_IDX)return wu;const e=this.currRuleShortName,t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK,n=this.RULE_STACK_IDX+1,r=new Array(n);for(let i=0;ithis.getFollowSetFromFollowKey(e)).flat()}getFollowSetFromFollowKey(e){if(e===wu)return[Ml];const t=e.ruleName+e.idxInCallingRule+Aa+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Ml)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA_FAST(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return t.slice(0,-1)}attemptInRepetitionRecovery(e,t,n,r,i,s,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){const e=this.RULE_STACK_IDX+1,t=new Array(e);for(let n=0;n{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:o}=function(e){Bu.reset(),e.accept(Bu);const t=Bu.dslMethods;return Bu.reset(),t}(e);t.forEach(t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${va(t)}${n}`,()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=Mu(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),n.forEach(t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,va(t))}),r.forEach(t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,va(t))}),i.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Ou,"RepetitionMandatory",t.maxLookahead,va(t))}),s.forEach(t=>{this.computeLookaheadFunc(e,t.idx,ku,"RepetitionMandatoryWithSeparator",t.maxLookahead,va(t))}),o.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Iu,"RepetitionWithSeparator",t.maxLookahead,va(t))})})})}computeLookaheadFunc(e,t,n,r,i,s){this.TRACE_INIT(`${s}${0===t?"":t}`,()=>{const s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=Mu(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,s)})}getKeyForAutomaticLookahead(e,t){return Mu(this.currRuleShortName,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:tc.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=$u,this.setNodeLocationFromNode=$u,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Uu,this.setNodeLocationFromNode=Uu,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{}}else this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{}}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA_FAST(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];var r,i,s;i=t,s=e,void 0===(r=n).children[s]?r.children[s]=[i]:r.children[s].push(i),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(void 0===this.baseCstVisitorConstructor){const e=function(e,t){const n=function(){};Gu(n,e+"BaseSemantics");const r={visit:function(e,t){if(Array.isArray(e)&&(e=e[0]),void 0!==e)return this[e.name](e.children,t)},validateVisitor:function(){const e=function(e,t){const n=function(e,t){return t.filter(t=>"function"==typeof e[t]==0).map(t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Wu.MISSING_METHOD,methodName:t})).filter(Boolean)}(e,t);return n}(this,t);if(0!==e.length){const t=e.map(e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(void 0===this.baseCstVisitorWithDefaultsConstructor){const e=function(e,t,n){const r=function(){};Gu(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return t.forEach(e=>{i[e]=Vu}),(r.prototype=i).constructor=r,r}(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):ec}LA_FAST(e){const t=this.currIdx+e;return this.tokVector[t]}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?ec:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=pl,this.subruleIdx=0,this.currRuleShortName=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(Array.isArray(e)){if(0===e.length)throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(Array.isArray(e))this.tokensMap=e.reduce((e,t)=>(e[t.name]=t,e),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(Sl)){const t=Object.values(e.modes).flat(),n=[...new Set(t)];this.tokensMap=n.reduce((e,t)=>(e[t.name]=t,e),{})}else{if("object"!=typeof e||null===e)throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=Object.assign({},e)}this.tokensMap.EOF=Ml;const n=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every(e=>{var t;return 0==(null===(t=e.categoryMatches)||void 0===t?void 0:t.length)});this.tokenMatcher=n?pl:fl,El(Object.values(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:nc.resyncEnabled,i=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:nc.recoveryValueFunc,s=this.ruleShortNameIdx<<12;let o;return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,o=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...t){this.onBeforeParse(e);try{return o.apply(this,t)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:t,coreRule:o})}invokeRuleCatch(e,t,n){const r=0===this.RULE_STACK_IDX,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(_u(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(Ou,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,Ou,e,Xl)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(ku,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Kl],t,ku,e,Kl)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let s=!0;for(;!0===i.call(this)&&!0===s;)s=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,jl,s)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(Iu,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,zl],t,Iu,e,zl)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,ku,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=Array.isArray(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX]),this.cstFinallyStateUpdate()}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.coreRule.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw _u(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA_FAST(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new bu(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===Fu?n:e}}}saveRecogState(){const e=this.errors,t=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);const t=e.RULE_STACK;for(let e=0;e=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX])}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=n,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ml)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let e=0;e${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:rc.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){var n;const r=null!==(n=e.coreRule)&&void 0!==n?n:e;return function(){this.isBackTrackingStack.push(1);const e=this.saveRecogState();try{return r.apply(this,t),!0}catch(e){if(_u(e))return!1;throw e}finally{this.reloadRecogState(e),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Object.values(this.gastProductionsCache).map(pa)}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:tc.errorMessageProvider}SAVE_ERROR(e){if(_u(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=lu(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],s=[];for(let e=1;e<=this.maxLookahead;e++)s.push(this.LA(e));const o=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:s,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new xu(o,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=au(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));const s=this.LA(0),o=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:s,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Tu(o,this.LA(1),s))}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const n=t>0?t:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return ec}topLevelRuleRecord(e,t){try{const n=new sa({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}}optionInternalRecord(e,t){return qu.call(this,aa,e,t)}atLeastOneInternalRecord(e,t){qu.call(this,la,t,e)}atLeastOneSepFirstInternalRecord(e,t){qu.call(this,ua,t,e,ju)}manyInternalRecord(e,t){qu.call(this,ca,t,e)}manySepFirstInternalRecord(e,t){qu.call(this,ha,t,e,ju)}orInternalRecord(e,t){return Qu.call(this,e,t)}subruleInternalRecord(e,t,n){if(Ju(t),!e||!Object.hasOwn(e,"ruleName")){const n=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=e.ruleName,s=new ia({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(s),this.outputCst?Yu:Hu}consumeInternalRecord(e,t,n){if(Ju(t),!Cl(e)){const n=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=new fa({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),Ku}},class{initPerformanceTracer(e){if(Object.hasOwn(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=tc.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()}}],sc.forEach(e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach(n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(ic.prototype,n,r):ic.prototype[n]=e.prototype[n]})});class ac extends oc{constructor(e,t=tc){const n=Object.assign({},t);n.outputCst=!1,super(e,n)}}function lc(e){return void 0!==e.lineNoCont?e.lineNoCont:e.startLine}class uc{visit(e){return e&&this[e.kind](e)}arraySpecifier(e){this.visit(e.size)}binaryExpression(e){this.visit(e.lhs),this.visit(e.rhs)}methodCall(e){this.visit(e.on),this.visit(e.functionCall)}functionCall(e){this.visit(e.callee);for(const t of e.args)this.visit(t)}arrayAccess(e){this.visit(e.on),this.visit(e.index)}translationUnit(e){for(const t of e.declarations)this.visit(t)}assignmentExpression(e){this.visit(e.lhs),this.visit(e.rhs)}fieldAccess(e){this.visit(e.on)}conditionalExpression(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}postfixExpression(e){this.visit(e.on)}commaExpression(e){this.visit(e.lhs),this.visit(e.rhs)}unaryExpression(e){this.visit(e.on)}functionDefinition(e){this.visit(e.returnType);for(const t of e.params)this.visit(t);this.visit(e.body)}functionPrototype(e){this.visit(e.returnType);for(const t of e.params)this.visit(t)}parameterDeclaration(e){this.visit(e.arraySpecifier),this.visit(e.typeSpecifier)}typeSpecifier(e){hc(e.typeSpecifierNonArray)&&this.visit(e.typeSpecifierNonArray),this.visit(e.arraySpecifier)}compoundStatement(e){for(const t of e.statements)this.visit(t)}returnStatement(e){this.visit(e.what)}continueStatement(e){}breakStatement(e){}discardStatement(e){}declarator(e){this.visit(e.arraySpecifier),this.visit(e.init)}doWhileStatement(e){this.visit(e.statement),this.visit(e.conditionExpression)}whileStatement(e){this.visit(e.conditionExpression),this.visit(e.statement)}forStatement(e){this.visit(e.initExpression),this.visit(e.conditionExpression),this.visit(e.loopExpression),this.visit(e.statement)}expressionStatement(e){this.visit(e.expression)}initDeclaratorListDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}precisionDeclaration(e){this.visit(e.typeSpecifierNoPrec)}selectionStatement(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}storageQualifier(e){}switchStatement(e){this.visit(e.initExpression);for(const t of e.cases)this.visit(t)}caseLabel(e){this.visit(e.case_)}caseBlock(e){this.visit(e.caseLabel);for(const t of e.statements)this.visit(t)}fullySpecifiedType(e){this.visit(e.typeQualifier),this.visit(e.typeSpecifier)}typeQualifier(e){this.visit(e.storageQualifier),this.visit(e.layoutQualifier)}structSpecifier(e){for(const t of e.declarations)this.visit(t)}layoutQualifier(e){}invariantDeclaration(e){}structDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}variableExpression(e){}constantExpression(e){}uniformBlock(e){this.visit(e.typeQualifier);for(const t of e.declarations)this.visit(t);this.visit(e.arraySpecifier)}ppDefine(e){this.visit(e.node)}ppDir(e){}ppExtension(e){}ppCall(e){}ppPragma(e){}}function cc(e){return"tokenType"in e}function hc(e){return"kind"in e}function dc(e,t){const n=e.split("\n"),r=t.startLine,i=t.endLine;return"./src/compiler.lambda:"+r+":"+(t.startColumn-1)+"\n"+n.map((e,t)=>[t+1,e]).slice(r-2,i+2).map(([e,n])=>{var s,o,a;return e>=r&&e<=i&&(s=n,o=6+(r===e?t.startColumn-1:0),a=6+(i===e?t.endColumn:n.length),n=s+"\n"+"-".repeat(o)+"^".repeat(a-o)),(""+e).padStart(5)+" "+n}).join("\n")}const fc=["active","asm","atomic_uint","attribute","cast","class","coherent","common","double","dvec2","dvec3","dvec4","enum","extern","external","filter","fixed","fvec2","fvec3","fvec4","goto","half","hvec2","hvec3","hvec4","iimage1D","iimage1DArray","iimage2D","iimage2DArray","iimage3D","iimageBuffer","iimageCube","image1D","image1DArray","image2D","image2DArray","image3D","imageBuffer","imageCube","inline","input","interface","isampler1D","isampler1DArray","isampler2DMS","isampler2DMSArray","isampler2DRect","isamplerBuffer","long","namespace","noinline","noperspective","output","partition","patch","public","readonly","resource","restrict","sample","sampler1D","sampler1DArray","sampler1DArrayShadow","sampler1DShadow","sampler2DMS","sampler2DMSArray","sampler2DRect","sampler2DRectShadow","sampler3DRect","samplerBuffer","short","sizeof","static","subroutine","superp","template","this","typedef","uimage1D","uimage1DArray","uimage2D","uimage2DArray","uimage3D","uimageBuffer","uimageCube","union","unsigned","usampler1D","usampler1DArray","usampler2DMS","usampler2DMSArray","usampler2DRect","usamplerBuffer","using","volatile","volatile","writeonly"];var pc;!function(e){e.ASSIGN_OP=kl({name:"ASSIGN_OP",pattern:yl.NA}),e.UNARY_OP=kl({name:"UNARY_OP",pattern:yl.NA}),e.POSTFIX_OP=kl({name:"POSTFIX_OP",pattern:yl.NA}),e.PRECISION_QUALIFIER=kl({name:"PRECISION_QUALIFIER",pattern:yl.NA}),e.INTERPOLATION_QUALIFIER=kl({name:"INTERPOLATION_QUALIFIER",pattern:yl.NA}),e.MULTIPLICATIVE_OP=kl({name:"MULTIPLICATIVE_OP",pattern:yl.NA}),e.ADDITIVE_OP=kl({name:"ADDITIVE_OP",pattern:yl.NA}),e.SHIFT_OP=kl({name:"SHIFT_OP",pattern:yl.NA}),e.RELATIONAL_OP=kl({name:"RELATIONAL_OP",pattern:yl.NA}),e.EQUALITY_OP=kl({name:"EQUALITY_OP",pattern:yl.NA}),e.PARAMETER_QUALIFIER=kl({name:"PARAMETER_QUALIFIER",pattern:yl.NA}),e.WHITESPACE=kl({name:"WHITESPACE",pattern:/\s+/,group:yl.SKIPPED}),e.LINE_COMMENT=kl({name:"LINE_COMMENT",pattern:/\/\/[^\r\n]*/,group:"COMMENTS"}),e.MULTILINE_COMMENT=kl({name:"MULTILINE_COMMENT",pattern:/\/\*[\s\S]*?\*\//,group:"COMMENTS"}),e.MULASSIGN=kl({name:"MULASSIGN",pattern:"*=",label:"'*='",categories:e.ASSIGN_OP}),e.DIVASSIGN=kl({name:"DIVASSIGN",pattern:"/=",label:"'/='",categories:e.ASSIGN_OP}),e.MODASSIGN=kl({name:"MODASSIGN",pattern:"%=",label:"'%='",categories:e.ASSIGN_OP}),e.ADDASSIGN=kl({name:"ADDASSIGN",pattern:"+=",label:"'+='",categories:e.ASSIGN_OP}),e.SUBASSIGN=kl({name:"SUBASSIGN",pattern:"-=",label:"'-='",categories:e.ASSIGN_OP}),e.LEFTASSIGN=kl({name:"LEFTASSIGN",pattern:"<<=",label:"'<<='",categories:e.ASSIGN_OP}),e.RIGHTASSIGN=kl({name:"RIGHTASSIGN",pattern:">>=",label:"'>>='",categories:e.ASSIGN_OP}),e.ANDASSIGN=kl({name:"ANDASSIGN",pattern:"&=",label:"'&='",categories:e.ASSIGN_OP}),e.XORASSIGN=kl({name:"XORASSIGN",pattern:"^=",label:"'^='",categories:e.ASSIGN_OP}),e.ORASSIGN=kl({name:"ORASSIGN",pattern:"|=",label:"'|='",categories:e.ASSIGN_OP}),e.INC_OP=kl({name:"INC_OP",pattern:"++",label:"'++'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.QUESTION=kl({name:"QUESTION",pattern:"?",label:"'?'"}),e.COLON=kl({name:"COLON",pattern:":",label:"':'"}),e.DEC_OP=kl({name:"DEC_OP",pattern:"--",label:"'--'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.AND_OP=kl({name:"AND_OP",pattern:"&&",label:"'&&'"}),e.XOR_OP=kl({name:"XOR_OP",pattern:"^^",label:"'^^'"}),e.OR_OP=kl({name:"OR_OP",pattern:"||",label:"'||'"}),e.LEFT_OP=kl({name:"LEFT_OP",pattern:"<<",label:"'<<'",categories:e.SHIFT_OP}),e.RIGHT_OP=kl({name:"RIGHT_OP",pattern:">>",label:"'>>'",categories:e.SHIFT_OP}),e.EQ_OP=kl({name:"EQ_OP",pattern:"==",label:"'=='",categories:e.EQUALITY_OP}),e.NE_OP=kl({name:"NE_OP",pattern:"!=",label:"'!='",categories:e.EQUALITY_OP}),e.LE_OP=kl({name:"LE_OP",pattern:"<=",label:"'<='",categories:e.RELATIONAL_OP}),e.GE_OP=kl({name:"GE_OP",pattern:">=",label:"'>='",categories:e.RELATIONAL_OP}),e.LEFT_ANGLE=kl({name:"LEFT_ANGLE",pattern:"<",label:"'<'",categories:e.RELATIONAL_OP}),e.RIGHT_ANGLE=kl({name:"RIGHT_ANGLE",pattern:">",label:"'>'",categories:e.RELATIONAL_OP}),e.PLUS=kl({name:"PLUS",pattern:"+",label:"'+'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.TILDE=kl({name:"TILDE",pattern:"~",label:"'~'",categories:e.UNARY_OP}),e.BANG=kl({name:"BANG",pattern:"!",label:"'!'",categories:e.UNARY_OP}),e.CARET=kl({name:"CARET",pattern:"^",label:"'^'"}),e.AMPERSAND=kl({name:"AND",pattern:"&",label:"'&'"}),e.VERTICAL_BAR=kl({name:"VERTICAL_BAR",pattern:"|",label:"'|'"}),e.SLASH=kl({name:"SLASH",pattern:"/",label:"'/'",categories:e.MULTIPLICATIVE_OP}),e.PERCENT=kl({name:"PERCENT",pattern:"%",label:"'%'",categories:e.MULTIPLICATIVE_OP}),e.STAR=kl({name:"STAR",pattern:"*",label:"'*'",categories:e.MULTIPLICATIVE_OP}),e.DASH=kl({name:"DASH",pattern:"-",label:"'-'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.COMMA=kl({name:"COMMA",pattern:",",label:"','"}),e.EQUAL=kl({name:"EQUAL",pattern:"=",label:"'='",categories:e.ASSIGN_OP}),e.LEFT_PAREN=kl({name:"LEFT_PAREN",pattern:"(",label:"'('"}),e.RIGHT_PAREN=kl({name:"RIGHT_PAREN",pattern:")",label:"')'"}),e.LEFT_BRACKET=kl({name:"LEFT_BRACKET",pattern:"[",label:"'['"}),e.RIGHT_BRACKET=kl({name:"RIGHT_BRACKET",pattern:"]",label:"']'"}),e.LEFT_BRACE=kl({name:"LEFT_BRACE",pattern:"{",label:"'{'"}),e.RIGHT_BRACE=kl({name:"RIGHT_BRACE",pattern:"}",label:"'}'"}),e.SEMICOLON=kl({name:"SEMICOLON",pattern:";",label:"';'"}),e.IDENTIFIER=kl({name:"IDENTIFIER",pattern:yl.NA}),e.NON_PP_IDENTIFIER=kl({name:"NON_PP_IDENTIFIER",pattern:/[a-z_]\w*/i,categories:e.IDENTIFIER}),e.PP=kl({name:"PP",pattern:yl.NA,categories:e.IDENTIFIER});const t=(t,n)=>kl({name:t,pattern:n,categories:e.PP,longer_alt:e.NON_PP_IDENTIFIER});e.DEFINE=t("DEFINE","define"),e.UNDEF=t("UNDEF","undef"),e.ENDIF=t("ENDIF","endif"),e.IFDEF=t("IFDEF","ifdef"),e.IFNDEF=t("IFNDEF","ifndef"),e.ELIF=t("ELIF","elif"),e.ERROR=t("ERROR","error"),e.VERSION=t("VERSION","version"),e.PRAGMA_DIRECTIVE=kl({name:"PRAGMA_DIRECTIVE",pattern:/#\s*pragma\s+[^\r\n]*/}),e.LINE=t("LINE","line"),e.EXTENSION=t("EXTENSION","extension"),e.INCLUDE=t("INCLUDE","include"),e.HASH_INCLUDE_MODULE=kl({name:"HASH_INCLUDE_MODULE",pattern:/#\s*include\s*<[\w\-./\\$@ ]+>/}),e.HASH=kl({name:"HASH",pattern:"#"}),e.KEYWORD=kl({name:"KEYWORD",pattern:yl.NA});const n=(t,n)=>kl({name:t,pattern:t.toLowerCase(),label:"'"+t.toLowerCase()+"'",longer_alt:e.NON_PP_IDENTIFIER,categories:n?[e.KEYWORD,n]:e.KEYWORD});e.CONST=n("CONST"),e.UNIFORM=n("UNIFORM"),e.LAYOUT=n("LAYOUT"),e.CENTROID=n("CENTROID"),e.FLAT=n("FLAT",e.INTERPOLATION_QUALIFIER),e.SMOOTH=n("SMOOTH",e.INTERPOLATION_QUALIFIER),e.BREAK=n("BREAK"),e.CONTINUE=n("CONTINUE"),e.DO=n("DO"),e.PRECISION=n("PRECISION"),e.FOR=n("FOR"),e.WHILE=n("WHILE"),e.SWITCH=n("SWITCH"),e.CASE=n("CASE"),e.DEFAULT=n("DEFAULT"),e.IF=n("IF"),e.ELSE=n("ELSE"),e.INVARIANT=n("INVARIANT"),e.INOUT=n("INOUT",e.PARAMETER_QUALIFIER),e.OUT=n("OUT",e.PARAMETER_QUALIFIER),e.VOID=n("VOID"),e.STRUCT=n("STRUCT"),e.DISCARD=n("DISCARD"),e.RETURN=n("RETURN"),e.LOWP=n("LOWP",e.PRECISION_QUALIFIER),e.MEDIUMP=n("MEDIUMP",e.PRECISION_QUALIFIER),e.HIGHP=n("HIGHP",e.PRECISION_QUALIFIER),e.CONSTANT=kl({name:"CONSTANT",pattern:yl.NA}),e.BASIC_TYPE=kl({name:"BASIC_TYPE",pattern:yl.NA});const r=t=>kl({name:t.toUpperCase(),pattern:t,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE});e.BOOL=r("bool"),e.INT=r("int"),e.FLOAT=r("float"),e.MAT2X3=r("mat2x3"),e.MAT2X4=r("mat2x4"),e.MAT2X2=kl({name:"mat2x2".toUpperCase(),pattern:/mat2(?:x2)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat2"}),e.MAT3X2=r("mat3x2"),e.MAT3X4=r("mat3x4"),e.MAT3X3=kl({name:"mat3x3".toUpperCase(),pattern:/mat3(?:x3)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat3"}),e.MAT4X2=r("mat4x2"),e.MAT4X3=r("mat4x3"),e.MAT4X4=kl({name:"MAT4X4",pattern:/mat4(?:x4)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat4"}),e.VEC2=r("vec2"),e.VEC3=r("vec3"),e.VEC4=r("vec4"),e.IVEC2=r("ivec2"),e.IVEC3=r("ivec3"),e.IVEC4=r("ivec4"),e.BVEC2=r("bvec2"),e.BVEC3=r("bvec3"),e.BVEC4=r("bvec4"),e.UINT=r("uint"),e.UVEC2=r("uvec2"),e.UVEC3=r("uvec3"),e.UVEC4=r("uvec4"),e.USAMPLERCUBE=r("usamplerCube"),e.USAMPLER3D=r("usampler3D"),e.USAMPLER2DARRAY=r("usampler2DArray"),e.USAMPLER2D=r("usampler2D"),e.SAMPLERCUBESHADOW=r("samplerCubeShadow"),e.SAMPLERCUBE=r("samplerCube"),e.SAMPLER3D=r("sampler3D"),e.SAMPLER2DSHADOW=r("sampler2DShadow"),e.SAMPLER2DARRAYSHADOW=r("sampler2DArrayShadow"),e.SAMPLER2DARRAY=r("sampler2DArray"),e.SAMPLER2D=r("sampler2D"),e.ISAMPLERCUBE=r("isamplerCube"),e.ISAMPLER3D=r("isampler3D"),e.ISAMPLER2DARRAY=r("isampler2DArray"),e.ISAMPLER2D=r("isampler2D"),e.IN=n("IN",e.PARAMETER_QUALIFIER),e.VARYING=n("VARYING"),e.ATTRIBUTE=n("ATTRIBUTE"),e.BOOLCONSTANT=kl({name:"BOOLCONSTANT",pattern:/true|false/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.CONSTANT}),e.FLOATCONSTANT=kl({name:"FLOATCONSTANT",pattern:/((\d+\.\d*|\.\d+)(e[+-]?\d+)?|\d+e[+-]?\d+)f?/i,categories:e.CONSTANT}),e.DOT=kl({name:"DOT",pattern:".",label:"'.'"}),e.UINTCONSTANT=kl({name:"UINTCONSTANT",pattern:/0x[\da-f]+u|\d+u/i,categories:e.CONSTANT}),e.INTCONSTANT=kl({name:"INTCONSTANT",pattern:/0x[\da-f]+|\d+/i,categories:e.CONSTANT}),e.STRING=kl({name:"STRING",pattern:/"([^"\\]+|\\")+"/})}(pc||(pc={}));const mc=Object.values(pc).filter(e=>e!==pc.NON_PP_IDENTIFIER).flatMap(e=>Array.isArray(e)?e:[e]);mc.push(pc.NON_PP_IDENTIFIER);const gc=new yl(mc,{ensureOptimizations:!1});new class extends uc{constructor(){super(...arguments),this.markError=()=>{}}eval(e,t,n){return this.isDefined=t,this.markError=n,super.visit(e)}constantExpression(e){if(e.const_.tokenType!==pc.INTCONSTANT)throw new Error("XX");return+e.const_.image}unaryExpression(e){switch(e.op.tokenType){case pc.NON_PP_IDENTIFIER:return+this.isDefined(e.on.var.image);case pc.DASH:return-this.visit(e.on);case pc.TILDE:return~this.visit(e.on);case pc.BANG:return+!this.visit(e.on);case pc.PLUS:return this.visit(e.on);default:throw new Error(e.op.tokenType.name)}}binaryExpression(e){const t=this.visit(e.lhs);switch(e.op.tokenType){case pc.AND_OP:return t&&this.visit(e.rhs);case pc.OR_OP:return t||this.visit(e.rhs);default:{const n=this.visit(e.rhs);return 0|function(e,t,n){switch(e){case pc.PLUS:return t+n;case pc.DASH:return t-n;case pc.STAR:return t*n;case pc.PERCENT:return t%n;case pc.SLASH:return t/n;case pc.LEFT_OP:return t<>n;case pc.EQ_OP:return t===n;case pc.NE_OP:return t!==n;case pc.LE_OP:return t<=n;case pc.GE_OP:return t>=n;case pc.LEFT_ANGLE:return tn;case pc.XOR_OP:return t!==n;case pc.AND_OP:return t&&n;case pc.OR_OP:return t||n;case pc.AMPERSAND:return t&n;case pc.CARET:return t^n;case pc.VERTICAL_BAR:return t|n;default:throw new Error}}(e.op.tokenType,t,n)}}}variableExpression(e){return this.markError("P0001",e.var,"undefined identifier "+e.var.image),0}};const Ec=new class extends ac{getTokensOnLine(){const e=[],t=lc(this.LA(0));let n;for(;lc(n=this.LA(1))===t;)e.push(n),this.SKIP_TOKEN();return e}constructor(){super(mc,{skipValidations:!0}),this.multiplicativeExpression=this.RR("multiplicativeExpression",()=>this.LEFT_ASSOC(this.preprocessing?this.ppUnaryExpression:this.unaryExpression,pc.MULTIPLICATIVE_OP)),this.additiveExpression=this.RR("additiveExpression",()=>this.LEFT_ASSOC(this.multiplicativeExpression,pc.ADDITIVE_OP)),this.shiftExpression=this.RR("shiftExpression",()=>this.LEFT_ASSOC(this.additiveExpression,pc.SHIFT_OP)),this.relationalExpression=this.RR("relationalExpression",()=>this.LEFT_ASSOC(this.shiftExpression,pc.RELATIONAL_OP)),this.equalityExpression=this.RR("equalityExpression",()=>this.LEFT_ASSOC(this.relationalExpression,pc.EQUALITY_OP)),this.andExpression=this.RR("andExpression",()=>this.LEFT_ASSOC(this.equalityExpression,pc.AMPERSAND)),this.exclusiveOrExpression=this.RR("exclusiveOrExpression",()=>this.LEFT_ASSOC(this.andExpression,pc.CARET)),this.inclusiveOrExpression=this.RR("inclusiveOrExpression",()=>this.LEFT_ASSOC(this.exclusiveOrExpression,pc.VERTICAL_BAR)),this.logicalAndExpression=this.RR("logicalAndExpression",()=>this.LEFT_ASSOC(this.inclusiveOrExpression,pc.AND_OP)),this.logicalXorExpression=this.RR("logicalXorExpression",()=>this.LEFT_ASSOC(this.logicalAndExpression,pc.XOR_OP)),this.logicalOrExpression=this.RR("logicalOrExpression",()=>this.LEFT_ASSOC(this.logicalXorExpression,pc.OR_OP)),this.assignmentExpression=this.RR("assignmentExpression",()=>{const e=this.SUBRULE(this.conditionalExpression);return this.OPTION(()=>{const t=this.CONSUME(pc.ASSIGN_OP),n=this.SUBRULE1(this.assignmentExpression);return{kind:"assignmentExpression",lhs:e,op:t,rhs:n}})??e}),this.expression=this.RR("expression",()=>{let e;return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.SUBRULE(this.assignmentExpression);return e=e?{kind:"commaExpression",lhs:e,rhs:t}:t}}),e}),this.conditionalExpression=this.RR("conditionalExpression",()=>{const e=this.SUBRULE1(this.logicalOrExpression);return this.OPTION(()=>({kind:"conditionalExpression",condition:e,QUESTION:this.CONSUME(pc.QUESTION),yes:this.SUBRULE2(this.expression),COLON:this.CONSUME(pc.COLON),no:this.SUBRULE3(this.assignmentExpression)}))??e}),this.switchStatement=this.RR("switchStatement",()=>{this.CONSUME(pc.SWITCH),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);this.CONSUME(pc.RIGHT_PAREN),this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.caseBlock))),this.CONSUME(pc.RIGHT_BRACE),{kind:"switchStatement",initExpression:e,cases:t}}),this.caseBlock=this.RR("caseBlock",()=>{const e=this.SUBRULE(this.caseLabel),t=[];return this.MANY1(()=>t.push(this.SUBRULE(this.statement))),{kind:"caseBlock",caseLabel:e,statements:t}}),this.jumpStatement=this.RR("jumpStatement",()=>{const e=this.OR([{ALT:()=>(this.CONSUME(pc.CONTINUE),{kind:"continueStatement"})},{ALT:()=>(this.CONSUME(pc.BREAK),{kind:"breakStatement"})},{ALT:()=>(this.CONSUME(pc.DISCARD),{kind:"discardStatement"})},{ALT:()=>(this.CONSUME(pc.RETURN),{kind:"returnStatement",what:this.OPTION(()=>this.SUBRULE(this.expression))})}]);return this.CONSUME(pc.SEMICOLON),e}),this.primaryExpression=this.RR("primaryExpression",()=>this.OR([{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),e}},{ALT:()=>({kind:"variableExpression",var:this.CONSUME(pc.IDENTIFIER)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.CONSTANT)})}])),this.constantExpression=this.RR("constantExpression",()=>this.SUBRULE(this.conditionalExpression)),this.layoutQualifier=this.RR("layoutQualifier",()=>{this.CONSUME(pc.LAYOUT),this.CONSUME(pc.LEFT_PAREN);const e=[];return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.CONSUME(pc.IDENTIFIER);let n;this.OPTION(()=>{this.CONSUME(pc.EQUAL),n=this.OR([{ALT:()=>this.CONSUME(pc.INTCONSTANT)},{ALT:()=>this.CONSUME(pc.UINTCONSTANT)}])}),e.push({IDENTIFIER:t,init:n})}}),this.CONSUME(pc.RIGHT_PAREN),{kind:"layoutQualifier",layoutQualifierIds:e}}),this.storageQualifier=this.RR("storageQualifier",()=>{let e,t,n,r,i,s,o;return this.OR([{ALT:()=>e=this.CONSUME(pc.CONST)},{ALT:()=>{t=this.OPTION(()=>this.CONSUME(pc.CENTROID)),this.OR9([{ALT:()=>n=this.CONSUME(pc.IN)},{ALT:()=>r=this.CONSUME(pc.OUT)},{ALT:()=>s=this.CONSUME(pc.VARYING)},{ALT:()=>o=this.CONSUME(pc.ATTRIBUTE)}])}},{ALT:()=>i=this.CONSUME(pc.UNIFORM)}]),{kind:"storageQualifier",CONST:e,CENTROID:t,IN:n,OUT:r,VARYING:s,ATTRIBUTE:o,UNIFORM:i}}),this.typeQualifier=this.RR("typeQualifier",()=>{let e,t,n,r;return this.OR([{ALT:()=>e=this.SUBRULE(this.storageQualifier)},{ALT:()=>{t=this.SUBRULE1(this.layoutQualifier),e=this.OPTION1(()=>this.SUBRULE2(this.storageQualifier))}},{ALT:()=>{n=this.CONSUME(pc.INTERPOLATION_QUALIFIER),e=this.OPTION2(()=>this.SUBRULE3(this.storageQualifier))}},{ALT:()=>{r=this.CONSUME(pc.INVARIANT),n=this.OPTION3(()=>this.CONSUME1(pc.INTERPOLATION_QUALIFIER)),e=this.SUBRULE7(this.storageQualifier)}}]),{kind:"typeQualifier",storageQualifier:e,layoutQualifier:t,interpolationQualifier:n,invariantQualifier:r}}),this.precisionQualifier=this.RR("precisionQualifier",()=>this.CONSUME(pc.PRECISION_QUALIFIER)),this.arraySpecifier=this.RR("arraySpecifier",()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.OPTION3(()=>this.SUBRULE(this.constantExpression));return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arraySpecifier",size:e}}),this.typeSpecifierNonArray=this.RR("typeSpecifierNonArray",()=>this.OR([{ALT:()=>this.CONSUME(pc.BASIC_TYPE)},{ALT:()=>this.CONSUME(pc.VOID)},{ALT:()=>this.SUBRULE(this.structSpecifier)},{ALT:()=>this.CONSUME(pc.IDENTIFIER)}])),this.typeSpecifierNoPrec=this.RR("typeSpecifierNoPrec",()=>{const e=this.SUBRULE(this.typeSpecifierNonArray);return{kind:"typeSpecifier",precisionQualifier:void 0,arraySpecifier:this.OPTION1(()=>this.SUBRULE(this.arraySpecifier)),typeSpecifierNonArray:e}}),this.functionCall=this.RR("functionCall",()=>{const e=this.SUBRULE(this.typeSpecifierNoPrec);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({DEF:()=>t.push(this.SUBRULE(this.assignmentExpression)),SEP:pc.COMMA}),this.CONSUME(pc.RIGHT_PAREN),{kind:"functionCall",callee:e,args:t}}),this.functionCallHeader=this.RULE("functionCallHeader",()=>{this.SUBRULE(this.typeSpecifierNoPrec),this.CONSUME(pc.LEFT_PAREN)}),this.postfixExpression=this.RR("postfixExpression",()=>{const e=this.LA(1);let t=this.OR1([{GATE:this.BACKTRACK(this.functionCallHeader),ALT:()=>this.SUBRULE1(this.functionCall)},{ALT:()=>this.SUBRULE(this.primaryExpression)}]);return this.MANY(()=>{t=this.OR2([{ALT:()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arrayAccess",on:t,index:e}}},{ALT:()=>{this.CONSUME1(pc.DOT);const e=this.SUBRULE2(this.functionCall);return{kind:"methodCall",on:t,functionCall:e}}},{ALT:()=>{this.CONSUME2(pc.DOT);const e=this.CONSUME(pc.IDENTIFIER);return{kind:"fieldAccess",on:t,field:e}}},{ALT:()=>{const e=this.CONSUME(pc.POSTFIX_OP);return{kind:"postfixExpression",on:t,op:e}}}]),this.FINALIZE(t,e)}),t}),this.unaryExpression=this.RR("unaryExpression",()=>this.OR([{ALT:()=>this.SUBRULE1(this.postfixExpression)},{ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.UNARY_OP),on:this.SUBRULE2(this.unaryExpression)})}])),this.ppUnaryExpression=this.RR("ppUnaryExpression",()=>this.OR([{GATE:()=>this.LA(1).tokenType===pc.NON_PP_IDENTIFIER&&"defined"===this.LA(1).image,ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.IDENTIFIER),on:{kind:"variableExpression",var:this.OR1([{ALT:()=>this.SUBRULE(this.ppIdentifier)},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE1(this.ppIdentifier);return this.CONSUME(pc.RIGHT_PAREN),e}}])}})},{ALT:()=>({kind:"unaryExpression",op:this.OR2([{ALT:()=>this.CONSUME(pc.PLUS)},{ALT:()=>this.CONSUME(pc.DASH)},{ALT:()=>this.CONSUME(pc.TILDE)},{ALT:()=>this.CONSUME(pc.BANG)}]),on:this.SUBRULE2(this.ppUnaryExpression)})},{ALT:()=>this.SUBRULE(this.ppPrimaryExpression)}])),this.ppPrimaryExpression=this.RR("ppPrimaryExpression",()=>this.OR([{ALT:()=>({kind:"variableExpression",var:this.SUBRULE(this.ppIdentifier)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.INTCONSTANT)})},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.ppConstantExpression);return this.CONSUME(pc.RIGHT_PAREN),e}}])),this.ppConstantExpression=this.RR("ppConstantExpression",()=>{try{return this.preprocessing=!0,this.LEFT_ASSOC(this.logicalAndExpression,pc.OR_OP)}finally{this.preprocessing=!1}}),this.typeSpecifier=this.RR("typeSpecifier",()=>{const e=this.OPTION(()=>this.SUBRULE(this.precisionQualifier)),t=this.SUBRULE(this.typeSpecifierNoPrec);return Object.assign({},t,{precisionQualifier:e})}),this.parameterDeclaration=this.RR("parameterDeclaration",()=>{const e=this.OPTION(()=>this.CONSUME(pc.CONST)),t=this.OPTION1(()=>this.CONSUME(pc.PARAMETER_QUALIFIER)),n=this.SUBRULE(this.typeSpecifier);let r,i;return this.OPTION2(()=>{r=this.CONSUME2(pc.IDENTIFIER),i=this.OPTION3(()=>this.SUBRULE(this.arraySpecifier))}),{kind:"parameterDeclaration",parameterTypeQualifier:e,pName:r,arraySpecifier:i,parameterQualifier:t,typeSpecifier:n}}),this.fullySpecifiedType=this.RR("fullySpecifiedType",()=>({kind:"fullySpecifiedType",typeQualifier:this.OPTION(()=>this.SUBRULE(this.typeQualifier)),typeSpecifier:this.SUBRULE(this.typeSpecifier)})),this.structDeclaration=this.RR("structDeclaration",()=>{const e=this.SUBRULE(this.fullySpecifiedType),t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME(pc.IDENTIFIER),arraySpecifier:this.OPTION(()=>this.SUBRULE(this.arraySpecifier)),init:void 0};return t.push(e),e})}),this.CONSUME(pc.SEMICOLON),{kind:"structDeclaration",fsType:e,declarators:t}}),this.structSpecifier=this.RR("structSpecifier",()=>{this.CONSUME(pc.STRUCT);const e=this.OPTION2(()=>this.CONSUME(pc.IDENTIFIER));this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),{kind:"structSpecifier",name:e,declarations:t}}),this.initializer=this.RR("initializer",()=>this.SUBRULE(this.assignmentExpression)),this.singleDeclaration=this.RULE("singleDeclaration",()=>this.OR([{ALT:()=>{this.SUBRULE(this.fullySpecifiedType),this.OPTION1(()=>{this.CONSUME1(pc.IDENTIFIER),this.OPTION2(()=>{this.CONSUME(pc.LEFT_BRACKET),this.OPTION3(()=>this.SUBRULE(this.constantExpression)),this.CONSUME(pc.RIGHT_BRACKET)}),this.OPTION4(()=>{this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)})})}},{ALT:()=>({kind:"invariantDeclaration",INVARIANT:this.CONSUME(pc.INVARIANT),IDENTIFIER:this.CONSUME2(pc.IDENTIFIER)})}])),this.initDeclaratorList=this.RR("initDeclaratorList",()=>this.SUBRULE(this.externalDeclaration,{ARGS:[!1,!1]})),this.expressionStatement=this.RR("expressionStatement",()=>{const e=this.OPTION(()=>this.SUBRULE(this.expression));return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:e}}),this.condition=this.RR("condition",()=>this.OR({MAX_LOOKAHEAD:4,DEF:[{GATE:this.BACKTRACK(this.singleDeclaration),ALT:()=>{const e=this.SUBRULE2(this.fullySpecifiedType),t=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.EQUAL),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:[{kind:"declarator",name:t,init:this.SUBRULE3(this.initializer),arraySpecifier:void 0}]}}},{ALT:()=>this.SUBRULE(this.expression)}]})),this.caseLabel=this.RR("caseLabel",()=>this.OR([{ALT:()=>{this.CONSUME(pc.CASE);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.COLON),{kind:"caseLabel",case_:e}}},{ALT:()=>(this.CONSUME2(pc.DEFAULT),this.CONSUME2(pc.COLON),{kind:"caseLabel",case_:void 0})}])),this.selectionStatement=this.RR("selectionStatement",()=>{this.CONSUME(pc.IF),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),{kind:"selectionStatement",condition:e,yes:this.SUBRULE2(this.statement,{ARGS:[!0]}),no:this.OPTION(()=>(this.CONSUME(pc.ELSE),this.SUBRULE3(this.statement,{ARGS:[!0]})))}}),this.statement=this.RR("statement",e=>this.OR([{ALT:()=>this.SUBRULE(this.ppDirective),IGNORE_AMBIGUITIES:!0},{ALT:()=>{const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:{kind:"variableExpression",var:e}}},IGNORE_AMBIGUITIES:!0},{GATE:this.BACKTRACK(this.expressionStatement),ALT:()=>this.SUBRULE(this.expressionStatement)},{ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.selectionStatement)},{ALT:()=>this.SUBRULE(this.switchStatement)},{ALT:()=>this.SUBRULE(this.iterationStatement)},{ALT:()=>this.SUBRULE(this.jumpStatement)},{ALT:()=>this.SUBRULE(this.compoundStatement,{ARGS:[!!e]})}])),this.compoundStatement=this.RR("compoundStatement",e=>{if("object"==typeof e)throw new Error;this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.statement))),this.CONSUME(pc.RIGHT_BRACE),{kind:"compoundStatement",statements:t,newScope:!!e}}),this.iterationStatement=this.RR("iterationStatement",()=>this.OR([{ALT:()=>{this.CONSUME(pc.WHILE),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.condition);return this.CONSUME(pc.RIGHT_PAREN),{kind:"whileStatement",conditionExpression:e,statement:this.SUBRULE(this.statement)}}},{ALT:()=>{this.CONSUME2(pc.DO);const e=this.SUBRULE2(this.statement,{ARGS:[!0]});this.CONSUME2(pc.WHILE),this.CONSUME2(pc.LEFT_PAREN);const t=this.SUBRULE2(this.expression);return this.CONSUME2(pc.RIGHT_PAREN),this.CONSUME2(pc.SEMICOLON),{kind:"doWhileStatement",statement:e,conditionExpression:t}}},{ALT:()=>{this.CONSUME3(pc.FOR),this.CONSUME3(pc.LEFT_PAREN);const e=this.OR3([{GATE:this.BACKTRACK(this.initDeclaratorList),ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.expressionStatement)}]),t=this.OPTION3(()=>this.SUBRULE3(this.condition));this.CONSUME4(pc.SEMICOLON);const n=this.OPTION4(()=>this.SUBRULE4(this.expression));return this.CONSUME3(pc.RIGHT_PAREN),{kind:"forStatement",initExpression:e,conditionExpression:t,loopExpression:n,statement:this.SUBRULE3(this.statement)}}}])),this.translationUnit=this.RR("translationUnit",()=>{const e=[];return this.AT_LEAST_ONE(()=>e.push(this.SUBRULE(this.externalDeclaration,{ARGS:[!0,!0]}))),{kind:"translationUnit",declarations:e}}),this.uniformBlock=this.RR("uniformBlock",()=>{const e=this.SUBRULE(this.typeQualifier),t=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_BRACE);const n=[];let r,i;return this.MANY(()=>n.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),this.OPTION(()=>{r=this.CONSUME1(pc.IDENTIFIER),i=this.OPTION1(()=>this.SUBRULE(this.arraySpecifier))}),this.CONSUME(pc.SEMICOLON),{kind:"uniformBlock",typeQualifier:e,blockName:t,declarations:n,namespace:r,arraySpecifier:i}}),this.uniformBlockHeader=this.RULE("uniformBlockHeader",()=>{this.OPTION(()=>this.SUBRULE(this.layoutQualifier)),this.CONSUME(pc.UNIFORM),this.CONSUME(pc.IDENTIFIER),this.CONSUME(pc.LEFT_BRACE)}),this.typeQualifierDeclaration=this.RR("typeQualifierDeclaration",()=>{const e=this.SUBRULE(this.typeQualifier);return this.CONSUME(pc.SEMICOLON),{kind:"typeQualifierDeclaration",typeQualifier:e}}),this.externalDeclaration=this.RR("externalDeclaration",(e,t)=>this.OR([{ALT:()=>this.SUBRULE(this.ppCall)},{ALT:()=>this.SUBRULE(this.ppDirective)},{GATE:this.BACKTRACK(this.typeQualifierDeclaration),ALT:()=>this.SUBRULE(this.typeQualifierDeclaration)},{GATE:e?this.BACKTRACK(this.uniformBlockHeader):()=>!1,ALT:()=>this.SUBRULE(this.uniformBlock)},{ALT:()=>{const e=this.SUBRULE(this.fullySpecifiedType);return this.OR2([{GATE:t?void 0:()=>!1,ALT:()=>{const t=this.CONSUME1(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const n=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>n.push(this.SUBRULE(this.parameterDeclaration))}),this.CONSUME(pc.RIGHT_PAREN),this.OR3([{ALT:()=>(this.CONSUME(pc.SEMICOLON),{kind:"functionPrototype",name:t,returnType:e,params:n})},{ALT:()=>{const r=this.SUBRULE(this.compoundStatement);return{kind:"functionDefinition",name:t,returnType:e,params:n,body:r}},IGNORE_AMBIGUITIES:!1}])}},{ALT:()=>{const t=[];return this.MANY_SEP2({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME3(pc.IDENTIFIER),arraySpecifier:this.OPTION5(()=>this.SUBRULE(this.arraySpecifier)),init:this.OPTION7(()=>(this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)))};return t.push(e),e})}),this.CONSUME2(pc.SEMICOLON),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:t}}}])}},{ALT:()=>{this.CONSUME(pc.PRECISION);const e=this.CONSUME(pc.PRECISION_QUALIFIER),t=this.SUBRULE(this.typeSpecifierNoPrec);return this.CONSUME3(pc.SEMICOLON),{kind:"precisionDeclaration",precisionQualifier:e,typeSpecifierNoPrec:t}}}])),this.ppDefine=this.RR("ppDefine",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.DEFINE);const e=this.CONSUME(pc.IDENTIFIER),t=this.LA(1).tokenType===pc.LEFT_PAREN&&e.endOffset+1===this.LA(1).startOffset,n={kind:"ppDefine",what:e,params:this.OPTION({GATE:()=>t,DEF:()=>{this.CONSUME(pc.LEFT_PAREN);const e=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>e.push(this.SUBRULE(this.ppIdentifier))}),this.CONSUME(pc.RIGHT_PAREN),e}}),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(n),n}),this.ppInclude=this.RR("ppInclude",()=>{let e="";return this.OR([{ALT:()=>{const t=this.CONSUME(pc.HASH_INCLUDE_MODULE);e=t.image.substring(t.image.indexOf("<"))}},{ALT:()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.INCLUDE),e=this.CONSUME(pc.STRING).image}}]),{kind:"ppInclude",what:e}}),this.ppCall=this.RR("ppCall",()=>{const e=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>{const e=[];this.MANY(()=>this.OR({DEF:[{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>e.push(this.CONSUME(pc.BASIC_TYPE))},{ALT:()=>e.push(this.CONSUME(pc.ASSIGN_OP))},{ALT:()=>e.push(this.CONSUME(pc.SHIFT_OP))},{ALT:()=>e.push(this.CONSUME(pc.CONSTANT))},{ALT:()=>e.push(this.CONSUME(pc.KEYWORD))},{ALT:()=>e.push(this.CONSUME2(pc.IDENTIFIER))}]})),t.push({tokens:e,node:void 0})},MAX_LOOKAHEAD:1}),this.CONSUME(pc.RIGHT_PAREN),{kind:"ppCall",callee:e,args:t}}),this.ppCallArg=this.RULE("ppCallArg",()=>{const e=[];return e.push(this.CONSUME(pc.LEFT_PAREN)),this.MANY(()=>this.OR([{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>(e.push(this.LA(1)),this.SKIP_TOKEN())}])),e.push(this.CONSUME(pc.RIGHT_PAREN)),e}),this.ppNone=this.RR("ppNone",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.ELSE)},{ALT:()=>this.CONSUME(pc.ENDIF)}]),tokens:[],node:void 0};return this.ppDefs.push(e),e}),this.ppMulti=this.RR("ppMulti",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IF)},{ALT:()=>this.CONSUME(pc.ELIF)},{ALT:()=>this.CONSUME(pc.ERROR)},{ALT:()=>this.CONSUME(pc.VERSION)},{ALT:()=>this.CONSUME(pc.LINE)}]),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(e),e}),this.ppPragma=this.RR("ppPragma",()=>({kind:"ppPragma",dir:this.CONSUME(pc.PRAGMA_DIRECTIVE)})),this.ppSingle=this.RR("ppSingle",()=>(this.CONSUME(pc.HASH),{kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IFDEF)},{ALT:()=>this.CONSUME(pc.IFNDEF)}]),tokens:[this.CONSUME(pc.IDENTIFIER)],node:void 0})),this.ppExtension=this.RR("ppExtension",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.EXTENSION);const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.COLON),{kind:"ppExtension",extension:e,behavior:this.CONSUME1(pc.IDENTIFIER)}}),this.ppDirective=this.RR("ppDirective",()=>this.OR([{ALT:()=>this.SUBRULE(this.ppDefine)},{ALT:()=>this.SUBRULE(this.ppExtension)},{ALT:()=>this.SUBRULE(this.ppNone)},{ALT:()=>this.SUBRULE(this.ppSingle)},{ALT:()=>this.SUBRULE(this.ppMulti)},{ALT:()=>this.SUBRULE(this.ppPragma)},{ALT:()=>this.SUBRULE(this.ppInclude)}])),this.ppIdentifier=this.RR("ppIdentifier",()=>this.OR([{ALT:()=>this.CONSUME(pc.IDENTIFIER)},{ALT:()=>this.CONSUME(pc.KEYWORD)},{ALT:()=>this.CONSUME(pc.BASIC_TYPE)}])),this.ppDefs=[],this.performSelfAnalysis()}reset(){super.reset(),this.ppDefs=[],this.backtracking=!1,this.preprocessing=!1}LEFT_ASSOC(e,t){const n=this.LA(1);let r=this.SUBRULE1(e);return this.MANY(()=>{const i=this.CONSUME(t),s=this.SUBRULE2(e);return r={kind:"binaryExpression",lhs:r,rhs:s,op:i,firstToken:n,lastToken:this.LA(0)},r}),r}ANNOTATE(e){return(...t)=>{const n=this.LA(1),r=e(...t);return r&&hc(r)&&!r.firstToken&&this.FINALIZE(r,n),r}}BACKTRACK(e,t){const n=super.BACKTRACK(e,t);return function(){try{return this.backtracking=!0,n.call(this)}finally{this.backtracking=!1}}}RR(e,t,n){return super.RULE(e,this.ANNOTATE(t),n)}FINALIZE(e,t){this.RECORDING_PHASE||this.backtracking||(e.firstToken=t,e.lastToken=this.LA(0))}isAtEof(){return this.LA(1).tokenType===Ml}};const{ll:{printDocToString:vc},LX:{indentIfBreak:Cc,group:Dc,indent:Sc,join:Ac,line:_c,softline:yc,hardline:bc,fill:Tc,lineSuffixBoundary:Rc}}=r,xc=new class extends uc{constructor(){super(...arguments),this.result=void 0}visit(e){if(!this.result){const t=this.result=[];return super.visit(e),this.result=void 0,t}e&&this.result.push(e)}};function wc(e){return(cc(e)?e:e.lastToken).endOffset+1}const Fc={"glsl-parser":{parse(e,t){const n=function(e){const t=function(e){const t=[];let n="",r=0,i=0;return{result:e.replace(/\\(\r\n|\n\r|\r|\n)(.*?)(?:(?=\\?[\r\n])|$)/g,(s,o,a,l)=>{r++,i+=function(e,t){let n=t;for(;n>=0&&"\r"!==e[n]&&"\n"!==e[n];)n--;return t-n-1}(e,l),t.push({originalOffset:l+1+o.length,newOffset:l-n.length,length:a.length,lineDiff:-r,columnDiff:i}),n+=" "+o;let u="";return e.length>l+s.length&&"\\"===e[l+s.length]||(u=n,n="",r=0,i=0),a+u}),changes:t}}(e),n=gc.tokenize(t.result);!function(e,t){if(t.errors.length)throw new Error("LEXER ERROR: "+t.errors.map(t=>t.message+":\n"+dc(e,{startLine:t.line,startColumn:t.column,endLine:t.line,endColumn:t.column+t.length})).join())}(t.result,n),function(e,t){let n=0;function r(e,t){const n=t.originalOffset-t.newOffset;e.startOffset>=t.newOffset&&(e.lineNoCont=e.startLine,e.startOffset+=n,e.startLine-=t.lineDiff,e.startColumn-=t.columnDiff),e.endOffset+=n,e.endLine-=t.lineDiff,e.endColumn-=t.columnDiff}for(const i of t){for(;e[n]&&e[n].endOffset0)throw new Error("PARSE ERROR: "+t.map(t=>t.message+"\n"+t.context.ruleStack.join(" > ")+"\n"+dc(e,t.token)).join("\n"))}(t.result,Ec.errors);const i=Ec.ppDefs;function s(e,t){Ec.input=e;const n=t(Ec);return Ec.isAtEof()&&0===Ec.errors.length?n:void 0}for(const e of i)e.node=s(e.tokens,e=>e.externalDeclaration(!0,!0))??s(e.tokens,e=>e.statement())??s(e.tokens,e=>e.expression());return r.comments=n.groups.COMMENTS,r}(e);return n.comments?.forEach(e=>e.value=JSON.stringify(e)),n},astFormat:"glsl-ast",locStart:function(e){return(cc(e)?e:e.firstToken).startOffset},locEnd:wc}};function Nc(e){switch(e){case pc.STAR:case pc.SLASH:case pc.PERCENT:return 4;case pc.PLUS:case pc.DASH:return 5;case pc.LEFT_OP:case pc.RIGHT_OP:return 6;case pc.LEFT_ANGLE:case pc.RIGHT_ANGLE:case pc.LE_OP:case pc.GE_OP:return 7;case pc.EQ_OP:case pc.NE_OP:return 8;case pc.AMPERSAND:return 9;case pc.CARET:return 10;case pc.VERTICAL_BAR:return 11;case pc.AND_OP:case pc.XOR_OP:return 12;case pc.OR_OP:return 13;case pc.COMMA:return 17;default:throw new Error}}function Lc(e,t){switch(e.kind){default:return 1;case"variableExpression":return t?.find(t=>t.image===e.var.image)?18:1;case"arrayAccess":case"functionCall":case"fieldAccess":case"postfixExpression":return 2;case"unaryExpression":return 3;case"binaryExpression":return Nc(e.op.tokenType);case"conditionalExpression":return 15;case"assignmentExpression":return 16;case"commaExpression":return 17}}function Oc(e,t){return t?["(",e,")"]:e}function Ic(e,t,n,r){const i="binaryExpression"===n.kind&&"binaryExpression"===n.lhs.kind&&Nc(n.lhs.op.tokenType)===Nc(n.op.tokenType)||"commaExpression"===n.kind&&"commaExpression"===n.lhs.kind,s="binaryExpression"===n.kind?n.op.tokenType:pc.COMMA;let o;return i?(o=e.call(e=>Ic(e,t,e.getValue(),r),"lhs"),o.push("commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))),o):[Oc(e.call(t,"lhs"),Lc(n.lhs,r)>Nc(s)),"commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))]}function kc(e,t,n){return"expressionStatement"!==e.kind||e.expression?"compoundStatement"===e.kind||n?[" ",t]:Sc([_c,t]):";"}function Mc(e,t){return vc(e,Object.assign({},t,{printWidth:t.printWidth-2})).formatted.trim().replace(/^.*(?=[\r\n])/gm,e=>e+" ".repeat(t.printWidth-2-e.length+1)+"\\")}function Pc(e){return"assignmentExpression"===e.kind}function Bc(e){return"assignmentExpression"===e.kind||"declarator"===e.kind}function Uc(e,t,n,r,i,s){const o=function(e,t,n){if(!n)return"only-left";const r=!Pc(n);return e.match(Pc,Bc,e=>!r||"expressionStatement"!==e.kind&&"initDeclaratorListDeclaration"!==e.kind)?r?"chain-tail":"chain":!r&&Pc(n.rhs)||(t.originalText,0)||"binaryExpression"===n.kind||"commaExpression"===n.kind||"conditionalExpression"===n.kind&&"binaryExpression"===n.condition.kind?"break-after-operator":"constantExpression"===n.kind?"never-break-after-operator":"fluid"}(e,t,s);switch(o){case"break-after-operator":return Dc([Dc(n),r,Dc(Sc([_c,i]))]);case"never-break-after-operator":return Dc([Dc(n),r," ",i]);case"fluid":{const e=Symbol("assignment");return Dc([Dc(n),r,Dc(Sc(_c),{id:e}),Rc,Cc(i,{groupId:e})])}case"chain":return[Dc(n),r,_c,i];case"chain-tail":return[Dc(n),r,Sc([_c,i])];case"only-left":return n;default:throw new Error}}const $c={"glsl-ast":{print(e,t,n){const r=t.inMacro,i=e.getValue();if(!i)return[];if(cc(i))return i.image;const s=t=>e.call(n,t);try{switch(i.kind){case"translationUnit":{const r=[];return e.each((e,i)=>{const s=e.getValue();r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc),r.push(bc)},"declarations"),r}case"precisionDeclaration":return["precision ",i.precisionQualifier.image," ",e.call(n,"typeSpecifierNoPrec"),";"];case"fullySpecifiedType":{const e=[];return i.typeQualifier&&e.push(s("typeQualifier")," "),e.push(s("typeSpecifier")),e}case"typeSpecifier":{const e=[];return i.precisionQualifier&&e.push(i.precisionQualifier.image," "),e.push(s("typeSpecifierNonArray")),i.arraySpecifier&&e.push(s("arraySpecifier")),e}case"typeQualifier":{const e=[];return i.invariantQualifier&&e.push("invariant"),i.interpolationQualifier&&e.push(i.interpolationQualifier.image),i.layoutQualifier&&e.push(s("layoutQualifier")),i.storageQualifier&&e.push(s("storageQualifier")),Ac(" ",e)}case"storageQualifier":{const t=[];return i.CONST&&t.push("const"),i.CENTROID&&e.getParentNode().interpolationQualifier?.tokenType!==pc.FLAT&&t.push("centroid"),i.IN&&t.push("in"),i.OUT&&t.push("out"),i.VARYING&&t.push("varying"),i.ATTRIBUTE&&t.push("attribute"),i.UNIFORM&&t.push("uniform"),Ac(" ",t)}case"functionPrototype":case"functionDefinition":return[Dc([s("returnType")," ",s("name"),"(",Sc([yc,Ac([",",_c],e.map(n,"params"))]),yc,")"]),"functionPrototype"===i.kind?";":[" ",s("body")]];case"parameterDeclaration":return[i.parameterTypeQualifier?[s("parameterTypeQualifier")," "]:"",i.parameterQualifier?.tokenType===pc.OUT||i.parameterQualifier?.tokenType===pc.INOUT?i.parameterQualifier?.image+" ":"",s("typeSpecifier")," ",s("pName"),s("arraySpecifier")];case"initDeclaratorListDeclaration":case"structDeclaration":{const t=e.map(n,"declarators"),r="forStatement"===e.getParentNode().kind,o=i.declarators.some(e=>e.init);return Dc([s("fsType"),0===t.length?"":" ",1===t.length?t:Dc(Sc(Ac([",",o&&!r?bc:_c],t))),";"])}case"declarator":{const n=s("arraySpecifier"),r=[i.name.image,n];return Uc(e,t,r," =",s("init"),i.init)}case"arraySpecifier":return Dc(["[",Sc([yc,s("size")]),yc,"]"]);case"arrayAccess":return[Oc(s("on"),Lc(i.on,r)>2),"[",s("index"),"]"];case"structSpecifier":{const r=[];return e.each((e,i,s)=>{const o=e.getValue();r.push(bc),r.push(n(e)),i!==s.length-1&&_s.isNextLineEmpty(t.originalText,o,wc)&&r.push(bc)},"declarations"),Dc(["struct",i.name?" "+i.name.image:""," {",Sc(r),bc,"}"])}case"compoundStatement":{const r=[],s=!!i.comments?.some(e=>!e.leading&&!e.trailing&&!e.printed);return e.each((e,i)=>{const s=e.getValue();0!==i&&r.push(bc),r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc)},"statements"),s&&e.each(e=>{const t=e.getValue();t.leading||t.trailing||(r.push(n(e)),t.printed=!0)},"comments"),Dc(["{",r.length?[Sc([bc,r]),bc]:"","}"])}case"returnStatement":return i.what?["return"," ",s("what"),";"]:"return;";case"breakStatement":return"break;";case"continueStatement":return"continue;";case"discardStatement":return"discard;";case"selectionStatement":{const e=[],t=kc(i.yes,s("yes"),!1),n=Dc(["if (",Dc([Sc([yc,s("condition")]),yc]),")",t]);if(e.push(n),i.no){const t=i.yes.comments?.some(e=>e.trailing&&e.tokenType===pc.LINE_COMMENT)||i.yes.comments?.findLast(e=>!e.leading&&!e.trailing)?.tokenType===pc.LINE_COMMENT,n="compoundStatement"===i.yes.kind&&!t;e.push(n?" ":bc),e.push("else",Dc(kc(i.no,s("no"),"selectionStatement"===i.no.kind)))}return e}case"forStatement":{const e=kc(i.statement,s("statement"),!1),t=!1,n=t?[t,yc]:"";return"expressionStatement"!==i.initExpression.kind||i.initExpression.expression||i.conditionExpression||i.loopExpression?[n,Dc(["for (",Dc([Sc([yc,s("initExpression"),_c,s("conditionExpression"),";",_c,s("loopExpression")]),yc]),")",e])]:[n,Dc(["for (;;)",e])]}case"whileStatement":{const e=kc(i.statement,s("statement"),!1);return["while (",Dc(s("conditionExpression")),")",e]}case"doWhileStatement":return["do ",s("statement")," while (",Dc(s("conditionExpression")),");"];case"functionCall":return function(t){const r=e.map(n,"args");let i,o;if(void 0===t.callee.arraySpecifier&&cc(t.callee.typeSpecifierNonArray)&&void 0!==(i=function(e){switch(e){case pc.MAT2X2:return[2,2];case pc.MAT2X3:return[2,3];case pc.MAT2X4:return[2,4];case pc.MAT3X2:return[3,2];case pc.MAT3X3:return[3,3];case pc.MAT3X4:return[3,4];case pc.MAT4X2:return[4,2];case pc.MAT4X3:return[4,3];case pc.MAT4X4:return[4,4];default:return}}(t.callee.typeSpecifierNonArray.tokenType))&&i[0]*i[1]===t.args.length){const e=t.args.every(e=>"constantExpression"===e.kind&&(e.const_.tokenType===pc.FLOATCONSTANT||e.const_.tokenType===pc.INTCONSTANT)||"unaryExpression"===e.kind&&(e.op.tokenType===pc.PLUS||e.op.tokenType===pc.DASH)&&"constantExpression"===e.on.kind&&(e.on.const_.tokenType===pc.FLOATCONSTANT||e.on.const_.tokenType===pc.INTCONSTANT));if(e){const e=[],n=[];let s=0,a=0;for(let i=0;i2),".",s("functionCall")];case"postfixExpression":return[Oc(s("on"),Lc(i.on,r)>2),s("op")];case"unaryExpression":return[s("op"),Oc(s("on"),Lc(i.on,r)>3)];case"assignmentExpression":{const n=s("lhs");return Uc(e,t,n," "+i.op.image,s("rhs"),i.rhs)}case"conditionalExpression":return[Oc(s("condition"),Lc(i.condition,r)>=15),Sc([_c,"? ",s("yes"),_c,": ",s("no")])];case"commaExpression":case"binaryExpression":{const t=Ic(e,n,i,r),s=e.getParentNode();if("selectionStatement"===s.kind||"whileStatement"===s.kind||"switchStatement"===s.kind||"doWhileStatement"===s.kind)return t;const o=()=>{const t=e.getParentNode();return!!t&&("functionCall"===t.kind&&"commaExpression"===i.kind||"binaryExpression"===t.kind&&((n=t.op.tokenType)===pc.CARET||n===pc.VERTICAL_BAR||n===pc.AMPERSAND));var n},a=e.getParentNode(1);if("returnStatement"===s.kind||"forStatement"===s.kind||"conditionalExpression"===s.kind&&"returnStatement"!==a.kind&&"functionCall"!==a.kind||"assignmentExpression"===s.kind||"declarator"===s.kind)return Dc(t);{const e=t.slice(0,1),n=t.slice(e.length);return Dc(Oc([...e,Sc(n)],o()))}}case"expressionStatement":return[s("expression"),";"];case"fieldAccess":return[Oc(s("on"),Lc(i.on,r)>2),".",s("field")];case"constantExpression":{const e=i.const_;return e.tokenType===pc.FLOATCONSTANT?function(e){const t=e.indexOf(".");return 0===t&&(e="0"+e),e=e.replace("E","e"),-1!==t&&(e=(e=(e=(e=e.replace(".e","e")).replace(/(?=4):Tc(Ac(_c,e.map(n,"tokens")))])]);return t.inMacro=void 0,Mc(r,t)}case"ppDir":return Mc(Dc(["#",i.dir.image," ",Sc(i.node?s("node"):Tc(Ac(_c,e.map(n,"tokens"))))]),t);case"ppPragma":return i.dir.image.replace(/^#\s+/,"#").replace(/^#pragma\s{2,}/,"#pragma ");case"ppCall":return Dc([i.callee.image,"(",Ac([",",_c],e.map((e,t,n)=>n[t].tokens.map(e=>e.image),"args")),")"]);case"ppInclude":return["#include ",i.what];case"ppExtension":return["#extension ",i.extension.image," : ",i.behavior.image];case"switchStatement":return["switch (",Dc([Sc([yc,s("initExpression")]),yc]),") {",i.cases.length?Sc([bc,Ac(bc,e.map(n,"cases"))]):"",bc,"}"];case"caseBlock":{const r=s("caseLabel"),i=[];return e.each((e,r)=>{const s=e.getValue();i.push(bc),i.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&i.push(bc)},"statements"),[r,Sc(i)]}case"caseLabel":return void 0===i.case_?"default:":["case ",s("case_"),":"];case"layoutQualifier":return["layout(",Ac(", ",i.layoutQualifierIds.map(e=>void 0===e.init?e.IDENTIFIER.image:[e.IDENTIFIER.image," = ",e.init.image])),")"];case"uniformBlock":return[s("typeQualifier")," ",i.blockName.image," {",Sc([bc,Ac(bc,e.map(n,"declarations"))]),bc,"};"];case"typeQualifierDeclaration":return[s("typeQualifier"),";"];default:throw new Error("unexpected n type "+i.kind+"\n"+JSON.stringify(i).substring(0,100))}}catch(e){throw console.error("error printing "+JSON.stringify(i).substring(0,100)+"\n"),e}},embed(e,t){const n=e.getValue();return!cc(n)||n.tokenType!==pc.LINE_COMMENT&&n.tokenType!==pc.MULTILINE_COMMENT?null:(e,t,n,r)=>{}},getVisitorKeys:(e,t)=>cc(e)?[]:Object.keys(e).filter(e=>!t.has(e)),getCommentChildNodes:e=>cc(e)?[]:xc.visit(e),canAttachComment:e=>!0,printComment:function(e,t){const n=e.getValue();return n.tokenType===pc.MULTILINE_COMMENT&&"*"===n.image[2]?"/**\n"+n.image.substring(3,n.image.length-2).split("\n").map(e=>" *"===e?"":e.startsWith(" * ")?e.substring(3):e).join("\n").trim().split("\n").map(e=>""===e?" *":" * "+e).join("\n")+"\n */":n.image},hasPrettierIgnore(e){const t=e.getValue();return(t&&hc(t)&&t.comments?.some(e=>/\/\/\s*prettier-ignore\b.*/.test(e.image)))??!1}}},Gc={parsers:Fc,printers:$c};function Vc(e){return e.replace(/^([^\n]*;)\n(?=(?:[A-Za-z_]\w*\s+)+[A-Za-z_]\w*\s*\()/gm,"$1\n\n").replace(/^}\n(?=\S)/gm,"}\n\n")}var Wc,Hc,jc=(Wc={program:function(e){return jc(e.program)+jc(e.wsEnd)},segment:function(e){return jc(e.blocks)},text:function(e){return jc(e.text)},literal:function(e){return jc(e.wsStart)+jc(e.literal)+jc(e.wsEnd)},identifier:function(e){return jc(e.identifier)+jc(e.wsEnd)},binary:function(e){return jc(e.left)+jc(e.operator)+jc(e.right)},group:function(e){return jc(e.lp)+jc(e.expression)+jc(e.rp)},unary:function(e){return jc(e.operator)+jc(e.expression)},unary_defined:function(e){return jc(e.operator)+jc(e.lp)+jc(e.identifier)+jc(e.rp)},int_constant:function(e){return jc(e.token)+jc(e.wsEnd)},elseif:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},if:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},ifdef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},ifndef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},else:function(e){return jc(e.token)+jc(e.wsEnd)+jc(e.body)},error:function(e){return jc(e.error)+jc(e.message)+jc(e.wsEnd)},undef:function(e){return jc(e.undef)+jc(e.identifier)+jc(e.wsEnd)},define:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.body)+jc(e.wsEnd)},define_arguments:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.lp)+jc(e.args)+jc(e.rp)+jc(e.body)+jc(e.wsEnd)},conditional:function(e){return jc(e.wsStart)+jc(e.ifPart)+jc(e.elseIfParts)+jc(e.elsePart)+jc(e.endif)+jc(e.wsEnd)},version:function(e){return jc(e.version)+jc(e.value)+jc(e.profile)+jc(e.wsEnd)},pragma:function(e){return jc(e.pragma)+jc(e.body)+jc(e.wsEnd)},line:function(e){return jc(e.line)+jc(e.value)+jc(e.wsEnd)},extension:function(e){return jc(e.extension)+jc(e.name)+jc(e.colon)+jc(e.behavior)+jc(e.wsEnd)}},Hc=function(e){return"string"==typeof e?e:null==e?"":Array.isArray(e)?e.map(Hc).join(""):e.type in Wc?Wc[e.type](e):"NO GENERATOR FOR ".concat(e.type)+e});const zc=jc;function Xc(e,t,n,r){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Xc.prototype),i.expected=t,i.found=n,i.location=r,i.name="SyntaxError",i}function Kc(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}function Yc(e,t){var n,r={},i=(t=void 0!==t?t:{}).grammarSource,s={program:An,constant_expression:hr},o=An,a="<<",l=">>",u="<=",c=">=",h="==",d="!=",f="&&",p="||",m="(",g=")",E=",",v="!",C="-",D="~",S="+",A="*",_="/",y="%",b="<",T=">",R="|",x="^",w="&",F=":",N="#",L="define",O="line",I="undef",k="error",M="pragma",P="defined",B="if",U="ifdef",$="ifndef",G="elif",V="else",W="endif",H="version",j="extension",z="0",X="//",K="/*",Y="*/",q=/^[A-Za-z_]/,Q=/^[A-Za-z_0-9]/,Z=/^[uU]/,J=/^[1-9]/,ee=/^[0-7]/,te=/^[xX]/,ne=/^[0-9a-fA-F]/,re=/^[0-9]/,ie=/^[\n\r]/,se=/^[^\n\r]/,oe=/^[ \t]/,ae=gn("<<",!1),le=gn(">>",!1),ue=gn("<=",!1),ce=gn(">=",!1),he=gn("==",!1),de=gn("!=",!1),fe=gn("&&",!1),pe=gn("||",!1),me=gn("(",!1),ge=gn(")",!1),Ee=gn(",",!1),ve=gn("!",!1),Ce=gn("-",!1),De=gn("~",!1),Se=gn("+",!1),Ae=gn("*",!1),_e=gn("/",!1),ye=gn("%",!1),be=gn("<",!1),Te=gn(">",!1),Re=gn("|",!1),xe=gn("^",!1),we=gn("&",!1),Fe=gn(":",!1),Ne=gn("#",!1),Le=gn("define",!1),Oe=(gn("include",!1),gn("line",!1)),Ie=gn("undef",!1),ke=gn("error",!1),Me=gn("pragma",!1),Pe=gn("defined",!1),Be=gn("if",!1),Ue=gn("ifdef",!1),$e=gn("ifndef",!1),Ge=gn("elif",!1),Ve=gn("else",!1),We=gn("endif",!1),He=gn("version",!1),je=gn("extension",!1),ze=En([["A","Z"],["a","z"],"_"],!1,!1),Xe=En([["A","Z"],["a","z"],"_",["0","9"]],!1,!1),Ke=vn("number"),Ye=En(["u","U"],!1,!1),qe=En([["1","9"]],!1,!1),Qe=gn("0",!1),Ze=En([["0","7"]],!1,!1),Je=En(["x","X"],!1,!1),et=En([["0","9"],["a","f"],["A","F"]],!1,!1),tt=En([["0","9"]],!1,!1),nt=vn("control line"),rt=En(["\n","\r"],!1,!1),it=vn("token string"),st=En(["\n","\r"],!0,!1),ot=vn("text"),at=vn("if"),lt=vn("primary expression"),ut=vn("unary expression"),ct=vn("multiplicative expression"),ht=vn("additive expression"),dt=vn("shift expression"),ft=vn("relational expression"),pt=vn("equality expression"),mt=vn("and expression"),gt=vn("exclusive or expression"),Et=vn("inclusive or expression"),vt=vn("logical and expression"),Ct=vn("logical or expression"),Dt=vn("constant expression"),St=vn("whitespace or comment"),At=gn("//",!1),_t=gn("/*",!1),yt=gn("*/",!1),bt={type:"any"},Tt=vn("whitespace"),Rt=En([" ","\t"],!1,!1),xt=function(e,t){return gr("program",{program:e.blocks,wsEnd:t})},wt=function(e,t){return gr("int_constant",{token:e,wsEnd:t})},Ft=function(e,t){return gr("literal",{literal:e,wsEnd:t})},Nt=function(e){return"#"},Lt=function(e,t,n){return gr("literal",{literal:t,wsStart:e,wsEnd:n})},Ot=function(e,t){return gr("identifier",{identifier:e,wsEnd:t})},It=function(e){return gr("identifier",{identifier:e})},kt=function(e){return gr("text",{text:e.join("")})},Mt=function(e){return gr("segment",{blocks:e})},Pt=function(e,t,n,r,i){return[r,...i.flat()]},Bt=function(e,t,n,r,i,s){return gr("define_arguments",{define:e,identifier:t,lp:n,args:r||[],rp:i,body:s})},Ut=function(e,t,n){return gr("define",{define:e,identifier:t,body:n})},$t=function(e,t){return gr("line",{line:e,value:t})},Gt=function(e,t){return gr("undef",{undef:e,identifier:t})},Vt=function(e,t){return gr("error",{error:e,message:t})},Wt=function(e,t){return gr("pragma",{pragma:e,body:t})},Ht=function(e,t,n){return gr("version",{version:e,value:t,profile:n})},jt=function(e,t,n,r){return gr("extension",{extension:e,name:t,colon:n,behavior:r})},zt=function(e,t){return{...e,wsEnd:t}},Xt=function(e,t,n){return{...e,body:n,wsEnd:t}},Kt=function(e,t,n,r,i){return gr("elseif",{token:t,expression:n,wsEnd:r,body:i})},Yt=function(e,t,n,r,i){return gr("else",{token:n,wsEnd:r,body:i})},qt=function(e,t,n,r,i){return gr("conditional",{ifPart:e,elseIfParts:t,elsePart:n,endif:r,wsEnd:i})},Qt=function(e,t){return gr("ifdef",{token:e,identifier:t})},Zt=function(e,t){return gr("ifndef",{token:e,identifier:t})},Jt=function(e,t){return gr("if",{token:e,expression:t})},en=function(e,t,n){return gr("group",{lp:e,expression:t,rp:n})},tn=function(e,t,n,r){return gr("unary_defined",{operator:e,lp:t,identifier:n,rp:r})},nn=function(e,t){return gr("unary",{operator:e,expression:t})},rn=function(e,t){return Cr(e,t)},sn=function(e,t){return vr(e,t)},on=function(e,t,n){return Er(t,n)},an=function(e,t){return Er(e,t.flat())},ln=function(e){return e},un=function(e){return e},cn=0,hn=[{line:1,column:1}],dn=0,fn=[],pn=0,mn={};if("startRule"in t){if(!(t.startRule in s))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=s[t.startRule]}function gn(e,t){return{type:"literal",text:e,ignoreCase:t}}function En(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function vn(e){return{type:"other",description:e}}function Cn(t){var n,r=hn[t];if(r)return r;for(n=t-1;!hn[n];)n--;for(r={line:(r=hn[n]).line,column:r.column};ndn&&(dn=cn,fn=[]),fn.push(e))}function An(){var e,t,n,i=75*cn+0,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Qn())!==r?(n=dr(),e=xt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}function _n(){var t,n,i,s=75*cn+2,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===a?(n=a,cn+=2):(n=r,0===pn&&Sn(ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function yn(){var t,n,i,s=75*cn+3,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===l?(n=l,cn+=2):(n=r,0===pn&&Sn(le)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function bn(){var t,n,i,s=75*cn+4,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===u?(n=u,cn+=2):(n=r,0===pn&&Sn(ue)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Tn(){var t,n,i,s=75*cn+5,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===c?(n=c,cn+=2):(n=r,0===pn&&Sn(ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Rn(){var t,n,i,s=75*cn+6,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===h?(n=h,cn+=2):(n=r,0===pn&&Sn(he)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function xn(){var t,n,i,s=75*cn+7,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===d?(n=d,cn+=2):(n=r,0===pn&&Sn(de)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function wn(){var t,n,i,s=75*cn+8,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===f?(n=f,cn+=2):(n=r,0===pn&&Sn(fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Fn(){var t,n,i,s=75*cn+9,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===p?(n=p,cn+=2):(n=r,0===pn&&Sn(pe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Nn(){var t,n,i,s=75*cn+10,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,40===e.charCodeAt(cn)?(n=m,cn++):(n=r,0===pn&&Sn(me)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Ln(){var t,n,i,s=75*cn+11,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,41===e.charCodeAt(cn)?(n=g,cn++):(n=r,0===pn&&Sn(ge)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function On(){var t,n,i,s=75*cn+12,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,44===e.charCodeAt(cn)?(n=E,cn++):(n=r,0===pn&&Sn(Ee)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function In(){var t,n,i,s=75*cn+14,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,45===e.charCodeAt(cn)?(n=C,cn++):(n=r,0===pn&&Sn(Ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function kn(){var t,n,i,s=75*cn+16,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,43===e.charCodeAt(cn)?(n=S,cn++):(n=r,0===pn&&Sn(Se)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Mn(){var t,n,i,s=75*cn+17,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,42===e.charCodeAt(cn)?(n=A,cn++):(n=r,0===pn&&Sn(Ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Pn(){var t,n,i,s=75*cn+18,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,47===e.charCodeAt(cn)?(n=_,cn++):(n=r,0===pn&&Sn(_e)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Bn(){var t,n,i,s=75*cn+19,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,37===e.charCodeAt(cn)?(n=y,cn++):(n=r,0===pn&&Sn(ye)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Un(){var t,n,i,s=75*cn+20,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,60===e.charCodeAt(cn)?(n=b,cn++):(n=r,0===pn&&Sn(be)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function $n(){var t,n,i,s=75*cn+21,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,62===e.charCodeAt(cn)?(n=T,cn++):(n=r,0===pn&&Sn(Te)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Gn(){var t,n,i,s=75*cn+22,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,124===e.charCodeAt(cn)?(n=R,cn++):(n=r,0===pn&&Sn(Re)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Vn(){var t,n,i,s=75*cn+23,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,94===e.charCodeAt(cn)?(n=x,cn++):(n=r,0===pn&&Sn(xe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Wn(){var t,n,i,s=75*cn+24,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,38===e.charCodeAt(cn)?(n=w,cn++):(n=r,0===pn&&Sn(we)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Hn(){var t,n,i,s=75*cn+26,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,35===e.charCodeAt(cn)?(i=N,cn++):(i=r,0===pn&&Sn(Ne)),(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Nt(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function jn(){var t,n,i,s,o,a,l=75*cn+27,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===L?(a=L,cn+=6):(a=r,0===pn&&Sn(Le)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function zn(){var t,n,i,s,o,a,l=75*cn+37,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===G?(a=G,cn+=4):(a=r,0===pn&&Sn(Ge)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function Xn(){var t,n,i,s,o,a,l=75*cn+42,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Ot(n,i)):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t}function Kn(){var t,n,i,s,o=75*cn+44,a=mn[o];return a?(cn=a.nextPos,a.result):(pn++,t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+46,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,J.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(qe)),i!==r){for(s=[],o=qn();o!==r;)s.push(o),o=qn();n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o=75*cn+47,a=mn[o];if(a)return cn=a.nextPos,a.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r){for(i=[],ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));s!==r;)i.push(s),ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));t=n=[n,i]}else cn=t,t=r;return mn[o]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+48,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r)if(te.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Je)),i!==r){for(s=[],ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));o!==r;)s.push(o),ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));t=n=[n,i,s]}else cn=t,t=r;else cn=t,t=r;return mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),t=n!==r?e.substring(t,cn):n)),pn--,t===r&&(n=r,0===pn&&Sn(Ke)),mn[o]={nextPos:cn,result:t},t)}function Yn(){var t,n=75*cn+45,i=mn[n];return i?(cn=i.nextPos,i.result):(Z.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(Ye)),mn[n]={nextPos:cn,result:t},t)}function qn(){var t,n=75*cn+49,i=mn[n];return i?(cn=i.nextPos,i.result):(re.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(tt)),mn[n]={nextPos:cn,result:t},t)}function Qn(){var e,t,n,i,s,o=75*cn+50,a=mn[o];if(a)return cn=a.nextPos,a.result;if(cn,t=[],(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}if(n!==r){for(;n!==r;)if(t.push(n),(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}}else t=r;return t!==r&&(t=Mt(t)),e=t,mn[o]={nextPos:cn,result:e},e}function Zn(){var t,n,i,s,o,a,l,u,c,h,d,f=75*cn+51,p=mn[f];if(p)return cn=p.nextPos,p.result;if(pn++,t=function(){var t,n,i,s,o,a,l,u,c=75*cn+54,h=mn[c];if(h)return cn=h.nextPos,h.result;if(t=cn,n=cn,i=function(){var t,n,i,s=75*cn+55,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+35,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===U?(a=U,cn+=5):(a=r,0===pn&&Sn(Ue)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Qt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+36,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===$?(a=$,cn+=6):(a=r,0===pn&&Sn($e)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Zt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+34,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,2)===B?(a=B,cn+=2):(a=r,0===pn&&Sn(Be)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r?((i=Jn())===r&&(i=null),t=Jt(n,i)):(cn=t,t=r))),pn--,t===r&&(n=r,0===pn&&Sn(at)),mn[s]={nextPos:cn,result:t},t)}(),i!==r?(ie.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(rt)),s!==r?((o=Qn())===r&&(o=null),n=Xt(i,s,o)):(cn=n,n=r)):(cn=n,n=r),n!==r){for(i=[],s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s=cn,o=function(){var t,n,i,s,o,a,l=75*cn+38,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===V?(a=V,cn+=4):(a=r,0===pn&&Sn(Ve)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a!==r?((l=Qn())===r&&(l=null),s=Yt(n,i,o,a,l)):(cn=s,s=r)):(cn=s,s=r),s===r&&(s=null),o=function(){var t,n,i,s,o,a,l=75*cn+39,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===W?(a=W,cn+=5):(a=r,0===pn&&Sn(We)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a===r&&(a=null),t=qt(n,i,s,o,a)):(cn=t,t=r)}else cn=t,t=r;return mn[c]={nextPos:cn,result:t},t}(),t===r){if(t=cn,n=cn,(i=jn())!==r)if(s=function(){var t,n,i,s,o,a,l=75*cn+43,u=mn[l];if(u)return cn=u.nextPos,u.result;if(cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r&&(n=It(n)),t=n,mn[l]={nextPos:cn,result:t},t}(),s!==r)if((o=Nn())!==r){if(a=cn,(l=Xn())!==r){for(u=[],c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);c!==r;)u.push(c),c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);a=Pt(i,s,o,l,u)}else cn=a,a=r;a===r&&(a=null),(l=Ln())!==r?((u=Jn())===r&&(u=null),n=Bt(i,s,o,a,l,u)):(cn=n,n=r)}else cn=n,n=r;else cn=n,n=r;else cn=n,n=r;if(n===r&&(n=cn,(i=jn())!==r&&(s=Xn())!==r?((o=Jn())===r&&(o=null),n=Ut(i,s,o)):(cn=n,n=r),n===r)){if(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+29,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===O?(a=O,cn+=4):(a=r,0===pn&&Sn(Oe)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r){if(s=cn,o=[],(a=qn())!==r)for(;a!==r;)o.push(a),a=qn();else o=r;(s=o!==r?e.substring(s,cn):o)!==r?n=$t(i,s):(cn=n,n=r)}else cn=n,n=r;n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+30,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===I?(a=I,cn+=5):(a=r,0===pn&&Sn(Ie)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?n=Gt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+31,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===k?(a=k,cn+=5):(a=r,0===pn&&Sn(ke)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Vt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+32,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===M?(a=M,cn+=6):(a=r,0===pn&&Sn(Me)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Wt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+40,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,7)===H?(a=H,cn+=7):(a=r,0===pn&&Sn(He)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Kn())!==r?((o=Jn())===r&&(o=null),n=Ht(i,s,o)):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+41,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,9)===j?(a=j,cn+=9):(a=r,0===pn&&Sn(je)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?(o=function(){var t,n,i,s=75*cn+25,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,58===e.charCodeAt(cn)?(n=F,cn++):(n=r,0===pn&&Sn(Fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),o!==r&&(a=Jn())!==r?n=jt(i,s,o,a):(cn=n,n=r)):(cn=n,n=r))))))}n!==r?(ie.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(rt)),i===r&&(i=null),t=zt(n,i)):(cn=t,t=r)}return pn--,t===r&&(n=r,0===pn&&Sn(nt)),mn[f]={nextPos:cn,result:t},t}function Jn(){var t,n,i,s=75*cn+52,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st)),i!==r)for(;i!==r;)n.push(i),se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(it)),mn[s]={nextPos:cn,result:t},t}function er(){var t,n,i,s,o,a,l=75*cn+53,u=mn[l];if(u)return cn=u.nextPos,u.result;if(pn++,t=cn,n=cn,i=cn,pn++,s=cn,(o=pr())===r&&(o=null),35===e.charCodeAt(cn)?(a=N,cn++):(a=r,0===pn&&Sn(Ne)),a!==r?s=o=[o,a]:(cn=s,s=r),pn--,s===r?i=void 0:(cn=i,i=r),i!==r){if(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st)),o!==r)for(;o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));else s=r;s!==r?(ie.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(rt)),o===r&&(o=null),n=i=[i,s,o]):(cn=n,n=r)}else cn=n,n=r;return n===r&&(ie.test(e.charAt(cn))?(n=e.charAt(cn),cn++):(n=r,0===pn&&Sn(rt))),t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(ot)),mn[l]={nextPos:cn,result:t},t}function tr(){var t,n,i,s,o,a=75*cn+57,l=mn[a];return l?(cn=l.nextPos,l.result):(pn++,t=cn,n=function(){var t,n,i,s,o=75*cn+33,a=mn[o];return a?(cn=a.nextPos,a.result):(t=cn,n=dr(),e.substr(cn,7)===P?(i=P,cn+=7):(i=r,0===pn&&Sn(Pe)),i!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[o]={nextPos:cn,result:t},t)}(),n!==r?((i=Nn())===r&&(i=null),(s=Xn())!==r?((o=Ln())===r&&(o=null),t=tn(n,i,s,o)):(cn=t,t=r)):(cn=t,t=r),t===r&&(t=cn,(n=kn())===r&&(n=In())===r&&(n=function(){var t,n,i,s=75*cn+13,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,33===e.charCodeAt(cn)?(n=v,cn++):(n=r,0===pn&&Sn(ve)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),n===r&&(n=function(){var t,n,i,s=75*cn+15,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,126===e.charCodeAt(cn)?(n=D,cn++):(n=r,0===pn&&Sn(De)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}())),n!==r&&(i=tr())!==r?t=nn(n,i):(cn=t,t=r),t===r&&(t=function(){var e,t,n,i,s=75*cn+56,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,e=function(){var e,t,n,i=75*cn+1,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Kn())!==r?(n=dr(),e=wt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}(),e===r&&(e=cn,(t=Nn())!==r&&(n=hr())!==r&&(i=Ln())!==r?e=en(t,n,i):(cn=e,e=r),e===r&&(e=Xn())),pn--,e===r&&(t=r,0===pn&&Sn(lt)),mn[s]={nextPos:cn,result:e},e)}())),pn--,t===r&&(n=r,0===pn&&Sn(ut)),mn[a]={nextPos:cn,result:t},t)}function nr(){var e,t,n,i,s,o,a=75*cn+58,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=tr())!==r){for(n=[],i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ct)),mn[a]={nextPos:cn,result:e},e}function rr(){var e,t,n,i,s,o,a=75*cn+59,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=nr())!==r){for(n=[],i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ht)),mn[a]={nextPos:cn,result:e},e}function ir(){var e,t,n,i,s,o,a=75*cn+60,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=rr())!==r){for(n=[],i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(dt)),mn[a]={nextPos:cn,result:e},e}function sr(){var e,t,n,i,s,o,a=75*cn+61,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ir())!==r){for(n=[],i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ft)),mn[a]={nextPos:cn,result:e},e}function or(){var e,t,n,i,s,o,a=75*cn+62,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=sr())!==r){for(n=[],i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(pt)),mn[a]={nextPos:cn,result:e},e}function ar(){var e,t,n,i,s,o,a=75*cn+63,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=or())!==r){for(n=[],i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(mt)),mn[a]={nextPos:cn,result:e},e}function lr(){var e,t,n,i,s,o,a=75*cn+64,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ar())!==r){for(n=[],i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(gt)),mn[a]={nextPos:cn,result:e},e}function ur(){var e,t,n,i,s,o,a=75*cn+65,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=lr())!==r){for(n=[],i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Et)),mn[a]={nextPos:cn,result:e},e}function cr(){var e,t,n,i,s,o,a=75*cn+66,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ur())!==r){for(n=[],i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(vt)),mn[a]={nextPos:cn,result:e},e}function hr(){var e,t=75*cn+68,n=mn[t];return n?(cn=n.nextPos,n.result):(pn++,e=function(){var e,t,n,i,s,o,a=75*cn+67,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=cr())!==r){for(n=[],i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Ct)),mn[a]={nextPos:cn,result:e},e}(),pn--,e===r&&0===pn&&Sn(Dt),mn[t]={nextPos:cn,result:e},e)}function dr(){var e,t,n,i,s,o,a=75*cn+69,l=mn[a];if(l)return cn=l.nextPos,l.result;for(pn++,cn,(t=pr())===r&&(t=null),n=[],i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);return e=sn(t,n),pn--,t=r,0===pn&&Sn(St),mn[a]={nextPos:cn,result:e},e}function fr(){var t,n,i,s,o,a,l=75*cn+70,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=function(){var t,n,i,s,o,a=75*cn+71,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,e.substr(cn,2)===X?(i=X,cn+=2):(i=r,0===pn&&Sn(At)),i!==r){for(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),t===r)if(t=cn,n=function(){var t,n,i,s,o,a,l,u=75*cn+72,c=mn[u];if(c)return cn=c.nextPos,c.result;if(t=cn,n=cn,e.substr(cn,2)===K?(i=K,cn+=2):(i=r,0===pn&&Sn(_t)),i!==r){for(s=[],o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);o!==r;)s.push(o),o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);e.substr(cn,2)===Y?(o=Y,cn+=2):(o=r,0===pn&&Sn(yt)),o!==r?n=i=[i,s,o]:(cn=n,n=r)}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[u]={nextPos:cn,result:t},t}(),n!==r){for(i=[],s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);t=an(n,i)}else cn=t,t=r;return mn[l]={nextPos:cn,result:t},t}function pr(){var t,n,i,s=75*cn+73,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt)),i!==r)for(;i!==r;)n.push(i),oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(Tt)),mn[s]={nextPos:cn,result:t},t}function mr(){var t,n,i,s=75*cn+74,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,pn++,Q.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Xe)),pn--,i===r?n=void 0:(cn=n,n=r),n!==r?(i=dr(),t=un(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}e=lh(e);const gr=(e,t)=>({type:e,...t}),Er=(...e)=>e.flat().filter(e=>null!=e&&""!==e&&0!==e.length),vr=(...e)=>{return(t=Er(e.flat())).length>1?t:t[0];var t},Cr=(...e)=>e.flat().reduce((e,[t,n])=>({type:"binary",operator:t,left:e,right:n}));if((n=o())!==r&&cn===e.length)return n;throw n!==r&&cn0){for(t=1,n=1;ts.length)throw new Error("'".concat(t,"': Too many arguments for macro"));if(u.length>":return t(n)>>t(r);case"<":return t(n)":return t(n)>t(r);case"<=":return t(n)<=t(r);case">=":return t(n)>=t(r);case"==":return t(n)==t(r);case"!=":return t(n)!=t(r);case"&":return t(n)&t(r);case"^":return t(n)^t(r);case"|":return t(n)|t(r);case"&&":return t(n)&&t(r);case"||":return t(n)||t(r);default:throw new Error("Preprocessing error: Unknown binary operator ".concat(i))}},unary:function(e,t){switch(e.operator.literal){case"+":return t(e.expression);case"-":return-1*t(e.expression);case"!":return!t(e.expression);case"~":return~t(e.expression);default:throw new Error("Preprocessing error: Unknown unary operator ".concat(e.operator.literal))}}},(r=function(e){var t=n[e.type];if(!t)throw new Error("No evaluate() evaluator for ".concat(e.type));return t(e,r)})(e);var n,r}((n=sh(r,t).trim(),eh(s)(n,{grammarSource:"expression",startRule:"constant_expression"})),t)},lh=function(e,t){return void 0===t&&(t={}),e.replace(/\\[\n\r]/g,"")},uh=function(e,t){void 0===t&&(t={});var n,r,i,s,o=Object.entries(t.defines||{}).reduce(function(e,t){var n,r=t[0],i=t[1];return th(th({},e),((n={})[r]={body:i},n))},{}),a=(void 0===(n=t.preserve)&&(n={}),function(e){var t=null==n?void 0:n[e.node.type];return"function"==typeof t?t(e):t});return r={conditional:{enter:function(e){var t=e,n=t.node;a(t)||(function(e,t){return"if"===t.type?!!t.expression&&oh(ah(t.expression,e)):"ifdef"===t.type?t.identifier.identifier in e:"ifndef"===t.type?!(t.identifier.identifier in e):void 0}(o,n.ifPart)?t.replaceWith(n.ifPart.body):n.elseIfParts.reduce(function(e,n){return e||oh(ah(n.expression,o))&&(t.replaceWith(n.body),!0)},!1)||(n.elsePart?t.replaceWith(n.elsePart.body):t.remove()))}},text:{enter:function(e){var t=e;t.node.text=sh(t.node.text,o)}},define_arguments:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body,s=n.args;o[r]={args:s,body:i},!a(t)&&t.remove()}},define:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body;o[r]={body:i},!a(t)&&t.remove()}},undef:{enter:function(e){var t=e;delete o[t.node.identifier.identifier],!a(t)&&t.remove()}},error:{enter:function(e){var n=e;if(t.stopOnError)throw new Error(n.node.message);!a(n)&&n.remove()}},pragma:{enter:function(e){var t=e;!a(t)&&t.remove()}},version:{enter:function(e){var t=e;!a(t)&&t.remove()}},extension:{enter:function(e){var t=e;!a(t)&&t.remove()}},line:{enter:function(e){var t=e;!a(t)&&t.remove()}}},i=!1,(s=function(e,t,n,o,a){var l;if(!i){var u=r[e.type],c=function(e,t,n,r,i){return{node:e,parent:t,parentPath:n,key:r,index:i,stop:function(){this.stopped=!0},skip:function(){this.skipped=!0},remove:function(){this.removed=!0},replaceWith:function(e){this.replaced=e},findParent:function(e){return n?e(n)?n:n.findParent(e):n}}}(e,t,n,o,a),h=t;if(null==u?void 0:u.enter){if(u.enter(c),c.removed){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));return"number"==typeof a?h[o].splice(a,1):h[o]=null,c}if(c.replaced){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));"number"==typeof a?h[o].splice(a,1,c.replaced):h[o]=c.replaced}if(c.skipped)return c}if(c.stopped)i=!0;else if(c.replaced){var d=c.replaced;s(d,t,n,o,a)}else Object.entries(e).filter(function(e){return e[0],function(e){return function(e){return!!(null==e?void 0:e.type)}(e)||Array.isArray(e)}(e[1])}).forEach(function(t){var n=t[0],r=t[1];if(Array.isArray(r))for(var o=0,a=0;o-a{let e=!0;return n?(i({source:o,formatted:null,error:""}),function(e){return Gs(e,{parser:"glsl-parser",plugins:[Gc],printWidth:80,tabWidth:4,useTabs:!1}).then(Vc)}(o).then(t=>{e&&i({source:o,formatted:t,error:""})}).catch(t=>{if(!e)return;const n=dh(t);a.error("shader formatting failed: "+n),i({source:o,formatted:null,error:n})}),()=>{e=!1}):(i({source:o,formatted:null,error:""}),()=>{e=!1})},[n,o]);const c=n&&r.source===o?r.formatted:null;return{source:c||o,formatted:!!c,preprocessed:u,error:(r.source===o?r.error:"")||l}}(C.source,C.preprocessed,e.beautify),S=D.source,A=C.edited,_=[e.fragment?e.sourceFragmentLog:e.sourceVertexLog,e.programLog].filter(e=>!!e).join("\n"),y=!e.translated&&!D.preprocessed&&!D.formatted,b=function(e,t,n,r){return!(e||t||!n||r)}(t,A,_,y);(0,dt.useLayoutEffect)(()=>{g.current={programId:e.programId,sourceVertex:e.sourceVertex,sourceFragment:e.sourceFragment}},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!d.current)return;if(!f.current){const e=ace.edit(d.current);e.setTheme("ace/theme/monokai"),e.getSession().setMode("ace/mode/glsl"),e.setShowPrintMargin(!1),f.current=e}const t=f.current;t.setReadOnly(!e.editable||e.translated),t.getValue()!==S&&t.setValue(S,-1);const n=()=>{const n=t.getValue();e.fragment?m.current.fragment=n:m.current.vertex=n,v(t=>e.fragment?t.fragment?t:Object.assign(Object.assign({},t),{fragment:!0}):t.vertex?t:Object.assign(Object.assign({},t),{vertex:!0})),function(e,t,n,r){e&&n(!1),t&&r(!1)}(e.beautify,e.preprocessed,c,h),-1!==p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{if(p.current=-1,!function(e,t){return e.programId===t.programId&&e.sourceVertex===t.sourceVertex&&e.sourceFragment===t.sourceFragment}(g.current,e))return;const t={sourceVertex:m.current.vertex,sourceFragment:m.current.fragment,translatedSourceVertex:e.translatedSourceVertex,translatedSourceFragment:e.translatedSourceFragment,programId:e.programId};u(t)},1500)},r=e.editable&&!e.translated;return r&&t.getSession().on("change",n),()=>{r&&t.getSession().off("change",n)}},[S,e.editable,e.translated,e.fragment,e.beautify,e.preprocessed,e.sourceVertex,e.sourceFragment,e.translatedSourceVertex,e.translatedSourceFragment,e.programId,c,h,u]),(0,dt.useEffect)(()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),m.current={baseProgramId:e.programId,baseVertex:e.sourceVertex,baseFragment:e.sourceFragment,vertex:e.sourceVertex,fragment:e.sourceFragment},v({vertex:!1,fragment:!1})},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!f.current)return;const e=t||(y&&!A?_:"");f.current.getSession().setAnnotations(function(e){if(!e)return[];const t=[],n=e.split(/\r?\n/);for(const e of n){const n=e.replace(/\0/g,"").trim();if(!n)continue;let r=/^(error|warning|info)\s*:\s*\d+\s*:\s*(\d+)(?:\s*:\s*(\d+))?\s*:\s*(.*)$/i.exec(n);if(r){t.push(Pt(r[1],r[2],r[3],r[4]));continue}if(r=/^\d+\s*\(\s*(\d+)\s*\)\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[2],r[1],"",r[3]));continue}if(r=/^\d+\s*:\s*(\d+)(?:\s*\(\s*(\d+)\s*\))?\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[3],r[1],r[2],r[4]));continue}const i=/\b(error|warning|info)\b/i.exec(n);t.push({row:0,column:0,text:n,type:i?i[1].toLowerCase():"info"})}return t}(e))},[_,y,t,D.formatted,D.preprocessed,A,e.beautify,e.fragment,e.programLog,e.sourceFragmentLog,e.sourceVertexLog,e.translated]),(0,dt.useEffect)(()=>()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),f.current&&(f.current.destroy(),f.current=null)},[]);const T=(0,dt.useCallback)(e=>{e.preventDefault(),n()},[n]),R=(0,dt.useCallback)(e=>{e.preventDefault(),r()},[r]),x=(0,dt.useCallback)(e=>{e.preventDefault(),null==i||i()},[i]),w=(0,dt.useCallback)(e=>{e.preventDefault(),null==o||o()},[o]),F=(0,dt.useCallback)(e=>{e.preventDefault(),l()},[l]),N=!e.singleShader||!e.fragment,L=!e.singleShader||e.fragment,O=D.error;return(0,mt.jsxs)("div",{className:"sourceCodeComponentContainer",children:[(0,mt.jsx)("div",{className:"sourceCodeMenuComponentContainer",children:(0,mt.jsxs)("ul",{className:"sourceCodeMenuComponent",children:[N&&e.translatedSourceVertex&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:!e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedVertexSourceClicked",onClick:x,children:"Translated Vertex"})}),L&&e.translatedSourceFragment&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedFragmentSourceClicked",onClick:w,children:"Translated Fragment"})}),N&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment||e.translated?"":"active",href:"#",role:"button",commandName:"onVertexSourceClicked",onClick:T,children:"Vertex"})}),L&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&!e.translated?"active":"",href:"#",role:"button",commandName:"onFragmentSourceClicked",onClick:R,children:"Fragment"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onSourceCodeCloseClicked",onClick:F,children:"Close"})})]})}),(0,mt.jsx)("div",{className:"sourceCodeComponent",ref:d}),(0,mt.jsx)(hh,{beautify:e.beautify,capturedDiagnosticsHidden:b,fragment:e.fragment,preprocessed:e.preprocessed,processingError:O,onBeautifyChanged:c,onFragmentSourceClicked:r,onPreprocessChanged:h,onVertexSourceClicked:n})]})}function hh({beautify:e,capturedDiagnosticsHidden:t,fragment:n,preprocessed:r,processingError:i,onBeautifyChanged:s,onFragmentSourceClicked:o,onPreprocessChanged:a,onVertexSourceClicked:l}){const u=(0,dt.useCallback)(e=>{s(e.target.checked)},[s]),c=(0,dt.useCallback)(e=>{a(e.target.checked)},[a]),h=(0,dt.useCallback)(e=>{e.preventDefault(),(n?o:l)(),s(!1),a(!1)},[n,s,o,a,l]);return(0,mt.jsx)("div",{className:"sourceCodeMenuComponentFooter",children:(0,mt.jsxs)("p",{children:[(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onBeautifyChanged",checked:e,onChange:u})," Beautify"]}),(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onPreprocessChanged",checked:r,onChange:c})," Preprocess"]}),i&&(0,mt.jsx)("span",{className:"sourceCodeFormatError",role:"alert",title:i,children:"Shader processing failed"}),t&&(0,mt.jsxs)("span",{className:"sourceCodeDiagnosticsNotice",role:"status",children:["Captured diagnostics hidden."," ",(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onShowCapturedDiagnostics",onClick:h,children:"Show original with diagnostics"})]})]})})}function dh(e){return e instanceof Error?e.message:String(e)}function fh({title:e,children:t}){const n=e?e.replace(/([A-Z])/g," $1").trim():"";return(0,mt.jsxs)("div",{className:"jsonGroupComponent",children:[(0,mt.jsx)("div",{className:"jsonGroupComponentTitle",children:n}),(0,mt.jsx)("ul",{children:t})]})}function ph({itemKey:e,value:t}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsx)("span",{className:"jsonItemComponentValue",children:t})]})}function mh({itemKey:e,value:t,pixelated:n,raw:r}){const i=bt();return(0,mt.jsx)("li",{className:"jsonItemImageHolder",children:(0,mt.jsxs)("div",{className:"jsonItemImage jsonItemImageClickable",children:[(0,mt.jsx)("img",{src:t,style:n?{imageRendering:"pixelated"}:void 0,title:"Open in texture viewer",onClick:()=>i.openTextureViewer({src:t,label:e,pixelated:n,raw:r||null})}),(0,mt.jsx)("span",{children:e})]})})}function gh({itemKey:e,value:t,help:n}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("span",{className:"jsonItemComponentValue",children:[t+" (",(0,mt.jsx)("a",{href:n,target:"_blank",className:"jsonSourceItemComponentOpen",children:"Open help page"}),")"]})]})}function Eh({visualState:e}){const t=bt();return(0,mt.jsxs)("div",{className:"jsonVisualStateItemComponent",children:[e.Attachments?e.Attachments.map((n,r)=>n.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{className:"jsonItemImageClickable",src:encodeURI(n.src),title:"Open in texture viewer",onClick:()=>t.openTextureViewer({src:n.src,label:n.attachmentName||"Attachment",pixelated:!1,raw:n.raw||null})}),e.Attachments.length>1&&(0,mt.jsx)("span",{children:n.attachmentName})]},r):null):(0,mt.jsx)("span",{children:e.FrameBufferStatus}),(0,mt.jsx)("span",{children:e.FrameBuffer?e.FrameBuffer.__SPECTOR_Object_TAG.displayText:"Canvas frame buffer"})]})}function vh({itemKey:e,shader:t,programLog:n,onOpen:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),null==r||r(t,n)},[r,n,t]),s=t.source?t.source.length:0,o=`${t.name||"Shader"} (${s} chars)`;return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("a",{href:"#",role:"button",className:"jsonSourceItemComponentOpen",commandName:"onShaderSourceOpen",onClick:i,children:["Open ",o]})]})}function Ch({items:e,onShaderSourceOpen:t}){return e&&0!==e.length?(0,mt.jsx)(mt.Fragment,{children:e.map((e,n)=>{switch(e.type){case"group":return(0,mt.jsx)(fh,{title:e.title,children:(0,mt.jsx)(Ch,{items:e.children,onShaderSourceOpen:t})},n);case"item":return(0,mt.jsx)(ph,{itemKey:e.key,value:e.value},n);case"image":return(0,mt.jsx)(mh,{itemKey:e.key,value:e.value,pixelated:e.pixelated,raw:e.raw},n);case"help":return(0,mt.jsx)(gh,{itemKey:e.key,value:e.value,help:e.help},n);case"shaderSource":return(0,mt.jsx)(vh,{itemKey:e.key,shader:e.shader,programLog:e.programLog,onOpen:t},n);case"visualState":return(0,mt.jsx)(Eh,{visualState:e.visualState},n);default:return null}})}):null}const Dh={added:"+",removed:"-",changed:"~",unchanged:" "};function Sh(e){const t=void 0===e.indexA?"_":String(e.indexA),n=void 0===e.indexB?"_":String(e.indexB);return e.type+"#"+t+"#"+n}function Ah(e){return!(!e.previousImage&&!e.currentImage)}function _h(){const e=bt(),t=pt(e.store),[n,r]=(0,dt.useState)(null);if((0,dt.useEffect)(()=>{r(null)},[t.compareRows]),!t.canCompare)return(0,mt.jsx)("div",{className:"compareViewComponent",children:(0,mt.jsx)("div",{className:"compareViewEmpty",children:"Capture the same page at least twice, then select a capture to compare it against the previous one."})});const{added:i,removed:s,changed:o,unchanged:a}=t.compareSummary,l=t.compareOnlyDifferences?t.compareRows.filter(e=>"unchanged"!==e.type):t.compareRows,u=l.find(e=>Sh(e)===n)||(l.length>0?l[0]:null),c=u?Sh(u):"";return(0,mt.jsxs)("div",{className:"compareViewComponent",children:[(0,mt.jsxs)("div",{className:"compareViewHeader",children:[(0,mt.jsx)("span",{className:"compareViewLabel",children:t.compareLabel}),(0,mt.jsxs)("span",{className:"compareViewSummary",children:[(0,mt.jsxs)("span",{className:"added",children:["+",i]}),(0,mt.jsxs)("span",{className:"removed",children:["-",s]}),(0,mt.jsxs)("span",{className:"changed",children:["~",o]}),(0,mt.jsxs)("span",{className:"unchanged",children:["=",a]})]}),(0,mt.jsxs)("label",{className:"compareViewToggle",children:[(0,mt.jsx)("input",{type:"checkbox",checked:t.compareOnlyDifferences,onChange:t=>e.handleCompareOnlyDifferencesChange(t.target.checked)}),"Differences only"]})]}),(0,mt.jsxs)("div",{className:"compareViewBody",children:[(0,mt.jsx)(yh,{}),(0,mt.jsx)("ul",{className:"compareViewList",children:0===l.length?(0,mt.jsx)("li",{className:"compareViewEmptyRow",children:"No differences between these two captures."}):l.map(e=>{const t=Sh(e);return(0,mt.jsx)(bh,{row:e,selected:t===c,onSelect:()=>r(t)},t)})}),(0,mt.jsx)("div",{className:"compareViewDetail",children:u?(0,mt.jsx)(Th,{row:u,onSelectCommand:e.handleCompareCommandSelected,onOpenTexture:(t,n)=>e.openTextureViewer({src:t,label:n,pixelated:!1,raw:null})}):(0,mt.jsx)("div",{className:"compareDetailEmpty",children:"Select a call to see its details."})})]})]})}function yh(){return(0,mt.jsxs)("div",{className:"compareViewLegend",children:[(0,mt.jsxs)("div",{className:"compareLegendRow added",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Added"]}),(0,mt.jsxs)("div",{className:"compareLegendRow removed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Removed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow changed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Changed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow unchanged",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Unchanged"]})]})}function bh(e){const{row:t,selected:n,onSelect:r}=e,i="removed"===t.type?t.previousText:t.currentText,s=i&&0===i.indexOf(t.name)?i.slice(t.name.length):"",o="compareRow "+t.type+(n?" selected":"");return(0,mt.jsxs)("li",{className:o,onClick:r,title:i,children:[(0,mt.jsx)("span",{className:"compareSign",children:Dh[t.type]}),(0,mt.jsxs)("span",{className:"compareRowText",children:[(0,mt.jsx)("span",{className:"compareCmdName",children:t.name}),s]})]})}function Th(e){const{row:t,onSelectCommand:n,onOpenTexture:r}=e,i=t.fieldDiffs||[],s=i.filter(e=>!Ah(e)),o=i.filter(Ah),a="changed"===t.type&&t.previousText!==t.currentText,l="removed"===t.type?t.previousText:t.currentText;return(0,mt.jsxs)("div",{className:"compareDetail",children:[(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Command"}),(0,mt.jsxs)("ul",{children:[(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"name"}),":"," ",(0,mt.jsx)("span",{className:"compareCmdName "+t.type,children:t.name})]}),(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"call"}),":"," ",a?(0,mt.jsxs)("span",{className:"compareTextChange",children:[(0,mt.jsx)("span",{className:"compareOld",children:t.previousText}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:t.currentText})]}):(0,mt.jsx)("span",{className:"compareNew",children:l})]}),void 0!==t.commandId&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",className:"compareCommandLink",title:"Show this command in the Commands view",onClick:e=>{e.preventDefault(),n(t.commandId)},children:"Show in Commands view →"})})]})]}),s.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Uniform & state changes"}),(0,mt.jsx)("ul",{children:s.map((e,t)=>(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),":"," ",(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:e.current})]},t))})]}),o.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Texture changes"}),(0,mt.jsx)("ul",{children:o.map((e,t)=>(0,mt.jsxs)("li",{className:"compareTextureItem",children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),(0,mt.jsxs)("div",{className:"compareImageDiff",children:[e.previousImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.previousImage,title:"Open in texture viewer",onClick:()=>r(e.previousImage,e.path+" (previous)")}):(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),e.currentImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.currentImage,title:"Open in texture viewer",onClick:()=>r(e.currentImage,e.path+" (current)")}):(0,mt.jsx)("span",{className:"compareNew",children:e.current})]})]},t))})]})]})}function Rh(e){const t=(255&e).toString(16);return 1===t.length?"0"+t:t}function xh(e,t,n,r){return"#"+Rh(e)+Rh(t)+Rh(n)+Rh(r)}function wh(e,t,n,r){const i=e=>(e/255).toFixed(2);return i(e)+", "+i(t)+", "+i(n)+", "+i(r)}function Fh(){const e=bt(),t=pt(e.store).textureViewer;return t.open?(0,mt.jsx)(Lh,{viewer:t,onClose:e.closeTextureViewer}):null}const Nh=120;function Lh(e){const{viewer:t,onClose:n}=e,r=(0,dt.useRef)(null),i=(0,dt.useRef)(null),s=(0,dt.useRef)(null),o=(0,dt.useRef)(null),[a,l]=(0,dt.useState)({r:!0,g:!0,b:!0,a:!0}),[u,c]=(0,dt.useState)(1),[h,d]=(0,dt.useState)("checker"),[f,p]=(0,dt.useState)(null),[m,g]=(0,dt.useState)(null),[E,v]=(0,dt.useState)(!1);(0,dt.useEffect)(()=>{let e=!1;const n=t=>{e||(o.current=t,p({width:t.width,height:t.height}),c(kh(t.width,t.height)),v(!0))};if(t.raw){const r=function(e){try{if(!e.data||e.width<=0||e.height<=0)return null;const t=function(e){const t=atob(e),n=new Uint8ClampedArray(t.length);for(let e=0;e{e=!0}}const r=new Image;return r.onload=()=>{const e=document.createElement("canvas");e.width=r.naturalWidth||1,e.height=r.naturalHeight||1;const t=e.getContext("2d");if(!t)return;t.drawImage(r,0,0);const i=t.getImageData(0,0,e.width,e.height);n({data:new Uint8ClampedArray(i.data),width:e.width,height:e.height})},r.src=t.src,()=>{e=!0}},[t.src,t.raw]),(0,dt.useEffect)(()=>{const e=o.current,t=r.current;if(!E||!e||!t)return;const n=function(e,t,n){let r=e.current;return r||(r=document.createElement("canvas"),e.current=r),r.width!==t&&(r.width=t),r.height!==n&&(r.height=n),r}(s,e.width,e.height),i=n.getContext("2d"),l=t.getContext("2d");if(!i||!l)return;const c=function(e,t){const n=new Uint8ClampedArray(e.length),r=t.a&&!t.r&&!t.g&&!t.b;for(let i=0;i{const e=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]);const C="textureViewerViewport"+("checker"===h?" checker":""),D="black"===h?{background:"#000"}:"white"===h?{background:"#fff"}:void 0;return(0,mt.jsx)("div",{className:"textureViewerOverlay",onClick:n,children:(0,mt.jsxs)("div",{className:"textureViewerModal",onClick:e=>e.stopPropagation(),children:[(0,mt.jsxs)("div",{className:"textureViewerHeader",children:[(0,mt.jsx)("span",{className:"textureViewerTitle",children:t.label}),(0,mt.jsxs)("span",{className:"textureViewerMeta",children:[f?f.width+" × "+f.height:"",!t.raw&&f?" · thumbnail":""]}),(0,mt.jsx)("span",{className:"textureViewerClose",title:"Close (Esc)",onClick:n,children:"✕"})]}),(0,mt.jsxs)("div",{className:"textureViewerToolbar",children:[(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Channels"}),(0,mt.jsx)(Oh,{channel:"r",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"g",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"b",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"a",mask:a,setMask:l})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"tvBtn",title:"Force alpha = 1 to reveal RGB hidden behind transparency",onClick:()=>l({r:!0,g:!0,b:!0,a:!1}),children:"Opaque"}),(0,mt.jsx)("span",{className:"tvBtn",title:"Show the alpha channel as grayscale",onClick:()=>l({r:!1,g:!1,b:!1,a:!0}),children:"Alpha → gray"})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"BG"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)(Ih,{value:"checker",glyph:"▦",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"black",glyph:"■",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"white",glyph:"□",background:h,setBackground:d})]})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Zoom"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.max(1,e/2)),children:"−"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(f?kh(f.width,f.height):1),children:"Fit"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.min(32,2*e)),children:"+"})]}),(0,mt.jsxs)("span",{className:"zoomVal",children:[Math.round(100*u),"%"]})]}),(0,mt.jsx)("div",{className:"textureViewerGroup textureViewerGroupEnd",children:(0,mt.jsx)("span",{className:"tvBtn primary",onClick:()=>{const e=s.current;e&&e.toBlob(e=>{if(!e)return;const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=((t.label||"texture").replace(/[^a-z0-9_\-]+/gi,"_").replace(/^_+|_+$/g,"")||"texture")+".png",r.click(),setTimeout(()=>URL.revokeObjectURL(n),0)})},children:"⭳ Save PNG"})})]}),(0,mt.jsxs)("div",{className:"textureViewerBody",children:[(0,mt.jsxs)("div",{className:C,style:D,children:[(0,mt.jsx)("canvas",{ref:r,className:"textureViewerCanvas",onMouseMove:e=>{const t=o.current,n=r.current,a=i.current,l=s.current;if(!t||!n)return;const c=n.getBoundingClientRect(),h=Math.floor((e.clientX-c.left)/u),d=Math.floor((e.clientY-c.top)/u);if(h<0||d<0||h>=t.width||d>=t.height)return g(null),void(a&&(a.style.display="none"));const f=4*(d*t.width+h);g({x:h,y:d,r:t.data[f],g:t.data[f+1],b:t.data[f+2],a:t.data[f+3]}),function(e,t,n,r){if(!e||!t)return;const i=e.getContext("2d");if(!i)return;i.imageSmoothingEnabled=!1,i.clearRect(0,0,Nh,Nh),i.drawImage(t,n-7,r-7,15,15,0,0,Nh,Nh),i.strokeStyle="#F0640D",i.lineWidth=2,i.strokeRect(56,56,8,8),e.style.display="block"}(a,l,h,d)},onMouseLeave:()=>{g(null),i.current&&(i.current.style.display="none")}}),(0,mt.jsx)("canvas",{ref:i,className:"textureViewerLoupe",width:Nh,height:Nh})]}),(0,mt.jsxs)("div",{className:"textureViewerRail",children:[(0,mt.jsx)("div",{className:"railTitle",children:"Pixel inspector"}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"position"}),(0,mt.jsx)("span",{className:"v",children:m?m.x+", "+m.y:"—"})]}),(0,mt.jsx)("div",{className:"swatch",children:(0,mt.jsx)("div",{className:"swatchInner",style:m?{background:"rgba("+m.r+","+m.g+","+m.b+","+m.a/255+")"}:void 0})}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"R"}),(0,mt.jsx)("span",{className:"v",children:m?m.r:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"G"}),(0,mt.jsx)("span",{className:"v",children:m?m.g:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"B"}),(0,mt.jsx)("span",{className:"v",children:m?m.b:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"A"}),(0,mt.jsx)("span",{className:"v",children:m?m.a:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"hex"}),(0,mt.jsx)("span",{className:"v",children:m?xh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"norm"}),(0,mt.jsx)("span",{className:"v",children:m?wh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"hint",children:["Move over the texture to sample pixels. Toggle channels to isolate RGB / alpha.",(0,mt.jsx)("b",{children:" Opaque"})," reveals colour hidden behind transparency (#183)."]})]})]})]})})}function Oh(e){const{channel:t,mask:n,setMask:r}=e,i=n[t],s="channel "+t+(i?" on":"");return(0,mt.jsx)("span",{className:s,onClick:()=>r(Object.assign(Object.assign({},n),{[t]:!i})),children:t.toUpperCase()})}function Ih(e){const{value:t,glyph:n,background:r,setBackground:i}=e;return(0,mt.jsx)("span",{className:"tvBtn"+(r===t?" active":""),onClick:()=>i(t),children:n})}function kh(e,t){return Math.max(1,Math.min(16,Math.floor(480/Math.max(e,t))||1))}function Mh(){const e=bt(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"resultViewComponent "+(t.visible?"active":""),children:[(0,mt.jsx)(Tt,{}),(0,mt.jsxs)(Rt,{children:[0===t.menuStatus&&(0,mt.jsx)(wt,{active:!0,captures:t.captures,onCaptureSelected:t=>{e.selectCapture(t),e.handleMenuStatusChange(40)},onSaveRequested:e.handleSaveRequested,onCaptureLoaded:e.handleCaptureLoaded}),40===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(Ft,{children:t.visualStates.map((t,n)=>(0,mt.jsx)(Nt,{item:t,onVisualStateSelected:()=>e.handleVisualStateSelected(n)},n))}),(0,mt.jsx)(Lt,{children:t.commands.map((t,n)=>(0,mt.jsx)(Ot,{command:t,onCommandSelected:()=>e.handleCommandSelected(n),onVertexSelected:()=>e.handleVertexSelected(n),onFragmentSelected:()=>e.handleFragmentSelected(n),onShaderSelected:()=>e.handleShaderSelected(n)},n))}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]}),10===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(kt,{left:!0,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationLeft})})}),(0,mt.jsx)(kt,{left:!1,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationRight})})})]}),20===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.initStateData})}),30===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.endStateData})}),60===t.menuStatus&&(0,mt.jsx)(_h,{}),50===t.menuStatus&&t.sourceCodeState&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(ch,{state:t.sourceCodeState,errorMessage:t.sourceCodeError,onVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!1),onFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!1),onTranslatedVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!0),onTranslatedFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!0),onCloseClicked:e.handleSourceCodeClose,onSourceCodeChanged:e.handleSourceCodeChanged,onBeautifyChanged:e.handleBeautifyChanged,onPreprocessChanged:e.handlePreprocessChanged}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]})]}),(0,mt.jsx)(Fh,{})]})}class Ph{static getMDNLink(e){const t=Ph.WebGL2Functions[e];if(t)return Ph.WebGL2RootUrl+t;const n=Ph.WebGLFunctions[e];if(n)return Ph.WebGLRootUrl+n;const r=Ph.AngleInstancedArraysExtFunctions[e];return r?Ph.AngleInstancedArraysExtRootUrl+r:Ph.WebGLRootUrl+e}}Ph.WebGL2RootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/",Ph.WebGLRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/",Ph.AngleInstancedArraysExtRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/",Ph.WebGL2Functions={beginQuery:"beginQuery",beginTransformFeedback:"beginTransformFeedback",bindBufferBase:"bindBufferBase",bindBufferRange:"bindBufferRange",bindSampler:"bindSampler",bindTransformFeedback:"bindTransformFeedback",bindVertexArray:"bindVertexArray",blitFramebuffer:"blitFramebuffer",clearBufferfv:"clearBuffer",clearBufferiv:"clearBuffer",clearBufferuiv:"clearBuffer",clearBufferfi:"clearBuffer",clientWaitSync:"clientWaitSync",compressedTexImage3D:"compressedTexImage3D",compressedTexSubImage3D:"compressedTexSubImage3D",copyBufferSubData:"copyBufferSubData",copyTexSubImage3D:"copyTexSubImage3D",createQuery:"createQuery",createSampler:"createSampler",createTransformFeedback:"createTransformFeedback",createVertexArray:"createVertexArray",deleteQuery:"deleteQuery",deleteSampler:"deleteSampler",deleteSync:"deleteSync",deleteTransformFeedback:"deleteTransformFeedback",deleteVertexArray:"deleteVertexArray",drawArraysInstanced:"drawArraysInstanced",drawBuffers:"drawBuffers",drawElementsInstanced:"drawElementsInstanced",drawRangeElements:"drawRangeElements",endQuery:"endQuery",endTransformFeedback:"endTransformFeedback",fenceSync:"fenceSync",framebufferTextureLayer:"framebufferTextureLayer",getActiveUniformBlockName:"getActiveUniformBlockName",getActiveUniformBlockParameter:"getActiveUniformBlockParameter",getActiveUniforms:"getActiveUniforms",getBufferSubData:"getBufferSubData",getFragDataLocation:"getFragDataLocation",getIndexedParameter:"getIndexedParameter",getInternalformatParameter:"getInternalformatParameter",getQuery:"getQuery",getQueryParameter:"getQueryParameter",getSamplerParameter:"getSamplerParameter",getSyncParameter:"getSyncParameter",getTransformFeedbackVarying:"getTransformFeedbackVarying",getUniformBlockIndex:"getUniformBlockIndex",getUniformIndices:"getUniformIndices",invalidateFramebuffer:"invalidateFramebuffer",invalidateSubFramebuffer:"invalidateSubFramebuffer",isQuery:"isQuery",isSampler:"isSampler",isSync:"isSync",isTransformFeedback:"isTransformFeedback",isVertexArray:"isVertexArray",pauseTransformFeedback:"pauseTransformFeedback",readBuffer:"readBuffer",renderbufferStorageMultisample:"renderbufferStorageMultisample",resumeTransformFeedback:"resumeTransformFeedback",samplerParameteri:"samplerParameter",samplerParameterf:"samplerParameter",texImage3D:"texImage3D",texStorage2D:"texStorage2D",texStorage3D:"texStorage3D",texSubImage3D:"texSubImage3D",transformFeedbackVaryings:"transformFeedbackVaryings",uniform1ui:"uniform",uniform2ui:"uniform",uniform3ui:"uniform",uniform4ui:"uniform",uniform1fv:"uniform",uniform2fv:"uniform",uniform3fv:"uniform",uniform4fv:"uniform",uniform1iv:"uniform",uniform2iv:"uniform",uniform3iv:"uniform",uniform4iv:"uniform",uniform1uiv:"uniform",uniform2uiv:"uniform",uniform3uiv:"uniform",uniform4uiv:"uniform",uniformBlockBinding:"uniformBlockBinding",uniformMatrix2fv:"uniformMatrix",uniformMatrix3x2fv:"uniformMatrix",uniformMatrix4x2fv:"uniformMatrix",uniformMatrix2x3fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4x3fv:"uniformMatrix",uniformMatrix2x4fv:"uniformMatrix",uniformMatrix3x4fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttribDivisor:"vertexAttribDivisor",vertexAttribI4i:"vertexAttribI",vertexAttribI4ui:"vertexAttribI",vertexAttribI4iv:"vertexAttribI",vertexAttribI4uiv:"vertexAttribI",vertexAttribIPointer:"vertexAttribIPointer",waitSync:"waitSync"},Ph.WebGLFunctions={uniform1f:"uniform",uniform1fv:"uniform",uniform1i:"uniform",uniform1iv:"uniform",uniform2f:"uniform",uniform2fv:"uniform",uniform2i:"uniform",uniform2iv:"uniform",uniform3f:"uniform",uniform3i:"uniform",uniform3iv:"uniform",uniform4f:"uniform",uniform4fv:"uniform",uniform4i:"uniform",uniform4iv:"uniform",uniformMatrix2fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttrib1f:"vertexAttrib",vertexAttrib2f:"vertexAttrib",vertexAttrib3f:"vertexAttrib",vertexAttrib4f:"vertexAttrib",vertexAttrib1fv:"vertexAttrib",vertexAttrib2fv:"vertexAttrib",vertexAttrib3fv:"vertexAttrib",vertexAttrib4fv:"vertexAttrib"},Ph.AngleInstancedArraysExtFunctions={drawArraysInstancedANGLE:"drawArraysInstancedANGLE",drawElementsInstancedANGLE:"drawElementsInstancedANGLE",vertexAttribDivisorANGLE:"vertexAttribDivisorANGLE"};const Bh={activeTexture:[["texture"]],attachShader:[["program","shader"]],beginQuery:[["target","query"]],beginTransformFeedback:[["primitiveMode"]],bindAttribLocation:[["program","index","name"]],bindBuffer:[["target","buffer"]],bindBufferBase:[["target","index","buffer"]],bindBufferRange:[["target","index","buffer","offset","size"]],bindFramebuffer:[["target","framebuffer"]],bindRenderbuffer:[["target","renderbuffer"]],bindSampler:[["unit","sampler"]],bindTexture:[["target","texture"]],bindTransformFeedback:[["target","tf"]],bindVertexArray:[["array"]],blendColor:[["red","green","blue","alpha"]],blendEquation:[["mode"]],blendEquationSeparate:[["modeRGB","modeAlpha"]],blendFunc:[["sfactor","dfactor"]],blendFuncSeparate:[["srcRGB","dstRGB","srcAlpha","dstAlpha"]],blitFramebuffer:[["srcX0","srcY0","srcX1","srcY1","dstX0","dstY0","dstX1","dstY1","mask","filter"]],bufferData:[["target","data","usage"],["target","size","usage"],["target","srcData","usage"],["target","srcData","usage","srcOffset","length"]],bufferSubData:[["target","dstByteOffset","srcData"],["target","offset","data"],["target","dstByteOffset","srcData","srcOffset","length"]],checkFramebufferStatus:[["target"]],clear:[["mask"]],clearBufferfi:[["buffer","drawbuffer","depth","stencil"]],clearBufferfv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferiv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferuiv:[["buffer","drawbuffer","values","srcOffset"]],clearColor:[["red","green","blue","alpha"]],clearDepth:[["depth"]],clearStencil:[["s"]],clientWaitSync:[["sync","flags","timeout"]],colorMask:[["red","green","blue","alpha"]],compileShader:[["shader"]],compressedTexImage2D:[["target","level","internalformat","width","height","border","data"],["target","level","internalformat","width","height","border","imageSize","offset"],["target","level","internalformat","width","height","border","srcData","srcOffset","srcLengthOverride"]],compressedTexImage3D:[["target","level","internalformat","width","height","depth","border","imageSize","offset"],["target","level","internalformat","width","height","depth","border","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage2D:[["target","level","xoffset","yoffset","width","height","format","data"],["target","level","xoffset","yoffset","width","height","format","imageSize","offset"],["target","level","xoffset","yoffset","width","height","format","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","imageSize","offset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","srcData","srcOffset","srcLengthOverride"]],copyBufferSubData:[["readTarget","writeTarget","readOffset","writeOffset","size"]],copyTexImage2D:[["target","level","internalformat","x","y","width","height","border"]],copyTexSubImage2D:[["target","level","xoffset","yoffset","x","y","width","height"]],copyTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","x","y","width","height"]],createBuffer:[[]],createFramebuffer:[[]],createProgram:[[]],createQuery:[[]],createRenderbuffer:[[]],createSampler:[[]],createShader:[["type"]],createTexture:[[]],createTransformFeedback:[[]],createVertexArray:[[]],cullFace:[["mode"]],deleteBuffer:[["buffer"]],deleteFramebuffer:[["framebuffer"]],deleteProgram:[["program"]],deleteQuery:[["query"]],deleteRenderbuffer:[["renderbuffer"]],deleteSampler:[["sampler"]],deleteShader:[["shader"]],deleteSync:[["sync"]],deleteTexture:[["texture"]],deleteTransformFeedback:[["tf"]],deleteVertexArray:[["vertexArray"]],depthFunc:[["func"]],depthMask:[["flag"]],depthRange:[["zNear","zFar"]],detachShader:[["program","shader"]],disable:[["cap"]],disableVertexAttribArray:[["index"]],drawArrays:[["mode","first","count"]],drawArraysInstanced:[["mode","first","count","instanceCount"]],drawBuffers:[["buffers"]],drawElements:[["mode","count","type","offset"]],drawElementsInstanced:[["mode","count","type","offset","instanceCount"]],drawRangeElements:[["mode","start","end","count","type","offset"]],enable:[["cap"]],enableVertexAttribArray:[["index"]],endQuery:[["target"]],endTransformFeedback:[[]],fenceSync:[["condition","flags"]],finish:[[]],flush:[[]],framebufferRenderbuffer:[["target","attachment","renderbuffertarget","renderbuffer"]],framebufferTexture2D:[["target","attachment","textarget","texture","level"]],framebufferTextureLayer:[["target","attachment","texture","level","layer"]],frontFace:[["mode"]],generateMipmap:[["target"]],getActiveAttrib:[["program","index"]],getActiveUniform:[["program","index"]],getActiveUniformBlockName:[["program","uniformBlockIndex"]],getActiveUniformBlockParameter:[["program","uniformBlockIndex","pname"]],getActiveUniforms:[["program","uniformIndices","pname"]],getAttachedShaders:[["program"]],getAttribLocation:[["program","name"]],getBufferParameter:[["target","pname"]],getBufferSubData:[["target","srcByteOffset","dstBuffer","dstOffset","length"]],getContextAttributes:[[]],getError:[[]],getExtension:[["extensionName"],["name"]],getFragDataLocation:[["program","name"]],getFramebufferAttachmentParameter:[["target","attachment","pname"]],getIndexedParameter:[["target","index"]],getInternalformatParameter:[["target","internalformat","pname"]],getParameter:[["pname"]],getProgramInfoLog:[["program"]],getProgramParameter:[["program","pname"]],getQuery:[["target","pname"]],getQueryParameter:[["query","pname"]],getRenderbufferParameter:[["target","pname"]],getSamplerParameter:[["sampler","pname"]],getShaderInfoLog:[["shader"]],getShaderParameter:[["shader","pname"]],getShaderPrecisionFormat:[["shadertype","precisiontype"]],getShaderSource:[["shader"]],getSupportedExtensions:[[]],getSyncParameter:[["sync","pname"]],getTexParameter:[["target","pname"]],getTransformFeedbackVarying:[["program","index"]],getUniform:[["program","location"]],getUniformBlockIndex:[["program","uniformBlockName"]],getUniformIndices:[["program","uniformNames"]],getUniformLocation:[["program","name"]],getVertexAttrib:[["index","pname"]],getVertexAttribOffset:[["index","pname"]],hint:[["target","mode"]],invalidateFramebuffer:[["target","attachments"]],invalidateSubFramebuffer:[["target","attachments","x","y","width","height"]],isBuffer:[["buffer"]],isContextLost:[[]],isEnabled:[["cap"]],isFramebuffer:[["framebuffer"]],isProgram:[["program"]],isQuery:[["query"]],isRenderbuffer:[["renderbuffer"]],isSampler:[["sampler"]],isShader:[["shader"]],isSync:[["sync"]],isTexture:[["texture"]],isTransformFeedback:[["tf"]],isVertexArray:[["vertexArray"]],lineWidth:[["width"]],linkProgram:[["program"]],pauseTransformFeedback:[[]],pixelStorei:[["pname","param"]],polygonOffset:[["factor","units"]],readBuffer:[["src"]],readPixels:[["x","y","width","height","format","type","dstData"],["x","y","width","height","format","type","offset"],["x","y","width","height","format","type","pixels"],["x","y","width","height","format","type","dstData","dstOffset"]],renderbufferStorage:[["target","internalformat","width","height"]],renderbufferStorageMultisample:[["target","samples","internalformat","width","height"]],resumeTransformFeedback:[[]],sampleCoverage:[["value","invert"]],samplerParameterf:[["sampler","pname","param"]],samplerParameteri:[["sampler","pname","param"]],scissor:[["x","y","width","height"]],shaderSource:[["shader","source"]],stencilFunc:[["func","ref","mask"]],stencilFuncSeparate:[["face","func","ref","mask"]],stencilMask:[["mask"]],stencilMaskSeparate:[["face","mask"]],stencilOp:[["fail","zfail","zpass"]],stencilOpSeparate:[["face","fail","zfail","zpass"]],texImage2D:[["target","level","internalformat","format","type","source"],["target","level","internalformat","width","height","border","format","type","pboOffset"],["target","level","internalformat","width","height","border","format","type","pixels"],["target","level","internalformat","width","height","border","format","type","source"],["target","level","internalformat","width","height","border","format","type","srcData","srcOffset"]],texImage3D:[["target","level","internalformat","width","height","depth","border","format","type","pboOffset"],["target","level","internalformat","width","height","depth","border","format","type","source"],["target","level","internalformat","width","height","depth","border","format","type","srcData"],["target","level","internalformat","width","height","depth","border","format","type","srcData","srcOffset"]],texParameterf:[["target","pname","param"]],texParameteri:[["target","pname","param"]],texStorage2D:[["target","levels","internalformat","width","height"]],texStorage3D:[["target","levels","internalformat","width","height","depth"]],texSubImage2D:[["target","level","xoffset","yoffset","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","pboOffset"],["target","level","xoffset","yoffset","width","height","format","type","pixels"],["target","level","xoffset","yoffset","width","height","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","srcData","srcOffset"]],texSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","pboOffset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","source"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","srcData","srcOffset"]],transformFeedbackVaryings:[["program","varyings","bufferMode"]],uniform1f:[["location","x"]],uniform1fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1i:[["location","x"]],uniform1iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1ui:[["location","v0"]],uniform1uiv:[["location","data","srcOffset","srcLength"]],uniform2f:[["location","x","y"]],uniform2fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2i:[["location","x","y"]],uniform2iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2ui:[["location","v0","v1"]],uniform2uiv:[["location","data","srcOffset","srcLength"]],uniform3f:[["location","x","y","z"]],uniform3fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3i:[["location","x","y","z"]],uniform3iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3ui:[["location","v0","v1","v2"]],uniform3uiv:[["location","data","srcOffset","srcLength"]],uniform4f:[["location","x","y","z","w"]],uniform4fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4i:[["location","x","y","z","w"]],uniform4iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4ui:[["location","v0","v1","v2","v3"]],uniform4uiv:[["location","data","srcOffset","srcLength"]],uniformBlockBinding:[["program","uniformBlockIndex","uniformBlockBinding"]],uniformMatrix2fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x3fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x3fv:[["location","transpose","data","srcOffset","srcLength"]],useProgram:[["program"]],validateProgram:[["program"]],vertexAttrib1f:[["index","x"]],vertexAttrib1fv:[["index","values"]],vertexAttrib2f:[["index","x","y"]],vertexAttrib2fv:[["index","values"]],vertexAttrib3f:[["index","x","y","z"]],vertexAttrib3fv:[["index","values"]],vertexAttrib4f:[["index","x","y","z","w"]],vertexAttrib4fv:[["index","values"]],vertexAttribDivisor:[["index","divisor"]],vertexAttribI4i:[["index","x","y","z","w"]],vertexAttribI4iv:[["index","values"]],vertexAttribI4ui:[["index","x","y","z","w"]],vertexAttribI4uiv:[["index","values"]],vertexAttribIPointer:[["index","size","type","stride","offset"]],vertexAttribPointer:[["index","size","type","normalized","stride","offset"]],viewport:[["x","y","width","height"]],waitSync:[["sync","flags","timeout"]]};class Uh{static getNames(e,t){const n=Bh[e];if(!n||0===n.length)return null;for(const e of n)if(e.length===t)return e;let r=null;for(const e of n)e.length>=t&&(null===r||e.lengthi.length&&(i=e);return i}static getName(e,t,n){const r=Uh.getNames(e,n);return r&&t>=0&&t{const e={};for(let t=0;t<64;t++)e["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;return e})();class qh{constructor(e){this.sources=e.sources||[],this.names=e.names||[],this.sourceRoot=e.sourceRoot||"",this.lines=qh.parseMappings(e.mappings||"")}originalPositionFor(e,t){const n={source:null,line:null,column:null,name:null},r=e-1;if(r<0||r>=this.lines.length)return n;const i=this.lines[r];if(!i||0===i.length)return n;const s=this.findSegment(i,t);if(!s)return n;const o=s.sourceIndex>=0&&s.sourceIndex=0&&s.nameIndex>1,o=e[s];o.generatedColumn<=t?(i=o,n=s+1):r=s-1}return i}static parseMappings(e){const t=[];let n=0,r=0,i=0,s=0;const o=e.split(";");for(let e=0;e0){const e=a.split(",");for(let t=0;t=4&&(n+=o[1],r+=o[2],i+=o[3],a.sourceIndex=n,a.originalLine=r,a.originalColumn=i,o.length>=5&&(s+=o[4],a.nameIndex=s)),l.push(a)}}l.sort((e,t)=>e.generatedColumn-t.generatedColumn),t.push(l)}return t}static decodeSegment(e){const t=[];let n=0;for(;n>>=1,t.push(o?-r:r)}return t}}var Qh=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})};class Zh{constructor(e){this.cache=new Map,this.inflight=new Map,this.fetchFn=e||("undefined"!=typeof fetch?fetch.bind(globalThis):void 0)}resolveFrames(e){return Qh(this,void 0,void 0,function*(){return e&&0!==e.length?Promise.all(e.map(e=>this.resolveFrame(e))):e||[]})}resolveFrame(e){return Qh(this,void 0,void 0,function*(){const t=Zh.parseFrame(e);if(!t)return e;let n;try{n=yield this.getConsumer(t.url)}catch(t){return e}if(!n)return e;const r=n.originalPositionFor(t.line,t.column);return r.source&&null!==r.line?Zh.formatFrame(t.functionName,r.name,r.source,r.line,r.column||0):e})}static parseFrame(e){if(!e)return null;let t=e.match(/^(.*?)\s*\((.+):(\d+):(\d+)\)\s*$/);return t?{functionName:t[1].trim(),url:t[2],line:parseInt(t[3],10),column:parseInt(t[4],10)}:(t=e.match(/^\s*(.+):(\d+):(\d+)\s*$/),t?{functionName:"",url:t[1].trim(),line:parseInt(t[2],10),column:parseInt(t[3],10)}:null)}static formatFrame(e,t,n,r,i){const s=t||e,o=n+":"+r+":"+i;return s?s+" ("+o+")":o}getConsumer(e){return Qh(this,void 0,void 0,function*(){if(this.cache.has(e))return this.cache.get(e);const t=this.inflight.get(e);if(t)return t;const n=this.loadConsumer(e).then(t=>(this.cache.set(e,t),this.inflight.delete(e),t)).catch(()=>(this.cache.set(e,null),this.inflight.delete(e),null));return this.inflight.set(e,n),n})}loadConsumer(e){return Qh(this,void 0,void 0,function*(){if(!this.fetchFn)return null;const t=yield this.fetchFn(e);if(!t.ok)return null;const n=yield t.text(),r=Zh.extractSourceMappingURL(n);if(!r)return null;let i;if(0===r.indexOf("data:"))i=Zh.parseDataUri(r);else{const t=Zh.resolveUrl(r,e),n=yield this.fetchFn(t);if(!n.ok)return null;i=yield n.json()}return i&&"string"==typeof i.mappings?new qh(i):null})}static extractSourceMappingURL(e){const t=/\/\/[#@]\s*sourceMappingURL=(\S+)\s*$/gm;let n,r=null;for(;null!==(n=t.exec(e));)r=n[1];return r}static parseDataUri(e){const t=e.indexOf(",");if(-1===t)return null;const n=e.substring(0,t),r=e.substring(t+1);try{const e=/;base64/i.test(n)?Zh.decodeBase64(r):decodeURIComponent(r);return JSON.parse(e)}catch(e){return null}}static decodeBase64(e){if("function"==typeof atob)return atob(e);const t=globalThis.Buffer;if(t)return t.from(e,"base64").toString("utf-8");throw new Error("No base64 decoder available.")}static resolveUrl(e,t){try{return new URL(e,t).href}catch(t){return e}}}function Jh(e){return e&&(e.text||e.name)||""}function ed(e,t){const n=[];if(!e||!t)return n;const r=e.DrawCall,i=t.DrawCall;ad("uniform",r&&r.uniforms,i&&i.uniforms,n),ad("uniformBlock",r&&r.uniformBlocks,i&&i.uniformBlocks,n);const s=sd(e,t);for(const r of s){if(td[r])continue;const i=e[r],s=t[r];(rd(i)||rd(s))&&od(i,s,r,n)}return n}const td={id:!0,name:!0,commandArguments:!0,result:!0,status:!0,marker:!0,text:!0,startTime:!0,commandEndTime:!0,endTime:!0,stackTrace:!0,consumeCommandId:!0,VisualState:!0},nd={__SPECTOR_Object_TAG:!0,__SPECTOR_Object_CustomData:!0,__SPECTOR_Metadata:!0,customData:!0,visual:!0,visualPixels:!0,VisualState:!0,texture:!0,sampler:!0,location:!0,source:!0,translatedSource:!0,analyserName:!0,uniforms:!0,uniformBlocks:!0,length:!0};function rd(e){return null!==e&&"object"==typeof e}function id(e){if(!rd(e))return null;const t=e.__SPECTOR_Object_TAG||("string"==typeof e.typeName&&"id"in e?e:null);return t&&"string"==typeof t.typeName?t.typeName:null}function sd(e,t){const n=[],r={},i=e=>{if(rd(e))for(const t in e)e.hasOwnProperty(t)&&!r[t]&&(r[t]=!0,n.push(t))};return i(e),i(t),n}function od(e,t,n,r,i=0){const s=id(e),o=id(t);if(null!==s||null!==o){const e=null!==s?s:"(absent)",t=null!==o?o:"(absent)";return void(e!==t&&r.push({path:n,previous:e,current:t}))}const a=rd(e),l=rd(t);if(!a&&!l){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}if(a!==l||i>=8){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}for(const s of sd(e,t))nd[s]||od(e?e[s]:void 0,t?t[s]:void 0,n+"."+s,r,i+1)}function ad(e,t,n,r){const i=hd(t),s=hd(n),o=[],a={};for(const e in i)i.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const e in s)s.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const t of o){const n=i.hasOwnProperty(t)?i[t]:void 0,o=s.hasOwnProperty(t)?s[t]:void 0,a=n?dd(n.value):"(absent)",l=o?dd(o.value):"(absent)";a!==l&&r.push({path:e+" "+t,previous:a,current:l}),ld(e+" "+t,n,o,r)}}function ld(e,t,n,r){const i=t&&t.texture,s=n&&n.texture;(rd(i)||rd(s))&&cd(e+" texture",i,s,r);const o=t&&t.textures,a=n&&n.textures,l=Array.isArray(o)?o.length:0,u=Array.isArray(a)?a.length:0,c=Math.max(l,u);for(let t=0;t0?o[t]:void 0,u>0?a[t]:void 0,r)}const ud=["width","height","depth","format","internalFormat","textureType"];function cd(e,t,n,r){(rd(t)||rd(n))&&(function(e,t,n,r){for(const i of ud){const s=t?t[i]:void 0,o=n?n[i]:void 0;if(void 0===s&&void 0===o)continue;const a=dd(s),l=dd(o);a!==l&&r.push({path:e+" "+i,previous:a,current:l})}}(e,t,n,r),function(e,t,n,r){if(rd(t)||rd(n))for(const i of sd(t,n)){const s=t?t[i]:void 0,o=n?n[i]:void 0,a="string"==typeof s,l="string"==typeof o;(a||l)&&s!==o&&r.push({path:e+" ("+i+")",previous:a?"(image)":"(absent)",current:l?"(image)":"(absent)",previousImage:a?s:void 0,currentImage:l?o:void 0})}}(e,t&&t.visual,n&&n.visual,r))}function hd(e){const t={};if(Array.isArray(e))for(const n of e)n&&"string"==typeof n.name&&(t[n.name]=n);return t}function dd(e){if(void 0===e)return"(absent)";if(null===e)return"null";try{return JSON.stringify(e)}catch(t){return String(e)}}function fd(e,t){for(let n=0;n{if(this.store.getSnapshot().currentCapture)switch(e){case 0:this._displayCaptures();break;case 40:this._displayCurrentCapture();break;case 10:this._displayInformation();break;case 20:this._displayInitState();break;case 30:this._displayEndState();break;case 60:this._displayCompare()}else this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))},this.handleSearchTextChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{searchText:e})),this._search(e)},this.handleCompareOnlyDifferencesChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{compareOnlyDifferences:e}))},this.handleCompareCommandSelected=e=>{null!=e&&(this._currentCommandId=e,this._displayCurrentCapture())},this.handleCommandSelected=e=>{this.selectCommand(e)},this.openTextureViewer=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{textureViewer:{open:!0,src:e.src,label:e.label,pixelated:e.pixelated,raw:e.raw||null}}))},this.closeTextureViewer=()=>{this.store.setState(e=>Object.assign(Object.assign({},e),{textureViewer:Object.assign(Object.assign({},e.textureViewer),{open:!1})}))},this.handleVisualStateSelected=e=>{this.selectVisualState(e)},this.handleVertexSelected=e=>{this.selectCommand(e),this._openShader(!1)},this.handleFragmentSelected=e=>{this.selectCommand(e),this._openShader(!0)},this.handleShaderSelected=e=>{var t;const n=null===(t=this.store.getSnapshot().commands[e])||void 0===t?void 0:t.capture.shader;n&&(this.selectCommand(e),this._openCapturedShader(n))},this.handleShaderSourceOpen=(e,t)=>{this._openCapturedShader(e,t)},this.handleSourceCodeChanged=e=>{this.onSourceCodeChanged.trigger(e)},this.handleSourceCodeClose=()=>{this._displayCurrentCapture()},this.handleSourceCodeTabChange=(e,t)=>{this.store.setState(n=>n.sourceCodeState?Object.assign(Object.assign({},n),{sourceCodeState:Object.assign(Object.assign({},n.sourceCodeState),{fragment:e,translated:t})}):n)},this.handleBeautifyChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{beautify:e})}):t)},this.handlePreprocessChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{preprocessed:e})}):t)},this.handleSaveRequested=e=>{this.saveCapture(e)},this.handleCaptureLoaded=e=>{this.addCapture(e)},this.handleClose=()=>{this.hide()},this._rootPlaceHolder=e||document.body,this.onSourceCodeChanged=new l,this.store=new ft(Object.assign({},pd)),this._container=document.createElement("div"),this._container.className="spector-react-result-view",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(yt.Provider,{value:this},(0,dt.createElement)(Mh))),this._rootPlaceHolder.addEventListener("keydown",e=>{if(40!==this.store.getSnapshot().menuStatus)return;const t=e.keyCode;38===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousCommand()):40===t?(e.preventDefault(),e.stopPropagation(),this._selectNextCommand()):33===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousVisualState()):34===t&&(e.preventDefault(),e.stopPropagation(),this._selectNextVisualState())})}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}addCapture(e){return this.store.setState(t=>{const n=t.captures.map(e=>({capture:e.capture,active:!1}));return Object.assign(Object.assign({},t),{captures:[{capture:e,active:!0},...n],currentCapture:e})}),this._currentCommandId=-1,this._displayCurrentCapture(),0}selectCapture(e){this._currentCommandId=-1,this.store.setState(t=>{var n,r;const i=t.captures.map((t,n)=>({capture:t.capture,active:n===e}));return Object.assign(Object.assign({},t),{captures:i,currentCapture:null!==(r=null===(n=i[e])||void 0===n?void 0:n.capture)&&void 0!==r?r:null})}),this._displayCurrentCapture()}selectCommand(e){const t=this.store.getSnapshot();if(e<0||e>=t.commands.length)return;const n=t.commands[e];this._currentCommandId=n.capture.id;const r=n.visualStateIndex,i=this._buildCommandDetail(e,t.commands,t.visualStates);this.store.setState(t=>Object.assign(Object.assign({},t),{commands:t.commands.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentCommandIndex:e,visualStates:t.visualStates.map((e,t)=>e.active!==(t===r)?Object.assign(Object.assign({},e),{active:t===r}):e),currentVisualStateIndex:r,commandDetailData:i}))}selectVisualState(e){const t=this.store.getSnapshot();if(e<0||e>=t.visualStates.length)return;const n=t.visualStates[e].commandIndex;if(n===Number.MIN_VALUE)return void this._displayInitState();if(n===Number.MAX_VALUE)return void this._displayEndState();n>=0&&(this._currentCommandId=t.commands[n].capture.id);const r=n>=0?this._buildCommandDetail(n,t.commands,t.visualStates):t.commandDetailData;this.store.setState(t=>Object.assign(Object.assign({},t),{visualStates:t.visualStates.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentVisualStateIndex:e,commands:n>=0?t.commands.map((e,t)=>e.active!==(t===n)?Object.assign(Object.assign({},e),{active:t===n}):e):t.commands,currentCommandIndex:n>=0?n:t.currentCommandIndex,commandDetailData:r}))}showSourceCodeError(e){this.store.setState(t=>Object.assign(Object.assign({},t),{sourceCodeError:e}))}saveCapture(e){const t=JSON.stringify(e,null,4),n=new Blob([t],{type:"octet/stream"}),r="capture "+new Date(e.startTime).toTimeString().split(" ")[0]+".json",i=document.createElement("a"),s=window.URL.createObjectURL(n);i.setAttribute("href",s),i.setAttribute("download",r),i.click()}_displayCaptures(){this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))}_displayCompare(){const e=this.store.getSnapshot(),t=e.captures.findIndex(e=>e.active),n=t>=0?e.captures[t]:null,r=n?e.captures[t+1]:null;if(!n||!r)return void this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:60,canCompare:!1,compareRows:[],compareSummary:{added:0,removed:0,changed:0,unchanged:0},compareLabel:""}));const i=function(e,t){const n=function(e,t){const n=e.length,r=t.length,i=e.map(Jh),s=t.map(Jh),o=[];for(let e=0;e<=n;e++)o.push(new Array(r+1).fill(0));for(let e=n-1;e>=0;e--)for(let t=r-1;t>=0;t--)o[e][t]=i[e]===s[t]?o[e+1][t+1]+1:Math.max(o[e+1][t],o[e][t+1]);const a=[];let l=[];const u=()=>{for(const e of l)a.push(e);l=[]};let c=0,h=0;for(;c0?a.push({type:"changed",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id,fieldDiffs:n}):a.push({type:"unchanged",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id}),c++,h++}else if(o[c+1][h]>=o[c][h+1])l.push({type:"removed",name:e[c].name,previousText:e[c].text,indexA:c}),c++;else{const n=fd(l,t[h].name);n?a.push({type:"changed",name:t[h].name,previousText:n.previousText,currentText:t[h].text,indexA:n.indexA,indexB:h,commandId:t[h].id,fieldDiffs:ed(e[n.indexA],t[h])}):(u(),a.push({type:"added",name:t[h].name,currentText:t[h].text,indexB:h,commandId:t[h].id})),h++}for(;cObject.assign(Object.assign({},e),{menuStatus:60,canCompare:!0,compareRows:i.rows,compareSummary:i.summary,compareLabel:s}))}static _captureLabel(e){try{return new Date(e.startTime).toTimeString().split(" ")[0]}catch(e){return"capture"}}_displayInformation(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];zh(n,"Canvas",t.canvas,e.searchText),zh(n,"Context",t.context,e.searchText);const r=[];for(const n of t.analyses){const t="Primitives"===n.analyserName?"Vertices count":n.analyserName;zh(r,t,n,e.searchText)}zh(r,"Frame Memory Changes",t.frameMemory,e.searchText),zh(r,"Total Memory (seconds since application start: bytes)",t.memory,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:10,commandCount:t.commands.length,informationLeft:n,informationRight:r}))}_displayInitState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.initState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:20,commandCount:t.commands.length,initStateData:n}))}_displayEndState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.endState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:30,commandCount:t.commands.length,endStateData:n}))}_displayCurrentCapture(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=e.searchText,r=e.captures.map(e=>({capture:e.capture,active:e.capture===t})),i=[];i.push({VisualState:t.initState.VisualState,time:t.startTime,commandIndex:Number.MIN_VALUE,active:!1,previousVisualStateIndex:-1,nextVisualStateIndex:-1});const s=[];let o=0,a=!1,l=-1,u=-1;for(let e=0;e0?c-1:-1,nextCommandIndex:-1,visualStateIndex:o,active:!1};if(c>0&&(s[c-1].nextCommandIndex=c),r.VisualState){const e=i.length,t=i.length-1,n={VisualState:r.VisualState,time:r.endTime,commandIndex:c,active:!1,previousVisualStateIndex:t,nextVisualStateIndex:-1};i[t].nextVisualStateIndex=e,i.push(n),o=e,a=!0}else a||(i[0].commandIndex=c,a=!0);h.visualStateIndex=o,s.push(h),(-1===this._currentCommandId&&0===c||this._currentCommandId===r.id)&&(l=c,u=o)}l>=0&&(s[l].active=!0,this._currentCommandId=s[l].capture.id),u>=0&&(i[u].active=!0);let c=[];l>=0&&(c=this._buildCommandDetail(l,s,i)),this.store.setState(e=>Object.assign(Object.assign({},e),{captures:r,menuStatus:40,commandCount:t.commands.length,commands:s,currentCommandIndex:l,visualStates:i,currentVisualStateIndex:u,sourceCodeState:null,sourceCodeError:"",commandDetailData:c}))}_openShader(e){const t=this.store.getSnapshot();if(t.currentCommandIndex<0||t.currentCommandIndex>=t.commands.length)return;const n=t.commands[t.currentCommandIndex].capture.DrawCall;if(!n||!n.shaders||n.shaders.length<2)return;const r={programId:n.programStatus.program.__SPECTOR_Object_TAG.id,nameVertex:n.shaders[0].name,nameFragment:n.shaders[1].name,sourceVertex:n.shaders[0].source,sourceFragment:n.shaders[1].source,translatedSourceVertex:n.shaders[0].translatedSource,translatedSourceFragment:n.shaders[1].translatedSource,fragment:e,translated:!1,editable:n.programStatus.RECOMPILABLE,beautify:!0,preprocessed:!1,singleShader:!1,sourceVertexLog:n.shaders[0].infoLog||"",sourceFragmentLog:n.shaders[1].infoLog||"",programLog:n.programStatus.infoLog||""},i=this._buildCommandDetail(t.currentCommandIndex,t.commands,t.visualStates);this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:"",commandDetailData:i}))}_openCapturedShader(e,t=""){if(!e||"string"!=typeof e.source)return;const n="FRAGMENT_SHADER"===e.shaderType,r={programId:-1,nameVertex:n?"":e.name,nameFragment:n?e.name:"",sourceVertex:n?"":e.source,sourceFragment:n?e.source:"",translatedSourceVertex:n?"":e.translatedSource||"",translatedSourceFragment:n&&e.translatedSource||"",fragment:n,translated:!1,editable:!1,beautify:!0,preprocessed:!1,singleShader:!0,sourceVertexLog:n?"":e.infoLog||"",sourceFragmentLog:n&&e.infoLog||"",programLog:t};this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:""}))}_buildCommandDetail(e,t,n){if(e<0||e>=t.length)return[];const r=t[e],i=n[r.visualStateIndex],s=this._resolvedStackTraces.get(r.capture.id),o=function(e,t,n){const r=[];t&&r.push({type:"visualState",visualState:t});let i="Unknown";switch(e.status){case 50:i="Deprecated";break;case 10:i="Unused";break;case 20:i="Disabled";break;case 30:i="Redundant";break;case 40:i="Valid"}const s=Ph.getMDNLink(e.name);e.result?zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,result:e.result,status:i},""):"LOG"!==e.name&&zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,status:i},"");for(const t in e)"VisualState"!==t&&"result"!==t&&("commandArguments"===t&&Array.isArray(e.commandArguments)?Kh(r,e.name,e.commandArguments):Xh(r,t,e)||("stackTrace"===t&&Array.isArray(e.stackTrace)?zh(r,"stackTrace",n||e.stackTrace,""):"object"==typeof e[t]&&zh(r,t,e[t],"")));return r}(r.capture,null==i?void 0:i.VisualState,s);return s||this._resolveStackTraceAsync(r.capture),o}_resolveStackTraceAsync(e){const t=e.id;this._resolvedStackTraces.has(t)||this._resolvingStackTraces.has(t)||e.stackTrace&&0!==e.stackTrace.length&&(this._resolvingStackTraces.add(t),this._sourceMapResolver.resolveFrames(e.stackTrace).then(n=>{this._resolvingStackTraces.delete(t),this._resolvedStackTraces.set(t,n);let r=!1;for(let t=0;tObject.assign(Object.assign({},t),{commandDetailData:e}))}}).catch(()=>{this._resolvingStackTraces.delete(t)}))}_selectPreviousCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.previousCommandIndex<0||this.selectCommand(t.previousCommandIndex)}_selectNextCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.nextCommandIndex<0||this.selectCommand(t.nextCommandIndex)}_selectPreviousVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.previousVisualStateIndex<0||this.selectVisualState(t.previousVisualStateIndex)}_selectNextVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.nextVisualStateIndex<0||this.selectVisualState(t.nextVisualStateIndex)}_search(e){switch(this.store.getSnapshot().menuStatus){case 0:case 40:this._displayCurrentCapture();break;case 30:this._displayEndState();break;case 10:this._displayInformation();break;case 20:this._displayInitState()}this.store.setState(e=>Object.assign(Object.assign({},e),{searchText:""}))}}class gd{constructor(e,t={}){this.worker=e,this.captureTimeout=t.captureTimeout||1e4,this.disposed=!1,this.captureTimer=null,this.onCapture=new l,this.onCaptureStarted=new l,this.onError=new l,this.onFps=new l,this.onContextReady=new l,this.messageHandler=this.handleMessage.bind(this),this.worker.addEventListener("message",this.messageHandler)}triggerCapture(e=0,t=0,n=!1,r=!1){if(this.disposed)return;this.clearCaptureTimer();const i={type:"spector:trigger-capture",version:1,canvasIndex:e,commandCount:t,quickCapture:n,fullCapture:r};this.worker.postMessage(i),this.captureTimer=setTimeout(()=>{this.onError.trigger("Capture timed out after "+this.captureTimeout+"ms"),this.captureTimer=null},this.captureTimeout)}dispose(){this.disposed||(this.disposed=!0,this.clearCaptureTimer(),this.worker.removeEventListener("message",this.messageHandler),this.onCapture.clear(),this.onCaptureStarted.clear(),this.onError.clear(),this.onFps.clear(),this.onContextReady.clear())}handleMessage(e){const t=e.data;if(!function(e){return null!=e&&"object"==typeof e&&"string"==typeof e.type&&0===e.type.indexOf("spector:")}(t))return;const n=t;switch(n.type){case"spector:context-ready":this.onContextReady.trigger({canvasCount:n.canvasCount,canvasWidth:n.canvasWidth,canvasHeight:n.canvasHeight});break;case"spector:capture-started":this.onCaptureStarted.trigger(void 0);break;case"spector:capture-complete":this.clearCaptureTimer(),this.onCapture.trigger(n.capture);break;case"spector:error":this.clearCaptureTimer(),this.onError.trigger(n.error);break;case"spector:fps":this.onFps.trigger(n.fps)}}clearCaptureTimer(){null!=this.captureTimer&&(clearTimeout(this.captureTimer),this.captureTimer=null)}}var Ed=n(72),vd=n.n(Ed),Cd=n(825),Dd=n.n(Cd),Sd=n(659),Ad=n.n(Sd),_d=n(56),yd=n.n(_d),bd=n(540),Td=n.n(bd),Rd=n(113),xd=n.n(Rd),wd=n(377),Fd={};Fd.styleTagTransform=xd(),Fd.setAttributes=yd(),Fd.insert=Ad().bind(null,"html"),Fd.domAPI=Dd(),Fd.insertStyleElement=Td(),vd()(wd.A,Fd),wd.A&&wd.A.locals&&wd.A.locals;var Nd=n(160),Ld={};Ld.styleTagTransform=xd(),Ld.setAttributes=yd(),Ld.insert=Ad().bind(null,"html"),Ld.domAPI=Dd(),Ld.insertStyleElement=Td(),vd()(Nd.A,Ld),Nd.A&&Nd.A.locals&&Nd.A.locals;class Od{constructor(e){this.timeSpy=e,this.init()}spyXRSession(e){this.currentXRSession&&this.unspyXRSession();for(const e of at.getRequestAnimationFrameFunctionNames())y.resetOriginFunction(this.timeSpy.getSpiedScope(),e);this.timeSpy.spyRequestAnimationFrame("requestAnimationFrame",e),this.currentXRSession=e}unspyXRSession(){if(this.currentXRSession){y.resetOriginFunction(this.currentXRSession,"requestAnimationFrame"),this.currentXRSession=void 0;for(const e of at.getRequestAnimationFrameFunctionNames())this.timeSpy.spyRequestAnimationFrame(e,this.timeSpy.getSpiedScope())}}init(){if(!navigator.xr)return;class e extends XRWebGLLayer{constructor(e,t,n){super(e,t,n),this.glContext=t}getContext(){return this.glContext}}class t extends XRWebGLBinding{constructor(e,t){super(e,t),this.glContext=t}createProjectionLayer(e){const t=super.createProjectionLayer(e);return t.glContext=this.glContext,t}}window.XRWebGLLayer=e,window.XRWebGLBinding=t;const n=navigator.xr.requestSession;Object.defineProperty(navigator.xr,"requestSessionInternal",{writable:!0}),navigator.xr.requestSessionInternal=n,Object.defineProperty(navigator.xr,"requestSession",{writable:!0}),navigator.xr.requestSession=(e,t)=>((e,t)=>navigator.xr.requestSessionInternal(e,t).then(e=>{const t=e;return t._updateRenderState=e.updateRenderState,t.updateRenderState=e=>function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){if(e.baseLayer){const n=e.baseLayer;t.glContext=n.getContext()}if(e.layers)for(const n of e.layers){const e=n;e.glContext&&(t.glContext=e.glContext)}return t._updateRenderState(e)}),this.spyXRSession(t),e.addEventListener("end",()=>{this.unspyXRSession()}),Promise.resolve(e)}))(e,t)}}const Id={CaptureMenu:_t,ResultView:md};class kd{static getFirstAvailable3dContext(e){return this.tryGetContextFromHelperField(e)||this.tryGetContextFromCanvas(e,"webgl")||this.tryGetContextFromCanvas(e,"experimental-webgl")||this.tryGetContextFromCanvas(e,"webgl2")||this.tryGetContextFromCanvas(e,"experimental-webgl2")}static tryGetContextFromHelperField(e){const t=e instanceof HTMLCanvasElement?e.getAttribute("__spector_context_type"):e.__spector_context_type;if(t)return this.tryGetContextFromCanvas(e,t)}static tryGetContextFromCanvas(e,t){let n;try{n=e.getContext(t)}catch(e){}return n}constructor(e={}){this.noFrameTimeout=-1,this.options=Object.assign({enableXRCapture:!1},e),this.captureNextFrames=0,this.captureNextCommands=0,this.quickCapture=!1,this.fullCapture=!1,this.retry=0,this.contexts=[],this.workerBridges=new Map,this.timeSpy=new at,this.onCaptureStarted=new l,this.onCapture=new l,this.onError=new l,this.timeSpy.onFrameStart.add(this.onFrameStart,this),this.timeSpy.onFrameEnd.add(this.onFrameEnd,this),this.timeSpy.onError.add(this.onErrorInternal,this),ct.install(),this.options.enableXRCapture&&(this.xrSpy=new Od(this.timeSpy))}displayUI(e=!1){this.captureMenu||(this.getCaptureUI(),this.captureMenu.onPauseRequested.add(this.pause,this),this.captureMenu.onPlayRequested.add(this.play,this),this.captureMenu.onPlayNextFrameRequested.add(this.playNextFrame,this),this.captureMenu.onCaptureRequested.add(e=>{e&&(e.ref instanceof Worker?this.captureWorker(e.ref):this.captureCanvas(e.ref))},this),setInterval(()=>{this.captureMenu.setFPS(this.getFps())},1e3),e||this.captureMenu.trackPageCanvases(),this.captureMenu.display()),this.resultView||(this.getResultUI(),this.onCapture.add(e=>{this.resultView.display(),this.resultView.addCapture(e)}))}getResultUI(){return this.resultView||(this.resultView=new md,this.resultView.onSourceCodeChanged.add(e=>{this.rebuildProgramFromProgramId(e.programId,e.sourceVertex,e.sourceFragment,t=>{this.referenceNewProgram(e.programId,t),this.resultView.showSourceCodeError(null)},e=>{this.resultView.showSourceCodeError(e)})})),this.resultView}getCaptureUI(){return this.captureMenu||(this.captureMenu=new _t),this.captureMenu}rebuildProgramFromProgramId(e,t,n,r,i){const s=Pe.getFromGlobalStore(e);this.rebuildProgram(s,t,n,r,i)}rebuildProgram(e,t,n,r,i){o.rebuildProgram(e,t,n,r,i)}referenceNewProgram(e,t){Pe.updateInGlobalStore(e,t)}pause(){this.timeSpy.changeSpeedRatio(0)}play(){this.timeSpy.changeSpeedRatio(1)}playNextFrame(){this.timeSpy.playNextFrame()}drawOnlyEveryXFrame(e){this.timeSpy.changeSpeedRatio(e)}getFps(){return this.timeSpy.getFps()}spyCanvases(){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt,this.canvasSpy.onContextRequested.add(this.spyContext,this))}spyCanvas(e){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt(e),this.canvasSpy.onContextRequested.add(this.spyContext,this))}getAvailableContexts(){return this.contexts}setShaderCompileDelay(e){ct.install(),ct.setDelay(e)}clearShaderCompileDelay(){ct.setDelay(0)}getShaderCompileDelay(){return ct.getDelay()}captureCanvas(e,t=0,n=!1,r=!1){const i=this.getAvailableContextSpyByCanvas(e);if(i)this.captureContextSpy(i,t,n,r);else{const i=kd.getFirstAvailable3dContext(e);i?this.captureContext(i,t,n,r):a.error("No webgl context available on the chosen canvas.")}}captureContext(e,t=0,n=!1,r=!1){let i=this.getAvailableContextSpyByCanvas(e.canvas);i||(i=e.getIndexedParameter?new ot({context:e,version:2,recordAlways:!1}):new ot({context:e,version:1,recordAlways:!1}),i.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:i.context.canvas,contextSpy:i})),i&&this.captureContextSpy(i,t,n,r)}captureXRContext(e=0,t=!1,n=!1){this.captureContext(this.getXRContext(),e,t,n)}captureContextSpy(e,t=0,n=!1,r=!1){this.quickCapture=n,this.fullCapture=r,this.capturingContext?this.onErrorInternal("Already capturing a context."):(this.retry=0,this.capturingContext=e,this.capturingContext.setMarker(this.marker),(t=Math.min(t,1e4))>0?this.captureCommands(t):this.captureFrames(1),this.noFrameTimeout=setTimeout(()=>{t>0?this.stopCapture():this.capturingContext&&this.retry>1?this.onErrorInternal("No frames with gl commands detected. Try moving the camera."):this.onErrorInternal("No frames detected. Try moving the camera or implementing requestAnimationFrame.")},1e4))}captureNextFrame(e,t=!1,n=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,0,t,n):this.captureContext(e,0,t,n)}startCapture(e,t,n=!1,r=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,t,n,r):this.captureContext(e,t,n,r)}stopCapture(){if(this.capturingContext){const e=this.capturingContext.stopCapture();if(e.commands.length>0)return this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),this.triggerCapture(e),this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,e;0===this.captureNextCommands&&(this.retry++,this.captureFrames(1))}}setMarker(e){this.marker=e,this.capturingContext&&this.capturingContext.setMarker(e)}clearMarker(){this.marker=null,this.capturingContext&&this.capturingContext.clearMarker()}addRequestAnimationFrameFunctionName(e){this.timeSpy.addRequestAnimationFrameFunctionName(e)}setSpiedScope(e){this.timeSpy.setSpiedScope(e)}log(e){this.capturingContext&&this.capturingContext.log(e)}spyWorkers(e="spector.worker.bundle.js"){ut.startIntercepting(e)}stopSpyingWorkers(){ut.stopIntercepting()}spyWorker(e){let t=this.workerBridges.get(e);return t||(t=new gd(e),t.onCapture.add(e=>{this.triggerCapture(e)},this),t.onError.add(e=>{this.onErrorInternal(e)},this),t.onContextReady.add(t=>{if(this.captureMenu){const n=this.workerBridges.size;this.captureMenu.addCanvasInformation({id:"Worker "+n,width:t.canvasWidth,height:t.canvasHeight,ref:e})}},this),t.onFps.add(e=>{this.captureMenu&&this.captureMenu.setFPS(e)},this),this.workerBridges.set(e,t),t)}captureWorker(e,t=0,n=!1,r=!1){this.workerBridges.has(e)||this.spyWorker(e);const i=this;e.addEventListener("message",function t(n){n.data&&"spector:capture-complete"===n.data.type&&(e.removeEventListener("message",t),i.triggerCapture(n.data.capture))}),e.postMessage({type:"spector:trigger-capture",version:1,canvasIndex:0,commandCount:t,quickCapture:n,fullCapture:r})}captureFrames(e){this.captureNextFrames=e,this.captureNextCommands=0,this.playNextFrame()}captureCommands(e){this.captureNextFrames=0,this.captureNextCommands=e,this.play(),this.capturingContext?(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(e,this.quickCapture,this.fullCapture)):(this.onErrorInternal("No context to capture from."),this.captureNextCommands=0)}spyContext(e){let t=this.getAvailableContextSpyByCanvas(e.context.canvas);t||(t=new ot({context:e.context,version:e.contextVersion,recordAlways:!0}),t.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:t.context.canvas,contextSpy:t})),t.spy()}getAvailableContextSpyByCanvas(e){for(const t of this.contexts)if(t.canvas===e)return t.contextSpy}getXRContext(){return this.options.enableXRCapture||a.error("Cannot retrieve WebXR context if capturing WebXR is disabled."),this.xrSpy.currentXRSession||a.error("No currently active WebXR session."),this.xrSpy.currentXRSession.glContext}onFrameStart(){this.captureNextCommands>0||(this.captureNextFrames>0?(this.capturingContext&&(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(0,this.quickCapture,this.fullCapture)),this.captureNextFrames--):this.capturingContext=void 0)}onFrameEnd(){this.captureNextCommands>0||0===this.captureNextFrames&&this.stopCapture()}triggerCapture(e){this.captureMenu&&this.captureMenu.captureComplete(null),this.onCapture.trigger(e)}onErrorInternal(e){if(a.error(e),this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),!this.capturingContext)throw e;this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,this.retry=0,this.captureMenu&&this.captureMenu.captureComplete(e),this.onError.trigger(e)}}},180(e,t,n){e=n.nmd(e),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/lang"),s=e("../lib/event"),o='.ace_search {background-color: #ddd;color: #666;border: 1px solid #cbcbcb;border-top: 0 none;overflow: hidden;margin: 0;padding: 4px 6px 0 4px;position: absolute;top: 0;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {margin: 0 20px 4px 0;overflow: hidden;line-height: 1.9;}.ace_replace_form {margin-right: 0;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {border-radius: 3px 0 0 3px;background-color: white;color: black;border: 1px solid #cbcbcb;border-right: 0 none;outline: 0;padding: 0;font-size: inherit;margin: 0;line-height: inherit;padding: 0 6px;min-width: 17em;vertical-align: top;min-height: 1.8em;box-sizing: content-box;}.ace_searchbtn {border: 1px solid #cbcbcb;line-height: inherit;display: inline-block;padding: 0 6px;background: #fff;border-right: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;margin: 0;position: relative;color: #666;}.ace_searchbtn:last-child {border-radius: 0 3px 3px 0;border-right: 1px solid #cbcbcb;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn:hover {background-color: #eef1f6;}.ace_searchbtn.prev, .ace_searchbtn.next {padding: 0px 0.7em}.ace_searchbtn.prev:after, .ace_searchbtn.next:after {content: "";border: solid 2px #888;width: 0.5em;height: 0.5em;border-width: 2px 0 0 2px;display:inline-block;transform: rotate(-45deg);}.ace_searchbtn.next:after {border-width: 0 2px 2px 0 ;}.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;font: 16px/16px Arial;padding: 0;height: 14px;width: 14px;top: 9px;right: 7px;position: absolute;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;box-sizing: border-box!important;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;clear: both;}.ace_search_counter {float: left;font-family: arial;padding: 0 8px;}',a=e("../keyboard/hash_handler").HashHandler,l=e("../lib/keys");r.importCssString(o,"ace_searchbox");var u=function(e,t,n){var i=r.createElement("div");r.buildDom(["div",{class:"ace_search right"},["span",{action:"hide",class:"ace_searchbtn_close"}],["div",{class:"ace_search_form"},["input",{class:"ace_search_field",placeholder:"Search for",spellcheck:"false"}],["span",{action:"findPrev",class:"ace_searchbtn prev"},"​"],["span",{action:"findNext",class:"ace_searchbtn next"},"​"],["span",{action:"findAll",class:"ace_searchbtn",title:"Alt-Enter"},"All"]],["div",{class:"ace_replace_form"},["input",{class:"ace_search_field",placeholder:"Replace with",spellcheck:"false"}],["span",{action:"replaceAndFindNext",class:"ace_searchbtn"},"Replace"],["span",{action:"replaceAll",class:"ace_searchbtn"},"All"]],["div",{class:"ace_search_options"},["span",{action:"toggleReplace",class:"ace_button",title:"Toggle Replace mode",style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{class:"ace_search_counter"}],["span",{action:"toggleRegexpMode",class:"ace_button",title:"RegExp Search"},".*"],["span",{action:"toggleCaseSensitive",class:"ace_button",title:"CaseSensitive Search"},"Aa"],["span",{action:"toggleWholeWords",class:"ace_button",title:"Whole Word Search"},"\\b"],["span",{action:"searchInSelection",class:"ace_button",title:"Search In Selection"},"S"]]],i),this.element=i.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),r.importCssString(o,"ace_searchbox",e.container)};(function(){this.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},this.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;s.addListener(e,"mousedown",function(e){setTimeout(function(){t.activeInput.focus()},0),s.stopPropagation(e)}),s.addListener(e,"click",function(e){var n=(e.target||e.srcElement).getAttribute("action");n&&t[n]?t[n]():t.$searchBarKb.commands[n]&&t.$searchBarKb.commands[n].exec(t),s.stopPropagation(e)}),s.addCommandKeyListener(e,function(e,n,r){var i=l.keyCodeToString(r),o=t.$searchBarKb.findKeyCommand(n,i);o&&o.exec&&(o.exec(t),s.stopEvent(e))}),this.$onChange=i.delayedCall(function(){t.find(!1,!1)}),s.addListener(this.searchInput,"input",function(){t.$onChange.schedule(20)}),s.addListener(this.searchInput,"focus",function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()}),s.addListener(this.replaceInput,"focus",function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()})},this.$closeSearchBarKb=new a([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new a,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.editor.getReadOnly()||(e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus())},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),this.setSearchRange=function(e){this.searchRange=e,e?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(e){r.setCssClass(this.replaceOption,"checked",this.searchRange),r.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var t=this.editor.getReadOnly();this.replaceOption.style.display=t?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!t?"":"none",this.find(!1,!1,e)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,n){var i=!this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n,range:this.searchRange})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",i),this.editor._emit("findSearchBox",{match:!i}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,n=0,r=0;if(t){var i=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),s=e.session.doc.positionToIndex(e.selection.anchor);this.searchRange&&(s-=e.session.doc.positionToIndex(this.searchRange.start));for(var o,a=t.lastIndex=0;(o=t.exec(i))&&(n++,(a=o.index)<=s&&r++,!(n>999))&&(o[0]||(t.lastIndex=a+=1,!(a>=i.length))););}this.searchCounter.textContent=r+" of "+(n>999?"999+":n)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(u.prototype),t.SearchBox=u,t.Search=function(e,t){(e.searchBox||new u(e)).show(e.session.getTextRange(),t)}}),ace.require(["ace/ext/searchbox"],function(t){e&&(e.exports=t)})},49(e,t,n){e=n.nmd(e),ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=t.cFunctions="\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b",a=function(){var e=this.$keywords=this.createKeywordMapper({"keyword.control":"break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while|catch|operator|try|throw|using","storage.type":"asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|class|wchar_t|template|char16_t|char32_t","storage.modifier":"const|extern|register|restrict|static|volatile|inline|private|protected|public|friend|explicit|virtual|export|mutable|typename|constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local","keyword.operator":"and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace","variable.language":"this","constant.language":"NULL|true|false|TRUE|FALSE|nullptr"},"identifier"),t=/\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source,n="%"+/(\d+\$)?/.source+/[#0\- +']*/.source+/[,;:_]?/.source+/((-?\d+)|\*(-?\d+\$)?)?/.source+/(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source+/(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source+/(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source;this.$rules={start:[{token:"comment",regex:"//$",next:"start"},{token:"comment",regex:"//",next:"singleLineComment"},i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string",regex:"'(?:"+t+"|.)?'"},{token:"string.start",regex:'"',stateName:"qqstring",next:[{token:"string",regex:/\\\s*$/,next:"qqstring"},{token:"constant.language.escape",regex:t},{token:"constant.language.escape",regex:n},{token:"string.end",regex:'"|$',next:"start"},{defaultToken:"string"}]},{token:"string.start",regex:'R"\\(',stateName:"rawString",next:[{token:"string.end",regex:'\\)"',next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"keyword",regex:"#\\s*(?:include|import|pragma|line|define|undef|version)\\b",next:"directive"},{token:"keyword",regex:"#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b"},{token:"support.function.C99.c",regex:o},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*"},{token:"keyword.operator",regex:/--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],singleLineComment:[{token:"comment",regex:/\\$/,next:"singleLineComment"},{token:"comment",regex:/$/,next:"start"},{defaultToken:"comment"}],directive:[{token:"constant.other.multiline",regex:/\\/},{token:"constant.other.multiline",regex:/.*\\/},{token:"constant.other",regex:"\\s*<.+?>",next:"start"},{token:"constant.other",regex:'\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',next:"start"},{token:"constant.other",regex:"\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",next:"start"},{token:"constant.other",regex:/[^\\\/]+/,next:"start"}]},this.embedRules(i,"doc-",[i.getEndRule("start")]),this.normalizeRules()};r.inherits(a,s),t.c_cppHighlightRules=a}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var i=n[1].length,s=e.findMatchingBracket({row:t,column:i});if(!s||s.row==t)return 0;var o=this.$getIndent(e.getLine(s.row));e.replace(new r(t,0,t,i-1),o)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i,s=e.getLine(n);if(this.startRegionRe.test(s))return this.getCommentRegionBlock(e,s,n);if(i=s.match(this.foldingStartMarker)){var o=i.index;if(i[1])return this.openingBracketBlock(e,i[1],n,o);var a=e.getCommentFoldRange(n,o+i[0].length,1);return a&&!a.isMultiLine()&&(r?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(i=s.match(this.foldingStopMarker))?(o=i.index+i[0].length,i[1]?this.closingBracketBlock(e,i[1],n,o):e.getCommentFoldRange(n,o,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length,a=t+=1,l=e.getLength();++tu)break;var c=this.getFoldWidgetRange(e,"all",t);if(c){if(c.start.row<=s)break;if(c.isMultiLine())t=c.end.row;else if(r==u)break}a=t}}return new i(s,o,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\s*$/),s=e.getLength(),o=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++no)return new i(o,r,n,t.length)}}.call(o.prototype)}),ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./c_cpp_highlight_rules").c_cppHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&"comment"==s[s.length-1].type)return r;if("start"==e)(a=t.match(/^.*[\{\(\[]\s*$/))&&(r+=n);else if("doc-start"==e){if("start"==o)return"";var a;(a=t.match(/^\s*(\/?)\*/))&&(a[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/c_cpp"}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/glsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/c_cpp_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp_highlight_rules").c_cppHighlightRules,s=function(){var e=this.createKeywordMapper({"variable.language":"this",keyword:"layout|attribute|const|uniform|varying|break|continue|do|for|while|if|else|in|out|inout|float|int|void|bool|true|false|lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|samplerCube|struct","constant.language":"radians|degrees|sin|cos|tan|asin|acos|atan|pow|exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|normalize|faceforward|reflect|refract|matrixCompMult|lessThan|lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|texture2DProjLod|textureCube|textureCubeLod|gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|gl_DepthRangeParameters|gl_DepthRange|gl_Position|gl_PointSize|gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData"},"identifier");this.$rules=(new i).$rules,this.$rules.start.forEach(function(t){"function"==typeof t.token&&(t.token=e)})};r.inherits(s,i),t.glslHighlightRules=s}),ace.define("ace/mode/glsl",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/glsl_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp").Mode,s=e("./glsl_highlight_rules").glslHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.$id="ace/mode/glsl"}.call(u.prototype),t.Mode=u}),ace.require(["ace/mode/glsl"],function(t){e&&(e.exports=t)})},429(e,t,n){e=n.nmd(e),ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.require(["ace/theme/monokai"],function(t){e&&(e.exports=t)})}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r](s,s.exports,n),s.loaded=!0,s.exports}return n.amdD=function(){throw new Error("define cannot be used indirect")},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.nc=void 0,n(832),n(49),n(429),n(902),n(180),n(878)})()); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("SPECTOR",[],t):"object"==typeof exports?exports.SPECTOR=t():e.SPECTOR=t()}(self,()=>(()=>{var e={377(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.captureMenuComponent{position:absolute;padding:7px;z-index:99999;top:10px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuComponent.active{visibility:visible;display:block}.captureMenuComponent,.captureMenuComponent:after,.captureMenuComponent:before{box-sizing:content-box}.captureMenuLogComponent{position:absolute;padding:7px;z-index:80000;top:66px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuLogComponent.active{visibility:visible;display:block}.captureMenuLogComponent,.captureMenuLogComponent:after,.captureMenuLogComponent:before{box-sizing:content-box}.captureMenuLogComponent span.error{color:red}.canvasListComponent{float:left;width:50%;height:100%}.canvasListComponent [commandName=onCanvasSelection]{vertical-align:center;line-height:40px;white-space:nowrap;text-overflow:ellipsis;width:190px;display:inline-block;overflow:hidden;margin:0px 5px}.canvasListComponent [commandName=onCanvasSelection]:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.canvasListComponent ul{margin:0px;padding:7px;list-style:none;position:absolute;top:54px;left:-2px;width:400px;border:2px solid #222;background-color:#2c2c2c}.canvasListComponent ul li{margin:5px}.canvasListComponent ul li:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.captureMenuActionsComponent{float:left;width:30%;height:100%;margin-top:7.5px}.captureMenuActionsComponent div{float:left}.captureMenuActionsComponent [commandName=onCaptureRequested]{border-radius:50%;background:#2c2c2c;border:2px solid red;width:21px;height:21px}.captureMenuActionsComponent [commandName=onCaptureRequested]:hover{background:red;cursor:pointer;transition:background .3s;-webkit-transition:background .3s;-moz-transition:background .3s}.captureMenuActionsComponent [commandName=onPlayRequested],.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPlayRequested]:before,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{content:"";position:absolute;display:inline-block;margin-top:6px;margin-left:4px;width:7px;height:7px;border-top:2px solid #f9f9f9;border-right:2px solid #f9f9f9;background-color:#f9f9f9;-moz-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg);z-index:-20}.captureMenuActionsComponent [commandName=onPlayRequested]:after,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:after{content:"";position:absolute;display:inline-block;width:8px;height:20px;background-color:#2c2c2c;z-index:-10}.captureMenuActionsComponent [commandName=onPlayRequested]:hover,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPauseRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPauseRequested]:before{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:12px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:after{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:7px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{background-color:#2c2c2c}.fpsCounterComponent{float:left;width:20%;vertical-align:center;line-height:40px;white-space:nowrap}',""]);const a=o},160(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.resultViewComponent{position:absolute;z-index:99999;border:1px solid #000;top:0;left:0;bottom:0;right:0;background-color:#222;opacity:1;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.resultViewComponent.active{visibility:visible;display:block}.resultViewComponent,.resultViewComponent:after,.resultViewComponent:before{box-sizing:content-box}.resultViewMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.resultViewMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.resultViewMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.resultViewMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.resultViewMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.resultViewMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.resultViewMenuComponent a.clearSearch{padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.resultViewMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}@media all and (max-width: 1024px){.resultViewMenuComponent .resultViewMenuOpen{display:block;visibility:visible}.resultViewMenuComponent li:not(.resultViewMenuSmall){display:none;visibility:hidden}.resultViewMenuComponent li{background:#2c2c2c}.resultViewMenuComponent li.searchContainer{background:rgb(69.5,69.5,69.5)}.resultViewMenuComponent{padding:0px;position:absolute;overflow-y:visible;top:0px;left:0px;right:0px;bottom:0px;z-index:999999;display:block}.resultViewMenuComponent a.active{background:#2c2c2c}}.resultViewMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:40px;position:relative;top:-1px;box-sizing:border-box}.resultViewMenuComponent input:focus{border:0;outline:0 none}.resultViewMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.resultViewMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.resultViewMenuComponent ::-webkit-input-placeholder{color:#ccc}.resultViewMenuComponent :-moz-placeholder{color:#ccc}.resultViewMenuComponent ::-moz-placeholder{color:#ccc}.resultViewMenuComponent :-ms-input-placeholder{color:#ccc}.resultViewContentComponent{position:absolute;top:40px;left:0;bottom:0;right:0}.informationColumnLeftComponent{position:absolute;top:0;left:0;bottom:0;right:50%;overflow:auto;overflow-x:hidden;overflow-y:visible}.informationColumnRightComponent{position:absolute;top:0;left:50%;bottom:0;right:0;overflow:auto;overflow-x:hidden;overflow-y:visible}.captureListComponent{position:absolute;top:40px;left:0;bottom:0;right:0;background:#222;z-index:9000;display:none;visibility:hidden;overflow-y:visible;overflow-x:hidden}.captureListComponent.active{display:block;visibility:visible}.captureListComponent .openCaptureFile{border:1px dashed #f9f9f9;display:block;margin:5px;padding:5px;text-align:center;font-style:italic}.captureListComponent .openCaptureFile span{line-height:100%;vertical-align:middle}.captureListComponent ul{margin:0px;padding:0px;list-style:none;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-start}.captureListComponent ul li{margin:5px;border:1px solid #606060}.captureListComponent ul li img{width:295px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;display:block}.captureListComponent ul li span{display:block;text-align:center;border:5px solid #222}.captureListComponent ul li span .captureListItemSave{color:#f9f9f9;font-size:16px;margin-left:10px;position:relative;padding:3px 8px 3px 32px}.captureListComponent ul li span .captureListItemSave:before,.captureListComponent ul li span .captureListItemSave:after{box-sizing:border-box;content:"";position:absolute}.captureListComponent ul li span .captureListItemSave:before{background:#222;border-color:#f9f9f9;border-style:solid;border-width:7px 2px 1px;border-radius:1px;height:16px;left:8px;top:5px;width:16px}.captureListComponent ul li span .captureListItemSave:after{background:#f9f9f9;border-color:#d9d9d9;border-style:solid;border-width:1px 1px 1px 4px;height:5px;left:13px;top:5px;width:7px}.captureListComponent ul li:hover{cursor:pointer}.captureListComponent ul li.active span{background:#f0640d;border:5px solid #f0640d}.captureListComponent ul li.active span .captureListItemSave:before{background:#f0640d}.captureListComponent ul li.active span .captureListItemSave:after{border-color:#f0640d}.visualStateListComponent{position:absolute;top:0;left:0;bottom:0;padding:5px;right:80%;overflow-y:visible;overflow-x:hidden}.visualStateListComponent ul{margin:0px;padding:0px;list-style:none}.visualStateListComponent ul li{margin:20px 15px 0px 15px;border:1px solid #606060}.visualStateListComponent ul li img{display:block;padding:0px;box-sizing:border-box;max-height:600px;width:100%;margin:0 auto;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.visualStateListComponent ul li:hover{cursor:pointer}.visualStateListComponent ul li span{border:5px solid #222;background:#222;box-sizing:border-box;display:inline-block;width:100%;margin:0px;padding:5px;word-wrap:break-word}.visualStateListComponent ul li.active{border:2px solid #f0640d}.commandListComponent{position:absolute;top:0;left:20%;right:40%;bottom:0;color:hsl(0,0%,82.6470588235%)}.commandListComponent ul{margin:0px;padding:0px;list-style:none;overflow-y:visible;overflow-x:hidden;height:100%}.commandListComponent ul li{padding:8px}.commandListComponent ul li span{word-wrap:break-word;line-height:22px}.commandListComponent ul li:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.commandListComponent ul li:nth-child(even){background:#2c2c2c}.commandListComponent ul li:nth-child(odd){background:#222}.commandListComponent ul li .important{font-weight:800}.commandListComponent ul li .important.deprecated{color:red}.commandListComponent ul li .important.unused{color:#ff0}.commandListComponent ul li .important.disabled{color:gray}.commandListComponent ul li .important.redundant{color:orange}.commandListComponent ul li .important.valid{color:#adff2f}.commandListComponent ul li .marker{font-size:16px;font-weight:900;color:#adff2f}.commandListComponent ul li.active{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.commandListComponent ul li.drawCall{background:#5db0d7;color:#222}.commandListComponent ul li a{margin-left:5px;margin-right:5px;color:#5db0d7;background:#222;padding:5px;font-weight:900;display:inline-block}.commandDetailComponent{position:absolute;top:0;left:60%;right:0;bottom:0;overflow-y:visible;overflow-x:hidden}.jsonGroupComponent{display:block;margin:10px;padding:10px;padding-bottom:5px}.jsonGroupComponent .jsonGroupComponentTitle{display:block;font-size:16px;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:5px;margin-bottom:5px;text-transform:capitalize}.jsonGroupComponent ul{margin:0px;padding:0px;list-style:none}.jsonGroupComponent ul li:nth-child(even){background:#222}.jsonGroupComponent ul li:nth-child(odd){background:#222}.jsonItemComponentKey{color:#f0640d}.jsonItemComponentValue{white-space:pre-wrap}.jsonItemImageHolder{width:50%;margin:auto}.jsonItemImageHolder .jsonItemImage{margin:5px;display:block;border:1px solid #606060;width:100%}.jsonItemImageHolder .jsonItemImage img{width:100%;display:block;margin:auto;max-width:256px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.jsonItemImageHolder .jsonItemImage span{margin:0px;padding:5px;word-wrap:break-word;display:inline-block;width:100%;box-sizing:border-box}[commandName=onOpenSourceClicked]:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.jsonVisualStateItemComponent{text-align:center;padding:10px}.jsonVisualStateItemComponent img{background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;border:1px solid #606060;margin:5px;width:100%;max-width:512px;max-height:800px}.jsonVisualStateItemComponent span{display:block}.jsonContentComponent{position:absolute;top:0;left:0;right:0;bottom:0;padding:10px;overflow-y:visible;overflow-x:hidden}.jsonItemComponentValue{word-break:break-all;white-space:normal}.jsonSourceItemComponentOpen{font-weight:bold;color:#5db0d7;text-decoration:underline}.sourceCodeMenuComponentContainer{position:absolute;left:0;top:0;bottom:48px;right:40%}.sourceCodeMenuComponentFooter{position:absolute;left:0;right:40%;bottom:0;padding:0 15px}.sourceCodeFormatError{color:#f0640d;margin-left:15px}.sourceCodeDiagnosticsNotice{color:#5db0d7;margin-left:15px}.sourceCodeDiagnosticsNotice a{color:#c9c9c9;text-decoration:underline}.sourceCodeMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.sourceCodeMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.sourceCodeMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.sourceCodeMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.sourceCodeMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.sourceCodeMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.sourceCodeMenuComponent a.clearSearch{display:inline-block;padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.sourceCodeMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}.sourceCodeMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:100%;position:relative;top:-1px;box-sizing:border-box}.sourceCodeMenuComponent input:focus{border:0;outline:0 none}.sourceCodeMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.sourceCodeMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.sourceCodeMenuComponent ::-webkit-input-placeholder{color:#ccc}.sourceCodeMenuComponent :-moz-placeholder{color:#ccc}.sourceCodeMenuComponent ::-moz-placeholder{color:#ccc}.sourceCodeMenuComponent :-ms-input-placeholder{color:#ccc}.sourceCodeComponent{position:absolute;top:42px;left:0;bottom:48px;right:40%;background:#222;z-index:9000;overflow-x:visible;overflow:auto}.sourceCodeComponent .sourceCodeComponentTitle{font-size:16px;font-weight:800;line-height:50px;color:#f0640d;padding:1em;margin:.5em 0}.compareViewComponent{position:absolute;top:50px;left:0px;right:0px;bottom:0px;overflow:hidden;display:flex;flex-direction:column;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:13px}.compareViewComponent .compareViewEmpty,.compareViewComponent .compareViewEmptyRow,.compareViewComponent .compareDetailEmpty{padding:1em;color:#c9c9c9;text-align:center}.compareViewComponent .compareViewHeader{flex:0 0 auto;display:flex;align-items:center;gap:16px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid rgb(8.5,8.5,8.5);white-space:nowrap}.compareViewComponent .compareViewHeader .compareViewLabel{color:#5db0d7}.compareViewComponent .compareViewHeader .compareViewSummary span{margin-right:8px;font-weight:700}.compareViewComponent .compareViewHeader .compareViewSummary span.added{color:#adff2f}.compareViewComponent .compareViewHeader .compareViewSummary span.removed{color:#ff5a5a}.compareViewComponent .compareViewHeader .compareViewSummary span.changed{color:#f0640d}.compareViewComponent .compareViewHeader .compareViewSummary span.unchanged{color:#c9c9c9}.compareViewComponent .compareViewHeader .compareViewToggle{margin-left:auto;cursor:pointer;user-select:none}.compareViewComponent .compareViewHeader .compareViewToggle input{vertical-align:middle;margin-right:4px}.compareViewComponent .compareViewBody{flex:1 1 auto;display:flex;min-height:0}.compareViewComponent .compareViewLegend{flex:0 0 130px;box-sizing:border-box;padding:10px;background:#2c2c2c;border-right:2px solid #222}.compareViewComponent .compareViewLegend .compareLegendRow{display:flex;align-items:center;gap:8px;margin:8px 0}.compareViewComponent .compareViewLegend .compareLegendRow.unchanged{opacity:.5}.compareViewComponent .compareViewLegend .compareLegendChip{width:12px;height:12px;border-radius:2px;background:#c9c9c9}.compareViewComponent .compareViewLegend .added .compareLegendChip{background:#adff2f}.compareViewComponent .compareViewLegend .removed .compareLegendChip{background:#ff5a5a}.compareViewComponent .compareViewLegend .changed .compareLegendChip{background:#f0640d}.compareViewComponent .compareViewList{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;margin:0;padding:0;list-style:none}.compareViewComponent .compareViewList .compareRow{display:flex;align-items:baseline;padding:3px 10px;line-height:20px;cursor:pointer;white-space:nowrap}.compareViewComponent .compareViewList .compareRow:nth-child(odd){background:#222}.compareViewComponent .compareViewList .compareRow:nth-child(even){background:#2c2c2c}.compareViewComponent .compareViewList .compareRow .compareSign{flex:0 0 14px;font-weight:800}.compareViewComponent .compareViewList .compareRow .compareRowText{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.compareViewComponent .compareViewList .compareRow .compareCmdName{font-weight:700}.compareViewComponent .compareViewList .compareRow.added .compareSign,.compareViewComponent .compareViewList .compareRow.added .compareCmdName{color:#adff2f}.compareViewComponent .compareViewList .compareRow.removed .compareSign,.compareViewComponent .compareViewList .compareRow.removed .compareCmdName{color:#ff5a5a}.compareViewComponent .compareViewList .compareRow.changed .compareSign,.compareViewComponent .compareViewList .compareRow.changed .compareCmdName{color:#f0640d}.compareViewComponent .compareViewList .compareRow.unchanged{opacity:.55}.compareViewComponent .compareViewList .compareRow.selected{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.compareViewComponent .compareViewList .compareRow.selected .compareSign,.compareViewComponent .compareViewList .compareRow.selected .compareCmdName{color:#222}.compareViewComponent .compareViewList .compareViewEmptyRow{cursor:default}.compareViewComponent .compareViewDetail{flex:0 0 42%;box-sizing:border-box;overflow-y:auto;border-left:2px solid #222;padding:4px 12px 12px}.compareViewComponent .compareViewDetail .compareDetailGroup{margin:12px 0}.compareViewComponent .compareViewDetail .compareDetailGroup ul{margin:0;padding:0;list-style:none}.compareViewComponent .compareViewDetail .compareDetailGroup li{padding:2px 0;white-space:pre-wrap;word-break:break-word}.compareViewComponent .compareViewDetail .compareDetailTitle{display:block;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin-bottom:6px;text-transform:capitalize}.compareViewComponent .compareViewDetail .compareDetailKey{color:#f0640d}.compareViewComponent .compareViewDetail .compareCmdName{font-weight:700}.compareViewComponent .compareViewDetail .compareCmdName.added{color:#adff2f}.compareViewComponent .compareViewDetail .compareCmdName.removed{color:#ff5a5a}.compareViewComponent .compareViewDetail .compareCmdName.changed{color:#f0640d}.compareViewComponent .compareViewDetail .compareArrow{color:#c9c9c9}.compareViewComponent .compareViewDetail .compareOld{opacity:.7;text-decoration:line-through}.compareViewComponent .compareViewDetail .compareNew{color:#f9f9f9}.compareViewComponent .compareViewDetail .compareCommandLink{color:#5db0d7;text-decoration:none;cursor:pointer;border-bottom:1px dotted currentColor}.compareViewComponent .compareViewDetail .compareCommandLink:hover{color:#f0640d}.compareViewComponent .compareViewDetail .compareTextureItem{padding-bottom:6px}.compareViewComponent .compareViewDetail .compareImageDiff{display:flex;align-items:center;margin-top:4px}.compareViewComponent .compareViewDetail .compareThumb{width:48px;height:48px;object-fit:contain;margin:2px 6px 2px 0;border:1px solid rgb(8.5,8.5,8.5);background:#222;image-rendering:pixelated}.jsonItemImageClickable{cursor:zoom-in}.textureViewerOverlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:100000;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.6);font-family:Consolas,monaco,monospace;font-size:13px;color:#f9f9f9}.textureViewerOverlay .textureViewerModal{width:min(900px,92vw);height:min(640px,90vh);display:flex;flex-direction:column;overflow:hidden;background:#222;border:1px solid #000;box-shadow:0 10px 40px rgba(0,0,0,.6)}.textureViewerOverlay .textureViewerHeader{flex:0 0 auto;display:flex;align-items:center;gap:12px;height:40px;padding:0 12px;background:#2c2c2c;border-bottom:2px solid #222}.textureViewerOverlay .textureViewerHeader .textureViewerTitle{color:#5db0d7}.textureViewerOverlay .textureViewerHeader .textureViewerMeta{color:#c9c9c9;font-size:12px}.textureViewerOverlay .textureViewerHeader .textureViewerClose{margin-left:auto;width:26px;height:26px;display:flex;align-items:center;justify-content:center;border-radius:3px;color:#c9c9c9;cursor:pointer}.textureViewerOverlay .textureViewerHeader .textureViewerClose:hover{color:#f9f9f9;background:hsla(0,0%,100%,.08)}.textureViewerOverlay .textureViewerToolbar{flex:0 0 auto;display:flex;align-items:center;flex-wrap:wrap;gap:14px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid #000;font-size:12px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup{display:flex;align-items:center;gap:6px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup .lbl{color:#c9c9c9;margin-right:2px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroupEnd{margin-left:auto}.textureViewerOverlay .textureViewerToolbar .channel{width:26px;height:24px;display:flex;align-items:center;justify-content:center;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#777;font-weight:800;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .channel.on.r{background:#e14b4b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.g{background:#4bd44b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.b{background:#4b8fe1;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.a{background:#dedede;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .tvBtn{height:24px;padding:0 10px;display:inline-flex;align-items:center;gap:6px;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#f9f9f9;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .tvBtn:hover{background:#333}.textureViewerOverlay .textureViewerToolbar .tvBtn.active{background:#f0640d;color:#1a1a1a;border-color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary{border-color:#f0640d;color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary:hover{background:#f0640d;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .seg{display:flex}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn{border-radius:0;border-right-width:0}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:first-child{border-radius:3px 0 0 3px}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:last-child{border-radius:0 3px 3px 0;border-right-width:1px}.textureViewerOverlay .textureViewerToolbar .zoomVal{min-width:44px;text-align:center;color:#c9c9c9}.textureViewerOverlay .textureViewerBody{flex:1 1 auto;display:flex;min-height:0}.textureViewerOverlay .textureViewerViewport{flex:1 1 auto;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#141414}.textureViewerOverlay .textureViewerViewport.checker{background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}.textureViewerOverlay .textureViewerCanvas{image-rendering:pixelated;cursor:crosshair;box-shadow:0 0 0 1px #000}.textureViewerOverlay .textureViewerLoupe{position:absolute;display:none;width:120px;height:120px;pointer-events:none;image-rendering:pixelated;border:1px solid #000;box-shadow:0 2px 8px rgba(0,0,0,.6);background:#000;left:16px;top:16px}.textureViewerOverlay .textureViewerRail{flex:0 0 210px;box-sizing:border-box;padding:12px;overflow-y:auto;background:#2c2c2c;border-left:2px solid #222}.textureViewerOverlay .textureViewerRail .railTitle{color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin:0 0 8px;text-transform:capitalize}.textureViewerOverlay .textureViewerRail .kv{display:flex;justify-content:space-between;margin:4px 0}.textureViewerOverlay .textureViewerRail .kv .k{color:#f0640d}.textureViewerOverlay .textureViewerRail .kv .v{color:#f9f9f9}.textureViewerOverlay .textureViewerRail .swatch{width:100%;height:34px;margin:8px 0;border:1px solid #000;background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0}.textureViewerOverlay .textureViewerRail .swatch .swatchInner{width:100%;height:100%}.textureViewerOverlay .textureViewerRail .hint{color:#c9c9c9;margin-top:10px;line-height:1.5}',""]);const a=o},636(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,".ace-monokai {\n color: #f9f9f9;\n font-size: 14px;\n}\n\n.ace-monokai .ace_entity.ace_name.ace_tag,\n.ace-monokai .ace_keyword,\n.ace-monokai .ace_meta.ace_tag,\n.ace-monokai .ace_storage {\n color: #F0640D\n}\n\n.ace-monokai .ace_constant.ace_character,\n.ace-monokai .ace_constant.ace_other {\n color: #5db0d7;\n}\n\n.ace-monokai .ace_marker-layer .ace_selection {\n background: #a6e22e\n}\n\n.ace-monokai .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #a6e22e;\n}\n\n.ace-monokai .ace_marker-layer .ace_active-line {\n background: #2c2c2c\n}\n.ace-monokai .ace_gutter-active-line {\n background-color: #2c2c2c\n}\n.ace-monokai .ace_marker-layer .ace_selected-word {\n border: 1px solid #a6e22e\n}\n\n.ace-monokai .ace_constant.ace_language {\n color: #e6db74\n}\n.ace-monokai .ace_constant.ace_numeric {\n color: #ae81ff\n}\n\n.ace-monokai .ace_gutter {\n background: #222;\n color: #8F908A;\n}",""]);const a=o},314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var a=0;a0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},601(e){"use strict";e.exports=function(e){return e[1]}},832(e,t,n){e=n.nmd(e),function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,n,r){"string"==typeof e?(2==arguments.length&&(r=n),t.modules[e]||(t.payloads[e]=r,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var n,r,i=function(e,t,n){if("string"==typeof t){var r=a(e,t);if(null!=r)return n&&n(),r}else if("[object Array]"===Object.prototype.toString.call(t)){for(var i=[],o=0,l=t.length;o1&&function(e,t,n){if(Array.prototype.indexOf)return e.indexOf("",n);for(var r=0;r-1&&(n=RegExp(this.source,i.replace.call(((r=this).global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),"g","")),i.replace.call(e.slice(a.index),n,function(){for(var e=1;ea.index&&this.lastIndex--}return a},o||(RegExp.prototype.test=function(e){var t=i.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError("Function.prototype.bind called on incompatible "+t);var n=d.call(arguments,1),i=function(){if(this instanceof i){var r=t.apply(this,n.concat(d.call(arguments)));return Object(r)===r?r:this}return t.apply(e,n.concat(d.call(arguments)))};return t.prototype&&(r.prototype=t.prototype,i.prototype=new r,r.prototype=null),i});var i,s,o,a,l,u=Function.prototype.call,c=Array.prototype,h=Object.prototype,d=c.slice,f=u.bind(h.toString),p=u.bind(h.hasOwnProperty);if((l=p(h,"__defineGetter__"))&&(i=u.bind(h.__defineGetter__),s=u.bind(h.__defineSetter__),o=u.bind(h.__lookupGetter__),a=u.bind(h.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,n=[];if(n.splice.apply(n,e(20)),n.splice.apply(n,e(26)),t=n.length,n.splice(5,0,"XXX"),n.length,t+1==n.length)return!0}()){var m=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?m.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(d.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):null==e?e=0:e<0&&(e=Math.max(n+e,0)),e+ta)for(h=u;h--;)this[l+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else for(this.length=c+s,h=0;h>>0;if("[object Function]"!=f(e))throw new TypeError;for(;++i>>0,i=Array(r),s=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var o=0;o>>0,s=[],o=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var a=0;a>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,s=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s++];break}if(++s>=r)throw new TypeError("reduce of empty array with no initial value")}for(;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,s=r-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s--];break}if(--s<0)throw new TypeError("reduceRight of empty array with no initial value")}do{s in this&&(i=e.call(void 0,i,n[s],s,t))}while(s--);return i}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=C&&"[object String]"==f(this)?this.split(""):L(this),n=t.length>>>0;if(!n)return-1;var r=0;for(arguments.length>1&&(r=N(arguments[1])),r=r>=0?r:Math.max(0,n+r);r>>0;if(!n)return-1;var r=n-1;for(arguments.length>1&&(r=Math.min(r,N(arguments[1]))),r=r>=0?r:n-Math.abs(r);r>=0;r--)if(r in t&&e===t[r])return r;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:h)}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(p(e,t)){var n;if(n={enumerable:!0,configurable:!0},l){var r=e.__proto__;e.__proto__=h;var i=o(e,t),s=a(e,t);if(e.__proto__=r,i||s)return i&&(n.get=i),s&&(n.set=s),n}return n.value=e[t],n}}),Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),Object.create||(g=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var n;if(null===e)n=g();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var r=function(){};r.prototype=e,(n=new r).__proto__=e}return void 0!==t&&Object.defineProperties(n,t),n}),Object.defineProperty){var S=D({}),A="undefined"==typeof document||D(document.createElement("div"));if(!S||!A)var _=Object.defineProperty}Object.defineProperty&&!_||(Object.defineProperty=function(e,t,n){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof n&&"function"!=typeof n||null===n)throw new TypeError("Property description must be an object: "+n);if(_)try{return _.call(Object,e,t,n)}catch(e){}if(p(n,"value"))if(l&&(o(e,t)||a(e,t))){var r=e.__proto__;e.__proto__=h,delete e[t],e[t]=n.value,e.__proto__=r}else e[t]=n.value;else{if(!l)throw new TypeError("getters & setters can not be defined on this javascript engine");p(n,"get")&&i(e,t,n.get),p(n,"set")&&s(e,t,n.set)}return e}),Object.defineProperties||(Object.defineProperties=function(e,t){for(var n in t)p(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=(E=Object.freeze,function(e){return"function"==typeof e?e:E(e)})}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";p(e,t);)t+="?";e[t]=!0;var n=p(e,t);return delete e[t],n}),!Object.keys){var y=!0,b=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],T=b.length;for(var R in{toString:null})y=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)p(e,n)&&t.push(n);if(y)for(var r=0,i=T;r0||-1)*Math.floor(Math.abs(e))),e}var L=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,n){"use strict";e("./regexp"),e("./es5-shim"),"undefined"==typeof Element||Element.prototype.remove||Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,n){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var r="object"==typeof navigator?navigator:{},i=(/mac|win|linux/i.exec(r.platform)||["other"])[0].toLowerCase(),s=r.userAgent||"",o=r.appName||"";t.isWin="win"==i,t.isMac="mac"==i,t.isLinux="linux"==i,t.isIE="Microsoft Internet Explorer"==o||o.indexOf("MSAppHost")>=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,t.isAIR=s.indexOf("AdobeAIR")>=0,t.isAndroid=s.indexOf("Android")>=0,t.isChromeOS=s.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./useragent");if(t.buildDom=function e(t,n,r){if("string"==typeof t&&t){var i=document.createTextNode(t);return n&&n.appendChild(i),i}if(!Array.isArray(t))return t;if("string"!=typeof t[0]||!t[0]){for(var s=[],o=0;o=1.5,"undefined"!=typeof document){var i=document.createElement("div");t.HI_DPI&&void 0!==i.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),r.isEdge||void 0===i.style.animationName||(t.HAS_CSS_ANIMATION=!0),i=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./oop"),i=function(){var e,t,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in n.FUNCTION_KEYS)e=n.FUNCTION_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);for(t in n.PRINTABLE_KEYS)e=n.PRINTABLE_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);return r.mixin(n,n.MODIFIER_KEYS),r.mixin(n,n.PRINTABLE_KEYS),r.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)n.KEY_MODS[t]=e.filter(function(e){return t&n.KEY_MODS[e]}).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();r.mixin(t,i),t.keyCodeToString=function(e){var t=i[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./keys"),i=e("./useragent"),s=null,o=0;t.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var r=function(){n.call(e,window.event)};n._wrapper=r,e.attachEvent("on"+t,r)}},t.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,n,r){function i(e){n&&n(e),r&&r(e),t.removeListener(document,"mousemove",n,!0),t.removeListener(document,"mouseup",i,!0),t.removeListener(document,"dragstart",i,!0)}return t.addListener(document,"mousemove",n,!0),t.addListener(document,"mouseup",i,!0),t.addListener(document,"dragstart",i,!0),i},t.addMouseWheelListener=function(e,n){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),n(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}n(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),n(e)})},t.addMultiMouseDownListener=function(e,n,r,s){var o,a,l,u=0,c={2:"dblclick",3:"tripleclick",4:"quadclick"};function h(e){if(0!==t.getButton(e)?u=0:e.detail>1?++u>4&&(u=1):u=1,i.isIE){var h=Math.abs(e.clientX-o)>5||Math.abs(e.clientY-a)>5;l&&!h||(u=1),l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),1==u&&(o=e.clientX,a=e.clientY)}if(e._clicks=u,r[s]("mousedown",e),u>4)u=0;else if(u>1)return r[s](c[u],e)}function d(e){u=2,l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),r[s]("mousedown",e),r[s](c[u],e)}Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",h),i.isOldIE&&t.addListener(e,"dblclick",d)})};var a=i.isMac&&i.isOpera&&!("KeyboardEvent"in window)?function(e){return(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)}:function(e){return(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};function l(e,t,n){var l=a(t);if(!i.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(l|=8),s.altGr){if(!(3&~l))return;s.altGr=0}if(18===n||17===n){var u="location"in t?t.location:t.keyLocation;17===n&&1===u?1==s[n]&&(o=t.timeStamp):18===n&&3===l&&2===u&&t.timeStamp-o<50&&(s.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),l||13!==n||3!==(u="location"in t?t.location:t.keyLocation)||(e(t,l,-n),!t.defaultPrevented)){if(i.isChromeOS&&8&l){if(e(t,l,n),t.defaultPrevented)return;l&=-9}return!!(l||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&e(t,l,n)}}function u(){s=Object.create(null)}if(t.getModifierString=function(e){return r.KEY_MODS[a(e)]},t.addCommandKeyListener=function(e,n){var r=t.addListener;if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var o=null;r(e,"keydown",function(e){o=e.keyCode}),r(e,"keypress",function(e){return l(n,e,o)})}else{var a=null;r(e,"keydown",function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=l(n,e,e.keyCode);return a=e.defaultPrevented,t}),r(e,"keypress",function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),r(e,"keyup",function(e){s[e.keyCode]=null}),s||(u(),r(window,"focus",u))}},"object"==typeof window&&window.postMessage&&!i.isOldIE){var c=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+c++,i=function(s){s.data==r&&(t.stopPropagation(s),t.removeListener(n,"message",i),e())};t.addListener(n,"message",i),n.postMessage(r,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function n(){t.$idleBlocked?setTimeout(n,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,n=e.end,r=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(r.row,r.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(r.row,r.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else this.end.rowt)var i={row:t+1,column:0};else this.start.row0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;nDate.now()-50)||(r=!1)},cancel:function(){r=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("../lib/dom"),o=e("../lib/lang"),a=e("../clipboard"),l=i.isChrome<18,u=i.isIE,c=i.isChrome>63,h=400,d=e("../lib/keys"),f=d.KEY_MODS,p=i.isIOS,m=p?/\s/:/\n/;t.TextInput=function(e,t){var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild);var g=!1,E=!1,v=!1,C=!1,D="";i.isMobile||(n.style.fontSize="1px");var S=!1,A=!1,_="",y=0,b=0,T=0;try{var R=document.activeElement===n}catch(e){}r.addListener(n,"blur",function(e){A||(t.onBlur(e),R=!1)}),r.addListener(n,"focus",function(e){if(!A){if(R=!0,i.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),i.isEdge?setTimeout(x):x()}}),this.$focusScroll=!1,this.focus=function(){if(D||c||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var t=0!=n.getBoundingClientRect().top}catch(e){return}var r=[];if(t)for(var i=n.parentElement;i&&1==i.nodeType;)r.push(i),i.setAttribute("ace_nocontext",!0),i=!i.parentElement&&i.getRootNode?i.getRootNode().host:i.parentElement;n.focus({preventScroll:!0}),t&&r.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="","0px"==n.style.top&&(n.style.top=e)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return R},t.on("beforeEndOperation",function(){t.curOp&&"insertstring"==t.curOp.command.name||(v&&(_=n.value="",U()),x())});var x=p?function(e){if(R&&(!g||e)&&!C){e||(e="");var r="\n ab"+e+"cde fg\n";r!=n.value&&(n.value=_=r);var i=4+(e.length||(t.selection.isEmpty()?0:1));4==y&&b==i||n.setSelectionRange(4,i),y=4,b=i}}:function(){if(!v&&!C&&(R||F)){v=!0;var e=t.selection,r=e.getRange(),i=e.cursor.row,s=r.start.column,o=r.end.column,a=t.session.getLine(i);if(r.start.row!=i){var l=t.session.getLine(i-1);s=r.start.rowi+1?u.length:o,o+=a.length+1,a=a+"\n"+u}a.length>h&&(s0&&_[h]==e[h];)h++,o--;for(l=l.slice(h),h=1;a>0&&_.length-h>y-1&&_[_.length-h]==e[e.length-h];)h++,a--;u-=h-1,c-=h-1;var d=l.length-h+1;return d<0&&(o=-d,d=0),l=l.slice(0,d),r||l||u||o||a||c?(C=!0,l&&!o&&!a&&!u&&!c||S?t.onTextInput(l):t.onTextInput(l,{extendLeft:o,extendRight:a,restoreStart:u,restoreEnd:c}),C=!1,_=e,y=i,b=s,T=c,l):""},L=function(e){if(v)return B();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var r=n.value,i=N(r,!0);(r.length>500||m.test(i))&&x()},O=function(e,t,n){var r=e.clipboardData||window.clipboardData;if(r&&!l){var i=u||n?"Text":"text/plain";try{return t?!1!==r.setData(i,t):r.getData(i)}catch(e){if(!n)return O(e,t,!0)}}},I=function(e,i){var s=t.getCopyText();if(!s)return r.preventDefault(e);O(e,s)?(p&&(x(s),g=s,setTimeout(function(){g=!1},10)),i?t.onCut():t.onCopy(),r.preventDefault(e)):(g=!0,n.value=s,n.select(),setTimeout(function(){g=!1,x(),i?t.onCut():t.onCopy()}))},k=function(e){I(e,!0)},M=function(e){I(e,!1)},P=function(e){var s=O(e);a.pasteCancelled()||("string"==typeof s?(s&&t.onPaste(s,e),i.isIE&&setTimeout(x),r.preventDefault(e)):(n.value="",E=!0))};r.addCommandKeyListener(n,t.onCommandKey.bind(t)),r.addListener(n,"select",function(e){v||(g?g=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=_.length&&e.value===_&&_&&e.selectionEnd!==b}(n)&&(t.selectAll(),x()))}),r.addListener(n,"input",L),r.addListener(n,"cut",k),r.addListener(n,"copy",M),r.addListener(n,"paste",P),"oncut"in n&&"oncopy"in n&&"onpaste"in n||r.addListener(e,"keydown",function(e){if((!i.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:M(e);break;case 86:P(e);break;case 88:k(e)}});var B=function(){if(v&&t.onCompositionUpdate&&!t.$readOnly){if(S)return $();if(v.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;N(e),v.markerRange&&(v.context&&(v.markerRange.start.column=v.selectionStart=v.context.compositionStartOffset),v.markerRange.end.column=v.markerRange.start.column+b-v.selectionStart+T)}}},U=function(e){t.onCompositionEnd&&!t.$readOnly&&(v=!1,t.onCompositionEnd(),t.off("mousedown",$),e&&L())};function $(){A=!0,n.blur(),n.focus(),A=!1}var G,V=o.delayedCall(B,50).schedule.bind(null,null);function W(){clearTimeout(G),G=setTimeout(function(){D&&(n.style.cssText=D,D=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()},0)}r.addListener(n,"compositionstart",function(e){if(!v&&t.onCompositionStart&&!t.$readOnly&&(v={},!S)){setTimeout(B,0),t.on("mousedown",$);var r=t.getSelectionRange();r.end.row=r.start.row,r.end.column=r.start.column,v.markerRange=r,v.selectionStart=y,t.onCompositionStart(v),v.useTextareaForIME?(n.value="",_="",y=0,b=0):(n.msGetInputContext&&(v.context=n.msGetInputContext()),n.getInputContext&&(v.context=n.getInputContext()))}}),r.addListener(n,"compositionupdate",B),r.addListener(n,"keyup",function(e){27==e.keyCode&&n.value.lengthb&&"\n"==_[s]?o=d.end:rb&&_.slice(0,s).split("\n").length>2?o=d.down:s>b&&" "==_[s-1]?(o=d.right,a=f.option):(s>b||s==b&&b!=y&&r==s)&&(o=d.right),r!==s&&(a|=f.shift),o){if(!t.onCommandKey({},a,o)&&t.commands){o=d.keyCodeToString(o);var l=t.commands.findKeyCommand(a,o);l&&t.execCommand(l)}y=r,b=s,x("")}}};document.addEventListener("selectionchange",s),t.on("destroy",function(){document.removeEventListener("selectionchange",s)})}(0,t,n)}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/useragent");function i(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function s(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)n=2*t.row-e.start.row-e.end.row;else n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,s=e.getButton();return 0!==s?((i.getSelectionRange().isEmpty()||1==s)&&i.selection.moveToPosition(n),void(2==s&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||i.isFocused()||(i.focus(),!this.$focusTimeout||this.$clickSelection||i.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(-1==r)e=this.$clickSelection.end;else if(1==r)e=this.$clickSelection.start;else{var i=s(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(i.start),a=this.$clickSelection.comparePoint(i.end);if(-1==o&&a<=0)t=this.$clickSelection.end,i.end.row==r.row&&i.end.column==r.column||(r=i.start);else if(1==a&&o>=0)t=this.$clickSelection.start,i.start.row==r.row&&i.start.column==r.column||(r=i.end);else if(-1==o&&1==a)r=i.end,t=i.start;else{var l=s(this.$clickSelection,r);r=l.cursor,t=l.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e,t,n,r,i=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,n=this.x,r=this.y,Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))),s=Date.now();(i>0||s-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session.getBracketRange(t);r?(r.isEmpty()&&(r.start.column--,r.end.column++),this.setState("select")):(r=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=r,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,s=i?e.wheelX/i:n.vx,o=i?e.wheelY/i:n.vy;i<550&&(s=(s+n.vx)/2,o=(o+n.vy)/2);var a=Math.abs(s/o),l=!1;return a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?n.allowed=r:r-n.allowed<550&&(Math.abs(s)<=1.5*Math.abs(n.vx)&&Math.abs(o)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=r):n.allowed=0),n.t=r,n.vx=s,n.vy=o,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(i.prototype),t.DefaultHandlers=i}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}(function(){this.$init=function(){return this.$element=r.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){r.addCssClass(this.getElement(),e)},this.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(i.prototype),t.Tooltip=i}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/event"),o=e("../tooltip").Tooltip;function a(e){o.call(this,e)}i.inherits(a,o),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),s=this.getHeight();(e+=15)+i>n&&(e-=e+i-n),(t+=15)+s>r&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=function(e){var t,n,i,o=e.editor,l=o.renderer.$gutterLayer,u=new a(o.container);function c(){t&&(t=clearTimeout(t)),i&&(u.hide(),i=null,o._signal("hideGutterTooltip",u),o.removeEventListener("mousewheel",c))}function h(e){u.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",function(t){if(o.isFocused()&&0==t.getButton()&&"foldWidgets"!=l.getRegion(t)){var n=t.getDocumentPosition().row,r=o.session.selection;if(t.getShiftKey())r.selectTo(n,0);else{if(2==t.domEvent.detail)return o.selectAll(),t.preventDefault();e.$clickSelection=o.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}),e.editor.setDefaultHandler("guttermousemove",function(s){var a=s.domEvent.target||s.domEvent.srcElement;if(r.hasCssClass(a,"ace_fold-widget"))return c();i&&e.$tooltipFollowsMouse&&h(s),n=s,t||(t=setTimeout(function(){t=null,n&&!e.isMousePressed?function(){var t=n.getDocumentPosition().row,r=l.$annotations[t];if(!r)return c();if(t==o.session.getLength()){var s=o.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(s>o.session.documentToScreenRow(a.row,a.column))return c()}if(i!=r)if(i=r.text.join("
"),u.setHtml(i),u.show(),o._signal("showGutterTooltip",u),o.on("mousewheel",c),e.$tooltipFollowsMouse)h(n);else{var d=n.domEvent.target.getBoundingClientRect(),f=u.getElement().style;f.left=d.right+"px",f.top=d.bottom+"px"}}():c()},50))}),s.addListener(o.renderer.$gutter,"mouseout",function(e){n=null,i&&!t&&(t=setTimeout(function(){t=null,c()},50))}),o.on("changeSession",c)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent");function o(e){var t=e.editor,n=r.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),t.addEventListener("mousedown",this.onMouseDown.bind(e));var o,l,u,c,h,d,f,p,m,g,E,v=t.container,C=0;function D(){var e=d;(function(e,n){var r=Date.now(),i=!n||e.row!=n.row,s=!n||e.column!=n.column;!g||i||s?(t.moveCursorToPosition(e),g=r,E={x:l,y:u}):a(E.x,E.y,l,u)>5?g=null:r-g>=200&&(t.renderer.scrollCursorIntoView(),g=null)})(d=t.renderer.screenToTextCoordinates(l,u),e),function(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,s=t.renderer.layerConfig.characterWidth,o=t.renderer.scroller.getBoundingClientRect(),a={x:{left:l-o.left,right:o.right-l},y:{top:u-o.top,bottom:o.bottom-u}},c=Math.min(a.x.left,a.x.right),h=Math.min(a.y.top,a.y.bottom),d={row:e.row,column:e.column};c/s<=2&&(d.column+=a.x.left=200&&t.renderer.scrollCursorIntoView(d):m=r:m=null}(d,e)}function S(){h=t.selection.toOrientedRange(),o=t.session.addMarker(h,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(c),D(),c=setInterval(D,20),C=0,i.addListener(document,"mousemove",y)}function A(){clearInterval(c),t.session.removeMarker(o),o=null,t.selection.fromOrientedRange(h),t.isFocused()&&!p&&t.$resetCursorStyle(),h=null,d=null,C=0,m=null,g=null,i.removeListener(document,"mousemove",y)}this.onDragStart=function(e){if(this.cancelDrag||!v.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}h=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?"copy":"copyMove",s.isOpera&&(t.container.appendChild(n),n.scrollTop=0),i.setDragImage&&i.setDragImage(n,0,0),s.isOpera&&t.container.removeChild(n),i.clearData(),i.setData("Text",t.session.getTextRange()),p=!0,this.setState("drag")},this.onDragEnd=function(e){if(v.draggable=!1,p=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;f||"move"!=n||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||S(),C++,e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||(S(),C++),null!==_&&(_=null),e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragLeave=function(e){if(--C<=0&&o)return A(),f=null,i.preventDefault(e)},this.onDrop=function(e){if(d){var n=e.dataTransfer;if(p)switch(f){case"move":h=h.contains(d.row,d.column)?{start:d,end:d}:t.moveText(h,d);break;case"copy":h=t.moveText(h,d,!0)}else{var r=n.getData("Text");h={start:d,end:t.session.insert(d,r)},t.focus(),f=null}return A(),i.preventDefault(e)}},i.addListener(v,"dragstart",this.onDragStart.bind(e)),i.addListener(v,"dragend",this.onDragEnd.bind(e)),i.addListener(v,"dragenter",this.onDragEnter.bind(e)),i.addListener(v,"dragover",this.onDragOver.bind(e)),i.addListener(v,"dragleave",this.onDragLeave.bind(e)),i.addListener(v,"drop",this.onDrop.bind(e));var _=null;function y(){null==_&&(_=setTimeout(function(){null!=_&&o&&A()},20))}function b(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function T(e){var t=["copy","copymove","all","uninitialized"],n=s.isMac?e.altKey:e.ctrlKey,r="uninitialized";try{r=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var i="none";return n&&t.indexOf(r)>=0?i="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(r)>=0?i="move":t.indexOf(r)>=0&&(i="copy"),i}}function a(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=s.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;s.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton();if(1===(e.domEvent.detail||1)&&0===r&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var i=e.domEvent.target||e.domEvent.srcElement;"unselectable"in i&&(i.unselectable="on"),t.getDragDelay()?(s.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(o.prototype),t.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./mouse_event").MouseEvent,i=e("../lib/dom");t.addTouchListeners=function(e,t){var n,s,o,a,l,u,c,h,d,f="scroll",p=0,m=0,g=0,E=0;function v(){var e,n,r;d||(e=window.navigator&&window.navigator.clipboard,n=!1,r=function(r){var s,o,a=r.target.getAttribute("action");if("more"==a||!n)return n=!n,s=t.getCopyText(),o=t.session.getUndoManager().hasUndo(),void d.replaceChild(i.buildDom(n?["span",!s&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],s&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],s&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],o&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),d.firstChild);"paste"==a?e.readText().then(function(e){t.execCommand(a,e)}):a&&("cut"!=a&&"copy"!=a||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(a)),d.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&t.focus()},d=i.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){f="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),r(e)},onclick:r},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container));var s=t.selection.cursor,o=t.renderer.textToScreenCoordinates(s.row,s.column),a=t.container.getBoundingClientRect();d.style.top=o.pageY-a.top-3+"px",d.style.right="10px",d.style.display="",d.firstChild.style.display="none",t.on("input",C)}function C(e){d&&(d.style.display="none"),t.off("input",C)}function D(){l=null,clearTimeout(l);var e=t.selection.getRange(),n=e.contains(c.row,c.column);!e.isEmpty()&&n||(t.selection.moveToPosition(c),t.selection.selectWord()),f="wait",v()}e.addEventListener("contextmenu",function(e){h&&t.textInput.getElement().focus()}),e.addEventListener("touchstart",function(e){var i=e.touches;if(l||i.length>1)return clearTimeout(l),l=null,o=-1,void(f="zoom");h=t.$mouseHandler.isMousePressed=!0;var u=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,v=e.timeStamp;a=v;var C=i[0],S=C.clientX,A=C.clientY;Math.abs(n-S)+Math.abs(s-A)>u&&(o=-1),n=e.clientX=S,s=e.clientY=A,g=E=0;var _=new r(e,t);if(c=_.getDocumentPosition(),v-o<500&&1==i.length&&!p)m++,e.preventDefault(),e.button=0,function(){l=null,clearTimeout(l),t.selection.moveToPosition(c);var e=m>=2?t.selection.getLineRange(c.row):t.session.getBracketRange(c);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),f="wait"}();else{m=0;var y=t.selection.cursor,b=t.selection.isEmpty()?y:t.selection.anchor,T=t.renderer.$cursorLayer.getPixelPosition(y,!0),R=t.renderer.$cursorLayer.getPixelPosition(b,!0),x=t.renderer.scroller.getBoundingClientRect(),w=function(e,t){return(e/=d)*e+(t=t/u-.75)*t};if(e.clientXN?"cursor":"anchor"),f=N<3.5?"anchor":F<3.5?"cursor":"scroll",l=setTimeout(D,450)}o=v}),e.addEventListener("touchend",function(e){h=t.$mouseHandler.isMousePressed=!1,u&&clearInterval(u),"zoom"==f?(f="",p=0):l?(t.selection.moveToPosition(c),p=0,v()):"scroll"==f?(p+=60,u=setInterval(function(){p--<=0&&(clearInterval(u),u=null),Math.abs(g)<.01&&(g=0),Math.abs(E)<.01&&(E=0),p<20&&(g*=.9),p<20&&(E*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*g,10*E),e==t.session.getScrollTop()&&(p=0)},10),e.preventDefault(),C()):v(),clearTimeout(l),l=null}),e.addEventListener("touchmove",function(e){l&&(clearTimeout(l),l=null);var i=e.touches;if(!(i.length>1||"zoom"==f)){var o=i[0],u=n-o.clientX,c=s-o.clientY;if("wait"==f){if(!(u*u+c*c>4))return e.preventDefault();f="cursor"}n=o.clientX,s=o.clientY,e.clientX=o.clientX,e.clientY=o.clientY;var h=e.timeStamp,d=h-a;if(a=h,"scroll"==f){var p=new r(e,t);p.speed=1,p.wheelX=u,p.wheelY=c,10*Math.abs(u)1&&(i=n[n.length-2]);var o=l[t+"Path"];return null==o?o=l.basePath:"/"==r&&(t=r=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+t+r+i+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,r){var i,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{i=e(n)}catch(e){}if(i&&!t.$loading[n])return r&&r(i);if(t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r),!(t.$loading[n].length>1)){var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var r=t.$loading[n];t.$loading[n]=null,r.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,o),a),u()}};var u=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),u=function(){})};function c(i){if(a&&a.document){l.packaged=i||e.packaged||r.packaged||a.define&&n.amdD.packaged;for(var s={},o="",u=document.currentScript||document._currentScript,c=(u&&u.ownerDocument||document).getElementsByTagName("script"),d=0;d=e){for(s=h+1;s=e;)s++;for(a=h,l=s-1;a=t.length||2!=(l=n[i-1])&&3!=l||2!=(u=t[i+1])&&3!=u?4:(s&&(u=3),u==l?u:4);case 10:return 2==(l=i>0?n[i-1]:5)&&i+10&&2==n[i-1])return 2;if(s)return 4;for(f=i+1,d=t.length;f=1425&&m<=2303||64286==m;if(l=t[f],g&&(1==l||7==l))return 1}return i<1||5==(l=t[i-1])?4:n[i-1];case 5:return s=!1,o=!0,r;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:s=!1;case h:return 4}}function g(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?t>191?0:d[t]:5==n?/[\u0591-\u05f4]/.test(e)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?12:/[\u0660-\u0669\u066b-\u066c]/.test(e)?3:1642==t?c:/[\u06f0-\u06f9]/.test(e)?2:7:32==n&&t<=8287?f[255&t]:254==n&&t>=65136?7:4}t.L=0,t.R=1,t.EN=2,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,n,c){if(e.length<2)return{};var d=e.split(""),f=new Array(d.length),E=new Array(d.length),v=[];r=c?1:0,function(e,t,n,c){var h=r?u:l,d=null,f=null,p=null,E=0,v=null,C=-1,D=null,S=null,A=[];if(!c)for(D=0,c=[];D0)if(16==v){for(D=C;D-1){for(D=C;D=0&&8==c[_];_--)t[_]=r}}(d,v,d.length,n);for(var C=0;C7&&n[C]<13||4===n[C]||n[C]===h)?v[C]=t.ON_R:C>0&&"ل"===d[C-1]&&/\u0622|\u0623|\u0625|\u0627/.test(d[C])&&(v[C-1]=v[C]=t.R_H,C++);for(d[d.length-1]===t.DOT&&(v[d.length-1]=t.B),"‫"===d[0]&&(v[0]=t.RLE),C=0;C=0&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,r=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===r;)r=n,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[e];s&&(void 0===t&&(t=this.getSplitIndex()),t>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&s[i]%2!=0&&i++;for(var a=0;at&&s[i]%2==0&&(o+=this.charWidths[s[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(e,t){var n,r=this.bidiMap,i=r.bidiLevels,s=[],o=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,u=!1,c=!1,h=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,f=0;f=a&&dn+s/2;){if(n+=s,r===i.length-1){s=0;break}s=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!=0&&i[r]%2==0?(e0&&i[r-1]%2==0&&i[r]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&0===s&&i[r-1]%2==0||!this.isRtlDir&&0===r&&i[r]%2!=0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!=0&&0!==s&&r--,t=this.bidiMap.logicalFromVisual[r]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(o.prototype),t.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")})};(function(){r.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},this.$setSelection=function(e,t,n,r){var i=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||s)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n,r="number"==typeof e?e:this.lead.row,i=this.session.getFoldLine(r);return i?(r=i.start.row,n=i.end.row):n=r,!0===t?new o(r,0,n,this.session.getLine(n).length):new o(r,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i)this.moveCursorTo(i.end.row,i.end.column);else{if(this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t)),t>=n.length)return this.moveCursorTo(e,n.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(s)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)}},this.$shortWordEndIndex=function(e){var t,n=0,r=/\s/,i=this.session.tokenRe;if(i.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&r.test(t);)n++;if(n<1)for(i.lastIndex=0;(t=e[n])&&!i.test(t);)if(i.lastIndex=0,n++,r.test(t)){if(n>2){n--;break}for(;(t=e[n])&&r.test(t);)n++;if(n>2)break}}return i.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do{e++,r=this.doc.getLine(e)}while(e0&&/^\s*$/.test(r));n=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(t,n-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n,r=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(r.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(r.column),r.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=r.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?r.column=this.$desiredColumn:this.$desiredColumn=r.column);var i=this.session.screenToDocumentPosition(r.row+e,r.column,n);0!==e&&0===t&&i.row===this.lead.row&&i.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[i.row]&&(i.row>0||e>0)&&i.row++,this.moveCursorTo(i.row,i.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch(e){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,n){"use strict";var r=e("./config"),i=2e3,s=function(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],r=[],i=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",a=[],l=0;l1?this.$applyToken:u.token),h>1&&(/\\\d/.test(u.regex)?c=u.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(h=1,c=this.removeCapturingGroups(u.regex)),u.splitRegex||"string"==typeof u.token||a.push(u)),s[i]=l,i+=h,r.push(c),u.onMatch||(u.onMatch=null)}}r.length||(s[0]=0,r.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){i=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var r=[],i=0,s=n.length;ic){var E=e.substring(c,g-m.length);d.type==f?d.value+=E:(d.type&&u.push(d),d={type:f,value:E})}for(var v=0;vi){for(h>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});c1&&n[0]!==r&&n.unshift("#tmp",r),{tokens:u,state:n.length?n:r}},this.reportError=r.reportError}).call(s.prototype),t.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var n in e){for(var r=e[n],i=0;i=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(void 0!==n)return n;for(n=0;t>0;)n+=e[t-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)}}).call(i.prototype),t.TokenIterator=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r,i=e("../../lib/oop"),s=e("../behaviour").Behaviour,o=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],u=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],c={},h={'"':'"',"'":"'"},d=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,c.rangeCount!=e.multiSelect.rangeCount&&(c={rangeCount:e.multiSelect.rangeCount})),c[t])return r=c[t];r=c[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},f=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},p=function(e){this.add("braces","insertion",function(t,n,i,s,o){var l=i.getCursorPosition(),u=s.doc.getLine(l.row);if("{"==o){d(i);var c=i.getSelectionRange(),h=s.doc.getTextRange(c);if(""!==h&&"{"!==h&&i.getWrapBehavioursEnabled())return f(c,h,"{","}");if(p.isSaneInsertion(i,s))return/[\]\}\)]/.test(u[l.column])||i.inMultiSelectMode||e&&e.braces?(p.recordAutoInsert(i,s,"}"),{text:"{}",selection:[1,1]}):(p.recordMaybeInsert(i,s,"{"),{text:"{",selection:[1,1]})}else if("}"==o){if(d(i),"}"==u.substring(l.column,l.column+1)&&null!==s.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&p.isAutoInsertedClosing(l,u,o))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==o||"\r\n"==o){d(i);var m="";if(p.isMaybeInsertedClosing(l,u)&&(m=a.stringRepeat("}",r.maybeInsertedBrackets),p.clearMaybeInsertedClosing()),"}"===u.substring(l.column,l.column+1)){var g=s.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!g)return null;var E=this.$getIndent(s.getLine(g.row))}else{if(!m)return void p.clearMaybeInsertedClosing();E=this.$getIndent(u)}var v=E+s.getTabString();return{text:"\n"+v+"\n"+E+m,selection:[1,v.length,1,v.length]}}p.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,i,s){var o=i.doc.getTextRange(s);if(!s.isMultiLine()&&"{"==o){if(d(n),"}"==i.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s;r.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if("("==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"(",")");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(")"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"("==s&&(d(n),")"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("brackets","insertion",function(e,t,n,r,i){if("["==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"[","]");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if("]"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"["==s&&(d(n),"]"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("string_dquotes","insertion",function(e,t,n,r,i){var s=r.$mode.$quotes||h;if(1==i.length&&s[i]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(i))return;d(n);var o=i,a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(!(""===l||1==l.length&&s[l])&&n.getWrapBehavioursEnabled())return f(a,l,o,o);if(!l){var u=n.getCursorPosition(),c=r.doc.getLine(u.row),p=c.substring(u.column-1,u.column),m=c.substring(u.column,u.column+1),g=r.getTokenAt(u.row,u.column),E=r.getTokenAt(u.row,u.column+1);if("\\"==p&&g&&/escape/.test(g.type))return null;var v,C=g&&/string|escape/.test(g.type),D=!E||/string|escape/.test(E.type);if(m==o)(v=C!==D)&&/string\.end/.test(E.type)&&(v=!1);else{if(C&&!D)return null;if(C&&D)return null;var S=r.$mode.tokenRe;S.lastIndex=0;var A=S.test(p);S.lastIndex=0;var _=S.test(p);if(A||_)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;var y=c[u.column-2];if(p==o&&(y==o||S.test(y)))return null;v=!0}return{text:v?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.$mode.$quotes||h,o=r.doc.getTextRange(i);if(!i.isMultiLine()&&s.hasOwnProperty(o)&&(d(n),r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==o))return i.end.column++,i})};p.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new o(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",l)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var i=new o(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",l))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",u)},p.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},p.recordAutoInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isAutoInsertedClosing(i,s,r.autoInsertedLineEnd[0])||(r.autoInsertedBrackets=0),r.autoInsertedRow=i.row,r.autoInsertedLineEnd=n+s.substr(i.column),r.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isMaybeInsertedClosing(i,s)||(r.maybeInsertedBrackets=0),r.maybeInsertedRow=i.row,r.maybeInsertedLineStart=s.substr(0,i.column)+n,r.maybeInsertedLineEnd=s.substr(i.column),r.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return r.autoInsertedBrackets>0&&e.row===r.autoInsertedRow&&n===r.autoInsertedLineEnd[0]&&t.substr(e.column)===r.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return r.maybeInsertedBrackets>0&&e.row===r.maybeInsertedRow&&t.substr(e.column)===r.maybeInsertedLineEnd&&t.substr(0,e.column)==r.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){r.autoInsertedLineEnd=r.autoInsertedLineEnd.substr(1),r.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){r&&(r.maybeInsertedBrackets=0,r.maybeInsertedRow=-1)},i.inherits(p,s),t.CstyleBehaviour=p}),ace.define("ace/unicode",["require","exports","module"],function(e,t,n){"use strict";for(var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,s=[],o=0;o2?r%u!=u-1:r%u==0})}else{if(!this.blockComment)return!1;var f=this.blockComment.start,p=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+l.escapeRegExp(f)+")"),g=new RegExp("(?:"+l.escapeRegExp(p)+")\\s*$"),E=function(e,t){C(e,t)||s&&!/\S/.test(e)||(i.insertInLine({row:t,column:e.length},p),i.insertInLine({row:t,column:a},f))},v=function(e,t){var n;(n=e.match(g))&&i.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(m))&&i.removeInLine(t,n[1].length,n[0].length)},C=function(e,n){if(m.test(e))return!0;for(var r=t.getTokens(n),i=0;ie.length&&(S=e.length)}),a==1/0&&(a=S,s=!1,o=!1),c&&a%u!=0&&(a=Math.floor(a/u)*u),D(o?v:E)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(i){!i.start&&i[0]&&(i=i[0]);var s,o,a=(m=new u(t,r.row,r.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var h,d;a&&/comment/.test(a.type);){if(-1!=(g=a.value.indexOf(i.start))){var f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g;h=new c(f,p,f,p+i.start.length);break}a=m.stepBackward()}var m;for(a=(m=new u(t,r.row,r.column)).getCurrentToken();a&&/comment/.test(a.type);){var g;if(-1!=(g=a.value.indexOf(i.end))){f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g,d=new c(f,p,f,p+i.end.length);break}a=m.stepForward()}d&&t.remove(d),h&&(t.remove(h),s=h.start.row,o=-i.start.length)}else o=i.start.length,s=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);l.start.row==s&&(l.start.column+=o),l.end.row==s&&(l.end.column+=o),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var n=e[t],i=n.prototype.$id,s=r.$modes[i];s||(r.$modes[i]=s=new n),r.$modes[t]||(r.$modes[t]=s),this.$embeds.push(t),this.$modes[t]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;tthis.row)){var n=function(t,n,r){var i="insert"==t.action,s=(i?1:-1)*(t.end.row-t.start.row),o=(i?1:-1)*(t.end.column-t.start.column),a=t.start,l=i?a:t.end;return e(n,a,r)?{row:n.row,column:n.column}:e(l,n,!r)?{row:n.row+s,column:n.column+(n.row==l.row?o:0)}:{row:a.row,column:a.column}}(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(e,t,n){var r;if(r=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=r.row||this.column!=r.column){var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=e("./anchor").Anchor,l=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new a(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();void 0===e?e=n:e<0?e=0:e>=n&&(e=n-1,t=void 0);var r=this.getLine(e);return null==t&&(t=r.length),{row:e,column:t=Math.min(Math.max(t,0),r.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof o||(e=o.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,r=n.length-t+1,i=e.start.row,s=e.start.column,o=0,a=0;o20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,-1==r&&(r=t),s<=r&&n.fireUpdateEvent(s,r)}}};(function(){r.implement(this,i),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens}}).call(s.prototype),t.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=(e("./lib/oop"),e("./range").Range),s=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,n,s){if(this.regExp)for(var o=s.firstRow,a=s.lastRow,l=o;l<=a;l++){var u=this.cache[l];null==u&&((u=r.getMatchOffsets(n.getLine(l),this.regExp)).length>this.MAX_RANGES&&(u=u.slice(0,this.MAX_RANGES)),u=u.map(function(e){return new i(l,e.offset,l,e.offset+e.length)}),this.cache[l]=u.length?u:"");for(var c=u.length;c--;)t.drawSingleLineMarker(e,u[c].toScreenRange(n),this.clazz,s)}}}).call(s.prototype),t.SearchHighlight=s}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range;function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var r,i,s=0,o=this.folds,a=!0;null==t&&(t=this.end.row,n=this.end.column);for(var l=0;l0)){var l=r(e,o.start);return 0===a?t&&0!==l?-s-2:s:l>0||0===l&&!t?s:-s-1}}return-s-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},this.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],n=this.ranges,i=(n=n.sort(function(e,t){return r(e.start,t.start)}))[0],s=1;s=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=r);o++);if("insert"==e.action){for(var l=i-r,u=-t.column+n.column;or);o++)if(c.start.row==r&&c.start.column>=t.column&&(c.start.column==t.column&&this.$bias<=0||(c.start.column+=u,c.start.row+=l)),c.end.row==r&&c.end.column>=t.column){if(c.end.column==t.column&&this.$bias<0)continue;c.end.column==t.column&&u>0&&oc.start.column&&c.end.column==s[o+1].start.column&&(c.end.column-=u),c.end.column+=u,c.end.row+=l}}else for(l=r-i,u=t.column-n.column;oi);o++)c.end.rowt.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=u,c.end.row+=l):c.end.row>i&&(c.end.row+=l),c.start.rowt.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=u,c.start.row+=l):c.start.row>i&&(c.start.row+=l);if(0!=l&&o=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;for(t&&(r=n.indexOf(t)),-1==r&&(r=0);r=e)return i}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,r=t-e+1,i=0;i=t){a=e?r-=t-a:r=0);break}o>=e&&(r-=a>=e?o-a:o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n,r=this.$foldData,o=!1;e instanceof s?n=e:(n=new s(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,u=n.end.row,c=n.end.column,h=this.getFoldAt(a,l,1),d=this.getFoldAt(u,c,-1);if(h&&d==h)return h.addSubFold(n);h&&!h.range.isStart(a,l)&&this.removeFold(h),d&&!d.range.isEnd(u,c)&&this.removeFold(d);var f=this.getFoldsInRange(n.range);f.length>0&&(this.removeFolds(f),f.forEach(function(e){n.addSubFold(e)}));for(var p=0;p0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;if(null==e?(n=new r(0,0,this.getLength(),0),t=!0):n="number"==typeof e?new r(e,0,e,this.getLine(e).length):"row"in e?r.fromPoints(e,e):e,i=this.getFoldsInRangeList(n),t)this.removeFolds(i);else for(var s=i;s.length;)this.expandFolds(s),s=this.getFoldsInRangeList(n);if(i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){null==r&&(r=e.start.row),null==i&&(i=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var s=this.doc,o="";return e.walk(function(e,t,n,a){if(!(tc)break}while(s&&l.test(s.type));s=i.stepBackward()}else s=i.getCurrentToken();return u.end.row=i.getCurrentTokenRow(),u.end.column=i.getCurrentTokenColumn()+s.value.length-2,u}},this.foldAll=function(e,t,n){null==n&&(n=1e5);var r=this.foldWidgets;if(r){t=t||this.getLength();for(var i=e=e||0;i=e){i=s.end.row;try{var o=this.addFold("...",s);o&&(o.collapseChildren=n)}catch(e){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};for(var r,i=e-1;i>=0;){var s=n[i];if(null==s&&(s=n[i]=this.getFoldWidget(i)),"start"==s){var o=this.getFoldWidgetRange(i);if(r||(r=o),o&&o.end.row>=e)break}i--}return{range:-1!==i&&o,firstRange:r}},this.onFoldWidgetClick=function(e,t){var n={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var r=t.target||t.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),r=this.getLine(e),i="end"===n?-1:1,s=this.getFoldAt(e,-1===i?0:r.length,i);if(s)return t.children||t.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()&&(s=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(s.range))return this.removeFold(s),s;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,u=a.range.end.row;this.foldAll(l,u,t.all?1e4:0)}else t.children?(u=o?o.end.row:this.getLength(),this.foldAll(e+1,u,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var r=this.getParentFoldRangeData(t,!0);if(n=r.range||r.firstRange){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold("...",n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){"use strict";var r=e("../token_iterator").TokenIterator,i=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(""==n)return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t,n=this.getLine(e.row),r=!0,s=n.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(o||(s=n.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),r=!1),!o)return null;if(o[1]){if(!(a=this.$findClosingBracket(o[1],e)))return null;t=i.fromPoints(e,a),r||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a;if(!(a=this.$findOpeningBracket(o[2],e)))return null;t=i.fromPoints(a,e),r||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn()-2,u=a.value;;){for(;l>=0;){var c=u.charAt(l);if(c==i){if(0==(s-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else c==e&&(s+=1);l-=1}do{a=o.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(u=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn();;){for(var u=a.value,c=u.length;ln&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>1,s=e[i];if(t>s)n=i+1;else{if(!(t=t);s++);return(n=r[s])?(n.index=s,n.start=i-n.value.length,n):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe)),r)var i=this.tokenRe;else i=/^\s+$/.test(n.slice(t-1,t+1))?/\s/:this.nonTokenRe;var s=t;if(s>0){do{s--}while(s>=0&&n.charAt(s).match(i));s++}for(var o=t;oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,s=this.$foldData[i],o=s?s.start.row:1/0,a=t.length,l=0;lo){if((l=s.end.row+1)>=a)break;o=(s=this.$foldData[i++])?s.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>r&&(r=n[l])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var r=e[n];"insert"==r.action||"remove"==r.action?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;ne.end.column&&(s.start.column+=u),s.end.row==e.end.row&&s.end.column>e.end.column&&(s.end.column+=u)),o&&s.start.row>=e.end.row&&(s.start.row+=o,s.end.row+=o)}if(s.end=this.insert(s.start,r),i.length){var a=e.start,l=s.start,u=(o=l.row-a.row,l.column-a.column);this.addFolds(i.map(function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=u),e.end.row==a.row&&(e.end.column+=u),e.start.row+=o,e.end.row+=o,e}))}return s},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},this.outdentRows=function(e){for(var t=e.collapseRows(),n=new c(0,0,0,0),r=this.getTabSize(),i=t.start.row;i<=t.end.row;++i){var s=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o0){var i;if((i=this.getRowFoldEnd(t+n))>this.doc.getLength()-1)return 0;r=i-t}else e=this.$clipRowToDocument(e),r=(t=this.$clipRowToDocument(t))-e+1;var s=new c(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(e){return(e=e.clone()).start.row+=r,e.end.row+=r,e}),a=0==n?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+r,a),o.length&&this.addFolds(o),r},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1&&(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,i=e.end,s=r.row,o=i.row,a=o-s,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[t?"$wrapData":"$rowLengthCache"].splice(s,a);var u=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var c=0;if(m=this.getFoldLine(i.row)){m.addRemoveChars(i.row,i.column,r.column-i.column),m.shiftRow(-a);var h=this.getFoldLine(s);h&&h!==m&&(h.merge(m),m=h),c=u.indexOf(m)+1}for(;c=i.row&&m.shiftRow(-a);o=s}else{var d=Array(a);d.unshift(s,0);var f=t?this.$wrapData:this.$rowLengthCache;if(f.splice.apply(f,d),u=this.$foldData,c=0,m=this.getFoldLine(s)){var p=m.range.compareInside(r.row,r.column);0==p?(m=m.split(r.row,r.column))&&(m.shiftRow(a),m.addRemoveChars(o,0,i.column-r.column)):-1==p&&(m.addRemoveChars(s,0,i.column-r.column),m.shiftRow(a)),c=u.indexOf(m)+1}for(;c=s&&m.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===n&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(m=this.getFoldLine(s))&&m.addRemoveChars(s,r.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),l},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(n,r){var i,s,o=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,u=this.$wrapLimit,c=n;for(r=Math.min(r,o.length-1);c<=r;)(s=this.getFoldLine(c,s))?(i=[],s.walk(function(n,r,s,a){var l;if(null!=n){(l=this.$getDisplayTokens(n,i.length))[0]=e;for(var u=1;u=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}this.$computeWrapSplits=function(n,r,i){if(0==n.length)return[];var s=[],o=n.length,a=0,l=0,u=this.$wrapAsCode,c=this.$indentedSoftWrap,h=r<=Math.max(2*i,8)||!1===c?0:Math.floor(r/2);function d(e){for(var t=e-a,r=a;rr-f;){var p=a+r-f;if(n[p-1]>=10&&n[p]>=10)d(p);else if(n[p]!=e&&n[p]!=t){for(var m=Math.max(p-(r-(r>>2)),a-1);p>m&&n[p]m&&n[p]m&&9==n[p];)p--}else for(;p>m&&n[p]<10;)p--;p>m?d(++p):(2==n[p=a+r]&&p--,d(p-f))}else{for(;p!=a-1&&n[p]!=e;p--);if(p>a){d(p);continue}for(p=a+r;p39&&o<48||o>57&&o<64?i.push(9):o>=4352&&n(o)?i.push(1,2):i.push(1)}return i},this.$getStringScreenWidth=function(e,t,r){if(0==t)return[0,0];var i,s;for(null==t&&(t=1/0),r=r||0,s=0;s=4352&&n(i)?r+=2:r+=1,!(r>t));s++);return[r,s]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0){a=u[c],s=this.$docRowCache[c];var d=e>u[h-1]}else d=!h;for(var f=this.getLength()-1,p=this.getNextFoldLine(s),m=p?p.start.row:1/0;a<=e&&!(a+(l=this.getRowLength(s))>e||s>=f);)a+=l,++s>m&&(s=p.end.row+1,m=(p=this.getNextFoldLine(s,p))?p.start.row:1/0),d&&(this.$docRowCache.push(s),this.$screenRowCache.push(a));if(p&&p.start.row<=s)r=this.getFoldDisplayLine(p),s=p.start.row;else{if(a+l<=e||s>f)return{row:f,column:this.getLine(f).length};r=this.getLine(s),p=null}var g=0,E=Math.floor(e-a);if(this.$useWrapMode){var v=this.$wrapData[s];v&&(i=v[E],E>0&&v.length&&(g=v.indent,o=v[E-1]||v[v.length-1],r=r.substring(o)))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+E,s,E)&&(t=this.$bidiHandler.offsetToCol(n)),o+=this.$getStringScreenWidth(r,t-g)[1],this.$useWrapMode&&o>=i&&(o=i-1),p?p.idxToPosition(o):{row:s,column:o}},this.documentToScreenPosition=function(e,t){if(void 0===t)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r,i=0,s=null;(r=this.getFoldAt(e,t,1))&&(e=r.start.row,t=r.start.column);var o,a=0,l=this.$docRowCache,u=this.$getRowCacheIndex(l,e),c=l.length;if(c&&u>=0){a=l[u],i=this.$screenRowCache[u];var h=e>l[c-1]}else h=!c;for(var d=this.getNextFoldLine(a),f=d?d.start.row:1/0;a=f){if((o=d.end.row+1)>e)break;f=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;i+=this.getRowLength(a),a=o,h&&(this.$docRowCache.push(a),this.$screenRowCache.push(i))}var p="";d&&a>=f?(p=this.getFoldDisplayLine(d,e,t),s=d.start.row):(p=this.getLine(e).substring(0,t),s=e);var m=0;if(this.$useWrapMode){var g=this.$wrapData[s];if(g){for(var E=0;p.length>=g[E];)i++,E++;p=p.substring(g[E-1]||0,p.length),m=E>0?g.indent:0}}return{row:i,column:m+this.$getStringScreenWidth(p)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,r=0,i=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);ri&&(r=t.end.row+1,i=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var o=this.$foldData,a=0;an);s++);return[r,s]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=n}.call(p.prototype),e("./edit_session/folding").Folding.call(p.prototype),e("./edit_session/bracket_match").BracketMatch.call(p.prototype),o.defineOptions(p.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=p}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(){this.$options={}};(function(){this.set=function(e){return i.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i,o){return r=new s(e,n,i,o),!(n==o&&t.start&&t.start.start&&0!=t.skipCurrent&&r.isEqual(t.start)&&(r=null,1))}),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],a=t.re;if(t.$isMultiLine){var l,u=a.length,c=i.length-u;e:for(var h=a.offset||0;h<=c;h++){for(var d=0;dm||(o.push(l=new s(h,m,h+u-1,g)),u>2&&(h=h+u-2))}}else for(var E=0;ES&&o[d].end.row==n.end.row;)d--;for(o=o.slice(E,d+1),E=0,d=o.length;E=a;n--)if(h(n,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(n=l,a=o.row;n>=a;n--)if(h(n,Number.MAX_VALUE,e))return}};else u=function(e){var n=o.row;if(!h(n,o.column,e)){for(n+=1;n<=l;n++)if(h(n,0,e))return;if(0!=t.wrap)for(n=a,l=o.row;n<=l;n++)if(h(n,0,e))return}};if(t.$isMultiLine)var c=n.length,h=function(t,i,s){var o=r?t-c+1:t;if(!(o<0)){var a=e.getLine(o),l=a.search(n[0]);if(!(!r&&li))return!!s(o,l,o+c-1,h)||void 0}}};else h=r?function(t,r,i){var s,o=e.getLine(t),a=[],l=0;for(n.lastIndex=0;s=n.exec(o);){var u=s[0].length;if(l=s.index,!u){if(l>=o.length)break;n.lastIndex=l+=1}if(s.index+u>r)break;a.push(s.index,u)}for(var c=a.length-1;c>=0;c-=2){var h=a[c-1];if(i(t,h,t,h+(u=a[c])))return!0}}:function(t,r,i){var s,o,a=e.getLine(t);for(n.lastIndex=r;o=n.exec(a);){var l=o[0].length;if(i(t,s=o.index,t,s+l))return!0;if(!l&&(n.lastIndex=s+=1,s>=a.length))return!1}};return{forEach:u}}}).call(o.prototype),t.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/keys"),i=e("../lib/useragent"),s=r.KEY_MODS;function o(e,t){this.platform=t||(i.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function a(e,t){o.call(this,e,t),this.$singleCommand=!1}a.prototype=o.prototype,function(){function e(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var n=e&&("string"==typeof e?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var s=r[i];if(s==e)delete r[i];else if(Array.isArray(s)){var o=s.indexOf(e);-1!=o&&(s.splice(o,1),1==s.length&&(r[i]=s[0]))}}},this.bindKey=function(e,t,n){if("object"==typeof e&&e&&(null==n&&(n=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach(function(e){var r="";if(-1!=e.indexOf(" ")){var i=e.split(/\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=s[t.hashId]+t.key;r+=(r?" ":"")+n,this._addCommandToBinding(r,"chainKeys")},this),r+=" "}var o=this.parseKeys(e),a=s[o.hashId]+o.key;this._addCommandToBinding(r+a,t,n)},this)},this._addCommandToBinding=function(t,n,r){var i,s=this.commandKeyBinding;if(n)if(!s[t]||this.$singleCommand)s[t]=n;else{Array.isArray(s[t])?-1!=(i=s[t].indexOf(n))&&s[t].splice(i,1):s[t]=[s[t]],"number"!=typeof r&&(r=e(n));var o=s[t];for(i=0;ir);i++);o.splice(i,0,n)}else delete s[t]},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(n){if("string"==typeof n)return this.bindKey(n,t);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=t),this.addCommand(n))}},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),i=r[n];if(r.FUNCTION_KEYS[i])n=r.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:n.toUpperCase(),hashId:-1}}for(var s=0,o=t.length;o--;){var a=r.KEY_MODS[t[o]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[o]+" in "+e),!1;s|=a}return{key:n,hashId:s}},this.findKeyCommand=function(e,t){var n=s[e]+t;return this.commandKeyBinding[n]},this.handleKeyboard=function(e,t,n,r){if(!(r<0)){var i=s[t]+n,o=this.commandKeyBinding[i];return e.$keyChain&&(e.$keyChain+=" "+i,o=this.commandKeyBinding[e.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(e.$keyChain&&(t&&4!=t||1!=n.length?(-1==t||r>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-i.length-1)),{command:o}):(e.$keyChain=e.$keyChain||i,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(o.prototype),t.HashHandler=o,t.MultiHashHandler=a}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){i.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};r.inherits(o,i),function(){r.implement(this,s),this.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var i={editor:t,command:e,args:n};return i.returnValue=this._emit("exec",i),this._signal("afterExec",i),!1!==i.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map(function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=e("../config"),s=e("../range").Range;function o(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(e){i.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,a=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(n.row),u=n.row+1;u<=i.row+1;u++){var c=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(u)));0!==c.length&&(c=" "+c),l+=c}i.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;o=i.lastRow||r.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var i=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&-1!==n.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var n=this;E.loadModule(["keybinding",e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||i.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=t.findMatchingBracket(e.getCursorPosition());if(n)var r=new f(n.row,n.column,n.row,n.column+1);else t.$mode.getMatching&&(r=t.$mode.getMatching(e.session));r&&(t.$bracketHighlight=t.addMarker(r,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=e.getCursorPosition(),r=new v(e.session,n.row,n.column),i=r.getCurrentToken();if(!i||!/\b(?:tag-open|tag-name)/.test(i.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1==i.type.indexOf("tag-open")||(i=r.stepForward())){var s=i.value,o=0,a=r.stepBackward();if("<"==a.value)do{a=i,(i=r.stepForward())&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"=0);else{do{i=a,a=r.stepBackward(),i&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var n=new f(e.row,e.column,e.row,1/0);n.id=t.addMarker(n,"ace_active-line","screenLine"),t.$highlightLineMarker=n}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var n=t.start.column,r=t.end.column,i=e.getLine(t.start.row),s=i.substring(n,r);if(!(s.length>5e3)&&/[\w\d]/.test(s)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),a=i.substring(n-1,r+1);if(o.test(a))return o}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var r=this.selection.getAllRanges(),i=0;ia.search(/\S|$/)){var l=a.substr(i.column).search(/\S|$/);n.doc.removeInLine(i.row,i.column,i.column+l)}}this.clearSelection();var u=i.column,c=n.getState(i.row),h=(a=n.getLine(i.row),r.checkOutdent(c,a,e));if(n.insert(i,e),s&&s.selection&&(2==s.selection.length?this.selection.setSelectionRange(new f(i.row,u+s.selection[0],i.row,u+s.selection[1])):this.selection.setSelectionRange(new f(i.row+s.selection[0],s.selection[1],i.row+s.selection[2],s.selection[3]))),n.getDocument().isNewLine(e)){var d=r.getNextLineIndent(c,a.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},d)}h&&r.autoOutdent(c,n,i.row)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(e,t){var n;(t.extendLeft||t.extendRight)&&((n=this.selection.getRange()).start.column-=t.extendLeft,n.end.column+=t.extendRight,this.selection.setRange(n),e||n.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((n=this.selection.getRange()).start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,"deletion",this,n,t);if(0===t.end.column){var s=n.getTextRange(t);if("\n"==s[s.length-1]){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var n,r,i=this.session.getLine(e.row);tt.toLowerCase()?1:0});var i=new f(0,0,0,0);for(r=e.first;r<=e.last;r++){var s=t.getLine(r);i.start.row=r,i.end.row=r,i.end.column=s.length,t.replace(i,n[r-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var r=this.session.getLine(e);n.lastIndex=t)return{value:i[0],start:i.index,end:i.index+i[0].length}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new f(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var s=this.getNumberAt(t,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,a=s.start+s.value.length-o,l=parseFloat(s.value);l*=Math.pow(10,a),o!==s.end&&n=a&&o<=l&&(n=t,u.selection.clearSelection(),u.moveCursorTo(e,a+r),u.selection.selectTo(e,l+r)),a=l});for(var c,h=this.$toggleWordPairs,d=0;df+1)break;f=p.last}for(c--,a=this.session.$moveLines(d,f,t?0:e),t&&-1==e&&(h=c+1);h<=c;)o[h].moveBy(a,0),h++;t||(a=0),l+=a}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);!0===t?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):!1===t&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,i*r.lineHeight),null!=t&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new v(this.session,n.row,n.column),i=r.getCurrentToken(),s=i||r.stepForward();if(s){var o,a,l=!1,u={},c=n.column-s.start,h={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;c=0;--s)this.$tryReplace(n[s],e)&&r++;return this.selection.setSelectionRange(i),r},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return null!==(t=this.$search.replace(n,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&r.mixin(t,e);var i=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(i)||this.$search.$options.needle)||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var s=this.$search.find(this.session);return t.preventScroll?s:s?(this.revealRange(s,n),s):(t.backwards?i.start=i.end:i.end=i.start,void this.selection.setRange(i))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(e){var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var s=this.on("changeSelection",function(){r=!0}),o=this.renderer.on("beforeRender",function(){r&&(t=n.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,s=e.$cursorLayer.$pixelPos,o=e.layerConfig,a=s.top-o.offset;null!=(r=s.top>=0&&a+t.top<0||!(s.topwindow.innerHeight)&&null)&&(i.style.top=a+"px",i.style.left=s.left+"px",i.style.height=o.lineHeight+"px",i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",o))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,i.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},this.prompt=function(e,t,n){var r=this;E.loadModule("./ext/prompt",function(i){i.prompt(r,e,t,n)})}}.call(D.prototype),E.defineOptions(D.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?S.attach(this):S.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?S.attach(this):S.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.renderer.$composition||this.getValue();if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),i.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!e&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),i.addCssClass(this.container,"ace_hasPlaceholder");var t=i.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var S={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=D}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,n){this.$fromUndo||e!=this.$lastDelta&&(!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,r=n.length;r--;){var i=n[r][0];if(i.id<=e)break;i.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?a(e):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(r.prototype);var i=e("./range").Range,s=i.comparePoints;function o(e){return{row:e.row,column:e.column}}function a(e){if(e=e||this,Array.isArray(e))return e.map(a).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function u(e,t){var n="insert"==e.action,r="insert"==t.action;if(n&&r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}else if(!n&&r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(!n&&!r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}return[t,e]}function c(e,t){for(var n=e.length;n--;)for(var r=0;r=0?d(e,t,-1):(s(e.start,t.start)<=0||d(e,i.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!n&&r)s(t.start,e.end)>=0?d(t,e,-1):(s(t.start,e.start)<=0||d(t,i.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{var o,a;if(!(s(t.end,e.start)<=0))return s(e.start,t.start)<0&&(o=e,e=p(e,t.start)),s(e.end,t.end)>0&&(a=p(e,t.end)),f(t.end,e.start,e.end,-1),a&&!o&&(e.lines=a.lines,e.start=a.start,e.end=a.end,a=e),[t,o,a].filter(Boolean);d(e,t,-1)}return[t,e]}function d(e,t,n){f(e.start,t.start,t.end,n),f(e.end,t.start,t.end,n)}function f(e,t,n,r){e.row==(1==r?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function p(e,t){var n=e.lines,r=e.end;e.end=o(t);var i=e.end.row-e.start.row,s=n.splice(i,n.length),a=i?t.column:t.column-e.start.column;return n.push(s[0].substring(0,a)),s[0]=s[0].substr(a),{start:o(t),end:r,lines:s,action:e.action}}function m(e,t){t=function(e){return{start:o(e.start),end:o(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var n=e.length;n--;){for(var r=e[n],i=0;is&&(l=i.end.row+1,s=(i=t.getNextFoldLine(l,i))?i.start.row:1/0),l>r){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,e,this.session,u),this.$lines.push(o)),this.$renderCell(o,e,i,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,i=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(i=t.getLength()+r-1);var s=n?n.getWidth(t,i,e):i.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();(s+=o.left+o.right)===this.gutterWidth||isNaN(s)||(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(r.row>this.$cursorRow){var i=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&i&&i.start.row==t[n-1].row))break;r=t[n-1]}r.element.className="ace_gutter-active-line "+r.element.className,this.$cursorCell=r;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;if(this.oldLastRow=n,!t||r0;i--)this.$lines.shift();if(r>n)for(i=this.session.getFoldedRowCount(n+1,r);i>0;i--)this.$lines.pop();e.firstRowr&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,n){for(var r=[],i=t,s=this.session.getNextFoldLine(i),o=s?s.start.row:1/0;i>o&&(i=s.end.row+1,o=(s=this.session.getNextFoldLine(i,s))?s.start.row:1/0),!(i>n);){var a=this.$lines.createCell(i,e,this.session,u);this.$renderCell(a,e,s,i),r.push(a),i++}return r},this.$renderCell=function(e,t,n,i){var s=e.element,o=this.session,a=s.childNodes[0],l=s.childNodes[1],u=o.$firstLineNumber,c=o.$breakpoints,h=o.$decorations,d=o.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&o.foldWidgets,p=n?n.start.row:Number.MAX_VALUE,m="ace_gutter-cell ";if(this.$highlightGutterLine&&(i==this.$cursorRow||n&&i=p&&this.$cursorRow<=n.end.row)&&(m+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),c[i]&&(m+=c[i]),h[i]&&(m+=h[i]),this.$annotations[i]&&(m+=this.$annotations[i].className),s.className!=m&&(s.className=m),f){var g=f[i];null==g&&(g=f[i]=o.getFoldWidget(i))}if(g){m="ace_fold-widget ace_"+g,"start"==g&&i==p&&in.right-t.right?"foldWidgets":void 0}}).call(l.prototype),t.Gutter=l}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/dom"),s=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){function e(e,t,n,r){return(e?1:0)|(t?2:0)|(n?4:0)|(r?8:0)}this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},this.update=function(e){if(e){var t;for(var n in this.config=e,this.i=0,this.markers){var r=this.markers[n];if(r.range){var i=r.range.clipRows(e.firstRow,e.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),r.renderer){var s=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,s,e)}else"fullLine"==r.type?this.drawFullLineMarker(t,i,r.clazz,e):"screenLine"==r.type?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?"text"==r.type?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+" ace_start ace_br15",e)}else r.update(t,this,this.session,e)}if(-1!=this.i)for(;this.if,c==u),s,c==u?0:1,o)},this.drawMultiLineMarker=function(e,t,n,r,i){var s=this.$padding,o=r.lineHeight,a=this.$getTop(t.start.row,r),l=s+t.start.column*r.characterWidth;if(i=i||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((u=t.clone()).end.row=u.start.row,u.end.column=this.session.getLine(u.start.row).length,this.drawBidiSingleLineMarker(e,u,n+" ace_br1 ace_start",r,null,i)):this.elt(n+" ace_br1 ace_start","height:"+o+"px;right:0;top:"+a+"px;left:"+l+"px;"+(i||"")),this.session.$bidiHandler.isBidiRow(t.end.row)){var u;(u=t.clone()).start.row=u.end.row,u.start.column=0,this.drawBidiSingleLineMarker(e,u,n+" ace_br12",r,null,i)}else{a=this.$getTop(t.end.row,r);var c=t.end.column*r.characterWidth;this.elt(n+" ace_br12","height:"+o+"px;width:"+c+"px;top:"+a+"px;left:"+s+"px;"+(i||""))}if(!((o=(t.end.row-t.start.row-1)*r.lineHeight)<=0)){a=this.$getTop(t.start.row+1,r);var h=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+o+"px;right:0;top:"+a+"px;left:"+s+"px;"+(i||""))}},this.drawSingleLineMarker=function(e,t,n,r,i,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,i,s);var o=r.lineHeight,a=(t.end.column+(i||0)-t.start.column)*r.characterWidth,l=this.$getTop(t.start.row,r),u=this.$padding+t.start.column*r.characterWidth;this.elt(n,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+u+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(e,t,n,r,i,s){var o=r.lineHeight,a=this.$getTop(t.start.row,r),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(n,"height:"+o+"px;width:"+e.width+(i||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-s),this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))},this.drawScreenLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))}}).call(s.prototype),t.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=function(e){this.dom=i,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){r.implement(this,a),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;nc&&(a=l.end.row+1,c=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(a>i);){var h=s[o++];if(h){this.dom.removeChildren(h),this.$renderLine(h,a,a==c&&l),u&&(h.style.top=this.$lines.computeLineTop(a,e,this.session)+"px");var d=e.lineHeight*this.session.getRowLength(a)+"px";h.style.height!=d&&(u=!0,h.style.height=d)}a++}if(u)for(;o0;i--)this.$lines.shift();if(t.lastRow>e.lastRow)for(i=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);i>0;i--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,n){for(var r=[],s=t,o=this.session.getNextFoldLine(s),a=o?o.start.row:1/0;s>a&&(s=o.end.row+1,a=(o=this.session.getNextFoldLine(s,o))?o.start.row:1/0),!(s>n);){var l=this.$lines.createCell(s,e,this.session),u=l.element;this.dom.removeChildren(u),i.setStyle(u.style,"height",this.$lines.computeLineHeight(s,e,this.session)+"px"),i.setStyle(u.style,"top",this.$lines.computeLineTop(s,e,this.session)+"px"),this.$renderLine(u,s,s==a&&o),this.$useLineGroups()?u.className="ace_line_group":u.className="ace_line",r.push(l),s++}return r},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,n=e.lastRow,r=this.$lines;r.getLength();)r.pop();r.push(this.$renderLinesFragment(e,t,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,r){for(var i,o=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),u=0;i=a.exec(r);){var c=i[1],h=i[2],d=i[3],f=i[4],p=i[5];if(o.showInvisibles||!h){var m=u!=i.index?r.slice(u,i.index):"";if(u=i.index+i[0].length,m&&l.appendChild(this.dom.createTextNode(m,this.element)),c){var g=o.session.getScreenTabSize(t+i.index);l.appendChild(o.$tabStrings[g].cloneNode(!0)),t+=g-1}else h?o.showInvisibles?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",v.textContent=s.stringRepeat(o.SPACE_CHAR,h.length),l.appendChild(v)):l.appendChild(this.com.createTextNode(h,this.element)):d?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",v.textContent=s.stringRepeat(o.SPACE_CHAR,d.length),l.appendChild(v)):f?(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className=o.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",v.textContent=o.showInvisibles?o.SPACE_CHAR:f,l.appendChild(v)):p&&(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className="ace_cjk",v.textContent=p,l.appendChild(v))}}if(l.appendChild(this.dom.createTextNode(u?r.slice(u):r,this.element)),this.$textToken[n.type])e.appendChild(l);else{var E="ace_"+n.type.replace(/\./g," ace_"),v=this.dom.createElement("span");"fold"==n.type&&(v.style.width=n.value.length*this.config.characterWidth+"px"),v.className=E,v.appendChild(l),e.appendChild(v)}return t+r.length},this.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(" "==t[0]){for(var i=(r-=r%this.tabSize)/this.tabSize,s=0;s=o;)a=this.$renderToken(l,a,c,h.substring(0,o-r)),h=h.substring(o-r),r=o,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(s.stringRepeat(" ",n.indent),this.element)),a=0,o=n[++i]||Number.MAX_VALUE;0!=h.length&&(r+=h.length,a=this.$renderToken(l,a,c,h))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(e,t){var n=0,r=t[0],i=r.value;this.displayIndentGuides&&(i=this.renderIndentGuide(e,i)),i&&(n=this.$renderToken(e,n,r,i));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,r,i);n=this.$renderToken(e,n,r,i)}},this.$renderOverflowMessage=function(e,t,n,r,i){n&&this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=i?"":"",e.appendChild(s)},this.$renderLine=function(e,t,n){if(n||0==n||(n=this.session.getFoldLine(t)),n)var r=this.$getFoldLineTokens(t,n);else r=this.session.getTokens(t);var i=e;if(r.length){var s=this.session.getRowSplitData(t);s&&s.length?(this.$renderWrappedLine(e,r,s),i=e.lastChild):(i=e,this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i)),this.$renderSimpleLine(i,r))}else this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i));if(this.showInvisibles&&i){n&&(t=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,i.appendChild(o)}},this.$getFoldLineTokens=function(e,t){var n=this.session,r=[],i=n.getTokens(e);return t.walk(function(e,t,s,o,a){null!=e?r.push({type:"fold",value:e}):(a&&(i=n.getTokens(t)),i.length&&function(e,t,n){for(var i=0,s=0;s+e[i].value.lengthn-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),s=t+o.length,i+=1);sn?r.push({type:e[i].type,value:o.substring(0,n-s)}):r.push(e[i]),s+=o.length,i+=1}}(i,o,s))},t.end.row,this.session.getLine(t.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),t.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)r.setStyle(t[n].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){r.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){r.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&r.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}else this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||o.top<0)&&n>1)){var a=this.cursors[i++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,o,e,t[n],this.session):this.isCursorInView(o,e)?(r.setStyle(l,"display","block"),r.translate(a,o.left,o.top),r.setStyle(l,"width",Math.round(e.characterWidth)+"px"),r.setStyle(l,"height",e.lineHeight+"px")):r.setStyle(l,"display","none")}}for(;this.cursors.length>i;)this.removeCursor();var u=this.session.getOverwrite();this.$setOverwrite(u),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(i.prototype),t.Cursor=i}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,a=32768,l=function(e){this.element=i.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){r.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(l.prototype);var u=function(e,t){l.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=i.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};r.inherits(u,l),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>a?(this.coeff=a/e,e=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(u.prototype);var c=function(e,t){l.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};r.inherits(c,l),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(c.prototype),t.ScrollBar=u,t.ScrollBarV=u,t.ScrollBarH=c,t.VScrollBar=u,t.HScrollBar=c}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){"use strict";var r=e("./lib/event"),i=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(r.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(i.prototype),t.RenderLoop=i}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,u=256,c="function"==typeof ResizeObserver,h=200,d=t.FontMetrics=function(e){this.el=i.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.innerHTML=s.stringRepeat("X",u),this.$characterSize={width:0,height:0},c?this.$addObserver():this.checkForSizeChanges()};(function(){r.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){var n=t[0].contentRect;e.checkForSizeChanges({height:n.height,width:n.width/u})}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/u};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.innerHTML=s.stringRepeat(e,u),this.$main.getBoundingClientRect().width/u},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=i.buildDom([e(0,0),e(h,0),e(0,h),e(h,h)],this.el)},this.transformCoordinates=function(e,t){function n(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function r(e,t){return[e[0]-t[0],e[1]-t[1]]}function i(e,t){return[e[0]+t[0],e[1]+t[1]]}function s(e,t){return[e*t[0],e*t[1]]}function o(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=s(1/this.$getZoom(this.el),e)),this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),u=o(this.els[2]),c=o(this.els[3]),d=n(r(c,l),r(c,u),r(i(l,u),i(c,a))),f=s(1+d[0],r(l,a)),p=s(1+d[1],r(u,a));if(t){var m=t,g=d[0]*m[0]/h+d[1]*m[1]/h+1,E=i(s(m[0],f),s(m[1],p));return i(s(1/g/h,E),a)}var v=r(e,a),C=n(r(f,s(d[0],v)),r(p,s(d[1],v)),v);return s(h,C)}}).call(d.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./config"),o=e("./layer/gutter").Gutter,a=e("./layer/marker").Marker,l=e("./layer/text").Text,u=e("./layer/cursor").Cursor,c=e("./scrollbar").HScrollBar,h=e("./scrollbar").VScrollBar,d=e("./renderloop").RenderLoop,f=e("./layer/font_metrics").FontMetrics,p=e("./lib/event_emitter").EventEmitter,m='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);opacity: 0.7;transform-origin: left;text-indent: 10px;}',g=e("./lib/useragent"),E=g.isIE;i.importCssString(m,"ace_editor.css");var v=function(e,t){var n=this;this.container=e||i.createElement("div"),i.addCssClass(this.container,"ace_editor"),i.HI_DPI&&i.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=i.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=i.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=i.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var r=this.$textLayer=new l(this.content);this.canvas=r.element,this.$markerFront=new a(this.content),this.$cursorLayer=new u(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new f(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!g.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,p),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),i.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,n){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,r){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var i=this.container;r||(r=i.clientHeight||i.scrollHeight),n||(n=i.clientWidth||i.scrollWidth);var s=this.$updateCachedSize(e,t,n,r);if(!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var s=0,o=this.$size,a={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if(r&&(e||o.height!=r)&&(o.height=r,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL),n&&(e||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,i.setStyle(this.scrollBarH.element.style,"left",t+"px"),i.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),i.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";i.setStyle(this.scrollBarH.element.style,"right",l),i.setStyle(this.scroller.style,"right",l),i.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(s|=this.CHANGE_FULL)}return o.$dirty=!n||!r,s&&this._signal("resize",a),s},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=i.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=i.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var n=this.$cursorLayer.$pixelPos;if(n){t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var r=this.layerConfig,s=n.top,o=n.left;s-=r.offset;var a=t&&t.useTextareaForIME?this.lineHeight:E?0:1;if(s<0||s>r.height-a)i.translate(this.textarea,0,0);else{var l=1,u=this.$size.height-a;if(t)if(t.useTextareaForIME){var c=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(c)[0]}else s+=this.lineHeight+2;else s+=this.lineHeight;(o-=this.scrollLeft)>this.$size.scrollerWidth-l&&(o=this.$size.scrollerWidth-l),o+=this.gutterWidth+this.margin.left,i.setStyle(e,"height",a+"px"),i.setStyle(e,"width",l+"px"),i.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-l),Math.min(s,u))}}}else i.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},this.setMargin=function(e,t,n,r){var i=this.margin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),i.translate(this.content,-this.scrollLeft,-n.offset);var s=n.width+2*this.$padding+"px",o=n.minHeight+"px";i.setStyle(this.content.style,"width",s),i.setStyle(this.content.style,"height",o)}if(e&this.CHANGE_H_SCROLL&&(i.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender")}else this.$changes|=e},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=!(n<=2*this.lineHeight)&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||r!=this.$vScroll){r!=this.$vScroll&&(this.$vScroll=r,this.scrollBarV.setVisible(r));var i=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,i,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength()*this.lineHeight,i=this.$getLongestLine(),s=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-i-2*this.$padding<0),o=this.$horizScroll!==s;o&&(this.$horizScroll=s,this.scrollBarH.setVisible(s));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,u=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;r+=u;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,r-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,i+2*this.$padding-t.scrollerWidth+c.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-r+u<0||this.scrollTop>c.top),d=a!==h;d&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var f,p,m=this.scrollTop%this.lineHeight,g=Math.ceil(l/this.lineHeight)-1,E=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),v=E+g,C=this.lineHeight;E=e.screenToDocumentRow(E,0);var D=e.getFoldLine(E);D&&(E=D.start.row),f=e.documentToScreenRow(E,0),p=e.getRowLength(E)*C,v=Math.min(e.screenToDocumentRow(v,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(v)*C+p,m=this.scrollTop-f*C;var S=0;return(this.layerConfig.width!=i||o)&&(S=this.CHANGE_H_SCROLL),(o||d)&&(S|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(i=this.$getLongestLine())),this.layerConfig={width:i,padding:this.$padding,firstRow:E,firstRowScreen:f,lastRow:v,lineHeight:C,characterWidth:this.characterWidth,minHeight:l,maxHeight:r,offset:m,gutterOffset:C?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/C)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(i-this.$padding),S},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1||tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t,n){if(0!==this.$size.scrollerHeight){var r=this.$cursorLayer.getPixelPosition(e),i=r.left,s=r.top,o=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+o>s?(t&&l+o>s+this.lineHeight&&(s-=t*this.$size.scrollerHeight),0===s&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):l+this.$size.scrollerHeight-ai?(i=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:a,side:s-a>0?1:-1,offsetX:i}},this.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),a=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),i)},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),s=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+s-this.scrollTop}},this.visualizeFocus=function(){i.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){i.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),e.useTextareaForIME=this.$useTextareaForIME,this.$useTextareaForIME?(i.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),i.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText,this.$composition=null,this.$cursorLayer.element.style.display="")},this.addToken=function(e,t,n,r){var i=this.session;i.bgTokenizer.lines[n]=null;var s={type:t,value:e},o=i.getTokens(n);if(null==r)o.push(s);else for(var a=0,l=0;l50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,n){var r=null,i=!1,a=Object.create(s),u=[],c=new l({messageBuffer:u,terminate:function(){},postMessage:function(e){u.push(e),r&&(i?setTimeout(h):h())}});c.setEmitSync=function(e){i=e};var h=function(){var e=u.shift();e.command?r[e.command].apply(r,e.args):e.event&&a._signal(e.event,e.data)};return a.postMessage=function(e){c.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},o.loadModule(["worker",t],function(e){for(r=new e[n](a);u.length;)h()}),c},t.WorkerClient=l,t.createWorker=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(e,t,n,r,i,s){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,i),this.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,s=t.start.column-this.pos.column;if(this.updateAnchors(e),i&&(this.length+=n),i&&!this.session.$fromUndo)if("insert"===e.action)for(var o=this.others.length-1;o>=0;o--){var a={row:(l=this.others[o]).row,column:l.column+s};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(o=this.others.length-1;o>=0;o--){var l;a={row:(l=this.others[o]).row,column:l.column+s},this.doc.remove(new r(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,i){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),i,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)}},this.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new r,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{n=this.getRange();var r=this.isBackwards(),s=n.start.row,o=n.end.row;if(s==o){if(r)var a=n.end,l=n.start;else a=n.start,l=n.end;return this.addRange(i.fromPoints(l,l)),void this.addRange(i.fromPoints(a,a))}var u=[],c=this.getLineRange(s,!0);c.start.column=n.start.column,u.push(c);for(var h=s+1;h1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(r,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],s=e.column0;)E--;if(E>0)for(var v=0;r[v].isEmpty();)v++;for(var C=E;C>=v;C--)r[C].isEmpty()&&r.splice(C,1)}return r}}.call(s.prototype);var d=e("./editor").Editor;function f(e,t){return e.row==t.row&&e.column==t.column}function p(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",o),e.commands.addCommands(u.defaultCommands),function(e){if(e.textInput){var t=e.textInput.getElement(),n=!1;a.addListener(t,"keydown",function(t){var i=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&i?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&r()}),a.addListener(t,"keyup",r),a.addListener(t,"blur",r)}function r(t){n&&(e.renderer.setMouseCursor(""),n=!1)}}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var r=e[n];if(r.marker){this.session.removeMarker(r.marker);var i=t.indexOf(r);-1!=i&&t.splice(i,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(u.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(u.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?r=n.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?r=n.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});else{var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return r}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var r,i=n&&n.keepOrder,o=1==n||n&&n.$byLines,a=this.session,l=this.selection,u=l.rangeList,c=(i?l:u).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var h=l._eventRegistry;l._eventRegistry={};var d=new s(a);this.inVirtualSelectionMode=!0;for(var f=c.length;f--;){if(o)for(;f>0&&c[f].start.row==c[f-1].end.row;)f--;d.fromOrientedRange(c[f]),d.index=f,this.selection=a.selection=d;var p=e.exec?e.exec(this,t||{}):e(this,t||{});r||void 0===p||(r=p),d.toOrientedRange(c[f])}d.detach(),this.selection=a.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=h,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),r}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],r=0;ro&&(o=n.column),rc?e.insert(r,l.stringRepeat(" ",s-c)):e.remove(new i(r.row,r.column,r.row,r.column-s+c)),t.start.column=t.end.column=o,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var c=this.selection.getRange(),h=c.start.row,d=c.end.row,f=h==d;if(f){var p,m=this.session.getLength();do{p=this.session.getLine(d)}while(/[=:]/.test(p)&&++d0);h<0&&(h=0),d>=m&&(d=m-1)}var g=this.session.removeFullLines(h,d);g=this.$reAlignText(g,f),this.session.insert({row:h,column:0},g.join("\n")+"\n"),f||(c.start.column=0,c.end.column=g[g.length-1].length),this.selection.setRange(c)}},this.$reAlignText=function(e,t){var n,r,i,s=!0,o=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==n?(n=t[1].length,r=t[2].length,i=t[3].length,t):(n+r+i!=t[1].length+t[2].length+t[3].length&&(o=!1),n!=t[1].length&&(s=!1),n>t[1].length&&(n=t[1].length),rt[3].length&&(i=t[3].length),t):[e]}).map(t?u:s?o?function(e){return e[2]?a(n+r-e[2].length)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:u:function(e){return e[2]?a(n)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function a(e){return l.stringRepeat(" ",e)}function u(e){return e[2]?a(n)+e[2]+a(r-e[2].length+i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=p,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){p(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,s=e.getLine(t),o=s.search(i);if(-1!=o){for(var a=n||s.length,l=e.getLength(),u=t,c=t;++tu){var f=e.getLine(c).length;return new r(u,a,c,f)}}},this.openingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i+1},a=e.$findClosingBracket(t,o,s);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>o.row&&(a.row--,a.column=e.getLine(a.row).length),r.fromPoints(o,a)}},this.closingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i},a=e.$findOpeningBracket(t,o);if(a)return a.column++,o.column--,r.fromPoints(a,o)}}).call(i.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}e("./range").Range,function(){this.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(n&&e.action){for(var r=e.data,i=r.start.row,s=r.end.row,o="add"==e.action,a=i+1;a0&&!r[i];)i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=s;o++){var a=r[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var u=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(u-=t.scrollLeft),a.el.style.left=u+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}.call(i.prototype),t.LineWidgets=i}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,n){"use strict";var r=e("../line_widgets").LineWidgets,i=e("../lib/dom"),s=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var o=e.getCursorPosition(),a=o.row,l=n.widgetManager.getWidgetsAtRow(a).filter(function(e){return"errorMarker"==e.type})[0];l?l.destroy():a-=t;var u,c=function(e,t,n){var r=e.getAnnotations().sort(s.comparePoints);if(r.length){var i=function(e,t,n){for(var r=0,i=e.length-1;r<=i;){var s=r+i>>1,o=n(t,e[s]);if(o>0)r=s+1;else{if(!(o<0))return s;i=s-1}}return-(r+1)}(r,{row:t,column:-1},s.comparePoints);i<0&&(i=-i-1),i>=r.length?i=n>0?0:r.length-1:0===i&&n<0&&(i=r.length-1);var o=r[i];if(o&&n){if(o.row===t){do{o=r[i+=n]}while(o&&o.row===t);if(!o)return r.slice()}var a=[];t=o.row;do{a[n<0?"unshift":"push"](o),o=r[i+=n]}while(o&&o.row==t);return a.length&&a}}}(n,a,t);if(c){var h=c[0];o.column=(h.pos&&"number"!=typeof h.column?h.pos.sc:h.column)||0,o.row=h.row,u=e.renderer.$gutterLayer.$annotations[o.row]}else{if(l)return;u={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(o.row),e.selection.moveToPosition(o);var d={row:o.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},f=d.el.appendChild(i.createElement("div")),p=d.el.appendChild(i.createElement("div"));p.className="error_widget_arrow "+u.className;var m=e.renderer.$cursorLayer.getPixelPosition(o).left;p.style.left=m+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",f.className="error_widget "+u.className,f.innerHTML=u.text.join("
"),f.appendChild(i.createElement("div"));var g=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(g),n.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(g),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t,r){"use strict";e("./lib/fixoldbrowsers");var i=e("./lib/dom"),s=e("./lib/event"),o=e("./range").Range,a=e("./editor").Editor,l=e("./edit_session").EditSession,u=e("./undomanager").UndoManager,c=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,t.define=n.amdD,t.edit=function(e,n){if("string"==typeof e){var r=e;if(!(e=document.getElementById(r)))throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof a)return e.env.editor;var o="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;o=l.value,e=i.createElement("pre"),l.parentNode.replaceChild(e,l)}else e&&(o=e.textContent,e.innerHTML="");var u=t.createEditSession(o),h=new a(new c(e),u,n),d={document:u,editor:h,onResize:h.resize.bind(h,null)};return l&&(d.textarea=l),s.addListener(window,"resize",d.onResize),h.on("destroy",function(){s.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),h.container.env=h.env=d,h},t.createEditSession=function(e,t){var n=new l(e,t);return n.setUndoManager(new u),n},t.Range=o,t.Editor=a,t.EditSession=l,t.UndoManager=u,t.VirtualRenderer=c,t.version=t.config.version}),ace.require(["ace/ace"],function(t){for(var n in t&&(t.config.init(!0),t.define=ace.define),window.ace||(window.ace=t),t)t.hasOwnProperty(n)&&(window.ace[n]=t[n]);window.ace.default=window.ace,e&&(e.exports=window.ace)}),e.exports={ace}},247(e,t,n){"use strict";var r=n(982),i=n(159),s=n(961);function o(e){var t="https://react.dev/errors/"+e;if(1P||(e.current=M[P],M[P]=null,P--)}function $(e,t){P++,M[P]=e.current,e.current=t}var G,V,W=B(null),H=B(null),j=B(null),z=B(null);function X(e,t){switch($(j,t),$(H,e),$(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=Eh(t=gh(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(W),$(W,e)}function K(){U(W),U(H),U(j)}function Y(e){null!==e.memoizedState&&$(z,e);var t=W.current,n=Eh(t,e.type);t!==n&&($(H,e),$(W,n))}function q(e){H.current===e&&(U(W),U(H)),z.current===e&&(U(z),ud._currentValue=k)}function Q(e){if(void 0===G)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);G=t&&t[1]||"",V=-1)":-1--i||l[r]!==u[i]){var c="\n"+l[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}}while(1<=r&&0<=i);break}}}finally{Z=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Q(n):""}function ee(e,t){switch(e.tag){case 26:case 27:case 5:return Q(e.type);case 16:return Q("Lazy");case 13:return e.child!==t&&null!==t?Q("Suspense Fallback"):Q("Suspense");case 19:return Q("SuspenseList");case 0:case 15:return J(e.type,!1);case 11:return J(e.type.render,!1);case 1:return J(e.type,!0);case 31:return Q("Activity");default:return""}}function te(e){try{var t="",n=null;do{t+=ee(e,n),n=e,e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var ne=Object.prototype.hasOwnProperty,re=r.unstable_scheduleCallback,ie=r.unstable_cancelCallback,se=r.unstable_shouldYield,oe=r.unstable_requestPaint,ae=r.unstable_now,le=r.unstable_getCurrentPriorityLevel,ue=r.unstable_ImmediatePriority,ce=r.unstable_UserBlockingPriority,he=r.unstable_NormalPriority,de=r.unstable_LowPriority,fe=r.unstable_IdlePriority,pe=r.log,me=r.unstable_setDisableYieldValue,ge=null,Ee=null;function ve(e){if("function"==typeof pe&&me(e),Ee&&"function"==typeof Ee.setStrictMode)try{Ee.setStrictMode(ge,e)}catch(e){}}var Ce=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(De(e)/Se|0)|0},De=Math.log,Se=Math.LN2,Ae=256,_e=262144,ye=4194304;function be(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Te(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var i=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var a=134217727&r;return 0!==a?0!==(r=a&~s)?i=be(r):0!==(o&=a)?i=be(o):n||0!==(n=a&~e)&&(i=be(n)):0!==(a=r&~s)?i=be(a):0!==o?i=be(o):n||0!==(n=r&~e)&&(i=be(n)),0===i?0:0!==t&&t!==i&&0===(t&s)&&((s=i&-i)>=(n=t&-t)||32===s&&4194048&n)?t:i}function Re(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function we(){var e=ye;return!(62914560&(ye<<=1))&&(ye=4194304),e}function Fe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ne(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Le(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ce(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function Oe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ce(n),i=1<=bn),xn=String.fromCharCode(32),wn=!1;function Fn(e,t){switch(e){case"keyup":return-1!==_n.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Ln=!1,On={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function In(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!On[e.type]:"textarea"===t}function kn(e,t,n,r){It?kt?kt.push(r):kt=[r]:It=r,0<(t=nh(t,"onChange")).length&&(n=new tn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Mn=null,Pn=null;function Bn(e){Kc(e,0)}function Un(e){if(ft(Qe(e)))return e}function $n(e,t){if("change"===e)return t}var Gn=!1;if($t){var Vn;if($t){var Wn="oninput"in document;if(!Wn){var Hn=document.createElement("div");Hn.setAttribute("oninput","return;"),Wn="function"==typeof Hn.oninput}Vn=Wn}else Vn=!1;Gn=Vn&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Jn(r)}}function tr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?tr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function nr(e){for(var t=pt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=pt((e=t.contentWindow).document)}return t}function rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var ir=$t&&"documentMode"in document&&11>=document.documentMode,sr=null,or=null,ar=null,lr=!1;function ur(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;lr||null==sr||sr!==pt(r)||(r="selectionStart"in(r=sr)&&rr(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},ar&&Zn(ar,r)||(ar=r,0<(r=nh(or,"onSelect")).length&&(t=new tn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=sr)))}function cr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var hr={animationend:cr("Animation","AnimationEnd"),animationiteration:cr("Animation","AnimationIteration"),animationstart:cr("Animation","AnimationStart"),transitionrun:cr("Transition","TransitionRun"),transitionstart:cr("Transition","TransitionStart"),transitioncancel:cr("Transition","TransitionCancel"),transitionend:cr("Transition","TransitionEnd")},dr={},fr={};function pr(e){if(dr[e])return dr[e];if(!hr[e])return e;var t,n=hr[e];for(t in n)if(n.hasOwnProperty(t)&&t in fr)return dr[e]=n[t];return e}$t&&(fr=document.createElement("div").style,"AnimationEvent"in window||(delete hr.animationend.animation,delete hr.animationiteration.animation,delete hr.animationstart.animation),"TransitionEvent"in window||delete hr.transitionend.transition);var mr=pr("animationend"),gr=pr("animationiteration"),Er=pr("animationstart"),vr=pr("transitionrun"),Cr=pr("transitionstart"),Dr=pr("transitioncancel"),Sr=pr("transitionend"),Ar=new Map,_r="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function yr(e,t){Ar.set(e,t),nt(t,[e])}_r.push("scrollEnd");var br="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Tr=[],Rr=0,xr=0;function wr(){for(var e=Rr,t=xr=Rr=0;t>=o,i-=o,ti=1<<32-Ce(t)+i|n<p?(m=h,h=null):m=h.sibling;var g=f(i,h,a[p],l);if(null===g){null===h&&(h=m);break}e&&h&&null===g.alternate&&t(i,h),o=s(g,o,p),null===c?u=g:c.sibling=g,c=g,h=m}if(p===a.length)return n(i,h),ci&&ri(i,p),u;if(null===h){for(;pm?(g=p,p=null):g=p.sibling;var C=f(i,p,v.value,u);if(null===C){null===p&&(p=g);break}e&&p&&null===C.alternate&&t(i,p),a=s(C,a,m),null===h?c=C:h.sibling=C,h=C,p=g}if(v.done)return n(i,p),ci&&ri(i,m),c;if(null===p){for(;!v.done;m++,v=l.next())null!==(v=d(i,v.value,u))&&(a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return ci&&ri(i,m),c}for(p=r(p);!v.done;m++,v=l.next())null!==(v=E(p,i,m,v.value,u))&&(e&&null!==v.alternate&&p.delete(null===v.key?m:v.key),a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return e&&p.forEach(function(e){return t(i,e)}),ci&&ri(i,m),c}(l,u,c=C.call(c),h)}if("function"==typeof c.then)return v(l,u,ls(c),h);if(c.$$typeof===D)return v(l,u,Li(l,c),h);cs(l,c)}return"string"==typeof c&&""!==c||"number"==typeof c||"bigint"==typeof c?(c=""+c,null!==u&&6===u.tag?(n(l,u.sibling),(h=i(u,c)).return=l,l=h):(n(l,u),(h=Wr(c,l.mode,h)).return=l,l=h),a(l)):n(l,u)}return function(e,t,n,r){try{as=0;var i=v(e,t,n,r);return os=null,i}catch(t){if(t===qi||t===Zi)throw t;var s=Pr(29,t,null,e.mode);return s.lanes=r,s.return=e,s}}}var ds=hs(!0),fs=hs(!1),ps=!1;function ms(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Es(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vs(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&du){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ir(e),Or(e,null,n),t}return Fr(e,r,t,n),Ir(e)}function Cs(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Oe(e,n)}}function Ds(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===s?i=s=o:s=s.next=o,n=n.next}while(null!==n);null===s?i=s=t:s=s.next=t}else i=s=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ss=!1;function As(){if(Ss&&null!==Wi)throw Wi}function _s(e,t,n,r){Ss=!1;var i=e.updateQueue;ps=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var l=a,u=l.next;l.next=null,null===o?s=u:o.next=u,o=l;var c=e.alternate;null!==c&&(a=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===a?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l)}if(null!==s){var h=i.baseState;for(o=0,c=u=l=null,a=s;;){var f=-536870913&a.lane,p=f!==a.lane;if(p?(mu&f)===f:(r&f)===f){0!==f&&f===Vi&&(Ss=!0),null!==c&&(c=c.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var m=e,g=a;f=t;var E=n;switch(g.tag){case 1:if("function"==typeof(m=g.payload)){h=m.call(E,h,f);break e}h=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(f="function"==typeof(m=g.payload)?m.call(E,h,f):m))break e;h=d({},h,f);break e;case 2:ps=!0}}null!==(f=a.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=i.callbacks)?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===c?(u=c=p,l=h):c=c.next=p,o|=f;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(p=a).next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}null===c&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null===s&&(i.shared.lanes=0),_u|=o,e.lanes=o,e.memoizedState=h}}function ys(e,t){if("function"!=typeof e)throw Error(o(191,e));e.call(t)}function bs(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;es?s:8;var o,a,l,u=O.T,c={};O.T=c,ca(e,!1,t,n);try{var h=i(),d=O.S;null!==d&&d(c,h),null!==h&&"object"==typeof h&&"function"==typeof h.then?ua(e,t,(o=r,a=[],l={status:"pending",value:null,reason:null,then:function(e){a.push(e)}},h.then(function(){l.status="fulfilled",l.value=o;for(var e=0;e<\/script>",s=s.removeChild(s.firstChild);break;case"select":s="string"==typeof r.is?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s="string"==typeof r.is?a.createElement(i,{is:r.is}):a.createElement(i)}}s[$e]=t,s[Ge]=r;e:for(a=t.child;null!==a;){if(5===a.tag||6===a.tag)s.appendChild(a.stateNode);else if(4!==a.tag&&27!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;null===a.sibling;){if(null===a.return||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=s;e:switch(hh(s,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&ol(t)}}return hl(t),al(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&ol(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));if(e=j.current,Ei(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(i=li))switch(i.tag){case 27:case 5:r=i.memoizedProps}e[$e]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||lh(e.nodeValue,n)))||pi(t,!0)}else(e=mh(e).createTextNode(r))[$e]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(r=Ei(t),null!==n){if(null===e){if(!r)throw Error(o(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(o(557));e[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Ps(t),t):(Ps(t),null);if(128&t.flags)throw Error(o(558))}return hl(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=Ei(t),null!==r&&null!==r.dehydrated){if(null===e){if(!i)throw Error(o(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(o(317));i[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),i=!1}else i=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return 256&t.flags?(Ps(t),t):(Ps(t),null)}return Ps(t),128&t.flags?(t.lanes=n,t):(n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(i=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(i=r.alternate.memoizedState.cachePool.pool),s=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(s=r.memoizedState.cachePool.pool),s!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ul(t,t.updateQueue),hl(t),null);case 4:return K(),null===e&&Zc(t.stateNode.containerInfo),hl(t),null;case 10:return bi(t.type),hl(t),null;case 19:if(U(Bs),null===(r=t.memoizedState))return hl(t),null;if(i=!!(128&t.flags),null===(s=r.rendering))if(i)cl(r,!1);else{if(0!==Au||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(s=Us(e))){for(t.flags|=128,cl(r,!1),e=s.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)$r(n,e),n=n.sibling;return $(Bs,1&Bs.current|2),ci&&ri(t,r.treeForkCount),t.child}e=e.sibling}null!==r.tail&&ae()>Ou&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=Us(s))){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),cl(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!ci)return hl(t),null}else 2*ae()-r.renderingStartTime>Ou&&536870912!==n&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=r.last)?e.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ae(),e.sibling=null,n=Bs.current,$(Bs,i?1&n|2:1&n),ci&&ri(t,r.treeForkCount),e):(hl(t),null);case 22:case 23:return Ps(t),Fs(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?!!(536870912&n)&&!(128&t.flags)&&(hl(t),6&t.subtreeFlags&&(t.flags|=8192)):hl(t),null!==(n=t.updateQueue)&&ul(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&U(zi),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),bi(Pi),hl(t),null;case 25:case 30:return null}throw Error(o(156,t.tag))}function fl(e,t){switch(oi(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return bi(Pi),K(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return q(t),null;case 31:if(null!==t.memoizedState){if(Ps(t),null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Ps(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return U(Bs),null;case 4:return K(),null;case 10:return bi(t.type),null;case 22:case 23:return Ps(t),Fs(),null!==e&&U(zi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return bi(Pi),null;default:return null}}function pl(e,t){switch(oi(t),t.tag){case 3:bi(Pi),K();break;case 26:case 27:case 5:q(t);break;case 4:K();break;case 31:null!==t.memoizedState&&Ps(t);break;case 13:Ps(t);break;case 19:U(Bs);break;case 10:bi(t.type);break;case 22:case 23:Ps(t),Fs(),null!==e&&U(zi);break;case 24:bi(Pi)}}function ml(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var s=n.create,o=n.inst;r=s(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ac(t,t.return,e)}}function gl(e,t,n){try{var r=t.updateQueue,i=null!==r?r.lastEffect:null;if(null!==i){var s=i.next;r=s;do{if((r.tag&e)===e){var o=r.inst,a=o.destroy;if(void 0!==a){o.destroy=void 0,i=t;var l=n,u=a;try{u()}catch(e){Ac(i,l,e)}}}r=r.next}while(r!==s)}}catch(e){Ac(t,t.return,e)}}function El(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{bs(t,n)}catch(t){Ac(e,e.return,t)}}}function vl(e,t,n){n.props=Aa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ac(e,t,n)}}function Cl(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(n){Ac(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(n){Ac(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){Ac(e,t,n)}else n.current=null}function Sl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ac(e,e.return,t)}}function Al(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,a=null,l=null,u=null,c=null,h=null;for(p in n){var d=n[p];if(n.hasOwnProperty(p)&&null!=d)switch(p){case"checked":case"value":break;case"defaultValue":u=d;default:r.hasOwnProperty(p)||uh(e,t,p,null,r,d)}}for(var f in r){var p=r[f];if(d=n[f],r.hasOwnProperty(f)&&(null!=p||null!=d))switch(f){case"type":s=p;break;case"name":i=p;break;case"checked":c=p;break;case"defaultChecked":h=p;break;case"value":a=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(o(137,t));break;default:p!==d&&uh(e,t,f,p,r,d)}}return void Et(e,a,l,u,c,h,s,i);case"select":for(s in p=a=l=f=null,n)if(u=n[s],n.hasOwnProperty(s)&&null!=u)switch(s){case"value":break;case"multiple":p=u;default:r.hasOwnProperty(s)||uh(e,t,s,null,r,u)}for(i in r)if(s=r[i],u=n[i],r.hasOwnProperty(i)&&(null!=s||null!=u))switch(i){case"value":f=s;break;case"defaultValue":l=s;break;case"multiple":a=s;default:s!==u&&uh(e,t,i,s,r,u)}return t=l,n=a,r=p,void(null!=f?Dt(e,!!n,f,!1):!!r!=!!n&&(null!=t?Dt(e,!!n,t,!0):Dt(e,!!n,n?[]:"",!1)));case"textarea":for(l in p=f=null,n)if(i=n[l],n.hasOwnProperty(l)&&null!=i&&!r.hasOwnProperty(l))switch(l){case"value":case"children":break;default:uh(e,t,l,null,r,i)}for(a in r)if(i=r[a],s=n[a],r.hasOwnProperty(a)&&(null!=i||null!=s))switch(a){case"value":f=i;break;case"defaultValue":p=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(o(91));break;default:i!==s&&uh(e,t,a,i,r,s)}return void St(e,f,p);case"option":for(var m in n)f=n[m],n.hasOwnProperty(m)&&null!=f&&!r.hasOwnProperty(m)&&("selected"===m?e.selected=!1:uh(e,t,m,null,r,f));for(u in r)f=r[u],p=n[u],!r.hasOwnProperty(u)||f===p||null==f&&null==p||("selected"===u?e.selected=f&&"function"!=typeof f&&"symbol"!=typeof f:uh(e,t,u,f,r,p));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)f=n[g],n.hasOwnProperty(g)&&null!=f&&!r.hasOwnProperty(g)&&uh(e,t,g,null,r,f);for(c in r)if(f=r[c],p=n[c],r.hasOwnProperty(c)&&f!==p&&(null!=f||null!=p))switch(c){case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(o(137,t));break;default:uh(e,t,c,f,r,p)}return;default:if(Rt(t)){for(var E in n)f=n[E],n.hasOwnProperty(E)&&void 0!==f&&!r.hasOwnProperty(E)&&ch(e,t,E,void 0,r,f);for(h in r)f=r[h],p=n[h],!r.hasOwnProperty(h)||f===p||void 0===f&&void 0===p||ch(e,t,h,f,r,p);return}}for(var v in n)f=n[v],n.hasOwnProperty(v)&&null!=f&&!r.hasOwnProperty(v)&&uh(e,t,v,null,r,f);for(d in r)f=r[d],p=n[d],!r.hasOwnProperty(d)||f===p||null==f&&null==p||uh(e,t,d,f,r,p)}(r,e.type,n,t),r[Ge]=t}catch(t){Ac(e,e.return,t)}}function _l(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&bh(e.type)||4===e.tag}function yl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||_l(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&bh(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function bl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Nt));else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(bl(e,t,n),e=e.sibling;null!==e;)bl(e,t,n),e=e.sibling}function Tl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Tl(e,t,n),e=e.sibling;null!==e;)Tl(e,t,n),e=e.sibling}function Rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);hh(t,r,n),t[$e]=e,t[Ge]=n}catch(t){Ac(e,e.return,t)}}var xl=!1,wl=!1,Fl=!1,Nl="function"==typeof WeakSet?WeakSet:Set,Ll=null;function Ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Xl(e,n),4&r&&ml(5,n);break;case 1:if(Xl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){Ac(n,n.return,e)}else{var i=Aa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ac(n,n.return,e)}}64&r&&El(n),512&r&&Cl(n,n.return);break;case 3:if(Xl(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{bs(e,t)}catch(e){Ac(n,n.return,e)}}break;case 27:null===t&&4&r&&Rl(n);case 26:case 5:Xl(e,n),null===t&&4&r&&Sl(n),512&r&&Cl(n,n.return);break;case 12:Xl(e,n);break;case 31:Xl(e,n),4&r&&Ul(e,n);break;case 13:Xl(e,n),4&r&&$l(e,n),64&r&&null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Tc.bind(null,n));break;case 22:if(!(r=null!==n.memoizedState||xl)){t=null!==t&&null!==t.memoizedState||wl,i=xl;var s=wl;xl=r,(wl=t)&&!s?Yl(e,n,!!(8772&n.subtreeFlags)):Xl(e,n),xl=i,wl=s}break;case 30:break;default:Xl(e,n)}}function Il(e){var t=e.alternate;null!==t&&(e.alternate=null,Il(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&Ke(t),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var kl=null,Ml=!1;function Pl(e,t,n){for(n=n.child;null!==n;)Bl(e,t,n),n=n.sibling}function Bl(e,t,n){if(Ee&&"function"==typeof Ee.onCommitFiberUnmount)try{Ee.onCommitFiberUnmount(ge,n)}catch(e){}switch(n.tag){case 26:wl||Dl(n,t),Pl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:wl||Dl(n,t);var r=kl,i=Ml;bh(n.type)&&(kl=n.stateNode,Ml=!1),Pl(e,t,n),Ph(n.stateNode),kl=r,Ml=i;break;case 5:wl||Dl(n,t);case 6:if(r=kl,i=Ml,kl=null,Pl(e,t,n),Ml=i,null!==(kl=r))if(Ml)try{(9===kl.nodeType?kl.body:"HTML"===kl.nodeName?kl.ownerDocument.body:kl).removeChild(n.stateNode)}catch(e){Ac(n,t,e)}else try{kl.removeChild(n.stateNode)}catch(e){Ac(n,t,e)}break;case 18:null!==kl&&(Ml?(Th(9===(e=kl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Gd(e)):Th(kl,n.stateNode));break;case 4:r=kl,i=Ml,kl=n.stateNode.containerInfo,Ml=!0,Pl(e,t,n),kl=r,Ml=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),wl||gl(4,n,t),Pl(e,t,n);break;case 1:wl||(Dl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&vl(n,t,r)),Pl(e,t,n);break;case 21:Pl(e,t,n);break;case 22:wl=(r=wl)||null!==n.memoizedState,Pl(e,t,n),wl=r;break;default:Pl(e,t,n)}}function Ul(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)){e=e.dehydrated;try{Gd(e)}catch(e){Ac(t,t.return,e)}}}function $l(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{Gd(e)}catch(e){Ac(t,t.return,e)}}function Gl(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Nl),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Nl),t;default:throw Error(o(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Rc.bind(null,e,t);t.then(r,r)}})}function Vl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r title"))),hh(s,r,n),s[$e]=e,Je(s),r=s;break e;case"link":var a=td("link","href",i).get(r+(n.href||""));if(a)for(var l=0;la)break;var c=l.transferSize,h=l.initiatorType;c&&dh(h)&&(o+=c*((l=l.responseEnd)id?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}(h,p)))return Uu=s,e.cancelPendingCommit=p(pc.bind(null,e,t,s,n,r,i,o,a,l,c,h,null,d,f)),void Qu(e,s,o,!u)}pc(e,t,s,n,r,i,o,a,l)}function qu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var r=0;rg&&(o=g,g=m,m=o);var E=er(a,m),v=er(a,g);if(E&&v&&(1!==f.rangeCount||f.anchorNode!==E.node||f.anchorOffset!==E.offset||f.focusNode!==v.node||f.focusOffset!==v.offset)){var C=h.createRange();C.setStart(E.node,E.offset),f.removeAllRanges(),m>g?(f.addRange(C),f.extend(v.node,v.offset)):(C.setEnd(v.node,v.offset),f.addRange(C))}}}}for(h=[],f=a;f=f.parentNode;)1===f.nodeType&&h.push({element:f,left:f.scrollLeft,top:f.scrollTop});for("function"==typeof a.focus&&a.focus(),a=0;an?32:n,O.T=null,n=Gu,Gu=null;var s=Pu,a=Uu;if(Mu=0,Bu=Pu=null,Uu=0,6&du)throw Error(o(331));var l=du;if(du|=4,au(s.current),Jl(s,s.current,a,n),du=l,kc(0,!1),Ee&&"function"==typeof Ee.onPostCommitFiberRoot)try{Ee.onPostCommitFiberRoot(ge,s)}catch(e){}return!0}finally{I.p=i,O.T=r,vc(e,t)}}function Sc(e,t,n){t=Xr(n,t),null!==(e=vs(e,t=xa(e.stateNode,t,2),2))&&(Ne(e,2),Ic(e))}function Ac(e,t,n){if(3===e.tag)Sc(e,e,n);else for(;null!==t;){if(3===t.tag){Sc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===ku||!ku.has(r))){e=Xr(n,e),null!==(r=vs(t,n=wa(2),2))&&(Fa(n,r,t,e),Ne(r,2),Ic(r));break}}t=t.return}}function _c(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hu;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(Du=!0,i.add(n),e=yc.bind(null,e,t,n),t.then(e,e))}function yc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,fu===e&&(mu&n)===n&&(4===Au||3===Au&&(62914560&mu)===mu&&300>ae()-Nu?!(2&du)&&ec(e,0):bu|=n,Ru===mu&&(Ru=0)),Ic(e)}function bc(e,t){0===t&&(t=we()),null!==(e=Lr(e,t))&&(Ne(e,t),Ic(e))}function Tc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),bc(e,n)}function Rc(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}null!==r&&r.delete(t),bc(e,n)}var xc=null,wc=null,Fc=!1,Nc=!1,Lc=!1,Oc=0;function Ic(e){e!==wc&&null===e.next&&(null===wc?xc=wc=e:wc=wc.next=e),Nc=!0,Fc||(Fc=!0,_h(function(){6&du?re(ue,Mc):Pc()}))}function kc(e,t){if(!Lc&&Nc){Lc=!0;do{for(var n=!1,r=xc;null!==r;){if(!t)if(0!==e){var i=r.pendingLanes;if(0===i)var s=0;else{var o=r.suspendedLanes,a=r.pingedLanes;s=(1<<31-Ce(42|e)+1)-1,s=201326741&(s&=i&~(o&~a))?201326741&s|1:s?2|s:0}0!==s&&(n=!0,$c(r,s))}else s=mu,!(3&(s=Te(r,r===fu?s:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Re(r,s)||(n=!0,$c(r,s));r=r.next}}while(n);Lc=!1}}function Mc(){Pc()}function Pc(){Nc=Fc=!1;var e,t=0;0!==Oc&&((e=window.event)&&"popstate"===e.type?e!==Ch&&(Ch=e,1):(Ch=null,0))&&(t=Oc);for(var n=ae(),r=null,i=xc;null!==i;){var s=i.next,o=Bc(i,n);0===o?(i.next=null,null===r?xc=s:r.next=s,null===s&&(wc=r)):(r=i,(0!==t||3&o)&&(Nc=!0)),i=s}0!==Mu&&5!==Mu||kc(t,!1),0!==Oc&&(Oc=0)}function Bc(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=-62914561&e.pendingLanes;0 title"):null)}function rd(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var id=0;function sd(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)ad(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var od=null;function ad(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,od=new Map,t.forEach(ld,e),od=null,sd.call(e))}function ld(e,t){if(!(4&t.state.loading)){var n=od.get(e);if(n)var r=n.get(null);else{n=new Map,od.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s>>1,i=e[r];if(!(0>>1;rs(l,n))us(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[a]=n,r=a);else{if(!(us(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var u=[],c=[],h=1,d=null,f=3,p=!1,m=!1,g=!1,E=!1,v="function"==typeof setTimeout?setTimeout:null,C="function"==typeof clearTimeout?clearTimeout:null,D="undefined"!=typeof setImmediate?setImmediate:null;function S(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function A(e){if(g=!1,S(e),!m)if(null!==r(u))m=!0,y||(y=!0,_());else{var t=r(c);null!==t&&L(A,t.startTime-e)}}var _,y=!1,b=-1,T=5,R=-1;function x(){return!(!E&&t.unstable_now()-Re&&x());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var a=o(d.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof a){d.callback=a,S(e),n=!0;break t}d===r(u)&&i(u),S(e)}else i(u);d=r(u)}if(null!==d)n=!0;else{var l=r(c);null!==l&&L(A,l.startTime-e),n=!1}}break e}finally{d=null,f=s,p=!1}n=void 0}}finally{n?_():y=!1}}}if("function"==typeof D)_=function(){D(w)};else if("undefined"!=typeof MessageChannel){var F=new MessageChannel,N=F.port2;F.port1.onmessage=w,_=function(){N.postMessage(null)}}else _=function(){v(w,0)};function L(e,n){b=v(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125o?(e.sortIndex=s,n(c,e),null===r(u)&&e===r(c)&&(g?(C(b),b=-1):g=!0,L(A,s-o))):(e.sortIndex=a,n(u,e),m||p||(m=!0,y||(y=!0,_()))),e},t.unstable_shouldYield=x,t.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}},982(e,t,n){"use strict";e.exports=n(477)},902(e,t,n){"use strict";var r=n(72),i=n.n(r),s=n(825),o=n.n(s),a=n(659),l=n.n(a),u=n(56),c=n.n(u),h=n(540),d=n.n(h),f=n(113),p=n.n(f),m=n(636),g={};g.styleTagTransform=p(),g.setAttributes=c(),g.insert=l().bind(null,"html"),g.domAPI=o(),g.insertStyleElement=d(),i()(m.A,g),m.A&&m.A.locals&&m.A.locals},72(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},878(e,t,n){"use strict";n.r(t),n.d(t,{EmbeddedFrontend:()=>Id,Spector:()=>kd});var r={};n.r(r),n.d(r,{LX:()=>Jo,ll:()=>ea});var i,s={};n.r(s),n.d(s,{SyntaxError:()=>Xc,parse:()=>Yc});class o{static isBuildableProgram(e){return!!e&&!!e[this.rebuildProgramFunctionName]}static rebuildProgram(e,t,n,r,i){this.isBuildableProgram(e)&&e[this.rebuildProgramFunctionName](t,n,r,i)}}o.rebuildProgramFunctionName="__SPECTOR_rebuildProgram",function(e){e[e.noLog=0]="noLog",e[e.error=1]="error",e[e.warning=2]="warning",e[e.info=3]="info"}(i||(i={}));class a{static error(e,...t){this.level>0&&console.error(e,t)}static warn(e,...t){this.level>1&&console.warn(e,t)}static info(e,...t){this.level>2&&console.log(e,t)}}a.level=i.warning;class l{constructor(){this.callbacks=[],this.counter=-1}add(e,t){return this.counter++,t&&(e=e.bind(t)),this.callbacks[this.counter]=e,this.counter}remove(e){delete this.callbacks[e]}clear(){this.callbacks={}}trigger(e){for(const t in this.callbacks)this.callbacks.hasOwnProperty(t)&&this.callbacks[t](e)}}class u{constructor(){if("undefined"!=typeof performance&&performance.now)this.nowFunction=()=>performance.now();else{const e=new Date;this.nowFunction=e.getTime.bind(e)}}static get now(){return u.instance.nowFunction()}}u.instance=new u;class c{constructor(e){this.options=e}appendAnalysis(e){e.analyses=e.analyses||[];const t=this.getAnalysis(e);e.analyses.push(t)}getAnalysis(e){const t={analyserName:this.analyserName};return this.appendToAnalysis(e,t),t}}class h extends c{get analyserName(){return h.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={};for(const t of e.commands)n[t.name]=n[t.name]||0,n[t.name]++;const r=Object.keys(n).map(e=>[e,n[e]]);r.sort((e,t)=>{const n=t[1]-e[1];return 0===n?e[0].localeCompare(t[0]):n});for(const e of r)t[e[0]]=e[1]}}h.analyserName="Commands";const d=["drawArrays","drawElements","drawArraysInstanced","drawArraysInstancedANGLE","drawElementsInstanced","drawElementsInstancedANGLE","drawRangeElements","multiDrawArraysWEBGL","multiDrawElementsWEBGL","multiDrawArraysInstancedWEBGL","multiDrawElementsInstancedWEBGL","multiDrawArraysInstancedBaseInstanceWEBGL","multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL","drawArraysInstancedBaseInstanceWEBGL","drawElementsInstancedBaseVertexBaseInstanceWEBGL"];class f extends c{get analyserName(){return f.analyserName}appendToAnalysis(e,t){if(e.commands){t.total=e.commands.length,t.draw=0,t.clear=0;for(const n of e.commands)"clear"===n.name?t.clear++:d.indexOf(n.name)>-1&&t.draw++}}}f.analyserName="CommandsSummary";class p{static isWebGlConstant(e){return null!==g[e]&&void 0!==g[e]}static stringifyWebGlConstant(e,t){if(null==e)return"";if(0===e){return this.zeroMeaningByCommand[t]||"0"}if(1===e){return this.oneMeaningByCommand[t]||"1"}const n=g[e];return n?n.name:e+""}}p.DEPTH_BUFFER_BIT={name:"DEPTH_BUFFER_BIT",value:256,description:"Passed to clear to clear the current depth buffer."},p.STENCIL_BUFFER_BIT={name:"STENCIL_BUFFER_BIT",value:1024,description:"Passed to clear to clear the current stencil buffer."},p.COLOR_BUFFER_BIT={name:"COLOR_BUFFER_BIT",value:16384,description:"Passed to clear to clear the current color buffer."},p.POINTS={name:"POINTS",value:0,description:"Passed to drawElements or drawArrays to draw single points."},p.LINES={name:"LINES",value:1,description:"Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it."},p.LINE_LOOP={name:"LINE_LOOP",value:2,description:"Passed to drawElements or drawArrays to draw lines. Each set of two vertices is treated as a separate line segment."},p.LINE_STRIP={name:"LINE_STRIP",value:3,description:"Passed to drawElements or drawArrays to draw a connected group of line segments from the first vertex to the last."},p.TRIANGLES={name:"TRIANGLES",value:4,description:"Passed to drawElements or drawArrays to draw triangles. Each set of three vertices creates a separate triangle."},p.TRIANGLE_STRIP={name:"TRIANGLE_STRIP",value:5,description:"Passed to drawElements or drawArrays to draw a connected group of triangles."},p.TRIANGLE_FAN={name:"TRIANGLE_FAN",value:6,description:"Passed to drawElements or drawArrays to draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan."},p.ZERO={name:"ZERO",value:0,description:"Passed to blendFunc or blendFuncSeparate to turn off a component."},p.ONE={name:"ONE",value:1,description:"Passed to blendFunc or blendFuncSeparate to turn on a component."},p.SRC_COLOR={name:"SRC_COLOR",value:768,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source elements color."},p.ONE_MINUS_SRC_COLOR={name:"ONE_MINUS_SRC_COLOR",value:769,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source elements color."},p.SRC_ALPHA={name:"SRC_ALPHA",value:770,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source's alpha."},p.ONE_MINUS_SRC_ALPHA={name:"ONE_MINUS_SRC_ALPHA",value:771,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source's alpha."},p.DST_ALPHA={name:"DST_ALPHA",value:772,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's alpha."},p.ONE_MINUS_DST_ALPHA={name:"ONE_MINUS_DST_ALPHA",value:773,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's alpha."},p.DST_COLOR={name:"DST_COLOR",value:774,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's color."},p.ONE_MINUS_DST_COLOR={name:"ONE_MINUS_DST_COLOR",value:775,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's color."},p.SRC_ALPHA_SATURATE={name:"SRC_ALPHA_SATURATE",value:776,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the minimum of source's alpha or one minus the destination's alpha."},p.CONSTANT_COLOR={name:"CONSTANT_COLOR",value:32769,description:"Passed to blendFunc or blendFuncSeparate to specify a constant color blend function."},p.ONE_MINUS_CONSTANT_COLOR={name:"ONE_MINUS_CONSTANT_COLOR",value:32770,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant color blend function."},p.CONSTANT_ALPHA={name:"CONSTANT_ALPHA",value:32771,description:"Passed to blendFunc or blendFuncSeparate to specify a constant alpha blend function."},p.ONE_MINUS_CONSTANT_ALPHA={name:"ONE_MINUS_CONSTANT_ALPHA",value:32772,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant alpha blend function."},p.FUNC_ADD={name:"FUNC_ADD",value:32774,description:"Passed to blendEquation or blendEquationSeparate to set an addition blend function."},p.FUNC_SUBSTRACT={name:"FUNC_SUBSTRACT",value:32778,description:"Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination)."},p.FUNC_REVERSE_SUBTRACT={name:"FUNC_REVERSE_SUBTRACT",value:32779,description:"Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source)."},p.BLEND_EQUATION={name:"BLEND_EQUATION",value:32777,description:"Passed to getParameter to get the current RGB blend function."},p.BLEND_EQUATION_RGB={name:"BLEND_EQUATION_RGB",value:32777,description:"Passed to getParameter to get the current RGB blend function. Same as BLEND_EQUATION"},p.BLEND_EQUATION_ALPHA={name:"BLEND_EQUATION_ALPHA",value:34877,description:"Passed to getParameter to get the current alpha blend function. Same as BLEND_EQUATION"},p.BLEND_DST_RGB={name:"BLEND_DST_RGB",value:32968,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_SRC_RGB={name:"BLEND_SRC_RGB",value:32969,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_DST_ALPHA={name:"BLEND_DST_ALPHA",value:32970,description:"Passed to getParameter to get the current destination alpha blend function."},p.BLEND_SRC_ALPHA={name:"BLEND_SRC_ALPHA",value:32971,description:"Passed to getParameter to get the current source alpha blend function."},p.BLEND_COLOR={name:"BLEND_COLOR",value:32773,description:"Passed to getParameter to return a the current blend color."},p.ARRAY_BUFFER_BINDING={name:"ARRAY_BUFFER_BINDING",value:34964,description:"Passed to getParameter to get the array buffer binding."},p.ELEMENT_ARRAY_BUFFER_BINDING={name:"ELEMENT_ARRAY_BUFFER_BINDING",value:34965,description:"Passed to getParameter to get the current element array buffer."},p.LINE_WIDTH={name:"LINE_WIDTH",value:2849,description:"Passed to getParameter to get the current lineWidth (set by the lineWidth method)."},p.ALIASED_POINT_SIZE_RANGE={name:"ALIASED_POINT_SIZE_RANGE",value:33901,description:"Passed to getParameter to get the current size of a point drawn with gl.POINTS"},p.ALIASED_LINE_WIDTH_RANGE={name:"ALIASED_LINE_WIDTH_RANGE",value:33902,description:"Passed to getParameter to get the range of available widths for a line. Returns a length-2 array with the lo value at 0, and hight at 1."},p.CULL_FACE_MODE={name:"CULL_FACE_MODE",value:2885,description:"Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK"},p.FRONT_FACE={name:"FRONT_FACE",value:2886,description:"Passed to getParameter to determine the current value of frontFace. Should return CW or CCW."},p.DEPTH_RANGE={name:"DEPTH_RANGE",value:2928,description:"Passed to getParameter to return a length-2 array of floats giving the current depth range."},p.DEPTH_WRITEMASK={name:"DEPTH_WRITEMASK",value:2930,description:"Passed to getParameter to determine if the depth write mask is enabled."},p.DEPTH_CLEAR_VALUE={name:"DEPTH_CLEAR_VALUE",value:2931,description:"Passed to getParameter to determine the current depth clear value."},p.DEPTH_FUNC={name:"DEPTH_FUNC",value:2932,description:"Passed to getParameter to get the current depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_CLEAR_VALUE={name:"STENCIL_CLEAR_VALUE",value:2961,description:"Passed to getParameter to get the value the stencil will be cleared to."},p.STENCIL_FUNC={name:"STENCIL_FUNC",value:2962,description:"Passed to getParameter to get the current stencil function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_FAIL={name:"STENCIL_FAIL",value:2964,description:"Passed to getParameter to get the current stencil fail function. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_FAIL={name:"STENCIL_PASS_DEPTH_FAIL",value:2965,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test fail. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_PASS={name:"STENCIL_PASS_DEPTH_PASS",value:2966,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test pass. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_REF={name:"STENCIL_REF",value:2967,description:"Passed to getParameter to get the reference value used for stencil tests."},p.STENCIL_VALUE_MASK={name:"STENCIL_VALUE_MASK",value:2963,description:" "},p.STENCIL_WRITEMASK={name:"STENCIL_WRITEMASK",value:2968,description:" "},p.STENCIL_BACK_FUNC={name:"STENCIL_BACK_FUNC",value:34816,description:" "},p.STENCIL_BACK_FAIL={name:"STENCIL_BACK_FAIL",value:34817,description:" "},p.STENCIL_BACK_PASS_DEPTH_FAIL={name:"STENCIL_BACK_PASS_DEPTH_FAIL",value:34818,description:" "},p.STENCIL_BACK_PASS_DEPTH_PASS={name:"STENCIL_BACK_PASS_DEPTH_PASS",value:34819,description:" "},p.STENCIL_BACK_REF={name:"STENCIL_BACK_REF",value:36003,description:" "},p.STENCIL_BACK_VALUE_MASK={name:"STENCIL_BACK_VALUE_MASK",value:36004,description:" "},p.STENCIL_BACK_WRITEMASK={name:"STENCIL_BACK_WRITEMASK",value:36005,description:" "},p.VIEWPORT={name:"VIEWPORT",value:2978,description:"Returns an Int32Array with four elements for the current viewport dimensions."},p.SCISSOR_BOX={name:"SCISSOR_BOX",value:3088,description:"Returns an Int32Array with four elements for the current scissor box dimensions."},p.COLOR_CLEAR_VALUE={name:"COLOR_CLEAR_VALUE",value:3106,description:" "},p.COLOR_WRITEMASK={name:"COLOR_WRITEMASK",value:3107,description:" "},p.UNPACK_ALIGNMENT={name:"UNPACK_ALIGNMENT",value:3317,description:" "},p.PACK_ALIGNMENT={name:"PACK_ALIGNMENT",value:3333,description:" "},p.MAX_TEXTURE_SIZE={name:"MAX_TEXTURE_SIZE",value:3379,description:" "},p.MAX_VIEWPORT_DIMS={name:"MAX_VIEWPORT_DIMS",value:3386,description:" "},p.SUBPIXEL_BITS={name:"SUBPIXEL_BITS",value:3408,description:" "},p.RED_BITS={name:"RED_BITS",value:3410,description:" "},p.GREEN_BITS={name:"GREEN_BITS",value:3411,description:" "},p.BLUE_BITS={name:"BLUE_BITS",value:3412,description:" "},p.ALPHA_BITS={name:"ALPHA_BITS",value:3413,description:" "},p.DEPTH_BITS={name:"DEPTH_BITS",value:3414,description:" "},p.STENCIL_BITS={name:"STENCIL_BITS",value:3415,description:" "},p.POLYGON_OFFSET_UNITS={name:"POLYGON_OFFSET_UNITS",value:10752,description:" "},p.POLYGON_OFFSET_FACTOR={name:"POLYGON_OFFSET_FACTOR",value:32824,description:" "},p.TEXTURE_BINDING_2D={name:"TEXTURE_BINDING_2D",value:32873,description:" "},p.SAMPLE_BUFFERS={name:"SAMPLE_BUFFERS",value:32936,description:" "},p.SAMPLES={name:"SAMPLES",value:32937,description:" "},p.SAMPLE_COVERAGE_VALUE={name:"SAMPLE_COVERAGE_VALUE",value:32938,description:" "},p.SAMPLE_COVERAGE_INVERT={name:"SAMPLE_COVERAGE_INVERT",value:32939,description:" "},p.COMPRESSED_TEXTURE_FORMATS={name:"COMPRESSED_TEXTURE_FORMATS",value:34467,description:" "},p.VENDOR={name:"VENDOR",value:7936,description:" "},p.RENDERER={name:"RENDERER",value:7937,description:" "},p.VERSION={name:"VERSION",value:7938,description:" "},p.IMPLEMENTATION_COLOR_READ_TYPE={name:"IMPLEMENTATION_COLOR_READ_TYPE",value:35738,description:" "},p.IMPLEMENTATION_COLOR_READ_FORMAT={name:"IMPLEMENTATION_COLOR_READ_FORMAT",value:35739,description:" "},p.BROWSER_DEFAULT_WEBGL={name:"BROWSER_DEFAULT_WEBGL",value:37444,description:" "},p.STATIC_DRAW={name:"STATIC_DRAW",value:35044,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and not change often."},p.STREAM_DRAW={name:"STREAM_DRAW",value:35040,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to not be used often."},p.DYNAMIC_DRAW={name:"DYNAMIC_DRAW",value:35048,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and change often."},p.ARRAY_BUFFER={name:"ARRAY_BUFFER",value:34962,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.ELEMENT_ARRAY_BUFFER={name:"ELEMENT_ARRAY_BUFFER",value:34963,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.BUFFER_SIZE={name:"BUFFER_SIZE",value:34660,description:"Passed to getBufferParameter to get a buffer's size."},p.BUFFER_USAGE={name:"BUFFER_USAGE",value:34661,description:"Passed to getBufferParameter to get the hint for the buffer passed in when it was created."},p.CURRENT_VERTEX_ATTRIB={name:"CURRENT_VERTEX_ATTRIB",value:34342,description:"Passed to getVertexAttrib to read back the current vertex attribute."},p.VERTEX_ATTRIB_ARRAY_ENABLED={name:"VERTEX_ATTRIB_ARRAY_ENABLED",value:34338,description:" "},p.VERTEX_ATTRIB_ARRAY_SIZE={name:"VERTEX_ATTRIB_ARRAY_SIZE",value:34339,description:" "},p.VERTEX_ATTRIB_ARRAY_STRIDE={name:"VERTEX_ATTRIB_ARRAY_STRIDE",value:34340,description:" "},p.VERTEX_ATTRIB_ARRAY_TYPE={name:"VERTEX_ATTRIB_ARRAY_TYPE",value:34341,description:" "},p.VERTEX_ATTRIB_ARRAY_NORMALIZED={name:"VERTEX_ATTRIB_ARRAY_NORMALIZED",value:34922,description:" "},p.VERTEX_ATTRIB_ARRAY_POINTER={name:"VERTEX_ATTRIB_ARRAY_POINTER",value:34373,description:" "},p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING={name:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",value:34975,description:" "},p.CULL_FACE={name:"CULL_FACE",value:2884,description:"Passed to enable/disable to turn on/off culling. Can also be used with getParameter to find the current culling method."},p.FRONT={name:"FRONT",value:1028,description:"Passed to cullFace to specify that only front faces should be drawn."},p.BACK={name:"BACK",value:1029,description:"Passed to cullFace to specify that only back faces should be drawn."},p.FRONT_AND_BACK={name:"FRONT_AND_BACK",value:1032,description:"Passed to cullFace to specify that front and back faces should be drawn."},p.BLEND={name:"BLEND",value:3042,description:"Passed to enable/disable to turn on/off blending. Can also be used with getParameter to find the current blending method."},p.DEPTH_TEST={name:"DEPTH_TEST",value:2929,description:"Passed to enable/disable to turn on/off the depth test. Can also be used with getParameter to query the depth test."},p.DITHER={name:"DITHER",value:3024,description:"Passed to enable/disable to turn on/off dithering. Can also be used with getParameter to find the current dithering method."},p.POLYGON_OFFSET_FILL={name:"POLYGON_OFFSET_FILL",value:32823,description:"Passed to enable/disable to turn on/off the polygon offset. Useful for rendering hidden-line images, decals, and or solids with highlighted edges. Can also be used with getParameter to query the scissor test."},p.SAMPLE_ALPHA_TO_COVERAGE={name:"SAMPLE_ALPHA_TO_COVERAGE",value:32926,description:"Passed to enable/disable to turn on/off the alpha to coverage. Used in multi-sampling alpha channels."},p.SAMPLE_COVERAGE={name:"SAMPLE_COVERAGE",value:32928,description:"Passed to enable/disable to turn on/off the sample coverage. Used in multi-sampling."},p.SCISSOR_TEST={name:"SCISSOR_TEST",value:3089,description:"Passed to enable/disable to turn on/off the scissor test. Can also be used with getParameter to query the scissor test."},p.STENCIL_TEST={name:"STENCIL_TEST",value:2960,description:"Passed to enable/disable to turn on/off the stencil test. Can also be used with getParameter to query the stencil test."},p.NO_ERROR={name:"NO_ERROR",value:0,description:"Returned from getError."},p.INVALID_ENUM={name:"INVALID_ENUM",value:1280,description:"Returned from getError."},p.INVALID_VALUE={name:"INVALID_VALUE",value:1281,description:"Returned from getError."},p.INVALID_OPERATION={name:"INVALID_OPERATION",value:1282,description:"Returned from getError."},p.OUT_OF_MEMORY={name:"OUT_OF_MEMORY",value:1285,description:"Returned from getError."},p.CONTEXT_LOST_WEBGL={name:"CONTEXT_LOST_WEBGL",value:37442,description:"Returned from getError."},p.CW={name:"CW",value:2304,description:"Passed to frontFace to specify the front face of a polygon is drawn in the clockwise direction"},p.CCW={name:"CCW",value:2305,description:"Passed to frontFace to specify the front face of a polygon is drawn in the counter clockwise direction"},p.DONT_CARE={name:"DONT_CARE",value:4352,description:"There is no preference for this behavior."},p.FASTEST={name:"FASTEST",value:4353,description:"The most efficient behavior should be used."},p.NICEST={name:"NICEST",value:4354,description:"The most correct or the highest quality option should be used."},p.GENERATE_MIPMAP_HINT={name:"GENERATE_MIPMAP_HINT",value:33170,description:"Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap()."},p.BYTE={name:"BYTE",value:5120,description:" "},p.UNSIGNED_BYTE={name:"UNSIGNED_BYTE",value:5121,description:" "},p.SHORT={name:"SHORT",value:5122,description:" "},p.UNSIGNED_SHORT={name:"UNSIGNED_SHORT",value:5123,description:" "},p.INT={name:"INT",value:5124,description:" "},p.UNSIGNED_INT={name:"UNSIGNED_INT",value:5125,description:" "},p.FLOAT={name:"FLOAT",value:5126,description:" "},p.DEPTH_COMPONENT={name:"DEPTH_COMPONENT",value:6402,description:" "},p.ALPHA={name:"ALPHA",value:6406,description:" "},p.RGB={name:"RGB",value:6407,description:" "},p.RGBA={name:"RGBA",value:6408,description:" "},p.LUMINANCE={name:"LUMINANCE",value:6409,description:" "},p.LUMINANCE_ALPHA={name:"LUMINANCE_ALPHA",value:6410,description:" "},p.UNSIGNED_SHORT_4_4_4_4={name:"UNSIGNED_SHORT_4_4_4_4",value:32819,description:" "},p.UNSIGNED_SHORT_5_5_5_1={name:"UNSIGNED_SHORT_5_5_5_1",value:32820,description:" "},p.UNSIGNED_SHORT_5_6_5={name:"UNSIGNED_SHORT_5_6_5",value:33635,description:" "},p.FRAGMENT_SHADER={name:"FRAGMENT_SHADER",value:35632,description:"Passed to createShader to define a fragment shader."},p.VERTEX_SHADER={name:"VERTEX_SHADER",value:35633,description:"Passed to createShader to define a vertex shader"},p.COMPILE_STATUS={name:"COMPILE_STATUS",value:35713,description:"Passed to getShaderParamter to get the status of the compilation. Returns false if the shader was not compiled. You can then query getShaderInfoLog to find the exact error"},p.DELETE_STATUS={name:"DELETE_STATUS",value:35712,description:"Passed to getShaderParamter to determine if a shader was deleted via deleteShader. Returns true if it was, false otherwise."},p.LINK_STATUS={name:"LINK_STATUS",value:35714,description:"Passed to getProgramParameter after calling linkProgram to determine if a program was linked correctly. Returns false if there were errors. Use getProgramInfoLog to find the exact error."},p.VALIDATE_STATUS={name:"VALIDATE_STATUS",value:35715,description:"Passed to getProgramParameter after calling validateProgram to determine if it is valid. Returns false if errors were found."},p.ATTACHED_SHADERS={name:"ATTACHED_SHADERS",value:35717,description:"Passed to getProgramParameter after calling attachShader to determine if the shader was attached correctly. Returns false if errors occurred."},p.COMPLETION_STATUS_KHR={name:"COMPLETION_STATUS_KHR",value:37297,description:"Passed to getProgramParameter (KHR_parallel_shader_compile) to query whether an asynchronous shader/program link has completed. Returns true once the program is ready to use without blocking."},p.ACTIVE_ATTRIBUTES={name:"ACTIVE_ATTRIBUTES",value:35721,description:"Passed to getProgramParameter to get the number of attributes active in a program."},p.ACTIVE_UNIFORMS={name:"ACTIVE_UNIFORMS",value:35718,description:"Passed to getProgramParamter to get the number of uniforms active in a program."},p.MAX_VERTEX_ATTRIBS={name:"MAX_VERTEX_ATTRIBS",value:34921,description:" "},p.MAX_VERTEX_UNIFORM_VECTORS={name:"MAX_VERTEX_UNIFORM_VECTORS",value:36347,description:" "},p.MAX_VARYING_VECTORS={name:"MAX_VARYING_VECTORS",value:36348,description:" "},p.MAX_COMBINED_TEXTURE_IMAGE_UNITS={name:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",value:35661,description:" "},p.MAX_VERTEX_TEXTURE_IMAGE_UNITS={name:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",value:35660,description:" "},p.MAX_TEXTURE_IMAGE_UNITS={name:"MAX_TEXTURE_IMAGE_UNITS",value:34930,description:"Implementation dependent number of maximum texture units. At least 8."},p.MAX_FRAGMENT_UNIFORM_VECTORS={name:"MAX_FRAGMENT_UNIFORM_VECTORS",value:36349,description:" "},p.SHADER_TYPE={name:"SHADER_TYPE",value:35663,description:" "},p.SHADING_LANGUAGE_VERSION={name:"SHADING_LANGUAGE_VERSION",value:35724,description:" "},p.CURRENT_PROGRAM={name:"CURRENT_PROGRAM",value:35725,description:" "},p.NEVER={name:"NEVER",value:512,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn."},p.ALWAYS={name:"ALWAYS",value:519,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn."},p.LESS={name:"LESS",value:513,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value."},p.EQUAL={name:"EQUAL",value:514,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value."},p.LEQUAL={name:"LEQUAL",value:515,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value."},p.GREATER={name:"GREATER",value:516,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value."},p.GEQUAL={name:"GEQUAL",value:518,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value."},p.NOTEQUAL={name:"NOTEQUAL",value:517,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value."},p.KEEP={name:"KEEP",value:7680,description:" "},p.REPLACE={name:"REPLACE",value:7681,description:" "},p.INCR={name:"INCR",value:7682,description:" "},p.DECR={name:"DECR",value:7683,description:" "},p.INVERT={name:"INVERT",value:5386,description:" "},p.INCR_WRAP={name:"INCR_WRAP",value:34055,description:" "},p.DECR_WRAP={name:"DECR_WRAP",value:34056,description:" "},p.NEAREST={name:"NEAREST",value:9728,description:" "},p.LINEAR={name:"LINEAR",value:9729,description:" "},p.NEAREST_MIPMAP_NEAREST={name:"NEAREST_MIPMAP_NEAREST",value:9984,description:" "},p.LINEAR_MIPMAP_NEAREST={name:"LINEAR_MIPMAP_NEAREST",value:9985,description:" "},p.NEAREST_MIPMAP_LINEAR={name:"NEAREST_MIPMAP_LINEAR",value:9986,description:" "},p.LINEAR_MIPMAP_LINEAR={name:"LINEAR_MIPMAP_LINEAR",value:9987,description:" "},p.TEXTURE_MAG_FILTER={name:"TEXTURE_MAG_FILTER",value:10240,description:" "},p.TEXTURE_MIN_FILTER={name:"TEXTURE_MIN_FILTER",value:10241,description:" "},p.TEXTURE_WRAP_S={name:"TEXTURE_WRAP_S",value:10242,description:" "},p.TEXTURE_WRAP_T={name:"TEXTURE_WRAP_T",value:10243,description:" "},p.TEXTURE_2D={name:"TEXTURE_2D",value:3553,description:" "},p.TEXTURE={name:"TEXTURE",value:5890,description:" "},p.TEXTURE_CUBE_MAP={name:"TEXTURE_CUBE_MAP",value:34067,description:" "},p.TEXTURE_BINDING_CUBE_MAP={name:"TEXTURE_BINDING_CUBE_MAP",value:34068,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_X={name:"TEXTURE_CUBE_MAP_POSITIVE_X",value:34069,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_X={name:"TEXTURE_CUBE_MAP_NEGATIVE_X",value:34070,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Y={name:"TEXTURE_CUBE_MAP_POSITIVE_Y",value:34071,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Y={name:"TEXTURE_CUBE_MAP_NEGATIVE_Y",value:34072,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Z={name:"TEXTURE_CUBE_MAP_POSITIVE_Z",value:34073,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Z={name:"TEXTURE_CUBE_MAP_NEGATIVE_Z",value:34074,description:" "},p.MAX_CUBE_MAP_TEXTURE_SIZE={name:"MAX_CUBE_MAP_TEXTURE_SIZE",value:34076,description:" "},p.TEXTURE0={name:"TEXTURE0",value:33984,description:"A texture unit."},p.TEXTURE1={name:"TEXTURE1",value:33985,description:"A texture unit."},p.TEXTURE2={name:"TEXTURE2",value:33986,description:"A texture unit."},p.TEXTURE3={name:"TEXTURE3",value:33987,description:"A texture unit."},p.TEXTURE4={name:"TEXTURE4",value:33988,description:"A texture unit."},p.TEXTURE5={name:"TEXTURE5",value:33989,description:"A texture unit."},p.TEXTURE6={name:"TEXTURE6",value:33990,description:"A texture unit."},p.TEXTURE7={name:"TEXTURE7",value:33991,description:"A texture unit."},p.TEXTURE8={name:"TEXTURE8",value:33992,description:"A texture unit."},p.TEXTURE9={name:"TEXTURE9",value:33993,description:"A texture unit."},p.TEXTURE10={name:"TEXTURE10",value:33994,description:"A texture unit."},p.TEXTURE11={name:"TEXTURE11",value:33995,description:"A texture unit."},p.TEXTURE12={name:"TEXTURE12",value:33996,description:"A texture unit."},p.TEXTURE13={name:"TEXTURE13",value:33997,description:"A texture unit."},p.TEXTURE14={name:"TEXTURE14",value:33998,description:"A texture unit."},p.TEXTURE15={name:"TEXTURE15",value:33999,description:"A texture unit."},p.TEXTURE16={name:"TEXTURE16",value:34e3,description:"A texture unit."},p.TEXTURE17={name:"TEXTURE17",value:34001,description:"A texture unit."},p.TEXTURE18={name:"TEXTURE18",value:34002,description:"A texture unit."},p.TEXTURE19={name:"TEXTURE19",value:34003,description:"A texture unit."},p.TEXTURE20={name:"TEXTURE20",value:34004,description:"A texture unit."},p.TEXTURE21={name:"TEXTURE21",value:34005,description:"A texture unit."},p.TEXTURE22={name:"TEXTURE22",value:34006,description:"A texture unit."},p.TEXTURE23={name:"TEXTURE23",value:34007,description:"A texture unit."},p.TEXTURE24={name:"TEXTURE24",value:34008,description:"A texture unit."},p.TEXTURE25={name:"TEXTURE25",value:34009,description:"A texture unit."},p.TEXTURE26={name:"TEXTURE26",value:34010,description:"A texture unit."},p.TEXTURE27={name:"TEXTURE27",value:34011,description:"A texture unit."},p.TEXTURE28={name:"TEXTURE28",value:34012,description:"A texture unit."},p.TEXTURE29={name:"TEXTURE29",value:34013,description:"A texture unit."},p.TEXTURE30={name:"TEXTURE30",value:34014,description:"A texture unit."},p.TEXTURE31={name:"TEXTURE31",value:34015,description:"A texture unit."},p.ACTIVE_TEXTURE={name:"ACTIVE_TEXTURE",value:34016,description:"The current active texture unit."},p.REPEAT={name:"REPEAT",value:10497,description:" "},p.CLAMP_TO_EDGE={name:"CLAMP_TO_EDGE",value:33071,description:" "},p.MIRRORED_REPEAT={name:"MIRRORED_REPEAT",value:33648,description:" "},p.FLOAT_VEC2={name:"FLOAT_VEC2",value:35664,description:" "},p.FLOAT_VEC3={name:"FLOAT_VEC3",value:35665,description:" "},p.FLOAT_VEC4={name:"FLOAT_VEC4",value:35666,description:" "},p.INT_VEC2={name:"INT_VEC2",value:35667,description:" "},p.INT_VEC3={name:"INT_VEC3",value:35668,description:" "},p.INT_VEC4={name:"INT_VEC4",value:35669,description:" "},p.BOOL={name:"BOOL",value:35670,description:" "},p.BOOL_VEC2={name:"BOOL_VEC2",value:35671,description:" "},p.BOOL_VEC3={name:"BOOL_VEC3",value:35672,description:" "},p.BOOL_VEC4={name:"BOOL_VEC4",value:35673,description:" "},p.FLOAT_MAT2={name:"FLOAT_MAT2",value:35674,description:" "},p.FLOAT_MAT3={name:"FLOAT_MAT3",value:35675,description:" "},p.FLOAT_MAT4={name:"FLOAT_MAT4",value:35676,description:" "},p.SAMPLER_2D={name:"SAMPLER_2D",value:35678,description:" "},p.SAMPLER_CUBE={name:"SAMPLER_CUBE",value:35680,description:" "},p.LOW_FLOAT={name:"LOW_FLOAT",value:36336,description:" "},p.MEDIUM_FLOAT={name:"MEDIUM_FLOAT",value:36337,description:" "},p.HIGH_FLOAT={name:"HIGH_FLOAT",value:36338,description:" "},p.LOW_INT={name:"LOW_INT",value:36339,description:" "},p.MEDIUM_INT={name:"MEDIUM_INT",value:36340,description:" "},p.HIGH_INT={name:"HIGH_INT",value:36341,description:" "},p.FRAMEBUFFER={name:"FRAMEBUFFER",value:36160,description:" "},p.RENDERBUFFER={name:"RENDERBUFFER",value:36161,description:" "},p.RGBA4={name:"RGBA4",value:32854,description:" "},p.RGB5_A1={name:"RGB5_A1",value:32855,description:" "},p.RGB565={name:"RGB565",value:36194,description:" "},p.DEPTH_COMPONENT16={name:"DEPTH_COMPONENT16",value:33189,description:" "},p.STENCIL_INDEX={name:"STENCIL_INDEX",value:6401,description:" "},p.STENCIL_INDEX8={name:"STENCIL_INDEX8",value:36168,description:" "},p.DEPTH_STENCIL={name:"DEPTH_STENCIL",value:34041,description:" "},p.RENDERBUFFER_WIDTH={name:"RENDERBUFFER_WIDTH",value:36162,description:" "},p.RENDERBUFFER_HEIGHT={name:"RENDERBUFFER_HEIGHT",value:36163,description:" "},p.RENDERBUFFER_INTERNAL_FORMAT={name:"RENDERBUFFER_INTERNAL_FORMAT",value:36164,description:" "},p.RENDERBUFFER_RED_SIZE={name:"RENDERBUFFER_RED_SIZE",value:36176,description:" "},p.RENDERBUFFER_GREEN_SIZE={name:"RENDERBUFFER_GREEN_SIZE",value:36177,description:" "},p.RENDERBUFFER_BLUE_SIZE={name:"RENDERBUFFER_BLUE_SIZE",value:36178,description:" "},p.RENDERBUFFER_ALPHA_SIZE={name:"RENDERBUFFER_ALPHA_SIZE",value:36179,description:" "},p.RENDERBUFFER_DEPTH_SIZE={name:"RENDERBUFFER_DEPTH_SIZE",value:36180,description:" "},p.RENDERBUFFER_STENCIL_SIZE={name:"RENDERBUFFER_STENCIL_SIZE",value:36181,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",value:36048,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",value:36049,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",value:36050,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",value:36051,description:" "},p.COLOR_ATTACHMENT0={name:"COLOR_ATTACHMENT0",value:36064,description:" "},p.DEPTH_ATTACHMENT={name:"DEPTH_ATTACHMENT",value:36096,description:" "},p.STENCIL_ATTACHMENT={name:"STENCIL_ATTACHMENT",value:36128,description:" "},p.DEPTH_STENCIL_ATTACHMENT={name:"DEPTH_STENCIL_ATTACHMENT",value:33306,description:" "},p.NONE={name:"NONE",value:0,description:" "},p.FRAMEBUFFER_COMPLETE={name:"FRAMEBUFFER_COMPLETE",value:36053,description:" "},p.FRAMEBUFFER_INCOMPLETE_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",value:36054,description:" "},p.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",value:36055,description:" "},p.FRAMEBUFFER_INCOMPLETE_DIMENSIONS={name:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",value:36057,description:" "},p.FRAMEBUFFER_UNSUPPORTED={name:"FRAMEBUFFER_UNSUPPORTED",value:36061,description:" "},p.FRAMEBUFFER_BINDING={name:"FRAMEBUFFER_BINDING",value:36006,description:" "},p.RENDERBUFFER_BINDING={name:"RENDERBUFFER_BINDING",value:36007,description:" "},p.MAX_RENDERBUFFER_SIZE={name:"MAX_RENDERBUFFER_SIZE",value:34024,description:" "},p.INVALID_FRAMEBUFFER_OPERATION={name:"INVALID_FRAMEBUFFER_OPERATION",value:1286,description:" "},p.UNPACK_FLIP_Y_WEBGL={name:"UNPACK_FLIP_Y_WEBGL",value:37440,description:" "},p.UNPACK_PREMULTIPLY_ALPHA_WEBGL={name:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",value:37441,description:" "},p.UNPACK_COLORSPACE_CONVERSION_WEBGL={name:"UNPACK_COLORSPACE_CONVERSION_WEBGL",value:37443,description:" "},p.READ_BUFFER={name:"READ_BUFFER",value:3074,description:" "},p.UNPACK_ROW_LENGTH={name:"UNPACK_ROW_LENGTH",value:3314,description:" "},p.UNPACK_SKIP_ROWS={name:"UNPACK_SKIP_ROWS",value:3315,description:" "},p.UNPACK_SKIP_PIXELS={name:"UNPACK_SKIP_PIXELS",value:3316,description:" "},p.PACK_ROW_LENGTH={name:"PACK_ROW_LENGTH",value:3330,description:" "},p.PACK_SKIP_ROWS={name:"PACK_SKIP_ROWS",value:3331,description:" "},p.PACK_SKIP_PIXELS={name:"PACK_SKIP_PIXELS",value:3332,description:" "},p.TEXTURE_BINDING_3D={name:"TEXTURE_BINDING_3D",value:32874,description:" "},p.UNPACK_SKIP_IMAGES={name:"UNPACK_SKIP_IMAGES",value:32877,description:" "},p.UNPACK_IMAGE_HEIGHT={name:"UNPACK_IMAGE_HEIGHT",value:32878,description:" "},p.MAX_3D_TEXTURE_SIZE={name:"MAX_3D_TEXTURE_SIZE",value:32883,description:" "},p.MAX_ELEMENTS_VERTICES={name:"MAX_ELEMENTS_VERTICES",value:33e3,description:" "},p.MAX_ELEMENTS_INDICES={name:"MAX_ELEMENTS_INDICES",value:33001,description:" "},p.MAX_TEXTURE_LOD_BIAS={name:"MAX_TEXTURE_LOD_BIAS",value:34045,description:" "},p.MAX_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_FRAGMENT_UNIFORM_COMPONENTS",value:35657,description:" "},p.MAX_VERTEX_UNIFORM_COMPONENTS={name:"MAX_VERTEX_UNIFORM_COMPONENTS",value:35658,description:" "},p.MAX_ARRAY_TEXTURE_LAYERS={name:"MAX_ARRAY_TEXTURE_LAYERS",value:35071,description:" "},p.MIN_PROGRAM_TEXEL_OFFSET={name:"MIN_PROGRAM_TEXEL_OFFSET",value:35076,description:" "},p.MAX_PROGRAM_TEXEL_OFFSET={name:"MAX_PROGRAM_TEXEL_OFFSET",value:35077,description:" "},p.MAX_VARYING_COMPONENTS={name:"MAX_VARYING_COMPONENTS",value:35659,description:" "},p.FRAGMENT_SHADER_DERIVATIVE_HINT={name:"FRAGMENT_SHADER_DERIVATIVE_HINT",value:35723,description:" "},p.RASTERIZER_DISCARD={name:"RASTERIZER_DISCARD",value:35977,description:" "},p.VERTEX_ARRAY_BINDING={name:"VERTEX_ARRAY_BINDING",value:34229,description:" "},p.MAX_VERTEX_OUTPUT_COMPONENTS={name:"MAX_VERTEX_OUTPUT_COMPONENTS",value:37154,description:" "},p.MAX_FRAGMENT_INPUT_COMPONENTS={name:"MAX_FRAGMENT_INPUT_COMPONENTS",value:37157,description:" "},p.MAX_SERVER_WAIT_TIMEOUT={name:"MAX_SERVER_WAIT_TIMEOUT",value:37137,description:" "},p.MAX_ELEMENT_INDEX={name:"MAX_ELEMENT_INDEX",value:36203,description:" "},p.RED={name:"RED",value:6403,description:" "},p.RGB8={name:"RGB8",value:32849,description:" "},p.RGBA8={name:"RGBA8",value:32856,description:" "},p.RGB10_A2={name:"RGB10_A2",value:32857,description:" "},p.TEXTURE_3D={name:"TEXTURE_3D",value:32879,description:" "},p.TEXTURE_WRAP_R={name:"TEXTURE_WRAP_R",value:32882,description:" "},p.TEXTURE_MIN_LOD={name:"TEXTURE_MIN_LOD",value:33082,description:" "},p.TEXTURE_MAX_LOD={name:"TEXTURE_MAX_LOD",value:33083,description:" "},p.TEXTURE_BASE_LEVEL={name:"TEXTURE_BASE_LEVEL",value:33084,description:" "},p.TEXTURE_MAX_LEVEL={name:"TEXTURE_MAX_LEVEL",value:33085,description:" "},p.TEXTURE_COMPARE_MODE={name:"TEXTURE_COMPARE_MODE",value:34892,description:" "},p.TEXTURE_COMPARE_FUNC={name:"TEXTURE_COMPARE_FUNC",value:34893,description:" "},p.SRGB={name:"SRGB",value:35904,description:" "},p.SRGB8={name:"SRGB8",value:35905,description:" "},p.SRGB8_ALPHA8={name:"SRGB8_ALPHA8",value:35907,description:" "},p.COMPARE_REF_TO_TEXTURE={name:"COMPARE_REF_TO_TEXTURE",value:34894,description:" "},p.RGBA32F={name:"RGBA32F",value:34836,description:" "},p.RGB32F={name:"RGB32F",value:34837,description:" "},p.RGBA16F={name:"RGBA16F",value:34842,description:" "},p.RGB16F={name:"RGB16F",value:34843,description:" "},p.TEXTURE_2D_ARRAY={name:"TEXTURE_2D_ARRAY",value:35866,description:" "},p.TEXTURE_BINDING_2D_ARRAY={name:"TEXTURE_BINDING_2D_ARRAY",value:35869,description:" "},p.R11F_G11F_B10F={name:"R11F_G11F_B10F",value:35898,description:" "},p.RGB9_E5={name:"RGB9_E5",value:35901,description:" "},p.RGBA32UI={name:"RGBA32UI",value:36208,description:" "},p.RGB32UI={name:"RGB32UI",value:36209,description:" "},p.RGBA16UI={name:"RGBA16UI",value:36214,description:" "},p.RGB16UI={name:"RGB16UI",value:36215,description:" "},p.RGBA8UI={name:"RGBA8UI",value:36220,description:" "},p.RGB8UI={name:"RGB8UI",value:36221,description:" "},p.RGBA32I={name:"RGBA32I",value:36226,description:" "},p.RGB32I={name:"RGB32I",value:36227,description:" "},p.RGBA16I={name:"RGBA16I",value:36232,description:" "},p.RGB16I={name:"RGB16I",value:36233,description:" "},p.RGBA8I={name:"RGBA8I",value:36238,description:" "},p.RGB8I={name:"RGB8I",value:36239,description:" "},p.RED_INTEGER={name:"RED_INTEGER",value:36244,description:" "},p.RGB_INTEGER={name:"RGB_INTEGER",value:36248,description:" "},p.RGBA_INTEGER={name:"RGBA_INTEGER",value:36249,description:" "},p.R8={name:"R8",value:33321,description:" "},p.RG8={name:"RG8",value:33323,description:" "},p.R16F={name:"R16F",value:33325,description:" "},p.R32F={name:"R32F",value:33326,description:" "},p.RG16F={name:"RG16F",value:33327,description:" "},p.RG32F={name:"RG32F",value:33328,description:" "},p.R8I={name:"R8I",value:33329,description:" "},p.R8UI={name:"R8UI",value:33330,description:" "},p.R16I={name:"R16I",value:33331,description:" "},p.R16UI={name:"R16UI",value:33332,description:" "},p.R32I={name:"R32I",value:33333,description:" "},p.R32UI={name:"R32UI",value:33334,description:" "},p.RG8I={name:"RG8I",value:33335,description:" "},p.RG8UI={name:"RG8UI",value:33336,description:" "},p.RG16I={name:"RG16I",value:33337,description:" "},p.RG16UI={name:"RG16UI",value:33338,description:" "},p.RG32I={name:"RG32I",value:33339,description:" "},p.RG32UI={name:"RG32UI",value:33340,description:" "},p.R8_SNORM={name:"R8_SNORM",value:36756,description:" "},p.RG8_SNORM={name:"RG8_SNORM",value:36757,description:" "},p.RGB8_SNORM={name:"RGB8_SNORM",value:36758,description:" "},p.RGBA8_SNORM={name:"RGBA8_SNORM",value:36759,description:" "},p.RGB10_A2UI={name:"RGB10_A2UI",value:36975,description:" "},p.TEXTURE_IMMUTABLE_FORMAT={name:"TEXTURE_IMMUTABLE_FORMAT",value:37167,description:" "},p.TEXTURE_IMMUTABLE_LEVELS={name:"TEXTURE_IMMUTABLE_LEVELS",value:33503,description:" "},p.UNSIGNED_INT_2_10_10_10_REV={name:"UNSIGNED_INT_2_10_10_10_REV",value:33640,description:" "},p.UNSIGNED_INT_10F_11F_11F_REV={name:"UNSIGNED_INT_10F_11F_11F_REV",value:35899,description:" "},p.UNSIGNED_INT_5_9_9_9_REV={name:"UNSIGNED_INT_5_9_9_9_REV",value:35902,description:" "},p.FLOAT_32_UNSIGNED_INT_24_8_REV={name:"FLOAT_32_UNSIGNED_INT_24_8_REV",value:36269,description:" "},p.UNSIGNED_INT_24_8={name:"UNSIGNED_INT_24_8",value:34042,description:" "},p.HALF_FLOAT={name:"HALF_FLOAT",value:5131,description:" "},p.RG={name:"RG",value:33319,description:" "},p.RG_INTEGER={name:"RG_INTEGER",value:33320,description:" "},p.INT_2_10_10_10_REV={name:"INT_2_10_10_10_REV",value:36255,description:" "},p.CURRENT_QUERY={name:"CURRENT_QUERY",value:34917,description:" "},p.QUERY_RESULT={name:"QUERY_RESULT",value:34918,description:" "},p.QUERY_RESULT_AVAILABLE={name:"QUERY_RESULT_AVAILABLE",value:34919,description:" "},p.ANY_SAMPLES_PASSED={name:"ANY_SAMPLES_PASSED",value:35887,description:" "},p.ANY_SAMPLES_PASSED_CONSERVATIVE={name:"ANY_SAMPLES_PASSED_CONSERVATIVE",value:36202,description:" "},p.MAX_DRAW_BUFFERS={name:"MAX_DRAW_BUFFERS",value:34852,description:" "},p.DRAW_BUFFER0={name:"DRAW_BUFFER0",value:34853,description:" "},p.DRAW_BUFFER1={name:"DRAW_BUFFER1",value:34854,description:" "},p.DRAW_BUFFER2={name:"DRAW_BUFFER2",value:34855,description:" "},p.DRAW_BUFFER3={name:"DRAW_BUFFER3",value:34856,description:" "},p.DRAW_BUFFER4={name:"DRAW_BUFFER4",value:34857,description:" "},p.DRAW_BUFFER5={name:"DRAW_BUFFER5",value:34858,description:" "},p.DRAW_BUFFER6={name:"DRAW_BUFFER6",value:34859,description:" "},p.DRAW_BUFFER7={name:"DRAW_BUFFER7",value:34860,description:" "},p.DRAW_BUFFER8={name:"DRAW_BUFFER8",value:34861,description:" "},p.DRAW_BUFFER9={name:"DRAW_BUFFER9",value:34862,description:" "},p.DRAW_BUFFER10={name:"DRAW_BUFFER10",value:34863,description:" "},p.DRAW_BUFFER11={name:"DRAW_BUFFER11",value:34864,description:" "},p.DRAW_BUFFER12={name:"DRAW_BUFFER12",value:34865,description:" "},p.DRAW_BUFFER13={name:"DRAW_BUFFER13",value:34866,description:" "},p.DRAW_BUFFER14={name:"DRAW_BUFFER14",value:34867,description:" "},p.DRAW_BUFFER15={name:"DRAW_BUFFER15",value:34868,description:" "},p.MAX_COLOR_ATTACHMENTS={name:"MAX_COLOR_ATTACHMENTS",value:36063,description:" "},p.COLOR_ATTACHMENT1={name:"COLOR_ATTACHMENT1",value:36065,description:" "},p.COLOR_ATTACHMENT2={name:"COLOR_ATTACHMENT2",value:36066,description:" "},p.COLOR_ATTACHMENT3={name:"COLOR_ATTACHMENT3",value:36067,description:" "},p.COLOR_ATTACHMENT4={name:"COLOR_ATTACHMENT4",value:36068,description:" "},p.COLOR_ATTACHMENT5={name:"COLOR_ATTACHMENT5",value:36069,description:" "},p.COLOR_ATTACHMENT6={name:"COLOR_ATTACHMENT6",value:36070,description:" "},p.COLOR_ATTACHMENT7={name:"COLOR_ATTACHMENT7",value:36071,description:" "},p.COLOR_ATTACHMENT8={name:"COLOR_ATTACHMENT8",value:36072,description:" "},p.COLOR_ATTACHMENT9={name:"COLOR_ATTACHMENT9",value:36073,description:" "},p.COLOR_ATTACHMENT10={name:"COLOR_ATTACHMENT10",value:36074,description:" "},p.COLOR_ATTACHMENT11={name:"COLOR_ATTACHMENT11",value:36075,description:" "},p.COLOR_ATTACHMENT12={name:"COLOR_ATTACHMENT12",value:36076,description:" "},p.COLOR_ATTACHMENT13={name:"COLOR_ATTACHMENT13",value:36077,description:" "},p.COLOR_ATTACHMENT14={name:"COLOR_ATTACHMENT14",value:36078,description:" "},p.COLOR_ATTACHMENT15={name:"COLOR_ATTACHMENT15",value:36079,description:" "},p.SAMPLER_3D={name:"SAMPLER_3D",value:35679,description:" "},p.SAMPLER_2D_SHADOW={name:"SAMPLER_2D_SHADOW",value:35682,description:" "},p.SAMPLER_2D_ARRAY={name:"SAMPLER_2D_ARRAY",value:36289,description:" "},p.SAMPLER_2D_ARRAY_SHADOW={name:"SAMPLER_2D_ARRAY_SHADOW",value:36292,description:" "},p.SAMPLER_CUBE_SHADOW={name:"SAMPLER_CUBE_SHADOW",value:36293,description:" "},p.INT_SAMPLER_2D={name:"INT_SAMPLER_2D",value:36298,description:" "},p.INT_SAMPLER_3D={name:"INT_SAMPLER_3D",value:36299,description:" "},p.INT_SAMPLER_CUBE={name:"INT_SAMPLER_CUBE",value:36300,description:" "},p.INT_SAMPLER_2D_ARRAY={name:"INT_SAMPLER_2D_ARRAY",value:36303,description:" "},p.UNSIGNED_INT_SAMPLER_2D={name:"UNSIGNED_INT_SAMPLER_2D",value:36306,description:" "},p.UNSIGNED_INT_SAMPLER_3D={name:"UNSIGNED_INT_SAMPLER_3D",value:36307,description:" "},p.UNSIGNED_INT_SAMPLER_CUBE={name:"UNSIGNED_INT_SAMPLER_CUBE",value:36308,description:" "},p.UNSIGNED_INT_SAMPLER_2D_ARRAY={name:"UNSIGNED_INT_SAMPLER_2D_ARRAY",value:36311,description:" "},p.MAX_SAMPLES={name:"MAX_SAMPLES",value:36183,description:" "},p.SAMPLER_BINDING={name:"SAMPLER_BINDING",value:35097,description:" "},p.PIXEL_PACK_BUFFER={name:"PIXEL_PACK_BUFFER",value:35051,description:" "},p.PIXEL_UNPACK_BUFFER={name:"PIXEL_UNPACK_BUFFER",value:35052,description:" "},p.PIXEL_PACK_BUFFER_BINDING={name:"PIXEL_PACK_BUFFER_BINDING",value:35053,description:" "},p.PIXEL_UNPACK_BUFFER_BINDING={name:"PIXEL_UNPACK_BUFFER_BINDING",value:35055,description:" "},p.COPY_READ_BUFFER={name:"COPY_READ_BUFFER",value:36662,description:" "},p.COPY_WRITE_BUFFER={name:"COPY_WRITE_BUFFER",value:36663,description:" "},p.COPY_READ_BUFFER_BINDING={name:"COPY_READ_BUFFER_BINDING",value:36662,description:" "},p.COPY_WRITE_BUFFER_BINDING={name:"COPY_WRITE_BUFFER_BINDING",value:36663,description:" "},p.FLOAT_MAT2x3={name:"FLOAT_MAT2x3",value:35685,description:" "},p.FLOAT_MAT2x4={name:"FLOAT_MAT2x4",value:35686,description:" "},p.FLOAT_MAT3x2={name:"FLOAT_MAT3x2",value:35687,description:" "},p.FLOAT_MAT3x4={name:"FLOAT_MAT3x4",value:35688,description:" "},p.FLOAT_MAT4x2={name:"FLOAT_MAT4x2",value:35689,description:" "},p.FLOAT_MAT4x3={name:"FLOAT_MAT4x3",value:35690,description:" "},p.UNSIGNED_INT_VEC2={name:"UNSIGNED_INT_VEC2",value:36294,description:" "},p.UNSIGNED_INT_VEC3={name:"UNSIGNED_INT_VEC3",value:36295,description:" "},p.UNSIGNED_INT_VEC4={name:"UNSIGNED_INT_VEC4",value:36296,description:" "},p.UNSIGNED_NORMALIZED={name:"UNSIGNED_NORMALIZED",value:35863,description:" "},p.SIGNED_NORMALIZED={name:"SIGNED_NORMALIZED",value:36764,description:" "},p.VERTEX_ATTRIB_ARRAY_INTEGER={name:"VERTEX_ATTRIB_ARRAY_INTEGER",value:35069,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR={name:"VERTEX_ATTRIB_ARRAY_DIVISOR",value:35070,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_MODE={name:"TRANSFORM_FEEDBACK_BUFFER_MODE",value:35967,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",value:35968,description:" "},p.TRANSFORM_FEEDBACK_VARYINGS={name:"TRANSFORM_FEEDBACK_VARYINGS",value:35971,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_START={name:"TRANSFORM_FEEDBACK_BUFFER_START",value:35972,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_SIZE={name:"TRANSFORM_FEEDBACK_BUFFER_SIZE",value:35973,description:" "},p.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN={name:"TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",value:35976,description:" "},p.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",value:35978,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",value:35979,description:" "},p.INTERLEAVED_ATTRIBS={name:"INTERLEAVED_ATTRIBS",value:35980,description:" "},p.SEPARATE_ATTRIBS={name:"SEPARATE_ATTRIBS",value:35981,description:" "},p.TRANSFORM_FEEDBACK_BUFFER={name:"TRANSFORM_FEEDBACK_BUFFER",value:35982,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_BINDING={name:"TRANSFORM_FEEDBACK_BUFFER_BINDING",value:35983,description:" "},p.TRANSFORM_FEEDBACK={name:"TRANSFORM_FEEDBACK",value:36386,description:" "},p.TRANSFORM_FEEDBACK_PAUSED={name:"TRANSFORM_FEEDBACK_PAUSED",value:36387,description:" "},p.TRANSFORM_FEEDBACK_ACTIVE={name:"TRANSFORM_FEEDBACK_ACTIVE",value:36388,description:" "},p.TRANSFORM_FEEDBACK_BINDING={name:"TRANSFORM_FEEDBACK_BINDING",value:36389,description:" "},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",value:33296,description:" "},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",value:33297,description:" "},p.FRAMEBUFFER_ATTACHMENT_RED_SIZE={name:"FRAMEBUFFER_ATTACHMENT_RED_SIZE",value:33298,description:" "},p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE={name:"FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",value:33299,description:" "},p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE={name:"FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",value:33300,description:" "},p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE={name:"FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",value:33301,description:" "},p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE={name:"FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",value:33302,description:" "},p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE={name:"FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",value:33303,description:" "},p.FRAMEBUFFER_DEFAULT={name:"FRAMEBUFFER_DEFAULT",value:33304,description:" "},p.DEPTH24_STENCIL8={name:"DEPTH24_STENCIL8",value:35056,description:" "},p.DRAW_FRAMEBUFFER_BINDING={name:"DRAW_FRAMEBUFFER_BINDING",value:36006,description:" "},p.READ_FRAMEBUFFER={name:"READ_FRAMEBUFFER",value:36008,description:" "},p.DRAW_FRAMEBUFFER={name:"DRAW_FRAMEBUFFER",value:36009,description:" "},p.READ_FRAMEBUFFER_BINDING={name:"READ_FRAMEBUFFER_BINDING",value:36010,description:" "},p.RENDERBUFFER_SAMPLES={name:"RENDERBUFFER_SAMPLES",value:36011,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",value:36052,description:" "},p.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE={name:"FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",value:36182,description:" "},p.UNIFORM_BUFFER={name:"UNIFORM_BUFFER",value:35345,description:" "},p.UNIFORM_BUFFER_BINDING={name:"UNIFORM_BUFFER_BINDING",value:35368,description:" "},p.UNIFORM_BUFFER_START={name:"UNIFORM_BUFFER_START",value:35369,description:" "},p.UNIFORM_BUFFER_SIZE={name:"UNIFORM_BUFFER_SIZE",value:35370,description:" "},p.MAX_VERTEX_UNIFORM_BLOCKS={name:"MAX_VERTEX_UNIFORM_BLOCKS",value:35371,description:" "},p.MAX_FRAGMENT_UNIFORM_BLOCKS={name:"MAX_FRAGMENT_UNIFORM_BLOCKS",value:35373,description:" "},p.MAX_COMBINED_UNIFORM_BLOCKS={name:"MAX_COMBINED_UNIFORM_BLOCKS",value:35374,description:" "},p.MAX_UNIFORM_BUFFER_BINDINGS={name:"MAX_UNIFORM_BUFFER_BINDINGS",value:35375,description:" "},p.MAX_UNIFORM_BLOCK_SIZE={name:"MAX_UNIFORM_BLOCK_SIZE",value:35376,description:" "},p.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS={name:"MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",value:35377,description:" "},p.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",value:35379,description:" "},p.UNIFORM_BUFFER_OFFSET_ALIGNMENT={name:"UNIFORM_BUFFER_OFFSET_ALIGNMENT",value:35380,description:" "},p.ACTIVE_UNIFORM_BLOCKS={name:"ACTIVE_UNIFORM_BLOCKS",value:35382,description:" "},p.UNIFORM_TYPE={name:"UNIFORM_TYPE",value:35383,description:" "},p.UNIFORM_SIZE={name:"UNIFORM_SIZE",value:35384,description:" "},p.UNIFORM_BLOCK_INDEX={name:"UNIFORM_BLOCK_INDEX",value:35386,description:" "},p.UNIFORM_OFFSET={name:"UNIFORM_OFFSET",value:35387,description:" "},p.UNIFORM_ARRAY_STRIDE={name:"UNIFORM_ARRAY_STRIDE",value:35388,description:" "},p.UNIFORM_MATRIX_STRIDE={name:"UNIFORM_MATRIX_STRIDE",value:35389,description:" "},p.UNIFORM_IS_ROW_MAJOR={name:"UNIFORM_IS_ROW_MAJOR",value:35390,description:" "},p.UNIFORM_BLOCK_BINDING={name:"UNIFORM_BLOCK_BINDING",value:35391,description:" "},p.UNIFORM_BLOCK_DATA_SIZE={name:"UNIFORM_BLOCK_DATA_SIZE",value:35392,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORMS={name:"UNIFORM_BLOCK_ACTIVE_UNIFORMS",value:35394,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES={name:"UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",value:35395,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",value:35396,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",value:35398,description:" "},p.OBJECT_TYPE={name:"OBJECT_TYPE",value:37138,description:" "},p.SYNC_CONDITION={name:"SYNC_CONDITION",value:37139,description:" "},p.SYNC_STATUS={name:"SYNC_STATUS",value:37140,description:" "},p.SYNC_FLAGS={name:"SYNC_FLAGS",value:37141,description:" "},p.SYNC_FENCE={name:"SYNC_FENCE",value:37142,description:" "},p.SYNC_GPU_COMMANDS_COMPLETE={name:"SYNC_GPU_COMMANDS_COMPLETE",value:37143,description:" "},p.UNSIGNALED={name:"UNSIGNALED",value:37144,description:" "},p.SIGNALED={name:"SIGNALED",value:37145,description:" "},p.ALREADY_SIGNALED={name:"ALREADY_SIGNALED",value:37146,description:" "},p.TIMEOUT_EXPIRED={name:"TIMEOUT_EXPIRED",value:37147,description:" "},p.CONDITION_SATISFIED={name:"CONDITION_SATISFIED",value:37148,description:" "},p.WAIT_FAILED={name:"WAIT_FAILED",value:37149,description:" "},p.SYNC_FLUSH_COMMANDS_BIT={name:"SYNC_FLUSH_COMMANDS_BIT",value:1,description:" "},p.COLOR={name:"COLOR",value:6144,description:" "},p.DEPTH={name:"DEPTH",value:6145,description:" "},p.STENCIL={name:"STENCIL",value:6146,description:" "},p.MIN={name:"MIN",value:32775,description:" "},p.MAX={name:"MAX",value:32776,description:" "},p.DEPTH_COMPONENT24={name:"DEPTH_COMPONENT24",value:33190,description:" "},p.STREAM_READ={name:"STREAM_READ",value:35041,description:" "},p.STREAM_COPY={name:"STREAM_COPY",value:35042,description:" "},p.STATIC_READ={name:"STATIC_READ",value:35045,description:" "},p.STATIC_COPY={name:"STATIC_COPY",value:35046,description:" "},p.DYNAMIC_READ={name:"DYNAMIC_READ",value:35049,description:" "},p.DYNAMIC_COPY={name:"DYNAMIC_COPY",value:35050,description:" "},p.DEPTH_COMPONENT32F={name:"DEPTH_COMPONENT32F",value:36012,description:" "},p.DEPTH32F_STENCIL8={name:"DEPTH32F_STENCIL8",value:36013,description:" "},p.INVALID_INDEX={name:"INVALID_INDEX",value:4294967295,description:" "},p.TIMEOUT_IGNORED={name:"TIMEOUT_IGNORED",value:-1,description:" "},p.MAX_CLIENT_WAIT_TIMEOUT_WEBGL={name:"MAX_CLIENT_WAIT_TIMEOUT_WEBGL",value:37447,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE={name:"VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",value:35070,description:"Describes the frequency divisor used for instanced rendering.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_VENDOR_WEBGL={name:"UNMASKED_VENDOR_WEBGL",value:37445,description:"Passed to getParameter to get the vendor string of the graphics driver.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_RENDERER_WEBGL={name:"UNMASKED_RENDERER_WEBGL",value:37446,description:"Passed to getParameter to get the renderer string of the graphics driver.",extensionName:"WEBGL_debug_renderer_info"},p.MAX_TEXTURE_MAX_ANISOTROPY_EXT={name:"MAX_TEXTURE_MAX_ANISOTROPY_EXT",value:34047,description:"Returns the maximum available anisotropy.",extensionName:"EXT_texture_filter_anisotropic"},p.TEXTURE_MAX_ANISOTROPY_EXT={name:"TEXTURE_MAX_ANISOTROPY_EXT",value:34046,description:"Passed to texParameter to set the desired maximum anisotropy for a texture.",extensionName:"EXT_texture_filter_anisotropic"},p.COMPRESSED_RGB_S3TC_DXT1_EXT={name:"COMPRESSED_RGB_S3TC_DXT1_EXT",value:33776,description:"A DXT1-compressed image in an RGB image format.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT1_EXT={name:"COMPRESSED_RGBA_S3TC_DXT1_EXT",value:33777,description:"A DXT1-compressed image in an RGB image format with a simple on/off alpha value.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT3_EXT={name:"COMPRESSED_RGBA_S3TC_DXT3_EXT",value:33778,description:"A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT5_EXT={name:"COMPRESSED_RGBA_S3TC_DXT5_EXT",value:33779,description:"A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_R11_EAC={name:"COMPRESSED_R11_EAC",value:37488,description:"One-channel (red) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_R11_EAC={name:"COMPRESSED_SIGNED_R11_EAC",value:37489,description:"One-channel (red) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RG11_EAC={name:"COMPRESSED_RG11_EAC",value:37490,description:"Two-channel (red and green) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_RG11_EAC={name:"COMPRESSED_SIGNED_RG11_EAC",value:37491,description:"Two-channel (red and green) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_ETC2={name:"COMPRESSED_RGB8_ETC2",value:37492,description:"Compresses RBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGBA8_ETC2_EAC={name:"COMPRESSED_RGBA8_ETC2_EAC",value:37493,description:"Compresses RGBA8 data. The RGB part is encoded the same as RGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ETC2={name:"COMPRESSED_SRGB8_ETC2",value:37494,description:"Compresses sRBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC={name:"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",value:37495,description:"Compresses sRGBA8 data. The sRGB part is encoded the same as SRGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37496,description:"Similar to RGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37497,description:"Similar to SRGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_4BPPV1_IMG",value:35840,description:"RGB compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",value:35842,description:"RGBA compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_2BPPV1_IMG",value:35841,description:"RGB compression in 2-bit mode. One block for each 8×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",value:35843,description:"RGBA compression in 2-bit mode. One block for each 8×4 pixe",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_ETC1_WEBGL={name:"COMPRESSED_RGB_ETC1_WEBGL",value:36196,description:"Compresses 24-bit RGB data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc1"},p.COMPRESSED_RGB_ATC_WEBGL={name:"COMPRESSED_RGB_ATC_WEBGL",value:35986,description:"Compresses RGB textures with no alpha channel.",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",value:35986,description:"Compresses RGBA textures using explicit alpha encoding (useful when alpha transitions are sharp).",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",value:34798,description:"Compresses RGBA textures using interpolated alpha encoding (useful when alpha transitions are gradient).",extensionName:"WEBGL_compressed_texture_atc"},p.UNSIGNED_INT_24_8_WEBGL={name:"UNSIGNED_INT_24_8_WEBGL",value:34042,description:"Unsigned integer type for 24-bit depth texture data.",extensionName:"WEBGL_depth_texture"},p.HALF_FLOAT_OES={name:"HALF_FLOAT_OES",value:36193,description:"Half floating-point type (16-bit).",extensionName:"OES_texture_half_float"},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",value:33297,description:" ",extensionName:"WEBGL_color_buffer_float"},p.UNSIGNED_NORMALIZED_EXT={name:"UNSIGNED_NORMALIZED_EXT",value:35863,description:" ",extensionName:"WEBGL_color_buffer_float"},p.MIN_EXT={name:"MIN_EXT",value:32775,description:"Produces the minimum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.MAX_EXT={name:"MAX_EXT",value:32776,description:"Produces the maximum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.SRGB_EXT={name:"SRGB_EXT",value:35904,description:"Unsized sRGB format that leaves the precision up to the driver.",extensionName:"EXT_sRGB"},p.SRGB_ALPHA_EXT={name:"SRGB_ALPHA_EXT",value:35906,description:"Unsized sRGB format with unsized alpha component.",extensionName:"EXT_sRGB"},p.SRGB8_ALPHA8_EXT={name:"SRGB8_ALPHA8_EXT",value:35907,description:"Sized (8-bit) sRGB and alpha formats.",extensionName:"EXT_sRGB"},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",value:33296,description:"Returns the framebuffer color encoding.",extensionName:"EXT_sRGB"},p.FRAGMENT_SHADER_DERIVATIVE_HINT_OES={name:"FRAGMENT_SHADER_DERIVATIVE_HINT_OES",value:35723,description:"Indicates the accuracy of the derivative calculation for the GLSL built-in functions: dFdx, dFdy, and fwidth.",extensionName:"OES_standard_derivatives"},p.COLOR_ATTACHMENT0_WEBGL={name:"COLOR_ATTACHMENT0_WEBGL",value:36064,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT1_WEBGL={name:"COLOR_ATTACHMENT1_WEBGL",value:36065,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT2_WEBGL={name:"COLOR_ATTACHMENT2_WEBGL",value:36066,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT3_WEBGL={name:"COLOR_ATTACHMENT3_WEBGL",value:36067,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT4_WEBGL={name:"COLOR_ATTACHMENT4_WEBGL",value:36068,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT5_WEBGL={name:"COLOR_ATTACHMENT5_WEBGL",value:36069,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT6_WEBGL={name:"COLOR_ATTACHMENT6_WEBGL",value:36070,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT7_WEBGL={name:"COLOR_ATTACHMENT7_WEBGL",value:36071,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT8_WEBGL={name:"COLOR_ATTACHMENT8_WEBGL",value:36072,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT9_WEBGL={name:"COLOR_ATTACHMENT9_WEBGL",value:36073,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT10_WEBGL={name:"COLOR_ATTACHMENT10_WEBGL",value:36074,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT11_WEBGL={name:"COLOR_ATTACHMENT11_WEBGL",value:36075,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT12_WEBGL={name:"COLOR_ATTACHMENT12_WEBGL",value:36076,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT13_WEBGL={name:"COLOR_ATTACHMENT13_WEBGL",value:36077,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT14_WEBGL={name:"COLOR_ATTACHMENT14_WEBGL",value:36078,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT15_WEBGL={name:"COLOR_ATTACHMENT15_WEBGL",value:36079,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER0_WEBGL={name:"DRAW_BUFFER0_WEBGL",value:34853,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER1_WEBGL={name:"DRAW_BUFFER1_WEBGL",value:34854,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER2_WEBGL={name:"DRAW_BUFFER2_WEBGL",value:34855,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER3_WEBGL={name:"DRAW_BUFFER3_WEBGL",value:34856,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER4_WEBGL={name:"DRAW_BUFFER4_WEBGL",value:34857,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER5_WEBGL={name:"DRAW_BUFFER5_WEBGL",value:34858,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER6_WEBGL={name:"DRAW_BUFFER6_WEBGL",value:34859,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER7_WEBGL={name:"DRAW_BUFFER7_WEBGL",value:34860,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER8_WEBGL={name:"DRAW_BUFFER8_WEBGL",value:34861,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER9_WEBGL={name:"DRAW_BUFFER9_WEBGL",value:34862,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER10_WEBGL={name:"DRAW_BUFFER10_WEBGL",value:34863,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER11_WEBGL={name:"DRAW_BUFFER11_WEBGL",value:34864,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER12_WEBGL={name:"DRAW_BUFFER12_WEBGL",value:34865,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER13_WEBGL={name:"DRAW_BUFFER13_WEBGL",value:34866,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER14_WEBGL={name:"DRAW_BUFFER14_WEBGL",value:34867,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER15_WEBGL={name:"DRAW_BUFFER15_WEBGL",value:34868,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.MAX_COLOR_ATTACHMENTS_WEBGL={name:"MAX_COLOR_ATTACHMENTS_WEBGL",value:36063,description:"Maximum number of framebuffer color attachment points",extensionName:"WEBGL_draw_buffers"},p.MAX_DRAW_BUFFERS_WEBGL={name:"MAX_DRAW_BUFFERS_WEBGL",value:34852,description:"Maximum number of draw buffers",extensionName:"WEBGL_draw_buffers"},p.VERTEX_ARRAY_BINDING_OES={name:"VERTEX_ARRAY_BINDING_OES",value:34229,description:"The bound vertex array object (VAO).",extensionName:"VERTEX_ARRAY_BINDING_OES"},p.QUERY_COUNTER_BITS_EXT={name:"QUERY_COUNTER_BITS_EXT",value:34916,description:"The number of bits used to hold the query result for the given target.",extensionName:"EXT_disjoint_timer_query"},p.CURRENT_QUERY_EXT={name:"CURRENT_QUERY_EXT",value:34917,description:"The currently active query.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_EXT={name:"QUERY_RESULT_EXT",value:34918,description:"The query result.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_AVAILABLE_EXT={name:"QUERY_RESULT_AVAILABLE_EXT",value:34919,description:"A Boolean indicating whether or not a query result is available.",extensionName:"EXT_disjoint_timer_query"},p.TIME_ELAPSED_EXT={name:"TIME_ELAPSED_EXT",value:35007,description:"Elapsed time (in nanoseconds).",extensionName:"EXT_disjoint_timer_query"},p.TIMESTAMP_EXT={name:"TIMESTAMP_EXT",value:36392,description:"The current time.",extensionName:"EXT_disjoint_timer_query"},p.GPU_DISJOINT_EXT={name:"GPU_DISJOINT_EXT",value:36795,description:"A Boolean indicating whether or not the GPU performed any disjoint operation.",extensionName:"EXT_disjoint_timer_query"},p.zeroMeaningByCommand={getError:"NO_ERROR",blendFunc:"ZERO",blendFuncSeparate:"ZERO",readBuffer:"NONE",getFramebufferAttachmentParameter:"NONE",texParameterf:"NONE",texParameteri:"NONE",drawArrays:"POINTS",drawElements:"POINTS",drawArraysInstanced:"POINTS",drawArraysInstancedAngle:"POINTS",drawBuffers:"POINTS",drawElementsInstanced:"POINTS",drawRangeElements:"POINTS"},p.oneMeaningByCommand={blendFunc:"ONE",blendFuncSeparate:"ONE",drawArrays:"LINES",drawElements:"LINES",drawArraysInstanced:"LINES",drawArraysInstancedAngle:"LINES",drawBuffers:"LINES",drawElementsInstanced:"LINES",drawRangeElements:"LINES"};const m={},g={};!function(){for(const e in p)if(p.hasOwnProperty(e)){const t=p[e];m[t.name]=t,g[t.value]=t}}();class E extends c{get analyserName(){return E.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={total:0,totalTriangles:0,totalTriangleStrip:0,totalTriangleFan:0,totalLines:0,totalLineStrip:0,totalLineLoop:0,totalPoints:0};for(const t of e.commands)"drawArrays"===t.name&&t.commandArguments.length>=3||"drawArraysInstanced"===t.name&&t.commandArguments.length>=3||"drawArraysInstancedANGLE"===t.name&&t.commandArguments.length>=3?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[2]):"drawElements"===t.name&&t.commandArguments.length>=2||"drawElementsInstanced"===t.name&&t.commandArguments.length>=2||"drawElementsInstancedANGLE"===t.name&&t.commandArguments.length>=2?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[1]):"drawRangeElements"===t.name&&t.commandArguments.length>=4&&this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[3]);t.total=n.total,t.triangles=n.totalTriangles,t.triangleStrip=n.totalTriangleStrip,t.triangleFan=n.totalTriangleFan,t.lines=n.totalLines,t.lineStrip=n.totalLineStrip,t.lineLoop=n.totalLineLoop,t.points=n.totalPoints}appendToPrimitives(e,t,n){t===p.POINTS.value?e.totalPoints+=n:t===p.LINES.value?e.totalLines+=n:t===p.LINE_STRIP.value?e.totalLineStrip+=n:t===p.LINE_LOOP.value?e.totalLineLoop+=n:t===p.TRIANGLES.value?e.totalTriangles+=n:t===p.TRIANGLE_STRIP.value?e.totalTriangleStrip+=n:t===p.TRIANGLE_FAN.value&&(e.totalTriangleFan+=n),e.total+=n}}E.analyserName="Primitives";class v{constructor(e){this.contextInformation=e,this.analysers=[],this.initAnalysers()}appendAnalyses(e){for(const t in this.analysers)this.analysers.hasOwnProperty(t)&&this.analysers[t].appendAnalysis(e)}initAnalysers(){this.analysers.push(new h(this.contextInformation),new f(this.contextInformation),new E(this.contextInformation))}}class C{static getStackTrace(e=0,t=0){const n=[];try{throw new Error("Errorator.")}catch(e){if(e.stack){const t=e.stack.split("\n");for(let e=0,r=t.length;e0;t++)n.shift();for(let e=0;e0;e++)n.pop()}return n}}class D{static getWebGlObjectTag(e){return e[D.SPECTOROBJECTTAGKEY]}static attachWebGlObjectTag(e,t){t.displayText=D.stringifyWebGlObjectTag(t),e[D.SPECTOROBJECTTAGKEY]=t}static stringifyWebGlObjectTag(e){return e?`${e.typeName} - ID: ${e.id}`:"No tag available."}}D.SPECTOROBJECTTAGKEY="__SPECTOR_Object_TAG";class S{get type(){return("undefined"!=typeof globalThis?globalThis:self)[this.typeName]||null}constructor(){this.id=0}tagWebGlObject(e){if(!this.type)return;let t;if(!e)return t;if(t=D.getWebGlObjectTag(e),t)return t;if(e instanceof this.type){const n=this.getNextId();return t={typeName:this.typeName,id:n},D.attachWebGlObjectTag(e,t),t}return t}getNextId(){return this.id++}}class A{constructor(e){this.options=e}createCapture(e,t,n){const r=C.getStackTrace(4,1),i=0===e.name.indexOf("uniform")?this.stringifyUniform(e.arguments):this.stringify(e.arguments,e.result),s={id:t,startTime:e.startTime,commandEndTime:e.endTime,endTime:0,name:e.name,commandArguments:e.arguments,result:e.result,stackTrace:r,status:0,marker:n,text:i};this.transformCapture(s);for(let e=0;e50&&(s.commandArguments[e]="Array Length: "+t.length)}if(s.commandArguments){const e=[];for(let t=0;t0&&(n+=": "+this.stringifyArgs(e).join(", ")),null!=t&&(n+=" -> "+this.stringifyResult(t)),n}stringifyUniform(e){let t=this.spiedCommandName;if(e&&e.length>0){const n=[];n.push(this.stringifyValue(e[0]));for(let t=1;t0&&"number"==typeof s)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");else{const e=this.stringifyValue(s);r.push(e)}}return r}}_.commandName="bufferSubData";class y{static storeOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]||(e[n]=e[t])}static resetOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]&&(e[t]=e[n],delete e[n])}static storePrototypeOriginFunction(e,t){if(!e)return;if(!e.prototype[t])return;const n=this.getOriginFunctionName(t);e.prototype[n]||(e.prototype[n]=e.prototype[t])}static executePrototypeOriginFunction(e,t,n,r){if(!e)return;const i=this.getOriginFunctionName(n);return t.prototype[i]?(e[i]||(e[i]=t.prototype[i]),this.executeFunction(e,i,r)):void 0}static executeOriginFunction(e,t,n){if(!e)return;const r=this.getOriginFunctionName(t);return e[r]?this.executeFunction(e,r,n):void 0}static executeFunction(e,t,n){const r=n;if(void 0===r||0===r.length)return e[t]();switch(r.length){case 1:return e[t](r[0]);case 2:return e[t](r[0],r[1]);case 3:return e[t](r[0],r[1],r[2]);case 4:return e[t](r[0],r[1],r[2],r[3]);case 5:return e[t](r[0],r[1],r[2],r[3],r[4]);case 6:return e[t](r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6]);case 8:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]);case 9:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8]);case 10:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9]);case 11:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10]);case 12:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11]);case 13:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12]);case 14:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13]);case 15:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14]);case 16:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);case 17:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16]);case 18:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17]);case 19:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18]);case 20:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19]);default:return e[t].apply(e,r)}}static getOriginFunctionName(e){return this.originFunctionPrefix+e}}y.originFunctionPrefix="__SPECTOR_Origin_";class b extends A{get spiedCommandName(){return b.commandName}stringifyArgs(e){const t=[];if(e.length>0){const n=e[0],r=this.stringifyValue(n);t.push(r)}if(e.length>1){const n=""+e[1];t.push(n)}return e.length>2&&t.push(e[2]),t}}b.commandName="bindAttribLocation";class T extends A{get spiedCommandName(){return T.commandName}stringifyArgs(e){const t=[],n=this.options.context.getParameter(p.READ_FRAMEBUFFER_BINDING.value),r=this.options.tagWebGlObject(n);t.push("READ FROM: "+this.stringifyValue(r));const i=this.options.context.getParameter(p.DRAW_FRAMEBUFFER_BINDING.value),s=this.options.tagWebGlObject(i);t.push("WRITE TO: "+this.stringifyValue(s));for(let n=0;n<8;n++)t.push(e[n]);return(e[8]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[8]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[8]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t.push(p.stringifyWebGlConstant(e[9],"blitFrameBuffer")),t}}T.commandName="blitFrameBuffer";class R extends A{get spiedCommandName(){return R.commandName}stringifyArgs(e){const t=[];return(e[0]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[0]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[0]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t}}R.commandName="clear";class x{static getProgramData(e,t){const n={LINK_STATUS:e.getProgramParameter(t,p.LINK_STATUS.value),VALIDATE_STATUS:e.getProgramParameter(t,p.VALIDATE_STATUS.value),infoLog:e.getProgramInfoLog(t)||""},r=e.getAttachedShaders(t)||[],i=new Array(2);let s=0;for(const t of r){const n=this.getShaderData(e,t);s+=n.source.length,n.shaderType===p.FRAGMENT_SHADER.name?i[1]=n:i[0]=n}return{programStatus:n,shaders:i,length:s}}static getShaderData(e,t){const n=e.getShaderSource(t)||"",r=e.getExtension("WEBGL_debug_shaders"),i=r?r.getTranslatedShaderSource(t):null,s=e.getShaderParameter(t,p.SHADER_TYPE.value)===p.FRAGMENT_SHADER.value;let o=t&&t.__SPECTOR_Metadata&&t.__SPECTOR_Metadata.name?t.__SPECTOR_Metadata.name:this.readNameFromShaderSource(n);return o||(o=s?"Fragment":"Vertex"),{COMPILE_STATUS:e.getShaderParameter(t,p.COMPILE_STATUS.value),shaderType:s?p.FRAGMENT_SHADER.name:p.VERTEX_SHADER.name,name:o,source:n,translatedSource:i,infoLog:e.getShaderInfoLog(t)||""}}static readNameFromShaderSource(e){try{let t,n="";const r=/#define[\s]+SHADER_NAME[\s]+([\S]+)(\n|$)/gi;if(t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),""===n){const r=/#define[\s]+SHADER_NAME_B64[\s]+([\S]+)(\n|$)/gi;t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),n&&(n=decodeURIComponent(atob(n)))}return n}catch(e){return null}}}class w extends A{constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.shader=x.getShaderData(this.options.context,t)}finally{n&&n(!0)}}getShaderDisplayText(e){return this.stringifyValue(e.commandArguments[0])}}class F extends w{get spiedCommandName(){return F.commandName}transformCapture(e){if(super.transformCapture(e),e.shader){const t=e.shader.COMPILE_STATUS?"compiled":"failed";e.text=`${this.spiedCommandName}: ${this.getShaderDisplayText(e)} -> ${t}`}}}F.commandName="compileShader";const N=["lineWidth"];class L extends A{get spiedCommandName(){return this.internalSpiedCommandName}constructor(e,t){super(e),this.internalSpiedCommandName=t,this.isDeprecated=N.indexOf(this.spiedCommandName)>-1}transformCapture(e){this.isDeprecated&&(e.status=50)}}class O extends A{get spiedCommandName(){return O.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}O.commandName="disableVertexAttribArray";class I extends A{get spiedCommandName(){return I.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(e[1]+" indices"),t.push(e[2]),t}}I.commandName="drawArrays";class k extends A{get spiedCommandName(){return k.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}k.commandName="drawArraysInstanced";class M extends A{get spiedCommandName(){return M.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstancedANGLE")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}M.commandName="drawArraysInstancedANGLE";class P extends A{get spiedCommandName(){return P.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElements")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElements")),t.push(e[3]),t}}P.commandName="drawElements";class B extends A{get spiedCommandName(){return B.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstancedANGLE")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstancedANGLE")),t.push(e[3]),t.push(e[4]),t}}B.commandName="drawElementsInstancedANGLE";class U extends A{get spiedCommandName(){return U.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t}}U.commandName="drawElementsInstanced";class $ extends A{get spiedCommandName(){return $.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawRangeElements")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(p.stringifyWebGlConstant(e[4],"drawRangeElements")),t.push(e[5]),t}}$.commandName="drawRangeElements";class G extends A{get spiedCommandName(){return G.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}G.commandName="getActiveAttrib";class V extends A{get spiedCommandName(){return V.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}V.commandName="getActiveUniform";class W extends A{get spiedCommandName(){return W.commandName}stringifyResult(e){var t;if(null!=e)return null!==(t=null==e?void 0:e.toFixed(0))&&void 0!==t?t:"0"}}W.commandName="getAttribLocation";class H extends A{get spiedCommandName(){return H.commandName}stringifyResult(e){return e?"true":"false"}}H.commandName="getExtension";class j extends A{get spiedCommandName(){return j.commandName}stringifyResult(e){if(!e)return"null";const t=D.getWebGlObjectTag(e);return t?t.displayText:e}}j.commandName="getParameter";class z extends A{get spiedCommandName(){return z.commandName}stringifyResult(e){if(e)return`min: ${e.rangeMin}, max: ${e.rangeMax}, precision: ${e.precision}`}}z.commandName="getShaderPrecisionFormat";class X extends w{get spiedCommandName(){return X.commandName}stringifyResult(e){if("string"!=typeof e||0===e.trim().length)return"No messages";const t=e.split(/\r?\n/).filter(e=>e.trim().length>0).length;return t+(1===t?" message":" messages")}}X.commandName="getShaderInfoLog";class K extends A{get spiedCommandName(){return K.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}K.commandName="getTransformFeedbackVarying";class Y extends A{get spiedCommandName(){return Y.commandName}constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.program=x.getProgramData(this.options.context,t)}finally{n&&n(!0)}const r=e.program.programStatus.LINK_STATUS?"linked":"failed";e.text=`${this.spiedCommandName}: ${this.stringifyValue(t)} -> ${r}`}}Y.commandName="linkProgram";class q extends A{get spiedCommandName(){return q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"multiDrawArraysInstancedBaseInstanceWEBGL")),t.push(`drawCount=${e[9]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t}}q.commandName="multiDrawArraysInstancedBaseInstanceWEBGL";class Q extends A{get spiedCommandName(){return Q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[7]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t}}Q.commandName="multiDrawArraysInstancedWEBGL";class Z extends A{get spiedCommandName(){return Z.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[5]}`),t.push(e[2]),t.push(e[4]),t}}Z.commandName="multiDrawArraysWEBGL";class J extends A{get spiedCommandName(){return J.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[11]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t.push(e[10]),t}}J.commandName="multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL";class ee extends A{get spiedCommandName(){return ee.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[8]}`),t.push(e[2]),t.push(e[5]),t.push(e[7]),t}}ee.commandName="multiDrawElementsInstancedWEBGL";class te extends A{get spiedCommandName(){return te.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[6]}`),t.push(e[2]),t.push(e[5]),t}}te.commandName="multiDrawElementsWEBGL";class ne extends A{get spiedCommandName(){return ne.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(`baseInstance = ${e[4]}`),t}}ne.commandName="drawArraysInstancedBaseInstanceWEBGL";class re extends A{get spiedCommandName(){return re.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t.push(`baseVertex = ${e[5]}`),t.push(`baseInstance = ${e[6]}`),t}}re.commandName="drawElementsInstancedBaseVertexBaseInstanceWEBGL";class ie extends A{get spiedCommandName(){return ie.commandName}stringifyArgs(e){var t,n;const r=[];for(let i=0;i<4;i++)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");return r}}function se(e){return null==e?"":`${e.toFixed(0)} (0b${(e>>>0).toString(2)})`}ie.commandName="scissor";class oe extends A{get spiedCommandName(){return oe.commandName}stringifyArgs(e){const t=[];return t.push(se(e[0])),t}}oe.commandName="stencilMask";class ae extends A{get spiedCommandName(){return ae.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilMaskSeparate")),t.push(se(e[1])),t}}ae.commandName="stencilMaskSeparate";class le extends A{get spiedCommandName(){return le.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFunc")),t.push(se(e[1])),t.push(se(e[2])),t}}le.commandName="stencilFunc";class ue extends A{get spiedCommandName(){return ue.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFuncSeparate")),t.push(p.stringifyWebGlConstant(e[1],"stencilFuncSeparate")),t.push(se(e[2])),t.push(se(e[3])),t}}ue.commandName="stencilFuncSeparate";class ce extends A{get spiedCommandName(){return ce.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t.push(e[1]),t.push(p.stringifyWebGlConstant(e[2],"vertexAttribPointer")),t.push(e[3]),t.push(e[4]),t.push(e[5]),t}}ce.commandName="vertexAttribPointer";class he extends A{get spiedCommandName(){return he.commandName}stringifyArgs(e){const t=[];for(let n=0;n<4;n++)t.push(e[n].toFixed(0));return t}}he.commandName="viewport";class de extends A{get spiedCommandName(){return de.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}de.commandName="enableVertexAttribArray";class fe extends w{get spiedCommandName(){return fe.commandName}stringifyArgs(e){const t="string"==typeof e[1]?e[1]:"";return[this.stringifyValue(e[0]),t.length+" chars"]}transformCapture(e){super.transformCapture(e);const t=e.commandArguments[1];e.shader&&"string"==typeof t&&(e.shader.source=t,e.shader.COMPILE_STATUS=null,e.shader.translatedSource="",e.shader.infoLog="")}}fe.commandName="shaderSource";class pe{constructor(e){this.spiedCommandName=e.spiedCommandName,this.spiedCommandRunningContext=e.spiedCommandRunningContext,this.spiedCommand=this.spiedCommandRunningContext[this.spiedCommandName],y.storeOriginFunction(this.spiedCommandRunningContext,this.spiedCommandName),this.callback=e.callback,this.commandOptions={context:e.context,contextVersion:e.contextVersion,extensions:e.extensions,toggleCapture:e.toggleCapture},this.initCustomCommands(),this.initCommand()}spy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.overloadedCommand}unSpy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.spiedCommand}createCapture(e,t,n){return this.command.createCapture(e,t,n)}initCommand(){pe.customCommandsConstructors[this.spiedCommandName]?this.command=pe.customCommandsConstructors[this.spiedCommandName](this.commandOptions):this.command=new L(this.commandOptions,this.spiedCommandName),this.overloadedCommand=this.getSpy()}getSpy(){const e=this;return function(){const t=u.now,n=y.executeOriginFunction(e.spiedCommandRunningContext,e.spiedCommandName,arguments),r=u.now;try{const i={name:e.spiedCommandName,arguments,result:n,startTime:t,endTime:r};e.callback(e,i)}catch(e){}return n}}initCustomCommands(){pe.customCommandsConstructors||(pe.customCommandsConstructors={[b.commandName]:e=>new b(e),[T.commandName]:e=>new T(e),[_.commandName]:e=>new _(e),[R.commandName]:e=>new R(e),[F.commandName]:e=>new F(e),[O.commandName]:e=>new O(e),[I.commandName]:e=>new I(e),[k.commandName]:e=>new k(e),[M.commandName]:e=>new M(e),[P.commandName]:e=>new P(e),[U.commandName]:e=>new U(e),[B.commandName]:e=>new B(e),[$.commandName]:e=>new $(e),[G.commandName]:e=>new G(e),[V.commandName]:e=>new V(e),[W.commandName]:e=>new W(e),[H.commandName]:e=>new H(e),[j.commandName]:e=>new j(e),[X.commandName]:e=>new X(e),[z.commandName]:e=>new z(e),[K.commandName]:e=>new K(e),[Y.commandName]:e=>new Y(e),[q.commandName]:e=>new q(e),[Q.commandName]:e=>new Q(e),[Z.commandName]:e=>new Z(e),[J.commandName]:e=>new J(e),[ee.commandName]:e=>new ee(e),[te.commandName]:e=>new te(e),[ne.commandName]:e=>new ne(e),[re.commandName]:e=>new re(e),[ie.commandName]:e=>new ie(e),[fe.commandName]:e=>new fe(e),[oe.commandName]:e=>new oe(e),[ae.commandName]:e=>new ae(e),[le.commandName]:e=>new le(e),[ue.commandName]:e=>new ue(e),[ce.commandName]:e=>new ce(e),[he.commandName]:e=>new he(e),[de.commandName]:e=>new de(e)})}}class me{constructor(e){this.options=e,this.context=e.context,this.contextVersion=e.contextVersion,this.extensions=e.extensions,this.toggleCapture=e.toggleCapture,this.consumeCommands=this.getConsumeCommands(),this.changeCommandsByState=this.getChangeCommandsByState(),this.commandNameToStates=this.getCommandNameToStates()}get requireStartAndStopStates(){return!0}startCapture(e,t,n){return this.quickCapture=t,this.fullCapture=n,this.capturedCommandsByState={},e&&this.requireStartAndStopStates&&(this.currentState={},this.readFromContextNoSideEffects()),this.copyCurrentStateToPrevious(),this.currentState={},this.previousState}stopCapture(){return this.requireStartAndStopStates&&this.readFromContextNoSideEffects(),this.analyse(void 0),this.currentState}registerCallbacks(e){for(const t in this.changeCommandsByState)if(this.changeCommandsByState.hasOwnProperty(t))for(const n of this.changeCommandsByState[t])e[n]=e[n]||[],e[n].push(this.onChangeCommand.bind(this));for(const t of this.consumeCommands)e[t]=e[t]||[],e[t].push(this.onConsumeCommand.bind(this))}getStateData(){return this.currentState}getConsumeCommands(){return[]}getChangeCommandsByState(){return{}}copyCurrentStateToPrevious(){this.currentState&&(this.previousState=this.currentState)}onChangeCommand(e){const t=this.commandNameToStates[e.name];for(const n of t){if(!this.isValidChangeCommand(e,n))return;this.capturedCommandsByState[n]=this.capturedCommandsByState[n]||[],this.capturedCommandsByState[n].push(e)}}isValidChangeCommand(e,t){return!0}onConsumeCommand(e){this.isValidConsumeCommand(e)&&(this.readFromContextNoSideEffects(),this.analyse(e),this.storeCommandIds(),e[this.stateName]=this.currentState,this.startCapture(!1,this.quickCapture,this.fullCapture))}isValidConsumeCommand(e){return this.lastCommandName=null==e?void 0:e.name,!0}analyse(e){for(const t in this.capturedCommandsByState)if(this.capturedCommandsByState.hasOwnProperty(t)){const n=this.capturedCommandsByState[t],r=n.length-1;if(r>=0)if(e){for(let t=0;t1&&this.parameters.push(this.getWebgl2Parameters());const e={};for(let t=1;t<=this.contextVersion&&!(t>this.parameters.length);t++)if(this.parameters[t-1])for(const n of this.parameters[t-1])if(n.changeCommands)for(const t of n.changeCommands)e[n.constant.name]=e[n.constant.name]||[],e[n.constant.name].push(t);return e}readFromContext(){for(let e=1;e<=this.contextVersion&&!(e>this.parameters.length);e++)for(const t of this.parameters[e-1]){const e=this.readParameterFromContext(t);if(null==e){const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n;continue}const n=D.getWebGlObjectTag(e);if(n)this.currentState[t.constant.name]=n;else{const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n}}}readParameterFromContext(e){return e.constant.extensionName&&!this.extensions[e.constant.extensionName]?`Extension ${e.constant.extensionName} is unavailable.`:this.context.getParameter(e.constant.value)}stringifyParameterValue(e,t){if(null===e)return"null";if(void 0===e)return"undefined";if(30===t.returnType)return se(e);if("number"==typeof e&&p.isWebGlConstant(e)){if(20===t.returnType){const n=t.changeCommands&&t.changeCommands[0]||"";return p.stringifyWebGlConstant(e,n)}return e}if(e.length&&"string"!=typeof e){const t=[];for(let n=0;n1?r=this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value):this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.value)===p.RENDERBUFFER.value&&(r=e.getRenderbufferParameter(e.RENDERBUFFER,e.RENDERBUFFER_STENCIL_SIZE))):r=this.readParameterFromContext({constant:p.STENCIL_BITS}),this.currentState[p.STENCIL_BITS.name]=""+r}isValidChangeCommand(e,t){return"enable"===e.name||"disable"===e.name?e.commandArguments[0]===p.STENCIL_TEST.value:"stencilOp"===e.name||"stencilOpSeparate"===e.name?xe.stencilOpStates.indexOf(e.commandArguments[0])>0:"stencilFunc"===e.name||"stencilFuncSeparate"===e.name?xe.stencilFuncStates.indexOf(e.commandArguments[0])>0:"stencilMask"!==e.name&&"stencilMaskSeparate"!==e.name||xe.stencilMaskStates.indexOf(e.commandArguments[0])>0}getConsumeCommands(){return d}isStateEnable(e,t){return this.context.isEnabled(p.STENCIL_TEST.value)}}xe.stateName="StencilState",xe.stencilOpStates=[p.STENCIL_BACK_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_PASS.value,p.STENCIL_FAIL.value,p.STENCIL_PASS_DEPTH_FAIL.value,p.STENCIL_PASS_DEPTH_PASS.value],xe.stencilFuncStates=[p.STENCIL_BACK_FUNC.value,p.STENCIL_BACK_REF.value,p.STENCIL_BACK_VALUE_MASK.value,p.STENCIL_FUNC.value,p.STENCIL_REF.value,p.STENCIL_VALUE_MASK.value],xe.stencilMaskStates=[p.STENCIL_BACK_WRITEMASK.value,p.STENCIL_WRITEMASK.value];class we{static isSupportedCombination(e,t,n){return e=e||p.UNSIGNED_BYTE.value,((t=t||p.RGBA.value)===p.RGB.value||t===p.RGBA.value)&&(n===p.RGB.value||n===p.RGBA.value||n===p.RGBA8.value||n===p.RGBA16F.value||n===p.RGBA32F.value||n===p.RGB16F.value||n===p.RGB32F.value||n===p.R11F_G11F_B10F.value||n===p.SRGB8.value||n===p.SRGB8_ALPHA8.value)&&this.isSupportedComponentType(e)}static readPixels(e,t,n,r,i,s){e.getError(),s===p.UNSIGNED_NORMALIZED.value&&(s=p.UNSIGNED_BYTE.value);const o=r*i*4;let a;if(s===p.UNSIGNED_BYTE.value?a=new Uint8Array(o):(s=p.FLOAT.value,a=new Float32Array(o)),e.readPixels(t,n,r,i,e.RGBA,s,a),e.getError())return;if(s===p.UNSIGNED_BYTE.value)return a;const l=new Uint8Array(r*i*4);for(let e=0;e1){const e=this.context.getParameter(p.MAX_DRAW_BUFFERS.value);for(let n=0;n1?this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value):p.UNSIGNED_BYTE.value;l===p.RENDERBUFFER.value?this.readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,c,u):l===p.TEXTURE.value&&this.readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,c,u)}readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,l,u){let c=0,h=0;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,c=e.samples,h=e.internalFormat,!c&&!we.isSupportedCombination(l,p.RGBA.value,h))return}else s+=r,o+=i;if(r=i=0,c){const a=e,u=e.createRenderbuffer(),c=e.getParameter(e.RENDERBUFFER_BINDING);e.bindRenderbuffer(e.RENDERBUFFER,u),e.renderbufferStorage(e.RENDERBUFFER,h,s,o),e.bindRenderbuffer(e.RENDERBUFFER,c),e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u);const d=a.getParameter(a.READ_FRAMEBUFFER_BINDING),f=a.getParameter(a.DRAW_FRAMEBUFFER_BINDING);a.bindFramebuffer(a.READ_FRAMEBUFFER,t),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,this.captureFrameBuffer),a.blitFramebuffer(0,0,s,o,0,0,s,o,e.COLOR_BUFFER_BIT,e.NEAREST),a.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),a.bindFramebuffer(a.READ_FRAMEBUFFER,d),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,f),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t),e.deleteRenderbuffer(u)}else e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,l,u){let c=0;this.contextVersion>1&&(c=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value));const h=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL.value),d=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE.value);d>0?g[d].name:p.TEXTURE_2D.name;let f=!1,m=l;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,void 0!==e.type&&(m=e.type),f=e.target===p.TEXTURE_2D_ARRAY.name,!we.isSupportedCombination(e.type,e.format,e.internalFormat))return}else s+=r,o+=i;r=i=0,e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),c>0||f?e.framebufferTextureLayer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,u,h,c):e.framebufferTexture2D(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,d||p.TEXTURE_2D.value,u,h),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,d,c,m),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}getCapture(e,t,n,r,i,s,o,l,u){i=Math.floor(i),s=Math.floor(s);const c={attachmentName:t,src:null,textureCubeMapFace:o?g[o].name:null,textureLayer:l,raw:null};if(!this.quickCapture)try{const t=we.readPixels(e,n,r,i,s,u);if(t){c.raw=Ne.encode(t,i,s),this.workingCanvas.width=i,this.workingCanvas.height=s;const e=this.workingContext2D.createImageData(i,s);if(e.data.set(t),this.workingContext2D.putImageData(e,0,0),this.fullCapture)this.captureCanvas.width=this.workingCanvas.width,this.captureCanvas.height=this.workingCanvas.height;else{const e=i/s;e<1?(this.captureCanvas.width=Le.captureBaseSize*e,this.captureCanvas.height=Le.captureBaseSize):e>1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this.captureContext2D.drawImage(this.workingCanvas,0,0,i,s,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",c.src=Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D)}}catch(e){a.warn("Spector can not capture the visual state: "+e)}this.currentState.Attachments.push(c)}analyse(e){}}Le.stateName="VisualState",Le.captureBaseSize=256;class Oe{constructor(e){this.context=e.context,this.captureFrameBuffer=e.context.createFramebuffer(),this.workingCanvas=Fe.createCanvas(1,1),this.workingContext2D=Fe.get2DContext(this.workingCanvas),this.captureCanvas=Fe.createCanvas(1,1),this.captureContext2D=Fe.get2DContext(this.captureCanvas),Fe.setImageSmoothing(this.captureContext2D,!0)}appendTextureState(e,t,n=null,r){if(!t)return;const i=t.__SPECTOR_Object_CustomData;if(i&&(this.fullCapture=r,i.type&&(e.textureType=this.getWebGlConstant(i.type)),i.format&&(e.format=this.getWebGlConstant(i.format)),i.internalFormat&&(e.internalFormat=this.getWebGlConstant(i.internalFormat)),e.width=i.width,e.height=i.height,i.depth&&(e.depth=i.depth),n)){const r="NEAREST"===e.samplerMagFilter||"NEAREST"===e.magFilter,s=this.getTextureVisualState(n,t,i,r);if(s){e.visual=s.visual;for(const t in s.visualPixels)if(s.visualPixels.hasOwnProperty(t)){e.visualPixels=s.visualPixels;break}}}}getTextureVisualState(e,t,n,r){try{const i=this.context,s={},o={};if(!we.isSupportedCombination(n.type,n.format,n.internalFormat))return{visual:s,visualPixels:o};const a=this.context.getParameter(p.FRAMEBUFFER_BINDING.value);i.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer);try{const a=0,l=n.width,u=n.height;if(e===p.TEXTURE_3D&&n.depth){const e=i;for(let c=0;c2&&c2&&c1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}return this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this._setSmoothing(!o),this.captureContext2D.drawImage(this.workingCanvas,0,0,r,i,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",{src:Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D),raw:l}}catch(e){}return{src:void 0,raw:null}}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}_setSmoothing(e){Fe.setImageSmoothing(this.captureContext2D,e)}}Oe.captureBaseSize=64,Oe.cubeMapFaces=[p.TEXTURE_CUBE_MAP_POSITIVE_X,p.TEXTURE_CUBE_MAP_POSITIVE_Y,p.TEXTURE_CUBE_MAP_POSITIVE_Z,p.TEXTURE_CUBE_MAP_NEGATIVE_X,p.TEXTURE_CUBE_MAP_NEGATIVE_Y,p.TEXTURE_CUBE_MAP_NEGATIVE_Z];class Ie{constructor(e){this.context=e.context}getUboValue(e,t,n,r){const i=Ie.uboTypes[r];if(!i)return;const s=new i.arrayBufferView(n*i.lengthMultiplier),o=this.context,a=o.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,e);if(a){const n=o.getIndexedParameter(p.UNIFORM_BUFFER_START.value,e),r=o.getParameter(p.UNIFORM_BUFFER_BINDING.value);try{o.bindBuffer(p.UNIFORM_BUFFER.value,a),o.getBufferSubData(p.UNIFORM_BUFFER.value,n+t,s)}catch(e){return}r&&o.bindBuffer(p.UNIFORM_BUFFER.value,r)}return Array.prototype.slice.call(s)}}Ie.uboTypes={[p.BOOL.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.BOOL_VEC2.value]:{arrayBufferView:Uint8Array,lengthMultiplier:2},[p.BOOL_VEC3.value]:{arrayBufferView:Uint8Array,lengthMultiplier:3},[p.BOOL_VEC4.value]:{arrayBufferView:Uint8Array,lengthMultiplier:4},[p.INT.value]:{arrayBufferView:Int32Array,lengthMultiplier:1},[p.INT_VEC2.value]:{arrayBufferView:Int32Array,lengthMultiplier:2},[p.INT_VEC3.value]:{arrayBufferView:Int32Array,lengthMultiplier:3},[p.INT_VEC4.value]:{arrayBufferView:Int32Array,lengthMultiplier:4},[p.UNSIGNED_INT.value]:{arrayBufferView:Uint32Array,lengthMultiplier:1},[p.UNSIGNED_INT_VEC2.value]:{arrayBufferView:Uint32Array,lengthMultiplier:2},[p.UNSIGNED_INT_VEC3.value]:{arrayBufferView:Uint32Array,lengthMultiplier:3},[p.UNSIGNED_INT_VEC4.value]:{arrayBufferView:Uint32Array,lengthMultiplier:4},[p.FLOAT.value]:{arrayBufferView:Float32Array,lengthMultiplier:1},[p.FLOAT_VEC2.value]:{arrayBufferView:Float32Array,lengthMultiplier:2},[p.FLOAT_VEC3.value]:{arrayBufferView:Float32Array,lengthMultiplier:3},[p.FLOAT_VEC4.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT2x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT3.value]:{arrayBufferView:Float32Array,lengthMultiplier:9},[p.FLOAT_MAT3x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT3x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.FLOAT_MAT4.value]:{arrayBufferView:Float32Array,lengthMultiplier:16},[p.FLOAT_MAT4x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT4x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.SAMPLER_2D.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.SAMPLER_CUBE.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1}};class ke extends S{get typeName(){return"WebGLBuffer"}}class Me extends S{get typeName(){return"WebGLFramebuffer"}}class Pe extends S{get typeName(){return"WebGLProgram"}static saveInGlobalStore(e){const t=D.getWebGlObjectTag(e);t&&(this.store[t.id]=e)}static getFromGlobalStore(e){return this.store[e]}static updateInGlobalStore(e,t){if(!t)return;const n=this.getFromGlobalStore(e);if(!n)return;const r=D.getWebGlObjectTag(n);r&&(D.attachWebGlObjectTag(t,r),this.store[r.id]=t)}}Pe.store={};class Be extends S{get typeName(){return"WebGLQuery"}}class Ue extends S{get typeName(){return"WebGLRenderbuffer"}}class $e extends S{get typeName(){return"WebGLSampler"}}class Ge extends S{get typeName(){return"WebGLShader"}}class Ve extends S{get typeName(){return"WebGLSync"}}class We extends S{get typeName(){return"WebGLTexture"}}class He extends S{get typeName(){return"WebGLTransformFeedback"}}class je extends S{get typeName(){return"WebGLUniformLocation"}}class ze extends S{get typeName(){return"WebGLVertexArrayObject"}}class Xe extends me{get stateName(){return Xe.stateName}get requireStartAndStopStates(){return!1}constructor(e){super(e),this.drawCallTextureInputState=new Oe(e),this.drawCallUboInputState=new Ie(e)}getConsumeCommands(){return d}getChangeCommandsByState(){return{}}readFromContext(){var e,t;const n=this.context.getParameter(p.CURRENT_PROGRAM.value);if(!n)return;this.currentState.frameBuffer=this.readFrameBufferFromContext();const r=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData:x.getProgramData(this.context,n);if(this.currentState.programStatus=Object.assign({},r.programStatus),this.currentState.programStatus.program=this.getSpectorData(n),this.currentState.programStatus.RECOMPILABLE=o.isBuildableProgram(n),this.currentState.programStatus.RECOMPILABLE&&Pe.saveInGlobalStore(n),this.currentState.shaders=r.shaders,(null===(e=this.lastCommandName)||void 0===e?void 0:e.indexOf("Elements"))>=0){const e=this.context.getParameter(this.context.ELEMENT_ARRAY_BUFFER_BINDING);e&&(this.currentState.elementArray={},this.currentState.elementArray.arrayBuffer=this.getSpectorData(e))}const i=this.context.getProgramParameter(n,p.ACTIVE_ATTRIBUTES.value);this.currentState.attributes=[];for(let e=0;e1){const e=this.context.getProgramParameter(n,p.ACTIVE_UNIFORM_BLOCKS.value);this.currentState.uniformBlocks=[];for(let t=0;t1){const e=this.context;t.colorAttachments=[];const n=e.getParameter(p.MAX_DRAW_BUFFERS.value);for(let e=0;e1&&(r.alphaSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE.value),r.blueSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE.value),r.encoding=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.value)),r.componentType=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value)),r.depthSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE.value),r.greenSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE.value),r.redSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_RED_SIZE.value),r.stencilSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value),n===p.TEXTURE.value&&(r.textureLayer=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value))),r}readAttributeFromContext(e,t){const n=this.context.getActiveAttrib(e,t),r=this.context.getAttribLocation(e,n.name);if(-1===r)return{name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:-1};const i=this.context.getVertexAttrib(r,p.CURRENT_VERTEX_ATTRIB.value),s=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING.value),o={name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:r,offsetPointer:this.context.getVertexAttribOffset(r,p.VERTEX_ATTRIB_ARRAY_POINTER.value),bufferBinding:this.getSpectorData(s),enabled:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_ENABLED.value),arraySize:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_SIZE.value),stride:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_STRIDE.value),arrayType:this.getWebGlConstant(this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_TYPE.value)),normalized:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_NORMALIZED.value),vertexAttrib:Array.prototype.slice.call(i)};return this.extensions[p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.extensionName]?o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.value):this.contextVersion>1&&(o.integer=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_INTEGER.value),o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR.value)),this.appendBufferCustomData(o,s),o}readUniformFromContext(e,t){const n=this.context.getActiveUniform(e,t),r=this.context.getUniformLocation(e,n.name);if(r){if(n.size>1&&n.name&&n.name.indexOf("[0]")===n.name.length-3){const t=[];for(let r=0;r1){r.baseLevel=this.context.getTexParameter(t.value,p.TEXTURE_BASE_LEVEL.value),r.immutable=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_FORMAT.value),r.immutableLevels=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_LEVELS.value),r.maxLevel=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LEVEL.value);const e=this.context.getParameter(p.SAMPLER_BINDING.value);if(e){r.sampler=this.getSpectorData(e);const t=this.context;r.samplerMaxLod=t.getSamplerParameter(e,p.TEXTURE_MAX_LOD.value),r.samplerMinLod=t.getSamplerParameter(e,p.TEXTURE_MIN_LOD.value),r.samplerCompareFunc=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_FUNC.value)),r.samplerCompareMode=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_MODE.value)),r.samplerWrapS=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_S.value)),r.samplerWrapT=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_T.value)),r.samplerWrapR=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_R.value)),r.samplerMagFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MAG_FILTER.value)),r.samplerMinFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MIN_FILTER.value))}else r.maxLod=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LOD.value),r.minLod=this.context.getTexParameter(t.value,p.TEXTURE_MIN_LOD.value),r.compareFunc=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_FUNC.value)),r.compareMode=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_MODE.value)),r.wrapR=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_WRAP_R.value))}const i=this.getTextureStorage(t);if(i){const e=this.quickCapture?null:t;this.drawCallTextureInputState.appendTextureState(r,i,e,this.fullCapture)}return this.context.activeTexture(n),r}getTextureStorage(e){return e===p.TEXTURE_2D?this.context.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP?this.context.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):e===p.TEXTURE_3D?this.context.getParameter(p.TEXTURE_BINDING_3D.value):e===p.TEXTURE_2D_ARRAY?this.context.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):void 0}readUniformsFromContextIntoState(e,t,n,r){const i=this.context,s=i.getActiveUniforms(e,t,p.UNIFORM_TYPE.value),o=i.getActiveUniforms(e,t,p.UNIFORM_SIZE.value),a=i.getActiveUniforms(e,t,p.UNIFORM_BLOCK_INDEX.value),l=i.getActiveUniforms(e,t,p.UNIFORM_OFFSET.value),u=i.getActiveUniforms(e,t,p.UNIFORM_ARRAY_STRIDE.value),c=i.getActiveUniforms(e,t,p.UNIFORM_MATRIX_STRIDE.value),h=i.getActiveUniforms(e,t,p.UNIFORM_IS_ROW_MAJOR.value);for(let d=0;d-1&&(t.blockName=i.getActiveUniformBlockName(e,t.blockIndice)),t.offset=l[d],t.arrayStride=u[d],t.matrixStride=c[d],t.rowMajor=h[d],t.blockIndice>-1){const e=r[a[d]].bindingPoint;t.value=this.drawCallUboInputState.getUboValue(e,t.offset,t.size,s[d])}}}readTransformFeedbackFromContext(e,t){const n=this.context,r=n.getTransformFeedbackVarying(e,t),i=n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value,t),s={name:r.name,size:r.size,type:this.getWebGlConstant(r.type),buffer:this.getSpectorData(i),bufferSize:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_SIZE.value,t),bufferStart:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_START.value,t)};return this.appendBufferCustomData(s,i),s}readUniformBlockFromContext(e,t){const n=this.context,r=n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_BINDING.value),i=n.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,r),s={name:n.getActiveUniformBlockName(e,t),bindingPoint:r,size:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_DATA_SIZE.value),activeUniformCount:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_ACTIVE_UNIFORMS.value),vertex:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER.value),fragment:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER.value),buffer:this.getSpectorData(i)};return this.appendBufferCustomData(s,i),s}appendBufferCustomData(e,t){if(t){const n=t.__SPECTOR_Object_CustomData;n&&(n.usage&&(e.bufferUsage=this.getWebGlConstant(n.usage)),e.bufferLength=n.length,n.offset&&(e.bufferOffset=n.offset),n.sourceLength&&(e.bufferSourceLength=n.sourceLength))}}getWebGlConstant(e){const t=g[e];return t?t.name:e}}Xe.stateName="DrawCall",Xe.samplerTypes={[p.SAMPLER_2D.value]:p.TEXTURE_2D,[p.SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.SAMPLER_3D.value]:p.TEXTURE_3D,[p.SAMPLER_2D_SHADOW.value]:p.TEXTURE_2D,[p.SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_2D_ARRAY_SHADOW.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_CUBE_SHADOW.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.UNSIGNED_INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.UNSIGNED_INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.UNSIGNED_INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.UNSIGNED_INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY};class Ke{constructor(e){this.contextInformation=e,this.stateTrackers=[],this.onCommandCapturedCallbacks={},this.initStateTrackers()}startCapture(e,t,n){for(const r of this.stateTrackers){const i=r.startCapture(!0,t,n);r.requireStartAndStopStates&&(e.initState[r.stateName]=i)}}stopCapture(e){for(const t of this.stateTrackers){const n=t.stopCapture();t.requireStartAndStopStates&&(e.endState[t.stateName]=n)}}captureState(e){const t=this.onCommandCapturedCallbacks[e.name];if(t)for(const n of t)n(e)}initStateTrackers(){this.stateTrackers.push(new Ee(this.contextInformation),new ve(this.contextInformation),new Ce(this.contextInformation),new De(this.contextInformation),new Se(this.contextInformation),new Ae(this.contextInformation),new _e(this.contextInformation),new ye(this.contextInformation),new be(this.contextInformation),new Te(this.contextInformation),new Re(this.contextInformation),new xe(this.contextInformation),new Le(this.contextInformation),new Xe(this.contextInformation));for(const e of this.stateTrackers)e.registerCallbacks(this.onCommandCapturedCallbacks)}}class Ye{static initializeByteSizeFormat(){this.byteSizePerInternalFormat||(this.byteSizePerInternalFormat={[p.R8.value]:1,[p.R16F.value]:2,[p.R32F.value]:4,[p.R8UI.value]:1,[p.RG8.value]:2,[p.RG16F.value]:4,[p.RG32F.value]:8,[p.ALPHA.value]:1,[p.RGB.value]:3,[p.RGBA.value]:4,[p.LUMINANCE.value]:1,[p.LUMINANCE_ALPHA.value]:2,[p.DEPTH_COMPONENT.value]:1,[p.DEPTH_STENCIL.value]:2,[p.SRGB_EXT.value]:3,[p.SRGB_ALPHA_EXT.value]:4,[p.RGB8.value]:3,[p.SRGB8.value]:3,[p.RGB565.value]:2,[p.R11F_G11F_B10F.value]:4,[p.RGB9_E5.value]:2,[p.RGB16F.value]:6,[p.RGB32F.value]:12,[p.RGB8UI.value]:3,[p.RGBA8.value]:4,[p.RGB5_A1.value]:2,[p.RGBA16F.value]:8,[p.RGBA32F.value]:16,[p.RGBA8UI.value]:4,[p.COMPRESSED_R11_EAC.value]:4,[p.COMPRESSED_SIGNED_R11_EAC.value]:4,[p.COMPRESSED_RG11_EAC.value]:4,[p.COMPRESSED_SIGNED_RG11_EAC.value]:4,[p.COMPRESSED_RGB8_ETC2.value]:4,[p.COMPRESSED_RGBA8_ETC2_EAC.value]:4,[p.COMPRESSED_SRGB8_ETC2.value]:4,[p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC.value]:4,[p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_RGB_S3TC_DXT1_EXT.value]:.5,[p.COMPRESSED_RGBA_S3TC_DXT3_EXT.value]:1,[p.COMPRESSED_RGBA_S3TC_DXT5_EXT.value]:1,[p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGB_ETC1_WEBGL.value]:.5,[p.COMPRESSED_RGB_ATC_WEBGL.value]:.5,[p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL.value]:1,[p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL.value]:1})}constructor(e){this.options=e,this.createCommandNames=this.getCreateCommandNames(),this.updateCommandNames=this.getUpdateCommandNames(),this.deleteCommandNames=this.getDeleteCommandNames(),this.startTime=u.now,this.memoryPerSecond={},this.totalMemory=0,this.frameMemory=0,this.capturing=!1,Ye.initializeByteSizeFormat()}registerCallbacks(e){for(const t of this.createCommandNames)e[t]=e[t]||[],e[t].push(this.createWithoutSideEffects.bind(this));for(const t of this.updateCommandNames)e[t]=e[t]||[],e[t].push(this.updateWithoutSideEffects.bind(this));for(const t of this.deleteCommandNames)e[t]=e[t]||[],e[t].push(this.deleteWithoutSideEffects.bind(this))}startCapture(){this.frameMemory=0,this.capturing=!0}stopCapture(){this.frameMemory=0,this.capturing=!1}appendRecordedInformation(e){e.frameMemory[this.objectName]=this.frameMemory,e.memory[this.objectName]=this.memoryPerSecond}create(e){}createWithoutSideEffects(e){this.options.toggleCapture(!1);try{this.create(e)}finally{this.options.toggleCapture(!0)}}updateWithoutSideEffects(e){if(e&&0!==e.arguments.length){this.options.toggleCapture(!1);try{const t=e.arguments[0],n=this.getBoundInstance(t);if(!n)return;if(!D.getWebGlObjectTag(n))return;const r=this.getWebGlConstant(t),i=this.update(e,r,n);this.changeMemorySize(i)}finally{this.options.toggleCapture(!0)}}}deleteWithoutSideEffects(e){if(!e||!e.arguments||e.arguments.length<1)return;const t=e.arguments[0];if(t){this.options.toggleCapture(!1);try{const e=this.delete(t);this.changeMemorySize(-e)}finally{this.options.toggleCapture(!0)}}}changeMemorySize(e){this.totalMemory+=e,this.capturing&&(this.frameMemory+=e);const t=u.now-this.startTime,n=Math.round(t/1e3);this.memoryPerSecond[n]=this.totalMemory}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}getByteSizeForInternalFormat(e){return Ye.byteSizePerInternalFormat[e]||4}readPixelStoreState(){const e=this.options.context,t={UNPACK_FLIP_Y_WEBGL:e.getParameter(p.UNPACK_FLIP_Y_WEBGL.value),UNPACK_PREMULTIPLY_ALPHA_WEBGL:e.getParameter(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL.value),UNPACK_COLORSPACE_CONVERSION_WEBGL:e.getParameter(p.UNPACK_COLORSPACE_CONVERSION_WEBGL.value),UNPACK_ALIGNMENT:e.getParameter(p.UNPACK_ALIGNMENT.value)};return e instanceof WebGL2RenderingContext&&(t.UNPACK_ROW_LENGTH=e.getParameter(p.UNPACK_ROW_LENGTH.value),t.UNPACK_IMAGE_HEIGHT=e.getParameter(p.UNPACK_IMAGE_HEIGHT.value),t.UNPACK_SKIP_PIXELS=e.getParameter(p.UNPACK_SKIP_PIXELS.value),t.UNPACK_SKIP_ROWS=e.getParameter(p.UNPACK_SKIP_ROWS.value),t.UNPACK_SKIP_IMAGES=e.getParameter(p.UNPACK_SKIP_IMAGES.value)),t}}class qe extends Ye{get objectName(){return"Buffer"}getCreateCommandNames(){return["createBuffer"]}getUpdateCommandNames(){return["bufferData"]}getDeleteCommandNames(){return["deleteBuffer"]}getBoundInstance(e){const t=this.options.context;return e===p.ARRAY_BUFFER.value?t.getParameter(p.ARRAY_BUFFER_BINDING.value):e===p.ELEMENT_ARRAY_BUFFER.value?t.getParameter(p.ELEMENT_ARRAY_BUFFER_BINDING.value):e===p.COPY_READ_BUFFER.value?t.getParameter(p.COPY_READ_BUFFER_BINDING.value):e===p.COPY_WRITE_BUFFER.value?t.getParameter(p.COPY_WRITE_BUFFER_BINDING.value):e===p.TRANSFORM_FEEDBACK_BUFFER.value?t.getParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value):e===p.UNIFORM_BUFFER.value?t.getParameter(p.UNIFORM_BUFFER_BINDING.value):e===p.PIXEL_PACK_BUFFER.value?t.getParameter(p.PIXEL_PACK_BUFFER_BINDING.value):e===p.PIXEL_UNPACK_BUFFER.value?t.getParameter(p.PIXEL_UNPACK_BUFFER_BINDING.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(t,e);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){const n=this.getLength(t);return t.arguments.length>=4?{target:e,length:n,usage:t.arguments[2],offset:t.arguments[3],sourceLength:t.arguments[1]?t.arguments[1].length:-1}:3===t.arguments.length?{target:e,length:n,usage:t.arguments[2]}:void 0}getLength(e){const t=e.arguments[1],n=e.arguments[3],r=e.arguments[4];if("number"==typeof t)return t;if("number"==typeof r&&r>0)return r;const i=t.byteLength||t.length||0;return"number"==typeof n&&n>0?i-n:i}}class Qe extends Ye{get objectName(){return"Renderbuffer"}getCreateCommandNames(){return["createRenderbuffer"]}getUpdateCommandNames(){return["renderbufferStorage","renderbufferStorageMultisample"]}getDeleteCommandNames(){return["deleteRenderbuffer"]}getBoundInstance(e){const t=this.options.context;if(e===p.RENDERBUFFER.value)return t.getParameter(p.RENDERBUFFER_BINDING.value)}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(e,t);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return r.length=r.width*r.height*this.getByteSizeForInternalFormat(r.internalFormat),n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){return 4===e.arguments.length?{target:t,internalFormat:e.arguments[1],width:e.arguments[2],height:e.arguments[3],length:0,samples:0}:{target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,samples:e.arguments[1]}}}class Ze extends Ye{get objectName(){return"Texture2d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage2D","compressedTexImage2D","texStorage2D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D.value?t.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP_POSITIVE_X.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Y.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Z.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_X.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Y.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Z.value?t.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target===p.TEXTURE_2D_ARRAY.name||t.target===p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else{const e="TEXTURE_2D"===t?1:6;let n=r.internalFormat;n===p.RGBA.value&&(r.type===p.FLOAT.value&&(n=p.RGBA32F.value),r.type===p.HALF_FLOAT_OES.value&&(n=p.RGBA16F.value)),r.length=r.width*r.height*e*this.getByteSizeForInternalFormat(n)}return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage2D"===e.name?this.getTexImage2DCustomData(e,t,n):"compressedTexImage2D"===e.name?this.getCompressedTexImage2DCustomData(e,t,n):"texStorage2D"===e.name?this.getTexStorage2DCustomData(e,t,n):void 0}getTexStorage2DCustomData(e,t,n){let r;return 5===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!1}),r}getCompressedTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=7&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!0}),r}getTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8?r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],format:e.arguments[6],type:e.arguments[7],length:0,isCompressed:!1}:6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[5].width,height:e.arguments[5].height,format:e.arguments[3],type:e.arguments[4],length:0,isCompressed:!1}),r}}class Je extends Ye{get objectName(){return"Texture3d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage3D","compressedTexImage3D","texStorage3D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D_ARRAY.value?t.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):e===p.TEXTURE_3D.value?t.getParameter(p.TEXTURE_BINDING_3D.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target!==p.TEXTURE_2D_ARRAY.name&&t.target!==p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){if(e.arguments.length>=2&&0!==e.arguments[1])return 0;const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else r.length=r.width*r.height*r.depth*this.getByteSizeForInternalFormat(r.internalFormat);return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage3D"===e.name?this.getTexImage3DCustomData(e,t,n):"compressedTexImage3D"===e.name?this.getCompressedTexImage3DCustomData(e,t,n):"texStorage3D"===e.name?this.getTexStorage3DCustomData(e,t,n):void 0}getTexStorage3DCustomData(e,t,n){let r;return 6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!1}),r}getCompressedTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!0}),r}getTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=9&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],format:e.arguments[7],type:e.arguments[8],length:0,isCompressed:!1}),r}}class et extends Ye{get objectName(){return"Program"}getCreateCommandNames(){return["createProgram"]}getUpdateCommandNames(){return["linkProgram"]}getDeleteCommandNames(){return["deleteProgram"]}getBoundInstance(e){return e}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){if(e.arguments.length>=1&&!e.arguments[0])return 0;const r=this.getCustomData(n);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e){const t=this.options.context;return x.getProgramData(t,e)}}class tt{constructor(e){this.contextInformation=e,this.onCommandCallbacks={},this.recorders=[],this.initRecorders()}recordCommand(e){const t=this.onCommandCallbacks[e.name];if(t)for(const n of t)n(e)}startCapture(){for(const e of this.recorders)e.startCapture()}stopCapture(){for(const e of this.recorders)e.stopCapture()}appendRecordedInformation(e){for(const t of this.recorders)t.appendRecordedInformation(e)}initRecorders(){this.recorders.push(new qe(this.contextInformation),new Qe(this.contextInformation),new Ze(this.contextInformation),new Je(this.contextInformation),new et(this.contextInformation));for(const e of this.recorders)e.registerCallbacks(this.onCommandCallbacks)}}class nt{constructor(e){this.contextInformation=e,this.webGlObjects=[],this.initWebglObjects()}tagWebGlObjects(e){for(const t of this.webGlObjects){for(let n=0;n0&&this.currentCapture.commands.length===this.maxCommands&&this.onMaxCommand.trigger(this)}}}spyContext(e){const t=[];for(const n in e)n&&t.push(n);for(let n=0;n{this.spyRequestAnimationFrame("requestAnimationFrame",e.display)})}spyRequestAnimationFrame(e,t){const n=this;y.storeOriginFunction(t,e),t[e]=function(){const r=arguments[0],i=n.getCallback(n,r,()=>{n.spiedScope[e](r)});return y.executeOriginFunction(t,e,[i])}}spySetTimer(e){const t=this,n=this.spiedScope,r="setTimeout"===e;y.storeOriginFunction(n,e),n[e]=function(){const i=arguments[0],s=arguments[1],o=Array.prototype.slice.call(arguments);return at.setTimerCommonValues.indexOf(s)>-1&&(o[0]=t.getCallback(t,i,r?()=>{n[e](i)}:null)),y.executeOriginFunction(n,e,o)}}getCallback(e,t,n=null){return function(){const r=u.now;if(e.lastFrame=++e.lastFrame%e.speedRatio,e.willPlayNextFrame||e.speedRatio&&!e.lastFrame){try{e.onFrameStart.trigger(e)}catch(t){e.onError.trigger(t)}try{t.apply(e.spiedScope,arguments)}catch(t){e.onError.trigger(t)}e.lastSixtyFramesCurrentIndex=(e.lastSixtyFramesCurrentIndex+1)%at.fpsWindowSize,e.lastSixtyFramesDuration[e.lastSixtyFramesCurrentIndex]=r-e.lastSixtyFramesPreviousStart;try{e.onFrameEnd.trigger(e)}catch(t){e.onError.trigger(t)}e.willPlayNextFrame=!1}else n&&n();e.lastSixtyFramesPreviousStart=r}}}at.requestAnimationFrameFunctions=["requestAnimationFrame","msRequestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame"],at.setTimerFunctions=["setTimeout","setInterval"],at.setTimerCommonValues=[0,15,16,33,32,40],at.fpsWindowSize=60;class lt{constructor(e){this.canvas=e,this.onContextRequested=new l,this.init()}init(){const e=this,t=function(){const t="undefined"!=typeof HTMLCanvasElement&&this instanceof HTMLCanvasElement?HTMLCanvasElement:OffscreenCanvas,n=e.canvas?y.executeOriginFunction(this,"getContext",arguments):y.executePrototypeOriginFunction(this,t,"getContext",arguments);if(arguments.length>0){const e=arguments[0];if("webgl"!==e&&"experimental-webgl"!==e&&"webgl2"!==e&&"experimental-webgl2"!==e)return n}if(n){const t=Array.prototype.slice.call(arguments),r="webgl2"===t[0]||"experimental-webgl2"===t[0]?2:1;e.onContextRequested.trigger({context:n,contextVersion:r})}return n};this.canvas?(y.storeOriginFunction(this.canvas,"getContext"),this.canvas.getContext=t):("undefined"!=typeof HTMLCanvasElement&&(y.storePrototypeOriginFunction(HTMLCanvasElement,"getContext"),HTMLCanvasElement.prototype.getContext=t),"undefined"!=typeof OffscreenCanvas&&(y.storePrototypeOriginFunction(OffscreenCanvas,"getContext"),OffscreenCanvas.prototype.getContext=t))}}class ut{static startIntercepting(e){if(ut.intercepting)return;if("undefined"==typeof Worker)return;ut.workerBundleUrl=e,ut.originalWorkerConstructor=Worker,ut.intercepting=!0;const t=Worker;globalThis.Worker=function(e,n){if(n&&"module"===n.type)return new t(e,n);const r=e.toString();try{let i;try{i=new URL(r,location.href).href}catch(r){return new t(e,n)}const s=new XMLHttpRequest;if(s.open("GET",i,!1),s.send(),200===s.status&&ut.shouldInjectSource(s.responseText)){const e=ut.rewriteImportScripts(s.responseText,i),o="(function(){\n var __spectorBase = "+JSON.stringify(i)+';\n self.__SPECTOR_workerBaseUrl = __spectorBase;\n function __spectorResolve(u) {\n if (u == null) return u;\n if (typeof u !== "string") {\n if (u instanceof URL) return u;\n try { u = String(u); } catch (e) { return u; }\n }\n if (/^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i.test(u)) return u;\n try { return new URL(u, __spectorBase).href; }\n catch (e) { return u; }\n }\n self.__SPECTOR_resolveWorkerUrl = __spectorResolve;\n var __origImportScripts = self.importScripts;\n if (typeof __origImportScripts === "function") {\n self.importScripts = function() {\n var args = new Array(arguments.length);\n for (var i = 0; i < arguments.length; i++) args[i] = __spectorResolve(arguments[i]);\n return __origImportScripts.apply(self, args);\n };\n }\n var __origFetch = self.fetch;\n if (typeof __origFetch === "function") {\n self.fetch = function(input, init) {\n try {\n if (typeof input === "string") {\n input = __spectorResolve(input);\n } else if (input && typeof input === "object" && "url" in input && typeof Request === "function") {\n var r = input;\n var resolved = __spectorResolve(r.url);\n if (resolved !== r.url) input = new Request(resolved, r);\n }\n } catch (e) { /* fall through with original input */ }\n return __origFetch.call(self, input, init);\n };\n }\n if (typeof XMLHttpRequest === "function" && XMLHttpRequest.prototype && XMLHttpRequest.prototype.open) {\n var __origXhrOpen = XMLHttpRequest.prototype.open;\n XMLHttpRequest.prototype.open = function(method, url) {\n var args = Array.prototype.slice.call(arguments);\n args[1] = __spectorResolve(url);\n return __origXhrOpen.apply(this, args);\n };\n }\n if (typeof Worker === "function") {\n var __OrigWorker = Worker;\n self.Worker = function(scriptURL, options) {\n var resolved = __spectorResolve(scriptURL);\n return new __OrigWorker(resolved, options);\n };\n self.Worker.prototype = __OrigWorker.prototype;\n }\n})();\n',a="importScripts("+JSON.stringify(ut.workerBundleUrl)+");\n",l=new Blob([o+a+e],{type:"application/javascript"}),u=URL.createObjectURL(l),c=new t(u,n);return ut.spiedWorkers.push({worker:c,originalUrl:r}),c}}catch(e){console.warn("[Spector.js] Could not inject into Worker ("+r+"):",e)}const i=new t(e,n);return ut.spiedWorkers.push({worker:i,originalUrl:r}),i},globalThis.Worker.prototype=t.prototype}static stopIntercepting(){ut.intercepting&&(globalThis.Worker=ut.originalWorkerConstructor,ut.intercepting=!1)}static rewriteImportScripts(e,t){const n=/(['"`])((?:\\.|(?!\1).)*)\1/g;return e.replace(/importScripts\s*\(([^)]*)\)/g,(e,r)=>"importScripts("+r.replace(n,(e,n,r)=>{if("`"===n&&-1!==r.indexOf("${"))return e;let i;try{i=new URL(r,t).href}catch(t){return e}return n+i+n})+")")}static shouldInjectSource(e){return!/\bimport\s*(?:\/\*[\s\S]*?\*\/\s*)?\(/.test(e)&&!/\bnew\s+(?:(?:self|globalThis)\s*\.\s*)?(?:Worker|SharedWorker)\s*\(/.test(e)}static getSpiedWorkers(){return ut.spiedWorkers}static isIntercepting(){return ut.intercepting}}ut.spiedWorkers=[],ut.intercepting=!1;class ct{static getDelay(){return ct.delayMs}static setDelay(e){ct.delayMs="number"==typeof e&&e>0?e:0}static shouldForceIncomplete(e,t,n,r){return!(r<=0)&&e===p.COMPLETION_STATUS_KHR.value&&void 0!==t&&n-tthis._state,this.subscribe=e=>(this._listeners.add(e),()=>{this._listeners.delete(e)}),this._state=e}setState(e){this._state=e(this._state),this._emitChange()}setSnapshot(e){this._state=e,this._emitChange()}_emitChange(){for(const e of this._listeners)e()}}function pt(e){return(0,dt.useSyncExternalStore)(e.subscribe,e.getSnapshot)}var mt=n(848);const gt=(0,dt.createContext)(null);function Et(){const e=(0,dt.useContext)(gt);if(!e)throw new Error("CaptureMenuContext not provided — CaptureMenuRoot must be rendered inside CaptureMenuContext.Provider");return e}function vt({canvas:e}){const t=Et();return(0,mt.jsx)("li",{onClick:()=>t.handleCanvasSelected(e),children:(0,mt.jsx)("span",{children:`Id: ${e.id} - Size: ${e.width}*${e.height}`})})}function Ct(){const e=Et(),t=pt(e.store),n=t.selectedCanvas?`${t.selectedCanvas.id} (${t.selectedCanvas.width}*${t.selectedCanvas.height})`:"Choose Canvas...";return(0,mt.jsxs)("div",{className:"canvasListComponent",children:[(0,mt.jsx)("span",{commandName:"onCanvasSelection",onClick:e.handleCanvasListToggle,children:n}),(0,mt.jsx)("ul",{style:{display:t.showCanvasList?"block":"none",visibility:t.showCanvasList?"visible":"hidden"},children:t.canvases.map((e,t)=>(0,mt.jsx)(vt,{canvas:e},e.id||t))})]})}function Dt(){const e=Et(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"captureMenuActionsComponent",children:[(0,mt.jsx)("div",{commandName:"onCaptureRequested",onClick:e.handleCaptureRequested}),t.isPlaying?(0,mt.jsx)("div",{commandName:"onPauseRequested",onClick:e.handlePauseRequested}):(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("div",{commandName:"onPlayRequested",onClick:e.handlePlayRequested}),(0,mt.jsx)("div",{commandName:"onPlayNextFrameRequested",onClick:e.handlePlayNextFrameRequested})]})]})}function St(){const e=pt(Et().store);return(0,mt.jsxs)("span",{className:"fpsCounterComponent",children:[e.fps.toFixed(2)," Fps"]})}function At(){const e=pt(Et().store);return(0,mt.jsxs)("div",{children:[(0,mt.jsxs)("div",{className:"captureMenuComponent "+(e.visible?"active":""),children:[(0,mt.jsx)(Ct,{}),(0,mt.jsx)(Dt,{}),(0,mt.jsx)(St,{})]}),(0,mt.jsx)("div",{className:"captureMenuLogComponent "+(e.logVisible?"active":""),children:(0,mt.jsx)("span",{className:e.logLevel===i.error?"error":"",children:e.logText})})]})}class _t{constructor(e={}){this.options=e,this.handleCanvasListToggle=()=>{this.store.getSnapshot(),this.store.setState(e=>Object.assign(Object.assign({},e),{selectedCanvas:null,showCanvasList:!e.showCanvasList,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!e.showCanvasList&&!this._hideLog})),this.onCanvasSelected.trigger(null),this._isTrackingCanvas&&this.trackPageCanvases()},this.handleCanvasSelected=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{selectedCanvas:e,showCanvasList:!1,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)},this.handleCaptureRequested=()=>{const e=this.getSelectedCanvasInformation();e&&this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.PleaseWaitHelpText,logVisible:!this._hideLog})),setTimeout(()=>{this.onCaptureRequested.trigger(e)},200)},this.handlePauseRequested=()=>{this.onPauseRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!1}))},this.handlePlayRequested=()=>{this.onPlayRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!0}))},this.handlePlayNextFrameRequested=()=>{this.onPlayNextFrameRequested.trigger(this.getSelectedCanvasInformation())},this._rootPlaceHolder=e.rootPlaceHolder||document.body,this._hideLog=!!e.hideLog,this._isTrackingCanvas=!1,this._extraCanvasEntries=[],this.onCanvasSelected=new l,this.onCaptureRequested=new l,this.onPauseRequested=new l,this.onPlayRequested=new l,this.onPlayNextFrameRequested=new l,this.store=new ft({visible:!0,logText:_t.SelectCanvasHelpText,logLevel:i.info,logVisible:!this._hideLog,canvases:[],selectedCanvas:null,showCanvasList:!1,isPlaying:!0,fps:0}),this._container=document.createElement("div"),this._container.className="spector-react-capture-menu",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(gt.Provider,{value:this},(0,dt.createElement)(At)))}getSelectedCanvasInformation(){return this.store.getSnapshot().selectedCanvas}trackPageCanvases(){if(this._isTrackingCanvas=!0,document.body){const e=document.body.querySelectorAll("canvas");this.updateCanvasesList(e)}}updateCanvasesList(e){const t=[];for(let n=0;nObject.assign(Object.assign({},n),{canvases:t,selectedCanvas:e,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}captureComplete(e){e?this.store.setState(t=>Object.assign(Object.assign({},t),{logLevel:i.error,logText:e,logVisible:!this._hideLog})):this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog}))}setFPS(e){this.store.setState(t=>Object.assign(Object.assign({},t),{fps:e}))}_updateCanvasesInternal(e){for(const t of this._extraCanvasEntries)e.push(t);this.store.getSnapshot().showCanvasList?this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e})):1===e.length?(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:e[0],logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e[0])):(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:null,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(null))}}_t.SelectCanvasHelpText="Please, select a canvas in the list above.",_t.ActionsHelpText="Record with the red button, you can also pause or continue playing the current scene.",_t.PleaseWaitHelpText="Capturing, be patient (this can take up to 3 minutes)...";const yt=(0,dt.createContext)(null);function bt(){const e=(0,dt.useContext)(yt);if(!e)throw new Error("ResultViewContext not provided — ResultViewRoot must be rendered inside ResultViewContext.Provider");return e}function Tt(){const e=bt(),t=pt(e.store),n=(0,dt.useRef)(null),r=(0,dt.useCallback)(e=>{e.preventDefault();const t=e.currentTarget.parentElement,n=t.parentElement;if(!n)return;const r=n.querySelectorAll("li:not(.resultViewMenuSmall)");if("true"===t.getAttribute("open")){t.setAttribute("open","false");for(let e=0;e{e.handleSearchTextChange(t.target.value)},[e]),s=(0,dt.useCallback)(t=>{t.stopPropagation(),e.handleSearchTextChange("")},[e]),o=(0,dt.useCallback)(t=>n=>{n.preventDefault(),e.handleMenuStatusChange(t)},[e]),a=(0,dt.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),e.handleClose()},[e]);return(0,mt.jsxs)("ul",{className:"resultViewMenuComponent",ref:n,children:[(0,mt.jsx)("li",{className:"resultViewMenuOpen resultViewMenuSmall",children:(0,mt.jsx)("a",{href:"#",role:"button",onClick:r,children:"Menu"})}),(0,mt.jsxs)("li",{className:"searchContainer",children:[(0,mt.jsx)("input",{type:"text",placeholder:"Search...",value:t.searchText,commandName:"onSearchTextChanged",commandEventBinding:"change",onChange:i}),(0,mt.jsx)("a",{className:"clearSearch",commandName:"onSearchTextCleared",onClick:s,children:"X"})]}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:0===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCapturesClicked",onClick:o(0),children:"Captures"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:10===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInformationClicked",onClick:o(10),children:"Information"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:20===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInitStateClicked",onClick:o(20),children:"Init State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:40===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCommandsClicked",onClick:o(40),children:"Commands"+(t.commandCount>0?" ("+t.commandCount+")":"")})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:60===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCompareClicked",onClick:o(60),children:"Compare"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:30===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onEndStateClicked",onClick:o(30),children:"End State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{role:"button",commandName:"onCloseClicked",onClick:a,children:"Close"})})]})}function Rt({children:e}){return(0,mt.jsx)("div",{className:"resultViewContentComponent",children:e})}function xt({capture:e,active:t,onCaptureSelected:n,onSaveRequested:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),r()},[r]),s=(0,dt.useCallback)(()=>{n()},[n]),o=new Date(e.startTime).toTimeString().split(" ")[0];return(0,mt.jsxs)("li",{className:t?"active":"",onClick:s,children:[e.endState.VisualState.Attachments?e.endState.VisualState.Attachments.map((e,t)=>(0,mt.jsx)("img",{src:encodeURI(e.src)},t)):(0,mt.jsx)("span",{children:e.endState.VisualState.FrameBufferStatus}),(0,mt.jsxs)("span",{children:[o,(0,mt.jsx)("a",{href:"#",className:"captureListItemSave",commandName:"onSaveRequested",onClick:i})]})]})}function wt({active:e,captures:t,onCaptureSelected:n,onSaveRequested:r,onCaptureLoaded:i}){const s=(0,dt.useRef)(null),o=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault()},[]),l=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),function(e,t){let n=null;if(e&&e.dataTransfer&&e.dataTransfer.files&&(n=e.dataTransfer.files),e&&e.target&&e.target.files&&(n=e.target.files),n&&n.length>0)for(let e=0;e{a.error("Error while reading file: "+r.name+e)},i.onload=e=>{try{const n=JSON.parse(e.target.result);t(n)}catch(e){a.error("Error while reading file: "+r.name+e)}},i.readAsText(r)}}(e.nativeEvent,i)},[i]);return(0,mt.jsxs)("div",{className:"captureListComponent "+(e?"active":""),children:[(0,mt.jsx)("div",{className:"openCaptureFile",ref:s,onDragEnter:o,onDragOver:o,onDrop:l,children:(0,mt.jsx)("span",{children:"Drag files here to open a previously saved capture."})}),(0,mt.jsx)("ul",{children:t.map((e,t)=>(0,mt.jsx)(xt,{capture:e.capture,active:e.active,onCaptureSelected:()=>n(t),onSaveRequested:()=>r(e.capture)},t))})]})}function Ft({children:e}){return(0,mt.jsx)("div",{className:"visualStateListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Nt({item:e,onVisualStateSelected:t}){const n=(0,dt.useRef)(null);(0,dt.useEffect)(()=>{e.active&&n.current&&setTimeout(()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const r=(0,dt.useCallback)(()=>{t()},[t]),i=e.VisualState;return(0,mt.jsxs)("li",{ref:n,className:e.active?"active":"",onClick:r,commandName:"onVisualStateSelected",children:[i.Attachments?i.Attachments.map((e,t)=>e.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{src:encodeURI(e.src)}),i.Attachments.length>1&&(0,mt.jsx)("span",{children:e.attachmentName}),!!e.textureLayer&&(0,mt.jsx)("span",{children:"Layer: "+e.textureLayer}),!!e.textureCubeMapFace&&(0,mt.jsx)("span",{children:e.textureCubeMapFace})]},t):null):(0,mt.jsx)("span",{children:i.FrameBufferStatus}),(0,mt.jsx)("span",{children:i.FrameBuffer?"Frame buffer: "+i.FrameBuffer.__SPECTOR_Object_TAG.id:"Canvas frame buffer"})]})}function Lt({children:e}){return(0,mt.jsx)("div",{className:"commandListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Ot({command:e,onCommandSelected:t,onVertexSelected:n,onFragmentSelected:r,onShaderSelected:i}){var s;const o=(0,dt.useRef)(null),a=e.capture,l=function(e){switch(e){case 50:return"deprecated";case 10:return"unused";case 20:return"disabled";case 30:return"redundant";case 40:return"valid";default:return"unknown"}}(a.status),u=!!a.VisualState;let c="";u&&(c=" drawCall"),e.active&&(c=" active"),(0,dt.useEffect)(()=>{e.active&&o.current&&setTimeout(()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const h=(0,dt.useCallback)(e=>{t()},[t]),d=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==n||n()},[n]),f=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==r||r()},[r]),p=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==i||i()},[i]);let m=null;if(u&&"clear"!==a.name)try{const e=a.DrawCall.shaders[0],t=a.DrawCall.shaders[1];m=(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("a",{href:"#",onClick:d,children:e.name}),(0,mt.jsx)("a",{href:"#",onClick:f,children:t.name})]})}catch(e){}const g=(null===(s=a.shader)||void 0===s?void 0:s.source)?(0,mt.jsx)("a",{href:"#",commandName:"onShaderSourceSelected",onClick:p,children:"Source"}):null;return(0,mt.jsxs)("li",{ref:o,className:c,onClick:h,commandName:"onCommandSelected",children:[a.marker&&(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.marker+" "}),"LOG"===a.name?(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.text+" "}):(0,mt.jsx)("span",{dangerouslySetInnerHTML:{__html:a.text.replace(a.name,`${a.name}`)}}),g,m]})}function It({children:e}){return(0,mt.jsx)("div",{className:"commandDetailComponent",children:e})}function kt({left:e,children:t}){return(0,mt.jsx)("div",{className:e?"informationColumnLeftComponent":"informationColumnRightComponent",children:t})}function Mt({children:e}){return(0,mt.jsx)("div",{className:"jsonContentComponent",children:e})}function Pt(e,t,n,r){return{row:Math.max(0,parseInt(t,10)-1),column:n?Math.max(0,parseInt(n,10)-1):0,text:r.trim()||e,type:e.toLowerCase()}}var Bt,Ut,$t=Object.create,Gt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor,Wt=Object.getOwnPropertyNames,Ht=Object.getPrototypeOf,jt=Object.prototype.hasOwnProperty,zt=e=>{throw TypeError(e)},Xt=(e,t)=>{for(var n in t)Gt(e,n,{get:t[n],enumerable:!0})},Kt=(e,t,n)=>(((e,t)=>{t.has(e)||zt("Cannot access private method")})(e,t),n),Yt=(Bt=e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=/\r\n|[\n\r\u2028\u2029]/;e.codeFrameColumns=function(e,n,r={}){let i=new Proxy({},{get:()=>e=>e}),s=e.split(t),{start:o,end:a,markerLines:l}=function(e,t,n){let r=Object.assign({column:0,line:-1},e.start),i=Object.assign({},r,e.end),{linesAbove:s=2,linesBelow:o=3}=n||{},a=r.line,l=r.column,u=i.line,c=i.column,h=Math.max(a-(s+1),0),d=Math.min(t.length,u+o);-1===a&&(h=0),-1===u&&(d=t.length);let f=u-a,p={};if(f)for(let e=0;e<=f;e++){let n=e+a;if(l)if(0===e){let e=t[n-1].length;p[n]=[l,e-l+1]}else if(e===f)p[n]=[0,c];else{let r=t[n-e].length;p[n]=[0,r]}else p[n]=!0}else p[a]=l===c?!l||[l,0]:[l,c-l];return{start:h,end:d,markerLines:p}}(n,s,r),u=n.start&&"number"==typeof n.start.column,c=String(a).length,h=e.split(t,a).slice(o,a).map((e,t)=>{let n=o+1+t,s=` ${` ${n}`.slice(-c)} |`,a=l[n],u=!l[n+1];if(a){let t="";if(Array.isArray(a)){let n=e.slice(0,Math.max(a[0]-1,0)).replace(/[^\t]/g," "),o=a[1]||1;t=["\n ",i.gutter(s.replace(/\d/g," "))," ",n,i.marker("^").repeat(o)].join(""),u&&r.message&&(t+=" "+i.message(r.message))}return[i.marker(">"),i.gutter(s),e.length>0?` ${e}`:"",t].join("")}return` ${i.gutter(s)}${e.length>0?` ${e}`:""}`}).join("\n");return r.message&&!u&&(h=`${" ".repeat(c+1)}${r.message}\n${h}`),h}},()=>(Ut||Bt((Ut={exports:{}}).exports),Ut.exports));Xt({},{__debug:()=>Hs,check:()=>Vs,doc:()=>vs,format:()=>Gs,formatWithCursor:()=>$s,getSupportInfo:()=>Ws,util:()=>_s,version:()=>As});var qt=(e,t,n,r)=>{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Qt=class{diff(e,t,n={}){let r;"function"==typeof n?(r=n,n={}):"callback"in n&&(r=n.callback);let i=this.castInput(e,n),s=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),a=this.removeEmpty(this.tokenize(s,n));return this.diffWithOptionsObj(o,a,n,r)}diffWithOptionsObj(e,t,n,r){var i;let s=e=>(e=this.postProcess(e,n),r?void setTimeout(function(){r(e)},0):e),o=t.length,a=e.length,l=1,u=o+a;null!=n.maxEditLength&&(u=Math.min(u,n.maxEditLength));let c=null!==(i=n.timeout)&&void 0!==i?i:1/0,h=Date.now()+c,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=a&&f+1>=o)return s(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,g=()=>{for(let r=Math.max(p,-l);r<=Math.min(m,l);r+=2){let i,l=d[r-1],u=d[r+1];l&&(d[r-1]=void 0);let c=!1;if(u){let e=u.oldPos-r;c=u&&0<=e&&e=a&&f+1>=o)return s(this.buildValues(i.lastComponent,t,e))||!0;d[r]=i,i.oldPos+1>=a&&(m=Math.min(m,r-1)),f+1>=o&&(p=Math.max(p,r+1))}else d[r]=void 0}l++};if(r)!function e(){setTimeout(function(){if(l>u||Date.now()>h)return r(void 0);g()||e()},0)}();else for(;l<=u&&Date.now()<=h;){let e=g();if(e)return e}}addToPath(e,t,n,r,i){let s=e.lastComponent;return s&&!i.oneChangePerToken&&s.added===t&&s.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:s.count+1,added:t,removed:n,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:s}}}extractCommon(e,t,n,r,i){let s=t.length,o=n.length,a=e.oldPos,l=a-r,u=0;for(;l+1e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(a,a+e.count));a+=e.count,e.added||(l+=e.count)}}return i}},Zt=new class extends Qt{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Jt(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}function en(e,t){let n;switch(t){case"\n":n=/\n/gu;break;case"\r":n=/\r/gu;break;case"\r\n":n=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let r=e.match(n);return r?r.length:0}var tn="string",nn="array",rn="cursor",sn="indent",on="align",an="trim",ln="group",un="fill",cn="if-break",hn="indent-if-break",dn="line-suffix",fn="line-suffix-boundary",pn="line",mn="label",gn="break-parent",En=new Set([rn,sn,on,an,ln,un,cn,hn,dn,fn,pn,mn,gn]),vn=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},Cn=function(e){if("string"==typeof e)return tn;if(Array.isArray(e))return nn;if(!e)return;let{type:t}=e;return En.has(t)?t:void 0};var Dn=class extends Error{name="InvalidDocError";constructor(e){super(function(e){let t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(Cn(e))throw new Error("doc is valid.");let n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;let r=(e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e))([...En].map(e=>`'${e}'`));return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},Sn=Dn,An={},_n=function(e,t,n,r){let i=[e];for(;i.length>0;){let e=i.pop();if(e===An){n(i.pop());continue}n&&i.push(e,An);let s=Cn(e);if(!s)throw new Sn(e);if(!1!==(null==t?void 0:t(e)))switch(s){case nn:case un:{let t=s===nn?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case cn:i.push(e.flatContents,e.breakContents);break;case ln:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case on:case sn:case hn:case mn:case dn:i.push(e.contents);break;case tn:case rn:case an:case fn:case pn:case gn:break;default:throw new Sn(e)}}};function yn(e,t){if("string"==typeof e)return t(e);let n=new Map;return function e(r){if(n.has(r))return n.get(r);let i=function(n){switch(Cn(n)){case nn:return t(n.map(e));case un:return t({...n,parts:n.parts.map(e)});case cn:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case ln:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case on:case sn:case hn:case mn:case dn:return t({...n,contents:e(n.contents)});case tn:case rn:case an:case fn:case pn:case gn:return t(n);default:throw new Sn(n)}}(r);return n.set(r,i),i}(e)}function bn(e,t,n){let r=n,i=!1;return _n(e,function(e){if(i)return!1;let n=t(e);void 0!==n&&(i=!0,r=n)}),r}function Tn(e){if(e.type===ln&&e.break||e.type===pn&&e.hard||e.type===gn)return!0}function Rn(e){if(e.length>0){let t=vn(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function xn(e){return e.type!==pn||e.hard?e.type===cn?e.flatContents:e:e.soft?"":" "}function wn(e){for(e=[...e];e.length>=2&&vn(!1,e,-2).type===pn&&vn(!1,e,-1).type===gn;)e.length-=2;if(e.length>0){let t=Fn(vn(!1,e,-1));e[e.length-1]=t}return e}function Fn(e){switch(Cn(e)){case sn:case hn:case ln:case dn:case mn:{let t=Fn(e.contents);return{...e,contents:t}}case cn:return{...e,breakContents:Fn(e.breakContents),flatContents:Fn(e.flatContents)};case un:return{...e,parts:wn(e.parts)};case nn:return wn(e);case tn:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return tfunction(e){switch(Cn(e)){case un:if(e.parts.every(e=>""===e))return"";break;case ln:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===ln&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case on:case sn:case hn:case dn:if(!e.contents)return"";break;case cn:if(!e.flatContents&&!e.breakContents)return"";break;case nn:{let t=[];for(let n of e){if(!n)continue;let[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof vn(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case tn:case rn:case an:case fn:case pn:case mn:case gn:break;default:throw new Sn(e)}return e}(e))}(e))}function Ln(e){if(e.type===pn)return!0}function On(e,t){return e.type===mn?{...e,contents:t(e.contents)}:t(e)}var In=()=>{},kn=In,Mn=In,Pn=In;function Bn(e){return kn(e),{type:sn,contents:e}}function Un(e,t){return kn(t),{type:on,contents:t,n:e}}function $n(e,t={}){return kn(e),Mn(t.expandedStates,!0),{type:ln,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Gn(e){return kn(e),{type:dn,contents:e}}var Vn={type:fn},Wn={type:gn},Hn={type:an},jn={type:pn,hard:!0},zn={type:pn,hard:!0,literal:!0},Xn={type:pn},Kn={type:pn,soft:!0},Yn=[jn,Wn],qn=[zn,Wn],Qn={type:rn};function Zn(e,t){kn(e),Mn(t);let n=[];for(let r=0;r0){for(let e=0;e!(function(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}(e)||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e)),nr=/[^\x20-\x7F]/u,rr=function(e){if(!e)return 0;if(!nr.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(let n of e){let e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=tr(e)?1:2)}return t},ir=Symbol("MODE_BREAK"),sr=Symbol("MODE_FLAT"),or=Symbol("cursor"),ar=Symbol("DOC_FILL_PRINTED_LENGTH");function lr(e,t){return cr(e,{type:"indent"},t)}function ur(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?cr(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:cr(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function cr(e,t,n){let r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t],i="",s=0,o=0,a=0;for(let e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function hr(e){let t=0,n=0,r=e.length;e:for(;r--;){let i=e[r];if(i!==or)for(let n=i.length-1;n>=0;n--){let s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(or);return t}function dr(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length,a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}let{mode:e,doc:u}=a.pop(),c=Cn(u);switch(c){case tn:l.push(u),n-=rr(u);break;case nn:case un:{let t=c===nn?u:u.parts,n=u[ar]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case sn:case on:case hn:case mn:a.push({mode:e,doc:u.contents});break;case an:n+=hr(l);break;case ln:{if(s&&u.break)return!1;let t=u.break?ir:e,n=u.expandedStates&&t===ir?vn(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case cn:{let t=(u.groupId?i[u.groupId]||sr:e)===ir?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case pn:if(e===ir||u.hard)return!0;u.soft||(l.push(" "),n--);break;case dn:r=!0;break;case fn:if(r)return!1}}return!1}function fr(e,t){let n={},r=t.printWidth,i=Jt(t.endOfLine),s=0,o=[{ind:{value:"",length:0,queue:[]},mode:ir,doc:e}],a=[],l=!1,u=[],c=0;for(function(e){let t=new Set,n=[];_n(e,function(e){if(e.type===gn&&Rn(n),e.type===ln){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===ln&&n.pop().break&&Rn(n)},!0)}(e);o.length>0;){let{ind:e,mode:h,doc:d}=o.pop();switch(Cn(d)){case tn:{let e="\n"!==i?qt(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=rr(e));break}case nn:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case rn:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(or),c++;break;case sn:o.push({ind:lr(e,t),mode:h,doc:d.contents});break;case on:o.push({ind:ur(e,d.n,t),mode:h,doc:d.contents});break;case an:s-=hr(a);break;case ln:switch(h){case sr:if(!l){o.push({ind:e,mode:d.break?ir:sr,doc:d.contents});break}case ir:{l=!1;let t={ind:e,mode:sr,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&dr(t,o,i,a,n))o.push(t);else if(d.expandedStates){let t=vn(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:ir,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:ir,doc:t});break}{let t=d.expandedStates[r],s={ind:e,mode:sr,doc:t};if(dr(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:ir,doc:d.contents});break}}d.id&&(n[d.id]=vn(!1,o,-1).mode);break;case un:{let t=r-s,i=d[ar]??0,{parts:a}=d,l=a.length-i;if(0===l)break;let c=a[i+0],f=a[i+1],p={ind:e,mode:sr,doc:c},m={ind:e,mode:ir,doc:c},g=dr(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}let E={ind:e,mode:sr,doc:f},v={ind:e,mode:ir,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}let C=a[i+2],D={ind:e,mode:h,doc:{...d,[ar]:i+2}};dr({ind:e,mode:sr,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case cn:case hn:{let t=d.groupId?n[d.groupId]:h;if(t===ir){let t=d.type===cn?d.breakContents:d.negate?d.contents:Bn(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===sr){let t=d.type===cn?d.flatContents:d.negate?Bn(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case dn:u.push({ind:e,mode:h,doc:d.contents});break;case fn:u.length>0&&o.push({ind:e,mode:h,doc:jn});break;case pn:switch(h){case sr:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case ir:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=hr(a),a.push(i+e.value),s=e.length)}break;case mn:o.push({ind:e,mode:h,doc:d.contents});break;case gn:break;default:throw new Sn(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}let h=a.indexOf(or);if(-1!==h){let e=a.indexOf(or,h+1);if(-1===e)return{formatted:a.filter(e=>e!==or).join("")};let t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}var pr,mr,gr,Er=function(e,t,n=0){let r=0;for(let i=n;i=0;n-=2)if(!Array.isArray(t[n])&&--e<0)return n;return-1},gr=function*(){let{stack:e}=this;for(let t=e.length-3;t>=0;t-=2){let n=e[t];Array.isArray(n)||(yield n)}};var vr=class{constructor(e){((e,t)=>{t.has(e)?zt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,void 0)})(this,pr),this.stack=[e]}get key(){let{stack:e,siblings:t}=this;return vn(!1,e,null===t?-2:-4)??null}get index(){return null===this.siblings?null:vn(!1,this.stack,-2)}get node(){return vn(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return null!==this.siblings}get siblings(){let{stack:e}=this,t=vn(!1,e,-3);return Array.isArray(t)?t:null}get next(){let{siblings:e}=this;return null===e?null:e[this.index+1]}get previous(){let{siblings:e}=this;return null===e?null:e[this.index-1]}get isFirst(){return 0===this.index}get isLast(){let{siblings:e,index:t}=this;return null!==e&&t===e.length-1}get isRoot(){return 1===this.stack.length}get root(){return this.stack[0]}get ancestors(){return[...Kt(this,pr,gr).call(this)]}getName(){let{stack:e}=this,{length:t}=e;return t>1?vn(!1,e,-2):null}getValue(){return vn(!1,this.stack,-1)}getNode(e=0){let t=Kt(this,pr,mr).call(this,e);return-1===t?null:this.stack[t]}getParentNode(e=0){return this.getNode(e+1)}call(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{return e(this)}finally{n.length=r}}callParent(e,t=0){let n=Kt(this,pr,mr).call(this,t+1),r=this.stack.splice(n+1);try{return e(this)}finally{this.stack.push(...r)}}each(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{for(let t=0;t{n[r]=e(t,r,i)},...t),n}match(...e){let t=this.stack.length-1,n=null,r=this.stack[t--];for(let i of e){if(void 0===r)return!1;let e=null;if("number"==typeof n&&(e=n,n=this.stack[t--],r=this.stack[t--]),i&&!i(r,n,e))return!1;n=this.stack[t--],r=this.stack[t--]}return!0}findAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return t}hasAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return!0;return!1}},Cr=new Proxy(()=>{},{get:()=>Cr}),Dr=Cr;function*Sr(e,t){let{getVisitorKeys:n,filter:r=()=>!0}=t,i=e=>function(e){return null!==e&&"object"==typeof e}(e)&&r(e);for(let t of n(e)){let n=e[t];if(Array.isArray(n))for(let e of n)i(e)&&(yield e);else i(n)&&(yield n)}}function Ar(e){return(t,n,r)=>{let i=!(null==r||!r.backwards);if(!1===n)return!1;let{length:s}=t,o=n;for(;o>=0&&oObject.keys(e).filter(e=>!wr.has(e)),Nr=function(e){return e?t=>e(t,wr):Fr};function Lr(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=function(e){let t=e.type||e.kind||"(unknown type)",n=String(e.name||e.id&&("object"==typeof e.id?e.id.name:e.id)||e.key&&("object"==typeof e.key?e.key.name:e.key)||e.value&&("object"==typeof e.value?"":String(e.value))||e.operator||"");return n.length>20&&(n=n.slice(0,19)+"…"),t+(n?" "+n:"")}(e)}function Or(e,t){t.leading=!0,t.trailing=!1,Lr(e,t)}function Ir(e,t,n){t.leading=!1,t.trailing=!1,n&&(t.marker=n),Lr(e,t)}function kr(e,t){t.leading=!1,t.trailing=!0,Lr(e,t)}var Mr=new WeakMap;function Pr(e,t){if(Mr.has(e))return Mr.get(e);let{printer:{getCommentChildNodes:n,canAttachComment:r,getVisitorKeys:i},locStart:s,locEnd:o}=t;if(!r)return[];let a=((null==n?void 0:n(e,t))??[...Sr(e,{getVisitorKeys:Nr(i)})]).flatMap(e=>r(e)?[e]:Pr(e,t));return a.sort((e,t)=>s(e)-s(t)||o(e)-o(t)),Mr.set(e,a),a}function Br(e,t,n,r){let i,s,{locStart:o,locEnd:a}=n,l=o(t),u=a(t),c=Pr(e,n),h=0,d=c.length;for(;h>1,r=c[e],f=o(r),p=a(r);if(f<=l&&u<=p)return Br(r,t,n,r);if(p<=l)i=r,h=e+1;else{if(!(u<=f))throw new Error("Comment location overlaps with node location");s=r,d=e}}if("TemplateLiteral"===(null==r?void 0:r.type)){let{quasis:e}=r,o=Hr(e,t,n);i&&Hr(e,i,n)!==o&&(i=null),s&&Hr(e,s,n)!==o&&(s=null)}return{enclosingNode:r,precedingNode:i,followingNode:s}}var Ur=()=>!1,$r=e=>!/[\S\n\u2028\u2029]/u.test(e);function Gr(e,t,n,r){let{comment:i,precedingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=o(i);if(s)for(let t=r-1;t>=0;t--){let{comment:r,precedingNode:i}=n[t];if(i!==s||!$r(e.slice(a(r),l)))break;l=o(r)}return xr(e,l,{backwards:!0})}function Vr(e,t,n,r){let{comment:i,followingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=a(i);if(s)for(let t=r+1;t0;--s){let{comment:i,precedingNode:u,followingNode:c}=e[s-1];Dr.strictEqual(u,o),Dr.strictEqual(c,a);let h=t.originalText.slice(t.locEnd(i),l);if(!((null==(r=(n=t.printer).isGap)?void 0:r.call(n,h,t))??/^[\s(]*$/u.test(h)))break;l=t.locStart(i)}for(let[t,{comment:n}]of e.entries())t1&&e.comments.sort((e,n)=>t.locStart(e)-t.locStart(n));e.length=0}function Hr(e,t,n){let r=n.locStart(t)-1;for(let t=1;t"string"==typeof e||"function"==typeof e,choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>"string"==typeof e||"object"==typeof e,cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:"Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.",cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:"Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.",cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function qr({plugins:e=[],showDeprecated:t=!1}={}){let n=e.flatMap(e=>e.languages??[]),r=[];for(let i of function(e){let t=[];for(let[n,r]of Object.entries(e)){let e={name:n,...r};Array.isArray(e.default)&&(e.default=vn(!1,e.default,-1).value),t.push(e)}return t}(Object.assign({},...e.map(({options:e})=>e),Yr)))!t&&i.deprecated||(Array.isArray(i.choices)&&(t||(i.choices=i.choices.filter(e=>!e.deprecated)),"parser"===i.name&&(i.choices=[...i.choices,...Qr(i.choices,n,e)])),i.pluginDefaults=Object.fromEntries(e.filter(e=>{var t;return void 0!==(null==(t=e.defaultOptions)?void 0:t[i.name])}).map(e=>[e.name,e.defaultOptions[i.name]])),r.push(i));return{languages:n,options:r}}function*Qr(e,t,n){let r=new Set(e.map(e=>e.value));for(let e of t)if(e.parsers)for(let t of e.parsers)if(!r.has(t)){r.add(t);let i=n.find(e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t)),s=e.name;null!=i&&i.name&&(s+=` (plugin: ${i.name})`),yield{value:t,description:s}}}var Zr,Jr,ei,ti,ni,ri="windows"===(null==(Zr=globalThis.Deno)?void 0:Zr.build.os)||(null==(ei=null==(Jr=globalThis.navigator)?void 0:Jr.platform)?void 0:ei.startsWith("Win"))||(null==(ni=null==(ti=globalThis.process)?void 0:ti.platform)?void 0:ni.startsWith("win"))||!1;function ii(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function si(e,t){if(!t)return;let n=(e=>String(e).split(/[/\\]/u).pop())(t).toLowerCase();return e.find(({filenames:e})=>null==e?void 0:e.some(e=>e.toLowerCase()===n))??e.find(({extensions:e})=>null==e?void 0:e.some(e=>n.endsWith(e)))}function oi(e,t){if(t){if(String(t).startsWith("file:"))try{t=function(e){return ri?function(e){e=ii(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return""!==e.hostname&&(t=`\\\\${e.hostname}${t}`),t}(e):function(e){return e=ii(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}(e)}(t)}catch{return}if("string"==typeof t)return e.find(({isSupported:e})=>null==e?void 0:e({filepath:t}))}}var ai=function(e,t){let n=((e,t)=>{if(!e||null!=t)return t.toReversed||!Array.isArray(t)?t.toReversed():[...t].reverse()})(!1,e.plugins).flatMap(e=>e.languages??[]),r=function(e,t){if(t)return e.find(({name:e})=>e.toLowerCase()===t)??e.find(({aliases:e})=>null==e?void 0:e.includes(t))??e.find(({extensions:e})=>null==e?void 0:e.includes(`.${t}`))}(n,t.language)??si(n,t.physicalFile)??si(n,t.file)??oi(n,t.physicalFile)??oi(n,t.file)??void t.physicalFile;return null==r?void 0:r.parsers[0]},li={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(e=>li.value(e)).join(", ")}]`;let t=Object.keys(e);return 0===t.length?"{}":`{ ${t.map(t=>`${li.key(t)}: ${li.value(e[t])}`).join(", ")} }`},pair:({key:e,value:t})=>li.value({[e]:t})},ui=new Proxy(String,{get:()=>ui}),ci=ui,hi=Symbol.for("vnopts.VALUE_NOT_EXIST"),di=Symbol.for("vnopts.VALUE_UNCHANGED"),fi=" ".repeat(2);function pi(e,t,n,r){return[`Invalid ${ci.red(r.key(e))} value.`,`Expected ${ci.blue(n)},`,`but received ${t===hi?ci.gray("nothing"):ci.red(r.value(t))}.`].join(" ")}function mi({text:e,list:t},n){let r=[];return e&&r.push(`- ${ci.blue(e)}`),t&&r.push([`- ${ci.blue(t.title)}:`].concat(t.values.map(e=>mi(e,n-fi.length).replace(/^|\n/g,`$&${fi}`))).join("\n")),gi(r,n)}function gi(e,t){if(1===e.length)return e[0];let[n,r]=e,[i,s]=e.map(e=>e.split("\n",1)[0].length);return i>t&&i>s?r:n}var Ei=[],vi=[],Ci=(e,t,{descriptor:n,logger:r,schemas:i})=>{let s=[`Ignored unknown option ${ci.yellow(n.pair({key:e,value:t}))}.`],o=Object.keys(i).sort().find(t=>function(e,t){if(e===t)return 0;let n=e;e.length>t.length&&(e=t,t=n);let r=e.length,i=t.length;for(;r>0&&e.charCodeAt(~-r)===t.charCodeAt(~-i);)r--,i--;let s=0;for(;sa?u>a?a+1:u:u>l?l+1:u;return a}(e,t)<3);o&&s.push(`Did you mean ${ci.blue(n.key(o))}?`),r.warn(s.join(" "))},Di=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"],Si=class{static create(e){return function(e,t){let n=new e(t),r=Object.create(n);for(let e of Di)e in t&&(r[e]=Ai(t[e],n,Si.prototype[e].length));return r}(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,t){return!1}deprecated(e,t){return!1}forward(e,t){}redirect(e,t){}overlap(e,t,n){return e}preprocess(e,t){return e}postprocess(e,t){return di}};function Ai(e,t,n){return"function"==typeof e?(...r)=>e(...r.slice(0,n-1),t,...r.slice(n-1)):()=>e}var _i=class extends Si{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},yi=class extends Si{expected(){return"anything"}validate(){return!0}},bi=class extends Si{constructor({valueSchema:e,name:t=e.name,...n}){super({...n,name:t}),this._valueSchema=e}expected(e){let{text:t,list:n}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:t&&`an array of ${t}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(e,t){if(!Array.isArray(e))return!1;let n=[];for(let r of e){let e=t.normalizeValidateResult(this._valueSchema.validate(r,t),r);!0!==e&&n.push(e.value)}return 0===n.length||{value:n}}deprecated(e,t){let n=[];for(let r of e){let e=t.normalizeDeprecatedResult(this._valueSchema.deprecated(r,t),r);!1!==e&&n.push(...e.map(({value:e})=>({value:[e]})))}return n}forward(e,t){let n=[];for(let r of e){let e=t.normalizeForwardResult(this._valueSchema.forward(r,t),r);n.push(...e.map(Ti))}return n}redirect(e,t){let n=[],r=[];for(let i of e){let e=t.normalizeRedirectResult(this._valueSchema.redirect(i,t),i);"remain"in e&&n.push(e.remain),r.push(...e.redirect.map(Ti))}return 0===n.length?{redirect:r}:{redirect:r,remain:n}}overlap(e,t){return e.concat(t)}};function Ti({from:e,to:t}){return{from:[e],to:t}}var Ri=class extends Si{expected(){return"true or false"}validate(e){return"boolean"==typeof e}};function xi(e,t){let n=Object.create(null);for(let r of e){let e=r[t];if(n[e])throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n[e]=r}return n}function wi(e,t){if(e===t)return 0;let n=typeof e,r=typeof t,i=["undefined","object","boolean","number","string"];return n!==r?i.indexOf(n)-i.indexOf(r):"string"!==n?Number(e)-Number(t):e.localeCompare(t)}function Fi(e){return void 0===e?{}:e}function Ni(e){if("string"==typeof e)return{text:e};let{text:t,list:n}=e;return function(e){if(!e)throw new Error("Unexpected `expected` result, there should be at least one field.")}(void 0!==(t||n)),n?{text:t,list:{title:n.title,values:n.values.map(Ni)}}:{text:t}}function Li(e,t){return!0===e||(!1===e?{value:t}:e)}function Oi(e,t,n=!1){return!1!==e&&(!0===e?!!n||[{value:t}]:"value"in e?[e]:0!==e.length&&e)}function Ii(e,t){return"string"==typeof e||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function ki(e,t){return void 0===e?[]:Array.isArray(e)?e.map(e=>Ii(e,t)):[Ii(e,t)]}function Mi(e,t){let n=ki("object"==typeof e&&"redirect"in e?e.redirect:e,t);return 0===n.length?{remain:t,redirect:n}:"object"==typeof e&&"remain"in e?{remain:e.remain,redirect:n}:{redirect:n}}var Pi,Bi=class extends Si{constructor(e){super(e),this._choices=function(e,t){let n=new Map;for(let r of e){let e=r[t];if(n.has(e))throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n.set(e,r)}return n}(e.choices.map(e=>e&&"object"==typeof e?e:{value:e}),"value")}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(e=>this._choices.get(e)).filter(({hidden:e})=>!e).map(e=>e.value).sort(wi).map(e.value),n=t.slice(0,-2),r=t.slice(-2);return{text:n.concat(r.join(" or ")).join(", "),list:{title:"one of the following values",values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return!(!t||!t.deprecated)&&{value:e}}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},Ui=class extends Si{expected(){return"a number"}validate(e,t){return"number"==typeof e}},$i=class extends Ui{expected(){return"an integer"}validate(e,t){return!0===t.normalizeValidateResult(super.validate(e,t),e)&&function(e){return e===Math.floor(e)}(e)}},Gi=class extends Si{expected(){return"a string"}validate(e){return"string"==typeof e}},Vi=li,Wi=Ci,Hi=(e,t,n)=>{let{text:r,list:i}=n.normalizeExpectedResult(n.schemas[e].expected(n)),s=[];return r&&s.push(pi(e,t,r,n.descriptor)),i&&s.push([pi(e,t,i.title,n.descriptor)].concat(i.values.map(e=>mi(e,n.loggerPrintWidth))).join("\n")),gi(s,n.loggerPrintWidth)},ji=(e,t,{descriptor:n})=>{let r=[`${ci.yellow("string"==typeof e?n.key(e):n.pair(e))} is deprecated`];return t&&r.push(`we now treat it as ${ci.blue("string"==typeof t?n.key(t):n.pair(t))}`),r.join("; ")+"."},zi=class{constructor(e,t){let{logger:n=console,loggerPrintWidth:r=80,descriptor:i=Vi,unknown:s=Wi,invalid:o=Hi,deprecated:a=ji,missing:l=()=>!1,required:u=()=>!1,preprocess:c=e=>e,postprocess:h=()=>di}=t||{};this._utils={descriptor:i,logger:n||{warn:()=>{}},loggerPrintWidth:r,schemas:xi(e,"name"),normalizeDefaultResult:Fi,normalizeExpectedResult:Ni,normalizeDeprecatedResult:Oi,normalizeForwardResult:ki,normalizeRedirectResult:Mi,normalizeValidateResult:Li},this._unknownHandler=s,this._invalidHandler=function(e){return(...t)=>{let n=e(...t);return"string"==typeof n?new Error(n):n}}(o),this._deprecatedHandler=a,this._identifyMissing=(e,t)=>!(e in t)||l(e,t),this._identifyRequired=u,this._preprocess=c,this._postprocess=h,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=function(){let e=Object.create(null);return t=>{let n=JSON.stringify(t);return!!e[n]||(e[n]=!0,!1)}}()}normalize(e){let t={},n=[this._preprocess(e,this._utils)],r=()=>{for(;0!==n.length;){let e=n.shift(),r=this._applyNormalization(e,t);n.push(...r)}};r();for(let e of Object.keys(this._utils.schemas)){let r=this._utils.schemas[e];if(!(e in t)){let t=Fi(r.default(this._utils));"value"in t&&n.push({[e]:t.value})}}r();for(let e of Object.keys(this._utils.schemas)){if(!(e in t))continue;let n=this._utils.schemas[e],r=t[e],i=n.postprocess(r,this._utils);i!==di&&(this._applyValidation(i,e,n),t[e]=i)}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let n=[],{knownKeys:r,unknownKeys:i}=this._partitionOptionKeys(e);for(let i of r){let r=this._utils.schemas[i],s=r.preprocess(e[i],this._utils);this._applyValidation(s,i,r);let o=({from:e,to:t})=>{n.push("string"==typeof t?{[t]:e}:{[t.key]:t.value})},a=({value:e,redirectTo:t})=>{let n=Oi(r.deprecated(e,this._utils),s,!0);if(!1!==n)if(!0===n)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,t,this._utils));else for(let{value:e}of n){let n={key:i,value:e};if(!this._hasDeprecationWarned(n)){let r="string"==typeof t?{key:t,value:e}:t;this._utils.logger.warn(this._deprecatedHandler(n,r,this._utils))}}};ki(r.forward(s,this._utils),s).forEach(o);let l=Mi(r.redirect(s,this._utils),s);if(l.redirect.forEach(o),"remain"in l){let e=l.remain;t[i]=i in t?r.overlap(t[i],e,this._utils):e,a({value:e})}for(let{from:e,to:t}of l.redirect)a({value:e,redirectTo:t})}for(let r of i){let i=e[r];this._applyUnknownHandler(r,i,t,(e,t)=>{n.push({[e]:t})})}return n}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,hi,this._utils)}_partitionOptionKeys(e){let[t,n]=function(e,t){let n=[],r=[];for(let i of e)t(i)?n.push(i):r.push(i);return[n,r]}(Object.keys(e).filter(t=>!this._identifyMissing(t,e)),e=>e in this._utils.schemas);return{knownKeys:t,unknownKeys:n}}_applyValidation(e,t,n){let r=Li(n.validate(e,this._utils),e);if(!0!==r)throw this._invalidHandler(t,r.value,this._utils)}_applyUnknownHandler(e,t,n,r){let i=this._unknownHandler(e,t,this._utils);if(i)for(let e of Object.keys(i)){if(this._identifyMissing(e,i))continue;let t=i[e];e in this._utils.schemas?r(e,t):n[e]=t}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==di){if(t.delete)for(let n of t.delete)delete e[n];if(t.override){let{knownKeys:n,unknownKeys:r}=this._partitionOptionKeys(t.override);for(let r of n){let n=t.override[r];this._applyValidation(n,r,this._utils.schemas[r]),e[r]=n}for(let n of r){let r=t.override[n];this._applyUnknownHandler(n,r,e,(t,n)=>{let r=this._utils.schemas[t];this._applyValidation(n,t,r),e[t]=n})}}}}};function Xi(e,{isCLI:t,optionInfos:n,FlagSchema:r}){let i,{name:s}=e,o={name:s},a={};switch(e.type){case"int":i=$i,t&&(o.preprocess=Number);break;case"string":case"path":i=Gi;break;case"choice":i=Bi,o.choices=e.choices.map(t=>null!=t&&t.redirect?{...t,redirect:{to:{key:e.name,value:t.redirect}}}:t);break;case"boolean":i=Ri;break;case"flag":i=r,o.flags=n.flatMap(e=>[e.alias,e.description&&e.name,e.oppositeDescription&&`no-${e.name}`].filter(Boolean));break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?o.validate=(t,n,r)=>e.exception(t)||n.validate(t,r):o.validate=(e,t,n)=>void 0===e||t.validate(e,n),e.redirect&&(a.redirect=t=>t?{to:"string"==typeof e.redirect?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(a.deprecated=!0),t&&!e.array){let e=o.preprocess||(e=>e);o.preprocess=(t,n,r)=>n.preprocess(e(Array.isArray(t)?vn(!1,t,-1):t),r)}return e.array?bi.create({...t?{preprocess:e=>Array.isArray(e)?e:[e]}:{},...a,valueSchema:i.create(o)}):i.create({...o,...a})}var Ki=(e,t,n)=>{if(!e||null!=t){if(t.findLast)return t.findLast(n);for(let e=t.length-1;e>=0;e--){let r=t[e];if(n(r,e,t))return r}}};function Yi(e,t){if(!t)throw new Error("parserName is required.");let n=Ki(!1,e,e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t));if(n)return n;let r=`Couldn't resolve parser "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}function qi({plugins:e,parser:t}){return Qi(Yi(e,t),t)}function Qi(e,t){let n=e.parsers[t];return"function"==typeof n?n():n}var Zi={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null},Ji=async function(e,t={}){var n;let r={...e};if(!r.parser){if(!r.filepath)throw new Kr("No parser and no file path given, couldn't infer a parser.");if(r.parser=ai(r,{physicalFile:r.filepath}),!r.parser)throw new Kr(`No parser could be inferred for file "${r.filepath}".`)}let i=qr({plugins:e.plugins,showDeprecated:!0}).options,s={...Zi,...Object.fromEntries(i.filter(e=>void 0!==e.default).map(e=>[e.name,e.default]))},o=Yi(r.plugins,r.parser),a=await Qi(o,r.parser);r.astFormat=a.astFormat,r.locEnd=a.locEnd,r.locStart=a.locStart;let l=null!=(n=o.printers)&&n[a.astFormat]?o:function(e,t){if(!t)throw new Error("astFormat is required.");let n=Ki(!1,e,e=>e.printers&&Object.prototype.hasOwnProperty.call(e.printers,t));if(n)return n;let r=`Couldn't find plugin for AST format "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}(r.plugins,a.astFormat),u=await function(e,t){let n=e.printers[t];return"function"==typeof n?n():n}(l,a.astFormat);r.printer=u;let c={...s,...l.defaultOptions?Object.fromEntries(Object.entries(l.defaultOptions).filter(([,e])=>void 0!==e)):{}};for(let[e,t]of Object.entries(c))(null===r[e]||void 0===r[e])&&(r[e]=t);return"json"===r.parser&&(r.trailingComma="none"),function(e,t,{logger:n=!1,isCLI:r=!1,passThrough:i=!1,FlagSchema:s,descriptor:o}={}){if(r){if(!s)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=li;let a=i?Array.isArray(i)?(e,t)=>i.includes(e)?{[e]:t}:void 0:(e,t)=>({[e]:t}):(e,t,n)=>{let{_:r,...i}=n.schemas;return Ci(e,t,{...n,schemas:i})},l=function(e,{isCLI:t,FlagSchema:n}){let r=[];t&&r.push(yi.create({name:"_"}));for(let i of e)r.push(Xi(i,{isCLI:t,optionInfos:e,FlagSchema:n})),i.alias&&t&&r.push(_i.create({name:i.alias,sourceName:i.name}));return r}(t,{isCLI:r,FlagSchema:s}),u=new zi(l,{logger:n,unknown:a,descriptor:o}),c=!1!==n;c&&Pi&&(u._hasDeprecationWarned=Pi);let h=u.normalize(e);return c&&(Pi=u._hasDeprecationWarned),h}(r,i,{passThrough:Object.keys(Zi),...t})},es=((e,t,n)=>(n=null!=e?$t(Ht(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of Wt(t))!jt.call(e,n)&&void 0!==n&&Gt(e,n,{get:()=>t[n],enumerable:!(r=Vt(t,n))||r.enumerable});return e})(Gt(n,"default",{value:e,enumerable:!0}),e)))(Yt()),ts=async function(e,t){let n,r=await qi(t),i=r.preprocess?r.preprocess(e,t):e;t.originalText=i;try{n=await r.parse(i,t,t)}catch(t){!function(e,t){let{loc:n}=e;if(n){let r=(0,es.codeFrameColumns)(t,n,{highlightCode:!0});throw e.message+="\n"+r,e.codeFrame=r,e}throw e}(t,e)}return{text:i,ast:n}};async function ns(e,t){({ast:e}=await is(e,t));let n=new Map,r=new vr(e),i=()=>{},s=new Map;await async function(e,t,n,r,i){let{embeddedLanguageFormatting:s,printer:{embed:o,hasPrettierIgnore:a=()=>!1,getVisitorKeys:l}}=n;if(!o||"auto"!==s)return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let u=Nr(o.getVisitorKeys??l),c=[];!function t(){let{node:r}=e;if(null===r||"object"!=typeof r||a(e))return;for(let n of u(r))Array.isArray(r[n])?e.each(t,n):e.call(t,n);let s=o(e,n);if(s){if("function"==typeof s)return void c.push({print:s,node:r,pathStack:[...e.stack]});i.set(r,s)}}();let h=e.stack;for(let{print:r,node:s,pathStack:o}of c)try{e.stack=o;let a=await r(d,t,e,n);a&&i.set(s,a)}catch(e){if(globalThis.PRETTIER_DEBUG)throw e}function d(e,t){return async function(e,t,n,r){let i=await Ji({...n,...t,parentParser:n.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:s}=await ts(e,i);return Nn(await r(s,i))}(e,t,n,r)}e.stack=h}(r,a,t,ns,s);let o=await rs(r,t,a,void 0,s);if(function(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:n}=e;for(let e of t){if(!e.printed&&!n.has(e))throw new Error('Comment "'+e.value.trim()+'" was not printed. Please report this error!');delete e.printed}}(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return[Qn,o];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[o,Qn]}return o;function a(e,t){return void 0===e||e===r?l(t):Array.isArray(e)?r.call(()=>l(t),...e):r.call(()=>l(t),e)}function l(e){i(r);let o=r.node;if(null==o)return"";let l=o&&"object"==typeof o&&void 0===e;if(l&&n.has(o))return n.get(o);let u=rs(r,t,a,e,s);return l&&n.set(o,u),u}}function rs(e,t,n,r,i){var s;let o,{node:a}=e,{printer:l}=t;switch(o=null!=(s=l.hasPrettierIgnore)&&s.call(l,e)?function(e,t){let{originalText:n,[Symbol.for("comments")]:r,locStart:i,locEnd:s,[Symbol.for("printedComments")]:o}=t,{node:a}=e,l=i(a),u=s(a);for(let e of r)i(e)>=l&&s(e)<=u&&o.add(e);return n.slice(l,u)}(e,t):i.has(a)?i.get(a):l.print(e,t,n,r),a){case t.cursorNode:o=On(o,e=>[Qn,e,Qn]);break;case t.nodeBeforeCursor:o=On(o,e=>[e,Qn]);break;case t.nodeAfterCursor:o=On(o,e=>[Qn,e])}return l.printComment&&(!l.willPrintOwnComments||!l.willPrintOwnComments(e,t))&&(o=function(e,t,n){let{leading:r,trailing:i}=function(e,t){let n=e.node;if(!n)return{};let r=t[Symbol.for("printedComments")];if(0===(n.comments||[]).filter(e=>!r.has(e)).length)return{leading:"",trailing:""};let i,s=[],o=[];return e.each(()=>{let n=e.node;if(null!=r&&r.has(n))return;let{leading:a,trailing:l}=n;a?s.push(function(e,t){var n;let r=e.node,i=[zr(e,t)],{printer:s,originalText:o,locStart:a,locEnd:l}=t;if(null==(n=s.isBlockComment)?void 0:n.call(s,r)){let e=xr(o,l(r))?xr(o,a(r),{backwards:!0})?Yn:Xn:" ";i.push(e)}else i.push(Yn);let u=Rr(o,yr(o,l(r)));return!1!==u&&xr(o,u)&&i.push(Yn),i}(e,t)):l&&(i=function(e,t,n){var r;let i=e.node,s=zr(e,t),{printer:o,originalText:a,locStart:l}=t,u=null==(r=o.isBlockComment)?void 0:r.call(o,i);if(null!=n&&n.hasLineSuffix&&(null==n||!n.isBlock)||xr(a,l(i),{backwards:!0})){let e=jr(a,l(i));return{doc:Gn([Yn,e?Yn:"",s]),isBlock:u,hasLineSuffix:!0}}return!u||null!=n&&n.hasLineSuffix?{doc:[Gn([" ",s]),Wn],isBlock:u,hasLineSuffix:!0}:{doc:[" ",s],isBlock:u,hasLineSuffix:!1}}(e,t,i),o.push(i.doc))},"comments"),{leading:s,trailing:o}}(e,n);return r||i?On(t,e=>[r,e,i]):t}(e,o,t)),o}async function is(e,t){let n=e.comments??[];t[Symbol.for("comments")]=n,t[Symbol.for("printedComments")]=new Set,function(e,t){let{comments:n}=e;if(delete e.comments,!function(e){return Array.isArray(e)&&e.length>0}(n)||!t.printer.canAttachComment)return;let r=[],{printer:{experimentalFeatures:{avoidAstMutation:i=!1}={},handleComments:s={}},originalText:o}=t,{ownLine:a=Ur,endOfLine:l=Ur,remaining:u=Ur}=s,c=n.map((r,i)=>({...Br(e,r,t),comment:r,text:o,options:t,ast:e,isLastComment:n.length-1===i}));for(let[e,t]of c.entries()){let n,{comment:s,precedingNode:o,enclosingNode:h,followingNode:d,text:f,options:p,ast:m,isLastComment:g}=t;if(i?n=[t]:(s.enclosingNode=h,s.precedingNode=o,s.followingNode=d,n=[s,f,p,m,g]),Gr(f,p,c,e))s.placement="ownLine",a(...n)||(d?Or(d,s):o?kr(o,s):Ir(h||m,s));else if(Vr(f,p,c,e))s.placement="endOfLine",l(...n)||(o?kr(o,s):d?Or(d,s):Ir(h||m,s));else if(s.placement="remaining",!u(...n))if(o&&d){let e=r.length;e>0&&r[e-1].followingNode!==d&&Wr(r,p),r.push(t)}else o?kr(o,s):d?Or(d,s):Ir(h||m,s)}if(Wr(r,t),!i)for(let e of n)delete e.precedingNode,delete e.enclosingNode,delete e.followingNode}(e,t);let{printer:{preprocess:r}}=t;return{ast:e=r?await r(e,t):e,comments:n}}var ss=function(e,t){let{cursorOffset:n,locStart:r,locEnd:i}=t,s=Nr(t.printer.getVisitorKeys),o=e=>r(e)<=n&&i(e)>=n,a=e,l=[e];for(let t of function*(e,t){let n=[e];for(let e=0;e0&&(void 0===u||void 0===c);){a=l.pop();let e=void 0!==u,t=void 0!==c;for(let o of Sr(a,{getVisitorKeys:s})){if(!e){let e=i(o);e<=n&&e>h&&(u=o,h=e)}if(!t){let e=r(o);e>=n&&e{if(!e||null!=t){if(t.findLastIndex)return t.findLastIndex(n);for(let e=t.length-1;e>=0;e--)if(n(t[e],e,t))return e;return-1}})(!1,e,e=>"Program"!==e.type&&"File"!==e.type);return-1===t?e:e.slice(0,t+1)}function as(e,t,n,r,i=[],s){let{locStart:o,locEnd:a}=n,l=o(e),u=a(e);if(!(t>u||t=0&&(t={...t,...ss(r,t)});let s=await ns(r,t);n>0&&(s=Jn([Yn,s],n,t.tabWidth));let o=fr(s,t);if(n>0){let e=o.formatted.trim();void 0!==o.cursorNodeStart&&(o.cursorNodeStart-=o.formatted.indexOf(e),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>e.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=e+Jt(t.endOfLine)}let a=t[Symbol.for("comments")];if(t.cursorOffset>=0){let e,n,r,s;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&o.cursorNodeText)if(r=o.cursorNodeStart,s=o.cursorNodeText,t.cursorNode)e=t.locStart(t.cursorNode),n=i.slice(e,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");e=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let r=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):i.length;n=i.slice(e,r)}else e=0,n=i,r=0,s=o.formatted;let l=t.cursorOffset-e;if(n===s)return{formatted:o.formatted,cursorOffset:r+l,comments:a};let u=n.split("");u.splice(l,0,hs);let c=function(e,t){return Zt.diff(e,t,void 0)}(u,s.split("")),h=r;for(let e of c)if(e.removed){if(e.value.includes(hs))break}else h+=e.count;return{formatted:o.formatted,cursorOffset:h,comments:a}}return{formatted:o.formatted,cursorOffset:-1,comments:a}}function fs(e,t,n){return"number"!=typeof t||Number.isNaN(t)||t<0||t>e.length?n:t}function ps(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i}=t;return n=fs(e,n,-1),r=fs(e,r,0),i=fs(e,i,e.length),{...t,cursorOffset:n,rangeStart:r,rangeEnd:i}}function ms(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s}=ps(e,t),o="\ufeff"===e.charAt(0);if(o&&(e=e.slice(1),n--,r--,i--),"auto"===s&&(s=function(e){let t=e.indexOf("\r");return-1!==t?"\n"===e.charAt(t+1)?"crlf":"cr":"lf"}(e)),e.includes("\r")){let t=t=>en(e.slice(0,Math.max(t,0)),"\r\n");n-=t(n),r-=t(r),i-=t(i),e=function(e){return qt(!1,e,/\r\n?/gu,"\n")}(e)}return{hasBOM:o,text:e,options:ps(e,{...t,cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s})}}async function gs(e,t){let n=await qi(t);return!n.hasPragma||n.hasPragma(e)}async function Es(e,t){let n,{hasBOM:r,text:i,options:s}=ms(e,await Ji(t));return s.rangeStart>=s.rangeEnd&&""!==i||s.requirePragma&&!await gs(i,s)||s.checkIgnorePragma&&await async function(e,t){var n;let r=await qi(t);return null==(n=r.hasIgnorePragma)?void 0:n.call(r,e)}(i,s)?{formatted:e,cursorOffset:t.cursorOffset,comments:[]}:(s.rangeStart>0||s.rangeEndr);let a=e.slice(r,i).search(/\S/u),l=-1===a;if(!l)for(r+=a;i>r&&!/\S/u.test(e[i-1]);--i);let u,c,h=as(n,r,t,(e,n)=>cs(t,e,n),[],"rangeStart"),d=l?h:as(n,i,t,e=>cs(t,e),[],"rangeEnd");if(!h||!d)return{rangeStart:0,rangeEnd:0};if((({parser:e})=>"json"===e||"json5"===e||"jsonc"===e||"json-stringify"===e)(t)){let e=function(e,t){let n=[e.node,...e.parentNodes],r=new Set([t.node,...t.parentNodes]);return n.find(e=>ls.has(e.type)&&r.has(e))}(h,d);u=e,c=e}else({startNode:u,endNode:c}=function(e,t,{locStart:n,locEnd:r}){let i=e.node,s=t.node;if(i===s)return{startNode:i,endNode:s};let o=n(e.node);for(let e of os(t.parentNodes)){if(!(n(e)>=o))break;s=e}let a=r(t.node);for(let t of os(e.parentNodes)){if(!(r(t)<=a))break;if(i=t,i===s)break}return{startNode:i,endNode:s}}(h,d,t));return{rangeStart:Math.min(s(u),s(c)),rangeEnd:Math.max(o(u),o(c))}}(r,t,n),o=r.slice(i,s),a=Math.min(i,r.lastIndexOf("\n",i)+1),l=r.slice(a,i).match(/^\s*/u)[0],u=Er(l,t.tabWidth),c=await ds(o,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>i&&t.cursorOffset<=s?t.cursorOffset-i:-1,endOfLine:"lf"},u),h=c.formatted.trimEnd(),{cursorOffset:d}=t;d>s?d+=h.length-o.length:c.cursorOffset>=0&&(d=c.cursorOffset+i);let f=r.slice(0,i)+h+r.slice(s);if("lf"!==t.endOfLine){let e=Jt(t.endOfLine);d>=0&&"\r\n"===e&&(d+=en(f.slice(0,d),"\n")),f=qt(!1,f,"\n",e)}return{formatted:f,cursorOffset:d,comments:c.comments}}(i,s):(!s.requirePragma&&s.insertPragma&&s.printer.insertPragma&&!await gs(i,s)&&(i=s.printer.insertPragma(i)),n=await ds(i,s)),r&&(n.formatted="\ufeff"+n.formatted,n.cursorOffset>=0&&n.cursorOffset++),n)}var vs={};Xt(vs,{builders:()=>Cs,printer:()=>Ds,utils:()=>Ss});var Cs={join:Zn,line:Xn,softline:Kn,hardline:Yn,literalline:qn,group:$n,conditionalGroup:function(e,t){return $n(e[0],{...t,expandedStates:e})},fill:function(e){return Pn(e),{type:un,parts:e}},lineSuffix:Gn,lineSuffixBoundary:Vn,cursor:Qn,breakParent:Wn,ifBreak:function(e,t="",n={}){return kn(e),""!==t&&kn(t),{type:cn,breakContents:e,flatContents:t,groupId:n.groupId}},trim:Hn,indent:Bn,indentIfBreak:function(e,t){return kn(e),{type:hn,contents:e,groupId:t.groupId,negate:t.negate}},align:Un,addAlignmentToDoc:Jn,markAsRoot:function(e){return Un({type:"root"},e)},dedentToRoot:function(e){return Un(Number.NEGATIVE_INFINITY,e)},dedent:function(e){return Un(-1,e)},hardlineWithoutBreakParent:jn,literallineWithoutBreakParent:zn,label:function(e,t){return kn(t),e?{type:mn,label:e,contents:t}:t},concat:e=>e},Ds={printDocToString:fr},Ss={willBreak:function(e){return bn(e,Tn,!1)},traverseDoc:_n,findInDoc:bn,mapDoc:yn,removeLines:function(e){return yn(e,xn)},stripTrailingHardline:Nn,replaceEndOfLine:function(e,t=qn){return yn(e,e=>"string"==typeof e?Zn(t,e.split("\n")):e)},canBreak:function(e){return bn(e,Ln,!1)}},As="3.6.2",_s={};Xt(_s,{addDanglingComment:()=>Ir,addLeadingComment:()=>Or,addTrailingComment:()=>kr,getAlignmentSize:()=>Er,getIndentSize:()=>xs,getMaxContinuousCount:()=>ws,getNextNonSpaceNonCommentCharacter:()=>Fs,getNextNonSpaceNonCommentCharacterIndex:()=>Ms,getPreferredQuote:()=>Ls,getStringWidth:()=>rr,hasNewline:()=>xr,hasNewlineInRange:()=>Os,hasSpaces:()=>Is,isNextLineEmpty:()=>Bs,isNextLineEmptyAfterIndex:()=>Rs,isPreviousLineEmpty:()=>Ps,makeString:()=>ks,skip:()=>Ar,skipEverythingButNewLine:()=>Tr,skipInlineComment:()=>ys,skipNewline:()=>Rr,skipSpaces:()=>yr,skipToLineEnd:()=>br,skipTrailingComment:()=>bs,skipWhitespace:()=>_r});var ys=function(e,t){if(!1===t)return!1;if("/"===e.charAt(t)&&"*"===e.charAt(t+1))for(let n=t+2;nMath.max(e,n.length/t.length),0)},Fs=function(e,t){let n=Ts(e,t);return!1===n?"":e.charAt(n)},Ns="'",Ls=function(e,t){let n=!0===t||t===Ns?Ns:'"',r=n===Ns?'"':Ns,i=0,s=0;for(let t of e)t===n?i++:t===r&&s++;return i>s?r:n},Os=function(e,t,n){for(let r=t;ri===r?i:s===t?"\\"+s:s||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(i)?i:"\\"+i));return t+i+t};function Ms(e,t){return 2===arguments.length||"number"==typeof t?Ts(e,t):function(e,t,n){return Ts(e,n(t))}(...arguments)}function Ps(e,t){return 2===arguments.length||"number"==typeof t?jr(e,t):function(e,t,n){return jr(e,n(t))}(...arguments)}function Bs(e,t){return 2===arguments.length||"number"==typeof t?Rs(e,t):function(e,t,n){return Rs(e,n(t))}(...arguments)}function Us(e,t=1){return async(...n)=>{let r=n[t]??{},i=r.plugins??[];return n[t]={...r,plugins:Array.isArray(i)?i:Object.values(i)},e(...n)}}var $s=Us(Es);async function Gs(e,t){let{formatted:n}=await $s(e,{...t,cursorOffset:-1});return n}async function Vs(e,t){return await Gs(e,t)===e}var Ws=Us(qr,0),Hs={parse:Us(async function(e,t,n){let{text:r,options:i}=ms(e,await Ji(t)),s=await ts(r,i);return n&&(n.preprocessForPrint&&(s.ast=await is(s.ast,i)),n.massage&&(s.ast=function(e,t){let{printer:{massageAstNode:n,getVisitorKeys:r}}=t;if(!n)return e;let i=Nr(r),s=n.ignoredProperties??new Set;return function e(t,r){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>e(t,r)).filter(Boolean);let o={},a=new Set(i(t));for(let n in t)!Object.prototype.hasOwnProperty.call(t,n)||s.has(n)||(a.has(n)?o[n]=e(t[n],t):o[n]=t[n]);let l=n(t,o,r);return null!==l?l??o:void 0}(e)}(s.ast,i))),s}),formatAST:Us(async function(e,t){return t=await Ji(t),fr(await ns(e,t),t)}),formatDoc:Us(async function(e,t){let n=function(e){let t=Object.create(null),n=new Set;return function e(t,n,i){var s,o;if("string"==typeof t)return JSON.stringify(t);if(Array.isArray(t)){let n=t.map(e).filter(Boolean);return 1===n.length?n[0]:`[${n.join(", ")}]`}if(t.type===pn){let e=(null==(s=null==i?void 0:i[n+1])?void 0:s.type)===gn;return t.literal?e?"literalline":"literallineWithoutBreakParent":t.hard?e?"hardline":"hardlineWithoutBreakParent":t.soft?"softline":"line"}if(t.type===gn)return(null==(o=null==i?void 0:i[n-1])?void 0:o.type)===pn&&i[n-1].hard?void 0:"breakParent";if(t.type===an)return"trim";if(t.type===sn)return"indent("+e(t.contents)+")";if(t.type===on)return t.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+e(t.contents)+")":t.n<0?"dedent("+e(t.contents)+")":"root"===t.n.type?"markAsRoot("+e(t.contents)+")":"align("+JSON.stringify(t.n)+", "+e(t.contents)+")";if(t.type===cn)return"ifBreak("+e(t.breakContents)+(t.flatContents?", "+e(t.flatContents):"")+(t.groupId?(t.flatContents?"":', ""')+`, { groupId: ${r(t.groupId)} }`:"")+")";if(t.type===hn){let n=[];t.negate&&n.push("negate: true"),t.groupId&&n.push(`groupId: ${r(t.groupId)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return`indentIfBreak(${e(t.contents)}${i})`}if(t.type===ln){let n=[];t.break&&"propagated"!==t.break&&n.push("shouldBreak: true"),t.id&&n.push(`id: ${r(t.id)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return t.expandedStates?`conditionalGroup([${t.expandedStates.map(t=>e(t)).join(",")}]${i})`:`group(${e(t.contents)}${i})`}if(t.type===un)return`fill([${t.parts.map(t=>e(t)).join(", ")}])`;if(t.type===dn)return"lineSuffix("+e(t.contents)+")";if(t.type===fn)return"lineSuffixBoundary";if(t.type===mn)return`label(${JSON.stringify(t.label)}, ${e(t.contents)})`;if(t.type===rn)return"cursor";throw new Error("Unknown doc type "+t.type)}(er(e));function r(e){if("symbol"!=typeof e)return JSON.stringify(String(e));if(e in t)return t[e];let r=e.description||"symbol";for(let i=0;;i++){let s=r+(i>0?` #${i}`:"");if(!n.has(s))return n.add(s),t[e]=`Symbol.for(${JSON.stringify(s)})`}}}(e),{formatted:r}=await Es(n,{...t,parser:"__js_expression"});return r}),printToDoc:Us(async function(e,t){t=await Ji(t);let{ast:n}=await ts(e,t);return t.cursorOffset>=0&&(t={...t,...ss(n,t)}),ns(n,t)}),printDocToString:Us(async function(e,t){return fr(e,await Ji(t))})},js=Object.defineProperty;((e,t)=>{for(var n in t)js(e,n,{get:t[n],enumerable:!0})})({},{builders:()=>Jo,printer:()=>ea,utils:()=>ta});var zs="string",Xs="array",Ks="cursor",Ys="indent",qs="align",Qs="trim",Zs="group",Js="fill",eo="if-break",to="indent-if-break",no="line-suffix",ro="line-suffix-boundary",io="line",so="label",oo="break-parent",ao=new Set([Ks,Ys,qs,Qs,Zs,Js,eo,to,no,ro,io,so,oo]),lo=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},uo=function(e){if("string"==typeof e)return zs;if(Array.isArray(e))return Xs;if(!e)return;const{type:t}=e;return ao.has(t)?t:void 0};var co=class extends Error{name="InvalidDocError";constructor(e){super(function(e){const t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(uo(e))throw new Error("doc is valid.");const n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;const r=(i=[...ao].map(e=>`'${e}'`),new Intl.ListFormat("en-US",{type:"disjunction"}).format(i));var i;return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},ho={},fo=function(e,t,n,r){const i=[e];for(;i.length>0;){const e=i.pop();if(e===ho){n(i.pop());continue}n&&i.push(e,ho);const s=uo(e);if(!s)throw new co(e);if(!1!==(null==t?void 0:t(e)))switch(s){case Xs:case Js:{const t=s===Xs?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case eo:i.push(e.flatContents,e.breakContents);break;case Zs:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case qs:case Ys:case to:case so:case no:i.push(e.contents);break;case zs:case Ks:case Qs:case ro:case io:case oo:break;default:throw new co(e)}}};function po(e,t){if("string"==typeof e)return t(e);const n=new Map;return function e(r){if(n.has(r))return n.get(r);const i=function(n){switch(uo(n)){case Xs:return t(n.map(e));case Js:return t({...n,parts:n.parts.map(e)});case eo:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case Zs:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case qs:case Ys:case to:case so:case no:return t({...n,contents:e(n.contents)});case zs:case Ks:case Qs:case ro:case io:case oo:return t(n);default:throw new co(n)}}(r);return n.set(r,i),i}(e)}function mo(e,t,n){let r=n,i=!1;return fo(e,function(e){if(i)return!1;const n=t(e);void 0!==n&&(i=!0,r=n)}),r}function go(e){return!(e.type!==Zs||!e.break)||!(e.type!==io||!e.hard)||e.type===oo||void 0}function Eo(e){if(e.length>0){const t=lo(!1,e,-1);t.expandedStates||t.break||(t.break="propagated")}return null}function vo(e){return e.type!==io||e.hard?e.type===eo?e.flatContents:e:e.soft?"":" "}function Co(e){for(e=[...e];e.length>=2&&lo(!1,e,-2).type===io&&lo(!1,e,-1).type===oo;)e.length-=2;if(e.length>0){const t=Do(lo(!1,e,-1));e[e.length-1]=t}return e}function Do(e){switch(uo(e)){case Ys:case to:case Zs:case no:case so:{const t=Do(e.contents);return{...e,contents:t}}case eo:return{...e,breakContents:Do(e.breakContents),flatContents:Do(e.flatContents)};case Js:return{...e,parts:Co(e.parts)};case Xs:return Co(e);case zs:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return t{},_o=Ao,yo=Ao,bo=Ao;function To(e){return _o(e),{type:Ys,contents:e}}function Ro(e,t){return _o(t),{type:qs,contents:t,n:e}}function xo(e,t={}){return _o(e),yo(t.expandedStates,!0),{type:Zs,id:t.id,contents:e,break:Boolean(t.shouldBreak),expandedStates:t.expandedStates}}var wo={type:ro},Fo={type:oo},No={type:Qs},Lo={type:io,hard:!0},Oo={type:io,hard:!0,literal:!0},Io={type:io},ko={type:io,soft:!0},Mo=[Lo,Fo],Po=[Oo,Fo],Bo={type:Ks};function Uo(e,t){_o(e),yo(t);const n=[];for(let r=0;r{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Go=e=>{return!(12288===(t=e)||t>=65281&&t<=65376||t>=65504&&t<=65510||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e));var t},Vo=/[^\x20-\x7F]/u,Wo=function(e){if(!e)return 0;if(!Vo.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(const n of e){const e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=Go(e)?1:2)}return t},Ho=Symbol("MODE_BREAK"),jo=Symbol("MODE_FLAT"),zo=Symbol("cursor"),Xo=Symbol("DOC_FILL_PRINTED_LENGTH");function Ko(e,t){return qo(e,{type:"indent"},t)}function Yo(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?qo(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:qo(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function qo(e,t,n){const r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t];let i="",s=0,o=0,a=0;for(const e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function Qo(e){let t=0,n=0,r=e.length;e:for(;r--;){const i=e[r];if(i!==zo)for(let n=i.length-1;n>=0;n--){const s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(zo);return t}function Zo(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length;const a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}const{mode:e,doc:u}=a.pop(),c=uo(u);switch(c){case zs:l.push(u),n-=Wo(u);break;case Xs:case Js:{const t=c===Xs?u:u.parts,n=u[Xo]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case Ys:case qs:case to:case so:a.push({mode:e,doc:u.contents});break;case Qs:n+=Qo(l);break;case Zs:{if(s&&u.break)return!1;const t=u.break?Ho:e,n=u.expandedStates&&t===Ho?lo(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case eo:{const t=(u.groupId?i[u.groupId]||jo:e)===Ho?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case io:if(e===Ho||u.hard)return!0;u.soft||(l.push(" "),n--);break;case no:r=!0;break;case ro:if(r)return!1}}return!1}var Jo={join:Uo,line:Io,softline:ko,hardline:Mo,literalline:Po,group:xo,conditionalGroup:function(e,t){return xo(e[0],{...t,expandedStates:e})},fill:function(e){return bo(e),{type:Js,parts:e}},lineSuffix:function(e){return _o(e),{type:no,contents:e}},lineSuffixBoundary:wo,cursor:Bo,breakParent:Fo,ifBreak:function(e,t="",n={}){return _o(e),""!==t&&_o(t),{type:eo,breakContents:e,flatContents:t,groupId:n.groupId}},trim:No,indent:To,indentIfBreak:function(e,t){return _o(e),{type:to,contents:e,groupId:t.groupId,negate:t.negate}},align:Ro,addAlignmentToDoc:function(e,t,n){_o(e);let r=e;if(t>0){for(let e=0;ee},ea={printDocToString:function(e,t){const n={},r=t.printWidth,i=function(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}(t.endOfLine);let s=0;const o=[{ind:{value:"",length:0,queue:[]},mode:Ho,doc:e}],a=[];let l=!1;const u=[];let c=0;for(function(e){const t=new Set,n=[];fo(e,function(e){if(e.type===oo&&Eo(n),e.type===Zs){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===Zs&&n.pop().break&&Eo(n)},!0)}(e);o.length>0;){const{ind:e,mode:h,doc:d}=o.pop();switch(uo(d)){case zs:{const e="\n"!==i?$o(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=Wo(e));break}case Xs:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case Ks:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(zo),c++;break;case Ys:o.push({ind:Ko(e,t),mode:h,doc:d.contents});break;case qs:o.push({ind:Yo(e,d.n,t),mode:h,doc:d.contents});break;case Qs:s-=Qo(a);break;case Zs:switch(h){case jo:if(!l){o.push({ind:e,mode:d.break?Ho:jo,doc:d.contents});break}case Ho:{l=!1;const t={ind:e,mode:jo,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&Zo(t,o,i,a,n))o.push(t);else if(d.expandedStates){const t=lo(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:Ho,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:Ho,doc:t});break}{const t=d.expandedStates[r],s={ind:e,mode:jo,doc:t};if(Zo(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:Ho,doc:d.contents});break}}d.id&&(n[d.id]=lo(!1,o,-1).mode);break;case Js:{const t=r-s,i=d[Xo]??0,{parts:a}=d,l=a.length-i;if(0===l)break;const c=a[i+0],f=a[i+1],p={ind:e,mode:jo,doc:c},m={ind:e,mode:Ho,doc:c},g=Zo(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}const E={ind:e,mode:jo,doc:f},v={ind:e,mode:Ho,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}const C=a[i+2],D={ind:e,mode:h,doc:{...d,[Xo]:i+2}};Zo({ind:e,mode:jo,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case eo:case to:{const t=d.groupId?n[d.groupId]:h;if(t===Ho){const t=d.type===eo?d.breakContents:d.negate?d.contents:To(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===jo){const t=d.type===eo?d.flatContents:d.negate?To(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case no:u.push({ind:e,mode:h,doc:d.contents});break;case ro:u.length>0&&o.push({ind:e,mode:h,doc:Lo});break;case io:switch(h){case jo:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case Ho:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=Qo(a),a.push(i+e.value),s=e.length)}break;case so:o.push({ind:e,mode:h,doc:d.contents});break;case oo:break;default:throw new co(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}const h=a.indexOf(zo);if(-1!==h){const e=a.indexOf(zo,h+1);if(-1===e)return{formatted:a.filter(e=>e!==zo).join("")};const t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}},ta={willBreak:function(e){return mo(e,go,!1)},traverseDoc:fo,findInDoc:mo,mapDoc:po,removeLines:function(e){return po(e,vo)},stripTrailingHardline:function(e){return Do(function(e){return po(e,e=>function(e){switch(uo(e)){case Js:if(e.parts.every(e=>""===e))return"";break;case Zs:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===Zs&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case qs:case Ys:case to:case no:if(!e.contents)return"";break;case eo:if(!e.flatContents&&!e.breakContents)return"";break;case Xs:{const t=[];for(const n of e){if(!n)continue;const[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof lo(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case zs:case Ks:case Qs:case ro:case io:case so:case oo:break;default:throw new co(e)}return e}(e))}(e))},replaceEndOfLine:function(e,t=Po){return po(e,e=>"string"==typeof e?Uo(t,e.split("\n")):e)},canBreak:function(e){return mo(e,So,!1)}};function na(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}class ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class ia extends ra{constructor(e){super([]),this.idx=1,Object.assign(this,ma(e))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class sa extends ra{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ma(e))}}class oa extends ra{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ma(e))}}class aa extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class la extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ua extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ca extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ha extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class da extends ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ma(e))}}class fa{constructor(e){this.idx=1,Object.assign(this,ma(e))}accept(e){e.visit(this)}}function pa(e){function t(e){return e.map(pa)}if(e instanceof ia){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return"string"==typeof e.label&&(t.label=e.label),t}if(e instanceof oa)return{type:"Alternative",definition:t(e.definition)};if(e instanceof aa)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof la)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof ua)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ha)return{type:"RepetitionWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ca)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof da)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof fa){const t={type:"Terminal",name:e.terminalType.name,label:(n=e.terminalType,"string"==typeof(r=n).LABEL&&""!==r.LABEL?n.LABEL:n.name),idx:e.idx};"string"==typeof e.label&&(t.terminalLabel=e.label);const i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=i instanceof RegExp?i.source:i),t}if(e instanceof sa)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match");var n,r}function ma(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}class ga{visit(e){const t=e;switch(t.constructor){case ia:return this.visitNonTerminal(t);case oa:return this.visitAlternative(t);case aa:return this.visitOption(t);case la:return this.visitRepetitionMandatory(t);case ua:return this.visitRepetitionMandatoryWithSeparator(t);case ha:return this.visitRepetitionWithSeparator(t);case ca:return this.visitRepetition(t);case da:return this.visitAlternation(t);case fa:return this.visitTerminal(t);case sa:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Ea(e,t=[]){return!!(e instanceof aa||e instanceof ca||e instanceof ha)||(e instanceof da?e.definition.some(e=>Ea(e,t)):!(e instanceof ia&&t.includes(e))&&e instanceof ra&&(e instanceof ia&&t.push(e),e.definition.every(e=>Ea(e,t))))}function va(e){if(e instanceof ia)return"SUBRULE";if(e instanceof aa)return"OPTION";if(e instanceof da)return"OR";if(e instanceof la)return"AT_LEAST_ONE";if(e instanceof ua)return"AT_LEAST_ONE_SEP";if(e instanceof ha)return"MANY_SEP";if(e instanceof ca)return"MANY";if(e instanceof fa)return"CONSUME";throw Error("non exhaustive match")}class Ca{walk(e,t=[]){e.definition.forEach((n,r)=>{const i=e.definition.slice(r+1);if(n instanceof ia)this.walkProdRef(n,i,t);else if(n instanceof fa)this.walkTerminal(n,i,t);else if(n instanceof oa)this.walkFlat(n,i,t);else if(n instanceof aa)this.walkOption(n,i,t);else if(n instanceof la)this.walkAtLeastOne(n,i,t);else if(n instanceof ua)this.walkAtLeastOneSep(n,i,t);else if(n instanceof ha)this.walkManySep(n,i,t);else if(n instanceof ca)this.walkMany(n,i,t);else{if(!(n instanceof da))throw Error("non exhaustive match");this.walkOr(n,i,t)}})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);e.definition.forEach(e=>{const t=new oa({definition:[e]});this.walk(t,r)})}}function Da(e,t,n){return[new aa({definition:[new fa({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Sa(e){if(e instanceof ia)return Sa(e.referencedRule);if(e instanceof fa)return[e.terminalType];if(function(e){return e instanceof oa||e instanceof aa||e instanceof ca||e instanceof la||e instanceof ua||e instanceof ha||e instanceof fa||e instanceof sa}(e))return function(e){let t=[];const n=e.definition;let r,i=0,s=n.length>i,o=!0;for(;s&&o;)r=n[i],o=Ea(r),t=t.concat(Sa(r)),i+=1,s=n.length>i;return[...new Set(t)]}(e);if(function(e){return e instanceof da}(e))return function(e){const t=e.definition.map(e=>Sa(e));return[...new Set(t.flat())]}(e);throw Error("non exhaustive match")}const Aa="_~IN~_";class _a extends Ca{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=(i=e.referencedRule,s=e.idx,i.name+s+Aa+this.topProd.name);var i,s;const o=t.concat(n),a=Sa(new oa({definition:o}));this.follows[r]=a}}function ya(e){return e.charCodeAt(0)}function ba(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function Ta(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t],e[t]=!0}function Ra(e){if(void 0===e)throw Error("Internal Error - Should never get here!");return!0}function xa(){throw Error("Internal Error - Should never get here!")}function wa(e){return"Character"===e.type}const Fa=[];for(let e=ya("0");e<=ya("9");e++)Fa.push(e);const Na=[ya("_")].concat(Fa);for(let e=ya("a");e<=ya("z");e++)Na.push(e);for(let e=ya("A");e<=ya("Z");e++)Na.push(e);const La=[ya(" "),ya("\f"),ya("\n"),ya("\r"),ya("\t"),ya("\v"),ya("\t"),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya("\u2028"),ya("\u2029"),ya(" "),ya(" "),ya(" "),ya("\ufeff")],Oa=/[0-9a-fA-F]/,Ia=/[0-9]/,ka=/[1-9]/;class Ma{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}function Pa(e){console&&console.error&&console.error(`Error: ${e}`)}function Ba(e){console&&console.warn&&console.warn(`Warning: ${e}`)}let Ua={};const $a=new class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Ta(n,"global");break;case"i":Ta(n,"ignoreCase");break;case"m":Ta(n,"multiLine");break;case"u":Ta(n,"unicode");break;case"y":Ta(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":let t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}}Ra(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return xa()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;Ra(t)}if(!0!==e||void 0!==t)return Ra(t)?("?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t):void 0}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),Ra(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):xa()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ya("\n"),ya("\r"),ya("\u2028"),ya("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=Fa;break;case"D":e=Fa,t=!0;break;case"s":e=La;break;case"S":e=La,t=!0;break;case"w":e=Na;break;case"W":e=Na,t=!0}return Ra(e)?{type:"Set",value:e,complement:t}:xa()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ya("\f");break;case"n":e=ya("\n");break;case"r":e=ya("\r");break;case"t":e=ya("\t");break;case"v":e=ya("\v")}return Ra(e)?{type:"Character",value:e}:xa()}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:ya("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:ya(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:ya(this.popChar())}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const t=this.classAtom();if(t.type,wa(t)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,wa(n)){if(n.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};function Ga(e){const t=e.toString();if(Ua.hasOwnProperty(t))return Ua[t];{const e=$a.pattern(t);return Ua[t]=e,e}}const Va="Complement Sets are not supported for first char optimization",Wa='Unable to use "first char" lexer optimizations:\n';function Ha(e,t=!1){try{const t=Ga(e);return ja(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===Va)t&&Ba(`${Wa}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),Pa(`${Wa}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function ja(e,t,n){switch(e.type){case"Disjunction":for(let r=0;r{if("number"==typeof e)za(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)za(e,t,n);else{for(let e=r.from;e<=r.to&&e=ul){const e=r.from>=ul?r.from:ul,n=r.to,i=hl(e),s=hl(n);for(let e=i;e<=s;e++)t[e]=e}}}});break;case"Group":ja(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}const o=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===Ka(s)||"Group"!==s.type&&!1===o)break}break;default:throw Error("non exhaustive match!")}return Object.values(t)}function za(e,t,n){const r=hl(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=hl(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=hl(e.charCodeAt(0));t[n]=n}}}(e,t)}function Xa(e,t){return e.value.find(e=>{if("number"==typeof e)return t.includes(e);{const n=e;return void 0!==t.find(e=>n.from<=e&&e<=n.to)}})}function Ka(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(Array.isArray(e.value)?e.value.every(Ka):Ka(e.value))}class Ya extends Ma{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e);case"Lookbehind":return void this.visitLookbehind(e);case"NegativeLookbehind":return void this.visitNegativeLookbehind(e)}super.visitChildren(e)}}visitCharacter(e){this.targetCharCodes.includes(e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===Xa(e,this.targetCharCodes)&&(this.found=!0):void 0!==Xa(e,this.targetCharCodes)&&(this.found=!0)}}function qa(e,t){if(t instanceof RegExp){const n=Ga(t),r=new Ya(e);return r.visit(n),r.found}for(const n of t){const t=n.charCodeAt(0);if(e.includes(t))return!0}return!1}const Qa="PATTERN",Za="defaultMode",Ja="modes";const el=/[^\\][$]/,tl=/[^\\[][\^]|^\^/;function nl(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function rl(e){const t=e.PATTERN;if(t instanceof RegExp)return!1;if("function"==typeof t)return!0;if(Object.hasOwn(t,"exec"))return!0;if("string"==typeof t)return!1;throw Error("non exhaustive match")}function il(e){return"string"==typeof e&&1===e.length&&e.charCodeAt(0)}const sl={test:function(e){const t=e.length;for(let n=this.lastIndex;n"string"==typeof e?e.charCodeAt(0):e)}function ll(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const ul=256;let cl=[];function hl(e){return ee.CATEGORIES).flat().filter(Boolean);const e=n.filter(e=>!t.includes(e));t=t.concat(e),0===e.length?r=!1:n=e}return t}(e);!function(e){e.forEach(e=>{var t;Cl(e)||(gl[ml]=e,e.tokenTypeIdx=ml++),Dl(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Dl(e)||(e.CATEGORIES=[]),t=e,Object.hasOwn(null!=t?t:{},"categoryMatches")||(e.categoryMatches=[]),function(e){return Object.hasOwn(null!=e?e:{},"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})})}(t),function(e){e.forEach(e=>{vl([],e)})}(t),function(e){e.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(t=>{e.categoryMatches.push(gl[t].tokenTypeIdx)})})}(t),t.forEach(e=>{e.isParent=e.categoryMatches.length>0})}function vl(e,t){e.forEach(e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),t.CATEGORIES.forEach(n=>{const r=e.concat(t);r.includes(n)||vl(r,n)})}function Cl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}function Dl(e){return Object.hasOwn(null!=e?e:{},"CATEGORIES")}function Sl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}var Al;!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"}(Al||(Al={}));const _l={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:{buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i,s)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`},traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(_l);class yl{constructor(e,t=_l){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=Object.assign({},_l,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===_l.lineTerminatorsPattern)this.config.lineTerminatorsPattern=sl;else if(this.config.lineTerminatorCharacters===_l.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Array.isArray(e)?n={modes:{defaultMode:[...e]},defaultMode:Za}:(r=!1,n=Object.assign({},e))}),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){const t=[];return Object.hasOwn(e,Za)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+Za+"> property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(e,Ja)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(e,Ja)&&Object.hasOwn(e,Za)&&!Object.hasOwn(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${Za}: <${e.defaultMode}>which does not exist\n`,type:Al.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(e,Ja)&&Object.keys(e.modes).forEach(n=>{const r=e.modes[n];r.forEach((e,i)=>{void 0===e?t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:Al.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(e,"LONGER_ALT")&&(Array.isArray(e.LONGER_ALT)?e.LONGER_ALT:[e.LONGER_ALT]).forEach(i=>{void 0===i||r.includes(i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${e.name}> outside of mode <${n}>\n`,type:Al.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(function(e,t,n){const r=[];let i=!1;const s=Object.values(e.modes||{}).flat().filter(Boolean).filter(e=>e[Qa]!==yl.NA),o=al(n);return t&&s.forEach(e=>{const t=ol(e,o);if(!1!==t){const n=function(e,t){if(t.issue===Al.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Al.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else Object.hasOwn(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):qa(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:Al.NO_LINE_BREAKS_FLAGS}),r}(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},Object.entries(n.modes).forEach(([e,t])=>{n.modes[e]=t.filter(e=>void 0!==e)});const i=Object.keys(n.modes);if(Object.entries(n.modes).forEach(([e,n])=>{this.TRACE_INIT(`Mode: <${e}> processing`,()=>{if(this.modes.push(e),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e,t){let n=[];const r=function(e){const t=e.filter(e=>!Object.hasOwn(e,Qa));return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:Al.MISSING_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(e);n=n.concat(r.errors);const i=function(e){const t=e.filter(e=>{const t=e[Qa];return!(t instanceof RegExp||"function"==typeof t||Object.hasOwn(t,"exec")||"string"==typeof t)});return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Al.INVALID_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=e.filter(e=>e[Qa]instanceof RegExp);return t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return el.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return tl.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){return e.filter(e=>{const t=e[Qa];return t instanceof RegExp&&(t.multiline||t.global)}).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Al.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){const t=[];let n=e.map(n=>e.reduce((e,r)=>(n.PATTERN.source!==r.PATTERN.source||t.includes(r)||r.PATTERN===yl.NA||(t.push(r),e.push(r)),e),[]));return n=n.filter(Boolean),n.filter(e=>e.length>1).map(e=>{const t=e.map(e=>e.name);return{message:`The same RegExp pattern ->${e[0].PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:Al.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}(n)),t=t.concat(function(e){return e.filter(e=>e.PATTERN.test("")).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:Al.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}(n)),t}(s)),n=n.concat(function(e){const t=e.filter(e=>{if(!Object.hasOwn(e,"GROUP"))return!1;const t=e.GROUP;return t!==yl.SKIPPED&&t!==yl.NA&&!("string"==typeof t)});return t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Al.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}(s)),n=n.concat(function(e,t){return e.filter(e=>void 0!==e.PUSH_MODE&&!t.includes(e.PUSH_MODE)).map(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:Al.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}(s,t)),n=n.concat(function(e){const t=[],n=e.reduce((e,t,n)=>{const r=t.PATTERN;return r===yl.NA||("string"==typeof r?e.push({str:r,idx:n,tokenType:t}):r instanceof RegExp&&(i=r,void 0===[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(e=>-1!==i.source.indexOf(e)))&&e.push({str:r.source,idx:n,tokenType:t})),e;var i},[]);return e.forEach((e,r)=>{n.forEach(({str:n,idx:i,tokenType:s})=>{if(r${s.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:Al.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}})}),t}(s)),n}(n,i))}),0===this.lexerDefinitionErrors.length){let r;El(n),this.TRACE_INIT("analyzeTokenTypes",()=>{r=function(e,t){const n=(t=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()},t)).tracer;let r;n("initCharCodeToOptimizedIndexMap",()=>{!function(){if(0===cl.length){cl=new Array(65536);for(let e=0;e<65536;e++)cl[e]=e>255?255+~~(e/255):e}}()}),n("Reject Lexer.NA",()=>{r=e.filter(e=>e[Qa]!==yl.NA)});let i,s,o,a,l,u,c,h,d,f,p,m=!1;n("Transform Patterns",()=>{m=!1,i=r.map(e=>{const t=e[Qa];if(t instanceof RegExp){const e=t.source;return 1!==e.length||"^"===e||"$"===e||"."===e||t.ignoreCase?2!==e.length||"\\"!==e[0]||["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(e[1])?nl(t):e[1]:e}if("function"==typeof t)return m=!0,{exec:t};if("object"==typeof t)return m=!0,t;if("string"==typeof t){if(1===t.length)return t;{const e=t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return nl(new RegExp(e))}}throw Error("non exhaustive match")})}),n("misc mapping",()=>{s=r.map(e=>e.tokenTypeIdx),o=r.map(e=>{const t=e.GROUP;if(t!==yl.SKIPPED){if("string"==typeof t)return t;if(void 0===t)return!1;throw Error("non exhaustive match")}}),a=r.map(e=>{const t=e.LONGER_ALT;if(t)return Array.isArray(t)?t.map(e=>r.indexOf(e)):[r.indexOf(t)]}),l=r.map(e=>e.PUSH_MODE),u=r.map(e=>Object.hasOwn(e,"POP_MODE"))}),n("Line Terminator Handling",()=>{const e=al(t.lineTerminatorCharacters);c=r.map(e=>!1),"onlyOffset"!==t.positionTracking&&(c=r.map(t=>Object.hasOwn(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===ol(t,e)&&qa(e,t.PATTERN)))}),n("Misc Mapping #2",()=>{h=r.map(rl),d=i.map(il),f=r.reduce((e,t)=>{const n=t.GROUP;return"string"==typeof n&&n!==yl.SKIPPED&&(e[n]=[]),e},{}),p=i.map((e,t)=>({pattern:i[t],longerAlt:a[t],canLineTerminator:c[t],isCustom:h[t],short:d[t],group:o[t],push:l[t],pop:u[t],tokenTypeIdx:s[t],tokenType:r[t]}))});let g=!0,E=[];return t.safeMode||n("First Char Optimization",()=>{E=r.reduce((e,n,r)=>{if("string"==typeof n.PATTERN){const t=hl(n.PATTERN.charCodeAt(0));ll(e,t,p[r])}else if(Array.isArray(n.START_CHARS_HINT)){let t;n.START_CHARS_HINT.forEach(n=>{const i=hl("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,ll(e,i,p[r]))})}else if(n.PATTERN instanceof RegExp)if(n.PATTERN.unicode)g=!1,t.ensureOptimizations&&Pa(`${Wa}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=Ha(n.PATTERN,t.ensureOptimizations);0===i.length&&(g=!1),i.forEach(t=>{ll(e,t,p[r])})}else t.ensureOptimizations&&Pa(`${Wa}\tTokenType: <${n.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return e},[])}),{emptyGroups:f,patternIdxToConfig:p,charCodeToPatternIdxToConfig:E,hasCustom:m,canBeOptimized:g}}(n,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[e]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[e]=r.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[e]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}this.lexerDefinitionWarning.forEach(e=>{Ba(e.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(r&&(this.handleModes=()=>{}),!1===this.trackStartLines&&(this.computeNewColumn=e=>e),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=()=>{}),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const e=Object.entries(this.canModeBeOptimized).reduce((e,[t,n])=>(!1===n&&e.push(t),e),[]);if(t.ensureOptimizations&&e.length>0)throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Ua={}}),this.TRACE_INIT("toFastProperties",()=>{na(this)})})}tokenize(e,t=this.defaultMode){if(this.lexerDefinitionErrors.length>0){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,s,o,a,l,u,c,h,d,f,p,m,g;const E=e,v=E.length;let C=0,D=0;const S=this.hasCustom?0:Math.floor(e.length/10),A=new Array(S),_=[];let y=this.trackStartLines?1:void 0,b=this.trackStartLines?1:void 0;const T=function(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(!Array.isArray(r))throw Error("non exhaustive match");t[n]=[]}),t}(this.emptyGroups),R=this.trackStartLines,x=this.config.lineTerminatorsPattern;let w=0,F=[],N=[];const L=[],O=[];Object.freeze(O);let I=!1;const k=e=>{if(1===L.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);_.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{L.pop();const e=L.at(-1);F=this.patternIdxToConfig[e],N=this.charCodeToPatternIdxToConfig[e],w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}};function M(e){L.push(e),N=this.charCodeToPatternIdxToConfig[e],F=this.patternIdxToConfig[e],w=F.length,w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}let P;M.call(this,t);const B=this.config.recoveryEnabled;for(;Ca.length){a=s,c=s.length,l=u,P=t;break}}}break}}if(-1!==c){if(h=P.group,void 0!==h&&(a=null!==a?a:e.substring(C,C+c),d=P.tokenTypeIdx,f=this.createTokenInstance(a,C,d,P.tokenType,y,b,c),this.handlePayload(f,l),!1===h?D=this.addToken(A,D,f):T[h].push(f)),!0===R&&!0===P.canLineTerminator){let t,n,r=0;x.lastIndex=0;do{a=null!==a?a:e.substring(C,C+c),t=x.test(a),!0===t&&(n=x.lastIndex-1,r++)}while(!0===t);0!==r?(y+=r,b=c-n,this.updateTokenEndLineColumnLocation(f,h,n,r,y,b,c)):b=this.computeNewColumn(b,c)}else b=this.computeNewColumn(b,c);C+=c,this.handleModes(P,k,M,f)}else{const t=C,n=y,i=b;let s=!1===B;for(;!1===s&&C`Expecting ${Tl(e)?`--\x3e ${bl(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o="\nbut found: '"+t[0].image+"'";return r?s+r+o:s+`one of these possible Token sequences:\n${e.reduce((e,t)=>e.concat(t),[]).map(e=>`[${e.map(e=>bl(e)).join(", ")}]`).map((e,t)=>` ${t+1}. ${e}`).join("\n")}`+o},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",s="\nbut found: '"+t[0].image+"'";return n?i+n+s:i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map(e=>`[${e.map(e=>bl(e)).join(",")}]`).join(" ,")}>`+s}};Object.freeze(Bl);const Ul={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},$l={buildDuplicateFoundError(e,t){const n=e.name,r=t[0],i=r.idx,s=va(r),o=(a=r)instanceof fa?a.terminalType.name:a instanceof ia?a.nonTerminalName:"";var a;let l=`->${s}${i>0?i:""}<- ${o?`with argument: ->${o}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,"\n"),l},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=e.prefixPath.map(e=>bl(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=0===e.alternation.idx?"":e.alternation.idx,n=0===e.prefixPath.length;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule,\n`;return r+=n?"These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n":`<${e.prefixPath.map(e=>bl(e)).join(", ")}> may appears as a prefix path in all these alternatives.\n`,r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=va(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${t} --\x3e ${e.leftRecursionPath.map(e=>e.name).concat([t]).join(" --\x3e ")}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof sa?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class Gl extends ga{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:rc.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Vl extends Ca{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){0===this.ruleStack.length?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Wl extends Vl{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const e=t.concat(n),r=new oa({definition:e});this.possibleTokTypes=Sa(r),this.found=!0}}}class Hl extends Ca{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class jl extends Hl{walkMany(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}}class zl extends Hl{walkManySep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}}class Xl extends Hl{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}}class Kl extends Hl{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}}function Yl(e,t,n=[]){n=[...n];let r=[],i=0;function s(s){const o=Yl(s.concat(e.slice(i+1)),t,n);return r.concat(o)}for(;n.length{0!==e.definition.length&&(r=s(e.definition))}),r;if(!(t instanceof fa))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:e.slice(i)}),r}function ql(e,t,n,r){const i=[...n];i.push(e.name);const s=[...r];return s.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:s}}var Ql;function Zl(e){if(e instanceof aa||"Option"===e)return Ql.OPTION;if(e instanceof ca||"Repetition"===e)return Ql.REPETITION;if(e instanceof la||"RepetitionMandatory"===e)return Ql.REPETITION_MANDATORY;if(e instanceof ua||"RepetitionMandatoryWithSeparator"===e)return Ql.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ha||"RepetitionWithSeparator"===e)return Ql.REPETITION_WITH_SEPARATOR;if(e instanceof da||"Alternation"===e)return Ql.ALTERNATION;throw Error("non exhaustive match")}function Jl(e,t,n,r){const i=e.length,s=e.every(e=>e.every(e=>1===e.length));if(t)return function(t){const r=t.map(e=>e.GATE);for(let t=0;te.flat()).reduce((e,t,n)=>(t.forEach(t=>{t.tokenTypeIdx in e||(e[t.tokenTypeIdx]=n),t.categoryMatches.forEach(t=>{Object.hasOwn(e,t)||(e[t]=n)})}),e),{});return function(){const e=this.LA_FAST(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t1===e.length),i=e.length;if(r&&!n){const t=e.flat();if(1===t.length&&0===t[0].categoryMatches.length){const e=t[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===e}}{const e=t.reduce((e,t,n)=>(e[t.tokenTypeIdx]=!0,t.categoryMatches.forEach(t=>{e[t]=!0}),e),[]);return function(){const t=this.LA_FAST(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;nYl([e],1)),r=ru(n.length),i=n.map(e=>{const t={};return e.forEach(e=>{iu(e.partialPath).forEach(e=>{t[e]=!0})}),t});let s=n;for(let e=1;e<=t;e++){const n=s;s=ru(n.length);for(let o=0;o{iu(e.partialPath).forEach(e=>{i[o][e]=!0})})}}}}return r}function au(e,t,n,r){const i=new nu(e,Ql.ALTERNATION,r);return t.accept(i),ou(i.result,n)}function lu(e,t,n,r){const i=new nu(e,n);t.accept(i);const s=i.result,o=new tu(t,e,n).startWalking();return ou([new oa({definition:s}),new oa({definition:o})],r)}function uu(e,t){e:for(let n=0;ne.every(e=>e.every(e=>0===e.categoryMatches.length)))}function hu(e){return`${va(e)}_#_${e.idx}_#_${du(e)}`}function du(e){return e instanceof fa?e.terminalType.name:e instanceof ia?e.nonTerminalName:""}class fu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function pu(e,t,n,r=[]){const i=[],s=mu(t.definition);if(0===s.length)return[];{const t=e.name;s.includes(e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:rc.LEFT_RECURSION,ruleName:t});const o=r.concat([e]),a=s.filter(e=>!o.includes(e)).flatMap(t=>{const i=[...r];return i.push(t),pu(e,t,n,i)});return i.concat(a)}}function mu(e){let t=[];if(0===e.length)return t;const n=e[0];if(n instanceof ia)t.push(n.referencedRule);else if(n instanceof oa||n instanceof aa||n instanceof la||n instanceof ua||n instanceof ha||n instanceof ca)t=t.concat(mu(n.definition));else if(n instanceof da)t=n.definition.map(e=>mu(e.definition)).flat();else if(!(n instanceof fa))throw Error("non exhaustive match");const r=Ea(n),i=e.length>1;if(r&&i){const n=e.slice(1);return t.concat(mu(n))}return t}class gu extends ga{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}class Eu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}const vu="MismatchedTokenException",Cu="NoViableAltException",Du="EarlyExitException",Su="NotAllInputParsedException",Au=[vu,Cu,Du,Su];function _u(e){return Au.includes(e.name)}Object.freeze(Au);class yu extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class bu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=vu}}class Tu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Cu}}class Ru extends yu{constructor(e,t){super(e,t),this.name=Su}}class xu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Du}}const wu={},Fu="InRuleRecoveryException";class Nu extends Error{constructor(e){super(e),this.name=Fu}}function Lu(e,t,n,r,i,s,o){const a=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[a];if(void 0===l){const e=this.getCurrRuleFullName();l=new s(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[a]=l}let u=l.token,c=l.occurrence;const h=l.isEndOfRule;0===this.RULE_STACK_IDX&&h&&void 0===u&&(u=Ml,c=1),void 0!==u&&void 0!==c&&this.shouldInRepetitionRecoveryBeTried(u,c,o)&&this.tryInRepetitionRecovery(e,t,n,u)}const Ou=1024,Iu=1280,ku=1536;function Mu(e,t,n){return n|t|e}class Pu{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:tc.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(0===t.length){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return e.flatMap(e=>pu(e,e,$l))}validateEmptyOrAlternatives(e){return e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.slice(0,-1).flatMap((r,i)=>0===function(e,t,n){const r="EXIT_NONE_TERMINAL",i=[r],s="EXIT_ALTERNATIVE";let o=!1;const a=t.length,l=a-1-1,u=[],c=[];for(c.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});0!==c.length;){const e=c.pop();if(e===s){o&&c.at(-1).idx<=l&&c.pop();continue}const h=e.def,d=e.idx,f=e.ruleStack,p=e.occurrenceStack;if(0===h.length)continue;const m=h[0];if(m===r){const e={idx:d,def:h.slice(1),ruleStack:f.slice(0,-1),occurrenceStack:p.slice(0,-1)};c.push(e)}else if(m instanceof fa)if(d=0;e--){const t={idx:d,def:m.definition[e].definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p};c.push(t),c.push(s)}else if(m instanceof oa)c.push({idx:d,def:m.definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p});else{if(!(m instanceof sa))throw Error("non exhaustive match");c.push(ql(m,d,f,p))}}return u}([r],[],fl).length?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:rc.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}(e,$l))}validateAmbiguousAlternationAlternatives(e,t){return e.flatMap(e=>function(e,t,n){const r=new gu;e.accept(r);let i=r.alternations;i=i.filter(e=>!0!==e.ignoreAmbiguities);return i.flatMap(r=>{const i=r.idx,s=r.maxLookahead||t,o=au(i,e,s,r),a=function(e,t,n,r){const i=[];return e.reduce((n,r,s)=>(!0===t.definition[s].ignoreAmbiguities||r.forEach(r=>{const o=[s];e.forEach((e,n)=>{s!==n&&uu(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&o.push(n)}),o.length>1&&!uu(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]).map(e=>{const i=e.alts.map(e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}(o,r,e,n),l=function(e,t,n,r){const i=e.reduce((e,t,n)=>{const r=t.map(e=>({idx:n,path:e}));return e.concat(r)},[]);return i.flatMap(e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const s=e.idx,o=e.path;return i.filter(e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx{const n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}));var n,r}).map(e=>{const i=[e.idx+1,s+1],o=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})})}(o,r,e,n);return a.concat(l)})}(e,t,$l))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return e.forEach(e=>{const i=new Eu;e.accept(i),i.allProductions.forEach(i=>{const s=Zl(i),o=i.maxLookahead||t;if(0===lu(i.idx,e,s,o)[0].flat().length){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:rc.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}(e,t,$l)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,s){const o=au(e,t,n);return s(o,r,cu(o)?pl:fl,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Jl)}buildLookaheadForOptional(e){return function(e,t,n,r,i,s){const o=lu(e,t,i,n),a=cu(o)?pl:fl;return s(o[0],a,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Zl(e.prodType),eu)}}const Bu=new class extends ga{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function Uu(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset"function"==typeof e.GATE);return s.hasPredicates=o,n.definition.push(s),i.forEach(e=>{const t=new oa({definition:[]});s.definition.push(t),Object.hasOwn(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Object.hasOwn(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),Hu}function Zu(e){return 0===e?"":`${e}`}function Ju(e){if(e<0||e>zu){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${zu+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const ec=Pl(Ml,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ec);const tc=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Bl,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),nc=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var rc,ic,sc;!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(rc||(rc={}));class oc{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",()=>{na(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=function(e){const t=Object.assign({errMsgProvider:Ul},e),n={};return e.rules.forEach(e=>{n[e.name]=e}),function(e,t){const n=new Gl(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(0===n.length&&!1===this.skipValidations){const e=function(e){var t;const n=null!==(t=e.errMsgProvider)&&void 0!==t?t:$l;return function(e,t,n,r){const i=e.flatMap(e=>function(e,t){const n=new fu;e.accept(n);const r=n.allProductions,i=Object.groupBy(r,hu),s=Object.fromEntries(Object.entries(i).filter(([e,t])=>t.length>1));return Object.values(s).map(n=>{const r=n[0],i=t.buildDuplicateFoundError(e,n),s=va(r),o={message:i,type:rc.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:s,occurrence:r.idx},a=du(r);return a&&(o.parameter=a),o})}(e,n)),s=function(e,t,n){const r=[],i=t.map(e=>e.name);return e.forEach(e=>{const t=e.name;if(i.includes(t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:rc.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}(e,t,n),o=e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:rc.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}(e,n)),a=e.flatMap(t=>function(e,t,n,r){const i=[],s=t.reduce((t,n)=>n.name===e.name?t+1:t,0);if(s>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:rc.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n));return i.concat(s,o,a)}(e.rules,e.tokenTypes,n,e.grammarName)}({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:$l,grammarName:t}),n=function(e){return e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}).map(e=>Object.assign({type:rc.CUSTOM_LOOKAHEAD_VALIDATION},e))}({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(e,n)}}),0===this.definitionErrors.length&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const e=function(e){const t={};return e.forEach(e=>{const n=new _a(e).startWalking();Object.assign(t,n)}),t}(Object.values(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!oc.DEFER_DEFINITION_ERRORS_HANDLING&&0!==this.definitionErrors.length)throw e=this.definitionErrors.map(e=>e.message),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initGastRecorder(t),n.initPerformanceTracer(t),Object.hasOwn(t,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=Object.hasOwn(t,"skipValidations")?t.skipValidations:tc.skipValidations}}oc.DEFER_DEFINITION_ERRORS_HANDLING=!1,ic=oc,sc=[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:tc.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Lu)}getTokenToInsert(e){const t=Pl(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let a=!1;const l=this.LA_FAST(1);let u=this.LA_FAST(1);const c=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),n=new bu(t,l,this.LA(0));n.resyncedTokens=o.slice(0,-1),this.SAVE_ERROR(n)};for(;!a;){if(this.tokenMatcher(u,r))return void c();if(n.call(this))return c(),void e.apply(this,t);this.tokenMatcher(u,i)?a=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o))}this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA_FAST(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getNextPossibleTokenTypes(e){const t=e.ruleStack[0],n=this.getGAstProductions()[t];return new Wl(n,e).startWalking()}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new Nu("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(0===t.length)return!1;const n=this.LA_FAST(1);return void 0!==t.find(e=>this.tokenMatcher(n,e))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(t).includes(e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA_FAST(1),n=2;for(;;){const r=e.find(e=>fl(t,e));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(0===this.RULE_STACK_IDX)return wu;const e=this.currRuleShortName,t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK,n=this.RULE_STACK_IDX+1,r=new Array(n);for(let i=0;ithis.getFollowSetFromFollowKey(e)).flat()}getFollowSetFromFollowKey(e){if(e===wu)return[Ml];const t=e.ruleName+e.idxInCallingRule+Aa+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Ml)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA_FAST(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return t.slice(0,-1)}attemptInRepetitionRecovery(e,t,n,r,i,s,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){const e=this.RULE_STACK_IDX+1,t=new Array(e);for(let n=0;n{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:o}=function(e){Bu.reset(),e.accept(Bu);const t=Bu.dslMethods;return Bu.reset(),t}(e);t.forEach(t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${va(t)}${n}`,()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=Mu(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),n.forEach(t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,va(t))}),r.forEach(t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,va(t))}),i.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Ou,"RepetitionMandatory",t.maxLookahead,va(t))}),s.forEach(t=>{this.computeLookaheadFunc(e,t.idx,ku,"RepetitionMandatoryWithSeparator",t.maxLookahead,va(t))}),o.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Iu,"RepetitionWithSeparator",t.maxLookahead,va(t))})})})}computeLookaheadFunc(e,t,n,r,i,s){this.TRACE_INIT(`${s}${0===t?"":t}`,()=>{const s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=Mu(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,s)})}getKeyForAutomaticLookahead(e,t){return Mu(this.currRuleShortName,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:tc.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=$u,this.setNodeLocationFromNode=$u,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Uu,this.setNodeLocationFromNode=Uu,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{}}else this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{}}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA_FAST(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];var r,i,s;i=t,s=e,void 0===(r=n).children[s]?r.children[s]=[i]:r.children[s].push(i),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(void 0===this.baseCstVisitorConstructor){const e=function(e,t){const n=function(){};Gu(n,e+"BaseSemantics");const r={visit:function(e,t){if(Array.isArray(e)&&(e=e[0]),void 0!==e)return this[e.name](e.children,t)},validateVisitor:function(){const e=function(e,t){const n=function(e,t){return t.filter(t=>"function"==typeof e[t]==0).map(t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Wu.MISSING_METHOD,methodName:t})).filter(Boolean)}(e,t);return n}(this,t);if(0!==e.length){const t=e.map(e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(void 0===this.baseCstVisitorWithDefaultsConstructor){const e=function(e,t,n){const r=function(){};Gu(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return t.forEach(e=>{i[e]=Vu}),(r.prototype=i).constructor=r,r}(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):ec}LA_FAST(e){const t=this.currIdx+e;return this.tokVector[t]}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?ec:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=pl,this.subruleIdx=0,this.currRuleShortName=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(Array.isArray(e)){if(0===e.length)throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(Array.isArray(e))this.tokensMap=e.reduce((e,t)=>(e[t.name]=t,e),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(Sl)){const t=Object.values(e.modes).flat(),n=[...new Set(t)];this.tokensMap=n.reduce((e,t)=>(e[t.name]=t,e),{})}else{if("object"!=typeof e||null===e)throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=Object.assign({},e)}this.tokensMap.EOF=Ml;const n=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every(e=>{var t;return 0==(null===(t=e.categoryMatches)||void 0===t?void 0:t.length)});this.tokenMatcher=n?pl:fl,El(Object.values(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:nc.resyncEnabled,i=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:nc.recoveryValueFunc,s=this.ruleShortNameIdx<<12;let o;return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,o=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...t){this.onBeforeParse(e);try{return o.apply(this,t)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:t,coreRule:o})}invokeRuleCatch(e,t,n){const r=0===this.RULE_STACK_IDX,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(_u(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(Ou,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,Ou,e,Xl)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(ku,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Kl],t,ku,e,Kl)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let s=!0;for(;!0===i.call(this)&&!0===s;)s=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,jl,s)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(Iu,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,zl],t,Iu,e,zl)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,ku,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=Array.isArray(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX]),this.cstFinallyStateUpdate()}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.coreRule.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw _u(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA_FAST(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new bu(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===Fu?n:e}}}saveRecogState(){const e=this.errors,t=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);const t=e.RULE_STACK;for(let e=0;e=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX])}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=n,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ml)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let e=0;e${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:rc.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){var n;const r=null!==(n=e.coreRule)&&void 0!==n?n:e;return function(){this.isBackTrackingStack.push(1);const e=this.saveRecogState();try{return r.apply(this,t),!0}catch(e){if(_u(e))return!1;throw e}finally{this.reloadRecogState(e),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Object.values(this.gastProductionsCache).map(pa)}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:tc.errorMessageProvider}SAVE_ERROR(e){if(_u(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=lu(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],s=[];for(let e=1;e<=this.maxLookahead;e++)s.push(this.LA(e));const o=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:s,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new xu(o,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=au(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));const s=this.LA(0),o=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:s,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Tu(o,this.LA(1),s))}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const n=t>0?t:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return ec}topLevelRuleRecord(e,t){try{const n=new sa({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}}optionInternalRecord(e,t){return qu.call(this,aa,e,t)}atLeastOneInternalRecord(e,t){qu.call(this,la,t,e)}atLeastOneSepFirstInternalRecord(e,t){qu.call(this,ua,t,e,ju)}manyInternalRecord(e,t){qu.call(this,ca,t,e)}manySepFirstInternalRecord(e,t){qu.call(this,ha,t,e,ju)}orInternalRecord(e,t){return Qu.call(this,e,t)}subruleInternalRecord(e,t,n){if(Ju(t),!e||!Object.hasOwn(e,"ruleName")){const n=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=e.ruleName,s=new ia({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(s),this.outputCst?Yu:Hu}consumeInternalRecord(e,t,n){if(Ju(t),!Cl(e)){const n=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=new fa({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),Ku}},class{initPerformanceTracer(e){if(Object.hasOwn(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=tc.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()}}],sc.forEach(e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach(n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(ic.prototype,n,r):ic.prototype[n]=e.prototype[n]})});class ac extends oc{constructor(e,t=tc){const n=Object.assign({},t);n.outputCst=!1,super(e,n)}}function lc(e){return void 0!==e.lineNoCont?e.lineNoCont:e.startLine}class uc{visit(e){return e&&this[e.kind](e)}arraySpecifier(e){this.visit(e.size)}binaryExpression(e){this.visit(e.lhs),this.visit(e.rhs)}methodCall(e){this.visit(e.on),this.visit(e.functionCall)}functionCall(e){this.visit(e.callee);for(const t of e.args)this.visit(t)}arrayAccess(e){this.visit(e.on),this.visit(e.index)}translationUnit(e){for(const t of e.declarations)this.visit(t)}assignmentExpression(e){this.visit(e.lhs),this.visit(e.rhs)}fieldAccess(e){this.visit(e.on)}conditionalExpression(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}postfixExpression(e){this.visit(e.on)}commaExpression(e){this.visit(e.lhs),this.visit(e.rhs)}unaryExpression(e){this.visit(e.on)}functionDefinition(e){this.visit(e.returnType);for(const t of e.params)this.visit(t);this.visit(e.body)}functionPrototype(e){this.visit(e.returnType);for(const t of e.params)this.visit(t)}parameterDeclaration(e){this.visit(e.arraySpecifier),this.visit(e.typeSpecifier)}typeSpecifier(e){hc(e.typeSpecifierNonArray)&&this.visit(e.typeSpecifierNonArray),this.visit(e.arraySpecifier)}compoundStatement(e){for(const t of e.statements)this.visit(t)}returnStatement(e){this.visit(e.what)}continueStatement(e){}breakStatement(e){}discardStatement(e){}declarator(e){this.visit(e.arraySpecifier),this.visit(e.init)}doWhileStatement(e){this.visit(e.statement),this.visit(e.conditionExpression)}whileStatement(e){this.visit(e.conditionExpression),this.visit(e.statement)}forStatement(e){this.visit(e.initExpression),this.visit(e.conditionExpression),this.visit(e.loopExpression),this.visit(e.statement)}expressionStatement(e){this.visit(e.expression)}initDeclaratorListDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}precisionDeclaration(e){this.visit(e.typeSpecifierNoPrec)}selectionStatement(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}storageQualifier(e){}switchStatement(e){this.visit(e.initExpression);for(const t of e.cases)this.visit(t)}caseLabel(e){this.visit(e.case_)}caseBlock(e){this.visit(e.caseLabel);for(const t of e.statements)this.visit(t)}fullySpecifiedType(e){this.visit(e.typeQualifier),this.visit(e.typeSpecifier)}typeQualifier(e){this.visit(e.storageQualifier),this.visit(e.layoutQualifier)}structSpecifier(e){for(const t of e.declarations)this.visit(t)}layoutQualifier(e){}invariantDeclaration(e){}structDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}variableExpression(e){}constantExpression(e){}uniformBlock(e){this.visit(e.typeQualifier);for(const t of e.declarations)this.visit(t);this.visit(e.arraySpecifier)}ppDefine(e){this.visit(e.node)}ppDir(e){}ppExtension(e){}ppCall(e){}ppPragma(e){}}function cc(e){return"tokenType"in e}function hc(e){return"kind"in e}function dc(e,t){const n=e.split("\n"),r=t.startLine,i=t.endLine;return"./src/compiler.lambda:"+r+":"+(t.startColumn-1)+"\n"+n.map((e,t)=>[t+1,e]).slice(r-2,i+2).map(([e,n])=>{var s,o,a;return e>=r&&e<=i&&(s=n,o=6+(r===e?t.startColumn-1:0),a=6+(i===e?t.endColumn:n.length),n=s+"\n"+"-".repeat(o)+"^".repeat(a-o)),(""+e).padStart(5)+" "+n}).join("\n")}const fc=["active","asm","atomic_uint","attribute","cast","class","coherent","common","double","dvec2","dvec3","dvec4","enum","extern","external","filter","fixed","fvec2","fvec3","fvec4","goto","half","hvec2","hvec3","hvec4","iimage1D","iimage1DArray","iimage2D","iimage2DArray","iimage3D","iimageBuffer","iimageCube","image1D","image1DArray","image2D","image2DArray","image3D","imageBuffer","imageCube","inline","input","interface","isampler1D","isampler1DArray","isampler2DMS","isampler2DMSArray","isampler2DRect","isamplerBuffer","long","namespace","noinline","noperspective","output","partition","patch","public","readonly","resource","restrict","sample","sampler1D","sampler1DArray","sampler1DArrayShadow","sampler1DShadow","sampler2DMS","sampler2DMSArray","sampler2DRect","sampler2DRectShadow","sampler3DRect","samplerBuffer","short","sizeof","static","subroutine","superp","template","this","typedef","uimage1D","uimage1DArray","uimage2D","uimage2DArray","uimage3D","uimageBuffer","uimageCube","union","unsigned","usampler1D","usampler1DArray","usampler2DMS","usampler2DMSArray","usampler2DRect","usamplerBuffer","using","volatile","volatile","writeonly"];var pc;!function(e){e.ASSIGN_OP=kl({name:"ASSIGN_OP",pattern:yl.NA}),e.UNARY_OP=kl({name:"UNARY_OP",pattern:yl.NA}),e.POSTFIX_OP=kl({name:"POSTFIX_OP",pattern:yl.NA}),e.PRECISION_QUALIFIER=kl({name:"PRECISION_QUALIFIER",pattern:yl.NA}),e.INTERPOLATION_QUALIFIER=kl({name:"INTERPOLATION_QUALIFIER",pattern:yl.NA}),e.MULTIPLICATIVE_OP=kl({name:"MULTIPLICATIVE_OP",pattern:yl.NA}),e.ADDITIVE_OP=kl({name:"ADDITIVE_OP",pattern:yl.NA}),e.SHIFT_OP=kl({name:"SHIFT_OP",pattern:yl.NA}),e.RELATIONAL_OP=kl({name:"RELATIONAL_OP",pattern:yl.NA}),e.EQUALITY_OP=kl({name:"EQUALITY_OP",pattern:yl.NA}),e.PARAMETER_QUALIFIER=kl({name:"PARAMETER_QUALIFIER",pattern:yl.NA}),e.WHITESPACE=kl({name:"WHITESPACE",pattern:/\s+/,group:yl.SKIPPED}),e.LINE_COMMENT=kl({name:"LINE_COMMENT",pattern:/\/\/[^\r\n]*/,group:"COMMENTS"}),e.MULTILINE_COMMENT=kl({name:"MULTILINE_COMMENT",pattern:/\/\*[\s\S]*?\*\//,group:"COMMENTS"}),e.MULASSIGN=kl({name:"MULASSIGN",pattern:"*=",label:"'*='",categories:e.ASSIGN_OP}),e.DIVASSIGN=kl({name:"DIVASSIGN",pattern:"/=",label:"'/='",categories:e.ASSIGN_OP}),e.MODASSIGN=kl({name:"MODASSIGN",pattern:"%=",label:"'%='",categories:e.ASSIGN_OP}),e.ADDASSIGN=kl({name:"ADDASSIGN",pattern:"+=",label:"'+='",categories:e.ASSIGN_OP}),e.SUBASSIGN=kl({name:"SUBASSIGN",pattern:"-=",label:"'-='",categories:e.ASSIGN_OP}),e.LEFTASSIGN=kl({name:"LEFTASSIGN",pattern:"<<=",label:"'<<='",categories:e.ASSIGN_OP}),e.RIGHTASSIGN=kl({name:"RIGHTASSIGN",pattern:">>=",label:"'>>='",categories:e.ASSIGN_OP}),e.ANDASSIGN=kl({name:"ANDASSIGN",pattern:"&=",label:"'&='",categories:e.ASSIGN_OP}),e.XORASSIGN=kl({name:"XORASSIGN",pattern:"^=",label:"'^='",categories:e.ASSIGN_OP}),e.ORASSIGN=kl({name:"ORASSIGN",pattern:"|=",label:"'|='",categories:e.ASSIGN_OP}),e.INC_OP=kl({name:"INC_OP",pattern:"++",label:"'++'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.QUESTION=kl({name:"QUESTION",pattern:"?",label:"'?'"}),e.COLON=kl({name:"COLON",pattern:":",label:"':'"}),e.DEC_OP=kl({name:"DEC_OP",pattern:"--",label:"'--'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.AND_OP=kl({name:"AND_OP",pattern:"&&",label:"'&&'"}),e.XOR_OP=kl({name:"XOR_OP",pattern:"^^",label:"'^^'"}),e.OR_OP=kl({name:"OR_OP",pattern:"||",label:"'||'"}),e.LEFT_OP=kl({name:"LEFT_OP",pattern:"<<",label:"'<<'",categories:e.SHIFT_OP}),e.RIGHT_OP=kl({name:"RIGHT_OP",pattern:">>",label:"'>>'",categories:e.SHIFT_OP}),e.EQ_OP=kl({name:"EQ_OP",pattern:"==",label:"'=='",categories:e.EQUALITY_OP}),e.NE_OP=kl({name:"NE_OP",pattern:"!=",label:"'!='",categories:e.EQUALITY_OP}),e.LE_OP=kl({name:"LE_OP",pattern:"<=",label:"'<='",categories:e.RELATIONAL_OP}),e.GE_OP=kl({name:"GE_OP",pattern:">=",label:"'>='",categories:e.RELATIONAL_OP}),e.LEFT_ANGLE=kl({name:"LEFT_ANGLE",pattern:"<",label:"'<'",categories:e.RELATIONAL_OP}),e.RIGHT_ANGLE=kl({name:"RIGHT_ANGLE",pattern:">",label:"'>'",categories:e.RELATIONAL_OP}),e.PLUS=kl({name:"PLUS",pattern:"+",label:"'+'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.TILDE=kl({name:"TILDE",pattern:"~",label:"'~'",categories:e.UNARY_OP}),e.BANG=kl({name:"BANG",pattern:"!",label:"'!'",categories:e.UNARY_OP}),e.CARET=kl({name:"CARET",pattern:"^",label:"'^'"}),e.AMPERSAND=kl({name:"AND",pattern:"&",label:"'&'"}),e.VERTICAL_BAR=kl({name:"VERTICAL_BAR",pattern:"|",label:"'|'"}),e.SLASH=kl({name:"SLASH",pattern:"/",label:"'/'",categories:e.MULTIPLICATIVE_OP}),e.PERCENT=kl({name:"PERCENT",pattern:"%",label:"'%'",categories:e.MULTIPLICATIVE_OP}),e.STAR=kl({name:"STAR",pattern:"*",label:"'*'",categories:e.MULTIPLICATIVE_OP}),e.DASH=kl({name:"DASH",pattern:"-",label:"'-'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.COMMA=kl({name:"COMMA",pattern:",",label:"','"}),e.EQUAL=kl({name:"EQUAL",pattern:"=",label:"'='",categories:e.ASSIGN_OP}),e.LEFT_PAREN=kl({name:"LEFT_PAREN",pattern:"(",label:"'('"}),e.RIGHT_PAREN=kl({name:"RIGHT_PAREN",pattern:")",label:"')'"}),e.LEFT_BRACKET=kl({name:"LEFT_BRACKET",pattern:"[",label:"'['"}),e.RIGHT_BRACKET=kl({name:"RIGHT_BRACKET",pattern:"]",label:"']'"}),e.LEFT_BRACE=kl({name:"LEFT_BRACE",pattern:"{",label:"'{'"}),e.RIGHT_BRACE=kl({name:"RIGHT_BRACE",pattern:"}",label:"'}'"}),e.SEMICOLON=kl({name:"SEMICOLON",pattern:";",label:"';'"}),e.IDENTIFIER=kl({name:"IDENTIFIER",pattern:yl.NA}),e.NON_PP_IDENTIFIER=kl({name:"NON_PP_IDENTIFIER",pattern:/[a-z_]\w*/i,categories:e.IDENTIFIER}),e.PP=kl({name:"PP",pattern:yl.NA,categories:e.IDENTIFIER});const t=(t,n)=>kl({name:t,pattern:n,categories:e.PP,longer_alt:e.NON_PP_IDENTIFIER});e.DEFINE=t("DEFINE","define"),e.UNDEF=t("UNDEF","undef"),e.ENDIF=t("ENDIF","endif"),e.IFDEF=t("IFDEF","ifdef"),e.IFNDEF=t("IFNDEF","ifndef"),e.ELIF=t("ELIF","elif"),e.ERROR=t("ERROR","error"),e.VERSION=t("VERSION","version"),e.PRAGMA_DIRECTIVE=kl({name:"PRAGMA_DIRECTIVE",pattern:/#\s*pragma\s+[^\r\n]*/}),e.LINE=t("LINE","line"),e.EXTENSION=t("EXTENSION","extension"),e.INCLUDE=t("INCLUDE","include"),e.HASH_INCLUDE_MODULE=kl({name:"HASH_INCLUDE_MODULE",pattern:/#\s*include\s*<[\w\-./\\$@ ]+>/}),e.HASH=kl({name:"HASH",pattern:"#"}),e.KEYWORD=kl({name:"KEYWORD",pattern:yl.NA});const n=(t,n)=>kl({name:t,pattern:t.toLowerCase(),label:"'"+t.toLowerCase()+"'",longer_alt:e.NON_PP_IDENTIFIER,categories:n?[e.KEYWORD,n]:e.KEYWORD});e.CONST=n("CONST"),e.UNIFORM=n("UNIFORM"),e.LAYOUT=n("LAYOUT"),e.CENTROID=n("CENTROID"),e.FLAT=n("FLAT",e.INTERPOLATION_QUALIFIER),e.SMOOTH=n("SMOOTH",e.INTERPOLATION_QUALIFIER),e.BREAK=n("BREAK"),e.CONTINUE=n("CONTINUE"),e.DO=n("DO"),e.PRECISION=n("PRECISION"),e.FOR=n("FOR"),e.WHILE=n("WHILE"),e.SWITCH=n("SWITCH"),e.CASE=n("CASE"),e.DEFAULT=n("DEFAULT"),e.IF=n("IF"),e.ELSE=n("ELSE"),e.INVARIANT=n("INVARIANT"),e.INOUT=n("INOUT",e.PARAMETER_QUALIFIER),e.OUT=n("OUT",e.PARAMETER_QUALIFIER),e.VOID=n("VOID"),e.STRUCT=n("STRUCT"),e.DISCARD=n("DISCARD"),e.RETURN=n("RETURN"),e.LOWP=n("LOWP",e.PRECISION_QUALIFIER),e.MEDIUMP=n("MEDIUMP",e.PRECISION_QUALIFIER),e.HIGHP=n("HIGHP",e.PRECISION_QUALIFIER),e.CONSTANT=kl({name:"CONSTANT",pattern:yl.NA}),e.BASIC_TYPE=kl({name:"BASIC_TYPE",pattern:yl.NA});const r=t=>kl({name:t.toUpperCase(),pattern:t,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE});e.BOOL=r("bool"),e.INT=r("int"),e.FLOAT=r("float"),e.MAT2X3=r("mat2x3"),e.MAT2X4=r("mat2x4"),e.MAT2X2=kl({name:"mat2x2".toUpperCase(),pattern:/mat2(?:x2)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat2"}),e.MAT3X2=r("mat3x2"),e.MAT3X4=r("mat3x4"),e.MAT3X3=kl({name:"mat3x3".toUpperCase(),pattern:/mat3(?:x3)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat3"}),e.MAT4X2=r("mat4x2"),e.MAT4X3=r("mat4x3"),e.MAT4X4=kl({name:"MAT4X4",pattern:/mat4(?:x4)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat4"}),e.VEC2=r("vec2"),e.VEC3=r("vec3"),e.VEC4=r("vec4"),e.IVEC2=r("ivec2"),e.IVEC3=r("ivec3"),e.IVEC4=r("ivec4"),e.BVEC2=r("bvec2"),e.BVEC3=r("bvec3"),e.BVEC4=r("bvec4"),e.UINT=r("uint"),e.UVEC2=r("uvec2"),e.UVEC3=r("uvec3"),e.UVEC4=r("uvec4"),e.USAMPLERCUBE=r("usamplerCube"),e.USAMPLER3D=r("usampler3D"),e.USAMPLER2DARRAY=r("usampler2DArray"),e.USAMPLER2D=r("usampler2D"),e.SAMPLERCUBESHADOW=r("samplerCubeShadow"),e.SAMPLERCUBE=r("samplerCube"),e.SAMPLER3D=r("sampler3D"),e.SAMPLER2DSHADOW=r("sampler2DShadow"),e.SAMPLER2DARRAYSHADOW=r("sampler2DArrayShadow"),e.SAMPLER2DARRAY=r("sampler2DArray"),e.SAMPLER2D=r("sampler2D"),e.ISAMPLERCUBE=r("isamplerCube"),e.ISAMPLER3D=r("isampler3D"),e.ISAMPLER2DARRAY=r("isampler2DArray"),e.ISAMPLER2D=r("isampler2D"),e.IN=n("IN",e.PARAMETER_QUALIFIER),e.VARYING=n("VARYING"),e.ATTRIBUTE=n("ATTRIBUTE"),e.BOOLCONSTANT=kl({name:"BOOLCONSTANT",pattern:/true|false/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.CONSTANT}),e.FLOATCONSTANT=kl({name:"FLOATCONSTANT",pattern:/((\d+\.\d*|\.\d+)(e[+-]?\d+)?|\d+e[+-]?\d+)f?/i,categories:e.CONSTANT}),e.DOT=kl({name:"DOT",pattern:".",label:"'.'"}),e.UINTCONSTANT=kl({name:"UINTCONSTANT",pattern:/0x[\da-f]+u|\d+u/i,categories:e.CONSTANT}),e.INTCONSTANT=kl({name:"INTCONSTANT",pattern:/0x[\da-f]+|\d+/i,categories:e.CONSTANT}),e.STRING=kl({name:"STRING",pattern:/"([^"\\]+|\\")+"/})}(pc||(pc={}));const mc=Object.values(pc).filter(e=>e!==pc.NON_PP_IDENTIFIER).flatMap(e=>Array.isArray(e)?e:[e]);mc.push(pc.NON_PP_IDENTIFIER);const gc=new yl(mc,{ensureOptimizations:!1});new class extends uc{constructor(){super(...arguments),this.markError=()=>{}}eval(e,t,n){return this.isDefined=t,this.markError=n,super.visit(e)}constantExpression(e){if(e.const_.tokenType!==pc.INTCONSTANT)throw new Error("XX");return+e.const_.image}unaryExpression(e){switch(e.op.tokenType){case pc.NON_PP_IDENTIFIER:return+this.isDefined(e.on.var.image);case pc.DASH:return-this.visit(e.on);case pc.TILDE:return~this.visit(e.on);case pc.BANG:return+!this.visit(e.on);case pc.PLUS:return this.visit(e.on);default:throw new Error(e.op.tokenType.name)}}binaryExpression(e){const t=this.visit(e.lhs);switch(e.op.tokenType){case pc.AND_OP:return t&&this.visit(e.rhs);case pc.OR_OP:return t||this.visit(e.rhs);default:{const n=this.visit(e.rhs);return 0|function(e,t,n){switch(e){case pc.PLUS:return t+n;case pc.DASH:return t-n;case pc.STAR:return t*n;case pc.PERCENT:return t%n;case pc.SLASH:return t/n;case pc.LEFT_OP:return t<>n;case pc.EQ_OP:return t===n;case pc.NE_OP:return t!==n;case pc.LE_OP:return t<=n;case pc.GE_OP:return t>=n;case pc.LEFT_ANGLE:return tn;case pc.XOR_OP:return t!==n;case pc.AND_OP:return t&&n;case pc.OR_OP:return t||n;case pc.AMPERSAND:return t&n;case pc.CARET:return t^n;case pc.VERTICAL_BAR:return t|n;default:throw new Error}}(e.op.tokenType,t,n)}}}variableExpression(e){return this.markError("P0001",e.var,"undefined identifier "+e.var.image),0}};const Ec=new class extends ac{getTokensOnLine(){const e=[],t=lc(this.LA(0));let n;for(;lc(n=this.LA(1))===t;)e.push(n),this.SKIP_TOKEN();return e}constructor(){super(mc,{skipValidations:!0}),this.multiplicativeExpression=this.RR("multiplicativeExpression",()=>this.LEFT_ASSOC(this.preprocessing?this.ppUnaryExpression:this.unaryExpression,pc.MULTIPLICATIVE_OP)),this.additiveExpression=this.RR("additiveExpression",()=>this.LEFT_ASSOC(this.multiplicativeExpression,pc.ADDITIVE_OP)),this.shiftExpression=this.RR("shiftExpression",()=>this.LEFT_ASSOC(this.additiveExpression,pc.SHIFT_OP)),this.relationalExpression=this.RR("relationalExpression",()=>this.LEFT_ASSOC(this.shiftExpression,pc.RELATIONAL_OP)),this.equalityExpression=this.RR("equalityExpression",()=>this.LEFT_ASSOC(this.relationalExpression,pc.EQUALITY_OP)),this.andExpression=this.RR("andExpression",()=>this.LEFT_ASSOC(this.equalityExpression,pc.AMPERSAND)),this.exclusiveOrExpression=this.RR("exclusiveOrExpression",()=>this.LEFT_ASSOC(this.andExpression,pc.CARET)),this.inclusiveOrExpression=this.RR("inclusiveOrExpression",()=>this.LEFT_ASSOC(this.exclusiveOrExpression,pc.VERTICAL_BAR)),this.logicalAndExpression=this.RR("logicalAndExpression",()=>this.LEFT_ASSOC(this.inclusiveOrExpression,pc.AND_OP)),this.logicalXorExpression=this.RR("logicalXorExpression",()=>this.LEFT_ASSOC(this.logicalAndExpression,pc.XOR_OP)),this.logicalOrExpression=this.RR("logicalOrExpression",()=>this.LEFT_ASSOC(this.logicalXorExpression,pc.OR_OP)),this.assignmentExpression=this.RR("assignmentExpression",()=>{const e=this.SUBRULE(this.conditionalExpression);return this.OPTION(()=>{const t=this.CONSUME(pc.ASSIGN_OP),n=this.SUBRULE1(this.assignmentExpression);return{kind:"assignmentExpression",lhs:e,op:t,rhs:n}})??e}),this.expression=this.RR("expression",()=>{let e;return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.SUBRULE(this.assignmentExpression);return e=e?{kind:"commaExpression",lhs:e,rhs:t}:t}}),e}),this.conditionalExpression=this.RR("conditionalExpression",()=>{const e=this.SUBRULE1(this.logicalOrExpression);return this.OPTION(()=>({kind:"conditionalExpression",condition:e,QUESTION:this.CONSUME(pc.QUESTION),yes:this.SUBRULE2(this.expression),COLON:this.CONSUME(pc.COLON),no:this.SUBRULE3(this.assignmentExpression)}))??e}),this.switchStatement=this.RR("switchStatement",()=>{this.CONSUME(pc.SWITCH),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);this.CONSUME(pc.RIGHT_PAREN),this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.caseBlock))),this.CONSUME(pc.RIGHT_BRACE),{kind:"switchStatement",initExpression:e,cases:t}}),this.caseBlock=this.RR("caseBlock",()=>{const e=this.SUBRULE(this.caseLabel),t=[];return this.MANY1(()=>t.push(this.SUBRULE(this.statement))),{kind:"caseBlock",caseLabel:e,statements:t}}),this.jumpStatement=this.RR("jumpStatement",()=>{const e=this.OR([{ALT:()=>(this.CONSUME(pc.CONTINUE),{kind:"continueStatement"})},{ALT:()=>(this.CONSUME(pc.BREAK),{kind:"breakStatement"})},{ALT:()=>(this.CONSUME(pc.DISCARD),{kind:"discardStatement"})},{ALT:()=>(this.CONSUME(pc.RETURN),{kind:"returnStatement",what:this.OPTION(()=>this.SUBRULE(this.expression))})}]);return this.CONSUME(pc.SEMICOLON),e}),this.primaryExpression=this.RR("primaryExpression",()=>this.OR([{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),e}},{ALT:()=>({kind:"variableExpression",var:this.CONSUME(pc.IDENTIFIER)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.CONSTANT)})}])),this.constantExpression=this.RR("constantExpression",()=>this.SUBRULE(this.conditionalExpression)),this.layoutQualifier=this.RR("layoutQualifier",()=>{this.CONSUME(pc.LAYOUT),this.CONSUME(pc.LEFT_PAREN);const e=[];return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.CONSUME(pc.IDENTIFIER);let n;this.OPTION(()=>{this.CONSUME(pc.EQUAL),n=this.OR([{ALT:()=>this.CONSUME(pc.INTCONSTANT)},{ALT:()=>this.CONSUME(pc.UINTCONSTANT)}])}),e.push({IDENTIFIER:t,init:n})}}),this.CONSUME(pc.RIGHT_PAREN),{kind:"layoutQualifier",layoutQualifierIds:e}}),this.storageQualifier=this.RR("storageQualifier",()=>{let e,t,n,r,i,s,o;return this.OR([{ALT:()=>e=this.CONSUME(pc.CONST)},{ALT:()=>{t=this.OPTION(()=>this.CONSUME(pc.CENTROID)),this.OR9([{ALT:()=>n=this.CONSUME(pc.IN)},{ALT:()=>r=this.CONSUME(pc.OUT)},{ALT:()=>s=this.CONSUME(pc.VARYING)},{ALT:()=>o=this.CONSUME(pc.ATTRIBUTE)}])}},{ALT:()=>i=this.CONSUME(pc.UNIFORM)}]),{kind:"storageQualifier",CONST:e,CENTROID:t,IN:n,OUT:r,VARYING:s,ATTRIBUTE:o,UNIFORM:i}}),this.typeQualifier=this.RR("typeQualifier",()=>{let e,t,n,r;return this.OR([{ALT:()=>e=this.SUBRULE(this.storageQualifier)},{ALT:()=>{t=this.SUBRULE1(this.layoutQualifier),e=this.OPTION1(()=>this.SUBRULE2(this.storageQualifier))}},{ALT:()=>{n=this.CONSUME(pc.INTERPOLATION_QUALIFIER),e=this.OPTION2(()=>this.SUBRULE3(this.storageQualifier))}},{ALT:()=>{r=this.CONSUME(pc.INVARIANT),n=this.OPTION3(()=>this.CONSUME1(pc.INTERPOLATION_QUALIFIER)),e=this.SUBRULE7(this.storageQualifier)}}]),{kind:"typeQualifier",storageQualifier:e,layoutQualifier:t,interpolationQualifier:n,invariantQualifier:r}}),this.precisionQualifier=this.RR("precisionQualifier",()=>this.CONSUME(pc.PRECISION_QUALIFIER)),this.arraySpecifier=this.RR("arraySpecifier",()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.OPTION3(()=>this.SUBRULE(this.constantExpression));return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arraySpecifier",size:e}}),this.typeSpecifierNonArray=this.RR("typeSpecifierNonArray",()=>this.OR([{ALT:()=>this.CONSUME(pc.BASIC_TYPE)},{ALT:()=>this.CONSUME(pc.VOID)},{ALT:()=>this.SUBRULE(this.structSpecifier)},{ALT:()=>this.CONSUME(pc.IDENTIFIER)}])),this.typeSpecifierNoPrec=this.RR("typeSpecifierNoPrec",()=>{const e=this.SUBRULE(this.typeSpecifierNonArray);return{kind:"typeSpecifier",precisionQualifier:void 0,arraySpecifier:this.OPTION1(()=>this.SUBRULE(this.arraySpecifier)),typeSpecifierNonArray:e}}),this.functionCall=this.RR("functionCall",()=>{const e=this.SUBRULE(this.typeSpecifierNoPrec);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({DEF:()=>t.push(this.SUBRULE(this.assignmentExpression)),SEP:pc.COMMA}),this.CONSUME(pc.RIGHT_PAREN),{kind:"functionCall",callee:e,args:t}}),this.functionCallHeader=this.RULE("functionCallHeader",()=>{this.SUBRULE(this.typeSpecifierNoPrec),this.CONSUME(pc.LEFT_PAREN)}),this.postfixExpression=this.RR("postfixExpression",()=>{const e=this.LA(1);let t=this.OR1([{GATE:this.BACKTRACK(this.functionCallHeader),ALT:()=>this.SUBRULE1(this.functionCall)},{ALT:()=>this.SUBRULE(this.primaryExpression)}]);return this.MANY(()=>{t=this.OR2([{ALT:()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arrayAccess",on:t,index:e}}},{ALT:()=>{this.CONSUME1(pc.DOT);const e=this.SUBRULE2(this.functionCall);return{kind:"methodCall",on:t,functionCall:e}}},{ALT:()=>{this.CONSUME2(pc.DOT);const e=this.CONSUME(pc.IDENTIFIER);return{kind:"fieldAccess",on:t,field:e}}},{ALT:()=>{const e=this.CONSUME(pc.POSTFIX_OP);return{kind:"postfixExpression",on:t,op:e}}}]),this.FINALIZE(t,e)}),t}),this.unaryExpression=this.RR("unaryExpression",()=>this.OR([{ALT:()=>this.SUBRULE1(this.postfixExpression)},{ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.UNARY_OP),on:this.SUBRULE2(this.unaryExpression)})}])),this.ppUnaryExpression=this.RR("ppUnaryExpression",()=>this.OR([{GATE:()=>this.LA(1).tokenType===pc.NON_PP_IDENTIFIER&&"defined"===this.LA(1).image,ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.IDENTIFIER),on:{kind:"variableExpression",var:this.OR1([{ALT:()=>this.SUBRULE(this.ppIdentifier)},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE1(this.ppIdentifier);return this.CONSUME(pc.RIGHT_PAREN),e}}])}})},{ALT:()=>({kind:"unaryExpression",op:this.OR2([{ALT:()=>this.CONSUME(pc.PLUS)},{ALT:()=>this.CONSUME(pc.DASH)},{ALT:()=>this.CONSUME(pc.TILDE)},{ALT:()=>this.CONSUME(pc.BANG)}]),on:this.SUBRULE2(this.ppUnaryExpression)})},{ALT:()=>this.SUBRULE(this.ppPrimaryExpression)}])),this.ppPrimaryExpression=this.RR("ppPrimaryExpression",()=>this.OR([{ALT:()=>({kind:"variableExpression",var:this.SUBRULE(this.ppIdentifier)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.INTCONSTANT)})},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.ppConstantExpression);return this.CONSUME(pc.RIGHT_PAREN),e}}])),this.ppConstantExpression=this.RR("ppConstantExpression",()=>{try{return this.preprocessing=!0,this.LEFT_ASSOC(this.logicalAndExpression,pc.OR_OP)}finally{this.preprocessing=!1}}),this.typeSpecifier=this.RR("typeSpecifier",()=>{const e=this.OPTION(()=>this.SUBRULE(this.precisionQualifier)),t=this.SUBRULE(this.typeSpecifierNoPrec);return Object.assign({},t,{precisionQualifier:e})}),this.parameterDeclaration=this.RR("parameterDeclaration",()=>{const e=this.OPTION(()=>this.CONSUME(pc.CONST)),t=this.OPTION1(()=>this.CONSUME(pc.PARAMETER_QUALIFIER)),n=this.SUBRULE(this.typeSpecifier);let r,i;return this.OPTION2(()=>{r=this.CONSUME2(pc.IDENTIFIER),i=this.OPTION3(()=>this.SUBRULE(this.arraySpecifier))}),{kind:"parameterDeclaration",parameterTypeQualifier:e,pName:r,arraySpecifier:i,parameterQualifier:t,typeSpecifier:n}}),this.fullySpecifiedType=this.RR("fullySpecifiedType",()=>({kind:"fullySpecifiedType",typeQualifier:this.OPTION(()=>this.SUBRULE(this.typeQualifier)),typeSpecifier:this.SUBRULE(this.typeSpecifier)})),this.structDeclaration=this.RR("structDeclaration",()=>{const e=this.SUBRULE(this.fullySpecifiedType),t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME(pc.IDENTIFIER),arraySpecifier:this.OPTION(()=>this.SUBRULE(this.arraySpecifier)),init:void 0};return t.push(e),e})}),this.CONSUME(pc.SEMICOLON),{kind:"structDeclaration",fsType:e,declarators:t}}),this.structSpecifier=this.RR("structSpecifier",()=>{this.CONSUME(pc.STRUCT);const e=this.OPTION2(()=>this.CONSUME(pc.IDENTIFIER));this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),{kind:"structSpecifier",name:e,declarations:t}}),this.initializer=this.RR("initializer",()=>this.SUBRULE(this.assignmentExpression)),this.singleDeclaration=this.RULE("singleDeclaration",()=>this.OR([{ALT:()=>{this.SUBRULE(this.fullySpecifiedType),this.OPTION1(()=>{this.CONSUME1(pc.IDENTIFIER),this.OPTION2(()=>{this.CONSUME(pc.LEFT_BRACKET),this.OPTION3(()=>this.SUBRULE(this.constantExpression)),this.CONSUME(pc.RIGHT_BRACKET)}),this.OPTION4(()=>{this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)})})}},{ALT:()=>({kind:"invariantDeclaration",INVARIANT:this.CONSUME(pc.INVARIANT),IDENTIFIER:this.CONSUME2(pc.IDENTIFIER)})}])),this.initDeclaratorList=this.RR("initDeclaratorList",()=>this.SUBRULE(this.externalDeclaration,{ARGS:[!1,!1]})),this.expressionStatement=this.RR("expressionStatement",()=>{const e=this.OPTION(()=>this.SUBRULE(this.expression));return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:e}}),this.condition=this.RR("condition",()=>this.OR({MAX_LOOKAHEAD:4,DEF:[{GATE:this.BACKTRACK(this.singleDeclaration),ALT:()=>{const e=this.SUBRULE2(this.fullySpecifiedType),t=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.EQUAL),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:[{kind:"declarator",name:t,init:this.SUBRULE3(this.initializer),arraySpecifier:void 0}]}}},{ALT:()=>this.SUBRULE(this.expression)}]})),this.caseLabel=this.RR("caseLabel",()=>this.OR([{ALT:()=>{this.CONSUME(pc.CASE);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.COLON),{kind:"caseLabel",case_:e}}},{ALT:()=>(this.CONSUME2(pc.DEFAULT),this.CONSUME2(pc.COLON),{kind:"caseLabel",case_:void 0})}])),this.selectionStatement=this.RR("selectionStatement",()=>{this.CONSUME(pc.IF),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),{kind:"selectionStatement",condition:e,yes:this.SUBRULE2(this.statement,{ARGS:[!0]}),no:this.OPTION(()=>(this.CONSUME(pc.ELSE),this.SUBRULE3(this.statement,{ARGS:[!0]})))}}),this.statement=this.RR("statement",e=>this.OR([{ALT:()=>this.SUBRULE(this.ppDirective),IGNORE_AMBIGUITIES:!0},{ALT:()=>{const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:{kind:"variableExpression",var:e}}},IGNORE_AMBIGUITIES:!0},{GATE:this.BACKTRACK(this.expressionStatement),ALT:()=>this.SUBRULE(this.expressionStatement)},{ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.selectionStatement)},{ALT:()=>this.SUBRULE(this.switchStatement)},{ALT:()=>this.SUBRULE(this.iterationStatement)},{ALT:()=>this.SUBRULE(this.jumpStatement)},{ALT:()=>this.SUBRULE(this.compoundStatement,{ARGS:[!!e]})}])),this.compoundStatement=this.RR("compoundStatement",e=>{if("object"==typeof e)throw new Error;this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.statement))),this.CONSUME(pc.RIGHT_BRACE),{kind:"compoundStatement",statements:t,newScope:!!e}}),this.iterationStatement=this.RR("iterationStatement",()=>this.OR([{ALT:()=>{this.CONSUME(pc.WHILE),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.condition);return this.CONSUME(pc.RIGHT_PAREN),{kind:"whileStatement",conditionExpression:e,statement:this.SUBRULE(this.statement)}}},{ALT:()=>{this.CONSUME2(pc.DO);const e=this.SUBRULE2(this.statement,{ARGS:[!0]});this.CONSUME2(pc.WHILE),this.CONSUME2(pc.LEFT_PAREN);const t=this.SUBRULE2(this.expression);return this.CONSUME2(pc.RIGHT_PAREN),this.CONSUME2(pc.SEMICOLON),{kind:"doWhileStatement",statement:e,conditionExpression:t}}},{ALT:()=>{this.CONSUME3(pc.FOR),this.CONSUME3(pc.LEFT_PAREN);const e=this.OR3([{GATE:this.BACKTRACK(this.initDeclaratorList),ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.expressionStatement)}]),t=this.OPTION3(()=>this.SUBRULE3(this.condition));this.CONSUME4(pc.SEMICOLON);const n=this.OPTION4(()=>this.SUBRULE4(this.expression));return this.CONSUME3(pc.RIGHT_PAREN),{kind:"forStatement",initExpression:e,conditionExpression:t,loopExpression:n,statement:this.SUBRULE3(this.statement)}}}])),this.translationUnit=this.RR("translationUnit",()=>{const e=[];return this.AT_LEAST_ONE(()=>e.push(this.SUBRULE(this.externalDeclaration,{ARGS:[!0,!0]}))),{kind:"translationUnit",declarations:e}}),this.uniformBlock=this.RR("uniformBlock",()=>{const e=this.SUBRULE(this.typeQualifier),t=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_BRACE);const n=[];let r,i;return this.MANY(()=>n.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),this.OPTION(()=>{r=this.CONSUME1(pc.IDENTIFIER),i=this.OPTION1(()=>this.SUBRULE(this.arraySpecifier))}),this.CONSUME(pc.SEMICOLON),{kind:"uniformBlock",typeQualifier:e,blockName:t,declarations:n,namespace:r,arraySpecifier:i}}),this.uniformBlockHeader=this.RULE("uniformBlockHeader",()=>{this.OPTION(()=>this.SUBRULE(this.layoutQualifier)),this.CONSUME(pc.UNIFORM),this.CONSUME(pc.IDENTIFIER),this.CONSUME(pc.LEFT_BRACE)}),this.typeQualifierDeclaration=this.RR("typeQualifierDeclaration",()=>{const e=this.SUBRULE(this.typeQualifier);return this.CONSUME(pc.SEMICOLON),{kind:"typeQualifierDeclaration",typeQualifier:e}}),this.externalDeclaration=this.RR("externalDeclaration",(e,t)=>this.OR([{ALT:()=>this.SUBRULE(this.ppCall)},{ALT:()=>this.SUBRULE(this.ppDirective)},{GATE:this.BACKTRACK(this.typeQualifierDeclaration),ALT:()=>this.SUBRULE(this.typeQualifierDeclaration)},{GATE:e?this.BACKTRACK(this.uniformBlockHeader):()=>!1,ALT:()=>this.SUBRULE(this.uniformBlock)},{ALT:()=>{const e=this.SUBRULE(this.fullySpecifiedType);return this.OR2([{GATE:t?void 0:()=>!1,ALT:()=>{const t=this.CONSUME1(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const n=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>n.push(this.SUBRULE(this.parameterDeclaration))}),this.CONSUME(pc.RIGHT_PAREN),this.OR3([{ALT:()=>(this.CONSUME(pc.SEMICOLON),{kind:"functionPrototype",name:t,returnType:e,params:n})},{ALT:()=>{const r=this.SUBRULE(this.compoundStatement);return{kind:"functionDefinition",name:t,returnType:e,params:n,body:r}},IGNORE_AMBIGUITIES:!1}])}},{ALT:()=>{const t=[];return this.MANY_SEP2({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME3(pc.IDENTIFIER),arraySpecifier:this.OPTION5(()=>this.SUBRULE(this.arraySpecifier)),init:this.OPTION7(()=>(this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)))};return t.push(e),e})}),this.CONSUME2(pc.SEMICOLON),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:t}}}])}},{ALT:()=>{this.CONSUME(pc.PRECISION);const e=this.CONSUME(pc.PRECISION_QUALIFIER),t=this.SUBRULE(this.typeSpecifierNoPrec);return this.CONSUME3(pc.SEMICOLON),{kind:"precisionDeclaration",precisionQualifier:e,typeSpecifierNoPrec:t}}}])),this.ppDefine=this.RR("ppDefine",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.DEFINE);const e=this.CONSUME(pc.IDENTIFIER),t=this.LA(1).tokenType===pc.LEFT_PAREN&&e.endOffset+1===this.LA(1).startOffset,n={kind:"ppDefine",what:e,params:this.OPTION({GATE:()=>t,DEF:()=>{this.CONSUME(pc.LEFT_PAREN);const e=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>e.push(this.SUBRULE(this.ppIdentifier))}),this.CONSUME(pc.RIGHT_PAREN),e}}),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(n),n}),this.ppInclude=this.RR("ppInclude",()=>{let e="";return this.OR([{ALT:()=>{const t=this.CONSUME(pc.HASH_INCLUDE_MODULE);e=t.image.substring(t.image.indexOf("<"))}},{ALT:()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.INCLUDE),e=this.CONSUME(pc.STRING).image}}]),{kind:"ppInclude",what:e}}),this.ppCall=this.RR("ppCall",()=>{const e=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>{const e=[];this.MANY(()=>this.OR({DEF:[{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>e.push(this.CONSUME(pc.BASIC_TYPE))},{ALT:()=>e.push(this.CONSUME(pc.ASSIGN_OP))},{ALT:()=>e.push(this.CONSUME(pc.SHIFT_OP))},{ALT:()=>e.push(this.CONSUME(pc.CONSTANT))},{ALT:()=>e.push(this.CONSUME(pc.KEYWORD))},{ALT:()=>e.push(this.CONSUME2(pc.IDENTIFIER))}]})),t.push({tokens:e,node:void 0})},MAX_LOOKAHEAD:1}),this.CONSUME(pc.RIGHT_PAREN),{kind:"ppCall",callee:e,args:t}}),this.ppCallArg=this.RULE("ppCallArg",()=>{const e=[];return e.push(this.CONSUME(pc.LEFT_PAREN)),this.MANY(()=>this.OR([{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>(e.push(this.LA(1)),this.SKIP_TOKEN())}])),e.push(this.CONSUME(pc.RIGHT_PAREN)),e}),this.ppNone=this.RR("ppNone",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.ELSE)},{ALT:()=>this.CONSUME(pc.ENDIF)}]),tokens:[],node:void 0};return this.ppDefs.push(e),e}),this.ppMulti=this.RR("ppMulti",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IF)},{ALT:()=>this.CONSUME(pc.ELIF)},{ALT:()=>this.CONSUME(pc.ERROR)},{ALT:()=>this.CONSUME(pc.VERSION)},{ALT:()=>this.CONSUME(pc.LINE)}]),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(e),e}),this.ppPragma=this.RR("ppPragma",()=>({kind:"ppPragma",dir:this.CONSUME(pc.PRAGMA_DIRECTIVE)})),this.ppSingle=this.RR("ppSingle",()=>(this.CONSUME(pc.HASH),{kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IFDEF)},{ALT:()=>this.CONSUME(pc.IFNDEF)}]),tokens:[this.CONSUME(pc.IDENTIFIER)],node:void 0})),this.ppExtension=this.RR("ppExtension",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.EXTENSION);const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.COLON),{kind:"ppExtension",extension:e,behavior:this.CONSUME1(pc.IDENTIFIER)}}),this.ppDirective=this.RR("ppDirective",()=>this.OR([{ALT:()=>this.SUBRULE(this.ppDefine)},{ALT:()=>this.SUBRULE(this.ppExtension)},{ALT:()=>this.SUBRULE(this.ppNone)},{ALT:()=>this.SUBRULE(this.ppSingle)},{ALT:()=>this.SUBRULE(this.ppMulti)},{ALT:()=>this.SUBRULE(this.ppPragma)},{ALT:()=>this.SUBRULE(this.ppInclude)}])),this.ppIdentifier=this.RR("ppIdentifier",()=>this.OR([{ALT:()=>this.CONSUME(pc.IDENTIFIER)},{ALT:()=>this.CONSUME(pc.KEYWORD)},{ALT:()=>this.CONSUME(pc.BASIC_TYPE)}])),this.ppDefs=[],this.performSelfAnalysis()}reset(){super.reset(),this.ppDefs=[],this.backtracking=!1,this.preprocessing=!1}LEFT_ASSOC(e,t){const n=this.LA(1);let r=this.SUBRULE1(e);return this.MANY(()=>{const i=this.CONSUME(t),s=this.SUBRULE2(e);return r={kind:"binaryExpression",lhs:r,rhs:s,op:i,firstToken:n,lastToken:this.LA(0)},r}),r}ANNOTATE(e){return(...t)=>{const n=this.LA(1),r=e(...t);return r&&hc(r)&&!r.firstToken&&this.FINALIZE(r,n),r}}BACKTRACK(e,t){const n=super.BACKTRACK(e,t);return function(){try{return this.backtracking=!0,n.call(this)}finally{this.backtracking=!1}}}RR(e,t,n){return super.RULE(e,this.ANNOTATE(t),n)}FINALIZE(e,t){this.RECORDING_PHASE||this.backtracking||(e.firstToken=t,e.lastToken=this.LA(0))}isAtEof(){return this.LA(1).tokenType===Ml}};const{ll:{printDocToString:vc},LX:{indentIfBreak:Cc,group:Dc,indent:Sc,join:Ac,line:_c,softline:yc,hardline:bc,fill:Tc,lineSuffixBoundary:Rc}}=r,xc=new class extends uc{constructor(){super(...arguments),this.result=void 0}visit(e){if(!this.result){const t=this.result=[];return super.visit(e),this.result=void 0,t}e&&this.result.push(e)}};function wc(e){return(cc(e)?e:e.lastToken).endOffset+1}const Fc={"glsl-parser":{parse(e,t){const n=function(e){const t=function(e){const t=[];let n="",r=0,i=0;return{result:e.replace(/\\(\r\n|\n\r|\r|\n)(.*?)(?:(?=\\?[\r\n])|$)/g,(s,o,a,l)=>{r++,i+=function(e,t){let n=t;for(;n>=0&&"\r"!==e[n]&&"\n"!==e[n];)n--;return t-n-1}(e,l),t.push({originalOffset:l+1+o.length,newOffset:l-n.length,length:a.length,lineDiff:-r,columnDiff:i}),n+=" "+o;let u="";return e.length>l+s.length&&"\\"===e[l+s.length]||(u=n,n="",r=0,i=0),a+u}),changes:t}}(e),n=gc.tokenize(t.result);!function(e,t){if(t.errors.length)throw new Error("LEXER ERROR: "+t.errors.map(t=>t.message+":\n"+dc(e,{startLine:t.line,startColumn:t.column,endLine:t.line,endColumn:t.column+t.length})).join())}(t.result,n),function(e,t){let n=0;function r(e,t){const n=t.originalOffset-t.newOffset;e.startOffset>=t.newOffset&&(e.lineNoCont=e.startLine,e.startOffset+=n,e.startLine-=t.lineDiff,e.startColumn-=t.columnDiff),e.endOffset+=n,e.endLine-=t.lineDiff,e.endColumn-=t.columnDiff}for(const i of t){for(;e[n]&&e[n].endOffset0)throw new Error("PARSE ERROR: "+t.map(t=>t.message+"\n"+t.context.ruleStack.join(" > ")+"\n"+dc(e,t.token)).join("\n"))}(t.result,Ec.errors);const i=Ec.ppDefs;function s(e,t){Ec.input=e;const n=t(Ec);return Ec.isAtEof()&&0===Ec.errors.length?n:void 0}for(const e of i)e.node=s(e.tokens,e=>e.externalDeclaration(!0,!0))??s(e.tokens,e=>e.statement())??s(e.tokens,e=>e.expression());return r.comments=n.groups.COMMENTS,r}(e);return n.comments?.forEach(e=>e.value=JSON.stringify(e)),n},astFormat:"glsl-ast",locStart:function(e){return(cc(e)?e:e.firstToken).startOffset},locEnd:wc}};function Nc(e){switch(e){case pc.STAR:case pc.SLASH:case pc.PERCENT:return 4;case pc.PLUS:case pc.DASH:return 5;case pc.LEFT_OP:case pc.RIGHT_OP:return 6;case pc.LEFT_ANGLE:case pc.RIGHT_ANGLE:case pc.LE_OP:case pc.GE_OP:return 7;case pc.EQ_OP:case pc.NE_OP:return 8;case pc.AMPERSAND:return 9;case pc.CARET:return 10;case pc.VERTICAL_BAR:return 11;case pc.AND_OP:case pc.XOR_OP:return 12;case pc.OR_OP:return 13;case pc.COMMA:return 17;default:throw new Error}}function Lc(e,t){switch(e.kind){default:return 1;case"variableExpression":return t?.find(t=>t.image===e.var.image)?18:1;case"arrayAccess":case"functionCall":case"fieldAccess":case"postfixExpression":return 2;case"unaryExpression":return 3;case"binaryExpression":return Nc(e.op.tokenType);case"conditionalExpression":return 15;case"assignmentExpression":return 16;case"commaExpression":return 17}}function Oc(e,t){return t?["(",e,")"]:e}function Ic(e,t,n,r){const i="binaryExpression"===n.kind&&"binaryExpression"===n.lhs.kind&&Nc(n.lhs.op.tokenType)===Nc(n.op.tokenType)||"commaExpression"===n.kind&&"commaExpression"===n.lhs.kind,s="binaryExpression"===n.kind?n.op.tokenType:pc.COMMA;let o;return i?(o=e.call(e=>Ic(e,t,e.getValue(),r),"lhs"),o.push("commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))),o):[Oc(e.call(t,"lhs"),Lc(n.lhs,r)>Nc(s)),"commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))]}function kc(e,t,n){return"expressionStatement"!==e.kind||e.expression?"compoundStatement"===e.kind||n?[" ",t]:Sc([_c,t]):";"}function Mc(e,t){return vc(e,Object.assign({},t,{printWidth:t.printWidth-2})).formatted.trim().replace(/^.*(?=[\r\n])/gm,e=>e+" ".repeat(t.printWidth-2-e.length+1)+"\\")}function Pc(e){return"assignmentExpression"===e.kind}function Bc(e){return"assignmentExpression"===e.kind||"declarator"===e.kind}function Uc(e,t,n,r,i,s){const o=function(e,t,n){if(!n)return"only-left";const r=!Pc(n);return e.match(Pc,Bc,e=>!r||"expressionStatement"!==e.kind&&"initDeclaratorListDeclaration"!==e.kind)?r?"chain-tail":"chain":!r&&Pc(n.rhs)||(t.originalText,0)||"binaryExpression"===n.kind||"commaExpression"===n.kind||"conditionalExpression"===n.kind&&"binaryExpression"===n.condition.kind?"break-after-operator":"constantExpression"===n.kind?"never-break-after-operator":"fluid"}(e,t,s);switch(o){case"break-after-operator":return Dc([Dc(n),r,Dc(Sc([_c,i]))]);case"never-break-after-operator":return Dc([Dc(n),r," ",i]);case"fluid":{const e=Symbol("assignment");return Dc([Dc(n),r,Dc(Sc(_c),{id:e}),Rc,Cc(i,{groupId:e})])}case"chain":return[Dc(n),r,_c,i];case"chain-tail":return[Dc(n),r,Sc([_c,i])];case"only-left":return n;default:throw new Error}}const $c={"glsl-ast":{print(e,t,n){const r=t.inMacro,i=e.getValue();if(!i)return[];if(cc(i))return i.image;const s=t=>e.call(n,t);try{switch(i.kind){case"translationUnit":{const r=[];return e.each((e,i)=>{const s=e.getValue();r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc),r.push(bc)},"declarations"),r}case"precisionDeclaration":return["precision ",i.precisionQualifier.image," ",e.call(n,"typeSpecifierNoPrec"),";"];case"fullySpecifiedType":{const e=[];return i.typeQualifier&&e.push(s("typeQualifier")," "),e.push(s("typeSpecifier")),e}case"typeSpecifier":{const e=[];return i.precisionQualifier&&e.push(i.precisionQualifier.image," "),e.push(s("typeSpecifierNonArray")),i.arraySpecifier&&e.push(s("arraySpecifier")),e}case"typeQualifier":{const e=[];return i.invariantQualifier&&e.push("invariant"),i.interpolationQualifier&&e.push(i.interpolationQualifier.image),i.layoutQualifier&&e.push(s("layoutQualifier")),i.storageQualifier&&e.push(s("storageQualifier")),Ac(" ",e)}case"storageQualifier":{const t=[];return i.CONST&&t.push("const"),i.CENTROID&&e.getParentNode().interpolationQualifier?.tokenType!==pc.FLAT&&t.push("centroid"),i.IN&&t.push("in"),i.OUT&&t.push("out"),i.VARYING&&t.push("varying"),i.ATTRIBUTE&&t.push("attribute"),i.UNIFORM&&t.push("uniform"),Ac(" ",t)}case"functionPrototype":case"functionDefinition":return[Dc([s("returnType")," ",s("name"),"(",Sc([yc,Ac([",",_c],e.map(n,"params"))]),yc,")"]),"functionPrototype"===i.kind?";":[" ",s("body")]];case"parameterDeclaration":return[i.parameterTypeQualifier?[s("parameterTypeQualifier")," "]:"",i.parameterQualifier?.tokenType===pc.OUT||i.parameterQualifier?.tokenType===pc.INOUT?i.parameterQualifier?.image+" ":"",s("typeSpecifier")," ",s("pName"),s("arraySpecifier")];case"initDeclaratorListDeclaration":case"structDeclaration":{const t=e.map(n,"declarators"),r="forStatement"===e.getParentNode().kind,o=i.declarators.some(e=>e.init);return Dc([s("fsType"),0===t.length?"":" ",1===t.length?t:Dc(Sc(Ac([",",o&&!r?bc:_c],t))),";"])}case"declarator":{const n=s("arraySpecifier"),r=[i.name.image,n];return Uc(e,t,r," =",s("init"),i.init)}case"arraySpecifier":return Dc(["[",Sc([yc,s("size")]),yc,"]"]);case"arrayAccess":return[Oc(s("on"),Lc(i.on,r)>2),"[",s("index"),"]"];case"structSpecifier":{const r=[];return e.each((e,i,s)=>{const o=e.getValue();r.push(bc),r.push(n(e)),i!==s.length-1&&_s.isNextLineEmpty(t.originalText,o,wc)&&r.push(bc)},"declarations"),Dc(["struct",i.name?" "+i.name.image:""," {",Sc(r),bc,"}"])}case"compoundStatement":{const r=[],s=!!i.comments?.some(e=>!e.leading&&!e.trailing&&!e.printed);return e.each((e,i)=>{const s=e.getValue();0!==i&&r.push(bc),r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc)},"statements"),s&&e.each(e=>{const t=e.getValue();t.leading||t.trailing||(r.push(n(e)),t.printed=!0)},"comments"),Dc(["{",r.length?[Sc([bc,r]),bc]:"","}"])}case"returnStatement":return i.what?["return"," ",s("what"),";"]:"return;";case"breakStatement":return"break;";case"continueStatement":return"continue;";case"discardStatement":return"discard;";case"selectionStatement":{const e=[],t=kc(i.yes,s("yes"),!1),n=Dc(["if (",Dc([Sc([yc,s("condition")]),yc]),")",t]);if(e.push(n),i.no){const t=i.yes.comments?.some(e=>e.trailing&&e.tokenType===pc.LINE_COMMENT)||i.yes.comments?.findLast(e=>!e.leading&&!e.trailing)?.tokenType===pc.LINE_COMMENT,n="compoundStatement"===i.yes.kind&&!t;e.push(n?" ":bc),e.push("else",Dc(kc(i.no,s("no"),"selectionStatement"===i.no.kind)))}return e}case"forStatement":{const e=kc(i.statement,s("statement"),!1),t=!1,n=t?[t,yc]:"";return"expressionStatement"!==i.initExpression.kind||i.initExpression.expression||i.conditionExpression||i.loopExpression?[n,Dc(["for (",Dc([Sc([yc,s("initExpression"),_c,s("conditionExpression"),";",_c,s("loopExpression")]),yc]),")",e])]:[n,Dc(["for (;;)",e])]}case"whileStatement":{const e=kc(i.statement,s("statement"),!1);return["while (",Dc(s("conditionExpression")),")",e]}case"doWhileStatement":return["do ",s("statement")," while (",Dc(s("conditionExpression")),");"];case"functionCall":return function(t){const r=e.map(n,"args");let i,o;if(void 0===t.callee.arraySpecifier&&cc(t.callee.typeSpecifierNonArray)&&void 0!==(i=function(e){switch(e){case pc.MAT2X2:return[2,2];case pc.MAT2X3:return[2,3];case pc.MAT2X4:return[2,4];case pc.MAT3X2:return[3,2];case pc.MAT3X3:return[3,3];case pc.MAT3X4:return[3,4];case pc.MAT4X2:return[4,2];case pc.MAT4X3:return[4,3];case pc.MAT4X4:return[4,4];default:return}}(t.callee.typeSpecifierNonArray.tokenType))&&i[0]*i[1]===t.args.length){const e=t.args.every(e=>"constantExpression"===e.kind&&(e.const_.tokenType===pc.FLOATCONSTANT||e.const_.tokenType===pc.INTCONSTANT)||"unaryExpression"===e.kind&&(e.op.tokenType===pc.PLUS||e.op.tokenType===pc.DASH)&&"constantExpression"===e.on.kind&&(e.on.const_.tokenType===pc.FLOATCONSTANT||e.on.const_.tokenType===pc.INTCONSTANT));if(e){const e=[],n=[];let s=0,a=0;for(let i=0;i2),".",s("functionCall")];case"postfixExpression":return[Oc(s("on"),Lc(i.on,r)>2),s("op")];case"unaryExpression":return[s("op"),Oc(s("on"),Lc(i.on,r)>3)];case"assignmentExpression":{const n=s("lhs");return Uc(e,t,n," "+i.op.image,s("rhs"),i.rhs)}case"conditionalExpression":return[Oc(s("condition"),Lc(i.condition,r)>=15),Sc([_c,"? ",s("yes"),_c,": ",s("no")])];case"commaExpression":case"binaryExpression":{const t=Ic(e,n,i,r),s=e.getParentNode();if("selectionStatement"===s.kind||"whileStatement"===s.kind||"switchStatement"===s.kind||"doWhileStatement"===s.kind)return t;const o=()=>{const t=e.getParentNode();return!!t&&("functionCall"===t.kind&&"commaExpression"===i.kind||"binaryExpression"===t.kind&&((n=t.op.tokenType)===pc.CARET||n===pc.VERTICAL_BAR||n===pc.AMPERSAND));var n},a=e.getParentNode(1);if("returnStatement"===s.kind||"forStatement"===s.kind||"conditionalExpression"===s.kind&&"returnStatement"!==a.kind&&"functionCall"!==a.kind||"assignmentExpression"===s.kind||"declarator"===s.kind)return Dc(t);{const e=t.slice(0,1),n=t.slice(e.length);return Dc(Oc([...e,Sc(n)],o()))}}case"expressionStatement":return[s("expression"),";"];case"fieldAccess":return[Oc(s("on"),Lc(i.on,r)>2),".",s("field")];case"constantExpression":{const e=i.const_;return e.tokenType===pc.FLOATCONSTANT?function(e){const t=e.indexOf(".");return 0===t&&(e="0"+e),e=e.replace("E","e"),-1!==t&&(e=(e=(e=(e=e.replace(".e","e")).replace(/(?=4):Tc(Ac(_c,e.map(n,"tokens")))])]);return t.inMacro=void 0,Mc(r,t)}case"ppDir":return Mc(Dc(["#",i.dir.image," ",Sc(i.node?s("node"):Tc(Ac(_c,e.map(n,"tokens"))))]),t);case"ppPragma":return i.dir.image.replace(/^#\s+/,"#").replace(/^#pragma\s{2,}/,"#pragma ");case"ppCall":return Dc([i.callee.image,"(",Ac([",",_c],e.map((e,t,n)=>n[t].tokens.map(e=>e.image),"args")),")"]);case"ppInclude":return["#include ",i.what];case"ppExtension":return["#extension ",i.extension.image," : ",i.behavior.image];case"switchStatement":return["switch (",Dc([Sc([yc,s("initExpression")]),yc]),") {",i.cases.length?Sc([bc,Ac(bc,e.map(n,"cases"))]):"",bc,"}"];case"caseBlock":{const r=s("caseLabel"),i=[];return e.each((e,r)=>{const s=e.getValue();i.push(bc),i.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&i.push(bc)},"statements"),[r,Sc(i)]}case"caseLabel":return void 0===i.case_?"default:":["case ",s("case_"),":"];case"layoutQualifier":return["layout(",Ac(", ",i.layoutQualifierIds.map(e=>void 0===e.init?e.IDENTIFIER.image:[e.IDENTIFIER.image," = ",e.init.image])),")"];case"uniformBlock":return[s("typeQualifier")," ",i.blockName.image," {",Sc([bc,Ac(bc,e.map(n,"declarations"))]),bc,"};"];case"typeQualifierDeclaration":return[s("typeQualifier"),";"];default:throw new Error("unexpected n type "+i.kind+"\n"+JSON.stringify(i).substring(0,100))}}catch(e){throw console.error("error printing "+JSON.stringify(i).substring(0,100)+"\n"),e}},embed(e,t){const n=e.getValue();return!cc(n)||n.tokenType!==pc.LINE_COMMENT&&n.tokenType!==pc.MULTILINE_COMMENT?null:(e,t,n,r)=>{}},getVisitorKeys:(e,t)=>cc(e)?[]:Object.keys(e).filter(e=>!t.has(e)),getCommentChildNodes:e=>cc(e)?[]:xc.visit(e),canAttachComment:e=>!0,printComment:function(e,t){const n=e.getValue();return n.tokenType===pc.MULTILINE_COMMENT&&"*"===n.image[2]?"/**\n"+n.image.substring(3,n.image.length-2).split("\n").map(e=>" *"===e?"":e.startsWith(" * ")?e.substring(3):e).join("\n").trim().split("\n").map(e=>""===e?" *":" * "+e).join("\n")+"\n */":n.image},hasPrettierIgnore(e){const t=e.getValue();return(t&&hc(t)&&t.comments?.some(e=>/\/\/\s*prettier-ignore\b.*/.test(e.image)))??!1}}},Gc={parsers:Fc,printers:$c};function Vc(e){return e.replace(/^([^\n]*;)\n(?=(?:[A-Za-z_]\w*\s+)+[A-Za-z_]\w*\s*\()/gm,"$1\n\n").replace(/^}\n(?=\S)/gm,"}\n\n")}var Wc,Hc,jc=(Wc={program:function(e){return jc(e.program)+jc(e.wsEnd)},segment:function(e){return jc(e.blocks)},text:function(e){return jc(e.text)},literal:function(e){return jc(e.wsStart)+jc(e.literal)+jc(e.wsEnd)},identifier:function(e){return jc(e.identifier)+jc(e.wsEnd)},binary:function(e){return jc(e.left)+jc(e.operator)+jc(e.right)},group:function(e){return jc(e.lp)+jc(e.expression)+jc(e.rp)},unary:function(e){return jc(e.operator)+jc(e.expression)},unary_defined:function(e){return jc(e.operator)+jc(e.lp)+jc(e.identifier)+jc(e.rp)},int_constant:function(e){return jc(e.token)+jc(e.wsEnd)},elseif:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},if:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},ifdef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},ifndef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},else:function(e){return jc(e.token)+jc(e.wsEnd)+jc(e.body)},error:function(e){return jc(e.error)+jc(e.message)+jc(e.wsEnd)},undef:function(e){return jc(e.undef)+jc(e.identifier)+jc(e.wsEnd)},define:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.body)+jc(e.wsEnd)},define_arguments:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.lp)+jc(e.args)+jc(e.rp)+jc(e.body)+jc(e.wsEnd)},conditional:function(e){return jc(e.wsStart)+jc(e.ifPart)+jc(e.elseIfParts)+jc(e.elsePart)+jc(e.endif)+jc(e.wsEnd)},version:function(e){return jc(e.version)+jc(e.value)+jc(e.profile)+jc(e.wsEnd)},pragma:function(e){return jc(e.pragma)+jc(e.body)+jc(e.wsEnd)},line:function(e){return jc(e.line)+jc(e.value)+jc(e.wsEnd)},extension:function(e){return jc(e.extension)+jc(e.name)+jc(e.colon)+jc(e.behavior)+jc(e.wsEnd)}},Hc=function(e){return"string"==typeof e?e:null==e?"":Array.isArray(e)?e.map(Hc).join(""):e.type in Wc?Wc[e.type](e):"NO GENERATOR FOR ".concat(e.type)+e});const zc=jc;function Xc(e,t,n,r){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Xc.prototype),i.expected=t,i.found=n,i.location=r,i.name="SyntaxError",i}function Kc(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}function Yc(e,t){var n,r={},i=(t=void 0!==t?t:{}).grammarSource,s={program:An,constant_expression:hr},o=An,a="<<",l=">>",u="<=",c=">=",h="==",d="!=",f="&&",p="||",m="(",g=")",E=",",v="!",C="-",D="~",S="+",A="*",_="/",y="%",b="<",T=">",R="|",x="^",w="&",F=":",N="#",L="define",O="line",I="undef",k="error",M="pragma",P="defined",B="if",U="ifdef",$="ifndef",G="elif",V="else",W="endif",H="version",j="extension",z="0",X="//",K="/*",Y="*/",q=/^[A-Za-z_]/,Q=/^[A-Za-z_0-9]/,Z=/^[uU]/,J=/^[1-9]/,ee=/^[0-7]/,te=/^[xX]/,ne=/^[0-9a-fA-F]/,re=/^[0-9]/,ie=/^[\n\r]/,se=/^[^\n\r]/,oe=/^[ \t]/,ae=gn("<<",!1),le=gn(">>",!1),ue=gn("<=",!1),ce=gn(">=",!1),he=gn("==",!1),de=gn("!=",!1),fe=gn("&&",!1),pe=gn("||",!1),me=gn("(",!1),ge=gn(")",!1),Ee=gn(",",!1),ve=gn("!",!1),Ce=gn("-",!1),De=gn("~",!1),Se=gn("+",!1),Ae=gn("*",!1),_e=gn("/",!1),ye=gn("%",!1),be=gn("<",!1),Te=gn(">",!1),Re=gn("|",!1),xe=gn("^",!1),we=gn("&",!1),Fe=gn(":",!1),Ne=gn("#",!1),Le=gn("define",!1),Oe=(gn("include",!1),gn("line",!1)),Ie=gn("undef",!1),ke=gn("error",!1),Me=gn("pragma",!1),Pe=gn("defined",!1),Be=gn("if",!1),Ue=gn("ifdef",!1),$e=gn("ifndef",!1),Ge=gn("elif",!1),Ve=gn("else",!1),We=gn("endif",!1),He=gn("version",!1),je=gn("extension",!1),ze=En([["A","Z"],["a","z"],"_"],!1,!1),Xe=En([["A","Z"],["a","z"],"_",["0","9"]],!1,!1),Ke=vn("number"),Ye=En(["u","U"],!1,!1),qe=En([["1","9"]],!1,!1),Qe=gn("0",!1),Ze=En([["0","7"]],!1,!1),Je=En(["x","X"],!1,!1),et=En([["0","9"],["a","f"],["A","F"]],!1,!1),tt=En([["0","9"]],!1,!1),nt=vn("control line"),rt=En(["\n","\r"],!1,!1),it=vn("token string"),st=En(["\n","\r"],!0,!1),ot=vn("text"),at=vn("if"),lt=vn("primary expression"),ut=vn("unary expression"),ct=vn("multiplicative expression"),ht=vn("additive expression"),dt=vn("shift expression"),ft=vn("relational expression"),pt=vn("equality expression"),mt=vn("and expression"),gt=vn("exclusive or expression"),Et=vn("inclusive or expression"),vt=vn("logical and expression"),Ct=vn("logical or expression"),Dt=vn("constant expression"),St=vn("whitespace or comment"),At=gn("//",!1),_t=gn("/*",!1),yt=gn("*/",!1),bt={type:"any"},Tt=vn("whitespace"),Rt=En([" ","\t"],!1,!1),xt=function(e,t){return gr("program",{program:e.blocks,wsEnd:t})},wt=function(e,t){return gr("int_constant",{token:e,wsEnd:t})},Ft=function(e,t){return gr("literal",{literal:e,wsEnd:t})},Nt=function(e){return"#"},Lt=function(e,t,n){return gr("literal",{literal:t,wsStart:e,wsEnd:n})},Ot=function(e,t){return gr("identifier",{identifier:e,wsEnd:t})},It=function(e){return gr("identifier",{identifier:e})},kt=function(e){return gr("text",{text:e.join("")})},Mt=function(e){return gr("segment",{blocks:e})},Pt=function(e,t,n,r,i){return[r,...i.flat()]},Bt=function(e,t,n,r,i,s){return gr("define_arguments",{define:e,identifier:t,lp:n,args:r||[],rp:i,body:s})},Ut=function(e,t,n){return gr("define",{define:e,identifier:t,body:n})},$t=function(e,t){return gr("line",{line:e,value:t})},Gt=function(e,t){return gr("undef",{undef:e,identifier:t})},Vt=function(e,t){return gr("error",{error:e,message:t})},Wt=function(e,t){return gr("pragma",{pragma:e,body:t})},Ht=function(e,t,n){return gr("version",{version:e,value:t,profile:n})},jt=function(e,t,n,r){return gr("extension",{extension:e,name:t,colon:n,behavior:r})},zt=function(e,t){return{...e,wsEnd:t}},Xt=function(e,t,n){return{...e,body:n,wsEnd:t}},Kt=function(e,t,n,r,i){return gr("elseif",{token:t,expression:n,wsEnd:r,body:i})},Yt=function(e,t,n,r,i){return gr("else",{token:n,wsEnd:r,body:i})},qt=function(e,t,n,r,i){return gr("conditional",{ifPart:e,elseIfParts:t,elsePart:n,endif:r,wsEnd:i})},Qt=function(e,t){return gr("ifdef",{token:e,identifier:t})},Zt=function(e,t){return gr("ifndef",{token:e,identifier:t})},Jt=function(e,t){return gr("if",{token:e,expression:t})},en=function(e,t,n){return gr("group",{lp:e,expression:t,rp:n})},tn=function(e,t,n,r){return gr("unary_defined",{operator:e,lp:t,identifier:n,rp:r})},nn=function(e,t){return gr("unary",{operator:e,expression:t})},rn=function(e,t){return Cr(e,t)},sn=function(e,t){return vr(e,t)},on=function(e,t,n){return Er(t,n)},an=function(e,t){return Er(e,t.flat())},ln=function(e){return e},un=function(e){return e},cn=0,hn=[{line:1,column:1}],dn=0,fn=[],pn=0,mn={};if("startRule"in t){if(!(t.startRule in s))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=s[t.startRule]}function gn(e,t){return{type:"literal",text:e,ignoreCase:t}}function En(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function vn(e){return{type:"other",description:e}}function Cn(t){var n,r=hn[t];if(r)return r;for(n=t-1;!hn[n];)n--;for(r={line:(r=hn[n]).line,column:r.column};ndn&&(dn=cn,fn=[]),fn.push(e))}function An(){var e,t,n,i=75*cn+0,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Qn())!==r?(n=dr(),e=xt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}function _n(){var t,n,i,s=75*cn+2,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===a?(n=a,cn+=2):(n=r,0===pn&&Sn(ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function yn(){var t,n,i,s=75*cn+3,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===l?(n=l,cn+=2):(n=r,0===pn&&Sn(le)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function bn(){var t,n,i,s=75*cn+4,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===u?(n=u,cn+=2):(n=r,0===pn&&Sn(ue)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Tn(){var t,n,i,s=75*cn+5,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===c?(n=c,cn+=2):(n=r,0===pn&&Sn(ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Rn(){var t,n,i,s=75*cn+6,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===h?(n=h,cn+=2):(n=r,0===pn&&Sn(he)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function xn(){var t,n,i,s=75*cn+7,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===d?(n=d,cn+=2):(n=r,0===pn&&Sn(de)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function wn(){var t,n,i,s=75*cn+8,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===f?(n=f,cn+=2):(n=r,0===pn&&Sn(fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Fn(){var t,n,i,s=75*cn+9,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===p?(n=p,cn+=2):(n=r,0===pn&&Sn(pe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Nn(){var t,n,i,s=75*cn+10,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,40===e.charCodeAt(cn)?(n=m,cn++):(n=r,0===pn&&Sn(me)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Ln(){var t,n,i,s=75*cn+11,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,41===e.charCodeAt(cn)?(n=g,cn++):(n=r,0===pn&&Sn(ge)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function On(){var t,n,i,s=75*cn+12,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,44===e.charCodeAt(cn)?(n=E,cn++):(n=r,0===pn&&Sn(Ee)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function In(){var t,n,i,s=75*cn+14,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,45===e.charCodeAt(cn)?(n=C,cn++):(n=r,0===pn&&Sn(Ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function kn(){var t,n,i,s=75*cn+16,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,43===e.charCodeAt(cn)?(n=S,cn++):(n=r,0===pn&&Sn(Se)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Mn(){var t,n,i,s=75*cn+17,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,42===e.charCodeAt(cn)?(n=A,cn++):(n=r,0===pn&&Sn(Ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Pn(){var t,n,i,s=75*cn+18,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,47===e.charCodeAt(cn)?(n=_,cn++):(n=r,0===pn&&Sn(_e)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Bn(){var t,n,i,s=75*cn+19,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,37===e.charCodeAt(cn)?(n=y,cn++):(n=r,0===pn&&Sn(ye)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Un(){var t,n,i,s=75*cn+20,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,60===e.charCodeAt(cn)?(n=b,cn++):(n=r,0===pn&&Sn(be)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function $n(){var t,n,i,s=75*cn+21,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,62===e.charCodeAt(cn)?(n=T,cn++):(n=r,0===pn&&Sn(Te)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Gn(){var t,n,i,s=75*cn+22,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,124===e.charCodeAt(cn)?(n=R,cn++):(n=r,0===pn&&Sn(Re)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Vn(){var t,n,i,s=75*cn+23,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,94===e.charCodeAt(cn)?(n=x,cn++):(n=r,0===pn&&Sn(xe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Wn(){var t,n,i,s=75*cn+24,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,38===e.charCodeAt(cn)?(n=w,cn++):(n=r,0===pn&&Sn(we)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Hn(){var t,n,i,s=75*cn+26,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,35===e.charCodeAt(cn)?(i=N,cn++):(i=r,0===pn&&Sn(Ne)),(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Nt(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function jn(){var t,n,i,s,o,a,l=75*cn+27,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===L?(a=L,cn+=6):(a=r,0===pn&&Sn(Le)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function zn(){var t,n,i,s,o,a,l=75*cn+37,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===G?(a=G,cn+=4):(a=r,0===pn&&Sn(Ge)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function Xn(){var t,n,i,s,o,a,l=75*cn+42,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Ot(n,i)):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t}function Kn(){var t,n,i,s,o=75*cn+44,a=mn[o];return a?(cn=a.nextPos,a.result):(pn++,t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+46,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,J.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(qe)),i!==r){for(s=[],o=qn();o!==r;)s.push(o),o=qn();n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o=75*cn+47,a=mn[o];if(a)return cn=a.nextPos,a.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r){for(i=[],ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));s!==r;)i.push(s),ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));t=n=[n,i]}else cn=t,t=r;return mn[o]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+48,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r)if(te.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Je)),i!==r){for(s=[],ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));o!==r;)s.push(o),ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));t=n=[n,i,s]}else cn=t,t=r;else cn=t,t=r;return mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),t=n!==r?e.substring(t,cn):n)),pn--,t===r&&(n=r,0===pn&&Sn(Ke)),mn[o]={nextPos:cn,result:t},t)}function Yn(){var t,n=75*cn+45,i=mn[n];return i?(cn=i.nextPos,i.result):(Z.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(Ye)),mn[n]={nextPos:cn,result:t},t)}function qn(){var t,n=75*cn+49,i=mn[n];return i?(cn=i.nextPos,i.result):(re.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(tt)),mn[n]={nextPos:cn,result:t},t)}function Qn(){var e,t,n,i,s,o=75*cn+50,a=mn[o];if(a)return cn=a.nextPos,a.result;if(cn,t=[],(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}if(n!==r){for(;n!==r;)if(t.push(n),(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}}else t=r;return t!==r&&(t=Mt(t)),e=t,mn[o]={nextPos:cn,result:e},e}function Zn(){var t,n,i,s,o,a,l,u,c,h,d,f=75*cn+51,p=mn[f];if(p)return cn=p.nextPos,p.result;if(pn++,t=function(){var t,n,i,s,o,a,l,u,c=75*cn+54,h=mn[c];if(h)return cn=h.nextPos,h.result;if(t=cn,n=cn,i=function(){var t,n,i,s=75*cn+55,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+35,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===U?(a=U,cn+=5):(a=r,0===pn&&Sn(Ue)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Qt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+36,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===$?(a=$,cn+=6):(a=r,0===pn&&Sn($e)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Zt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+34,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,2)===B?(a=B,cn+=2):(a=r,0===pn&&Sn(Be)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r?((i=Jn())===r&&(i=null),t=Jt(n,i)):(cn=t,t=r))),pn--,t===r&&(n=r,0===pn&&Sn(at)),mn[s]={nextPos:cn,result:t},t)}(),i!==r?(ie.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(rt)),s!==r?((o=Qn())===r&&(o=null),n=Xt(i,s,o)):(cn=n,n=r)):(cn=n,n=r),n!==r){for(i=[],s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s=cn,o=function(){var t,n,i,s,o,a,l=75*cn+38,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===V?(a=V,cn+=4):(a=r,0===pn&&Sn(Ve)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a!==r?((l=Qn())===r&&(l=null),s=Yt(n,i,o,a,l)):(cn=s,s=r)):(cn=s,s=r),s===r&&(s=null),o=function(){var t,n,i,s,o,a,l=75*cn+39,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===W?(a=W,cn+=5):(a=r,0===pn&&Sn(We)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a===r&&(a=null),t=qt(n,i,s,o,a)):(cn=t,t=r)}else cn=t,t=r;return mn[c]={nextPos:cn,result:t},t}(),t===r){if(t=cn,n=cn,(i=jn())!==r)if(s=function(){var t,n,i,s,o,a,l=75*cn+43,u=mn[l];if(u)return cn=u.nextPos,u.result;if(cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r&&(n=It(n)),t=n,mn[l]={nextPos:cn,result:t},t}(),s!==r)if((o=Nn())!==r){if(a=cn,(l=Xn())!==r){for(u=[],c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);c!==r;)u.push(c),c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);a=Pt(i,s,o,l,u)}else cn=a,a=r;a===r&&(a=null),(l=Ln())!==r?((u=Jn())===r&&(u=null),n=Bt(i,s,o,a,l,u)):(cn=n,n=r)}else cn=n,n=r;else cn=n,n=r;else cn=n,n=r;if(n===r&&(n=cn,(i=jn())!==r&&(s=Xn())!==r?((o=Jn())===r&&(o=null),n=Ut(i,s,o)):(cn=n,n=r),n===r)){if(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+29,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===O?(a=O,cn+=4):(a=r,0===pn&&Sn(Oe)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r){if(s=cn,o=[],(a=qn())!==r)for(;a!==r;)o.push(a),a=qn();else o=r;(s=o!==r?e.substring(s,cn):o)!==r?n=$t(i,s):(cn=n,n=r)}else cn=n,n=r;n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+30,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===I?(a=I,cn+=5):(a=r,0===pn&&Sn(Ie)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?n=Gt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+31,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===k?(a=k,cn+=5):(a=r,0===pn&&Sn(ke)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Vt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+32,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===M?(a=M,cn+=6):(a=r,0===pn&&Sn(Me)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Wt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+40,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,7)===H?(a=H,cn+=7):(a=r,0===pn&&Sn(He)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Kn())!==r?((o=Jn())===r&&(o=null),n=Ht(i,s,o)):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+41,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,9)===j?(a=j,cn+=9):(a=r,0===pn&&Sn(je)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?(o=function(){var t,n,i,s=75*cn+25,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,58===e.charCodeAt(cn)?(n=F,cn++):(n=r,0===pn&&Sn(Fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),o!==r&&(a=Jn())!==r?n=jt(i,s,o,a):(cn=n,n=r)):(cn=n,n=r))))))}n!==r?(ie.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(rt)),i===r&&(i=null),t=zt(n,i)):(cn=t,t=r)}return pn--,t===r&&(n=r,0===pn&&Sn(nt)),mn[f]={nextPos:cn,result:t},t}function Jn(){var t,n,i,s=75*cn+52,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st)),i!==r)for(;i!==r;)n.push(i),se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(it)),mn[s]={nextPos:cn,result:t},t}function er(){var t,n,i,s,o,a,l=75*cn+53,u=mn[l];if(u)return cn=u.nextPos,u.result;if(pn++,t=cn,n=cn,i=cn,pn++,s=cn,(o=pr())===r&&(o=null),35===e.charCodeAt(cn)?(a=N,cn++):(a=r,0===pn&&Sn(Ne)),a!==r?s=o=[o,a]:(cn=s,s=r),pn--,s===r?i=void 0:(cn=i,i=r),i!==r){if(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st)),o!==r)for(;o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));else s=r;s!==r?(ie.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(rt)),o===r&&(o=null),n=i=[i,s,o]):(cn=n,n=r)}else cn=n,n=r;return n===r&&(ie.test(e.charAt(cn))?(n=e.charAt(cn),cn++):(n=r,0===pn&&Sn(rt))),t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(ot)),mn[l]={nextPos:cn,result:t},t}function tr(){var t,n,i,s,o,a=75*cn+57,l=mn[a];return l?(cn=l.nextPos,l.result):(pn++,t=cn,n=function(){var t,n,i,s,o=75*cn+33,a=mn[o];return a?(cn=a.nextPos,a.result):(t=cn,n=dr(),e.substr(cn,7)===P?(i=P,cn+=7):(i=r,0===pn&&Sn(Pe)),i!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[o]={nextPos:cn,result:t},t)}(),n!==r?((i=Nn())===r&&(i=null),(s=Xn())!==r?((o=Ln())===r&&(o=null),t=tn(n,i,s,o)):(cn=t,t=r)):(cn=t,t=r),t===r&&(t=cn,(n=kn())===r&&(n=In())===r&&(n=function(){var t,n,i,s=75*cn+13,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,33===e.charCodeAt(cn)?(n=v,cn++):(n=r,0===pn&&Sn(ve)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),n===r&&(n=function(){var t,n,i,s=75*cn+15,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,126===e.charCodeAt(cn)?(n=D,cn++):(n=r,0===pn&&Sn(De)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}())),n!==r&&(i=tr())!==r?t=nn(n,i):(cn=t,t=r),t===r&&(t=function(){var e,t,n,i,s=75*cn+56,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,e=function(){var e,t,n,i=75*cn+1,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Kn())!==r?(n=dr(),e=wt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}(),e===r&&(e=cn,(t=Nn())!==r&&(n=hr())!==r&&(i=Ln())!==r?e=en(t,n,i):(cn=e,e=r),e===r&&(e=Xn())),pn--,e===r&&(t=r,0===pn&&Sn(lt)),mn[s]={nextPos:cn,result:e},e)}())),pn--,t===r&&(n=r,0===pn&&Sn(ut)),mn[a]={nextPos:cn,result:t},t)}function nr(){var e,t,n,i,s,o,a=75*cn+58,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=tr())!==r){for(n=[],i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ct)),mn[a]={nextPos:cn,result:e},e}function rr(){var e,t,n,i,s,o,a=75*cn+59,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=nr())!==r){for(n=[],i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ht)),mn[a]={nextPos:cn,result:e},e}function ir(){var e,t,n,i,s,o,a=75*cn+60,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=rr())!==r){for(n=[],i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(dt)),mn[a]={nextPos:cn,result:e},e}function sr(){var e,t,n,i,s,o,a=75*cn+61,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ir())!==r){for(n=[],i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ft)),mn[a]={nextPos:cn,result:e},e}function or(){var e,t,n,i,s,o,a=75*cn+62,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=sr())!==r){for(n=[],i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(pt)),mn[a]={nextPos:cn,result:e},e}function ar(){var e,t,n,i,s,o,a=75*cn+63,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=or())!==r){for(n=[],i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(mt)),mn[a]={nextPos:cn,result:e},e}function lr(){var e,t,n,i,s,o,a=75*cn+64,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ar())!==r){for(n=[],i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(gt)),mn[a]={nextPos:cn,result:e},e}function ur(){var e,t,n,i,s,o,a=75*cn+65,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=lr())!==r){for(n=[],i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Et)),mn[a]={nextPos:cn,result:e},e}function cr(){var e,t,n,i,s,o,a=75*cn+66,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ur())!==r){for(n=[],i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(vt)),mn[a]={nextPos:cn,result:e},e}function hr(){var e,t=75*cn+68,n=mn[t];return n?(cn=n.nextPos,n.result):(pn++,e=function(){var e,t,n,i,s,o,a=75*cn+67,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=cr())!==r){for(n=[],i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Ct)),mn[a]={nextPos:cn,result:e},e}(),pn--,e===r&&0===pn&&Sn(Dt),mn[t]={nextPos:cn,result:e},e)}function dr(){var e,t,n,i,s,o,a=75*cn+69,l=mn[a];if(l)return cn=l.nextPos,l.result;for(pn++,cn,(t=pr())===r&&(t=null),n=[],i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);return e=sn(t,n),pn--,t=r,0===pn&&Sn(St),mn[a]={nextPos:cn,result:e},e}function fr(){var t,n,i,s,o,a,l=75*cn+70,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=function(){var t,n,i,s,o,a=75*cn+71,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,e.substr(cn,2)===X?(i=X,cn+=2):(i=r,0===pn&&Sn(At)),i!==r){for(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),t===r)if(t=cn,n=function(){var t,n,i,s,o,a,l,u=75*cn+72,c=mn[u];if(c)return cn=c.nextPos,c.result;if(t=cn,n=cn,e.substr(cn,2)===K?(i=K,cn+=2):(i=r,0===pn&&Sn(_t)),i!==r){for(s=[],o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);o!==r;)s.push(o),o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);e.substr(cn,2)===Y?(o=Y,cn+=2):(o=r,0===pn&&Sn(yt)),o!==r?n=i=[i,s,o]:(cn=n,n=r)}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[u]={nextPos:cn,result:t},t}(),n!==r){for(i=[],s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);t=an(n,i)}else cn=t,t=r;return mn[l]={nextPos:cn,result:t},t}function pr(){var t,n,i,s=75*cn+73,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt)),i!==r)for(;i!==r;)n.push(i),oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(Tt)),mn[s]={nextPos:cn,result:t},t}function mr(){var t,n,i,s=75*cn+74,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,pn++,Q.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Xe)),pn--,i===r?n=void 0:(cn=n,n=r),n!==r?(i=dr(),t=un(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}e=lh(e);const gr=(e,t)=>({type:e,...t}),Er=(...e)=>e.flat().filter(e=>null!=e&&""!==e&&0!==e.length),vr=(...e)=>{return(t=Er(e.flat())).length>1?t:t[0];var t},Cr=(...e)=>e.flat().reduce((e,[t,n])=>({type:"binary",operator:t,left:e,right:n}));if((n=o())!==r&&cn===e.length)return n;throw n!==r&&cn0){for(t=1,n=1;ts.length)throw new Error("'".concat(t,"': Too many arguments for macro"));if(u.length>":return t(n)>>t(r);case"<":return t(n)":return t(n)>t(r);case"<=":return t(n)<=t(r);case">=":return t(n)>=t(r);case"==":return t(n)==t(r);case"!=":return t(n)!=t(r);case"&":return t(n)&t(r);case"^":return t(n)^t(r);case"|":return t(n)|t(r);case"&&":return t(n)&&t(r);case"||":return t(n)||t(r);default:throw new Error("Preprocessing error: Unknown binary operator ".concat(i))}},unary:function(e,t){switch(e.operator.literal){case"+":return t(e.expression);case"-":return-1*t(e.expression);case"!":return!t(e.expression);case"~":return~t(e.expression);default:throw new Error("Preprocessing error: Unknown unary operator ".concat(e.operator.literal))}}},(r=function(e){var t=n[e.type];if(!t)throw new Error("No evaluate() evaluator for ".concat(e.type));return t(e,r)})(e);var n,r}((n=sh(r,t).trim(),eh(s)(n,{grammarSource:"expression",startRule:"constant_expression"})),t)},lh=function(e,t){return void 0===t&&(t={}),e.replace(/\\[\n\r]/g,"")},uh=function(e,t){void 0===t&&(t={});var n,r,i,s,o=Object.entries(t.defines||{}).reduce(function(e,t){var n,r=t[0],i=t[1];return th(th({},e),((n={})[r]={body:i},n))},{}),a=(void 0===(n=t.preserve)&&(n={}),function(e){var t=null==n?void 0:n[e.node.type];return"function"==typeof t?t(e):t});return r={conditional:{enter:function(e){var t=e,n=t.node;a(t)||(function(e,t){return"if"===t.type?!!t.expression&&oh(ah(t.expression,e)):"ifdef"===t.type?t.identifier.identifier in e:"ifndef"===t.type?!(t.identifier.identifier in e):void 0}(o,n.ifPart)?t.replaceWith(n.ifPart.body):n.elseIfParts.reduce(function(e,n){return e||oh(ah(n.expression,o))&&(t.replaceWith(n.body),!0)},!1)||(n.elsePart?t.replaceWith(n.elsePart.body):t.remove()))}},text:{enter:function(e){var t=e;t.node.text=sh(t.node.text,o)}},define_arguments:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body,s=n.args;o[r]={args:s,body:i},!a(t)&&t.remove()}},define:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body;o[r]={body:i},!a(t)&&t.remove()}},undef:{enter:function(e){var t=e;delete o[t.node.identifier.identifier],!a(t)&&t.remove()}},error:{enter:function(e){var n=e;if(t.stopOnError)throw new Error(n.node.message);!a(n)&&n.remove()}},pragma:{enter:function(e){var t=e;!a(t)&&t.remove()}},version:{enter:function(e){var t=e;!a(t)&&t.remove()}},extension:{enter:function(e){var t=e;!a(t)&&t.remove()}},line:{enter:function(e){var t=e;!a(t)&&t.remove()}}},i=!1,(s=function(e,t,n,o,a){var l;if(!i){var u=r[e.type],c=function(e,t,n,r,i){return{node:e,parent:t,parentPath:n,key:r,index:i,stop:function(){this.stopped=!0},skip:function(){this.skipped=!0},remove:function(){this.removed=!0},replaceWith:function(e){this.replaced=e},findParent:function(e){return n?e(n)?n:n.findParent(e):n}}}(e,t,n,o,a),h=t;if(null==u?void 0:u.enter){if(u.enter(c),c.removed){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));return"number"==typeof a?h[o].splice(a,1):h[o]=null,c}if(c.replaced){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));"number"==typeof a?h[o].splice(a,1,c.replaced):h[o]=c.replaced}if(c.skipped)return c}if(c.stopped)i=!0;else if(c.replaced){var d=c.replaced;s(d,t,n,o,a)}else Object.entries(e).filter(function(e){return e[0],function(e){return function(e){return!!(null==e?void 0:e.type)}(e)||Array.isArray(e)}(e[1])}).forEach(function(t){var n=t[0],r=t[1];if(Array.isArray(r))for(var o=0,a=0;o-a{let e=!0;return n?(i({source:o,formatted:null,error:""}),function(e){return Gs(e,{parser:"glsl-parser",plugins:[Gc],printWidth:80,tabWidth:4,useTabs:!1}).then(Vc)}(o).then(t=>{e&&i({source:o,formatted:t,error:""})}).catch(t=>{if(!e)return;const n=dh(t);a.error("shader formatting failed: "+n),i({source:o,formatted:null,error:n})}),()=>{e=!1}):(i({source:o,formatted:null,error:""}),()=>{e=!1})},[n,o]);const c=n&&r.source===o?r.formatted:null;return{source:c||o,formatted:!!c,preprocessed:u,error:(r.source===o?r.error:"")||l}}(C.source,C.preprocessed,e.beautify),S=D.source,A=C.edited,_=[e.fragment?e.sourceFragmentLog:e.sourceVertexLog,e.programLog].filter(e=>!!e).join("\n"),y=!e.translated&&!D.preprocessed&&!D.formatted,b=function(e,t,n,r){return!(e||t||!n||r)}(t,A,_,y);(0,dt.useLayoutEffect)(()=>{g.current={programId:e.programId,sourceVertex:e.sourceVertex,sourceFragment:e.sourceFragment}},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!d.current)return;if(!f.current){const e=ace.edit(d.current);e.setTheme("ace/theme/monokai"),e.getSession().setMode("ace/mode/glsl"),e.setShowPrintMargin(!1),f.current=e}const t=f.current;t.setReadOnly(!e.editable||e.translated),t.getValue()!==S&&t.setValue(S,-1);const n=()=>{const n=t.getValue();e.fragment?m.current.fragment=n:m.current.vertex=n,v(t=>e.fragment?t.fragment?t:Object.assign(Object.assign({},t),{fragment:!0}):t.vertex?t:Object.assign(Object.assign({},t),{vertex:!0})),function(e,t,n,r){e&&n(!1),t&&r(!1)}(e.beautify,e.preprocessed,c,h),-1!==p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{if(p.current=-1,!function(e,t){return e.programId===t.programId&&e.sourceVertex===t.sourceVertex&&e.sourceFragment===t.sourceFragment}(g.current,e))return;const t={sourceVertex:m.current.vertex,sourceFragment:m.current.fragment,translatedSourceVertex:e.translatedSourceVertex,translatedSourceFragment:e.translatedSourceFragment,programId:e.programId};u(t)},1500)},r=e.editable&&!e.translated;return r&&t.getSession().on("change",n),()=>{r&&t.getSession().off("change",n)}},[S,e.editable,e.translated,e.fragment,e.beautify,e.preprocessed,e.sourceVertex,e.sourceFragment,e.translatedSourceVertex,e.translatedSourceFragment,e.programId,c,h,u]),(0,dt.useEffect)(()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),m.current={baseProgramId:e.programId,baseVertex:e.sourceVertex,baseFragment:e.sourceFragment,vertex:e.sourceVertex,fragment:e.sourceFragment},v({vertex:!1,fragment:!1})},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!f.current)return;const e=t||(y&&!A?_:"");f.current.getSession().setAnnotations(function(e){if(!e)return[];const t=[],n=e.split(/\r?\n/);for(const e of n){const n=e.replace(/\0/g,"").trim();if(!n)continue;let r=/^(error|warning|info)\s*:\s*\d+\s*:\s*(\d+)(?:\s*:\s*(\d+))?\s*:\s*(.*)$/i.exec(n);if(r){t.push(Pt(r[1],r[2],r[3],r[4]));continue}if(r=/^\d+\s*\(\s*(\d+)\s*\)\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[2],r[1],"",r[3]));continue}if(r=/^\d+\s*:\s*(\d+)(?:\s*\(\s*(\d+)\s*\))?\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[3],r[1],r[2],r[4]));continue}const i=/\b(error|warning|info)\b/i.exec(n);t.push({row:0,column:0,text:n,type:i?i[1].toLowerCase():"info"})}return t}(e))},[_,y,t,D.formatted,D.preprocessed,A,e.beautify,e.fragment,e.programLog,e.sourceFragmentLog,e.sourceVertexLog,e.translated]),(0,dt.useEffect)(()=>()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),f.current&&(f.current.destroy(),f.current=null)},[]);const T=(0,dt.useCallback)(e=>{e.preventDefault(),n()},[n]),R=(0,dt.useCallback)(e=>{e.preventDefault(),r()},[r]),x=(0,dt.useCallback)(e=>{e.preventDefault(),null==i||i()},[i]),w=(0,dt.useCallback)(e=>{e.preventDefault(),null==o||o()},[o]),F=(0,dt.useCallback)(e=>{e.preventDefault(),l()},[l]),N=!e.singleShader||!e.fragment,L=!e.singleShader||e.fragment,O=D.error;return(0,mt.jsxs)("div",{className:"sourceCodeComponentContainer",children:[(0,mt.jsx)("div",{className:"sourceCodeMenuComponentContainer",children:(0,mt.jsxs)("ul",{className:"sourceCodeMenuComponent",children:[N&&e.translatedSourceVertex&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:!e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedVertexSourceClicked",onClick:x,children:"Translated Vertex"})}),L&&e.translatedSourceFragment&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedFragmentSourceClicked",onClick:w,children:"Translated Fragment"})}),N&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment||e.translated?"":"active",href:"#",role:"button",commandName:"onVertexSourceClicked",onClick:T,children:"Vertex"})}),L&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&!e.translated?"active":"",href:"#",role:"button",commandName:"onFragmentSourceClicked",onClick:R,children:"Fragment"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onSourceCodeCloseClicked",onClick:F,children:"Close"})})]})}),(0,mt.jsx)("div",{className:"sourceCodeComponent",ref:d}),(0,mt.jsx)(hh,{beautify:e.beautify,capturedDiagnosticsHidden:b,fragment:e.fragment,preprocessed:e.preprocessed,processingError:O,onBeautifyChanged:c,onFragmentSourceClicked:r,onPreprocessChanged:h,onVertexSourceClicked:n})]})}function hh({beautify:e,capturedDiagnosticsHidden:t,fragment:n,preprocessed:r,processingError:i,onBeautifyChanged:s,onFragmentSourceClicked:o,onPreprocessChanged:a,onVertexSourceClicked:l}){const u=(0,dt.useCallback)(e=>{s(e.target.checked)},[s]),c=(0,dt.useCallback)(e=>{a(e.target.checked)},[a]),h=(0,dt.useCallback)(e=>{e.preventDefault(),(n?o:l)(),s(!1),a(!1)},[n,s,o,a,l]);return(0,mt.jsx)("div",{className:"sourceCodeMenuComponentFooter",children:(0,mt.jsxs)("p",{children:[(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onBeautifyChanged",checked:e,onChange:u})," Beautify"]}),(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onPreprocessChanged",checked:r,onChange:c})," Preprocess"]}),i&&(0,mt.jsx)("span",{className:"sourceCodeFormatError",role:"alert",title:i,children:"Shader processing failed"}),t&&(0,mt.jsxs)("span",{className:"sourceCodeDiagnosticsNotice",role:"status",children:["Captured diagnostics hidden."," ",(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onShowCapturedDiagnostics",onClick:h,children:"Show original with diagnostics"})]})]})})}function dh(e){return e instanceof Error?e.message:String(e)}function fh({title:e,children:t}){const n=e?e.replace(/([A-Z])/g," $1").trim():"";return(0,mt.jsxs)("div",{className:"jsonGroupComponent",children:[(0,mt.jsx)("div",{className:"jsonGroupComponentTitle",children:n}),(0,mt.jsx)("ul",{children:t})]})}function ph({itemKey:e,value:t}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsx)("span",{className:"jsonItemComponentValue",children:t})]})}function mh({itemKey:e,value:t,pixelated:n,raw:r}){const i=bt();return(0,mt.jsx)("li",{className:"jsonItemImageHolder",children:(0,mt.jsxs)("div",{className:"jsonItemImage jsonItemImageClickable",children:[(0,mt.jsx)("img",{src:t,style:n?{imageRendering:"pixelated"}:void 0,title:"Open in texture viewer",onClick:()=>i.openTextureViewer({src:t,label:e,pixelated:n,raw:r||null})}),(0,mt.jsx)("span",{children:e})]})})}function gh({itemKey:e,value:t,help:n}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("span",{className:"jsonItemComponentValue",children:[t+" (",(0,mt.jsx)("a",{href:n,target:"_blank",className:"jsonSourceItemComponentOpen",children:"Open help page"}),")"]})]})}function Eh({visualState:e}){const t=bt();return(0,mt.jsxs)("div",{className:"jsonVisualStateItemComponent",children:[e.Attachments?e.Attachments.map((n,r)=>n.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{className:"jsonItemImageClickable",src:encodeURI(n.src),title:"Open in texture viewer",onClick:()=>t.openTextureViewer({src:n.src,label:n.attachmentName||"Attachment",pixelated:!1,raw:n.raw||null})}),e.Attachments.length>1&&(0,mt.jsx)("span",{children:n.attachmentName})]},r):null):(0,mt.jsx)("span",{children:e.FrameBufferStatus}),(0,mt.jsx)("span",{children:e.FrameBuffer?e.FrameBuffer.__SPECTOR_Object_TAG.displayText:"Canvas frame buffer"})]})}function vh({itemKey:e,shader:t,programLog:n,onOpen:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),null==r||r(t,n)},[r,n,t]),s=t.source?t.source.length:0,o=`${t.name||"Shader"} (${s} chars)`;return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("a",{href:"#",role:"button",className:"jsonSourceItemComponentOpen",commandName:"onShaderSourceOpen",onClick:i,children:["Open ",o]})]})}function Ch({items:e,onShaderSourceOpen:t}){return e&&0!==e.length?(0,mt.jsx)(mt.Fragment,{children:e.map((e,n)=>{switch(e.type){case"group":return(0,mt.jsx)(fh,{title:e.title,children:(0,mt.jsx)(Ch,{items:e.children,onShaderSourceOpen:t})},n);case"item":return(0,mt.jsx)(ph,{itemKey:e.key,value:e.value},n);case"image":return(0,mt.jsx)(mh,{itemKey:e.key,value:e.value,pixelated:e.pixelated,raw:e.raw},n);case"help":return(0,mt.jsx)(gh,{itemKey:e.key,value:e.value,help:e.help},n);case"shaderSource":return(0,mt.jsx)(vh,{itemKey:e.key,shader:e.shader,programLog:e.programLog,onOpen:t},n);case"visualState":return(0,mt.jsx)(Eh,{visualState:e.visualState},n);default:return null}})}):null}const Dh={added:"+",removed:"-",changed:"~",unchanged:" "};function Sh(e){const t=void 0===e.indexA?"_":String(e.indexA),n=void 0===e.indexB?"_":String(e.indexB);return e.type+"#"+t+"#"+n}function Ah(e){return!(!e.previousImage&&!e.currentImage)}function _h(){const e=bt(),t=pt(e.store),[n,r]=(0,dt.useState)(null);if((0,dt.useEffect)(()=>{r(null)},[t.compareRows]),!t.canCompare)return(0,mt.jsx)("div",{className:"compareViewComponent",children:(0,mt.jsx)("div",{className:"compareViewEmpty",children:"Capture the same page at least twice, then select a capture to compare it against the previous one."})});const{added:i,removed:s,changed:o,unchanged:a}=t.compareSummary,l=t.compareOnlyDifferences?t.compareRows.filter(e=>"unchanged"!==e.type):t.compareRows,u=l.find(e=>Sh(e)===n)||(l.length>0?l[0]:null),c=u?Sh(u):"";return(0,mt.jsxs)("div",{className:"compareViewComponent",children:[(0,mt.jsxs)("div",{className:"compareViewHeader",children:[(0,mt.jsx)("span",{className:"compareViewLabel",children:t.compareLabel}),(0,mt.jsxs)("span",{className:"compareViewSummary",children:[(0,mt.jsxs)("span",{className:"added",children:["+",i]}),(0,mt.jsxs)("span",{className:"removed",children:["-",s]}),(0,mt.jsxs)("span",{className:"changed",children:["~",o]}),(0,mt.jsxs)("span",{className:"unchanged",children:["=",a]})]}),(0,mt.jsxs)("label",{className:"compareViewToggle",children:[(0,mt.jsx)("input",{type:"checkbox",checked:t.compareOnlyDifferences,onChange:t=>e.handleCompareOnlyDifferencesChange(t.target.checked)}),"Differences only"]})]}),(0,mt.jsxs)("div",{className:"compareViewBody",children:[(0,mt.jsx)(yh,{}),(0,mt.jsx)("ul",{className:"compareViewList",children:0===l.length?(0,mt.jsx)("li",{className:"compareViewEmptyRow",children:"No differences between these two captures."}):l.map(e=>{const t=Sh(e);return(0,mt.jsx)(bh,{row:e,selected:t===c,onSelect:()=>r(t)},t)})}),(0,mt.jsx)("div",{className:"compareViewDetail",children:u?(0,mt.jsx)(Th,{row:u,onSelectCommand:e.handleCompareCommandSelected,onOpenTexture:(t,n)=>e.openTextureViewer({src:t,label:n,pixelated:!1,raw:null})}):(0,mt.jsx)("div",{className:"compareDetailEmpty",children:"Select a call to see its details."})})]})]})}function yh(){return(0,mt.jsxs)("div",{className:"compareViewLegend",children:[(0,mt.jsxs)("div",{className:"compareLegendRow added",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Added"]}),(0,mt.jsxs)("div",{className:"compareLegendRow removed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Removed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow changed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Changed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow unchanged",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Unchanged"]})]})}function bh(e){const{row:t,selected:n,onSelect:r}=e,i="removed"===t.type?t.previousText:t.currentText,s=i&&0===i.indexOf(t.name)?i.slice(t.name.length):"",o="compareRow "+t.type+(n?" selected":"");return(0,mt.jsxs)("li",{className:o,onClick:r,title:i,children:[(0,mt.jsx)("span",{className:"compareSign",children:Dh[t.type]}),(0,mt.jsxs)("span",{className:"compareRowText",children:[(0,mt.jsx)("span",{className:"compareCmdName",children:t.name}),s]})]})}function Th(e){const{row:t,onSelectCommand:n,onOpenTexture:r}=e,i=t.fieldDiffs||[],s=i.filter(e=>!Ah(e)),o=i.filter(Ah),a="changed"===t.type&&t.previousText!==t.currentText,l="removed"===t.type?t.previousText:t.currentText;return(0,mt.jsxs)("div",{className:"compareDetail",children:[(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Command"}),(0,mt.jsxs)("ul",{children:[(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"name"}),":"," ",(0,mt.jsx)("span",{className:"compareCmdName "+t.type,children:t.name})]}),(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"call"}),":"," ",a?(0,mt.jsxs)("span",{className:"compareTextChange",children:[(0,mt.jsx)("span",{className:"compareOld",children:t.previousText}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:t.currentText})]}):(0,mt.jsx)("span",{className:"compareNew",children:l})]}),void 0!==t.commandId&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",className:"compareCommandLink",title:"Show this command in the Commands view",onClick:e=>{e.preventDefault(),n(t.commandId)},children:"Show in Commands view →"})})]})]}),s.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Uniform & state changes"}),(0,mt.jsx)("ul",{children:s.map((e,t)=>(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),":"," ",(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:e.current})]},t))})]}),o.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Texture changes"}),(0,mt.jsx)("ul",{children:o.map((e,t)=>(0,mt.jsxs)("li",{className:"compareTextureItem",children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),(0,mt.jsxs)("div",{className:"compareImageDiff",children:[e.previousImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.previousImage,title:"Open in texture viewer",onClick:()=>r(e.previousImage,e.path+" (previous)")}):(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),e.currentImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.currentImage,title:"Open in texture viewer",onClick:()=>r(e.currentImage,e.path+" (current)")}):(0,mt.jsx)("span",{className:"compareNew",children:e.current})]})]},t))})]})]})}function Rh(e){const t=(255&e).toString(16);return 1===t.length?"0"+t:t}function xh(e,t,n,r){return"#"+Rh(e)+Rh(t)+Rh(n)+Rh(r)}function wh(e,t,n,r){const i=e=>(e/255).toFixed(2);return i(e)+", "+i(t)+", "+i(n)+", "+i(r)}function Fh(){const e=bt(),t=pt(e.store).textureViewer;return t.open?(0,mt.jsx)(Lh,{viewer:t,onClose:e.closeTextureViewer}):null}const Nh=120;function Lh(e){const{viewer:t,onClose:n}=e,r=(0,dt.useRef)(null),i=(0,dt.useRef)(null),s=(0,dt.useRef)(null),o=(0,dt.useRef)(null),[a,l]=(0,dt.useState)({r:!0,g:!0,b:!0,a:!0}),[u,c]=(0,dt.useState)(1),[h,d]=(0,dt.useState)("checker"),[f,p]=(0,dt.useState)(null),[m,g]=(0,dt.useState)(null),[E,v]=(0,dt.useState)(!1);(0,dt.useEffect)(()=>{let e=!1;const n=t=>{e||(o.current=t,p({width:t.width,height:t.height}),c(kh(t.width,t.height)),v(!0))};if(t.raw){const r=function(e){try{if(!e.data||e.width<=0||e.height<=0)return null;const t=function(e){const t=atob(e),n=new Uint8ClampedArray(t.length);for(let e=0;e{e=!0}}const r=new Image;return r.onload=()=>{const e=document.createElement("canvas");e.width=r.naturalWidth||1,e.height=r.naturalHeight||1;const t=e.getContext("2d");if(!t)return;t.drawImage(r,0,0);const i=t.getImageData(0,0,e.width,e.height);n({data:new Uint8ClampedArray(i.data),width:e.width,height:e.height})},r.src=t.src,()=>{e=!0}},[t.src,t.raw]),(0,dt.useEffect)(()=>{const e=o.current,t=r.current;if(!E||!e||!t)return;const n=function(e,t,n){let r=e.current;return r||(r=document.createElement("canvas"),e.current=r),r.width!==t&&(r.width=t),r.height!==n&&(r.height=n),r}(s,e.width,e.height),i=n.getContext("2d"),l=t.getContext("2d");if(!i||!l)return;const c=function(e,t){const n=new Uint8ClampedArray(e.length),r=t.a&&!t.r&&!t.g&&!t.b;for(let i=0;i{const e=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]);const C="textureViewerViewport"+("checker"===h?" checker":""),D="black"===h?{background:"#000"}:"white"===h?{background:"#fff"}:void 0;return(0,mt.jsx)("div",{className:"textureViewerOverlay",onClick:n,children:(0,mt.jsxs)("div",{className:"textureViewerModal",onClick:e=>e.stopPropagation(),children:[(0,mt.jsxs)("div",{className:"textureViewerHeader",children:[(0,mt.jsx)("span",{className:"textureViewerTitle",children:t.label}),(0,mt.jsxs)("span",{className:"textureViewerMeta",children:[f?f.width+" × "+f.height:"",!t.raw&&f?" · thumbnail":""]}),(0,mt.jsx)("span",{className:"textureViewerClose",title:"Close (Esc)",onClick:n,children:"✕"})]}),(0,mt.jsxs)("div",{className:"textureViewerToolbar",children:[(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Channels"}),(0,mt.jsx)(Oh,{channel:"r",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"g",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"b",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"a",mask:a,setMask:l})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"tvBtn",title:"Force alpha = 1 to reveal RGB hidden behind transparency",onClick:()=>l({r:!0,g:!0,b:!0,a:!1}),children:"Opaque"}),(0,mt.jsx)("span",{className:"tvBtn",title:"Show the alpha channel as grayscale",onClick:()=>l({r:!1,g:!1,b:!1,a:!0}),children:"Alpha → gray"})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"BG"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)(Ih,{value:"checker",glyph:"▦",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"black",glyph:"■",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"white",glyph:"□",background:h,setBackground:d})]})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Zoom"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.max(1,e/2)),children:"−"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(f?kh(f.width,f.height):1),children:"Fit"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.min(32,2*e)),children:"+"})]}),(0,mt.jsxs)("span",{className:"zoomVal",children:[Math.round(100*u),"%"]})]}),(0,mt.jsx)("div",{className:"textureViewerGroup textureViewerGroupEnd",children:(0,mt.jsx)("span",{className:"tvBtn primary",onClick:()=>{const e=s.current;e&&e.toBlob(e=>{if(!e)return;const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=((t.label||"texture").replace(/[^a-z0-9_\-]+/gi,"_").replace(/^_+|_+$/g,"")||"texture")+".png",r.click(),setTimeout(()=>URL.revokeObjectURL(n),0)})},children:"⭳ Save PNG"})})]}),(0,mt.jsxs)("div",{className:"textureViewerBody",children:[(0,mt.jsxs)("div",{className:C,style:D,children:[(0,mt.jsx)("canvas",{ref:r,className:"textureViewerCanvas",onMouseMove:e=>{const t=o.current,n=r.current,a=i.current,l=s.current;if(!t||!n)return;const c=n.getBoundingClientRect(),h=Math.floor((e.clientX-c.left)/u),d=Math.floor((e.clientY-c.top)/u);if(h<0||d<0||h>=t.width||d>=t.height)return g(null),void(a&&(a.style.display="none"));const f=4*(d*t.width+h);g({x:h,y:d,r:t.data[f],g:t.data[f+1],b:t.data[f+2],a:t.data[f+3]}),function(e,t,n,r){if(!e||!t)return;const i=e.getContext("2d");if(!i)return;i.imageSmoothingEnabled=!1,i.clearRect(0,0,Nh,Nh),i.drawImage(t,n-7,r-7,15,15,0,0,Nh,Nh),i.strokeStyle="#F0640D",i.lineWidth=2,i.strokeRect(56,56,8,8),e.style.display="block"}(a,l,h,d)},onMouseLeave:()=>{g(null),i.current&&(i.current.style.display="none")}}),(0,mt.jsx)("canvas",{ref:i,className:"textureViewerLoupe",width:Nh,height:Nh})]}),(0,mt.jsxs)("div",{className:"textureViewerRail",children:[(0,mt.jsx)("div",{className:"railTitle",children:"Pixel inspector"}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"position"}),(0,mt.jsx)("span",{className:"v",children:m?m.x+", "+m.y:"—"})]}),(0,mt.jsx)("div",{className:"swatch",children:(0,mt.jsx)("div",{className:"swatchInner",style:m?{background:"rgba("+m.r+","+m.g+","+m.b+","+m.a/255+")"}:void 0})}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"R"}),(0,mt.jsx)("span",{className:"v",children:m?m.r:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"G"}),(0,mt.jsx)("span",{className:"v",children:m?m.g:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"B"}),(0,mt.jsx)("span",{className:"v",children:m?m.b:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"A"}),(0,mt.jsx)("span",{className:"v",children:m?m.a:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"hex"}),(0,mt.jsx)("span",{className:"v",children:m?xh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"norm"}),(0,mt.jsx)("span",{className:"v",children:m?wh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"hint",children:["Move over the texture to sample pixels. Toggle channels to isolate RGB / alpha.",(0,mt.jsx)("b",{children:" Opaque"})," reveals colour hidden behind transparency (#183)."]})]})]})]})})}function Oh(e){const{channel:t,mask:n,setMask:r}=e,i=n[t],s="channel "+t+(i?" on":"");return(0,mt.jsx)("span",{className:s,onClick:()=>r(Object.assign(Object.assign({},n),{[t]:!i})),children:t.toUpperCase()})}function Ih(e){const{value:t,glyph:n,background:r,setBackground:i}=e;return(0,mt.jsx)("span",{className:"tvBtn"+(r===t?" active":""),onClick:()=>i(t),children:n})}function kh(e,t){return Math.max(1,Math.min(16,Math.floor(480/Math.max(e,t))||1))}function Mh(){const e=bt(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"resultViewComponent "+(t.visible?"active":""),children:[(0,mt.jsx)(Tt,{}),(0,mt.jsxs)(Rt,{children:[0===t.menuStatus&&(0,mt.jsx)(wt,{active:!0,captures:t.captures,onCaptureSelected:t=>{e.selectCapture(t),e.handleMenuStatusChange(40)},onSaveRequested:e.handleSaveRequested,onCaptureLoaded:e.handleCaptureLoaded}),40===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(Ft,{children:t.visualStates.map((t,n)=>(0,mt.jsx)(Nt,{item:t,onVisualStateSelected:()=>e.handleVisualStateSelected(n)},n))}),(0,mt.jsx)(Lt,{children:t.commands.map((t,n)=>(0,mt.jsx)(Ot,{command:t,onCommandSelected:()=>e.handleCommandSelected(n),onVertexSelected:()=>e.handleVertexSelected(n),onFragmentSelected:()=>e.handleFragmentSelected(n),onShaderSelected:()=>e.handleShaderSelected(n)},n))}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]}),10===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(kt,{left:!0,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationLeft})})}),(0,mt.jsx)(kt,{left:!1,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationRight})})})]}),20===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.initStateData})}),30===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.endStateData})}),60===t.menuStatus&&(0,mt.jsx)(_h,{}),50===t.menuStatus&&t.sourceCodeState&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(ch,{state:t.sourceCodeState,errorMessage:t.sourceCodeError,onVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!1),onFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!1),onTranslatedVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!0),onTranslatedFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!0),onCloseClicked:e.handleSourceCodeClose,onSourceCodeChanged:e.handleSourceCodeChanged,onBeautifyChanged:e.handleBeautifyChanged,onPreprocessChanged:e.handlePreprocessChanged}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]})]}),(0,mt.jsx)(Fh,{})]})}class Ph{static getMDNLink(e){const t=Ph.WebGL2Functions[e];if(t)return Ph.WebGL2RootUrl+t;const n=Ph.WebGLFunctions[e];if(n)return Ph.WebGLRootUrl+n;const r=Ph.AngleInstancedArraysExtFunctions[e];return r?Ph.AngleInstancedArraysExtRootUrl+r:Ph.WebGLRootUrl+e}}Ph.WebGL2RootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/",Ph.WebGLRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/",Ph.AngleInstancedArraysExtRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/",Ph.WebGL2Functions={beginQuery:"beginQuery",beginTransformFeedback:"beginTransformFeedback",bindBufferBase:"bindBufferBase",bindBufferRange:"bindBufferRange",bindSampler:"bindSampler",bindTransformFeedback:"bindTransformFeedback",bindVertexArray:"bindVertexArray",blitFramebuffer:"blitFramebuffer",clearBufferfv:"clearBuffer",clearBufferiv:"clearBuffer",clearBufferuiv:"clearBuffer",clearBufferfi:"clearBuffer",clientWaitSync:"clientWaitSync",compressedTexImage3D:"compressedTexImage3D",compressedTexSubImage3D:"compressedTexSubImage3D",copyBufferSubData:"copyBufferSubData",copyTexSubImage3D:"copyTexSubImage3D",createQuery:"createQuery",createSampler:"createSampler",createTransformFeedback:"createTransformFeedback",createVertexArray:"createVertexArray",deleteQuery:"deleteQuery",deleteSampler:"deleteSampler",deleteSync:"deleteSync",deleteTransformFeedback:"deleteTransformFeedback",deleteVertexArray:"deleteVertexArray",drawArraysInstanced:"drawArraysInstanced",drawBuffers:"drawBuffers",drawElementsInstanced:"drawElementsInstanced",drawRangeElements:"drawRangeElements",endQuery:"endQuery",endTransformFeedback:"endTransformFeedback",fenceSync:"fenceSync",framebufferTextureLayer:"framebufferTextureLayer",getActiveUniformBlockName:"getActiveUniformBlockName",getActiveUniformBlockParameter:"getActiveUniformBlockParameter",getActiveUniforms:"getActiveUniforms",getBufferSubData:"getBufferSubData",getFragDataLocation:"getFragDataLocation",getIndexedParameter:"getIndexedParameter",getInternalformatParameter:"getInternalformatParameter",getQuery:"getQuery",getQueryParameter:"getQueryParameter",getSamplerParameter:"getSamplerParameter",getSyncParameter:"getSyncParameter",getTransformFeedbackVarying:"getTransformFeedbackVarying",getUniformBlockIndex:"getUniformBlockIndex",getUniformIndices:"getUniformIndices",invalidateFramebuffer:"invalidateFramebuffer",invalidateSubFramebuffer:"invalidateSubFramebuffer",isQuery:"isQuery",isSampler:"isSampler",isSync:"isSync",isTransformFeedback:"isTransformFeedback",isVertexArray:"isVertexArray",pauseTransformFeedback:"pauseTransformFeedback",readBuffer:"readBuffer",renderbufferStorageMultisample:"renderbufferStorageMultisample",resumeTransformFeedback:"resumeTransformFeedback",samplerParameteri:"samplerParameter",samplerParameterf:"samplerParameter",texImage3D:"texImage3D",texStorage2D:"texStorage2D",texStorage3D:"texStorage3D",texSubImage3D:"texSubImage3D",transformFeedbackVaryings:"transformFeedbackVaryings",uniform1ui:"uniform",uniform2ui:"uniform",uniform3ui:"uniform",uniform4ui:"uniform",uniform1fv:"uniform",uniform2fv:"uniform",uniform3fv:"uniform",uniform4fv:"uniform",uniform1iv:"uniform",uniform2iv:"uniform",uniform3iv:"uniform",uniform4iv:"uniform",uniform1uiv:"uniform",uniform2uiv:"uniform",uniform3uiv:"uniform",uniform4uiv:"uniform",uniformBlockBinding:"uniformBlockBinding",uniformMatrix2fv:"uniformMatrix",uniformMatrix3x2fv:"uniformMatrix",uniformMatrix4x2fv:"uniformMatrix",uniformMatrix2x3fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4x3fv:"uniformMatrix",uniformMatrix2x4fv:"uniformMatrix",uniformMatrix3x4fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttribDivisor:"vertexAttribDivisor",vertexAttribI4i:"vertexAttribI",vertexAttribI4ui:"vertexAttribI",vertexAttribI4iv:"vertexAttribI",vertexAttribI4uiv:"vertexAttribI",vertexAttribIPointer:"vertexAttribIPointer",waitSync:"waitSync"},Ph.WebGLFunctions={uniform1f:"uniform",uniform1fv:"uniform",uniform1i:"uniform",uniform1iv:"uniform",uniform2f:"uniform",uniform2fv:"uniform",uniform2i:"uniform",uniform2iv:"uniform",uniform3f:"uniform",uniform3i:"uniform",uniform3iv:"uniform",uniform4f:"uniform",uniform4fv:"uniform",uniform4i:"uniform",uniform4iv:"uniform",uniformMatrix2fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttrib1f:"vertexAttrib",vertexAttrib2f:"vertexAttrib",vertexAttrib3f:"vertexAttrib",vertexAttrib4f:"vertexAttrib",vertexAttrib1fv:"vertexAttrib",vertexAttrib2fv:"vertexAttrib",vertexAttrib3fv:"vertexAttrib",vertexAttrib4fv:"vertexAttrib"},Ph.AngleInstancedArraysExtFunctions={drawArraysInstancedANGLE:"drawArraysInstancedANGLE",drawElementsInstancedANGLE:"drawElementsInstancedANGLE",vertexAttribDivisorANGLE:"vertexAttribDivisorANGLE"};const Bh={activeTexture:[["texture"]],attachShader:[["program","shader"]],beginQuery:[["target","query"]],beginTransformFeedback:[["primitiveMode"]],bindAttribLocation:[["program","index","name"]],bindBuffer:[["target","buffer"]],bindBufferBase:[["target","index","buffer"]],bindBufferRange:[["target","index","buffer","offset","size"]],bindFramebuffer:[["target","framebuffer"]],bindRenderbuffer:[["target","renderbuffer"]],bindSampler:[["unit","sampler"]],bindTexture:[["target","texture"]],bindTransformFeedback:[["target","tf"]],bindVertexArray:[["array"]],blendColor:[["red","green","blue","alpha"]],blendEquation:[["mode"]],blendEquationSeparate:[["modeRGB","modeAlpha"]],blendFunc:[["sfactor","dfactor"]],blendFuncSeparate:[["srcRGB","dstRGB","srcAlpha","dstAlpha"]],blitFramebuffer:[["srcX0","srcY0","srcX1","srcY1","dstX0","dstY0","dstX1","dstY1","mask","filter"]],bufferData:[["target","data","usage"],["target","size","usage"],["target","srcData","usage"],["target","srcData","usage","srcOffset","length"]],bufferSubData:[["target","dstByteOffset","srcData"],["target","offset","data"],["target","dstByteOffset","srcData","srcOffset","length"]],checkFramebufferStatus:[["target"]],clear:[["mask"]],clearBufferfi:[["buffer","drawbuffer","depth","stencil"]],clearBufferfv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferiv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferuiv:[["buffer","drawbuffer","values","srcOffset"]],clearColor:[["red","green","blue","alpha"]],clearDepth:[["depth"]],clearStencil:[["s"]],clientWaitSync:[["sync","flags","timeout"]],colorMask:[["red","green","blue","alpha"]],compileShader:[["shader"]],compressedTexImage2D:[["target","level","internalformat","width","height","border","data"],["target","level","internalformat","width","height","border","imageSize","offset"],["target","level","internalformat","width","height","border","srcData","srcOffset","srcLengthOverride"]],compressedTexImage3D:[["target","level","internalformat","width","height","depth","border","imageSize","offset"],["target","level","internalformat","width","height","depth","border","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage2D:[["target","level","xoffset","yoffset","width","height","format","data"],["target","level","xoffset","yoffset","width","height","format","imageSize","offset"],["target","level","xoffset","yoffset","width","height","format","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","imageSize","offset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","srcData","srcOffset","srcLengthOverride"]],copyBufferSubData:[["readTarget","writeTarget","readOffset","writeOffset","size"]],copyTexImage2D:[["target","level","internalformat","x","y","width","height","border"]],copyTexSubImage2D:[["target","level","xoffset","yoffset","x","y","width","height"]],copyTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","x","y","width","height"]],createBuffer:[[]],createFramebuffer:[[]],createProgram:[[]],createQuery:[[]],createRenderbuffer:[[]],createSampler:[[]],createShader:[["type"]],createTexture:[[]],createTransformFeedback:[[]],createVertexArray:[[]],cullFace:[["mode"]],deleteBuffer:[["buffer"]],deleteFramebuffer:[["framebuffer"]],deleteProgram:[["program"]],deleteQuery:[["query"]],deleteRenderbuffer:[["renderbuffer"]],deleteSampler:[["sampler"]],deleteShader:[["shader"]],deleteSync:[["sync"]],deleteTexture:[["texture"]],deleteTransformFeedback:[["tf"]],deleteVertexArray:[["vertexArray"]],depthFunc:[["func"]],depthMask:[["flag"]],depthRange:[["zNear","zFar"]],detachShader:[["program","shader"]],disable:[["cap"]],disableVertexAttribArray:[["index"]],drawArrays:[["mode","first","count"]],drawArraysInstanced:[["mode","first","count","instanceCount"]],drawBuffers:[["buffers"]],drawElements:[["mode","count","type","offset"]],drawElementsInstanced:[["mode","count","type","offset","instanceCount"]],drawRangeElements:[["mode","start","end","count","type","offset"]],enable:[["cap"]],enableVertexAttribArray:[["index"]],endQuery:[["target"]],endTransformFeedback:[[]],fenceSync:[["condition","flags"]],finish:[[]],flush:[[]],framebufferRenderbuffer:[["target","attachment","renderbuffertarget","renderbuffer"]],framebufferTexture2D:[["target","attachment","textarget","texture","level"]],framebufferTextureLayer:[["target","attachment","texture","level","layer"]],frontFace:[["mode"]],generateMipmap:[["target"]],getActiveAttrib:[["program","index"]],getActiveUniform:[["program","index"]],getActiveUniformBlockName:[["program","uniformBlockIndex"]],getActiveUniformBlockParameter:[["program","uniformBlockIndex","pname"]],getActiveUniforms:[["program","uniformIndices","pname"]],getAttachedShaders:[["program"]],getAttribLocation:[["program","name"]],getBufferParameter:[["target","pname"]],getBufferSubData:[["target","srcByteOffset","dstBuffer","dstOffset","length"]],getContextAttributes:[[]],getError:[[]],getExtension:[["extensionName"],["name"]],getFragDataLocation:[["program","name"]],getFramebufferAttachmentParameter:[["target","attachment","pname"]],getIndexedParameter:[["target","index"]],getInternalformatParameter:[["target","internalformat","pname"]],getParameter:[["pname"]],getProgramInfoLog:[["program"]],getProgramParameter:[["program","pname"]],getQuery:[["target","pname"]],getQueryParameter:[["query","pname"]],getRenderbufferParameter:[["target","pname"]],getSamplerParameter:[["sampler","pname"]],getShaderInfoLog:[["shader"]],getShaderParameter:[["shader","pname"]],getShaderPrecisionFormat:[["shadertype","precisiontype"]],getShaderSource:[["shader"]],getSupportedExtensions:[[]],getSyncParameter:[["sync","pname"]],getTexParameter:[["target","pname"]],getTransformFeedbackVarying:[["program","index"]],getUniform:[["program","location"]],getUniformBlockIndex:[["program","uniformBlockName"]],getUniformIndices:[["program","uniformNames"]],getUniformLocation:[["program","name"]],getVertexAttrib:[["index","pname"]],getVertexAttribOffset:[["index","pname"]],hint:[["target","mode"]],invalidateFramebuffer:[["target","attachments"]],invalidateSubFramebuffer:[["target","attachments","x","y","width","height"]],isBuffer:[["buffer"]],isContextLost:[[]],isEnabled:[["cap"]],isFramebuffer:[["framebuffer"]],isProgram:[["program"]],isQuery:[["query"]],isRenderbuffer:[["renderbuffer"]],isSampler:[["sampler"]],isShader:[["shader"]],isSync:[["sync"]],isTexture:[["texture"]],isTransformFeedback:[["tf"]],isVertexArray:[["vertexArray"]],lineWidth:[["width"]],linkProgram:[["program"]],pauseTransformFeedback:[[]],pixelStorei:[["pname","param"]],polygonOffset:[["factor","units"]],readBuffer:[["src"]],readPixels:[["x","y","width","height","format","type","dstData"],["x","y","width","height","format","type","offset"],["x","y","width","height","format","type","pixels"],["x","y","width","height","format","type","dstData","dstOffset"]],renderbufferStorage:[["target","internalformat","width","height"]],renderbufferStorageMultisample:[["target","samples","internalformat","width","height"]],resumeTransformFeedback:[[]],sampleCoverage:[["value","invert"]],samplerParameterf:[["sampler","pname","param"]],samplerParameteri:[["sampler","pname","param"]],scissor:[["x","y","width","height"]],shaderSource:[["shader","source"]],stencilFunc:[["func","ref","mask"]],stencilFuncSeparate:[["face","func","ref","mask"]],stencilMask:[["mask"]],stencilMaskSeparate:[["face","mask"]],stencilOp:[["fail","zfail","zpass"]],stencilOpSeparate:[["face","fail","zfail","zpass"]],texImage2D:[["target","level","internalformat","format","type","source"],["target","level","internalformat","width","height","border","format","type","pboOffset"],["target","level","internalformat","width","height","border","format","type","pixels"],["target","level","internalformat","width","height","border","format","type","source"],["target","level","internalformat","width","height","border","format","type","srcData","srcOffset"]],texImage3D:[["target","level","internalformat","width","height","depth","border","format","type","pboOffset"],["target","level","internalformat","width","height","depth","border","format","type","source"],["target","level","internalformat","width","height","depth","border","format","type","srcData"],["target","level","internalformat","width","height","depth","border","format","type","srcData","srcOffset"]],texParameterf:[["target","pname","param"]],texParameteri:[["target","pname","param"]],texStorage2D:[["target","levels","internalformat","width","height"]],texStorage3D:[["target","levels","internalformat","width","height","depth"]],texSubImage2D:[["target","level","xoffset","yoffset","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","pboOffset"],["target","level","xoffset","yoffset","width","height","format","type","pixels"],["target","level","xoffset","yoffset","width","height","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","srcData","srcOffset"]],texSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","pboOffset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","source"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","srcData","srcOffset"]],transformFeedbackVaryings:[["program","varyings","bufferMode"]],uniform1f:[["location","x"]],uniform1fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1i:[["location","x"]],uniform1iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1ui:[["location","v0"]],uniform1uiv:[["location","data","srcOffset","srcLength"]],uniform2f:[["location","x","y"]],uniform2fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2i:[["location","x","y"]],uniform2iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2ui:[["location","v0","v1"]],uniform2uiv:[["location","data","srcOffset","srcLength"]],uniform3f:[["location","x","y","z"]],uniform3fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3i:[["location","x","y","z"]],uniform3iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3ui:[["location","v0","v1","v2"]],uniform3uiv:[["location","data","srcOffset","srcLength"]],uniform4f:[["location","x","y","z","w"]],uniform4fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4i:[["location","x","y","z","w"]],uniform4iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4ui:[["location","v0","v1","v2","v3"]],uniform4uiv:[["location","data","srcOffset","srcLength"]],uniformBlockBinding:[["program","uniformBlockIndex","uniformBlockBinding"]],uniformMatrix2fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x3fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x3fv:[["location","transpose","data","srcOffset","srcLength"]],useProgram:[["program"]],validateProgram:[["program"]],vertexAttrib1f:[["index","x"]],vertexAttrib1fv:[["index","values"]],vertexAttrib2f:[["index","x","y"]],vertexAttrib2fv:[["index","values"]],vertexAttrib3f:[["index","x","y","z"]],vertexAttrib3fv:[["index","values"]],vertexAttrib4f:[["index","x","y","z","w"]],vertexAttrib4fv:[["index","values"]],vertexAttribDivisor:[["index","divisor"]],vertexAttribI4i:[["index","x","y","z","w"]],vertexAttribI4iv:[["index","values"]],vertexAttribI4ui:[["index","x","y","z","w"]],vertexAttribI4uiv:[["index","values"]],vertexAttribIPointer:[["index","size","type","stride","offset"]],vertexAttribPointer:[["index","size","type","normalized","stride","offset"]],viewport:[["x","y","width","height"]],waitSync:[["sync","flags","timeout"]]};class Uh{static getNames(e,t){const n=Bh[e];if(!n||0===n.length)return null;for(const e of n)if(e.length===t)return e;let r=null;for(const e of n)e.length>=t&&(null===r||e.lengthi.length&&(i=e);return i}static getName(e,t,n){const r=Uh.getNames(e,n);return r&&t>=0&&t{const e={};for(let t=0;t<64;t++)e["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;return e})();class qh{constructor(e){this.sources=e.sources||[],this.names=e.names||[],this.sourceRoot=e.sourceRoot||"",this.lines=qh.parseMappings(e.mappings||"")}originalPositionFor(e,t){const n={source:null,line:null,column:null,name:null},r=e-1;if(r<0||r>=this.lines.length)return n;const i=this.lines[r];if(!i||0===i.length)return n;const s=this.findSegment(i,t);if(!s)return n;const o=s.sourceIndex>=0&&s.sourceIndex=0&&s.nameIndex>1,o=e[s];o.generatedColumn<=t?(i=o,n=s+1):r=s-1}return i}static parseMappings(e){const t=[];let n=0,r=0,i=0,s=0;const o=e.split(";");for(let e=0;e0){const e=a.split(",");for(let t=0;t=4&&(n+=o[1],r+=o[2],i+=o[3],a.sourceIndex=n,a.originalLine=r,a.originalColumn=i,o.length>=5&&(s+=o[4],a.nameIndex=s)),l.push(a)}}l.sort((e,t)=>e.generatedColumn-t.generatedColumn),t.push(l)}return t}static decodeSegment(e){const t=[];let n=0;for(;n>>=1,t.push(o?-r:r)}return t}}var Qh=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})};class Zh{constructor(e){this.cache=new Map,this.inflight=new Map,this.fetchFn=e||("undefined"!=typeof fetch?fetch.bind(globalThis):void 0)}resolveFrames(e){return Qh(this,void 0,void 0,function*(){return e&&0!==e.length?Promise.all(e.map(e=>this.resolveFrame(e))):e||[]})}resolveFrame(e){return Qh(this,void 0,void 0,function*(){const t=Zh.parseFrame(e);if(!t)return e;let n;try{n=yield this.getConsumer(t.url)}catch(t){return e}if(!n)return e;const r=n.originalPositionFor(t.line,t.column);return r.source&&null!==r.line?Zh.formatFrame(t.functionName,r.name,r.source,r.line,r.column||0):e})}static parseFrame(e){if(!e)return null;let t=e.match(/^(.*?)\s*\((.+):(\d+):(\d+)\)\s*$/);return t?{functionName:t[1].trim(),url:t[2],line:parseInt(t[3],10),column:parseInt(t[4],10)}:(t=e.match(/^\s*(.+):(\d+):(\d+)\s*$/),t?{functionName:"",url:t[1].trim(),line:parseInt(t[2],10),column:parseInt(t[3],10)}:null)}static formatFrame(e,t,n,r,i){const s=t||e,o=n+":"+r+":"+i;return s?s+" ("+o+")":o}getConsumer(e){return Qh(this,void 0,void 0,function*(){if(this.cache.has(e))return this.cache.get(e);const t=this.inflight.get(e);if(t)return t;const n=this.loadConsumer(e).then(t=>(this.cache.set(e,t),this.inflight.delete(e),t)).catch(()=>(this.cache.set(e,null),this.inflight.delete(e),null));return this.inflight.set(e,n),n})}loadConsumer(e){return Qh(this,void 0,void 0,function*(){if(!this.fetchFn)return null;const t=yield this.fetchFn(e);if(!t.ok)return null;const n=yield t.text(),r=Zh.extractSourceMappingURL(n);if(!r)return null;let i;if(0===r.indexOf("data:"))i=Zh.parseDataUri(r);else{const t=Zh.resolveUrl(r,e),n=yield this.fetchFn(t);if(!n.ok)return null;i=yield n.json()}return i&&"string"==typeof i.mappings?new qh(i):null})}static extractSourceMappingURL(e){const t=/\/\/[#@]\s*sourceMappingURL=(\S+)\s*$/gm;let n,r=null;for(;null!==(n=t.exec(e));)r=n[1];return r}static parseDataUri(e){const t=e.indexOf(",");if(-1===t)return null;const n=e.substring(0,t),r=e.substring(t+1);try{const e=/;base64/i.test(n)?Zh.decodeBase64(r):decodeURIComponent(r);return JSON.parse(e)}catch(e){return null}}static decodeBase64(e){if("function"==typeof atob)return atob(e);const t=globalThis.Buffer;if(t)return t.from(e,"base64").toString("utf-8");throw new Error("No base64 decoder available.")}static resolveUrl(e,t){try{return new URL(e,t).href}catch(t){return e}}}function Jh(e){return e&&(e.text||e.name)||""}function ed(e,t){const n=[];if(!e||!t)return n;const r=e.DrawCall,i=t.DrawCall;ad("uniform",r&&r.uniforms,i&&i.uniforms,n),ad("uniformBlock",r&&r.uniformBlocks,i&&i.uniformBlocks,n);const s=sd(e,t);for(const r of s){if(td[r])continue;const i=e[r],s=t[r];(rd(i)||rd(s))&&od(i,s,r,n)}return n}const td={id:!0,name:!0,commandArguments:!0,result:!0,status:!0,marker:!0,text:!0,startTime:!0,commandEndTime:!0,endTime:!0,stackTrace:!0,consumeCommandId:!0,VisualState:!0},nd={__SPECTOR_Object_TAG:!0,__SPECTOR_Object_CustomData:!0,__SPECTOR_Metadata:!0,customData:!0,visual:!0,visualPixels:!0,VisualState:!0,texture:!0,sampler:!0,location:!0,source:!0,translatedSource:!0,analyserName:!0,uniforms:!0,uniformBlocks:!0,length:!0};function rd(e){return null!==e&&"object"==typeof e}function id(e){if(!rd(e))return null;const t=e.__SPECTOR_Object_TAG||("string"==typeof e.typeName&&"id"in e?e:null);return t&&"string"==typeof t.typeName?t.typeName:null}function sd(e,t){const n=[],r={},i=e=>{if(rd(e))for(const t in e)e.hasOwnProperty(t)&&!r[t]&&(r[t]=!0,n.push(t))};return i(e),i(t),n}function od(e,t,n,r,i=0){const s=id(e),o=id(t);if(null!==s||null!==o){const e=null!==s?s:"(absent)",t=null!==o?o:"(absent)";return void(e!==t&&r.push({path:n,previous:e,current:t}))}const a=rd(e),l=rd(t);if(!a&&!l){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}if(a!==l||i>=8){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}for(const s of sd(e,t))nd[s]||od(e?e[s]:void 0,t?t[s]:void 0,n+"."+s,r,i+1)}function ad(e,t,n,r){const i=hd(t),s=hd(n),o=[],a={};for(const e in i)i.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const e in s)s.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const t of o){const n=i.hasOwnProperty(t)?i[t]:void 0,o=s.hasOwnProperty(t)?s[t]:void 0,a=n?dd(n.value):"(absent)",l=o?dd(o.value):"(absent)";a!==l&&r.push({path:e+" "+t,previous:a,current:l}),ld(e+" "+t,n,o,r)}}function ld(e,t,n,r){const i=t&&t.texture,s=n&&n.texture;(rd(i)||rd(s))&&cd(e+" texture",i,s,r);const o=t&&t.textures,a=n&&n.textures,l=Array.isArray(o)?o.length:0,u=Array.isArray(a)?a.length:0,c=Math.max(l,u);for(let t=0;t0?o[t]:void 0,u>0?a[t]:void 0,r)}const ud=["width","height","depth","format","internalFormat","textureType"];function cd(e,t,n,r){(rd(t)||rd(n))&&(function(e,t,n,r){for(const i of ud){const s=t?t[i]:void 0,o=n?n[i]:void 0;if(void 0===s&&void 0===o)continue;const a=dd(s),l=dd(o);a!==l&&r.push({path:e+" "+i,previous:a,current:l})}}(e,t,n,r),function(e,t,n,r){if(rd(t)||rd(n))for(const i of sd(t,n)){const s=t?t[i]:void 0,o=n?n[i]:void 0,a="string"==typeof s,l="string"==typeof o;(a||l)&&s!==o&&r.push({path:e+" ("+i+")",previous:a?"(image)":"(absent)",current:l?"(image)":"(absent)",previousImage:a?s:void 0,currentImage:l?o:void 0})}}(e,t&&t.visual,n&&n.visual,r))}function hd(e){const t={};if(Array.isArray(e))for(const n of e)n&&"string"==typeof n.name&&(t[n.name]=n);return t}function dd(e){if(void 0===e)return"(absent)";if(null===e)return"null";try{return JSON.stringify(e)}catch(t){return String(e)}}function fd(e,t){for(let n=0;n{if(this.store.getSnapshot().currentCapture)switch(e){case 0:this._displayCaptures();break;case 40:this._displayCurrentCapture();break;case 10:this._displayInformation();break;case 20:this._displayInitState();break;case 30:this._displayEndState();break;case 60:this._displayCompare()}else this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))},this.handleSearchTextChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{searchText:e})),this._search(e)},this.handleCompareOnlyDifferencesChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{compareOnlyDifferences:e}))},this.handleCompareCommandSelected=e=>{null!=e&&(this._currentCommandId=e,this._displayCurrentCapture())},this.handleCommandSelected=e=>{this.selectCommand(e)},this.openTextureViewer=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{textureViewer:{open:!0,src:e.src,label:e.label,pixelated:e.pixelated,raw:e.raw||null}}))},this.closeTextureViewer=()=>{this.store.setState(e=>Object.assign(Object.assign({},e),{textureViewer:Object.assign(Object.assign({},e.textureViewer),{open:!1})}))},this.handleVisualStateSelected=e=>{this.selectVisualState(e)},this.handleVertexSelected=e=>{this.selectCommand(e),this._openShader(!1)},this.handleFragmentSelected=e=>{this.selectCommand(e),this._openShader(!0)},this.handleShaderSelected=e=>{var t;const n=null===(t=this.store.getSnapshot().commands[e])||void 0===t?void 0:t.capture.shader;n&&(this.selectCommand(e),this._openCapturedShader(n))},this.handleShaderSourceOpen=(e,t)=>{this._openCapturedShader(e,t)},this.handleSourceCodeChanged=e=>{this.onSourceCodeChanged.trigger(e)},this.handleSourceCodeClose=()=>{this._displayCurrentCapture()},this.handleSourceCodeTabChange=(e,t)=>{this.store.setState(n=>n.sourceCodeState?Object.assign(Object.assign({},n),{sourceCodeState:Object.assign(Object.assign({},n.sourceCodeState),{fragment:e,translated:t})}):n)},this.handleBeautifyChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{beautify:e})}):t)},this.handlePreprocessChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{preprocessed:e})}):t)},this.handleSaveRequested=e=>{this.saveCapture(e)},this.handleCaptureLoaded=e=>{this.addCapture(e)},this.handleClose=()=>{this.hide()},this._rootPlaceHolder=e||document.body,this.onSourceCodeChanged=new l,this.store=new ft(Object.assign({},pd)),this._container=document.createElement("div"),this._container.className="spector-react-result-view",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(yt.Provider,{value:this},(0,dt.createElement)(Mh))),this._rootPlaceHolder.addEventListener("keydown",e=>{if(40!==this.store.getSnapshot().menuStatus)return;const t=e.keyCode;38===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousCommand()):40===t?(e.preventDefault(),e.stopPropagation(),this._selectNextCommand()):33===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousVisualState()):34===t&&(e.preventDefault(),e.stopPropagation(),this._selectNextVisualState())})}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}addCapture(e){return this.store.setState(t=>{const n=t.captures.map(e=>({capture:e.capture,active:!1}));return Object.assign(Object.assign({},t),{captures:[{capture:e,active:!0},...n],currentCapture:e})}),this._currentCommandId=-1,this._displayCurrentCapture(),0}selectCapture(e){this._currentCommandId=-1,this.store.setState(t=>{var n,r;const i=t.captures.map((t,n)=>({capture:t.capture,active:n===e}));return Object.assign(Object.assign({},t),{captures:i,currentCapture:null!==(r=null===(n=i[e])||void 0===n?void 0:n.capture)&&void 0!==r?r:null})}),this._displayCurrentCapture()}selectCommand(e){const t=this.store.getSnapshot();if(e<0||e>=t.commands.length)return;const n=t.commands[e];this._currentCommandId=n.capture.id;const r=n.visualStateIndex,i=this._buildCommandDetail(e,t.commands,t.visualStates);this.store.setState(t=>Object.assign(Object.assign({},t),{commands:t.commands.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentCommandIndex:e,visualStates:t.visualStates.map((e,t)=>e.active!==(t===r)?Object.assign(Object.assign({},e),{active:t===r}):e),currentVisualStateIndex:r,commandDetailData:i}))}selectVisualState(e){const t=this.store.getSnapshot();if(e<0||e>=t.visualStates.length)return;const n=t.visualStates[e].commandIndex;if(n===Number.MIN_VALUE)return void this._displayInitState();if(n===Number.MAX_VALUE)return void this._displayEndState();n>=0&&(this._currentCommandId=t.commands[n].capture.id);const r=n>=0?this._buildCommandDetail(n,t.commands,t.visualStates):t.commandDetailData;this.store.setState(t=>Object.assign(Object.assign({},t),{visualStates:t.visualStates.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentVisualStateIndex:e,commands:n>=0?t.commands.map((e,t)=>e.active!==(t===n)?Object.assign(Object.assign({},e),{active:t===n}):e):t.commands,currentCommandIndex:n>=0?n:t.currentCommandIndex,commandDetailData:r}))}showSourceCodeError(e){this.store.setState(t=>Object.assign(Object.assign({},t),{sourceCodeError:e}))}saveCapture(e){const t=JSON.stringify(e,null,4),n=new Blob([t],{type:"octet/stream"}),r="capture "+new Date(e.startTime).toTimeString().split(" ")[0]+".json",i=document.createElement("a"),s=window.URL.createObjectURL(n);i.setAttribute("href",s),i.setAttribute("download",r),i.click()}_displayCaptures(){this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))}_displayCompare(){const e=this.store.getSnapshot(),t=e.captures.findIndex(e=>e.active),n=t>=0?e.captures[t]:null,r=n?e.captures[t+1]:null;if(!n||!r)return void this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:60,canCompare:!1,compareRows:[],compareSummary:{added:0,removed:0,changed:0,unchanged:0},compareLabel:""}));const i=function(e,t){const n=function(e,t){const n=e.length,r=t.length,i=e.map(Jh),s=t.map(Jh),o=[];for(let e=0;e<=n;e++)o.push(new Array(r+1).fill(0));for(let e=n-1;e>=0;e--)for(let t=r-1;t>=0;t--)o[e][t]=i[e]===s[t]?o[e+1][t+1]+1:Math.max(o[e+1][t],o[e][t+1]);const a=[];let l=[];const u=()=>{for(const e of l)a.push(e);l=[]};let c=0,h=0;for(;c0?a.push({type:"changed",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id,fieldDiffs:n}):a.push({type:"unchanged",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id}),c++,h++}else if(o[c+1][h]>=o[c][h+1])l.push({type:"removed",name:e[c].name,previousText:e[c].text,indexA:c}),c++;else{const n=fd(l,t[h].name);n?a.push({type:"changed",name:t[h].name,previousText:n.previousText,currentText:t[h].text,indexA:n.indexA,indexB:h,commandId:t[h].id,fieldDiffs:ed(e[n.indexA],t[h])}):(u(),a.push({type:"added",name:t[h].name,currentText:t[h].text,indexB:h,commandId:t[h].id})),h++}for(;cObject.assign(Object.assign({},e),{menuStatus:60,canCompare:!0,compareRows:i.rows,compareSummary:i.summary,compareLabel:s}))}static _captureLabel(e){try{return new Date(e.startTime).toTimeString().split(" ")[0]}catch(e){return"capture"}}_displayInformation(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];zh(n,"Canvas",t.canvas,e.searchText),zh(n,"Context",t.context,e.searchText);const r=[];for(const n of t.analyses){const t="Primitives"===n.analyserName?"Vertices count":n.analyserName;zh(r,t,n,e.searchText)}zh(r,"Frame Memory Changes",t.frameMemory,e.searchText),zh(r,"Total Memory (seconds since application start: bytes)",t.memory,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:10,commandCount:t.commands.length,informationLeft:n,informationRight:r}))}_displayInitState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.initState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:20,commandCount:t.commands.length,initStateData:n}))}_displayEndState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.endState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:30,commandCount:t.commands.length,endStateData:n}))}_displayCurrentCapture(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=e.searchText,r=e.captures.map(e=>({capture:e.capture,active:e.capture===t})),i=[];i.push({VisualState:t.initState.VisualState,time:t.startTime,commandIndex:Number.MIN_VALUE,active:!1,previousVisualStateIndex:-1,nextVisualStateIndex:-1});const s=[];let o=0,a=!1,l=-1,u=-1;for(let e=0;e0?c-1:-1,nextCommandIndex:-1,visualStateIndex:o,active:!1};if(c>0&&(s[c-1].nextCommandIndex=c),r.VisualState){const e=i.length,t=i.length-1,n={VisualState:r.VisualState,time:r.endTime,commandIndex:c,active:!1,previousVisualStateIndex:t,nextVisualStateIndex:-1};i[t].nextVisualStateIndex=e,i.push(n),o=e,a=!0}else a||(i[0].commandIndex=c,a=!0);h.visualStateIndex=o,s.push(h),(-1===this._currentCommandId&&0===c||this._currentCommandId===r.id)&&(l=c,u=o)}l>=0&&(s[l].active=!0,this._currentCommandId=s[l].capture.id),u>=0&&(i[u].active=!0);let c=[];l>=0&&(c=this._buildCommandDetail(l,s,i)),this.store.setState(e=>Object.assign(Object.assign({},e),{captures:r,menuStatus:40,commandCount:t.commands.length,commands:s,currentCommandIndex:l,visualStates:i,currentVisualStateIndex:u,sourceCodeState:null,sourceCodeError:"",commandDetailData:c}))}_openShader(e){const t=this.store.getSnapshot();if(t.currentCommandIndex<0||t.currentCommandIndex>=t.commands.length)return;const n=t.commands[t.currentCommandIndex].capture.DrawCall;if(!n||!n.shaders||n.shaders.length<2)return;const r={programId:n.programStatus.program.__SPECTOR_Object_TAG.id,nameVertex:n.shaders[0].name,nameFragment:n.shaders[1].name,sourceVertex:n.shaders[0].source,sourceFragment:n.shaders[1].source,translatedSourceVertex:n.shaders[0].translatedSource,translatedSourceFragment:n.shaders[1].translatedSource,fragment:e,translated:!1,editable:n.programStatus.RECOMPILABLE,beautify:!0,preprocessed:!1,singleShader:!1,sourceVertexLog:n.shaders[0].infoLog||"",sourceFragmentLog:n.shaders[1].infoLog||"",programLog:n.programStatus.infoLog||""},i=this._buildCommandDetail(t.currentCommandIndex,t.commands,t.visualStates);this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:"",commandDetailData:i}))}_openCapturedShader(e,t=""){if(!e||"string"!=typeof e.source)return;const n="FRAGMENT_SHADER"===e.shaderType,r={programId:-1,nameVertex:n?"":e.name,nameFragment:n?e.name:"",sourceVertex:n?"":e.source,sourceFragment:n?e.source:"",translatedSourceVertex:n?"":e.translatedSource||"",translatedSourceFragment:n&&e.translatedSource||"",fragment:n,translated:!1,editable:!1,beautify:!0,preprocessed:!1,singleShader:!0,sourceVertexLog:n?"":e.infoLog||"",sourceFragmentLog:n&&e.infoLog||"",programLog:t};this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:""}))}_buildCommandDetail(e,t,n){if(e<0||e>=t.length)return[];const r=t[e],i=n[r.visualStateIndex],s=this._resolvedStackTraces.get(r.capture.id),o=function(e,t,n){const r=[];t&&r.push({type:"visualState",visualState:t});let i="Unknown";switch(e.status){case 50:i="Deprecated";break;case 10:i="Unused";break;case 20:i="Disabled";break;case 30:i="Redundant";break;case 40:i="Valid"}const s=Ph.getMDNLink(e.name);e.result?zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,result:e.result,status:i},""):"LOG"!==e.name&&zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,status:i},"");for(const t in e)"VisualState"!==t&&"result"!==t&&("commandArguments"===t&&Array.isArray(e.commandArguments)?Kh(r,e.name,e.commandArguments):Xh(r,t,e)||("stackTrace"===t&&Array.isArray(e.stackTrace)?zh(r,"stackTrace",n||e.stackTrace,""):"object"==typeof e[t]&&zh(r,t,e[t],"")));return r}(r.capture,null==i?void 0:i.VisualState,s);return s||this._resolveStackTraceAsync(r.capture),o}_resolveStackTraceAsync(e){const t=e.id;this._resolvedStackTraces.has(t)||this._resolvingStackTraces.has(t)||e.stackTrace&&0!==e.stackTrace.length&&(this._resolvingStackTraces.add(t),this._sourceMapResolver.resolveFrames(e.stackTrace).then(n=>{this._resolvingStackTraces.delete(t),this._resolvedStackTraces.set(t,n);let r=!1;for(let t=0;tObject.assign(Object.assign({},t),{commandDetailData:e}))}}).catch(()=>{this._resolvingStackTraces.delete(t)}))}_selectPreviousCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.previousCommandIndex<0||this.selectCommand(t.previousCommandIndex)}_selectNextCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.nextCommandIndex<0||this.selectCommand(t.nextCommandIndex)}_selectPreviousVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.previousVisualStateIndex<0||this.selectVisualState(t.previousVisualStateIndex)}_selectNextVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.nextVisualStateIndex<0||this.selectVisualState(t.nextVisualStateIndex)}_search(e){switch(this.store.getSnapshot().menuStatus){case 0:case 40:this._displayCurrentCapture();break;case 30:this._displayEndState();break;case 10:this._displayInformation();break;case 20:this._displayInitState()}this.store.setState(e=>Object.assign(Object.assign({},e),{searchText:""}))}}class gd{constructor(e,t={}){this.worker=e,this.captureTimeout=t.captureTimeout||1e4,this.disposed=!1,this.captureTimer=null,this.onCapture=new l,this.onCaptureStarted=new l,this.onError=new l,this.onFps=new l,this.onContextReady=new l,this.messageHandler=this.handleMessage.bind(this),this.worker.addEventListener("message",this.messageHandler)}triggerCapture(e=0,t=0,n=!1,r=!1){if(this.disposed)return;this.clearCaptureTimer();const i={type:"spector:trigger-capture",version:1,canvasIndex:e,commandCount:t,quickCapture:n,fullCapture:r};this.worker.postMessage(i),this.captureTimer=setTimeout(()=>{this.onError.trigger("Capture timed out after "+this.captureTimeout+"ms"),this.captureTimer=null},this.captureTimeout)}dispose(){this.disposed||(this.disposed=!0,this.clearCaptureTimer(),this.worker.removeEventListener("message",this.messageHandler),this.onCapture.clear(),this.onCaptureStarted.clear(),this.onError.clear(),this.onFps.clear(),this.onContextReady.clear())}handleMessage(e){const t=e.data;if(!function(e){return null!=e&&"object"==typeof e&&"string"==typeof e.type&&0===e.type.indexOf("spector:")}(t))return;const n=t;switch(n.type){case"spector:context-ready":this.onContextReady.trigger({canvasCount:n.canvasCount,canvasWidth:n.canvasWidth,canvasHeight:n.canvasHeight});break;case"spector:capture-started":this.onCaptureStarted.trigger(void 0);break;case"spector:capture-complete":this.clearCaptureTimer(),this.onCapture.trigger(n.capture);break;case"spector:error":this.clearCaptureTimer(),this.onError.trigger(n.error);break;case"spector:fps":this.onFps.trigger(n.fps)}}clearCaptureTimer(){null!=this.captureTimer&&(clearTimeout(this.captureTimer),this.captureTimer=null)}}var Ed=n(72),vd=n.n(Ed),Cd=n(825),Dd=n.n(Cd),Sd=n(659),Ad=n.n(Sd),_d=n(56),yd=n.n(_d),bd=n(540),Td=n.n(bd),Rd=n(113),xd=n.n(Rd),wd=n(377),Fd={};Fd.styleTagTransform=xd(),Fd.setAttributes=yd(),Fd.insert=Ad().bind(null,"html"),Fd.domAPI=Dd(),Fd.insertStyleElement=Td(),vd()(wd.A,Fd),wd.A&&wd.A.locals&&wd.A.locals;var Nd=n(160),Ld={};Ld.styleTagTransform=xd(),Ld.setAttributes=yd(),Ld.insert=Ad().bind(null,"html"),Ld.domAPI=Dd(),Ld.insertStyleElement=Td(),vd()(Nd.A,Ld),Nd.A&&Nd.A.locals&&Nd.A.locals;class Od{constructor(e){this.timeSpy=e,this.init()}spyXRSession(e){this.currentXRSession&&this.unspyXRSession();for(const e of at.getRequestAnimationFrameFunctionNames())y.resetOriginFunction(this.timeSpy.getSpiedScope(),e);this.timeSpy.spyRequestAnimationFrame("requestAnimationFrame",e),this.currentXRSession=e}unspyXRSession(){if(this.currentXRSession){y.resetOriginFunction(this.currentXRSession,"requestAnimationFrame"),this.currentXRSession=void 0;for(const e of at.getRequestAnimationFrameFunctionNames())this.timeSpy.spyRequestAnimationFrame(e,this.timeSpy.getSpiedScope())}}init(){if(!navigator.xr)return;class e extends XRWebGLLayer{constructor(e,t,n){super(e,t,n),this.glContext=t}getContext(){return this.glContext}}class t extends XRWebGLBinding{constructor(e,t){super(e,t),this.glContext=t}createProjectionLayer(e){const t=super.createProjectionLayer(e);return t.glContext=this.glContext,t}}window.XRWebGLLayer=e,window.XRWebGLBinding=t;const n=navigator.xr.requestSession;Object.defineProperty(navigator.xr,"requestSessionInternal",{writable:!0}),navigator.xr.requestSessionInternal=n,Object.defineProperty(navigator.xr,"requestSession",{writable:!0}),navigator.xr.requestSession=(e,t)=>((e,t)=>navigator.xr.requestSessionInternal(e,t).then(e=>{const t=e;return t._updateRenderState=e.updateRenderState,t.updateRenderState=e=>function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){if(e.baseLayer){const n=e.baseLayer;t.glContext=n.getContext()}if(e.layers)for(const n of e.layers){const e=n;e.glContext&&(t.glContext=e.glContext)}return t._updateRenderState(e)}),this.spyXRSession(t),e.addEventListener("end",()=>{this.unspyXRSession()}),Promise.resolve(e)}))(e,t)}}const Id={CaptureMenu:_t,ResultView:md};class kd{static getFirstAvailable3dContext(e){return this.tryGetContextFromHelperField(e)||this.tryGetContextFromCanvas(e,"webgl")||this.tryGetContextFromCanvas(e,"experimental-webgl")||this.tryGetContextFromCanvas(e,"webgl2")||this.tryGetContextFromCanvas(e,"experimental-webgl2")}static tryGetContextFromHelperField(e){const t=e instanceof HTMLCanvasElement?e.getAttribute("__spector_context_type"):e.__spector_context_type;if(t)return this.tryGetContextFromCanvas(e,t)}static tryGetContextFromCanvas(e,t){let n;try{n=e.getContext(t)}catch(e){}return n}constructor(e={}){this.noFrameTimeout=-1,this.options=Object.assign({enableXRCapture:!1},e),this.captureNextFrames=0,this.captureNextCommands=0,this.quickCapture=!1,this.fullCapture=!1,this.retry=0,this.contexts=[],this.workerBridges=new Map,this.timeSpy=new at,this.onCaptureStarted=new l,this.onCapture=new l,this.onError=new l,this.timeSpy.onFrameStart.add(this.onFrameStart,this),this.timeSpy.onFrameEnd.add(this.onFrameEnd,this),this.timeSpy.onError.add(this.onErrorInternal,this),ct.install(),this.options.enableXRCapture&&(this.xrSpy=new Od(this.timeSpy))}displayUI(e=!1){this.captureMenu||(this.getCaptureUI(),this.captureMenu.onPauseRequested.add(this.pause,this),this.captureMenu.onPlayRequested.add(this.play,this),this.captureMenu.onPlayNextFrameRequested.add(this.playNextFrame,this),this.captureMenu.onCaptureRequested.add(e=>{e&&(e.ref instanceof Worker?this.captureWorker(e.ref):this.captureCanvas(e.ref))},this),setInterval(()=>{this.captureMenu.setFPS(this.getFps())},1e3),e||this.captureMenu.trackPageCanvases(),this.captureMenu.display()),this.resultView||(this.getResultUI(),this.onCapture.add(e=>{this.resultView.display(),this.resultView.addCapture(e)}))}getResultUI(){return this.resultView||(this.resultView=new md,this.resultView.onSourceCodeChanged.add(e=>{this.rebuildProgramFromProgramId(e.programId,e.sourceVertex,e.sourceFragment,t=>{this.referenceNewProgram(e.programId,t),this.resultView.showSourceCodeError(null)},e=>{this.resultView.showSourceCodeError(e)})})),this.resultView}getCaptureUI(){return this.captureMenu||(this.captureMenu=new _t),this.captureMenu}rebuildProgramFromProgramId(e,t,n,r,i){const s=Pe.getFromGlobalStore(e);this.rebuildProgram(s,t,n,r,i)}rebuildProgram(e,t,n,r,i){o.rebuildProgram(e,t,n,r,i)}referenceNewProgram(e,t){Pe.updateInGlobalStore(e,t)}pause(){this.timeSpy.changeSpeedRatio(0)}play(){this.timeSpy.changeSpeedRatio(1)}playNextFrame(){this.timeSpy.playNextFrame()}drawOnlyEveryXFrame(e){this.timeSpy.changeSpeedRatio(e)}getFps(){return this.timeSpy.getFps()}spyCanvases(){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt,this.canvasSpy.onContextRequested.add(this.spyContext,this))}spyCanvas(e){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt(e),this.canvasSpy.onContextRequested.add(this.spyContext,this))}getAvailableContexts(){return this.contexts}setShaderCompileDelay(e){ct.install(),ct.setDelay(e)}clearShaderCompileDelay(){ct.setDelay(0)}getShaderCompileDelay(){return ct.getDelay()}captureCanvas(e,t=0,n=!1,r=!1){const i=this.getAvailableContextSpyByCanvas(e);if(i)this.captureContextSpy(i,t,n,r);else{const i=kd.getFirstAvailable3dContext(e);i?this.captureContext(i,t,n,r):a.error("No webgl context available on the chosen canvas.")}}captureContext(e,t=0,n=!1,r=!1){let i=this.getAvailableContextSpyByCanvas(e.canvas);i||(i=e.getIndexedParameter?new ot({context:e,version:2,recordAlways:!1}):new ot({context:e,version:1,recordAlways:!1}),i.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:i.context.canvas,contextSpy:i})),i&&this.captureContextSpy(i,t,n,r)}captureXRContext(e=0,t=!1,n=!1){this.captureContext(this.getXRContext(),e,t,n)}captureContextSpy(e,t=0,n=!1,r=!1){this.quickCapture=n,this.fullCapture=r,this.capturingContext?this.onErrorInternal("Already capturing a context."):(this.retry=0,this.capturingContext=e,this.capturingContext.setMarker(this.marker),(t=Math.min(t,1e4))>0?this.captureCommands(t):this.captureFrames(1),this.noFrameTimeout=setTimeout(()=>{t>0?this.stopCapture():this.capturingContext&&this.retry>1?this.onErrorInternal("No frames with gl commands detected. Try moving the camera."):this.onErrorInternal("No frames detected. Try moving the camera or implementing requestAnimationFrame.")},1e4))}captureNextFrame(e,t=!1,n=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,0,t,n):this.captureContext(e,0,t,n)}startCapture(e,t,n=!1,r=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,t,n,r):this.captureContext(e,t,n,r)}stopCapture(){if(this.capturingContext){const e=this.capturingContext.stopCapture();if(e.commands.length>0)return this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),this.triggerCapture(e),this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,e;0===this.captureNextCommands&&(this.retry++,this.captureFrames(1))}}setMarker(e){this.marker=e,this.capturingContext&&this.capturingContext.setMarker(e)}clearMarker(){this.marker=null,this.capturingContext&&this.capturingContext.clearMarker()}addRequestAnimationFrameFunctionName(e){this.timeSpy.addRequestAnimationFrameFunctionName(e)}setSpiedScope(e){this.timeSpy.setSpiedScope(e)}log(e){this.capturingContext&&this.capturingContext.log(e)}spyWorkers(e="spector.worker.bundle.js"){ut.startIntercepting(e)}stopSpyingWorkers(){ut.stopIntercepting()}spyWorker(e){let t=this.workerBridges.get(e);return t||(t=new gd(e),t.onCapture.add(e=>{this.triggerCapture(e)},this),t.onError.add(e=>{this.onErrorInternal(e)},this),t.onContextReady.add(t=>{if(this.captureMenu){const n=this.workerBridges.size;this.captureMenu.addCanvasInformation({id:"Worker "+n,width:t.canvasWidth,height:t.canvasHeight,ref:e})}},this),t.onFps.add(e=>{this.captureMenu&&this.captureMenu.setFPS(e)},this),this.workerBridges.set(e,t),t)}captureWorker(e,t=0,n=!1,r=!1){this.workerBridges.has(e)||this.spyWorker(e);const i=this;e.addEventListener("message",function t(n){n.data&&"spector:capture-complete"===n.data.type&&(e.removeEventListener("message",t),i.triggerCapture(n.data.capture))}),e.postMessage({type:"spector:trigger-capture",version:1,canvasIndex:0,commandCount:t,quickCapture:n,fullCapture:r})}captureFrames(e){this.captureNextFrames=e,this.captureNextCommands=0,this.playNextFrame()}captureCommands(e){this.captureNextFrames=0,this.captureNextCommands=e,this.play(),this.capturingContext?(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(e,this.quickCapture,this.fullCapture)):(this.onErrorInternal("No context to capture from."),this.captureNextCommands=0)}spyContext(e){let t=this.getAvailableContextSpyByCanvas(e.context.canvas);t||(t=new ot({context:e.context,version:e.contextVersion,recordAlways:!0}),t.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:t.context.canvas,contextSpy:t})),t.spy()}getAvailableContextSpyByCanvas(e){for(const t of this.contexts)if(t.canvas===e)return t.contextSpy}getXRContext(){return this.options.enableXRCapture||a.error("Cannot retrieve WebXR context if capturing WebXR is disabled."),this.xrSpy.currentXRSession||a.error("No currently active WebXR session."),this.xrSpy.currentXRSession.glContext}onFrameStart(){this.captureNextCommands>0||(this.captureNextFrames>0?(this.capturingContext&&(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(0,this.quickCapture,this.fullCapture)),this.captureNextFrames--):this.capturingContext=void 0)}onFrameEnd(){this.captureNextCommands>0||0===this.captureNextFrames&&this.stopCapture()}triggerCapture(e){this.captureMenu&&this.captureMenu.captureComplete(null),this.onCapture.trigger(e)}onErrorInternal(e){if(a.error(e),this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),!this.capturingContext)throw e;this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,this.retry=0,this.captureMenu&&this.captureMenu.captureComplete(e),this.onError.trigger(e)}}},180(e,t,n){e=n.nmd(e),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/lang"),s=e("../lib/event"),o='.ace_search {background-color: #ddd;color: #666;border: 1px solid #cbcbcb;border-top: 0 none;overflow: hidden;margin: 0;padding: 4px 6px 0 4px;position: absolute;top: 0;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {margin: 0 20px 4px 0;overflow: hidden;line-height: 1.9;}.ace_replace_form {margin-right: 0;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {border-radius: 3px 0 0 3px;background-color: white;color: black;border: 1px solid #cbcbcb;border-right: 0 none;outline: 0;padding: 0;font-size: inherit;margin: 0;line-height: inherit;padding: 0 6px;min-width: 17em;vertical-align: top;min-height: 1.8em;box-sizing: content-box;}.ace_searchbtn {border: 1px solid #cbcbcb;line-height: inherit;display: inline-block;padding: 0 6px;background: #fff;border-right: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;margin: 0;position: relative;color: #666;}.ace_searchbtn:last-child {border-radius: 0 3px 3px 0;border-right: 1px solid #cbcbcb;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn:hover {background-color: #eef1f6;}.ace_searchbtn.prev, .ace_searchbtn.next {padding: 0px 0.7em}.ace_searchbtn.prev:after, .ace_searchbtn.next:after {content: "";border: solid 2px #888;width: 0.5em;height: 0.5em;border-width: 2px 0 0 2px;display:inline-block;transform: rotate(-45deg);}.ace_searchbtn.next:after {border-width: 0 2px 2px 0 ;}.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;font: 16px/16px Arial;padding: 0;height: 14px;width: 14px;top: 9px;right: 7px;position: absolute;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;box-sizing: border-box!important;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;clear: both;}.ace_search_counter {float: left;font-family: arial;padding: 0 8px;}',a=e("../keyboard/hash_handler").HashHandler,l=e("../lib/keys");r.importCssString(o,"ace_searchbox");var u=function(e,t,n){var i=r.createElement("div");r.buildDom(["div",{class:"ace_search right"},["span",{action:"hide",class:"ace_searchbtn_close"}],["div",{class:"ace_search_form"},["input",{class:"ace_search_field",placeholder:"Search for",spellcheck:"false"}],["span",{action:"findPrev",class:"ace_searchbtn prev"},"​"],["span",{action:"findNext",class:"ace_searchbtn next"},"​"],["span",{action:"findAll",class:"ace_searchbtn",title:"Alt-Enter"},"All"]],["div",{class:"ace_replace_form"},["input",{class:"ace_search_field",placeholder:"Replace with",spellcheck:"false"}],["span",{action:"replaceAndFindNext",class:"ace_searchbtn"},"Replace"],["span",{action:"replaceAll",class:"ace_searchbtn"},"All"]],["div",{class:"ace_search_options"},["span",{action:"toggleReplace",class:"ace_button",title:"Toggle Replace mode",style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{class:"ace_search_counter"}],["span",{action:"toggleRegexpMode",class:"ace_button",title:"RegExp Search"},".*"],["span",{action:"toggleCaseSensitive",class:"ace_button",title:"CaseSensitive Search"},"Aa"],["span",{action:"toggleWholeWords",class:"ace_button",title:"Whole Word Search"},"\\b"],["span",{action:"searchInSelection",class:"ace_button",title:"Search In Selection"},"S"]]],i),this.element=i.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),r.importCssString(o,"ace_searchbox",e.container)};(function(){this.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},this.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;s.addListener(e,"mousedown",function(e){setTimeout(function(){t.activeInput.focus()},0),s.stopPropagation(e)}),s.addListener(e,"click",function(e){var n=(e.target||e.srcElement).getAttribute("action");n&&t[n]?t[n]():t.$searchBarKb.commands[n]&&t.$searchBarKb.commands[n].exec(t),s.stopPropagation(e)}),s.addCommandKeyListener(e,function(e,n,r){var i=l.keyCodeToString(r),o=t.$searchBarKb.findKeyCommand(n,i);o&&o.exec&&(o.exec(t),s.stopEvent(e))}),this.$onChange=i.delayedCall(function(){t.find(!1,!1)}),s.addListener(this.searchInput,"input",function(){t.$onChange.schedule(20)}),s.addListener(this.searchInput,"focus",function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()}),s.addListener(this.replaceInput,"focus",function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()})},this.$closeSearchBarKb=new a([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new a,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.editor.getReadOnly()||(e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus())},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),this.setSearchRange=function(e){this.searchRange=e,e?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(e){r.setCssClass(this.replaceOption,"checked",this.searchRange),r.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var t=this.editor.getReadOnly();this.replaceOption.style.display=t?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!t?"":"none",this.find(!1,!1,e)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,n){var i=!this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n,range:this.searchRange})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",i),this.editor._emit("findSearchBox",{match:!i}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,n=0,r=0;if(t){var i=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),s=e.session.doc.positionToIndex(e.selection.anchor);this.searchRange&&(s-=e.session.doc.positionToIndex(this.searchRange.start));for(var o,a=t.lastIndex=0;(o=t.exec(i))&&(n++,(a=o.index)<=s&&r++,!(n>999))&&(o[0]||(t.lastIndex=a+=1,!(a>=i.length))););}this.searchCounter.textContent=r+" of "+(n>999?"999+":n)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(u.prototype),t.SearchBox=u,t.Search=function(e,t){(e.searchBox||new u(e)).show(e.session.getTextRange(),t)}}),ace.require(["ace/ext/searchbox"],function(t){e&&(e.exports=t)})},49(e,t,n){e=n.nmd(e),ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=t.cFunctions="\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b",a=function(){var e=this.$keywords=this.createKeywordMapper({"keyword.control":"break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while|catch|operator|try|throw|using","storage.type":"asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|class|wchar_t|template|char16_t|char32_t","storage.modifier":"const|extern|register|restrict|static|volatile|inline|private|protected|public|friend|explicit|virtual|export|mutable|typename|constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local","keyword.operator":"and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace","variable.language":"this","constant.language":"NULL|true|false|TRUE|FALSE|nullptr"},"identifier"),t=/\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source,n="%"+/(\d+\$)?/.source+/[#0\- +']*/.source+/[,;:_]?/.source+/((-?\d+)|\*(-?\d+\$)?)?/.source+/(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source+/(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source+/(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source;this.$rules={start:[{token:"comment",regex:"//$",next:"start"},{token:"comment",regex:"//",next:"singleLineComment"},i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string",regex:"'(?:"+t+"|.)?'"},{token:"string.start",regex:'"',stateName:"qqstring",next:[{token:"string",regex:/\\\s*$/,next:"qqstring"},{token:"constant.language.escape",regex:t},{token:"constant.language.escape",regex:n},{token:"string.end",regex:'"|$',next:"start"},{defaultToken:"string"}]},{token:"string.start",regex:'R"\\(',stateName:"rawString",next:[{token:"string.end",regex:'\\)"',next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"keyword",regex:"#\\s*(?:include|import|pragma|line|define|undef|version)\\b",next:"directive"},{token:"keyword",regex:"#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b"},{token:"support.function.C99.c",regex:o},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*"},{token:"keyword.operator",regex:/--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],singleLineComment:[{token:"comment",regex:/\\$/,next:"singleLineComment"},{token:"comment",regex:/$/,next:"start"},{defaultToken:"comment"}],directive:[{token:"constant.other.multiline",regex:/\\/},{token:"constant.other.multiline",regex:/.*\\/},{token:"constant.other",regex:"\\s*<.+?>",next:"start"},{token:"constant.other",regex:'\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',next:"start"},{token:"constant.other",regex:"\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",next:"start"},{token:"constant.other",regex:/[^\\\/]+/,next:"start"}]},this.embedRules(i,"doc-",[i.getEndRule("start")]),this.normalizeRules()};r.inherits(a,s),t.c_cppHighlightRules=a}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var i=n[1].length,s=e.findMatchingBracket({row:t,column:i});if(!s||s.row==t)return 0;var o=this.$getIndent(e.getLine(s.row));e.replace(new r(t,0,t,i-1),o)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i,s=e.getLine(n);if(this.startRegionRe.test(s))return this.getCommentRegionBlock(e,s,n);if(i=s.match(this.foldingStartMarker)){var o=i.index;if(i[1])return this.openingBracketBlock(e,i[1],n,o);var a=e.getCommentFoldRange(n,o+i[0].length,1);return a&&!a.isMultiLine()&&(r?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(i=s.match(this.foldingStopMarker))?(o=i.index+i[0].length,i[1]?this.closingBracketBlock(e,i[1],n,o):e.getCommentFoldRange(n,o,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length,a=t+=1,l=e.getLength();++tu)break;var c=this.getFoldWidgetRange(e,"all",t);if(c){if(c.start.row<=s)break;if(c.isMultiLine())t=c.end.row;else if(r==u)break}a=t}}return new i(s,o,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\s*$/),s=e.getLength(),o=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++no)return new i(o,r,n,t.length)}}.call(o.prototype)}),ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./c_cpp_highlight_rules").c_cppHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&"comment"==s[s.length-1].type)return r;if("start"==e)(a=t.match(/^.*[\{\(\[]\s*$/))&&(r+=n);else if("doc-start"==e){if("start"==o)return"";var a;(a=t.match(/^\s*(\/?)\*/))&&(a[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/c_cpp"}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/glsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/c_cpp_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp_highlight_rules").c_cppHighlightRules,s=function(){var e=this.createKeywordMapper({"variable.language":"this",keyword:"layout|attribute|const|uniform|varying|break|continue|do|for|while|if|else|in|out|inout|float|int|void|bool|true|false|lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|samplerCube|struct","constant.language":"radians|degrees|sin|cos|tan|asin|acos|atan|pow|exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|normalize|faceforward|reflect|refract|matrixCompMult|lessThan|lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|texture2DProjLod|textureCube|textureCubeLod|gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|gl_DepthRangeParameters|gl_DepthRange|gl_Position|gl_PointSize|gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData"},"identifier");this.$rules=(new i).$rules,this.$rules.start.forEach(function(t){"function"==typeof t.token&&(t.token=e)})};r.inherits(s,i),t.glslHighlightRules=s}),ace.define("ace/mode/glsl",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/glsl_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp").Mode,s=e("./glsl_highlight_rules").glslHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.$id="ace/mode/glsl"}.call(u.prototype),t.Mode=u}),ace.require(["ace/mode/glsl"],function(t){e&&(e.exports=t)})},429(e,t,n){e=n.nmd(e),ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.require(["ace/theme/monokai"],function(t){e&&(e.exports=t)})}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r](s,s.exports,n),s.loaded=!0,s.exports}return n.amdD=function(){throw new Error("define cannot be used indirect")},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.nc=void 0,n(832),n(49),n(429),n(902),n(180),n(878)})()); }; diff --git a/extensions/spector.bundle.js b/extensions/spector.bundle.js index ff7e2e9..662efd1 100644 --- a/extensions/spector.bundle.js +++ b/extensions/spector.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see spector.bundle.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("SPECTOR",[],t):"object"==typeof exports?exports.SPECTOR=t():e.SPECTOR=t()}(self,()=>(()=>{var e={377(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.captureMenuComponent{position:absolute;padding:7px;z-index:99999;top:10px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuComponent.active{visibility:visible;display:block}.captureMenuComponent,.captureMenuComponent:after,.captureMenuComponent:before{box-sizing:content-box}.captureMenuLogComponent{position:absolute;padding:7px;z-index:80000;top:66px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuLogComponent.active{visibility:visible;display:block}.captureMenuLogComponent,.captureMenuLogComponent:after,.captureMenuLogComponent:before{box-sizing:content-box}.captureMenuLogComponent span.error{color:red}.canvasListComponent{float:left;width:50%;height:100%}.canvasListComponent [commandName=onCanvasSelection]{vertical-align:center;line-height:40px;white-space:nowrap;text-overflow:ellipsis;width:190px;display:inline-block;overflow:hidden;margin:0px 5px}.canvasListComponent [commandName=onCanvasSelection]:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.canvasListComponent ul{margin:0px;padding:7px;list-style:none;position:absolute;top:54px;left:-2px;width:400px;border:2px solid #222;background-color:#2c2c2c}.canvasListComponent ul li{margin:5px}.canvasListComponent ul li:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.captureMenuActionsComponent{float:left;width:30%;height:100%;margin-top:7.5px}.captureMenuActionsComponent div{float:left}.captureMenuActionsComponent [commandName=onCaptureRequested]{border-radius:50%;background:#2c2c2c;border:2px solid red;width:21px;height:21px}.captureMenuActionsComponent [commandName=onCaptureRequested]:hover{background:red;cursor:pointer;transition:background .3s;-webkit-transition:background .3s;-moz-transition:background .3s}.captureMenuActionsComponent [commandName=onPlayRequested],.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPlayRequested]:before,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{content:"";position:absolute;display:inline-block;margin-top:6px;margin-left:4px;width:7px;height:7px;border-top:2px solid #f9f9f9;border-right:2px solid #f9f9f9;background-color:#f9f9f9;-moz-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg);z-index:-20}.captureMenuActionsComponent [commandName=onPlayRequested]:after,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:after{content:"";position:absolute;display:inline-block;width:8px;height:20px;background-color:#2c2c2c;z-index:-10}.captureMenuActionsComponent [commandName=onPlayRequested]:hover,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPauseRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPauseRequested]:before{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:12px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:after{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:7px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{background-color:#2c2c2c}.fpsCounterComponent{float:left;width:20%;vertical-align:center;line-height:40px;white-space:nowrap}',""]);const a=o},160(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.resultViewComponent{position:absolute;z-index:99999;border:1px solid #000;top:0;left:0;bottom:0;right:0;background-color:#222;opacity:1;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.resultViewComponent.active{visibility:visible;display:block}.resultViewComponent,.resultViewComponent:after,.resultViewComponent:before{box-sizing:content-box}.resultViewMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.resultViewMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.resultViewMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.resultViewMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.resultViewMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.resultViewMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.resultViewMenuComponent a.clearSearch{padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.resultViewMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}@media all and (max-width: 1024px){.resultViewMenuComponent .resultViewMenuOpen{display:block;visibility:visible}.resultViewMenuComponent li:not(.resultViewMenuSmall){display:none;visibility:hidden}.resultViewMenuComponent li{background:#2c2c2c}.resultViewMenuComponent li.searchContainer{background:rgb(69.5,69.5,69.5)}.resultViewMenuComponent{padding:0px;position:absolute;overflow-y:visible;top:0px;left:0px;right:0px;bottom:0px;z-index:999999;display:block}.resultViewMenuComponent a.active{background:#2c2c2c}}.resultViewMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:40px;position:relative;top:-1px;box-sizing:border-box}.resultViewMenuComponent input:focus{border:0;outline:0 none}.resultViewMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.resultViewMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.resultViewMenuComponent ::-webkit-input-placeholder{color:#ccc}.resultViewMenuComponent :-moz-placeholder{color:#ccc}.resultViewMenuComponent ::-moz-placeholder{color:#ccc}.resultViewMenuComponent :-ms-input-placeholder{color:#ccc}.resultViewContentComponent{position:absolute;top:40px;left:0;bottom:0;right:0}.informationColumnLeftComponent{position:absolute;top:0;left:0;bottom:0;right:50%;overflow:auto;overflow-x:hidden;overflow-y:visible}.informationColumnRightComponent{position:absolute;top:0;left:50%;bottom:0;right:0;overflow:auto;overflow-x:hidden;overflow-y:visible}.captureListComponent{position:absolute;top:40px;left:0;bottom:0;right:0;background:#222;z-index:9000;display:none;visibility:hidden;overflow-y:visible;overflow-x:hidden}.captureListComponent.active{display:block;visibility:visible}.captureListComponent .openCaptureFile{border:1px dashed #f9f9f9;display:block;margin:5px;padding:5px;text-align:center;font-style:italic}.captureListComponent .openCaptureFile span{line-height:100%;vertical-align:middle}.captureListComponent ul{margin:0px;padding:0px;list-style:none;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-start}.captureListComponent ul li{margin:5px;border:1px solid #606060}.captureListComponent ul li img{width:295px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;display:block}.captureListComponent ul li span{display:block;text-align:center;border:5px solid #222}.captureListComponent ul li span .captureListItemSave{color:#f9f9f9;font-size:16px;margin-left:10px;position:relative;padding:3px 8px 3px 32px}.captureListComponent ul li span .captureListItemSave:before,.captureListComponent ul li span .captureListItemSave:after{box-sizing:border-box;content:"";position:absolute}.captureListComponent ul li span .captureListItemSave:before{background:#d9d9d9;border-color:#f9f9f9;border-style:solid;border-width:7px 2px 1px;border-radius:1px;height:16px;left:8px;top:5px;width:16px}.captureListComponent ul li span .captureListItemSave:after{background:#f9f9f9;border-color:#d9d9d9;border-style:solid;border-width:1px 1px 1px 4px;height:5px;left:13px;top:5px;width:7px}.captureListComponent ul li:hover{cursor:pointer}.captureListComponent ul li.active span{background:#f0640d;border:5px solid #f0640d}.captureListComponent ul li.active span .captureListItemSave:before{background:#f0640d}.captureListComponent ul li.active span .captureListItemSave:after{border-color:#f0640d}.visualStateListComponent{position:absolute;top:0;left:0;bottom:0;padding:5px;right:80%;overflow-y:visible;overflow-x:hidden}.visualStateListComponent ul{margin:0px;padding:0px;list-style:none}.visualStateListComponent ul li{margin:20px 15px 0px 15px;border:1px solid #606060}.visualStateListComponent ul li img{display:block;padding:0px;box-sizing:border-box;max-height:600px;width:100%;margin:0 auto;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.visualStateListComponent ul li:hover{cursor:pointer}.visualStateListComponent ul li span{border:5px solid #222;background:#222;box-sizing:border-box;display:inline-block;width:100%;margin:0px;padding:5px;word-wrap:break-word}.visualStateListComponent ul li.active{border:2px solid #f0640d}.commandListComponent{position:absolute;top:0;left:20%;right:40%;bottom:0;color:hsl(0,0%,82.6470588235%)}.commandListComponent ul{margin:0px;padding:0px;list-style:none;overflow-y:visible;overflow-x:hidden;height:100%}.commandListComponent ul li{padding:8px}.commandListComponent ul li span{word-wrap:break-word;line-height:22px}.commandListComponent ul li:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.commandListComponent ul li:nth-child(even){background:#2c2c2c}.commandListComponent ul li:nth-child(odd){background:#222}.commandListComponent ul li .important{font-weight:800}.commandListComponent ul li .important.deprecated{color:red}.commandListComponent ul li .important.unused{color:#ff0}.commandListComponent ul li .important.disabled{color:gray}.commandListComponent ul li .important.redundant{color:orange}.commandListComponent ul li .important.valid{color:#adff2f}.commandListComponent ul li .marker{font-size:16px;font-weight:900;color:#adff2f}.commandListComponent ul li.active{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.commandListComponent ul li.drawCall{background:#5db0d7;color:#222}.commandListComponent ul li a{margin-left:5px;margin-right:5px;color:#5db0d7;background:#222;padding:5px;font-weight:900;display:inline-block}.commandDetailComponent{position:absolute;top:0;left:60%;right:0;bottom:0;overflow-y:visible;overflow-x:hidden}.jsonGroupComponent{display:block;margin:10px;padding:10px;padding-bottom:5px}.jsonGroupComponent .jsonGroupComponentTitle{display:block;font-size:16px;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:5px;margin-bottom:5px;text-transform:capitalize}.jsonGroupComponent ul{margin:0px;padding:0px;list-style:none}.jsonGroupComponent ul li:nth-child(even){background:#222}.jsonGroupComponent ul li:nth-child(odd){background:#222}.jsonItemComponentKey{color:#f0640d}.jsonItemComponentValue{white-space:pre-wrap}.jsonItemImageHolder{width:50%;margin:auto}.jsonItemImageHolder .jsonItemImage{margin:5px;display:block;border:1px solid #606060;width:100%}.jsonItemImageHolder .jsonItemImage img{width:100%;display:block;margin:auto;max-width:256px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.jsonItemImageHolder .jsonItemImage span{margin:0px;padding:5px;word-wrap:break-word;display:inline-block;width:100%;box-sizing:border-box}[commandName=onOpenSourceClicked]:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.jsonVisualStateItemComponent{text-align:center;padding:10px}.jsonVisualStateItemComponent img{background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;border:1px solid #606060;margin:5px;width:100%;max-width:512px;max-height:800px}.jsonVisualStateItemComponent span{display:block}.jsonContentComponent{position:absolute;top:0;left:0;right:0;bottom:0;padding:10px;overflow-y:visible;overflow-x:hidden}.jsonItemComponentValue{word-break:break-all;white-space:normal}.jsonSourceItemComponentOpen{font-weight:bold;color:#5db0d7;text-decoration:underline}.sourceCodeMenuComponentContainer{position:absolute;left:0;top:0;bottom:48px;right:40%}.sourceCodeMenuComponentFooter{position:absolute;left:0;right:40%;bottom:0;padding:0 15px}.sourceCodeFormatError{color:#f0640d;margin-left:15px}.sourceCodeDiagnosticsNotice{color:#5db0d7;margin-left:15px}.sourceCodeDiagnosticsNotice a{color:#c9c9c9;text-decoration:underline}.sourceCodeMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.sourceCodeMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.sourceCodeMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.sourceCodeMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.sourceCodeMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.sourceCodeMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.sourceCodeMenuComponent a.clearSearch{display:inline-block;padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.sourceCodeMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}.sourceCodeMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:100%;position:relative;top:-1px;box-sizing:border-box}.sourceCodeMenuComponent input:focus{border:0;outline:0 none}.sourceCodeMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.sourceCodeMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.sourceCodeMenuComponent ::-webkit-input-placeholder{color:#ccc}.sourceCodeMenuComponent :-moz-placeholder{color:#ccc}.sourceCodeMenuComponent ::-moz-placeholder{color:#ccc}.sourceCodeMenuComponent :-ms-input-placeholder{color:#ccc}.sourceCodeComponent{position:absolute;top:42px;left:0;bottom:48px;right:40%;background:#222;z-index:9000;overflow-x:visible;overflow:auto}.sourceCodeComponent .sourceCodeComponentTitle{font-size:16px;font-weight:800;line-height:50px;color:#f0640d;padding:1em;margin:.5em 0}.compareViewComponent{position:absolute;top:50px;left:0px;right:0px;bottom:0px;overflow:hidden;display:flex;flex-direction:column;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:13px}.compareViewComponent .compareViewEmpty,.compareViewComponent .compareViewEmptyRow,.compareViewComponent .compareDetailEmpty{padding:1em;color:#c9c9c9;text-align:center}.compareViewComponent .compareViewHeader{flex:0 0 auto;display:flex;align-items:center;gap:16px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid rgb(8.5,8.5,8.5);white-space:nowrap}.compareViewComponent .compareViewHeader .compareViewLabel{color:#5db0d7}.compareViewComponent .compareViewHeader .compareViewSummary span{margin-right:8px;font-weight:700}.compareViewComponent .compareViewHeader .compareViewSummary span.added{color:#adff2f}.compareViewComponent .compareViewHeader .compareViewSummary span.removed{color:#ff5a5a}.compareViewComponent .compareViewHeader .compareViewSummary span.changed{color:#f0640d}.compareViewComponent .compareViewHeader .compareViewSummary span.unchanged{color:#c9c9c9}.compareViewComponent .compareViewHeader .compareViewToggle{margin-left:auto;cursor:pointer;user-select:none}.compareViewComponent .compareViewHeader .compareViewToggle input{vertical-align:middle;margin-right:4px}.compareViewComponent .compareViewBody{flex:1 1 auto;display:flex;min-height:0}.compareViewComponent .compareViewLegend{flex:0 0 130px;box-sizing:border-box;padding:10px;background:#2c2c2c;border-right:2px solid #222}.compareViewComponent .compareViewLegend .compareLegendRow{display:flex;align-items:center;gap:8px;margin:8px 0}.compareViewComponent .compareViewLegend .compareLegendRow.unchanged{opacity:.5}.compareViewComponent .compareViewLegend .compareLegendChip{width:12px;height:12px;border-radius:2px;background:#c9c9c9}.compareViewComponent .compareViewLegend .added .compareLegendChip{background:#adff2f}.compareViewComponent .compareViewLegend .removed .compareLegendChip{background:#ff5a5a}.compareViewComponent .compareViewLegend .changed .compareLegendChip{background:#f0640d}.compareViewComponent .compareViewList{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;margin:0;padding:0;list-style:none}.compareViewComponent .compareViewList .compareRow{display:flex;align-items:baseline;padding:3px 10px;line-height:20px;cursor:pointer;white-space:nowrap}.compareViewComponent .compareViewList .compareRow:nth-child(odd){background:#222}.compareViewComponent .compareViewList .compareRow:nth-child(even){background:#2c2c2c}.compareViewComponent .compareViewList .compareRow .compareSign{flex:0 0 14px;font-weight:800}.compareViewComponent .compareViewList .compareRow .compareRowText{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.compareViewComponent .compareViewList .compareRow .compareCmdName{font-weight:700}.compareViewComponent .compareViewList .compareRow.added .compareSign,.compareViewComponent .compareViewList .compareRow.added .compareCmdName{color:#adff2f}.compareViewComponent .compareViewList .compareRow.removed .compareSign,.compareViewComponent .compareViewList .compareRow.removed .compareCmdName{color:#ff5a5a}.compareViewComponent .compareViewList .compareRow.changed .compareSign,.compareViewComponent .compareViewList .compareRow.changed .compareCmdName{color:#f0640d}.compareViewComponent .compareViewList .compareRow.unchanged{opacity:.55}.compareViewComponent .compareViewList .compareRow.selected{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.compareViewComponent .compareViewList .compareRow.selected .compareSign,.compareViewComponent .compareViewList .compareRow.selected .compareCmdName{color:#222}.compareViewComponent .compareViewList .compareViewEmptyRow{cursor:default}.compareViewComponent .compareViewDetail{flex:0 0 42%;box-sizing:border-box;overflow-y:auto;border-left:2px solid #222;padding:4px 12px 12px}.compareViewComponent .compareViewDetail .compareDetailGroup{margin:12px 0}.compareViewComponent .compareViewDetail .compareDetailGroup ul{margin:0;padding:0;list-style:none}.compareViewComponent .compareViewDetail .compareDetailGroup li{padding:2px 0;white-space:pre-wrap;word-break:break-word}.compareViewComponent .compareViewDetail .compareDetailTitle{display:block;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin-bottom:6px;text-transform:capitalize}.compareViewComponent .compareViewDetail .compareDetailKey{color:#f0640d}.compareViewComponent .compareViewDetail .compareCmdName{font-weight:700}.compareViewComponent .compareViewDetail .compareCmdName.added{color:#adff2f}.compareViewComponent .compareViewDetail .compareCmdName.removed{color:#ff5a5a}.compareViewComponent .compareViewDetail .compareCmdName.changed{color:#f0640d}.compareViewComponent .compareViewDetail .compareArrow{color:#c9c9c9}.compareViewComponent .compareViewDetail .compareOld{opacity:.7;text-decoration:line-through}.compareViewComponent .compareViewDetail .compareNew{color:#f9f9f9}.compareViewComponent .compareViewDetail .compareCommandLink{color:#5db0d7;text-decoration:none;cursor:pointer;border-bottom:1px dotted currentColor}.compareViewComponent .compareViewDetail .compareCommandLink:hover{color:#f0640d}.compareViewComponent .compareViewDetail .compareTextureItem{padding-bottom:6px}.compareViewComponent .compareViewDetail .compareImageDiff{display:flex;align-items:center;margin-top:4px}.compareViewComponent .compareViewDetail .compareThumb{width:48px;height:48px;object-fit:contain;margin:2px 6px 2px 0;border:1px solid rgb(8.5,8.5,8.5);background:#222;image-rendering:pixelated}.jsonItemImageClickable{cursor:zoom-in}.textureViewerOverlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:100000;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.6);font-family:Consolas,monaco,monospace;font-size:13px;color:#f9f9f9}.textureViewerOverlay .textureViewerModal{width:min(900px,92vw);height:min(640px,90vh);display:flex;flex-direction:column;overflow:hidden;background:#222;border:1px solid #000;box-shadow:0 10px 40px rgba(0,0,0,.6)}.textureViewerOverlay .textureViewerHeader{flex:0 0 auto;display:flex;align-items:center;gap:12px;height:40px;padding:0 12px;background:#2c2c2c;border-bottom:2px solid #222}.textureViewerOverlay .textureViewerHeader .textureViewerTitle{color:#5db0d7}.textureViewerOverlay .textureViewerHeader .textureViewerMeta{color:#c9c9c9;font-size:12px}.textureViewerOverlay .textureViewerHeader .textureViewerClose{margin-left:auto;width:26px;height:26px;display:flex;align-items:center;justify-content:center;border-radius:3px;color:#c9c9c9;cursor:pointer}.textureViewerOverlay .textureViewerHeader .textureViewerClose:hover{color:#f9f9f9;background:hsla(0,0%,100%,.08)}.textureViewerOverlay .textureViewerToolbar{flex:0 0 auto;display:flex;align-items:center;flex-wrap:wrap;gap:14px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid #000;font-size:12px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup{display:flex;align-items:center;gap:6px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup .lbl{color:#c9c9c9;margin-right:2px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroupEnd{margin-left:auto}.textureViewerOverlay .textureViewerToolbar .channel{width:26px;height:24px;display:flex;align-items:center;justify-content:center;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#777;font-weight:800;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .channel.on.r{background:#e14b4b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.g{background:#4bd44b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.b{background:#4b8fe1;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.a{background:#dedede;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .tvBtn{height:24px;padding:0 10px;display:inline-flex;align-items:center;gap:6px;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#f9f9f9;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .tvBtn:hover{background:#333}.textureViewerOverlay .textureViewerToolbar .tvBtn.active{background:#f0640d;color:#1a1a1a;border-color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary{border-color:#f0640d;color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary:hover{background:#f0640d;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .seg{display:flex}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn{border-radius:0;border-right-width:0}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:first-child{border-radius:3px 0 0 3px}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:last-child{border-radius:0 3px 3px 0;border-right-width:1px}.textureViewerOverlay .textureViewerToolbar .zoomVal{min-width:44px;text-align:center;color:#c9c9c9}.textureViewerOverlay .textureViewerBody{flex:1 1 auto;display:flex;min-height:0}.textureViewerOverlay .textureViewerViewport{flex:1 1 auto;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#141414}.textureViewerOverlay .textureViewerViewport.checker{background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}.textureViewerOverlay .textureViewerCanvas{image-rendering:pixelated;cursor:crosshair;box-shadow:0 0 0 1px #000}.textureViewerOverlay .textureViewerLoupe{position:absolute;display:none;width:120px;height:120px;pointer-events:none;image-rendering:pixelated;border:1px solid #000;box-shadow:0 2px 8px rgba(0,0,0,.6);background:#000;left:16px;top:16px}.textureViewerOverlay .textureViewerRail{flex:0 0 210px;box-sizing:border-box;padding:12px;overflow-y:auto;background:#2c2c2c;border-left:2px solid #222}.textureViewerOverlay .textureViewerRail .railTitle{color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin:0 0 8px;text-transform:capitalize}.textureViewerOverlay .textureViewerRail .kv{display:flex;justify-content:space-between;margin:4px 0}.textureViewerOverlay .textureViewerRail .kv .k{color:#f0640d}.textureViewerOverlay .textureViewerRail .kv .v{color:#f9f9f9}.textureViewerOverlay .textureViewerRail .swatch{width:100%;height:34px;margin:8px 0;border:1px solid #000;background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0}.textureViewerOverlay .textureViewerRail .swatch .swatchInner{width:100%;height:100%}.textureViewerOverlay .textureViewerRail .hint{color:#c9c9c9;margin-top:10px;line-height:1.5}',""]);const a=o},636(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,".ace-monokai {\n color: #f9f9f9;\n font-size: 14px;\n}\n\n.ace-monokai .ace_entity.ace_name.ace_tag,\n.ace-monokai .ace_keyword,\n.ace-monokai .ace_meta.ace_tag,\n.ace-monokai .ace_storage {\n color: #F0640D\n}\n\n.ace-monokai .ace_constant.ace_character,\n.ace-monokai .ace_constant.ace_other {\n color: #5db0d7;\n}\n\n.ace-monokai .ace_marker-layer .ace_selection {\n background: #a6e22e\n}\n\n.ace-monokai .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #a6e22e;\n}\n\n.ace-monokai .ace_marker-layer .ace_active-line {\n background: #2c2c2c\n}\n.ace-monokai .ace_gutter-active-line {\n background-color: #2c2c2c\n}\n.ace-monokai .ace_marker-layer .ace_selected-word {\n border: 1px solid #a6e22e\n}\n\n.ace-monokai .ace_constant.ace_language {\n color: #e6db74\n}\n.ace-monokai .ace_constant.ace_numeric {\n color: #ae81ff\n}\n\n.ace-monokai .ace_gutter {\n background: #222;\n color: #8F908A;\n}",""]);const a=o},314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var a=0;a0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},601(e){"use strict";e.exports=function(e){return e[1]}},832(e,t,n){e=n.nmd(e),function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,n,r){"string"==typeof e?(2==arguments.length&&(r=n),t.modules[e]||(t.payloads[e]=r,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var n,r,i=function(e,t,n){if("string"==typeof t){var r=a(e,t);if(null!=r)return n&&n(),r}else if("[object Array]"===Object.prototype.toString.call(t)){for(var i=[],o=0,l=t.length;o1&&function(e,t,n){if(Array.prototype.indexOf)return e.indexOf("",n);for(var r=0;r-1&&(n=RegExp(this.source,i.replace.call(((r=this).global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),"g","")),i.replace.call(e.slice(a.index),n,function(){for(var e=1;ea.index&&this.lastIndex--}return a},o||(RegExp.prototype.test=function(e){var t=i.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError("Function.prototype.bind called on incompatible "+t);var n=d.call(arguments,1),i=function(){if(this instanceof i){var r=t.apply(this,n.concat(d.call(arguments)));return Object(r)===r?r:this}return t.apply(e,n.concat(d.call(arguments)))};return t.prototype&&(r.prototype=t.prototype,i.prototype=new r,r.prototype=null),i});var i,s,o,a,l,u=Function.prototype.call,c=Array.prototype,h=Object.prototype,d=c.slice,f=u.bind(h.toString),p=u.bind(h.hasOwnProperty);if((l=p(h,"__defineGetter__"))&&(i=u.bind(h.__defineGetter__),s=u.bind(h.__defineSetter__),o=u.bind(h.__lookupGetter__),a=u.bind(h.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,n=[];if(n.splice.apply(n,e(20)),n.splice.apply(n,e(26)),t=n.length,n.splice(5,0,"XXX"),n.length,t+1==n.length)return!0}()){var m=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?m.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(d.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):null==e?e=0:e<0&&(e=Math.max(n+e,0)),e+ta)for(h=u;h--;)this[l+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else for(this.length=c+s,h=0;h>>0;if("[object Function]"!=f(e))throw new TypeError;for(;++i>>0,i=Array(r),s=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var o=0;o>>0,s=[],o=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var a=0;a>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,s=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s++];break}if(++s>=r)throw new TypeError("reduce of empty array with no initial value")}for(;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,s=r-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s--];break}if(--s<0)throw new TypeError("reduceRight of empty array with no initial value")}do{s in this&&(i=e.call(void 0,i,n[s],s,t))}while(s--);return i}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=C&&"[object String]"==f(this)?this.split(""):L(this),n=t.length>>>0;if(!n)return-1;var r=0;for(arguments.length>1&&(r=N(arguments[1])),r=r>=0?r:Math.max(0,n+r);r>>0;if(!n)return-1;var r=n-1;for(arguments.length>1&&(r=Math.min(r,N(arguments[1]))),r=r>=0?r:n-Math.abs(r);r>=0;r--)if(r in t&&e===t[r])return r;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:h)}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(p(e,t)){var n;if(n={enumerable:!0,configurable:!0},l){var r=e.__proto__;e.__proto__=h;var i=o(e,t),s=a(e,t);if(e.__proto__=r,i||s)return i&&(n.get=i),s&&(n.set=s),n}return n.value=e[t],n}}),Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),Object.create||(g=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var n;if(null===e)n=g();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var r=function(){};r.prototype=e,(n=new r).__proto__=e}return void 0!==t&&Object.defineProperties(n,t),n}),Object.defineProperty){var S=D({}),A="undefined"==typeof document||D(document.createElement("div"));if(!S||!A)var _=Object.defineProperty}Object.defineProperty&&!_||(Object.defineProperty=function(e,t,n){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof n&&"function"!=typeof n||null===n)throw new TypeError("Property description must be an object: "+n);if(_)try{return _.call(Object,e,t,n)}catch(e){}if(p(n,"value"))if(l&&(o(e,t)||a(e,t))){var r=e.__proto__;e.__proto__=h,delete e[t],e[t]=n.value,e.__proto__=r}else e[t]=n.value;else{if(!l)throw new TypeError("getters & setters can not be defined on this javascript engine");p(n,"get")&&i(e,t,n.get),p(n,"set")&&s(e,t,n.set)}return e}),Object.defineProperties||(Object.defineProperties=function(e,t){for(var n in t)p(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=(E=Object.freeze,function(e){return"function"==typeof e?e:E(e)})}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";p(e,t);)t+="?";e[t]=!0;var n=p(e,t);return delete e[t],n}),!Object.keys){var y=!0,b=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],T=b.length;for(var R in{toString:null})y=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)p(e,n)&&t.push(n);if(y)for(var r=0,i=T;r0||-1)*Math.floor(Math.abs(e))),e}var L=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,n){"use strict";e("./regexp"),e("./es5-shim"),"undefined"==typeof Element||Element.prototype.remove||Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,n){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var r="object"==typeof navigator?navigator:{},i=(/mac|win|linux/i.exec(r.platform)||["other"])[0].toLowerCase(),s=r.userAgent||"",o=r.appName||"";t.isWin="win"==i,t.isMac="mac"==i,t.isLinux="linux"==i,t.isIE="Microsoft Internet Explorer"==o||o.indexOf("MSAppHost")>=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,t.isAIR=s.indexOf("AdobeAIR")>=0,t.isAndroid=s.indexOf("Android")>=0,t.isChromeOS=s.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./useragent");if(t.buildDom=function e(t,n,r){if("string"==typeof t&&t){var i=document.createTextNode(t);return n&&n.appendChild(i),i}if(!Array.isArray(t))return t;if("string"!=typeof t[0]||!t[0]){for(var s=[],o=0;o=1.5,"undefined"!=typeof document){var i=document.createElement("div");t.HI_DPI&&void 0!==i.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),r.isEdge||void 0===i.style.animationName||(t.HAS_CSS_ANIMATION=!0),i=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./oop"),i=function(){var e,t,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in n.FUNCTION_KEYS)e=n.FUNCTION_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);for(t in n.PRINTABLE_KEYS)e=n.PRINTABLE_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);return r.mixin(n,n.MODIFIER_KEYS),r.mixin(n,n.PRINTABLE_KEYS),r.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)n.KEY_MODS[t]=e.filter(function(e){return t&n.KEY_MODS[e]}).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();r.mixin(t,i),t.keyCodeToString=function(e){var t=i[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./keys"),i=e("./useragent"),s=null,o=0;t.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var r=function(){n.call(e,window.event)};n._wrapper=r,e.attachEvent("on"+t,r)}},t.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,n,r){function i(e){n&&n(e),r&&r(e),t.removeListener(document,"mousemove",n,!0),t.removeListener(document,"mouseup",i,!0),t.removeListener(document,"dragstart",i,!0)}return t.addListener(document,"mousemove",n,!0),t.addListener(document,"mouseup",i,!0),t.addListener(document,"dragstart",i,!0),i},t.addMouseWheelListener=function(e,n){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),n(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}n(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),n(e)})},t.addMultiMouseDownListener=function(e,n,r,s){var o,a,l,u=0,c={2:"dblclick",3:"tripleclick",4:"quadclick"};function h(e){if(0!==t.getButton(e)?u=0:e.detail>1?++u>4&&(u=1):u=1,i.isIE){var h=Math.abs(e.clientX-o)>5||Math.abs(e.clientY-a)>5;l&&!h||(u=1),l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),1==u&&(o=e.clientX,a=e.clientY)}if(e._clicks=u,r[s]("mousedown",e),u>4)u=0;else if(u>1)return r[s](c[u],e)}function d(e){u=2,l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),r[s]("mousedown",e),r[s](c[u],e)}Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",h),i.isOldIE&&t.addListener(e,"dblclick",d)})};var a=i.isMac&&i.isOpera&&!("KeyboardEvent"in window)?function(e){return(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)}:function(e){return(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};function l(e,t,n){var l=a(t);if(!i.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(l|=8),s.altGr){if(!(3&~l))return;s.altGr=0}if(18===n||17===n){var u="location"in t?t.location:t.keyLocation;17===n&&1===u?1==s[n]&&(o=t.timeStamp):18===n&&3===l&&2===u&&t.timeStamp-o<50&&(s.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),l||13!==n||3!==(u="location"in t?t.location:t.keyLocation)||(e(t,l,-n),!t.defaultPrevented)){if(i.isChromeOS&&8&l){if(e(t,l,n),t.defaultPrevented)return;l&=-9}return!!(l||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&e(t,l,n)}}function u(){s=Object.create(null)}if(t.getModifierString=function(e){return r.KEY_MODS[a(e)]},t.addCommandKeyListener=function(e,n){var r=t.addListener;if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var o=null;r(e,"keydown",function(e){o=e.keyCode}),r(e,"keypress",function(e){return l(n,e,o)})}else{var a=null;r(e,"keydown",function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=l(n,e,e.keyCode);return a=e.defaultPrevented,t}),r(e,"keypress",function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),r(e,"keyup",function(e){s[e.keyCode]=null}),s||(u(),r(window,"focus",u))}},"object"==typeof window&&window.postMessage&&!i.isOldIE){var c=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+c++,i=function(s){s.data==r&&(t.stopPropagation(s),t.removeListener(n,"message",i),e())};t.addListener(n,"message",i),n.postMessage(r,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function n(){t.$idleBlocked?setTimeout(n,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,n=e.end,r=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(r.row,r.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(r.row,r.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else this.end.rowt)var i={row:t+1,column:0};else this.start.row0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;nDate.now()-50)||(r=!1)},cancel:function(){r=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("../lib/dom"),o=e("../lib/lang"),a=e("../clipboard"),l=i.isChrome<18,u=i.isIE,c=i.isChrome>63,h=400,d=e("../lib/keys"),f=d.KEY_MODS,p=i.isIOS,m=p?/\s/:/\n/;t.TextInput=function(e,t){var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild);var g=!1,E=!1,v=!1,C=!1,D="";i.isMobile||(n.style.fontSize="1px");var S=!1,A=!1,_="",y=0,b=0,T=0;try{var R=document.activeElement===n}catch(e){}r.addListener(n,"blur",function(e){A||(t.onBlur(e),R=!1)}),r.addListener(n,"focus",function(e){if(!A){if(R=!0,i.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),i.isEdge?setTimeout(x):x()}}),this.$focusScroll=!1,this.focus=function(){if(D||c||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var t=0!=n.getBoundingClientRect().top}catch(e){return}var r=[];if(t)for(var i=n.parentElement;i&&1==i.nodeType;)r.push(i),i.setAttribute("ace_nocontext",!0),i=!i.parentElement&&i.getRootNode?i.getRootNode().host:i.parentElement;n.focus({preventScroll:!0}),t&&r.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="","0px"==n.style.top&&(n.style.top=e)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return R},t.on("beforeEndOperation",function(){t.curOp&&"insertstring"==t.curOp.command.name||(v&&(_=n.value="",U()),x())});var x=p?function(e){if(R&&(!g||e)&&!C){e||(e="");var r="\n ab"+e+"cde fg\n";r!=n.value&&(n.value=_=r);var i=4+(e.length||(t.selection.isEmpty()?0:1));4==y&&b==i||n.setSelectionRange(4,i),y=4,b=i}}:function(){if(!v&&!C&&(R||F)){v=!0;var e=t.selection,r=e.getRange(),i=e.cursor.row,s=r.start.column,o=r.end.column,a=t.session.getLine(i);if(r.start.row!=i){var l=t.session.getLine(i-1);s=r.start.rowi+1?u.length:o,o+=a.length+1,a=a+"\n"+u}a.length>h&&(s0&&_[h]==e[h];)h++,o--;for(l=l.slice(h),h=1;a>0&&_.length-h>y-1&&_[_.length-h]==e[e.length-h];)h++,a--;u-=h-1,c-=h-1;var d=l.length-h+1;return d<0&&(o=-d,d=0),l=l.slice(0,d),r||l||u||o||a||c?(C=!0,l&&!o&&!a&&!u&&!c||S?t.onTextInput(l):t.onTextInput(l,{extendLeft:o,extendRight:a,restoreStart:u,restoreEnd:c}),C=!1,_=e,y=i,b=s,T=c,l):""},L=function(e){if(v)return B();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var r=n.value,i=N(r,!0);(r.length>500||m.test(i))&&x()},O=function(e,t,n){var r=e.clipboardData||window.clipboardData;if(r&&!l){var i=u||n?"Text":"text/plain";try{return t?!1!==r.setData(i,t):r.getData(i)}catch(e){if(!n)return O(e,t,!0)}}},I=function(e,i){var s=t.getCopyText();if(!s)return r.preventDefault(e);O(e,s)?(p&&(x(s),g=s,setTimeout(function(){g=!1},10)),i?t.onCut():t.onCopy(),r.preventDefault(e)):(g=!0,n.value=s,n.select(),setTimeout(function(){g=!1,x(),i?t.onCut():t.onCopy()}))},k=function(e){I(e,!0)},M=function(e){I(e,!1)},P=function(e){var s=O(e);a.pasteCancelled()||("string"==typeof s?(s&&t.onPaste(s,e),i.isIE&&setTimeout(x),r.preventDefault(e)):(n.value="",E=!0))};r.addCommandKeyListener(n,t.onCommandKey.bind(t)),r.addListener(n,"select",function(e){v||(g?g=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=_.length&&e.value===_&&_&&e.selectionEnd!==b}(n)&&(t.selectAll(),x()))}),r.addListener(n,"input",L),r.addListener(n,"cut",k),r.addListener(n,"copy",M),r.addListener(n,"paste",P),"oncut"in n&&"oncopy"in n&&"onpaste"in n||r.addListener(e,"keydown",function(e){if((!i.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:M(e);break;case 86:P(e);break;case 88:k(e)}});var B=function(){if(v&&t.onCompositionUpdate&&!t.$readOnly){if(S)return $();if(v.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;N(e),v.markerRange&&(v.context&&(v.markerRange.start.column=v.selectionStart=v.context.compositionStartOffset),v.markerRange.end.column=v.markerRange.start.column+b-v.selectionStart+T)}}},U=function(e){t.onCompositionEnd&&!t.$readOnly&&(v=!1,t.onCompositionEnd(),t.off("mousedown",$),e&&L())};function $(){A=!0,n.blur(),n.focus(),A=!1}var G,V=o.delayedCall(B,50).schedule.bind(null,null);function W(){clearTimeout(G),G=setTimeout(function(){D&&(n.style.cssText=D,D=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()},0)}r.addListener(n,"compositionstart",function(e){if(!v&&t.onCompositionStart&&!t.$readOnly&&(v={},!S)){setTimeout(B,0),t.on("mousedown",$);var r=t.getSelectionRange();r.end.row=r.start.row,r.end.column=r.start.column,v.markerRange=r,v.selectionStart=y,t.onCompositionStart(v),v.useTextareaForIME?(n.value="",_="",y=0,b=0):(n.msGetInputContext&&(v.context=n.msGetInputContext()),n.getInputContext&&(v.context=n.getInputContext()))}}),r.addListener(n,"compositionupdate",B),r.addListener(n,"keyup",function(e){27==e.keyCode&&n.value.lengthb&&"\n"==_[s]?o=d.end:rb&&_.slice(0,s).split("\n").length>2?o=d.down:s>b&&" "==_[s-1]?(o=d.right,a=f.option):(s>b||s==b&&b!=y&&r==s)&&(o=d.right),r!==s&&(a|=f.shift),o){if(!t.onCommandKey({},a,o)&&t.commands){o=d.keyCodeToString(o);var l=t.commands.findKeyCommand(a,o);l&&t.execCommand(l)}y=r,b=s,x("")}}};document.addEventListener("selectionchange",s),t.on("destroy",function(){document.removeEventListener("selectionchange",s)})}(0,t,n)}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/useragent");function i(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function s(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)n=2*t.row-e.start.row-e.end.row;else n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,s=e.getButton();return 0!==s?((i.getSelectionRange().isEmpty()||1==s)&&i.selection.moveToPosition(n),void(2==s&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||i.isFocused()||(i.focus(),!this.$focusTimeout||this.$clickSelection||i.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(-1==r)e=this.$clickSelection.end;else if(1==r)e=this.$clickSelection.start;else{var i=s(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(i.start),a=this.$clickSelection.comparePoint(i.end);if(-1==o&&a<=0)t=this.$clickSelection.end,i.end.row==r.row&&i.end.column==r.column||(r=i.start);else if(1==a&&o>=0)t=this.$clickSelection.start,i.start.row==r.row&&i.start.column==r.column||(r=i.end);else if(-1==o&&1==a)r=i.end,t=i.start;else{var l=s(this.$clickSelection,r);r=l.cursor,t=l.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e,t,n,r,i=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,n=this.x,r=this.y,Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))),s=Date.now();(i>0||s-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session.getBracketRange(t);r?(r.isEmpty()&&(r.start.column--,r.end.column++),this.setState("select")):(r=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=r,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,s=i?e.wheelX/i:n.vx,o=i?e.wheelY/i:n.vy;i<550&&(s=(s+n.vx)/2,o=(o+n.vy)/2);var a=Math.abs(s/o),l=!1;return a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?n.allowed=r:r-n.allowed<550&&(Math.abs(s)<=1.5*Math.abs(n.vx)&&Math.abs(o)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=r):n.allowed=0),n.t=r,n.vx=s,n.vy=o,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(i.prototype),t.DefaultHandlers=i}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}(function(){this.$init=function(){return this.$element=r.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){r.addCssClass(this.getElement(),e)},this.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(i.prototype),t.Tooltip=i}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/event"),o=e("../tooltip").Tooltip;function a(e){o.call(this,e)}i.inherits(a,o),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),s=this.getHeight();(e+=15)+i>n&&(e-=e+i-n),(t+=15)+s>r&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=function(e){var t,n,i,o=e.editor,l=o.renderer.$gutterLayer,u=new a(o.container);function c(){t&&(t=clearTimeout(t)),i&&(u.hide(),i=null,o._signal("hideGutterTooltip",u),o.removeEventListener("mousewheel",c))}function h(e){u.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",function(t){if(o.isFocused()&&0==t.getButton()&&"foldWidgets"!=l.getRegion(t)){var n=t.getDocumentPosition().row,r=o.session.selection;if(t.getShiftKey())r.selectTo(n,0);else{if(2==t.domEvent.detail)return o.selectAll(),t.preventDefault();e.$clickSelection=o.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}),e.editor.setDefaultHandler("guttermousemove",function(s){var a=s.domEvent.target||s.domEvent.srcElement;if(r.hasCssClass(a,"ace_fold-widget"))return c();i&&e.$tooltipFollowsMouse&&h(s),n=s,t||(t=setTimeout(function(){t=null,n&&!e.isMousePressed?function(){var t=n.getDocumentPosition().row,r=l.$annotations[t];if(!r)return c();if(t==o.session.getLength()){var s=o.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(s>o.session.documentToScreenRow(a.row,a.column))return c()}if(i!=r)if(i=r.text.join("
"),u.setHtml(i),u.show(),o._signal("showGutterTooltip",u),o.on("mousewheel",c),e.$tooltipFollowsMouse)h(n);else{var d=n.domEvent.target.getBoundingClientRect(),f=u.getElement().style;f.left=d.right+"px",f.top=d.bottom+"px"}}():c()},50))}),s.addListener(o.renderer.$gutter,"mouseout",function(e){n=null,i&&!t&&(t=setTimeout(function(){t=null,c()},50))}),o.on("changeSession",c)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent");function o(e){var t=e.editor,n=r.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),t.addEventListener("mousedown",this.onMouseDown.bind(e));var o,l,u,c,h,d,f,p,m,g,E,v=t.container,C=0;function D(){var e=d;(function(e,n){var r=Date.now(),i=!n||e.row!=n.row,s=!n||e.column!=n.column;!g||i||s?(t.moveCursorToPosition(e),g=r,E={x:l,y:u}):a(E.x,E.y,l,u)>5?g=null:r-g>=200&&(t.renderer.scrollCursorIntoView(),g=null)})(d=t.renderer.screenToTextCoordinates(l,u),e),function(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,s=t.renderer.layerConfig.characterWidth,o=t.renderer.scroller.getBoundingClientRect(),a={x:{left:l-o.left,right:o.right-l},y:{top:u-o.top,bottom:o.bottom-u}},c=Math.min(a.x.left,a.x.right),h=Math.min(a.y.top,a.y.bottom),d={row:e.row,column:e.column};c/s<=2&&(d.column+=a.x.left=200&&t.renderer.scrollCursorIntoView(d):m=r:m=null}(d,e)}function S(){h=t.selection.toOrientedRange(),o=t.session.addMarker(h,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(c),D(),c=setInterval(D,20),C=0,i.addListener(document,"mousemove",y)}function A(){clearInterval(c),t.session.removeMarker(o),o=null,t.selection.fromOrientedRange(h),t.isFocused()&&!p&&t.$resetCursorStyle(),h=null,d=null,C=0,m=null,g=null,i.removeListener(document,"mousemove",y)}this.onDragStart=function(e){if(this.cancelDrag||!v.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}h=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?"copy":"copyMove",s.isOpera&&(t.container.appendChild(n),n.scrollTop=0),i.setDragImage&&i.setDragImage(n,0,0),s.isOpera&&t.container.removeChild(n),i.clearData(),i.setData("Text",t.session.getTextRange()),p=!0,this.setState("drag")},this.onDragEnd=function(e){if(v.draggable=!1,p=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;f||"move"!=n||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||S(),C++,e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||(S(),C++),null!==_&&(_=null),e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragLeave=function(e){if(--C<=0&&o)return A(),f=null,i.preventDefault(e)},this.onDrop=function(e){if(d){var n=e.dataTransfer;if(p)switch(f){case"move":h=h.contains(d.row,d.column)?{start:d,end:d}:t.moveText(h,d);break;case"copy":h=t.moveText(h,d,!0)}else{var r=n.getData("Text");h={start:d,end:t.session.insert(d,r)},t.focus(),f=null}return A(),i.preventDefault(e)}},i.addListener(v,"dragstart",this.onDragStart.bind(e)),i.addListener(v,"dragend",this.onDragEnd.bind(e)),i.addListener(v,"dragenter",this.onDragEnter.bind(e)),i.addListener(v,"dragover",this.onDragOver.bind(e)),i.addListener(v,"dragleave",this.onDragLeave.bind(e)),i.addListener(v,"drop",this.onDrop.bind(e));var _=null;function y(){null==_&&(_=setTimeout(function(){null!=_&&o&&A()},20))}function b(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function T(e){var t=["copy","copymove","all","uninitialized"],n=s.isMac?e.altKey:e.ctrlKey,r="uninitialized";try{r=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var i="none";return n&&t.indexOf(r)>=0?i="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(r)>=0?i="move":t.indexOf(r)>=0&&(i="copy"),i}}function a(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=s.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;s.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton();if(1===(e.domEvent.detail||1)&&0===r&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var i=e.domEvent.target||e.domEvent.srcElement;"unselectable"in i&&(i.unselectable="on"),t.getDragDelay()?(s.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(o.prototype),t.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./mouse_event").MouseEvent,i=e("../lib/dom");t.addTouchListeners=function(e,t){var n,s,o,a,l,u,c,h,d,f="scroll",p=0,m=0,g=0,E=0;function v(){var e,n,r;d||(e=window.navigator&&window.navigator.clipboard,n=!1,r=function(r){var s,o,a=r.target.getAttribute("action");if("more"==a||!n)return n=!n,s=t.getCopyText(),o=t.session.getUndoManager().hasUndo(),void d.replaceChild(i.buildDom(n?["span",!s&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],s&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],s&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],o&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),d.firstChild);"paste"==a?e.readText().then(function(e){t.execCommand(a,e)}):a&&("cut"!=a&&"copy"!=a||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(a)),d.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&t.focus()},d=i.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){f="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),r(e)},onclick:r},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container));var s=t.selection.cursor,o=t.renderer.textToScreenCoordinates(s.row,s.column),a=t.container.getBoundingClientRect();d.style.top=o.pageY-a.top-3+"px",d.style.right="10px",d.style.display="",d.firstChild.style.display="none",t.on("input",C)}function C(e){d&&(d.style.display="none"),t.off("input",C)}function D(){l=null,clearTimeout(l);var e=t.selection.getRange(),n=e.contains(c.row,c.column);!e.isEmpty()&&n||(t.selection.moveToPosition(c),t.selection.selectWord()),f="wait",v()}e.addEventListener("contextmenu",function(e){h&&t.textInput.getElement().focus()}),e.addEventListener("touchstart",function(e){var i=e.touches;if(l||i.length>1)return clearTimeout(l),l=null,o=-1,void(f="zoom");h=t.$mouseHandler.isMousePressed=!0;var u=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,v=e.timeStamp;a=v;var C=i[0],S=C.clientX,A=C.clientY;Math.abs(n-S)+Math.abs(s-A)>u&&(o=-1),n=e.clientX=S,s=e.clientY=A,g=E=0;var _=new r(e,t);if(c=_.getDocumentPosition(),v-o<500&&1==i.length&&!p)m++,e.preventDefault(),e.button=0,function(){l=null,clearTimeout(l),t.selection.moveToPosition(c);var e=m>=2?t.selection.getLineRange(c.row):t.session.getBracketRange(c);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),f="wait"}();else{m=0;var y=t.selection.cursor,b=t.selection.isEmpty()?y:t.selection.anchor,T=t.renderer.$cursorLayer.getPixelPosition(y,!0),R=t.renderer.$cursorLayer.getPixelPosition(b,!0),x=t.renderer.scroller.getBoundingClientRect(),w=function(e,t){return(e/=d)*e+(t=t/u-.75)*t};if(e.clientXN?"cursor":"anchor"),f=N<3.5?"anchor":F<3.5?"cursor":"scroll",l=setTimeout(D,450)}o=v}),e.addEventListener("touchend",function(e){h=t.$mouseHandler.isMousePressed=!1,u&&clearInterval(u),"zoom"==f?(f="",p=0):l?(t.selection.moveToPosition(c),p=0,v()):"scroll"==f?(p+=60,u=setInterval(function(){p--<=0&&(clearInterval(u),u=null),Math.abs(g)<.01&&(g=0),Math.abs(E)<.01&&(E=0),p<20&&(g*=.9),p<20&&(E*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*g,10*E),e==t.session.getScrollTop()&&(p=0)},10),e.preventDefault(),C()):v(),clearTimeout(l),l=null}),e.addEventListener("touchmove",function(e){l&&(clearTimeout(l),l=null);var i=e.touches;if(!(i.length>1||"zoom"==f)){var o=i[0],u=n-o.clientX,c=s-o.clientY;if("wait"==f){if(!(u*u+c*c>4))return e.preventDefault();f="cursor"}n=o.clientX,s=o.clientY,e.clientX=o.clientX,e.clientY=o.clientY;var h=e.timeStamp,d=h-a;if(a=h,"scroll"==f){var p=new r(e,t);p.speed=1,p.wheelX=u,p.wheelY=c,10*Math.abs(u)1&&(i=n[n.length-2]);var o=l[t+"Path"];return null==o?o=l.basePath:"/"==r&&(t=r=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+t+r+i+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,r){var i,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{i=e(n)}catch(e){}if(i&&!t.$loading[n])return r&&r(i);if(t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r),!(t.$loading[n].length>1)){var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var r=t.$loading[n];t.$loading[n]=null,r.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,o),a),u()}};var u=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),u=function(){})};function c(i){if(a&&a.document){l.packaged=i||e.packaged||r.packaged||a.define&&n.amdD.packaged;for(var s={},o="",u=document.currentScript||document._currentScript,c=(u&&u.ownerDocument||document).getElementsByTagName("script"),d=0;d=e){for(s=h+1;s=e;)s++;for(a=h,l=s-1;a=t.length||2!=(l=n[i-1])&&3!=l||2!=(u=t[i+1])&&3!=u?4:(s&&(u=3),u==l?u:4);case 10:return 2==(l=i>0?n[i-1]:5)&&i+10&&2==n[i-1])return 2;if(s)return 4;for(f=i+1,d=t.length;f=1425&&m<=2303||64286==m;if(l=t[f],g&&(1==l||7==l))return 1}return i<1||5==(l=t[i-1])?4:n[i-1];case 5:return s=!1,o=!0,r;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:s=!1;case h:return 4}}function g(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?t>191?0:d[t]:5==n?/[\u0591-\u05f4]/.test(e)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?12:/[\u0660-\u0669\u066b-\u066c]/.test(e)?3:1642==t?c:/[\u06f0-\u06f9]/.test(e)?2:7:32==n&&t<=8287?f[255&t]:254==n&&t>=65136?7:4}t.L=0,t.R=1,t.EN=2,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,n,c){if(e.length<2)return{};var d=e.split(""),f=new Array(d.length),E=new Array(d.length),v=[];r=c?1:0,function(e,t,n,c){var h=r?u:l,d=null,f=null,p=null,E=0,v=null,C=-1,D=null,S=null,A=[];if(!c)for(D=0,c=[];D0)if(16==v){for(D=C;D-1){for(D=C;D=0&&8==c[_];_--)t[_]=r}}(d,v,d.length,n);for(var C=0;C7&&n[C]<13||4===n[C]||n[C]===h)?v[C]=t.ON_R:C>0&&"ل"===d[C-1]&&/\u0622|\u0623|\u0625|\u0627/.test(d[C])&&(v[C-1]=v[C]=t.R_H,C++);for(d[d.length-1]===t.DOT&&(v[d.length-1]=t.B),"‫"===d[0]&&(v[0]=t.RLE),C=0;C=0&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,r=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===r;)r=n,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[e];s&&(void 0===t&&(t=this.getSplitIndex()),t>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&s[i]%2!=0&&i++;for(var a=0;at&&s[i]%2==0&&(o+=this.charWidths[s[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(e,t){var n,r=this.bidiMap,i=r.bidiLevels,s=[],o=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,u=!1,c=!1,h=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,f=0;f=a&&dn+s/2;){if(n+=s,r===i.length-1){s=0;break}s=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!=0&&i[r]%2==0?(e0&&i[r-1]%2==0&&i[r]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&0===s&&i[r-1]%2==0||!this.isRtlDir&&0===r&&i[r]%2!=0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!=0&&0!==s&&r--,t=this.bidiMap.logicalFromVisual[r]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(o.prototype),t.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")})};(function(){r.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},this.$setSelection=function(e,t,n,r){var i=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||s)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n,r="number"==typeof e?e:this.lead.row,i=this.session.getFoldLine(r);return i?(r=i.start.row,n=i.end.row):n=r,!0===t?new o(r,0,n,this.session.getLine(n).length):new o(r,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i)this.moveCursorTo(i.end.row,i.end.column);else{if(this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t)),t>=n.length)return this.moveCursorTo(e,n.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(s)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)}},this.$shortWordEndIndex=function(e){var t,n=0,r=/\s/,i=this.session.tokenRe;if(i.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&r.test(t);)n++;if(n<1)for(i.lastIndex=0;(t=e[n])&&!i.test(t);)if(i.lastIndex=0,n++,r.test(t)){if(n>2){n--;break}for(;(t=e[n])&&r.test(t);)n++;if(n>2)break}}return i.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do{e++,r=this.doc.getLine(e)}while(e0&&/^\s*$/.test(r));n=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(t,n-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n,r=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(r.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(r.column),r.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=r.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?r.column=this.$desiredColumn:this.$desiredColumn=r.column);var i=this.session.screenToDocumentPosition(r.row+e,r.column,n);0!==e&&0===t&&i.row===this.lead.row&&i.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[i.row]&&(i.row>0||e>0)&&i.row++,this.moveCursorTo(i.row,i.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch(e){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,n){"use strict";var r=e("./config"),i=2e3,s=function(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],r=[],i=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",a=[],l=0;l1?this.$applyToken:u.token),h>1&&(/\\\d/.test(u.regex)?c=u.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(h=1,c=this.removeCapturingGroups(u.regex)),u.splitRegex||"string"==typeof u.token||a.push(u)),s[i]=l,i+=h,r.push(c),u.onMatch||(u.onMatch=null)}}r.length||(s[0]=0,r.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){i=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var r=[],i=0,s=n.length;ic){var E=e.substring(c,g-m.length);d.type==f?d.value+=E:(d.type&&u.push(d),d={type:f,value:E})}for(var v=0;vi){for(h>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});c1&&n[0]!==r&&n.unshift("#tmp",r),{tokens:u,state:n.length?n:r}},this.reportError=r.reportError}).call(s.prototype),t.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var n in e){for(var r=e[n],i=0;i=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(void 0!==n)return n;for(n=0;t>0;)n+=e[t-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)}}).call(i.prototype),t.TokenIterator=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r,i=e("../../lib/oop"),s=e("../behaviour").Behaviour,o=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],u=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],c={},h={'"':'"',"'":"'"},d=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,c.rangeCount!=e.multiSelect.rangeCount&&(c={rangeCount:e.multiSelect.rangeCount})),c[t])return r=c[t];r=c[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},f=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},p=function(e){this.add("braces","insertion",function(t,n,i,s,o){var l=i.getCursorPosition(),u=s.doc.getLine(l.row);if("{"==o){d(i);var c=i.getSelectionRange(),h=s.doc.getTextRange(c);if(""!==h&&"{"!==h&&i.getWrapBehavioursEnabled())return f(c,h,"{","}");if(p.isSaneInsertion(i,s))return/[\]\}\)]/.test(u[l.column])||i.inMultiSelectMode||e&&e.braces?(p.recordAutoInsert(i,s,"}"),{text:"{}",selection:[1,1]}):(p.recordMaybeInsert(i,s,"{"),{text:"{",selection:[1,1]})}else if("}"==o){if(d(i),"}"==u.substring(l.column,l.column+1)&&null!==s.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&p.isAutoInsertedClosing(l,u,o))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==o||"\r\n"==o){d(i);var m="";if(p.isMaybeInsertedClosing(l,u)&&(m=a.stringRepeat("}",r.maybeInsertedBrackets),p.clearMaybeInsertedClosing()),"}"===u.substring(l.column,l.column+1)){var g=s.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!g)return null;var E=this.$getIndent(s.getLine(g.row))}else{if(!m)return void p.clearMaybeInsertedClosing();E=this.$getIndent(u)}var v=E+s.getTabString();return{text:"\n"+v+"\n"+E+m,selection:[1,v.length,1,v.length]}}p.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,i,s){var o=i.doc.getTextRange(s);if(!s.isMultiLine()&&"{"==o){if(d(n),"}"==i.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s;r.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if("("==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"(",")");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(")"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"("==s&&(d(n),")"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("brackets","insertion",function(e,t,n,r,i){if("["==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"[","]");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if("]"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"["==s&&(d(n),"]"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("string_dquotes","insertion",function(e,t,n,r,i){var s=r.$mode.$quotes||h;if(1==i.length&&s[i]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(i))return;d(n);var o=i,a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(!(""===l||1==l.length&&s[l])&&n.getWrapBehavioursEnabled())return f(a,l,o,o);if(!l){var u=n.getCursorPosition(),c=r.doc.getLine(u.row),p=c.substring(u.column-1,u.column),m=c.substring(u.column,u.column+1),g=r.getTokenAt(u.row,u.column),E=r.getTokenAt(u.row,u.column+1);if("\\"==p&&g&&/escape/.test(g.type))return null;var v,C=g&&/string|escape/.test(g.type),D=!E||/string|escape/.test(E.type);if(m==o)(v=C!==D)&&/string\.end/.test(E.type)&&(v=!1);else{if(C&&!D)return null;if(C&&D)return null;var S=r.$mode.tokenRe;S.lastIndex=0;var A=S.test(p);S.lastIndex=0;var _=S.test(p);if(A||_)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;var y=c[u.column-2];if(p==o&&(y==o||S.test(y)))return null;v=!0}return{text:v?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.$mode.$quotes||h,o=r.doc.getTextRange(i);if(!i.isMultiLine()&&s.hasOwnProperty(o)&&(d(n),r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==o))return i.end.column++,i})};p.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new o(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",l)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var i=new o(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",l))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",u)},p.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},p.recordAutoInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isAutoInsertedClosing(i,s,r.autoInsertedLineEnd[0])||(r.autoInsertedBrackets=0),r.autoInsertedRow=i.row,r.autoInsertedLineEnd=n+s.substr(i.column),r.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isMaybeInsertedClosing(i,s)||(r.maybeInsertedBrackets=0),r.maybeInsertedRow=i.row,r.maybeInsertedLineStart=s.substr(0,i.column)+n,r.maybeInsertedLineEnd=s.substr(i.column),r.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return r.autoInsertedBrackets>0&&e.row===r.autoInsertedRow&&n===r.autoInsertedLineEnd[0]&&t.substr(e.column)===r.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return r.maybeInsertedBrackets>0&&e.row===r.maybeInsertedRow&&t.substr(e.column)===r.maybeInsertedLineEnd&&t.substr(0,e.column)==r.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){r.autoInsertedLineEnd=r.autoInsertedLineEnd.substr(1),r.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){r&&(r.maybeInsertedBrackets=0,r.maybeInsertedRow=-1)},i.inherits(p,s),t.CstyleBehaviour=p}),ace.define("ace/unicode",["require","exports","module"],function(e,t,n){"use strict";for(var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,s=[],o=0;o2?r%u!=u-1:r%u==0})}else{if(!this.blockComment)return!1;var f=this.blockComment.start,p=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+l.escapeRegExp(f)+")"),g=new RegExp("(?:"+l.escapeRegExp(p)+")\\s*$"),E=function(e,t){C(e,t)||s&&!/\S/.test(e)||(i.insertInLine({row:t,column:e.length},p),i.insertInLine({row:t,column:a},f))},v=function(e,t){var n;(n=e.match(g))&&i.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(m))&&i.removeInLine(t,n[1].length,n[0].length)},C=function(e,n){if(m.test(e))return!0;for(var r=t.getTokens(n),i=0;ie.length&&(S=e.length)}),a==1/0&&(a=S,s=!1,o=!1),c&&a%u!=0&&(a=Math.floor(a/u)*u),D(o?v:E)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(i){!i.start&&i[0]&&(i=i[0]);var s,o,a=(m=new u(t,r.row,r.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var h,d;a&&/comment/.test(a.type);){if(-1!=(g=a.value.indexOf(i.start))){var f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g;h=new c(f,p,f,p+i.start.length);break}a=m.stepBackward()}var m;for(a=(m=new u(t,r.row,r.column)).getCurrentToken();a&&/comment/.test(a.type);){var g;if(-1!=(g=a.value.indexOf(i.end))){f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g,d=new c(f,p,f,p+i.end.length);break}a=m.stepForward()}d&&t.remove(d),h&&(t.remove(h),s=h.start.row,o=-i.start.length)}else o=i.start.length,s=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);l.start.row==s&&(l.start.column+=o),l.end.row==s&&(l.end.column+=o),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var n=e[t],i=n.prototype.$id,s=r.$modes[i];s||(r.$modes[i]=s=new n),r.$modes[t]||(r.$modes[t]=s),this.$embeds.push(t),this.$modes[t]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;tthis.row)){var n=function(t,n,r){var i="insert"==t.action,s=(i?1:-1)*(t.end.row-t.start.row),o=(i?1:-1)*(t.end.column-t.start.column),a=t.start,l=i?a:t.end;return e(n,a,r)?{row:n.row,column:n.column}:e(l,n,!r)?{row:n.row+s,column:n.column+(n.row==l.row?o:0)}:{row:a.row,column:a.column}}(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(e,t,n){var r;if(r=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=r.row||this.column!=r.column){var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=e("./anchor").Anchor,l=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new a(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();void 0===e?e=n:e<0?e=0:e>=n&&(e=n-1,t=void 0);var r=this.getLine(e);return null==t&&(t=r.length),{row:e,column:t=Math.min(Math.max(t,0),r.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof o||(e=o.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,r=n.length-t+1,i=e.start.row,s=e.start.column,o=0,a=0;o20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,-1==r&&(r=t),s<=r&&n.fireUpdateEvent(s,r)}}};(function(){r.implement(this,i),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens}}).call(s.prototype),t.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=(e("./lib/oop"),e("./range").Range),s=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,n,s){if(this.regExp)for(var o=s.firstRow,a=s.lastRow,l=o;l<=a;l++){var u=this.cache[l];null==u&&((u=r.getMatchOffsets(n.getLine(l),this.regExp)).length>this.MAX_RANGES&&(u=u.slice(0,this.MAX_RANGES)),u=u.map(function(e){return new i(l,e.offset,l,e.offset+e.length)}),this.cache[l]=u.length?u:"");for(var c=u.length;c--;)t.drawSingleLineMarker(e,u[c].toScreenRange(n),this.clazz,s)}}}).call(s.prototype),t.SearchHighlight=s}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range;function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var r,i,s=0,o=this.folds,a=!0;null==t&&(t=this.end.row,n=this.end.column);for(var l=0;l0)){var l=r(e,o.start);return 0===a?t&&0!==l?-s-2:s:l>0||0===l&&!t?s:-s-1}}return-s-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},this.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],n=this.ranges,i=(n=n.sort(function(e,t){return r(e.start,t.start)}))[0],s=1;s=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=r);o++);if("insert"==e.action){for(var l=i-r,u=-t.column+n.column;or);o++)if(c.start.row==r&&c.start.column>=t.column&&(c.start.column==t.column&&this.$bias<=0||(c.start.column+=u,c.start.row+=l)),c.end.row==r&&c.end.column>=t.column){if(c.end.column==t.column&&this.$bias<0)continue;c.end.column==t.column&&u>0&&oc.start.column&&c.end.column==s[o+1].start.column&&(c.end.column-=u),c.end.column+=u,c.end.row+=l}}else for(l=r-i,u=t.column-n.column;oi);o++)c.end.rowt.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=u,c.end.row+=l):c.end.row>i&&(c.end.row+=l),c.start.rowt.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=u,c.start.row+=l):c.start.row>i&&(c.start.row+=l);if(0!=l&&o=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;for(t&&(r=n.indexOf(t)),-1==r&&(r=0);r=e)return i}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,r=t-e+1,i=0;i=t){a=e?r-=t-a:r=0);break}o>=e&&(r-=a>=e?o-a:o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n,r=this.$foldData,o=!1;e instanceof s?n=e:(n=new s(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,u=n.end.row,c=n.end.column,h=this.getFoldAt(a,l,1),d=this.getFoldAt(u,c,-1);if(h&&d==h)return h.addSubFold(n);h&&!h.range.isStart(a,l)&&this.removeFold(h),d&&!d.range.isEnd(u,c)&&this.removeFold(d);var f=this.getFoldsInRange(n.range);f.length>0&&(this.removeFolds(f),f.forEach(function(e){n.addSubFold(e)}));for(var p=0;p0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;if(null==e?(n=new r(0,0,this.getLength(),0),t=!0):n="number"==typeof e?new r(e,0,e,this.getLine(e).length):"row"in e?r.fromPoints(e,e):e,i=this.getFoldsInRangeList(n),t)this.removeFolds(i);else for(var s=i;s.length;)this.expandFolds(s),s=this.getFoldsInRangeList(n);if(i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){null==r&&(r=e.start.row),null==i&&(i=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var s=this.doc,o="";return e.walk(function(e,t,n,a){if(!(tc)break}while(s&&l.test(s.type));s=i.stepBackward()}else s=i.getCurrentToken();return u.end.row=i.getCurrentTokenRow(),u.end.column=i.getCurrentTokenColumn()+s.value.length-2,u}},this.foldAll=function(e,t,n){null==n&&(n=1e5);var r=this.foldWidgets;if(r){t=t||this.getLength();for(var i=e=e||0;i=e){i=s.end.row;try{var o=this.addFold("...",s);o&&(o.collapseChildren=n)}catch(e){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};for(var r,i=e-1;i>=0;){var s=n[i];if(null==s&&(s=n[i]=this.getFoldWidget(i)),"start"==s){var o=this.getFoldWidgetRange(i);if(r||(r=o),o&&o.end.row>=e)break}i--}return{range:-1!==i&&o,firstRange:r}},this.onFoldWidgetClick=function(e,t){var n={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var r=t.target||t.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),r=this.getLine(e),i="end"===n?-1:1,s=this.getFoldAt(e,-1===i?0:r.length,i);if(s)return t.children||t.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()&&(s=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(s.range))return this.removeFold(s),s;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,u=a.range.end.row;this.foldAll(l,u,t.all?1e4:0)}else t.children?(u=o?o.end.row:this.getLength(),this.foldAll(e+1,u,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var r=this.getParentFoldRangeData(t,!0);if(n=r.range||r.firstRange){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold("...",n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){"use strict";var r=e("../token_iterator").TokenIterator,i=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(""==n)return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t,n=this.getLine(e.row),r=!0,s=n.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(o||(s=n.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),r=!1),!o)return null;if(o[1]){if(!(a=this.$findClosingBracket(o[1],e)))return null;t=i.fromPoints(e,a),r||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a;if(!(a=this.$findOpeningBracket(o[2],e)))return null;t=i.fromPoints(a,e),r||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn()-2,u=a.value;;){for(;l>=0;){var c=u.charAt(l);if(c==i){if(0==(s-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else c==e&&(s+=1);l-=1}do{a=o.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(u=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn();;){for(var u=a.value,c=u.length;ln&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>1,s=e[i];if(t>s)n=i+1;else{if(!(t=t);s++);return(n=r[s])?(n.index=s,n.start=i-n.value.length,n):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe)),r)var i=this.tokenRe;else i=/^\s+$/.test(n.slice(t-1,t+1))?/\s/:this.nonTokenRe;var s=t;if(s>0){do{s--}while(s>=0&&n.charAt(s).match(i));s++}for(var o=t;oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,s=this.$foldData[i],o=s?s.start.row:1/0,a=t.length,l=0;lo){if((l=s.end.row+1)>=a)break;o=(s=this.$foldData[i++])?s.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>r&&(r=n[l])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var r=e[n];"insert"==r.action||"remove"==r.action?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;ne.end.column&&(s.start.column+=u),s.end.row==e.end.row&&s.end.column>e.end.column&&(s.end.column+=u)),o&&s.start.row>=e.end.row&&(s.start.row+=o,s.end.row+=o)}if(s.end=this.insert(s.start,r),i.length){var a=e.start,l=s.start,u=(o=l.row-a.row,l.column-a.column);this.addFolds(i.map(function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=u),e.end.row==a.row&&(e.end.column+=u),e.start.row+=o,e.end.row+=o,e}))}return s},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},this.outdentRows=function(e){for(var t=e.collapseRows(),n=new c(0,0,0,0),r=this.getTabSize(),i=t.start.row;i<=t.end.row;++i){var s=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o0){var i;if((i=this.getRowFoldEnd(t+n))>this.doc.getLength()-1)return 0;r=i-t}else e=this.$clipRowToDocument(e),r=(t=this.$clipRowToDocument(t))-e+1;var s=new c(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(e){return(e=e.clone()).start.row+=r,e.end.row+=r,e}),a=0==n?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+r,a),o.length&&this.addFolds(o),r},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1&&(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,i=e.end,s=r.row,o=i.row,a=o-s,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[t?"$wrapData":"$rowLengthCache"].splice(s,a);var u=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var c=0;if(m=this.getFoldLine(i.row)){m.addRemoveChars(i.row,i.column,r.column-i.column),m.shiftRow(-a);var h=this.getFoldLine(s);h&&h!==m&&(h.merge(m),m=h),c=u.indexOf(m)+1}for(;c=i.row&&m.shiftRow(-a);o=s}else{var d=Array(a);d.unshift(s,0);var f=t?this.$wrapData:this.$rowLengthCache;if(f.splice.apply(f,d),u=this.$foldData,c=0,m=this.getFoldLine(s)){var p=m.range.compareInside(r.row,r.column);0==p?(m=m.split(r.row,r.column))&&(m.shiftRow(a),m.addRemoveChars(o,0,i.column-r.column)):-1==p&&(m.addRemoveChars(s,0,i.column-r.column),m.shiftRow(a)),c=u.indexOf(m)+1}for(;c=s&&m.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===n&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(m=this.getFoldLine(s))&&m.addRemoveChars(s,r.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),l},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(n,r){var i,s,o=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,u=this.$wrapLimit,c=n;for(r=Math.min(r,o.length-1);c<=r;)(s=this.getFoldLine(c,s))?(i=[],s.walk(function(n,r,s,a){var l;if(null!=n){(l=this.$getDisplayTokens(n,i.length))[0]=e;for(var u=1;u=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}this.$computeWrapSplits=function(n,r,i){if(0==n.length)return[];var s=[],o=n.length,a=0,l=0,u=this.$wrapAsCode,c=this.$indentedSoftWrap,h=r<=Math.max(2*i,8)||!1===c?0:Math.floor(r/2);function d(e){for(var t=e-a,r=a;rr-f;){var p=a+r-f;if(n[p-1]>=10&&n[p]>=10)d(p);else if(n[p]!=e&&n[p]!=t){for(var m=Math.max(p-(r-(r>>2)),a-1);p>m&&n[p]m&&n[p]m&&9==n[p];)p--}else for(;p>m&&n[p]<10;)p--;p>m?d(++p):(2==n[p=a+r]&&p--,d(p-f))}else{for(;p!=a-1&&n[p]!=e;p--);if(p>a){d(p);continue}for(p=a+r;p39&&o<48||o>57&&o<64?i.push(9):o>=4352&&n(o)?i.push(1,2):i.push(1)}return i},this.$getStringScreenWidth=function(e,t,r){if(0==t)return[0,0];var i,s;for(null==t&&(t=1/0),r=r||0,s=0;s=4352&&n(i)?r+=2:r+=1,!(r>t));s++);return[r,s]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0){a=u[c],s=this.$docRowCache[c];var d=e>u[h-1]}else d=!h;for(var f=this.getLength()-1,p=this.getNextFoldLine(s),m=p?p.start.row:1/0;a<=e&&!(a+(l=this.getRowLength(s))>e||s>=f);)a+=l,++s>m&&(s=p.end.row+1,m=(p=this.getNextFoldLine(s,p))?p.start.row:1/0),d&&(this.$docRowCache.push(s),this.$screenRowCache.push(a));if(p&&p.start.row<=s)r=this.getFoldDisplayLine(p),s=p.start.row;else{if(a+l<=e||s>f)return{row:f,column:this.getLine(f).length};r=this.getLine(s),p=null}var g=0,E=Math.floor(e-a);if(this.$useWrapMode){var v=this.$wrapData[s];v&&(i=v[E],E>0&&v.length&&(g=v.indent,o=v[E-1]||v[v.length-1],r=r.substring(o)))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+E,s,E)&&(t=this.$bidiHandler.offsetToCol(n)),o+=this.$getStringScreenWidth(r,t-g)[1],this.$useWrapMode&&o>=i&&(o=i-1),p?p.idxToPosition(o):{row:s,column:o}},this.documentToScreenPosition=function(e,t){if(void 0===t)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r,i=0,s=null;(r=this.getFoldAt(e,t,1))&&(e=r.start.row,t=r.start.column);var o,a=0,l=this.$docRowCache,u=this.$getRowCacheIndex(l,e),c=l.length;if(c&&u>=0){a=l[u],i=this.$screenRowCache[u];var h=e>l[c-1]}else h=!c;for(var d=this.getNextFoldLine(a),f=d?d.start.row:1/0;a=f){if((o=d.end.row+1)>e)break;f=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;i+=this.getRowLength(a),a=o,h&&(this.$docRowCache.push(a),this.$screenRowCache.push(i))}var p="";d&&a>=f?(p=this.getFoldDisplayLine(d,e,t),s=d.start.row):(p=this.getLine(e).substring(0,t),s=e);var m=0;if(this.$useWrapMode){var g=this.$wrapData[s];if(g){for(var E=0;p.length>=g[E];)i++,E++;p=p.substring(g[E-1]||0,p.length),m=E>0?g.indent:0}}return{row:i,column:m+this.$getStringScreenWidth(p)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,r=0,i=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);ri&&(r=t.end.row+1,i=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var o=this.$foldData,a=0;an);s++);return[r,s]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=n}.call(p.prototype),e("./edit_session/folding").Folding.call(p.prototype),e("./edit_session/bracket_match").BracketMatch.call(p.prototype),o.defineOptions(p.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=p}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(){this.$options={}};(function(){this.set=function(e){return i.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i,o){return r=new s(e,n,i,o),!(n==o&&t.start&&t.start.start&&0!=t.skipCurrent&&r.isEqual(t.start)&&(r=null,1))}),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],a=t.re;if(t.$isMultiLine){var l,u=a.length,c=i.length-u;e:for(var h=a.offset||0;h<=c;h++){for(var d=0;dm||(o.push(l=new s(h,m,h+u-1,g)),u>2&&(h=h+u-2))}}else for(var E=0;ES&&o[d].end.row==n.end.row;)d--;for(o=o.slice(E,d+1),E=0,d=o.length;E=a;n--)if(h(n,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(n=l,a=o.row;n>=a;n--)if(h(n,Number.MAX_VALUE,e))return}};else u=function(e){var n=o.row;if(!h(n,o.column,e)){for(n+=1;n<=l;n++)if(h(n,0,e))return;if(0!=t.wrap)for(n=a,l=o.row;n<=l;n++)if(h(n,0,e))return}};if(t.$isMultiLine)var c=n.length,h=function(t,i,s){var o=r?t-c+1:t;if(!(o<0)){var a=e.getLine(o),l=a.search(n[0]);if(!(!r&&li))return!!s(o,l,o+c-1,h)||void 0}}};else h=r?function(t,r,i){var s,o=e.getLine(t),a=[],l=0;for(n.lastIndex=0;s=n.exec(o);){var u=s[0].length;if(l=s.index,!u){if(l>=o.length)break;n.lastIndex=l+=1}if(s.index+u>r)break;a.push(s.index,u)}for(var c=a.length-1;c>=0;c-=2){var h=a[c-1];if(i(t,h,t,h+(u=a[c])))return!0}}:function(t,r,i){var s,o,a=e.getLine(t);for(n.lastIndex=r;o=n.exec(a);){var l=o[0].length;if(i(t,s=o.index,t,s+l))return!0;if(!l&&(n.lastIndex=s+=1,s>=a.length))return!1}};return{forEach:u}}}).call(o.prototype),t.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/keys"),i=e("../lib/useragent"),s=r.KEY_MODS;function o(e,t){this.platform=t||(i.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function a(e,t){o.call(this,e,t),this.$singleCommand=!1}a.prototype=o.prototype,function(){function e(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var n=e&&("string"==typeof e?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var s=r[i];if(s==e)delete r[i];else if(Array.isArray(s)){var o=s.indexOf(e);-1!=o&&(s.splice(o,1),1==s.length&&(r[i]=s[0]))}}},this.bindKey=function(e,t,n){if("object"==typeof e&&e&&(null==n&&(n=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach(function(e){var r="";if(-1!=e.indexOf(" ")){var i=e.split(/\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=s[t.hashId]+t.key;r+=(r?" ":"")+n,this._addCommandToBinding(r,"chainKeys")},this),r+=" "}var o=this.parseKeys(e),a=s[o.hashId]+o.key;this._addCommandToBinding(r+a,t,n)},this)},this._addCommandToBinding=function(t,n,r){var i,s=this.commandKeyBinding;if(n)if(!s[t]||this.$singleCommand)s[t]=n;else{Array.isArray(s[t])?-1!=(i=s[t].indexOf(n))&&s[t].splice(i,1):s[t]=[s[t]],"number"!=typeof r&&(r=e(n));var o=s[t];for(i=0;ir);i++);o.splice(i,0,n)}else delete s[t]},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(n){if("string"==typeof n)return this.bindKey(n,t);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=t),this.addCommand(n))}},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),i=r[n];if(r.FUNCTION_KEYS[i])n=r.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:n.toUpperCase(),hashId:-1}}for(var s=0,o=t.length;o--;){var a=r.KEY_MODS[t[o]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[o]+" in "+e),!1;s|=a}return{key:n,hashId:s}},this.findKeyCommand=function(e,t){var n=s[e]+t;return this.commandKeyBinding[n]},this.handleKeyboard=function(e,t,n,r){if(!(r<0)){var i=s[t]+n,o=this.commandKeyBinding[i];return e.$keyChain&&(e.$keyChain+=" "+i,o=this.commandKeyBinding[e.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(e.$keyChain&&(t&&4!=t||1!=n.length?(-1==t||r>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-i.length-1)),{command:o}):(e.$keyChain=e.$keyChain||i,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(o.prototype),t.HashHandler=o,t.MultiHashHandler=a}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){i.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};r.inherits(o,i),function(){r.implement(this,s),this.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var i={editor:t,command:e,args:n};return i.returnValue=this._emit("exec",i),this._signal("afterExec",i),!1!==i.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map(function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=e("../config"),s=e("../range").Range;function o(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(e){i.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,a=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(n.row),u=n.row+1;u<=i.row+1;u++){var c=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(u)));0!==c.length&&(c=" "+c),l+=c}i.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;o=i.lastRow||r.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var i=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&-1!==n.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var n=this;E.loadModule(["keybinding",e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||i.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=t.findMatchingBracket(e.getCursorPosition());if(n)var r=new f(n.row,n.column,n.row,n.column+1);else t.$mode.getMatching&&(r=t.$mode.getMatching(e.session));r&&(t.$bracketHighlight=t.addMarker(r,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=e.getCursorPosition(),r=new v(e.session,n.row,n.column),i=r.getCurrentToken();if(!i||!/\b(?:tag-open|tag-name)/.test(i.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1==i.type.indexOf("tag-open")||(i=r.stepForward())){var s=i.value,o=0,a=r.stepBackward();if("<"==a.value)do{a=i,(i=r.stepForward())&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"=0);else{do{i=a,a=r.stepBackward(),i&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var n=new f(e.row,e.column,e.row,1/0);n.id=t.addMarker(n,"ace_active-line","screenLine"),t.$highlightLineMarker=n}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var n=t.start.column,r=t.end.column,i=e.getLine(t.start.row),s=i.substring(n,r);if(!(s.length>5e3)&&/[\w\d]/.test(s)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),a=i.substring(n-1,r+1);if(o.test(a))return o}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var r=this.selection.getAllRanges(),i=0;ia.search(/\S|$/)){var l=a.substr(i.column).search(/\S|$/);n.doc.removeInLine(i.row,i.column,i.column+l)}}this.clearSelection();var u=i.column,c=n.getState(i.row),h=(a=n.getLine(i.row),r.checkOutdent(c,a,e));if(n.insert(i,e),s&&s.selection&&(2==s.selection.length?this.selection.setSelectionRange(new f(i.row,u+s.selection[0],i.row,u+s.selection[1])):this.selection.setSelectionRange(new f(i.row+s.selection[0],s.selection[1],i.row+s.selection[2],s.selection[3]))),n.getDocument().isNewLine(e)){var d=r.getNextLineIndent(c,a.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},d)}h&&r.autoOutdent(c,n,i.row)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(e,t){var n;(t.extendLeft||t.extendRight)&&((n=this.selection.getRange()).start.column-=t.extendLeft,n.end.column+=t.extendRight,this.selection.setRange(n),e||n.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((n=this.selection.getRange()).start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,"deletion",this,n,t);if(0===t.end.column){var s=n.getTextRange(t);if("\n"==s[s.length-1]){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var n,r,i=this.session.getLine(e.row);tt.toLowerCase()?1:0});var i=new f(0,0,0,0);for(r=e.first;r<=e.last;r++){var s=t.getLine(r);i.start.row=r,i.end.row=r,i.end.column=s.length,t.replace(i,n[r-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var r=this.session.getLine(e);n.lastIndex=t)return{value:i[0],start:i.index,end:i.index+i[0].length}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new f(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var s=this.getNumberAt(t,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,a=s.start+s.value.length-o,l=parseFloat(s.value);l*=Math.pow(10,a),o!==s.end&&n=a&&o<=l&&(n=t,u.selection.clearSelection(),u.moveCursorTo(e,a+r),u.selection.selectTo(e,l+r)),a=l});for(var c,h=this.$toggleWordPairs,d=0;df+1)break;f=p.last}for(c--,a=this.session.$moveLines(d,f,t?0:e),t&&-1==e&&(h=c+1);h<=c;)o[h].moveBy(a,0),h++;t||(a=0),l+=a}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);!0===t?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):!1===t&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,i*r.lineHeight),null!=t&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new v(this.session,n.row,n.column),i=r.getCurrentToken(),s=i||r.stepForward();if(s){var o,a,l=!1,u={},c=n.column-s.start,h={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;c=0;--s)this.$tryReplace(n[s],e)&&r++;return this.selection.setSelectionRange(i),r},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return null!==(t=this.$search.replace(n,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&r.mixin(t,e);var i=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(i)||this.$search.$options.needle)||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var s=this.$search.find(this.session);return t.preventScroll?s:s?(this.revealRange(s,n),s):(t.backwards?i.start=i.end:i.end=i.start,void this.selection.setRange(i))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(e){var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var s=this.on("changeSelection",function(){r=!0}),o=this.renderer.on("beforeRender",function(){r&&(t=n.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,s=e.$cursorLayer.$pixelPos,o=e.layerConfig,a=s.top-o.offset;null!=(r=s.top>=0&&a+t.top<0||!(s.topwindow.innerHeight)&&null)&&(i.style.top=a+"px",i.style.left=s.left+"px",i.style.height=o.lineHeight+"px",i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",o))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,i.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},this.prompt=function(e,t,n){var r=this;E.loadModule("./ext/prompt",function(i){i.prompt(r,e,t,n)})}}.call(D.prototype),E.defineOptions(D.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?S.attach(this):S.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?S.attach(this):S.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.renderer.$composition||this.getValue();if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),i.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!e&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),i.addCssClass(this.container,"ace_hasPlaceholder");var t=i.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var S={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=D}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,n){this.$fromUndo||e!=this.$lastDelta&&(!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,r=n.length;r--;){var i=n[r][0];if(i.id<=e)break;i.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?a(e):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(r.prototype);var i=e("./range").Range,s=i.comparePoints;function o(e){return{row:e.row,column:e.column}}function a(e){if(e=e||this,Array.isArray(e))return e.map(a).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function u(e,t){var n="insert"==e.action,r="insert"==t.action;if(n&&r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}else if(!n&&r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(!n&&!r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}return[t,e]}function c(e,t){for(var n=e.length;n--;)for(var r=0;r=0?d(e,t,-1):(s(e.start,t.start)<=0||d(e,i.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!n&&r)s(t.start,e.end)>=0?d(t,e,-1):(s(t.start,e.start)<=0||d(t,i.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{var o,a;if(!(s(t.end,e.start)<=0))return s(e.start,t.start)<0&&(o=e,e=p(e,t.start)),s(e.end,t.end)>0&&(a=p(e,t.end)),f(t.end,e.start,e.end,-1),a&&!o&&(e.lines=a.lines,e.start=a.start,e.end=a.end,a=e),[t,o,a].filter(Boolean);d(e,t,-1)}return[t,e]}function d(e,t,n){f(e.start,t.start,t.end,n),f(e.end,t.start,t.end,n)}function f(e,t,n,r){e.row==(1==r?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function p(e,t){var n=e.lines,r=e.end;e.end=o(t);var i=e.end.row-e.start.row,s=n.splice(i,n.length),a=i?t.column:t.column-e.start.column;return n.push(s[0].substring(0,a)),s[0]=s[0].substr(a),{start:o(t),end:r,lines:s,action:e.action}}function m(e,t){t=function(e){return{start:o(e.start),end:o(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var n=e.length;n--;){for(var r=e[n],i=0;is&&(l=i.end.row+1,s=(i=t.getNextFoldLine(l,i))?i.start.row:1/0),l>r){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,e,this.session,u),this.$lines.push(o)),this.$renderCell(o,e,i,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,i=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(i=t.getLength()+r-1);var s=n?n.getWidth(t,i,e):i.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();(s+=o.left+o.right)===this.gutterWidth||isNaN(s)||(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(r.row>this.$cursorRow){var i=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&i&&i.start.row==t[n-1].row))break;r=t[n-1]}r.element.className="ace_gutter-active-line "+r.element.className,this.$cursorCell=r;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;if(this.oldLastRow=n,!t||r0;i--)this.$lines.shift();if(r>n)for(i=this.session.getFoldedRowCount(n+1,r);i>0;i--)this.$lines.pop();e.firstRowr&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,n){for(var r=[],i=t,s=this.session.getNextFoldLine(i),o=s?s.start.row:1/0;i>o&&(i=s.end.row+1,o=(s=this.session.getNextFoldLine(i,s))?s.start.row:1/0),!(i>n);){var a=this.$lines.createCell(i,e,this.session,u);this.$renderCell(a,e,s,i),r.push(a),i++}return r},this.$renderCell=function(e,t,n,i){var s=e.element,o=this.session,a=s.childNodes[0],l=s.childNodes[1],u=o.$firstLineNumber,c=o.$breakpoints,h=o.$decorations,d=o.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&o.foldWidgets,p=n?n.start.row:Number.MAX_VALUE,m="ace_gutter-cell ";if(this.$highlightGutterLine&&(i==this.$cursorRow||n&&i=p&&this.$cursorRow<=n.end.row)&&(m+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),c[i]&&(m+=c[i]),h[i]&&(m+=h[i]),this.$annotations[i]&&(m+=this.$annotations[i].className),s.className!=m&&(s.className=m),f){var g=f[i];null==g&&(g=f[i]=o.getFoldWidget(i))}if(g){m="ace_fold-widget ace_"+g,"start"==g&&i==p&&in.right-t.right?"foldWidgets":void 0}}).call(l.prototype),t.Gutter=l}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/dom"),s=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){function e(e,t,n,r){return(e?1:0)|(t?2:0)|(n?4:0)|(r?8:0)}this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},this.update=function(e){if(e){var t;for(var n in this.config=e,this.i=0,this.markers){var r=this.markers[n];if(r.range){var i=r.range.clipRows(e.firstRow,e.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),r.renderer){var s=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,s,e)}else"fullLine"==r.type?this.drawFullLineMarker(t,i,r.clazz,e):"screenLine"==r.type?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?"text"==r.type?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+" ace_start ace_br15",e)}else r.update(t,this,this.session,e)}if(-1!=this.i)for(;this.if,c==u),s,c==u?0:1,o)},this.drawMultiLineMarker=function(e,t,n,r,i){var s=this.$padding,o=r.lineHeight,a=this.$getTop(t.start.row,r),l=s+t.start.column*r.characterWidth;if(i=i||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((u=t.clone()).end.row=u.start.row,u.end.column=this.session.getLine(u.start.row).length,this.drawBidiSingleLineMarker(e,u,n+" ace_br1 ace_start",r,null,i)):this.elt(n+" ace_br1 ace_start","height:"+o+"px;right:0;top:"+a+"px;left:"+l+"px;"+(i||"")),this.session.$bidiHandler.isBidiRow(t.end.row)){var u;(u=t.clone()).start.row=u.end.row,u.start.column=0,this.drawBidiSingleLineMarker(e,u,n+" ace_br12",r,null,i)}else{a=this.$getTop(t.end.row,r);var c=t.end.column*r.characterWidth;this.elt(n+" ace_br12","height:"+o+"px;width:"+c+"px;top:"+a+"px;left:"+s+"px;"+(i||""))}if(!((o=(t.end.row-t.start.row-1)*r.lineHeight)<=0)){a=this.$getTop(t.start.row+1,r);var h=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+o+"px;right:0;top:"+a+"px;left:"+s+"px;"+(i||""))}},this.drawSingleLineMarker=function(e,t,n,r,i,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,i,s);var o=r.lineHeight,a=(t.end.column+(i||0)-t.start.column)*r.characterWidth,l=this.$getTop(t.start.row,r),u=this.$padding+t.start.column*r.characterWidth;this.elt(n,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+u+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(e,t,n,r,i,s){var o=r.lineHeight,a=this.$getTop(t.start.row,r),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(n,"height:"+o+"px;width:"+e.width+(i||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-s),this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))},this.drawScreenLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))}}).call(s.prototype),t.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=function(e){this.dom=i,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){r.implement(this,a),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;nc&&(a=l.end.row+1,c=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(a>i);){var h=s[o++];if(h){this.dom.removeChildren(h),this.$renderLine(h,a,a==c&&l),u&&(h.style.top=this.$lines.computeLineTop(a,e,this.session)+"px");var d=e.lineHeight*this.session.getRowLength(a)+"px";h.style.height!=d&&(u=!0,h.style.height=d)}a++}if(u)for(;o0;i--)this.$lines.shift();if(t.lastRow>e.lastRow)for(i=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);i>0;i--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,n){for(var r=[],s=t,o=this.session.getNextFoldLine(s),a=o?o.start.row:1/0;s>a&&(s=o.end.row+1,a=(o=this.session.getNextFoldLine(s,o))?o.start.row:1/0),!(s>n);){var l=this.$lines.createCell(s,e,this.session),u=l.element;this.dom.removeChildren(u),i.setStyle(u.style,"height",this.$lines.computeLineHeight(s,e,this.session)+"px"),i.setStyle(u.style,"top",this.$lines.computeLineTop(s,e,this.session)+"px"),this.$renderLine(u,s,s==a&&o),this.$useLineGroups()?u.className="ace_line_group":u.className="ace_line",r.push(l),s++}return r},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,n=e.lastRow,r=this.$lines;r.getLength();)r.pop();r.push(this.$renderLinesFragment(e,t,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,r){for(var i,o=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),u=0;i=a.exec(r);){var c=i[1],h=i[2],d=i[3],f=i[4],p=i[5];if(o.showInvisibles||!h){var m=u!=i.index?r.slice(u,i.index):"";if(u=i.index+i[0].length,m&&l.appendChild(this.dom.createTextNode(m,this.element)),c){var g=o.session.getScreenTabSize(t+i.index);l.appendChild(o.$tabStrings[g].cloneNode(!0)),t+=g-1}else h?o.showInvisibles?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",v.textContent=s.stringRepeat(o.SPACE_CHAR,h.length),l.appendChild(v)):l.appendChild(this.com.createTextNode(h,this.element)):d?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",v.textContent=s.stringRepeat(o.SPACE_CHAR,d.length),l.appendChild(v)):f?(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className=o.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",v.textContent=o.showInvisibles?o.SPACE_CHAR:f,l.appendChild(v)):p&&(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className="ace_cjk",v.textContent=p,l.appendChild(v))}}if(l.appendChild(this.dom.createTextNode(u?r.slice(u):r,this.element)),this.$textToken[n.type])e.appendChild(l);else{var E="ace_"+n.type.replace(/\./g," ace_"),v=this.dom.createElement("span");"fold"==n.type&&(v.style.width=n.value.length*this.config.characterWidth+"px"),v.className=E,v.appendChild(l),e.appendChild(v)}return t+r.length},this.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(" "==t[0]){for(var i=(r-=r%this.tabSize)/this.tabSize,s=0;s=o;)a=this.$renderToken(l,a,c,h.substring(0,o-r)),h=h.substring(o-r),r=o,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(s.stringRepeat(" ",n.indent),this.element)),a=0,o=n[++i]||Number.MAX_VALUE;0!=h.length&&(r+=h.length,a=this.$renderToken(l,a,c,h))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(e,t){var n=0,r=t[0],i=r.value;this.displayIndentGuides&&(i=this.renderIndentGuide(e,i)),i&&(n=this.$renderToken(e,n,r,i));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,r,i);n=this.$renderToken(e,n,r,i)}},this.$renderOverflowMessage=function(e,t,n,r,i){n&&this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=i?"":"",e.appendChild(s)},this.$renderLine=function(e,t,n){if(n||0==n||(n=this.session.getFoldLine(t)),n)var r=this.$getFoldLineTokens(t,n);else r=this.session.getTokens(t);var i=e;if(r.length){var s=this.session.getRowSplitData(t);s&&s.length?(this.$renderWrappedLine(e,r,s),i=e.lastChild):(i=e,this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i)),this.$renderSimpleLine(i,r))}else this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i));if(this.showInvisibles&&i){n&&(t=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,i.appendChild(o)}},this.$getFoldLineTokens=function(e,t){var n=this.session,r=[],i=n.getTokens(e);return t.walk(function(e,t,s,o,a){null!=e?r.push({type:"fold",value:e}):(a&&(i=n.getTokens(t)),i.length&&function(e,t,n){for(var i=0,s=0;s+e[i].value.lengthn-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),s=t+o.length,i+=1);sn?r.push({type:e[i].type,value:o.substring(0,n-s)}):r.push(e[i]),s+=o.length,i+=1}}(i,o,s))},t.end.row,this.session.getLine(t.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),t.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)r.setStyle(t[n].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){r.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){r.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&r.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}else this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||o.top<0)&&n>1)){var a=this.cursors[i++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,o,e,t[n],this.session):this.isCursorInView(o,e)?(r.setStyle(l,"display","block"),r.translate(a,o.left,o.top),r.setStyle(l,"width",Math.round(e.characterWidth)+"px"),r.setStyle(l,"height",e.lineHeight+"px")):r.setStyle(l,"display","none")}}for(;this.cursors.length>i;)this.removeCursor();var u=this.session.getOverwrite();this.$setOverwrite(u),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(i.prototype),t.Cursor=i}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,a=32768,l=function(e){this.element=i.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){r.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(l.prototype);var u=function(e,t){l.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=i.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};r.inherits(u,l),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>a?(this.coeff=a/e,e=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(u.prototype);var c=function(e,t){l.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};r.inherits(c,l),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(c.prototype),t.ScrollBar=u,t.ScrollBarV=u,t.ScrollBarH=c,t.VScrollBar=u,t.HScrollBar=c}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){"use strict";var r=e("./lib/event"),i=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(r.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(i.prototype),t.RenderLoop=i}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,u=256,c="function"==typeof ResizeObserver,h=200,d=t.FontMetrics=function(e){this.el=i.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.innerHTML=s.stringRepeat("X",u),this.$characterSize={width:0,height:0},c?this.$addObserver():this.checkForSizeChanges()};(function(){r.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){var n=t[0].contentRect;e.checkForSizeChanges({height:n.height,width:n.width/u})}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/u};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.innerHTML=s.stringRepeat(e,u),this.$main.getBoundingClientRect().width/u},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=i.buildDom([e(0,0),e(h,0),e(0,h),e(h,h)],this.el)},this.transformCoordinates=function(e,t){function n(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function r(e,t){return[e[0]-t[0],e[1]-t[1]]}function i(e,t){return[e[0]+t[0],e[1]+t[1]]}function s(e,t){return[e*t[0],e*t[1]]}function o(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=s(1/this.$getZoom(this.el),e)),this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),u=o(this.els[2]),c=o(this.els[3]),d=n(r(c,l),r(c,u),r(i(l,u),i(c,a))),f=s(1+d[0],r(l,a)),p=s(1+d[1],r(u,a));if(t){var m=t,g=d[0]*m[0]/h+d[1]*m[1]/h+1,E=i(s(m[0],f),s(m[1],p));return i(s(1/g/h,E),a)}var v=r(e,a),C=n(r(f,s(d[0],v)),r(p,s(d[1],v)),v);return s(h,C)}}).call(d.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./config"),o=e("./layer/gutter").Gutter,a=e("./layer/marker").Marker,l=e("./layer/text").Text,u=e("./layer/cursor").Cursor,c=e("./scrollbar").HScrollBar,h=e("./scrollbar").VScrollBar,d=e("./renderloop").RenderLoop,f=e("./layer/font_metrics").FontMetrics,p=e("./lib/event_emitter").EventEmitter,m='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);opacity: 0.7;transform-origin: left;text-indent: 10px;}',g=e("./lib/useragent"),E=g.isIE;i.importCssString(m,"ace_editor.css");var v=function(e,t){var n=this;this.container=e||i.createElement("div"),i.addCssClass(this.container,"ace_editor"),i.HI_DPI&&i.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=i.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=i.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=i.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var r=this.$textLayer=new l(this.content);this.canvas=r.element,this.$markerFront=new a(this.content),this.$cursorLayer=new u(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new f(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!g.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,p),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),i.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,n){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,r){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var i=this.container;r||(r=i.clientHeight||i.scrollHeight),n||(n=i.clientWidth||i.scrollWidth);var s=this.$updateCachedSize(e,t,n,r);if(!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var s=0,o=this.$size,a={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if(r&&(e||o.height!=r)&&(o.height=r,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL),n&&(e||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,i.setStyle(this.scrollBarH.element.style,"left",t+"px"),i.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),i.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";i.setStyle(this.scrollBarH.element.style,"right",l),i.setStyle(this.scroller.style,"right",l),i.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(s|=this.CHANGE_FULL)}return o.$dirty=!n||!r,s&&this._signal("resize",a),s},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=i.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=i.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var n=this.$cursorLayer.$pixelPos;if(n){t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var r=this.layerConfig,s=n.top,o=n.left;s-=r.offset;var a=t&&t.useTextareaForIME?this.lineHeight:E?0:1;if(s<0||s>r.height-a)i.translate(this.textarea,0,0);else{var l=1,u=this.$size.height-a;if(t)if(t.useTextareaForIME){var c=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(c)[0]}else s+=this.lineHeight+2;else s+=this.lineHeight;(o-=this.scrollLeft)>this.$size.scrollerWidth-l&&(o=this.$size.scrollerWidth-l),o+=this.gutterWidth+this.margin.left,i.setStyle(e,"height",a+"px"),i.setStyle(e,"width",l+"px"),i.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-l),Math.min(s,u))}}}else i.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},this.setMargin=function(e,t,n,r){var i=this.margin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),i.translate(this.content,-this.scrollLeft,-n.offset);var s=n.width+2*this.$padding+"px",o=n.minHeight+"px";i.setStyle(this.content.style,"width",s),i.setStyle(this.content.style,"height",o)}if(e&this.CHANGE_H_SCROLL&&(i.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender")}else this.$changes|=e},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=!(n<=2*this.lineHeight)&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||r!=this.$vScroll){r!=this.$vScroll&&(this.$vScroll=r,this.scrollBarV.setVisible(r));var i=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,i,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength()*this.lineHeight,i=this.$getLongestLine(),s=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-i-2*this.$padding<0),o=this.$horizScroll!==s;o&&(this.$horizScroll=s,this.scrollBarH.setVisible(s));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,u=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;r+=u;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,r-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,i+2*this.$padding-t.scrollerWidth+c.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-r+u<0||this.scrollTop>c.top),d=a!==h;d&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var f,p,m=this.scrollTop%this.lineHeight,g=Math.ceil(l/this.lineHeight)-1,E=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),v=E+g,C=this.lineHeight;E=e.screenToDocumentRow(E,0);var D=e.getFoldLine(E);D&&(E=D.start.row),f=e.documentToScreenRow(E,0),p=e.getRowLength(E)*C,v=Math.min(e.screenToDocumentRow(v,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(v)*C+p,m=this.scrollTop-f*C;var S=0;return(this.layerConfig.width!=i||o)&&(S=this.CHANGE_H_SCROLL),(o||d)&&(S|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(i=this.$getLongestLine())),this.layerConfig={width:i,padding:this.$padding,firstRow:E,firstRowScreen:f,lastRow:v,lineHeight:C,characterWidth:this.characterWidth,minHeight:l,maxHeight:r,offset:m,gutterOffset:C?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/C)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(i-this.$padding),S},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1||tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t,n){if(0!==this.$size.scrollerHeight){var r=this.$cursorLayer.getPixelPosition(e),i=r.left,s=r.top,o=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+o>s?(t&&l+o>s+this.lineHeight&&(s-=t*this.$size.scrollerHeight),0===s&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):l+this.$size.scrollerHeight-ai?(i=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:a,side:s-a>0?1:-1,offsetX:i}},this.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),a=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),i)},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),s=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+s-this.scrollTop}},this.visualizeFocus=function(){i.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){i.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),e.useTextareaForIME=this.$useTextareaForIME,this.$useTextareaForIME?(i.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),i.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText,this.$composition=null,this.$cursorLayer.element.style.display="")},this.addToken=function(e,t,n,r){var i=this.session;i.bgTokenizer.lines[n]=null;var s={type:t,value:e},o=i.getTokens(n);if(null==r)o.push(s);else for(var a=0,l=0;l50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,n){var r=null,i=!1,a=Object.create(s),u=[],c=new l({messageBuffer:u,terminate:function(){},postMessage:function(e){u.push(e),r&&(i?setTimeout(h):h())}});c.setEmitSync=function(e){i=e};var h=function(){var e=u.shift();e.command?r[e.command].apply(r,e.args):e.event&&a._signal(e.event,e.data)};return a.postMessage=function(e){c.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},o.loadModule(["worker",t],function(e){for(r=new e[n](a);u.length;)h()}),c},t.WorkerClient=l,t.createWorker=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(e,t,n,r,i,s){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,i),this.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,s=t.start.column-this.pos.column;if(this.updateAnchors(e),i&&(this.length+=n),i&&!this.session.$fromUndo)if("insert"===e.action)for(var o=this.others.length-1;o>=0;o--){var a={row:(l=this.others[o]).row,column:l.column+s};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(o=this.others.length-1;o>=0;o--){var l;a={row:(l=this.others[o]).row,column:l.column+s},this.doc.remove(new r(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,i){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),i,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)}},this.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new r,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{n=this.getRange();var r=this.isBackwards(),s=n.start.row,o=n.end.row;if(s==o){if(r)var a=n.end,l=n.start;else a=n.start,l=n.end;return this.addRange(i.fromPoints(l,l)),void this.addRange(i.fromPoints(a,a))}var u=[],c=this.getLineRange(s,!0);c.start.column=n.start.column,u.push(c);for(var h=s+1;h1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(r,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],s=e.column0;)E--;if(E>0)for(var v=0;r[v].isEmpty();)v++;for(var C=E;C>=v;C--)r[C].isEmpty()&&r.splice(C,1)}return r}}.call(s.prototype);var d=e("./editor").Editor;function f(e,t){return e.row==t.row&&e.column==t.column}function p(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",o),e.commands.addCommands(u.defaultCommands),function(e){if(e.textInput){var t=e.textInput.getElement(),n=!1;a.addListener(t,"keydown",function(t){var i=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&i?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&r()}),a.addListener(t,"keyup",r),a.addListener(t,"blur",r)}function r(t){n&&(e.renderer.setMouseCursor(""),n=!1)}}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var r=e[n];if(r.marker){this.session.removeMarker(r.marker);var i=t.indexOf(r);-1!=i&&t.splice(i,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(u.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(u.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?r=n.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?r=n.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});else{var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return r}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var r,i=n&&n.keepOrder,o=1==n||n&&n.$byLines,a=this.session,l=this.selection,u=l.rangeList,c=(i?l:u).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var h=l._eventRegistry;l._eventRegistry={};var d=new s(a);this.inVirtualSelectionMode=!0;for(var f=c.length;f--;){if(o)for(;f>0&&c[f].start.row==c[f-1].end.row;)f--;d.fromOrientedRange(c[f]),d.index=f,this.selection=a.selection=d;var p=e.exec?e.exec(this,t||{}):e(this,t||{});r||void 0===p||(r=p),d.toOrientedRange(c[f])}d.detach(),this.selection=a.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=h,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),r}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],r=0;ro&&(o=n.column),rc?e.insert(r,l.stringRepeat(" ",s-c)):e.remove(new i(r.row,r.column,r.row,r.column-s+c)),t.start.column=t.end.column=o,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var c=this.selection.getRange(),h=c.start.row,d=c.end.row,f=h==d;if(f){var p,m=this.session.getLength();do{p=this.session.getLine(d)}while(/[=:]/.test(p)&&++d0);h<0&&(h=0),d>=m&&(d=m-1)}var g=this.session.removeFullLines(h,d);g=this.$reAlignText(g,f),this.session.insert({row:h,column:0},g.join("\n")+"\n"),f||(c.start.column=0,c.end.column=g[g.length-1].length),this.selection.setRange(c)}},this.$reAlignText=function(e,t){var n,r,i,s=!0,o=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==n?(n=t[1].length,r=t[2].length,i=t[3].length,t):(n+r+i!=t[1].length+t[2].length+t[3].length&&(o=!1),n!=t[1].length&&(s=!1),n>t[1].length&&(n=t[1].length),rt[3].length&&(i=t[3].length),t):[e]}).map(t?u:s?o?function(e){return e[2]?a(n+r-e[2].length)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:u:function(e){return e[2]?a(n)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function a(e){return l.stringRepeat(" ",e)}function u(e){return e[2]?a(n)+e[2]+a(r-e[2].length+i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=p,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){p(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,s=e.getLine(t),o=s.search(i);if(-1!=o){for(var a=n||s.length,l=e.getLength(),u=t,c=t;++tu){var f=e.getLine(c).length;return new r(u,a,c,f)}}},this.openingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i+1},a=e.$findClosingBracket(t,o,s);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>o.row&&(a.row--,a.column=e.getLine(a.row).length),r.fromPoints(o,a)}},this.closingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i},a=e.$findOpeningBracket(t,o);if(a)return a.column++,o.column--,r.fromPoints(a,o)}}).call(i.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}e("./range").Range,function(){this.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(n&&e.action){for(var r=e.data,i=r.start.row,s=r.end.row,o="add"==e.action,a=i+1;a0&&!r[i];)i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=s;o++){var a=r[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var u=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(u-=t.scrollLeft),a.el.style.left=u+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}.call(i.prototype),t.LineWidgets=i}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,n){"use strict";var r=e("../line_widgets").LineWidgets,i=e("../lib/dom"),s=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var o=e.getCursorPosition(),a=o.row,l=n.widgetManager.getWidgetsAtRow(a).filter(function(e){return"errorMarker"==e.type})[0];l?l.destroy():a-=t;var u,c=function(e,t,n){var r=e.getAnnotations().sort(s.comparePoints);if(r.length){var i=function(e,t,n){for(var r=0,i=e.length-1;r<=i;){var s=r+i>>1,o=n(t,e[s]);if(o>0)r=s+1;else{if(!(o<0))return s;i=s-1}}return-(r+1)}(r,{row:t,column:-1},s.comparePoints);i<0&&(i=-i-1),i>=r.length?i=n>0?0:r.length-1:0===i&&n<0&&(i=r.length-1);var o=r[i];if(o&&n){if(o.row===t){do{o=r[i+=n]}while(o&&o.row===t);if(!o)return r.slice()}var a=[];t=o.row;do{a[n<0?"unshift":"push"](o),o=r[i+=n]}while(o&&o.row==t);return a.length&&a}}}(n,a,t);if(c){var h=c[0];o.column=(h.pos&&"number"!=typeof h.column?h.pos.sc:h.column)||0,o.row=h.row,u=e.renderer.$gutterLayer.$annotations[o.row]}else{if(l)return;u={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(o.row),e.selection.moveToPosition(o);var d={row:o.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},f=d.el.appendChild(i.createElement("div")),p=d.el.appendChild(i.createElement("div"));p.className="error_widget_arrow "+u.className;var m=e.renderer.$cursorLayer.getPixelPosition(o).left;p.style.left=m+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",f.className="error_widget "+u.className,f.innerHTML=u.text.join("
"),f.appendChild(i.createElement("div"));var g=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(g),n.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(g),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t,r){"use strict";e("./lib/fixoldbrowsers");var i=e("./lib/dom"),s=e("./lib/event"),o=e("./range").Range,a=e("./editor").Editor,l=e("./edit_session").EditSession,u=e("./undomanager").UndoManager,c=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,t.define=n.amdD,t.edit=function(e,n){if("string"==typeof e){var r=e;if(!(e=document.getElementById(r)))throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof a)return e.env.editor;var o="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;o=l.value,e=i.createElement("pre"),l.parentNode.replaceChild(e,l)}else e&&(o=e.textContent,e.innerHTML="");var u=t.createEditSession(o),h=new a(new c(e),u,n),d={document:u,editor:h,onResize:h.resize.bind(h,null)};return l&&(d.textarea=l),s.addListener(window,"resize",d.onResize),h.on("destroy",function(){s.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),h.container.env=h.env=d,h},t.createEditSession=function(e,t){var n=new l(e,t);return n.setUndoManager(new u),n},t.Range=o,t.Editor=a,t.EditSession=l,t.UndoManager=u,t.VirtualRenderer=c,t.version=t.config.version}),ace.require(["ace/ace"],function(t){for(var n in t&&(t.config.init(!0),t.define=ace.define),window.ace||(window.ace=t),t)t.hasOwnProperty(n)&&(window.ace[n]=t[n]);window.ace.default=window.ace,e&&(e.exports=window.ace)}),e.exports={ace}},247(e,t,n){"use strict";var r=n(982),i=n(159),s=n(961);function o(e){var t="https://react.dev/errors/"+e;if(1P||(e.current=M[P],M[P]=null,P--)}function $(e,t){P++,M[P]=e.current,e.current=t}var G,V,W=B(null),H=B(null),j=B(null),z=B(null);function X(e,t){switch($(j,t),$(H,e),$(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=Eh(t=gh(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(W),$(W,e)}function K(){U(W),U(H),U(j)}function Y(e){null!==e.memoizedState&&$(z,e);var t=W.current,n=Eh(t,e.type);t!==n&&($(H,e),$(W,n))}function q(e){H.current===e&&(U(W),U(H)),z.current===e&&(U(z),ud._currentValue=k)}function Q(e){if(void 0===G)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);G=t&&t[1]||"",V=-1)":-1--i||l[r]!==u[i]){var c="\n"+l[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}}while(1<=r&&0<=i);break}}}finally{Z=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Q(n):""}function ee(e,t){switch(e.tag){case 26:case 27:case 5:return Q(e.type);case 16:return Q("Lazy");case 13:return e.child!==t&&null!==t?Q("Suspense Fallback"):Q("Suspense");case 19:return Q("SuspenseList");case 0:case 15:return J(e.type,!1);case 11:return J(e.type.render,!1);case 1:return J(e.type,!0);case 31:return Q("Activity");default:return""}}function te(e){try{var t="",n=null;do{t+=ee(e,n),n=e,e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var ne=Object.prototype.hasOwnProperty,re=r.unstable_scheduleCallback,ie=r.unstable_cancelCallback,se=r.unstable_shouldYield,oe=r.unstable_requestPaint,ae=r.unstable_now,le=r.unstable_getCurrentPriorityLevel,ue=r.unstable_ImmediatePriority,ce=r.unstable_UserBlockingPriority,he=r.unstable_NormalPriority,de=r.unstable_LowPriority,fe=r.unstable_IdlePriority,pe=r.log,me=r.unstable_setDisableYieldValue,ge=null,Ee=null;function ve(e){if("function"==typeof pe&&me(e),Ee&&"function"==typeof Ee.setStrictMode)try{Ee.setStrictMode(ge,e)}catch(e){}}var Ce=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(De(e)/Se|0)|0},De=Math.log,Se=Math.LN2,Ae=256,_e=262144,ye=4194304;function be(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Te(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var i=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var a=134217727&r;return 0!==a?0!==(r=a&~s)?i=be(r):0!==(o&=a)?i=be(o):n||0!==(n=a&~e)&&(i=be(n)):0!==(a=r&~s)?i=be(a):0!==o?i=be(o):n||0!==(n=r&~e)&&(i=be(n)),0===i?0:0!==t&&t!==i&&0===(t&s)&&((s=i&-i)>=(n=t&-t)||32===s&&4194048&n)?t:i}function Re(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function we(){var e=ye;return!(62914560&(ye<<=1))&&(ye=4194304),e}function Fe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ne(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Le(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ce(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function Oe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ce(n),i=1<=bn),xn=String.fromCharCode(32),wn=!1;function Fn(e,t){switch(e){case"keyup":return-1!==_n.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Ln=!1,On={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function In(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!On[e.type]:"textarea"===t}function kn(e,t,n,r){It?kt?kt.push(r):kt=[r]:It=r,0<(t=nh(t,"onChange")).length&&(n=new tn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Mn=null,Pn=null;function Bn(e){Kc(e,0)}function Un(e){if(ft(Qe(e)))return e}function $n(e,t){if("change"===e)return t}var Gn=!1;if($t){var Vn;if($t){var Wn="oninput"in document;if(!Wn){var Hn=document.createElement("div");Hn.setAttribute("oninput","return;"),Wn="function"==typeof Hn.oninput}Vn=Wn}else Vn=!1;Gn=Vn&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Jn(r)}}function tr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?tr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function nr(e){for(var t=pt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=pt((e=t.contentWindow).document)}return t}function rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var ir=$t&&"documentMode"in document&&11>=document.documentMode,sr=null,or=null,ar=null,lr=!1;function ur(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;lr||null==sr||sr!==pt(r)||(r="selectionStart"in(r=sr)&&rr(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},ar&&Zn(ar,r)||(ar=r,0<(r=nh(or,"onSelect")).length&&(t=new tn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=sr)))}function cr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var hr={animationend:cr("Animation","AnimationEnd"),animationiteration:cr("Animation","AnimationIteration"),animationstart:cr("Animation","AnimationStart"),transitionrun:cr("Transition","TransitionRun"),transitionstart:cr("Transition","TransitionStart"),transitioncancel:cr("Transition","TransitionCancel"),transitionend:cr("Transition","TransitionEnd")},dr={},fr={};function pr(e){if(dr[e])return dr[e];if(!hr[e])return e;var t,n=hr[e];for(t in n)if(n.hasOwnProperty(t)&&t in fr)return dr[e]=n[t];return e}$t&&(fr=document.createElement("div").style,"AnimationEvent"in window||(delete hr.animationend.animation,delete hr.animationiteration.animation,delete hr.animationstart.animation),"TransitionEvent"in window||delete hr.transitionend.transition);var mr=pr("animationend"),gr=pr("animationiteration"),Er=pr("animationstart"),vr=pr("transitionrun"),Cr=pr("transitionstart"),Dr=pr("transitioncancel"),Sr=pr("transitionend"),Ar=new Map,_r="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function yr(e,t){Ar.set(e,t),nt(t,[e])}_r.push("scrollEnd");var br="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Tr=[],Rr=0,xr=0;function wr(){for(var e=Rr,t=xr=Rr=0;t>=o,i-=o,ti=1<<32-Ce(t)+i|n<p?(m=h,h=null):m=h.sibling;var g=f(i,h,a[p],l);if(null===g){null===h&&(h=m);break}e&&h&&null===g.alternate&&t(i,h),o=s(g,o,p),null===c?u=g:c.sibling=g,c=g,h=m}if(p===a.length)return n(i,h),ci&&ri(i,p),u;if(null===h){for(;pm?(g=p,p=null):g=p.sibling;var C=f(i,p,v.value,u);if(null===C){null===p&&(p=g);break}e&&p&&null===C.alternate&&t(i,p),a=s(C,a,m),null===h?c=C:h.sibling=C,h=C,p=g}if(v.done)return n(i,p),ci&&ri(i,m),c;if(null===p){for(;!v.done;m++,v=l.next())null!==(v=d(i,v.value,u))&&(a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return ci&&ri(i,m),c}for(p=r(p);!v.done;m++,v=l.next())null!==(v=E(p,i,m,v.value,u))&&(e&&null!==v.alternate&&p.delete(null===v.key?m:v.key),a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return e&&p.forEach(function(e){return t(i,e)}),ci&&ri(i,m),c}(l,u,c=C.call(c),h)}if("function"==typeof c.then)return v(l,u,ls(c),h);if(c.$$typeof===D)return v(l,u,Li(l,c),h);cs(l,c)}return"string"==typeof c&&""!==c||"number"==typeof c||"bigint"==typeof c?(c=""+c,null!==u&&6===u.tag?(n(l,u.sibling),(h=i(u,c)).return=l,l=h):(n(l,u),(h=Wr(c,l.mode,h)).return=l,l=h),a(l)):n(l,u)}return function(e,t,n,r){try{as=0;var i=v(e,t,n,r);return os=null,i}catch(t){if(t===qi||t===Zi)throw t;var s=Pr(29,t,null,e.mode);return s.lanes=r,s.return=e,s}}}var ds=hs(!0),fs=hs(!1),ps=!1;function ms(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Es(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vs(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&du){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ir(e),Or(e,null,n),t}return Fr(e,r,t,n),Ir(e)}function Cs(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Oe(e,n)}}function Ds(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===s?i=s=o:s=s.next=o,n=n.next}while(null!==n);null===s?i=s=t:s=s.next=t}else i=s=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ss=!1;function As(){if(Ss&&null!==Wi)throw Wi}function _s(e,t,n,r){Ss=!1;var i=e.updateQueue;ps=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var l=a,u=l.next;l.next=null,null===o?s=u:o.next=u,o=l;var c=e.alternate;null!==c&&(a=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===a?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l)}if(null!==s){var h=i.baseState;for(o=0,c=u=l=null,a=s;;){var f=-536870913&a.lane,p=f!==a.lane;if(p?(mu&f)===f:(r&f)===f){0!==f&&f===Vi&&(Ss=!0),null!==c&&(c=c.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var m=e,g=a;f=t;var E=n;switch(g.tag){case 1:if("function"==typeof(m=g.payload)){h=m.call(E,h,f);break e}h=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(f="function"==typeof(m=g.payload)?m.call(E,h,f):m))break e;h=d({},h,f);break e;case 2:ps=!0}}null!==(f=a.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=i.callbacks)?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===c?(u=c=p,l=h):c=c.next=p,o|=f;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(p=a).next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}null===c&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null===s&&(i.shared.lanes=0),_u|=o,e.lanes=o,e.memoizedState=h}}function ys(e,t){if("function"!=typeof e)throw Error(o(191,e));e.call(t)}function bs(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;es?s:8;var o,a,l,u=O.T,c={};O.T=c,ca(e,!1,t,n);try{var h=i(),d=O.S;null!==d&&d(c,h),null!==h&&"object"==typeof h&&"function"==typeof h.then?ua(e,t,(o=r,a=[],l={status:"pending",value:null,reason:null,then:function(e){a.push(e)}},h.then(function(){l.status="fulfilled",l.value=o;for(var e=0;e<\/script>",s=s.removeChild(s.firstChild);break;case"select":s="string"==typeof r.is?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s="string"==typeof r.is?a.createElement(i,{is:r.is}):a.createElement(i)}}s[$e]=t,s[Ge]=r;e:for(a=t.child;null!==a;){if(5===a.tag||6===a.tag)s.appendChild(a.stateNode);else if(4!==a.tag&&27!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;null===a.sibling;){if(null===a.return||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=s;e:switch(hh(s,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&ol(t)}}return hl(t),al(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&ol(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));if(e=j.current,Ei(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(i=li))switch(i.tag){case 27:case 5:r=i.memoizedProps}e[$e]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||lh(e.nodeValue,n)))||pi(t,!0)}else(e=mh(e).createTextNode(r))[$e]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(r=Ei(t),null!==n){if(null===e){if(!r)throw Error(o(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(o(557));e[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Ps(t),t):(Ps(t),null);if(128&t.flags)throw Error(o(558))}return hl(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=Ei(t),null!==r&&null!==r.dehydrated){if(null===e){if(!i)throw Error(o(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(o(317));i[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),i=!1}else i=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return 256&t.flags?(Ps(t),t):(Ps(t),null)}return Ps(t),128&t.flags?(t.lanes=n,t):(n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(i=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(i=r.alternate.memoizedState.cachePool.pool),s=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(s=r.memoizedState.cachePool.pool),s!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ul(t,t.updateQueue),hl(t),null);case 4:return K(),null===e&&Zc(t.stateNode.containerInfo),hl(t),null;case 10:return bi(t.type),hl(t),null;case 19:if(U(Bs),null===(r=t.memoizedState))return hl(t),null;if(i=!!(128&t.flags),null===(s=r.rendering))if(i)cl(r,!1);else{if(0!==Au||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(s=Us(e))){for(t.flags|=128,cl(r,!1),e=s.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)$r(n,e),n=n.sibling;return $(Bs,1&Bs.current|2),ci&&ri(t,r.treeForkCount),t.child}e=e.sibling}null!==r.tail&&ae()>Ou&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=Us(s))){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),cl(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!ci)return hl(t),null}else 2*ae()-r.renderingStartTime>Ou&&536870912!==n&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=r.last)?e.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ae(),e.sibling=null,n=Bs.current,$(Bs,i?1&n|2:1&n),ci&&ri(t,r.treeForkCount),e):(hl(t),null);case 22:case 23:return Ps(t),Fs(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?!!(536870912&n)&&!(128&t.flags)&&(hl(t),6&t.subtreeFlags&&(t.flags|=8192)):hl(t),null!==(n=t.updateQueue)&&ul(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&U(zi),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),bi(Pi),hl(t),null;case 25:case 30:return null}throw Error(o(156,t.tag))}function fl(e,t){switch(oi(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return bi(Pi),K(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return q(t),null;case 31:if(null!==t.memoizedState){if(Ps(t),null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Ps(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return U(Bs),null;case 4:return K(),null;case 10:return bi(t.type),null;case 22:case 23:return Ps(t),Fs(),null!==e&&U(zi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return bi(Pi),null;default:return null}}function pl(e,t){switch(oi(t),t.tag){case 3:bi(Pi),K();break;case 26:case 27:case 5:q(t);break;case 4:K();break;case 31:null!==t.memoizedState&&Ps(t);break;case 13:Ps(t);break;case 19:U(Bs);break;case 10:bi(t.type);break;case 22:case 23:Ps(t),Fs(),null!==e&&U(zi);break;case 24:bi(Pi)}}function ml(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var s=n.create,o=n.inst;r=s(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ac(t,t.return,e)}}function gl(e,t,n){try{var r=t.updateQueue,i=null!==r?r.lastEffect:null;if(null!==i){var s=i.next;r=s;do{if((r.tag&e)===e){var o=r.inst,a=o.destroy;if(void 0!==a){o.destroy=void 0,i=t;var l=n,u=a;try{u()}catch(e){Ac(i,l,e)}}}r=r.next}while(r!==s)}}catch(e){Ac(t,t.return,e)}}function El(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{bs(t,n)}catch(t){Ac(e,e.return,t)}}}function vl(e,t,n){n.props=Aa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ac(e,t,n)}}function Cl(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(n){Ac(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(n){Ac(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){Ac(e,t,n)}else n.current=null}function Sl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ac(e,e.return,t)}}function Al(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,a=null,l=null,u=null,c=null,h=null;for(p in n){var d=n[p];if(n.hasOwnProperty(p)&&null!=d)switch(p){case"checked":case"value":break;case"defaultValue":u=d;default:r.hasOwnProperty(p)||uh(e,t,p,null,r,d)}}for(var f in r){var p=r[f];if(d=n[f],r.hasOwnProperty(f)&&(null!=p||null!=d))switch(f){case"type":s=p;break;case"name":i=p;break;case"checked":c=p;break;case"defaultChecked":h=p;break;case"value":a=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(o(137,t));break;default:p!==d&&uh(e,t,f,p,r,d)}}return void Et(e,a,l,u,c,h,s,i);case"select":for(s in p=a=l=f=null,n)if(u=n[s],n.hasOwnProperty(s)&&null!=u)switch(s){case"value":break;case"multiple":p=u;default:r.hasOwnProperty(s)||uh(e,t,s,null,r,u)}for(i in r)if(s=r[i],u=n[i],r.hasOwnProperty(i)&&(null!=s||null!=u))switch(i){case"value":f=s;break;case"defaultValue":l=s;break;case"multiple":a=s;default:s!==u&&uh(e,t,i,s,r,u)}return t=l,n=a,r=p,void(null!=f?Dt(e,!!n,f,!1):!!r!=!!n&&(null!=t?Dt(e,!!n,t,!0):Dt(e,!!n,n?[]:"",!1)));case"textarea":for(l in p=f=null,n)if(i=n[l],n.hasOwnProperty(l)&&null!=i&&!r.hasOwnProperty(l))switch(l){case"value":case"children":break;default:uh(e,t,l,null,r,i)}for(a in r)if(i=r[a],s=n[a],r.hasOwnProperty(a)&&(null!=i||null!=s))switch(a){case"value":f=i;break;case"defaultValue":p=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(o(91));break;default:i!==s&&uh(e,t,a,i,r,s)}return void St(e,f,p);case"option":for(var m in n)f=n[m],n.hasOwnProperty(m)&&null!=f&&!r.hasOwnProperty(m)&&("selected"===m?e.selected=!1:uh(e,t,m,null,r,f));for(u in r)f=r[u],p=n[u],!r.hasOwnProperty(u)||f===p||null==f&&null==p||("selected"===u?e.selected=f&&"function"!=typeof f&&"symbol"!=typeof f:uh(e,t,u,f,r,p));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)f=n[g],n.hasOwnProperty(g)&&null!=f&&!r.hasOwnProperty(g)&&uh(e,t,g,null,r,f);for(c in r)if(f=r[c],p=n[c],r.hasOwnProperty(c)&&f!==p&&(null!=f||null!=p))switch(c){case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(o(137,t));break;default:uh(e,t,c,f,r,p)}return;default:if(Rt(t)){for(var E in n)f=n[E],n.hasOwnProperty(E)&&void 0!==f&&!r.hasOwnProperty(E)&&ch(e,t,E,void 0,r,f);for(h in r)f=r[h],p=n[h],!r.hasOwnProperty(h)||f===p||void 0===f&&void 0===p||ch(e,t,h,f,r,p);return}}for(var v in n)f=n[v],n.hasOwnProperty(v)&&null!=f&&!r.hasOwnProperty(v)&&uh(e,t,v,null,r,f);for(d in r)f=r[d],p=n[d],!r.hasOwnProperty(d)||f===p||null==f&&null==p||uh(e,t,d,f,r,p)}(r,e.type,n,t),r[Ge]=t}catch(t){Ac(e,e.return,t)}}function _l(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&bh(e.type)||4===e.tag}function yl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||_l(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&bh(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function bl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Nt));else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(bl(e,t,n),e=e.sibling;null!==e;)bl(e,t,n),e=e.sibling}function Tl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Tl(e,t,n),e=e.sibling;null!==e;)Tl(e,t,n),e=e.sibling}function Rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);hh(t,r,n),t[$e]=e,t[Ge]=n}catch(t){Ac(e,e.return,t)}}var xl=!1,wl=!1,Fl=!1,Nl="function"==typeof WeakSet?WeakSet:Set,Ll=null;function Ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Xl(e,n),4&r&&ml(5,n);break;case 1:if(Xl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){Ac(n,n.return,e)}else{var i=Aa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ac(n,n.return,e)}}64&r&&El(n),512&r&&Cl(n,n.return);break;case 3:if(Xl(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{bs(e,t)}catch(e){Ac(n,n.return,e)}}break;case 27:null===t&&4&r&&Rl(n);case 26:case 5:Xl(e,n),null===t&&4&r&&Sl(n),512&r&&Cl(n,n.return);break;case 12:Xl(e,n);break;case 31:Xl(e,n),4&r&&Ul(e,n);break;case 13:Xl(e,n),4&r&&$l(e,n),64&r&&null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Tc.bind(null,n));break;case 22:if(!(r=null!==n.memoizedState||xl)){t=null!==t&&null!==t.memoizedState||wl,i=xl;var s=wl;xl=r,(wl=t)&&!s?Yl(e,n,!!(8772&n.subtreeFlags)):Xl(e,n),xl=i,wl=s}break;case 30:break;default:Xl(e,n)}}function Il(e){var t=e.alternate;null!==t&&(e.alternate=null,Il(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&Ke(t),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var kl=null,Ml=!1;function Pl(e,t,n){for(n=n.child;null!==n;)Bl(e,t,n),n=n.sibling}function Bl(e,t,n){if(Ee&&"function"==typeof Ee.onCommitFiberUnmount)try{Ee.onCommitFiberUnmount(ge,n)}catch(e){}switch(n.tag){case 26:wl||Dl(n,t),Pl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:wl||Dl(n,t);var r=kl,i=Ml;bh(n.type)&&(kl=n.stateNode,Ml=!1),Pl(e,t,n),Ph(n.stateNode),kl=r,Ml=i;break;case 5:wl||Dl(n,t);case 6:if(r=kl,i=Ml,kl=null,Pl(e,t,n),Ml=i,null!==(kl=r))if(Ml)try{(9===kl.nodeType?kl.body:"HTML"===kl.nodeName?kl.ownerDocument.body:kl).removeChild(n.stateNode)}catch(e){Ac(n,t,e)}else try{kl.removeChild(n.stateNode)}catch(e){Ac(n,t,e)}break;case 18:null!==kl&&(Ml?(Th(9===(e=kl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Gd(e)):Th(kl,n.stateNode));break;case 4:r=kl,i=Ml,kl=n.stateNode.containerInfo,Ml=!0,Pl(e,t,n),kl=r,Ml=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),wl||gl(4,n,t),Pl(e,t,n);break;case 1:wl||(Dl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&vl(n,t,r)),Pl(e,t,n);break;case 21:Pl(e,t,n);break;case 22:wl=(r=wl)||null!==n.memoizedState,Pl(e,t,n),wl=r;break;default:Pl(e,t,n)}}function Ul(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)){e=e.dehydrated;try{Gd(e)}catch(e){Ac(t,t.return,e)}}}function $l(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{Gd(e)}catch(e){Ac(t,t.return,e)}}function Gl(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Nl),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Nl),t;default:throw Error(o(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Rc.bind(null,e,t);t.then(r,r)}})}function Vl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r title"))),hh(s,r,n),s[$e]=e,Je(s),r=s;break e;case"link":var a=td("link","href",i).get(r+(n.href||""));if(a)for(var l=0;la)break;var c=l.transferSize,h=l.initiatorType;c&&dh(h)&&(o+=c*((l=l.responseEnd)id?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}(h,p)))return Uu=s,e.cancelPendingCommit=p(pc.bind(null,e,t,s,n,r,i,o,a,l,c,h,null,d,f)),void Qu(e,s,o,!u)}pc(e,t,s,n,r,i,o,a,l)}function qu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var r=0;rg&&(o=g,g=m,m=o);var E=er(a,m),v=er(a,g);if(E&&v&&(1!==f.rangeCount||f.anchorNode!==E.node||f.anchorOffset!==E.offset||f.focusNode!==v.node||f.focusOffset!==v.offset)){var C=h.createRange();C.setStart(E.node,E.offset),f.removeAllRanges(),m>g?(f.addRange(C),f.extend(v.node,v.offset)):(C.setEnd(v.node,v.offset),f.addRange(C))}}}}for(h=[],f=a;f=f.parentNode;)1===f.nodeType&&h.push({element:f,left:f.scrollLeft,top:f.scrollTop});for("function"==typeof a.focus&&a.focus(),a=0;an?32:n,O.T=null,n=Gu,Gu=null;var s=Pu,a=Uu;if(Mu=0,Bu=Pu=null,Uu=0,6&du)throw Error(o(331));var l=du;if(du|=4,au(s.current),Jl(s,s.current,a,n),du=l,kc(0,!1),Ee&&"function"==typeof Ee.onPostCommitFiberRoot)try{Ee.onPostCommitFiberRoot(ge,s)}catch(e){}return!0}finally{I.p=i,O.T=r,vc(e,t)}}function Sc(e,t,n){t=Xr(n,t),null!==(e=vs(e,t=xa(e.stateNode,t,2),2))&&(Ne(e,2),Ic(e))}function Ac(e,t,n){if(3===e.tag)Sc(e,e,n);else for(;null!==t;){if(3===t.tag){Sc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===ku||!ku.has(r))){e=Xr(n,e),null!==(r=vs(t,n=wa(2),2))&&(Fa(n,r,t,e),Ne(r,2),Ic(r));break}}t=t.return}}function _c(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hu;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(Du=!0,i.add(n),e=yc.bind(null,e,t,n),t.then(e,e))}function yc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,fu===e&&(mu&n)===n&&(4===Au||3===Au&&(62914560&mu)===mu&&300>ae()-Nu?!(2&du)&&ec(e,0):bu|=n,Ru===mu&&(Ru=0)),Ic(e)}function bc(e,t){0===t&&(t=we()),null!==(e=Lr(e,t))&&(Ne(e,t),Ic(e))}function Tc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),bc(e,n)}function Rc(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}null!==r&&r.delete(t),bc(e,n)}var xc=null,wc=null,Fc=!1,Nc=!1,Lc=!1,Oc=0;function Ic(e){e!==wc&&null===e.next&&(null===wc?xc=wc=e:wc=wc.next=e),Nc=!0,Fc||(Fc=!0,_h(function(){6&du?re(ue,Mc):Pc()}))}function kc(e,t){if(!Lc&&Nc){Lc=!0;do{for(var n=!1,r=xc;null!==r;){if(!t)if(0!==e){var i=r.pendingLanes;if(0===i)var s=0;else{var o=r.suspendedLanes,a=r.pingedLanes;s=(1<<31-Ce(42|e)+1)-1,s=201326741&(s&=i&~(o&~a))?201326741&s|1:s?2|s:0}0!==s&&(n=!0,$c(r,s))}else s=mu,!(3&(s=Te(r,r===fu?s:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Re(r,s)||(n=!0,$c(r,s));r=r.next}}while(n);Lc=!1}}function Mc(){Pc()}function Pc(){Nc=Fc=!1;var e,t=0;0!==Oc&&((e=window.event)&&"popstate"===e.type?e!==Ch&&(Ch=e,1):(Ch=null,0))&&(t=Oc);for(var n=ae(),r=null,i=xc;null!==i;){var s=i.next,o=Bc(i,n);0===o?(i.next=null,null===r?xc=s:r.next=s,null===s&&(wc=r)):(r=i,(0!==t||3&o)&&(Nc=!0)),i=s}0!==Mu&&5!==Mu||kc(t,!1),0!==Oc&&(Oc=0)}function Bc(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=-62914561&e.pendingLanes;0 title"):null)}function rd(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var id=0;function sd(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)ad(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var od=null;function ad(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,od=new Map,t.forEach(ld,e),od=null,sd.call(e))}function ld(e,t){if(!(4&t.state.loading)){var n=od.get(e);if(n)var r=n.get(null);else{n=new Map,od.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s>>1,i=e[r];if(!(0>>1;rs(l,n))us(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[a]=n,r=a);else{if(!(us(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var u=[],c=[],h=1,d=null,f=3,p=!1,m=!1,g=!1,E=!1,v="function"==typeof setTimeout?setTimeout:null,C="function"==typeof clearTimeout?clearTimeout:null,D="undefined"!=typeof setImmediate?setImmediate:null;function S(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function A(e){if(g=!1,S(e),!m)if(null!==r(u))m=!0,y||(y=!0,_());else{var t=r(c);null!==t&&L(A,t.startTime-e)}}var _,y=!1,b=-1,T=5,R=-1;function x(){return!(!E&&t.unstable_now()-Re&&x());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var a=o(d.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof a){d.callback=a,S(e),n=!0;break t}d===r(u)&&i(u),S(e)}else i(u);d=r(u)}if(null!==d)n=!0;else{var l=r(c);null!==l&&L(A,l.startTime-e),n=!1}}break e}finally{d=null,f=s,p=!1}n=void 0}}finally{n?_():y=!1}}}if("function"==typeof D)_=function(){D(w)};else if("undefined"!=typeof MessageChannel){var F=new MessageChannel,N=F.port2;F.port1.onmessage=w,_=function(){N.postMessage(null)}}else _=function(){v(w,0)};function L(e,n){b=v(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125o?(e.sortIndex=s,n(c,e),null===r(u)&&e===r(c)&&(g?(C(b),b=-1):g=!0,L(A,s-o))):(e.sortIndex=a,n(u,e),m||p||(m=!0,y||(y=!0,_()))),e},t.unstable_shouldYield=x,t.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}},982(e,t,n){"use strict";e.exports=n(477)},902(e,t,n){"use strict";var r=n(72),i=n.n(r),s=n(825),o=n.n(s),a=n(659),l=n.n(a),u=n(56),c=n.n(u),h=n(540),d=n.n(h),f=n(113),p=n.n(f),m=n(636),g={};g.styleTagTransform=p(),g.setAttributes=c(),g.insert=l().bind(null,"html"),g.domAPI=o(),g.insertStyleElement=d(),i()(m.A,g),m.A&&m.A.locals&&m.A.locals},72(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},878(e,t,n){"use strict";n.r(t),n.d(t,{EmbeddedFrontend:()=>Id,Spector:()=>kd});var r={};n.r(r),n.d(r,{LX:()=>Jo,ll:()=>ea});var i,s={};n.r(s),n.d(s,{SyntaxError:()=>Xc,parse:()=>Yc});class o{static isBuildableProgram(e){return!!e&&!!e[this.rebuildProgramFunctionName]}static rebuildProgram(e,t,n,r,i){this.isBuildableProgram(e)&&e[this.rebuildProgramFunctionName](t,n,r,i)}}o.rebuildProgramFunctionName="__SPECTOR_rebuildProgram",function(e){e[e.noLog=0]="noLog",e[e.error=1]="error",e[e.warning=2]="warning",e[e.info=3]="info"}(i||(i={}));class a{static error(e,...t){this.level>0&&console.error(e,t)}static warn(e,...t){this.level>1&&console.warn(e,t)}static info(e,...t){this.level>2&&console.log(e,t)}}a.level=i.warning;class l{constructor(){this.callbacks=[],this.counter=-1}add(e,t){return this.counter++,t&&(e=e.bind(t)),this.callbacks[this.counter]=e,this.counter}remove(e){delete this.callbacks[e]}clear(){this.callbacks={}}trigger(e){for(const t in this.callbacks)this.callbacks.hasOwnProperty(t)&&this.callbacks[t](e)}}class u{constructor(){if("undefined"!=typeof performance&&performance.now)this.nowFunction=()=>performance.now();else{const e=new Date;this.nowFunction=e.getTime.bind(e)}}static get now(){return u.instance.nowFunction()}}u.instance=new u;class c{constructor(e){this.options=e}appendAnalysis(e){e.analyses=e.analyses||[];const t=this.getAnalysis(e);e.analyses.push(t)}getAnalysis(e){const t={analyserName:this.analyserName};return this.appendToAnalysis(e,t),t}}class h extends c{get analyserName(){return h.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={};for(const t of e.commands)n[t.name]=n[t.name]||0,n[t.name]++;const r=Object.keys(n).map(e=>[e,n[e]]);r.sort((e,t)=>{const n=t[1]-e[1];return 0===n?e[0].localeCompare(t[0]):n});for(const e of r)t[e[0]]=e[1]}}h.analyserName="Commands";const d=["drawArrays","drawElements","drawArraysInstanced","drawArraysInstancedANGLE","drawElementsInstanced","drawElementsInstancedANGLE","drawRangeElements","multiDrawArraysWEBGL","multiDrawElementsWEBGL","multiDrawArraysInstancedWEBGL","multiDrawElementsInstancedWEBGL","multiDrawArraysInstancedBaseInstanceWEBGL","multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL","drawArraysInstancedBaseInstanceWEBGL","drawElementsInstancedBaseVertexBaseInstanceWEBGL"];class f extends c{get analyserName(){return f.analyserName}appendToAnalysis(e,t){if(e.commands){t.total=e.commands.length,t.draw=0,t.clear=0;for(const n of e.commands)"clear"===n.name?t.clear++:d.indexOf(n.name)>-1&&t.draw++}}}f.analyserName="CommandsSummary";class p{static isWebGlConstant(e){return null!==g[e]&&void 0!==g[e]}static stringifyWebGlConstant(e,t){if(null==e)return"";if(0===e){return this.zeroMeaningByCommand[t]||"0"}if(1===e){return this.oneMeaningByCommand[t]||"1"}const n=g[e];return n?n.name:e+""}}p.DEPTH_BUFFER_BIT={name:"DEPTH_BUFFER_BIT",value:256,description:"Passed to clear to clear the current depth buffer."},p.STENCIL_BUFFER_BIT={name:"STENCIL_BUFFER_BIT",value:1024,description:"Passed to clear to clear the current stencil buffer."},p.COLOR_BUFFER_BIT={name:"COLOR_BUFFER_BIT",value:16384,description:"Passed to clear to clear the current color buffer."},p.POINTS={name:"POINTS",value:0,description:"Passed to drawElements or drawArrays to draw single points."},p.LINES={name:"LINES",value:1,description:"Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it."},p.LINE_LOOP={name:"LINE_LOOP",value:2,description:"Passed to drawElements or drawArrays to draw lines. Each set of two vertices is treated as a separate line segment."},p.LINE_STRIP={name:"LINE_STRIP",value:3,description:"Passed to drawElements or drawArrays to draw a connected group of line segments from the first vertex to the last."},p.TRIANGLES={name:"TRIANGLES",value:4,description:"Passed to drawElements or drawArrays to draw triangles. Each set of three vertices creates a separate triangle."},p.TRIANGLE_STRIP={name:"TRIANGLE_STRIP",value:5,description:"Passed to drawElements or drawArrays to draw a connected group of triangles."},p.TRIANGLE_FAN={name:"TRIANGLE_FAN",value:6,description:"Passed to drawElements or drawArrays to draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan."},p.ZERO={name:"ZERO",value:0,description:"Passed to blendFunc or blendFuncSeparate to turn off a component."},p.ONE={name:"ONE",value:1,description:"Passed to blendFunc or blendFuncSeparate to turn on a component."},p.SRC_COLOR={name:"SRC_COLOR",value:768,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source elements color."},p.ONE_MINUS_SRC_COLOR={name:"ONE_MINUS_SRC_COLOR",value:769,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source elements color."},p.SRC_ALPHA={name:"SRC_ALPHA",value:770,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source's alpha."},p.ONE_MINUS_SRC_ALPHA={name:"ONE_MINUS_SRC_ALPHA",value:771,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source's alpha."},p.DST_ALPHA={name:"DST_ALPHA",value:772,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's alpha."},p.ONE_MINUS_DST_ALPHA={name:"ONE_MINUS_DST_ALPHA",value:773,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's alpha."},p.DST_COLOR={name:"DST_COLOR",value:774,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's color."},p.ONE_MINUS_DST_COLOR={name:"ONE_MINUS_DST_COLOR",value:775,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's color."},p.SRC_ALPHA_SATURATE={name:"SRC_ALPHA_SATURATE",value:776,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the minimum of source's alpha or one minus the destination's alpha."},p.CONSTANT_COLOR={name:"CONSTANT_COLOR",value:32769,description:"Passed to blendFunc or blendFuncSeparate to specify a constant color blend function."},p.ONE_MINUS_CONSTANT_COLOR={name:"ONE_MINUS_CONSTANT_COLOR",value:32770,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant color blend function."},p.CONSTANT_ALPHA={name:"CONSTANT_ALPHA",value:32771,description:"Passed to blendFunc or blendFuncSeparate to specify a constant alpha blend function."},p.ONE_MINUS_CONSTANT_ALPHA={name:"ONE_MINUS_CONSTANT_ALPHA",value:32772,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant alpha blend function."},p.FUNC_ADD={name:"FUNC_ADD",value:32774,description:"Passed to blendEquation or blendEquationSeparate to set an addition blend function."},p.FUNC_SUBSTRACT={name:"FUNC_SUBSTRACT",value:32778,description:"Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination)."},p.FUNC_REVERSE_SUBTRACT={name:"FUNC_REVERSE_SUBTRACT",value:32779,description:"Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source)."},p.BLEND_EQUATION={name:"BLEND_EQUATION",value:32777,description:"Passed to getParameter to get the current RGB blend function."},p.BLEND_EQUATION_RGB={name:"BLEND_EQUATION_RGB",value:32777,description:"Passed to getParameter to get the current RGB blend function. Same as BLEND_EQUATION"},p.BLEND_EQUATION_ALPHA={name:"BLEND_EQUATION_ALPHA",value:34877,description:"Passed to getParameter to get the current alpha blend function. Same as BLEND_EQUATION"},p.BLEND_DST_RGB={name:"BLEND_DST_RGB",value:32968,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_SRC_RGB={name:"BLEND_SRC_RGB",value:32969,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_DST_ALPHA={name:"BLEND_DST_ALPHA",value:32970,description:"Passed to getParameter to get the current destination alpha blend function."},p.BLEND_SRC_ALPHA={name:"BLEND_SRC_ALPHA",value:32971,description:"Passed to getParameter to get the current source alpha blend function."},p.BLEND_COLOR={name:"BLEND_COLOR",value:32773,description:"Passed to getParameter to return a the current blend color."},p.ARRAY_BUFFER_BINDING={name:"ARRAY_BUFFER_BINDING",value:34964,description:"Passed to getParameter to get the array buffer binding."},p.ELEMENT_ARRAY_BUFFER_BINDING={name:"ELEMENT_ARRAY_BUFFER_BINDING",value:34965,description:"Passed to getParameter to get the current element array buffer."},p.LINE_WIDTH={name:"LINE_WIDTH",value:2849,description:"Passed to getParameter to get the current lineWidth (set by the lineWidth method)."},p.ALIASED_POINT_SIZE_RANGE={name:"ALIASED_POINT_SIZE_RANGE",value:33901,description:"Passed to getParameter to get the current size of a point drawn with gl.POINTS"},p.ALIASED_LINE_WIDTH_RANGE={name:"ALIASED_LINE_WIDTH_RANGE",value:33902,description:"Passed to getParameter to get the range of available widths for a line. Returns a length-2 array with the lo value at 0, and hight at 1."},p.CULL_FACE_MODE={name:"CULL_FACE_MODE",value:2885,description:"Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK"},p.FRONT_FACE={name:"FRONT_FACE",value:2886,description:"Passed to getParameter to determine the current value of frontFace. Should return CW or CCW."},p.DEPTH_RANGE={name:"DEPTH_RANGE",value:2928,description:"Passed to getParameter to return a length-2 array of floats giving the current depth range."},p.DEPTH_WRITEMASK={name:"DEPTH_WRITEMASK",value:2930,description:"Passed to getParameter to determine if the depth write mask is enabled."},p.DEPTH_CLEAR_VALUE={name:"DEPTH_CLEAR_VALUE",value:2931,description:"Passed to getParameter to determine the current depth clear value."},p.DEPTH_FUNC={name:"DEPTH_FUNC",value:2932,description:"Passed to getParameter to get the current depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_CLEAR_VALUE={name:"STENCIL_CLEAR_VALUE",value:2961,description:"Passed to getParameter to get the value the stencil will be cleared to."},p.STENCIL_FUNC={name:"STENCIL_FUNC",value:2962,description:"Passed to getParameter to get the current stencil function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_FAIL={name:"STENCIL_FAIL",value:2964,description:"Passed to getParameter to get the current stencil fail function. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_FAIL={name:"STENCIL_PASS_DEPTH_FAIL",value:2965,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test fail. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_PASS={name:"STENCIL_PASS_DEPTH_PASS",value:2966,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test pass. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_REF={name:"STENCIL_REF",value:2967,description:"Passed to getParameter to get the reference value used for stencil tests."},p.STENCIL_VALUE_MASK={name:"STENCIL_VALUE_MASK",value:2963,description:" "},p.STENCIL_WRITEMASK={name:"STENCIL_WRITEMASK",value:2968,description:" "},p.STENCIL_BACK_FUNC={name:"STENCIL_BACK_FUNC",value:34816,description:" "},p.STENCIL_BACK_FAIL={name:"STENCIL_BACK_FAIL",value:34817,description:" "},p.STENCIL_BACK_PASS_DEPTH_FAIL={name:"STENCIL_BACK_PASS_DEPTH_FAIL",value:34818,description:" "},p.STENCIL_BACK_PASS_DEPTH_PASS={name:"STENCIL_BACK_PASS_DEPTH_PASS",value:34819,description:" "},p.STENCIL_BACK_REF={name:"STENCIL_BACK_REF",value:36003,description:" "},p.STENCIL_BACK_VALUE_MASK={name:"STENCIL_BACK_VALUE_MASK",value:36004,description:" "},p.STENCIL_BACK_WRITEMASK={name:"STENCIL_BACK_WRITEMASK",value:36005,description:" "},p.VIEWPORT={name:"VIEWPORT",value:2978,description:"Returns an Int32Array with four elements for the current viewport dimensions."},p.SCISSOR_BOX={name:"SCISSOR_BOX",value:3088,description:"Returns an Int32Array with four elements for the current scissor box dimensions."},p.COLOR_CLEAR_VALUE={name:"COLOR_CLEAR_VALUE",value:3106,description:" "},p.COLOR_WRITEMASK={name:"COLOR_WRITEMASK",value:3107,description:" "},p.UNPACK_ALIGNMENT={name:"UNPACK_ALIGNMENT",value:3317,description:" "},p.PACK_ALIGNMENT={name:"PACK_ALIGNMENT",value:3333,description:" "},p.MAX_TEXTURE_SIZE={name:"MAX_TEXTURE_SIZE",value:3379,description:" "},p.MAX_VIEWPORT_DIMS={name:"MAX_VIEWPORT_DIMS",value:3386,description:" "},p.SUBPIXEL_BITS={name:"SUBPIXEL_BITS",value:3408,description:" "},p.RED_BITS={name:"RED_BITS",value:3410,description:" "},p.GREEN_BITS={name:"GREEN_BITS",value:3411,description:" "},p.BLUE_BITS={name:"BLUE_BITS",value:3412,description:" "},p.ALPHA_BITS={name:"ALPHA_BITS",value:3413,description:" "},p.DEPTH_BITS={name:"DEPTH_BITS",value:3414,description:" "},p.STENCIL_BITS={name:"STENCIL_BITS",value:3415,description:" "},p.POLYGON_OFFSET_UNITS={name:"POLYGON_OFFSET_UNITS",value:10752,description:" "},p.POLYGON_OFFSET_FACTOR={name:"POLYGON_OFFSET_FACTOR",value:32824,description:" "},p.TEXTURE_BINDING_2D={name:"TEXTURE_BINDING_2D",value:32873,description:" "},p.SAMPLE_BUFFERS={name:"SAMPLE_BUFFERS",value:32936,description:" "},p.SAMPLES={name:"SAMPLES",value:32937,description:" "},p.SAMPLE_COVERAGE_VALUE={name:"SAMPLE_COVERAGE_VALUE",value:32938,description:" "},p.SAMPLE_COVERAGE_INVERT={name:"SAMPLE_COVERAGE_INVERT",value:32939,description:" "},p.COMPRESSED_TEXTURE_FORMATS={name:"COMPRESSED_TEXTURE_FORMATS",value:34467,description:" "},p.VENDOR={name:"VENDOR",value:7936,description:" "},p.RENDERER={name:"RENDERER",value:7937,description:" "},p.VERSION={name:"VERSION",value:7938,description:" "},p.IMPLEMENTATION_COLOR_READ_TYPE={name:"IMPLEMENTATION_COLOR_READ_TYPE",value:35738,description:" "},p.IMPLEMENTATION_COLOR_READ_FORMAT={name:"IMPLEMENTATION_COLOR_READ_FORMAT",value:35739,description:" "},p.BROWSER_DEFAULT_WEBGL={name:"BROWSER_DEFAULT_WEBGL",value:37444,description:" "},p.STATIC_DRAW={name:"STATIC_DRAW",value:35044,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and not change often."},p.STREAM_DRAW={name:"STREAM_DRAW",value:35040,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to not be used often."},p.DYNAMIC_DRAW={name:"DYNAMIC_DRAW",value:35048,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and change often."},p.ARRAY_BUFFER={name:"ARRAY_BUFFER",value:34962,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.ELEMENT_ARRAY_BUFFER={name:"ELEMENT_ARRAY_BUFFER",value:34963,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.BUFFER_SIZE={name:"BUFFER_SIZE",value:34660,description:"Passed to getBufferParameter to get a buffer's size."},p.BUFFER_USAGE={name:"BUFFER_USAGE",value:34661,description:"Passed to getBufferParameter to get the hint for the buffer passed in when it was created."},p.CURRENT_VERTEX_ATTRIB={name:"CURRENT_VERTEX_ATTRIB",value:34342,description:"Passed to getVertexAttrib to read back the current vertex attribute."},p.VERTEX_ATTRIB_ARRAY_ENABLED={name:"VERTEX_ATTRIB_ARRAY_ENABLED",value:34338,description:" "},p.VERTEX_ATTRIB_ARRAY_SIZE={name:"VERTEX_ATTRIB_ARRAY_SIZE",value:34339,description:" "},p.VERTEX_ATTRIB_ARRAY_STRIDE={name:"VERTEX_ATTRIB_ARRAY_STRIDE",value:34340,description:" "},p.VERTEX_ATTRIB_ARRAY_TYPE={name:"VERTEX_ATTRIB_ARRAY_TYPE",value:34341,description:" "},p.VERTEX_ATTRIB_ARRAY_NORMALIZED={name:"VERTEX_ATTRIB_ARRAY_NORMALIZED",value:34922,description:" "},p.VERTEX_ATTRIB_ARRAY_POINTER={name:"VERTEX_ATTRIB_ARRAY_POINTER",value:34373,description:" "},p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING={name:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",value:34975,description:" "},p.CULL_FACE={name:"CULL_FACE",value:2884,description:"Passed to enable/disable to turn on/off culling. Can also be used with getParameter to find the current culling method."},p.FRONT={name:"FRONT",value:1028,description:"Passed to cullFace to specify that only front faces should be drawn."},p.BACK={name:"BACK",value:1029,description:"Passed to cullFace to specify that only back faces should be drawn."},p.FRONT_AND_BACK={name:"FRONT_AND_BACK",value:1032,description:"Passed to cullFace to specify that front and back faces should be drawn."},p.BLEND={name:"BLEND",value:3042,description:"Passed to enable/disable to turn on/off blending. Can also be used with getParameter to find the current blending method."},p.DEPTH_TEST={name:"DEPTH_TEST",value:2929,description:"Passed to enable/disable to turn on/off the depth test. Can also be used with getParameter to query the depth test."},p.DITHER={name:"DITHER",value:3024,description:"Passed to enable/disable to turn on/off dithering. Can also be used with getParameter to find the current dithering method."},p.POLYGON_OFFSET_FILL={name:"POLYGON_OFFSET_FILL",value:32823,description:"Passed to enable/disable to turn on/off the polygon offset. Useful for rendering hidden-line images, decals, and or solids with highlighted edges. Can also be used with getParameter to query the scissor test."},p.SAMPLE_ALPHA_TO_COVERAGE={name:"SAMPLE_ALPHA_TO_COVERAGE",value:32926,description:"Passed to enable/disable to turn on/off the alpha to coverage. Used in multi-sampling alpha channels."},p.SAMPLE_COVERAGE={name:"SAMPLE_COVERAGE",value:32928,description:"Passed to enable/disable to turn on/off the sample coverage. Used in multi-sampling."},p.SCISSOR_TEST={name:"SCISSOR_TEST",value:3089,description:"Passed to enable/disable to turn on/off the scissor test. Can also be used with getParameter to query the scissor test."},p.STENCIL_TEST={name:"STENCIL_TEST",value:2960,description:"Passed to enable/disable to turn on/off the stencil test. Can also be used with getParameter to query the stencil test."},p.NO_ERROR={name:"NO_ERROR",value:0,description:"Returned from getError."},p.INVALID_ENUM={name:"INVALID_ENUM",value:1280,description:"Returned from getError."},p.INVALID_VALUE={name:"INVALID_VALUE",value:1281,description:"Returned from getError."},p.INVALID_OPERATION={name:"INVALID_OPERATION",value:1282,description:"Returned from getError."},p.OUT_OF_MEMORY={name:"OUT_OF_MEMORY",value:1285,description:"Returned from getError."},p.CONTEXT_LOST_WEBGL={name:"CONTEXT_LOST_WEBGL",value:37442,description:"Returned from getError."},p.CW={name:"CW",value:2304,description:"Passed to frontFace to specify the front face of a polygon is drawn in the clockwise direction"},p.CCW={name:"CCW",value:2305,description:"Passed to frontFace to specify the front face of a polygon is drawn in the counter clockwise direction"},p.DONT_CARE={name:"DONT_CARE",value:4352,description:"There is no preference for this behavior."},p.FASTEST={name:"FASTEST",value:4353,description:"The most efficient behavior should be used."},p.NICEST={name:"NICEST",value:4354,description:"The most correct or the highest quality option should be used."},p.GENERATE_MIPMAP_HINT={name:"GENERATE_MIPMAP_HINT",value:33170,description:"Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap()."},p.BYTE={name:"BYTE",value:5120,description:" "},p.UNSIGNED_BYTE={name:"UNSIGNED_BYTE",value:5121,description:" "},p.SHORT={name:"SHORT",value:5122,description:" "},p.UNSIGNED_SHORT={name:"UNSIGNED_SHORT",value:5123,description:" "},p.INT={name:"INT",value:5124,description:" "},p.UNSIGNED_INT={name:"UNSIGNED_INT",value:5125,description:" "},p.FLOAT={name:"FLOAT",value:5126,description:" "},p.DEPTH_COMPONENT={name:"DEPTH_COMPONENT",value:6402,description:" "},p.ALPHA={name:"ALPHA",value:6406,description:" "},p.RGB={name:"RGB",value:6407,description:" "},p.RGBA={name:"RGBA",value:6408,description:" "},p.LUMINANCE={name:"LUMINANCE",value:6409,description:" "},p.LUMINANCE_ALPHA={name:"LUMINANCE_ALPHA",value:6410,description:" "},p.UNSIGNED_SHORT_4_4_4_4={name:"UNSIGNED_SHORT_4_4_4_4",value:32819,description:" "},p.UNSIGNED_SHORT_5_5_5_1={name:"UNSIGNED_SHORT_5_5_5_1",value:32820,description:" "},p.UNSIGNED_SHORT_5_6_5={name:"UNSIGNED_SHORT_5_6_5",value:33635,description:" "},p.FRAGMENT_SHADER={name:"FRAGMENT_SHADER",value:35632,description:"Passed to createShader to define a fragment shader."},p.VERTEX_SHADER={name:"VERTEX_SHADER",value:35633,description:"Passed to createShader to define a vertex shader"},p.COMPILE_STATUS={name:"COMPILE_STATUS",value:35713,description:"Passed to getShaderParamter to get the status of the compilation. Returns false if the shader was not compiled. You can then query getShaderInfoLog to find the exact error"},p.DELETE_STATUS={name:"DELETE_STATUS",value:35712,description:"Passed to getShaderParamter to determine if a shader was deleted via deleteShader. Returns true if it was, false otherwise."},p.LINK_STATUS={name:"LINK_STATUS",value:35714,description:"Passed to getProgramParameter after calling linkProgram to determine if a program was linked correctly. Returns false if there were errors. Use getProgramInfoLog to find the exact error."},p.VALIDATE_STATUS={name:"VALIDATE_STATUS",value:35715,description:"Passed to getProgramParameter after calling validateProgram to determine if it is valid. Returns false if errors were found."},p.ATTACHED_SHADERS={name:"ATTACHED_SHADERS",value:35717,description:"Passed to getProgramParameter after calling attachShader to determine if the shader was attached correctly. Returns false if errors occurred."},p.COMPLETION_STATUS_KHR={name:"COMPLETION_STATUS_KHR",value:37297,description:"Passed to getProgramParameter (KHR_parallel_shader_compile) to query whether an asynchronous shader/program link has completed. Returns true once the program is ready to use without blocking."},p.ACTIVE_ATTRIBUTES={name:"ACTIVE_ATTRIBUTES",value:35721,description:"Passed to getProgramParameter to get the number of attributes active in a program."},p.ACTIVE_UNIFORMS={name:"ACTIVE_UNIFORMS",value:35718,description:"Passed to getProgramParamter to get the number of uniforms active in a program."},p.MAX_VERTEX_ATTRIBS={name:"MAX_VERTEX_ATTRIBS",value:34921,description:" "},p.MAX_VERTEX_UNIFORM_VECTORS={name:"MAX_VERTEX_UNIFORM_VECTORS",value:36347,description:" "},p.MAX_VARYING_VECTORS={name:"MAX_VARYING_VECTORS",value:36348,description:" "},p.MAX_COMBINED_TEXTURE_IMAGE_UNITS={name:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",value:35661,description:" "},p.MAX_VERTEX_TEXTURE_IMAGE_UNITS={name:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",value:35660,description:" "},p.MAX_TEXTURE_IMAGE_UNITS={name:"MAX_TEXTURE_IMAGE_UNITS",value:34930,description:"Implementation dependent number of maximum texture units. At least 8."},p.MAX_FRAGMENT_UNIFORM_VECTORS={name:"MAX_FRAGMENT_UNIFORM_VECTORS",value:36349,description:" "},p.SHADER_TYPE={name:"SHADER_TYPE",value:35663,description:" "},p.SHADING_LANGUAGE_VERSION={name:"SHADING_LANGUAGE_VERSION",value:35724,description:" "},p.CURRENT_PROGRAM={name:"CURRENT_PROGRAM",value:35725,description:" "},p.NEVER={name:"NEVER",value:512,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn."},p.ALWAYS={name:"ALWAYS",value:519,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn."},p.LESS={name:"LESS",value:513,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value."},p.EQUAL={name:"EQUAL",value:514,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value."},p.LEQUAL={name:"LEQUAL",value:515,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value."},p.GREATER={name:"GREATER",value:516,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value."},p.GEQUAL={name:"GEQUAL",value:518,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value."},p.NOTEQUAL={name:"NOTEQUAL",value:517,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value."},p.KEEP={name:"KEEP",value:7680,description:" "},p.REPLACE={name:"REPLACE",value:7681,description:" "},p.INCR={name:"INCR",value:7682,description:" "},p.DECR={name:"DECR",value:7683,description:" "},p.INVERT={name:"INVERT",value:5386,description:" "},p.INCR_WRAP={name:"INCR_WRAP",value:34055,description:" "},p.DECR_WRAP={name:"DECR_WRAP",value:34056,description:" "},p.NEAREST={name:"NEAREST",value:9728,description:" "},p.LINEAR={name:"LINEAR",value:9729,description:" "},p.NEAREST_MIPMAP_NEAREST={name:"NEAREST_MIPMAP_NEAREST",value:9984,description:" "},p.LINEAR_MIPMAP_NEAREST={name:"LINEAR_MIPMAP_NEAREST",value:9985,description:" "},p.NEAREST_MIPMAP_LINEAR={name:"NEAREST_MIPMAP_LINEAR",value:9986,description:" "},p.LINEAR_MIPMAP_LINEAR={name:"LINEAR_MIPMAP_LINEAR",value:9987,description:" "},p.TEXTURE_MAG_FILTER={name:"TEXTURE_MAG_FILTER",value:10240,description:" "},p.TEXTURE_MIN_FILTER={name:"TEXTURE_MIN_FILTER",value:10241,description:" "},p.TEXTURE_WRAP_S={name:"TEXTURE_WRAP_S",value:10242,description:" "},p.TEXTURE_WRAP_T={name:"TEXTURE_WRAP_T",value:10243,description:" "},p.TEXTURE_2D={name:"TEXTURE_2D",value:3553,description:" "},p.TEXTURE={name:"TEXTURE",value:5890,description:" "},p.TEXTURE_CUBE_MAP={name:"TEXTURE_CUBE_MAP",value:34067,description:" "},p.TEXTURE_BINDING_CUBE_MAP={name:"TEXTURE_BINDING_CUBE_MAP",value:34068,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_X={name:"TEXTURE_CUBE_MAP_POSITIVE_X",value:34069,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_X={name:"TEXTURE_CUBE_MAP_NEGATIVE_X",value:34070,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Y={name:"TEXTURE_CUBE_MAP_POSITIVE_Y",value:34071,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Y={name:"TEXTURE_CUBE_MAP_NEGATIVE_Y",value:34072,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Z={name:"TEXTURE_CUBE_MAP_POSITIVE_Z",value:34073,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Z={name:"TEXTURE_CUBE_MAP_NEGATIVE_Z",value:34074,description:" "},p.MAX_CUBE_MAP_TEXTURE_SIZE={name:"MAX_CUBE_MAP_TEXTURE_SIZE",value:34076,description:" "},p.TEXTURE0={name:"TEXTURE0",value:33984,description:"A texture unit."},p.TEXTURE1={name:"TEXTURE1",value:33985,description:"A texture unit."},p.TEXTURE2={name:"TEXTURE2",value:33986,description:"A texture unit."},p.TEXTURE3={name:"TEXTURE3",value:33987,description:"A texture unit."},p.TEXTURE4={name:"TEXTURE4",value:33988,description:"A texture unit."},p.TEXTURE5={name:"TEXTURE5",value:33989,description:"A texture unit."},p.TEXTURE6={name:"TEXTURE6",value:33990,description:"A texture unit."},p.TEXTURE7={name:"TEXTURE7",value:33991,description:"A texture unit."},p.TEXTURE8={name:"TEXTURE8",value:33992,description:"A texture unit."},p.TEXTURE9={name:"TEXTURE9",value:33993,description:"A texture unit."},p.TEXTURE10={name:"TEXTURE10",value:33994,description:"A texture unit."},p.TEXTURE11={name:"TEXTURE11",value:33995,description:"A texture unit."},p.TEXTURE12={name:"TEXTURE12",value:33996,description:"A texture unit."},p.TEXTURE13={name:"TEXTURE13",value:33997,description:"A texture unit."},p.TEXTURE14={name:"TEXTURE14",value:33998,description:"A texture unit."},p.TEXTURE15={name:"TEXTURE15",value:33999,description:"A texture unit."},p.TEXTURE16={name:"TEXTURE16",value:34e3,description:"A texture unit."},p.TEXTURE17={name:"TEXTURE17",value:34001,description:"A texture unit."},p.TEXTURE18={name:"TEXTURE18",value:34002,description:"A texture unit."},p.TEXTURE19={name:"TEXTURE19",value:34003,description:"A texture unit."},p.TEXTURE20={name:"TEXTURE20",value:34004,description:"A texture unit."},p.TEXTURE21={name:"TEXTURE21",value:34005,description:"A texture unit."},p.TEXTURE22={name:"TEXTURE22",value:34006,description:"A texture unit."},p.TEXTURE23={name:"TEXTURE23",value:34007,description:"A texture unit."},p.TEXTURE24={name:"TEXTURE24",value:34008,description:"A texture unit."},p.TEXTURE25={name:"TEXTURE25",value:34009,description:"A texture unit."},p.TEXTURE26={name:"TEXTURE26",value:34010,description:"A texture unit."},p.TEXTURE27={name:"TEXTURE27",value:34011,description:"A texture unit."},p.TEXTURE28={name:"TEXTURE28",value:34012,description:"A texture unit."},p.TEXTURE29={name:"TEXTURE29",value:34013,description:"A texture unit."},p.TEXTURE30={name:"TEXTURE30",value:34014,description:"A texture unit."},p.TEXTURE31={name:"TEXTURE31",value:34015,description:"A texture unit."},p.ACTIVE_TEXTURE={name:"ACTIVE_TEXTURE",value:34016,description:"The current active texture unit."},p.REPEAT={name:"REPEAT",value:10497,description:" "},p.CLAMP_TO_EDGE={name:"CLAMP_TO_EDGE",value:33071,description:" "},p.MIRRORED_REPEAT={name:"MIRRORED_REPEAT",value:33648,description:" "},p.FLOAT_VEC2={name:"FLOAT_VEC2",value:35664,description:" "},p.FLOAT_VEC3={name:"FLOAT_VEC3",value:35665,description:" "},p.FLOAT_VEC4={name:"FLOAT_VEC4",value:35666,description:" "},p.INT_VEC2={name:"INT_VEC2",value:35667,description:" "},p.INT_VEC3={name:"INT_VEC3",value:35668,description:" "},p.INT_VEC4={name:"INT_VEC4",value:35669,description:" "},p.BOOL={name:"BOOL",value:35670,description:" "},p.BOOL_VEC2={name:"BOOL_VEC2",value:35671,description:" "},p.BOOL_VEC3={name:"BOOL_VEC3",value:35672,description:" "},p.BOOL_VEC4={name:"BOOL_VEC4",value:35673,description:" "},p.FLOAT_MAT2={name:"FLOAT_MAT2",value:35674,description:" "},p.FLOAT_MAT3={name:"FLOAT_MAT3",value:35675,description:" "},p.FLOAT_MAT4={name:"FLOAT_MAT4",value:35676,description:" "},p.SAMPLER_2D={name:"SAMPLER_2D",value:35678,description:" "},p.SAMPLER_CUBE={name:"SAMPLER_CUBE",value:35680,description:" "},p.LOW_FLOAT={name:"LOW_FLOAT",value:36336,description:" "},p.MEDIUM_FLOAT={name:"MEDIUM_FLOAT",value:36337,description:" "},p.HIGH_FLOAT={name:"HIGH_FLOAT",value:36338,description:" "},p.LOW_INT={name:"LOW_INT",value:36339,description:" "},p.MEDIUM_INT={name:"MEDIUM_INT",value:36340,description:" "},p.HIGH_INT={name:"HIGH_INT",value:36341,description:" "},p.FRAMEBUFFER={name:"FRAMEBUFFER",value:36160,description:" "},p.RENDERBUFFER={name:"RENDERBUFFER",value:36161,description:" "},p.RGBA4={name:"RGBA4",value:32854,description:" "},p.RGB5_A1={name:"RGB5_A1",value:32855,description:" "},p.RGB565={name:"RGB565",value:36194,description:" "},p.DEPTH_COMPONENT16={name:"DEPTH_COMPONENT16",value:33189,description:" "},p.STENCIL_INDEX={name:"STENCIL_INDEX",value:6401,description:" "},p.STENCIL_INDEX8={name:"STENCIL_INDEX8",value:36168,description:" "},p.DEPTH_STENCIL={name:"DEPTH_STENCIL",value:34041,description:" "},p.RENDERBUFFER_WIDTH={name:"RENDERBUFFER_WIDTH",value:36162,description:" "},p.RENDERBUFFER_HEIGHT={name:"RENDERBUFFER_HEIGHT",value:36163,description:" "},p.RENDERBUFFER_INTERNAL_FORMAT={name:"RENDERBUFFER_INTERNAL_FORMAT",value:36164,description:" "},p.RENDERBUFFER_RED_SIZE={name:"RENDERBUFFER_RED_SIZE",value:36176,description:" "},p.RENDERBUFFER_GREEN_SIZE={name:"RENDERBUFFER_GREEN_SIZE",value:36177,description:" "},p.RENDERBUFFER_BLUE_SIZE={name:"RENDERBUFFER_BLUE_SIZE",value:36178,description:" "},p.RENDERBUFFER_ALPHA_SIZE={name:"RENDERBUFFER_ALPHA_SIZE",value:36179,description:" "},p.RENDERBUFFER_DEPTH_SIZE={name:"RENDERBUFFER_DEPTH_SIZE",value:36180,description:" "},p.RENDERBUFFER_STENCIL_SIZE={name:"RENDERBUFFER_STENCIL_SIZE",value:36181,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",value:36048,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",value:36049,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",value:36050,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",value:36051,description:" "},p.COLOR_ATTACHMENT0={name:"COLOR_ATTACHMENT0",value:36064,description:" "},p.DEPTH_ATTACHMENT={name:"DEPTH_ATTACHMENT",value:36096,description:" "},p.STENCIL_ATTACHMENT={name:"STENCIL_ATTACHMENT",value:36128,description:" "},p.DEPTH_STENCIL_ATTACHMENT={name:"DEPTH_STENCIL_ATTACHMENT",value:33306,description:" "},p.NONE={name:"NONE",value:0,description:" "},p.FRAMEBUFFER_COMPLETE={name:"FRAMEBUFFER_COMPLETE",value:36053,description:" "},p.FRAMEBUFFER_INCOMPLETE_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",value:36054,description:" "},p.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",value:36055,description:" "},p.FRAMEBUFFER_INCOMPLETE_DIMENSIONS={name:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",value:36057,description:" "},p.FRAMEBUFFER_UNSUPPORTED={name:"FRAMEBUFFER_UNSUPPORTED",value:36061,description:" "},p.FRAMEBUFFER_BINDING={name:"FRAMEBUFFER_BINDING",value:36006,description:" "},p.RENDERBUFFER_BINDING={name:"RENDERBUFFER_BINDING",value:36007,description:" "},p.MAX_RENDERBUFFER_SIZE={name:"MAX_RENDERBUFFER_SIZE",value:34024,description:" "},p.INVALID_FRAMEBUFFER_OPERATION={name:"INVALID_FRAMEBUFFER_OPERATION",value:1286,description:" "},p.UNPACK_FLIP_Y_WEBGL={name:"UNPACK_FLIP_Y_WEBGL",value:37440,description:" "},p.UNPACK_PREMULTIPLY_ALPHA_WEBGL={name:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",value:37441,description:" "},p.UNPACK_COLORSPACE_CONVERSION_WEBGL={name:"UNPACK_COLORSPACE_CONVERSION_WEBGL",value:37443,description:" "},p.READ_BUFFER={name:"READ_BUFFER",value:3074,description:" "},p.UNPACK_ROW_LENGTH={name:"UNPACK_ROW_LENGTH",value:3314,description:" "},p.UNPACK_SKIP_ROWS={name:"UNPACK_SKIP_ROWS",value:3315,description:" "},p.UNPACK_SKIP_PIXELS={name:"UNPACK_SKIP_PIXELS",value:3316,description:" "},p.PACK_ROW_LENGTH={name:"PACK_ROW_LENGTH",value:3330,description:" "},p.PACK_SKIP_ROWS={name:"PACK_SKIP_ROWS",value:3331,description:" "},p.PACK_SKIP_PIXELS={name:"PACK_SKIP_PIXELS",value:3332,description:" "},p.TEXTURE_BINDING_3D={name:"TEXTURE_BINDING_3D",value:32874,description:" "},p.UNPACK_SKIP_IMAGES={name:"UNPACK_SKIP_IMAGES",value:32877,description:" "},p.UNPACK_IMAGE_HEIGHT={name:"UNPACK_IMAGE_HEIGHT",value:32878,description:" "},p.MAX_3D_TEXTURE_SIZE={name:"MAX_3D_TEXTURE_SIZE",value:32883,description:" "},p.MAX_ELEMENTS_VERTICES={name:"MAX_ELEMENTS_VERTICES",value:33e3,description:" "},p.MAX_ELEMENTS_INDICES={name:"MAX_ELEMENTS_INDICES",value:33001,description:" "},p.MAX_TEXTURE_LOD_BIAS={name:"MAX_TEXTURE_LOD_BIAS",value:34045,description:" "},p.MAX_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_FRAGMENT_UNIFORM_COMPONENTS",value:35657,description:" "},p.MAX_VERTEX_UNIFORM_COMPONENTS={name:"MAX_VERTEX_UNIFORM_COMPONENTS",value:35658,description:" "},p.MAX_ARRAY_TEXTURE_LAYERS={name:"MAX_ARRAY_TEXTURE_LAYERS",value:35071,description:" "},p.MIN_PROGRAM_TEXEL_OFFSET={name:"MIN_PROGRAM_TEXEL_OFFSET",value:35076,description:" "},p.MAX_PROGRAM_TEXEL_OFFSET={name:"MAX_PROGRAM_TEXEL_OFFSET",value:35077,description:" "},p.MAX_VARYING_COMPONENTS={name:"MAX_VARYING_COMPONENTS",value:35659,description:" "},p.FRAGMENT_SHADER_DERIVATIVE_HINT={name:"FRAGMENT_SHADER_DERIVATIVE_HINT",value:35723,description:" "},p.RASTERIZER_DISCARD={name:"RASTERIZER_DISCARD",value:35977,description:" "},p.VERTEX_ARRAY_BINDING={name:"VERTEX_ARRAY_BINDING",value:34229,description:" "},p.MAX_VERTEX_OUTPUT_COMPONENTS={name:"MAX_VERTEX_OUTPUT_COMPONENTS",value:37154,description:" "},p.MAX_FRAGMENT_INPUT_COMPONENTS={name:"MAX_FRAGMENT_INPUT_COMPONENTS",value:37157,description:" "},p.MAX_SERVER_WAIT_TIMEOUT={name:"MAX_SERVER_WAIT_TIMEOUT",value:37137,description:" "},p.MAX_ELEMENT_INDEX={name:"MAX_ELEMENT_INDEX",value:36203,description:" "},p.RED={name:"RED",value:6403,description:" "},p.RGB8={name:"RGB8",value:32849,description:" "},p.RGBA8={name:"RGBA8",value:32856,description:" "},p.RGB10_A2={name:"RGB10_A2",value:32857,description:" "},p.TEXTURE_3D={name:"TEXTURE_3D",value:32879,description:" "},p.TEXTURE_WRAP_R={name:"TEXTURE_WRAP_R",value:32882,description:" "},p.TEXTURE_MIN_LOD={name:"TEXTURE_MIN_LOD",value:33082,description:" "},p.TEXTURE_MAX_LOD={name:"TEXTURE_MAX_LOD",value:33083,description:" "},p.TEXTURE_BASE_LEVEL={name:"TEXTURE_BASE_LEVEL",value:33084,description:" "},p.TEXTURE_MAX_LEVEL={name:"TEXTURE_MAX_LEVEL",value:33085,description:" "},p.TEXTURE_COMPARE_MODE={name:"TEXTURE_COMPARE_MODE",value:34892,description:" "},p.TEXTURE_COMPARE_FUNC={name:"TEXTURE_COMPARE_FUNC",value:34893,description:" "},p.SRGB={name:"SRGB",value:35904,description:" "},p.SRGB8={name:"SRGB8",value:35905,description:" "},p.SRGB8_ALPHA8={name:"SRGB8_ALPHA8",value:35907,description:" "},p.COMPARE_REF_TO_TEXTURE={name:"COMPARE_REF_TO_TEXTURE",value:34894,description:" "},p.RGBA32F={name:"RGBA32F",value:34836,description:" "},p.RGB32F={name:"RGB32F",value:34837,description:" "},p.RGBA16F={name:"RGBA16F",value:34842,description:" "},p.RGB16F={name:"RGB16F",value:34843,description:" "},p.TEXTURE_2D_ARRAY={name:"TEXTURE_2D_ARRAY",value:35866,description:" "},p.TEXTURE_BINDING_2D_ARRAY={name:"TEXTURE_BINDING_2D_ARRAY",value:35869,description:" "},p.R11F_G11F_B10F={name:"R11F_G11F_B10F",value:35898,description:" "},p.RGB9_E5={name:"RGB9_E5",value:35901,description:" "},p.RGBA32UI={name:"RGBA32UI",value:36208,description:" "},p.RGB32UI={name:"RGB32UI",value:36209,description:" "},p.RGBA16UI={name:"RGBA16UI",value:36214,description:" "},p.RGB16UI={name:"RGB16UI",value:36215,description:" "},p.RGBA8UI={name:"RGBA8UI",value:36220,description:" "},p.RGB8UI={name:"RGB8UI",value:36221,description:" "},p.RGBA32I={name:"RGBA32I",value:36226,description:" "},p.RGB32I={name:"RGB32I",value:36227,description:" "},p.RGBA16I={name:"RGBA16I",value:36232,description:" "},p.RGB16I={name:"RGB16I",value:36233,description:" "},p.RGBA8I={name:"RGBA8I",value:36238,description:" "},p.RGB8I={name:"RGB8I",value:36239,description:" "},p.RED_INTEGER={name:"RED_INTEGER",value:36244,description:" "},p.RGB_INTEGER={name:"RGB_INTEGER",value:36248,description:" "},p.RGBA_INTEGER={name:"RGBA_INTEGER",value:36249,description:" "},p.R8={name:"R8",value:33321,description:" "},p.RG8={name:"RG8",value:33323,description:" "},p.R16F={name:"R16F",value:33325,description:" "},p.R32F={name:"R32F",value:33326,description:" "},p.RG16F={name:"RG16F",value:33327,description:" "},p.RG32F={name:"RG32F",value:33328,description:" "},p.R8I={name:"R8I",value:33329,description:" "},p.R8UI={name:"R8UI",value:33330,description:" "},p.R16I={name:"R16I",value:33331,description:" "},p.R16UI={name:"R16UI",value:33332,description:" "},p.R32I={name:"R32I",value:33333,description:" "},p.R32UI={name:"R32UI",value:33334,description:" "},p.RG8I={name:"RG8I",value:33335,description:" "},p.RG8UI={name:"RG8UI",value:33336,description:" "},p.RG16I={name:"RG16I",value:33337,description:" "},p.RG16UI={name:"RG16UI",value:33338,description:" "},p.RG32I={name:"RG32I",value:33339,description:" "},p.RG32UI={name:"RG32UI",value:33340,description:" "},p.R8_SNORM={name:"R8_SNORM",value:36756,description:" "},p.RG8_SNORM={name:"RG8_SNORM",value:36757,description:" "},p.RGB8_SNORM={name:"RGB8_SNORM",value:36758,description:" "},p.RGBA8_SNORM={name:"RGBA8_SNORM",value:36759,description:" "},p.RGB10_A2UI={name:"RGB10_A2UI",value:36975,description:" "},p.TEXTURE_IMMUTABLE_FORMAT={name:"TEXTURE_IMMUTABLE_FORMAT",value:37167,description:" "},p.TEXTURE_IMMUTABLE_LEVELS={name:"TEXTURE_IMMUTABLE_LEVELS",value:33503,description:" "},p.UNSIGNED_INT_2_10_10_10_REV={name:"UNSIGNED_INT_2_10_10_10_REV",value:33640,description:" "},p.UNSIGNED_INT_10F_11F_11F_REV={name:"UNSIGNED_INT_10F_11F_11F_REV",value:35899,description:" "},p.UNSIGNED_INT_5_9_9_9_REV={name:"UNSIGNED_INT_5_9_9_9_REV",value:35902,description:" "},p.FLOAT_32_UNSIGNED_INT_24_8_REV={name:"FLOAT_32_UNSIGNED_INT_24_8_REV",value:36269,description:" "},p.UNSIGNED_INT_24_8={name:"UNSIGNED_INT_24_8",value:34042,description:" "},p.HALF_FLOAT={name:"HALF_FLOAT",value:5131,description:" "},p.RG={name:"RG",value:33319,description:" "},p.RG_INTEGER={name:"RG_INTEGER",value:33320,description:" "},p.INT_2_10_10_10_REV={name:"INT_2_10_10_10_REV",value:36255,description:" "},p.CURRENT_QUERY={name:"CURRENT_QUERY",value:34917,description:" "},p.QUERY_RESULT={name:"QUERY_RESULT",value:34918,description:" "},p.QUERY_RESULT_AVAILABLE={name:"QUERY_RESULT_AVAILABLE",value:34919,description:" "},p.ANY_SAMPLES_PASSED={name:"ANY_SAMPLES_PASSED",value:35887,description:" "},p.ANY_SAMPLES_PASSED_CONSERVATIVE={name:"ANY_SAMPLES_PASSED_CONSERVATIVE",value:36202,description:" "},p.MAX_DRAW_BUFFERS={name:"MAX_DRAW_BUFFERS",value:34852,description:" "},p.DRAW_BUFFER0={name:"DRAW_BUFFER0",value:34853,description:" "},p.DRAW_BUFFER1={name:"DRAW_BUFFER1",value:34854,description:" "},p.DRAW_BUFFER2={name:"DRAW_BUFFER2",value:34855,description:" "},p.DRAW_BUFFER3={name:"DRAW_BUFFER3",value:34856,description:" "},p.DRAW_BUFFER4={name:"DRAW_BUFFER4",value:34857,description:" "},p.DRAW_BUFFER5={name:"DRAW_BUFFER5",value:34858,description:" "},p.DRAW_BUFFER6={name:"DRAW_BUFFER6",value:34859,description:" "},p.DRAW_BUFFER7={name:"DRAW_BUFFER7",value:34860,description:" "},p.DRAW_BUFFER8={name:"DRAW_BUFFER8",value:34861,description:" "},p.DRAW_BUFFER9={name:"DRAW_BUFFER9",value:34862,description:" "},p.DRAW_BUFFER10={name:"DRAW_BUFFER10",value:34863,description:" "},p.DRAW_BUFFER11={name:"DRAW_BUFFER11",value:34864,description:" "},p.DRAW_BUFFER12={name:"DRAW_BUFFER12",value:34865,description:" "},p.DRAW_BUFFER13={name:"DRAW_BUFFER13",value:34866,description:" "},p.DRAW_BUFFER14={name:"DRAW_BUFFER14",value:34867,description:" "},p.DRAW_BUFFER15={name:"DRAW_BUFFER15",value:34868,description:" "},p.MAX_COLOR_ATTACHMENTS={name:"MAX_COLOR_ATTACHMENTS",value:36063,description:" "},p.COLOR_ATTACHMENT1={name:"COLOR_ATTACHMENT1",value:36065,description:" "},p.COLOR_ATTACHMENT2={name:"COLOR_ATTACHMENT2",value:36066,description:" "},p.COLOR_ATTACHMENT3={name:"COLOR_ATTACHMENT3",value:36067,description:" "},p.COLOR_ATTACHMENT4={name:"COLOR_ATTACHMENT4",value:36068,description:" "},p.COLOR_ATTACHMENT5={name:"COLOR_ATTACHMENT5",value:36069,description:" "},p.COLOR_ATTACHMENT6={name:"COLOR_ATTACHMENT6",value:36070,description:" "},p.COLOR_ATTACHMENT7={name:"COLOR_ATTACHMENT7",value:36071,description:" "},p.COLOR_ATTACHMENT8={name:"COLOR_ATTACHMENT8",value:36072,description:" "},p.COLOR_ATTACHMENT9={name:"COLOR_ATTACHMENT9",value:36073,description:" "},p.COLOR_ATTACHMENT10={name:"COLOR_ATTACHMENT10",value:36074,description:" "},p.COLOR_ATTACHMENT11={name:"COLOR_ATTACHMENT11",value:36075,description:" "},p.COLOR_ATTACHMENT12={name:"COLOR_ATTACHMENT12",value:36076,description:" "},p.COLOR_ATTACHMENT13={name:"COLOR_ATTACHMENT13",value:36077,description:" "},p.COLOR_ATTACHMENT14={name:"COLOR_ATTACHMENT14",value:36078,description:" "},p.COLOR_ATTACHMENT15={name:"COLOR_ATTACHMENT15",value:36079,description:" "},p.SAMPLER_3D={name:"SAMPLER_3D",value:35679,description:" "},p.SAMPLER_2D_SHADOW={name:"SAMPLER_2D_SHADOW",value:35682,description:" "},p.SAMPLER_2D_ARRAY={name:"SAMPLER_2D_ARRAY",value:36289,description:" "},p.SAMPLER_2D_ARRAY_SHADOW={name:"SAMPLER_2D_ARRAY_SHADOW",value:36292,description:" "},p.SAMPLER_CUBE_SHADOW={name:"SAMPLER_CUBE_SHADOW",value:36293,description:" "},p.INT_SAMPLER_2D={name:"INT_SAMPLER_2D",value:36298,description:" "},p.INT_SAMPLER_3D={name:"INT_SAMPLER_3D",value:36299,description:" "},p.INT_SAMPLER_CUBE={name:"INT_SAMPLER_CUBE",value:36300,description:" "},p.INT_SAMPLER_2D_ARRAY={name:"INT_SAMPLER_2D_ARRAY",value:36303,description:" "},p.UNSIGNED_INT_SAMPLER_2D={name:"UNSIGNED_INT_SAMPLER_2D",value:36306,description:" "},p.UNSIGNED_INT_SAMPLER_3D={name:"UNSIGNED_INT_SAMPLER_3D",value:36307,description:" "},p.UNSIGNED_INT_SAMPLER_CUBE={name:"UNSIGNED_INT_SAMPLER_CUBE",value:36308,description:" "},p.UNSIGNED_INT_SAMPLER_2D_ARRAY={name:"UNSIGNED_INT_SAMPLER_2D_ARRAY",value:36311,description:" "},p.MAX_SAMPLES={name:"MAX_SAMPLES",value:36183,description:" "},p.SAMPLER_BINDING={name:"SAMPLER_BINDING",value:35097,description:" "},p.PIXEL_PACK_BUFFER={name:"PIXEL_PACK_BUFFER",value:35051,description:" "},p.PIXEL_UNPACK_BUFFER={name:"PIXEL_UNPACK_BUFFER",value:35052,description:" "},p.PIXEL_PACK_BUFFER_BINDING={name:"PIXEL_PACK_BUFFER_BINDING",value:35053,description:" "},p.PIXEL_UNPACK_BUFFER_BINDING={name:"PIXEL_UNPACK_BUFFER_BINDING",value:35055,description:" "},p.COPY_READ_BUFFER={name:"COPY_READ_BUFFER",value:36662,description:" "},p.COPY_WRITE_BUFFER={name:"COPY_WRITE_BUFFER",value:36663,description:" "},p.COPY_READ_BUFFER_BINDING={name:"COPY_READ_BUFFER_BINDING",value:36662,description:" "},p.COPY_WRITE_BUFFER_BINDING={name:"COPY_WRITE_BUFFER_BINDING",value:36663,description:" "},p.FLOAT_MAT2x3={name:"FLOAT_MAT2x3",value:35685,description:" "},p.FLOAT_MAT2x4={name:"FLOAT_MAT2x4",value:35686,description:" "},p.FLOAT_MAT3x2={name:"FLOAT_MAT3x2",value:35687,description:" "},p.FLOAT_MAT3x4={name:"FLOAT_MAT3x4",value:35688,description:" "},p.FLOAT_MAT4x2={name:"FLOAT_MAT4x2",value:35689,description:" "},p.FLOAT_MAT4x3={name:"FLOAT_MAT4x3",value:35690,description:" "},p.UNSIGNED_INT_VEC2={name:"UNSIGNED_INT_VEC2",value:36294,description:" "},p.UNSIGNED_INT_VEC3={name:"UNSIGNED_INT_VEC3",value:36295,description:" "},p.UNSIGNED_INT_VEC4={name:"UNSIGNED_INT_VEC4",value:36296,description:" "},p.UNSIGNED_NORMALIZED={name:"UNSIGNED_NORMALIZED",value:35863,description:" "},p.SIGNED_NORMALIZED={name:"SIGNED_NORMALIZED",value:36764,description:" "},p.VERTEX_ATTRIB_ARRAY_INTEGER={name:"VERTEX_ATTRIB_ARRAY_INTEGER",value:35069,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR={name:"VERTEX_ATTRIB_ARRAY_DIVISOR",value:35070,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_MODE={name:"TRANSFORM_FEEDBACK_BUFFER_MODE",value:35967,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",value:35968,description:" "},p.TRANSFORM_FEEDBACK_VARYINGS={name:"TRANSFORM_FEEDBACK_VARYINGS",value:35971,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_START={name:"TRANSFORM_FEEDBACK_BUFFER_START",value:35972,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_SIZE={name:"TRANSFORM_FEEDBACK_BUFFER_SIZE",value:35973,description:" "},p.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN={name:"TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",value:35976,description:" "},p.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",value:35978,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",value:35979,description:" "},p.INTERLEAVED_ATTRIBS={name:"INTERLEAVED_ATTRIBS",value:35980,description:" "},p.SEPARATE_ATTRIBS={name:"SEPARATE_ATTRIBS",value:35981,description:" "},p.TRANSFORM_FEEDBACK_BUFFER={name:"TRANSFORM_FEEDBACK_BUFFER",value:35982,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_BINDING={name:"TRANSFORM_FEEDBACK_BUFFER_BINDING",value:35983,description:" "},p.TRANSFORM_FEEDBACK={name:"TRANSFORM_FEEDBACK",value:36386,description:" "},p.TRANSFORM_FEEDBACK_PAUSED={name:"TRANSFORM_FEEDBACK_PAUSED",value:36387,description:" "},p.TRANSFORM_FEEDBACK_ACTIVE={name:"TRANSFORM_FEEDBACK_ACTIVE",value:36388,description:" "},p.TRANSFORM_FEEDBACK_BINDING={name:"TRANSFORM_FEEDBACK_BINDING",value:36389,description:" "},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",value:33296,description:" "},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",value:33297,description:" "},p.FRAMEBUFFER_ATTACHMENT_RED_SIZE={name:"FRAMEBUFFER_ATTACHMENT_RED_SIZE",value:33298,description:" "},p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE={name:"FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",value:33299,description:" "},p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE={name:"FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",value:33300,description:" "},p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE={name:"FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",value:33301,description:" "},p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE={name:"FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",value:33302,description:" "},p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE={name:"FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",value:33303,description:" "},p.FRAMEBUFFER_DEFAULT={name:"FRAMEBUFFER_DEFAULT",value:33304,description:" "},p.DEPTH24_STENCIL8={name:"DEPTH24_STENCIL8",value:35056,description:" "},p.DRAW_FRAMEBUFFER_BINDING={name:"DRAW_FRAMEBUFFER_BINDING",value:36006,description:" "},p.READ_FRAMEBUFFER={name:"READ_FRAMEBUFFER",value:36008,description:" "},p.DRAW_FRAMEBUFFER={name:"DRAW_FRAMEBUFFER",value:36009,description:" "},p.READ_FRAMEBUFFER_BINDING={name:"READ_FRAMEBUFFER_BINDING",value:36010,description:" "},p.RENDERBUFFER_SAMPLES={name:"RENDERBUFFER_SAMPLES",value:36011,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",value:36052,description:" "},p.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE={name:"FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",value:36182,description:" "},p.UNIFORM_BUFFER={name:"UNIFORM_BUFFER",value:35345,description:" "},p.UNIFORM_BUFFER_BINDING={name:"UNIFORM_BUFFER_BINDING",value:35368,description:" "},p.UNIFORM_BUFFER_START={name:"UNIFORM_BUFFER_START",value:35369,description:" "},p.UNIFORM_BUFFER_SIZE={name:"UNIFORM_BUFFER_SIZE",value:35370,description:" "},p.MAX_VERTEX_UNIFORM_BLOCKS={name:"MAX_VERTEX_UNIFORM_BLOCKS",value:35371,description:" "},p.MAX_FRAGMENT_UNIFORM_BLOCKS={name:"MAX_FRAGMENT_UNIFORM_BLOCKS",value:35373,description:" "},p.MAX_COMBINED_UNIFORM_BLOCKS={name:"MAX_COMBINED_UNIFORM_BLOCKS",value:35374,description:" "},p.MAX_UNIFORM_BUFFER_BINDINGS={name:"MAX_UNIFORM_BUFFER_BINDINGS",value:35375,description:" "},p.MAX_UNIFORM_BLOCK_SIZE={name:"MAX_UNIFORM_BLOCK_SIZE",value:35376,description:" "},p.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS={name:"MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",value:35377,description:" "},p.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",value:35379,description:" "},p.UNIFORM_BUFFER_OFFSET_ALIGNMENT={name:"UNIFORM_BUFFER_OFFSET_ALIGNMENT",value:35380,description:" "},p.ACTIVE_UNIFORM_BLOCKS={name:"ACTIVE_UNIFORM_BLOCKS",value:35382,description:" "},p.UNIFORM_TYPE={name:"UNIFORM_TYPE",value:35383,description:" "},p.UNIFORM_SIZE={name:"UNIFORM_SIZE",value:35384,description:" "},p.UNIFORM_BLOCK_INDEX={name:"UNIFORM_BLOCK_INDEX",value:35386,description:" "},p.UNIFORM_OFFSET={name:"UNIFORM_OFFSET",value:35387,description:" "},p.UNIFORM_ARRAY_STRIDE={name:"UNIFORM_ARRAY_STRIDE",value:35388,description:" "},p.UNIFORM_MATRIX_STRIDE={name:"UNIFORM_MATRIX_STRIDE",value:35389,description:" "},p.UNIFORM_IS_ROW_MAJOR={name:"UNIFORM_IS_ROW_MAJOR",value:35390,description:" "},p.UNIFORM_BLOCK_BINDING={name:"UNIFORM_BLOCK_BINDING",value:35391,description:" "},p.UNIFORM_BLOCK_DATA_SIZE={name:"UNIFORM_BLOCK_DATA_SIZE",value:35392,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORMS={name:"UNIFORM_BLOCK_ACTIVE_UNIFORMS",value:35394,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES={name:"UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",value:35395,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",value:35396,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",value:35398,description:" "},p.OBJECT_TYPE={name:"OBJECT_TYPE",value:37138,description:" "},p.SYNC_CONDITION={name:"SYNC_CONDITION",value:37139,description:" "},p.SYNC_STATUS={name:"SYNC_STATUS",value:37140,description:" "},p.SYNC_FLAGS={name:"SYNC_FLAGS",value:37141,description:" "},p.SYNC_FENCE={name:"SYNC_FENCE",value:37142,description:" "},p.SYNC_GPU_COMMANDS_COMPLETE={name:"SYNC_GPU_COMMANDS_COMPLETE",value:37143,description:" "},p.UNSIGNALED={name:"UNSIGNALED",value:37144,description:" "},p.SIGNALED={name:"SIGNALED",value:37145,description:" "},p.ALREADY_SIGNALED={name:"ALREADY_SIGNALED",value:37146,description:" "},p.TIMEOUT_EXPIRED={name:"TIMEOUT_EXPIRED",value:37147,description:" "},p.CONDITION_SATISFIED={name:"CONDITION_SATISFIED",value:37148,description:" "},p.WAIT_FAILED={name:"WAIT_FAILED",value:37149,description:" "},p.SYNC_FLUSH_COMMANDS_BIT={name:"SYNC_FLUSH_COMMANDS_BIT",value:1,description:" "},p.COLOR={name:"COLOR",value:6144,description:" "},p.DEPTH={name:"DEPTH",value:6145,description:" "},p.STENCIL={name:"STENCIL",value:6146,description:" "},p.MIN={name:"MIN",value:32775,description:" "},p.MAX={name:"MAX",value:32776,description:" "},p.DEPTH_COMPONENT24={name:"DEPTH_COMPONENT24",value:33190,description:" "},p.STREAM_READ={name:"STREAM_READ",value:35041,description:" "},p.STREAM_COPY={name:"STREAM_COPY",value:35042,description:" "},p.STATIC_READ={name:"STATIC_READ",value:35045,description:" "},p.STATIC_COPY={name:"STATIC_COPY",value:35046,description:" "},p.DYNAMIC_READ={name:"DYNAMIC_READ",value:35049,description:" "},p.DYNAMIC_COPY={name:"DYNAMIC_COPY",value:35050,description:" "},p.DEPTH_COMPONENT32F={name:"DEPTH_COMPONENT32F",value:36012,description:" "},p.DEPTH32F_STENCIL8={name:"DEPTH32F_STENCIL8",value:36013,description:" "},p.INVALID_INDEX={name:"INVALID_INDEX",value:4294967295,description:" "},p.TIMEOUT_IGNORED={name:"TIMEOUT_IGNORED",value:-1,description:" "},p.MAX_CLIENT_WAIT_TIMEOUT_WEBGL={name:"MAX_CLIENT_WAIT_TIMEOUT_WEBGL",value:37447,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE={name:"VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",value:35070,description:"Describes the frequency divisor used for instanced rendering.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_VENDOR_WEBGL={name:"UNMASKED_VENDOR_WEBGL",value:37445,description:"Passed to getParameter to get the vendor string of the graphics driver.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_RENDERER_WEBGL={name:"UNMASKED_RENDERER_WEBGL",value:37446,description:"Passed to getParameter to get the renderer string of the graphics driver.",extensionName:"WEBGL_debug_renderer_info"},p.MAX_TEXTURE_MAX_ANISOTROPY_EXT={name:"MAX_TEXTURE_MAX_ANISOTROPY_EXT",value:34047,description:"Returns the maximum available anisotropy.",extensionName:"EXT_texture_filter_anisotropic"},p.TEXTURE_MAX_ANISOTROPY_EXT={name:"TEXTURE_MAX_ANISOTROPY_EXT",value:34046,description:"Passed to texParameter to set the desired maximum anisotropy for a texture.",extensionName:"EXT_texture_filter_anisotropic"},p.COMPRESSED_RGB_S3TC_DXT1_EXT={name:"COMPRESSED_RGB_S3TC_DXT1_EXT",value:33776,description:"A DXT1-compressed image in an RGB image format.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT1_EXT={name:"COMPRESSED_RGBA_S3TC_DXT1_EXT",value:33777,description:"A DXT1-compressed image in an RGB image format with a simple on/off alpha value.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT3_EXT={name:"COMPRESSED_RGBA_S3TC_DXT3_EXT",value:33778,description:"A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT5_EXT={name:"COMPRESSED_RGBA_S3TC_DXT5_EXT",value:33779,description:"A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_R11_EAC={name:"COMPRESSED_R11_EAC",value:37488,description:"One-channel (red) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_R11_EAC={name:"COMPRESSED_SIGNED_R11_EAC",value:37489,description:"One-channel (red) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RG11_EAC={name:"COMPRESSED_RG11_EAC",value:37490,description:"Two-channel (red and green) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_RG11_EAC={name:"COMPRESSED_SIGNED_RG11_EAC",value:37491,description:"Two-channel (red and green) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_ETC2={name:"COMPRESSED_RGB8_ETC2",value:37492,description:"Compresses RBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGBA8_ETC2_EAC={name:"COMPRESSED_RGBA8_ETC2_EAC",value:37493,description:"Compresses RGBA8 data. The RGB part is encoded the same as RGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ETC2={name:"COMPRESSED_SRGB8_ETC2",value:37494,description:"Compresses sRBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC={name:"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",value:37495,description:"Compresses sRGBA8 data. The sRGB part is encoded the same as SRGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37496,description:"Similar to RGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37497,description:"Similar to SRGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_4BPPV1_IMG",value:35840,description:"RGB compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",value:35842,description:"RGBA compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_2BPPV1_IMG",value:35841,description:"RGB compression in 2-bit mode. One block for each 8×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",value:35843,description:"RGBA compression in 2-bit mode. One block for each 8×4 pixe",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_ETC1_WEBGL={name:"COMPRESSED_RGB_ETC1_WEBGL",value:36196,description:"Compresses 24-bit RGB data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc1"},p.COMPRESSED_RGB_ATC_WEBGL={name:"COMPRESSED_RGB_ATC_WEBGL",value:35986,description:"Compresses RGB textures with no alpha channel.",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",value:35986,description:"Compresses RGBA textures using explicit alpha encoding (useful when alpha transitions are sharp).",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",value:34798,description:"Compresses RGBA textures using interpolated alpha encoding (useful when alpha transitions are gradient).",extensionName:"WEBGL_compressed_texture_atc"},p.UNSIGNED_INT_24_8_WEBGL={name:"UNSIGNED_INT_24_8_WEBGL",value:34042,description:"Unsigned integer type for 24-bit depth texture data.",extensionName:"WEBGL_depth_texture"},p.HALF_FLOAT_OES={name:"HALF_FLOAT_OES",value:36193,description:"Half floating-point type (16-bit).",extensionName:"OES_texture_half_float"},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",value:33297,description:" ",extensionName:"WEBGL_color_buffer_float"},p.UNSIGNED_NORMALIZED_EXT={name:"UNSIGNED_NORMALIZED_EXT",value:35863,description:" ",extensionName:"WEBGL_color_buffer_float"},p.MIN_EXT={name:"MIN_EXT",value:32775,description:"Produces the minimum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.MAX_EXT={name:"MAX_EXT",value:32776,description:"Produces the maximum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.SRGB_EXT={name:"SRGB_EXT",value:35904,description:"Unsized sRGB format that leaves the precision up to the driver.",extensionName:"EXT_sRGB"},p.SRGB_ALPHA_EXT={name:"SRGB_ALPHA_EXT",value:35906,description:"Unsized sRGB format with unsized alpha component.",extensionName:"EXT_sRGB"},p.SRGB8_ALPHA8_EXT={name:"SRGB8_ALPHA8_EXT",value:35907,description:"Sized (8-bit) sRGB and alpha formats.",extensionName:"EXT_sRGB"},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",value:33296,description:"Returns the framebuffer color encoding.",extensionName:"EXT_sRGB"},p.FRAGMENT_SHADER_DERIVATIVE_HINT_OES={name:"FRAGMENT_SHADER_DERIVATIVE_HINT_OES",value:35723,description:"Indicates the accuracy of the derivative calculation for the GLSL built-in functions: dFdx, dFdy, and fwidth.",extensionName:"OES_standard_derivatives"},p.COLOR_ATTACHMENT0_WEBGL={name:"COLOR_ATTACHMENT0_WEBGL",value:36064,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT1_WEBGL={name:"COLOR_ATTACHMENT1_WEBGL",value:36065,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT2_WEBGL={name:"COLOR_ATTACHMENT2_WEBGL",value:36066,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT3_WEBGL={name:"COLOR_ATTACHMENT3_WEBGL",value:36067,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT4_WEBGL={name:"COLOR_ATTACHMENT4_WEBGL",value:36068,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT5_WEBGL={name:"COLOR_ATTACHMENT5_WEBGL",value:36069,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT6_WEBGL={name:"COLOR_ATTACHMENT6_WEBGL",value:36070,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT7_WEBGL={name:"COLOR_ATTACHMENT7_WEBGL",value:36071,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT8_WEBGL={name:"COLOR_ATTACHMENT8_WEBGL",value:36072,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT9_WEBGL={name:"COLOR_ATTACHMENT9_WEBGL",value:36073,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT10_WEBGL={name:"COLOR_ATTACHMENT10_WEBGL",value:36074,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT11_WEBGL={name:"COLOR_ATTACHMENT11_WEBGL",value:36075,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT12_WEBGL={name:"COLOR_ATTACHMENT12_WEBGL",value:36076,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT13_WEBGL={name:"COLOR_ATTACHMENT13_WEBGL",value:36077,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT14_WEBGL={name:"COLOR_ATTACHMENT14_WEBGL",value:36078,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT15_WEBGL={name:"COLOR_ATTACHMENT15_WEBGL",value:36079,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER0_WEBGL={name:"DRAW_BUFFER0_WEBGL",value:34853,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER1_WEBGL={name:"DRAW_BUFFER1_WEBGL",value:34854,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER2_WEBGL={name:"DRAW_BUFFER2_WEBGL",value:34855,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER3_WEBGL={name:"DRAW_BUFFER3_WEBGL",value:34856,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER4_WEBGL={name:"DRAW_BUFFER4_WEBGL",value:34857,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER5_WEBGL={name:"DRAW_BUFFER5_WEBGL",value:34858,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER6_WEBGL={name:"DRAW_BUFFER6_WEBGL",value:34859,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER7_WEBGL={name:"DRAW_BUFFER7_WEBGL",value:34860,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER8_WEBGL={name:"DRAW_BUFFER8_WEBGL",value:34861,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER9_WEBGL={name:"DRAW_BUFFER9_WEBGL",value:34862,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER10_WEBGL={name:"DRAW_BUFFER10_WEBGL",value:34863,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER11_WEBGL={name:"DRAW_BUFFER11_WEBGL",value:34864,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER12_WEBGL={name:"DRAW_BUFFER12_WEBGL",value:34865,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER13_WEBGL={name:"DRAW_BUFFER13_WEBGL",value:34866,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER14_WEBGL={name:"DRAW_BUFFER14_WEBGL",value:34867,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER15_WEBGL={name:"DRAW_BUFFER15_WEBGL",value:34868,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.MAX_COLOR_ATTACHMENTS_WEBGL={name:"MAX_COLOR_ATTACHMENTS_WEBGL",value:36063,description:"Maximum number of framebuffer color attachment points",extensionName:"WEBGL_draw_buffers"},p.MAX_DRAW_BUFFERS_WEBGL={name:"MAX_DRAW_BUFFERS_WEBGL",value:34852,description:"Maximum number of draw buffers",extensionName:"WEBGL_draw_buffers"},p.VERTEX_ARRAY_BINDING_OES={name:"VERTEX_ARRAY_BINDING_OES",value:34229,description:"The bound vertex array object (VAO).",extensionName:"VERTEX_ARRAY_BINDING_OES"},p.QUERY_COUNTER_BITS_EXT={name:"QUERY_COUNTER_BITS_EXT",value:34916,description:"The number of bits used to hold the query result for the given target.",extensionName:"EXT_disjoint_timer_query"},p.CURRENT_QUERY_EXT={name:"CURRENT_QUERY_EXT",value:34917,description:"The currently active query.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_EXT={name:"QUERY_RESULT_EXT",value:34918,description:"The query result.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_AVAILABLE_EXT={name:"QUERY_RESULT_AVAILABLE_EXT",value:34919,description:"A Boolean indicating whether or not a query result is available.",extensionName:"EXT_disjoint_timer_query"},p.TIME_ELAPSED_EXT={name:"TIME_ELAPSED_EXT",value:35007,description:"Elapsed time (in nanoseconds).",extensionName:"EXT_disjoint_timer_query"},p.TIMESTAMP_EXT={name:"TIMESTAMP_EXT",value:36392,description:"The current time.",extensionName:"EXT_disjoint_timer_query"},p.GPU_DISJOINT_EXT={name:"GPU_DISJOINT_EXT",value:36795,description:"A Boolean indicating whether or not the GPU performed any disjoint operation.",extensionName:"EXT_disjoint_timer_query"},p.zeroMeaningByCommand={getError:"NO_ERROR",blendFunc:"ZERO",blendFuncSeparate:"ZERO",readBuffer:"NONE",getFramebufferAttachmentParameter:"NONE",texParameterf:"NONE",texParameteri:"NONE",drawArrays:"POINTS",drawElements:"POINTS",drawArraysInstanced:"POINTS",drawArraysInstancedAngle:"POINTS",drawBuffers:"POINTS",drawElementsInstanced:"POINTS",drawRangeElements:"POINTS"},p.oneMeaningByCommand={blendFunc:"ONE",blendFuncSeparate:"ONE",drawArrays:"LINES",drawElements:"LINES",drawArraysInstanced:"LINES",drawArraysInstancedAngle:"LINES",drawBuffers:"LINES",drawElementsInstanced:"LINES",drawRangeElements:"LINES"};const m={},g={};!function(){for(const e in p)if(p.hasOwnProperty(e)){const t=p[e];m[t.name]=t,g[t.value]=t}}();class E extends c{get analyserName(){return E.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={total:0,totalTriangles:0,totalTriangleStrip:0,totalTriangleFan:0,totalLines:0,totalLineStrip:0,totalLineLoop:0,totalPoints:0};for(const t of e.commands)"drawArrays"===t.name&&t.commandArguments.length>=3||"drawArraysInstanced"===t.name&&t.commandArguments.length>=3||"drawArraysInstancedANGLE"===t.name&&t.commandArguments.length>=3?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[2]):"drawElements"===t.name&&t.commandArguments.length>=2||"drawElementsInstanced"===t.name&&t.commandArguments.length>=2||"drawElementsInstancedANGLE"===t.name&&t.commandArguments.length>=2?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[1]):"drawRangeElements"===t.name&&t.commandArguments.length>=4&&this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[3]);t.total=n.total,t.triangles=n.totalTriangles,t.triangleStrip=n.totalTriangleStrip,t.triangleFan=n.totalTriangleFan,t.lines=n.totalLines,t.lineStrip=n.totalLineStrip,t.lineLoop=n.totalLineLoop,t.points=n.totalPoints}appendToPrimitives(e,t,n){t===p.POINTS.value?e.totalPoints+=n:t===p.LINES.value?e.totalLines+=n:t===p.LINE_STRIP.value?e.totalLineStrip+=n:t===p.LINE_LOOP.value?e.totalLineLoop+=n:t===p.TRIANGLES.value?e.totalTriangles+=n:t===p.TRIANGLE_STRIP.value?e.totalTriangleStrip+=n:t===p.TRIANGLE_FAN.value&&(e.totalTriangleFan+=n),e.total+=n}}E.analyserName="Primitives";class v{constructor(e){this.contextInformation=e,this.analysers=[],this.initAnalysers()}appendAnalyses(e){for(const t in this.analysers)this.analysers.hasOwnProperty(t)&&this.analysers[t].appendAnalysis(e)}initAnalysers(){this.analysers.push(new h(this.contextInformation),new f(this.contextInformation),new E(this.contextInformation))}}class C{static getStackTrace(e=0,t=0){const n=[];try{throw new Error("Errorator.")}catch(e){if(e.stack){const t=e.stack.split("\n");for(let e=0,r=t.length;e0;t++)n.shift();for(let e=0;e0;e++)n.pop()}return n}}class D{static getWebGlObjectTag(e){return e[D.SPECTOROBJECTTAGKEY]}static attachWebGlObjectTag(e,t){t.displayText=D.stringifyWebGlObjectTag(t),e[D.SPECTOROBJECTTAGKEY]=t}static stringifyWebGlObjectTag(e){return e?`${e.typeName} - ID: ${e.id}`:"No tag available."}}D.SPECTOROBJECTTAGKEY="__SPECTOR_Object_TAG";class S{get type(){return("undefined"!=typeof globalThis?globalThis:self)[this.typeName]||null}constructor(){this.id=0}tagWebGlObject(e){if(!this.type)return;let t;if(!e)return t;if(t=D.getWebGlObjectTag(e),t)return t;if(e instanceof this.type){const n=this.getNextId();return t={typeName:this.typeName,id:n},D.attachWebGlObjectTag(e,t),t}return t}getNextId(){return this.id++}}class A{constructor(e){this.options=e}createCapture(e,t,n){const r=C.getStackTrace(4,1),i=0===e.name.indexOf("uniform")?this.stringifyUniform(e.arguments):this.stringify(e.arguments,e.result),s={id:t,startTime:e.startTime,commandEndTime:e.endTime,endTime:0,name:e.name,commandArguments:e.arguments,result:e.result,stackTrace:r,status:0,marker:n,text:i};this.transformCapture(s);for(let e=0;e50&&(s.commandArguments[e]="Array Length: "+t.length)}if(s.commandArguments){const e=[];for(let t=0;t0&&(n+=": "+this.stringifyArgs(e).join(", ")),null!=t&&(n+=" -> "+this.stringifyResult(t)),n}stringifyUniform(e){let t=this.spiedCommandName;if(e&&e.length>0){const n=[];n.push(this.stringifyValue(e[0]));for(let t=1;t0&&"number"==typeof s)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");else{const e=this.stringifyValue(s);r.push(e)}}return r}}_.commandName="bufferSubData";class y{static storeOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]||(e[n]=e[t])}static resetOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]&&(e[t]=e[n],delete e[n])}static storePrototypeOriginFunction(e,t){if(!e)return;if(!e.prototype[t])return;const n=this.getOriginFunctionName(t);e.prototype[n]||(e.prototype[n]=e.prototype[t])}static executePrototypeOriginFunction(e,t,n,r){if(!e)return;const i=this.getOriginFunctionName(n);return t.prototype[i]?(e[i]||(e[i]=t.prototype[i]),this.executeFunction(e,i,r)):void 0}static executeOriginFunction(e,t,n){if(!e)return;const r=this.getOriginFunctionName(t);return e[r]?this.executeFunction(e,r,n):void 0}static executeFunction(e,t,n){const r=n;if(void 0===r||0===r.length)return e[t]();switch(r.length){case 1:return e[t](r[0]);case 2:return e[t](r[0],r[1]);case 3:return e[t](r[0],r[1],r[2]);case 4:return e[t](r[0],r[1],r[2],r[3]);case 5:return e[t](r[0],r[1],r[2],r[3],r[4]);case 6:return e[t](r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6]);case 8:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]);case 9:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8]);case 10:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9]);case 11:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10]);case 12:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11]);case 13:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12]);case 14:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13]);case 15:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14]);case 16:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);case 17:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16]);case 18:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17]);case 19:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18]);case 20:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19]);default:return e[t].apply(e,r)}}static getOriginFunctionName(e){return this.originFunctionPrefix+e}}y.originFunctionPrefix="__SPECTOR_Origin_";class b extends A{get spiedCommandName(){return b.commandName}stringifyArgs(e){const t=[];if(e.length>0){const n=e[0],r=this.stringifyValue(n);t.push(r)}if(e.length>1){const n=""+e[1];t.push(n)}return e.length>2&&t.push(e[2]),t}}b.commandName="bindAttribLocation";class T extends A{get spiedCommandName(){return T.commandName}stringifyArgs(e){const t=[],n=this.options.context.getParameter(p.READ_FRAMEBUFFER_BINDING.value),r=this.options.tagWebGlObject(n);t.push("READ FROM: "+this.stringifyValue(r));const i=this.options.context.getParameter(p.DRAW_FRAMEBUFFER_BINDING.value),s=this.options.tagWebGlObject(i);t.push("WRITE TO: "+this.stringifyValue(s));for(let n=0;n<8;n++)t.push(e[n]);return(e[8]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[8]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[8]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t.push(p.stringifyWebGlConstant(e[9],"blitFrameBuffer")),t}}T.commandName="blitFrameBuffer";class R extends A{get spiedCommandName(){return R.commandName}stringifyArgs(e){const t=[];return(e[0]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[0]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[0]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t}}R.commandName="clear";class x{static getProgramData(e,t){const n={LINK_STATUS:e.getProgramParameter(t,p.LINK_STATUS.value),VALIDATE_STATUS:e.getProgramParameter(t,p.VALIDATE_STATUS.value),infoLog:e.getProgramInfoLog(t)||""},r=e.getAttachedShaders(t)||[],i=new Array(2);let s=0;for(const t of r){const n=this.getShaderData(e,t);s+=n.source.length,n.shaderType===p.FRAGMENT_SHADER.name?i[1]=n:i[0]=n}return{programStatus:n,shaders:i,length:s}}static getShaderData(e,t){const n=e.getShaderSource(t)||"",r=e.getExtension("WEBGL_debug_shaders"),i=r?r.getTranslatedShaderSource(t):null,s=e.getShaderParameter(t,p.SHADER_TYPE.value)===p.FRAGMENT_SHADER.value;let o=t&&t.__SPECTOR_Metadata&&t.__SPECTOR_Metadata.name?t.__SPECTOR_Metadata.name:this.readNameFromShaderSource(n);return o||(o=s?"Fragment":"Vertex"),{COMPILE_STATUS:e.getShaderParameter(t,p.COMPILE_STATUS.value),shaderType:s?p.FRAGMENT_SHADER.name:p.VERTEX_SHADER.name,name:o,source:n,translatedSource:i,infoLog:e.getShaderInfoLog(t)||""}}static readNameFromShaderSource(e){try{let t,n="";const r=/#define[\s]+SHADER_NAME[\s]+([\S]+)(\n|$)/gi;if(t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),""===n){const r=/#define[\s]+SHADER_NAME_B64[\s]+([\S]+)(\n|$)/gi;t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),n&&(n=decodeURIComponent(atob(n)))}return n}catch(e){return null}}}class w extends A{constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.shader=x.getShaderData(this.options.context,t)}finally{n&&n(!0)}}getShaderDisplayText(e){return this.stringifyValue(e.commandArguments[0])}}class F extends w{get spiedCommandName(){return F.commandName}transformCapture(e){if(super.transformCapture(e),e.shader){const t=e.shader.COMPILE_STATUS?"compiled":"failed";e.text=`${this.spiedCommandName}: ${this.getShaderDisplayText(e)} -> ${t}`}}}F.commandName="compileShader";const N=["lineWidth"];class L extends A{get spiedCommandName(){return this.internalSpiedCommandName}constructor(e,t){super(e),this.internalSpiedCommandName=t,this.isDeprecated=N.indexOf(this.spiedCommandName)>-1}transformCapture(e){this.isDeprecated&&(e.status=50)}}class O extends A{get spiedCommandName(){return O.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}O.commandName="disableVertexAttribArray";class I extends A{get spiedCommandName(){return I.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(e[1]+" indices"),t.push(e[2]),t}}I.commandName="drawArrays";class k extends A{get spiedCommandName(){return k.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}k.commandName="drawArraysInstanced";class M extends A{get spiedCommandName(){return M.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstancedANGLE")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}M.commandName="drawArraysInstancedANGLE";class P extends A{get spiedCommandName(){return P.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElements")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElements")),t.push(e[3]),t}}P.commandName="drawElements";class B extends A{get spiedCommandName(){return B.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstancedANGLE")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstancedANGLE")),t.push(e[3]),t.push(e[4]),t}}B.commandName="drawElementsInstancedANGLE";class U extends A{get spiedCommandName(){return U.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t}}U.commandName="drawElementsInstanced";class $ extends A{get spiedCommandName(){return $.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawRangeElements")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(p.stringifyWebGlConstant(e[4],"drawRangeElements")),t.push(e[5]),t}}$.commandName="drawRangeElements";class G extends A{get spiedCommandName(){return G.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}G.commandName="getActiveAttrib";class V extends A{get spiedCommandName(){return V.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}V.commandName="getActiveUniform";class W extends A{get spiedCommandName(){return W.commandName}stringifyResult(e){var t;if(null!=e)return null!==(t=null==e?void 0:e.toFixed(0))&&void 0!==t?t:"0"}}W.commandName="getAttribLocation";class H extends A{get spiedCommandName(){return H.commandName}stringifyResult(e){return e?"true":"false"}}H.commandName="getExtension";class j extends A{get spiedCommandName(){return j.commandName}stringifyResult(e){if(!e)return"null";const t=D.getWebGlObjectTag(e);return t?t.displayText:e}}j.commandName="getParameter";class z extends A{get spiedCommandName(){return z.commandName}stringifyResult(e){if(e)return`min: ${e.rangeMin}, max: ${e.rangeMax}, precision: ${e.precision}`}}z.commandName="getShaderPrecisionFormat";class X extends w{get spiedCommandName(){return X.commandName}stringifyResult(e){if("string"!=typeof e||0===e.trim().length)return"No messages";const t=e.split(/\r?\n/).filter(e=>e.trim().length>0).length;return t+(1===t?" message":" messages")}}X.commandName="getShaderInfoLog";class K extends A{get spiedCommandName(){return K.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}K.commandName="getTransformFeedbackVarying";class Y extends A{get spiedCommandName(){return Y.commandName}constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.program=x.getProgramData(this.options.context,t)}finally{n&&n(!0)}const r=e.program.programStatus.LINK_STATUS?"linked":"failed";e.text=`${this.spiedCommandName}: ${this.stringifyValue(t)} -> ${r}`}}Y.commandName="linkProgram";class q extends A{get spiedCommandName(){return q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"multiDrawArraysInstancedBaseInstanceWEBGL")),t.push(`drawCount=${e[9]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t}}q.commandName="multiDrawArraysInstancedBaseInstanceWEBGL";class Q extends A{get spiedCommandName(){return Q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[7]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t}}Q.commandName="multiDrawArraysInstancedWEBGL";class Z extends A{get spiedCommandName(){return Z.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[5]}`),t.push(e[2]),t.push(e[4]),t}}Z.commandName="multiDrawArraysWEBGL";class J extends A{get spiedCommandName(){return J.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[11]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t.push(e[10]),t}}J.commandName="multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL";class ee extends A{get spiedCommandName(){return ee.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[8]}`),t.push(e[2]),t.push(e[5]),t.push(e[7]),t}}ee.commandName="multiDrawElementsInstancedWEBGL";class te extends A{get spiedCommandName(){return te.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[6]}`),t.push(e[2]),t.push(e[5]),t}}te.commandName="multiDrawElementsWEBGL";class ne extends A{get spiedCommandName(){return ne.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(`baseInstance = ${e[4]}`),t}}ne.commandName="drawArraysInstancedBaseInstanceWEBGL";class re extends A{get spiedCommandName(){return re.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t.push(`baseVertex = ${e[5]}`),t.push(`baseInstance = ${e[6]}`),t}}re.commandName="drawElementsInstancedBaseVertexBaseInstanceWEBGL";class ie extends A{get spiedCommandName(){return ie.commandName}stringifyArgs(e){var t,n;const r=[];for(let i=0;i<4;i++)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");return r}}function se(e){return null==e?"":`${e.toFixed(0)} (0b${(e>>>0).toString(2)})`}ie.commandName="scissor";class oe extends A{get spiedCommandName(){return oe.commandName}stringifyArgs(e){const t=[];return t.push(se(e[0])),t}}oe.commandName="stencilMask";class ae extends A{get spiedCommandName(){return ae.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilMaskSeparate")),t.push(se(e[1])),t}}ae.commandName="stencilMaskSeparate";class le extends A{get spiedCommandName(){return le.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFunc")),t.push(se(e[1])),t.push(se(e[2])),t}}le.commandName="stencilFunc";class ue extends A{get spiedCommandName(){return ue.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFuncSeparate")),t.push(p.stringifyWebGlConstant(e[1],"stencilFuncSeparate")),t.push(se(e[2])),t.push(se(e[3])),t}}ue.commandName="stencilFuncSeparate";class ce extends A{get spiedCommandName(){return ce.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t.push(e[1]),t.push(p.stringifyWebGlConstant(e[2],"vertexAttribPointer")),t.push(e[3]),t.push(e[4]),t.push(e[5]),t}}ce.commandName="vertexAttribPointer";class he extends A{get spiedCommandName(){return he.commandName}stringifyArgs(e){const t=[];for(let n=0;n<4;n++)t.push(e[n].toFixed(0));return t}}he.commandName="viewport";class de extends A{get spiedCommandName(){return de.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}de.commandName="enableVertexAttribArray";class fe extends w{get spiedCommandName(){return fe.commandName}stringifyArgs(e){const t="string"==typeof e[1]?e[1]:"";return[this.stringifyValue(e[0]),t.length+" chars"]}transformCapture(e){super.transformCapture(e);const t=e.commandArguments[1];e.shader&&"string"==typeof t&&(e.shader.source=t,e.shader.COMPILE_STATUS=null,e.shader.translatedSource="",e.shader.infoLog="")}}fe.commandName="shaderSource";class pe{constructor(e){this.spiedCommandName=e.spiedCommandName,this.spiedCommandRunningContext=e.spiedCommandRunningContext,this.spiedCommand=this.spiedCommandRunningContext[this.spiedCommandName],y.storeOriginFunction(this.spiedCommandRunningContext,this.spiedCommandName),this.callback=e.callback,this.commandOptions={context:e.context,contextVersion:e.contextVersion,extensions:e.extensions,toggleCapture:e.toggleCapture},this.initCustomCommands(),this.initCommand()}spy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.overloadedCommand}unSpy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.spiedCommand}createCapture(e,t,n){return this.command.createCapture(e,t,n)}initCommand(){pe.customCommandsConstructors[this.spiedCommandName]?this.command=pe.customCommandsConstructors[this.spiedCommandName](this.commandOptions):this.command=new L(this.commandOptions,this.spiedCommandName),this.overloadedCommand=this.getSpy()}getSpy(){const e=this;return function(){const t=u.now,n=y.executeOriginFunction(e.spiedCommandRunningContext,e.spiedCommandName,arguments),r=u.now;try{const i={name:e.spiedCommandName,arguments,result:n,startTime:t,endTime:r};e.callback(e,i)}catch(e){}return n}}initCustomCommands(){pe.customCommandsConstructors||(pe.customCommandsConstructors={[b.commandName]:e=>new b(e),[T.commandName]:e=>new T(e),[_.commandName]:e=>new _(e),[R.commandName]:e=>new R(e),[F.commandName]:e=>new F(e),[O.commandName]:e=>new O(e),[I.commandName]:e=>new I(e),[k.commandName]:e=>new k(e),[M.commandName]:e=>new M(e),[P.commandName]:e=>new P(e),[U.commandName]:e=>new U(e),[B.commandName]:e=>new B(e),[$.commandName]:e=>new $(e),[G.commandName]:e=>new G(e),[V.commandName]:e=>new V(e),[W.commandName]:e=>new W(e),[H.commandName]:e=>new H(e),[j.commandName]:e=>new j(e),[X.commandName]:e=>new X(e),[z.commandName]:e=>new z(e),[K.commandName]:e=>new K(e),[Y.commandName]:e=>new Y(e),[q.commandName]:e=>new q(e),[Q.commandName]:e=>new Q(e),[Z.commandName]:e=>new Z(e),[J.commandName]:e=>new J(e),[ee.commandName]:e=>new ee(e),[te.commandName]:e=>new te(e),[ne.commandName]:e=>new ne(e),[re.commandName]:e=>new re(e),[ie.commandName]:e=>new ie(e),[fe.commandName]:e=>new fe(e),[oe.commandName]:e=>new oe(e),[ae.commandName]:e=>new ae(e),[le.commandName]:e=>new le(e),[ue.commandName]:e=>new ue(e),[ce.commandName]:e=>new ce(e),[he.commandName]:e=>new he(e),[de.commandName]:e=>new de(e)})}}class me{constructor(e){this.options=e,this.context=e.context,this.contextVersion=e.contextVersion,this.extensions=e.extensions,this.toggleCapture=e.toggleCapture,this.consumeCommands=this.getConsumeCommands(),this.changeCommandsByState=this.getChangeCommandsByState(),this.commandNameToStates=this.getCommandNameToStates()}get requireStartAndStopStates(){return!0}startCapture(e,t,n){return this.quickCapture=t,this.fullCapture=n,this.capturedCommandsByState={},e&&this.requireStartAndStopStates&&(this.currentState={},this.readFromContextNoSideEffects()),this.copyCurrentStateToPrevious(),this.currentState={},this.previousState}stopCapture(){return this.requireStartAndStopStates&&this.readFromContextNoSideEffects(),this.analyse(void 0),this.currentState}registerCallbacks(e){for(const t in this.changeCommandsByState)if(this.changeCommandsByState.hasOwnProperty(t))for(const n of this.changeCommandsByState[t])e[n]=e[n]||[],e[n].push(this.onChangeCommand.bind(this));for(const t of this.consumeCommands)e[t]=e[t]||[],e[t].push(this.onConsumeCommand.bind(this))}getStateData(){return this.currentState}getConsumeCommands(){return[]}getChangeCommandsByState(){return{}}copyCurrentStateToPrevious(){this.currentState&&(this.previousState=this.currentState)}onChangeCommand(e){const t=this.commandNameToStates[e.name];for(const n of t){if(!this.isValidChangeCommand(e,n))return;this.capturedCommandsByState[n]=this.capturedCommandsByState[n]||[],this.capturedCommandsByState[n].push(e)}}isValidChangeCommand(e,t){return!0}onConsumeCommand(e){this.isValidConsumeCommand(e)&&(this.readFromContextNoSideEffects(),this.analyse(e),this.storeCommandIds(),e[this.stateName]=this.currentState,this.startCapture(!1,this.quickCapture,this.fullCapture))}isValidConsumeCommand(e){return this.lastCommandName=null==e?void 0:e.name,!0}analyse(e){for(const t in this.capturedCommandsByState)if(this.capturedCommandsByState.hasOwnProperty(t)){const n=this.capturedCommandsByState[t],r=n.length-1;if(r>=0)if(e){for(let t=0;t1&&this.parameters.push(this.getWebgl2Parameters());const e={};for(let t=1;t<=this.contextVersion&&!(t>this.parameters.length);t++)if(this.parameters[t-1])for(const n of this.parameters[t-1])if(n.changeCommands)for(const t of n.changeCommands)e[n.constant.name]=e[n.constant.name]||[],e[n.constant.name].push(t);return e}readFromContext(){for(let e=1;e<=this.contextVersion&&!(e>this.parameters.length);e++)for(const t of this.parameters[e-1]){const e=this.readParameterFromContext(t);if(null==e){const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n;continue}const n=D.getWebGlObjectTag(e);if(n)this.currentState[t.constant.name]=n;else{const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n}}}readParameterFromContext(e){return e.constant.extensionName&&!this.extensions[e.constant.extensionName]?`Extension ${e.constant.extensionName} is unavailable.`:this.context.getParameter(e.constant.value)}stringifyParameterValue(e,t){if(null===e)return"null";if(void 0===e)return"undefined";if(30===t.returnType)return se(e);if("number"==typeof e&&p.isWebGlConstant(e)){if(20===t.returnType){const n=t.changeCommands&&t.changeCommands[0]||"";return p.stringifyWebGlConstant(e,n)}return e}if(e.length&&"string"!=typeof e){const t=[];for(let n=0;n1?r=this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value):this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.value)===p.RENDERBUFFER.value&&(r=e.getRenderbufferParameter(e.RENDERBUFFER,e.RENDERBUFFER_STENCIL_SIZE))):r=this.readParameterFromContext({constant:p.STENCIL_BITS}),this.currentState[p.STENCIL_BITS.name]=""+r}isValidChangeCommand(e,t){return"enable"===e.name||"disable"===e.name?e.commandArguments[0]===p.STENCIL_TEST.value:"stencilOp"===e.name||"stencilOpSeparate"===e.name?xe.stencilOpStates.indexOf(e.commandArguments[0])>0:"stencilFunc"===e.name||"stencilFuncSeparate"===e.name?xe.stencilFuncStates.indexOf(e.commandArguments[0])>0:"stencilMask"!==e.name&&"stencilMaskSeparate"!==e.name||xe.stencilMaskStates.indexOf(e.commandArguments[0])>0}getConsumeCommands(){return d}isStateEnable(e,t){return this.context.isEnabled(p.STENCIL_TEST.value)}}xe.stateName="StencilState",xe.stencilOpStates=[p.STENCIL_BACK_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_PASS.value,p.STENCIL_FAIL.value,p.STENCIL_PASS_DEPTH_FAIL.value,p.STENCIL_PASS_DEPTH_PASS.value],xe.stencilFuncStates=[p.STENCIL_BACK_FUNC.value,p.STENCIL_BACK_REF.value,p.STENCIL_BACK_VALUE_MASK.value,p.STENCIL_FUNC.value,p.STENCIL_REF.value,p.STENCIL_VALUE_MASK.value],xe.stencilMaskStates=[p.STENCIL_BACK_WRITEMASK.value,p.STENCIL_WRITEMASK.value];class we{static isSupportedCombination(e,t,n){return e=e||p.UNSIGNED_BYTE.value,((t=t||p.RGBA.value)===p.RGB.value||t===p.RGBA.value)&&(n===p.RGB.value||n===p.RGBA.value||n===p.RGBA8.value||n===p.RGBA16F.value||n===p.RGBA32F.value||n===p.RGB16F.value||n===p.RGB32F.value||n===p.R11F_G11F_B10F.value||n===p.SRGB8.value||n===p.SRGB8_ALPHA8.value)&&this.isSupportedComponentType(e)}static readPixels(e,t,n,r,i,s){e.getError(),s===p.UNSIGNED_NORMALIZED.value&&(s=p.UNSIGNED_BYTE.value);const o=r*i*4;let a;if(s===p.UNSIGNED_BYTE.value?a=new Uint8Array(o):(s=p.FLOAT.value,a=new Float32Array(o)),e.readPixels(t,n,r,i,e.RGBA,s,a),e.getError())return;if(s===p.UNSIGNED_BYTE.value)return a;const l=new Uint8Array(r*i*4);for(let e=0;e1){const e=this.context.getParameter(p.MAX_DRAW_BUFFERS.value);for(let n=0;n1?this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value):p.UNSIGNED_BYTE.value;l===p.RENDERBUFFER.value?this.readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,c,u):l===p.TEXTURE.value&&this.readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,c,u)}readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,l,u){let c=0,h=0;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,c=e.samples,h=e.internalFormat,!c&&!we.isSupportedCombination(l,p.RGBA.value,h))return}else s+=r,o+=i;if(r=i=0,c){const a=e,u=e.createRenderbuffer(),c=e.getParameter(e.RENDERBUFFER_BINDING);e.bindRenderbuffer(e.RENDERBUFFER,u),e.renderbufferStorage(e.RENDERBUFFER,h,s,o),e.bindRenderbuffer(e.RENDERBUFFER,c),e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u);const d=a.getParameter(a.READ_FRAMEBUFFER_BINDING),f=a.getParameter(a.DRAW_FRAMEBUFFER_BINDING);a.bindFramebuffer(a.READ_FRAMEBUFFER,t),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,this.captureFrameBuffer),a.blitFramebuffer(0,0,s,o,0,0,s,o,e.COLOR_BUFFER_BIT,e.NEAREST),a.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),a.bindFramebuffer(a.READ_FRAMEBUFFER,d),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,f),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t),e.deleteRenderbuffer(u)}else e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,l,u){let c=0;this.contextVersion>1&&(c=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value));const h=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL.value),d=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE.value);d>0?g[d].name:p.TEXTURE_2D.name;let f=!1,m=l;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,void 0!==e.type&&(m=e.type),f=e.target===p.TEXTURE_2D_ARRAY.name,!we.isSupportedCombination(e.type,e.format,e.internalFormat))return}else s+=r,o+=i;r=i=0,e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),c>0||f?e.framebufferTextureLayer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,u,h,c):e.framebufferTexture2D(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,d||p.TEXTURE_2D.value,u,h),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,d,c,m),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}getCapture(e,t,n,r,i,s,o,l,u){i=Math.floor(i),s=Math.floor(s);const c={attachmentName:t,src:null,textureCubeMapFace:o?g[o].name:null,textureLayer:l,raw:null};if(!this.quickCapture)try{const t=we.readPixels(e,n,r,i,s,u);if(t){c.raw=Ne.encode(t,i,s),this.workingCanvas.width=i,this.workingCanvas.height=s;const e=this.workingContext2D.createImageData(i,s);if(e.data.set(t),this.workingContext2D.putImageData(e,0,0),this.fullCapture)this.captureCanvas.width=this.workingCanvas.width,this.captureCanvas.height=this.workingCanvas.height;else{const e=i/s;e<1?(this.captureCanvas.width=Le.captureBaseSize*e,this.captureCanvas.height=Le.captureBaseSize):e>1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this.captureContext2D.drawImage(this.workingCanvas,0,0,i,s,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",c.src=Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D)}}catch(e){a.warn("Spector can not capture the visual state: "+e)}this.currentState.Attachments.push(c)}analyse(e){}}Le.stateName="VisualState",Le.captureBaseSize=256;class Oe{constructor(e){this.context=e.context,this.captureFrameBuffer=e.context.createFramebuffer(),this.workingCanvas=Fe.createCanvas(1,1),this.workingContext2D=Fe.get2DContext(this.workingCanvas),this.captureCanvas=Fe.createCanvas(1,1),this.captureContext2D=Fe.get2DContext(this.captureCanvas),Fe.setImageSmoothing(this.captureContext2D,!0)}appendTextureState(e,t,n=null,r){if(!t)return;const i=t.__SPECTOR_Object_CustomData;if(i&&(this.fullCapture=r,i.type&&(e.textureType=this.getWebGlConstant(i.type)),i.format&&(e.format=this.getWebGlConstant(i.format)),i.internalFormat&&(e.internalFormat=this.getWebGlConstant(i.internalFormat)),e.width=i.width,e.height=i.height,i.depth&&(e.depth=i.depth),n)){const r="NEAREST"===e.samplerMagFilter||"NEAREST"===e.magFilter,s=this.getTextureVisualState(n,t,i,r);if(s){e.visual=s.visual;for(const t in s.visualPixels)if(s.visualPixels.hasOwnProperty(t)){e.visualPixels=s.visualPixels;break}}}}getTextureVisualState(e,t,n,r){try{const i=this.context,s={},o={};if(!we.isSupportedCombination(n.type,n.format,n.internalFormat))return{visual:s,visualPixels:o};const a=this.context.getParameter(p.FRAMEBUFFER_BINDING.value);i.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer);try{const a=0,l=n.width,u=n.height;if(e===p.TEXTURE_3D&&n.depth){const e=i;for(let c=0;c2&&c2&&c1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}return this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this._setSmoothing(!o),this.captureContext2D.drawImage(this.workingCanvas,0,0,r,i,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",{src:Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D),raw:l}}catch(e){}return{src:void 0,raw:null}}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}_setSmoothing(e){Fe.setImageSmoothing(this.captureContext2D,e)}}Oe.captureBaseSize=64,Oe.cubeMapFaces=[p.TEXTURE_CUBE_MAP_POSITIVE_X,p.TEXTURE_CUBE_MAP_POSITIVE_Y,p.TEXTURE_CUBE_MAP_POSITIVE_Z,p.TEXTURE_CUBE_MAP_NEGATIVE_X,p.TEXTURE_CUBE_MAP_NEGATIVE_Y,p.TEXTURE_CUBE_MAP_NEGATIVE_Z];class Ie{constructor(e){this.context=e.context}getUboValue(e,t,n,r){const i=Ie.uboTypes[r];if(!i)return;const s=new i.arrayBufferView(n*i.lengthMultiplier),o=this.context,a=o.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,e);if(a){const n=o.getIndexedParameter(p.UNIFORM_BUFFER_START.value,e),r=o.getParameter(p.UNIFORM_BUFFER_BINDING.value);try{o.bindBuffer(p.UNIFORM_BUFFER.value,a),o.getBufferSubData(p.UNIFORM_BUFFER.value,n+t,s)}catch(e){return}r&&o.bindBuffer(p.UNIFORM_BUFFER.value,r)}return Array.prototype.slice.call(s)}}Ie.uboTypes={[p.BOOL.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.BOOL_VEC2.value]:{arrayBufferView:Uint8Array,lengthMultiplier:2},[p.BOOL_VEC3.value]:{arrayBufferView:Uint8Array,lengthMultiplier:3},[p.BOOL_VEC4.value]:{arrayBufferView:Uint8Array,lengthMultiplier:4},[p.INT.value]:{arrayBufferView:Int32Array,lengthMultiplier:1},[p.INT_VEC2.value]:{arrayBufferView:Int32Array,lengthMultiplier:2},[p.INT_VEC3.value]:{arrayBufferView:Int32Array,lengthMultiplier:3},[p.INT_VEC4.value]:{arrayBufferView:Int32Array,lengthMultiplier:4},[p.UNSIGNED_INT.value]:{arrayBufferView:Uint32Array,lengthMultiplier:1},[p.UNSIGNED_INT_VEC2.value]:{arrayBufferView:Uint32Array,lengthMultiplier:2},[p.UNSIGNED_INT_VEC3.value]:{arrayBufferView:Uint32Array,lengthMultiplier:3},[p.UNSIGNED_INT_VEC4.value]:{arrayBufferView:Uint32Array,lengthMultiplier:4},[p.FLOAT.value]:{arrayBufferView:Float32Array,lengthMultiplier:1},[p.FLOAT_VEC2.value]:{arrayBufferView:Float32Array,lengthMultiplier:2},[p.FLOAT_VEC3.value]:{arrayBufferView:Float32Array,lengthMultiplier:3},[p.FLOAT_VEC4.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT2x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT3.value]:{arrayBufferView:Float32Array,lengthMultiplier:9},[p.FLOAT_MAT3x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT3x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.FLOAT_MAT4.value]:{arrayBufferView:Float32Array,lengthMultiplier:16},[p.FLOAT_MAT4x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT4x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.SAMPLER_2D.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.SAMPLER_CUBE.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1}};class ke extends S{get typeName(){return"WebGLBuffer"}}class Me extends S{get typeName(){return"WebGLFramebuffer"}}class Pe extends S{get typeName(){return"WebGLProgram"}static saveInGlobalStore(e){const t=D.getWebGlObjectTag(e);t&&(this.store[t.id]=e)}static getFromGlobalStore(e){return this.store[e]}static updateInGlobalStore(e,t){if(!t)return;const n=this.getFromGlobalStore(e);if(!n)return;const r=D.getWebGlObjectTag(n);r&&(D.attachWebGlObjectTag(t,r),this.store[r.id]=t)}}Pe.store={};class Be extends S{get typeName(){return"WebGLQuery"}}class Ue extends S{get typeName(){return"WebGLRenderbuffer"}}class $e extends S{get typeName(){return"WebGLSampler"}}class Ge extends S{get typeName(){return"WebGLShader"}}class Ve extends S{get typeName(){return"WebGLSync"}}class We extends S{get typeName(){return"WebGLTexture"}}class He extends S{get typeName(){return"WebGLTransformFeedback"}}class je extends S{get typeName(){return"WebGLUniformLocation"}}class ze extends S{get typeName(){return"WebGLVertexArrayObject"}}class Xe extends me{get stateName(){return Xe.stateName}get requireStartAndStopStates(){return!1}constructor(e){super(e),this.drawCallTextureInputState=new Oe(e),this.drawCallUboInputState=new Ie(e)}getConsumeCommands(){return d}getChangeCommandsByState(){return{}}readFromContext(){var e,t;const n=this.context.getParameter(p.CURRENT_PROGRAM.value);if(!n)return;this.currentState.frameBuffer=this.readFrameBufferFromContext();const r=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData:x.getProgramData(this.context,n);if(this.currentState.programStatus=Object.assign({},r.programStatus),this.currentState.programStatus.program=this.getSpectorData(n),this.currentState.programStatus.RECOMPILABLE=o.isBuildableProgram(n),this.currentState.programStatus.RECOMPILABLE&&Pe.saveInGlobalStore(n),this.currentState.shaders=r.shaders,(null===(e=this.lastCommandName)||void 0===e?void 0:e.indexOf("Elements"))>=0){const e=this.context.getParameter(this.context.ELEMENT_ARRAY_BUFFER_BINDING);e&&(this.currentState.elementArray={},this.currentState.elementArray.arrayBuffer=this.getSpectorData(e))}const i=this.context.getProgramParameter(n,p.ACTIVE_ATTRIBUTES.value);this.currentState.attributes=[];for(let e=0;e1){const e=this.context.getProgramParameter(n,p.ACTIVE_UNIFORM_BLOCKS.value);this.currentState.uniformBlocks=[];for(let t=0;t1){const e=this.context;t.colorAttachments=[];const n=e.getParameter(p.MAX_DRAW_BUFFERS.value);for(let e=0;e1&&(r.alphaSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE.value),r.blueSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE.value),r.encoding=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.value)),r.componentType=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value)),r.depthSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE.value),r.greenSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE.value),r.redSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_RED_SIZE.value),r.stencilSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value),n===p.TEXTURE.value&&(r.textureLayer=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value))),r}readAttributeFromContext(e,t){const n=this.context.getActiveAttrib(e,t),r=this.context.getAttribLocation(e,n.name);if(-1===r)return{name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:-1};const i=this.context.getVertexAttrib(r,p.CURRENT_VERTEX_ATTRIB.value),s=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING.value),o={name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:r,offsetPointer:this.context.getVertexAttribOffset(r,p.VERTEX_ATTRIB_ARRAY_POINTER.value),bufferBinding:this.getSpectorData(s),enabled:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_ENABLED.value),arraySize:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_SIZE.value),stride:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_STRIDE.value),arrayType:this.getWebGlConstant(this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_TYPE.value)),normalized:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_NORMALIZED.value),vertexAttrib:Array.prototype.slice.call(i)};return this.extensions[p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.extensionName]?o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.value):this.contextVersion>1&&(o.integer=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_INTEGER.value),o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR.value)),this.appendBufferCustomData(o,s),o}readUniformFromContext(e,t){const n=this.context.getActiveUniform(e,t),r=this.context.getUniformLocation(e,n.name);if(r){if(n.size>1&&n.name&&n.name.indexOf("[0]")===n.name.length-3){const t=[];for(let r=0;r1){r.baseLevel=this.context.getTexParameter(t.value,p.TEXTURE_BASE_LEVEL.value),r.immutable=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_FORMAT.value),r.immutableLevels=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_LEVELS.value),r.maxLevel=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LEVEL.value);const e=this.context.getParameter(p.SAMPLER_BINDING.value);if(e){r.sampler=this.getSpectorData(e);const t=this.context;r.samplerMaxLod=t.getSamplerParameter(e,p.TEXTURE_MAX_LOD.value),r.samplerMinLod=t.getSamplerParameter(e,p.TEXTURE_MIN_LOD.value),r.samplerCompareFunc=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_FUNC.value)),r.samplerCompareMode=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_MODE.value)),r.samplerWrapS=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_S.value)),r.samplerWrapT=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_T.value)),r.samplerWrapR=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_R.value)),r.samplerMagFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MAG_FILTER.value)),r.samplerMinFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MIN_FILTER.value))}else r.maxLod=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LOD.value),r.minLod=this.context.getTexParameter(t.value,p.TEXTURE_MIN_LOD.value),r.compareFunc=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_FUNC.value)),r.compareMode=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_MODE.value)),r.wrapR=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_WRAP_R.value))}const i=this.getTextureStorage(t);if(i){const e=this.quickCapture?null:t;this.drawCallTextureInputState.appendTextureState(r,i,e,this.fullCapture)}return this.context.activeTexture(n),r}getTextureStorage(e){return e===p.TEXTURE_2D?this.context.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP?this.context.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):e===p.TEXTURE_3D?this.context.getParameter(p.TEXTURE_BINDING_3D.value):e===p.TEXTURE_2D_ARRAY?this.context.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):void 0}readUniformsFromContextIntoState(e,t,n,r){const i=this.context,s=i.getActiveUniforms(e,t,p.UNIFORM_TYPE.value),o=i.getActiveUniforms(e,t,p.UNIFORM_SIZE.value),a=i.getActiveUniforms(e,t,p.UNIFORM_BLOCK_INDEX.value),l=i.getActiveUniforms(e,t,p.UNIFORM_OFFSET.value),u=i.getActiveUniforms(e,t,p.UNIFORM_ARRAY_STRIDE.value),c=i.getActiveUniforms(e,t,p.UNIFORM_MATRIX_STRIDE.value),h=i.getActiveUniforms(e,t,p.UNIFORM_IS_ROW_MAJOR.value);for(let d=0;d-1&&(t.blockName=i.getActiveUniformBlockName(e,t.blockIndice)),t.offset=l[d],t.arrayStride=u[d],t.matrixStride=c[d],t.rowMajor=h[d],t.blockIndice>-1){const e=r[a[d]].bindingPoint;t.value=this.drawCallUboInputState.getUboValue(e,t.offset,t.size,s[d])}}}readTransformFeedbackFromContext(e,t){const n=this.context,r=n.getTransformFeedbackVarying(e,t),i=n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value,t),s={name:r.name,size:r.size,type:this.getWebGlConstant(r.type),buffer:this.getSpectorData(i),bufferSize:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_SIZE.value,t),bufferStart:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_START.value,t)};return this.appendBufferCustomData(s,i),s}readUniformBlockFromContext(e,t){const n=this.context,r=n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_BINDING.value),i=n.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,r),s={name:n.getActiveUniformBlockName(e,t),bindingPoint:r,size:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_DATA_SIZE.value),activeUniformCount:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_ACTIVE_UNIFORMS.value),vertex:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER.value),fragment:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER.value),buffer:this.getSpectorData(i)};return this.appendBufferCustomData(s,i),s}appendBufferCustomData(e,t){if(t){const n=t.__SPECTOR_Object_CustomData;n&&(n.usage&&(e.bufferUsage=this.getWebGlConstant(n.usage)),e.bufferLength=n.length,n.offset&&(e.bufferOffset=n.offset),n.sourceLength&&(e.bufferSourceLength=n.sourceLength))}}getWebGlConstant(e){const t=g[e];return t?t.name:e}}Xe.stateName="DrawCall",Xe.samplerTypes={[p.SAMPLER_2D.value]:p.TEXTURE_2D,[p.SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.SAMPLER_3D.value]:p.TEXTURE_3D,[p.SAMPLER_2D_SHADOW.value]:p.TEXTURE_2D,[p.SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_2D_ARRAY_SHADOW.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_CUBE_SHADOW.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.UNSIGNED_INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.UNSIGNED_INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.UNSIGNED_INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.UNSIGNED_INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY};class Ke{constructor(e){this.contextInformation=e,this.stateTrackers=[],this.onCommandCapturedCallbacks={},this.initStateTrackers()}startCapture(e,t,n){for(const r of this.stateTrackers){const i=r.startCapture(!0,t,n);r.requireStartAndStopStates&&(e.initState[r.stateName]=i)}}stopCapture(e){for(const t of this.stateTrackers){const n=t.stopCapture();t.requireStartAndStopStates&&(e.endState[t.stateName]=n)}}captureState(e){const t=this.onCommandCapturedCallbacks[e.name];if(t)for(const n of t)n(e)}initStateTrackers(){this.stateTrackers.push(new Ee(this.contextInformation),new ve(this.contextInformation),new Ce(this.contextInformation),new De(this.contextInformation),new Se(this.contextInformation),new Ae(this.contextInformation),new _e(this.contextInformation),new ye(this.contextInformation),new be(this.contextInformation),new Te(this.contextInformation),new Re(this.contextInformation),new xe(this.contextInformation),new Le(this.contextInformation),new Xe(this.contextInformation));for(const e of this.stateTrackers)e.registerCallbacks(this.onCommandCapturedCallbacks)}}class Ye{static initializeByteSizeFormat(){this.byteSizePerInternalFormat||(this.byteSizePerInternalFormat={[p.R8.value]:1,[p.R16F.value]:2,[p.R32F.value]:4,[p.R8UI.value]:1,[p.RG8.value]:2,[p.RG16F.value]:4,[p.RG32F.value]:8,[p.ALPHA.value]:1,[p.RGB.value]:3,[p.RGBA.value]:4,[p.LUMINANCE.value]:1,[p.LUMINANCE_ALPHA.value]:2,[p.DEPTH_COMPONENT.value]:1,[p.DEPTH_STENCIL.value]:2,[p.SRGB_EXT.value]:3,[p.SRGB_ALPHA_EXT.value]:4,[p.RGB8.value]:3,[p.SRGB8.value]:3,[p.RGB565.value]:2,[p.R11F_G11F_B10F.value]:4,[p.RGB9_E5.value]:2,[p.RGB16F.value]:6,[p.RGB32F.value]:12,[p.RGB8UI.value]:3,[p.RGBA8.value]:4,[p.RGB5_A1.value]:2,[p.RGBA16F.value]:8,[p.RGBA32F.value]:16,[p.RGBA8UI.value]:4,[p.COMPRESSED_R11_EAC.value]:4,[p.COMPRESSED_SIGNED_R11_EAC.value]:4,[p.COMPRESSED_RG11_EAC.value]:4,[p.COMPRESSED_SIGNED_RG11_EAC.value]:4,[p.COMPRESSED_RGB8_ETC2.value]:4,[p.COMPRESSED_RGBA8_ETC2_EAC.value]:4,[p.COMPRESSED_SRGB8_ETC2.value]:4,[p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC.value]:4,[p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_RGB_S3TC_DXT1_EXT.value]:.5,[p.COMPRESSED_RGBA_S3TC_DXT3_EXT.value]:1,[p.COMPRESSED_RGBA_S3TC_DXT5_EXT.value]:1,[p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGB_ETC1_WEBGL.value]:.5,[p.COMPRESSED_RGB_ATC_WEBGL.value]:.5,[p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL.value]:1,[p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL.value]:1})}constructor(e){this.options=e,this.createCommandNames=this.getCreateCommandNames(),this.updateCommandNames=this.getUpdateCommandNames(),this.deleteCommandNames=this.getDeleteCommandNames(),this.startTime=u.now,this.memoryPerSecond={},this.totalMemory=0,this.frameMemory=0,this.capturing=!1,Ye.initializeByteSizeFormat()}registerCallbacks(e){for(const t of this.createCommandNames)e[t]=e[t]||[],e[t].push(this.createWithoutSideEffects.bind(this));for(const t of this.updateCommandNames)e[t]=e[t]||[],e[t].push(this.updateWithoutSideEffects.bind(this));for(const t of this.deleteCommandNames)e[t]=e[t]||[],e[t].push(this.deleteWithoutSideEffects.bind(this))}startCapture(){this.frameMemory=0,this.capturing=!0}stopCapture(){this.frameMemory=0,this.capturing=!1}appendRecordedInformation(e){e.frameMemory[this.objectName]=this.frameMemory,e.memory[this.objectName]=this.memoryPerSecond}create(e){}createWithoutSideEffects(e){this.options.toggleCapture(!1);try{this.create(e)}finally{this.options.toggleCapture(!0)}}updateWithoutSideEffects(e){if(e&&0!==e.arguments.length){this.options.toggleCapture(!1);try{const t=e.arguments[0],n=this.getBoundInstance(t);if(!n)return;if(!D.getWebGlObjectTag(n))return;const r=this.getWebGlConstant(t),i=this.update(e,r,n);this.changeMemorySize(i)}finally{this.options.toggleCapture(!0)}}}deleteWithoutSideEffects(e){if(!e||!e.arguments||e.arguments.length<1)return;const t=e.arguments[0];if(t){this.options.toggleCapture(!1);try{const e=this.delete(t);this.changeMemorySize(-e)}finally{this.options.toggleCapture(!0)}}}changeMemorySize(e){this.totalMemory+=e,this.capturing&&(this.frameMemory+=e);const t=u.now-this.startTime,n=Math.round(t/1e3);this.memoryPerSecond[n]=this.totalMemory}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}getByteSizeForInternalFormat(e){return Ye.byteSizePerInternalFormat[e]||4}readPixelStoreState(){const e=this.options.context,t={UNPACK_FLIP_Y_WEBGL:e.getParameter(p.UNPACK_FLIP_Y_WEBGL.value),UNPACK_PREMULTIPLY_ALPHA_WEBGL:e.getParameter(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL.value),UNPACK_COLORSPACE_CONVERSION_WEBGL:e.getParameter(p.UNPACK_COLORSPACE_CONVERSION_WEBGL.value),UNPACK_ALIGNMENT:e.getParameter(p.UNPACK_ALIGNMENT.value)};return e instanceof WebGL2RenderingContext&&(t.UNPACK_ROW_LENGTH=e.getParameter(p.UNPACK_ROW_LENGTH.value),t.UNPACK_IMAGE_HEIGHT=e.getParameter(p.UNPACK_IMAGE_HEIGHT.value),t.UNPACK_SKIP_PIXELS=e.getParameter(p.UNPACK_SKIP_PIXELS.value),t.UNPACK_SKIP_ROWS=e.getParameter(p.UNPACK_SKIP_ROWS.value),t.UNPACK_SKIP_IMAGES=e.getParameter(p.UNPACK_SKIP_IMAGES.value)),t}}class qe extends Ye{get objectName(){return"Buffer"}getCreateCommandNames(){return["createBuffer"]}getUpdateCommandNames(){return["bufferData"]}getDeleteCommandNames(){return["deleteBuffer"]}getBoundInstance(e){const t=this.options.context;return e===p.ARRAY_BUFFER.value?t.getParameter(p.ARRAY_BUFFER_BINDING.value):e===p.ELEMENT_ARRAY_BUFFER.value?t.getParameter(p.ELEMENT_ARRAY_BUFFER_BINDING.value):e===p.COPY_READ_BUFFER.value?t.getParameter(p.COPY_READ_BUFFER_BINDING.value):e===p.COPY_WRITE_BUFFER.value?t.getParameter(p.COPY_WRITE_BUFFER_BINDING.value):e===p.TRANSFORM_FEEDBACK_BUFFER.value?t.getParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value):e===p.UNIFORM_BUFFER.value?t.getParameter(p.UNIFORM_BUFFER_BINDING.value):e===p.PIXEL_PACK_BUFFER.value?t.getParameter(p.PIXEL_PACK_BUFFER_BINDING.value):e===p.PIXEL_UNPACK_BUFFER.value?t.getParameter(p.PIXEL_UNPACK_BUFFER_BINDING.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(t,e);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){const n=this.getLength(t);return t.arguments.length>=4?{target:e,length:n,usage:t.arguments[2],offset:t.arguments[3],sourceLength:t.arguments[1]?t.arguments[1].length:-1}:3===t.arguments.length?{target:e,length:n,usage:t.arguments[2]}:void 0}getLength(e){const t=e.arguments[1],n=e.arguments[3],r=e.arguments[4];if("number"==typeof t)return t;if("number"==typeof r&&r>0)return r;const i=t.byteLength||t.length||0;return"number"==typeof n&&n>0?i-n:i}}class Qe extends Ye{get objectName(){return"Renderbuffer"}getCreateCommandNames(){return["createRenderbuffer"]}getUpdateCommandNames(){return["renderbufferStorage","renderbufferStorageMultisample"]}getDeleteCommandNames(){return["deleteRenderbuffer"]}getBoundInstance(e){const t=this.options.context;if(e===p.RENDERBUFFER.value)return t.getParameter(p.RENDERBUFFER_BINDING.value)}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(e,t);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return r.length=r.width*r.height*this.getByteSizeForInternalFormat(r.internalFormat),n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){return 4===e.arguments.length?{target:t,internalFormat:e.arguments[1],width:e.arguments[2],height:e.arguments[3],length:0,samples:0}:{target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,samples:e.arguments[1]}}}class Ze extends Ye{get objectName(){return"Texture2d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage2D","compressedTexImage2D","texStorage2D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D.value?t.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP_POSITIVE_X.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Y.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Z.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_X.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Y.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Z.value?t.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target===p.TEXTURE_2D_ARRAY.name||t.target===p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else{const e="TEXTURE_2D"===t?1:6;let n=r.internalFormat;n===p.RGBA.value&&(r.type===p.FLOAT.value&&(n=p.RGBA32F.value),r.type===p.HALF_FLOAT_OES.value&&(n=p.RGBA16F.value)),r.length=r.width*r.height*e*this.getByteSizeForInternalFormat(n)}return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage2D"===e.name?this.getTexImage2DCustomData(e,t,n):"compressedTexImage2D"===e.name?this.getCompressedTexImage2DCustomData(e,t,n):"texStorage2D"===e.name?this.getTexStorage2DCustomData(e,t,n):void 0}getTexStorage2DCustomData(e,t,n){let r;return 5===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!1}),r}getCompressedTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=7&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!0}),r}getTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8?r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],format:e.arguments[6],type:e.arguments[7],length:0,isCompressed:!1}:6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[5].width,height:e.arguments[5].height,format:e.arguments[3],type:e.arguments[4],length:0,isCompressed:!1}),r}}class Je extends Ye{get objectName(){return"Texture3d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage3D","compressedTexImage3D","texStorage3D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D_ARRAY.value?t.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):e===p.TEXTURE_3D.value?t.getParameter(p.TEXTURE_BINDING_3D.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target!==p.TEXTURE_2D_ARRAY.name&&t.target!==p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){if(e.arguments.length>=2&&0!==e.arguments[1])return 0;const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else r.length=r.width*r.height*r.depth*this.getByteSizeForInternalFormat(r.internalFormat);return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage3D"===e.name?this.getTexImage3DCustomData(e,t,n):"compressedTexImage3D"===e.name?this.getCompressedTexImage3DCustomData(e,t,n):"texStorage3D"===e.name?this.getTexStorage3DCustomData(e,t,n):void 0}getTexStorage3DCustomData(e,t,n){let r;return 6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!1}),r}getCompressedTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!0}),r}getTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=9&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],format:e.arguments[7],type:e.arguments[8],length:0,isCompressed:!1}),r}}class et extends Ye{get objectName(){return"Program"}getCreateCommandNames(){return["createProgram"]}getUpdateCommandNames(){return["linkProgram"]}getDeleteCommandNames(){return["deleteProgram"]}getBoundInstance(e){return e}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){if(e.arguments.length>=1&&!e.arguments[0])return 0;const r=this.getCustomData(n);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e){const t=this.options.context;return x.getProgramData(t,e)}}class tt{constructor(e){this.contextInformation=e,this.onCommandCallbacks={},this.recorders=[],this.initRecorders()}recordCommand(e){const t=this.onCommandCallbacks[e.name];if(t)for(const n of t)n(e)}startCapture(){for(const e of this.recorders)e.startCapture()}stopCapture(){for(const e of this.recorders)e.stopCapture()}appendRecordedInformation(e){for(const t of this.recorders)t.appendRecordedInformation(e)}initRecorders(){this.recorders.push(new qe(this.contextInformation),new Qe(this.contextInformation),new Ze(this.contextInformation),new Je(this.contextInformation),new et(this.contextInformation));for(const e of this.recorders)e.registerCallbacks(this.onCommandCallbacks)}}class nt{constructor(e){this.contextInformation=e,this.webGlObjects=[],this.initWebglObjects()}tagWebGlObjects(e){for(const t of this.webGlObjects){for(let n=0;n0&&this.currentCapture.commands.length===this.maxCommands&&this.onMaxCommand.trigger(this)}}}spyContext(e){const t=[];for(const n in e)n&&t.push(n);for(let n=0;n{this.spyRequestAnimationFrame("requestAnimationFrame",e.display)})}spyRequestAnimationFrame(e,t){const n=this;y.storeOriginFunction(t,e),t[e]=function(){const r=arguments[0],i=n.getCallback(n,r,()=>{n.spiedScope[e](r)});return y.executeOriginFunction(t,e,[i])}}spySetTimer(e){const t=this,n=this.spiedScope,r="setTimeout"===e;y.storeOriginFunction(n,e),n[e]=function(){const i=arguments[0],s=arguments[1],o=Array.prototype.slice.call(arguments);return at.setTimerCommonValues.indexOf(s)>-1&&(o[0]=t.getCallback(t,i,r?()=>{n[e](i)}:null)),y.executeOriginFunction(n,e,o)}}getCallback(e,t,n=null){return function(){const r=u.now;if(e.lastFrame=++e.lastFrame%e.speedRatio,e.willPlayNextFrame||e.speedRatio&&!e.lastFrame){try{e.onFrameStart.trigger(e)}catch(t){e.onError.trigger(t)}try{t.apply(e.spiedScope,arguments)}catch(t){e.onError.trigger(t)}e.lastSixtyFramesCurrentIndex=(e.lastSixtyFramesCurrentIndex+1)%at.fpsWindowSize,e.lastSixtyFramesDuration[e.lastSixtyFramesCurrentIndex]=r-e.lastSixtyFramesPreviousStart;try{e.onFrameEnd.trigger(e)}catch(t){e.onError.trigger(t)}e.willPlayNextFrame=!1}else n&&n();e.lastSixtyFramesPreviousStart=r}}}at.requestAnimationFrameFunctions=["requestAnimationFrame","msRequestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame"],at.setTimerFunctions=["setTimeout","setInterval"],at.setTimerCommonValues=[0,15,16,33,32,40],at.fpsWindowSize=60;class lt{constructor(e){this.canvas=e,this.onContextRequested=new l,this.init()}init(){const e=this,t=function(){const t="undefined"!=typeof HTMLCanvasElement&&this instanceof HTMLCanvasElement?HTMLCanvasElement:OffscreenCanvas,n=e.canvas?y.executeOriginFunction(this,"getContext",arguments):y.executePrototypeOriginFunction(this,t,"getContext",arguments);if(arguments.length>0){const e=arguments[0];if("webgl"!==e&&"experimental-webgl"!==e&&"webgl2"!==e&&"experimental-webgl2"!==e)return n}if(n){const t=Array.prototype.slice.call(arguments),r="webgl2"===t[0]||"experimental-webgl2"===t[0]?2:1;e.onContextRequested.trigger({context:n,contextVersion:r})}return n};this.canvas?(y.storeOriginFunction(this.canvas,"getContext"),this.canvas.getContext=t):("undefined"!=typeof HTMLCanvasElement&&(y.storePrototypeOriginFunction(HTMLCanvasElement,"getContext"),HTMLCanvasElement.prototype.getContext=t),"undefined"!=typeof OffscreenCanvas&&(y.storePrototypeOriginFunction(OffscreenCanvas,"getContext"),OffscreenCanvas.prototype.getContext=t))}}class ut{static startIntercepting(e){if(ut.intercepting)return;if("undefined"==typeof Worker)return;ut.workerBundleUrl=e,ut.originalWorkerConstructor=Worker,ut.intercepting=!0;const t=Worker;globalThis.Worker=function(e,n){const r=e.toString();if(n&&"module"===n.type)return new t(e,n);try{let i;try{i=new URL(r,location.href).href}catch(r){return new t(e,n)}const s=new XMLHttpRequest;if(s.open("GET",i,!1),s.send(),200===s.status){const e=ut.rewriteImportScripts(s.responseText,i),o="(function(){\n var __spectorBase = "+JSON.stringify(i)+';\n self.__SPECTOR_workerBaseUrl = __spectorBase;\n function __spectorResolve(u) {\n if (u == null) return u;\n if (typeof u !== "string") {\n if (u instanceof URL) return u;\n try { u = String(u); } catch (e) { return u; }\n }\n if (/^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i.test(u)) return u;\n try { return new URL(u, __spectorBase).href; }\n catch (e) { return u; }\n }\n self.__SPECTOR_resolveWorkerUrl = __spectorResolve;\n var __origImportScripts = self.importScripts;\n if (typeof __origImportScripts === "function") {\n self.importScripts = function() {\n var args = new Array(arguments.length);\n for (var i = 0; i < arguments.length; i++) args[i] = __spectorResolve(arguments[i]);\n return __origImportScripts.apply(self, args);\n };\n }\n var __origFetch = self.fetch;\n if (typeof __origFetch === "function") {\n self.fetch = function(input, init) {\n try {\n if (typeof input === "string") {\n input = __spectorResolve(input);\n } else if (input && typeof input === "object" && "url" in input && typeof Request === "function") {\n var r = input;\n var resolved = __spectorResolve(r.url);\n if (resolved !== r.url) input = new Request(resolved, r);\n }\n } catch (e) { /* fall through with original input */ }\n return __origFetch.call(self, input, init);\n };\n }\n if (typeof XMLHttpRequest === "function" && XMLHttpRequest.prototype && XMLHttpRequest.prototype.open) {\n var __origXhrOpen = XMLHttpRequest.prototype.open;\n XMLHttpRequest.prototype.open = function(method, url) {\n var args = Array.prototype.slice.call(arguments);\n args[1] = __spectorResolve(url);\n return __origXhrOpen.apply(this, args);\n };\n }\n if (typeof Worker === "function") {\n var __OrigWorker = Worker;\n self.Worker = function(scriptURL, options) {\n var resolved = __spectorResolve(scriptURL);\n return new __OrigWorker(resolved, options);\n };\n self.Worker.prototype = __OrigWorker.prototype;\n }\n})();\n',a="importScripts("+JSON.stringify(ut.workerBundleUrl)+");\n",l=new Blob([o+a+e],{type:"application/javascript"}),u=URL.createObjectURL(l),c=new t(u,n);return ut.spiedWorkers.push({worker:c,originalUrl:r}),c}}catch(e){console.warn("[Spector.js] Could not inject into Worker ("+r+"):",e)}const i=new t(e,n);return ut.spiedWorkers.push({worker:i,originalUrl:r}),i},globalThis.Worker.prototype=t.prototype}static stopIntercepting(){ut.intercepting&&(globalThis.Worker=ut.originalWorkerConstructor,ut.intercepting=!1)}static rewriteImportScripts(e,t){const n=/(['"`])((?:\\.|(?!\1).)*)\1/g;return e.replace(/importScripts\s*\(([^)]*)\)/g,(e,r)=>"importScripts("+r.replace(n,(e,n,r)=>{if("`"===n&&-1!==r.indexOf("${"))return e;let i;try{i=new URL(r,t).href}catch(t){return e}return n+i+n})+")")}static getSpiedWorkers(){return ut.spiedWorkers}static isIntercepting(){return ut.intercepting}}ut.spiedWorkers=[],ut.intercepting=!1;class ct{static getDelay(){return ct.delayMs}static setDelay(e){ct.delayMs="number"==typeof e&&e>0?e:0}static shouldForceIncomplete(e,t,n,r){return!(r<=0)&&e===p.COMPLETION_STATUS_KHR.value&&void 0!==t&&n-tthis._state,this.subscribe=e=>(this._listeners.add(e),()=>{this._listeners.delete(e)}),this._state=e}setState(e){this._state=e(this._state),this._emitChange()}setSnapshot(e){this._state=e,this._emitChange()}_emitChange(){for(const e of this._listeners)e()}}function pt(e){return(0,dt.useSyncExternalStore)(e.subscribe,e.getSnapshot)}var mt=n(848);const gt=(0,dt.createContext)(null);function Et(){const e=(0,dt.useContext)(gt);if(!e)throw new Error("CaptureMenuContext not provided — CaptureMenuRoot must be rendered inside CaptureMenuContext.Provider");return e}function vt({canvas:e}){const t=Et();return(0,mt.jsx)("li",{onClick:()=>t.handleCanvasSelected(e),children:(0,mt.jsx)("span",{children:`Id: ${e.id} - Size: ${e.width}*${e.height}`})})}function Ct(){const e=Et(),t=pt(e.store),n=t.selectedCanvas?`${t.selectedCanvas.id} (${t.selectedCanvas.width}*${t.selectedCanvas.height})`:"Choose Canvas...";return(0,mt.jsxs)("div",{className:"canvasListComponent",children:[(0,mt.jsx)("span",{commandName:"onCanvasSelection",onClick:e.handleCanvasListToggle,children:n}),(0,mt.jsx)("ul",{style:{display:t.showCanvasList?"block":"none",visibility:t.showCanvasList?"visible":"hidden"},children:t.canvases.map((e,t)=>(0,mt.jsx)(vt,{canvas:e},e.id||t))})]})}function Dt(){const e=Et(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"captureMenuActionsComponent",children:[(0,mt.jsx)("div",{commandName:"onCaptureRequested",onClick:e.handleCaptureRequested}),t.isPlaying?(0,mt.jsx)("div",{commandName:"onPauseRequested",onClick:e.handlePauseRequested}):(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("div",{commandName:"onPlayRequested",onClick:e.handlePlayRequested}),(0,mt.jsx)("div",{commandName:"onPlayNextFrameRequested",onClick:e.handlePlayNextFrameRequested})]})]})}function St(){const e=pt(Et().store);return(0,mt.jsxs)("span",{className:"fpsCounterComponent",children:[e.fps.toFixed(2)," Fps"]})}function At(){const e=pt(Et().store);return(0,mt.jsxs)("div",{children:[(0,mt.jsxs)("div",{className:"captureMenuComponent "+(e.visible?"active":""),children:[(0,mt.jsx)(Ct,{}),(0,mt.jsx)(Dt,{}),(0,mt.jsx)(St,{})]}),(0,mt.jsx)("div",{className:"captureMenuLogComponent "+(e.logVisible?"active":""),children:(0,mt.jsx)("span",{className:e.logLevel===i.error?"error":"",children:e.logText})})]})}class _t{constructor(e={}){this.options=e,this.handleCanvasListToggle=()=>{this.store.getSnapshot(),this.store.setState(e=>Object.assign(Object.assign({},e),{selectedCanvas:null,showCanvasList:!e.showCanvasList,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!e.showCanvasList&&!this._hideLog})),this.onCanvasSelected.trigger(null),this._isTrackingCanvas&&this.trackPageCanvases()},this.handleCanvasSelected=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{selectedCanvas:e,showCanvasList:!1,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)},this.handleCaptureRequested=()=>{const e=this.getSelectedCanvasInformation();e&&this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.PleaseWaitHelpText,logVisible:!this._hideLog})),setTimeout(()=>{this.onCaptureRequested.trigger(e)},200)},this.handlePauseRequested=()=>{this.onPauseRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!1}))},this.handlePlayRequested=()=>{this.onPlayRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!0}))},this.handlePlayNextFrameRequested=()=>{this.onPlayNextFrameRequested.trigger(this.getSelectedCanvasInformation())},this._rootPlaceHolder=e.rootPlaceHolder||document.body,this._hideLog=!!e.hideLog,this._isTrackingCanvas=!1,this._extraCanvasEntries=[],this.onCanvasSelected=new l,this.onCaptureRequested=new l,this.onPauseRequested=new l,this.onPlayRequested=new l,this.onPlayNextFrameRequested=new l,this.store=new ft({visible:!0,logText:_t.SelectCanvasHelpText,logLevel:i.info,logVisible:!this._hideLog,canvases:[],selectedCanvas:null,showCanvasList:!1,isPlaying:!0,fps:0}),this._container=document.createElement("div"),this._container.className="spector-react-capture-menu",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(gt.Provider,{value:this},(0,dt.createElement)(At)))}getSelectedCanvasInformation(){return this.store.getSnapshot().selectedCanvas}trackPageCanvases(){if(this._isTrackingCanvas=!0,document.body){const e=document.body.querySelectorAll("canvas");this.updateCanvasesList(e)}}updateCanvasesList(e){const t=[];for(let n=0;nObject.assign(Object.assign({},n),{canvases:t,selectedCanvas:e,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}captureComplete(e){e?this.store.setState(t=>Object.assign(Object.assign({},t),{logLevel:i.error,logText:e,logVisible:!this._hideLog})):this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog}))}setFPS(e){this.store.setState(t=>Object.assign(Object.assign({},t),{fps:e}))}_updateCanvasesInternal(e){for(const t of this._extraCanvasEntries)e.push(t);this.store.getSnapshot().showCanvasList?this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e})):1===e.length?(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:e[0],logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e[0])):(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:null,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(null))}}_t.SelectCanvasHelpText="Please, select a canvas in the list above.",_t.ActionsHelpText="Record with the red button, you can also pause or continue playing the current scene.",_t.PleaseWaitHelpText="Capturing, be patient (this can take up to 3 minutes)...";const yt=(0,dt.createContext)(null);function bt(){const e=(0,dt.useContext)(yt);if(!e)throw new Error("ResultViewContext not provided — ResultViewRoot must be rendered inside ResultViewContext.Provider");return e}function Tt(){const e=bt(),t=pt(e.store),n=(0,dt.useRef)(null),r=(0,dt.useCallback)(e=>{e.preventDefault();const t=e.currentTarget.parentElement,n=t.parentElement;if(!n)return;const r=n.querySelectorAll("li:not(.resultViewMenuSmall)");if("true"===t.getAttribute("open")){t.setAttribute("open","false");for(let e=0;e{e.handleSearchTextChange(t.target.value)},[e]),s=(0,dt.useCallback)(t=>{t.stopPropagation(),e.handleSearchTextChange("")},[e]),o=(0,dt.useCallback)(t=>n=>{n.preventDefault(),e.handleMenuStatusChange(t)},[e]),a=(0,dt.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),e.handleClose()},[e]);return(0,mt.jsxs)("ul",{className:"resultViewMenuComponent",ref:n,children:[(0,mt.jsx)("li",{className:"resultViewMenuOpen resultViewMenuSmall",children:(0,mt.jsx)("a",{href:"#",role:"button",onClick:r,children:"Menu"})}),(0,mt.jsxs)("li",{className:"searchContainer",children:[(0,mt.jsx)("input",{type:"text",placeholder:"Search...",value:t.searchText,commandName:"onSearchTextChanged",commandEventBinding:"change",onChange:i}),(0,mt.jsx)("a",{className:"clearSearch",commandName:"onSearchTextCleared",onClick:s,children:"X"})]}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:0===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCapturesClicked",onClick:o(0),children:"Captures"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:10===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInformationClicked",onClick:o(10),children:"Information"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:20===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInitStateClicked",onClick:o(20),children:"Init State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:40===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCommandsClicked",onClick:o(40),children:"Commands"+(t.commandCount>0?" ("+t.commandCount+")":"")})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:60===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCompareClicked",onClick:o(60),children:"Compare"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:30===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onEndStateClicked",onClick:o(30),children:"End State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{role:"button",commandName:"onCloseClicked",onClick:a,children:"Close"})})]})}function Rt({children:e}){return(0,mt.jsx)("div",{className:"resultViewContentComponent",children:e})}function xt({capture:e,active:t,onCaptureSelected:n,onSaveRequested:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),r()},[r]),s=(0,dt.useCallback)(()=>{n()},[n]),o=new Date(e.startTime).toTimeString().split(" ")[0];return(0,mt.jsxs)("li",{className:t?"active":"",onClick:s,children:[e.endState.VisualState.Attachments?e.endState.VisualState.Attachments.map((e,t)=>(0,mt.jsx)("img",{src:encodeURI(e.src)},t)):(0,mt.jsx)("span",{children:e.endState.VisualState.FrameBufferStatus}),(0,mt.jsxs)("span",{children:[o,(0,mt.jsx)("a",{href:"#",className:"captureListItemSave",commandName:"onSaveRequested",onClick:i})]})]})}function wt({active:e,captures:t,onCaptureSelected:n,onSaveRequested:r,onCaptureLoaded:i}){const s=(0,dt.useRef)(null),o=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault()},[]),l=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),function(e,t){let n=null;if(e&&e.dataTransfer&&e.dataTransfer.files&&(n=e.dataTransfer.files),e&&e.target&&e.target.files&&(n=e.target.files),n&&n.length>0)for(let e=0;e{a.error("Error while reading file: "+r.name+e)},i.onload=e=>{try{const n=JSON.parse(e.target.result);t(n)}catch(e){a.error("Error while reading file: "+r.name+e)}},i.readAsText(r)}}(e.nativeEvent,i)},[i]);return(0,mt.jsxs)("div",{className:"captureListComponent "+(e?"active":""),children:[(0,mt.jsx)("div",{className:"openCaptureFile",ref:s,onDragEnter:o,onDragOver:o,onDrop:l,children:(0,mt.jsx)("span",{children:"Drag files here to open a previously saved capture."})}),(0,mt.jsx)("ul",{children:t.map((e,t)=>(0,mt.jsx)(xt,{capture:e.capture,active:e.active,onCaptureSelected:()=>n(t),onSaveRequested:()=>r(e.capture)},t))})]})}function Ft({children:e}){return(0,mt.jsx)("div",{className:"visualStateListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Nt({item:e,onVisualStateSelected:t}){const n=(0,dt.useRef)(null);(0,dt.useEffect)(()=>{e.active&&n.current&&setTimeout(()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const r=(0,dt.useCallback)(()=>{t()},[t]),i=e.VisualState;return(0,mt.jsxs)("li",{ref:n,className:e.active?"active":"",onClick:r,commandName:"onVisualStateSelected",children:[i.Attachments?i.Attachments.map((e,t)=>e.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{src:encodeURI(e.src)}),i.Attachments.length>1&&(0,mt.jsx)("span",{children:e.attachmentName}),!!e.textureLayer&&(0,mt.jsx)("span",{children:"Layer: "+e.textureLayer}),!!e.textureCubeMapFace&&(0,mt.jsx)("span",{children:e.textureCubeMapFace})]},t):null):(0,mt.jsx)("span",{children:i.FrameBufferStatus}),(0,mt.jsx)("span",{children:i.FrameBuffer?"Frame buffer: "+i.FrameBuffer.__SPECTOR_Object_TAG.id:"Canvas frame buffer"})]})}function Lt({children:e}){return(0,mt.jsx)("div",{className:"commandListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Ot({command:e,onCommandSelected:t,onVertexSelected:n,onFragmentSelected:r,onShaderSelected:i}){var s;const o=(0,dt.useRef)(null),a=e.capture,l=function(e){switch(e){case 50:return"deprecated";case 10:return"unused";case 20:return"disabled";case 30:return"redundant";case 40:return"valid";default:return"unknown"}}(a.status),u=!!a.VisualState;let c="";u&&(c=" drawCall"),e.active&&(c=" active"),(0,dt.useEffect)(()=>{e.active&&o.current&&setTimeout(()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const h=(0,dt.useCallback)(e=>{t()},[t]),d=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==n||n()},[n]),f=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==r||r()},[r]),p=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==i||i()},[i]);let m=null;if(u&&"clear"!==a.name)try{const e=a.DrawCall.shaders[0],t=a.DrawCall.shaders[1];m=(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("a",{href:"#",onClick:d,children:e.name}),(0,mt.jsx)("a",{href:"#",onClick:f,children:t.name})]})}catch(e){}const g=(null===(s=a.shader)||void 0===s?void 0:s.source)?(0,mt.jsx)("a",{href:"#",commandName:"onShaderSourceSelected",onClick:p,children:"Source"}):null;return(0,mt.jsxs)("li",{ref:o,className:c,onClick:h,commandName:"onCommandSelected",children:[a.marker&&(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.marker+" "}),"LOG"===a.name?(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.text+" "}):(0,mt.jsx)("span",{dangerouslySetInnerHTML:{__html:a.text.replace(a.name,`${a.name}`)}}),g,m]})}function It({children:e}){return(0,mt.jsx)("div",{className:"commandDetailComponent",children:e})}function kt({left:e,children:t}){return(0,mt.jsx)("div",{className:e?"informationColumnLeftComponent":"informationColumnRightComponent",children:t})}function Mt({children:e}){return(0,mt.jsx)("div",{className:"jsonContentComponent",children:e})}function Pt(e,t,n,r){return{row:Math.max(0,parseInt(t,10)-1),column:n?Math.max(0,parseInt(n,10)-1):0,text:r.trim()||e,type:e.toLowerCase()}}var Bt,Ut,$t=Object.create,Gt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor,Wt=Object.getOwnPropertyNames,Ht=Object.getPrototypeOf,jt=Object.prototype.hasOwnProperty,zt=e=>{throw TypeError(e)},Xt=(e,t)=>{for(var n in t)Gt(e,n,{get:t[n],enumerable:!0})},Kt=(e,t,n)=>(((e,t)=>{t.has(e)||zt("Cannot access private method")})(e,t),n),Yt=(Bt=e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=/\r\n|[\n\r\u2028\u2029]/;e.codeFrameColumns=function(e,n,r={}){let i=new Proxy({},{get:()=>e=>e}),s=e.split(t),{start:o,end:a,markerLines:l}=function(e,t,n){let r=Object.assign({column:0,line:-1},e.start),i=Object.assign({},r,e.end),{linesAbove:s=2,linesBelow:o=3}=n||{},a=r.line,l=r.column,u=i.line,c=i.column,h=Math.max(a-(s+1),0),d=Math.min(t.length,u+o);-1===a&&(h=0),-1===u&&(d=t.length);let f=u-a,p={};if(f)for(let e=0;e<=f;e++){let n=e+a;if(l)if(0===e){let e=t[n-1].length;p[n]=[l,e-l+1]}else if(e===f)p[n]=[0,c];else{let r=t[n-e].length;p[n]=[0,r]}else p[n]=!0}else p[a]=l===c?!l||[l,0]:[l,c-l];return{start:h,end:d,markerLines:p}}(n,s,r),u=n.start&&"number"==typeof n.start.column,c=String(a).length,h=e.split(t,a).slice(o,a).map((e,t)=>{let n=o+1+t,s=` ${` ${n}`.slice(-c)} |`,a=l[n],u=!l[n+1];if(a){let t="";if(Array.isArray(a)){let n=e.slice(0,Math.max(a[0]-1,0)).replace(/[^\t]/g," "),o=a[1]||1;t=["\n ",i.gutter(s.replace(/\d/g," "))," ",n,i.marker("^").repeat(o)].join(""),u&&r.message&&(t+=" "+i.message(r.message))}return[i.marker(">"),i.gutter(s),e.length>0?` ${e}`:"",t].join("")}return` ${i.gutter(s)}${e.length>0?` ${e}`:""}`}).join("\n");return r.message&&!u&&(h=`${" ".repeat(c+1)}${r.message}\n${h}`),h}},()=>(Ut||Bt((Ut={exports:{}}).exports),Ut.exports));Xt({},{__debug:()=>Hs,check:()=>Vs,doc:()=>vs,format:()=>Gs,formatWithCursor:()=>$s,getSupportInfo:()=>Ws,util:()=>_s,version:()=>As});var qt=(e,t,n,r)=>{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Qt=class{diff(e,t,n={}){let r;"function"==typeof n?(r=n,n={}):"callback"in n&&(r=n.callback);let i=this.castInput(e,n),s=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),a=this.removeEmpty(this.tokenize(s,n));return this.diffWithOptionsObj(o,a,n,r)}diffWithOptionsObj(e,t,n,r){var i;let s=e=>(e=this.postProcess(e,n),r?void setTimeout(function(){r(e)},0):e),o=t.length,a=e.length,l=1,u=o+a;null!=n.maxEditLength&&(u=Math.min(u,n.maxEditLength));let c=null!==(i=n.timeout)&&void 0!==i?i:1/0,h=Date.now()+c,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=a&&f+1>=o)return s(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,g=()=>{for(let r=Math.max(p,-l);r<=Math.min(m,l);r+=2){let i,l=d[r-1],u=d[r+1];l&&(d[r-1]=void 0);let c=!1;if(u){let e=u.oldPos-r;c=u&&0<=e&&e=a&&f+1>=o)return s(this.buildValues(i.lastComponent,t,e))||!0;d[r]=i,i.oldPos+1>=a&&(m=Math.min(m,r-1)),f+1>=o&&(p=Math.max(p,r+1))}else d[r]=void 0}l++};if(r)!function e(){setTimeout(function(){if(l>u||Date.now()>h)return r(void 0);g()||e()},0)}();else for(;l<=u&&Date.now()<=h;){let e=g();if(e)return e}}addToPath(e,t,n,r,i){let s=e.lastComponent;return s&&!i.oneChangePerToken&&s.added===t&&s.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:s.count+1,added:t,removed:n,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:s}}}extractCommon(e,t,n,r,i){let s=t.length,o=n.length,a=e.oldPos,l=a-r,u=0;for(;l+1e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(a,a+e.count));a+=e.count,e.added||(l+=e.count)}}return i}},Zt=new class extends Qt{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Jt(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}function en(e,t){let n;switch(t){case"\n":n=/\n/gu;break;case"\r":n=/\r/gu;break;case"\r\n":n=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let r=e.match(n);return r?r.length:0}var tn="string",nn="array",rn="cursor",sn="indent",on="align",an="trim",ln="group",un="fill",cn="if-break",hn="indent-if-break",dn="line-suffix",fn="line-suffix-boundary",pn="line",mn="label",gn="break-parent",En=new Set([rn,sn,on,an,ln,un,cn,hn,dn,fn,pn,mn,gn]),vn=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},Cn=function(e){if("string"==typeof e)return tn;if(Array.isArray(e))return nn;if(!e)return;let{type:t}=e;return En.has(t)?t:void 0};var Dn=class extends Error{name="InvalidDocError";constructor(e){super(function(e){let t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(Cn(e))throw new Error("doc is valid.");let n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;let r=(e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e))([...En].map(e=>`'${e}'`));return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},Sn=Dn,An={},_n=function(e,t,n,r){let i=[e];for(;i.length>0;){let e=i.pop();if(e===An){n(i.pop());continue}n&&i.push(e,An);let s=Cn(e);if(!s)throw new Sn(e);if(!1!==(null==t?void 0:t(e)))switch(s){case nn:case un:{let t=s===nn?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case cn:i.push(e.flatContents,e.breakContents);break;case ln:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case on:case sn:case hn:case mn:case dn:i.push(e.contents);break;case tn:case rn:case an:case fn:case pn:case gn:break;default:throw new Sn(e)}}};function yn(e,t){if("string"==typeof e)return t(e);let n=new Map;return function e(r){if(n.has(r))return n.get(r);let i=function(n){switch(Cn(n)){case nn:return t(n.map(e));case un:return t({...n,parts:n.parts.map(e)});case cn:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case ln:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case on:case sn:case hn:case mn:case dn:return t({...n,contents:e(n.contents)});case tn:case rn:case an:case fn:case pn:case gn:return t(n);default:throw new Sn(n)}}(r);return n.set(r,i),i}(e)}function bn(e,t,n){let r=n,i=!1;return _n(e,function(e){if(i)return!1;let n=t(e);void 0!==n&&(i=!0,r=n)}),r}function Tn(e){if(e.type===ln&&e.break||e.type===pn&&e.hard||e.type===gn)return!0}function Rn(e){if(e.length>0){let t=vn(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function xn(e){return e.type!==pn||e.hard?e.type===cn?e.flatContents:e:e.soft?"":" "}function wn(e){for(e=[...e];e.length>=2&&vn(!1,e,-2).type===pn&&vn(!1,e,-1).type===gn;)e.length-=2;if(e.length>0){let t=Fn(vn(!1,e,-1));e[e.length-1]=t}return e}function Fn(e){switch(Cn(e)){case sn:case hn:case ln:case dn:case mn:{let t=Fn(e.contents);return{...e,contents:t}}case cn:return{...e,breakContents:Fn(e.breakContents),flatContents:Fn(e.flatContents)};case un:return{...e,parts:wn(e.parts)};case nn:return wn(e);case tn:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return tfunction(e){switch(Cn(e)){case un:if(e.parts.every(e=>""===e))return"";break;case ln:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===ln&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case on:case sn:case hn:case dn:if(!e.contents)return"";break;case cn:if(!e.flatContents&&!e.breakContents)return"";break;case nn:{let t=[];for(let n of e){if(!n)continue;let[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof vn(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case tn:case rn:case an:case fn:case pn:case mn:case gn:break;default:throw new Sn(e)}return e}(e))}(e))}function Ln(e){if(e.type===pn)return!0}function On(e,t){return e.type===mn?{...e,contents:t(e.contents)}:t(e)}var In=()=>{},kn=In,Mn=In,Pn=In;function Bn(e){return kn(e),{type:sn,contents:e}}function Un(e,t){return kn(t),{type:on,contents:t,n:e}}function $n(e,t={}){return kn(e),Mn(t.expandedStates,!0),{type:ln,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Gn(e){return kn(e),{type:dn,contents:e}}var Vn={type:fn},Wn={type:gn},Hn={type:an},jn={type:pn,hard:!0},zn={type:pn,hard:!0,literal:!0},Xn={type:pn},Kn={type:pn,soft:!0},Yn=[jn,Wn],qn=[zn,Wn],Qn={type:rn};function Zn(e,t){kn(e),Mn(t);let n=[];for(let r=0;r0){for(let e=0;e!(function(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}(e)||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e)),nr=/[^\x20-\x7F]/u,rr=function(e){if(!e)return 0;if(!nr.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(let n of e){let e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=tr(e)?1:2)}return t},ir=Symbol("MODE_BREAK"),sr=Symbol("MODE_FLAT"),or=Symbol("cursor"),ar=Symbol("DOC_FILL_PRINTED_LENGTH");function lr(e,t){return cr(e,{type:"indent"},t)}function ur(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?cr(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:cr(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function cr(e,t,n){let r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t],i="",s=0,o=0,a=0;for(let e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function hr(e){let t=0,n=0,r=e.length;e:for(;r--;){let i=e[r];if(i!==or)for(let n=i.length-1;n>=0;n--){let s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(or);return t}function dr(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length,a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}let{mode:e,doc:u}=a.pop(),c=Cn(u);switch(c){case tn:l.push(u),n-=rr(u);break;case nn:case un:{let t=c===nn?u:u.parts,n=u[ar]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case sn:case on:case hn:case mn:a.push({mode:e,doc:u.contents});break;case an:n+=hr(l);break;case ln:{if(s&&u.break)return!1;let t=u.break?ir:e,n=u.expandedStates&&t===ir?vn(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case cn:{let t=(u.groupId?i[u.groupId]||sr:e)===ir?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case pn:if(e===ir||u.hard)return!0;u.soft||(l.push(" "),n--);break;case dn:r=!0;break;case fn:if(r)return!1}}return!1}function fr(e,t){let n={},r=t.printWidth,i=Jt(t.endOfLine),s=0,o=[{ind:{value:"",length:0,queue:[]},mode:ir,doc:e}],a=[],l=!1,u=[],c=0;for(function(e){let t=new Set,n=[];_n(e,function(e){if(e.type===gn&&Rn(n),e.type===ln){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===ln&&n.pop().break&&Rn(n)},!0)}(e);o.length>0;){let{ind:e,mode:h,doc:d}=o.pop();switch(Cn(d)){case tn:{let e="\n"!==i?qt(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=rr(e));break}case nn:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case rn:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(or),c++;break;case sn:o.push({ind:lr(e,t),mode:h,doc:d.contents});break;case on:o.push({ind:ur(e,d.n,t),mode:h,doc:d.contents});break;case an:s-=hr(a);break;case ln:switch(h){case sr:if(!l){o.push({ind:e,mode:d.break?ir:sr,doc:d.contents});break}case ir:{l=!1;let t={ind:e,mode:sr,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&dr(t,o,i,a,n))o.push(t);else if(d.expandedStates){let t=vn(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:ir,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:ir,doc:t});break}{let t=d.expandedStates[r],s={ind:e,mode:sr,doc:t};if(dr(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:ir,doc:d.contents});break}}d.id&&(n[d.id]=vn(!1,o,-1).mode);break;case un:{let t=r-s,i=d[ar]??0,{parts:a}=d,l=a.length-i;if(0===l)break;let c=a[i+0],f=a[i+1],p={ind:e,mode:sr,doc:c},m={ind:e,mode:ir,doc:c},g=dr(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}let E={ind:e,mode:sr,doc:f},v={ind:e,mode:ir,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}let C=a[i+2],D={ind:e,mode:h,doc:{...d,[ar]:i+2}};dr({ind:e,mode:sr,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case cn:case hn:{let t=d.groupId?n[d.groupId]:h;if(t===ir){let t=d.type===cn?d.breakContents:d.negate?d.contents:Bn(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===sr){let t=d.type===cn?d.flatContents:d.negate?Bn(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case dn:u.push({ind:e,mode:h,doc:d.contents});break;case fn:u.length>0&&o.push({ind:e,mode:h,doc:jn});break;case pn:switch(h){case sr:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case ir:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=hr(a),a.push(i+e.value),s=e.length)}break;case mn:o.push({ind:e,mode:h,doc:d.contents});break;case gn:break;default:throw new Sn(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}let h=a.indexOf(or);if(-1!==h){let e=a.indexOf(or,h+1);if(-1===e)return{formatted:a.filter(e=>e!==or).join("")};let t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}var pr,mr,gr,Er=function(e,t,n=0){let r=0;for(let i=n;i=0;n-=2)if(!Array.isArray(t[n])&&--e<0)return n;return-1},gr=function*(){let{stack:e}=this;for(let t=e.length-3;t>=0;t-=2){let n=e[t];Array.isArray(n)||(yield n)}};var vr=class{constructor(e){((e,t)=>{t.has(e)?zt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,void 0)})(this,pr),this.stack=[e]}get key(){let{stack:e,siblings:t}=this;return vn(!1,e,null===t?-2:-4)??null}get index(){return null===this.siblings?null:vn(!1,this.stack,-2)}get node(){return vn(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return null!==this.siblings}get siblings(){let{stack:e}=this,t=vn(!1,e,-3);return Array.isArray(t)?t:null}get next(){let{siblings:e}=this;return null===e?null:e[this.index+1]}get previous(){let{siblings:e}=this;return null===e?null:e[this.index-1]}get isFirst(){return 0===this.index}get isLast(){let{siblings:e,index:t}=this;return null!==e&&t===e.length-1}get isRoot(){return 1===this.stack.length}get root(){return this.stack[0]}get ancestors(){return[...Kt(this,pr,gr).call(this)]}getName(){let{stack:e}=this,{length:t}=e;return t>1?vn(!1,e,-2):null}getValue(){return vn(!1,this.stack,-1)}getNode(e=0){let t=Kt(this,pr,mr).call(this,e);return-1===t?null:this.stack[t]}getParentNode(e=0){return this.getNode(e+1)}call(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{return e(this)}finally{n.length=r}}callParent(e,t=0){let n=Kt(this,pr,mr).call(this,t+1),r=this.stack.splice(n+1);try{return e(this)}finally{this.stack.push(...r)}}each(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{for(let t=0;t{n[r]=e(t,r,i)},...t),n}match(...e){let t=this.stack.length-1,n=null,r=this.stack[t--];for(let i of e){if(void 0===r)return!1;let e=null;if("number"==typeof n&&(e=n,n=this.stack[t--],r=this.stack[t--]),i&&!i(r,n,e))return!1;n=this.stack[t--],r=this.stack[t--]}return!0}findAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return t}hasAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return!0;return!1}},Cr=new Proxy(()=>{},{get:()=>Cr}),Dr=Cr;function*Sr(e,t){let{getVisitorKeys:n,filter:r=()=>!0}=t,i=e=>function(e){return null!==e&&"object"==typeof e}(e)&&r(e);for(let t of n(e)){let n=e[t];if(Array.isArray(n))for(let e of n)i(e)&&(yield e);else i(n)&&(yield n)}}function Ar(e){return(t,n,r)=>{let i=!(null==r||!r.backwards);if(!1===n)return!1;let{length:s}=t,o=n;for(;o>=0&&oObject.keys(e).filter(e=>!wr.has(e)),Nr=function(e){return e?t=>e(t,wr):Fr};function Lr(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=function(e){let t=e.type||e.kind||"(unknown type)",n=String(e.name||e.id&&("object"==typeof e.id?e.id.name:e.id)||e.key&&("object"==typeof e.key?e.key.name:e.key)||e.value&&("object"==typeof e.value?"":String(e.value))||e.operator||"");return n.length>20&&(n=n.slice(0,19)+"…"),t+(n?" "+n:"")}(e)}function Or(e,t){t.leading=!0,t.trailing=!1,Lr(e,t)}function Ir(e,t,n){t.leading=!1,t.trailing=!1,n&&(t.marker=n),Lr(e,t)}function kr(e,t){t.leading=!1,t.trailing=!0,Lr(e,t)}var Mr=new WeakMap;function Pr(e,t){if(Mr.has(e))return Mr.get(e);let{printer:{getCommentChildNodes:n,canAttachComment:r,getVisitorKeys:i},locStart:s,locEnd:o}=t;if(!r)return[];let a=((null==n?void 0:n(e,t))??[...Sr(e,{getVisitorKeys:Nr(i)})]).flatMap(e=>r(e)?[e]:Pr(e,t));return a.sort((e,t)=>s(e)-s(t)||o(e)-o(t)),Mr.set(e,a),a}function Br(e,t,n,r){let i,s,{locStart:o,locEnd:a}=n,l=o(t),u=a(t),c=Pr(e,n),h=0,d=c.length;for(;h>1,r=c[e],f=o(r),p=a(r);if(f<=l&&u<=p)return Br(r,t,n,r);if(p<=l)i=r,h=e+1;else{if(!(u<=f))throw new Error("Comment location overlaps with node location");s=r,d=e}}if("TemplateLiteral"===(null==r?void 0:r.type)){let{quasis:e}=r,o=Hr(e,t,n);i&&Hr(e,i,n)!==o&&(i=null),s&&Hr(e,s,n)!==o&&(s=null)}return{enclosingNode:r,precedingNode:i,followingNode:s}}var Ur=()=>!1,$r=e=>!/[\S\n\u2028\u2029]/u.test(e);function Gr(e,t,n,r){let{comment:i,precedingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=o(i);if(s)for(let t=r-1;t>=0;t--){let{comment:r,precedingNode:i}=n[t];if(i!==s||!$r(e.slice(a(r),l)))break;l=o(r)}return xr(e,l,{backwards:!0})}function Vr(e,t,n,r){let{comment:i,followingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=a(i);if(s)for(let t=r+1;t0;--s){let{comment:i,precedingNode:u,followingNode:c}=e[s-1];Dr.strictEqual(u,o),Dr.strictEqual(c,a);let h=t.originalText.slice(t.locEnd(i),l);if(!((null==(r=(n=t.printer).isGap)?void 0:r.call(n,h,t))??/^[\s(]*$/u.test(h)))break;l=t.locStart(i)}for(let[t,{comment:n}]of e.entries())t1&&e.comments.sort((e,n)=>t.locStart(e)-t.locStart(n));e.length=0}function Hr(e,t,n){let r=n.locStart(t)-1;for(let t=1;t"string"==typeof e||"function"==typeof e,choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>"string"==typeof e||"object"==typeof e,cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:"Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.",cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:"Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.",cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function qr({plugins:e=[],showDeprecated:t=!1}={}){let n=e.flatMap(e=>e.languages??[]),r=[];for(let i of function(e){let t=[];for(let[n,r]of Object.entries(e)){let e={name:n,...r};Array.isArray(e.default)&&(e.default=vn(!1,e.default,-1).value),t.push(e)}return t}(Object.assign({},...e.map(({options:e})=>e),Yr)))!t&&i.deprecated||(Array.isArray(i.choices)&&(t||(i.choices=i.choices.filter(e=>!e.deprecated)),"parser"===i.name&&(i.choices=[...i.choices,...Qr(i.choices,n,e)])),i.pluginDefaults=Object.fromEntries(e.filter(e=>{var t;return void 0!==(null==(t=e.defaultOptions)?void 0:t[i.name])}).map(e=>[e.name,e.defaultOptions[i.name]])),r.push(i));return{languages:n,options:r}}function*Qr(e,t,n){let r=new Set(e.map(e=>e.value));for(let e of t)if(e.parsers)for(let t of e.parsers)if(!r.has(t)){r.add(t);let i=n.find(e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t)),s=e.name;null!=i&&i.name&&(s+=` (plugin: ${i.name})`),yield{value:t,description:s}}}var Zr,Jr,ei,ti,ni,ri="windows"===(null==(Zr=globalThis.Deno)?void 0:Zr.build.os)||(null==(ei=null==(Jr=globalThis.navigator)?void 0:Jr.platform)?void 0:ei.startsWith("Win"))||(null==(ni=null==(ti=globalThis.process)?void 0:ti.platform)?void 0:ni.startsWith("win"))||!1;function ii(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function si(e,t){if(!t)return;let n=(e=>String(e).split(/[/\\]/u).pop())(t).toLowerCase();return e.find(({filenames:e})=>null==e?void 0:e.some(e=>e.toLowerCase()===n))??e.find(({extensions:e})=>null==e?void 0:e.some(e=>n.endsWith(e)))}function oi(e,t){if(t){if(String(t).startsWith("file:"))try{t=function(e){return ri?function(e){e=ii(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return""!==e.hostname&&(t=`\\\\${e.hostname}${t}`),t}(e):function(e){return e=ii(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}(e)}(t)}catch{return}if("string"==typeof t)return e.find(({isSupported:e})=>null==e?void 0:e({filepath:t}))}}var ai=function(e,t){let n=((e,t)=>{if(!e||null!=t)return t.toReversed||!Array.isArray(t)?t.toReversed():[...t].reverse()})(!1,e.plugins).flatMap(e=>e.languages??[]),r=function(e,t){if(t)return e.find(({name:e})=>e.toLowerCase()===t)??e.find(({aliases:e})=>null==e?void 0:e.includes(t))??e.find(({extensions:e})=>null==e?void 0:e.includes(`.${t}`))}(n,t.language)??si(n,t.physicalFile)??si(n,t.file)??oi(n,t.physicalFile)??oi(n,t.file)??void t.physicalFile;return null==r?void 0:r.parsers[0]},li={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(e=>li.value(e)).join(", ")}]`;let t=Object.keys(e);return 0===t.length?"{}":`{ ${t.map(t=>`${li.key(t)}: ${li.value(e[t])}`).join(", ")} }`},pair:({key:e,value:t})=>li.value({[e]:t})},ui=new Proxy(String,{get:()=>ui}),ci=ui,hi=Symbol.for("vnopts.VALUE_NOT_EXIST"),di=Symbol.for("vnopts.VALUE_UNCHANGED"),fi=" ".repeat(2);function pi(e,t,n,r){return[`Invalid ${ci.red(r.key(e))} value.`,`Expected ${ci.blue(n)},`,`but received ${t===hi?ci.gray("nothing"):ci.red(r.value(t))}.`].join(" ")}function mi({text:e,list:t},n){let r=[];return e&&r.push(`- ${ci.blue(e)}`),t&&r.push([`- ${ci.blue(t.title)}:`].concat(t.values.map(e=>mi(e,n-fi.length).replace(/^|\n/g,`$&${fi}`))).join("\n")),gi(r,n)}function gi(e,t){if(1===e.length)return e[0];let[n,r]=e,[i,s]=e.map(e=>e.split("\n",1)[0].length);return i>t&&i>s?r:n}var Ei=[],vi=[],Ci=(e,t,{descriptor:n,logger:r,schemas:i})=>{let s=[`Ignored unknown option ${ci.yellow(n.pair({key:e,value:t}))}.`],o=Object.keys(i).sort().find(t=>function(e,t){if(e===t)return 0;let n=e;e.length>t.length&&(e=t,t=n);let r=e.length,i=t.length;for(;r>0&&e.charCodeAt(~-r)===t.charCodeAt(~-i);)r--,i--;let s=0;for(;sa?u>a?a+1:u:u>l?l+1:u;return a}(e,t)<3);o&&s.push(`Did you mean ${ci.blue(n.key(o))}?`),r.warn(s.join(" "))},Di=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"],Si=class{static create(e){return function(e,t){let n=new e(t),r=Object.create(n);for(let e of Di)e in t&&(r[e]=Ai(t[e],n,Si.prototype[e].length));return r}(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,t){return!1}deprecated(e,t){return!1}forward(e,t){}redirect(e,t){}overlap(e,t,n){return e}preprocess(e,t){return e}postprocess(e,t){return di}};function Ai(e,t,n){return"function"==typeof e?(...r)=>e(...r.slice(0,n-1),t,...r.slice(n-1)):()=>e}var _i=class extends Si{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},yi=class extends Si{expected(){return"anything"}validate(){return!0}},bi=class extends Si{constructor({valueSchema:e,name:t=e.name,...n}){super({...n,name:t}),this._valueSchema=e}expected(e){let{text:t,list:n}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:t&&`an array of ${t}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(e,t){if(!Array.isArray(e))return!1;let n=[];for(let r of e){let e=t.normalizeValidateResult(this._valueSchema.validate(r,t),r);!0!==e&&n.push(e.value)}return 0===n.length||{value:n}}deprecated(e,t){let n=[];for(let r of e){let e=t.normalizeDeprecatedResult(this._valueSchema.deprecated(r,t),r);!1!==e&&n.push(...e.map(({value:e})=>({value:[e]})))}return n}forward(e,t){let n=[];for(let r of e){let e=t.normalizeForwardResult(this._valueSchema.forward(r,t),r);n.push(...e.map(Ti))}return n}redirect(e,t){let n=[],r=[];for(let i of e){let e=t.normalizeRedirectResult(this._valueSchema.redirect(i,t),i);"remain"in e&&n.push(e.remain),r.push(...e.redirect.map(Ti))}return 0===n.length?{redirect:r}:{redirect:r,remain:n}}overlap(e,t){return e.concat(t)}};function Ti({from:e,to:t}){return{from:[e],to:t}}var Ri=class extends Si{expected(){return"true or false"}validate(e){return"boolean"==typeof e}};function xi(e,t){let n=Object.create(null);for(let r of e){let e=r[t];if(n[e])throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n[e]=r}return n}function wi(e,t){if(e===t)return 0;let n=typeof e,r=typeof t,i=["undefined","object","boolean","number","string"];return n!==r?i.indexOf(n)-i.indexOf(r):"string"!==n?Number(e)-Number(t):e.localeCompare(t)}function Fi(e){return void 0===e?{}:e}function Ni(e){if("string"==typeof e)return{text:e};let{text:t,list:n}=e;return function(e){if(!e)throw new Error("Unexpected `expected` result, there should be at least one field.")}(void 0!==(t||n)),n?{text:t,list:{title:n.title,values:n.values.map(Ni)}}:{text:t}}function Li(e,t){return!0===e||(!1===e?{value:t}:e)}function Oi(e,t,n=!1){return!1!==e&&(!0===e?!!n||[{value:t}]:"value"in e?[e]:0!==e.length&&e)}function Ii(e,t){return"string"==typeof e||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function ki(e,t){return void 0===e?[]:Array.isArray(e)?e.map(e=>Ii(e,t)):[Ii(e,t)]}function Mi(e,t){let n=ki("object"==typeof e&&"redirect"in e?e.redirect:e,t);return 0===n.length?{remain:t,redirect:n}:"object"==typeof e&&"remain"in e?{remain:e.remain,redirect:n}:{redirect:n}}var Pi,Bi=class extends Si{constructor(e){super(e),this._choices=function(e,t){let n=new Map;for(let r of e){let e=r[t];if(n.has(e))throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n.set(e,r)}return n}(e.choices.map(e=>e&&"object"==typeof e?e:{value:e}),"value")}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(e=>this._choices.get(e)).filter(({hidden:e})=>!e).map(e=>e.value).sort(wi).map(e.value),n=t.slice(0,-2),r=t.slice(-2);return{text:n.concat(r.join(" or ")).join(", "),list:{title:"one of the following values",values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return!(!t||!t.deprecated)&&{value:e}}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},Ui=class extends Si{expected(){return"a number"}validate(e,t){return"number"==typeof e}},$i=class extends Ui{expected(){return"an integer"}validate(e,t){return!0===t.normalizeValidateResult(super.validate(e,t),e)&&function(e){return e===Math.floor(e)}(e)}},Gi=class extends Si{expected(){return"a string"}validate(e){return"string"==typeof e}},Vi=li,Wi=Ci,Hi=(e,t,n)=>{let{text:r,list:i}=n.normalizeExpectedResult(n.schemas[e].expected(n)),s=[];return r&&s.push(pi(e,t,r,n.descriptor)),i&&s.push([pi(e,t,i.title,n.descriptor)].concat(i.values.map(e=>mi(e,n.loggerPrintWidth))).join("\n")),gi(s,n.loggerPrintWidth)},ji=(e,t,{descriptor:n})=>{let r=[`${ci.yellow("string"==typeof e?n.key(e):n.pair(e))} is deprecated`];return t&&r.push(`we now treat it as ${ci.blue("string"==typeof t?n.key(t):n.pair(t))}`),r.join("; ")+"."},zi=class{constructor(e,t){let{logger:n=console,loggerPrintWidth:r=80,descriptor:i=Vi,unknown:s=Wi,invalid:o=Hi,deprecated:a=ji,missing:l=()=>!1,required:u=()=>!1,preprocess:c=e=>e,postprocess:h=()=>di}=t||{};this._utils={descriptor:i,logger:n||{warn:()=>{}},loggerPrintWidth:r,schemas:xi(e,"name"),normalizeDefaultResult:Fi,normalizeExpectedResult:Ni,normalizeDeprecatedResult:Oi,normalizeForwardResult:ki,normalizeRedirectResult:Mi,normalizeValidateResult:Li},this._unknownHandler=s,this._invalidHandler=function(e){return(...t)=>{let n=e(...t);return"string"==typeof n?new Error(n):n}}(o),this._deprecatedHandler=a,this._identifyMissing=(e,t)=>!(e in t)||l(e,t),this._identifyRequired=u,this._preprocess=c,this._postprocess=h,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=function(){let e=Object.create(null);return t=>{let n=JSON.stringify(t);return!!e[n]||(e[n]=!0,!1)}}()}normalize(e){let t={},n=[this._preprocess(e,this._utils)],r=()=>{for(;0!==n.length;){let e=n.shift(),r=this._applyNormalization(e,t);n.push(...r)}};r();for(let e of Object.keys(this._utils.schemas)){let r=this._utils.schemas[e];if(!(e in t)){let t=Fi(r.default(this._utils));"value"in t&&n.push({[e]:t.value})}}r();for(let e of Object.keys(this._utils.schemas)){if(!(e in t))continue;let n=this._utils.schemas[e],r=t[e],i=n.postprocess(r,this._utils);i!==di&&(this._applyValidation(i,e,n),t[e]=i)}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let n=[],{knownKeys:r,unknownKeys:i}=this._partitionOptionKeys(e);for(let i of r){let r=this._utils.schemas[i],s=r.preprocess(e[i],this._utils);this._applyValidation(s,i,r);let o=({from:e,to:t})=>{n.push("string"==typeof t?{[t]:e}:{[t.key]:t.value})},a=({value:e,redirectTo:t})=>{let n=Oi(r.deprecated(e,this._utils),s,!0);if(!1!==n)if(!0===n)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,t,this._utils));else for(let{value:e}of n){let n={key:i,value:e};if(!this._hasDeprecationWarned(n)){let r="string"==typeof t?{key:t,value:e}:t;this._utils.logger.warn(this._deprecatedHandler(n,r,this._utils))}}};ki(r.forward(s,this._utils),s).forEach(o);let l=Mi(r.redirect(s,this._utils),s);if(l.redirect.forEach(o),"remain"in l){let e=l.remain;t[i]=i in t?r.overlap(t[i],e,this._utils):e,a({value:e})}for(let{from:e,to:t}of l.redirect)a({value:e,redirectTo:t})}for(let r of i){let i=e[r];this._applyUnknownHandler(r,i,t,(e,t)=>{n.push({[e]:t})})}return n}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,hi,this._utils)}_partitionOptionKeys(e){let[t,n]=function(e,t){let n=[],r=[];for(let i of e)t(i)?n.push(i):r.push(i);return[n,r]}(Object.keys(e).filter(t=>!this._identifyMissing(t,e)),e=>e in this._utils.schemas);return{knownKeys:t,unknownKeys:n}}_applyValidation(e,t,n){let r=Li(n.validate(e,this._utils),e);if(!0!==r)throw this._invalidHandler(t,r.value,this._utils)}_applyUnknownHandler(e,t,n,r){let i=this._unknownHandler(e,t,this._utils);if(i)for(let e of Object.keys(i)){if(this._identifyMissing(e,i))continue;let t=i[e];e in this._utils.schemas?r(e,t):n[e]=t}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==di){if(t.delete)for(let n of t.delete)delete e[n];if(t.override){let{knownKeys:n,unknownKeys:r}=this._partitionOptionKeys(t.override);for(let r of n){let n=t.override[r];this._applyValidation(n,r,this._utils.schemas[r]),e[r]=n}for(let n of r){let r=t.override[n];this._applyUnknownHandler(n,r,e,(t,n)=>{let r=this._utils.schemas[t];this._applyValidation(n,t,r),e[t]=n})}}}}};function Xi(e,{isCLI:t,optionInfos:n,FlagSchema:r}){let i,{name:s}=e,o={name:s},a={};switch(e.type){case"int":i=$i,t&&(o.preprocess=Number);break;case"string":case"path":i=Gi;break;case"choice":i=Bi,o.choices=e.choices.map(t=>null!=t&&t.redirect?{...t,redirect:{to:{key:e.name,value:t.redirect}}}:t);break;case"boolean":i=Ri;break;case"flag":i=r,o.flags=n.flatMap(e=>[e.alias,e.description&&e.name,e.oppositeDescription&&`no-${e.name}`].filter(Boolean));break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?o.validate=(t,n,r)=>e.exception(t)||n.validate(t,r):o.validate=(e,t,n)=>void 0===e||t.validate(e,n),e.redirect&&(a.redirect=t=>t?{to:"string"==typeof e.redirect?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(a.deprecated=!0),t&&!e.array){let e=o.preprocess||(e=>e);o.preprocess=(t,n,r)=>n.preprocess(e(Array.isArray(t)?vn(!1,t,-1):t),r)}return e.array?bi.create({...t?{preprocess:e=>Array.isArray(e)?e:[e]}:{},...a,valueSchema:i.create(o)}):i.create({...o,...a})}var Ki=(e,t,n)=>{if(!e||null!=t){if(t.findLast)return t.findLast(n);for(let e=t.length-1;e>=0;e--){let r=t[e];if(n(r,e,t))return r}}};function Yi(e,t){if(!t)throw new Error("parserName is required.");let n=Ki(!1,e,e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t));if(n)return n;let r=`Couldn't resolve parser "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}function qi({plugins:e,parser:t}){return Qi(Yi(e,t),t)}function Qi(e,t){let n=e.parsers[t];return"function"==typeof n?n():n}var Zi={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null},Ji=async function(e,t={}){var n;let r={...e};if(!r.parser){if(!r.filepath)throw new Kr("No parser and no file path given, couldn't infer a parser.");if(r.parser=ai(r,{physicalFile:r.filepath}),!r.parser)throw new Kr(`No parser could be inferred for file "${r.filepath}".`)}let i=qr({plugins:e.plugins,showDeprecated:!0}).options,s={...Zi,...Object.fromEntries(i.filter(e=>void 0!==e.default).map(e=>[e.name,e.default]))},o=Yi(r.plugins,r.parser),a=await Qi(o,r.parser);r.astFormat=a.astFormat,r.locEnd=a.locEnd,r.locStart=a.locStart;let l=null!=(n=o.printers)&&n[a.astFormat]?o:function(e,t){if(!t)throw new Error("astFormat is required.");let n=Ki(!1,e,e=>e.printers&&Object.prototype.hasOwnProperty.call(e.printers,t));if(n)return n;let r=`Couldn't find plugin for AST format "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}(r.plugins,a.astFormat),u=await function(e,t){let n=e.printers[t];return"function"==typeof n?n():n}(l,a.astFormat);r.printer=u;let c={...s,...l.defaultOptions?Object.fromEntries(Object.entries(l.defaultOptions).filter(([,e])=>void 0!==e)):{}};for(let[e,t]of Object.entries(c))(null===r[e]||void 0===r[e])&&(r[e]=t);return"json"===r.parser&&(r.trailingComma="none"),function(e,t,{logger:n=!1,isCLI:r=!1,passThrough:i=!1,FlagSchema:s,descriptor:o}={}){if(r){if(!s)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=li;let a=i?Array.isArray(i)?(e,t)=>i.includes(e)?{[e]:t}:void 0:(e,t)=>({[e]:t}):(e,t,n)=>{let{_:r,...i}=n.schemas;return Ci(e,t,{...n,schemas:i})},l=function(e,{isCLI:t,FlagSchema:n}){let r=[];t&&r.push(yi.create({name:"_"}));for(let i of e)r.push(Xi(i,{isCLI:t,optionInfos:e,FlagSchema:n})),i.alias&&t&&r.push(_i.create({name:i.alias,sourceName:i.name}));return r}(t,{isCLI:r,FlagSchema:s}),u=new zi(l,{logger:n,unknown:a,descriptor:o}),c=!1!==n;c&&Pi&&(u._hasDeprecationWarned=Pi);let h=u.normalize(e);return c&&(Pi=u._hasDeprecationWarned),h}(r,i,{passThrough:Object.keys(Zi),...t})},es=((e,t,n)=>(n=null!=e?$t(Ht(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of Wt(t))!jt.call(e,n)&&void 0!==n&&Gt(e,n,{get:()=>t[n],enumerable:!(r=Vt(t,n))||r.enumerable});return e})(Gt(n,"default",{value:e,enumerable:!0}),e)))(Yt()),ts=async function(e,t){let n,r=await qi(t),i=r.preprocess?r.preprocess(e,t):e;t.originalText=i;try{n=await r.parse(i,t,t)}catch(t){!function(e,t){let{loc:n}=e;if(n){let r=(0,es.codeFrameColumns)(t,n,{highlightCode:!0});throw e.message+="\n"+r,e.codeFrame=r,e}throw e}(t,e)}return{text:i,ast:n}};async function ns(e,t){({ast:e}=await is(e,t));let n=new Map,r=new vr(e),i=()=>{},s=new Map;await async function(e,t,n,r,i){let{embeddedLanguageFormatting:s,printer:{embed:o,hasPrettierIgnore:a=()=>!1,getVisitorKeys:l}}=n;if(!o||"auto"!==s)return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let u=Nr(o.getVisitorKeys??l),c=[];!function t(){let{node:r}=e;if(null===r||"object"!=typeof r||a(e))return;for(let n of u(r))Array.isArray(r[n])?e.each(t,n):e.call(t,n);let s=o(e,n);if(s){if("function"==typeof s)return void c.push({print:s,node:r,pathStack:[...e.stack]});i.set(r,s)}}();let h=e.stack;for(let{print:r,node:s,pathStack:o}of c)try{e.stack=o;let a=await r(d,t,e,n);a&&i.set(s,a)}catch(e){if(globalThis.PRETTIER_DEBUG)throw e}function d(e,t){return async function(e,t,n,r){let i=await Ji({...n,...t,parentParser:n.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:s}=await ts(e,i);return Nn(await r(s,i))}(e,t,n,r)}e.stack=h}(r,a,t,ns,s);let o=await rs(r,t,a,void 0,s);if(function(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:n}=e;for(let e of t){if(!e.printed&&!n.has(e))throw new Error('Comment "'+e.value.trim()+'" was not printed. Please report this error!');delete e.printed}}(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return[Qn,o];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[o,Qn]}return o;function a(e,t){return void 0===e||e===r?l(t):Array.isArray(e)?r.call(()=>l(t),...e):r.call(()=>l(t),e)}function l(e){i(r);let o=r.node;if(null==o)return"";let l=o&&"object"==typeof o&&void 0===e;if(l&&n.has(o))return n.get(o);let u=rs(r,t,a,e,s);return l&&n.set(o,u),u}}function rs(e,t,n,r,i){var s;let o,{node:a}=e,{printer:l}=t;switch(o=null!=(s=l.hasPrettierIgnore)&&s.call(l,e)?function(e,t){let{originalText:n,[Symbol.for("comments")]:r,locStart:i,locEnd:s,[Symbol.for("printedComments")]:o}=t,{node:a}=e,l=i(a),u=s(a);for(let e of r)i(e)>=l&&s(e)<=u&&o.add(e);return n.slice(l,u)}(e,t):i.has(a)?i.get(a):l.print(e,t,n,r),a){case t.cursorNode:o=On(o,e=>[Qn,e,Qn]);break;case t.nodeBeforeCursor:o=On(o,e=>[e,Qn]);break;case t.nodeAfterCursor:o=On(o,e=>[Qn,e])}return l.printComment&&(!l.willPrintOwnComments||!l.willPrintOwnComments(e,t))&&(o=function(e,t,n){let{leading:r,trailing:i}=function(e,t){let n=e.node;if(!n)return{};let r=t[Symbol.for("printedComments")];if(0===(n.comments||[]).filter(e=>!r.has(e)).length)return{leading:"",trailing:""};let i,s=[],o=[];return e.each(()=>{let n=e.node;if(null!=r&&r.has(n))return;let{leading:a,trailing:l}=n;a?s.push(function(e,t){var n;let r=e.node,i=[zr(e,t)],{printer:s,originalText:o,locStart:a,locEnd:l}=t;if(null==(n=s.isBlockComment)?void 0:n.call(s,r)){let e=xr(o,l(r))?xr(o,a(r),{backwards:!0})?Yn:Xn:" ";i.push(e)}else i.push(Yn);let u=Rr(o,yr(o,l(r)));return!1!==u&&xr(o,u)&&i.push(Yn),i}(e,t)):l&&(i=function(e,t,n){var r;let i=e.node,s=zr(e,t),{printer:o,originalText:a,locStart:l}=t,u=null==(r=o.isBlockComment)?void 0:r.call(o,i);if(null!=n&&n.hasLineSuffix&&(null==n||!n.isBlock)||xr(a,l(i),{backwards:!0})){let e=jr(a,l(i));return{doc:Gn([Yn,e?Yn:"",s]),isBlock:u,hasLineSuffix:!0}}return!u||null!=n&&n.hasLineSuffix?{doc:[Gn([" ",s]),Wn],isBlock:u,hasLineSuffix:!0}:{doc:[" ",s],isBlock:u,hasLineSuffix:!1}}(e,t,i),o.push(i.doc))},"comments"),{leading:s,trailing:o}}(e,n);return r||i?On(t,e=>[r,e,i]):t}(e,o,t)),o}async function is(e,t){let n=e.comments??[];t[Symbol.for("comments")]=n,t[Symbol.for("printedComments")]=new Set,function(e,t){let{comments:n}=e;if(delete e.comments,!function(e){return Array.isArray(e)&&e.length>0}(n)||!t.printer.canAttachComment)return;let r=[],{printer:{experimentalFeatures:{avoidAstMutation:i=!1}={},handleComments:s={}},originalText:o}=t,{ownLine:a=Ur,endOfLine:l=Ur,remaining:u=Ur}=s,c=n.map((r,i)=>({...Br(e,r,t),comment:r,text:o,options:t,ast:e,isLastComment:n.length-1===i}));for(let[e,t]of c.entries()){let n,{comment:s,precedingNode:o,enclosingNode:h,followingNode:d,text:f,options:p,ast:m,isLastComment:g}=t;if(i?n=[t]:(s.enclosingNode=h,s.precedingNode=o,s.followingNode=d,n=[s,f,p,m,g]),Gr(f,p,c,e))s.placement="ownLine",a(...n)||(d?Or(d,s):o?kr(o,s):Ir(h||m,s));else if(Vr(f,p,c,e))s.placement="endOfLine",l(...n)||(o?kr(o,s):d?Or(d,s):Ir(h||m,s));else if(s.placement="remaining",!u(...n))if(o&&d){let e=r.length;e>0&&r[e-1].followingNode!==d&&Wr(r,p),r.push(t)}else o?kr(o,s):d?Or(d,s):Ir(h||m,s)}if(Wr(r,t),!i)for(let e of n)delete e.precedingNode,delete e.enclosingNode,delete e.followingNode}(e,t);let{printer:{preprocess:r}}=t;return{ast:e=r?await r(e,t):e,comments:n}}var ss=function(e,t){let{cursorOffset:n,locStart:r,locEnd:i}=t,s=Nr(t.printer.getVisitorKeys),o=e=>r(e)<=n&&i(e)>=n,a=e,l=[e];for(let t of function*(e,t){let n=[e];for(let e=0;e0&&(void 0===u||void 0===c);){a=l.pop();let e=void 0!==u,t=void 0!==c;for(let o of Sr(a,{getVisitorKeys:s})){if(!e){let e=i(o);e<=n&&e>h&&(u=o,h=e)}if(!t){let e=r(o);e>=n&&e{if(!e||null!=t){if(t.findLastIndex)return t.findLastIndex(n);for(let e=t.length-1;e>=0;e--)if(n(t[e],e,t))return e;return-1}})(!1,e,e=>"Program"!==e.type&&"File"!==e.type);return-1===t?e:e.slice(0,t+1)}function as(e,t,n,r,i=[],s){let{locStart:o,locEnd:a}=n,l=o(e),u=a(e);if(!(t>u||t=0&&(t={...t,...ss(r,t)});let s=await ns(r,t);n>0&&(s=Jn([Yn,s],n,t.tabWidth));let o=fr(s,t);if(n>0){let e=o.formatted.trim();void 0!==o.cursorNodeStart&&(o.cursorNodeStart-=o.formatted.indexOf(e),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>e.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=e+Jt(t.endOfLine)}let a=t[Symbol.for("comments")];if(t.cursorOffset>=0){let e,n,r,s;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&o.cursorNodeText)if(r=o.cursorNodeStart,s=o.cursorNodeText,t.cursorNode)e=t.locStart(t.cursorNode),n=i.slice(e,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");e=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let r=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):i.length;n=i.slice(e,r)}else e=0,n=i,r=0,s=o.formatted;let l=t.cursorOffset-e;if(n===s)return{formatted:o.formatted,cursorOffset:r+l,comments:a};let u=n.split("");u.splice(l,0,hs);let c=function(e,t){return Zt.diff(e,t,void 0)}(u,s.split("")),h=r;for(let e of c)if(e.removed){if(e.value.includes(hs))break}else h+=e.count;return{formatted:o.formatted,cursorOffset:h,comments:a}}return{formatted:o.formatted,cursorOffset:-1,comments:a}}function fs(e,t,n){return"number"!=typeof t||Number.isNaN(t)||t<0||t>e.length?n:t}function ps(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i}=t;return n=fs(e,n,-1),r=fs(e,r,0),i=fs(e,i,e.length),{...t,cursorOffset:n,rangeStart:r,rangeEnd:i}}function ms(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s}=ps(e,t),o="\ufeff"===e.charAt(0);if(o&&(e=e.slice(1),n--,r--,i--),"auto"===s&&(s=function(e){let t=e.indexOf("\r");return-1!==t?"\n"===e.charAt(t+1)?"crlf":"cr":"lf"}(e)),e.includes("\r")){let t=t=>en(e.slice(0,Math.max(t,0)),"\r\n");n-=t(n),r-=t(r),i-=t(i),e=function(e){return qt(!1,e,/\r\n?/gu,"\n")}(e)}return{hasBOM:o,text:e,options:ps(e,{...t,cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s})}}async function gs(e,t){let n=await qi(t);return!n.hasPragma||n.hasPragma(e)}async function Es(e,t){let n,{hasBOM:r,text:i,options:s}=ms(e,await Ji(t));return s.rangeStart>=s.rangeEnd&&""!==i||s.requirePragma&&!await gs(i,s)||s.checkIgnorePragma&&await async function(e,t){var n;let r=await qi(t);return null==(n=r.hasIgnorePragma)?void 0:n.call(r,e)}(i,s)?{formatted:e,cursorOffset:t.cursorOffset,comments:[]}:(s.rangeStart>0||s.rangeEndr);let a=e.slice(r,i).search(/\S/u),l=-1===a;if(!l)for(r+=a;i>r&&!/\S/u.test(e[i-1]);--i);let u,c,h=as(n,r,t,(e,n)=>cs(t,e,n),[],"rangeStart"),d=l?h:as(n,i,t,e=>cs(t,e),[],"rangeEnd");if(!h||!d)return{rangeStart:0,rangeEnd:0};if((({parser:e})=>"json"===e||"json5"===e||"jsonc"===e||"json-stringify"===e)(t)){let e=function(e,t){let n=[e.node,...e.parentNodes],r=new Set([t.node,...t.parentNodes]);return n.find(e=>ls.has(e.type)&&r.has(e))}(h,d);u=e,c=e}else({startNode:u,endNode:c}=function(e,t,{locStart:n,locEnd:r}){let i=e.node,s=t.node;if(i===s)return{startNode:i,endNode:s};let o=n(e.node);for(let e of os(t.parentNodes)){if(!(n(e)>=o))break;s=e}let a=r(t.node);for(let t of os(e.parentNodes)){if(!(r(t)<=a))break;if(i=t,i===s)break}return{startNode:i,endNode:s}}(h,d,t));return{rangeStart:Math.min(s(u),s(c)),rangeEnd:Math.max(o(u),o(c))}}(r,t,n),o=r.slice(i,s),a=Math.min(i,r.lastIndexOf("\n",i)+1),l=r.slice(a,i).match(/^\s*/u)[0],u=Er(l,t.tabWidth),c=await ds(o,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>i&&t.cursorOffset<=s?t.cursorOffset-i:-1,endOfLine:"lf"},u),h=c.formatted.trimEnd(),{cursorOffset:d}=t;d>s?d+=h.length-o.length:c.cursorOffset>=0&&(d=c.cursorOffset+i);let f=r.slice(0,i)+h+r.slice(s);if("lf"!==t.endOfLine){let e=Jt(t.endOfLine);d>=0&&"\r\n"===e&&(d+=en(f.slice(0,d),"\n")),f=qt(!1,f,"\n",e)}return{formatted:f,cursorOffset:d,comments:c.comments}}(i,s):(!s.requirePragma&&s.insertPragma&&s.printer.insertPragma&&!await gs(i,s)&&(i=s.printer.insertPragma(i)),n=await ds(i,s)),r&&(n.formatted="\ufeff"+n.formatted,n.cursorOffset>=0&&n.cursorOffset++),n)}var vs={};Xt(vs,{builders:()=>Cs,printer:()=>Ds,utils:()=>Ss});var Cs={join:Zn,line:Xn,softline:Kn,hardline:Yn,literalline:qn,group:$n,conditionalGroup:function(e,t){return $n(e[0],{...t,expandedStates:e})},fill:function(e){return Pn(e),{type:un,parts:e}},lineSuffix:Gn,lineSuffixBoundary:Vn,cursor:Qn,breakParent:Wn,ifBreak:function(e,t="",n={}){return kn(e),""!==t&&kn(t),{type:cn,breakContents:e,flatContents:t,groupId:n.groupId}},trim:Hn,indent:Bn,indentIfBreak:function(e,t){return kn(e),{type:hn,contents:e,groupId:t.groupId,negate:t.negate}},align:Un,addAlignmentToDoc:Jn,markAsRoot:function(e){return Un({type:"root"},e)},dedentToRoot:function(e){return Un(Number.NEGATIVE_INFINITY,e)},dedent:function(e){return Un(-1,e)},hardlineWithoutBreakParent:jn,literallineWithoutBreakParent:zn,label:function(e,t){return kn(t),e?{type:mn,label:e,contents:t}:t},concat:e=>e},Ds={printDocToString:fr},Ss={willBreak:function(e){return bn(e,Tn,!1)},traverseDoc:_n,findInDoc:bn,mapDoc:yn,removeLines:function(e){return yn(e,xn)},stripTrailingHardline:Nn,replaceEndOfLine:function(e,t=qn){return yn(e,e=>"string"==typeof e?Zn(t,e.split("\n")):e)},canBreak:function(e){return bn(e,Ln,!1)}},As="3.6.2",_s={};Xt(_s,{addDanglingComment:()=>Ir,addLeadingComment:()=>Or,addTrailingComment:()=>kr,getAlignmentSize:()=>Er,getIndentSize:()=>xs,getMaxContinuousCount:()=>ws,getNextNonSpaceNonCommentCharacter:()=>Fs,getNextNonSpaceNonCommentCharacterIndex:()=>Ms,getPreferredQuote:()=>Ls,getStringWidth:()=>rr,hasNewline:()=>xr,hasNewlineInRange:()=>Os,hasSpaces:()=>Is,isNextLineEmpty:()=>Bs,isNextLineEmptyAfterIndex:()=>Rs,isPreviousLineEmpty:()=>Ps,makeString:()=>ks,skip:()=>Ar,skipEverythingButNewLine:()=>Tr,skipInlineComment:()=>ys,skipNewline:()=>Rr,skipSpaces:()=>yr,skipToLineEnd:()=>br,skipTrailingComment:()=>bs,skipWhitespace:()=>_r});var ys=function(e,t){if(!1===t)return!1;if("/"===e.charAt(t)&&"*"===e.charAt(t+1))for(let n=t+2;nMath.max(e,n.length/t.length),0)},Fs=function(e,t){let n=Ts(e,t);return!1===n?"":e.charAt(n)},Ns="'",Ls=function(e,t){let n=!0===t||t===Ns?Ns:'"',r=n===Ns?'"':Ns,i=0,s=0;for(let t of e)t===n?i++:t===r&&s++;return i>s?r:n},Os=function(e,t,n){for(let r=t;ri===r?i:s===t?"\\"+s:s||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(i)?i:"\\"+i));return t+i+t};function Ms(e,t){return 2===arguments.length||"number"==typeof t?Ts(e,t):function(e,t,n){return Ts(e,n(t))}(...arguments)}function Ps(e,t){return 2===arguments.length||"number"==typeof t?jr(e,t):function(e,t,n){return jr(e,n(t))}(...arguments)}function Bs(e,t){return 2===arguments.length||"number"==typeof t?Rs(e,t):function(e,t,n){return Rs(e,n(t))}(...arguments)}function Us(e,t=1){return async(...n)=>{let r=n[t]??{},i=r.plugins??[];return n[t]={...r,plugins:Array.isArray(i)?i:Object.values(i)},e(...n)}}var $s=Us(Es);async function Gs(e,t){let{formatted:n}=await $s(e,{...t,cursorOffset:-1});return n}async function Vs(e,t){return await Gs(e,t)===e}var Ws=Us(qr,0),Hs={parse:Us(async function(e,t,n){let{text:r,options:i}=ms(e,await Ji(t)),s=await ts(r,i);return n&&(n.preprocessForPrint&&(s.ast=await is(s.ast,i)),n.massage&&(s.ast=function(e,t){let{printer:{massageAstNode:n,getVisitorKeys:r}}=t;if(!n)return e;let i=Nr(r),s=n.ignoredProperties??new Set;return function e(t,r){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>e(t,r)).filter(Boolean);let o={},a=new Set(i(t));for(let n in t)!Object.prototype.hasOwnProperty.call(t,n)||s.has(n)||(a.has(n)?o[n]=e(t[n],t):o[n]=t[n]);let l=n(t,o,r);return null!==l?l??o:void 0}(e)}(s.ast,i))),s}),formatAST:Us(async function(e,t){return t=await Ji(t),fr(await ns(e,t),t)}),formatDoc:Us(async function(e,t){let n=function(e){let t=Object.create(null),n=new Set;return function e(t,n,i){var s,o;if("string"==typeof t)return JSON.stringify(t);if(Array.isArray(t)){let n=t.map(e).filter(Boolean);return 1===n.length?n[0]:`[${n.join(", ")}]`}if(t.type===pn){let e=(null==(s=null==i?void 0:i[n+1])?void 0:s.type)===gn;return t.literal?e?"literalline":"literallineWithoutBreakParent":t.hard?e?"hardline":"hardlineWithoutBreakParent":t.soft?"softline":"line"}if(t.type===gn)return(null==(o=null==i?void 0:i[n-1])?void 0:o.type)===pn&&i[n-1].hard?void 0:"breakParent";if(t.type===an)return"trim";if(t.type===sn)return"indent("+e(t.contents)+")";if(t.type===on)return t.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+e(t.contents)+")":t.n<0?"dedent("+e(t.contents)+")":"root"===t.n.type?"markAsRoot("+e(t.contents)+")":"align("+JSON.stringify(t.n)+", "+e(t.contents)+")";if(t.type===cn)return"ifBreak("+e(t.breakContents)+(t.flatContents?", "+e(t.flatContents):"")+(t.groupId?(t.flatContents?"":', ""')+`, { groupId: ${r(t.groupId)} }`:"")+")";if(t.type===hn){let n=[];t.negate&&n.push("negate: true"),t.groupId&&n.push(`groupId: ${r(t.groupId)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return`indentIfBreak(${e(t.contents)}${i})`}if(t.type===ln){let n=[];t.break&&"propagated"!==t.break&&n.push("shouldBreak: true"),t.id&&n.push(`id: ${r(t.id)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return t.expandedStates?`conditionalGroup([${t.expandedStates.map(t=>e(t)).join(",")}]${i})`:`group(${e(t.contents)}${i})`}if(t.type===un)return`fill([${t.parts.map(t=>e(t)).join(", ")}])`;if(t.type===dn)return"lineSuffix("+e(t.contents)+")";if(t.type===fn)return"lineSuffixBoundary";if(t.type===mn)return`label(${JSON.stringify(t.label)}, ${e(t.contents)})`;if(t.type===rn)return"cursor";throw new Error("Unknown doc type "+t.type)}(er(e));function r(e){if("symbol"!=typeof e)return JSON.stringify(String(e));if(e in t)return t[e];let r=e.description||"symbol";for(let i=0;;i++){let s=r+(i>0?` #${i}`:"");if(!n.has(s))return n.add(s),t[e]=`Symbol.for(${JSON.stringify(s)})`}}}(e),{formatted:r}=await Es(n,{...t,parser:"__js_expression"});return r}),printToDoc:Us(async function(e,t){t=await Ji(t);let{ast:n}=await ts(e,t);return t.cursorOffset>=0&&(t={...t,...ss(n,t)}),ns(n,t)}),printDocToString:Us(async function(e,t){return fr(e,await Ji(t))})},js=Object.defineProperty;((e,t)=>{for(var n in t)js(e,n,{get:t[n],enumerable:!0})})({},{builders:()=>Jo,printer:()=>ea,utils:()=>ta});var zs="string",Xs="array",Ks="cursor",Ys="indent",qs="align",Qs="trim",Zs="group",Js="fill",eo="if-break",to="indent-if-break",no="line-suffix",ro="line-suffix-boundary",io="line",so="label",oo="break-parent",ao=new Set([Ks,Ys,qs,Qs,Zs,Js,eo,to,no,ro,io,so,oo]),lo=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},uo=function(e){if("string"==typeof e)return zs;if(Array.isArray(e))return Xs;if(!e)return;const{type:t}=e;return ao.has(t)?t:void 0};var co=class extends Error{name="InvalidDocError";constructor(e){super(function(e){const t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(uo(e))throw new Error("doc is valid.");const n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;const r=(i=[...ao].map(e=>`'${e}'`),new Intl.ListFormat("en-US",{type:"disjunction"}).format(i));var i;return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},ho={},fo=function(e,t,n,r){const i=[e];for(;i.length>0;){const e=i.pop();if(e===ho){n(i.pop());continue}n&&i.push(e,ho);const s=uo(e);if(!s)throw new co(e);if(!1!==(null==t?void 0:t(e)))switch(s){case Xs:case Js:{const t=s===Xs?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case eo:i.push(e.flatContents,e.breakContents);break;case Zs:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case qs:case Ys:case to:case so:case no:i.push(e.contents);break;case zs:case Ks:case Qs:case ro:case io:case oo:break;default:throw new co(e)}}};function po(e,t){if("string"==typeof e)return t(e);const n=new Map;return function e(r){if(n.has(r))return n.get(r);const i=function(n){switch(uo(n)){case Xs:return t(n.map(e));case Js:return t({...n,parts:n.parts.map(e)});case eo:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case Zs:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case qs:case Ys:case to:case so:case no:return t({...n,contents:e(n.contents)});case zs:case Ks:case Qs:case ro:case io:case oo:return t(n);default:throw new co(n)}}(r);return n.set(r,i),i}(e)}function mo(e,t,n){let r=n,i=!1;return fo(e,function(e){if(i)return!1;const n=t(e);void 0!==n&&(i=!0,r=n)}),r}function go(e){return!(e.type!==Zs||!e.break)||!(e.type!==io||!e.hard)||e.type===oo||void 0}function Eo(e){if(e.length>0){const t=lo(!1,e,-1);t.expandedStates||t.break||(t.break="propagated")}return null}function vo(e){return e.type!==io||e.hard?e.type===eo?e.flatContents:e:e.soft?"":" "}function Co(e){for(e=[...e];e.length>=2&&lo(!1,e,-2).type===io&&lo(!1,e,-1).type===oo;)e.length-=2;if(e.length>0){const t=Do(lo(!1,e,-1));e[e.length-1]=t}return e}function Do(e){switch(uo(e)){case Ys:case to:case Zs:case no:case so:{const t=Do(e.contents);return{...e,contents:t}}case eo:return{...e,breakContents:Do(e.breakContents),flatContents:Do(e.flatContents)};case Js:return{...e,parts:Co(e.parts)};case Xs:return Co(e);case zs:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return t{},_o=Ao,yo=Ao,bo=Ao;function To(e){return _o(e),{type:Ys,contents:e}}function Ro(e,t){return _o(t),{type:qs,contents:t,n:e}}function xo(e,t={}){return _o(e),yo(t.expandedStates,!0),{type:Zs,id:t.id,contents:e,break:Boolean(t.shouldBreak),expandedStates:t.expandedStates}}var wo={type:ro},Fo={type:oo},No={type:Qs},Lo={type:io,hard:!0},Oo={type:io,hard:!0,literal:!0},Io={type:io},ko={type:io,soft:!0},Mo=[Lo,Fo],Po=[Oo,Fo],Bo={type:Ks};function Uo(e,t){_o(e),yo(t);const n=[];for(let r=0;r{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Go=e=>{return!(12288===(t=e)||t>=65281&&t<=65376||t>=65504&&t<=65510||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e));var t},Vo=/[^\x20-\x7F]/u,Wo=function(e){if(!e)return 0;if(!Vo.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(const n of e){const e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=Go(e)?1:2)}return t},Ho=Symbol("MODE_BREAK"),jo=Symbol("MODE_FLAT"),zo=Symbol("cursor"),Xo=Symbol("DOC_FILL_PRINTED_LENGTH");function Ko(e,t){return qo(e,{type:"indent"},t)}function Yo(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?qo(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:qo(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function qo(e,t,n){const r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t];let i="",s=0,o=0,a=0;for(const e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function Qo(e){let t=0,n=0,r=e.length;e:for(;r--;){const i=e[r];if(i!==zo)for(let n=i.length-1;n>=0;n--){const s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(zo);return t}function Zo(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length;const a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}const{mode:e,doc:u}=a.pop(),c=uo(u);switch(c){case zs:l.push(u),n-=Wo(u);break;case Xs:case Js:{const t=c===Xs?u:u.parts,n=u[Xo]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case Ys:case qs:case to:case so:a.push({mode:e,doc:u.contents});break;case Qs:n+=Qo(l);break;case Zs:{if(s&&u.break)return!1;const t=u.break?Ho:e,n=u.expandedStates&&t===Ho?lo(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case eo:{const t=(u.groupId?i[u.groupId]||jo:e)===Ho?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case io:if(e===Ho||u.hard)return!0;u.soft||(l.push(" "),n--);break;case no:r=!0;break;case ro:if(r)return!1}}return!1}var Jo={join:Uo,line:Io,softline:ko,hardline:Mo,literalline:Po,group:xo,conditionalGroup:function(e,t){return xo(e[0],{...t,expandedStates:e})},fill:function(e){return bo(e),{type:Js,parts:e}},lineSuffix:function(e){return _o(e),{type:no,contents:e}},lineSuffixBoundary:wo,cursor:Bo,breakParent:Fo,ifBreak:function(e,t="",n={}){return _o(e),""!==t&&_o(t),{type:eo,breakContents:e,flatContents:t,groupId:n.groupId}},trim:No,indent:To,indentIfBreak:function(e,t){return _o(e),{type:to,contents:e,groupId:t.groupId,negate:t.negate}},align:Ro,addAlignmentToDoc:function(e,t,n){_o(e);let r=e;if(t>0){for(let e=0;ee},ea={printDocToString:function(e,t){const n={},r=t.printWidth,i=function(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}(t.endOfLine);let s=0;const o=[{ind:{value:"",length:0,queue:[]},mode:Ho,doc:e}],a=[];let l=!1;const u=[];let c=0;for(function(e){const t=new Set,n=[];fo(e,function(e){if(e.type===oo&&Eo(n),e.type===Zs){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===Zs&&n.pop().break&&Eo(n)},!0)}(e);o.length>0;){const{ind:e,mode:h,doc:d}=o.pop();switch(uo(d)){case zs:{const e="\n"!==i?$o(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=Wo(e));break}case Xs:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case Ks:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(zo),c++;break;case Ys:o.push({ind:Ko(e,t),mode:h,doc:d.contents});break;case qs:o.push({ind:Yo(e,d.n,t),mode:h,doc:d.contents});break;case Qs:s-=Qo(a);break;case Zs:switch(h){case jo:if(!l){o.push({ind:e,mode:d.break?Ho:jo,doc:d.contents});break}case Ho:{l=!1;const t={ind:e,mode:jo,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&Zo(t,o,i,a,n))o.push(t);else if(d.expandedStates){const t=lo(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:Ho,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:Ho,doc:t});break}{const t=d.expandedStates[r],s={ind:e,mode:jo,doc:t};if(Zo(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:Ho,doc:d.contents});break}}d.id&&(n[d.id]=lo(!1,o,-1).mode);break;case Js:{const t=r-s,i=d[Xo]??0,{parts:a}=d,l=a.length-i;if(0===l)break;const c=a[i+0],f=a[i+1],p={ind:e,mode:jo,doc:c},m={ind:e,mode:Ho,doc:c},g=Zo(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}const E={ind:e,mode:jo,doc:f},v={ind:e,mode:Ho,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}const C=a[i+2],D={ind:e,mode:h,doc:{...d,[Xo]:i+2}};Zo({ind:e,mode:jo,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case eo:case to:{const t=d.groupId?n[d.groupId]:h;if(t===Ho){const t=d.type===eo?d.breakContents:d.negate?d.contents:To(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===jo){const t=d.type===eo?d.flatContents:d.negate?To(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case no:u.push({ind:e,mode:h,doc:d.contents});break;case ro:u.length>0&&o.push({ind:e,mode:h,doc:Lo});break;case io:switch(h){case jo:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case Ho:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=Qo(a),a.push(i+e.value),s=e.length)}break;case so:o.push({ind:e,mode:h,doc:d.contents});break;case oo:break;default:throw new co(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}const h=a.indexOf(zo);if(-1!==h){const e=a.indexOf(zo,h+1);if(-1===e)return{formatted:a.filter(e=>e!==zo).join("")};const t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}},ta={willBreak:function(e){return mo(e,go,!1)},traverseDoc:fo,findInDoc:mo,mapDoc:po,removeLines:function(e){return po(e,vo)},stripTrailingHardline:function(e){return Do(function(e){return po(e,e=>function(e){switch(uo(e)){case Js:if(e.parts.every(e=>""===e))return"";break;case Zs:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===Zs&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case qs:case Ys:case to:case no:if(!e.contents)return"";break;case eo:if(!e.flatContents&&!e.breakContents)return"";break;case Xs:{const t=[];for(const n of e){if(!n)continue;const[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof lo(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case zs:case Ks:case Qs:case ro:case io:case so:case oo:break;default:throw new co(e)}return e}(e))}(e))},replaceEndOfLine:function(e,t=Po){return po(e,e=>"string"==typeof e?Uo(t,e.split("\n")):e)},canBreak:function(e){return mo(e,So,!1)}};function na(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}class ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class ia extends ra{constructor(e){super([]),this.idx=1,Object.assign(this,ma(e))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class sa extends ra{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ma(e))}}class oa extends ra{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ma(e))}}class aa extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class la extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ua extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ca extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ha extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class da extends ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ma(e))}}class fa{constructor(e){this.idx=1,Object.assign(this,ma(e))}accept(e){e.visit(this)}}function pa(e){function t(e){return e.map(pa)}if(e instanceof ia){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return"string"==typeof e.label&&(t.label=e.label),t}if(e instanceof oa)return{type:"Alternative",definition:t(e.definition)};if(e instanceof aa)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof la)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof ua)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ha)return{type:"RepetitionWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ca)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof da)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof fa){const t={type:"Terminal",name:e.terminalType.name,label:(n=e.terminalType,"string"==typeof(r=n).LABEL&&""!==r.LABEL?n.LABEL:n.name),idx:e.idx};"string"==typeof e.label&&(t.terminalLabel=e.label);const i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=i instanceof RegExp?i.source:i),t}if(e instanceof sa)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match");var n,r}function ma(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}class ga{visit(e){const t=e;switch(t.constructor){case ia:return this.visitNonTerminal(t);case oa:return this.visitAlternative(t);case aa:return this.visitOption(t);case la:return this.visitRepetitionMandatory(t);case ua:return this.visitRepetitionMandatoryWithSeparator(t);case ha:return this.visitRepetitionWithSeparator(t);case ca:return this.visitRepetition(t);case da:return this.visitAlternation(t);case fa:return this.visitTerminal(t);case sa:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Ea(e,t=[]){return!!(e instanceof aa||e instanceof ca||e instanceof ha)||(e instanceof da?e.definition.some(e=>Ea(e,t)):!(e instanceof ia&&t.includes(e))&&e instanceof ra&&(e instanceof ia&&t.push(e),e.definition.every(e=>Ea(e,t))))}function va(e){if(e instanceof ia)return"SUBRULE";if(e instanceof aa)return"OPTION";if(e instanceof da)return"OR";if(e instanceof la)return"AT_LEAST_ONE";if(e instanceof ua)return"AT_LEAST_ONE_SEP";if(e instanceof ha)return"MANY_SEP";if(e instanceof ca)return"MANY";if(e instanceof fa)return"CONSUME";throw Error("non exhaustive match")}class Ca{walk(e,t=[]){e.definition.forEach((n,r)=>{const i=e.definition.slice(r+1);if(n instanceof ia)this.walkProdRef(n,i,t);else if(n instanceof fa)this.walkTerminal(n,i,t);else if(n instanceof oa)this.walkFlat(n,i,t);else if(n instanceof aa)this.walkOption(n,i,t);else if(n instanceof la)this.walkAtLeastOne(n,i,t);else if(n instanceof ua)this.walkAtLeastOneSep(n,i,t);else if(n instanceof ha)this.walkManySep(n,i,t);else if(n instanceof ca)this.walkMany(n,i,t);else{if(!(n instanceof da))throw Error("non exhaustive match");this.walkOr(n,i,t)}})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);e.definition.forEach(e=>{const t=new oa({definition:[e]});this.walk(t,r)})}}function Da(e,t,n){return[new aa({definition:[new fa({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Sa(e){if(e instanceof ia)return Sa(e.referencedRule);if(e instanceof fa)return[e.terminalType];if(function(e){return e instanceof oa||e instanceof aa||e instanceof ca||e instanceof la||e instanceof ua||e instanceof ha||e instanceof fa||e instanceof sa}(e))return function(e){let t=[];const n=e.definition;let r,i=0,s=n.length>i,o=!0;for(;s&&o;)r=n[i],o=Ea(r),t=t.concat(Sa(r)),i+=1,s=n.length>i;return[...new Set(t)]}(e);if(function(e){return e instanceof da}(e))return function(e){const t=e.definition.map(e=>Sa(e));return[...new Set(t.flat())]}(e);throw Error("non exhaustive match")}const Aa="_~IN~_";class _a extends Ca{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=(i=e.referencedRule,s=e.idx,i.name+s+Aa+this.topProd.name);var i,s;const o=t.concat(n),a=Sa(new oa({definition:o}));this.follows[r]=a}}function ya(e){return e.charCodeAt(0)}function ba(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function Ta(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t],e[t]=!0}function Ra(e){if(void 0===e)throw Error("Internal Error - Should never get here!");return!0}function xa(){throw Error("Internal Error - Should never get here!")}function wa(e){return"Character"===e.type}const Fa=[];for(let e=ya("0");e<=ya("9");e++)Fa.push(e);const Na=[ya("_")].concat(Fa);for(let e=ya("a");e<=ya("z");e++)Na.push(e);for(let e=ya("A");e<=ya("Z");e++)Na.push(e);const La=[ya(" "),ya("\f"),ya("\n"),ya("\r"),ya("\t"),ya("\v"),ya("\t"),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya("\u2028"),ya("\u2029"),ya(" "),ya(" "),ya(" "),ya("\ufeff")],Oa=/[0-9a-fA-F]/,Ia=/[0-9]/,ka=/[1-9]/;class Ma{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}function Pa(e){console&&console.error&&console.error(`Error: ${e}`)}function Ba(e){console&&console.warn&&console.warn(`Warning: ${e}`)}let Ua={};const $a=new class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Ta(n,"global");break;case"i":Ta(n,"ignoreCase");break;case"m":Ta(n,"multiLine");break;case"u":Ta(n,"unicode");break;case"y":Ta(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":let t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}}Ra(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return xa()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;Ra(t)}if(!0!==e||void 0!==t)return Ra(t)?("?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t):void 0}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),Ra(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):xa()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ya("\n"),ya("\r"),ya("\u2028"),ya("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=Fa;break;case"D":e=Fa,t=!0;break;case"s":e=La;break;case"S":e=La,t=!0;break;case"w":e=Na;break;case"W":e=Na,t=!0}return Ra(e)?{type:"Set",value:e,complement:t}:xa()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ya("\f");break;case"n":e=ya("\n");break;case"r":e=ya("\r");break;case"t":e=ya("\t");break;case"v":e=ya("\v")}return Ra(e)?{type:"Character",value:e}:xa()}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:ya("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:ya(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:ya(this.popChar())}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const t=this.classAtom();if(t.type,wa(t)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,wa(n)){if(n.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};function Ga(e){const t=e.toString();if(Ua.hasOwnProperty(t))return Ua[t];{const e=$a.pattern(t);return Ua[t]=e,e}}const Va="Complement Sets are not supported for first char optimization",Wa='Unable to use "first char" lexer optimizations:\n';function Ha(e,t=!1){try{const t=Ga(e);return ja(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===Va)t&&Ba(`${Wa}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),Pa(`${Wa}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function ja(e,t,n){switch(e.type){case"Disjunction":for(let r=0;r{if("number"==typeof e)za(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)za(e,t,n);else{for(let e=r.from;e<=r.to&&e=ul){const e=r.from>=ul?r.from:ul,n=r.to,i=hl(e),s=hl(n);for(let e=i;e<=s;e++)t[e]=e}}}});break;case"Group":ja(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}const o=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===Ka(s)||"Group"!==s.type&&!1===o)break}break;default:throw Error("non exhaustive match!")}return Object.values(t)}function za(e,t,n){const r=hl(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=hl(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=hl(e.charCodeAt(0));t[n]=n}}}(e,t)}function Xa(e,t){return e.value.find(e=>{if("number"==typeof e)return t.includes(e);{const n=e;return void 0!==t.find(e=>n.from<=e&&e<=n.to)}})}function Ka(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(Array.isArray(e.value)?e.value.every(Ka):Ka(e.value))}class Ya extends Ma{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e);case"Lookbehind":return void this.visitLookbehind(e);case"NegativeLookbehind":return void this.visitNegativeLookbehind(e)}super.visitChildren(e)}}visitCharacter(e){this.targetCharCodes.includes(e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===Xa(e,this.targetCharCodes)&&(this.found=!0):void 0!==Xa(e,this.targetCharCodes)&&(this.found=!0)}}function qa(e,t){if(t instanceof RegExp){const n=Ga(t),r=new Ya(e);return r.visit(n),r.found}for(const n of t){const t=n.charCodeAt(0);if(e.includes(t))return!0}return!1}const Qa="PATTERN",Za="defaultMode",Ja="modes";const el=/[^\\][$]/,tl=/[^\\[][\^]|^\^/;function nl(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function rl(e){const t=e.PATTERN;if(t instanceof RegExp)return!1;if("function"==typeof t)return!0;if(Object.hasOwn(t,"exec"))return!0;if("string"==typeof t)return!1;throw Error("non exhaustive match")}function il(e){return"string"==typeof e&&1===e.length&&e.charCodeAt(0)}const sl={test:function(e){const t=e.length;for(let n=this.lastIndex;n"string"==typeof e?e.charCodeAt(0):e)}function ll(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const ul=256;let cl=[];function hl(e){return ee.CATEGORIES).flat().filter(Boolean);const e=n.filter(e=>!t.includes(e));t=t.concat(e),0===e.length?r=!1:n=e}return t}(e);!function(e){e.forEach(e=>{var t;Cl(e)||(gl[ml]=e,e.tokenTypeIdx=ml++),Dl(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Dl(e)||(e.CATEGORIES=[]),t=e,Object.hasOwn(null!=t?t:{},"categoryMatches")||(e.categoryMatches=[]),function(e){return Object.hasOwn(null!=e?e:{},"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})})}(t),function(e){e.forEach(e=>{vl([],e)})}(t),function(e){e.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(t=>{e.categoryMatches.push(gl[t].tokenTypeIdx)})})}(t),t.forEach(e=>{e.isParent=e.categoryMatches.length>0})}function vl(e,t){e.forEach(e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),t.CATEGORIES.forEach(n=>{const r=e.concat(t);r.includes(n)||vl(r,n)})}function Cl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}function Dl(e){return Object.hasOwn(null!=e?e:{},"CATEGORIES")}function Sl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}var Al;!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"}(Al||(Al={}));const _l={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:{buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i,s)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`},traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(_l);class yl{constructor(e,t=_l){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=Object.assign({},_l,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===_l.lineTerminatorsPattern)this.config.lineTerminatorsPattern=sl;else if(this.config.lineTerminatorCharacters===_l.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Array.isArray(e)?n={modes:{defaultMode:[...e]},defaultMode:Za}:(r=!1,n=Object.assign({},e))}),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){const t=[];return Object.hasOwn(e,Za)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+Za+"> property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(e,Ja)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(e,Ja)&&Object.hasOwn(e,Za)&&!Object.hasOwn(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${Za}: <${e.defaultMode}>which does not exist\n`,type:Al.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(e,Ja)&&Object.keys(e.modes).forEach(n=>{const r=e.modes[n];r.forEach((e,i)=>{void 0===e?t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:Al.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(e,"LONGER_ALT")&&(Array.isArray(e.LONGER_ALT)?e.LONGER_ALT:[e.LONGER_ALT]).forEach(i=>{void 0===i||r.includes(i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${e.name}> outside of mode <${n}>\n`,type:Al.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(function(e,t,n){const r=[];let i=!1;const s=Object.values(e.modes||{}).flat().filter(Boolean).filter(e=>e[Qa]!==yl.NA),o=al(n);return t&&s.forEach(e=>{const t=ol(e,o);if(!1!==t){const n=function(e,t){if(t.issue===Al.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Al.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else Object.hasOwn(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):qa(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:Al.NO_LINE_BREAKS_FLAGS}),r}(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},Object.entries(n.modes).forEach(([e,t])=>{n.modes[e]=t.filter(e=>void 0!==e)});const i=Object.keys(n.modes);if(Object.entries(n.modes).forEach(([e,n])=>{this.TRACE_INIT(`Mode: <${e}> processing`,()=>{if(this.modes.push(e),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e,t){let n=[];const r=function(e){const t=e.filter(e=>!Object.hasOwn(e,Qa));return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:Al.MISSING_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(e);n=n.concat(r.errors);const i=function(e){const t=e.filter(e=>{const t=e[Qa];return!(t instanceof RegExp||"function"==typeof t||Object.hasOwn(t,"exec")||"string"==typeof t)});return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Al.INVALID_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=e.filter(e=>e[Qa]instanceof RegExp);return t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return el.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return tl.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){return e.filter(e=>{const t=e[Qa];return t instanceof RegExp&&(t.multiline||t.global)}).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Al.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){const t=[];let n=e.map(n=>e.reduce((e,r)=>(n.PATTERN.source!==r.PATTERN.source||t.includes(r)||r.PATTERN===yl.NA||(t.push(r),e.push(r)),e),[]));return n=n.filter(Boolean),n.filter(e=>e.length>1).map(e=>{const t=e.map(e=>e.name);return{message:`The same RegExp pattern ->${e[0].PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:Al.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}(n)),t=t.concat(function(e){return e.filter(e=>e.PATTERN.test("")).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:Al.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}(n)),t}(s)),n=n.concat(function(e){const t=e.filter(e=>{if(!Object.hasOwn(e,"GROUP"))return!1;const t=e.GROUP;return t!==yl.SKIPPED&&t!==yl.NA&&!("string"==typeof t)});return t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Al.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}(s)),n=n.concat(function(e,t){return e.filter(e=>void 0!==e.PUSH_MODE&&!t.includes(e.PUSH_MODE)).map(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:Al.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}(s,t)),n=n.concat(function(e){const t=[],n=e.reduce((e,t,n)=>{const r=t.PATTERN;return r===yl.NA||("string"==typeof r?e.push({str:r,idx:n,tokenType:t}):r instanceof RegExp&&(i=r,void 0===[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(e=>-1!==i.source.indexOf(e)))&&e.push({str:r.source,idx:n,tokenType:t})),e;var i},[]);return e.forEach((e,r)=>{n.forEach(({str:n,idx:i,tokenType:s})=>{if(r${s.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:Al.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}})}),t}(s)),n}(n,i))}),0===this.lexerDefinitionErrors.length){let r;El(n),this.TRACE_INIT("analyzeTokenTypes",()=>{r=function(e,t){const n=(t=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()},t)).tracer;let r;n("initCharCodeToOptimizedIndexMap",()=>{!function(){if(0===cl.length){cl=new Array(65536);for(let e=0;e<65536;e++)cl[e]=e>255?255+~~(e/255):e}}()}),n("Reject Lexer.NA",()=>{r=e.filter(e=>e[Qa]!==yl.NA)});let i,s,o,a,l,u,c,h,d,f,p,m=!1;n("Transform Patterns",()=>{m=!1,i=r.map(e=>{const t=e[Qa];if(t instanceof RegExp){const e=t.source;return 1!==e.length||"^"===e||"$"===e||"."===e||t.ignoreCase?2!==e.length||"\\"!==e[0]||["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(e[1])?nl(t):e[1]:e}if("function"==typeof t)return m=!0,{exec:t};if("object"==typeof t)return m=!0,t;if("string"==typeof t){if(1===t.length)return t;{const e=t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return nl(new RegExp(e))}}throw Error("non exhaustive match")})}),n("misc mapping",()=>{s=r.map(e=>e.tokenTypeIdx),o=r.map(e=>{const t=e.GROUP;if(t!==yl.SKIPPED){if("string"==typeof t)return t;if(void 0===t)return!1;throw Error("non exhaustive match")}}),a=r.map(e=>{const t=e.LONGER_ALT;if(t)return Array.isArray(t)?t.map(e=>r.indexOf(e)):[r.indexOf(t)]}),l=r.map(e=>e.PUSH_MODE),u=r.map(e=>Object.hasOwn(e,"POP_MODE"))}),n("Line Terminator Handling",()=>{const e=al(t.lineTerminatorCharacters);c=r.map(e=>!1),"onlyOffset"!==t.positionTracking&&(c=r.map(t=>Object.hasOwn(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===ol(t,e)&&qa(e,t.PATTERN)))}),n("Misc Mapping #2",()=>{h=r.map(rl),d=i.map(il),f=r.reduce((e,t)=>{const n=t.GROUP;return"string"==typeof n&&n!==yl.SKIPPED&&(e[n]=[]),e},{}),p=i.map((e,t)=>({pattern:i[t],longerAlt:a[t],canLineTerminator:c[t],isCustom:h[t],short:d[t],group:o[t],push:l[t],pop:u[t],tokenTypeIdx:s[t],tokenType:r[t]}))});let g=!0,E=[];return t.safeMode||n("First Char Optimization",()=>{E=r.reduce((e,n,r)=>{if("string"==typeof n.PATTERN){const t=hl(n.PATTERN.charCodeAt(0));ll(e,t,p[r])}else if(Array.isArray(n.START_CHARS_HINT)){let t;n.START_CHARS_HINT.forEach(n=>{const i=hl("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,ll(e,i,p[r]))})}else if(n.PATTERN instanceof RegExp)if(n.PATTERN.unicode)g=!1,t.ensureOptimizations&&Pa(`${Wa}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=Ha(n.PATTERN,t.ensureOptimizations);0===i.length&&(g=!1),i.forEach(t=>{ll(e,t,p[r])})}else t.ensureOptimizations&&Pa(`${Wa}\tTokenType: <${n.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return e},[])}),{emptyGroups:f,patternIdxToConfig:p,charCodeToPatternIdxToConfig:E,hasCustom:m,canBeOptimized:g}}(n,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[e]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[e]=r.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[e]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}this.lexerDefinitionWarning.forEach(e=>{Ba(e.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(r&&(this.handleModes=()=>{}),!1===this.trackStartLines&&(this.computeNewColumn=e=>e),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=()=>{}),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const e=Object.entries(this.canModeBeOptimized).reduce((e,[t,n])=>(!1===n&&e.push(t),e),[]);if(t.ensureOptimizations&&e.length>0)throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Ua={}}),this.TRACE_INIT("toFastProperties",()=>{na(this)})})}tokenize(e,t=this.defaultMode){if(this.lexerDefinitionErrors.length>0){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,s,o,a,l,u,c,h,d,f,p,m,g;const E=e,v=E.length;let C=0,D=0;const S=this.hasCustom?0:Math.floor(e.length/10),A=new Array(S),_=[];let y=this.trackStartLines?1:void 0,b=this.trackStartLines?1:void 0;const T=function(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(!Array.isArray(r))throw Error("non exhaustive match");t[n]=[]}),t}(this.emptyGroups),R=this.trackStartLines,x=this.config.lineTerminatorsPattern;let w=0,F=[],N=[];const L=[],O=[];Object.freeze(O);let I=!1;const k=e=>{if(1===L.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);_.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{L.pop();const e=L.at(-1);F=this.patternIdxToConfig[e],N=this.charCodeToPatternIdxToConfig[e],w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}};function M(e){L.push(e),N=this.charCodeToPatternIdxToConfig[e],F=this.patternIdxToConfig[e],w=F.length,w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}let P;M.call(this,t);const B=this.config.recoveryEnabled;for(;Ca.length){a=s,c=s.length,l=u,P=t;break}}}break}}if(-1!==c){if(h=P.group,void 0!==h&&(a=null!==a?a:e.substring(C,C+c),d=P.tokenTypeIdx,f=this.createTokenInstance(a,C,d,P.tokenType,y,b,c),this.handlePayload(f,l),!1===h?D=this.addToken(A,D,f):T[h].push(f)),!0===R&&!0===P.canLineTerminator){let t,n,r=0;x.lastIndex=0;do{a=null!==a?a:e.substring(C,C+c),t=x.test(a),!0===t&&(n=x.lastIndex-1,r++)}while(!0===t);0!==r?(y+=r,b=c-n,this.updateTokenEndLineColumnLocation(f,h,n,r,y,b,c)):b=this.computeNewColumn(b,c)}else b=this.computeNewColumn(b,c);C+=c,this.handleModes(P,k,M,f)}else{const t=C,n=y,i=b;let s=!1===B;for(;!1===s&&C`Expecting ${Tl(e)?`--\x3e ${bl(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o="\nbut found: '"+t[0].image+"'";return r?s+r+o:s+`one of these possible Token sequences:\n${e.reduce((e,t)=>e.concat(t),[]).map(e=>`[${e.map(e=>bl(e)).join(", ")}]`).map((e,t)=>` ${t+1}. ${e}`).join("\n")}`+o},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",s="\nbut found: '"+t[0].image+"'";return n?i+n+s:i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map(e=>`[${e.map(e=>bl(e)).join(",")}]`).join(" ,")}>`+s}};Object.freeze(Bl);const Ul={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},$l={buildDuplicateFoundError(e,t){const n=e.name,r=t[0],i=r.idx,s=va(r),o=(a=r)instanceof fa?a.terminalType.name:a instanceof ia?a.nonTerminalName:"";var a;let l=`->${s}${i>0?i:""}<- ${o?`with argument: ->${o}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,"\n"),l},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=e.prefixPath.map(e=>bl(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=0===e.alternation.idx?"":e.alternation.idx,n=0===e.prefixPath.length;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule,\n`;return r+=n?"These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n":`<${e.prefixPath.map(e=>bl(e)).join(", ")}> may appears as a prefix path in all these alternatives.\n`,r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=va(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${t} --\x3e ${e.leftRecursionPath.map(e=>e.name).concat([t]).join(" --\x3e ")}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof sa?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class Gl extends ga{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:rc.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Vl extends Ca{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){0===this.ruleStack.length?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Wl extends Vl{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const e=t.concat(n),r=new oa({definition:e});this.possibleTokTypes=Sa(r),this.found=!0}}}class Hl extends Ca{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class jl extends Hl{walkMany(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}}class zl extends Hl{walkManySep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}}class Xl extends Hl{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}}class Kl extends Hl{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}}function Yl(e,t,n=[]){n=[...n];let r=[],i=0;function s(s){const o=Yl(s.concat(e.slice(i+1)),t,n);return r.concat(o)}for(;n.length{0!==e.definition.length&&(r=s(e.definition))}),r;if(!(t instanceof fa))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:e.slice(i)}),r}function ql(e,t,n,r){const i=[...n];i.push(e.name);const s=[...r];return s.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:s}}var Ql;function Zl(e){if(e instanceof aa||"Option"===e)return Ql.OPTION;if(e instanceof ca||"Repetition"===e)return Ql.REPETITION;if(e instanceof la||"RepetitionMandatory"===e)return Ql.REPETITION_MANDATORY;if(e instanceof ua||"RepetitionMandatoryWithSeparator"===e)return Ql.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ha||"RepetitionWithSeparator"===e)return Ql.REPETITION_WITH_SEPARATOR;if(e instanceof da||"Alternation"===e)return Ql.ALTERNATION;throw Error("non exhaustive match")}function Jl(e,t,n,r){const i=e.length,s=e.every(e=>e.every(e=>1===e.length));if(t)return function(t){const r=t.map(e=>e.GATE);for(let t=0;te.flat()).reduce((e,t,n)=>(t.forEach(t=>{t.tokenTypeIdx in e||(e[t.tokenTypeIdx]=n),t.categoryMatches.forEach(t=>{Object.hasOwn(e,t)||(e[t]=n)})}),e),{});return function(){const e=this.LA_FAST(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t1===e.length),i=e.length;if(r&&!n){const t=e.flat();if(1===t.length&&0===t[0].categoryMatches.length){const e=t[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===e}}{const e=t.reduce((e,t,n)=>(e[t.tokenTypeIdx]=!0,t.categoryMatches.forEach(t=>{e[t]=!0}),e),[]);return function(){const t=this.LA_FAST(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;nYl([e],1)),r=ru(n.length),i=n.map(e=>{const t={};return e.forEach(e=>{iu(e.partialPath).forEach(e=>{t[e]=!0})}),t});let s=n;for(let e=1;e<=t;e++){const n=s;s=ru(n.length);for(let o=0;o{iu(e.partialPath).forEach(e=>{i[o][e]=!0})})}}}}return r}function au(e,t,n,r){const i=new nu(e,Ql.ALTERNATION,r);return t.accept(i),ou(i.result,n)}function lu(e,t,n,r){const i=new nu(e,n);t.accept(i);const s=i.result,o=new tu(t,e,n).startWalking();return ou([new oa({definition:s}),new oa({definition:o})],r)}function uu(e,t){e:for(let n=0;ne.every(e=>e.every(e=>0===e.categoryMatches.length)))}function hu(e){return`${va(e)}_#_${e.idx}_#_${du(e)}`}function du(e){return e instanceof fa?e.terminalType.name:e instanceof ia?e.nonTerminalName:""}class fu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function pu(e,t,n,r=[]){const i=[],s=mu(t.definition);if(0===s.length)return[];{const t=e.name;s.includes(e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:rc.LEFT_RECURSION,ruleName:t});const o=r.concat([e]),a=s.filter(e=>!o.includes(e)).flatMap(t=>{const i=[...r];return i.push(t),pu(e,t,n,i)});return i.concat(a)}}function mu(e){let t=[];if(0===e.length)return t;const n=e[0];if(n instanceof ia)t.push(n.referencedRule);else if(n instanceof oa||n instanceof aa||n instanceof la||n instanceof ua||n instanceof ha||n instanceof ca)t=t.concat(mu(n.definition));else if(n instanceof da)t=n.definition.map(e=>mu(e.definition)).flat();else if(!(n instanceof fa))throw Error("non exhaustive match");const r=Ea(n),i=e.length>1;if(r&&i){const n=e.slice(1);return t.concat(mu(n))}return t}class gu extends ga{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}class Eu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}const vu="MismatchedTokenException",Cu="NoViableAltException",Du="EarlyExitException",Su="NotAllInputParsedException",Au=[vu,Cu,Du,Su];function _u(e){return Au.includes(e.name)}Object.freeze(Au);class yu extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class bu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=vu}}class Tu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Cu}}class Ru extends yu{constructor(e,t){super(e,t),this.name=Su}}class xu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Du}}const wu={},Fu="InRuleRecoveryException";class Nu extends Error{constructor(e){super(e),this.name=Fu}}function Lu(e,t,n,r,i,s,o){const a=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[a];if(void 0===l){const e=this.getCurrRuleFullName();l=new s(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[a]=l}let u=l.token,c=l.occurrence;const h=l.isEndOfRule;0===this.RULE_STACK_IDX&&h&&void 0===u&&(u=Ml,c=1),void 0!==u&&void 0!==c&&this.shouldInRepetitionRecoveryBeTried(u,c,o)&&this.tryInRepetitionRecovery(e,t,n,u)}const Ou=1024,Iu=1280,ku=1536;function Mu(e,t,n){return n|t|e}class Pu{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:tc.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(0===t.length){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return e.flatMap(e=>pu(e,e,$l))}validateEmptyOrAlternatives(e){return e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.slice(0,-1).flatMap((r,i)=>0===function(e,t,n){const r="EXIT_NONE_TERMINAL",i=[r],s="EXIT_ALTERNATIVE";let o=!1;const a=t.length,l=a-1-1,u=[],c=[];for(c.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});0!==c.length;){const e=c.pop();if(e===s){o&&c.at(-1).idx<=l&&c.pop();continue}const h=e.def,d=e.idx,f=e.ruleStack,p=e.occurrenceStack;if(0===h.length)continue;const m=h[0];if(m===r){const e={idx:d,def:h.slice(1),ruleStack:f.slice(0,-1),occurrenceStack:p.slice(0,-1)};c.push(e)}else if(m instanceof fa)if(d=0;e--){const t={idx:d,def:m.definition[e].definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p};c.push(t),c.push(s)}else if(m instanceof oa)c.push({idx:d,def:m.definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p});else{if(!(m instanceof sa))throw Error("non exhaustive match");c.push(ql(m,d,f,p))}}return u}([r],[],fl).length?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:rc.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}(e,$l))}validateAmbiguousAlternationAlternatives(e,t){return e.flatMap(e=>function(e,t,n){const r=new gu;e.accept(r);let i=r.alternations;i=i.filter(e=>!0!==e.ignoreAmbiguities);return i.flatMap(r=>{const i=r.idx,s=r.maxLookahead||t,o=au(i,e,s,r),a=function(e,t,n,r){const i=[];return e.reduce((n,r,s)=>(!0===t.definition[s].ignoreAmbiguities||r.forEach(r=>{const o=[s];e.forEach((e,n)=>{s!==n&&uu(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&o.push(n)}),o.length>1&&!uu(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]).map(e=>{const i=e.alts.map(e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}(o,r,e,n),l=function(e,t,n,r){const i=e.reduce((e,t,n)=>{const r=t.map(e=>({idx:n,path:e}));return e.concat(r)},[]);return i.flatMap(e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const s=e.idx,o=e.path;return i.filter(e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx{const n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}));var n,r}).map(e=>{const i=[e.idx+1,s+1],o=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})})}(o,r,e,n);return a.concat(l)})}(e,t,$l))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return e.forEach(e=>{const i=new Eu;e.accept(i),i.allProductions.forEach(i=>{const s=Zl(i),o=i.maxLookahead||t;if(0===lu(i.idx,e,s,o)[0].flat().length){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:rc.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}(e,t,$l)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,s){const o=au(e,t,n);return s(o,r,cu(o)?pl:fl,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Jl)}buildLookaheadForOptional(e){return function(e,t,n,r,i,s){const o=lu(e,t,i,n),a=cu(o)?pl:fl;return s(o[0],a,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Zl(e.prodType),eu)}}const Bu=new class extends ga{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function Uu(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset"function"==typeof e.GATE);return s.hasPredicates=o,n.definition.push(s),i.forEach(e=>{const t=new oa({definition:[]});s.definition.push(t),Object.hasOwn(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Object.hasOwn(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),Hu}function Zu(e){return 0===e?"":`${e}`}function Ju(e){if(e<0||e>zu){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${zu+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const ec=Pl(Ml,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ec);const tc=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Bl,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),nc=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var rc,ic,sc;!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(rc||(rc={}));class oc{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",()=>{na(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=function(e){const t=Object.assign({errMsgProvider:Ul},e),n={};return e.rules.forEach(e=>{n[e.name]=e}),function(e,t){const n=new Gl(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(0===n.length&&!1===this.skipValidations){const e=function(e){var t;const n=null!==(t=e.errMsgProvider)&&void 0!==t?t:$l;return function(e,t,n,r){const i=e.flatMap(e=>function(e,t){const n=new fu;e.accept(n);const r=n.allProductions,i=Object.groupBy(r,hu),s=Object.fromEntries(Object.entries(i).filter(([e,t])=>t.length>1));return Object.values(s).map(n=>{const r=n[0],i=t.buildDuplicateFoundError(e,n),s=va(r),o={message:i,type:rc.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:s,occurrence:r.idx},a=du(r);return a&&(o.parameter=a),o})}(e,n)),s=function(e,t,n){const r=[],i=t.map(e=>e.name);return e.forEach(e=>{const t=e.name;if(i.includes(t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:rc.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}(e,t,n),o=e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:rc.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}(e,n)),a=e.flatMap(t=>function(e,t,n,r){const i=[],s=t.reduce((t,n)=>n.name===e.name?t+1:t,0);if(s>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:rc.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n));return i.concat(s,o,a)}(e.rules,e.tokenTypes,n,e.grammarName)}({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:$l,grammarName:t}),n=function(e){return e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}).map(e=>Object.assign({type:rc.CUSTOM_LOOKAHEAD_VALIDATION},e))}({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(e,n)}}),0===this.definitionErrors.length&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const e=function(e){const t={};return e.forEach(e=>{const n=new _a(e).startWalking();Object.assign(t,n)}),t}(Object.values(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!oc.DEFER_DEFINITION_ERRORS_HANDLING&&0!==this.definitionErrors.length)throw e=this.definitionErrors.map(e=>e.message),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initGastRecorder(t),n.initPerformanceTracer(t),Object.hasOwn(t,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=Object.hasOwn(t,"skipValidations")?t.skipValidations:tc.skipValidations}}oc.DEFER_DEFINITION_ERRORS_HANDLING=!1,ic=oc,sc=[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:tc.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Lu)}getTokenToInsert(e){const t=Pl(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let a=!1;const l=this.LA_FAST(1);let u=this.LA_FAST(1);const c=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),n=new bu(t,l,this.LA(0));n.resyncedTokens=o.slice(0,-1),this.SAVE_ERROR(n)};for(;!a;){if(this.tokenMatcher(u,r))return void c();if(n.call(this))return c(),void e.apply(this,t);this.tokenMatcher(u,i)?a=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o))}this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA_FAST(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getNextPossibleTokenTypes(e){const t=e.ruleStack[0],n=this.getGAstProductions()[t];return new Wl(n,e).startWalking()}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new Nu("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(0===t.length)return!1;const n=this.LA_FAST(1);return void 0!==t.find(e=>this.tokenMatcher(n,e))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(t).includes(e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA_FAST(1),n=2;for(;;){const r=e.find(e=>fl(t,e));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(0===this.RULE_STACK_IDX)return wu;const e=this.currRuleShortName,t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK,n=this.RULE_STACK_IDX+1,r=new Array(n);for(let i=0;ithis.getFollowSetFromFollowKey(e)).flat()}getFollowSetFromFollowKey(e){if(e===wu)return[Ml];const t=e.ruleName+e.idxInCallingRule+Aa+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Ml)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA_FAST(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return t.slice(0,-1)}attemptInRepetitionRecovery(e,t,n,r,i,s,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){const e=this.RULE_STACK_IDX+1,t=new Array(e);for(let n=0;n{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:o}=function(e){Bu.reset(),e.accept(Bu);const t=Bu.dslMethods;return Bu.reset(),t}(e);t.forEach(t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${va(t)}${n}`,()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=Mu(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),n.forEach(t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,va(t))}),r.forEach(t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,va(t))}),i.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Ou,"RepetitionMandatory",t.maxLookahead,va(t))}),s.forEach(t=>{this.computeLookaheadFunc(e,t.idx,ku,"RepetitionMandatoryWithSeparator",t.maxLookahead,va(t))}),o.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Iu,"RepetitionWithSeparator",t.maxLookahead,va(t))})})})}computeLookaheadFunc(e,t,n,r,i,s){this.TRACE_INIT(`${s}${0===t?"":t}`,()=>{const s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=Mu(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,s)})}getKeyForAutomaticLookahead(e,t){return Mu(this.currRuleShortName,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:tc.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=$u,this.setNodeLocationFromNode=$u,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Uu,this.setNodeLocationFromNode=Uu,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{}}else this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{}}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA_FAST(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];var r,i,s;i=t,s=e,void 0===(r=n).children[s]?r.children[s]=[i]:r.children[s].push(i),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(void 0===this.baseCstVisitorConstructor){const e=function(e,t){const n=function(){};Gu(n,e+"BaseSemantics");const r={visit:function(e,t){if(Array.isArray(e)&&(e=e[0]),void 0!==e)return this[e.name](e.children,t)},validateVisitor:function(){const e=function(e,t){const n=function(e,t){return t.filter(t=>"function"==typeof e[t]==0).map(t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Wu.MISSING_METHOD,methodName:t})).filter(Boolean)}(e,t);return n}(this,t);if(0!==e.length){const t=e.map(e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(void 0===this.baseCstVisitorWithDefaultsConstructor){const e=function(e,t,n){const r=function(){};Gu(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return t.forEach(e=>{i[e]=Vu}),(r.prototype=i).constructor=r,r}(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):ec}LA_FAST(e){const t=this.currIdx+e;return this.tokVector[t]}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?ec:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=pl,this.subruleIdx=0,this.currRuleShortName=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(Array.isArray(e)){if(0===e.length)throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(Array.isArray(e))this.tokensMap=e.reduce((e,t)=>(e[t.name]=t,e),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(Sl)){const t=Object.values(e.modes).flat(),n=[...new Set(t)];this.tokensMap=n.reduce((e,t)=>(e[t.name]=t,e),{})}else{if("object"!=typeof e||null===e)throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=Object.assign({},e)}this.tokensMap.EOF=Ml;const n=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every(e=>{var t;return 0==(null===(t=e.categoryMatches)||void 0===t?void 0:t.length)});this.tokenMatcher=n?pl:fl,El(Object.values(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:nc.resyncEnabled,i=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:nc.recoveryValueFunc,s=this.ruleShortNameIdx<<12;let o;return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,o=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...t){this.onBeforeParse(e);try{return o.apply(this,t)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:t,coreRule:o})}invokeRuleCatch(e,t,n){const r=0===this.RULE_STACK_IDX,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(_u(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(Ou,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,Ou,e,Xl)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(ku,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Kl],t,ku,e,Kl)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let s=!0;for(;!0===i.call(this)&&!0===s;)s=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,jl,s)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(Iu,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,zl],t,Iu,e,zl)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,ku,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=Array.isArray(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX]),this.cstFinallyStateUpdate()}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.coreRule.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw _u(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA_FAST(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new bu(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===Fu?n:e}}}saveRecogState(){const e=this.errors,t=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);const t=e.RULE_STACK;for(let e=0;e=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX])}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=n,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ml)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let e=0;e${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:rc.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){var n;const r=null!==(n=e.coreRule)&&void 0!==n?n:e;return function(){this.isBackTrackingStack.push(1);const e=this.saveRecogState();try{return r.apply(this,t),!0}catch(e){if(_u(e))return!1;throw e}finally{this.reloadRecogState(e),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Object.values(this.gastProductionsCache).map(pa)}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:tc.errorMessageProvider}SAVE_ERROR(e){if(_u(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=lu(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],s=[];for(let e=1;e<=this.maxLookahead;e++)s.push(this.LA(e));const o=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:s,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new xu(o,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=au(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));const s=this.LA(0),o=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:s,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Tu(o,this.LA(1),s))}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const n=t>0?t:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return ec}topLevelRuleRecord(e,t){try{const n=new sa({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}}optionInternalRecord(e,t){return qu.call(this,aa,e,t)}atLeastOneInternalRecord(e,t){qu.call(this,la,t,e)}atLeastOneSepFirstInternalRecord(e,t){qu.call(this,ua,t,e,ju)}manyInternalRecord(e,t){qu.call(this,ca,t,e)}manySepFirstInternalRecord(e,t){qu.call(this,ha,t,e,ju)}orInternalRecord(e,t){return Qu.call(this,e,t)}subruleInternalRecord(e,t,n){if(Ju(t),!e||!Object.hasOwn(e,"ruleName")){const n=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=e.ruleName,s=new ia({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(s),this.outputCst?Yu:Hu}consumeInternalRecord(e,t,n){if(Ju(t),!Cl(e)){const n=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=new fa({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),Ku}},class{initPerformanceTracer(e){if(Object.hasOwn(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=tc.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()}}],sc.forEach(e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach(n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(ic.prototype,n,r):ic.prototype[n]=e.prototype[n]})});class ac extends oc{constructor(e,t=tc){const n=Object.assign({},t);n.outputCst=!1,super(e,n)}}function lc(e){return void 0!==e.lineNoCont?e.lineNoCont:e.startLine}class uc{visit(e){return e&&this[e.kind](e)}arraySpecifier(e){this.visit(e.size)}binaryExpression(e){this.visit(e.lhs),this.visit(e.rhs)}methodCall(e){this.visit(e.on),this.visit(e.functionCall)}functionCall(e){this.visit(e.callee);for(const t of e.args)this.visit(t)}arrayAccess(e){this.visit(e.on),this.visit(e.index)}translationUnit(e){for(const t of e.declarations)this.visit(t)}assignmentExpression(e){this.visit(e.lhs),this.visit(e.rhs)}fieldAccess(e){this.visit(e.on)}conditionalExpression(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}postfixExpression(e){this.visit(e.on)}commaExpression(e){this.visit(e.lhs),this.visit(e.rhs)}unaryExpression(e){this.visit(e.on)}functionDefinition(e){this.visit(e.returnType);for(const t of e.params)this.visit(t);this.visit(e.body)}functionPrototype(e){this.visit(e.returnType);for(const t of e.params)this.visit(t)}parameterDeclaration(e){this.visit(e.arraySpecifier),this.visit(e.typeSpecifier)}typeSpecifier(e){hc(e.typeSpecifierNonArray)&&this.visit(e.typeSpecifierNonArray),this.visit(e.arraySpecifier)}compoundStatement(e){for(const t of e.statements)this.visit(t)}returnStatement(e){this.visit(e.what)}continueStatement(e){}breakStatement(e){}discardStatement(e){}declarator(e){this.visit(e.arraySpecifier),this.visit(e.init)}doWhileStatement(e){this.visit(e.statement),this.visit(e.conditionExpression)}whileStatement(e){this.visit(e.conditionExpression),this.visit(e.statement)}forStatement(e){this.visit(e.initExpression),this.visit(e.conditionExpression),this.visit(e.loopExpression),this.visit(e.statement)}expressionStatement(e){this.visit(e.expression)}initDeclaratorListDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}precisionDeclaration(e){this.visit(e.typeSpecifierNoPrec)}selectionStatement(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}storageQualifier(e){}switchStatement(e){this.visit(e.initExpression);for(const t of e.cases)this.visit(t)}caseLabel(e){this.visit(e.case_)}caseBlock(e){this.visit(e.caseLabel);for(const t of e.statements)this.visit(t)}fullySpecifiedType(e){this.visit(e.typeQualifier),this.visit(e.typeSpecifier)}typeQualifier(e){this.visit(e.storageQualifier),this.visit(e.layoutQualifier)}structSpecifier(e){for(const t of e.declarations)this.visit(t)}layoutQualifier(e){}invariantDeclaration(e){}structDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}variableExpression(e){}constantExpression(e){}uniformBlock(e){this.visit(e.typeQualifier);for(const t of e.declarations)this.visit(t);this.visit(e.arraySpecifier)}ppDefine(e){this.visit(e.node)}ppDir(e){}ppExtension(e){}ppCall(e){}ppPragma(e){}}function cc(e){return"tokenType"in e}function hc(e){return"kind"in e}function dc(e,t){const n=e.split("\n"),r=t.startLine,i=t.endLine;return"./src/compiler.lambda:"+r+":"+(t.startColumn-1)+"\n"+n.map((e,t)=>[t+1,e]).slice(r-2,i+2).map(([e,n])=>{var s,o,a;return e>=r&&e<=i&&(s=n,o=6+(r===e?t.startColumn-1:0),a=6+(i===e?t.endColumn:n.length),n=s+"\n"+"-".repeat(o)+"^".repeat(a-o)),(""+e).padStart(5)+" "+n}).join("\n")}const fc=["active","asm","atomic_uint","attribute","cast","class","coherent","common","double","dvec2","dvec3","dvec4","enum","extern","external","filter","fixed","fvec2","fvec3","fvec4","goto","half","hvec2","hvec3","hvec4","iimage1D","iimage1DArray","iimage2D","iimage2DArray","iimage3D","iimageBuffer","iimageCube","image1D","image1DArray","image2D","image2DArray","image3D","imageBuffer","imageCube","inline","input","interface","isampler1D","isampler1DArray","isampler2DMS","isampler2DMSArray","isampler2DRect","isamplerBuffer","long","namespace","noinline","noperspective","output","partition","patch","public","readonly","resource","restrict","sample","sampler1D","sampler1DArray","sampler1DArrayShadow","sampler1DShadow","sampler2DMS","sampler2DMSArray","sampler2DRect","sampler2DRectShadow","sampler3DRect","samplerBuffer","short","sizeof","static","subroutine","superp","template","this","typedef","uimage1D","uimage1DArray","uimage2D","uimage2DArray","uimage3D","uimageBuffer","uimageCube","union","unsigned","usampler1D","usampler1DArray","usampler2DMS","usampler2DMSArray","usampler2DRect","usamplerBuffer","using","volatile","volatile","writeonly"];var pc;!function(e){e.ASSIGN_OP=kl({name:"ASSIGN_OP",pattern:yl.NA}),e.UNARY_OP=kl({name:"UNARY_OP",pattern:yl.NA}),e.POSTFIX_OP=kl({name:"POSTFIX_OP",pattern:yl.NA}),e.PRECISION_QUALIFIER=kl({name:"PRECISION_QUALIFIER",pattern:yl.NA}),e.INTERPOLATION_QUALIFIER=kl({name:"INTERPOLATION_QUALIFIER",pattern:yl.NA}),e.MULTIPLICATIVE_OP=kl({name:"MULTIPLICATIVE_OP",pattern:yl.NA}),e.ADDITIVE_OP=kl({name:"ADDITIVE_OP",pattern:yl.NA}),e.SHIFT_OP=kl({name:"SHIFT_OP",pattern:yl.NA}),e.RELATIONAL_OP=kl({name:"RELATIONAL_OP",pattern:yl.NA}),e.EQUALITY_OP=kl({name:"EQUALITY_OP",pattern:yl.NA}),e.PARAMETER_QUALIFIER=kl({name:"PARAMETER_QUALIFIER",pattern:yl.NA}),e.WHITESPACE=kl({name:"WHITESPACE",pattern:/\s+/,group:yl.SKIPPED}),e.LINE_COMMENT=kl({name:"LINE_COMMENT",pattern:/\/\/[^\r\n]*/,group:"COMMENTS"}),e.MULTILINE_COMMENT=kl({name:"MULTILINE_COMMENT",pattern:/\/\*[\s\S]*?\*\//,group:"COMMENTS"}),e.MULASSIGN=kl({name:"MULASSIGN",pattern:"*=",label:"'*='",categories:e.ASSIGN_OP}),e.DIVASSIGN=kl({name:"DIVASSIGN",pattern:"/=",label:"'/='",categories:e.ASSIGN_OP}),e.MODASSIGN=kl({name:"MODASSIGN",pattern:"%=",label:"'%='",categories:e.ASSIGN_OP}),e.ADDASSIGN=kl({name:"ADDASSIGN",pattern:"+=",label:"'+='",categories:e.ASSIGN_OP}),e.SUBASSIGN=kl({name:"SUBASSIGN",pattern:"-=",label:"'-='",categories:e.ASSIGN_OP}),e.LEFTASSIGN=kl({name:"LEFTASSIGN",pattern:"<<=",label:"'<<='",categories:e.ASSIGN_OP}),e.RIGHTASSIGN=kl({name:"RIGHTASSIGN",pattern:">>=",label:"'>>='",categories:e.ASSIGN_OP}),e.ANDASSIGN=kl({name:"ANDASSIGN",pattern:"&=",label:"'&='",categories:e.ASSIGN_OP}),e.XORASSIGN=kl({name:"XORASSIGN",pattern:"^=",label:"'^='",categories:e.ASSIGN_OP}),e.ORASSIGN=kl({name:"ORASSIGN",pattern:"|=",label:"'|='",categories:e.ASSIGN_OP}),e.INC_OP=kl({name:"INC_OP",pattern:"++",label:"'++'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.QUESTION=kl({name:"QUESTION",pattern:"?",label:"'?'"}),e.COLON=kl({name:"COLON",pattern:":",label:"':'"}),e.DEC_OP=kl({name:"DEC_OP",pattern:"--",label:"'--'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.AND_OP=kl({name:"AND_OP",pattern:"&&",label:"'&&'"}),e.XOR_OP=kl({name:"XOR_OP",pattern:"^^",label:"'^^'"}),e.OR_OP=kl({name:"OR_OP",pattern:"||",label:"'||'"}),e.LEFT_OP=kl({name:"LEFT_OP",pattern:"<<",label:"'<<'",categories:e.SHIFT_OP}),e.RIGHT_OP=kl({name:"RIGHT_OP",pattern:">>",label:"'>>'",categories:e.SHIFT_OP}),e.EQ_OP=kl({name:"EQ_OP",pattern:"==",label:"'=='",categories:e.EQUALITY_OP}),e.NE_OP=kl({name:"NE_OP",pattern:"!=",label:"'!='",categories:e.EQUALITY_OP}),e.LE_OP=kl({name:"LE_OP",pattern:"<=",label:"'<='",categories:e.RELATIONAL_OP}),e.GE_OP=kl({name:"GE_OP",pattern:">=",label:"'>='",categories:e.RELATIONAL_OP}),e.LEFT_ANGLE=kl({name:"LEFT_ANGLE",pattern:"<",label:"'<'",categories:e.RELATIONAL_OP}),e.RIGHT_ANGLE=kl({name:"RIGHT_ANGLE",pattern:">",label:"'>'",categories:e.RELATIONAL_OP}),e.PLUS=kl({name:"PLUS",pattern:"+",label:"'+'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.TILDE=kl({name:"TILDE",pattern:"~",label:"'~'",categories:e.UNARY_OP}),e.BANG=kl({name:"BANG",pattern:"!",label:"'!'",categories:e.UNARY_OP}),e.CARET=kl({name:"CARET",pattern:"^",label:"'^'"}),e.AMPERSAND=kl({name:"AND",pattern:"&",label:"'&'"}),e.VERTICAL_BAR=kl({name:"VERTICAL_BAR",pattern:"|",label:"'|'"}),e.SLASH=kl({name:"SLASH",pattern:"/",label:"'/'",categories:e.MULTIPLICATIVE_OP}),e.PERCENT=kl({name:"PERCENT",pattern:"%",label:"'%'",categories:e.MULTIPLICATIVE_OP}),e.STAR=kl({name:"STAR",pattern:"*",label:"'*'",categories:e.MULTIPLICATIVE_OP}),e.DASH=kl({name:"DASH",pattern:"-",label:"'-'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.COMMA=kl({name:"COMMA",pattern:",",label:"','"}),e.EQUAL=kl({name:"EQUAL",pattern:"=",label:"'='",categories:e.ASSIGN_OP}),e.LEFT_PAREN=kl({name:"LEFT_PAREN",pattern:"(",label:"'('"}),e.RIGHT_PAREN=kl({name:"RIGHT_PAREN",pattern:")",label:"')'"}),e.LEFT_BRACKET=kl({name:"LEFT_BRACKET",pattern:"[",label:"'['"}),e.RIGHT_BRACKET=kl({name:"RIGHT_BRACKET",pattern:"]",label:"']'"}),e.LEFT_BRACE=kl({name:"LEFT_BRACE",pattern:"{",label:"'{'"}),e.RIGHT_BRACE=kl({name:"RIGHT_BRACE",pattern:"}",label:"'}'"}),e.SEMICOLON=kl({name:"SEMICOLON",pattern:";",label:"';'"}),e.IDENTIFIER=kl({name:"IDENTIFIER",pattern:yl.NA}),e.NON_PP_IDENTIFIER=kl({name:"NON_PP_IDENTIFIER",pattern:/[a-z_]\w*/i,categories:e.IDENTIFIER}),e.PP=kl({name:"PP",pattern:yl.NA,categories:e.IDENTIFIER});const t=(t,n)=>kl({name:t,pattern:n,categories:e.PP,longer_alt:e.NON_PP_IDENTIFIER});e.DEFINE=t("DEFINE","define"),e.UNDEF=t("UNDEF","undef"),e.ENDIF=t("ENDIF","endif"),e.IFDEF=t("IFDEF","ifdef"),e.IFNDEF=t("IFNDEF","ifndef"),e.ELIF=t("ELIF","elif"),e.ERROR=t("ERROR","error"),e.VERSION=t("VERSION","version"),e.PRAGMA_DIRECTIVE=kl({name:"PRAGMA_DIRECTIVE",pattern:/#\s*pragma\s+[^\r\n]*/}),e.LINE=t("LINE","line"),e.EXTENSION=t("EXTENSION","extension"),e.INCLUDE=t("INCLUDE","include"),e.HASH_INCLUDE_MODULE=kl({name:"HASH_INCLUDE_MODULE",pattern:/#\s*include\s*<[\w\-./\\$@ ]+>/}),e.HASH=kl({name:"HASH",pattern:"#"}),e.KEYWORD=kl({name:"KEYWORD",pattern:yl.NA});const n=(t,n)=>kl({name:t,pattern:t.toLowerCase(),label:"'"+t.toLowerCase()+"'",longer_alt:e.NON_PP_IDENTIFIER,categories:n?[e.KEYWORD,n]:e.KEYWORD});e.CONST=n("CONST"),e.UNIFORM=n("UNIFORM"),e.LAYOUT=n("LAYOUT"),e.CENTROID=n("CENTROID"),e.FLAT=n("FLAT",e.INTERPOLATION_QUALIFIER),e.SMOOTH=n("SMOOTH",e.INTERPOLATION_QUALIFIER),e.BREAK=n("BREAK"),e.CONTINUE=n("CONTINUE"),e.DO=n("DO"),e.PRECISION=n("PRECISION"),e.FOR=n("FOR"),e.WHILE=n("WHILE"),e.SWITCH=n("SWITCH"),e.CASE=n("CASE"),e.DEFAULT=n("DEFAULT"),e.IF=n("IF"),e.ELSE=n("ELSE"),e.INVARIANT=n("INVARIANT"),e.INOUT=n("INOUT",e.PARAMETER_QUALIFIER),e.OUT=n("OUT",e.PARAMETER_QUALIFIER),e.VOID=n("VOID"),e.STRUCT=n("STRUCT"),e.DISCARD=n("DISCARD"),e.RETURN=n("RETURN"),e.LOWP=n("LOWP",e.PRECISION_QUALIFIER),e.MEDIUMP=n("MEDIUMP",e.PRECISION_QUALIFIER),e.HIGHP=n("HIGHP",e.PRECISION_QUALIFIER),e.CONSTANT=kl({name:"CONSTANT",pattern:yl.NA}),e.BASIC_TYPE=kl({name:"BASIC_TYPE",pattern:yl.NA});const r=t=>kl({name:t.toUpperCase(),pattern:t,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE});e.BOOL=r("bool"),e.INT=r("int"),e.FLOAT=r("float"),e.MAT2X3=r("mat2x3"),e.MAT2X4=r("mat2x4"),e.MAT2X2=kl({name:"mat2x2".toUpperCase(),pattern:/mat2(?:x2)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat2"}),e.MAT3X2=r("mat3x2"),e.MAT3X4=r("mat3x4"),e.MAT3X3=kl({name:"mat3x3".toUpperCase(),pattern:/mat3(?:x3)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat3"}),e.MAT4X2=r("mat4x2"),e.MAT4X3=r("mat4x3"),e.MAT4X4=kl({name:"MAT4X4",pattern:/mat4(?:x4)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat4"}),e.VEC2=r("vec2"),e.VEC3=r("vec3"),e.VEC4=r("vec4"),e.IVEC2=r("ivec2"),e.IVEC3=r("ivec3"),e.IVEC4=r("ivec4"),e.BVEC2=r("bvec2"),e.BVEC3=r("bvec3"),e.BVEC4=r("bvec4"),e.UINT=r("uint"),e.UVEC2=r("uvec2"),e.UVEC3=r("uvec3"),e.UVEC4=r("uvec4"),e.USAMPLERCUBE=r("usamplerCube"),e.USAMPLER3D=r("usampler3D"),e.USAMPLER2DARRAY=r("usampler2DArray"),e.USAMPLER2D=r("usampler2D"),e.SAMPLERCUBESHADOW=r("samplerCubeShadow"),e.SAMPLERCUBE=r("samplerCube"),e.SAMPLER3D=r("sampler3D"),e.SAMPLER2DSHADOW=r("sampler2DShadow"),e.SAMPLER2DARRAYSHADOW=r("sampler2DArrayShadow"),e.SAMPLER2DARRAY=r("sampler2DArray"),e.SAMPLER2D=r("sampler2D"),e.ISAMPLERCUBE=r("isamplerCube"),e.ISAMPLER3D=r("isampler3D"),e.ISAMPLER2DARRAY=r("isampler2DArray"),e.ISAMPLER2D=r("isampler2D"),e.IN=n("IN",e.PARAMETER_QUALIFIER),e.VARYING=n("VARYING"),e.ATTRIBUTE=n("ATTRIBUTE"),e.BOOLCONSTANT=kl({name:"BOOLCONSTANT",pattern:/true|false/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.CONSTANT}),e.FLOATCONSTANT=kl({name:"FLOATCONSTANT",pattern:/((\d+\.\d*|\.\d+)(e[+-]?\d+)?|\d+e[+-]?\d+)f?/i,categories:e.CONSTANT}),e.DOT=kl({name:"DOT",pattern:".",label:"'.'"}),e.UINTCONSTANT=kl({name:"UINTCONSTANT",pattern:/0x[\da-f]+u|\d+u/i,categories:e.CONSTANT}),e.INTCONSTANT=kl({name:"INTCONSTANT",pattern:/0x[\da-f]+|\d+/i,categories:e.CONSTANT}),e.STRING=kl({name:"STRING",pattern:/"([^"\\]+|\\")+"/})}(pc||(pc={}));const mc=Object.values(pc).filter(e=>e!==pc.NON_PP_IDENTIFIER).flatMap(e=>Array.isArray(e)?e:[e]);mc.push(pc.NON_PP_IDENTIFIER);const gc=new yl(mc,{ensureOptimizations:!1});new class extends uc{constructor(){super(...arguments),this.markError=()=>{}}eval(e,t,n){return this.isDefined=t,this.markError=n,super.visit(e)}constantExpression(e){if(e.const_.tokenType!==pc.INTCONSTANT)throw new Error("XX");return+e.const_.image}unaryExpression(e){switch(e.op.tokenType){case pc.NON_PP_IDENTIFIER:return+this.isDefined(e.on.var.image);case pc.DASH:return-this.visit(e.on);case pc.TILDE:return~this.visit(e.on);case pc.BANG:return+!this.visit(e.on);case pc.PLUS:return this.visit(e.on);default:throw new Error(e.op.tokenType.name)}}binaryExpression(e){const t=this.visit(e.lhs);switch(e.op.tokenType){case pc.AND_OP:return t&&this.visit(e.rhs);case pc.OR_OP:return t||this.visit(e.rhs);default:{const n=this.visit(e.rhs);return 0|function(e,t,n){switch(e){case pc.PLUS:return t+n;case pc.DASH:return t-n;case pc.STAR:return t*n;case pc.PERCENT:return t%n;case pc.SLASH:return t/n;case pc.LEFT_OP:return t<>n;case pc.EQ_OP:return t===n;case pc.NE_OP:return t!==n;case pc.LE_OP:return t<=n;case pc.GE_OP:return t>=n;case pc.LEFT_ANGLE:return tn;case pc.XOR_OP:return t!==n;case pc.AND_OP:return t&&n;case pc.OR_OP:return t||n;case pc.AMPERSAND:return t&n;case pc.CARET:return t^n;case pc.VERTICAL_BAR:return t|n;default:throw new Error}}(e.op.tokenType,t,n)}}}variableExpression(e){return this.markError("P0001",e.var,"undefined identifier "+e.var.image),0}};const Ec=new class extends ac{getTokensOnLine(){const e=[],t=lc(this.LA(0));let n;for(;lc(n=this.LA(1))===t;)e.push(n),this.SKIP_TOKEN();return e}constructor(){super(mc,{skipValidations:!0}),this.multiplicativeExpression=this.RR("multiplicativeExpression",()=>this.LEFT_ASSOC(this.preprocessing?this.ppUnaryExpression:this.unaryExpression,pc.MULTIPLICATIVE_OP)),this.additiveExpression=this.RR("additiveExpression",()=>this.LEFT_ASSOC(this.multiplicativeExpression,pc.ADDITIVE_OP)),this.shiftExpression=this.RR("shiftExpression",()=>this.LEFT_ASSOC(this.additiveExpression,pc.SHIFT_OP)),this.relationalExpression=this.RR("relationalExpression",()=>this.LEFT_ASSOC(this.shiftExpression,pc.RELATIONAL_OP)),this.equalityExpression=this.RR("equalityExpression",()=>this.LEFT_ASSOC(this.relationalExpression,pc.EQUALITY_OP)),this.andExpression=this.RR("andExpression",()=>this.LEFT_ASSOC(this.equalityExpression,pc.AMPERSAND)),this.exclusiveOrExpression=this.RR("exclusiveOrExpression",()=>this.LEFT_ASSOC(this.andExpression,pc.CARET)),this.inclusiveOrExpression=this.RR("inclusiveOrExpression",()=>this.LEFT_ASSOC(this.exclusiveOrExpression,pc.VERTICAL_BAR)),this.logicalAndExpression=this.RR("logicalAndExpression",()=>this.LEFT_ASSOC(this.inclusiveOrExpression,pc.AND_OP)),this.logicalXorExpression=this.RR("logicalXorExpression",()=>this.LEFT_ASSOC(this.logicalAndExpression,pc.XOR_OP)),this.logicalOrExpression=this.RR("logicalOrExpression",()=>this.LEFT_ASSOC(this.logicalXorExpression,pc.OR_OP)),this.assignmentExpression=this.RR("assignmentExpression",()=>{const e=this.SUBRULE(this.conditionalExpression);return this.OPTION(()=>{const t=this.CONSUME(pc.ASSIGN_OP),n=this.SUBRULE1(this.assignmentExpression);return{kind:"assignmentExpression",lhs:e,op:t,rhs:n}})??e}),this.expression=this.RR("expression",()=>{let e;return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.SUBRULE(this.assignmentExpression);return e=e?{kind:"commaExpression",lhs:e,rhs:t}:t}}),e}),this.conditionalExpression=this.RR("conditionalExpression",()=>{const e=this.SUBRULE1(this.logicalOrExpression);return this.OPTION(()=>({kind:"conditionalExpression",condition:e,QUESTION:this.CONSUME(pc.QUESTION),yes:this.SUBRULE2(this.expression),COLON:this.CONSUME(pc.COLON),no:this.SUBRULE3(this.assignmentExpression)}))??e}),this.switchStatement=this.RR("switchStatement",()=>{this.CONSUME(pc.SWITCH),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);this.CONSUME(pc.RIGHT_PAREN),this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.caseBlock))),this.CONSUME(pc.RIGHT_BRACE),{kind:"switchStatement",initExpression:e,cases:t}}),this.caseBlock=this.RR("caseBlock",()=>{const e=this.SUBRULE(this.caseLabel),t=[];return this.MANY1(()=>t.push(this.SUBRULE(this.statement))),{kind:"caseBlock",caseLabel:e,statements:t}}),this.jumpStatement=this.RR("jumpStatement",()=>{const e=this.OR([{ALT:()=>(this.CONSUME(pc.CONTINUE),{kind:"continueStatement"})},{ALT:()=>(this.CONSUME(pc.BREAK),{kind:"breakStatement"})},{ALT:()=>(this.CONSUME(pc.DISCARD),{kind:"discardStatement"})},{ALT:()=>(this.CONSUME(pc.RETURN),{kind:"returnStatement",what:this.OPTION(()=>this.SUBRULE(this.expression))})}]);return this.CONSUME(pc.SEMICOLON),e}),this.primaryExpression=this.RR("primaryExpression",()=>this.OR([{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),e}},{ALT:()=>({kind:"variableExpression",var:this.CONSUME(pc.IDENTIFIER)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.CONSTANT)})}])),this.constantExpression=this.RR("constantExpression",()=>this.SUBRULE(this.conditionalExpression)),this.layoutQualifier=this.RR("layoutQualifier",()=>{this.CONSUME(pc.LAYOUT),this.CONSUME(pc.LEFT_PAREN);const e=[];return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.CONSUME(pc.IDENTIFIER);let n;this.OPTION(()=>{this.CONSUME(pc.EQUAL),n=this.OR([{ALT:()=>this.CONSUME(pc.INTCONSTANT)},{ALT:()=>this.CONSUME(pc.UINTCONSTANT)}])}),e.push({IDENTIFIER:t,init:n})}}),this.CONSUME(pc.RIGHT_PAREN),{kind:"layoutQualifier",layoutQualifierIds:e}}),this.storageQualifier=this.RR("storageQualifier",()=>{let e,t,n,r,i,s,o;return this.OR([{ALT:()=>e=this.CONSUME(pc.CONST)},{ALT:()=>{t=this.OPTION(()=>this.CONSUME(pc.CENTROID)),this.OR9([{ALT:()=>n=this.CONSUME(pc.IN)},{ALT:()=>r=this.CONSUME(pc.OUT)},{ALT:()=>s=this.CONSUME(pc.VARYING)},{ALT:()=>o=this.CONSUME(pc.ATTRIBUTE)}])}},{ALT:()=>i=this.CONSUME(pc.UNIFORM)}]),{kind:"storageQualifier",CONST:e,CENTROID:t,IN:n,OUT:r,VARYING:s,ATTRIBUTE:o,UNIFORM:i}}),this.typeQualifier=this.RR("typeQualifier",()=>{let e,t,n,r;return this.OR([{ALT:()=>e=this.SUBRULE(this.storageQualifier)},{ALT:()=>{t=this.SUBRULE1(this.layoutQualifier),e=this.OPTION1(()=>this.SUBRULE2(this.storageQualifier))}},{ALT:()=>{n=this.CONSUME(pc.INTERPOLATION_QUALIFIER),e=this.OPTION2(()=>this.SUBRULE3(this.storageQualifier))}},{ALT:()=>{r=this.CONSUME(pc.INVARIANT),n=this.OPTION3(()=>this.CONSUME1(pc.INTERPOLATION_QUALIFIER)),e=this.SUBRULE7(this.storageQualifier)}}]),{kind:"typeQualifier",storageQualifier:e,layoutQualifier:t,interpolationQualifier:n,invariantQualifier:r}}),this.precisionQualifier=this.RR("precisionQualifier",()=>this.CONSUME(pc.PRECISION_QUALIFIER)),this.arraySpecifier=this.RR("arraySpecifier",()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.OPTION3(()=>this.SUBRULE(this.constantExpression));return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arraySpecifier",size:e}}),this.typeSpecifierNonArray=this.RR("typeSpecifierNonArray",()=>this.OR([{ALT:()=>this.CONSUME(pc.BASIC_TYPE)},{ALT:()=>this.CONSUME(pc.VOID)},{ALT:()=>this.SUBRULE(this.structSpecifier)},{ALT:()=>this.CONSUME(pc.IDENTIFIER)}])),this.typeSpecifierNoPrec=this.RR("typeSpecifierNoPrec",()=>{const e=this.SUBRULE(this.typeSpecifierNonArray);return{kind:"typeSpecifier",precisionQualifier:void 0,arraySpecifier:this.OPTION1(()=>this.SUBRULE(this.arraySpecifier)),typeSpecifierNonArray:e}}),this.functionCall=this.RR("functionCall",()=>{const e=this.SUBRULE(this.typeSpecifierNoPrec);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({DEF:()=>t.push(this.SUBRULE(this.assignmentExpression)),SEP:pc.COMMA}),this.CONSUME(pc.RIGHT_PAREN),{kind:"functionCall",callee:e,args:t}}),this.functionCallHeader=this.RULE("functionCallHeader",()=>{this.SUBRULE(this.typeSpecifierNoPrec),this.CONSUME(pc.LEFT_PAREN)}),this.postfixExpression=this.RR("postfixExpression",()=>{const e=this.LA(1);let t=this.OR1([{GATE:this.BACKTRACK(this.functionCallHeader),ALT:()=>this.SUBRULE1(this.functionCall)},{ALT:()=>this.SUBRULE(this.primaryExpression)}]);return this.MANY(()=>{t=this.OR2([{ALT:()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arrayAccess",on:t,index:e}}},{ALT:()=>{this.CONSUME1(pc.DOT);const e=this.SUBRULE2(this.functionCall);return{kind:"methodCall",on:t,functionCall:e}}},{ALT:()=>{this.CONSUME2(pc.DOT);const e=this.CONSUME(pc.IDENTIFIER);return{kind:"fieldAccess",on:t,field:e}}},{ALT:()=>{const e=this.CONSUME(pc.POSTFIX_OP);return{kind:"postfixExpression",on:t,op:e}}}]),this.FINALIZE(t,e)}),t}),this.unaryExpression=this.RR("unaryExpression",()=>this.OR([{ALT:()=>this.SUBRULE1(this.postfixExpression)},{ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.UNARY_OP),on:this.SUBRULE2(this.unaryExpression)})}])),this.ppUnaryExpression=this.RR("ppUnaryExpression",()=>this.OR([{GATE:()=>this.LA(1).tokenType===pc.NON_PP_IDENTIFIER&&"defined"===this.LA(1).image,ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.IDENTIFIER),on:{kind:"variableExpression",var:this.OR1([{ALT:()=>this.SUBRULE(this.ppIdentifier)},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE1(this.ppIdentifier);return this.CONSUME(pc.RIGHT_PAREN),e}}])}})},{ALT:()=>({kind:"unaryExpression",op:this.OR2([{ALT:()=>this.CONSUME(pc.PLUS)},{ALT:()=>this.CONSUME(pc.DASH)},{ALT:()=>this.CONSUME(pc.TILDE)},{ALT:()=>this.CONSUME(pc.BANG)}]),on:this.SUBRULE2(this.ppUnaryExpression)})},{ALT:()=>this.SUBRULE(this.ppPrimaryExpression)}])),this.ppPrimaryExpression=this.RR("ppPrimaryExpression",()=>this.OR([{ALT:()=>({kind:"variableExpression",var:this.SUBRULE(this.ppIdentifier)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.INTCONSTANT)})},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.ppConstantExpression);return this.CONSUME(pc.RIGHT_PAREN),e}}])),this.ppConstantExpression=this.RR("ppConstantExpression",()=>{try{return this.preprocessing=!0,this.LEFT_ASSOC(this.logicalAndExpression,pc.OR_OP)}finally{this.preprocessing=!1}}),this.typeSpecifier=this.RR("typeSpecifier",()=>{const e=this.OPTION(()=>this.SUBRULE(this.precisionQualifier)),t=this.SUBRULE(this.typeSpecifierNoPrec);return Object.assign({},t,{precisionQualifier:e})}),this.parameterDeclaration=this.RR("parameterDeclaration",()=>{const e=this.OPTION(()=>this.CONSUME(pc.CONST)),t=this.OPTION1(()=>this.CONSUME(pc.PARAMETER_QUALIFIER)),n=this.SUBRULE(this.typeSpecifier);let r,i;return this.OPTION2(()=>{r=this.CONSUME2(pc.IDENTIFIER),i=this.OPTION3(()=>this.SUBRULE(this.arraySpecifier))}),{kind:"parameterDeclaration",parameterTypeQualifier:e,pName:r,arraySpecifier:i,parameterQualifier:t,typeSpecifier:n}}),this.fullySpecifiedType=this.RR("fullySpecifiedType",()=>({kind:"fullySpecifiedType",typeQualifier:this.OPTION(()=>this.SUBRULE(this.typeQualifier)),typeSpecifier:this.SUBRULE(this.typeSpecifier)})),this.structDeclaration=this.RR("structDeclaration",()=>{const e=this.SUBRULE(this.fullySpecifiedType),t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME(pc.IDENTIFIER),arraySpecifier:this.OPTION(()=>this.SUBRULE(this.arraySpecifier)),init:void 0};return t.push(e),e})}),this.CONSUME(pc.SEMICOLON),{kind:"structDeclaration",fsType:e,declarators:t}}),this.structSpecifier=this.RR("structSpecifier",()=>{this.CONSUME(pc.STRUCT);const e=this.OPTION2(()=>this.CONSUME(pc.IDENTIFIER));this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),{kind:"structSpecifier",name:e,declarations:t}}),this.initializer=this.RR("initializer",()=>this.SUBRULE(this.assignmentExpression)),this.singleDeclaration=this.RULE("singleDeclaration",()=>this.OR([{ALT:()=>{this.SUBRULE(this.fullySpecifiedType),this.OPTION1(()=>{this.CONSUME1(pc.IDENTIFIER),this.OPTION2(()=>{this.CONSUME(pc.LEFT_BRACKET),this.OPTION3(()=>this.SUBRULE(this.constantExpression)),this.CONSUME(pc.RIGHT_BRACKET)}),this.OPTION4(()=>{this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)})})}},{ALT:()=>({kind:"invariantDeclaration",INVARIANT:this.CONSUME(pc.INVARIANT),IDENTIFIER:this.CONSUME2(pc.IDENTIFIER)})}])),this.initDeclaratorList=this.RR("initDeclaratorList",()=>this.SUBRULE(this.externalDeclaration,{ARGS:[!1,!1]})),this.expressionStatement=this.RR("expressionStatement",()=>{const e=this.OPTION(()=>this.SUBRULE(this.expression));return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:e}}),this.condition=this.RR("condition",()=>this.OR({MAX_LOOKAHEAD:4,DEF:[{GATE:this.BACKTRACK(this.singleDeclaration),ALT:()=>{const e=this.SUBRULE2(this.fullySpecifiedType),t=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.EQUAL),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:[{kind:"declarator",name:t,init:this.SUBRULE3(this.initializer),arraySpecifier:void 0}]}}},{ALT:()=>this.SUBRULE(this.expression)}]})),this.caseLabel=this.RR("caseLabel",()=>this.OR([{ALT:()=>{this.CONSUME(pc.CASE);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.COLON),{kind:"caseLabel",case_:e}}},{ALT:()=>(this.CONSUME2(pc.DEFAULT),this.CONSUME2(pc.COLON),{kind:"caseLabel",case_:void 0})}])),this.selectionStatement=this.RR("selectionStatement",()=>{this.CONSUME(pc.IF),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),{kind:"selectionStatement",condition:e,yes:this.SUBRULE2(this.statement,{ARGS:[!0]}),no:this.OPTION(()=>(this.CONSUME(pc.ELSE),this.SUBRULE3(this.statement,{ARGS:[!0]})))}}),this.statement=this.RR("statement",e=>this.OR([{ALT:()=>this.SUBRULE(this.ppDirective),IGNORE_AMBIGUITIES:!0},{ALT:()=>{const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:{kind:"variableExpression",var:e}}},IGNORE_AMBIGUITIES:!0},{GATE:this.BACKTRACK(this.expressionStatement),ALT:()=>this.SUBRULE(this.expressionStatement)},{ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.selectionStatement)},{ALT:()=>this.SUBRULE(this.switchStatement)},{ALT:()=>this.SUBRULE(this.iterationStatement)},{ALT:()=>this.SUBRULE(this.jumpStatement)},{ALT:()=>this.SUBRULE(this.compoundStatement,{ARGS:[!!e]})}])),this.compoundStatement=this.RR("compoundStatement",e=>{if("object"==typeof e)throw new Error;this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.statement))),this.CONSUME(pc.RIGHT_BRACE),{kind:"compoundStatement",statements:t,newScope:!!e}}),this.iterationStatement=this.RR("iterationStatement",()=>this.OR([{ALT:()=>{this.CONSUME(pc.WHILE),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.condition);return this.CONSUME(pc.RIGHT_PAREN),{kind:"whileStatement",conditionExpression:e,statement:this.SUBRULE(this.statement)}}},{ALT:()=>{this.CONSUME2(pc.DO);const e=this.SUBRULE2(this.statement,{ARGS:[!0]});this.CONSUME2(pc.WHILE),this.CONSUME2(pc.LEFT_PAREN);const t=this.SUBRULE2(this.expression);return this.CONSUME2(pc.RIGHT_PAREN),this.CONSUME2(pc.SEMICOLON),{kind:"doWhileStatement",statement:e,conditionExpression:t}}},{ALT:()=>{this.CONSUME3(pc.FOR),this.CONSUME3(pc.LEFT_PAREN);const e=this.OR3([{GATE:this.BACKTRACK(this.initDeclaratorList),ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.expressionStatement)}]),t=this.OPTION3(()=>this.SUBRULE3(this.condition));this.CONSUME4(pc.SEMICOLON);const n=this.OPTION4(()=>this.SUBRULE4(this.expression));return this.CONSUME3(pc.RIGHT_PAREN),{kind:"forStatement",initExpression:e,conditionExpression:t,loopExpression:n,statement:this.SUBRULE3(this.statement)}}}])),this.translationUnit=this.RR("translationUnit",()=>{const e=[];return this.AT_LEAST_ONE(()=>e.push(this.SUBRULE(this.externalDeclaration,{ARGS:[!0,!0]}))),{kind:"translationUnit",declarations:e}}),this.uniformBlock=this.RR("uniformBlock",()=>{const e=this.SUBRULE(this.typeQualifier),t=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_BRACE);const n=[];let r,i;return this.MANY(()=>n.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),this.OPTION(()=>{r=this.CONSUME1(pc.IDENTIFIER),i=this.OPTION1(()=>this.SUBRULE(this.arraySpecifier))}),this.CONSUME(pc.SEMICOLON),{kind:"uniformBlock",typeQualifier:e,blockName:t,declarations:n,namespace:r,arraySpecifier:i}}),this.uniformBlockHeader=this.RULE("uniformBlockHeader",()=>{this.OPTION(()=>this.SUBRULE(this.layoutQualifier)),this.CONSUME(pc.UNIFORM),this.CONSUME(pc.IDENTIFIER),this.CONSUME(pc.LEFT_BRACE)}),this.typeQualifierDeclaration=this.RR("typeQualifierDeclaration",()=>{const e=this.SUBRULE(this.typeQualifier);return this.CONSUME(pc.SEMICOLON),{kind:"typeQualifierDeclaration",typeQualifier:e}}),this.externalDeclaration=this.RR("externalDeclaration",(e,t)=>this.OR([{ALT:()=>this.SUBRULE(this.ppCall)},{ALT:()=>this.SUBRULE(this.ppDirective)},{GATE:this.BACKTRACK(this.typeQualifierDeclaration),ALT:()=>this.SUBRULE(this.typeQualifierDeclaration)},{GATE:e?this.BACKTRACK(this.uniformBlockHeader):()=>!1,ALT:()=>this.SUBRULE(this.uniformBlock)},{ALT:()=>{const e=this.SUBRULE(this.fullySpecifiedType);return this.OR2([{GATE:t?void 0:()=>!1,ALT:()=>{const t=this.CONSUME1(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const n=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>n.push(this.SUBRULE(this.parameterDeclaration))}),this.CONSUME(pc.RIGHT_PAREN),this.OR3([{ALT:()=>(this.CONSUME(pc.SEMICOLON),{kind:"functionPrototype",name:t,returnType:e,params:n})},{ALT:()=>{const r=this.SUBRULE(this.compoundStatement);return{kind:"functionDefinition",name:t,returnType:e,params:n,body:r}},IGNORE_AMBIGUITIES:!1}])}},{ALT:()=>{const t=[];return this.MANY_SEP2({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME3(pc.IDENTIFIER),arraySpecifier:this.OPTION5(()=>this.SUBRULE(this.arraySpecifier)),init:this.OPTION7(()=>(this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)))};return t.push(e),e})}),this.CONSUME2(pc.SEMICOLON),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:t}}}])}},{ALT:()=>{this.CONSUME(pc.PRECISION);const e=this.CONSUME(pc.PRECISION_QUALIFIER),t=this.SUBRULE(this.typeSpecifierNoPrec);return this.CONSUME3(pc.SEMICOLON),{kind:"precisionDeclaration",precisionQualifier:e,typeSpecifierNoPrec:t}}}])),this.ppDefine=this.RR("ppDefine",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.DEFINE);const e=this.CONSUME(pc.IDENTIFIER),t=this.LA(1).tokenType===pc.LEFT_PAREN&&e.endOffset+1===this.LA(1).startOffset,n={kind:"ppDefine",what:e,params:this.OPTION({GATE:()=>t,DEF:()=>{this.CONSUME(pc.LEFT_PAREN);const e=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>e.push(this.SUBRULE(this.ppIdentifier))}),this.CONSUME(pc.RIGHT_PAREN),e}}),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(n),n}),this.ppInclude=this.RR("ppInclude",()=>{let e="";return this.OR([{ALT:()=>{const t=this.CONSUME(pc.HASH_INCLUDE_MODULE);e=t.image.substring(t.image.indexOf("<"))}},{ALT:()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.INCLUDE),e=this.CONSUME(pc.STRING).image}}]),{kind:"ppInclude",what:e}}),this.ppCall=this.RR("ppCall",()=>{const e=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>{const e=[];this.MANY(()=>this.OR({DEF:[{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>e.push(this.CONSUME(pc.BASIC_TYPE))},{ALT:()=>e.push(this.CONSUME(pc.ASSIGN_OP))},{ALT:()=>e.push(this.CONSUME(pc.SHIFT_OP))},{ALT:()=>e.push(this.CONSUME(pc.CONSTANT))},{ALT:()=>e.push(this.CONSUME(pc.KEYWORD))},{ALT:()=>e.push(this.CONSUME2(pc.IDENTIFIER))}]})),t.push({tokens:e,node:void 0})},MAX_LOOKAHEAD:1}),this.CONSUME(pc.RIGHT_PAREN),{kind:"ppCall",callee:e,args:t}}),this.ppCallArg=this.RULE("ppCallArg",()=>{const e=[];return e.push(this.CONSUME(pc.LEFT_PAREN)),this.MANY(()=>this.OR([{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>(e.push(this.LA(1)),this.SKIP_TOKEN())}])),e.push(this.CONSUME(pc.RIGHT_PAREN)),e}),this.ppNone=this.RR("ppNone",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.ELSE)},{ALT:()=>this.CONSUME(pc.ENDIF)}]),tokens:[],node:void 0};return this.ppDefs.push(e),e}),this.ppMulti=this.RR("ppMulti",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IF)},{ALT:()=>this.CONSUME(pc.ELIF)},{ALT:()=>this.CONSUME(pc.ERROR)},{ALT:()=>this.CONSUME(pc.VERSION)},{ALT:()=>this.CONSUME(pc.LINE)}]),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(e),e}),this.ppPragma=this.RR("ppPragma",()=>({kind:"ppPragma",dir:this.CONSUME(pc.PRAGMA_DIRECTIVE)})),this.ppSingle=this.RR("ppSingle",()=>(this.CONSUME(pc.HASH),{kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IFDEF)},{ALT:()=>this.CONSUME(pc.IFNDEF)}]),tokens:[this.CONSUME(pc.IDENTIFIER)],node:void 0})),this.ppExtension=this.RR("ppExtension",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.EXTENSION);const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.COLON),{kind:"ppExtension",extension:e,behavior:this.CONSUME1(pc.IDENTIFIER)}}),this.ppDirective=this.RR("ppDirective",()=>this.OR([{ALT:()=>this.SUBRULE(this.ppDefine)},{ALT:()=>this.SUBRULE(this.ppExtension)},{ALT:()=>this.SUBRULE(this.ppNone)},{ALT:()=>this.SUBRULE(this.ppSingle)},{ALT:()=>this.SUBRULE(this.ppMulti)},{ALT:()=>this.SUBRULE(this.ppPragma)},{ALT:()=>this.SUBRULE(this.ppInclude)}])),this.ppIdentifier=this.RR("ppIdentifier",()=>this.OR([{ALT:()=>this.CONSUME(pc.IDENTIFIER)},{ALT:()=>this.CONSUME(pc.KEYWORD)},{ALT:()=>this.CONSUME(pc.BASIC_TYPE)}])),this.ppDefs=[],this.performSelfAnalysis()}reset(){super.reset(),this.ppDefs=[],this.backtracking=!1,this.preprocessing=!1}LEFT_ASSOC(e,t){const n=this.LA(1);let r=this.SUBRULE1(e);return this.MANY(()=>{const i=this.CONSUME(t),s=this.SUBRULE2(e);return r={kind:"binaryExpression",lhs:r,rhs:s,op:i,firstToken:n,lastToken:this.LA(0)},r}),r}ANNOTATE(e){return(...t)=>{const n=this.LA(1),r=e(...t);return r&&hc(r)&&!r.firstToken&&this.FINALIZE(r,n),r}}BACKTRACK(e,t){const n=super.BACKTRACK(e,t);return function(){try{return this.backtracking=!0,n.call(this)}finally{this.backtracking=!1}}}RR(e,t,n){return super.RULE(e,this.ANNOTATE(t),n)}FINALIZE(e,t){this.RECORDING_PHASE||this.backtracking||(e.firstToken=t,e.lastToken=this.LA(0))}isAtEof(){return this.LA(1).tokenType===Ml}};const{ll:{printDocToString:vc},LX:{indentIfBreak:Cc,group:Dc,indent:Sc,join:Ac,line:_c,softline:yc,hardline:bc,fill:Tc,lineSuffixBoundary:Rc}}=r,xc=new class extends uc{constructor(){super(...arguments),this.result=void 0}visit(e){if(!this.result){const t=this.result=[];return super.visit(e),this.result=void 0,t}e&&this.result.push(e)}};function wc(e){return(cc(e)?e:e.lastToken).endOffset+1}const Fc={"glsl-parser":{parse(e,t){const n=function(e){const t=function(e){const t=[];let n="",r=0,i=0;return{result:e.replace(/\\(\r\n|\n\r|\r|\n)(.*?)(?:(?=\\?[\r\n])|$)/g,(s,o,a,l)=>{r++,i+=function(e,t){let n=t;for(;n>=0&&"\r"!==e[n]&&"\n"!==e[n];)n--;return t-n-1}(e,l),t.push({originalOffset:l+1+o.length,newOffset:l-n.length,length:a.length,lineDiff:-r,columnDiff:i}),n+=" "+o;let u="";return e.length>l+s.length&&"\\"===e[l+s.length]||(u=n,n="",r=0,i=0),a+u}),changes:t}}(e),n=gc.tokenize(t.result);!function(e,t){if(t.errors.length)throw new Error("LEXER ERROR: "+t.errors.map(t=>t.message+":\n"+dc(e,{startLine:t.line,startColumn:t.column,endLine:t.line,endColumn:t.column+t.length})).join())}(t.result,n),function(e,t){let n=0;function r(e,t){const n=t.originalOffset-t.newOffset;e.startOffset>=t.newOffset&&(e.lineNoCont=e.startLine,e.startOffset+=n,e.startLine-=t.lineDiff,e.startColumn-=t.columnDiff),e.endOffset+=n,e.endLine-=t.lineDiff,e.endColumn-=t.columnDiff}for(const i of t){for(;e[n]&&e[n].endOffset0)throw new Error("PARSE ERROR: "+t.map(t=>t.message+"\n"+t.context.ruleStack.join(" > ")+"\n"+dc(e,t.token)).join("\n"))}(t.result,Ec.errors);const i=Ec.ppDefs;function s(e,t){Ec.input=e;const n=t(Ec);return Ec.isAtEof()&&0===Ec.errors.length?n:void 0}for(const e of i)e.node=s(e.tokens,e=>e.externalDeclaration(!0,!0))??s(e.tokens,e=>e.statement())??s(e.tokens,e=>e.expression());return r.comments=n.groups.COMMENTS,r}(e);return n.comments?.forEach(e=>e.value=JSON.stringify(e)),n},astFormat:"glsl-ast",locStart:function(e){return(cc(e)?e:e.firstToken).startOffset},locEnd:wc}};function Nc(e){switch(e){case pc.STAR:case pc.SLASH:case pc.PERCENT:return 4;case pc.PLUS:case pc.DASH:return 5;case pc.LEFT_OP:case pc.RIGHT_OP:return 6;case pc.LEFT_ANGLE:case pc.RIGHT_ANGLE:case pc.LE_OP:case pc.GE_OP:return 7;case pc.EQ_OP:case pc.NE_OP:return 8;case pc.AMPERSAND:return 9;case pc.CARET:return 10;case pc.VERTICAL_BAR:return 11;case pc.AND_OP:case pc.XOR_OP:return 12;case pc.OR_OP:return 13;case pc.COMMA:return 17;default:throw new Error}}function Lc(e,t){switch(e.kind){default:return 1;case"variableExpression":return t?.find(t=>t.image===e.var.image)?18:1;case"arrayAccess":case"functionCall":case"fieldAccess":case"postfixExpression":return 2;case"unaryExpression":return 3;case"binaryExpression":return Nc(e.op.tokenType);case"conditionalExpression":return 15;case"assignmentExpression":return 16;case"commaExpression":return 17}}function Oc(e,t){return t?["(",e,")"]:e}function Ic(e,t,n,r){const i="binaryExpression"===n.kind&&"binaryExpression"===n.lhs.kind&&Nc(n.lhs.op.tokenType)===Nc(n.op.tokenType)||"commaExpression"===n.kind&&"commaExpression"===n.lhs.kind,s="binaryExpression"===n.kind?n.op.tokenType:pc.COMMA;let o;return i?(o=e.call(e=>Ic(e,t,e.getValue(),r),"lhs"),o.push("commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))),o):[Oc(e.call(t,"lhs"),Lc(n.lhs,r)>Nc(s)),"commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))]}function kc(e,t,n){return"expressionStatement"!==e.kind||e.expression?"compoundStatement"===e.kind||n?[" ",t]:Sc([_c,t]):";"}function Mc(e,t){return vc(e,Object.assign({},t,{printWidth:t.printWidth-2})).formatted.trim().replace(/^.*(?=[\r\n])/gm,e=>e+" ".repeat(t.printWidth-2-e.length+1)+"\\")}function Pc(e){return"assignmentExpression"===e.kind}function Bc(e){return"assignmentExpression"===e.kind||"declarator"===e.kind}function Uc(e,t,n,r,i,s){const o=function(e,t,n){if(!n)return"only-left";const r=!Pc(n);return e.match(Pc,Bc,e=>!r||"expressionStatement"!==e.kind&&"initDeclaratorListDeclaration"!==e.kind)?r?"chain-tail":"chain":!r&&Pc(n.rhs)||(t.originalText,0)||"binaryExpression"===n.kind||"commaExpression"===n.kind||"conditionalExpression"===n.kind&&"binaryExpression"===n.condition.kind?"break-after-operator":"constantExpression"===n.kind?"never-break-after-operator":"fluid"}(e,t,s);switch(o){case"break-after-operator":return Dc([Dc(n),r,Dc(Sc([_c,i]))]);case"never-break-after-operator":return Dc([Dc(n),r," ",i]);case"fluid":{const e=Symbol("assignment");return Dc([Dc(n),r,Dc(Sc(_c),{id:e}),Rc,Cc(i,{groupId:e})])}case"chain":return[Dc(n),r,_c,i];case"chain-tail":return[Dc(n),r,Sc([_c,i])];case"only-left":return n;default:throw new Error}}const $c={"glsl-ast":{print(e,t,n){const r=t.inMacro,i=e.getValue();if(!i)return[];if(cc(i))return i.image;const s=t=>e.call(n,t);try{switch(i.kind){case"translationUnit":{const r=[];return e.each((e,i)=>{const s=e.getValue();r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc),r.push(bc)},"declarations"),r}case"precisionDeclaration":return["precision ",i.precisionQualifier.image," ",e.call(n,"typeSpecifierNoPrec"),";"];case"fullySpecifiedType":{const e=[];return i.typeQualifier&&e.push(s("typeQualifier")," "),e.push(s("typeSpecifier")),e}case"typeSpecifier":{const e=[];return i.precisionQualifier&&e.push(i.precisionQualifier.image," "),e.push(s("typeSpecifierNonArray")),i.arraySpecifier&&e.push(s("arraySpecifier")),e}case"typeQualifier":{const e=[];return i.invariantQualifier&&e.push("invariant"),i.interpolationQualifier&&e.push(i.interpolationQualifier.image),i.layoutQualifier&&e.push(s("layoutQualifier")),i.storageQualifier&&e.push(s("storageQualifier")),Ac(" ",e)}case"storageQualifier":{const t=[];return i.CONST&&t.push("const"),i.CENTROID&&e.getParentNode().interpolationQualifier?.tokenType!==pc.FLAT&&t.push("centroid"),i.IN&&t.push("in"),i.OUT&&t.push("out"),i.VARYING&&t.push("varying"),i.ATTRIBUTE&&t.push("attribute"),i.UNIFORM&&t.push("uniform"),Ac(" ",t)}case"functionPrototype":case"functionDefinition":return[Dc([s("returnType")," ",s("name"),"(",Sc([yc,Ac([",",_c],e.map(n,"params"))]),yc,")"]),"functionPrototype"===i.kind?";":[" ",s("body")]];case"parameterDeclaration":return[i.parameterTypeQualifier?[s("parameterTypeQualifier")," "]:"",i.parameterQualifier?.tokenType===pc.OUT||i.parameterQualifier?.tokenType===pc.INOUT?i.parameterQualifier?.image+" ":"",s("typeSpecifier")," ",s("pName"),s("arraySpecifier")];case"initDeclaratorListDeclaration":case"structDeclaration":{const t=e.map(n,"declarators"),r="forStatement"===e.getParentNode().kind,o=i.declarators.some(e=>e.init);return Dc([s("fsType"),0===t.length?"":" ",1===t.length?t:Dc(Sc(Ac([",",o&&!r?bc:_c],t))),";"])}case"declarator":{const n=s("arraySpecifier"),r=[i.name.image,n];return Uc(e,t,r," =",s("init"),i.init)}case"arraySpecifier":return Dc(["[",Sc([yc,s("size")]),yc,"]"]);case"arrayAccess":return[Oc(s("on"),Lc(i.on,r)>2),"[",s("index"),"]"];case"structSpecifier":{const r=[];return e.each((e,i,s)=>{const o=e.getValue();r.push(bc),r.push(n(e)),i!==s.length-1&&_s.isNextLineEmpty(t.originalText,o,wc)&&r.push(bc)},"declarations"),Dc(["struct",i.name?" "+i.name.image:""," {",Sc(r),bc,"}"])}case"compoundStatement":{const r=[],s=!!i.comments?.some(e=>!e.leading&&!e.trailing&&!e.printed);return e.each((e,i)=>{const s=e.getValue();0!==i&&r.push(bc),r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc)},"statements"),s&&e.each(e=>{const t=e.getValue();t.leading||t.trailing||(r.push(n(e)),t.printed=!0)},"comments"),Dc(["{",r.length?[Sc([bc,r]),bc]:"","}"])}case"returnStatement":return i.what?["return"," ",s("what"),";"]:"return;";case"breakStatement":return"break;";case"continueStatement":return"continue;";case"discardStatement":return"discard;";case"selectionStatement":{const e=[],t=kc(i.yes,s("yes"),!1),n=Dc(["if (",Dc([Sc([yc,s("condition")]),yc]),")",t]);if(e.push(n),i.no){const t=i.yes.comments?.some(e=>e.trailing&&e.tokenType===pc.LINE_COMMENT)||i.yes.comments?.findLast(e=>!e.leading&&!e.trailing)?.tokenType===pc.LINE_COMMENT,n="compoundStatement"===i.yes.kind&&!t;e.push(n?" ":bc),e.push("else",Dc(kc(i.no,s("no"),"selectionStatement"===i.no.kind)))}return e}case"forStatement":{const e=kc(i.statement,s("statement"),!1),t=!1,n=t?[t,yc]:"";return"expressionStatement"!==i.initExpression.kind||i.initExpression.expression||i.conditionExpression||i.loopExpression?[n,Dc(["for (",Dc([Sc([yc,s("initExpression"),_c,s("conditionExpression"),";",_c,s("loopExpression")]),yc]),")",e])]:[n,Dc(["for (;;)",e])]}case"whileStatement":{const e=kc(i.statement,s("statement"),!1);return["while (",Dc(s("conditionExpression")),")",e]}case"doWhileStatement":return["do ",s("statement")," while (",Dc(s("conditionExpression")),");"];case"functionCall":return function(t){const r=e.map(n,"args");let i,o;if(void 0===t.callee.arraySpecifier&&cc(t.callee.typeSpecifierNonArray)&&void 0!==(i=function(e){switch(e){case pc.MAT2X2:return[2,2];case pc.MAT2X3:return[2,3];case pc.MAT2X4:return[2,4];case pc.MAT3X2:return[3,2];case pc.MAT3X3:return[3,3];case pc.MAT3X4:return[3,4];case pc.MAT4X2:return[4,2];case pc.MAT4X3:return[4,3];case pc.MAT4X4:return[4,4];default:return}}(t.callee.typeSpecifierNonArray.tokenType))&&i[0]*i[1]===t.args.length){const e=t.args.every(e=>"constantExpression"===e.kind&&(e.const_.tokenType===pc.FLOATCONSTANT||e.const_.tokenType===pc.INTCONSTANT)||"unaryExpression"===e.kind&&(e.op.tokenType===pc.PLUS||e.op.tokenType===pc.DASH)&&"constantExpression"===e.on.kind&&(e.on.const_.tokenType===pc.FLOATCONSTANT||e.on.const_.tokenType===pc.INTCONSTANT));if(e){const e=[],n=[];let s=0,a=0;for(let i=0;i2),".",s("functionCall")];case"postfixExpression":return[Oc(s("on"),Lc(i.on,r)>2),s("op")];case"unaryExpression":return[s("op"),Oc(s("on"),Lc(i.on,r)>3)];case"assignmentExpression":{const n=s("lhs");return Uc(e,t,n," "+i.op.image,s("rhs"),i.rhs)}case"conditionalExpression":return[Oc(s("condition"),Lc(i.condition,r)>=15),Sc([_c,"? ",s("yes"),_c,": ",s("no")])];case"commaExpression":case"binaryExpression":{const t=Ic(e,n,i,r),s=e.getParentNode();if("selectionStatement"===s.kind||"whileStatement"===s.kind||"switchStatement"===s.kind||"doWhileStatement"===s.kind)return t;const o=()=>{const t=e.getParentNode();return!!t&&("functionCall"===t.kind&&"commaExpression"===i.kind||"binaryExpression"===t.kind&&((n=t.op.tokenType)===pc.CARET||n===pc.VERTICAL_BAR||n===pc.AMPERSAND));var n},a=e.getParentNode(1);if("returnStatement"===s.kind||"forStatement"===s.kind||"conditionalExpression"===s.kind&&"returnStatement"!==a.kind&&"functionCall"!==a.kind||"assignmentExpression"===s.kind||"declarator"===s.kind)return Dc(t);{const e=t.slice(0,1),n=t.slice(e.length);return Dc(Oc([...e,Sc(n)],o()))}}case"expressionStatement":return[s("expression"),";"];case"fieldAccess":return[Oc(s("on"),Lc(i.on,r)>2),".",s("field")];case"constantExpression":{const e=i.const_;return e.tokenType===pc.FLOATCONSTANT?function(e){const t=e.indexOf(".");return 0===t&&(e="0"+e),e=e.replace("E","e"),-1!==t&&(e=(e=(e=(e=e.replace(".e","e")).replace(/(?=4):Tc(Ac(_c,e.map(n,"tokens")))])]);return t.inMacro=void 0,Mc(r,t)}case"ppDir":return Mc(Dc(["#",i.dir.image," ",Sc(i.node?s("node"):Tc(Ac(_c,e.map(n,"tokens"))))]),t);case"ppPragma":return i.dir.image.replace(/^#\s+/,"#").replace(/^#pragma\s{2,}/,"#pragma ");case"ppCall":return Dc([i.callee.image,"(",Ac([",",_c],e.map((e,t,n)=>n[t].tokens.map(e=>e.image),"args")),")"]);case"ppInclude":return["#include ",i.what];case"ppExtension":return["#extension ",i.extension.image," : ",i.behavior.image];case"switchStatement":return["switch (",Dc([Sc([yc,s("initExpression")]),yc]),") {",i.cases.length?Sc([bc,Ac(bc,e.map(n,"cases"))]):"",bc,"}"];case"caseBlock":{const r=s("caseLabel"),i=[];return e.each((e,r)=>{const s=e.getValue();i.push(bc),i.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&i.push(bc)},"statements"),[r,Sc(i)]}case"caseLabel":return void 0===i.case_?"default:":["case ",s("case_"),":"];case"layoutQualifier":return["layout(",Ac(", ",i.layoutQualifierIds.map(e=>void 0===e.init?e.IDENTIFIER.image:[e.IDENTIFIER.image," = ",e.init.image])),")"];case"uniformBlock":return[s("typeQualifier")," ",i.blockName.image," {",Sc([bc,Ac(bc,e.map(n,"declarations"))]),bc,"};"];case"typeQualifierDeclaration":return[s("typeQualifier"),";"];default:throw new Error("unexpected n type "+i.kind+"\n"+JSON.stringify(i).substring(0,100))}}catch(e){throw console.error("error printing "+JSON.stringify(i).substring(0,100)+"\n"),e}},embed(e,t){const n=e.getValue();return!cc(n)||n.tokenType!==pc.LINE_COMMENT&&n.tokenType!==pc.MULTILINE_COMMENT?null:(e,t,n,r)=>{}},getVisitorKeys:(e,t)=>cc(e)?[]:Object.keys(e).filter(e=>!t.has(e)),getCommentChildNodes:e=>cc(e)?[]:xc.visit(e),canAttachComment:e=>!0,printComment:function(e,t){const n=e.getValue();return n.tokenType===pc.MULTILINE_COMMENT&&"*"===n.image[2]?"/**\n"+n.image.substring(3,n.image.length-2).split("\n").map(e=>" *"===e?"":e.startsWith(" * ")?e.substring(3):e).join("\n").trim().split("\n").map(e=>""===e?" *":" * "+e).join("\n")+"\n */":n.image},hasPrettierIgnore(e){const t=e.getValue();return(t&&hc(t)&&t.comments?.some(e=>/\/\/\s*prettier-ignore\b.*/.test(e.image)))??!1}}},Gc={parsers:Fc,printers:$c};function Vc(e){return e.replace(/^([^\n]*;)\n(?=(?:[A-Za-z_]\w*\s+)+[A-Za-z_]\w*\s*\()/gm,"$1\n\n").replace(/^}\n(?=\S)/gm,"}\n\n")}var Wc,Hc,jc=(Wc={program:function(e){return jc(e.program)+jc(e.wsEnd)},segment:function(e){return jc(e.blocks)},text:function(e){return jc(e.text)},literal:function(e){return jc(e.wsStart)+jc(e.literal)+jc(e.wsEnd)},identifier:function(e){return jc(e.identifier)+jc(e.wsEnd)},binary:function(e){return jc(e.left)+jc(e.operator)+jc(e.right)},group:function(e){return jc(e.lp)+jc(e.expression)+jc(e.rp)},unary:function(e){return jc(e.operator)+jc(e.expression)},unary_defined:function(e){return jc(e.operator)+jc(e.lp)+jc(e.identifier)+jc(e.rp)},int_constant:function(e){return jc(e.token)+jc(e.wsEnd)},elseif:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},if:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},ifdef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},ifndef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},else:function(e){return jc(e.token)+jc(e.wsEnd)+jc(e.body)},error:function(e){return jc(e.error)+jc(e.message)+jc(e.wsEnd)},undef:function(e){return jc(e.undef)+jc(e.identifier)+jc(e.wsEnd)},define:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.body)+jc(e.wsEnd)},define_arguments:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.lp)+jc(e.args)+jc(e.rp)+jc(e.body)+jc(e.wsEnd)},conditional:function(e){return jc(e.wsStart)+jc(e.ifPart)+jc(e.elseIfParts)+jc(e.elsePart)+jc(e.endif)+jc(e.wsEnd)},version:function(e){return jc(e.version)+jc(e.value)+jc(e.profile)+jc(e.wsEnd)},pragma:function(e){return jc(e.pragma)+jc(e.body)+jc(e.wsEnd)},line:function(e){return jc(e.line)+jc(e.value)+jc(e.wsEnd)},extension:function(e){return jc(e.extension)+jc(e.name)+jc(e.colon)+jc(e.behavior)+jc(e.wsEnd)}},Hc=function(e){return"string"==typeof e?e:null==e?"":Array.isArray(e)?e.map(Hc).join(""):e.type in Wc?Wc[e.type](e):"NO GENERATOR FOR ".concat(e.type)+e});const zc=jc;function Xc(e,t,n,r){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Xc.prototype),i.expected=t,i.found=n,i.location=r,i.name="SyntaxError",i}function Kc(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}function Yc(e,t){var n,r={},i=(t=void 0!==t?t:{}).grammarSource,s={program:An,constant_expression:hr},o=An,a="<<",l=">>",u="<=",c=">=",h="==",d="!=",f="&&",p="||",m="(",g=")",E=",",v="!",C="-",D="~",S="+",A="*",_="/",y="%",b="<",T=">",R="|",x="^",w="&",F=":",N="#",L="define",O="line",I="undef",k="error",M="pragma",P="defined",B="if",U="ifdef",$="ifndef",G="elif",V="else",W="endif",H="version",j="extension",z="0",X="//",K="/*",Y="*/",q=/^[A-Za-z_]/,Q=/^[A-Za-z_0-9]/,Z=/^[uU]/,J=/^[1-9]/,ee=/^[0-7]/,te=/^[xX]/,ne=/^[0-9a-fA-F]/,re=/^[0-9]/,ie=/^[\n\r]/,se=/^[^\n\r]/,oe=/^[ \t]/,ae=gn("<<",!1),le=gn(">>",!1),ue=gn("<=",!1),ce=gn(">=",!1),he=gn("==",!1),de=gn("!=",!1),fe=gn("&&",!1),pe=gn("||",!1),me=gn("(",!1),ge=gn(")",!1),Ee=gn(",",!1),ve=gn("!",!1),Ce=gn("-",!1),De=gn("~",!1),Se=gn("+",!1),Ae=gn("*",!1),_e=gn("/",!1),ye=gn("%",!1),be=gn("<",!1),Te=gn(">",!1),Re=gn("|",!1),xe=gn("^",!1),we=gn("&",!1),Fe=gn(":",!1),Ne=gn("#",!1),Le=gn("define",!1),Oe=(gn("include",!1),gn("line",!1)),Ie=gn("undef",!1),ke=gn("error",!1),Me=gn("pragma",!1),Pe=gn("defined",!1),Be=gn("if",!1),Ue=gn("ifdef",!1),$e=gn("ifndef",!1),Ge=gn("elif",!1),Ve=gn("else",!1),We=gn("endif",!1),He=gn("version",!1),je=gn("extension",!1),ze=En([["A","Z"],["a","z"],"_"],!1,!1),Xe=En([["A","Z"],["a","z"],"_",["0","9"]],!1,!1),Ke=vn("number"),Ye=En(["u","U"],!1,!1),qe=En([["1","9"]],!1,!1),Qe=gn("0",!1),Ze=En([["0","7"]],!1,!1),Je=En(["x","X"],!1,!1),et=En([["0","9"],["a","f"],["A","F"]],!1,!1),tt=En([["0","9"]],!1,!1),nt=vn("control line"),rt=En(["\n","\r"],!1,!1),it=vn("token string"),st=En(["\n","\r"],!0,!1),ot=vn("text"),at=vn("if"),lt=vn("primary expression"),ut=vn("unary expression"),ct=vn("multiplicative expression"),ht=vn("additive expression"),dt=vn("shift expression"),ft=vn("relational expression"),pt=vn("equality expression"),mt=vn("and expression"),gt=vn("exclusive or expression"),Et=vn("inclusive or expression"),vt=vn("logical and expression"),Ct=vn("logical or expression"),Dt=vn("constant expression"),St=vn("whitespace or comment"),At=gn("//",!1),_t=gn("/*",!1),yt=gn("*/",!1),bt={type:"any"},Tt=vn("whitespace"),Rt=En([" ","\t"],!1,!1),xt=function(e,t){return gr("program",{program:e.blocks,wsEnd:t})},wt=function(e,t){return gr("int_constant",{token:e,wsEnd:t})},Ft=function(e,t){return gr("literal",{literal:e,wsEnd:t})},Nt=function(e){return"#"},Lt=function(e,t,n){return gr("literal",{literal:t,wsStart:e,wsEnd:n})},Ot=function(e,t){return gr("identifier",{identifier:e,wsEnd:t})},It=function(e){return gr("identifier",{identifier:e})},kt=function(e){return gr("text",{text:e.join("")})},Mt=function(e){return gr("segment",{blocks:e})},Pt=function(e,t,n,r,i){return[r,...i.flat()]},Bt=function(e,t,n,r,i,s){return gr("define_arguments",{define:e,identifier:t,lp:n,args:r||[],rp:i,body:s})},Ut=function(e,t,n){return gr("define",{define:e,identifier:t,body:n})},$t=function(e,t){return gr("line",{line:e,value:t})},Gt=function(e,t){return gr("undef",{undef:e,identifier:t})},Vt=function(e,t){return gr("error",{error:e,message:t})},Wt=function(e,t){return gr("pragma",{pragma:e,body:t})},Ht=function(e,t,n){return gr("version",{version:e,value:t,profile:n})},jt=function(e,t,n,r){return gr("extension",{extension:e,name:t,colon:n,behavior:r})},zt=function(e,t){return{...e,wsEnd:t}},Xt=function(e,t,n){return{...e,body:n,wsEnd:t}},Kt=function(e,t,n,r,i){return gr("elseif",{token:t,expression:n,wsEnd:r,body:i})},Yt=function(e,t,n,r,i){return gr("else",{token:n,wsEnd:r,body:i})},qt=function(e,t,n,r,i){return gr("conditional",{ifPart:e,elseIfParts:t,elsePart:n,endif:r,wsEnd:i})},Qt=function(e,t){return gr("ifdef",{token:e,identifier:t})},Zt=function(e,t){return gr("ifndef",{token:e,identifier:t})},Jt=function(e,t){return gr("if",{token:e,expression:t})},en=function(e,t,n){return gr("group",{lp:e,expression:t,rp:n})},tn=function(e,t,n,r){return gr("unary_defined",{operator:e,lp:t,identifier:n,rp:r})},nn=function(e,t){return gr("unary",{operator:e,expression:t})},rn=function(e,t){return Cr(e,t)},sn=function(e,t){return vr(e,t)},on=function(e,t,n){return Er(t,n)},an=function(e,t){return Er(e,t.flat())},ln=function(e){return e},un=function(e){return e},cn=0,hn=[{line:1,column:1}],dn=0,fn=[],pn=0,mn={};if("startRule"in t){if(!(t.startRule in s))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=s[t.startRule]}function gn(e,t){return{type:"literal",text:e,ignoreCase:t}}function En(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function vn(e){return{type:"other",description:e}}function Cn(t){var n,r=hn[t];if(r)return r;for(n=t-1;!hn[n];)n--;for(r={line:(r=hn[n]).line,column:r.column};ndn&&(dn=cn,fn=[]),fn.push(e))}function An(){var e,t,n,i=75*cn+0,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Qn())!==r?(n=dr(),e=xt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}function _n(){var t,n,i,s=75*cn+2,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===a?(n=a,cn+=2):(n=r,0===pn&&Sn(ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function yn(){var t,n,i,s=75*cn+3,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===l?(n=l,cn+=2):(n=r,0===pn&&Sn(le)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function bn(){var t,n,i,s=75*cn+4,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===u?(n=u,cn+=2):(n=r,0===pn&&Sn(ue)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Tn(){var t,n,i,s=75*cn+5,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===c?(n=c,cn+=2):(n=r,0===pn&&Sn(ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Rn(){var t,n,i,s=75*cn+6,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===h?(n=h,cn+=2):(n=r,0===pn&&Sn(he)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function xn(){var t,n,i,s=75*cn+7,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===d?(n=d,cn+=2):(n=r,0===pn&&Sn(de)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function wn(){var t,n,i,s=75*cn+8,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===f?(n=f,cn+=2):(n=r,0===pn&&Sn(fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Fn(){var t,n,i,s=75*cn+9,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===p?(n=p,cn+=2):(n=r,0===pn&&Sn(pe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Nn(){var t,n,i,s=75*cn+10,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,40===e.charCodeAt(cn)?(n=m,cn++):(n=r,0===pn&&Sn(me)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Ln(){var t,n,i,s=75*cn+11,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,41===e.charCodeAt(cn)?(n=g,cn++):(n=r,0===pn&&Sn(ge)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function On(){var t,n,i,s=75*cn+12,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,44===e.charCodeAt(cn)?(n=E,cn++):(n=r,0===pn&&Sn(Ee)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function In(){var t,n,i,s=75*cn+14,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,45===e.charCodeAt(cn)?(n=C,cn++):(n=r,0===pn&&Sn(Ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function kn(){var t,n,i,s=75*cn+16,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,43===e.charCodeAt(cn)?(n=S,cn++):(n=r,0===pn&&Sn(Se)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Mn(){var t,n,i,s=75*cn+17,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,42===e.charCodeAt(cn)?(n=A,cn++):(n=r,0===pn&&Sn(Ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Pn(){var t,n,i,s=75*cn+18,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,47===e.charCodeAt(cn)?(n=_,cn++):(n=r,0===pn&&Sn(_e)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Bn(){var t,n,i,s=75*cn+19,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,37===e.charCodeAt(cn)?(n=y,cn++):(n=r,0===pn&&Sn(ye)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Un(){var t,n,i,s=75*cn+20,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,60===e.charCodeAt(cn)?(n=b,cn++):(n=r,0===pn&&Sn(be)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function $n(){var t,n,i,s=75*cn+21,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,62===e.charCodeAt(cn)?(n=T,cn++):(n=r,0===pn&&Sn(Te)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Gn(){var t,n,i,s=75*cn+22,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,124===e.charCodeAt(cn)?(n=R,cn++):(n=r,0===pn&&Sn(Re)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Vn(){var t,n,i,s=75*cn+23,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,94===e.charCodeAt(cn)?(n=x,cn++):(n=r,0===pn&&Sn(xe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Wn(){var t,n,i,s=75*cn+24,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,38===e.charCodeAt(cn)?(n=w,cn++):(n=r,0===pn&&Sn(we)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Hn(){var t,n,i,s=75*cn+26,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,35===e.charCodeAt(cn)?(i=N,cn++):(i=r,0===pn&&Sn(Ne)),(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Nt(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function jn(){var t,n,i,s,o,a,l=75*cn+27,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===L?(a=L,cn+=6):(a=r,0===pn&&Sn(Le)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function zn(){var t,n,i,s,o,a,l=75*cn+37,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===G?(a=G,cn+=4):(a=r,0===pn&&Sn(Ge)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function Xn(){var t,n,i,s,o,a,l=75*cn+42,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Ot(n,i)):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t}function Kn(){var t,n,i,s,o=75*cn+44,a=mn[o];return a?(cn=a.nextPos,a.result):(pn++,t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+46,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,J.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(qe)),i!==r){for(s=[],o=qn();o!==r;)s.push(o),o=qn();n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o=75*cn+47,a=mn[o];if(a)return cn=a.nextPos,a.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r){for(i=[],ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));s!==r;)i.push(s),ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));t=n=[n,i]}else cn=t,t=r;return mn[o]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+48,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r)if(te.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Je)),i!==r){for(s=[],ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));o!==r;)s.push(o),ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));t=n=[n,i,s]}else cn=t,t=r;else cn=t,t=r;return mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),t=n!==r?e.substring(t,cn):n)),pn--,t===r&&(n=r,0===pn&&Sn(Ke)),mn[o]={nextPos:cn,result:t},t)}function Yn(){var t,n=75*cn+45,i=mn[n];return i?(cn=i.nextPos,i.result):(Z.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(Ye)),mn[n]={nextPos:cn,result:t},t)}function qn(){var t,n=75*cn+49,i=mn[n];return i?(cn=i.nextPos,i.result):(re.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(tt)),mn[n]={nextPos:cn,result:t},t)}function Qn(){var e,t,n,i,s,o=75*cn+50,a=mn[o];if(a)return cn=a.nextPos,a.result;if(cn,t=[],(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}if(n!==r){for(;n!==r;)if(t.push(n),(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}}else t=r;return t!==r&&(t=Mt(t)),e=t,mn[o]={nextPos:cn,result:e},e}function Zn(){var t,n,i,s,o,a,l,u,c,h,d,f=75*cn+51,p=mn[f];if(p)return cn=p.nextPos,p.result;if(pn++,t=function(){var t,n,i,s,o,a,l,u,c=75*cn+54,h=mn[c];if(h)return cn=h.nextPos,h.result;if(t=cn,n=cn,i=function(){var t,n,i,s=75*cn+55,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+35,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===U?(a=U,cn+=5):(a=r,0===pn&&Sn(Ue)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Qt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+36,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===$?(a=$,cn+=6):(a=r,0===pn&&Sn($e)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Zt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+34,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,2)===B?(a=B,cn+=2):(a=r,0===pn&&Sn(Be)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r?((i=Jn())===r&&(i=null),t=Jt(n,i)):(cn=t,t=r))),pn--,t===r&&(n=r,0===pn&&Sn(at)),mn[s]={nextPos:cn,result:t},t)}(),i!==r?(ie.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(rt)),s!==r?((o=Qn())===r&&(o=null),n=Xt(i,s,o)):(cn=n,n=r)):(cn=n,n=r),n!==r){for(i=[],s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s=cn,o=function(){var t,n,i,s,o,a,l=75*cn+38,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===V?(a=V,cn+=4):(a=r,0===pn&&Sn(Ve)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a!==r?((l=Qn())===r&&(l=null),s=Yt(n,i,o,a,l)):(cn=s,s=r)):(cn=s,s=r),s===r&&(s=null),o=function(){var t,n,i,s,o,a,l=75*cn+39,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===W?(a=W,cn+=5):(a=r,0===pn&&Sn(We)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a===r&&(a=null),t=qt(n,i,s,o,a)):(cn=t,t=r)}else cn=t,t=r;return mn[c]={nextPos:cn,result:t},t}(),t===r){if(t=cn,n=cn,(i=jn())!==r)if(s=function(){var t,n,i,s,o,a,l=75*cn+43,u=mn[l];if(u)return cn=u.nextPos,u.result;if(cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r&&(n=It(n)),t=n,mn[l]={nextPos:cn,result:t},t}(),s!==r)if((o=Nn())!==r){if(a=cn,(l=Xn())!==r){for(u=[],c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);c!==r;)u.push(c),c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);a=Pt(i,s,o,l,u)}else cn=a,a=r;a===r&&(a=null),(l=Ln())!==r?((u=Jn())===r&&(u=null),n=Bt(i,s,o,a,l,u)):(cn=n,n=r)}else cn=n,n=r;else cn=n,n=r;else cn=n,n=r;if(n===r&&(n=cn,(i=jn())!==r&&(s=Xn())!==r?((o=Jn())===r&&(o=null),n=Ut(i,s,o)):(cn=n,n=r),n===r)){if(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+29,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===O?(a=O,cn+=4):(a=r,0===pn&&Sn(Oe)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r){if(s=cn,o=[],(a=qn())!==r)for(;a!==r;)o.push(a),a=qn();else o=r;(s=o!==r?e.substring(s,cn):o)!==r?n=$t(i,s):(cn=n,n=r)}else cn=n,n=r;n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+30,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===I?(a=I,cn+=5):(a=r,0===pn&&Sn(Ie)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?n=Gt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+31,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===k?(a=k,cn+=5):(a=r,0===pn&&Sn(ke)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Vt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+32,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===M?(a=M,cn+=6):(a=r,0===pn&&Sn(Me)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Wt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+40,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,7)===H?(a=H,cn+=7):(a=r,0===pn&&Sn(He)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Kn())!==r?((o=Jn())===r&&(o=null),n=Ht(i,s,o)):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+41,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,9)===j?(a=j,cn+=9):(a=r,0===pn&&Sn(je)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?(o=function(){var t,n,i,s=75*cn+25,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,58===e.charCodeAt(cn)?(n=F,cn++):(n=r,0===pn&&Sn(Fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),o!==r&&(a=Jn())!==r?n=jt(i,s,o,a):(cn=n,n=r)):(cn=n,n=r))))))}n!==r?(ie.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(rt)),i===r&&(i=null),t=zt(n,i)):(cn=t,t=r)}return pn--,t===r&&(n=r,0===pn&&Sn(nt)),mn[f]={nextPos:cn,result:t},t}function Jn(){var t,n,i,s=75*cn+52,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st)),i!==r)for(;i!==r;)n.push(i),se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(it)),mn[s]={nextPos:cn,result:t},t}function er(){var t,n,i,s,o,a,l=75*cn+53,u=mn[l];if(u)return cn=u.nextPos,u.result;if(pn++,t=cn,n=cn,i=cn,pn++,s=cn,(o=pr())===r&&(o=null),35===e.charCodeAt(cn)?(a=N,cn++):(a=r,0===pn&&Sn(Ne)),a!==r?s=o=[o,a]:(cn=s,s=r),pn--,s===r?i=void 0:(cn=i,i=r),i!==r){if(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st)),o!==r)for(;o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));else s=r;s!==r?(ie.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(rt)),o===r&&(o=null),n=i=[i,s,o]):(cn=n,n=r)}else cn=n,n=r;return n===r&&(ie.test(e.charAt(cn))?(n=e.charAt(cn),cn++):(n=r,0===pn&&Sn(rt))),t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(ot)),mn[l]={nextPos:cn,result:t},t}function tr(){var t,n,i,s,o,a=75*cn+57,l=mn[a];return l?(cn=l.nextPos,l.result):(pn++,t=cn,n=function(){var t,n,i,s,o=75*cn+33,a=mn[o];return a?(cn=a.nextPos,a.result):(t=cn,n=dr(),e.substr(cn,7)===P?(i=P,cn+=7):(i=r,0===pn&&Sn(Pe)),i!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[o]={nextPos:cn,result:t},t)}(),n!==r?((i=Nn())===r&&(i=null),(s=Xn())!==r?((o=Ln())===r&&(o=null),t=tn(n,i,s,o)):(cn=t,t=r)):(cn=t,t=r),t===r&&(t=cn,(n=kn())===r&&(n=In())===r&&(n=function(){var t,n,i,s=75*cn+13,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,33===e.charCodeAt(cn)?(n=v,cn++):(n=r,0===pn&&Sn(ve)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),n===r&&(n=function(){var t,n,i,s=75*cn+15,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,126===e.charCodeAt(cn)?(n=D,cn++):(n=r,0===pn&&Sn(De)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}())),n!==r&&(i=tr())!==r?t=nn(n,i):(cn=t,t=r),t===r&&(t=function(){var e,t,n,i,s=75*cn+56,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,e=function(){var e,t,n,i=75*cn+1,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Kn())!==r?(n=dr(),e=wt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}(),e===r&&(e=cn,(t=Nn())!==r&&(n=hr())!==r&&(i=Ln())!==r?e=en(t,n,i):(cn=e,e=r),e===r&&(e=Xn())),pn--,e===r&&(t=r,0===pn&&Sn(lt)),mn[s]={nextPos:cn,result:e},e)}())),pn--,t===r&&(n=r,0===pn&&Sn(ut)),mn[a]={nextPos:cn,result:t},t)}function nr(){var e,t,n,i,s,o,a=75*cn+58,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=tr())!==r){for(n=[],i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ct)),mn[a]={nextPos:cn,result:e},e}function rr(){var e,t,n,i,s,o,a=75*cn+59,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=nr())!==r){for(n=[],i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ht)),mn[a]={nextPos:cn,result:e},e}function ir(){var e,t,n,i,s,o,a=75*cn+60,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=rr())!==r){for(n=[],i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(dt)),mn[a]={nextPos:cn,result:e},e}function sr(){var e,t,n,i,s,o,a=75*cn+61,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ir())!==r){for(n=[],i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ft)),mn[a]={nextPos:cn,result:e},e}function or(){var e,t,n,i,s,o,a=75*cn+62,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=sr())!==r){for(n=[],i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(pt)),mn[a]={nextPos:cn,result:e},e}function ar(){var e,t,n,i,s,o,a=75*cn+63,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=or())!==r){for(n=[],i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(mt)),mn[a]={nextPos:cn,result:e},e}function lr(){var e,t,n,i,s,o,a=75*cn+64,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ar())!==r){for(n=[],i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(gt)),mn[a]={nextPos:cn,result:e},e}function ur(){var e,t,n,i,s,o,a=75*cn+65,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=lr())!==r){for(n=[],i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Et)),mn[a]={nextPos:cn,result:e},e}function cr(){var e,t,n,i,s,o,a=75*cn+66,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ur())!==r){for(n=[],i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(vt)),mn[a]={nextPos:cn,result:e},e}function hr(){var e,t=75*cn+68,n=mn[t];return n?(cn=n.nextPos,n.result):(pn++,e=function(){var e,t,n,i,s,o,a=75*cn+67,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=cr())!==r){for(n=[],i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Ct)),mn[a]={nextPos:cn,result:e},e}(),pn--,e===r&&0===pn&&Sn(Dt),mn[t]={nextPos:cn,result:e},e)}function dr(){var e,t,n,i,s,o,a=75*cn+69,l=mn[a];if(l)return cn=l.nextPos,l.result;for(pn++,cn,(t=pr())===r&&(t=null),n=[],i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);return e=sn(t,n),pn--,t=r,0===pn&&Sn(St),mn[a]={nextPos:cn,result:e},e}function fr(){var t,n,i,s,o,a,l=75*cn+70,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=function(){var t,n,i,s,o,a=75*cn+71,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,e.substr(cn,2)===X?(i=X,cn+=2):(i=r,0===pn&&Sn(At)),i!==r){for(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),t===r)if(t=cn,n=function(){var t,n,i,s,o,a,l,u=75*cn+72,c=mn[u];if(c)return cn=c.nextPos,c.result;if(t=cn,n=cn,e.substr(cn,2)===K?(i=K,cn+=2):(i=r,0===pn&&Sn(_t)),i!==r){for(s=[],o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);o!==r;)s.push(o),o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);e.substr(cn,2)===Y?(o=Y,cn+=2):(o=r,0===pn&&Sn(yt)),o!==r?n=i=[i,s,o]:(cn=n,n=r)}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[u]={nextPos:cn,result:t},t}(),n!==r){for(i=[],s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);t=an(n,i)}else cn=t,t=r;return mn[l]={nextPos:cn,result:t},t}function pr(){var t,n,i,s=75*cn+73,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt)),i!==r)for(;i!==r;)n.push(i),oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(Tt)),mn[s]={nextPos:cn,result:t},t}function mr(){var t,n,i,s=75*cn+74,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,pn++,Q.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Xe)),pn--,i===r?n=void 0:(cn=n,n=r),n!==r?(i=dr(),t=un(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}e=lh(e);const gr=(e,t)=>({type:e,...t}),Er=(...e)=>e.flat().filter(e=>null!=e&&""!==e&&0!==e.length),vr=(...e)=>{return(t=Er(e.flat())).length>1?t:t[0];var t},Cr=(...e)=>e.flat().reduce((e,[t,n])=>({type:"binary",operator:t,left:e,right:n}));if((n=o())!==r&&cn===e.length)return n;throw n!==r&&cn0){for(t=1,n=1;ts.length)throw new Error("'".concat(t,"': Too many arguments for macro"));if(u.length>":return t(n)>>t(r);case"<":return t(n)":return t(n)>t(r);case"<=":return t(n)<=t(r);case">=":return t(n)>=t(r);case"==":return t(n)==t(r);case"!=":return t(n)!=t(r);case"&":return t(n)&t(r);case"^":return t(n)^t(r);case"|":return t(n)|t(r);case"&&":return t(n)&&t(r);case"||":return t(n)||t(r);default:throw new Error("Preprocessing error: Unknown binary operator ".concat(i))}},unary:function(e,t){switch(e.operator.literal){case"+":return t(e.expression);case"-":return-1*t(e.expression);case"!":return!t(e.expression);case"~":return~t(e.expression);default:throw new Error("Preprocessing error: Unknown unary operator ".concat(e.operator.literal))}}},(r=function(e){var t=n[e.type];if(!t)throw new Error("No evaluate() evaluator for ".concat(e.type));return t(e,r)})(e);var n,r}((n=sh(r,t).trim(),eh(s)(n,{grammarSource:"expression",startRule:"constant_expression"})),t)},lh=function(e,t){return void 0===t&&(t={}),e.replace(/\\[\n\r]/g,"")},uh=function(e,t){void 0===t&&(t={});var n,r,i,s,o=Object.entries(t.defines||{}).reduce(function(e,t){var n,r=t[0],i=t[1];return th(th({},e),((n={})[r]={body:i},n))},{}),a=(void 0===(n=t.preserve)&&(n={}),function(e){var t=null==n?void 0:n[e.node.type];return"function"==typeof t?t(e):t});return r={conditional:{enter:function(e){var t=e,n=t.node;a(t)||(function(e,t){return"if"===t.type?!!t.expression&&oh(ah(t.expression,e)):"ifdef"===t.type?t.identifier.identifier in e:"ifndef"===t.type?!(t.identifier.identifier in e):void 0}(o,n.ifPart)?t.replaceWith(n.ifPart.body):n.elseIfParts.reduce(function(e,n){return e||oh(ah(n.expression,o))&&(t.replaceWith(n.body),!0)},!1)||(n.elsePart?t.replaceWith(n.elsePart.body):t.remove()))}},text:{enter:function(e){var t=e;t.node.text=sh(t.node.text,o)}},define_arguments:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body,s=n.args;o[r]={args:s,body:i},!a(t)&&t.remove()}},define:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body;o[r]={body:i},!a(t)&&t.remove()}},undef:{enter:function(e){var t=e;delete o[t.node.identifier.identifier],!a(t)&&t.remove()}},error:{enter:function(e){var n=e;if(t.stopOnError)throw new Error(n.node.message);!a(n)&&n.remove()}},pragma:{enter:function(e){var t=e;!a(t)&&t.remove()}},version:{enter:function(e){var t=e;!a(t)&&t.remove()}},extension:{enter:function(e){var t=e;!a(t)&&t.remove()}},line:{enter:function(e){var t=e;!a(t)&&t.remove()}}},i=!1,(s=function(e,t,n,o,a){var l;if(!i){var u=r[e.type],c=function(e,t,n,r,i){return{node:e,parent:t,parentPath:n,key:r,index:i,stop:function(){this.stopped=!0},skip:function(){this.skipped=!0},remove:function(){this.removed=!0},replaceWith:function(e){this.replaced=e},findParent:function(e){return n?e(n)?n:n.findParent(e):n}}}(e,t,n,o,a),h=t;if(null==u?void 0:u.enter){if(u.enter(c),c.removed){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));return"number"==typeof a?h[o].splice(a,1):h[o]=null,c}if(c.replaced){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));"number"==typeof a?h[o].splice(a,1,c.replaced):h[o]=c.replaced}if(c.skipped)return c}if(c.stopped)i=!0;else if(c.replaced){var d=c.replaced;s(d,t,n,o,a)}else Object.entries(e).filter(function(e){return e[0],function(e){return function(e){return!!(null==e?void 0:e.type)}(e)||Array.isArray(e)}(e[1])}).forEach(function(t){var n=t[0],r=t[1];if(Array.isArray(r))for(var o=0,a=0;o-a{let e=!0;return n?(i({source:o,formatted:null,error:""}),function(e){return Gs(e,{parser:"glsl-parser",plugins:[Gc],printWidth:80,tabWidth:4,useTabs:!1}).then(Vc)}(o).then(t=>{e&&i({source:o,formatted:t,error:""})}).catch(t=>{if(!e)return;const n=dh(t);a.error("shader formatting failed: "+n),i({source:o,formatted:null,error:n})}),()=>{e=!1}):(i({source:o,formatted:null,error:""}),()=>{e=!1})},[n,o]);const c=n&&r.source===o?r.formatted:null;return{source:c||o,formatted:!!c,preprocessed:u,error:(r.source===o?r.error:"")||l}}(C.source,C.preprocessed,e.beautify),S=D.source,A=C.edited,_=[e.fragment?e.sourceFragmentLog:e.sourceVertexLog,e.programLog].filter(e=>!!e).join("\n"),y=!e.translated&&!D.preprocessed&&!D.formatted,b=function(e,t,n,r){return!(e||t||!n||r)}(t,A,_,y);(0,dt.useLayoutEffect)(()=>{g.current={programId:e.programId,sourceVertex:e.sourceVertex,sourceFragment:e.sourceFragment}},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!d.current)return;if(!f.current){const e=ace.edit(d.current);e.setTheme("ace/theme/monokai"),e.getSession().setMode("ace/mode/glsl"),e.setShowPrintMargin(!1),f.current=e}const t=f.current;t.setReadOnly(!e.editable||e.translated),t.getValue()!==S&&t.setValue(S,-1);const n=()=>{const n=t.getValue();e.fragment?m.current.fragment=n:m.current.vertex=n,v(t=>e.fragment?t.fragment?t:Object.assign(Object.assign({},t),{fragment:!0}):t.vertex?t:Object.assign(Object.assign({},t),{vertex:!0})),function(e,t,n,r){e&&n(!1),t&&r(!1)}(e.beautify,e.preprocessed,c,h),-1!==p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{if(p.current=-1,!function(e,t){return e.programId===t.programId&&e.sourceVertex===t.sourceVertex&&e.sourceFragment===t.sourceFragment}(g.current,e))return;const t={sourceVertex:m.current.vertex,sourceFragment:m.current.fragment,translatedSourceVertex:e.translatedSourceVertex,translatedSourceFragment:e.translatedSourceFragment,programId:e.programId};u(t)},1500)},r=e.editable&&!e.translated;return r&&t.getSession().on("change",n),()=>{r&&t.getSession().off("change",n)}},[S,e.editable,e.translated,e.fragment,e.beautify,e.preprocessed,e.sourceVertex,e.sourceFragment,e.translatedSourceVertex,e.translatedSourceFragment,e.programId,c,h,u]),(0,dt.useEffect)(()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),m.current={baseProgramId:e.programId,baseVertex:e.sourceVertex,baseFragment:e.sourceFragment,vertex:e.sourceVertex,fragment:e.sourceFragment},v({vertex:!1,fragment:!1})},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!f.current)return;const e=t||(y&&!A?_:"");f.current.getSession().setAnnotations(function(e){if(!e)return[];const t=[],n=e.split(/\r?\n/);for(const e of n){const n=e.replace(/\0/g,"").trim();if(!n)continue;let r=/^(error|warning|info)\s*:\s*\d+\s*:\s*(\d+)(?:\s*:\s*(\d+))?\s*:\s*(.*)$/i.exec(n);if(r){t.push(Pt(r[1],r[2],r[3],r[4]));continue}if(r=/^\d+\s*\(\s*(\d+)\s*\)\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[2],r[1],"",r[3]));continue}if(r=/^\d+\s*:\s*(\d+)(?:\s*\(\s*(\d+)\s*\))?\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[3],r[1],r[2],r[4]));continue}const i=/\b(error|warning|info)\b/i.exec(n);t.push({row:0,column:0,text:n,type:i?i[1].toLowerCase():"info"})}return t}(e))},[_,y,t,D.formatted,D.preprocessed,A,e.beautify,e.fragment,e.programLog,e.sourceFragmentLog,e.sourceVertexLog,e.translated]),(0,dt.useEffect)(()=>()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),f.current&&(f.current.destroy(),f.current=null)},[]);const T=(0,dt.useCallback)(e=>{e.preventDefault(),n()},[n]),R=(0,dt.useCallback)(e=>{e.preventDefault(),r()},[r]),x=(0,dt.useCallback)(e=>{e.preventDefault(),null==i||i()},[i]),w=(0,dt.useCallback)(e=>{e.preventDefault(),null==o||o()},[o]),F=(0,dt.useCallback)(e=>{e.preventDefault(),l()},[l]),N=!e.singleShader||!e.fragment,L=!e.singleShader||e.fragment,O=D.error;return(0,mt.jsxs)("div",{className:"sourceCodeComponentContainer",children:[(0,mt.jsx)("div",{className:"sourceCodeMenuComponentContainer",children:(0,mt.jsxs)("ul",{className:"sourceCodeMenuComponent",children:[N&&e.translatedSourceVertex&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:!e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedVertexSourceClicked",onClick:x,children:"Translated Vertex"})}),L&&e.translatedSourceFragment&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedFragmentSourceClicked",onClick:w,children:"Translated Fragment"})}),N&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment||e.translated?"":"active",href:"#",role:"button",commandName:"onVertexSourceClicked",onClick:T,children:"Vertex"})}),L&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&!e.translated?"active":"",href:"#",role:"button",commandName:"onFragmentSourceClicked",onClick:R,children:"Fragment"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onSourceCodeCloseClicked",onClick:F,children:"Close"})})]})}),(0,mt.jsx)("div",{className:"sourceCodeComponent",ref:d}),(0,mt.jsx)(hh,{beautify:e.beautify,capturedDiagnosticsHidden:b,fragment:e.fragment,preprocessed:e.preprocessed,processingError:O,onBeautifyChanged:c,onFragmentSourceClicked:r,onPreprocessChanged:h,onVertexSourceClicked:n})]})}function hh({beautify:e,capturedDiagnosticsHidden:t,fragment:n,preprocessed:r,processingError:i,onBeautifyChanged:s,onFragmentSourceClicked:o,onPreprocessChanged:a,onVertexSourceClicked:l}){const u=(0,dt.useCallback)(e=>{s(e.target.checked)},[s]),c=(0,dt.useCallback)(e=>{a(e.target.checked)},[a]),h=(0,dt.useCallback)(e=>{e.preventDefault(),(n?o:l)(),s(!1),a(!1)},[n,s,o,a,l]);return(0,mt.jsx)("div",{className:"sourceCodeMenuComponentFooter",children:(0,mt.jsxs)("p",{children:[(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onBeautifyChanged",checked:e,onChange:u})," Beautify"]}),(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onPreprocessChanged",checked:r,onChange:c})," Preprocess"]}),i&&(0,mt.jsx)("span",{className:"sourceCodeFormatError",role:"alert",title:i,children:"Shader processing failed"}),t&&(0,mt.jsxs)("span",{className:"sourceCodeDiagnosticsNotice",role:"status",children:["Captured diagnostics hidden."," ",(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onShowCapturedDiagnostics",onClick:h,children:"Show original with diagnostics"})]})]})})}function dh(e){return e instanceof Error?e.message:String(e)}function fh({title:e,children:t}){const n=e?e.replace(/([A-Z])/g," $1").trim():"";return(0,mt.jsxs)("div",{className:"jsonGroupComponent",children:[(0,mt.jsx)("div",{className:"jsonGroupComponentTitle",children:n}),(0,mt.jsx)("ul",{children:t})]})}function ph({itemKey:e,value:t}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsx)("span",{className:"jsonItemComponentValue",children:t})]})}function mh({itemKey:e,value:t,pixelated:n,raw:r}){const i=bt();return(0,mt.jsx)("li",{className:"jsonItemImageHolder",children:(0,mt.jsxs)("div",{className:"jsonItemImage jsonItemImageClickable",children:[(0,mt.jsx)("img",{src:t,style:n?{imageRendering:"pixelated"}:void 0,title:"Open in texture viewer",onClick:()=>i.openTextureViewer({src:t,label:e,pixelated:n,raw:r||null})}),(0,mt.jsx)("span",{children:e})]})})}function gh({itemKey:e,value:t,help:n}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("span",{className:"jsonItemComponentValue",children:[t+" (",(0,mt.jsx)("a",{href:n,target:"_blank",className:"jsonSourceItemComponentOpen",children:"Open help page"}),")"]})]})}function Eh({visualState:e}){const t=bt();return(0,mt.jsxs)("div",{className:"jsonVisualStateItemComponent",children:[e.Attachments?e.Attachments.map((n,r)=>n.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{className:"jsonItemImageClickable",src:encodeURI(n.src),title:"Open in texture viewer",onClick:()=>t.openTextureViewer({src:n.src,label:n.attachmentName||"Attachment",pixelated:!1,raw:n.raw||null})}),e.Attachments.length>1&&(0,mt.jsx)("span",{children:n.attachmentName})]},r):null):(0,mt.jsx)("span",{children:e.FrameBufferStatus}),(0,mt.jsx)("span",{children:e.FrameBuffer?e.FrameBuffer.__SPECTOR_Object_TAG.displayText:"Canvas frame buffer"})]})}function vh({itemKey:e,shader:t,programLog:n,onOpen:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),null==r||r(t,n)},[r,n,t]),s=t.source?t.source.length:0,o=`${t.name||"Shader"} (${s} chars)`;return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("a",{href:"#",role:"button",className:"jsonSourceItemComponentOpen",commandName:"onShaderSourceOpen",onClick:i,children:["Open ",o]})]})}function Ch({items:e,onShaderSourceOpen:t}){return e&&0!==e.length?(0,mt.jsx)(mt.Fragment,{children:e.map((e,n)=>{switch(e.type){case"group":return(0,mt.jsx)(fh,{title:e.title,children:(0,mt.jsx)(Ch,{items:e.children,onShaderSourceOpen:t})},n);case"item":return(0,mt.jsx)(ph,{itemKey:e.key,value:e.value},n);case"image":return(0,mt.jsx)(mh,{itemKey:e.key,value:e.value,pixelated:e.pixelated,raw:e.raw},n);case"help":return(0,mt.jsx)(gh,{itemKey:e.key,value:e.value,help:e.help},n);case"shaderSource":return(0,mt.jsx)(vh,{itemKey:e.key,shader:e.shader,programLog:e.programLog,onOpen:t},n);case"visualState":return(0,mt.jsx)(Eh,{visualState:e.visualState},n);default:return null}})}):null}const Dh={added:"+",removed:"-",changed:"~",unchanged:" "};function Sh(e){const t=void 0===e.indexA?"_":String(e.indexA),n=void 0===e.indexB?"_":String(e.indexB);return e.type+"#"+t+"#"+n}function Ah(e){return!(!e.previousImage&&!e.currentImage)}function _h(){const e=bt(),t=pt(e.store),[n,r]=(0,dt.useState)(null);if((0,dt.useEffect)(()=>{r(null)},[t.compareRows]),!t.canCompare)return(0,mt.jsx)("div",{className:"compareViewComponent",children:(0,mt.jsx)("div",{className:"compareViewEmpty",children:"Capture the same page at least twice, then select a capture to compare it against the previous one."})});const{added:i,removed:s,changed:o,unchanged:a}=t.compareSummary,l=t.compareOnlyDifferences?t.compareRows.filter(e=>"unchanged"!==e.type):t.compareRows,u=l.find(e=>Sh(e)===n)||(l.length>0?l[0]:null),c=u?Sh(u):"";return(0,mt.jsxs)("div",{className:"compareViewComponent",children:[(0,mt.jsxs)("div",{className:"compareViewHeader",children:[(0,mt.jsx)("span",{className:"compareViewLabel",children:t.compareLabel}),(0,mt.jsxs)("span",{className:"compareViewSummary",children:[(0,mt.jsxs)("span",{className:"added",children:["+",i]}),(0,mt.jsxs)("span",{className:"removed",children:["-",s]}),(0,mt.jsxs)("span",{className:"changed",children:["~",o]}),(0,mt.jsxs)("span",{className:"unchanged",children:["=",a]})]}),(0,mt.jsxs)("label",{className:"compareViewToggle",children:[(0,mt.jsx)("input",{type:"checkbox",checked:t.compareOnlyDifferences,onChange:t=>e.handleCompareOnlyDifferencesChange(t.target.checked)}),"Differences only"]})]}),(0,mt.jsxs)("div",{className:"compareViewBody",children:[(0,mt.jsx)(yh,{}),(0,mt.jsx)("ul",{className:"compareViewList",children:0===l.length?(0,mt.jsx)("li",{className:"compareViewEmptyRow",children:"No differences between these two captures."}):l.map(e=>{const t=Sh(e);return(0,mt.jsx)(bh,{row:e,selected:t===c,onSelect:()=>r(t)},t)})}),(0,mt.jsx)("div",{className:"compareViewDetail",children:u?(0,mt.jsx)(Th,{row:u,onSelectCommand:e.handleCompareCommandSelected,onOpenTexture:(t,n)=>e.openTextureViewer({src:t,label:n,pixelated:!1,raw:null})}):(0,mt.jsx)("div",{className:"compareDetailEmpty",children:"Select a call to see its details."})})]})]})}function yh(){return(0,mt.jsxs)("div",{className:"compareViewLegend",children:[(0,mt.jsxs)("div",{className:"compareLegendRow added",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Added"]}),(0,mt.jsxs)("div",{className:"compareLegendRow removed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Removed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow changed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Changed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow unchanged",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Unchanged"]})]})}function bh(e){const{row:t,selected:n,onSelect:r}=e,i="removed"===t.type?t.previousText:t.currentText,s=i&&0===i.indexOf(t.name)?i.slice(t.name.length):"",o="compareRow "+t.type+(n?" selected":"");return(0,mt.jsxs)("li",{className:o,onClick:r,title:i,children:[(0,mt.jsx)("span",{className:"compareSign",children:Dh[t.type]}),(0,mt.jsxs)("span",{className:"compareRowText",children:[(0,mt.jsx)("span",{className:"compareCmdName",children:t.name}),s]})]})}function Th(e){const{row:t,onSelectCommand:n,onOpenTexture:r}=e,i=t.fieldDiffs||[],s=i.filter(e=>!Ah(e)),o=i.filter(Ah),a="changed"===t.type&&t.previousText!==t.currentText,l="removed"===t.type?t.previousText:t.currentText;return(0,mt.jsxs)("div",{className:"compareDetail",children:[(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Command"}),(0,mt.jsxs)("ul",{children:[(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"name"}),":"," ",(0,mt.jsx)("span",{className:"compareCmdName "+t.type,children:t.name})]}),(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"call"}),":"," ",a?(0,mt.jsxs)("span",{className:"compareTextChange",children:[(0,mt.jsx)("span",{className:"compareOld",children:t.previousText}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:t.currentText})]}):(0,mt.jsx)("span",{className:"compareNew",children:l})]}),void 0!==t.commandId&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",className:"compareCommandLink",title:"Show this command in the Commands view",onClick:e=>{e.preventDefault(),n(t.commandId)},children:"Show in Commands view →"})})]})]}),s.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Uniform & state changes"}),(0,mt.jsx)("ul",{children:s.map((e,t)=>(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),":"," ",(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:e.current})]},t))})]}),o.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Texture changes"}),(0,mt.jsx)("ul",{children:o.map((e,t)=>(0,mt.jsxs)("li",{className:"compareTextureItem",children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),(0,mt.jsxs)("div",{className:"compareImageDiff",children:[e.previousImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.previousImage,title:"Open in texture viewer",onClick:()=>r(e.previousImage,e.path+" (previous)")}):(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),e.currentImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.currentImage,title:"Open in texture viewer",onClick:()=>r(e.currentImage,e.path+" (current)")}):(0,mt.jsx)("span",{className:"compareNew",children:e.current})]})]},t))})]})]})}function Rh(e){const t=(255&e).toString(16);return 1===t.length?"0"+t:t}function xh(e,t,n,r){return"#"+Rh(e)+Rh(t)+Rh(n)+Rh(r)}function wh(e,t,n,r){const i=e=>(e/255).toFixed(2);return i(e)+", "+i(t)+", "+i(n)+", "+i(r)}function Fh(){const e=bt(),t=pt(e.store).textureViewer;return t.open?(0,mt.jsx)(Lh,{viewer:t,onClose:e.closeTextureViewer}):null}const Nh=120;function Lh(e){const{viewer:t,onClose:n}=e,r=(0,dt.useRef)(null),i=(0,dt.useRef)(null),s=(0,dt.useRef)(null),o=(0,dt.useRef)(null),[a,l]=(0,dt.useState)({r:!0,g:!0,b:!0,a:!0}),[u,c]=(0,dt.useState)(1),[h,d]=(0,dt.useState)("checker"),[f,p]=(0,dt.useState)(null),[m,g]=(0,dt.useState)(null),[E,v]=(0,dt.useState)(!1);(0,dt.useEffect)(()=>{let e=!1;const n=t=>{e||(o.current=t,p({width:t.width,height:t.height}),c(kh(t.width,t.height)),v(!0))};if(t.raw){const r=function(e){try{if(!e.data||e.width<=0||e.height<=0)return null;const t=function(e){const t=atob(e),n=new Uint8ClampedArray(t.length);for(let e=0;e{e=!0}}const r=new Image;return r.onload=()=>{const e=document.createElement("canvas");e.width=r.naturalWidth||1,e.height=r.naturalHeight||1;const t=e.getContext("2d");if(!t)return;t.drawImage(r,0,0);const i=t.getImageData(0,0,e.width,e.height);n({data:new Uint8ClampedArray(i.data),width:e.width,height:e.height})},r.src=t.src,()=>{e=!0}},[t.src,t.raw]),(0,dt.useEffect)(()=>{const e=o.current,t=r.current;if(!E||!e||!t)return;const n=function(e,t,n){let r=e.current;return r||(r=document.createElement("canvas"),e.current=r),r.width!==t&&(r.width=t),r.height!==n&&(r.height=n),r}(s,e.width,e.height),i=n.getContext("2d"),l=t.getContext("2d");if(!i||!l)return;const c=function(e,t){const n=new Uint8ClampedArray(e.length),r=t.a&&!t.r&&!t.g&&!t.b;for(let i=0;i{const e=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]);const C="textureViewerViewport"+("checker"===h?" checker":""),D="black"===h?{background:"#000"}:"white"===h?{background:"#fff"}:void 0;return(0,mt.jsx)("div",{className:"textureViewerOverlay",onClick:n,children:(0,mt.jsxs)("div",{className:"textureViewerModal",onClick:e=>e.stopPropagation(),children:[(0,mt.jsxs)("div",{className:"textureViewerHeader",children:[(0,mt.jsx)("span",{className:"textureViewerTitle",children:t.label}),(0,mt.jsxs)("span",{className:"textureViewerMeta",children:[f?f.width+" × "+f.height:"",!t.raw&&f?" · thumbnail":""]}),(0,mt.jsx)("span",{className:"textureViewerClose",title:"Close (Esc)",onClick:n,children:"✕"})]}),(0,mt.jsxs)("div",{className:"textureViewerToolbar",children:[(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Channels"}),(0,mt.jsx)(Oh,{channel:"r",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"g",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"b",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"a",mask:a,setMask:l})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"tvBtn",title:"Force alpha = 1 to reveal RGB hidden behind transparency",onClick:()=>l({r:!0,g:!0,b:!0,a:!1}),children:"Opaque"}),(0,mt.jsx)("span",{className:"tvBtn",title:"Show the alpha channel as grayscale",onClick:()=>l({r:!1,g:!1,b:!1,a:!0}),children:"Alpha → gray"})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"BG"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)(Ih,{value:"checker",glyph:"▦",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"black",glyph:"■",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"white",glyph:"□",background:h,setBackground:d})]})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Zoom"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.max(1,e/2)),children:"−"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(f?kh(f.width,f.height):1),children:"Fit"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.min(32,2*e)),children:"+"})]}),(0,mt.jsxs)("span",{className:"zoomVal",children:[Math.round(100*u),"%"]})]}),(0,mt.jsx)("div",{className:"textureViewerGroup textureViewerGroupEnd",children:(0,mt.jsx)("span",{className:"tvBtn primary",onClick:()=>{const e=s.current;e&&e.toBlob(e=>{if(!e)return;const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=((t.label||"texture").replace(/[^a-z0-9_\-]+/gi,"_").replace(/^_+|_+$/g,"")||"texture")+".png",r.click(),setTimeout(()=>URL.revokeObjectURL(n),0)})},children:"⭳ Save PNG"})})]}),(0,mt.jsxs)("div",{className:"textureViewerBody",children:[(0,mt.jsxs)("div",{className:C,style:D,children:[(0,mt.jsx)("canvas",{ref:r,className:"textureViewerCanvas",onMouseMove:e=>{const t=o.current,n=r.current,a=i.current,l=s.current;if(!t||!n)return;const c=n.getBoundingClientRect(),h=Math.floor((e.clientX-c.left)/u),d=Math.floor((e.clientY-c.top)/u);if(h<0||d<0||h>=t.width||d>=t.height)return g(null),void(a&&(a.style.display="none"));const f=4*(d*t.width+h);g({x:h,y:d,r:t.data[f],g:t.data[f+1],b:t.data[f+2],a:t.data[f+3]}),function(e,t,n,r){if(!e||!t)return;const i=e.getContext("2d");if(!i)return;i.imageSmoothingEnabled=!1,i.clearRect(0,0,Nh,Nh),i.drawImage(t,n-7,r-7,15,15,0,0,Nh,Nh),i.strokeStyle="#F0640D",i.lineWidth=2,i.strokeRect(56,56,8,8),e.style.display="block"}(a,l,h,d)},onMouseLeave:()=>{g(null),i.current&&(i.current.style.display="none")}}),(0,mt.jsx)("canvas",{ref:i,className:"textureViewerLoupe",width:Nh,height:Nh})]}),(0,mt.jsxs)("div",{className:"textureViewerRail",children:[(0,mt.jsx)("div",{className:"railTitle",children:"Pixel inspector"}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"position"}),(0,mt.jsx)("span",{className:"v",children:m?m.x+", "+m.y:"—"})]}),(0,mt.jsx)("div",{className:"swatch",children:(0,mt.jsx)("div",{className:"swatchInner",style:m?{background:"rgba("+m.r+","+m.g+","+m.b+","+m.a/255+")"}:void 0})}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"R"}),(0,mt.jsx)("span",{className:"v",children:m?m.r:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"G"}),(0,mt.jsx)("span",{className:"v",children:m?m.g:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"B"}),(0,mt.jsx)("span",{className:"v",children:m?m.b:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"A"}),(0,mt.jsx)("span",{className:"v",children:m?m.a:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"hex"}),(0,mt.jsx)("span",{className:"v",children:m?xh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"norm"}),(0,mt.jsx)("span",{className:"v",children:m?wh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"hint",children:["Move over the texture to sample pixels. Toggle channels to isolate RGB / alpha.",(0,mt.jsx)("b",{children:" Opaque"})," reveals colour hidden behind transparency (#183)."]})]})]})]})})}function Oh(e){const{channel:t,mask:n,setMask:r}=e,i=n[t],s="channel "+t+(i?" on":"");return(0,mt.jsx)("span",{className:s,onClick:()=>r(Object.assign(Object.assign({},n),{[t]:!i})),children:t.toUpperCase()})}function Ih(e){const{value:t,glyph:n,background:r,setBackground:i}=e;return(0,mt.jsx)("span",{className:"tvBtn"+(r===t?" active":""),onClick:()=>i(t),children:n})}function kh(e,t){return Math.max(1,Math.min(16,Math.floor(480/Math.max(e,t))||1))}function Mh(){const e=bt(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"resultViewComponent "+(t.visible?"active":""),children:[(0,mt.jsx)(Tt,{}),(0,mt.jsxs)(Rt,{children:[0===t.menuStatus&&(0,mt.jsx)(wt,{active:!0,captures:t.captures,onCaptureSelected:t=>{e.selectCapture(t),e.handleMenuStatusChange(40)},onSaveRequested:e.handleSaveRequested,onCaptureLoaded:e.handleCaptureLoaded}),40===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(Ft,{children:t.visualStates.map((t,n)=>(0,mt.jsx)(Nt,{item:t,onVisualStateSelected:()=>e.handleVisualStateSelected(n)},n))}),(0,mt.jsx)(Lt,{children:t.commands.map((t,n)=>(0,mt.jsx)(Ot,{command:t,onCommandSelected:()=>e.handleCommandSelected(n),onVertexSelected:()=>e.handleVertexSelected(n),onFragmentSelected:()=>e.handleFragmentSelected(n),onShaderSelected:()=>e.handleShaderSelected(n)},n))}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]}),10===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(kt,{left:!0,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationLeft})})}),(0,mt.jsx)(kt,{left:!1,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationRight})})})]}),20===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.initStateData})}),30===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.endStateData})}),60===t.menuStatus&&(0,mt.jsx)(_h,{}),50===t.menuStatus&&t.sourceCodeState&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(ch,{state:t.sourceCodeState,errorMessage:t.sourceCodeError,onVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!1),onFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!1),onTranslatedVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!0),onTranslatedFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!0),onCloseClicked:e.handleSourceCodeClose,onSourceCodeChanged:e.handleSourceCodeChanged,onBeautifyChanged:e.handleBeautifyChanged,onPreprocessChanged:e.handlePreprocessChanged}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]})]}),(0,mt.jsx)(Fh,{})]})}class Ph{static getMDNLink(e){const t=Ph.WebGL2Functions[e];if(t)return Ph.WebGL2RootUrl+t;const n=Ph.WebGLFunctions[e];if(n)return Ph.WebGLRootUrl+n;const r=Ph.AngleInstancedArraysExtFunctions[e];return r?Ph.AngleInstancedArraysExtRootUrl+r:Ph.WebGLRootUrl+e}}Ph.WebGL2RootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/",Ph.WebGLRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/",Ph.AngleInstancedArraysExtRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/",Ph.WebGL2Functions={beginQuery:"beginQuery",beginTransformFeedback:"beginTransformFeedback",bindBufferBase:"bindBufferBase",bindBufferRange:"bindBufferRange",bindSampler:"bindSampler",bindTransformFeedback:"bindTransformFeedback",bindVertexArray:"bindVertexArray",blitFramebuffer:"blitFramebuffer",clearBufferfv:"clearBuffer",clearBufferiv:"clearBuffer",clearBufferuiv:"clearBuffer",clearBufferfi:"clearBuffer",clientWaitSync:"clientWaitSync",compressedTexImage3D:"compressedTexImage3D",compressedTexSubImage3D:"compressedTexSubImage3D",copyBufferSubData:"copyBufferSubData",copyTexSubImage3D:"copyTexSubImage3D",createQuery:"createQuery",createSampler:"createSampler",createTransformFeedback:"createTransformFeedback",createVertexArray:"createVertexArray",deleteQuery:"deleteQuery",deleteSampler:"deleteSampler",deleteSync:"deleteSync",deleteTransformFeedback:"deleteTransformFeedback",deleteVertexArray:"deleteVertexArray",drawArraysInstanced:"drawArraysInstanced",drawBuffers:"drawBuffers",drawElementsInstanced:"drawElementsInstanced",drawRangeElements:"drawRangeElements",endQuery:"endQuery",endTransformFeedback:"endTransformFeedback",fenceSync:"fenceSync",framebufferTextureLayer:"framebufferTextureLayer",getActiveUniformBlockName:"getActiveUniformBlockName",getActiveUniformBlockParameter:"getActiveUniformBlockParameter",getActiveUniforms:"getActiveUniforms",getBufferSubData:"getBufferSubData",getFragDataLocation:"getFragDataLocation",getIndexedParameter:"getIndexedParameter",getInternalformatParameter:"getInternalformatParameter",getQuery:"getQuery",getQueryParameter:"getQueryParameter",getSamplerParameter:"getSamplerParameter",getSyncParameter:"getSyncParameter",getTransformFeedbackVarying:"getTransformFeedbackVarying",getUniformBlockIndex:"getUniformBlockIndex",getUniformIndices:"getUniformIndices",invalidateFramebuffer:"invalidateFramebuffer",invalidateSubFramebuffer:"invalidateSubFramebuffer",isQuery:"isQuery",isSampler:"isSampler",isSync:"isSync",isTransformFeedback:"isTransformFeedback",isVertexArray:"isVertexArray",pauseTransformFeedback:"pauseTransformFeedback",readBuffer:"readBuffer",renderbufferStorageMultisample:"renderbufferStorageMultisample",resumeTransformFeedback:"resumeTransformFeedback",samplerParameteri:"samplerParameter",samplerParameterf:"samplerParameter",texImage3D:"texImage3D",texStorage2D:"texStorage2D",texStorage3D:"texStorage3D",texSubImage3D:"texSubImage3D",transformFeedbackVaryings:"transformFeedbackVaryings",uniform1ui:"uniform",uniform2ui:"uniform",uniform3ui:"uniform",uniform4ui:"uniform",uniform1fv:"uniform",uniform2fv:"uniform",uniform3fv:"uniform",uniform4fv:"uniform",uniform1iv:"uniform",uniform2iv:"uniform",uniform3iv:"uniform",uniform4iv:"uniform",uniform1uiv:"uniform",uniform2uiv:"uniform",uniform3uiv:"uniform",uniform4uiv:"uniform",uniformBlockBinding:"uniformBlockBinding",uniformMatrix2fv:"uniformMatrix",uniformMatrix3x2fv:"uniformMatrix",uniformMatrix4x2fv:"uniformMatrix",uniformMatrix2x3fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4x3fv:"uniformMatrix",uniformMatrix2x4fv:"uniformMatrix",uniformMatrix3x4fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttribDivisor:"vertexAttribDivisor",vertexAttribI4i:"vertexAttribI",vertexAttribI4ui:"vertexAttribI",vertexAttribI4iv:"vertexAttribI",vertexAttribI4uiv:"vertexAttribI",vertexAttribIPointer:"vertexAttribIPointer",waitSync:"waitSync"},Ph.WebGLFunctions={uniform1f:"uniform",uniform1fv:"uniform",uniform1i:"uniform",uniform1iv:"uniform",uniform2f:"uniform",uniform2fv:"uniform",uniform2i:"uniform",uniform2iv:"uniform",uniform3f:"uniform",uniform3i:"uniform",uniform3iv:"uniform",uniform4f:"uniform",uniform4fv:"uniform",uniform4i:"uniform",uniform4iv:"uniform",uniformMatrix2fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttrib1f:"vertexAttrib",vertexAttrib2f:"vertexAttrib",vertexAttrib3f:"vertexAttrib",vertexAttrib4f:"vertexAttrib",vertexAttrib1fv:"vertexAttrib",vertexAttrib2fv:"vertexAttrib",vertexAttrib3fv:"vertexAttrib",vertexAttrib4fv:"vertexAttrib"},Ph.AngleInstancedArraysExtFunctions={drawArraysInstancedANGLE:"drawArraysInstancedANGLE",drawElementsInstancedANGLE:"drawElementsInstancedANGLE",vertexAttribDivisorANGLE:"vertexAttribDivisorANGLE"};const Bh={activeTexture:[["texture"]],attachShader:[["program","shader"]],beginQuery:[["target","query"]],beginTransformFeedback:[["primitiveMode"]],bindAttribLocation:[["program","index","name"]],bindBuffer:[["target","buffer"]],bindBufferBase:[["target","index","buffer"]],bindBufferRange:[["target","index","buffer","offset","size"]],bindFramebuffer:[["target","framebuffer"]],bindRenderbuffer:[["target","renderbuffer"]],bindSampler:[["unit","sampler"]],bindTexture:[["target","texture"]],bindTransformFeedback:[["target","tf"]],bindVertexArray:[["array"]],blendColor:[["red","green","blue","alpha"]],blendEquation:[["mode"]],blendEquationSeparate:[["modeRGB","modeAlpha"]],blendFunc:[["sfactor","dfactor"]],blendFuncSeparate:[["srcRGB","dstRGB","srcAlpha","dstAlpha"]],blitFramebuffer:[["srcX0","srcY0","srcX1","srcY1","dstX0","dstY0","dstX1","dstY1","mask","filter"]],bufferData:[["target","data","usage"],["target","size","usage"],["target","srcData","usage"],["target","srcData","usage","srcOffset","length"]],bufferSubData:[["target","dstByteOffset","srcData"],["target","offset","data"],["target","dstByteOffset","srcData","srcOffset","length"]],checkFramebufferStatus:[["target"]],clear:[["mask"]],clearBufferfi:[["buffer","drawbuffer","depth","stencil"]],clearBufferfv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferiv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferuiv:[["buffer","drawbuffer","values","srcOffset"]],clearColor:[["red","green","blue","alpha"]],clearDepth:[["depth"]],clearStencil:[["s"]],clientWaitSync:[["sync","flags","timeout"]],colorMask:[["red","green","blue","alpha"]],compileShader:[["shader"]],compressedTexImage2D:[["target","level","internalformat","width","height","border","data"],["target","level","internalformat","width","height","border","imageSize","offset"],["target","level","internalformat","width","height","border","srcData","srcOffset","srcLengthOverride"]],compressedTexImage3D:[["target","level","internalformat","width","height","depth","border","imageSize","offset"],["target","level","internalformat","width","height","depth","border","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage2D:[["target","level","xoffset","yoffset","width","height","format","data"],["target","level","xoffset","yoffset","width","height","format","imageSize","offset"],["target","level","xoffset","yoffset","width","height","format","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","imageSize","offset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","srcData","srcOffset","srcLengthOverride"]],copyBufferSubData:[["readTarget","writeTarget","readOffset","writeOffset","size"]],copyTexImage2D:[["target","level","internalformat","x","y","width","height","border"]],copyTexSubImage2D:[["target","level","xoffset","yoffset","x","y","width","height"]],copyTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","x","y","width","height"]],createBuffer:[[]],createFramebuffer:[[]],createProgram:[[]],createQuery:[[]],createRenderbuffer:[[]],createSampler:[[]],createShader:[["type"]],createTexture:[[]],createTransformFeedback:[[]],createVertexArray:[[]],cullFace:[["mode"]],deleteBuffer:[["buffer"]],deleteFramebuffer:[["framebuffer"]],deleteProgram:[["program"]],deleteQuery:[["query"]],deleteRenderbuffer:[["renderbuffer"]],deleteSampler:[["sampler"]],deleteShader:[["shader"]],deleteSync:[["sync"]],deleteTexture:[["texture"]],deleteTransformFeedback:[["tf"]],deleteVertexArray:[["vertexArray"]],depthFunc:[["func"]],depthMask:[["flag"]],depthRange:[["zNear","zFar"]],detachShader:[["program","shader"]],disable:[["cap"]],disableVertexAttribArray:[["index"]],drawArrays:[["mode","first","count"]],drawArraysInstanced:[["mode","first","count","instanceCount"]],drawBuffers:[["buffers"]],drawElements:[["mode","count","type","offset"]],drawElementsInstanced:[["mode","count","type","offset","instanceCount"]],drawRangeElements:[["mode","start","end","count","type","offset"]],enable:[["cap"]],enableVertexAttribArray:[["index"]],endQuery:[["target"]],endTransformFeedback:[[]],fenceSync:[["condition","flags"]],finish:[[]],flush:[[]],framebufferRenderbuffer:[["target","attachment","renderbuffertarget","renderbuffer"]],framebufferTexture2D:[["target","attachment","textarget","texture","level"]],framebufferTextureLayer:[["target","attachment","texture","level","layer"]],frontFace:[["mode"]],generateMipmap:[["target"]],getActiveAttrib:[["program","index"]],getActiveUniform:[["program","index"]],getActiveUniformBlockName:[["program","uniformBlockIndex"]],getActiveUniformBlockParameter:[["program","uniformBlockIndex","pname"]],getActiveUniforms:[["program","uniformIndices","pname"]],getAttachedShaders:[["program"]],getAttribLocation:[["program","name"]],getBufferParameter:[["target","pname"]],getBufferSubData:[["target","srcByteOffset","dstBuffer","dstOffset","length"]],getContextAttributes:[[]],getError:[[]],getExtension:[["extensionName"],["name"]],getFragDataLocation:[["program","name"]],getFramebufferAttachmentParameter:[["target","attachment","pname"]],getIndexedParameter:[["target","index"]],getInternalformatParameter:[["target","internalformat","pname"]],getParameter:[["pname"]],getProgramInfoLog:[["program"]],getProgramParameter:[["program","pname"]],getQuery:[["target","pname"]],getQueryParameter:[["query","pname"]],getRenderbufferParameter:[["target","pname"]],getSamplerParameter:[["sampler","pname"]],getShaderInfoLog:[["shader"]],getShaderParameter:[["shader","pname"]],getShaderPrecisionFormat:[["shadertype","precisiontype"]],getShaderSource:[["shader"]],getSupportedExtensions:[[]],getSyncParameter:[["sync","pname"]],getTexParameter:[["target","pname"]],getTransformFeedbackVarying:[["program","index"]],getUniform:[["program","location"]],getUniformBlockIndex:[["program","uniformBlockName"]],getUniformIndices:[["program","uniformNames"]],getUniformLocation:[["program","name"]],getVertexAttrib:[["index","pname"]],getVertexAttribOffset:[["index","pname"]],hint:[["target","mode"]],invalidateFramebuffer:[["target","attachments"]],invalidateSubFramebuffer:[["target","attachments","x","y","width","height"]],isBuffer:[["buffer"]],isContextLost:[[]],isEnabled:[["cap"]],isFramebuffer:[["framebuffer"]],isProgram:[["program"]],isQuery:[["query"]],isRenderbuffer:[["renderbuffer"]],isSampler:[["sampler"]],isShader:[["shader"]],isSync:[["sync"]],isTexture:[["texture"]],isTransformFeedback:[["tf"]],isVertexArray:[["vertexArray"]],lineWidth:[["width"]],linkProgram:[["program"]],pauseTransformFeedback:[[]],pixelStorei:[["pname","param"]],polygonOffset:[["factor","units"]],readBuffer:[["src"]],readPixels:[["x","y","width","height","format","type","dstData"],["x","y","width","height","format","type","offset"],["x","y","width","height","format","type","pixels"],["x","y","width","height","format","type","dstData","dstOffset"]],renderbufferStorage:[["target","internalformat","width","height"]],renderbufferStorageMultisample:[["target","samples","internalformat","width","height"]],resumeTransformFeedback:[[]],sampleCoverage:[["value","invert"]],samplerParameterf:[["sampler","pname","param"]],samplerParameteri:[["sampler","pname","param"]],scissor:[["x","y","width","height"]],shaderSource:[["shader","source"]],stencilFunc:[["func","ref","mask"]],stencilFuncSeparate:[["face","func","ref","mask"]],stencilMask:[["mask"]],stencilMaskSeparate:[["face","mask"]],stencilOp:[["fail","zfail","zpass"]],stencilOpSeparate:[["face","fail","zfail","zpass"]],texImage2D:[["target","level","internalformat","format","type","source"],["target","level","internalformat","width","height","border","format","type","pboOffset"],["target","level","internalformat","width","height","border","format","type","pixels"],["target","level","internalformat","width","height","border","format","type","source"],["target","level","internalformat","width","height","border","format","type","srcData","srcOffset"]],texImage3D:[["target","level","internalformat","width","height","depth","border","format","type","pboOffset"],["target","level","internalformat","width","height","depth","border","format","type","source"],["target","level","internalformat","width","height","depth","border","format","type","srcData"],["target","level","internalformat","width","height","depth","border","format","type","srcData","srcOffset"]],texParameterf:[["target","pname","param"]],texParameteri:[["target","pname","param"]],texStorage2D:[["target","levels","internalformat","width","height"]],texStorage3D:[["target","levels","internalformat","width","height","depth"]],texSubImage2D:[["target","level","xoffset","yoffset","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","pboOffset"],["target","level","xoffset","yoffset","width","height","format","type","pixels"],["target","level","xoffset","yoffset","width","height","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","srcData","srcOffset"]],texSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","pboOffset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","source"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","srcData","srcOffset"]],transformFeedbackVaryings:[["program","varyings","bufferMode"]],uniform1f:[["location","x"]],uniform1fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1i:[["location","x"]],uniform1iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1ui:[["location","v0"]],uniform1uiv:[["location","data","srcOffset","srcLength"]],uniform2f:[["location","x","y"]],uniform2fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2i:[["location","x","y"]],uniform2iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2ui:[["location","v0","v1"]],uniform2uiv:[["location","data","srcOffset","srcLength"]],uniform3f:[["location","x","y","z"]],uniform3fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3i:[["location","x","y","z"]],uniform3iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3ui:[["location","v0","v1","v2"]],uniform3uiv:[["location","data","srcOffset","srcLength"]],uniform4f:[["location","x","y","z","w"]],uniform4fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4i:[["location","x","y","z","w"]],uniform4iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4ui:[["location","v0","v1","v2","v3"]],uniform4uiv:[["location","data","srcOffset","srcLength"]],uniformBlockBinding:[["program","uniformBlockIndex","uniformBlockBinding"]],uniformMatrix2fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x3fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x3fv:[["location","transpose","data","srcOffset","srcLength"]],useProgram:[["program"]],validateProgram:[["program"]],vertexAttrib1f:[["index","x"]],vertexAttrib1fv:[["index","values"]],vertexAttrib2f:[["index","x","y"]],vertexAttrib2fv:[["index","values"]],vertexAttrib3f:[["index","x","y","z"]],vertexAttrib3fv:[["index","values"]],vertexAttrib4f:[["index","x","y","z","w"]],vertexAttrib4fv:[["index","values"]],vertexAttribDivisor:[["index","divisor"]],vertexAttribI4i:[["index","x","y","z","w"]],vertexAttribI4iv:[["index","values"]],vertexAttribI4ui:[["index","x","y","z","w"]],vertexAttribI4uiv:[["index","values"]],vertexAttribIPointer:[["index","size","type","stride","offset"]],vertexAttribPointer:[["index","size","type","normalized","stride","offset"]],viewport:[["x","y","width","height"]],waitSync:[["sync","flags","timeout"]]};class Uh{static getNames(e,t){const n=Bh[e];if(!n||0===n.length)return null;for(const e of n)if(e.length===t)return e;let r=null;for(const e of n)e.length>=t&&(null===r||e.lengthi.length&&(i=e);return i}static getName(e,t,n){const r=Uh.getNames(e,n);return r&&t>=0&&t{const e={};for(let t=0;t<64;t++)e["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;return e})();class qh{constructor(e){this.sources=e.sources||[],this.names=e.names||[],this.sourceRoot=e.sourceRoot||"",this.lines=qh.parseMappings(e.mappings||"")}originalPositionFor(e,t){const n={source:null,line:null,column:null,name:null},r=e-1;if(r<0||r>=this.lines.length)return n;const i=this.lines[r];if(!i||0===i.length)return n;const s=this.findSegment(i,t);if(!s)return n;const o=s.sourceIndex>=0&&s.sourceIndex=0&&s.nameIndex>1,o=e[s];o.generatedColumn<=t?(i=o,n=s+1):r=s-1}return i}static parseMappings(e){const t=[];let n=0,r=0,i=0,s=0;const o=e.split(";");for(let e=0;e0){const e=a.split(",");for(let t=0;t=4&&(n+=o[1],r+=o[2],i+=o[3],a.sourceIndex=n,a.originalLine=r,a.originalColumn=i,o.length>=5&&(s+=o[4],a.nameIndex=s)),l.push(a)}}l.sort((e,t)=>e.generatedColumn-t.generatedColumn),t.push(l)}return t}static decodeSegment(e){const t=[];let n=0;for(;n>>=1,t.push(o?-r:r)}return t}}var Qh=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})};class Zh{constructor(e){this.cache=new Map,this.inflight=new Map,this.fetchFn=e||("undefined"!=typeof fetch?fetch.bind(globalThis):void 0)}resolveFrames(e){return Qh(this,void 0,void 0,function*(){return e&&0!==e.length?Promise.all(e.map(e=>this.resolveFrame(e))):e||[]})}resolveFrame(e){return Qh(this,void 0,void 0,function*(){const t=Zh.parseFrame(e);if(!t)return e;let n;try{n=yield this.getConsumer(t.url)}catch(t){return e}if(!n)return e;const r=n.originalPositionFor(t.line,t.column);return r.source&&null!==r.line?Zh.formatFrame(t.functionName,r.name,r.source,r.line,r.column||0):e})}static parseFrame(e){if(!e)return null;let t=e.match(/^(.*?)\s*\((.+):(\d+):(\d+)\)\s*$/);return t?{functionName:t[1].trim(),url:t[2],line:parseInt(t[3],10),column:parseInt(t[4],10)}:(t=e.match(/^\s*(.+):(\d+):(\d+)\s*$/),t?{functionName:"",url:t[1].trim(),line:parseInt(t[2],10),column:parseInt(t[3],10)}:null)}static formatFrame(e,t,n,r,i){const s=t||e,o=n+":"+r+":"+i;return s?s+" ("+o+")":o}getConsumer(e){return Qh(this,void 0,void 0,function*(){if(this.cache.has(e))return this.cache.get(e);const t=this.inflight.get(e);if(t)return t;const n=this.loadConsumer(e).then(t=>(this.cache.set(e,t),this.inflight.delete(e),t)).catch(()=>(this.cache.set(e,null),this.inflight.delete(e),null));return this.inflight.set(e,n),n})}loadConsumer(e){return Qh(this,void 0,void 0,function*(){if(!this.fetchFn)return null;const t=yield this.fetchFn(e);if(!t.ok)return null;const n=yield t.text(),r=Zh.extractSourceMappingURL(n);if(!r)return null;let i;if(0===r.indexOf("data:"))i=Zh.parseDataUri(r);else{const t=Zh.resolveUrl(r,e),n=yield this.fetchFn(t);if(!n.ok)return null;i=yield n.json()}return i&&"string"==typeof i.mappings?new qh(i):null})}static extractSourceMappingURL(e){const t=/\/\/[#@]\s*sourceMappingURL=(\S+)\s*$/gm;let n,r=null;for(;null!==(n=t.exec(e));)r=n[1];return r}static parseDataUri(e){const t=e.indexOf(",");if(-1===t)return null;const n=e.substring(0,t),r=e.substring(t+1);try{const e=/;base64/i.test(n)?Zh.decodeBase64(r):decodeURIComponent(r);return JSON.parse(e)}catch(e){return null}}static decodeBase64(e){if("function"==typeof atob)return atob(e);const t=globalThis.Buffer;if(t)return t.from(e,"base64").toString("utf-8");throw new Error("No base64 decoder available.")}static resolveUrl(e,t){try{return new URL(e,t).href}catch(t){return e}}}function Jh(e){return e&&(e.text||e.name)||""}function ed(e,t){const n=[];if(!e||!t)return n;const r=e.DrawCall,i=t.DrawCall;ad("uniform",r&&r.uniforms,i&&i.uniforms,n),ad("uniformBlock",r&&r.uniformBlocks,i&&i.uniformBlocks,n);const s=sd(e,t);for(const r of s){if(td[r])continue;const i=e[r],s=t[r];(rd(i)||rd(s))&&od(i,s,r,n)}return n}const td={id:!0,name:!0,commandArguments:!0,result:!0,status:!0,marker:!0,text:!0,startTime:!0,commandEndTime:!0,endTime:!0,stackTrace:!0,consumeCommandId:!0,VisualState:!0},nd={__SPECTOR_Object_TAG:!0,__SPECTOR_Object_CustomData:!0,__SPECTOR_Metadata:!0,customData:!0,visual:!0,visualPixels:!0,VisualState:!0,texture:!0,sampler:!0,location:!0,source:!0,translatedSource:!0,analyserName:!0,uniforms:!0,uniformBlocks:!0,length:!0};function rd(e){return null!==e&&"object"==typeof e}function id(e){if(!rd(e))return null;const t=e.__SPECTOR_Object_TAG||("string"==typeof e.typeName&&"id"in e?e:null);return t&&"string"==typeof t.typeName?t.typeName:null}function sd(e,t){const n=[],r={},i=e=>{if(rd(e))for(const t in e)e.hasOwnProperty(t)&&!r[t]&&(r[t]=!0,n.push(t))};return i(e),i(t),n}function od(e,t,n,r,i=0){const s=id(e),o=id(t);if(null!==s||null!==o){const e=null!==s?s:"(absent)",t=null!==o?o:"(absent)";return void(e!==t&&r.push({path:n,previous:e,current:t}))}const a=rd(e),l=rd(t);if(!a&&!l){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}if(a!==l||i>=8){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}for(const s of sd(e,t))nd[s]||od(e?e[s]:void 0,t?t[s]:void 0,n+"."+s,r,i+1)}function ad(e,t,n,r){const i=hd(t),s=hd(n),o=[],a={};for(const e in i)i.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const e in s)s.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const t of o){const n=i.hasOwnProperty(t)?i[t]:void 0,o=s.hasOwnProperty(t)?s[t]:void 0,a=n?dd(n.value):"(absent)",l=o?dd(o.value):"(absent)";a!==l&&r.push({path:e+" "+t,previous:a,current:l}),ld(e+" "+t,n,o,r)}}function ld(e,t,n,r){const i=t&&t.texture,s=n&&n.texture;(rd(i)||rd(s))&&cd(e+" texture",i,s,r);const o=t&&t.textures,a=n&&n.textures,l=Array.isArray(o)?o.length:0,u=Array.isArray(a)?a.length:0,c=Math.max(l,u);for(let t=0;t0?o[t]:void 0,u>0?a[t]:void 0,r)}const ud=["width","height","depth","format","internalFormat","textureType"];function cd(e,t,n,r){(rd(t)||rd(n))&&(function(e,t,n,r){for(const i of ud){const s=t?t[i]:void 0,o=n?n[i]:void 0;if(void 0===s&&void 0===o)continue;const a=dd(s),l=dd(o);a!==l&&r.push({path:e+" "+i,previous:a,current:l})}}(e,t,n,r),function(e,t,n,r){if(rd(t)||rd(n))for(const i of sd(t,n)){const s=t?t[i]:void 0,o=n?n[i]:void 0,a="string"==typeof s,l="string"==typeof o;(a||l)&&s!==o&&r.push({path:e+" ("+i+")",previous:a?"(image)":"(absent)",current:l?"(image)":"(absent)",previousImage:a?s:void 0,currentImage:l?o:void 0})}}(e,t&&t.visual,n&&n.visual,r))}function hd(e){const t={};if(Array.isArray(e))for(const n of e)n&&"string"==typeof n.name&&(t[n.name]=n);return t}function dd(e){if(void 0===e)return"(absent)";if(null===e)return"null";try{return JSON.stringify(e)}catch(t){return String(e)}}function fd(e,t){for(let n=0;n{if(this.store.getSnapshot().currentCapture)switch(e){case 0:this._displayCaptures();break;case 40:this._displayCurrentCapture();break;case 10:this._displayInformation();break;case 20:this._displayInitState();break;case 30:this._displayEndState();break;case 60:this._displayCompare()}else this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))},this.handleSearchTextChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{searchText:e})),this._search(e)},this.handleCompareOnlyDifferencesChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{compareOnlyDifferences:e}))},this.handleCompareCommandSelected=e=>{null!=e&&(this._currentCommandId=e,this._displayCurrentCapture())},this.handleCommandSelected=e=>{this.selectCommand(e)},this.openTextureViewer=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{textureViewer:{open:!0,src:e.src,label:e.label,pixelated:e.pixelated,raw:e.raw||null}}))},this.closeTextureViewer=()=>{this.store.setState(e=>Object.assign(Object.assign({},e),{textureViewer:Object.assign(Object.assign({},e.textureViewer),{open:!1})}))},this.handleVisualStateSelected=e=>{this.selectVisualState(e)},this.handleVertexSelected=e=>{this.selectCommand(e),this._openShader(!1)},this.handleFragmentSelected=e=>{this.selectCommand(e),this._openShader(!0)},this.handleShaderSelected=e=>{var t;const n=null===(t=this.store.getSnapshot().commands[e])||void 0===t?void 0:t.capture.shader;n&&(this.selectCommand(e),this._openCapturedShader(n))},this.handleShaderSourceOpen=(e,t)=>{this._openCapturedShader(e,t)},this.handleSourceCodeChanged=e=>{this.onSourceCodeChanged.trigger(e)},this.handleSourceCodeClose=()=>{this._displayCurrentCapture()},this.handleSourceCodeTabChange=(e,t)=>{this.store.setState(n=>n.sourceCodeState?Object.assign(Object.assign({},n),{sourceCodeState:Object.assign(Object.assign({},n.sourceCodeState),{fragment:e,translated:t})}):n)},this.handleBeautifyChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{beautify:e})}):t)},this.handlePreprocessChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{preprocessed:e})}):t)},this.handleSaveRequested=e=>{this.saveCapture(e)},this.handleCaptureLoaded=e=>{this.addCapture(e)},this.handleClose=()=>{this.hide()},this._rootPlaceHolder=e||document.body,this.onSourceCodeChanged=new l,this.store=new ft(Object.assign({},pd)),this._container=document.createElement("div"),this._container.className="spector-react-result-view",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(yt.Provider,{value:this},(0,dt.createElement)(Mh))),this._rootPlaceHolder.addEventListener("keydown",e=>{if(40!==this.store.getSnapshot().menuStatus)return;const t=e.keyCode;38===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousCommand()):40===t?(e.preventDefault(),e.stopPropagation(),this._selectNextCommand()):33===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousVisualState()):34===t&&(e.preventDefault(),e.stopPropagation(),this._selectNextVisualState())})}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}addCapture(e){return this.store.setState(t=>{const n=t.captures.map(e=>({capture:e.capture,active:!1}));return Object.assign(Object.assign({},t),{captures:[{capture:e,active:!0},...n],currentCapture:e})}),this._currentCommandId=-1,this._displayCurrentCapture(),0}selectCapture(e){this._currentCommandId=-1,this.store.setState(t=>{var n,r;const i=t.captures.map((t,n)=>({capture:t.capture,active:n===e}));return Object.assign(Object.assign({},t),{captures:i,currentCapture:null!==(r=null===(n=i[e])||void 0===n?void 0:n.capture)&&void 0!==r?r:null})}),this._displayCurrentCapture()}selectCommand(e){const t=this.store.getSnapshot();if(e<0||e>=t.commands.length)return;const n=t.commands[e];this._currentCommandId=n.capture.id;const r=n.visualStateIndex,i=this._buildCommandDetail(e,t.commands,t.visualStates);this.store.setState(t=>Object.assign(Object.assign({},t),{commands:t.commands.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentCommandIndex:e,visualStates:t.visualStates.map((e,t)=>e.active!==(t===r)?Object.assign(Object.assign({},e),{active:t===r}):e),currentVisualStateIndex:r,commandDetailData:i}))}selectVisualState(e){const t=this.store.getSnapshot();if(e<0||e>=t.visualStates.length)return;const n=t.visualStates[e].commandIndex;if(n===Number.MIN_VALUE)return void this._displayInitState();if(n===Number.MAX_VALUE)return void this._displayEndState();n>=0&&(this._currentCommandId=t.commands[n].capture.id);const r=n>=0?this._buildCommandDetail(n,t.commands,t.visualStates):t.commandDetailData;this.store.setState(t=>Object.assign(Object.assign({},t),{visualStates:t.visualStates.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentVisualStateIndex:e,commands:n>=0?t.commands.map((e,t)=>e.active!==(t===n)?Object.assign(Object.assign({},e),{active:t===n}):e):t.commands,currentCommandIndex:n>=0?n:t.currentCommandIndex,commandDetailData:r}))}showSourceCodeError(e){this.store.setState(t=>Object.assign(Object.assign({},t),{sourceCodeError:e}))}saveCapture(e){const t=JSON.stringify(e,null,4),n=new Blob([t],{type:"octet/stream"}),r="capture "+new Date(e.startTime).toTimeString().split(" ")[0]+".json",i=document.createElement("a"),s=window.URL.createObjectURL(n);i.setAttribute("href",s),i.setAttribute("download",r),i.click()}_displayCaptures(){this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))}_displayCompare(){const e=this.store.getSnapshot(),t=e.captures.findIndex(e=>e.active),n=t>=0?e.captures[t]:null,r=n?e.captures[t+1]:null;if(!n||!r)return void this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:60,canCompare:!1,compareRows:[],compareSummary:{added:0,removed:0,changed:0,unchanged:0},compareLabel:""}));const i=function(e,t){const n=function(e,t){const n=e.length,r=t.length,i=e.map(Jh),s=t.map(Jh),o=[];for(let e=0;e<=n;e++)o.push(new Array(r+1).fill(0));for(let e=n-1;e>=0;e--)for(let t=r-1;t>=0;t--)o[e][t]=i[e]===s[t]?o[e+1][t+1]+1:Math.max(o[e+1][t],o[e][t+1]);const a=[];let l=[];const u=()=>{for(const e of l)a.push(e);l=[]};let c=0,h=0;for(;c0?a.push({type:"changed",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id,fieldDiffs:n}):a.push({type:"unchanged",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id}),c++,h++}else if(o[c+1][h]>=o[c][h+1])l.push({type:"removed",name:e[c].name,previousText:e[c].text,indexA:c}),c++;else{const n=fd(l,t[h].name);n?a.push({type:"changed",name:t[h].name,previousText:n.previousText,currentText:t[h].text,indexA:n.indexA,indexB:h,commandId:t[h].id,fieldDiffs:ed(e[n.indexA],t[h])}):(u(),a.push({type:"added",name:t[h].name,currentText:t[h].text,indexB:h,commandId:t[h].id})),h++}for(;cObject.assign(Object.assign({},e),{menuStatus:60,canCompare:!0,compareRows:i.rows,compareSummary:i.summary,compareLabel:s}))}static _captureLabel(e){try{return new Date(e.startTime).toTimeString().split(" ")[0]}catch(e){return"capture"}}_displayInformation(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];zh(n,"Canvas",t.canvas,e.searchText),zh(n,"Context",t.context,e.searchText);const r=[];for(const n of t.analyses){const t="Primitives"===n.analyserName?"Vertices count":n.analyserName;zh(r,t,n,e.searchText)}zh(r,"Frame Memory Changes",t.frameMemory,e.searchText),zh(r,"Total Memory (seconds since application start: bytes)",t.memory,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:10,commandCount:t.commands.length,informationLeft:n,informationRight:r}))}_displayInitState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.initState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:20,commandCount:t.commands.length,initStateData:n}))}_displayEndState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.endState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:30,commandCount:t.commands.length,endStateData:n}))}_displayCurrentCapture(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=e.searchText,r=e.captures.map(e=>({capture:e.capture,active:e.capture===t})),i=[];i.push({VisualState:t.initState.VisualState,time:t.startTime,commandIndex:Number.MIN_VALUE,active:!1,previousVisualStateIndex:-1,nextVisualStateIndex:-1});const s=[];let o=0,a=!1,l=-1,u=-1;for(let e=0;e0?c-1:-1,nextCommandIndex:-1,visualStateIndex:o,active:!1};if(c>0&&(s[c-1].nextCommandIndex=c),r.VisualState){const e=i.length,t=i.length-1,n={VisualState:r.VisualState,time:r.endTime,commandIndex:c,active:!1,previousVisualStateIndex:t,nextVisualStateIndex:-1};i[t].nextVisualStateIndex=e,i.push(n),o=e,a=!0}else a||(i[0].commandIndex=c,a=!0);h.visualStateIndex=o,s.push(h),(-1===this._currentCommandId&&0===c||this._currentCommandId===r.id)&&(l=c,u=o)}l>=0&&(s[l].active=!0,this._currentCommandId=s[l].capture.id),u>=0&&(i[u].active=!0);let c=[];l>=0&&(c=this._buildCommandDetail(l,s,i)),this.store.setState(e=>Object.assign(Object.assign({},e),{captures:r,menuStatus:40,commandCount:t.commands.length,commands:s,currentCommandIndex:l,visualStates:i,currentVisualStateIndex:u,sourceCodeState:null,sourceCodeError:"",commandDetailData:c}))}_openShader(e){const t=this.store.getSnapshot();if(t.currentCommandIndex<0||t.currentCommandIndex>=t.commands.length)return;const n=t.commands[t.currentCommandIndex].capture.DrawCall;if(!n||!n.shaders||n.shaders.length<2)return;const r={programId:n.programStatus.program.__SPECTOR_Object_TAG.id,nameVertex:n.shaders[0].name,nameFragment:n.shaders[1].name,sourceVertex:n.shaders[0].source,sourceFragment:n.shaders[1].source,translatedSourceVertex:n.shaders[0].translatedSource,translatedSourceFragment:n.shaders[1].translatedSource,fragment:e,translated:!1,editable:n.programStatus.RECOMPILABLE,beautify:!0,preprocessed:!1,singleShader:!1,sourceVertexLog:n.shaders[0].infoLog||"",sourceFragmentLog:n.shaders[1].infoLog||"",programLog:n.programStatus.infoLog||""},i=this._buildCommandDetail(t.currentCommandIndex,t.commands,t.visualStates);this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:"",commandDetailData:i}))}_openCapturedShader(e,t=""){if(!e||"string"!=typeof e.source)return;const n="FRAGMENT_SHADER"===e.shaderType,r={programId:-1,nameVertex:n?"":e.name,nameFragment:n?e.name:"",sourceVertex:n?"":e.source,sourceFragment:n?e.source:"",translatedSourceVertex:n?"":e.translatedSource||"",translatedSourceFragment:n&&e.translatedSource||"",fragment:n,translated:!1,editable:!1,beautify:!0,preprocessed:!1,singleShader:!0,sourceVertexLog:n?"":e.infoLog||"",sourceFragmentLog:n&&e.infoLog||"",programLog:t};this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:""}))}_buildCommandDetail(e,t,n){if(e<0||e>=t.length)return[];const r=t[e],i=n[r.visualStateIndex],s=this._resolvedStackTraces.get(r.capture.id),o=function(e,t,n){const r=[];t&&r.push({type:"visualState",visualState:t});let i="Unknown";switch(e.status){case 50:i="Deprecated";break;case 10:i="Unused";break;case 20:i="Disabled";break;case 30:i="Redundant";break;case 40:i="Valid"}const s=Ph.getMDNLink(e.name);e.result?zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,result:e.result,status:i},""):"LOG"!==e.name&&zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,status:i},"");for(const t in e)"VisualState"!==t&&"result"!==t&&("commandArguments"===t&&Array.isArray(e.commandArguments)?Kh(r,e.name,e.commandArguments):Xh(r,t,e)||("stackTrace"===t&&Array.isArray(e.stackTrace)?zh(r,"stackTrace",n||e.stackTrace,""):"object"==typeof e[t]&&zh(r,t,e[t],"")));return r}(r.capture,null==i?void 0:i.VisualState,s);return s||this._resolveStackTraceAsync(r.capture),o}_resolveStackTraceAsync(e){const t=e.id;this._resolvedStackTraces.has(t)||this._resolvingStackTraces.has(t)||e.stackTrace&&0!==e.stackTrace.length&&(this._resolvingStackTraces.add(t),this._sourceMapResolver.resolveFrames(e.stackTrace).then(n=>{this._resolvingStackTraces.delete(t),this._resolvedStackTraces.set(t,n);let r=!1;for(let t=0;tObject.assign(Object.assign({},t),{commandDetailData:e}))}}).catch(()=>{this._resolvingStackTraces.delete(t)}))}_selectPreviousCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.previousCommandIndex<0||this.selectCommand(t.previousCommandIndex)}_selectNextCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.nextCommandIndex<0||this.selectCommand(t.nextCommandIndex)}_selectPreviousVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.previousVisualStateIndex<0||this.selectVisualState(t.previousVisualStateIndex)}_selectNextVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.nextVisualStateIndex<0||this.selectVisualState(t.nextVisualStateIndex)}_search(e){switch(this.store.getSnapshot().menuStatus){case 0:case 40:this._displayCurrentCapture();break;case 30:this._displayEndState();break;case 10:this._displayInformation();break;case 20:this._displayInitState()}this.store.setState(e=>Object.assign(Object.assign({},e),{searchText:""}))}}class gd{constructor(e,t={}){this.worker=e,this.captureTimeout=t.captureTimeout||1e4,this.disposed=!1,this.captureTimer=null,this.onCapture=new l,this.onCaptureStarted=new l,this.onError=new l,this.onFps=new l,this.onContextReady=new l,this.messageHandler=this.handleMessage.bind(this),this.worker.addEventListener("message",this.messageHandler)}triggerCapture(e=0,t=0,n=!1,r=!1){if(this.disposed)return;this.clearCaptureTimer();const i={type:"spector:trigger-capture",version:1,canvasIndex:e,commandCount:t,quickCapture:n,fullCapture:r};this.worker.postMessage(i),this.captureTimer=setTimeout(()=>{this.onError.trigger("Capture timed out after "+this.captureTimeout+"ms"),this.captureTimer=null},this.captureTimeout)}dispose(){this.disposed||(this.disposed=!0,this.clearCaptureTimer(),this.worker.removeEventListener("message",this.messageHandler),this.onCapture.clear(),this.onCaptureStarted.clear(),this.onError.clear(),this.onFps.clear(),this.onContextReady.clear())}handleMessage(e){const t=e.data;if(!function(e){return null!=e&&"object"==typeof e&&"string"==typeof e.type&&0===e.type.indexOf("spector:")}(t))return;const n=t;switch(n.type){case"spector:context-ready":this.onContextReady.trigger({canvasCount:n.canvasCount,canvasWidth:n.canvasWidth,canvasHeight:n.canvasHeight});break;case"spector:capture-started":this.onCaptureStarted.trigger(void 0);break;case"spector:capture-complete":this.clearCaptureTimer(),this.onCapture.trigger(n.capture);break;case"spector:error":this.clearCaptureTimer(),this.onError.trigger(n.error);break;case"spector:fps":this.onFps.trigger(n.fps)}}clearCaptureTimer(){null!=this.captureTimer&&(clearTimeout(this.captureTimer),this.captureTimer=null)}}var Ed=n(72),vd=n.n(Ed),Cd=n(825),Dd=n.n(Cd),Sd=n(659),Ad=n.n(Sd),_d=n(56),yd=n.n(_d),bd=n(540),Td=n.n(bd),Rd=n(113),xd=n.n(Rd),wd=n(377),Fd={};Fd.styleTagTransform=xd(),Fd.setAttributes=yd(),Fd.insert=Ad().bind(null,"html"),Fd.domAPI=Dd(),Fd.insertStyleElement=Td(),vd()(wd.A,Fd),wd.A&&wd.A.locals&&wd.A.locals;var Nd=n(160),Ld={};Ld.styleTagTransform=xd(),Ld.setAttributes=yd(),Ld.insert=Ad().bind(null,"html"),Ld.domAPI=Dd(),Ld.insertStyleElement=Td(),vd()(Nd.A,Ld),Nd.A&&Nd.A.locals&&Nd.A.locals;class Od{constructor(e){this.timeSpy=e,this.init()}spyXRSession(e){this.currentXRSession&&this.unspyXRSession();for(const e of at.getRequestAnimationFrameFunctionNames())y.resetOriginFunction(this.timeSpy.getSpiedScope(),e);this.timeSpy.spyRequestAnimationFrame("requestAnimationFrame",e),this.currentXRSession=e}unspyXRSession(){if(this.currentXRSession){y.resetOriginFunction(this.currentXRSession,"requestAnimationFrame"),this.currentXRSession=void 0;for(const e of at.getRequestAnimationFrameFunctionNames())this.timeSpy.spyRequestAnimationFrame(e,this.timeSpy.getSpiedScope())}}init(){if(!navigator.xr)return;class e extends XRWebGLLayer{constructor(e,t,n){super(e,t,n),this.glContext=t}getContext(){return this.glContext}}class t extends XRWebGLBinding{constructor(e,t){super(e,t),this.glContext=t}createProjectionLayer(e){const t=super.createProjectionLayer(e);return t.glContext=this.glContext,t}}window.XRWebGLLayer=e,window.XRWebGLBinding=t;const n=navigator.xr.requestSession;Object.defineProperty(navigator.xr,"requestSessionInternal",{writable:!0}),navigator.xr.requestSessionInternal=n,Object.defineProperty(navigator.xr,"requestSession",{writable:!0}),navigator.xr.requestSession=(e,t)=>((e,t)=>navigator.xr.requestSessionInternal(e,t).then(e=>{const t=e;return t._updateRenderState=e.updateRenderState,t.updateRenderState=e=>function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){if(e.baseLayer){const n=e.baseLayer;t.glContext=n.getContext()}if(e.layers)for(const n of e.layers){const e=n;e.glContext&&(t.glContext=e.glContext)}return t._updateRenderState(e)}),this.spyXRSession(t),e.addEventListener("end",()=>{this.unspyXRSession()}),Promise.resolve(e)}))(e,t)}}const Id={CaptureMenu:_t,ResultView:md};class kd{static getFirstAvailable3dContext(e){return this.tryGetContextFromHelperField(e)||this.tryGetContextFromCanvas(e,"webgl")||this.tryGetContextFromCanvas(e,"experimental-webgl")||this.tryGetContextFromCanvas(e,"webgl2")||this.tryGetContextFromCanvas(e,"experimental-webgl2")}static tryGetContextFromHelperField(e){const t=e instanceof HTMLCanvasElement?e.getAttribute("__spector_context_type"):e.__spector_context_type;if(t)return this.tryGetContextFromCanvas(e,t)}static tryGetContextFromCanvas(e,t){let n;try{n=e.getContext(t)}catch(e){}return n}constructor(e={}){this.noFrameTimeout=-1,this.options=Object.assign({enableXRCapture:!1},e),this.captureNextFrames=0,this.captureNextCommands=0,this.quickCapture=!1,this.fullCapture=!1,this.retry=0,this.contexts=[],this.workerBridges=new Map,this.timeSpy=new at,this.onCaptureStarted=new l,this.onCapture=new l,this.onError=new l,this.timeSpy.onFrameStart.add(this.onFrameStart,this),this.timeSpy.onFrameEnd.add(this.onFrameEnd,this),this.timeSpy.onError.add(this.onErrorInternal,this),ct.install(),this.options.enableXRCapture&&(this.xrSpy=new Od(this.timeSpy))}displayUI(e=!1){this.captureMenu||(this.getCaptureUI(),this.captureMenu.onPauseRequested.add(this.pause,this),this.captureMenu.onPlayRequested.add(this.play,this),this.captureMenu.onPlayNextFrameRequested.add(this.playNextFrame,this),this.captureMenu.onCaptureRequested.add(e=>{e&&(e.ref instanceof Worker?this.captureWorker(e.ref):this.captureCanvas(e.ref))},this),setInterval(()=>{this.captureMenu.setFPS(this.getFps())},1e3),e||this.captureMenu.trackPageCanvases(),this.captureMenu.display()),this.resultView||(this.getResultUI(),this.onCapture.add(e=>{this.resultView.display(),this.resultView.addCapture(e)}))}getResultUI(){return this.resultView||(this.resultView=new md,this.resultView.onSourceCodeChanged.add(e=>{this.rebuildProgramFromProgramId(e.programId,e.sourceVertex,e.sourceFragment,t=>{this.referenceNewProgram(e.programId,t),this.resultView.showSourceCodeError(null)},e=>{this.resultView.showSourceCodeError(e)})})),this.resultView}getCaptureUI(){return this.captureMenu||(this.captureMenu=new _t),this.captureMenu}rebuildProgramFromProgramId(e,t,n,r,i){const s=Pe.getFromGlobalStore(e);this.rebuildProgram(s,t,n,r,i)}rebuildProgram(e,t,n,r,i){o.rebuildProgram(e,t,n,r,i)}referenceNewProgram(e,t){Pe.updateInGlobalStore(e,t)}pause(){this.timeSpy.changeSpeedRatio(0)}play(){this.timeSpy.changeSpeedRatio(1)}playNextFrame(){this.timeSpy.playNextFrame()}drawOnlyEveryXFrame(e){this.timeSpy.changeSpeedRatio(e)}getFps(){return this.timeSpy.getFps()}spyCanvases(){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt,this.canvasSpy.onContextRequested.add(this.spyContext,this))}spyCanvas(e){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt(e),this.canvasSpy.onContextRequested.add(this.spyContext,this))}getAvailableContexts(){return this.contexts}setShaderCompileDelay(e){ct.install(),ct.setDelay(e)}clearShaderCompileDelay(){ct.setDelay(0)}getShaderCompileDelay(){return ct.getDelay()}captureCanvas(e,t=0,n=!1,r=!1){const i=this.getAvailableContextSpyByCanvas(e);if(i)this.captureContextSpy(i,t,n,r);else{const i=kd.getFirstAvailable3dContext(e);i?this.captureContext(i,t,n,r):a.error("No webgl context available on the chosen canvas.")}}captureContext(e,t=0,n=!1,r=!1){let i=this.getAvailableContextSpyByCanvas(e.canvas);i||(i=e.getIndexedParameter?new ot({context:e,version:2,recordAlways:!1}):new ot({context:e,version:1,recordAlways:!1}),i.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:i.context.canvas,contextSpy:i})),i&&this.captureContextSpy(i,t,n,r)}captureXRContext(e=0,t=!1,n=!1){this.captureContext(this.getXRContext(),e,t,n)}captureContextSpy(e,t=0,n=!1,r=!1){this.quickCapture=n,this.fullCapture=r,this.capturingContext?this.onErrorInternal("Already capturing a context."):(this.retry=0,this.capturingContext=e,this.capturingContext.setMarker(this.marker),(t=Math.min(t,1e4))>0?this.captureCommands(t):this.captureFrames(1),this.noFrameTimeout=setTimeout(()=>{t>0?this.stopCapture():this.capturingContext&&this.retry>1?this.onErrorInternal("No frames with gl commands detected. Try moving the camera."):this.onErrorInternal("No frames detected. Try moving the camera or implementing requestAnimationFrame.")},1e4))}captureNextFrame(e,t=!1,n=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,0,t,n):this.captureContext(e,0,t,n)}startCapture(e,t,n=!1,r=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,t,n,r):this.captureContext(e,t,n,r)}stopCapture(){if(this.capturingContext){const e=this.capturingContext.stopCapture();if(e.commands.length>0)return this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),this.triggerCapture(e),this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,e;0===this.captureNextCommands&&(this.retry++,this.captureFrames(1))}}setMarker(e){this.marker=e,this.capturingContext&&this.capturingContext.setMarker(e)}clearMarker(){this.marker=null,this.capturingContext&&this.capturingContext.clearMarker()}addRequestAnimationFrameFunctionName(e){this.timeSpy.addRequestAnimationFrameFunctionName(e)}setSpiedScope(e){this.timeSpy.setSpiedScope(e)}log(e){this.capturingContext&&this.capturingContext.log(e)}spyWorkers(e="spector.worker.bundle.js"){ut.startIntercepting(e)}stopSpyingWorkers(){ut.stopIntercepting()}spyWorker(e){let t=this.workerBridges.get(e);return t||(t=new gd(e),t.onCapture.add(e=>{this.triggerCapture(e)},this),t.onError.add(e=>{this.onErrorInternal(e)},this),t.onContextReady.add(t=>{if(this.captureMenu){const n=this.workerBridges.size;this.captureMenu.addCanvasInformation({id:"Worker "+n,width:t.canvasWidth,height:t.canvasHeight,ref:e})}},this),t.onFps.add(e=>{this.captureMenu&&this.captureMenu.setFPS(e)},this),this.workerBridges.set(e,t),t)}captureWorker(e,t=0,n=!1,r=!1){this.workerBridges.has(e)||this.spyWorker(e);const i=this;e.addEventListener("message",function t(n){n.data&&"spector:capture-complete"===n.data.type&&(e.removeEventListener("message",t),i.triggerCapture(n.data.capture))}),e.postMessage({type:"spector:trigger-capture",version:1,canvasIndex:0,commandCount:t,quickCapture:n,fullCapture:r})}captureFrames(e){this.captureNextFrames=e,this.captureNextCommands=0,this.playNextFrame()}captureCommands(e){this.captureNextFrames=0,this.captureNextCommands=e,this.play(),this.capturingContext?(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(e,this.quickCapture,this.fullCapture)):(this.onErrorInternal("No context to capture from."),this.captureNextCommands=0)}spyContext(e){let t=this.getAvailableContextSpyByCanvas(e.context.canvas);t||(t=new ot({context:e.context,version:e.contextVersion,recordAlways:!0}),t.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:t.context.canvas,contextSpy:t})),t.spy()}getAvailableContextSpyByCanvas(e){for(const t of this.contexts)if(t.canvas===e)return t.contextSpy}getXRContext(){return this.options.enableXRCapture||a.error("Cannot retrieve WebXR context if capturing WebXR is disabled."),this.xrSpy.currentXRSession||a.error("No currently active WebXR session."),this.xrSpy.currentXRSession.glContext}onFrameStart(){this.captureNextCommands>0||(this.captureNextFrames>0?(this.capturingContext&&(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(0,this.quickCapture,this.fullCapture)),this.captureNextFrames--):this.capturingContext=void 0)}onFrameEnd(){this.captureNextCommands>0||0===this.captureNextFrames&&this.stopCapture()}triggerCapture(e){this.captureMenu&&this.captureMenu.captureComplete(null),this.onCapture.trigger(e)}onErrorInternal(e){if(a.error(e),this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),!this.capturingContext)throw e;this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,this.retry=0,this.captureMenu&&this.captureMenu.captureComplete(e),this.onError.trigger(e)}}},180(e,t,n){e=n.nmd(e),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/lang"),s=e("../lib/event"),o='.ace_search {background-color: #ddd;color: #666;border: 1px solid #cbcbcb;border-top: 0 none;overflow: hidden;margin: 0;padding: 4px 6px 0 4px;position: absolute;top: 0;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {margin: 0 20px 4px 0;overflow: hidden;line-height: 1.9;}.ace_replace_form {margin-right: 0;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {border-radius: 3px 0 0 3px;background-color: white;color: black;border: 1px solid #cbcbcb;border-right: 0 none;outline: 0;padding: 0;font-size: inherit;margin: 0;line-height: inherit;padding: 0 6px;min-width: 17em;vertical-align: top;min-height: 1.8em;box-sizing: content-box;}.ace_searchbtn {border: 1px solid #cbcbcb;line-height: inherit;display: inline-block;padding: 0 6px;background: #fff;border-right: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;margin: 0;position: relative;color: #666;}.ace_searchbtn:last-child {border-radius: 0 3px 3px 0;border-right: 1px solid #cbcbcb;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn:hover {background-color: #eef1f6;}.ace_searchbtn.prev, .ace_searchbtn.next {padding: 0px 0.7em}.ace_searchbtn.prev:after, .ace_searchbtn.next:after {content: "";border: solid 2px #888;width: 0.5em;height: 0.5em;border-width: 2px 0 0 2px;display:inline-block;transform: rotate(-45deg);}.ace_searchbtn.next:after {border-width: 0 2px 2px 0 ;}.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;font: 16px/16px Arial;padding: 0;height: 14px;width: 14px;top: 9px;right: 7px;position: absolute;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;box-sizing: border-box!important;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;clear: both;}.ace_search_counter {float: left;font-family: arial;padding: 0 8px;}',a=e("../keyboard/hash_handler").HashHandler,l=e("../lib/keys");r.importCssString(o,"ace_searchbox");var u=function(e,t,n){var i=r.createElement("div");r.buildDom(["div",{class:"ace_search right"},["span",{action:"hide",class:"ace_searchbtn_close"}],["div",{class:"ace_search_form"},["input",{class:"ace_search_field",placeholder:"Search for",spellcheck:"false"}],["span",{action:"findPrev",class:"ace_searchbtn prev"},"​"],["span",{action:"findNext",class:"ace_searchbtn next"},"​"],["span",{action:"findAll",class:"ace_searchbtn",title:"Alt-Enter"},"All"]],["div",{class:"ace_replace_form"},["input",{class:"ace_search_field",placeholder:"Replace with",spellcheck:"false"}],["span",{action:"replaceAndFindNext",class:"ace_searchbtn"},"Replace"],["span",{action:"replaceAll",class:"ace_searchbtn"},"All"]],["div",{class:"ace_search_options"},["span",{action:"toggleReplace",class:"ace_button",title:"Toggle Replace mode",style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{class:"ace_search_counter"}],["span",{action:"toggleRegexpMode",class:"ace_button",title:"RegExp Search"},".*"],["span",{action:"toggleCaseSensitive",class:"ace_button",title:"CaseSensitive Search"},"Aa"],["span",{action:"toggleWholeWords",class:"ace_button",title:"Whole Word Search"},"\\b"],["span",{action:"searchInSelection",class:"ace_button",title:"Search In Selection"},"S"]]],i),this.element=i.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),r.importCssString(o,"ace_searchbox",e.container)};(function(){this.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},this.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;s.addListener(e,"mousedown",function(e){setTimeout(function(){t.activeInput.focus()},0),s.stopPropagation(e)}),s.addListener(e,"click",function(e){var n=(e.target||e.srcElement).getAttribute("action");n&&t[n]?t[n]():t.$searchBarKb.commands[n]&&t.$searchBarKb.commands[n].exec(t),s.stopPropagation(e)}),s.addCommandKeyListener(e,function(e,n,r){var i=l.keyCodeToString(r),o=t.$searchBarKb.findKeyCommand(n,i);o&&o.exec&&(o.exec(t),s.stopEvent(e))}),this.$onChange=i.delayedCall(function(){t.find(!1,!1)}),s.addListener(this.searchInput,"input",function(){t.$onChange.schedule(20)}),s.addListener(this.searchInput,"focus",function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()}),s.addListener(this.replaceInput,"focus",function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()})},this.$closeSearchBarKb=new a([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new a,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.editor.getReadOnly()||(e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus())},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),this.setSearchRange=function(e){this.searchRange=e,e?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(e){r.setCssClass(this.replaceOption,"checked",this.searchRange),r.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var t=this.editor.getReadOnly();this.replaceOption.style.display=t?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!t?"":"none",this.find(!1,!1,e)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,n){var i=!this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n,range:this.searchRange})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",i),this.editor._emit("findSearchBox",{match:!i}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,n=0,r=0;if(t){var i=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),s=e.session.doc.positionToIndex(e.selection.anchor);this.searchRange&&(s-=e.session.doc.positionToIndex(this.searchRange.start));for(var o,a=t.lastIndex=0;(o=t.exec(i))&&(n++,(a=o.index)<=s&&r++,!(n>999))&&(o[0]||(t.lastIndex=a+=1,!(a>=i.length))););}this.searchCounter.textContent=r+" of "+(n>999?"999+":n)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(u.prototype),t.SearchBox=u,t.Search=function(e,t){(e.searchBox||new u(e)).show(e.session.getTextRange(),t)}}),ace.require(["ace/ext/searchbox"],function(t){e&&(e.exports=t)})},49(e,t,n){e=n.nmd(e),ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=t.cFunctions="\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b",a=function(){var e=this.$keywords=this.createKeywordMapper({"keyword.control":"break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while|catch|operator|try|throw|using","storage.type":"asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|class|wchar_t|template|char16_t|char32_t","storage.modifier":"const|extern|register|restrict|static|volatile|inline|private|protected|public|friend|explicit|virtual|export|mutable|typename|constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local","keyword.operator":"and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace","variable.language":"this","constant.language":"NULL|true|false|TRUE|FALSE|nullptr"},"identifier"),t=/\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source,n="%"+/(\d+\$)?/.source+/[#0\- +']*/.source+/[,;:_]?/.source+/((-?\d+)|\*(-?\d+\$)?)?/.source+/(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source+/(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source+/(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source;this.$rules={start:[{token:"comment",regex:"//$",next:"start"},{token:"comment",regex:"//",next:"singleLineComment"},i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string",regex:"'(?:"+t+"|.)?'"},{token:"string.start",regex:'"',stateName:"qqstring",next:[{token:"string",regex:/\\\s*$/,next:"qqstring"},{token:"constant.language.escape",regex:t},{token:"constant.language.escape",regex:n},{token:"string.end",regex:'"|$',next:"start"},{defaultToken:"string"}]},{token:"string.start",regex:'R"\\(',stateName:"rawString",next:[{token:"string.end",regex:'\\)"',next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"keyword",regex:"#\\s*(?:include|import|pragma|line|define|undef|version)\\b",next:"directive"},{token:"keyword",regex:"#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b"},{token:"support.function.C99.c",regex:o},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*"},{token:"keyword.operator",regex:/--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],singleLineComment:[{token:"comment",regex:/\\$/,next:"singleLineComment"},{token:"comment",regex:/$/,next:"start"},{defaultToken:"comment"}],directive:[{token:"constant.other.multiline",regex:/\\/},{token:"constant.other.multiline",regex:/.*\\/},{token:"constant.other",regex:"\\s*<.+?>",next:"start"},{token:"constant.other",regex:'\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',next:"start"},{token:"constant.other",regex:"\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",next:"start"},{token:"constant.other",regex:/[^\\\/]+/,next:"start"}]},this.embedRules(i,"doc-",[i.getEndRule("start")]),this.normalizeRules()};r.inherits(a,s),t.c_cppHighlightRules=a}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var i=n[1].length,s=e.findMatchingBracket({row:t,column:i});if(!s||s.row==t)return 0;var o=this.$getIndent(e.getLine(s.row));e.replace(new r(t,0,t,i-1),o)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i,s=e.getLine(n);if(this.startRegionRe.test(s))return this.getCommentRegionBlock(e,s,n);if(i=s.match(this.foldingStartMarker)){var o=i.index;if(i[1])return this.openingBracketBlock(e,i[1],n,o);var a=e.getCommentFoldRange(n,o+i[0].length,1);return a&&!a.isMultiLine()&&(r?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(i=s.match(this.foldingStopMarker))?(o=i.index+i[0].length,i[1]?this.closingBracketBlock(e,i[1],n,o):e.getCommentFoldRange(n,o,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length,a=t+=1,l=e.getLength();++tu)break;var c=this.getFoldWidgetRange(e,"all",t);if(c){if(c.start.row<=s)break;if(c.isMultiLine())t=c.end.row;else if(r==u)break}a=t}}return new i(s,o,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\s*$/),s=e.getLength(),o=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++no)return new i(o,r,n,t.length)}}.call(o.prototype)}),ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./c_cpp_highlight_rules").c_cppHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&"comment"==s[s.length-1].type)return r;if("start"==e)(a=t.match(/^.*[\{\(\[]\s*$/))&&(r+=n);else if("doc-start"==e){if("start"==o)return"";var a;(a=t.match(/^\s*(\/?)\*/))&&(a[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/c_cpp"}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/glsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/c_cpp_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp_highlight_rules").c_cppHighlightRules,s=function(){var e=this.createKeywordMapper({"variable.language":"this",keyword:"layout|attribute|const|uniform|varying|break|continue|do|for|while|if|else|in|out|inout|float|int|void|bool|true|false|lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|samplerCube|struct","constant.language":"radians|degrees|sin|cos|tan|asin|acos|atan|pow|exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|normalize|faceforward|reflect|refract|matrixCompMult|lessThan|lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|texture2DProjLod|textureCube|textureCubeLod|gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|gl_DepthRangeParameters|gl_DepthRange|gl_Position|gl_PointSize|gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData"},"identifier");this.$rules=(new i).$rules,this.$rules.start.forEach(function(t){"function"==typeof t.token&&(t.token=e)})};r.inherits(s,i),t.glslHighlightRules=s}),ace.define("ace/mode/glsl",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/glsl_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp").Mode,s=e("./glsl_highlight_rules").glslHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.$id="ace/mode/glsl"}.call(u.prototype),t.Mode=u}),ace.require(["ace/mode/glsl"],function(t){e&&(e.exports=t)})},429(e,t,n){e=n.nmd(e),ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.require(["ace/theme/monokai"],function(t){e&&(e.exports=t)})}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r](s,s.exports,n),s.loaded=!0,s.exports}return n.amdD=function(){throw new Error("define cannot be used indirect")},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.nc=void 0,n(832),n(49),n(429),n(902),n(180),n(878)})()); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("SPECTOR",[],t):"object"==typeof exports?exports.SPECTOR=t():e.SPECTOR=t()}(self,()=>(()=>{var e={377(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.captureMenuComponent{position:absolute;padding:7px;z-index:99999;top:10px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuComponent.active{visibility:visible;display:block}.captureMenuComponent,.captureMenuComponent:after,.captureMenuComponent:before{box-sizing:content-box}.captureMenuLogComponent{position:absolute;padding:7px;z-index:80000;top:66px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuLogComponent.active{visibility:visible;display:block}.captureMenuLogComponent,.captureMenuLogComponent:after,.captureMenuLogComponent:before{box-sizing:content-box}.captureMenuLogComponent span.error{color:red}.canvasListComponent{float:left;width:50%;height:100%}.canvasListComponent [commandName=onCanvasSelection]{vertical-align:center;line-height:40px;white-space:nowrap;text-overflow:ellipsis;width:190px;display:inline-block;overflow:hidden;margin:0px 5px}.canvasListComponent [commandName=onCanvasSelection]:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.canvasListComponent ul{margin:0px;padding:7px;list-style:none;position:absolute;top:54px;left:-2px;width:400px;border:2px solid #222;background-color:#2c2c2c}.canvasListComponent ul li{margin:5px}.canvasListComponent ul li:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.captureMenuActionsComponent{float:left;width:30%;height:100%;margin-top:7.5px}.captureMenuActionsComponent div{float:left}.captureMenuActionsComponent [commandName=onCaptureRequested]{border-radius:50%;background:#2c2c2c;border:2px solid red;width:21px;height:21px}.captureMenuActionsComponent [commandName=onCaptureRequested]:hover{background:red;cursor:pointer;transition:background .3s;-webkit-transition:background .3s;-moz-transition:background .3s}.captureMenuActionsComponent [commandName=onPlayRequested],.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPlayRequested]:before,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{content:"";position:absolute;display:inline-block;margin-top:6px;margin-left:4px;width:7px;height:7px;border-top:2px solid #f9f9f9;border-right:2px solid #f9f9f9;background-color:#f9f9f9;-moz-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg);z-index:-20}.captureMenuActionsComponent [commandName=onPlayRequested]:after,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:after{content:"";position:absolute;display:inline-block;width:8px;height:20px;background-color:#2c2c2c;z-index:-10}.captureMenuActionsComponent [commandName=onPlayRequested]:hover,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPauseRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPauseRequested]:before{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:12px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:after{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:7px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{background-color:#2c2c2c}.fpsCounterComponent{float:left;width:20%;vertical-align:center;line-height:40px;white-space:nowrap}',""]);const a=o},160(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.resultViewComponent{position:absolute;z-index:99999;border:1px solid #000;top:0;left:0;bottom:0;right:0;background-color:#222;opacity:1;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.resultViewComponent.active{visibility:visible;display:block}.resultViewComponent,.resultViewComponent:after,.resultViewComponent:before{box-sizing:content-box}.resultViewMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.resultViewMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.resultViewMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.resultViewMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.resultViewMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.resultViewMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.resultViewMenuComponent a.clearSearch{padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.resultViewMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}@media all and (max-width: 1024px){.resultViewMenuComponent .resultViewMenuOpen{display:block;visibility:visible}.resultViewMenuComponent li:not(.resultViewMenuSmall){display:none;visibility:hidden}.resultViewMenuComponent li{background:#2c2c2c}.resultViewMenuComponent li.searchContainer{background:rgb(69.5,69.5,69.5)}.resultViewMenuComponent{padding:0px;position:absolute;overflow-y:visible;top:0px;left:0px;right:0px;bottom:0px;z-index:999999;display:block}.resultViewMenuComponent a.active{background:#2c2c2c}}.resultViewMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:40px;position:relative;top:-1px;box-sizing:border-box}.resultViewMenuComponent input:focus{border:0;outline:0 none}.resultViewMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.resultViewMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.resultViewMenuComponent ::-webkit-input-placeholder{color:#ccc}.resultViewMenuComponent :-moz-placeholder{color:#ccc}.resultViewMenuComponent ::-moz-placeholder{color:#ccc}.resultViewMenuComponent :-ms-input-placeholder{color:#ccc}.resultViewContentComponent{position:absolute;top:40px;left:0;bottom:0;right:0}.informationColumnLeftComponent{position:absolute;top:0;left:0;bottom:0;right:50%;overflow:auto;overflow-x:hidden;overflow-y:visible}.informationColumnRightComponent{position:absolute;top:0;left:50%;bottom:0;right:0;overflow:auto;overflow-x:hidden;overflow-y:visible}.captureListComponent{position:absolute;top:40px;left:0;bottom:0;right:0;background:#222;z-index:9000;display:none;visibility:hidden;overflow-y:visible;overflow-x:hidden}.captureListComponent.active{display:block;visibility:visible}.captureListComponent .openCaptureFile{border:1px dashed #f9f9f9;display:block;margin:5px;padding:5px;text-align:center;font-style:italic}.captureListComponent .openCaptureFile span{line-height:100%;vertical-align:middle}.captureListComponent ul{margin:0px;padding:0px;list-style:none;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-start}.captureListComponent ul li{margin:5px;border:1px solid #606060}.captureListComponent ul li img{width:295px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;display:block}.captureListComponent ul li span{display:block;text-align:center;border:5px solid #222}.captureListComponent ul li span .captureListItemSave{color:#f9f9f9;font-size:16px;margin-left:10px;position:relative;padding:3px 8px 3px 32px}.captureListComponent ul li span .captureListItemSave:before,.captureListComponent ul li span .captureListItemSave:after{box-sizing:border-box;content:"";position:absolute}.captureListComponent ul li span .captureListItemSave:before{background:#222;border-color:#f9f9f9;border-style:solid;border-width:7px 2px 1px;border-radius:1px;height:16px;left:8px;top:5px;width:16px}.captureListComponent ul li span .captureListItemSave:after{background:#f9f9f9;border-color:#d9d9d9;border-style:solid;border-width:1px 1px 1px 4px;height:5px;left:13px;top:5px;width:7px}.captureListComponent ul li:hover{cursor:pointer}.captureListComponent ul li.active span{background:#f0640d;border:5px solid #f0640d}.captureListComponent ul li.active span .captureListItemSave:before{background:#f0640d}.captureListComponent ul li.active span .captureListItemSave:after{border-color:#f0640d}.visualStateListComponent{position:absolute;top:0;left:0;bottom:0;padding:5px;right:80%;overflow-y:visible;overflow-x:hidden}.visualStateListComponent ul{margin:0px;padding:0px;list-style:none}.visualStateListComponent ul li{margin:20px 15px 0px 15px;border:1px solid #606060}.visualStateListComponent ul li img{display:block;padding:0px;box-sizing:border-box;max-height:600px;width:100%;margin:0 auto;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.visualStateListComponent ul li:hover{cursor:pointer}.visualStateListComponent ul li span{border:5px solid #222;background:#222;box-sizing:border-box;display:inline-block;width:100%;margin:0px;padding:5px;word-wrap:break-word}.visualStateListComponent ul li.active{border:2px solid #f0640d}.commandListComponent{position:absolute;top:0;left:20%;right:40%;bottom:0;color:hsl(0,0%,82.6470588235%)}.commandListComponent ul{margin:0px;padding:0px;list-style:none;overflow-y:visible;overflow-x:hidden;height:100%}.commandListComponent ul li{padding:8px}.commandListComponent ul li span{word-wrap:break-word;line-height:22px}.commandListComponent ul li:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.commandListComponent ul li:nth-child(even){background:#2c2c2c}.commandListComponent ul li:nth-child(odd){background:#222}.commandListComponent ul li .important{font-weight:800}.commandListComponent ul li .important.deprecated{color:red}.commandListComponent ul li .important.unused{color:#ff0}.commandListComponent ul li .important.disabled{color:gray}.commandListComponent ul li .important.redundant{color:orange}.commandListComponent ul li .important.valid{color:#adff2f}.commandListComponent ul li .marker{font-size:16px;font-weight:900;color:#adff2f}.commandListComponent ul li.active{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.commandListComponent ul li.drawCall{background:#5db0d7;color:#222}.commandListComponent ul li a{margin-left:5px;margin-right:5px;color:#5db0d7;background:#222;padding:5px;font-weight:900;display:inline-block}.commandDetailComponent{position:absolute;top:0;left:60%;right:0;bottom:0;overflow-y:visible;overflow-x:hidden}.jsonGroupComponent{display:block;margin:10px;padding:10px;padding-bottom:5px}.jsonGroupComponent .jsonGroupComponentTitle{display:block;font-size:16px;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:5px;margin-bottom:5px;text-transform:capitalize}.jsonGroupComponent ul{margin:0px;padding:0px;list-style:none}.jsonGroupComponent ul li:nth-child(even){background:#222}.jsonGroupComponent ul li:nth-child(odd){background:#222}.jsonItemComponentKey{color:#f0640d}.jsonItemComponentValue{white-space:pre-wrap}.jsonItemImageHolder{width:50%;margin:auto}.jsonItemImageHolder .jsonItemImage{margin:5px;display:block;border:1px solid #606060;width:100%}.jsonItemImageHolder .jsonItemImage img{width:100%;display:block;margin:auto;max-width:256px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.jsonItemImageHolder .jsonItemImage span{margin:0px;padding:5px;word-wrap:break-word;display:inline-block;width:100%;box-sizing:border-box}[commandName=onOpenSourceClicked]:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.jsonVisualStateItemComponent{text-align:center;padding:10px}.jsonVisualStateItemComponent img{background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;border:1px solid #606060;margin:5px;width:100%;max-width:512px;max-height:800px}.jsonVisualStateItemComponent span{display:block}.jsonContentComponent{position:absolute;top:0;left:0;right:0;bottom:0;padding:10px;overflow-y:visible;overflow-x:hidden}.jsonItemComponentValue{word-break:break-all;white-space:normal}.jsonSourceItemComponentOpen{font-weight:bold;color:#5db0d7;text-decoration:underline}.sourceCodeMenuComponentContainer{position:absolute;left:0;top:0;bottom:48px;right:40%}.sourceCodeMenuComponentFooter{position:absolute;left:0;right:40%;bottom:0;padding:0 15px}.sourceCodeFormatError{color:#f0640d;margin-left:15px}.sourceCodeDiagnosticsNotice{color:#5db0d7;margin-left:15px}.sourceCodeDiagnosticsNotice a{color:#c9c9c9;text-decoration:underline}.sourceCodeMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.sourceCodeMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.sourceCodeMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.sourceCodeMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.sourceCodeMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.sourceCodeMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.sourceCodeMenuComponent a.clearSearch{display:inline-block;padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.sourceCodeMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}.sourceCodeMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:100%;position:relative;top:-1px;box-sizing:border-box}.sourceCodeMenuComponent input:focus{border:0;outline:0 none}.sourceCodeMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.sourceCodeMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.sourceCodeMenuComponent ::-webkit-input-placeholder{color:#ccc}.sourceCodeMenuComponent :-moz-placeholder{color:#ccc}.sourceCodeMenuComponent ::-moz-placeholder{color:#ccc}.sourceCodeMenuComponent :-ms-input-placeholder{color:#ccc}.sourceCodeComponent{position:absolute;top:42px;left:0;bottom:48px;right:40%;background:#222;z-index:9000;overflow-x:visible;overflow:auto}.sourceCodeComponent .sourceCodeComponentTitle{font-size:16px;font-weight:800;line-height:50px;color:#f0640d;padding:1em;margin:.5em 0}.compareViewComponent{position:absolute;top:50px;left:0px;right:0px;bottom:0px;overflow:hidden;display:flex;flex-direction:column;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:13px}.compareViewComponent .compareViewEmpty,.compareViewComponent .compareViewEmptyRow,.compareViewComponent .compareDetailEmpty{padding:1em;color:#c9c9c9;text-align:center}.compareViewComponent .compareViewHeader{flex:0 0 auto;display:flex;align-items:center;gap:16px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid rgb(8.5,8.5,8.5);white-space:nowrap}.compareViewComponent .compareViewHeader .compareViewLabel{color:#5db0d7}.compareViewComponent .compareViewHeader .compareViewSummary span{margin-right:8px;font-weight:700}.compareViewComponent .compareViewHeader .compareViewSummary span.added{color:#adff2f}.compareViewComponent .compareViewHeader .compareViewSummary span.removed{color:#ff5a5a}.compareViewComponent .compareViewHeader .compareViewSummary span.changed{color:#f0640d}.compareViewComponent .compareViewHeader .compareViewSummary span.unchanged{color:#c9c9c9}.compareViewComponent .compareViewHeader .compareViewToggle{margin-left:auto;cursor:pointer;user-select:none}.compareViewComponent .compareViewHeader .compareViewToggle input{vertical-align:middle;margin-right:4px}.compareViewComponent .compareViewBody{flex:1 1 auto;display:flex;min-height:0}.compareViewComponent .compareViewLegend{flex:0 0 130px;box-sizing:border-box;padding:10px;background:#2c2c2c;border-right:2px solid #222}.compareViewComponent .compareViewLegend .compareLegendRow{display:flex;align-items:center;gap:8px;margin:8px 0}.compareViewComponent .compareViewLegend .compareLegendRow.unchanged{opacity:.5}.compareViewComponent .compareViewLegend .compareLegendChip{width:12px;height:12px;border-radius:2px;background:#c9c9c9}.compareViewComponent .compareViewLegend .added .compareLegendChip{background:#adff2f}.compareViewComponent .compareViewLegend .removed .compareLegendChip{background:#ff5a5a}.compareViewComponent .compareViewLegend .changed .compareLegendChip{background:#f0640d}.compareViewComponent .compareViewList{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;margin:0;padding:0;list-style:none}.compareViewComponent .compareViewList .compareRow{display:flex;align-items:baseline;padding:3px 10px;line-height:20px;cursor:pointer;white-space:nowrap}.compareViewComponent .compareViewList .compareRow:nth-child(odd){background:#222}.compareViewComponent .compareViewList .compareRow:nth-child(even){background:#2c2c2c}.compareViewComponent .compareViewList .compareRow .compareSign{flex:0 0 14px;font-weight:800}.compareViewComponent .compareViewList .compareRow .compareRowText{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.compareViewComponent .compareViewList .compareRow .compareCmdName{font-weight:700}.compareViewComponent .compareViewList .compareRow.added .compareSign,.compareViewComponent .compareViewList .compareRow.added .compareCmdName{color:#adff2f}.compareViewComponent .compareViewList .compareRow.removed .compareSign,.compareViewComponent .compareViewList .compareRow.removed .compareCmdName{color:#ff5a5a}.compareViewComponent .compareViewList .compareRow.changed .compareSign,.compareViewComponent .compareViewList .compareRow.changed .compareCmdName{color:#f0640d}.compareViewComponent .compareViewList .compareRow.unchanged{opacity:.55}.compareViewComponent .compareViewList .compareRow.selected{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.compareViewComponent .compareViewList .compareRow.selected .compareSign,.compareViewComponent .compareViewList .compareRow.selected .compareCmdName{color:#222}.compareViewComponent .compareViewList .compareViewEmptyRow{cursor:default}.compareViewComponent .compareViewDetail{flex:0 0 42%;box-sizing:border-box;overflow-y:auto;border-left:2px solid #222;padding:4px 12px 12px}.compareViewComponent .compareViewDetail .compareDetailGroup{margin:12px 0}.compareViewComponent .compareViewDetail .compareDetailGroup ul{margin:0;padding:0;list-style:none}.compareViewComponent .compareViewDetail .compareDetailGroup li{padding:2px 0;white-space:pre-wrap;word-break:break-word}.compareViewComponent .compareViewDetail .compareDetailTitle{display:block;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin-bottom:6px;text-transform:capitalize}.compareViewComponent .compareViewDetail .compareDetailKey{color:#f0640d}.compareViewComponent .compareViewDetail .compareCmdName{font-weight:700}.compareViewComponent .compareViewDetail .compareCmdName.added{color:#adff2f}.compareViewComponent .compareViewDetail .compareCmdName.removed{color:#ff5a5a}.compareViewComponent .compareViewDetail .compareCmdName.changed{color:#f0640d}.compareViewComponent .compareViewDetail .compareArrow{color:#c9c9c9}.compareViewComponent .compareViewDetail .compareOld{opacity:.7;text-decoration:line-through}.compareViewComponent .compareViewDetail .compareNew{color:#f9f9f9}.compareViewComponent .compareViewDetail .compareCommandLink{color:#5db0d7;text-decoration:none;cursor:pointer;border-bottom:1px dotted currentColor}.compareViewComponent .compareViewDetail .compareCommandLink:hover{color:#f0640d}.compareViewComponent .compareViewDetail .compareTextureItem{padding-bottom:6px}.compareViewComponent .compareViewDetail .compareImageDiff{display:flex;align-items:center;margin-top:4px}.compareViewComponent .compareViewDetail .compareThumb{width:48px;height:48px;object-fit:contain;margin:2px 6px 2px 0;border:1px solid rgb(8.5,8.5,8.5);background:#222;image-rendering:pixelated}.jsonItemImageClickable{cursor:zoom-in}.textureViewerOverlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:100000;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.6);font-family:Consolas,monaco,monospace;font-size:13px;color:#f9f9f9}.textureViewerOverlay .textureViewerModal{width:min(900px,92vw);height:min(640px,90vh);display:flex;flex-direction:column;overflow:hidden;background:#222;border:1px solid #000;box-shadow:0 10px 40px rgba(0,0,0,.6)}.textureViewerOverlay .textureViewerHeader{flex:0 0 auto;display:flex;align-items:center;gap:12px;height:40px;padding:0 12px;background:#2c2c2c;border-bottom:2px solid #222}.textureViewerOverlay .textureViewerHeader .textureViewerTitle{color:#5db0d7}.textureViewerOverlay .textureViewerHeader .textureViewerMeta{color:#c9c9c9;font-size:12px}.textureViewerOverlay .textureViewerHeader .textureViewerClose{margin-left:auto;width:26px;height:26px;display:flex;align-items:center;justify-content:center;border-radius:3px;color:#c9c9c9;cursor:pointer}.textureViewerOverlay .textureViewerHeader .textureViewerClose:hover{color:#f9f9f9;background:hsla(0,0%,100%,.08)}.textureViewerOverlay .textureViewerToolbar{flex:0 0 auto;display:flex;align-items:center;flex-wrap:wrap;gap:14px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid #000;font-size:12px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup{display:flex;align-items:center;gap:6px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup .lbl{color:#c9c9c9;margin-right:2px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroupEnd{margin-left:auto}.textureViewerOverlay .textureViewerToolbar .channel{width:26px;height:24px;display:flex;align-items:center;justify-content:center;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#777;font-weight:800;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .channel.on.r{background:#e14b4b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.g{background:#4bd44b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.b{background:#4b8fe1;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.a{background:#dedede;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .tvBtn{height:24px;padding:0 10px;display:inline-flex;align-items:center;gap:6px;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#f9f9f9;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .tvBtn:hover{background:#333}.textureViewerOverlay .textureViewerToolbar .tvBtn.active{background:#f0640d;color:#1a1a1a;border-color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary{border-color:#f0640d;color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary:hover{background:#f0640d;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .seg{display:flex}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn{border-radius:0;border-right-width:0}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:first-child{border-radius:3px 0 0 3px}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:last-child{border-radius:0 3px 3px 0;border-right-width:1px}.textureViewerOverlay .textureViewerToolbar .zoomVal{min-width:44px;text-align:center;color:#c9c9c9}.textureViewerOverlay .textureViewerBody{flex:1 1 auto;display:flex;min-height:0}.textureViewerOverlay .textureViewerViewport{flex:1 1 auto;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#141414}.textureViewerOverlay .textureViewerViewport.checker{background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}.textureViewerOverlay .textureViewerCanvas{image-rendering:pixelated;cursor:crosshair;box-shadow:0 0 0 1px #000}.textureViewerOverlay .textureViewerLoupe{position:absolute;display:none;width:120px;height:120px;pointer-events:none;image-rendering:pixelated;border:1px solid #000;box-shadow:0 2px 8px rgba(0,0,0,.6);background:#000;left:16px;top:16px}.textureViewerOverlay .textureViewerRail{flex:0 0 210px;box-sizing:border-box;padding:12px;overflow-y:auto;background:#2c2c2c;border-left:2px solid #222}.textureViewerOverlay .textureViewerRail .railTitle{color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin:0 0 8px;text-transform:capitalize}.textureViewerOverlay .textureViewerRail .kv{display:flex;justify-content:space-between;margin:4px 0}.textureViewerOverlay .textureViewerRail .kv .k{color:#f0640d}.textureViewerOverlay .textureViewerRail .kv .v{color:#f9f9f9}.textureViewerOverlay .textureViewerRail .swatch{width:100%;height:34px;margin:8px 0;border:1px solid #000;background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0}.textureViewerOverlay .textureViewerRail .swatch .swatchInner{width:100%;height:100%}.textureViewerOverlay .textureViewerRail .hint{color:#c9c9c9;margin-top:10px;line-height:1.5}',""]);const a=o},636(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,".ace-monokai {\n color: #f9f9f9;\n font-size: 14px;\n}\n\n.ace-monokai .ace_entity.ace_name.ace_tag,\n.ace-monokai .ace_keyword,\n.ace-monokai .ace_meta.ace_tag,\n.ace-monokai .ace_storage {\n color: #F0640D\n}\n\n.ace-monokai .ace_constant.ace_character,\n.ace-monokai .ace_constant.ace_other {\n color: #5db0d7;\n}\n\n.ace-monokai .ace_marker-layer .ace_selection {\n background: #a6e22e\n}\n\n.ace-monokai .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #a6e22e;\n}\n\n.ace-monokai .ace_marker-layer .ace_active-line {\n background: #2c2c2c\n}\n.ace-monokai .ace_gutter-active-line {\n background-color: #2c2c2c\n}\n.ace-monokai .ace_marker-layer .ace_selected-word {\n border: 1px solid #a6e22e\n}\n\n.ace-monokai .ace_constant.ace_language {\n color: #e6db74\n}\n.ace-monokai .ace_constant.ace_numeric {\n color: #ae81ff\n}\n\n.ace-monokai .ace_gutter {\n background: #222;\n color: #8F908A;\n}",""]);const a=o},314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var a=0;a0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},601(e){"use strict";e.exports=function(e){return e[1]}},832(e,t,n){e=n.nmd(e),function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,n,r){"string"==typeof e?(2==arguments.length&&(r=n),t.modules[e]||(t.payloads[e]=r,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var n,r,i=function(e,t,n){if("string"==typeof t){var r=a(e,t);if(null!=r)return n&&n(),r}else if("[object Array]"===Object.prototype.toString.call(t)){for(var i=[],o=0,l=t.length;o1&&function(e,t,n){if(Array.prototype.indexOf)return e.indexOf("",n);for(var r=0;r-1&&(n=RegExp(this.source,i.replace.call(((r=this).global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),"g","")),i.replace.call(e.slice(a.index),n,function(){for(var e=1;ea.index&&this.lastIndex--}return a},o||(RegExp.prototype.test=function(e){var t=i.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError("Function.prototype.bind called on incompatible "+t);var n=d.call(arguments,1),i=function(){if(this instanceof i){var r=t.apply(this,n.concat(d.call(arguments)));return Object(r)===r?r:this}return t.apply(e,n.concat(d.call(arguments)))};return t.prototype&&(r.prototype=t.prototype,i.prototype=new r,r.prototype=null),i});var i,s,o,a,l,u=Function.prototype.call,c=Array.prototype,h=Object.prototype,d=c.slice,f=u.bind(h.toString),p=u.bind(h.hasOwnProperty);if((l=p(h,"__defineGetter__"))&&(i=u.bind(h.__defineGetter__),s=u.bind(h.__defineSetter__),o=u.bind(h.__lookupGetter__),a=u.bind(h.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,n=[];if(n.splice.apply(n,e(20)),n.splice.apply(n,e(26)),t=n.length,n.splice(5,0,"XXX"),n.length,t+1==n.length)return!0}()){var m=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?m.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(d.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):null==e?e=0:e<0&&(e=Math.max(n+e,0)),e+ta)for(h=u;h--;)this[l+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else for(this.length=c+s,h=0;h>>0;if("[object Function]"!=f(e))throw new TypeError;for(;++i>>0,i=Array(r),s=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var o=0;o>>0,s=[],o=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var a=0;a>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,s=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s++];break}if(++s>=r)throw new TypeError("reduce of empty array with no initial value")}for(;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,s=r-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s--];break}if(--s<0)throw new TypeError("reduceRight of empty array with no initial value")}do{s in this&&(i=e.call(void 0,i,n[s],s,t))}while(s--);return i}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=C&&"[object String]"==f(this)?this.split(""):L(this),n=t.length>>>0;if(!n)return-1;var r=0;for(arguments.length>1&&(r=N(arguments[1])),r=r>=0?r:Math.max(0,n+r);r>>0;if(!n)return-1;var r=n-1;for(arguments.length>1&&(r=Math.min(r,N(arguments[1]))),r=r>=0?r:n-Math.abs(r);r>=0;r--)if(r in t&&e===t[r])return r;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:h)}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(p(e,t)){var n;if(n={enumerable:!0,configurable:!0},l){var r=e.__proto__;e.__proto__=h;var i=o(e,t),s=a(e,t);if(e.__proto__=r,i||s)return i&&(n.get=i),s&&(n.set=s),n}return n.value=e[t],n}}),Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),Object.create||(g=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var n;if(null===e)n=g();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var r=function(){};r.prototype=e,(n=new r).__proto__=e}return void 0!==t&&Object.defineProperties(n,t),n}),Object.defineProperty){var S=D({}),A="undefined"==typeof document||D(document.createElement("div"));if(!S||!A)var _=Object.defineProperty}Object.defineProperty&&!_||(Object.defineProperty=function(e,t,n){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof n&&"function"!=typeof n||null===n)throw new TypeError("Property description must be an object: "+n);if(_)try{return _.call(Object,e,t,n)}catch(e){}if(p(n,"value"))if(l&&(o(e,t)||a(e,t))){var r=e.__proto__;e.__proto__=h,delete e[t],e[t]=n.value,e.__proto__=r}else e[t]=n.value;else{if(!l)throw new TypeError("getters & setters can not be defined on this javascript engine");p(n,"get")&&i(e,t,n.get),p(n,"set")&&s(e,t,n.set)}return e}),Object.defineProperties||(Object.defineProperties=function(e,t){for(var n in t)p(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=(E=Object.freeze,function(e){return"function"==typeof e?e:E(e)})}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";p(e,t);)t+="?";e[t]=!0;var n=p(e,t);return delete e[t],n}),!Object.keys){var y=!0,b=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],T=b.length;for(var R in{toString:null})y=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)p(e,n)&&t.push(n);if(y)for(var r=0,i=T;r0||-1)*Math.floor(Math.abs(e))),e}var L=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,n){"use strict";e("./regexp"),e("./es5-shim"),"undefined"==typeof Element||Element.prototype.remove||Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,n){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var r="object"==typeof navigator?navigator:{},i=(/mac|win|linux/i.exec(r.platform)||["other"])[0].toLowerCase(),s=r.userAgent||"",o=r.appName||"";t.isWin="win"==i,t.isMac="mac"==i,t.isLinux="linux"==i,t.isIE="Microsoft Internet Explorer"==o||o.indexOf("MSAppHost")>=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,t.isAIR=s.indexOf("AdobeAIR")>=0,t.isAndroid=s.indexOf("Android")>=0,t.isChromeOS=s.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./useragent");if(t.buildDom=function e(t,n,r){if("string"==typeof t&&t){var i=document.createTextNode(t);return n&&n.appendChild(i),i}if(!Array.isArray(t))return t;if("string"!=typeof t[0]||!t[0]){for(var s=[],o=0;o=1.5,"undefined"!=typeof document){var i=document.createElement("div");t.HI_DPI&&void 0!==i.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),r.isEdge||void 0===i.style.animationName||(t.HAS_CSS_ANIMATION=!0),i=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./oop"),i=function(){var e,t,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in n.FUNCTION_KEYS)e=n.FUNCTION_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);for(t in n.PRINTABLE_KEYS)e=n.PRINTABLE_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);return r.mixin(n,n.MODIFIER_KEYS),r.mixin(n,n.PRINTABLE_KEYS),r.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)n.KEY_MODS[t]=e.filter(function(e){return t&n.KEY_MODS[e]}).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();r.mixin(t,i),t.keyCodeToString=function(e){var t=i[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./keys"),i=e("./useragent"),s=null,o=0;t.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var r=function(){n.call(e,window.event)};n._wrapper=r,e.attachEvent("on"+t,r)}},t.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,n,r){function i(e){n&&n(e),r&&r(e),t.removeListener(document,"mousemove",n,!0),t.removeListener(document,"mouseup",i,!0),t.removeListener(document,"dragstart",i,!0)}return t.addListener(document,"mousemove",n,!0),t.addListener(document,"mouseup",i,!0),t.addListener(document,"dragstart",i,!0),i},t.addMouseWheelListener=function(e,n){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),n(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}n(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),n(e)})},t.addMultiMouseDownListener=function(e,n,r,s){var o,a,l,u=0,c={2:"dblclick",3:"tripleclick",4:"quadclick"};function h(e){if(0!==t.getButton(e)?u=0:e.detail>1?++u>4&&(u=1):u=1,i.isIE){var h=Math.abs(e.clientX-o)>5||Math.abs(e.clientY-a)>5;l&&!h||(u=1),l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),1==u&&(o=e.clientX,a=e.clientY)}if(e._clicks=u,r[s]("mousedown",e),u>4)u=0;else if(u>1)return r[s](c[u],e)}function d(e){u=2,l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),r[s]("mousedown",e),r[s](c[u],e)}Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",h),i.isOldIE&&t.addListener(e,"dblclick",d)})};var a=i.isMac&&i.isOpera&&!("KeyboardEvent"in window)?function(e){return(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)}:function(e){return(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};function l(e,t,n){var l=a(t);if(!i.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(l|=8),s.altGr){if(!(3&~l))return;s.altGr=0}if(18===n||17===n){var u="location"in t?t.location:t.keyLocation;17===n&&1===u?1==s[n]&&(o=t.timeStamp):18===n&&3===l&&2===u&&t.timeStamp-o<50&&(s.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),l||13!==n||3!==(u="location"in t?t.location:t.keyLocation)||(e(t,l,-n),!t.defaultPrevented)){if(i.isChromeOS&&8&l){if(e(t,l,n),t.defaultPrevented)return;l&=-9}return!!(l||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&e(t,l,n)}}function u(){s=Object.create(null)}if(t.getModifierString=function(e){return r.KEY_MODS[a(e)]},t.addCommandKeyListener=function(e,n){var r=t.addListener;if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var o=null;r(e,"keydown",function(e){o=e.keyCode}),r(e,"keypress",function(e){return l(n,e,o)})}else{var a=null;r(e,"keydown",function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=l(n,e,e.keyCode);return a=e.defaultPrevented,t}),r(e,"keypress",function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),r(e,"keyup",function(e){s[e.keyCode]=null}),s||(u(),r(window,"focus",u))}},"object"==typeof window&&window.postMessage&&!i.isOldIE){var c=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+c++,i=function(s){s.data==r&&(t.stopPropagation(s),t.removeListener(n,"message",i),e())};t.addListener(n,"message",i),n.postMessage(r,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function n(){t.$idleBlocked?setTimeout(n,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,n=e.end,r=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(r.row,r.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(r.row,r.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else this.end.rowt)var i={row:t+1,column:0};else this.start.row0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;nDate.now()-50)||(r=!1)},cancel:function(){r=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("../lib/dom"),o=e("../lib/lang"),a=e("../clipboard"),l=i.isChrome<18,u=i.isIE,c=i.isChrome>63,h=400,d=e("../lib/keys"),f=d.KEY_MODS,p=i.isIOS,m=p?/\s/:/\n/;t.TextInput=function(e,t){var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild);var g=!1,E=!1,v=!1,C=!1,D="";i.isMobile||(n.style.fontSize="1px");var S=!1,A=!1,_="",y=0,b=0,T=0;try{var R=document.activeElement===n}catch(e){}r.addListener(n,"blur",function(e){A||(t.onBlur(e),R=!1)}),r.addListener(n,"focus",function(e){if(!A){if(R=!0,i.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),i.isEdge?setTimeout(x):x()}}),this.$focusScroll=!1,this.focus=function(){if(D||c||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var t=0!=n.getBoundingClientRect().top}catch(e){return}var r=[];if(t)for(var i=n.parentElement;i&&1==i.nodeType;)r.push(i),i.setAttribute("ace_nocontext",!0),i=!i.parentElement&&i.getRootNode?i.getRootNode().host:i.parentElement;n.focus({preventScroll:!0}),t&&r.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="","0px"==n.style.top&&(n.style.top=e)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return R},t.on("beforeEndOperation",function(){t.curOp&&"insertstring"==t.curOp.command.name||(v&&(_=n.value="",U()),x())});var x=p?function(e){if(R&&(!g||e)&&!C){e||(e="");var r="\n ab"+e+"cde fg\n";r!=n.value&&(n.value=_=r);var i=4+(e.length||(t.selection.isEmpty()?0:1));4==y&&b==i||n.setSelectionRange(4,i),y=4,b=i}}:function(){if(!v&&!C&&(R||F)){v=!0;var e=t.selection,r=e.getRange(),i=e.cursor.row,s=r.start.column,o=r.end.column,a=t.session.getLine(i);if(r.start.row!=i){var l=t.session.getLine(i-1);s=r.start.rowi+1?u.length:o,o+=a.length+1,a=a+"\n"+u}a.length>h&&(s0&&_[h]==e[h];)h++,o--;for(l=l.slice(h),h=1;a>0&&_.length-h>y-1&&_[_.length-h]==e[e.length-h];)h++,a--;u-=h-1,c-=h-1;var d=l.length-h+1;return d<0&&(o=-d,d=0),l=l.slice(0,d),r||l||u||o||a||c?(C=!0,l&&!o&&!a&&!u&&!c||S?t.onTextInput(l):t.onTextInput(l,{extendLeft:o,extendRight:a,restoreStart:u,restoreEnd:c}),C=!1,_=e,y=i,b=s,T=c,l):""},L=function(e){if(v)return B();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var r=n.value,i=N(r,!0);(r.length>500||m.test(i))&&x()},O=function(e,t,n){var r=e.clipboardData||window.clipboardData;if(r&&!l){var i=u||n?"Text":"text/plain";try{return t?!1!==r.setData(i,t):r.getData(i)}catch(e){if(!n)return O(e,t,!0)}}},I=function(e,i){var s=t.getCopyText();if(!s)return r.preventDefault(e);O(e,s)?(p&&(x(s),g=s,setTimeout(function(){g=!1},10)),i?t.onCut():t.onCopy(),r.preventDefault(e)):(g=!0,n.value=s,n.select(),setTimeout(function(){g=!1,x(),i?t.onCut():t.onCopy()}))},k=function(e){I(e,!0)},M=function(e){I(e,!1)},P=function(e){var s=O(e);a.pasteCancelled()||("string"==typeof s?(s&&t.onPaste(s,e),i.isIE&&setTimeout(x),r.preventDefault(e)):(n.value="",E=!0))};r.addCommandKeyListener(n,t.onCommandKey.bind(t)),r.addListener(n,"select",function(e){v||(g?g=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=_.length&&e.value===_&&_&&e.selectionEnd!==b}(n)&&(t.selectAll(),x()))}),r.addListener(n,"input",L),r.addListener(n,"cut",k),r.addListener(n,"copy",M),r.addListener(n,"paste",P),"oncut"in n&&"oncopy"in n&&"onpaste"in n||r.addListener(e,"keydown",function(e){if((!i.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:M(e);break;case 86:P(e);break;case 88:k(e)}});var B=function(){if(v&&t.onCompositionUpdate&&!t.$readOnly){if(S)return $();if(v.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;N(e),v.markerRange&&(v.context&&(v.markerRange.start.column=v.selectionStart=v.context.compositionStartOffset),v.markerRange.end.column=v.markerRange.start.column+b-v.selectionStart+T)}}},U=function(e){t.onCompositionEnd&&!t.$readOnly&&(v=!1,t.onCompositionEnd(),t.off("mousedown",$),e&&L())};function $(){A=!0,n.blur(),n.focus(),A=!1}var G,V=o.delayedCall(B,50).schedule.bind(null,null);function W(){clearTimeout(G),G=setTimeout(function(){D&&(n.style.cssText=D,D=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()},0)}r.addListener(n,"compositionstart",function(e){if(!v&&t.onCompositionStart&&!t.$readOnly&&(v={},!S)){setTimeout(B,0),t.on("mousedown",$);var r=t.getSelectionRange();r.end.row=r.start.row,r.end.column=r.start.column,v.markerRange=r,v.selectionStart=y,t.onCompositionStart(v),v.useTextareaForIME?(n.value="",_="",y=0,b=0):(n.msGetInputContext&&(v.context=n.msGetInputContext()),n.getInputContext&&(v.context=n.getInputContext()))}}),r.addListener(n,"compositionupdate",B),r.addListener(n,"keyup",function(e){27==e.keyCode&&n.value.lengthb&&"\n"==_[s]?o=d.end:rb&&_.slice(0,s).split("\n").length>2?o=d.down:s>b&&" "==_[s-1]?(o=d.right,a=f.option):(s>b||s==b&&b!=y&&r==s)&&(o=d.right),r!==s&&(a|=f.shift),o){if(!t.onCommandKey({},a,o)&&t.commands){o=d.keyCodeToString(o);var l=t.commands.findKeyCommand(a,o);l&&t.execCommand(l)}y=r,b=s,x("")}}};document.addEventListener("selectionchange",s),t.on("destroy",function(){document.removeEventListener("selectionchange",s)})}(0,t,n)}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/useragent");function i(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function s(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)n=2*t.row-e.start.row-e.end.row;else n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,s=e.getButton();return 0!==s?((i.getSelectionRange().isEmpty()||1==s)&&i.selection.moveToPosition(n),void(2==s&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||i.isFocused()||(i.focus(),!this.$focusTimeout||this.$clickSelection||i.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(-1==r)e=this.$clickSelection.end;else if(1==r)e=this.$clickSelection.start;else{var i=s(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(i.start),a=this.$clickSelection.comparePoint(i.end);if(-1==o&&a<=0)t=this.$clickSelection.end,i.end.row==r.row&&i.end.column==r.column||(r=i.start);else if(1==a&&o>=0)t=this.$clickSelection.start,i.start.row==r.row&&i.start.column==r.column||(r=i.end);else if(-1==o&&1==a)r=i.end,t=i.start;else{var l=s(this.$clickSelection,r);r=l.cursor,t=l.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e,t,n,r,i=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,n=this.x,r=this.y,Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))),s=Date.now();(i>0||s-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session.getBracketRange(t);r?(r.isEmpty()&&(r.start.column--,r.end.column++),this.setState("select")):(r=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=r,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,s=i?e.wheelX/i:n.vx,o=i?e.wheelY/i:n.vy;i<550&&(s=(s+n.vx)/2,o=(o+n.vy)/2);var a=Math.abs(s/o),l=!1;return a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?n.allowed=r:r-n.allowed<550&&(Math.abs(s)<=1.5*Math.abs(n.vx)&&Math.abs(o)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=r):n.allowed=0),n.t=r,n.vx=s,n.vy=o,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(i.prototype),t.DefaultHandlers=i}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}(function(){this.$init=function(){return this.$element=r.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){r.addCssClass(this.getElement(),e)},this.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(i.prototype),t.Tooltip=i}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/event"),o=e("../tooltip").Tooltip;function a(e){o.call(this,e)}i.inherits(a,o),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),s=this.getHeight();(e+=15)+i>n&&(e-=e+i-n),(t+=15)+s>r&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=function(e){var t,n,i,o=e.editor,l=o.renderer.$gutterLayer,u=new a(o.container);function c(){t&&(t=clearTimeout(t)),i&&(u.hide(),i=null,o._signal("hideGutterTooltip",u),o.removeEventListener("mousewheel",c))}function h(e){u.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",function(t){if(o.isFocused()&&0==t.getButton()&&"foldWidgets"!=l.getRegion(t)){var n=t.getDocumentPosition().row,r=o.session.selection;if(t.getShiftKey())r.selectTo(n,0);else{if(2==t.domEvent.detail)return o.selectAll(),t.preventDefault();e.$clickSelection=o.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}),e.editor.setDefaultHandler("guttermousemove",function(s){var a=s.domEvent.target||s.domEvent.srcElement;if(r.hasCssClass(a,"ace_fold-widget"))return c();i&&e.$tooltipFollowsMouse&&h(s),n=s,t||(t=setTimeout(function(){t=null,n&&!e.isMousePressed?function(){var t=n.getDocumentPosition().row,r=l.$annotations[t];if(!r)return c();if(t==o.session.getLength()){var s=o.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(s>o.session.documentToScreenRow(a.row,a.column))return c()}if(i!=r)if(i=r.text.join("
"),u.setHtml(i),u.show(),o._signal("showGutterTooltip",u),o.on("mousewheel",c),e.$tooltipFollowsMouse)h(n);else{var d=n.domEvent.target.getBoundingClientRect(),f=u.getElement().style;f.left=d.right+"px",f.top=d.bottom+"px"}}():c()},50))}),s.addListener(o.renderer.$gutter,"mouseout",function(e){n=null,i&&!t&&(t=setTimeout(function(){t=null,c()},50))}),o.on("changeSession",c)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent");function o(e){var t=e.editor,n=r.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),t.addEventListener("mousedown",this.onMouseDown.bind(e));var o,l,u,c,h,d,f,p,m,g,E,v=t.container,C=0;function D(){var e=d;(function(e,n){var r=Date.now(),i=!n||e.row!=n.row,s=!n||e.column!=n.column;!g||i||s?(t.moveCursorToPosition(e),g=r,E={x:l,y:u}):a(E.x,E.y,l,u)>5?g=null:r-g>=200&&(t.renderer.scrollCursorIntoView(),g=null)})(d=t.renderer.screenToTextCoordinates(l,u),e),function(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,s=t.renderer.layerConfig.characterWidth,o=t.renderer.scroller.getBoundingClientRect(),a={x:{left:l-o.left,right:o.right-l},y:{top:u-o.top,bottom:o.bottom-u}},c=Math.min(a.x.left,a.x.right),h=Math.min(a.y.top,a.y.bottom),d={row:e.row,column:e.column};c/s<=2&&(d.column+=a.x.left=200&&t.renderer.scrollCursorIntoView(d):m=r:m=null}(d,e)}function S(){h=t.selection.toOrientedRange(),o=t.session.addMarker(h,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(c),D(),c=setInterval(D,20),C=0,i.addListener(document,"mousemove",y)}function A(){clearInterval(c),t.session.removeMarker(o),o=null,t.selection.fromOrientedRange(h),t.isFocused()&&!p&&t.$resetCursorStyle(),h=null,d=null,C=0,m=null,g=null,i.removeListener(document,"mousemove",y)}this.onDragStart=function(e){if(this.cancelDrag||!v.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}h=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?"copy":"copyMove",s.isOpera&&(t.container.appendChild(n),n.scrollTop=0),i.setDragImage&&i.setDragImage(n,0,0),s.isOpera&&t.container.removeChild(n),i.clearData(),i.setData("Text",t.session.getTextRange()),p=!0,this.setState("drag")},this.onDragEnd=function(e){if(v.draggable=!1,p=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;f||"move"!=n||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||S(),C++,e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||(S(),C++),null!==_&&(_=null),e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragLeave=function(e){if(--C<=0&&o)return A(),f=null,i.preventDefault(e)},this.onDrop=function(e){if(d){var n=e.dataTransfer;if(p)switch(f){case"move":h=h.contains(d.row,d.column)?{start:d,end:d}:t.moveText(h,d);break;case"copy":h=t.moveText(h,d,!0)}else{var r=n.getData("Text");h={start:d,end:t.session.insert(d,r)},t.focus(),f=null}return A(),i.preventDefault(e)}},i.addListener(v,"dragstart",this.onDragStart.bind(e)),i.addListener(v,"dragend",this.onDragEnd.bind(e)),i.addListener(v,"dragenter",this.onDragEnter.bind(e)),i.addListener(v,"dragover",this.onDragOver.bind(e)),i.addListener(v,"dragleave",this.onDragLeave.bind(e)),i.addListener(v,"drop",this.onDrop.bind(e));var _=null;function y(){null==_&&(_=setTimeout(function(){null!=_&&o&&A()},20))}function b(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function T(e){var t=["copy","copymove","all","uninitialized"],n=s.isMac?e.altKey:e.ctrlKey,r="uninitialized";try{r=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var i="none";return n&&t.indexOf(r)>=0?i="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(r)>=0?i="move":t.indexOf(r)>=0&&(i="copy"),i}}function a(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=s.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;s.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton();if(1===(e.domEvent.detail||1)&&0===r&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var i=e.domEvent.target||e.domEvent.srcElement;"unselectable"in i&&(i.unselectable="on"),t.getDragDelay()?(s.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(o.prototype),t.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./mouse_event").MouseEvent,i=e("../lib/dom");t.addTouchListeners=function(e,t){var n,s,o,a,l,u,c,h,d,f="scroll",p=0,m=0,g=0,E=0;function v(){var e,n,r;d||(e=window.navigator&&window.navigator.clipboard,n=!1,r=function(r){var s,o,a=r.target.getAttribute("action");if("more"==a||!n)return n=!n,s=t.getCopyText(),o=t.session.getUndoManager().hasUndo(),void d.replaceChild(i.buildDom(n?["span",!s&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],s&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],s&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],o&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),d.firstChild);"paste"==a?e.readText().then(function(e){t.execCommand(a,e)}):a&&("cut"!=a&&"copy"!=a||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(a)),d.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&t.focus()},d=i.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){f="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),r(e)},onclick:r},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container));var s=t.selection.cursor,o=t.renderer.textToScreenCoordinates(s.row,s.column),a=t.container.getBoundingClientRect();d.style.top=o.pageY-a.top-3+"px",d.style.right="10px",d.style.display="",d.firstChild.style.display="none",t.on("input",C)}function C(e){d&&(d.style.display="none"),t.off("input",C)}function D(){l=null,clearTimeout(l);var e=t.selection.getRange(),n=e.contains(c.row,c.column);!e.isEmpty()&&n||(t.selection.moveToPosition(c),t.selection.selectWord()),f="wait",v()}e.addEventListener("contextmenu",function(e){h&&t.textInput.getElement().focus()}),e.addEventListener("touchstart",function(e){var i=e.touches;if(l||i.length>1)return clearTimeout(l),l=null,o=-1,void(f="zoom");h=t.$mouseHandler.isMousePressed=!0;var u=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,v=e.timeStamp;a=v;var C=i[0],S=C.clientX,A=C.clientY;Math.abs(n-S)+Math.abs(s-A)>u&&(o=-1),n=e.clientX=S,s=e.clientY=A,g=E=0;var _=new r(e,t);if(c=_.getDocumentPosition(),v-o<500&&1==i.length&&!p)m++,e.preventDefault(),e.button=0,function(){l=null,clearTimeout(l),t.selection.moveToPosition(c);var e=m>=2?t.selection.getLineRange(c.row):t.session.getBracketRange(c);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),f="wait"}();else{m=0;var y=t.selection.cursor,b=t.selection.isEmpty()?y:t.selection.anchor,T=t.renderer.$cursorLayer.getPixelPosition(y,!0),R=t.renderer.$cursorLayer.getPixelPosition(b,!0),x=t.renderer.scroller.getBoundingClientRect(),w=function(e,t){return(e/=d)*e+(t=t/u-.75)*t};if(e.clientXN?"cursor":"anchor"),f=N<3.5?"anchor":F<3.5?"cursor":"scroll",l=setTimeout(D,450)}o=v}),e.addEventListener("touchend",function(e){h=t.$mouseHandler.isMousePressed=!1,u&&clearInterval(u),"zoom"==f?(f="",p=0):l?(t.selection.moveToPosition(c),p=0,v()):"scroll"==f?(p+=60,u=setInterval(function(){p--<=0&&(clearInterval(u),u=null),Math.abs(g)<.01&&(g=0),Math.abs(E)<.01&&(E=0),p<20&&(g*=.9),p<20&&(E*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*g,10*E),e==t.session.getScrollTop()&&(p=0)},10),e.preventDefault(),C()):v(),clearTimeout(l),l=null}),e.addEventListener("touchmove",function(e){l&&(clearTimeout(l),l=null);var i=e.touches;if(!(i.length>1||"zoom"==f)){var o=i[0],u=n-o.clientX,c=s-o.clientY;if("wait"==f){if(!(u*u+c*c>4))return e.preventDefault();f="cursor"}n=o.clientX,s=o.clientY,e.clientX=o.clientX,e.clientY=o.clientY;var h=e.timeStamp,d=h-a;if(a=h,"scroll"==f){var p=new r(e,t);p.speed=1,p.wheelX=u,p.wheelY=c,10*Math.abs(u)1&&(i=n[n.length-2]);var o=l[t+"Path"];return null==o?o=l.basePath:"/"==r&&(t=r=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+t+r+i+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,r){var i,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{i=e(n)}catch(e){}if(i&&!t.$loading[n])return r&&r(i);if(t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r),!(t.$loading[n].length>1)){var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var r=t.$loading[n];t.$loading[n]=null,r.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,o),a),u()}};var u=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),u=function(){})};function c(i){if(a&&a.document){l.packaged=i||e.packaged||r.packaged||a.define&&n.amdD.packaged;for(var s={},o="",u=document.currentScript||document._currentScript,c=(u&&u.ownerDocument||document).getElementsByTagName("script"),d=0;d=e){for(s=h+1;s=e;)s++;for(a=h,l=s-1;a=t.length||2!=(l=n[i-1])&&3!=l||2!=(u=t[i+1])&&3!=u?4:(s&&(u=3),u==l?u:4);case 10:return 2==(l=i>0?n[i-1]:5)&&i+10&&2==n[i-1])return 2;if(s)return 4;for(f=i+1,d=t.length;f=1425&&m<=2303||64286==m;if(l=t[f],g&&(1==l||7==l))return 1}return i<1||5==(l=t[i-1])?4:n[i-1];case 5:return s=!1,o=!0,r;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:s=!1;case h:return 4}}function g(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?t>191?0:d[t]:5==n?/[\u0591-\u05f4]/.test(e)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?12:/[\u0660-\u0669\u066b-\u066c]/.test(e)?3:1642==t?c:/[\u06f0-\u06f9]/.test(e)?2:7:32==n&&t<=8287?f[255&t]:254==n&&t>=65136?7:4}t.L=0,t.R=1,t.EN=2,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,n,c){if(e.length<2)return{};var d=e.split(""),f=new Array(d.length),E=new Array(d.length),v=[];r=c?1:0,function(e,t,n,c){var h=r?u:l,d=null,f=null,p=null,E=0,v=null,C=-1,D=null,S=null,A=[];if(!c)for(D=0,c=[];D0)if(16==v){for(D=C;D-1){for(D=C;D=0&&8==c[_];_--)t[_]=r}}(d,v,d.length,n);for(var C=0;C7&&n[C]<13||4===n[C]||n[C]===h)?v[C]=t.ON_R:C>0&&"ل"===d[C-1]&&/\u0622|\u0623|\u0625|\u0627/.test(d[C])&&(v[C-1]=v[C]=t.R_H,C++);for(d[d.length-1]===t.DOT&&(v[d.length-1]=t.B),"‫"===d[0]&&(v[0]=t.RLE),C=0;C=0&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,r=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===r;)r=n,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[e];s&&(void 0===t&&(t=this.getSplitIndex()),t>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&s[i]%2!=0&&i++;for(var a=0;at&&s[i]%2==0&&(o+=this.charWidths[s[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(e,t){var n,r=this.bidiMap,i=r.bidiLevels,s=[],o=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,u=!1,c=!1,h=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,f=0;f=a&&dn+s/2;){if(n+=s,r===i.length-1){s=0;break}s=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!=0&&i[r]%2==0?(e0&&i[r-1]%2==0&&i[r]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&0===s&&i[r-1]%2==0||!this.isRtlDir&&0===r&&i[r]%2!=0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!=0&&0!==s&&r--,t=this.bidiMap.logicalFromVisual[r]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(o.prototype),t.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")})};(function(){r.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},this.$setSelection=function(e,t,n,r){var i=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||s)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n,r="number"==typeof e?e:this.lead.row,i=this.session.getFoldLine(r);return i?(r=i.start.row,n=i.end.row):n=r,!0===t?new o(r,0,n,this.session.getLine(n).length):new o(r,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i)this.moveCursorTo(i.end.row,i.end.column);else{if(this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t)),t>=n.length)return this.moveCursorTo(e,n.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(s)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)}},this.$shortWordEndIndex=function(e){var t,n=0,r=/\s/,i=this.session.tokenRe;if(i.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&r.test(t);)n++;if(n<1)for(i.lastIndex=0;(t=e[n])&&!i.test(t);)if(i.lastIndex=0,n++,r.test(t)){if(n>2){n--;break}for(;(t=e[n])&&r.test(t);)n++;if(n>2)break}}return i.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do{e++,r=this.doc.getLine(e)}while(e0&&/^\s*$/.test(r));n=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(t,n-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n,r=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(r.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(r.column),r.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=r.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?r.column=this.$desiredColumn:this.$desiredColumn=r.column);var i=this.session.screenToDocumentPosition(r.row+e,r.column,n);0!==e&&0===t&&i.row===this.lead.row&&i.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[i.row]&&(i.row>0||e>0)&&i.row++,this.moveCursorTo(i.row,i.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch(e){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,n){"use strict";var r=e("./config"),i=2e3,s=function(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],r=[],i=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",a=[],l=0;l1?this.$applyToken:u.token),h>1&&(/\\\d/.test(u.regex)?c=u.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(h=1,c=this.removeCapturingGroups(u.regex)),u.splitRegex||"string"==typeof u.token||a.push(u)),s[i]=l,i+=h,r.push(c),u.onMatch||(u.onMatch=null)}}r.length||(s[0]=0,r.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){i=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var r=[],i=0,s=n.length;ic){var E=e.substring(c,g-m.length);d.type==f?d.value+=E:(d.type&&u.push(d),d={type:f,value:E})}for(var v=0;vi){for(h>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});c1&&n[0]!==r&&n.unshift("#tmp",r),{tokens:u,state:n.length?n:r}},this.reportError=r.reportError}).call(s.prototype),t.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var n in e){for(var r=e[n],i=0;i=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(void 0!==n)return n;for(n=0;t>0;)n+=e[t-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)}}).call(i.prototype),t.TokenIterator=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r,i=e("../../lib/oop"),s=e("../behaviour").Behaviour,o=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],u=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],c={},h={'"':'"',"'":"'"},d=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,c.rangeCount!=e.multiSelect.rangeCount&&(c={rangeCount:e.multiSelect.rangeCount})),c[t])return r=c[t];r=c[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},f=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},p=function(e){this.add("braces","insertion",function(t,n,i,s,o){var l=i.getCursorPosition(),u=s.doc.getLine(l.row);if("{"==o){d(i);var c=i.getSelectionRange(),h=s.doc.getTextRange(c);if(""!==h&&"{"!==h&&i.getWrapBehavioursEnabled())return f(c,h,"{","}");if(p.isSaneInsertion(i,s))return/[\]\}\)]/.test(u[l.column])||i.inMultiSelectMode||e&&e.braces?(p.recordAutoInsert(i,s,"}"),{text:"{}",selection:[1,1]}):(p.recordMaybeInsert(i,s,"{"),{text:"{",selection:[1,1]})}else if("}"==o){if(d(i),"}"==u.substring(l.column,l.column+1)&&null!==s.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&p.isAutoInsertedClosing(l,u,o))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==o||"\r\n"==o){d(i);var m="";if(p.isMaybeInsertedClosing(l,u)&&(m=a.stringRepeat("}",r.maybeInsertedBrackets),p.clearMaybeInsertedClosing()),"}"===u.substring(l.column,l.column+1)){var g=s.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!g)return null;var E=this.$getIndent(s.getLine(g.row))}else{if(!m)return void p.clearMaybeInsertedClosing();E=this.$getIndent(u)}var v=E+s.getTabString();return{text:"\n"+v+"\n"+E+m,selection:[1,v.length,1,v.length]}}p.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,i,s){var o=i.doc.getTextRange(s);if(!s.isMultiLine()&&"{"==o){if(d(n),"}"==i.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s;r.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if("("==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"(",")");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(")"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"("==s&&(d(n),")"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("brackets","insertion",function(e,t,n,r,i){if("["==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"[","]");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if("]"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"["==s&&(d(n),"]"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("string_dquotes","insertion",function(e,t,n,r,i){var s=r.$mode.$quotes||h;if(1==i.length&&s[i]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(i))return;d(n);var o=i,a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(!(""===l||1==l.length&&s[l])&&n.getWrapBehavioursEnabled())return f(a,l,o,o);if(!l){var u=n.getCursorPosition(),c=r.doc.getLine(u.row),p=c.substring(u.column-1,u.column),m=c.substring(u.column,u.column+1),g=r.getTokenAt(u.row,u.column),E=r.getTokenAt(u.row,u.column+1);if("\\"==p&&g&&/escape/.test(g.type))return null;var v,C=g&&/string|escape/.test(g.type),D=!E||/string|escape/.test(E.type);if(m==o)(v=C!==D)&&/string\.end/.test(E.type)&&(v=!1);else{if(C&&!D)return null;if(C&&D)return null;var S=r.$mode.tokenRe;S.lastIndex=0;var A=S.test(p);S.lastIndex=0;var _=S.test(p);if(A||_)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;var y=c[u.column-2];if(p==o&&(y==o||S.test(y)))return null;v=!0}return{text:v?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.$mode.$quotes||h,o=r.doc.getTextRange(i);if(!i.isMultiLine()&&s.hasOwnProperty(o)&&(d(n),r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==o))return i.end.column++,i})};p.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new o(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",l)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var i=new o(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",l))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",u)},p.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},p.recordAutoInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isAutoInsertedClosing(i,s,r.autoInsertedLineEnd[0])||(r.autoInsertedBrackets=0),r.autoInsertedRow=i.row,r.autoInsertedLineEnd=n+s.substr(i.column),r.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isMaybeInsertedClosing(i,s)||(r.maybeInsertedBrackets=0),r.maybeInsertedRow=i.row,r.maybeInsertedLineStart=s.substr(0,i.column)+n,r.maybeInsertedLineEnd=s.substr(i.column),r.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return r.autoInsertedBrackets>0&&e.row===r.autoInsertedRow&&n===r.autoInsertedLineEnd[0]&&t.substr(e.column)===r.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return r.maybeInsertedBrackets>0&&e.row===r.maybeInsertedRow&&t.substr(e.column)===r.maybeInsertedLineEnd&&t.substr(0,e.column)==r.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){r.autoInsertedLineEnd=r.autoInsertedLineEnd.substr(1),r.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){r&&(r.maybeInsertedBrackets=0,r.maybeInsertedRow=-1)},i.inherits(p,s),t.CstyleBehaviour=p}),ace.define("ace/unicode",["require","exports","module"],function(e,t,n){"use strict";for(var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,s=[],o=0;o2?r%u!=u-1:r%u==0})}else{if(!this.blockComment)return!1;var f=this.blockComment.start,p=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+l.escapeRegExp(f)+")"),g=new RegExp("(?:"+l.escapeRegExp(p)+")\\s*$"),E=function(e,t){C(e,t)||s&&!/\S/.test(e)||(i.insertInLine({row:t,column:e.length},p),i.insertInLine({row:t,column:a},f))},v=function(e,t){var n;(n=e.match(g))&&i.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(m))&&i.removeInLine(t,n[1].length,n[0].length)},C=function(e,n){if(m.test(e))return!0;for(var r=t.getTokens(n),i=0;ie.length&&(S=e.length)}),a==1/0&&(a=S,s=!1,o=!1),c&&a%u!=0&&(a=Math.floor(a/u)*u),D(o?v:E)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(i){!i.start&&i[0]&&(i=i[0]);var s,o,a=(m=new u(t,r.row,r.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var h,d;a&&/comment/.test(a.type);){if(-1!=(g=a.value.indexOf(i.start))){var f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g;h=new c(f,p,f,p+i.start.length);break}a=m.stepBackward()}var m;for(a=(m=new u(t,r.row,r.column)).getCurrentToken();a&&/comment/.test(a.type);){var g;if(-1!=(g=a.value.indexOf(i.end))){f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g,d=new c(f,p,f,p+i.end.length);break}a=m.stepForward()}d&&t.remove(d),h&&(t.remove(h),s=h.start.row,o=-i.start.length)}else o=i.start.length,s=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);l.start.row==s&&(l.start.column+=o),l.end.row==s&&(l.end.column+=o),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var n=e[t],i=n.prototype.$id,s=r.$modes[i];s||(r.$modes[i]=s=new n),r.$modes[t]||(r.$modes[t]=s),this.$embeds.push(t),this.$modes[t]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;tthis.row)){var n=function(t,n,r){var i="insert"==t.action,s=(i?1:-1)*(t.end.row-t.start.row),o=(i?1:-1)*(t.end.column-t.start.column),a=t.start,l=i?a:t.end;return e(n,a,r)?{row:n.row,column:n.column}:e(l,n,!r)?{row:n.row+s,column:n.column+(n.row==l.row?o:0)}:{row:a.row,column:a.column}}(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(e,t,n){var r;if(r=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=r.row||this.column!=r.column){var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=e("./anchor").Anchor,l=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new a(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();void 0===e?e=n:e<0?e=0:e>=n&&(e=n-1,t=void 0);var r=this.getLine(e);return null==t&&(t=r.length),{row:e,column:t=Math.min(Math.max(t,0),r.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof o||(e=o.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,r=n.length-t+1,i=e.start.row,s=e.start.column,o=0,a=0;o20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,-1==r&&(r=t),s<=r&&n.fireUpdateEvent(s,r)}}};(function(){r.implement(this,i),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens}}).call(s.prototype),t.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=(e("./lib/oop"),e("./range").Range),s=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,n,s){if(this.regExp)for(var o=s.firstRow,a=s.lastRow,l=o;l<=a;l++){var u=this.cache[l];null==u&&((u=r.getMatchOffsets(n.getLine(l),this.regExp)).length>this.MAX_RANGES&&(u=u.slice(0,this.MAX_RANGES)),u=u.map(function(e){return new i(l,e.offset,l,e.offset+e.length)}),this.cache[l]=u.length?u:"");for(var c=u.length;c--;)t.drawSingleLineMarker(e,u[c].toScreenRange(n),this.clazz,s)}}}).call(s.prototype),t.SearchHighlight=s}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range;function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var r,i,s=0,o=this.folds,a=!0;null==t&&(t=this.end.row,n=this.end.column);for(var l=0;l0)){var l=r(e,o.start);return 0===a?t&&0!==l?-s-2:s:l>0||0===l&&!t?s:-s-1}}return-s-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},this.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],n=this.ranges,i=(n=n.sort(function(e,t){return r(e.start,t.start)}))[0],s=1;s=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=r);o++);if("insert"==e.action){for(var l=i-r,u=-t.column+n.column;or);o++)if(c.start.row==r&&c.start.column>=t.column&&(c.start.column==t.column&&this.$bias<=0||(c.start.column+=u,c.start.row+=l)),c.end.row==r&&c.end.column>=t.column){if(c.end.column==t.column&&this.$bias<0)continue;c.end.column==t.column&&u>0&&oc.start.column&&c.end.column==s[o+1].start.column&&(c.end.column-=u),c.end.column+=u,c.end.row+=l}}else for(l=r-i,u=t.column-n.column;oi);o++)c.end.rowt.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=u,c.end.row+=l):c.end.row>i&&(c.end.row+=l),c.start.rowt.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=u,c.start.row+=l):c.start.row>i&&(c.start.row+=l);if(0!=l&&o=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;for(t&&(r=n.indexOf(t)),-1==r&&(r=0);r=e)return i}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,r=t-e+1,i=0;i=t){a=e?r-=t-a:r=0);break}o>=e&&(r-=a>=e?o-a:o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n,r=this.$foldData,o=!1;e instanceof s?n=e:(n=new s(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,u=n.end.row,c=n.end.column,h=this.getFoldAt(a,l,1),d=this.getFoldAt(u,c,-1);if(h&&d==h)return h.addSubFold(n);h&&!h.range.isStart(a,l)&&this.removeFold(h),d&&!d.range.isEnd(u,c)&&this.removeFold(d);var f=this.getFoldsInRange(n.range);f.length>0&&(this.removeFolds(f),f.forEach(function(e){n.addSubFold(e)}));for(var p=0;p0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;if(null==e?(n=new r(0,0,this.getLength(),0),t=!0):n="number"==typeof e?new r(e,0,e,this.getLine(e).length):"row"in e?r.fromPoints(e,e):e,i=this.getFoldsInRangeList(n),t)this.removeFolds(i);else for(var s=i;s.length;)this.expandFolds(s),s=this.getFoldsInRangeList(n);if(i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){null==r&&(r=e.start.row),null==i&&(i=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var s=this.doc,o="";return e.walk(function(e,t,n,a){if(!(tc)break}while(s&&l.test(s.type));s=i.stepBackward()}else s=i.getCurrentToken();return u.end.row=i.getCurrentTokenRow(),u.end.column=i.getCurrentTokenColumn()+s.value.length-2,u}},this.foldAll=function(e,t,n){null==n&&(n=1e5);var r=this.foldWidgets;if(r){t=t||this.getLength();for(var i=e=e||0;i=e){i=s.end.row;try{var o=this.addFold("...",s);o&&(o.collapseChildren=n)}catch(e){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};for(var r,i=e-1;i>=0;){var s=n[i];if(null==s&&(s=n[i]=this.getFoldWidget(i)),"start"==s){var o=this.getFoldWidgetRange(i);if(r||(r=o),o&&o.end.row>=e)break}i--}return{range:-1!==i&&o,firstRange:r}},this.onFoldWidgetClick=function(e,t){var n={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var r=t.target||t.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),r=this.getLine(e),i="end"===n?-1:1,s=this.getFoldAt(e,-1===i?0:r.length,i);if(s)return t.children||t.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()&&(s=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(s.range))return this.removeFold(s),s;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,u=a.range.end.row;this.foldAll(l,u,t.all?1e4:0)}else t.children?(u=o?o.end.row:this.getLength(),this.foldAll(e+1,u,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var r=this.getParentFoldRangeData(t,!0);if(n=r.range||r.firstRange){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold("...",n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){"use strict";var r=e("../token_iterator").TokenIterator,i=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(""==n)return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t,n=this.getLine(e.row),r=!0,s=n.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(o||(s=n.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),r=!1),!o)return null;if(o[1]){if(!(a=this.$findClosingBracket(o[1],e)))return null;t=i.fromPoints(e,a),r||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a;if(!(a=this.$findOpeningBracket(o[2],e)))return null;t=i.fromPoints(a,e),r||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn()-2,u=a.value;;){for(;l>=0;){var c=u.charAt(l);if(c==i){if(0==(s-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else c==e&&(s+=1);l-=1}do{a=o.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(u=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn();;){for(var u=a.value,c=u.length;ln&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>1,s=e[i];if(t>s)n=i+1;else{if(!(t=t);s++);return(n=r[s])?(n.index=s,n.start=i-n.value.length,n):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe)),r)var i=this.tokenRe;else i=/^\s+$/.test(n.slice(t-1,t+1))?/\s/:this.nonTokenRe;var s=t;if(s>0){do{s--}while(s>=0&&n.charAt(s).match(i));s++}for(var o=t;oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,s=this.$foldData[i],o=s?s.start.row:1/0,a=t.length,l=0;lo){if((l=s.end.row+1)>=a)break;o=(s=this.$foldData[i++])?s.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>r&&(r=n[l])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var r=e[n];"insert"==r.action||"remove"==r.action?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;ne.end.column&&(s.start.column+=u),s.end.row==e.end.row&&s.end.column>e.end.column&&(s.end.column+=u)),o&&s.start.row>=e.end.row&&(s.start.row+=o,s.end.row+=o)}if(s.end=this.insert(s.start,r),i.length){var a=e.start,l=s.start,u=(o=l.row-a.row,l.column-a.column);this.addFolds(i.map(function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=u),e.end.row==a.row&&(e.end.column+=u),e.start.row+=o,e.end.row+=o,e}))}return s},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},this.outdentRows=function(e){for(var t=e.collapseRows(),n=new c(0,0,0,0),r=this.getTabSize(),i=t.start.row;i<=t.end.row;++i){var s=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o0){var i;if((i=this.getRowFoldEnd(t+n))>this.doc.getLength()-1)return 0;r=i-t}else e=this.$clipRowToDocument(e),r=(t=this.$clipRowToDocument(t))-e+1;var s=new c(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(e){return(e=e.clone()).start.row+=r,e.end.row+=r,e}),a=0==n?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+r,a),o.length&&this.addFolds(o),r},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1&&(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,i=e.end,s=r.row,o=i.row,a=o-s,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[t?"$wrapData":"$rowLengthCache"].splice(s,a);var u=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var c=0;if(m=this.getFoldLine(i.row)){m.addRemoveChars(i.row,i.column,r.column-i.column),m.shiftRow(-a);var h=this.getFoldLine(s);h&&h!==m&&(h.merge(m),m=h),c=u.indexOf(m)+1}for(;c=i.row&&m.shiftRow(-a);o=s}else{var d=Array(a);d.unshift(s,0);var f=t?this.$wrapData:this.$rowLengthCache;if(f.splice.apply(f,d),u=this.$foldData,c=0,m=this.getFoldLine(s)){var p=m.range.compareInside(r.row,r.column);0==p?(m=m.split(r.row,r.column))&&(m.shiftRow(a),m.addRemoveChars(o,0,i.column-r.column)):-1==p&&(m.addRemoveChars(s,0,i.column-r.column),m.shiftRow(a)),c=u.indexOf(m)+1}for(;c=s&&m.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===n&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(m=this.getFoldLine(s))&&m.addRemoveChars(s,r.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),l},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(n,r){var i,s,o=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,u=this.$wrapLimit,c=n;for(r=Math.min(r,o.length-1);c<=r;)(s=this.getFoldLine(c,s))?(i=[],s.walk(function(n,r,s,a){var l;if(null!=n){(l=this.$getDisplayTokens(n,i.length))[0]=e;for(var u=1;u=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}this.$computeWrapSplits=function(n,r,i){if(0==n.length)return[];var s=[],o=n.length,a=0,l=0,u=this.$wrapAsCode,c=this.$indentedSoftWrap,h=r<=Math.max(2*i,8)||!1===c?0:Math.floor(r/2);function d(e){for(var t=e-a,r=a;rr-f;){var p=a+r-f;if(n[p-1]>=10&&n[p]>=10)d(p);else if(n[p]!=e&&n[p]!=t){for(var m=Math.max(p-(r-(r>>2)),a-1);p>m&&n[p]m&&n[p]m&&9==n[p];)p--}else for(;p>m&&n[p]<10;)p--;p>m?d(++p):(2==n[p=a+r]&&p--,d(p-f))}else{for(;p!=a-1&&n[p]!=e;p--);if(p>a){d(p);continue}for(p=a+r;p39&&o<48||o>57&&o<64?i.push(9):o>=4352&&n(o)?i.push(1,2):i.push(1)}return i},this.$getStringScreenWidth=function(e,t,r){if(0==t)return[0,0];var i,s;for(null==t&&(t=1/0),r=r||0,s=0;s=4352&&n(i)?r+=2:r+=1,!(r>t));s++);return[r,s]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0){a=u[c],s=this.$docRowCache[c];var d=e>u[h-1]}else d=!h;for(var f=this.getLength()-1,p=this.getNextFoldLine(s),m=p?p.start.row:1/0;a<=e&&!(a+(l=this.getRowLength(s))>e||s>=f);)a+=l,++s>m&&(s=p.end.row+1,m=(p=this.getNextFoldLine(s,p))?p.start.row:1/0),d&&(this.$docRowCache.push(s),this.$screenRowCache.push(a));if(p&&p.start.row<=s)r=this.getFoldDisplayLine(p),s=p.start.row;else{if(a+l<=e||s>f)return{row:f,column:this.getLine(f).length};r=this.getLine(s),p=null}var g=0,E=Math.floor(e-a);if(this.$useWrapMode){var v=this.$wrapData[s];v&&(i=v[E],E>0&&v.length&&(g=v.indent,o=v[E-1]||v[v.length-1],r=r.substring(o)))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+E,s,E)&&(t=this.$bidiHandler.offsetToCol(n)),o+=this.$getStringScreenWidth(r,t-g)[1],this.$useWrapMode&&o>=i&&(o=i-1),p?p.idxToPosition(o):{row:s,column:o}},this.documentToScreenPosition=function(e,t){if(void 0===t)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r,i=0,s=null;(r=this.getFoldAt(e,t,1))&&(e=r.start.row,t=r.start.column);var o,a=0,l=this.$docRowCache,u=this.$getRowCacheIndex(l,e),c=l.length;if(c&&u>=0){a=l[u],i=this.$screenRowCache[u];var h=e>l[c-1]}else h=!c;for(var d=this.getNextFoldLine(a),f=d?d.start.row:1/0;a=f){if((o=d.end.row+1)>e)break;f=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;i+=this.getRowLength(a),a=o,h&&(this.$docRowCache.push(a),this.$screenRowCache.push(i))}var p="";d&&a>=f?(p=this.getFoldDisplayLine(d,e,t),s=d.start.row):(p=this.getLine(e).substring(0,t),s=e);var m=0;if(this.$useWrapMode){var g=this.$wrapData[s];if(g){for(var E=0;p.length>=g[E];)i++,E++;p=p.substring(g[E-1]||0,p.length),m=E>0?g.indent:0}}return{row:i,column:m+this.$getStringScreenWidth(p)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,r=0,i=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);ri&&(r=t.end.row+1,i=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var o=this.$foldData,a=0;an);s++);return[r,s]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=n}.call(p.prototype),e("./edit_session/folding").Folding.call(p.prototype),e("./edit_session/bracket_match").BracketMatch.call(p.prototype),o.defineOptions(p.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=p}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(){this.$options={}};(function(){this.set=function(e){return i.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i,o){return r=new s(e,n,i,o),!(n==o&&t.start&&t.start.start&&0!=t.skipCurrent&&r.isEqual(t.start)&&(r=null,1))}),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],a=t.re;if(t.$isMultiLine){var l,u=a.length,c=i.length-u;e:for(var h=a.offset||0;h<=c;h++){for(var d=0;dm||(o.push(l=new s(h,m,h+u-1,g)),u>2&&(h=h+u-2))}}else for(var E=0;ES&&o[d].end.row==n.end.row;)d--;for(o=o.slice(E,d+1),E=0,d=o.length;E=a;n--)if(h(n,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(n=l,a=o.row;n>=a;n--)if(h(n,Number.MAX_VALUE,e))return}};else u=function(e){var n=o.row;if(!h(n,o.column,e)){for(n+=1;n<=l;n++)if(h(n,0,e))return;if(0!=t.wrap)for(n=a,l=o.row;n<=l;n++)if(h(n,0,e))return}};if(t.$isMultiLine)var c=n.length,h=function(t,i,s){var o=r?t-c+1:t;if(!(o<0)){var a=e.getLine(o),l=a.search(n[0]);if(!(!r&&li))return!!s(o,l,o+c-1,h)||void 0}}};else h=r?function(t,r,i){var s,o=e.getLine(t),a=[],l=0;for(n.lastIndex=0;s=n.exec(o);){var u=s[0].length;if(l=s.index,!u){if(l>=o.length)break;n.lastIndex=l+=1}if(s.index+u>r)break;a.push(s.index,u)}for(var c=a.length-1;c>=0;c-=2){var h=a[c-1];if(i(t,h,t,h+(u=a[c])))return!0}}:function(t,r,i){var s,o,a=e.getLine(t);for(n.lastIndex=r;o=n.exec(a);){var l=o[0].length;if(i(t,s=o.index,t,s+l))return!0;if(!l&&(n.lastIndex=s+=1,s>=a.length))return!1}};return{forEach:u}}}).call(o.prototype),t.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/keys"),i=e("../lib/useragent"),s=r.KEY_MODS;function o(e,t){this.platform=t||(i.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function a(e,t){o.call(this,e,t),this.$singleCommand=!1}a.prototype=o.prototype,function(){function e(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var n=e&&("string"==typeof e?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var s=r[i];if(s==e)delete r[i];else if(Array.isArray(s)){var o=s.indexOf(e);-1!=o&&(s.splice(o,1),1==s.length&&(r[i]=s[0]))}}},this.bindKey=function(e,t,n){if("object"==typeof e&&e&&(null==n&&(n=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach(function(e){var r="";if(-1!=e.indexOf(" ")){var i=e.split(/\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=s[t.hashId]+t.key;r+=(r?" ":"")+n,this._addCommandToBinding(r,"chainKeys")},this),r+=" "}var o=this.parseKeys(e),a=s[o.hashId]+o.key;this._addCommandToBinding(r+a,t,n)},this)},this._addCommandToBinding=function(t,n,r){var i,s=this.commandKeyBinding;if(n)if(!s[t]||this.$singleCommand)s[t]=n;else{Array.isArray(s[t])?-1!=(i=s[t].indexOf(n))&&s[t].splice(i,1):s[t]=[s[t]],"number"!=typeof r&&(r=e(n));var o=s[t];for(i=0;ir);i++);o.splice(i,0,n)}else delete s[t]},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(n){if("string"==typeof n)return this.bindKey(n,t);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=t),this.addCommand(n))}},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),i=r[n];if(r.FUNCTION_KEYS[i])n=r.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:n.toUpperCase(),hashId:-1}}for(var s=0,o=t.length;o--;){var a=r.KEY_MODS[t[o]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[o]+" in "+e),!1;s|=a}return{key:n,hashId:s}},this.findKeyCommand=function(e,t){var n=s[e]+t;return this.commandKeyBinding[n]},this.handleKeyboard=function(e,t,n,r){if(!(r<0)){var i=s[t]+n,o=this.commandKeyBinding[i];return e.$keyChain&&(e.$keyChain+=" "+i,o=this.commandKeyBinding[e.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(e.$keyChain&&(t&&4!=t||1!=n.length?(-1==t||r>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-i.length-1)),{command:o}):(e.$keyChain=e.$keyChain||i,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(o.prototype),t.HashHandler=o,t.MultiHashHandler=a}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){i.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};r.inherits(o,i),function(){r.implement(this,s),this.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var i={editor:t,command:e,args:n};return i.returnValue=this._emit("exec",i),this._signal("afterExec",i),!1!==i.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map(function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=e("../config"),s=e("../range").Range;function o(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(e){i.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,a=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(n.row),u=n.row+1;u<=i.row+1;u++){var c=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(u)));0!==c.length&&(c=" "+c),l+=c}i.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;o=i.lastRow||r.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var i=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&-1!==n.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var n=this;E.loadModule(["keybinding",e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||i.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=t.findMatchingBracket(e.getCursorPosition());if(n)var r=new f(n.row,n.column,n.row,n.column+1);else t.$mode.getMatching&&(r=t.$mode.getMatching(e.session));r&&(t.$bracketHighlight=t.addMarker(r,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=e.getCursorPosition(),r=new v(e.session,n.row,n.column),i=r.getCurrentToken();if(!i||!/\b(?:tag-open|tag-name)/.test(i.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1==i.type.indexOf("tag-open")||(i=r.stepForward())){var s=i.value,o=0,a=r.stepBackward();if("<"==a.value)do{a=i,(i=r.stepForward())&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"=0);else{do{i=a,a=r.stepBackward(),i&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var n=new f(e.row,e.column,e.row,1/0);n.id=t.addMarker(n,"ace_active-line","screenLine"),t.$highlightLineMarker=n}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var n=t.start.column,r=t.end.column,i=e.getLine(t.start.row),s=i.substring(n,r);if(!(s.length>5e3)&&/[\w\d]/.test(s)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),a=i.substring(n-1,r+1);if(o.test(a))return o}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var r=this.selection.getAllRanges(),i=0;ia.search(/\S|$/)){var l=a.substr(i.column).search(/\S|$/);n.doc.removeInLine(i.row,i.column,i.column+l)}}this.clearSelection();var u=i.column,c=n.getState(i.row),h=(a=n.getLine(i.row),r.checkOutdent(c,a,e));if(n.insert(i,e),s&&s.selection&&(2==s.selection.length?this.selection.setSelectionRange(new f(i.row,u+s.selection[0],i.row,u+s.selection[1])):this.selection.setSelectionRange(new f(i.row+s.selection[0],s.selection[1],i.row+s.selection[2],s.selection[3]))),n.getDocument().isNewLine(e)){var d=r.getNextLineIndent(c,a.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},d)}h&&r.autoOutdent(c,n,i.row)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(e,t){var n;(t.extendLeft||t.extendRight)&&((n=this.selection.getRange()).start.column-=t.extendLeft,n.end.column+=t.extendRight,this.selection.setRange(n),e||n.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((n=this.selection.getRange()).start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,"deletion",this,n,t);if(0===t.end.column){var s=n.getTextRange(t);if("\n"==s[s.length-1]){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var n,r,i=this.session.getLine(e.row);tt.toLowerCase()?1:0});var i=new f(0,0,0,0);for(r=e.first;r<=e.last;r++){var s=t.getLine(r);i.start.row=r,i.end.row=r,i.end.column=s.length,t.replace(i,n[r-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var r=this.session.getLine(e);n.lastIndex=t)return{value:i[0],start:i.index,end:i.index+i[0].length}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new f(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var s=this.getNumberAt(t,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,a=s.start+s.value.length-o,l=parseFloat(s.value);l*=Math.pow(10,a),o!==s.end&&n=a&&o<=l&&(n=t,u.selection.clearSelection(),u.moveCursorTo(e,a+r),u.selection.selectTo(e,l+r)),a=l});for(var c,h=this.$toggleWordPairs,d=0;df+1)break;f=p.last}for(c--,a=this.session.$moveLines(d,f,t?0:e),t&&-1==e&&(h=c+1);h<=c;)o[h].moveBy(a,0),h++;t||(a=0),l+=a}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);!0===t?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):!1===t&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,i*r.lineHeight),null!=t&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new v(this.session,n.row,n.column),i=r.getCurrentToken(),s=i||r.stepForward();if(s){var o,a,l=!1,u={},c=n.column-s.start,h={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;c=0;--s)this.$tryReplace(n[s],e)&&r++;return this.selection.setSelectionRange(i),r},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return null!==(t=this.$search.replace(n,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&r.mixin(t,e);var i=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(i)||this.$search.$options.needle)||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var s=this.$search.find(this.session);return t.preventScroll?s:s?(this.revealRange(s,n),s):(t.backwards?i.start=i.end:i.end=i.start,void this.selection.setRange(i))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(e){var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var s=this.on("changeSelection",function(){r=!0}),o=this.renderer.on("beforeRender",function(){r&&(t=n.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,s=e.$cursorLayer.$pixelPos,o=e.layerConfig,a=s.top-o.offset;null!=(r=s.top>=0&&a+t.top<0||!(s.topwindow.innerHeight)&&null)&&(i.style.top=a+"px",i.style.left=s.left+"px",i.style.height=o.lineHeight+"px",i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",o))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,i.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},this.prompt=function(e,t,n){var r=this;E.loadModule("./ext/prompt",function(i){i.prompt(r,e,t,n)})}}.call(D.prototype),E.defineOptions(D.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?S.attach(this):S.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?S.attach(this):S.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.renderer.$composition||this.getValue();if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),i.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!e&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),i.addCssClass(this.container,"ace_hasPlaceholder");var t=i.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var S={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=D}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,n){this.$fromUndo||e!=this.$lastDelta&&(!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,r=n.length;r--;){var i=n[r][0];if(i.id<=e)break;i.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?a(e):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(r.prototype);var i=e("./range").Range,s=i.comparePoints;function o(e){return{row:e.row,column:e.column}}function a(e){if(e=e||this,Array.isArray(e))return e.map(a).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function u(e,t){var n="insert"==e.action,r="insert"==t.action;if(n&&r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}else if(!n&&r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(!n&&!r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}return[t,e]}function c(e,t){for(var n=e.length;n--;)for(var r=0;r=0?d(e,t,-1):(s(e.start,t.start)<=0||d(e,i.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!n&&r)s(t.start,e.end)>=0?d(t,e,-1):(s(t.start,e.start)<=0||d(t,i.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{var o,a;if(!(s(t.end,e.start)<=0))return s(e.start,t.start)<0&&(o=e,e=p(e,t.start)),s(e.end,t.end)>0&&(a=p(e,t.end)),f(t.end,e.start,e.end,-1),a&&!o&&(e.lines=a.lines,e.start=a.start,e.end=a.end,a=e),[t,o,a].filter(Boolean);d(e,t,-1)}return[t,e]}function d(e,t,n){f(e.start,t.start,t.end,n),f(e.end,t.start,t.end,n)}function f(e,t,n,r){e.row==(1==r?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function p(e,t){var n=e.lines,r=e.end;e.end=o(t);var i=e.end.row-e.start.row,s=n.splice(i,n.length),a=i?t.column:t.column-e.start.column;return n.push(s[0].substring(0,a)),s[0]=s[0].substr(a),{start:o(t),end:r,lines:s,action:e.action}}function m(e,t){t=function(e){return{start:o(e.start),end:o(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var n=e.length;n--;){for(var r=e[n],i=0;is&&(l=i.end.row+1,s=(i=t.getNextFoldLine(l,i))?i.start.row:1/0),l>r){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,e,this.session,u),this.$lines.push(o)),this.$renderCell(o,e,i,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,i=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(i=t.getLength()+r-1);var s=n?n.getWidth(t,i,e):i.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();(s+=o.left+o.right)===this.gutterWidth||isNaN(s)||(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(r.row>this.$cursorRow){var i=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&i&&i.start.row==t[n-1].row))break;r=t[n-1]}r.element.className="ace_gutter-active-line "+r.element.className,this.$cursorCell=r;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;if(this.oldLastRow=n,!t||r0;i--)this.$lines.shift();if(r>n)for(i=this.session.getFoldedRowCount(n+1,r);i>0;i--)this.$lines.pop();e.firstRowr&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,n){for(var r=[],i=t,s=this.session.getNextFoldLine(i),o=s?s.start.row:1/0;i>o&&(i=s.end.row+1,o=(s=this.session.getNextFoldLine(i,s))?s.start.row:1/0),!(i>n);){var a=this.$lines.createCell(i,e,this.session,u);this.$renderCell(a,e,s,i),r.push(a),i++}return r},this.$renderCell=function(e,t,n,i){var s=e.element,o=this.session,a=s.childNodes[0],l=s.childNodes[1],u=o.$firstLineNumber,c=o.$breakpoints,h=o.$decorations,d=o.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&o.foldWidgets,p=n?n.start.row:Number.MAX_VALUE,m="ace_gutter-cell ";if(this.$highlightGutterLine&&(i==this.$cursorRow||n&&i=p&&this.$cursorRow<=n.end.row)&&(m+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),c[i]&&(m+=c[i]),h[i]&&(m+=h[i]),this.$annotations[i]&&(m+=this.$annotations[i].className),s.className!=m&&(s.className=m),f){var g=f[i];null==g&&(g=f[i]=o.getFoldWidget(i))}if(g){m="ace_fold-widget ace_"+g,"start"==g&&i==p&&in.right-t.right?"foldWidgets":void 0}}).call(l.prototype),t.Gutter=l}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/dom"),s=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){function e(e,t,n,r){return(e?1:0)|(t?2:0)|(n?4:0)|(r?8:0)}this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},this.update=function(e){if(e){var t;for(var n in this.config=e,this.i=0,this.markers){var r=this.markers[n];if(r.range){var i=r.range.clipRows(e.firstRow,e.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),r.renderer){var s=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,s,e)}else"fullLine"==r.type?this.drawFullLineMarker(t,i,r.clazz,e):"screenLine"==r.type?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?"text"==r.type?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+" ace_start ace_br15",e)}else r.update(t,this,this.session,e)}if(-1!=this.i)for(;this.if,c==u),s,c==u?0:1,o)},this.drawMultiLineMarker=function(e,t,n,r,i){var s=this.$padding,o=r.lineHeight,a=this.$getTop(t.start.row,r),l=s+t.start.column*r.characterWidth;if(i=i||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((u=t.clone()).end.row=u.start.row,u.end.column=this.session.getLine(u.start.row).length,this.drawBidiSingleLineMarker(e,u,n+" ace_br1 ace_start",r,null,i)):this.elt(n+" ace_br1 ace_start","height:"+o+"px;right:0;top:"+a+"px;left:"+l+"px;"+(i||"")),this.session.$bidiHandler.isBidiRow(t.end.row)){var u;(u=t.clone()).start.row=u.end.row,u.start.column=0,this.drawBidiSingleLineMarker(e,u,n+" ace_br12",r,null,i)}else{a=this.$getTop(t.end.row,r);var c=t.end.column*r.characterWidth;this.elt(n+" ace_br12","height:"+o+"px;width:"+c+"px;top:"+a+"px;left:"+s+"px;"+(i||""))}if(!((o=(t.end.row-t.start.row-1)*r.lineHeight)<=0)){a=this.$getTop(t.start.row+1,r);var h=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+o+"px;right:0;top:"+a+"px;left:"+s+"px;"+(i||""))}},this.drawSingleLineMarker=function(e,t,n,r,i,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,i,s);var o=r.lineHeight,a=(t.end.column+(i||0)-t.start.column)*r.characterWidth,l=this.$getTop(t.start.row,r),u=this.$padding+t.start.column*r.characterWidth;this.elt(n,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+u+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(e,t,n,r,i,s){var o=r.lineHeight,a=this.$getTop(t.start.row,r),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(n,"height:"+o+"px;width:"+e.width+(i||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-s),this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))},this.drawScreenLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))}}).call(s.prototype),t.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=function(e){this.dom=i,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){r.implement(this,a),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;nc&&(a=l.end.row+1,c=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(a>i);){var h=s[o++];if(h){this.dom.removeChildren(h),this.$renderLine(h,a,a==c&&l),u&&(h.style.top=this.$lines.computeLineTop(a,e,this.session)+"px");var d=e.lineHeight*this.session.getRowLength(a)+"px";h.style.height!=d&&(u=!0,h.style.height=d)}a++}if(u)for(;o0;i--)this.$lines.shift();if(t.lastRow>e.lastRow)for(i=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);i>0;i--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,n){for(var r=[],s=t,o=this.session.getNextFoldLine(s),a=o?o.start.row:1/0;s>a&&(s=o.end.row+1,a=(o=this.session.getNextFoldLine(s,o))?o.start.row:1/0),!(s>n);){var l=this.$lines.createCell(s,e,this.session),u=l.element;this.dom.removeChildren(u),i.setStyle(u.style,"height",this.$lines.computeLineHeight(s,e,this.session)+"px"),i.setStyle(u.style,"top",this.$lines.computeLineTop(s,e,this.session)+"px"),this.$renderLine(u,s,s==a&&o),this.$useLineGroups()?u.className="ace_line_group":u.className="ace_line",r.push(l),s++}return r},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,n=e.lastRow,r=this.$lines;r.getLength();)r.pop();r.push(this.$renderLinesFragment(e,t,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,r){for(var i,o=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),u=0;i=a.exec(r);){var c=i[1],h=i[2],d=i[3],f=i[4],p=i[5];if(o.showInvisibles||!h){var m=u!=i.index?r.slice(u,i.index):"";if(u=i.index+i[0].length,m&&l.appendChild(this.dom.createTextNode(m,this.element)),c){var g=o.session.getScreenTabSize(t+i.index);l.appendChild(o.$tabStrings[g].cloneNode(!0)),t+=g-1}else h?o.showInvisibles?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",v.textContent=s.stringRepeat(o.SPACE_CHAR,h.length),l.appendChild(v)):l.appendChild(this.com.createTextNode(h,this.element)):d?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",v.textContent=s.stringRepeat(o.SPACE_CHAR,d.length),l.appendChild(v)):f?(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className=o.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",v.textContent=o.showInvisibles?o.SPACE_CHAR:f,l.appendChild(v)):p&&(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className="ace_cjk",v.textContent=p,l.appendChild(v))}}if(l.appendChild(this.dom.createTextNode(u?r.slice(u):r,this.element)),this.$textToken[n.type])e.appendChild(l);else{var E="ace_"+n.type.replace(/\./g," ace_"),v=this.dom.createElement("span");"fold"==n.type&&(v.style.width=n.value.length*this.config.characterWidth+"px"),v.className=E,v.appendChild(l),e.appendChild(v)}return t+r.length},this.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(" "==t[0]){for(var i=(r-=r%this.tabSize)/this.tabSize,s=0;s=o;)a=this.$renderToken(l,a,c,h.substring(0,o-r)),h=h.substring(o-r),r=o,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(s.stringRepeat(" ",n.indent),this.element)),a=0,o=n[++i]||Number.MAX_VALUE;0!=h.length&&(r+=h.length,a=this.$renderToken(l,a,c,h))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(e,t){var n=0,r=t[0],i=r.value;this.displayIndentGuides&&(i=this.renderIndentGuide(e,i)),i&&(n=this.$renderToken(e,n,r,i));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,r,i);n=this.$renderToken(e,n,r,i)}},this.$renderOverflowMessage=function(e,t,n,r,i){n&&this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=i?"":"",e.appendChild(s)},this.$renderLine=function(e,t,n){if(n||0==n||(n=this.session.getFoldLine(t)),n)var r=this.$getFoldLineTokens(t,n);else r=this.session.getTokens(t);var i=e;if(r.length){var s=this.session.getRowSplitData(t);s&&s.length?(this.$renderWrappedLine(e,r,s),i=e.lastChild):(i=e,this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i)),this.$renderSimpleLine(i,r))}else this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i));if(this.showInvisibles&&i){n&&(t=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,i.appendChild(o)}},this.$getFoldLineTokens=function(e,t){var n=this.session,r=[],i=n.getTokens(e);return t.walk(function(e,t,s,o,a){null!=e?r.push({type:"fold",value:e}):(a&&(i=n.getTokens(t)),i.length&&function(e,t,n){for(var i=0,s=0;s+e[i].value.lengthn-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),s=t+o.length,i+=1);sn?r.push({type:e[i].type,value:o.substring(0,n-s)}):r.push(e[i]),s+=o.length,i+=1}}(i,o,s))},t.end.row,this.session.getLine(t.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),t.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)r.setStyle(t[n].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){r.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){r.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&r.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}else this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||o.top<0)&&n>1)){var a=this.cursors[i++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,o,e,t[n],this.session):this.isCursorInView(o,e)?(r.setStyle(l,"display","block"),r.translate(a,o.left,o.top),r.setStyle(l,"width",Math.round(e.characterWidth)+"px"),r.setStyle(l,"height",e.lineHeight+"px")):r.setStyle(l,"display","none")}}for(;this.cursors.length>i;)this.removeCursor();var u=this.session.getOverwrite();this.$setOverwrite(u),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(i.prototype),t.Cursor=i}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,a=32768,l=function(e){this.element=i.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){r.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(l.prototype);var u=function(e,t){l.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=i.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};r.inherits(u,l),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>a?(this.coeff=a/e,e=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(u.prototype);var c=function(e,t){l.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};r.inherits(c,l),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(c.prototype),t.ScrollBar=u,t.ScrollBarV=u,t.ScrollBarH=c,t.VScrollBar=u,t.HScrollBar=c}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){"use strict";var r=e("./lib/event"),i=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(r.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(i.prototype),t.RenderLoop=i}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,u=256,c="function"==typeof ResizeObserver,h=200,d=t.FontMetrics=function(e){this.el=i.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.innerHTML=s.stringRepeat("X",u),this.$characterSize={width:0,height:0},c?this.$addObserver():this.checkForSizeChanges()};(function(){r.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){var n=t[0].contentRect;e.checkForSizeChanges({height:n.height,width:n.width/u})}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/u};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.innerHTML=s.stringRepeat(e,u),this.$main.getBoundingClientRect().width/u},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=i.buildDom([e(0,0),e(h,0),e(0,h),e(h,h)],this.el)},this.transformCoordinates=function(e,t){function n(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function r(e,t){return[e[0]-t[0],e[1]-t[1]]}function i(e,t){return[e[0]+t[0],e[1]+t[1]]}function s(e,t){return[e*t[0],e*t[1]]}function o(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=s(1/this.$getZoom(this.el),e)),this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),u=o(this.els[2]),c=o(this.els[3]),d=n(r(c,l),r(c,u),r(i(l,u),i(c,a))),f=s(1+d[0],r(l,a)),p=s(1+d[1],r(u,a));if(t){var m=t,g=d[0]*m[0]/h+d[1]*m[1]/h+1,E=i(s(m[0],f),s(m[1],p));return i(s(1/g/h,E),a)}var v=r(e,a),C=n(r(f,s(d[0],v)),r(p,s(d[1],v)),v);return s(h,C)}}).call(d.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./config"),o=e("./layer/gutter").Gutter,a=e("./layer/marker").Marker,l=e("./layer/text").Text,u=e("./layer/cursor").Cursor,c=e("./scrollbar").HScrollBar,h=e("./scrollbar").VScrollBar,d=e("./renderloop").RenderLoop,f=e("./layer/font_metrics").FontMetrics,p=e("./lib/event_emitter").EventEmitter,m='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);opacity: 0.7;transform-origin: left;text-indent: 10px;}',g=e("./lib/useragent"),E=g.isIE;i.importCssString(m,"ace_editor.css");var v=function(e,t){var n=this;this.container=e||i.createElement("div"),i.addCssClass(this.container,"ace_editor"),i.HI_DPI&&i.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=i.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=i.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=i.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var r=this.$textLayer=new l(this.content);this.canvas=r.element,this.$markerFront=new a(this.content),this.$cursorLayer=new u(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new f(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!g.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,p),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),i.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,n){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,r){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var i=this.container;r||(r=i.clientHeight||i.scrollHeight),n||(n=i.clientWidth||i.scrollWidth);var s=this.$updateCachedSize(e,t,n,r);if(!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var s=0,o=this.$size,a={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if(r&&(e||o.height!=r)&&(o.height=r,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL),n&&(e||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,i.setStyle(this.scrollBarH.element.style,"left",t+"px"),i.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),i.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";i.setStyle(this.scrollBarH.element.style,"right",l),i.setStyle(this.scroller.style,"right",l),i.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(s|=this.CHANGE_FULL)}return o.$dirty=!n||!r,s&&this._signal("resize",a),s},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=i.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=i.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var n=this.$cursorLayer.$pixelPos;if(n){t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var r=this.layerConfig,s=n.top,o=n.left;s-=r.offset;var a=t&&t.useTextareaForIME?this.lineHeight:E?0:1;if(s<0||s>r.height-a)i.translate(this.textarea,0,0);else{var l=1,u=this.$size.height-a;if(t)if(t.useTextareaForIME){var c=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(c)[0]}else s+=this.lineHeight+2;else s+=this.lineHeight;(o-=this.scrollLeft)>this.$size.scrollerWidth-l&&(o=this.$size.scrollerWidth-l),o+=this.gutterWidth+this.margin.left,i.setStyle(e,"height",a+"px"),i.setStyle(e,"width",l+"px"),i.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-l),Math.min(s,u))}}}else i.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},this.setMargin=function(e,t,n,r){var i=this.margin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),i.translate(this.content,-this.scrollLeft,-n.offset);var s=n.width+2*this.$padding+"px",o=n.minHeight+"px";i.setStyle(this.content.style,"width",s),i.setStyle(this.content.style,"height",o)}if(e&this.CHANGE_H_SCROLL&&(i.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender")}else this.$changes|=e},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=!(n<=2*this.lineHeight)&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||r!=this.$vScroll){r!=this.$vScroll&&(this.$vScroll=r,this.scrollBarV.setVisible(r));var i=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,i,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength()*this.lineHeight,i=this.$getLongestLine(),s=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-i-2*this.$padding<0),o=this.$horizScroll!==s;o&&(this.$horizScroll=s,this.scrollBarH.setVisible(s));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,u=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;r+=u;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,r-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,i+2*this.$padding-t.scrollerWidth+c.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-r+u<0||this.scrollTop>c.top),d=a!==h;d&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var f,p,m=this.scrollTop%this.lineHeight,g=Math.ceil(l/this.lineHeight)-1,E=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),v=E+g,C=this.lineHeight;E=e.screenToDocumentRow(E,0);var D=e.getFoldLine(E);D&&(E=D.start.row),f=e.documentToScreenRow(E,0),p=e.getRowLength(E)*C,v=Math.min(e.screenToDocumentRow(v,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(v)*C+p,m=this.scrollTop-f*C;var S=0;return(this.layerConfig.width!=i||o)&&(S=this.CHANGE_H_SCROLL),(o||d)&&(S|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(i=this.$getLongestLine())),this.layerConfig={width:i,padding:this.$padding,firstRow:E,firstRowScreen:f,lastRow:v,lineHeight:C,characterWidth:this.characterWidth,minHeight:l,maxHeight:r,offset:m,gutterOffset:C?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/C)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(i-this.$padding),S},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1||tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t,n){if(0!==this.$size.scrollerHeight){var r=this.$cursorLayer.getPixelPosition(e),i=r.left,s=r.top,o=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+o>s?(t&&l+o>s+this.lineHeight&&(s-=t*this.$size.scrollerHeight),0===s&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):l+this.$size.scrollerHeight-ai?(i=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:a,side:s-a>0?1:-1,offsetX:i}},this.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),a=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),i)},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),s=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+s-this.scrollTop}},this.visualizeFocus=function(){i.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){i.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),e.useTextareaForIME=this.$useTextareaForIME,this.$useTextareaForIME?(i.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),i.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText,this.$composition=null,this.$cursorLayer.element.style.display="")},this.addToken=function(e,t,n,r){var i=this.session;i.bgTokenizer.lines[n]=null;var s={type:t,value:e},o=i.getTokens(n);if(null==r)o.push(s);else for(var a=0,l=0;l50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,n){var r=null,i=!1,a=Object.create(s),u=[],c=new l({messageBuffer:u,terminate:function(){},postMessage:function(e){u.push(e),r&&(i?setTimeout(h):h())}});c.setEmitSync=function(e){i=e};var h=function(){var e=u.shift();e.command?r[e.command].apply(r,e.args):e.event&&a._signal(e.event,e.data)};return a.postMessage=function(e){c.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},o.loadModule(["worker",t],function(e){for(r=new e[n](a);u.length;)h()}),c},t.WorkerClient=l,t.createWorker=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(e,t,n,r,i,s){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,i),this.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,s=t.start.column-this.pos.column;if(this.updateAnchors(e),i&&(this.length+=n),i&&!this.session.$fromUndo)if("insert"===e.action)for(var o=this.others.length-1;o>=0;o--){var a={row:(l=this.others[o]).row,column:l.column+s};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(o=this.others.length-1;o>=0;o--){var l;a={row:(l=this.others[o]).row,column:l.column+s},this.doc.remove(new r(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,i){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),i,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)}},this.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new r,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{n=this.getRange();var r=this.isBackwards(),s=n.start.row,o=n.end.row;if(s==o){if(r)var a=n.end,l=n.start;else a=n.start,l=n.end;return this.addRange(i.fromPoints(l,l)),void this.addRange(i.fromPoints(a,a))}var u=[],c=this.getLineRange(s,!0);c.start.column=n.start.column,u.push(c);for(var h=s+1;h1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(r,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],s=e.column0;)E--;if(E>0)for(var v=0;r[v].isEmpty();)v++;for(var C=E;C>=v;C--)r[C].isEmpty()&&r.splice(C,1)}return r}}.call(s.prototype);var d=e("./editor").Editor;function f(e,t){return e.row==t.row&&e.column==t.column}function p(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",o),e.commands.addCommands(u.defaultCommands),function(e){if(e.textInput){var t=e.textInput.getElement(),n=!1;a.addListener(t,"keydown",function(t){var i=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&i?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&r()}),a.addListener(t,"keyup",r),a.addListener(t,"blur",r)}function r(t){n&&(e.renderer.setMouseCursor(""),n=!1)}}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var r=e[n];if(r.marker){this.session.removeMarker(r.marker);var i=t.indexOf(r);-1!=i&&t.splice(i,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(u.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(u.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?r=n.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?r=n.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});else{var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return r}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var r,i=n&&n.keepOrder,o=1==n||n&&n.$byLines,a=this.session,l=this.selection,u=l.rangeList,c=(i?l:u).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var h=l._eventRegistry;l._eventRegistry={};var d=new s(a);this.inVirtualSelectionMode=!0;for(var f=c.length;f--;){if(o)for(;f>0&&c[f].start.row==c[f-1].end.row;)f--;d.fromOrientedRange(c[f]),d.index=f,this.selection=a.selection=d;var p=e.exec?e.exec(this,t||{}):e(this,t||{});r||void 0===p||(r=p),d.toOrientedRange(c[f])}d.detach(),this.selection=a.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=h,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),r}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],r=0;ro&&(o=n.column),rc?e.insert(r,l.stringRepeat(" ",s-c)):e.remove(new i(r.row,r.column,r.row,r.column-s+c)),t.start.column=t.end.column=o,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var c=this.selection.getRange(),h=c.start.row,d=c.end.row,f=h==d;if(f){var p,m=this.session.getLength();do{p=this.session.getLine(d)}while(/[=:]/.test(p)&&++d0);h<0&&(h=0),d>=m&&(d=m-1)}var g=this.session.removeFullLines(h,d);g=this.$reAlignText(g,f),this.session.insert({row:h,column:0},g.join("\n")+"\n"),f||(c.start.column=0,c.end.column=g[g.length-1].length),this.selection.setRange(c)}},this.$reAlignText=function(e,t){var n,r,i,s=!0,o=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==n?(n=t[1].length,r=t[2].length,i=t[3].length,t):(n+r+i!=t[1].length+t[2].length+t[3].length&&(o=!1),n!=t[1].length&&(s=!1),n>t[1].length&&(n=t[1].length),rt[3].length&&(i=t[3].length),t):[e]}).map(t?u:s?o?function(e){return e[2]?a(n+r-e[2].length)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:u:function(e){return e[2]?a(n)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function a(e){return l.stringRepeat(" ",e)}function u(e){return e[2]?a(n)+e[2]+a(r-e[2].length+i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=p,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){p(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,s=e.getLine(t),o=s.search(i);if(-1!=o){for(var a=n||s.length,l=e.getLength(),u=t,c=t;++tu){var f=e.getLine(c).length;return new r(u,a,c,f)}}},this.openingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i+1},a=e.$findClosingBracket(t,o,s);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>o.row&&(a.row--,a.column=e.getLine(a.row).length),r.fromPoints(o,a)}},this.closingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i},a=e.$findOpeningBracket(t,o);if(a)return a.column++,o.column--,r.fromPoints(a,o)}}).call(i.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}e("./range").Range,function(){this.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(n&&e.action){for(var r=e.data,i=r.start.row,s=r.end.row,o="add"==e.action,a=i+1;a0&&!r[i];)i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=s;o++){var a=r[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var u=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(u-=t.scrollLeft),a.el.style.left=u+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}.call(i.prototype),t.LineWidgets=i}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,n){"use strict";var r=e("../line_widgets").LineWidgets,i=e("../lib/dom"),s=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var o=e.getCursorPosition(),a=o.row,l=n.widgetManager.getWidgetsAtRow(a).filter(function(e){return"errorMarker"==e.type})[0];l?l.destroy():a-=t;var u,c=function(e,t,n){var r=e.getAnnotations().sort(s.comparePoints);if(r.length){var i=function(e,t,n){for(var r=0,i=e.length-1;r<=i;){var s=r+i>>1,o=n(t,e[s]);if(o>0)r=s+1;else{if(!(o<0))return s;i=s-1}}return-(r+1)}(r,{row:t,column:-1},s.comparePoints);i<0&&(i=-i-1),i>=r.length?i=n>0?0:r.length-1:0===i&&n<0&&(i=r.length-1);var o=r[i];if(o&&n){if(o.row===t){do{o=r[i+=n]}while(o&&o.row===t);if(!o)return r.slice()}var a=[];t=o.row;do{a[n<0?"unshift":"push"](o),o=r[i+=n]}while(o&&o.row==t);return a.length&&a}}}(n,a,t);if(c){var h=c[0];o.column=(h.pos&&"number"!=typeof h.column?h.pos.sc:h.column)||0,o.row=h.row,u=e.renderer.$gutterLayer.$annotations[o.row]}else{if(l)return;u={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(o.row),e.selection.moveToPosition(o);var d={row:o.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},f=d.el.appendChild(i.createElement("div")),p=d.el.appendChild(i.createElement("div"));p.className="error_widget_arrow "+u.className;var m=e.renderer.$cursorLayer.getPixelPosition(o).left;p.style.left=m+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",f.className="error_widget "+u.className,f.innerHTML=u.text.join("
"),f.appendChild(i.createElement("div"));var g=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(g),n.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(g),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t,r){"use strict";e("./lib/fixoldbrowsers");var i=e("./lib/dom"),s=e("./lib/event"),o=e("./range").Range,a=e("./editor").Editor,l=e("./edit_session").EditSession,u=e("./undomanager").UndoManager,c=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,t.define=n.amdD,t.edit=function(e,n){if("string"==typeof e){var r=e;if(!(e=document.getElementById(r)))throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof a)return e.env.editor;var o="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;o=l.value,e=i.createElement("pre"),l.parentNode.replaceChild(e,l)}else e&&(o=e.textContent,e.innerHTML="");var u=t.createEditSession(o),h=new a(new c(e),u,n),d={document:u,editor:h,onResize:h.resize.bind(h,null)};return l&&(d.textarea=l),s.addListener(window,"resize",d.onResize),h.on("destroy",function(){s.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),h.container.env=h.env=d,h},t.createEditSession=function(e,t){var n=new l(e,t);return n.setUndoManager(new u),n},t.Range=o,t.Editor=a,t.EditSession=l,t.UndoManager=u,t.VirtualRenderer=c,t.version=t.config.version}),ace.require(["ace/ace"],function(t){for(var n in t&&(t.config.init(!0),t.define=ace.define),window.ace||(window.ace=t),t)t.hasOwnProperty(n)&&(window.ace[n]=t[n]);window.ace.default=window.ace,e&&(e.exports=window.ace)}),e.exports={ace}},247(e,t,n){"use strict";var r=n(982),i=n(159),s=n(961);function o(e){var t="https://react.dev/errors/"+e;if(1P||(e.current=M[P],M[P]=null,P--)}function $(e,t){P++,M[P]=e.current,e.current=t}var G,V,W=B(null),H=B(null),j=B(null),z=B(null);function X(e,t){switch($(j,t),$(H,e),$(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=Eh(t=gh(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(W),$(W,e)}function K(){U(W),U(H),U(j)}function Y(e){null!==e.memoizedState&&$(z,e);var t=W.current,n=Eh(t,e.type);t!==n&&($(H,e),$(W,n))}function q(e){H.current===e&&(U(W),U(H)),z.current===e&&(U(z),ud._currentValue=k)}function Q(e){if(void 0===G)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);G=t&&t[1]||"",V=-1)":-1--i||l[r]!==u[i]){var c="\n"+l[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}}while(1<=r&&0<=i);break}}}finally{Z=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Q(n):""}function ee(e,t){switch(e.tag){case 26:case 27:case 5:return Q(e.type);case 16:return Q("Lazy");case 13:return e.child!==t&&null!==t?Q("Suspense Fallback"):Q("Suspense");case 19:return Q("SuspenseList");case 0:case 15:return J(e.type,!1);case 11:return J(e.type.render,!1);case 1:return J(e.type,!0);case 31:return Q("Activity");default:return""}}function te(e){try{var t="",n=null;do{t+=ee(e,n),n=e,e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var ne=Object.prototype.hasOwnProperty,re=r.unstable_scheduleCallback,ie=r.unstable_cancelCallback,se=r.unstable_shouldYield,oe=r.unstable_requestPaint,ae=r.unstable_now,le=r.unstable_getCurrentPriorityLevel,ue=r.unstable_ImmediatePriority,ce=r.unstable_UserBlockingPriority,he=r.unstable_NormalPriority,de=r.unstable_LowPriority,fe=r.unstable_IdlePriority,pe=r.log,me=r.unstable_setDisableYieldValue,ge=null,Ee=null;function ve(e){if("function"==typeof pe&&me(e),Ee&&"function"==typeof Ee.setStrictMode)try{Ee.setStrictMode(ge,e)}catch(e){}}var Ce=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(De(e)/Se|0)|0},De=Math.log,Se=Math.LN2,Ae=256,_e=262144,ye=4194304;function be(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Te(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var i=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var a=134217727&r;return 0!==a?0!==(r=a&~s)?i=be(r):0!==(o&=a)?i=be(o):n||0!==(n=a&~e)&&(i=be(n)):0!==(a=r&~s)?i=be(a):0!==o?i=be(o):n||0!==(n=r&~e)&&(i=be(n)),0===i?0:0!==t&&t!==i&&0===(t&s)&&((s=i&-i)>=(n=t&-t)||32===s&&4194048&n)?t:i}function Re(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function we(){var e=ye;return!(62914560&(ye<<=1))&&(ye=4194304),e}function Fe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ne(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Le(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ce(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function Oe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ce(n),i=1<=bn),xn=String.fromCharCode(32),wn=!1;function Fn(e,t){switch(e){case"keyup":return-1!==_n.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Ln=!1,On={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function In(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!On[e.type]:"textarea"===t}function kn(e,t,n,r){It?kt?kt.push(r):kt=[r]:It=r,0<(t=nh(t,"onChange")).length&&(n=new tn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Mn=null,Pn=null;function Bn(e){Kc(e,0)}function Un(e){if(ft(Qe(e)))return e}function $n(e,t){if("change"===e)return t}var Gn=!1;if($t){var Vn;if($t){var Wn="oninput"in document;if(!Wn){var Hn=document.createElement("div");Hn.setAttribute("oninput","return;"),Wn="function"==typeof Hn.oninput}Vn=Wn}else Vn=!1;Gn=Vn&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Jn(r)}}function tr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?tr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function nr(e){for(var t=pt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=pt((e=t.contentWindow).document)}return t}function rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var ir=$t&&"documentMode"in document&&11>=document.documentMode,sr=null,or=null,ar=null,lr=!1;function ur(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;lr||null==sr||sr!==pt(r)||(r="selectionStart"in(r=sr)&&rr(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},ar&&Zn(ar,r)||(ar=r,0<(r=nh(or,"onSelect")).length&&(t=new tn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=sr)))}function cr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var hr={animationend:cr("Animation","AnimationEnd"),animationiteration:cr("Animation","AnimationIteration"),animationstart:cr("Animation","AnimationStart"),transitionrun:cr("Transition","TransitionRun"),transitionstart:cr("Transition","TransitionStart"),transitioncancel:cr("Transition","TransitionCancel"),transitionend:cr("Transition","TransitionEnd")},dr={},fr={};function pr(e){if(dr[e])return dr[e];if(!hr[e])return e;var t,n=hr[e];for(t in n)if(n.hasOwnProperty(t)&&t in fr)return dr[e]=n[t];return e}$t&&(fr=document.createElement("div").style,"AnimationEvent"in window||(delete hr.animationend.animation,delete hr.animationiteration.animation,delete hr.animationstart.animation),"TransitionEvent"in window||delete hr.transitionend.transition);var mr=pr("animationend"),gr=pr("animationiteration"),Er=pr("animationstart"),vr=pr("transitionrun"),Cr=pr("transitionstart"),Dr=pr("transitioncancel"),Sr=pr("transitionend"),Ar=new Map,_r="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function yr(e,t){Ar.set(e,t),nt(t,[e])}_r.push("scrollEnd");var br="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Tr=[],Rr=0,xr=0;function wr(){for(var e=Rr,t=xr=Rr=0;t>=o,i-=o,ti=1<<32-Ce(t)+i|n<p?(m=h,h=null):m=h.sibling;var g=f(i,h,a[p],l);if(null===g){null===h&&(h=m);break}e&&h&&null===g.alternate&&t(i,h),o=s(g,o,p),null===c?u=g:c.sibling=g,c=g,h=m}if(p===a.length)return n(i,h),ci&&ri(i,p),u;if(null===h){for(;pm?(g=p,p=null):g=p.sibling;var C=f(i,p,v.value,u);if(null===C){null===p&&(p=g);break}e&&p&&null===C.alternate&&t(i,p),a=s(C,a,m),null===h?c=C:h.sibling=C,h=C,p=g}if(v.done)return n(i,p),ci&&ri(i,m),c;if(null===p){for(;!v.done;m++,v=l.next())null!==(v=d(i,v.value,u))&&(a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return ci&&ri(i,m),c}for(p=r(p);!v.done;m++,v=l.next())null!==(v=E(p,i,m,v.value,u))&&(e&&null!==v.alternate&&p.delete(null===v.key?m:v.key),a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return e&&p.forEach(function(e){return t(i,e)}),ci&&ri(i,m),c}(l,u,c=C.call(c),h)}if("function"==typeof c.then)return v(l,u,ls(c),h);if(c.$$typeof===D)return v(l,u,Li(l,c),h);cs(l,c)}return"string"==typeof c&&""!==c||"number"==typeof c||"bigint"==typeof c?(c=""+c,null!==u&&6===u.tag?(n(l,u.sibling),(h=i(u,c)).return=l,l=h):(n(l,u),(h=Wr(c,l.mode,h)).return=l,l=h),a(l)):n(l,u)}return function(e,t,n,r){try{as=0;var i=v(e,t,n,r);return os=null,i}catch(t){if(t===qi||t===Zi)throw t;var s=Pr(29,t,null,e.mode);return s.lanes=r,s.return=e,s}}}var ds=hs(!0),fs=hs(!1),ps=!1;function ms(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Es(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vs(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&du){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ir(e),Or(e,null,n),t}return Fr(e,r,t,n),Ir(e)}function Cs(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Oe(e,n)}}function Ds(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===s?i=s=o:s=s.next=o,n=n.next}while(null!==n);null===s?i=s=t:s=s.next=t}else i=s=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ss=!1;function As(){if(Ss&&null!==Wi)throw Wi}function _s(e,t,n,r){Ss=!1;var i=e.updateQueue;ps=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var l=a,u=l.next;l.next=null,null===o?s=u:o.next=u,o=l;var c=e.alternate;null!==c&&(a=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===a?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l)}if(null!==s){var h=i.baseState;for(o=0,c=u=l=null,a=s;;){var f=-536870913&a.lane,p=f!==a.lane;if(p?(mu&f)===f:(r&f)===f){0!==f&&f===Vi&&(Ss=!0),null!==c&&(c=c.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var m=e,g=a;f=t;var E=n;switch(g.tag){case 1:if("function"==typeof(m=g.payload)){h=m.call(E,h,f);break e}h=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(f="function"==typeof(m=g.payload)?m.call(E,h,f):m))break e;h=d({},h,f);break e;case 2:ps=!0}}null!==(f=a.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=i.callbacks)?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===c?(u=c=p,l=h):c=c.next=p,o|=f;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(p=a).next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}null===c&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null===s&&(i.shared.lanes=0),_u|=o,e.lanes=o,e.memoizedState=h}}function ys(e,t){if("function"!=typeof e)throw Error(o(191,e));e.call(t)}function bs(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;es?s:8;var o,a,l,u=O.T,c={};O.T=c,ca(e,!1,t,n);try{var h=i(),d=O.S;null!==d&&d(c,h),null!==h&&"object"==typeof h&&"function"==typeof h.then?ua(e,t,(o=r,a=[],l={status:"pending",value:null,reason:null,then:function(e){a.push(e)}},h.then(function(){l.status="fulfilled",l.value=o;for(var e=0;e<\/script>",s=s.removeChild(s.firstChild);break;case"select":s="string"==typeof r.is?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s="string"==typeof r.is?a.createElement(i,{is:r.is}):a.createElement(i)}}s[$e]=t,s[Ge]=r;e:for(a=t.child;null!==a;){if(5===a.tag||6===a.tag)s.appendChild(a.stateNode);else if(4!==a.tag&&27!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;null===a.sibling;){if(null===a.return||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=s;e:switch(hh(s,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&ol(t)}}return hl(t),al(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&ol(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));if(e=j.current,Ei(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(i=li))switch(i.tag){case 27:case 5:r=i.memoizedProps}e[$e]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||lh(e.nodeValue,n)))||pi(t,!0)}else(e=mh(e).createTextNode(r))[$e]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(r=Ei(t),null!==n){if(null===e){if(!r)throw Error(o(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(o(557));e[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Ps(t),t):(Ps(t),null);if(128&t.flags)throw Error(o(558))}return hl(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=Ei(t),null!==r&&null!==r.dehydrated){if(null===e){if(!i)throw Error(o(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(o(317));i[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),i=!1}else i=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return 256&t.flags?(Ps(t),t):(Ps(t),null)}return Ps(t),128&t.flags?(t.lanes=n,t):(n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(i=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(i=r.alternate.memoizedState.cachePool.pool),s=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(s=r.memoizedState.cachePool.pool),s!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ul(t,t.updateQueue),hl(t),null);case 4:return K(),null===e&&Zc(t.stateNode.containerInfo),hl(t),null;case 10:return bi(t.type),hl(t),null;case 19:if(U(Bs),null===(r=t.memoizedState))return hl(t),null;if(i=!!(128&t.flags),null===(s=r.rendering))if(i)cl(r,!1);else{if(0!==Au||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(s=Us(e))){for(t.flags|=128,cl(r,!1),e=s.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)$r(n,e),n=n.sibling;return $(Bs,1&Bs.current|2),ci&&ri(t,r.treeForkCount),t.child}e=e.sibling}null!==r.tail&&ae()>Ou&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=Us(s))){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),cl(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!ci)return hl(t),null}else 2*ae()-r.renderingStartTime>Ou&&536870912!==n&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=r.last)?e.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ae(),e.sibling=null,n=Bs.current,$(Bs,i?1&n|2:1&n),ci&&ri(t,r.treeForkCount),e):(hl(t),null);case 22:case 23:return Ps(t),Fs(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?!!(536870912&n)&&!(128&t.flags)&&(hl(t),6&t.subtreeFlags&&(t.flags|=8192)):hl(t),null!==(n=t.updateQueue)&&ul(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&U(zi),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),bi(Pi),hl(t),null;case 25:case 30:return null}throw Error(o(156,t.tag))}function fl(e,t){switch(oi(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return bi(Pi),K(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return q(t),null;case 31:if(null!==t.memoizedState){if(Ps(t),null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Ps(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return U(Bs),null;case 4:return K(),null;case 10:return bi(t.type),null;case 22:case 23:return Ps(t),Fs(),null!==e&&U(zi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return bi(Pi),null;default:return null}}function pl(e,t){switch(oi(t),t.tag){case 3:bi(Pi),K();break;case 26:case 27:case 5:q(t);break;case 4:K();break;case 31:null!==t.memoizedState&&Ps(t);break;case 13:Ps(t);break;case 19:U(Bs);break;case 10:bi(t.type);break;case 22:case 23:Ps(t),Fs(),null!==e&&U(zi);break;case 24:bi(Pi)}}function ml(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var s=n.create,o=n.inst;r=s(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ac(t,t.return,e)}}function gl(e,t,n){try{var r=t.updateQueue,i=null!==r?r.lastEffect:null;if(null!==i){var s=i.next;r=s;do{if((r.tag&e)===e){var o=r.inst,a=o.destroy;if(void 0!==a){o.destroy=void 0,i=t;var l=n,u=a;try{u()}catch(e){Ac(i,l,e)}}}r=r.next}while(r!==s)}}catch(e){Ac(t,t.return,e)}}function El(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{bs(t,n)}catch(t){Ac(e,e.return,t)}}}function vl(e,t,n){n.props=Aa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ac(e,t,n)}}function Cl(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(n){Ac(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(n){Ac(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){Ac(e,t,n)}else n.current=null}function Sl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ac(e,e.return,t)}}function Al(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,a=null,l=null,u=null,c=null,h=null;for(p in n){var d=n[p];if(n.hasOwnProperty(p)&&null!=d)switch(p){case"checked":case"value":break;case"defaultValue":u=d;default:r.hasOwnProperty(p)||uh(e,t,p,null,r,d)}}for(var f in r){var p=r[f];if(d=n[f],r.hasOwnProperty(f)&&(null!=p||null!=d))switch(f){case"type":s=p;break;case"name":i=p;break;case"checked":c=p;break;case"defaultChecked":h=p;break;case"value":a=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(o(137,t));break;default:p!==d&&uh(e,t,f,p,r,d)}}return void Et(e,a,l,u,c,h,s,i);case"select":for(s in p=a=l=f=null,n)if(u=n[s],n.hasOwnProperty(s)&&null!=u)switch(s){case"value":break;case"multiple":p=u;default:r.hasOwnProperty(s)||uh(e,t,s,null,r,u)}for(i in r)if(s=r[i],u=n[i],r.hasOwnProperty(i)&&(null!=s||null!=u))switch(i){case"value":f=s;break;case"defaultValue":l=s;break;case"multiple":a=s;default:s!==u&&uh(e,t,i,s,r,u)}return t=l,n=a,r=p,void(null!=f?Dt(e,!!n,f,!1):!!r!=!!n&&(null!=t?Dt(e,!!n,t,!0):Dt(e,!!n,n?[]:"",!1)));case"textarea":for(l in p=f=null,n)if(i=n[l],n.hasOwnProperty(l)&&null!=i&&!r.hasOwnProperty(l))switch(l){case"value":case"children":break;default:uh(e,t,l,null,r,i)}for(a in r)if(i=r[a],s=n[a],r.hasOwnProperty(a)&&(null!=i||null!=s))switch(a){case"value":f=i;break;case"defaultValue":p=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(o(91));break;default:i!==s&&uh(e,t,a,i,r,s)}return void St(e,f,p);case"option":for(var m in n)f=n[m],n.hasOwnProperty(m)&&null!=f&&!r.hasOwnProperty(m)&&("selected"===m?e.selected=!1:uh(e,t,m,null,r,f));for(u in r)f=r[u],p=n[u],!r.hasOwnProperty(u)||f===p||null==f&&null==p||("selected"===u?e.selected=f&&"function"!=typeof f&&"symbol"!=typeof f:uh(e,t,u,f,r,p));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)f=n[g],n.hasOwnProperty(g)&&null!=f&&!r.hasOwnProperty(g)&&uh(e,t,g,null,r,f);for(c in r)if(f=r[c],p=n[c],r.hasOwnProperty(c)&&f!==p&&(null!=f||null!=p))switch(c){case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(o(137,t));break;default:uh(e,t,c,f,r,p)}return;default:if(Rt(t)){for(var E in n)f=n[E],n.hasOwnProperty(E)&&void 0!==f&&!r.hasOwnProperty(E)&&ch(e,t,E,void 0,r,f);for(h in r)f=r[h],p=n[h],!r.hasOwnProperty(h)||f===p||void 0===f&&void 0===p||ch(e,t,h,f,r,p);return}}for(var v in n)f=n[v],n.hasOwnProperty(v)&&null!=f&&!r.hasOwnProperty(v)&&uh(e,t,v,null,r,f);for(d in r)f=r[d],p=n[d],!r.hasOwnProperty(d)||f===p||null==f&&null==p||uh(e,t,d,f,r,p)}(r,e.type,n,t),r[Ge]=t}catch(t){Ac(e,e.return,t)}}function _l(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&bh(e.type)||4===e.tag}function yl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||_l(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&bh(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function bl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Nt));else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(bl(e,t,n),e=e.sibling;null!==e;)bl(e,t,n),e=e.sibling}function Tl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Tl(e,t,n),e=e.sibling;null!==e;)Tl(e,t,n),e=e.sibling}function Rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);hh(t,r,n),t[$e]=e,t[Ge]=n}catch(t){Ac(e,e.return,t)}}var xl=!1,wl=!1,Fl=!1,Nl="function"==typeof WeakSet?WeakSet:Set,Ll=null;function Ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Xl(e,n),4&r&&ml(5,n);break;case 1:if(Xl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){Ac(n,n.return,e)}else{var i=Aa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ac(n,n.return,e)}}64&r&&El(n),512&r&&Cl(n,n.return);break;case 3:if(Xl(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{bs(e,t)}catch(e){Ac(n,n.return,e)}}break;case 27:null===t&&4&r&&Rl(n);case 26:case 5:Xl(e,n),null===t&&4&r&&Sl(n),512&r&&Cl(n,n.return);break;case 12:Xl(e,n);break;case 31:Xl(e,n),4&r&&Ul(e,n);break;case 13:Xl(e,n),4&r&&$l(e,n),64&r&&null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Tc.bind(null,n));break;case 22:if(!(r=null!==n.memoizedState||xl)){t=null!==t&&null!==t.memoizedState||wl,i=xl;var s=wl;xl=r,(wl=t)&&!s?Yl(e,n,!!(8772&n.subtreeFlags)):Xl(e,n),xl=i,wl=s}break;case 30:break;default:Xl(e,n)}}function Il(e){var t=e.alternate;null!==t&&(e.alternate=null,Il(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&Ke(t),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var kl=null,Ml=!1;function Pl(e,t,n){for(n=n.child;null!==n;)Bl(e,t,n),n=n.sibling}function Bl(e,t,n){if(Ee&&"function"==typeof Ee.onCommitFiberUnmount)try{Ee.onCommitFiberUnmount(ge,n)}catch(e){}switch(n.tag){case 26:wl||Dl(n,t),Pl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:wl||Dl(n,t);var r=kl,i=Ml;bh(n.type)&&(kl=n.stateNode,Ml=!1),Pl(e,t,n),Ph(n.stateNode),kl=r,Ml=i;break;case 5:wl||Dl(n,t);case 6:if(r=kl,i=Ml,kl=null,Pl(e,t,n),Ml=i,null!==(kl=r))if(Ml)try{(9===kl.nodeType?kl.body:"HTML"===kl.nodeName?kl.ownerDocument.body:kl).removeChild(n.stateNode)}catch(e){Ac(n,t,e)}else try{kl.removeChild(n.stateNode)}catch(e){Ac(n,t,e)}break;case 18:null!==kl&&(Ml?(Th(9===(e=kl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Gd(e)):Th(kl,n.stateNode));break;case 4:r=kl,i=Ml,kl=n.stateNode.containerInfo,Ml=!0,Pl(e,t,n),kl=r,Ml=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),wl||gl(4,n,t),Pl(e,t,n);break;case 1:wl||(Dl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&vl(n,t,r)),Pl(e,t,n);break;case 21:Pl(e,t,n);break;case 22:wl=(r=wl)||null!==n.memoizedState,Pl(e,t,n),wl=r;break;default:Pl(e,t,n)}}function Ul(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)){e=e.dehydrated;try{Gd(e)}catch(e){Ac(t,t.return,e)}}}function $l(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{Gd(e)}catch(e){Ac(t,t.return,e)}}function Gl(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Nl),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Nl),t;default:throw Error(o(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Rc.bind(null,e,t);t.then(r,r)}})}function Vl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r title"))),hh(s,r,n),s[$e]=e,Je(s),r=s;break e;case"link":var a=td("link","href",i).get(r+(n.href||""));if(a)for(var l=0;la)break;var c=l.transferSize,h=l.initiatorType;c&&dh(h)&&(o+=c*((l=l.responseEnd)id?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}(h,p)))return Uu=s,e.cancelPendingCommit=p(pc.bind(null,e,t,s,n,r,i,o,a,l,c,h,null,d,f)),void Qu(e,s,o,!u)}pc(e,t,s,n,r,i,o,a,l)}function qu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var r=0;rg&&(o=g,g=m,m=o);var E=er(a,m),v=er(a,g);if(E&&v&&(1!==f.rangeCount||f.anchorNode!==E.node||f.anchorOffset!==E.offset||f.focusNode!==v.node||f.focusOffset!==v.offset)){var C=h.createRange();C.setStart(E.node,E.offset),f.removeAllRanges(),m>g?(f.addRange(C),f.extend(v.node,v.offset)):(C.setEnd(v.node,v.offset),f.addRange(C))}}}}for(h=[],f=a;f=f.parentNode;)1===f.nodeType&&h.push({element:f,left:f.scrollLeft,top:f.scrollTop});for("function"==typeof a.focus&&a.focus(),a=0;an?32:n,O.T=null,n=Gu,Gu=null;var s=Pu,a=Uu;if(Mu=0,Bu=Pu=null,Uu=0,6&du)throw Error(o(331));var l=du;if(du|=4,au(s.current),Jl(s,s.current,a,n),du=l,kc(0,!1),Ee&&"function"==typeof Ee.onPostCommitFiberRoot)try{Ee.onPostCommitFiberRoot(ge,s)}catch(e){}return!0}finally{I.p=i,O.T=r,vc(e,t)}}function Sc(e,t,n){t=Xr(n,t),null!==(e=vs(e,t=xa(e.stateNode,t,2),2))&&(Ne(e,2),Ic(e))}function Ac(e,t,n){if(3===e.tag)Sc(e,e,n);else for(;null!==t;){if(3===t.tag){Sc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===ku||!ku.has(r))){e=Xr(n,e),null!==(r=vs(t,n=wa(2),2))&&(Fa(n,r,t,e),Ne(r,2),Ic(r));break}}t=t.return}}function _c(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hu;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(Du=!0,i.add(n),e=yc.bind(null,e,t,n),t.then(e,e))}function yc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,fu===e&&(mu&n)===n&&(4===Au||3===Au&&(62914560&mu)===mu&&300>ae()-Nu?!(2&du)&&ec(e,0):bu|=n,Ru===mu&&(Ru=0)),Ic(e)}function bc(e,t){0===t&&(t=we()),null!==(e=Lr(e,t))&&(Ne(e,t),Ic(e))}function Tc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),bc(e,n)}function Rc(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}null!==r&&r.delete(t),bc(e,n)}var xc=null,wc=null,Fc=!1,Nc=!1,Lc=!1,Oc=0;function Ic(e){e!==wc&&null===e.next&&(null===wc?xc=wc=e:wc=wc.next=e),Nc=!0,Fc||(Fc=!0,_h(function(){6&du?re(ue,Mc):Pc()}))}function kc(e,t){if(!Lc&&Nc){Lc=!0;do{for(var n=!1,r=xc;null!==r;){if(!t)if(0!==e){var i=r.pendingLanes;if(0===i)var s=0;else{var o=r.suspendedLanes,a=r.pingedLanes;s=(1<<31-Ce(42|e)+1)-1,s=201326741&(s&=i&~(o&~a))?201326741&s|1:s?2|s:0}0!==s&&(n=!0,$c(r,s))}else s=mu,!(3&(s=Te(r,r===fu?s:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Re(r,s)||(n=!0,$c(r,s));r=r.next}}while(n);Lc=!1}}function Mc(){Pc()}function Pc(){Nc=Fc=!1;var e,t=0;0!==Oc&&((e=window.event)&&"popstate"===e.type?e!==Ch&&(Ch=e,1):(Ch=null,0))&&(t=Oc);for(var n=ae(),r=null,i=xc;null!==i;){var s=i.next,o=Bc(i,n);0===o?(i.next=null,null===r?xc=s:r.next=s,null===s&&(wc=r)):(r=i,(0!==t||3&o)&&(Nc=!0)),i=s}0!==Mu&&5!==Mu||kc(t,!1),0!==Oc&&(Oc=0)}function Bc(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=-62914561&e.pendingLanes;0 title"):null)}function rd(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var id=0;function sd(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)ad(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var od=null;function ad(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,od=new Map,t.forEach(ld,e),od=null,sd.call(e))}function ld(e,t){if(!(4&t.state.loading)){var n=od.get(e);if(n)var r=n.get(null);else{n=new Map,od.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s>>1,i=e[r];if(!(0>>1;rs(l,n))us(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[a]=n,r=a);else{if(!(us(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var u=[],c=[],h=1,d=null,f=3,p=!1,m=!1,g=!1,E=!1,v="function"==typeof setTimeout?setTimeout:null,C="function"==typeof clearTimeout?clearTimeout:null,D="undefined"!=typeof setImmediate?setImmediate:null;function S(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function A(e){if(g=!1,S(e),!m)if(null!==r(u))m=!0,y||(y=!0,_());else{var t=r(c);null!==t&&L(A,t.startTime-e)}}var _,y=!1,b=-1,T=5,R=-1;function x(){return!(!E&&t.unstable_now()-Re&&x());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var a=o(d.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof a){d.callback=a,S(e),n=!0;break t}d===r(u)&&i(u),S(e)}else i(u);d=r(u)}if(null!==d)n=!0;else{var l=r(c);null!==l&&L(A,l.startTime-e),n=!1}}break e}finally{d=null,f=s,p=!1}n=void 0}}finally{n?_():y=!1}}}if("function"==typeof D)_=function(){D(w)};else if("undefined"!=typeof MessageChannel){var F=new MessageChannel,N=F.port2;F.port1.onmessage=w,_=function(){N.postMessage(null)}}else _=function(){v(w,0)};function L(e,n){b=v(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125o?(e.sortIndex=s,n(c,e),null===r(u)&&e===r(c)&&(g?(C(b),b=-1):g=!0,L(A,s-o))):(e.sortIndex=a,n(u,e),m||p||(m=!0,y||(y=!0,_()))),e},t.unstable_shouldYield=x,t.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}},982(e,t,n){"use strict";e.exports=n(477)},902(e,t,n){"use strict";var r=n(72),i=n.n(r),s=n(825),o=n.n(s),a=n(659),l=n.n(a),u=n(56),c=n.n(u),h=n(540),d=n.n(h),f=n(113),p=n.n(f),m=n(636),g={};g.styleTagTransform=p(),g.setAttributes=c(),g.insert=l().bind(null,"html"),g.domAPI=o(),g.insertStyleElement=d(),i()(m.A,g),m.A&&m.A.locals&&m.A.locals},72(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},878(e,t,n){"use strict";n.r(t),n.d(t,{EmbeddedFrontend:()=>Id,Spector:()=>kd});var r={};n.r(r),n.d(r,{LX:()=>Jo,ll:()=>ea});var i,s={};n.r(s),n.d(s,{SyntaxError:()=>Xc,parse:()=>Yc});class o{static isBuildableProgram(e){return!!e&&!!e[this.rebuildProgramFunctionName]}static rebuildProgram(e,t,n,r,i){this.isBuildableProgram(e)&&e[this.rebuildProgramFunctionName](t,n,r,i)}}o.rebuildProgramFunctionName="__SPECTOR_rebuildProgram",function(e){e[e.noLog=0]="noLog",e[e.error=1]="error",e[e.warning=2]="warning",e[e.info=3]="info"}(i||(i={}));class a{static error(e,...t){this.level>0&&console.error(e,t)}static warn(e,...t){this.level>1&&console.warn(e,t)}static info(e,...t){this.level>2&&console.log(e,t)}}a.level=i.warning;class l{constructor(){this.callbacks=[],this.counter=-1}add(e,t){return this.counter++,t&&(e=e.bind(t)),this.callbacks[this.counter]=e,this.counter}remove(e){delete this.callbacks[e]}clear(){this.callbacks={}}trigger(e){for(const t in this.callbacks)this.callbacks.hasOwnProperty(t)&&this.callbacks[t](e)}}class u{constructor(){if("undefined"!=typeof performance&&performance.now)this.nowFunction=()=>performance.now();else{const e=new Date;this.nowFunction=e.getTime.bind(e)}}static get now(){return u.instance.nowFunction()}}u.instance=new u;class c{constructor(e){this.options=e}appendAnalysis(e){e.analyses=e.analyses||[];const t=this.getAnalysis(e);e.analyses.push(t)}getAnalysis(e){const t={analyserName:this.analyserName};return this.appendToAnalysis(e,t),t}}class h extends c{get analyserName(){return h.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={};for(const t of e.commands)n[t.name]=n[t.name]||0,n[t.name]++;const r=Object.keys(n).map(e=>[e,n[e]]);r.sort((e,t)=>{const n=t[1]-e[1];return 0===n?e[0].localeCompare(t[0]):n});for(const e of r)t[e[0]]=e[1]}}h.analyserName="Commands";const d=["drawArrays","drawElements","drawArraysInstanced","drawArraysInstancedANGLE","drawElementsInstanced","drawElementsInstancedANGLE","drawRangeElements","multiDrawArraysWEBGL","multiDrawElementsWEBGL","multiDrawArraysInstancedWEBGL","multiDrawElementsInstancedWEBGL","multiDrawArraysInstancedBaseInstanceWEBGL","multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL","drawArraysInstancedBaseInstanceWEBGL","drawElementsInstancedBaseVertexBaseInstanceWEBGL"];class f extends c{get analyserName(){return f.analyserName}appendToAnalysis(e,t){if(e.commands){t.total=e.commands.length,t.draw=0,t.clear=0;for(const n of e.commands)"clear"===n.name?t.clear++:d.indexOf(n.name)>-1&&t.draw++}}}f.analyserName="CommandsSummary";class p{static isWebGlConstant(e){return null!==g[e]&&void 0!==g[e]}static stringifyWebGlConstant(e,t){if(null==e)return"";if(0===e){return this.zeroMeaningByCommand[t]||"0"}if(1===e){return this.oneMeaningByCommand[t]||"1"}const n=g[e];return n?n.name:e+""}}p.DEPTH_BUFFER_BIT={name:"DEPTH_BUFFER_BIT",value:256,description:"Passed to clear to clear the current depth buffer."},p.STENCIL_BUFFER_BIT={name:"STENCIL_BUFFER_BIT",value:1024,description:"Passed to clear to clear the current stencil buffer."},p.COLOR_BUFFER_BIT={name:"COLOR_BUFFER_BIT",value:16384,description:"Passed to clear to clear the current color buffer."},p.POINTS={name:"POINTS",value:0,description:"Passed to drawElements or drawArrays to draw single points."},p.LINES={name:"LINES",value:1,description:"Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it."},p.LINE_LOOP={name:"LINE_LOOP",value:2,description:"Passed to drawElements or drawArrays to draw lines. Each set of two vertices is treated as a separate line segment."},p.LINE_STRIP={name:"LINE_STRIP",value:3,description:"Passed to drawElements or drawArrays to draw a connected group of line segments from the first vertex to the last."},p.TRIANGLES={name:"TRIANGLES",value:4,description:"Passed to drawElements or drawArrays to draw triangles. Each set of three vertices creates a separate triangle."},p.TRIANGLE_STRIP={name:"TRIANGLE_STRIP",value:5,description:"Passed to drawElements or drawArrays to draw a connected group of triangles."},p.TRIANGLE_FAN={name:"TRIANGLE_FAN",value:6,description:"Passed to drawElements or drawArrays to draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan."},p.ZERO={name:"ZERO",value:0,description:"Passed to blendFunc or blendFuncSeparate to turn off a component."},p.ONE={name:"ONE",value:1,description:"Passed to blendFunc or blendFuncSeparate to turn on a component."},p.SRC_COLOR={name:"SRC_COLOR",value:768,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source elements color."},p.ONE_MINUS_SRC_COLOR={name:"ONE_MINUS_SRC_COLOR",value:769,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source elements color."},p.SRC_ALPHA={name:"SRC_ALPHA",value:770,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source's alpha."},p.ONE_MINUS_SRC_ALPHA={name:"ONE_MINUS_SRC_ALPHA",value:771,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source's alpha."},p.DST_ALPHA={name:"DST_ALPHA",value:772,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's alpha."},p.ONE_MINUS_DST_ALPHA={name:"ONE_MINUS_DST_ALPHA",value:773,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's alpha."},p.DST_COLOR={name:"DST_COLOR",value:774,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's color."},p.ONE_MINUS_DST_COLOR={name:"ONE_MINUS_DST_COLOR",value:775,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's color."},p.SRC_ALPHA_SATURATE={name:"SRC_ALPHA_SATURATE",value:776,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the minimum of source's alpha or one minus the destination's alpha."},p.CONSTANT_COLOR={name:"CONSTANT_COLOR",value:32769,description:"Passed to blendFunc or blendFuncSeparate to specify a constant color blend function."},p.ONE_MINUS_CONSTANT_COLOR={name:"ONE_MINUS_CONSTANT_COLOR",value:32770,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant color blend function."},p.CONSTANT_ALPHA={name:"CONSTANT_ALPHA",value:32771,description:"Passed to blendFunc or blendFuncSeparate to specify a constant alpha blend function."},p.ONE_MINUS_CONSTANT_ALPHA={name:"ONE_MINUS_CONSTANT_ALPHA",value:32772,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant alpha blend function."},p.FUNC_ADD={name:"FUNC_ADD",value:32774,description:"Passed to blendEquation or blendEquationSeparate to set an addition blend function."},p.FUNC_SUBSTRACT={name:"FUNC_SUBSTRACT",value:32778,description:"Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination)."},p.FUNC_REVERSE_SUBTRACT={name:"FUNC_REVERSE_SUBTRACT",value:32779,description:"Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source)."},p.BLEND_EQUATION={name:"BLEND_EQUATION",value:32777,description:"Passed to getParameter to get the current RGB blend function."},p.BLEND_EQUATION_RGB={name:"BLEND_EQUATION_RGB",value:32777,description:"Passed to getParameter to get the current RGB blend function. Same as BLEND_EQUATION"},p.BLEND_EQUATION_ALPHA={name:"BLEND_EQUATION_ALPHA",value:34877,description:"Passed to getParameter to get the current alpha blend function. Same as BLEND_EQUATION"},p.BLEND_DST_RGB={name:"BLEND_DST_RGB",value:32968,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_SRC_RGB={name:"BLEND_SRC_RGB",value:32969,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_DST_ALPHA={name:"BLEND_DST_ALPHA",value:32970,description:"Passed to getParameter to get the current destination alpha blend function."},p.BLEND_SRC_ALPHA={name:"BLEND_SRC_ALPHA",value:32971,description:"Passed to getParameter to get the current source alpha blend function."},p.BLEND_COLOR={name:"BLEND_COLOR",value:32773,description:"Passed to getParameter to return a the current blend color."},p.ARRAY_BUFFER_BINDING={name:"ARRAY_BUFFER_BINDING",value:34964,description:"Passed to getParameter to get the array buffer binding."},p.ELEMENT_ARRAY_BUFFER_BINDING={name:"ELEMENT_ARRAY_BUFFER_BINDING",value:34965,description:"Passed to getParameter to get the current element array buffer."},p.LINE_WIDTH={name:"LINE_WIDTH",value:2849,description:"Passed to getParameter to get the current lineWidth (set by the lineWidth method)."},p.ALIASED_POINT_SIZE_RANGE={name:"ALIASED_POINT_SIZE_RANGE",value:33901,description:"Passed to getParameter to get the current size of a point drawn with gl.POINTS"},p.ALIASED_LINE_WIDTH_RANGE={name:"ALIASED_LINE_WIDTH_RANGE",value:33902,description:"Passed to getParameter to get the range of available widths for a line. Returns a length-2 array with the lo value at 0, and hight at 1."},p.CULL_FACE_MODE={name:"CULL_FACE_MODE",value:2885,description:"Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK"},p.FRONT_FACE={name:"FRONT_FACE",value:2886,description:"Passed to getParameter to determine the current value of frontFace. Should return CW or CCW."},p.DEPTH_RANGE={name:"DEPTH_RANGE",value:2928,description:"Passed to getParameter to return a length-2 array of floats giving the current depth range."},p.DEPTH_WRITEMASK={name:"DEPTH_WRITEMASK",value:2930,description:"Passed to getParameter to determine if the depth write mask is enabled."},p.DEPTH_CLEAR_VALUE={name:"DEPTH_CLEAR_VALUE",value:2931,description:"Passed to getParameter to determine the current depth clear value."},p.DEPTH_FUNC={name:"DEPTH_FUNC",value:2932,description:"Passed to getParameter to get the current depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_CLEAR_VALUE={name:"STENCIL_CLEAR_VALUE",value:2961,description:"Passed to getParameter to get the value the stencil will be cleared to."},p.STENCIL_FUNC={name:"STENCIL_FUNC",value:2962,description:"Passed to getParameter to get the current stencil function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_FAIL={name:"STENCIL_FAIL",value:2964,description:"Passed to getParameter to get the current stencil fail function. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_FAIL={name:"STENCIL_PASS_DEPTH_FAIL",value:2965,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test fail. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_PASS={name:"STENCIL_PASS_DEPTH_PASS",value:2966,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test pass. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_REF={name:"STENCIL_REF",value:2967,description:"Passed to getParameter to get the reference value used for stencil tests."},p.STENCIL_VALUE_MASK={name:"STENCIL_VALUE_MASK",value:2963,description:" "},p.STENCIL_WRITEMASK={name:"STENCIL_WRITEMASK",value:2968,description:" "},p.STENCIL_BACK_FUNC={name:"STENCIL_BACK_FUNC",value:34816,description:" "},p.STENCIL_BACK_FAIL={name:"STENCIL_BACK_FAIL",value:34817,description:" "},p.STENCIL_BACK_PASS_DEPTH_FAIL={name:"STENCIL_BACK_PASS_DEPTH_FAIL",value:34818,description:" "},p.STENCIL_BACK_PASS_DEPTH_PASS={name:"STENCIL_BACK_PASS_DEPTH_PASS",value:34819,description:" "},p.STENCIL_BACK_REF={name:"STENCIL_BACK_REF",value:36003,description:" "},p.STENCIL_BACK_VALUE_MASK={name:"STENCIL_BACK_VALUE_MASK",value:36004,description:" "},p.STENCIL_BACK_WRITEMASK={name:"STENCIL_BACK_WRITEMASK",value:36005,description:" "},p.VIEWPORT={name:"VIEWPORT",value:2978,description:"Returns an Int32Array with four elements for the current viewport dimensions."},p.SCISSOR_BOX={name:"SCISSOR_BOX",value:3088,description:"Returns an Int32Array with four elements for the current scissor box dimensions."},p.COLOR_CLEAR_VALUE={name:"COLOR_CLEAR_VALUE",value:3106,description:" "},p.COLOR_WRITEMASK={name:"COLOR_WRITEMASK",value:3107,description:" "},p.UNPACK_ALIGNMENT={name:"UNPACK_ALIGNMENT",value:3317,description:" "},p.PACK_ALIGNMENT={name:"PACK_ALIGNMENT",value:3333,description:" "},p.MAX_TEXTURE_SIZE={name:"MAX_TEXTURE_SIZE",value:3379,description:" "},p.MAX_VIEWPORT_DIMS={name:"MAX_VIEWPORT_DIMS",value:3386,description:" "},p.SUBPIXEL_BITS={name:"SUBPIXEL_BITS",value:3408,description:" "},p.RED_BITS={name:"RED_BITS",value:3410,description:" "},p.GREEN_BITS={name:"GREEN_BITS",value:3411,description:" "},p.BLUE_BITS={name:"BLUE_BITS",value:3412,description:" "},p.ALPHA_BITS={name:"ALPHA_BITS",value:3413,description:" "},p.DEPTH_BITS={name:"DEPTH_BITS",value:3414,description:" "},p.STENCIL_BITS={name:"STENCIL_BITS",value:3415,description:" "},p.POLYGON_OFFSET_UNITS={name:"POLYGON_OFFSET_UNITS",value:10752,description:" "},p.POLYGON_OFFSET_FACTOR={name:"POLYGON_OFFSET_FACTOR",value:32824,description:" "},p.TEXTURE_BINDING_2D={name:"TEXTURE_BINDING_2D",value:32873,description:" "},p.SAMPLE_BUFFERS={name:"SAMPLE_BUFFERS",value:32936,description:" "},p.SAMPLES={name:"SAMPLES",value:32937,description:" "},p.SAMPLE_COVERAGE_VALUE={name:"SAMPLE_COVERAGE_VALUE",value:32938,description:" "},p.SAMPLE_COVERAGE_INVERT={name:"SAMPLE_COVERAGE_INVERT",value:32939,description:" "},p.COMPRESSED_TEXTURE_FORMATS={name:"COMPRESSED_TEXTURE_FORMATS",value:34467,description:" "},p.VENDOR={name:"VENDOR",value:7936,description:" "},p.RENDERER={name:"RENDERER",value:7937,description:" "},p.VERSION={name:"VERSION",value:7938,description:" "},p.IMPLEMENTATION_COLOR_READ_TYPE={name:"IMPLEMENTATION_COLOR_READ_TYPE",value:35738,description:" "},p.IMPLEMENTATION_COLOR_READ_FORMAT={name:"IMPLEMENTATION_COLOR_READ_FORMAT",value:35739,description:" "},p.BROWSER_DEFAULT_WEBGL={name:"BROWSER_DEFAULT_WEBGL",value:37444,description:" "},p.STATIC_DRAW={name:"STATIC_DRAW",value:35044,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and not change often."},p.STREAM_DRAW={name:"STREAM_DRAW",value:35040,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to not be used often."},p.DYNAMIC_DRAW={name:"DYNAMIC_DRAW",value:35048,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and change often."},p.ARRAY_BUFFER={name:"ARRAY_BUFFER",value:34962,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.ELEMENT_ARRAY_BUFFER={name:"ELEMENT_ARRAY_BUFFER",value:34963,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.BUFFER_SIZE={name:"BUFFER_SIZE",value:34660,description:"Passed to getBufferParameter to get a buffer's size."},p.BUFFER_USAGE={name:"BUFFER_USAGE",value:34661,description:"Passed to getBufferParameter to get the hint for the buffer passed in when it was created."},p.CURRENT_VERTEX_ATTRIB={name:"CURRENT_VERTEX_ATTRIB",value:34342,description:"Passed to getVertexAttrib to read back the current vertex attribute."},p.VERTEX_ATTRIB_ARRAY_ENABLED={name:"VERTEX_ATTRIB_ARRAY_ENABLED",value:34338,description:" "},p.VERTEX_ATTRIB_ARRAY_SIZE={name:"VERTEX_ATTRIB_ARRAY_SIZE",value:34339,description:" "},p.VERTEX_ATTRIB_ARRAY_STRIDE={name:"VERTEX_ATTRIB_ARRAY_STRIDE",value:34340,description:" "},p.VERTEX_ATTRIB_ARRAY_TYPE={name:"VERTEX_ATTRIB_ARRAY_TYPE",value:34341,description:" "},p.VERTEX_ATTRIB_ARRAY_NORMALIZED={name:"VERTEX_ATTRIB_ARRAY_NORMALIZED",value:34922,description:" "},p.VERTEX_ATTRIB_ARRAY_POINTER={name:"VERTEX_ATTRIB_ARRAY_POINTER",value:34373,description:" "},p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING={name:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",value:34975,description:" "},p.CULL_FACE={name:"CULL_FACE",value:2884,description:"Passed to enable/disable to turn on/off culling. Can also be used with getParameter to find the current culling method."},p.FRONT={name:"FRONT",value:1028,description:"Passed to cullFace to specify that only front faces should be drawn."},p.BACK={name:"BACK",value:1029,description:"Passed to cullFace to specify that only back faces should be drawn."},p.FRONT_AND_BACK={name:"FRONT_AND_BACK",value:1032,description:"Passed to cullFace to specify that front and back faces should be drawn."},p.BLEND={name:"BLEND",value:3042,description:"Passed to enable/disable to turn on/off blending. Can also be used with getParameter to find the current blending method."},p.DEPTH_TEST={name:"DEPTH_TEST",value:2929,description:"Passed to enable/disable to turn on/off the depth test. Can also be used with getParameter to query the depth test."},p.DITHER={name:"DITHER",value:3024,description:"Passed to enable/disable to turn on/off dithering. Can also be used with getParameter to find the current dithering method."},p.POLYGON_OFFSET_FILL={name:"POLYGON_OFFSET_FILL",value:32823,description:"Passed to enable/disable to turn on/off the polygon offset. Useful for rendering hidden-line images, decals, and or solids with highlighted edges. Can also be used with getParameter to query the scissor test."},p.SAMPLE_ALPHA_TO_COVERAGE={name:"SAMPLE_ALPHA_TO_COVERAGE",value:32926,description:"Passed to enable/disable to turn on/off the alpha to coverage. Used in multi-sampling alpha channels."},p.SAMPLE_COVERAGE={name:"SAMPLE_COVERAGE",value:32928,description:"Passed to enable/disable to turn on/off the sample coverage. Used in multi-sampling."},p.SCISSOR_TEST={name:"SCISSOR_TEST",value:3089,description:"Passed to enable/disable to turn on/off the scissor test. Can also be used with getParameter to query the scissor test."},p.STENCIL_TEST={name:"STENCIL_TEST",value:2960,description:"Passed to enable/disable to turn on/off the stencil test. Can also be used with getParameter to query the stencil test."},p.NO_ERROR={name:"NO_ERROR",value:0,description:"Returned from getError."},p.INVALID_ENUM={name:"INVALID_ENUM",value:1280,description:"Returned from getError."},p.INVALID_VALUE={name:"INVALID_VALUE",value:1281,description:"Returned from getError."},p.INVALID_OPERATION={name:"INVALID_OPERATION",value:1282,description:"Returned from getError."},p.OUT_OF_MEMORY={name:"OUT_OF_MEMORY",value:1285,description:"Returned from getError."},p.CONTEXT_LOST_WEBGL={name:"CONTEXT_LOST_WEBGL",value:37442,description:"Returned from getError."},p.CW={name:"CW",value:2304,description:"Passed to frontFace to specify the front face of a polygon is drawn in the clockwise direction"},p.CCW={name:"CCW",value:2305,description:"Passed to frontFace to specify the front face of a polygon is drawn in the counter clockwise direction"},p.DONT_CARE={name:"DONT_CARE",value:4352,description:"There is no preference for this behavior."},p.FASTEST={name:"FASTEST",value:4353,description:"The most efficient behavior should be used."},p.NICEST={name:"NICEST",value:4354,description:"The most correct or the highest quality option should be used."},p.GENERATE_MIPMAP_HINT={name:"GENERATE_MIPMAP_HINT",value:33170,description:"Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap()."},p.BYTE={name:"BYTE",value:5120,description:" "},p.UNSIGNED_BYTE={name:"UNSIGNED_BYTE",value:5121,description:" "},p.SHORT={name:"SHORT",value:5122,description:" "},p.UNSIGNED_SHORT={name:"UNSIGNED_SHORT",value:5123,description:" "},p.INT={name:"INT",value:5124,description:" "},p.UNSIGNED_INT={name:"UNSIGNED_INT",value:5125,description:" "},p.FLOAT={name:"FLOAT",value:5126,description:" "},p.DEPTH_COMPONENT={name:"DEPTH_COMPONENT",value:6402,description:" "},p.ALPHA={name:"ALPHA",value:6406,description:" "},p.RGB={name:"RGB",value:6407,description:" "},p.RGBA={name:"RGBA",value:6408,description:" "},p.LUMINANCE={name:"LUMINANCE",value:6409,description:" "},p.LUMINANCE_ALPHA={name:"LUMINANCE_ALPHA",value:6410,description:" "},p.UNSIGNED_SHORT_4_4_4_4={name:"UNSIGNED_SHORT_4_4_4_4",value:32819,description:" "},p.UNSIGNED_SHORT_5_5_5_1={name:"UNSIGNED_SHORT_5_5_5_1",value:32820,description:" "},p.UNSIGNED_SHORT_5_6_5={name:"UNSIGNED_SHORT_5_6_5",value:33635,description:" "},p.FRAGMENT_SHADER={name:"FRAGMENT_SHADER",value:35632,description:"Passed to createShader to define a fragment shader."},p.VERTEX_SHADER={name:"VERTEX_SHADER",value:35633,description:"Passed to createShader to define a vertex shader"},p.COMPILE_STATUS={name:"COMPILE_STATUS",value:35713,description:"Passed to getShaderParamter to get the status of the compilation. Returns false if the shader was not compiled. You can then query getShaderInfoLog to find the exact error"},p.DELETE_STATUS={name:"DELETE_STATUS",value:35712,description:"Passed to getShaderParamter to determine if a shader was deleted via deleteShader. Returns true if it was, false otherwise."},p.LINK_STATUS={name:"LINK_STATUS",value:35714,description:"Passed to getProgramParameter after calling linkProgram to determine if a program was linked correctly. Returns false if there were errors. Use getProgramInfoLog to find the exact error."},p.VALIDATE_STATUS={name:"VALIDATE_STATUS",value:35715,description:"Passed to getProgramParameter after calling validateProgram to determine if it is valid. Returns false if errors were found."},p.ATTACHED_SHADERS={name:"ATTACHED_SHADERS",value:35717,description:"Passed to getProgramParameter after calling attachShader to determine if the shader was attached correctly. Returns false if errors occurred."},p.COMPLETION_STATUS_KHR={name:"COMPLETION_STATUS_KHR",value:37297,description:"Passed to getProgramParameter (KHR_parallel_shader_compile) to query whether an asynchronous shader/program link has completed. Returns true once the program is ready to use without blocking."},p.ACTIVE_ATTRIBUTES={name:"ACTIVE_ATTRIBUTES",value:35721,description:"Passed to getProgramParameter to get the number of attributes active in a program."},p.ACTIVE_UNIFORMS={name:"ACTIVE_UNIFORMS",value:35718,description:"Passed to getProgramParamter to get the number of uniforms active in a program."},p.MAX_VERTEX_ATTRIBS={name:"MAX_VERTEX_ATTRIBS",value:34921,description:" "},p.MAX_VERTEX_UNIFORM_VECTORS={name:"MAX_VERTEX_UNIFORM_VECTORS",value:36347,description:" "},p.MAX_VARYING_VECTORS={name:"MAX_VARYING_VECTORS",value:36348,description:" "},p.MAX_COMBINED_TEXTURE_IMAGE_UNITS={name:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",value:35661,description:" "},p.MAX_VERTEX_TEXTURE_IMAGE_UNITS={name:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",value:35660,description:" "},p.MAX_TEXTURE_IMAGE_UNITS={name:"MAX_TEXTURE_IMAGE_UNITS",value:34930,description:"Implementation dependent number of maximum texture units. At least 8."},p.MAX_FRAGMENT_UNIFORM_VECTORS={name:"MAX_FRAGMENT_UNIFORM_VECTORS",value:36349,description:" "},p.SHADER_TYPE={name:"SHADER_TYPE",value:35663,description:" "},p.SHADING_LANGUAGE_VERSION={name:"SHADING_LANGUAGE_VERSION",value:35724,description:" "},p.CURRENT_PROGRAM={name:"CURRENT_PROGRAM",value:35725,description:" "},p.NEVER={name:"NEVER",value:512,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn."},p.ALWAYS={name:"ALWAYS",value:519,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn."},p.LESS={name:"LESS",value:513,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value."},p.EQUAL={name:"EQUAL",value:514,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value."},p.LEQUAL={name:"LEQUAL",value:515,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value."},p.GREATER={name:"GREATER",value:516,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value."},p.GEQUAL={name:"GEQUAL",value:518,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value."},p.NOTEQUAL={name:"NOTEQUAL",value:517,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value."},p.KEEP={name:"KEEP",value:7680,description:" "},p.REPLACE={name:"REPLACE",value:7681,description:" "},p.INCR={name:"INCR",value:7682,description:" "},p.DECR={name:"DECR",value:7683,description:" "},p.INVERT={name:"INVERT",value:5386,description:" "},p.INCR_WRAP={name:"INCR_WRAP",value:34055,description:" "},p.DECR_WRAP={name:"DECR_WRAP",value:34056,description:" "},p.NEAREST={name:"NEAREST",value:9728,description:" "},p.LINEAR={name:"LINEAR",value:9729,description:" "},p.NEAREST_MIPMAP_NEAREST={name:"NEAREST_MIPMAP_NEAREST",value:9984,description:" "},p.LINEAR_MIPMAP_NEAREST={name:"LINEAR_MIPMAP_NEAREST",value:9985,description:" "},p.NEAREST_MIPMAP_LINEAR={name:"NEAREST_MIPMAP_LINEAR",value:9986,description:" "},p.LINEAR_MIPMAP_LINEAR={name:"LINEAR_MIPMAP_LINEAR",value:9987,description:" "},p.TEXTURE_MAG_FILTER={name:"TEXTURE_MAG_FILTER",value:10240,description:" "},p.TEXTURE_MIN_FILTER={name:"TEXTURE_MIN_FILTER",value:10241,description:" "},p.TEXTURE_WRAP_S={name:"TEXTURE_WRAP_S",value:10242,description:" "},p.TEXTURE_WRAP_T={name:"TEXTURE_WRAP_T",value:10243,description:" "},p.TEXTURE_2D={name:"TEXTURE_2D",value:3553,description:" "},p.TEXTURE={name:"TEXTURE",value:5890,description:" "},p.TEXTURE_CUBE_MAP={name:"TEXTURE_CUBE_MAP",value:34067,description:" "},p.TEXTURE_BINDING_CUBE_MAP={name:"TEXTURE_BINDING_CUBE_MAP",value:34068,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_X={name:"TEXTURE_CUBE_MAP_POSITIVE_X",value:34069,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_X={name:"TEXTURE_CUBE_MAP_NEGATIVE_X",value:34070,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Y={name:"TEXTURE_CUBE_MAP_POSITIVE_Y",value:34071,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Y={name:"TEXTURE_CUBE_MAP_NEGATIVE_Y",value:34072,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Z={name:"TEXTURE_CUBE_MAP_POSITIVE_Z",value:34073,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Z={name:"TEXTURE_CUBE_MAP_NEGATIVE_Z",value:34074,description:" "},p.MAX_CUBE_MAP_TEXTURE_SIZE={name:"MAX_CUBE_MAP_TEXTURE_SIZE",value:34076,description:" "},p.TEXTURE0={name:"TEXTURE0",value:33984,description:"A texture unit."},p.TEXTURE1={name:"TEXTURE1",value:33985,description:"A texture unit."},p.TEXTURE2={name:"TEXTURE2",value:33986,description:"A texture unit."},p.TEXTURE3={name:"TEXTURE3",value:33987,description:"A texture unit."},p.TEXTURE4={name:"TEXTURE4",value:33988,description:"A texture unit."},p.TEXTURE5={name:"TEXTURE5",value:33989,description:"A texture unit."},p.TEXTURE6={name:"TEXTURE6",value:33990,description:"A texture unit."},p.TEXTURE7={name:"TEXTURE7",value:33991,description:"A texture unit."},p.TEXTURE8={name:"TEXTURE8",value:33992,description:"A texture unit."},p.TEXTURE9={name:"TEXTURE9",value:33993,description:"A texture unit."},p.TEXTURE10={name:"TEXTURE10",value:33994,description:"A texture unit."},p.TEXTURE11={name:"TEXTURE11",value:33995,description:"A texture unit."},p.TEXTURE12={name:"TEXTURE12",value:33996,description:"A texture unit."},p.TEXTURE13={name:"TEXTURE13",value:33997,description:"A texture unit."},p.TEXTURE14={name:"TEXTURE14",value:33998,description:"A texture unit."},p.TEXTURE15={name:"TEXTURE15",value:33999,description:"A texture unit."},p.TEXTURE16={name:"TEXTURE16",value:34e3,description:"A texture unit."},p.TEXTURE17={name:"TEXTURE17",value:34001,description:"A texture unit."},p.TEXTURE18={name:"TEXTURE18",value:34002,description:"A texture unit."},p.TEXTURE19={name:"TEXTURE19",value:34003,description:"A texture unit."},p.TEXTURE20={name:"TEXTURE20",value:34004,description:"A texture unit."},p.TEXTURE21={name:"TEXTURE21",value:34005,description:"A texture unit."},p.TEXTURE22={name:"TEXTURE22",value:34006,description:"A texture unit."},p.TEXTURE23={name:"TEXTURE23",value:34007,description:"A texture unit."},p.TEXTURE24={name:"TEXTURE24",value:34008,description:"A texture unit."},p.TEXTURE25={name:"TEXTURE25",value:34009,description:"A texture unit."},p.TEXTURE26={name:"TEXTURE26",value:34010,description:"A texture unit."},p.TEXTURE27={name:"TEXTURE27",value:34011,description:"A texture unit."},p.TEXTURE28={name:"TEXTURE28",value:34012,description:"A texture unit."},p.TEXTURE29={name:"TEXTURE29",value:34013,description:"A texture unit."},p.TEXTURE30={name:"TEXTURE30",value:34014,description:"A texture unit."},p.TEXTURE31={name:"TEXTURE31",value:34015,description:"A texture unit."},p.ACTIVE_TEXTURE={name:"ACTIVE_TEXTURE",value:34016,description:"The current active texture unit."},p.REPEAT={name:"REPEAT",value:10497,description:" "},p.CLAMP_TO_EDGE={name:"CLAMP_TO_EDGE",value:33071,description:" "},p.MIRRORED_REPEAT={name:"MIRRORED_REPEAT",value:33648,description:" "},p.FLOAT_VEC2={name:"FLOAT_VEC2",value:35664,description:" "},p.FLOAT_VEC3={name:"FLOAT_VEC3",value:35665,description:" "},p.FLOAT_VEC4={name:"FLOAT_VEC4",value:35666,description:" "},p.INT_VEC2={name:"INT_VEC2",value:35667,description:" "},p.INT_VEC3={name:"INT_VEC3",value:35668,description:" "},p.INT_VEC4={name:"INT_VEC4",value:35669,description:" "},p.BOOL={name:"BOOL",value:35670,description:" "},p.BOOL_VEC2={name:"BOOL_VEC2",value:35671,description:" "},p.BOOL_VEC3={name:"BOOL_VEC3",value:35672,description:" "},p.BOOL_VEC4={name:"BOOL_VEC4",value:35673,description:" "},p.FLOAT_MAT2={name:"FLOAT_MAT2",value:35674,description:" "},p.FLOAT_MAT3={name:"FLOAT_MAT3",value:35675,description:" "},p.FLOAT_MAT4={name:"FLOAT_MAT4",value:35676,description:" "},p.SAMPLER_2D={name:"SAMPLER_2D",value:35678,description:" "},p.SAMPLER_CUBE={name:"SAMPLER_CUBE",value:35680,description:" "},p.LOW_FLOAT={name:"LOW_FLOAT",value:36336,description:" "},p.MEDIUM_FLOAT={name:"MEDIUM_FLOAT",value:36337,description:" "},p.HIGH_FLOAT={name:"HIGH_FLOAT",value:36338,description:" "},p.LOW_INT={name:"LOW_INT",value:36339,description:" "},p.MEDIUM_INT={name:"MEDIUM_INT",value:36340,description:" "},p.HIGH_INT={name:"HIGH_INT",value:36341,description:" "},p.FRAMEBUFFER={name:"FRAMEBUFFER",value:36160,description:" "},p.RENDERBUFFER={name:"RENDERBUFFER",value:36161,description:" "},p.RGBA4={name:"RGBA4",value:32854,description:" "},p.RGB5_A1={name:"RGB5_A1",value:32855,description:" "},p.RGB565={name:"RGB565",value:36194,description:" "},p.DEPTH_COMPONENT16={name:"DEPTH_COMPONENT16",value:33189,description:" "},p.STENCIL_INDEX={name:"STENCIL_INDEX",value:6401,description:" "},p.STENCIL_INDEX8={name:"STENCIL_INDEX8",value:36168,description:" "},p.DEPTH_STENCIL={name:"DEPTH_STENCIL",value:34041,description:" "},p.RENDERBUFFER_WIDTH={name:"RENDERBUFFER_WIDTH",value:36162,description:" "},p.RENDERBUFFER_HEIGHT={name:"RENDERBUFFER_HEIGHT",value:36163,description:" "},p.RENDERBUFFER_INTERNAL_FORMAT={name:"RENDERBUFFER_INTERNAL_FORMAT",value:36164,description:" "},p.RENDERBUFFER_RED_SIZE={name:"RENDERBUFFER_RED_SIZE",value:36176,description:" "},p.RENDERBUFFER_GREEN_SIZE={name:"RENDERBUFFER_GREEN_SIZE",value:36177,description:" "},p.RENDERBUFFER_BLUE_SIZE={name:"RENDERBUFFER_BLUE_SIZE",value:36178,description:" "},p.RENDERBUFFER_ALPHA_SIZE={name:"RENDERBUFFER_ALPHA_SIZE",value:36179,description:" "},p.RENDERBUFFER_DEPTH_SIZE={name:"RENDERBUFFER_DEPTH_SIZE",value:36180,description:" "},p.RENDERBUFFER_STENCIL_SIZE={name:"RENDERBUFFER_STENCIL_SIZE",value:36181,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",value:36048,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",value:36049,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",value:36050,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",value:36051,description:" "},p.COLOR_ATTACHMENT0={name:"COLOR_ATTACHMENT0",value:36064,description:" "},p.DEPTH_ATTACHMENT={name:"DEPTH_ATTACHMENT",value:36096,description:" "},p.STENCIL_ATTACHMENT={name:"STENCIL_ATTACHMENT",value:36128,description:" "},p.DEPTH_STENCIL_ATTACHMENT={name:"DEPTH_STENCIL_ATTACHMENT",value:33306,description:" "},p.NONE={name:"NONE",value:0,description:" "},p.FRAMEBUFFER_COMPLETE={name:"FRAMEBUFFER_COMPLETE",value:36053,description:" "},p.FRAMEBUFFER_INCOMPLETE_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",value:36054,description:" "},p.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",value:36055,description:" "},p.FRAMEBUFFER_INCOMPLETE_DIMENSIONS={name:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",value:36057,description:" "},p.FRAMEBUFFER_UNSUPPORTED={name:"FRAMEBUFFER_UNSUPPORTED",value:36061,description:" "},p.FRAMEBUFFER_BINDING={name:"FRAMEBUFFER_BINDING",value:36006,description:" "},p.RENDERBUFFER_BINDING={name:"RENDERBUFFER_BINDING",value:36007,description:" "},p.MAX_RENDERBUFFER_SIZE={name:"MAX_RENDERBUFFER_SIZE",value:34024,description:" "},p.INVALID_FRAMEBUFFER_OPERATION={name:"INVALID_FRAMEBUFFER_OPERATION",value:1286,description:" "},p.UNPACK_FLIP_Y_WEBGL={name:"UNPACK_FLIP_Y_WEBGL",value:37440,description:" "},p.UNPACK_PREMULTIPLY_ALPHA_WEBGL={name:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",value:37441,description:" "},p.UNPACK_COLORSPACE_CONVERSION_WEBGL={name:"UNPACK_COLORSPACE_CONVERSION_WEBGL",value:37443,description:" "},p.READ_BUFFER={name:"READ_BUFFER",value:3074,description:" "},p.UNPACK_ROW_LENGTH={name:"UNPACK_ROW_LENGTH",value:3314,description:" "},p.UNPACK_SKIP_ROWS={name:"UNPACK_SKIP_ROWS",value:3315,description:" "},p.UNPACK_SKIP_PIXELS={name:"UNPACK_SKIP_PIXELS",value:3316,description:" "},p.PACK_ROW_LENGTH={name:"PACK_ROW_LENGTH",value:3330,description:" "},p.PACK_SKIP_ROWS={name:"PACK_SKIP_ROWS",value:3331,description:" "},p.PACK_SKIP_PIXELS={name:"PACK_SKIP_PIXELS",value:3332,description:" "},p.TEXTURE_BINDING_3D={name:"TEXTURE_BINDING_3D",value:32874,description:" "},p.UNPACK_SKIP_IMAGES={name:"UNPACK_SKIP_IMAGES",value:32877,description:" "},p.UNPACK_IMAGE_HEIGHT={name:"UNPACK_IMAGE_HEIGHT",value:32878,description:" "},p.MAX_3D_TEXTURE_SIZE={name:"MAX_3D_TEXTURE_SIZE",value:32883,description:" "},p.MAX_ELEMENTS_VERTICES={name:"MAX_ELEMENTS_VERTICES",value:33e3,description:" "},p.MAX_ELEMENTS_INDICES={name:"MAX_ELEMENTS_INDICES",value:33001,description:" "},p.MAX_TEXTURE_LOD_BIAS={name:"MAX_TEXTURE_LOD_BIAS",value:34045,description:" "},p.MAX_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_FRAGMENT_UNIFORM_COMPONENTS",value:35657,description:" "},p.MAX_VERTEX_UNIFORM_COMPONENTS={name:"MAX_VERTEX_UNIFORM_COMPONENTS",value:35658,description:" "},p.MAX_ARRAY_TEXTURE_LAYERS={name:"MAX_ARRAY_TEXTURE_LAYERS",value:35071,description:" "},p.MIN_PROGRAM_TEXEL_OFFSET={name:"MIN_PROGRAM_TEXEL_OFFSET",value:35076,description:" "},p.MAX_PROGRAM_TEXEL_OFFSET={name:"MAX_PROGRAM_TEXEL_OFFSET",value:35077,description:" "},p.MAX_VARYING_COMPONENTS={name:"MAX_VARYING_COMPONENTS",value:35659,description:" "},p.FRAGMENT_SHADER_DERIVATIVE_HINT={name:"FRAGMENT_SHADER_DERIVATIVE_HINT",value:35723,description:" "},p.RASTERIZER_DISCARD={name:"RASTERIZER_DISCARD",value:35977,description:" "},p.VERTEX_ARRAY_BINDING={name:"VERTEX_ARRAY_BINDING",value:34229,description:" "},p.MAX_VERTEX_OUTPUT_COMPONENTS={name:"MAX_VERTEX_OUTPUT_COMPONENTS",value:37154,description:" "},p.MAX_FRAGMENT_INPUT_COMPONENTS={name:"MAX_FRAGMENT_INPUT_COMPONENTS",value:37157,description:" "},p.MAX_SERVER_WAIT_TIMEOUT={name:"MAX_SERVER_WAIT_TIMEOUT",value:37137,description:" "},p.MAX_ELEMENT_INDEX={name:"MAX_ELEMENT_INDEX",value:36203,description:" "},p.RED={name:"RED",value:6403,description:" "},p.RGB8={name:"RGB8",value:32849,description:" "},p.RGBA8={name:"RGBA8",value:32856,description:" "},p.RGB10_A2={name:"RGB10_A2",value:32857,description:" "},p.TEXTURE_3D={name:"TEXTURE_3D",value:32879,description:" "},p.TEXTURE_WRAP_R={name:"TEXTURE_WRAP_R",value:32882,description:" "},p.TEXTURE_MIN_LOD={name:"TEXTURE_MIN_LOD",value:33082,description:" "},p.TEXTURE_MAX_LOD={name:"TEXTURE_MAX_LOD",value:33083,description:" "},p.TEXTURE_BASE_LEVEL={name:"TEXTURE_BASE_LEVEL",value:33084,description:" "},p.TEXTURE_MAX_LEVEL={name:"TEXTURE_MAX_LEVEL",value:33085,description:" "},p.TEXTURE_COMPARE_MODE={name:"TEXTURE_COMPARE_MODE",value:34892,description:" "},p.TEXTURE_COMPARE_FUNC={name:"TEXTURE_COMPARE_FUNC",value:34893,description:" "},p.SRGB={name:"SRGB",value:35904,description:" "},p.SRGB8={name:"SRGB8",value:35905,description:" "},p.SRGB8_ALPHA8={name:"SRGB8_ALPHA8",value:35907,description:" "},p.COMPARE_REF_TO_TEXTURE={name:"COMPARE_REF_TO_TEXTURE",value:34894,description:" "},p.RGBA32F={name:"RGBA32F",value:34836,description:" "},p.RGB32F={name:"RGB32F",value:34837,description:" "},p.RGBA16F={name:"RGBA16F",value:34842,description:" "},p.RGB16F={name:"RGB16F",value:34843,description:" "},p.TEXTURE_2D_ARRAY={name:"TEXTURE_2D_ARRAY",value:35866,description:" "},p.TEXTURE_BINDING_2D_ARRAY={name:"TEXTURE_BINDING_2D_ARRAY",value:35869,description:" "},p.R11F_G11F_B10F={name:"R11F_G11F_B10F",value:35898,description:" "},p.RGB9_E5={name:"RGB9_E5",value:35901,description:" "},p.RGBA32UI={name:"RGBA32UI",value:36208,description:" "},p.RGB32UI={name:"RGB32UI",value:36209,description:" "},p.RGBA16UI={name:"RGBA16UI",value:36214,description:" "},p.RGB16UI={name:"RGB16UI",value:36215,description:" "},p.RGBA8UI={name:"RGBA8UI",value:36220,description:" "},p.RGB8UI={name:"RGB8UI",value:36221,description:" "},p.RGBA32I={name:"RGBA32I",value:36226,description:" "},p.RGB32I={name:"RGB32I",value:36227,description:" "},p.RGBA16I={name:"RGBA16I",value:36232,description:" "},p.RGB16I={name:"RGB16I",value:36233,description:" "},p.RGBA8I={name:"RGBA8I",value:36238,description:" "},p.RGB8I={name:"RGB8I",value:36239,description:" "},p.RED_INTEGER={name:"RED_INTEGER",value:36244,description:" "},p.RGB_INTEGER={name:"RGB_INTEGER",value:36248,description:" "},p.RGBA_INTEGER={name:"RGBA_INTEGER",value:36249,description:" "},p.R8={name:"R8",value:33321,description:" "},p.RG8={name:"RG8",value:33323,description:" "},p.R16F={name:"R16F",value:33325,description:" "},p.R32F={name:"R32F",value:33326,description:" "},p.RG16F={name:"RG16F",value:33327,description:" "},p.RG32F={name:"RG32F",value:33328,description:" "},p.R8I={name:"R8I",value:33329,description:" "},p.R8UI={name:"R8UI",value:33330,description:" "},p.R16I={name:"R16I",value:33331,description:" "},p.R16UI={name:"R16UI",value:33332,description:" "},p.R32I={name:"R32I",value:33333,description:" "},p.R32UI={name:"R32UI",value:33334,description:" "},p.RG8I={name:"RG8I",value:33335,description:" "},p.RG8UI={name:"RG8UI",value:33336,description:" "},p.RG16I={name:"RG16I",value:33337,description:" "},p.RG16UI={name:"RG16UI",value:33338,description:" "},p.RG32I={name:"RG32I",value:33339,description:" "},p.RG32UI={name:"RG32UI",value:33340,description:" "},p.R8_SNORM={name:"R8_SNORM",value:36756,description:" "},p.RG8_SNORM={name:"RG8_SNORM",value:36757,description:" "},p.RGB8_SNORM={name:"RGB8_SNORM",value:36758,description:" "},p.RGBA8_SNORM={name:"RGBA8_SNORM",value:36759,description:" "},p.RGB10_A2UI={name:"RGB10_A2UI",value:36975,description:" "},p.TEXTURE_IMMUTABLE_FORMAT={name:"TEXTURE_IMMUTABLE_FORMAT",value:37167,description:" "},p.TEXTURE_IMMUTABLE_LEVELS={name:"TEXTURE_IMMUTABLE_LEVELS",value:33503,description:" "},p.UNSIGNED_INT_2_10_10_10_REV={name:"UNSIGNED_INT_2_10_10_10_REV",value:33640,description:" "},p.UNSIGNED_INT_10F_11F_11F_REV={name:"UNSIGNED_INT_10F_11F_11F_REV",value:35899,description:" "},p.UNSIGNED_INT_5_9_9_9_REV={name:"UNSIGNED_INT_5_9_9_9_REV",value:35902,description:" "},p.FLOAT_32_UNSIGNED_INT_24_8_REV={name:"FLOAT_32_UNSIGNED_INT_24_8_REV",value:36269,description:" "},p.UNSIGNED_INT_24_8={name:"UNSIGNED_INT_24_8",value:34042,description:" "},p.HALF_FLOAT={name:"HALF_FLOAT",value:5131,description:" "},p.RG={name:"RG",value:33319,description:" "},p.RG_INTEGER={name:"RG_INTEGER",value:33320,description:" "},p.INT_2_10_10_10_REV={name:"INT_2_10_10_10_REV",value:36255,description:" "},p.CURRENT_QUERY={name:"CURRENT_QUERY",value:34917,description:" "},p.QUERY_RESULT={name:"QUERY_RESULT",value:34918,description:" "},p.QUERY_RESULT_AVAILABLE={name:"QUERY_RESULT_AVAILABLE",value:34919,description:" "},p.ANY_SAMPLES_PASSED={name:"ANY_SAMPLES_PASSED",value:35887,description:" "},p.ANY_SAMPLES_PASSED_CONSERVATIVE={name:"ANY_SAMPLES_PASSED_CONSERVATIVE",value:36202,description:" "},p.MAX_DRAW_BUFFERS={name:"MAX_DRAW_BUFFERS",value:34852,description:" "},p.DRAW_BUFFER0={name:"DRAW_BUFFER0",value:34853,description:" "},p.DRAW_BUFFER1={name:"DRAW_BUFFER1",value:34854,description:" "},p.DRAW_BUFFER2={name:"DRAW_BUFFER2",value:34855,description:" "},p.DRAW_BUFFER3={name:"DRAW_BUFFER3",value:34856,description:" "},p.DRAW_BUFFER4={name:"DRAW_BUFFER4",value:34857,description:" "},p.DRAW_BUFFER5={name:"DRAW_BUFFER5",value:34858,description:" "},p.DRAW_BUFFER6={name:"DRAW_BUFFER6",value:34859,description:" "},p.DRAW_BUFFER7={name:"DRAW_BUFFER7",value:34860,description:" "},p.DRAW_BUFFER8={name:"DRAW_BUFFER8",value:34861,description:" "},p.DRAW_BUFFER9={name:"DRAW_BUFFER9",value:34862,description:" "},p.DRAW_BUFFER10={name:"DRAW_BUFFER10",value:34863,description:" "},p.DRAW_BUFFER11={name:"DRAW_BUFFER11",value:34864,description:" "},p.DRAW_BUFFER12={name:"DRAW_BUFFER12",value:34865,description:" "},p.DRAW_BUFFER13={name:"DRAW_BUFFER13",value:34866,description:" "},p.DRAW_BUFFER14={name:"DRAW_BUFFER14",value:34867,description:" "},p.DRAW_BUFFER15={name:"DRAW_BUFFER15",value:34868,description:" "},p.MAX_COLOR_ATTACHMENTS={name:"MAX_COLOR_ATTACHMENTS",value:36063,description:" "},p.COLOR_ATTACHMENT1={name:"COLOR_ATTACHMENT1",value:36065,description:" "},p.COLOR_ATTACHMENT2={name:"COLOR_ATTACHMENT2",value:36066,description:" "},p.COLOR_ATTACHMENT3={name:"COLOR_ATTACHMENT3",value:36067,description:" "},p.COLOR_ATTACHMENT4={name:"COLOR_ATTACHMENT4",value:36068,description:" "},p.COLOR_ATTACHMENT5={name:"COLOR_ATTACHMENT5",value:36069,description:" "},p.COLOR_ATTACHMENT6={name:"COLOR_ATTACHMENT6",value:36070,description:" "},p.COLOR_ATTACHMENT7={name:"COLOR_ATTACHMENT7",value:36071,description:" "},p.COLOR_ATTACHMENT8={name:"COLOR_ATTACHMENT8",value:36072,description:" "},p.COLOR_ATTACHMENT9={name:"COLOR_ATTACHMENT9",value:36073,description:" "},p.COLOR_ATTACHMENT10={name:"COLOR_ATTACHMENT10",value:36074,description:" "},p.COLOR_ATTACHMENT11={name:"COLOR_ATTACHMENT11",value:36075,description:" "},p.COLOR_ATTACHMENT12={name:"COLOR_ATTACHMENT12",value:36076,description:" "},p.COLOR_ATTACHMENT13={name:"COLOR_ATTACHMENT13",value:36077,description:" "},p.COLOR_ATTACHMENT14={name:"COLOR_ATTACHMENT14",value:36078,description:" "},p.COLOR_ATTACHMENT15={name:"COLOR_ATTACHMENT15",value:36079,description:" "},p.SAMPLER_3D={name:"SAMPLER_3D",value:35679,description:" "},p.SAMPLER_2D_SHADOW={name:"SAMPLER_2D_SHADOW",value:35682,description:" "},p.SAMPLER_2D_ARRAY={name:"SAMPLER_2D_ARRAY",value:36289,description:" "},p.SAMPLER_2D_ARRAY_SHADOW={name:"SAMPLER_2D_ARRAY_SHADOW",value:36292,description:" "},p.SAMPLER_CUBE_SHADOW={name:"SAMPLER_CUBE_SHADOW",value:36293,description:" "},p.INT_SAMPLER_2D={name:"INT_SAMPLER_2D",value:36298,description:" "},p.INT_SAMPLER_3D={name:"INT_SAMPLER_3D",value:36299,description:" "},p.INT_SAMPLER_CUBE={name:"INT_SAMPLER_CUBE",value:36300,description:" "},p.INT_SAMPLER_2D_ARRAY={name:"INT_SAMPLER_2D_ARRAY",value:36303,description:" "},p.UNSIGNED_INT_SAMPLER_2D={name:"UNSIGNED_INT_SAMPLER_2D",value:36306,description:" "},p.UNSIGNED_INT_SAMPLER_3D={name:"UNSIGNED_INT_SAMPLER_3D",value:36307,description:" "},p.UNSIGNED_INT_SAMPLER_CUBE={name:"UNSIGNED_INT_SAMPLER_CUBE",value:36308,description:" "},p.UNSIGNED_INT_SAMPLER_2D_ARRAY={name:"UNSIGNED_INT_SAMPLER_2D_ARRAY",value:36311,description:" "},p.MAX_SAMPLES={name:"MAX_SAMPLES",value:36183,description:" "},p.SAMPLER_BINDING={name:"SAMPLER_BINDING",value:35097,description:" "},p.PIXEL_PACK_BUFFER={name:"PIXEL_PACK_BUFFER",value:35051,description:" "},p.PIXEL_UNPACK_BUFFER={name:"PIXEL_UNPACK_BUFFER",value:35052,description:" "},p.PIXEL_PACK_BUFFER_BINDING={name:"PIXEL_PACK_BUFFER_BINDING",value:35053,description:" "},p.PIXEL_UNPACK_BUFFER_BINDING={name:"PIXEL_UNPACK_BUFFER_BINDING",value:35055,description:" "},p.COPY_READ_BUFFER={name:"COPY_READ_BUFFER",value:36662,description:" "},p.COPY_WRITE_BUFFER={name:"COPY_WRITE_BUFFER",value:36663,description:" "},p.COPY_READ_BUFFER_BINDING={name:"COPY_READ_BUFFER_BINDING",value:36662,description:" "},p.COPY_WRITE_BUFFER_BINDING={name:"COPY_WRITE_BUFFER_BINDING",value:36663,description:" "},p.FLOAT_MAT2x3={name:"FLOAT_MAT2x3",value:35685,description:" "},p.FLOAT_MAT2x4={name:"FLOAT_MAT2x4",value:35686,description:" "},p.FLOAT_MAT3x2={name:"FLOAT_MAT3x2",value:35687,description:" "},p.FLOAT_MAT3x4={name:"FLOAT_MAT3x4",value:35688,description:" "},p.FLOAT_MAT4x2={name:"FLOAT_MAT4x2",value:35689,description:" "},p.FLOAT_MAT4x3={name:"FLOAT_MAT4x3",value:35690,description:" "},p.UNSIGNED_INT_VEC2={name:"UNSIGNED_INT_VEC2",value:36294,description:" "},p.UNSIGNED_INT_VEC3={name:"UNSIGNED_INT_VEC3",value:36295,description:" "},p.UNSIGNED_INT_VEC4={name:"UNSIGNED_INT_VEC4",value:36296,description:" "},p.UNSIGNED_NORMALIZED={name:"UNSIGNED_NORMALIZED",value:35863,description:" "},p.SIGNED_NORMALIZED={name:"SIGNED_NORMALIZED",value:36764,description:" "},p.VERTEX_ATTRIB_ARRAY_INTEGER={name:"VERTEX_ATTRIB_ARRAY_INTEGER",value:35069,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR={name:"VERTEX_ATTRIB_ARRAY_DIVISOR",value:35070,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_MODE={name:"TRANSFORM_FEEDBACK_BUFFER_MODE",value:35967,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",value:35968,description:" "},p.TRANSFORM_FEEDBACK_VARYINGS={name:"TRANSFORM_FEEDBACK_VARYINGS",value:35971,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_START={name:"TRANSFORM_FEEDBACK_BUFFER_START",value:35972,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_SIZE={name:"TRANSFORM_FEEDBACK_BUFFER_SIZE",value:35973,description:" "},p.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN={name:"TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",value:35976,description:" "},p.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",value:35978,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",value:35979,description:" "},p.INTERLEAVED_ATTRIBS={name:"INTERLEAVED_ATTRIBS",value:35980,description:" "},p.SEPARATE_ATTRIBS={name:"SEPARATE_ATTRIBS",value:35981,description:" "},p.TRANSFORM_FEEDBACK_BUFFER={name:"TRANSFORM_FEEDBACK_BUFFER",value:35982,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_BINDING={name:"TRANSFORM_FEEDBACK_BUFFER_BINDING",value:35983,description:" "},p.TRANSFORM_FEEDBACK={name:"TRANSFORM_FEEDBACK",value:36386,description:" "},p.TRANSFORM_FEEDBACK_PAUSED={name:"TRANSFORM_FEEDBACK_PAUSED",value:36387,description:" "},p.TRANSFORM_FEEDBACK_ACTIVE={name:"TRANSFORM_FEEDBACK_ACTIVE",value:36388,description:" "},p.TRANSFORM_FEEDBACK_BINDING={name:"TRANSFORM_FEEDBACK_BINDING",value:36389,description:" "},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",value:33296,description:" "},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",value:33297,description:" "},p.FRAMEBUFFER_ATTACHMENT_RED_SIZE={name:"FRAMEBUFFER_ATTACHMENT_RED_SIZE",value:33298,description:" "},p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE={name:"FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",value:33299,description:" "},p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE={name:"FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",value:33300,description:" "},p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE={name:"FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",value:33301,description:" "},p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE={name:"FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",value:33302,description:" "},p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE={name:"FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",value:33303,description:" "},p.FRAMEBUFFER_DEFAULT={name:"FRAMEBUFFER_DEFAULT",value:33304,description:" "},p.DEPTH24_STENCIL8={name:"DEPTH24_STENCIL8",value:35056,description:" "},p.DRAW_FRAMEBUFFER_BINDING={name:"DRAW_FRAMEBUFFER_BINDING",value:36006,description:" "},p.READ_FRAMEBUFFER={name:"READ_FRAMEBUFFER",value:36008,description:" "},p.DRAW_FRAMEBUFFER={name:"DRAW_FRAMEBUFFER",value:36009,description:" "},p.READ_FRAMEBUFFER_BINDING={name:"READ_FRAMEBUFFER_BINDING",value:36010,description:" "},p.RENDERBUFFER_SAMPLES={name:"RENDERBUFFER_SAMPLES",value:36011,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",value:36052,description:" "},p.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE={name:"FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",value:36182,description:" "},p.UNIFORM_BUFFER={name:"UNIFORM_BUFFER",value:35345,description:" "},p.UNIFORM_BUFFER_BINDING={name:"UNIFORM_BUFFER_BINDING",value:35368,description:" "},p.UNIFORM_BUFFER_START={name:"UNIFORM_BUFFER_START",value:35369,description:" "},p.UNIFORM_BUFFER_SIZE={name:"UNIFORM_BUFFER_SIZE",value:35370,description:" "},p.MAX_VERTEX_UNIFORM_BLOCKS={name:"MAX_VERTEX_UNIFORM_BLOCKS",value:35371,description:" "},p.MAX_FRAGMENT_UNIFORM_BLOCKS={name:"MAX_FRAGMENT_UNIFORM_BLOCKS",value:35373,description:" "},p.MAX_COMBINED_UNIFORM_BLOCKS={name:"MAX_COMBINED_UNIFORM_BLOCKS",value:35374,description:" "},p.MAX_UNIFORM_BUFFER_BINDINGS={name:"MAX_UNIFORM_BUFFER_BINDINGS",value:35375,description:" "},p.MAX_UNIFORM_BLOCK_SIZE={name:"MAX_UNIFORM_BLOCK_SIZE",value:35376,description:" "},p.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS={name:"MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",value:35377,description:" "},p.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",value:35379,description:" "},p.UNIFORM_BUFFER_OFFSET_ALIGNMENT={name:"UNIFORM_BUFFER_OFFSET_ALIGNMENT",value:35380,description:" "},p.ACTIVE_UNIFORM_BLOCKS={name:"ACTIVE_UNIFORM_BLOCKS",value:35382,description:" "},p.UNIFORM_TYPE={name:"UNIFORM_TYPE",value:35383,description:" "},p.UNIFORM_SIZE={name:"UNIFORM_SIZE",value:35384,description:" "},p.UNIFORM_BLOCK_INDEX={name:"UNIFORM_BLOCK_INDEX",value:35386,description:" "},p.UNIFORM_OFFSET={name:"UNIFORM_OFFSET",value:35387,description:" "},p.UNIFORM_ARRAY_STRIDE={name:"UNIFORM_ARRAY_STRIDE",value:35388,description:" "},p.UNIFORM_MATRIX_STRIDE={name:"UNIFORM_MATRIX_STRIDE",value:35389,description:" "},p.UNIFORM_IS_ROW_MAJOR={name:"UNIFORM_IS_ROW_MAJOR",value:35390,description:" "},p.UNIFORM_BLOCK_BINDING={name:"UNIFORM_BLOCK_BINDING",value:35391,description:" "},p.UNIFORM_BLOCK_DATA_SIZE={name:"UNIFORM_BLOCK_DATA_SIZE",value:35392,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORMS={name:"UNIFORM_BLOCK_ACTIVE_UNIFORMS",value:35394,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES={name:"UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",value:35395,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",value:35396,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",value:35398,description:" "},p.OBJECT_TYPE={name:"OBJECT_TYPE",value:37138,description:" "},p.SYNC_CONDITION={name:"SYNC_CONDITION",value:37139,description:" "},p.SYNC_STATUS={name:"SYNC_STATUS",value:37140,description:" "},p.SYNC_FLAGS={name:"SYNC_FLAGS",value:37141,description:" "},p.SYNC_FENCE={name:"SYNC_FENCE",value:37142,description:" "},p.SYNC_GPU_COMMANDS_COMPLETE={name:"SYNC_GPU_COMMANDS_COMPLETE",value:37143,description:" "},p.UNSIGNALED={name:"UNSIGNALED",value:37144,description:" "},p.SIGNALED={name:"SIGNALED",value:37145,description:" "},p.ALREADY_SIGNALED={name:"ALREADY_SIGNALED",value:37146,description:" "},p.TIMEOUT_EXPIRED={name:"TIMEOUT_EXPIRED",value:37147,description:" "},p.CONDITION_SATISFIED={name:"CONDITION_SATISFIED",value:37148,description:" "},p.WAIT_FAILED={name:"WAIT_FAILED",value:37149,description:" "},p.SYNC_FLUSH_COMMANDS_BIT={name:"SYNC_FLUSH_COMMANDS_BIT",value:1,description:" "},p.COLOR={name:"COLOR",value:6144,description:" "},p.DEPTH={name:"DEPTH",value:6145,description:" "},p.STENCIL={name:"STENCIL",value:6146,description:" "},p.MIN={name:"MIN",value:32775,description:" "},p.MAX={name:"MAX",value:32776,description:" "},p.DEPTH_COMPONENT24={name:"DEPTH_COMPONENT24",value:33190,description:" "},p.STREAM_READ={name:"STREAM_READ",value:35041,description:" "},p.STREAM_COPY={name:"STREAM_COPY",value:35042,description:" "},p.STATIC_READ={name:"STATIC_READ",value:35045,description:" "},p.STATIC_COPY={name:"STATIC_COPY",value:35046,description:" "},p.DYNAMIC_READ={name:"DYNAMIC_READ",value:35049,description:" "},p.DYNAMIC_COPY={name:"DYNAMIC_COPY",value:35050,description:" "},p.DEPTH_COMPONENT32F={name:"DEPTH_COMPONENT32F",value:36012,description:" "},p.DEPTH32F_STENCIL8={name:"DEPTH32F_STENCIL8",value:36013,description:" "},p.INVALID_INDEX={name:"INVALID_INDEX",value:4294967295,description:" "},p.TIMEOUT_IGNORED={name:"TIMEOUT_IGNORED",value:-1,description:" "},p.MAX_CLIENT_WAIT_TIMEOUT_WEBGL={name:"MAX_CLIENT_WAIT_TIMEOUT_WEBGL",value:37447,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE={name:"VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",value:35070,description:"Describes the frequency divisor used for instanced rendering.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_VENDOR_WEBGL={name:"UNMASKED_VENDOR_WEBGL",value:37445,description:"Passed to getParameter to get the vendor string of the graphics driver.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_RENDERER_WEBGL={name:"UNMASKED_RENDERER_WEBGL",value:37446,description:"Passed to getParameter to get the renderer string of the graphics driver.",extensionName:"WEBGL_debug_renderer_info"},p.MAX_TEXTURE_MAX_ANISOTROPY_EXT={name:"MAX_TEXTURE_MAX_ANISOTROPY_EXT",value:34047,description:"Returns the maximum available anisotropy.",extensionName:"EXT_texture_filter_anisotropic"},p.TEXTURE_MAX_ANISOTROPY_EXT={name:"TEXTURE_MAX_ANISOTROPY_EXT",value:34046,description:"Passed to texParameter to set the desired maximum anisotropy for a texture.",extensionName:"EXT_texture_filter_anisotropic"},p.COMPRESSED_RGB_S3TC_DXT1_EXT={name:"COMPRESSED_RGB_S3TC_DXT1_EXT",value:33776,description:"A DXT1-compressed image in an RGB image format.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT1_EXT={name:"COMPRESSED_RGBA_S3TC_DXT1_EXT",value:33777,description:"A DXT1-compressed image in an RGB image format with a simple on/off alpha value.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT3_EXT={name:"COMPRESSED_RGBA_S3TC_DXT3_EXT",value:33778,description:"A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT5_EXT={name:"COMPRESSED_RGBA_S3TC_DXT5_EXT",value:33779,description:"A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_R11_EAC={name:"COMPRESSED_R11_EAC",value:37488,description:"One-channel (red) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_R11_EAC={name:"COMPRESSED_SIGNED_R11_EAC",value:37489,description:"One-channel (red) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RG11_EAC={name:"COMPRESSED_RG11_EAC",value:37490,description:"Two-channel (red and green) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_RG11_EAC={name:"COMPRESSED_SIGNED_RG11_EAC",value:37491,description:"Two-channel (red and green) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_ETC2={name:"COMPRESSED_RGB8_ETC2",value:37492,description:"Compresses RBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGBA8_ETC2_EAC={name:"COMPRESSED_RGBA8_ETC2_EAC",value:37493,description:"Compresses RGBA8 data. The RGB part is encoded the same as RGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ETC2={name:"COMPRESSED_SRGB8_ETC2",value:37494,description:"Compresses sRBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC={name:"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",value:37495,description:"Compresses sRGBA8 data. The sRGB part is encoded the same as SRGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37496,description:"Similar to RGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37497,description:"Similar to SRGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_4BPPV1_IMG",value:35840,description:"RGB compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",value:35842,description:"RGBA compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_2BPPV1_IMG",value:35841,description:"RGB compression in 2-bit mode. One block for each 8×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",value:35843,description:"RGBA compression in 2-bit mode. One block for each 8×4 pixe",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_ETC1_WEBGL={name:"COMPRESSED_RGB_ETC1_WEBGL",value:36196,description:"Compresses 24-bit RGB data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc1"},p.COMPRESSED_RGB_ATC_WEBGL={name:"COMPRESSED_RGB_ATC_WEBGL",value:35986,description:"Compresses RGB textures with no alpha channel.",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",value:35986,description:"Compresses RGBA textures using explicit alpha encoding (useful when alpha transitions are sharp).",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",value:34798,description:"Compresses RGBA textures using interpolated alpha encoding (useful when alpha transitions are gradient).",extensionName:"WEBGL_compressed_texture_atc"},p.UNSIGNED_INT_24_8_WEBGL={name:"UNSIGNED_INT_24_8_WEBGL",value:34042,description:"Unsigned integer type for 24-bit depth texture data.",extensionName:"WEBGL_depth_texture"},p.HALF_FLOAT_OES={name:"HALF_FLOAT_OES",value:36193,description:"Half floating-point type (16-bit).",extensionName:"OES_texture_half_float"},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",value:33297,description:" ",extensionName:"WEBGL_color_buffer_float"},p.UNSIGNED_NORMALIZED_EXT={name:"UNSIGNED_NORMALIZED_EXT",value:35863,description:" ",extensionName:"WEBGL_color_buffer_float"},p.MIN_EXT={name:"MIN_EXT",value:32775,description:"Produces the minimum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.MAX_EXT={name:"MAX_EXT",value:32776,description:"Produces the maximum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.SRGB_EXT={name:"SRGB_EXT",value:35904,description:"Unsized sRGB format that leaves the precision up to the driver.",extensionName:"EXT_sRGB"},p.SRGB_ALPHA_EXT={name:"SRGB_ALPHA_EXT",value:35906,description:"Unsized sRGB format with unsized alpha component.",extensionName:"EXT_sRGB"},p.SRGB8_ALPHA8_EXT={name:"SRGB8_ALPHA8_EXT",value:35907,description:"Sized (8-bit) sRGB and alpha formats.",extensionName:"EXT_sRGB"},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",value:33296,description:"Returns the framebuffer color encoding.",extensionName:"EXT_sRGB"},p.FRAGMENT_SHADER_DERIVATIVE_HINT_OES={name:"FRAGMENT_SHADER_DERIVATIVE_HINT_OES",value:35723,description:"Indicates the accuracy of the derivative calculation for the GLSL built-in functions: dFdx, dFdy, and fwidth.",extensionName:"OES_standard_derivatives"},p.COLOR_ATTACHMENT0_WEBGL={name:"COLOR_ATTACHMENT0_WEBGL",value:36064,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT1_WEBGL={name:"COLOR_ATTACHMENT1_WEBGL",value:36065,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT2_WEBGL={name:"COLOR_ATTACHMENT2_WEBGL",value:36066,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT3_WEBGL={name:"COLOR_ATTACHMENT3_WEBGL",value:36067,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT4_WEBGL={name:"COLOR_ATTACHMENT4_WEBGL",value:36068,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT5_WEBGL={name:"COLOR_ATTACHMENT5_WEBGL",value:36069,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT6_WEBGL={name:"COLOR_ATTACHMENT6_WEBGL",value:36070,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT7_WEBGL={name:"COLOR_ATTACHMENT7_WEBGL",value:36071,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT8_WEBGL={name:"COLOR_ATTACHMENT8_WEBGL",value:36072,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT9_WEBGL={name:"COLOR_ATTACHMENT9_WEBGL",value:36073,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT10_WEBGL={name:"COLOR_ATTACHMENT10_WEBGL",value:36074,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT11_WEBGL={name:"COLOR_ATTACHMENT11_WEBGL",value:36075,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT12_WEBGL={name:"COLOR_ATTACHMENT12_WEBGL",value:36076,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT13_WEBGL={name:"COLOR_ATTACHMENT13_WEBGL",value:36077,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT14_WEBGL={name:"COLOR_ATTACHMENT14_WEBGL",value:36078,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT15_WEBGL={name:"COLOR_ATTACHMENT15_WEBGL",value:36079,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER0_WEBGL={name:"DRAW_BUFFER0_WEBGL",value:34853,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER1_WEBGL={name:"DRAW_BUFFER1_WEBGL",value:34854,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER2_WEBGL={name:"DRAW_BUFFER2_WEBGL",value:34855,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER3_WEBGL={name:"DRAW_BUFFER3_WEBGL",value:34856,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER4_WEBGL={name:"DRAW_BUFFER4_WEBGL",value:34857,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER5_WEBGL={name:"DRAW_BUFFER5_WEBGL",value:34858,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER6_WEBGL={name:"DRAW_BUFFER6_WEBGL",value:34859,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER7_WEBGL={name:"DRAW_BUFFER7_WEBGL",value:34860,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER8_WEBGL={name:"DRAW_BUFFER8_WEBGL",value:34861,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER9_WEBGL={name:"DRAW_BUFFER9_WEBGL",value:34862,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER10_WEBGL={name:"DRAW_BUFFER10_WEBGL",value:34863,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER11_WEBGL={name:"DRAW_BUFFER11_WEBGL",value:34864,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER12_WEBGL={name:"DRAW_BUFFER12_WEBGL",value:34865,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER13_WEBGL={name:"DRAW_BUFFER13_WEBGL",value:34866,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER14_WEBGL={name:"DRAW_BUFFER14_WEBGL",value:34867,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER15_WEBGL={name:"DRAW_BUFFER15_WEBGL",value:34868,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.MAX_COLOR_ATTACHMENTS_WEBGL={name:"MAX_COLOR_ATTACHMENTS_WEBGL",value:36063,description:"Maximum number of framebuffer color attachment points",extensionName:"WEBGL_draw_buffers"},p.MAX_DRAW_BUFFERS_WEBGL={name:"MAX_DRAW_BUFFERS_WEBGL",value:34852,description:"Maximum number of draw buffers",extensionName:"WEBGL_draw_buffers"},p.VERTEX_ARRAY_BINDING_OES={name:"VERTEX_ARRAY_BINDING_OES",value:34229,description:"The bound vertex array object (VAO).",extensionName:"VERTEX_ARRAY_BINDING_OES"},p.QUERY_COUNTER_BITS_EXT={name:"QUERY_COUNTER_BITS_EXT",value:34916,description:"The number of bits used to hold the query result for the given target.",extensionName:"EXT_disjoint_timer_query"},p.CURRENT_QUERY_EXT={name:"CURRENT_QUERY_EXT",value:34917,description:"The currently active query.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_EXT={name:"QUERY_RESULT_EXT",value:34918,description:"The query result.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_AVAILABLE_EXT={name:"QUERY_RESULT_AVAILABLE_EXT",value:34919,description:"A Boolean indicating whether or not a query result is available.",extensionName:"EXT_disjoint_timer_query"},p.TIME_ELAPSED_EXT={name:"TIME_ELAPSED_EXT",value:35007,description:"Elapsed time (in nanoseconds).",extensionName:"EXT_disjoint_timer_query"},p.TIMESTAMP_EXT={name:"TIMESTAMP_EXT",value:36392,description:"The current time.",extensionName:"EXT_disjoint_timer_query"},p.GPU_DISJOINT_EXT={name:"GPU_DISJOINT_EXT",value:36795,description:"A Boolean indicating whether or not the GPU performed any disjoint operation.",extensionName:"EXT_disjoint_timer_query"},p.zeroMeaningByCommand={getError:"NO_ERROR",blendFunc:"ZERO",blendFuncSeparate:"ZERO",readBuffer:"NONE",getFramebufferAttachmentParameter:"NONE",texParameterf:"NONE",texParameteri:"NONE",drawArrays:"POINTS",drawElements:"POINTS",drawArraysInstanced:"POINTS",drawArraysInstancedAngle:"POINTS",drawBuffers:"POINTS",drawElementsInstanced:"POINTS",drawRangeElements:"POINTS"},p.oneMeaningByCommand={blendFunc:"ONE",blendFuncSeparate:"ONE",drawArrays:"LINES",drawElements:"LINES",drawArraysInstanced:"LINES",drawArraysInstancedAngle:"LINES",drawBuffers:"LINES",drawElementsInstanced:"LINES",drawRangeElements:"LINES"};const m={},g={};!function(){for(const e in p)if(p.hasOwnProperty(e)){const t=p[e];m[t.name]=t,g[t.value]=t}}();class E extends c{get analyserName(){return E.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={total:0,totalTriangles:0,totalTriangleStrip:0,totalTriangleFan:0,totalLines:0,totalLineStrip:0,totalLineLoop:0,totalPoints:0};for(const t of e.commands)"drawArrays"===t.name&&t.commandArguments.length>=3||"drawArraysInstanced"===t.name&&t.commandArguments.length>=3||"drawArraysInstancedANGLE"===t.name&&t.commandArguments.length>=3?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[2]):"drawElements"===t.name&&t.commandArguments.length>=2||"drawElementsInstanced"===t.name&&t.commandArguments.length>=2||"drawElementsInstancedANGLE"===t.name&&t.commandArguments.length>=2?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[1]):"drawRangeElements"===t.name&&t.commandArguments.length>=4&&this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[3]);t.total=n.total,t.triangles=n.totalTriangles,t.triangleStrip=n.totalTriangleStrip,t.triangleFan=n.totalTriangleFan,t.lines=n.totalLines,t.lineStrip=n.totalLineStrip,t.lineLoop=n.totalLineLoop,t.points=n.totalPoints}appendToPrimitives(e,t,n){t===p.POINTS.value?e.totalPoints+=n:t===p.LINES.value?e.totalLines+=n:t===p.LINE_STRIP.value?e.totalLineStrip+=n:t===p.LINE_LOOP.value?e.totalLineLoop+=n:t===p.TRIANGLES.value?e.totalTriangles+=n:t===p.TRIANGLE_STRIP.value?e.totalTriangleStrip+=n:t===p.TRIANGLE_FAN.value&&(e.totalTriangleFan+=n),e.total+=n}}E.analyserName="Primitives";class v{constructor(e){this.contextInformation=e,this.analysers=[],this.initAnalysers()}appendAnalyses(e){for(const t in this.analysers)this.analysers.hasOwnProperty(t)&&this.analysers[t].appendAnalysis(e)}initAnalysers(){this.analysers.push(new h(this.contextInformation),new f(this.contextInformation),new E(this.contextInformation))}}class C{static getStackTrace(e=0,t=0){const n=[];try{throw new Error("Errorator.")}catch(e){if(e.stack){const t=e.stack.split("\n");for(let e=0,r=t.length;e0;t++)n.shift();for(let e=0;e0;e++)n.pop()}return n}}class D{static getWebGlObjectTag(e){return e[D.SPECTOROBJECTTAGKEY]}static attachWebGlObjectTag(e,t){t.displayText=D.stringifyWebGlObjectTag(t),e[D.SPECTOROBJECTTAGKEY]=t}static stringifyWebGlObjectTag(e){return e?`${e.typeName} - ID: ${e.id}`:"No tag available."}}D.SPECTOROBJECTTAGKEY="__SPECTOR_Object_TAG";class S{get type(){return("undefined"!=typeof globalThis?globalThis:self)[this.typeName]||null}constructor(){this.id=0}tagWebGlObject(e){if(!this.type)return;let t;if(!e)return t;if(t=D.getWebGlObjectTag(e),t)return t;if(e instanceof this.type){const n=this.getNextId();return t={typeName:this.typeName,id:n},D.attachWebGlObjectTag(e,t),t}return t}getNextId(){return this.id++}}class A{constructor(e){this.options=e}createCapture(e,t,n){const r=C.getStackTrace(4,1),i=0===e.name.indexOf("uniform")?this.stringifyUniform(e.arguments):this.stringify(e.arguments,e.result),s={id:t,startTime:e.startTime,commandEndTime:e.endTime,endTime:0,name:e.name,commandArguments:e.arguments,result:e.result,stackTrace:r,status:0,marker:n,text:i};this.transformCapture(s);for(let e=0;e50&&(s.commandArguments[e]="Array Length: "+t.length)}if(s.commandArguments){const e=[];for(let t=0;t0&&(n+=": "+this.stringifyArgs(e).join(", ")),null!=t&&(n+=" -> "+this.stringifyResult(t)),n}stringifyUniform(e){let t=this.spiedCommandName;if(e&&e.length>0){const n=[];n.push(this.stringifyValue(e[0]));for(let t=1;t0&&"number"==typeof s)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");else{const e=this.stringifyValue(s);r.push(e)}}return r}}_.commandName="bufferSubData";class y{static storeOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]||(e[n]=e[t])}static resetOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]&&(e[t]=e[n],delete e[n])}static storePrototypeOriginFunction(e,t){if(!e)return;if(!e.prototype[t])return;const n=this.getOriginFunctionName(t);e.prototype[n]||(e.prototype[n]=e.prototype[t])}static executePrototypeOriginFunction(e,t,n,r){if(!e)return;const i=this.getOriginFunctionName(n);return t.prototype[i]?(e[i]||(e[i]=t.prototype[i]),this.executeFunction(e,i,r)):void 0}static executeOriginFunction(e,t,n){if(!e)return;const r=this.getOriginFunctionName(t);return e[r]?this.executeFunction(e,r,n):void 0}static executeFunction(e,t,n){const r=n;if(void 0===r||0===r.length)return e[t]();switch(r.length){case 1:return e[t](r[0]);case 2:return e[t](r[0],r[1]);case 3:return e[t](r[0],r[1],r[2]);case 4:return e[t](r[0],r[1],r[2],r[3]);case 5:return e[t](r[0],r[1],r[2],r[3],r[4]);case 6:return e[t](r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6]);case 8:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]);case 9:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8]);case 10:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9]);case 11:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10]);case 12:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11]);case 13:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12]);case 14:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13]);case 15:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14]);case 16:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);case 17:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16]);case 18:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17]);case 19:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18]);case 20:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19]);default:return e[t].apply(e,r)}}static getOriginFunctionName(e){return this.originFunctionPrefix+e}}y.originFunctionPrefix="__SPECTOR_Origin_";class b extends A{get spiedCommandName(){return b.commandName}stringifyArgs(e){const t=[];if(e.length>0){const n=e[0],r=this.stringifyValue(n);t.push(r)}if(e.length>1){const n=""+e[1];t.push(n)}return e.length>2&&t.push(e[2]),t}}b.commandName="bindAttribLocation";class T extends A{get spiedCommandName(){return T.commandName}stringifyArgs(e){const t=[],n=this.options.context.getParameter(p.READ_FRAMEBUFFER_BINDING.value),r=this.options.tagWebGlObject(n);t.push("READ FROM: "+this.stringifyValue(r));const i=this.options.context.getParameter(p.DRAW_FRAMEBUFFER_BINDING.value),s=this.options.tagWebGlObject(i);t.push("WRITE TO: "+this.stringifyValue(s));for(let n=0;n<8;n++)t.push(e[n]);return(e[8]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[8]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[8]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t.push(p.stringifyWebGlConstant(e[9],"blitFrameBuffer")),t}}T.commandName="blitFrameBuffer";class R extends A{get spiedCommandName(){return R.commandName}stringifyArgs(e){const t=[];return(e[0]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[0]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[0]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t}}R.commandName="clear";class x{static getProgramData(e,t){const n={LINK_STATUS:e.getProgramParameter(t,p.LINK_STATUS.value),VALIDATE_STATUS:e.getProgramParameter(t,p.VALIDATE_STATUS.value),infoLog:e.getProgramInfoLog(t)||""},r=e.getAttachedShaders(t)||[],i=new Array(2);let s=0;for(const t of r){const n=this.getShaderData(e,t);s+=n.source.length,n.shaderType===p.FRAGMENT_SHADER.name?i[1]=n:i[0]=n}return{programStatus:n,shaders:i,length:s}}static getShaderData(e,t){const n=e.getShaderSource(t)||"",r=e.getExtension("WEBGL_debug_shaders"),i=r?r.getTranslatedShaderSource(t):null,s=e.getShaderParameter(t,p.SHADER_TYPE.value)===p.FRAGMENT_SHADER.value;let o=t&&t.__SPECTOR_Metadata&&t.__SPECTOR_Metadata.name?t.__SPECTOR_Metadata.name:this.readNameFromShaderSource(n);return o||(o=s?"Fragment":"Vertex"),{COMPILE_STATUS:e.getShaderParameter(t,p.COMPILE_STATUS.value),shaderType:s?p.FRAGMENT_SHADER.name:p.VERTEX_SHADER.name,name:o,source:n,translatedSource:i,infoLog:e.getShaderInfoLog(t)||""}}static readNameFromShaderSource(e){try{let t,n="";const r=/#define[\s]+SHADER_NAME[\s]+([\S]+)(\n|$)/gi;if(t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),""===n){const r=/#define[\s]+SHADER_NAME_B64[\s]+([\S]+)(\n|$)/gi;t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),n&&(n=decodeURIComponent(atob(n)))}return n}catch(e){return null}}}class w extends A{constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.shader=x.getShaderData(this.options.context,t)}finally{n&&n(!0)}}getShaderDisplayText(e){return this.stringifyValue(e.commandArguments[0])}}class F extends w{get spiedCommandName(){return F.commandName}transformCapture(e){if(super.transformCapture(e),e.shader){const t=e.shader.COMPILE_STATUS?"compiled":"failed";e.text=`${this.spiedCommandName}: ${this.getShaderDisplayText(e)} -> ${t}`}}}F.commandName="compileShader";const N=["lineWidth"];class L extends A{get spiedCommandName(){return this.internalSpiedCommandName}constructor(e,t){super(e),this.internalSpiedCommandName=t,this.isDeprecated=N.indexOf(this.spiedCommandName)>-1}transformCapture(e){this.isDeprecated&&(e.status=50)}}class O extends A{get spiedCommandName(){return O.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}O.commandName="disableVertexAttribArray";class I extends A{get spiedCommandName(){return I.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(e[1]+" indices"),t.push(e[2]),t}}I.commandName="drawArrays";class k extends A{get spiedCommandName(){return k.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}k.commandName="drawArraysInstanced";class M extends A{get spiedCommandName(){return M.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstancedANGLE")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}M.commandName="drawArraysInstancedANGLE";class P extends A{get spiedCommandName(){return P.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElements")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElements")),t.push(e[3]),t}}P.commandName="drawElements";class B extends A{get spiedCommandName(){return B.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstancedANGLE")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstancedANGLE")),t.push(e[3]),t.push(e[4]),t}}B.commandName="drawElementsInstancedANGLE";class U extends A{get spiedCommandName(){return U.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t}}U.commandName="drawElementsInstanced";class $ extends A{get spiedCommandName(){return $.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawRangeElements")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(p.stringifyWebGlConstant(e[4],"drawRangeElements")),t.push(e[5]),t}}$.commandName="drawRangeElements";class G extends A{get spiedCommandName(){return G.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}G.commandName="getActiveAttrib";class V extends A{get spiedCommandName(){return V.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}V.commandName="getActiveUniform";class W extends A{get spiedCommandName(){return W.commandName}stringifyResult(e){var t;if(null!=e)return null!==(t=null==e?void 0:e.toFixed(0))&&void 0!==t?t:"0"}}W.commandName="getAttribLocation";class H extends A{get spiedCommandName(){return H.commandName}stringifyResult(e){return e?"true":"false"}}H.commandName="getExtension";class j extends A{get spiedCommandName(){return j.commandName}stringifyResult(e){if(!e)return"null";const t=D.getWebGlObjectTag(e);return t?t.displayText:e}}j.commandName="getParameter";class z extends A{get spiedCommandName(){return z.commandName}stringifyResult(e){if(e)return`min: ${e.rangeMin}, max: ${e.rangeMax}, precision: ${e.precision}`}}z.commandName="getShaderPrecisionFormat";class X extends w{get spiedCommandName(){return X.commandName}stringifyResult(e){if("string"!=typeof e||0===e.trim().length)return"No messages";const t=e.split(/\r?\n/).filter(e=>e.trim().length>0).length;return t+(1===t?" message":" messages")}}X.commandName="getShaderInfoLog";class K extends A{get spiedCommandName(){return K.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}K.commandName="getTransformFeedbackVarying";class Y extends A{get spiedCommandName(){return Y.commandName}constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.program=x.getProgramData(this.options.context,t)}finally{n&&n(!0)}const r=e.program.programStatus.LINK_STATUS?"linked":"failed";e.text=`${this.spiedCommandName}: ${this.stringifyValue(t)} -> ${r}`}}Y.commandName="linkProgram";class q extends A{get spiedCommandName(){return q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"multiDrawArraysInstancedBaseInstanceWEBGL")),t.push(`drawCount=${e[9]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t}}q.commandName="multiDrawArraysInstancedBaseInstanceWEBGL";class Q extends A{get spiedCommandName(){return Q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[7]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t}}Q.commandName="multiDrawArraysInstancedWEBGL";class Z extends A{get spiedCommandName(){return Z.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[5]}`),t.push(e[2]),t.push(e[4]),t}}Z.commandName="multiDrawArraysWEBGL";class J extends A{get spiedCommandName(){return J.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[11]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t.push(e[10]),t}}J.commandName="multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL";class ee extends A{get spiedCommandName(){return ee.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[8]}`),t.push(e[2]),t.push(e[5]),t.push(e[7]),t}}ee.commandName="multiDrawElementsInstancedWEBGL";class te extends A{get spiedCommandName(){return te.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[6]}`),t.push(e[2]),t.push(e[5]),t}}te.commandName="multiDrawElementsWEBGL";class ne extends A{get spiedCommandName(){return ne.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(`baseInstance = ${e[4]}`),t}}ne.commandName="drawArraysInstancedBaseInstanceWEBGL";class re extends A{get spiedCommandName(){return re.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t.push(`baseVertex = ${e[5]}`),t.push(`baseInstance = ${e[6]}`),t}}re.commandName="drawElementsInstancedBaseVertexBaseInstanceWEBGL";class ie extends A{get spiedCommandName(){return ie.commandName}stringifyArgs(e){var t,n;const r=[];for(let i=0;i<4;i++)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");return r}}function se(e){return null==e?"":`${e.toFixed(0)} (0b${(e>>>0).toString(2)})`}ie.commandName="scissor";class oe extends A{get spiedCommandName(){return oe.commandName}stringifyArgs(e){const t=[];return t.push(se(e[0])),t}}oe.commandName="stencilMask";class ae extends A{get spiedCommandName(){return ae.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilMaskSeparate")),t.push(se(e[1])),t}}ae.commandName="stencilMaskSeparate";class le extends A{get spiedCommandName(){return le.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFunc")),t.push(se(e[1])),t.push(se(e[2])),t}}le.commandName="stencilFunc";class ue extends A{get spiedCommandName(){return ue.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFuncSeparate")),t.push(p.stringifyWebGlConstant(e[1],"stencilFuncSeparate")),t.push(se(e[2])),t.push(se(e[3])),t}}ue.commandName="stencilFuncSeparate";class ce extends A{get spiedCommandName(){return ce.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t.push(e[1]),t.push(p.stringifyWebGlConstant(e[2],"vertexAttribPointer")),t.push(e[3]),t.push(e[4]),t.push(e[5]),t}}ce.commandName="vertexAttribPointer";class he extends A{get spiedCommandName(){return he.commandName}stringifyArgs(e){const t=[];for(let n=0;n<4;n++)t.push(e[n].toFixed(0));return t}}he.commandName="viewport";class de extends A{get spiedCommandName(){return de.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}de.commandName="enableVertexAttribArray";class fe extends w{get spiedCommandName(){return fe.commandName}stringifyArgs(e){const t="string"==typeof e[1]?e[1]:"";return[this.stringifyValue(e[0]),t.length+" chars"]}transformCapture(e){super.transformCapture(e);const t=e.commandArguments[1];e.shader&&"string"==typeof t&&(e.shader.source=t,e.shader.COMPILE_STATUS=null,e.shader.translatedSource="",e.shader.infoLog="")}}fe.commandName="shaderSource";class pe{constructor(e){this.spiedCommandName=e.spiedCommandName,this.spiedCommandRunningContext=e.spiedCommandRunningContext,this.spiedCommand=this.spiedCommandRunningContext[this.spiedCommandName],y.storeOriginFunction(this.spiedCommandRunningContext,this.spiedCommandName),this.callback=e.callback,this.commandOptions={context:e.context,contextVersion:e.contextVersion,extensions:e.extensions,toggleCapture:e.toggleCapture},this.initCustomCommands(),this.initCommand()}spy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.overloadedCommand}unSpy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.spiedCommand}createCapture(e,t,n){return this.command.createCapture(e,t,n)}initCommand(){pe.customCommandsConstructors[this.spiedCommandName]?this.command=pe.customCommandsConstructors[this.spiedCommandName](this.commandOptions):this.command=new L(this.commandOptions,this.spiedCommandName),this.overloadedCommand=this.getSpy()}getSpy(){const e=this;return function(){const t=u.now,n=y.executeOriginFunction(e.spiedCommandRunningContext,e.spiedCommandName,arguments),r=u.now;try{const i={name:e.spiedCommandName,arguments,result:n,startTime:t,endTime:r};e.callback(e,i)}catch(e){}return n}}initCustomCommands(){pe.customCommandsConstructors||(pe.customCommandsConstructors={[b.commandName]:e=>new b(e),[T.commandName]:e=>new T(e),[_.commandName]:e=>new _(e),[R.commandName]:e=>new R(e),[F.commandName]:e=>new F(e),[O.commandName]:e=>new O(e),[I.commandName]:e=>new I(e),[k.commandName]:e=>new k(e),[M.commandName]:e=>new M(e),[P.commandName]:e=>new P(e),[U.commandName]:e=>new U(e),[B.commandName]:e=>new B(e),[$.commandName]:e=>new $(e),[G.commandName]:e=>new G(e),[V.commandName]:e=>new V(e),[W.commandName]:e=>new W(e),[H.commandName]:e=>new H(e),[j.commandName]:e=>new j(e),[X.commandName]:e=>new X(e),[z.commandName]:e=>new z(e),[K.commandName]:e=>new K(e),[Y.commandName]:e=>new Y(e),[q.commandName]:e=>new q(e),[Q.commandName]:e=>new Q(e),[Z.commandName]:e=>new Z(e),[J.commandName]:e=>new J(e),[ee.commandName]:e=>new ee(e),[te.commandName]:e=>new te(e),[ne.commandName]:e=>new ne(e),[re.commandName]:e=>new re(e),[ie.commandName]:e=>new ie(e),[fe.commandName]:e=>new fe(e),[oe.commandName]:e=>new oe(e),[ae.commandName]:e=>new ae(e),[le.commandName]:e=>new le(e),[ue.commandName]:e=>new ue(e),[ce.commandName]:e=>new ce(e),[he.commandName]:e=>new he(e),[de.commandName]:e=>new de(e)})}}class me{constructor(e){this.options=e,this.context=e.context,this.contextVersion=e.contextVersion,this.extensions=e.extensions,this.toggleCapture=e.toggleCapture,this.consumeCommands=this.getConsumeCommands(),this.changeCommandsByState=this.getChangeCommandsByState(),this.commandNameToStates=this.getCommandNameToStates()}get requireStartAndStopStates(){return!0}startCapture(e,t,n){return this.quickCapture=t,this.fullCapture=n,this.capturedCommandsByState={},e&&this.requireStartAndStopStates&&(this.currentState={},this.readFromContextNoSideEffects()),this.copyCurrentStateToPrevious(),this.currentState={},this.previousState}stopCapture(){return this.requireStartAndStopStates&&this.readFromContextNoSideEffects(),this.analyse(void 0),this.currentState}registerCallbacks(e){for(const t in this.changeCommandsByState)if(this.changeCommandsByState.hasOwnProperty(t))for(const n of this.changeCommandsByState[t])e[n]=e[n]||[],e[n].push(this.onChangeCommand.bind(this));for(const t of this.consumeCommands)e[t]=e[t]||[],e[t].push(this.onConsumeCommand.bind(this))}getStateData(){return this.currentState}getConsumeCommands(){return[]}getChangeCommandsByState(){return{}}copyCurrentStateToPrevious(){this.currentState&&(this.previousState=this.currentState)}onChangeCommand(e){const t=this.commandNameToStates[e.name];for(const n of t){if(!this.isValidChangeCommand(e,n))return;this.capturedCommandsByState[n]=this.capturedCommandsByState[n]||[],this.capturedCommandsByState[n].push(e)}}isValidChangeCommand(e,t){return!0}onConsumeCommand(e){this.isValidConsumeCommand(e)&&(this.readFromContextNoSideEffects(),this.analyse(e),this.storeCommandIds(),e[this.stateName]=this.currentState,this.startCapture(!1,this.quickCapture,this.fullCapture))}isValidConsumeCommand(e){return this.lastCommandName=null==e?void 0:e.name,!0}analyse(e){for(const t in this.capturedCommandsByState)if(this.capturedCommandsByState.hasOwnProperty(t)){const n=this.capturedCommandsByState[t],r=n.length-1;if(r>=0)if(e){for(let t=0;t1&&this.parameters.push(this.getWebgl2Parameters());const e={};for(let t=1;t<=this.contextVersion&&!(t>this.parameters.length);t++)if(this.parameters[t-1])for(const n of this.parameters[t-1])if(n.changeCommands)for(const t of n.changeCommands)e[n.constant.name]=e[n.constant.name]||[],e[n.constant.name].push(t);return e}readFromContext(){for(let e=1;e<=this.contextVersion&&!(e>this.parameters.length);e++)for(const t of this.parameters[e-1]){const e=this.readParameterFromContext(t);if(null==e){const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n;continue}const n=D.getWebGlObjectTag(e);if(n)this.currentState[t.constant.name]=n;else{const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n}}}readParameterFromContext(e){return e.constant.extensionName&&!this.extensions[e.constant.extensionName]?`Extension ${e.constant.extensionName} is unavailable.`:this.context.getParameter(e.constant.value)}stringifyParameterValue(e,t){if(null===e)return"null";if(void 0===e)return"undefined";if(30===t.returnType)return se(e);if("number"==typeof e&&p.isWebGlConstant(e)){if(20===t.returnType){const n=t.changeCommands&&t.changeCommands[0]||"";return p.stringifyWebGlConstant(e,n)}return e}if(e.length&&"string"!=typeof e){const t=[];for(let n=0;n1?r=this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value):this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.value)===p.RENDERBUFFER.value&&(r=e.getRenderbufferParameter(e.RENDERBUFFER,e.RENDERBUFFER_STENCIL_SIZE))):r=this.readParameterFromContext({constant:p.STENCIL_BITS}),this.currentState[p.STENCIL_BITS.name]=""+r}isValidChangeCommand(e,t){return"enable"===e.name||"disable"===e.name?e.commandArguments[0]===p.STENCIL_TEST.value:"stencilOp"===e.name||"stencilOpSeparate"===e.name?xe.stencilOpStates.indexOf(e.commandArguments[0])>0:"stencilFunc"===e.name||"stencilFuncSeparate"===e.name?xe.stencilFuncStates.indexOf(e.commandArguments[0])>0:"stencilMask"!==e.name&&"stencilMaskSeparate"!==e.name||xe.stencilMaskStates.indexOf(e.commandArguments[0])>0}getConsumeCommands(){return d}isStateEnable(e,t){return this.context.isEnabled(p.STENCIL_TEST.value)}}xe.stateName="StencilState",xe.stencilOpStates=[p.STENCIL_BACK_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_PASS.value,p.STENCIL_FAIL.value,p.STENCIL_PASS_DEPTH_FAIL.value,p.STENCIL_PASS_DEPTH_PASS.value],xe.stencilFuncStates=[p.STENCIL_BACK_FUNC.value,p.STENCIL_BACK_REF.value,p.STENCIL_BACK_VALUE_MASK.value,p.STENCIL_FUNC.value,p.STENCIL_REF.value,p.STENCIL_VALUE_MASK.value],xe.stencilMaskStates=[p.STENCIL_BACK_WRITEMASK.value,p.STENCIL_WRITEMASK.value];class we{static isSupportedCombination(e,t,n){return e=e||p.UNSIGNED_BYTE.value,((t=t||p.RGBA.value)===p.RGB.value||t===p.RGBA.value)&&(n===p.RGB.value||n===p.RGBA.value||n===p.RGBA8.value||n===p.RGBA16F.value||n===p.RGBA32F.value||n===p.RGB16F.value||n===p.RGB32F.value||n===p.R11F_G11F_B10F.value||n===p.SRGB8.value||n===p.SRGB8_ALPHA8.value)&&this.isSupportedComponentType(e)}static readPixels(e,t,n,r,i,s){e.getError(),s===p.UNSIGNED_NORMALIZED.value&&(s=p.UNSIGNED_BYTE.value);const o=r*i*4;let a;if(s===p.UNSIGNED_BYTE.value?a=new Uint8Array(o):(s=p.FLOAT.value,a=new Float32Array(o)),e.readPixels(t,n,r,i,e.RGBA,s,a),e.getError())return;if(s===p.UNSIGNED_BYTE.value)return a;const l=new Uint8Array(r*i*4);for(let e=0;e1){const e=this.context.getParameter(p.MAX_DRAW_BUFFERS.value);for(let n=0;n1?this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value):p.UNSIGNED_BYTE.value;l===p.RENDERBUFFER.value?this.readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,c,u):l===p.TEXTURE.value&&this.readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,c,u)}readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,l,u){let c=0,h=0;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,c=e.samples,h=e.internalFormat,!c&&!we.isSupportedCombination(l,p.RGBA.value,h))return}else s+=r,o+=i;if(r=i=0,c){const a=e,u=e.createRenderbuffer(),c=e.getParameter(e.RENDERBUFFER_BINDING);e.bindRenderbuffer(e.RENDERBUFFER,u),e.renderbufferStorage(e.RENDERBUFFER,h,s,o),e.bindRenderbuffer(e.RENDERBUFFER,c),e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u);const d=a.getParameter(a.READ_FRAMEBUFFER_BINDING),f=a.getParameter(a.DRAW_FRAMEBUFFER_BINDING);a.bindFramebuffer(a.READ_FRAMEBUFFER,t),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,this.captureFrameBuffer),a.blitFramebuffer(0,0,s,o,0,0,s,o,e.COLOR_BUFFER_BIT,e.NEAREST),a.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),a.bindFramebuffer(a.READ_FRAMEBUFFER,d),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,f),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t),e.deleteRenderbuffer(u)}else e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,l,u){let c=0;this.contextVersion>1&&(c=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value));const h=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL.value),d=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE.value);d>0?g[d].name:p.TEXTURE_2D.name;let f=!1,m=l;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,void 0!==e.type&&(m=e.type),f=e.target===p.TEXTURE_2D_ARRAY.name,!we.isSupportedCombination(e.type,e.format,e.internalFormat))return}else s+=r,o+=i;r=i=0,e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),c>0||f?e.framebufferTextureLayer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,u,h,c):e.framebufferTexture2D(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,d||p.TEXTURE_2D.value,u,h),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,d,c,m),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}getCapture(e,t,n,r,i,s,o,l,u){i=Math.floor(i),s=Math.floor(s);const c={attachmentName:t,src:null,textureCubeMapFace:o?g[o].name:null,textureLayer:l,raw:null};if(!this.quickCapture)try{const t=we.readPixels(e,n,r,i,s,u);if(t){c.raw=Ne.encode(t,i,s),this.workingCanvas.width=i,this.workingCanvas.height=s;const e=this.workingContext2D.createImageData(i,s);if(e.data.set(t),this.workingContext2D.putImageData(e,0,0),this.fullCapture)this.captureCanvas.width=this.workingCanvas.width,this.captureCanvas.height=this.workingCanvas.height;else{const e=i/s;e<1?(this.captureCanvas.width=Le.captureBaseSize*e,this.captureCanvas.height=Le.captureBaseSize):e>1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this.captureContext2D.drawImage(this.workingCanvas,0,0,i,s,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",c.src=Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D)}}catch(e){a.warn("Spector can not capture the visual state: "+e)}this.currentState.Attachments.push(c)}analyse(e){}}Le.stateName="VisualState",Le.captureBaseSize=256;class Oe{constructor(e){this.context=e.context,this.captureFrameBuffer=e.context.createFramebuffer(),this.workingCanvas=Fe.createCanvas(1,1),this.workingContext2D=Fe.get2DContext(this.workingCanvas),this.captureCanvas=Fe.createCanvas(1,1),this.captureContext2D=Fe.get2DContext(this.captureCanvas),Fe.setImageSmoothing(this.captureContext2D,!0)}appendTextureState(e,t,n=null,r){if(!t)return;const i=t.__SPECTOR_Object_CustomData;if(i&&(this.fullCapture=r,i.type&&(e.textureType=this.getWebGlConstant(i.type)),i.format&&(e.format=this.getWebGlConstant(i.format)),i.internalFormat&&(e.internalFormat=this.getWebGlConstant(i.internalFormat)),e.width=i.width,e.height=i.height,i.depth&&(e.depth=i.depth),n)){const r="NEAREST"===e.samplerMagFilter||"NEAREST"===e.magFilter,s=this.getTextureVisualState(n,t,i,r);if(s){e.visual=s.visual;for(const t in s.visualPixels)if(s.visualPixels.hasOwnProperty(t)){e.visualPixels=s.visualPixels;break}}}}getTextureVisualState(e,t,n,r){try{const i=this.context,s={},o={};if(!we.isSupportedCombination(n.type,n.format,n.internalFormat))return{visual:s,visualPixels:o};const a=this.context.getParameter(p.FRAMEBUFFER_BINDING.value);i.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer);try{const a=0,l=n.width,u=n.height;if(e===p.TEXTURE_3D&&n.depth){const e=i;for(let c=0;c2&&c2&&c1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}return this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this._setSmoothing(!o),this.captureContext2D.drawImage(this.workingCanvas,0,0,r,i,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",{src:Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D),raw:l}}catch(e){}return{src:void 0,raw:null}}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}_setSmoothing(e){Fe.setImageSmoothing(this.captureContext2D,e)}}Oe.captureBaseSize=64,Oe.cubeMapFaces=[p.TEXTURE_CUBE_MAP_POSITIVE_X,p.TEXTURE_CUBE_MAP_POSITIVE_Y,p.TEXTURE_CUBE_MAP_POSITIVE_Z,p.TEXTURE_CUBE_MAP_NEGATIVE_X,p.TEXTURE_CUBE_MAP_NEGATIVE_Y,p.TEXTURE_CUBE_MAP_NEGATIVE_Z];class Ie{constructor(e){this.context=e.context}getUboValue(e,t,n,r){const i=Ie.uboTypes[r];if(!i)return;const s=new i.arrayBufferView(n*i.lengthMultiplier),o=this.context,a=o.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,e);if(a){const n=o.getIndexedParameter(p.UNIFORM_BUFFER_START.value,e),r=o.getParameter(p.UNIFORM_BUFFER_BINDING.value);try{o.bindBuffer(p.UNIFORM_BUFFER.value,a),o.getBufferSubData(p.UNIFORM_BUFFER.value,n+t,s)}catch(e){return}r&&o.bindBuffer(p.UNIFORM_BUFFER.value,r)}return Array.prototype.slice.call(s)}}Ie.uboTypes={[p.BOOL.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.BOOL_VEC2.value]:{arrayBufferView:Uint8Array,lengthMultiplier:2},[p.BOOL_VEC3.value]:{arrayBufferView:Uint8Array,lengthMultiplier:3},[p.BOOL_VEC4.value]:{arrayBufferView:Uint8Array,lengthMultiplier:4},[p.INT.value]:{arrayBufferView:Int32Array,lengthMultiplier:1},[p.INT_VEC2.value]:{arrayBufferView:Int32Array,lengthMultiplier:2},[p.INT_VEC3.value]:{arrayBufferView:Int32Array,lengthMultiplier:3},[p.INT_VEC4.value]:{arrayBufferView:Int32Array,lengthMultiplier:4},[p.UNSIGNED_INT.value]:{arrayBufferView:Uint32Array,lengthMultiplier:1},[p.UNSIGNED_INT_VEC2.value]:{arrayBufferView:Uint32Array,lengthMultiplier:2},[p.UNSIGNED_INT_VEC3.value]:{arrayBufferView:Uint32Array,lengthMultiplier:3},[p.UNSIGNED_INT_VEC4.value]:{arrayBufferView:Uint32Array,lengthMultiplier:4},[p.FLOAT.value]:{arrayBufferView:Float32Array,lengthMultiplier:1},[p.FLOAT_VEC2.value]:{arrayBufferView:Float32Array,lengthMultiplier:2},[p.FLOAT_VEC3.value]:{arrayBufferView:Float32Array,lengthMultiplier:3},[p.FLOAT_VEC4.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT2x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT3.value]:{arrayBufferView:Float32Array,lengthMultiplier:9},[p.FLOAT_MAT3x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT3x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.FLOAT_MAT4.value]:{arrayBufferView:Float32Array,lengthMultiplier:16},[p.FLOAT_MAT4x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT4x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.SAMPLER_2D.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.SAMPLER_CUBE.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1}};class ke extends S{get typeName(){return"WebGLBuffer"}}class Me extends S{get typeName(){return"WebGLFramebuffer"}}class Pe extends S{get typeName(){return"WebGLProgram"}static saveInGlobalStore(e){const t=D.getWebGlObjectTag(e);t&&(this.store[t.id]=e)}static getFromGlobalStore(e){return this.store[e]}static updateInGlobalStore(e,t){if(!t)return;const n=this.getFromGlobalStore(e);if(!n)return;const r=D.getWebGlObjectTag(n);r&&(D.attachWebGlObjectTag(t,r),this.store[r.id]=t)}}Pe.store={};class Be extends S{get typeName(){return"WebGLQuery"}}class Ue extends S{get typeName(){return"WebGLRenderbuffer"}}class $e extends S{get typeName(){return"WebGLSampler"}}class Ge extends S{get typeName(){return"WebGLShader"}}class Ve extends S{get typeName(){return"WebGLSync"}}class We extends S{get typeName(){return"WebGLTexture"}}class He extends S{get typeName(){return"WebGLTransformFeedback"}}class je extends S{get typeName(){return"WebGLUniformLocation"}}class ze extends S{get typeName(){return"WebGLVertexArrayObject"}}class Xe extends me{get stateName(){return Xe.stateName}get requireStartAndStopStates(){return!1}constructor(e){super(e),this.drawCallTextureInputState=new Oe(e),this.drawCallUboInputState=new Ie(e)}getConsumeCommands(){return d}getChangeCommandsByState(){return{}}readFromContext(){var e,t;const n=this.context.getParameter(p.CURRENT_PROGRAM.value);if(!n)return;this.currentState.frameBuffer=this.readFrameBufferFromContext();const r=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData:x.getProgramData(this.context,n);if(this.currentState.programStatus=Object.assign({},r.programStatus),this.currentState.programStatus.program=this.getSpectorData(n),this.currentState.programStatus.RECOMPILABLE=o.isBuildableProgram(n),this.currentState.programStatus.RECOMPILABLE&&Pe.saveInGlobalStore(n),this.currentState.shaders=r.shaders,(null===(e=this.lastCommandName)||void 0===e?void 0:e.indexOf("Elements"))>=0){const e=this.context.getParameter(this.context.ELEMENT_ARRAY_BUFFER_BINDING);e&&(this.currentState.elementArray={},this.currentState.elementArray.arrayBuffer=this.getSpectorData(e))}const i=this.context.getProgramParameter(n,p.ACTIVE_ATTRIBUTES.value);this.currentState.attributes=[];for(let e=0;e1){const e=this.context.getProgramParameter(n,p.ACTIVE_UNIFORM_BLOCKS.value);this.currentState.uniformBlocks=[];for(let t=0;t1){const e=this.context;t.colorAttachments=[];const n=e.getParameter(p.MAX_DRAW_BUFFERS.value);for(let e=0;e1&&(r.alphaSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE.value),r.blueSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE.value),r.encoding=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.value)),r.componentType=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value)),r.depthSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE.value),r.greenSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE.value),r.redSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_RED_SIZE.value),r.stencilSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value),n===p.TEXTURE.value&&(r.textureLayer=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value))),r}readAttributeFromContext(e,t){const n=this.context.getActiveAttrib(e,t),r=this.context.getAttribLocation(e,n.name);if(-1===r)return{name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:-1};const i=this.context.getVertexAttrib(r,p.CURRENT_VERTEX_ATTRIB.value),s=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING.value),o={name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:r,offsetPointer:this.context.getVertexAttribOffset(r,p.VERTEX_ATTRIB_ARRAY_POINTER.value),bufferBinding:this.getSpectorData(s),enabled:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_ENABLED.value),arraySize:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_SIZE.value),stride:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_STRIDE.value),arrayType:this.getWebGlConstant(this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_TYPE.value)),normalized:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_NORMALIZED.value),vertexAttrib:Array.prototype.slice.call(i)};return this.extensions[p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.extensionName]?o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.value):this.contextVersion>1&&(o.integer=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_INTEGER.value),o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR.value)),this.appendBufferCustomData(o,s),o}readUniformFromContext(e,t){const n=this.context.getActiveUniform(e,t),r=this.context.getUniformLocation(e,n.name);if(r){if(n.size>1&&n.name&&n.name.indexOf("[0]")===n.name.length-3){const t=[];for(let r=0;r1){r.baseLevel=this.context.getTexParameter(t.value,p.TEXTURE_BASE_LEVEL.value),r.immutable=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_FORMAT.value),r.immutableLevels=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_LEVELS.value),r.maxLevel=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LEVEL.value);const e=this.context.getParameter(p.SAMPLER_BINDING.value);if(e){r.sampler=this.getSpectorData(e);const t=this.context;r.samplerMaxLod=t.getSamplerParameter(e,p.TEXTURE_MAX_LOD.value),r.samplerMinLod=t.getSamplerParameter(e,p.TEXTURE_MIN_LOD.value),r.samplerCompareFunc=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_FUNC.value)),r.samplerCompareMode=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_MODE.value)),r.samplerWrapS=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_S.value)),r.samplerWrapT=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_T.value)),r.samplerWrapR=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_R.value)),r.samplerMagFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MAG_FILTER.value)),r.samplerMinFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MIN_FILTER.value))}else r.maxLod=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LOD.value),r.minLod=this.context.getTexParameter(t.value,p.TEXTURE_MIN_LOD.value),r.compareFunc=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_FUNC.value)),r.compareMode=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_MODE.value)),r.wrapR=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_WRAP_R.value))}const i=this.getTextureStorage(t);if(i){const e=this.quickCapture?null:t;this.drawCallTextureInputState.appendTextureState(r,i,e,this.fullCapture)}return this.context.activeTexture(n),r}getTextureStorage(e){return e===p.TEXTURE_2D?this.context.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP?this.context.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):e===p.TEXTURE_3D?this.context.getParameter(p.TEXTURE_BINDING_3D.value):e===p.TEXTURE_2D_ARRAY?this.context.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):void 0}readUniformsFromContextIntoState(e,t,n,r){const i=this.context,s=i.getActiveUniforms(e,t,p.UNIFORM_TYPE.value),o=i.getActiveUniforms(e,t,p.UNIFORM_SIZE.value),a=i.getActiveUniforms(e,t,p.UNIFORM_BLOCK_INDEX.value),l=i.getActiveUniforms(e,t,p.UNIFORM_OFFSET.value),u=i.getActiveUniforms(e,t,p.UNIFORM_ARRAY_STRIDE.value),c=i.getActiveUniforms(e,t,p.UNIFORM_MATRIX_STRIDE.value),h=i.getActiveUniforms(e,t,p.UNIFORM_IS_ROW_MAJOR.value);for(let d=0;d-1&&(t.blockName=i.getActiveUniformBlockName(e,t.blockIndice)),t.offset=l[d],t.arrayStride=u[d],t.matrixStride=c[d],t.rowMajor=h[d],t.blockIndice>-1){const e=r[a[d]].bindingPoint;t.value=this.drawCallUboInputState.getUboValue(e,t.offset,t.size,s[d])}}}readTransformFeedbackFromContext(e,t){const n=this.context,r=n.getTransformFeedbackVarying(e,t),i=n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value,t),s={name:r.name,size:r.size,type:this.getWebGlConstant(r.type),buffer:this.getSpectorData(i),bufferSize:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_SIZE.value,t),bufferStart:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_START.value,t)};return this.appendBufferCustomData(s,i),s}readUniformBlockFromContext(e,t){const n=this.context,r=n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_BINDING.value),i=n.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,r),s={name:n.getActiveUniformBlockName(e,t),bindingPoint:r,size:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_DATA_SIZE.value),activeUniformCount:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_ACTIVE_UNIFORMS.value),vertex:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER.value),fragment:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER.value),buffer:this.getSpectorData(i)};return this.appendBufferCustomData(s,i),s}appendBufferCustomData(e,t){if(t){const n=t.__SPECTOR_Object_CustomData;n&&(n.usage&&(e.bufferUsage=this.getWebGlConstant(n.usage)),e.bufferLength=n.length,n.offset&&(e.bufferOffset=n.offset),n.sourceLength&&(e.bufferSourceLength=n.sourceLength))}}getWebGlConstant(e){const t=g[e];return t?t.name:e}}Xe.stateName="DrawCall",Xe.samplerTypes={[p.SAMPLER_2D.value]:p.TEXTURE_2D,[p.SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.SAMPLER_3D.value]:p.TEXTURE_3D,[p.SAMPLER_2D_SHADOW.value]:p.TEXTURE_2D,[p.SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_2D_ARRAY_SHADOW.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_CUBE_SHADOW.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.UNSIGNED_INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.UNSIGNED_INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.UNSIGNED_INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.UNSIGNED_INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY};class Ke{constructor(e){this.contextInformation=e,this.stateTrackers=[],this.onCommandCapturedCallbacks={},this.initStateTrackers()}startCapture(e,t,n){for(const r of this.stateTrackers){const i=r.startCapture(!0,t,n);r.requireStartAndStopStates&&(e.initState[r.stateName]=i)}}stopCapture(e){for(const t of this.stateTrackers){const n=t.stopCapture();t.requireStartAndStopStates&&(e.endState[t.stateName]=n)}}captureState(e){const t=this.onCommandCapturedCallbacks[e.name];if(t)for(const n of t)n(e)}initStateTrackers(){this.stateTrackers.push(new Ee(this.contextInformation),new ve(this.contextInformation),new Ce(this.contextInformation),new De(this.contextInformation),new Se(this.contextInformation),new Ae(this.contextInformation),new _e(this.contextInformation),new ye(this.contextInformation),new be(this.contextInformation),new Te(this.contextInformation),new Re(this.contextInformation),new xe(this.contextInformation),new Le(this.contextInformation),new Xe(this.contextInformation));for(const e of this.stateTrackers)e.registerCallbacks(this.onCommandCapturedCallbacks)}}class Ye{static initializeByteSizeFormat(){this.byteSizePerInternalFormat||(this.byteSizePerInternalFormat={[p.R8.value]:1,[p.R16F.value]:2,[p.R32F.value]:4,[p.R8UI.value]:1,[p.RG8.value]:2,[p.RG16F.value]:4,[p.RG32F.value]:8,[p.ALPHA.value]:1,[p.RGB.value]:3,[p.RGBA.value]:4,[p.LUMINANCE.value]:1,[p.LUMINANCE_ALPHA.value]:2,[p.DEPTH_COMPONENT.value]:1,[p.DEPTH_STENCIL.value]:2,[p.SRGB_EXT.value]:3,[p.SRGB_ALPHA_EXT.value]:4,[p.RGB8.value]:3,[p.SRGB8.value]:3,[p.RGB565.value]:2,[p.R11F_G11F_B10F.value]:4,[p.RGB9_E5.value]:2,[p.RGB16F.value]:6,[p.RGB32F.value]:12,[p.RGB8UI.value]:3,[p.RGBA8.value]:4,[p.RGB5_A1.value]:2,[p.RGBA16F.value]:8,[p.RGBA32F.value]:16,[p.RGBA8UI.value]:4,[p.COMPRESSED_R11_EAC.value]:4,[p.COMPRESSED_SIGNED_R11_EAC.value]:4,[p.COMPRESSED_RG11_EAC.value]:4,[p.COMPRESSED_SIGNED_RG11_EAC.value]:4,[p.COMPRESSED_RGB8_ETC2.value]:4,[p.COMPRESSED_RGBA8_ETC2_EAC.value]:4,[p.COMPRESSED_SRGB8_ETC2.value]:4,[p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC.value]:4,[p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_RGB_S3TC_DXT1_EXT.value]:.5,[p.COMPRESSED_RGBA_S3TC_DXT3_EXT.value]:1,[p.COMPRESSED_RGBA_S3TC_DXT5_EXT.value]:1,[p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGB_ETC1_WEBGL.value]:.5,[p.COMPRESSED_RGB_ATC_WEBGL.value]:.5,[p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL.value]:1,[p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL.value]:1})}constructor(e){this.options=e,this.createCommandNames=this.getCreateCommandNames(),this.updateCommandNames=this.getUpdateCommandNames(),this.deleteCommandNames=this.getDeleteCommandNames(),this.startTime=u.now,this.memoryPerSecond={},this.totalMemory=0,this.frameMemory=0,this.capturing=!1,Ye.initializeByteSizeFormat()}registerCallbacks(e){for(const t of this.createCommandNames)e[t]=e[t]||[],e[t].push(this.createWithoutSideEffects.bind(this));for(const t of this.updateCommandNames)e[t]=e[t]||[],e[t].push(this.updateWithoutSideEffects.bind(this));for(const t of this.deleteCommandNames)e[t]=e[t]||[],e[t].push(this.deleteWithoutSideEffects.bind(this))}startCapture(){this.frameMemory=0,this.capturing=!0}stopCapture(){this.frameMemory=0,this.capturing=!1}appendRecordedInformation(e){e.frameMemory[this.objectName]=this.frameMemory,e.memory[this.objectName]=this.memoryPerSecond}create(e){}createWithoutSideEffects(e){this.options.toggleCapture(!1);try{this.create(e)}finally{this.options.toggleCapture(!0)}}updateWithoutSideEffects(e){if(e&&0!==e.arguments.length){this.options.toggleCapture(!1);try{const t=e.arguments[0],n=this.getBoundInstance(t);if(!n)return;if(!D.getWebGlObjectTag(n))return;const r=this.getWebGlConstant(t),i=this.update(e,r,n);this.changeMemorySize(i)}finally{this.options.toggleCapture(!0)}}}deleteWithoutSideEffects(e){if(!e||!e.arguments||e.arguments.length<1)return;const t=e.arguments[0];if(t){this.options.toggleCapture(!1);try{const e=this.delete(t);this.changeMemorySize(-e)}finally{this.options.toggleCapture(!0)}}}changeMemorySize(e){this.totalMemory+=e,this.capturing&&(this.frameMemory+=e);const t=u.now-this.startTime,n=Math.round(t/1e3);this.memoryPerSecond[n]=this.totalMemory}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}getByteSizeForInternalFormat(e){return Ye.byteSizePerInternalFormat[e]||4}readPixelStoreState(){const e=this.options.context,t={UNPACK_FLIP_Y_WEBGL:e.getParameter(p.UNPACK_FLIP_Y_WEBGL.value),UNPACK_PREMULTIPLY_ALPHA_WEBGL:e.getParameter(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL.value),UNPACK_COLORSPACE_CONVERSION_WEBGL:e.getParameter(p.UNPACK_COLORSPACE_CONVERSION_WEBGL.value),UNPACK_ALIGNMENT:e.getParameter(p.UNPACK_ALIGNMENT.value)};return e instanceof WebGL2RenderingContext&&(t.UNPACK_ROW_LENGTH=e.getParameter(p.UNPACK_ROW_LENGTH.value),t.UNPACK_IMAGE_HEIGHT=e.getParameter(p.UNPACK_IMAGE_HEIGHT.value),t.UNPACK_SKIP_PIXELS=e.getParameter(p.UNPACK_SKIP_PIXELS.value),t.UNPACK_SKIP_ROWS=e.getParameter(p.UNPACK_SKIP_ROWS.value),t.UNPACK_SKIP_IMAGES=e.getParameter(p.UNPACK_SKIP_IMAGES.value)),t}}class qe extends Ye{get objectName(){return"Buffer"}getCreateCommandNames(){return["createBuffer"]}getUpdateCommandNames(){return["bufferData"]}getDeleteCommandNames(){return["deleteBuffer"]}getBoundInstance(e){const t=this.options.context;return e===p.ARRAY_BUFFER.value?t.getParameter(p.ARRAY_BUFFER_BINDING.value):e===p.ELEMENT_ARRAY_BUFFER.value?t.getParameter(p.ELEMENT_ARRAY_BUFFER_BINDING.value):e===p.COPY_READ_BUFFER.value?t.getParameter(p.COPY_READ_BUFFER_BINDING.value):e===p.COPY_WRITE_BUFFER.value?t.getParameter(p.COPY_WRITE_BUFFER_BINDING.value):e===p.TRANSFORM_FEEDBACK_BUFFER.value?t.getParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value):e===p.UNIFORM_BUFFER.value?t.getParameter(p.UNIFORM_BUFFER_BINDING.value):e===p.PIXEL_PACK_BUFFER.value?t.getParameter(p.PIXEL_PACK_BUFFER_BINDING.value):e===p.PIXEL_UNPACK_BUFFER.value?t.getParameter(p.PIXEL_UNPACK_BUFFER_BINDING.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(t,e);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){const n=this.getLength(t);return t.arguments.length>=4?{target:e,length:n,usage:t.arguments[2],offset:t.arguments[3],sourceLength:t.arguments[1]?t.arguments[1].length:-1}:3===t.arguments.length?{target:e,length:n,usage:t.arguments[2]}:void 0}getLength(e){const t=e.arguments[1],n=e.arguments[3],r=e.arguments[4];if("number"==typeof t)return t;if("number"==typeof r&&r>0)return r;const i=t.byteLength||t.length||0;return"number"==typeof n&&n>0?i-n:i}}class Qe extends Ye{get objectName(){return"Renderbuffer"}getCreateCommandNames(){return["createRenderbuffer"]}getUpdateCommandNames(){return["renderbufferStorage","renderbufferStorageMultisample"]}getDeleteCommandNames(){return["deleteRenderbuffer"]}getBoundInstance(e){const t=this.options.context;if(e===p.RENDERBUFFER.value)return t.getParameter(p.RENDERBUFFER_BINDING.value)}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(e,t);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return r.length=r.width*r.height*this.getByteSizeForInternalFormat(r.internalFormat),n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){return 4===e.arguments.length?{target:t,internalFormat:e.arguments[1],width:e.arguments[2],height:e.arguments[3],length:0,samples:0}:{target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,samples:e.arguments[1]}}}class Ze extends Ye{get objectName(){return"Texture2d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage2D","compressedTexImage2D","texStorage2D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D.value?t.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP_POSITIVE_X.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Y.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Z.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_X.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Y.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Z.value?t.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target===p.TEXTURE_2D_ARRAY.name||t.target===p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else{const e="TEXTURE_2D"===t?1:6;let n=r.internalFormat;n===p.RGBA.value&&(r.type===p.FLOAT.value&&(n=p.RGBA32F.value),r.type===p.HALF_FLOAT_OES.value&&(n=p.RGBA16F.value)),r.length=r.width*r.height*e*this.getByteSizeForInternalFormat(n)}return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage2D"===e.name?this.getTexImage2DCustomData(e,t,n):"compressedTexImage2D"===e.name?this.getCompressedTexImage2DCustomData(e,t,n):"texStorage2D"===e.name?this.getTexStorage2DCustomData(e,t,n):void 0}getTexStorage2DCustomData(e,t,n){let r;return 5===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!1}),r}getCompressedTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=7&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!0}),r}getTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8?r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],format:e.arguments[6],type:e.arguments[7],length:0,isCompressed:!1}:6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[5].width,height:e.arguments[5].height,format:e.arguments[3],type:e.arguments[4],length:0,isCompressed:!1}),r}}class Je extends Ye{get objectName(){return"Texture3d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage3D","compressedTexImage3D","texStorage3D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D_ARRAY.value?t.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):e===p.TEXTURE_3D.value?t.getParameter(p.TEXTURE_BINDING_3D.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target!==p.TEXTURE_2D_ARRAY.name&&t.target!==p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){if(e.arguments.length>=2&&0!==e.arguments[1])return 0;const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else r.length=r.width*r.height*r.depth*this.getByteSizeForInternalFormat(r.internalFormat);return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage3D"===e.name?this.getTexImage3DCustomData(e,t,n):"compressedTexImage3D"===e.name?this.getCompressedTexImage3DCustomData(e,t,n):"texStorage3D"===e.name?this.getTexStorage3DCustomData(e,t,n):void 0}getTexStorage3DCustomData(e,t,n){let r;return 6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!1}),r}getCompressedTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!0}),r}getTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=9&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],format:e.arguments[7],type:e.arguments[8],length:0,isCompressed:!1}),r}}class et extends Ye{get objectName(){return"Program"}getCreateCommandNames(){return["createProgram"]}getUpdateCommandNames(){return["linkProgram"]}getDeleteCommandNames(){return["deleteProgram"]}getBoundInstance(e){return e}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){if(e.arguments.length>=1&&!e.arguments[0])return 0;const r=this.getCustomData(n);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e){const t=this.options.context;return x.getProgramData(t,e)}}class tt{constructor(e){this.contextInformation=e,this.onCommandCallbacks={},this.recorders=[],this.initRecorders()}recordCommand(e){const t=this.onCommandCallbacks[e.name];if(t)for(const n of t)n(e)}startCapture(){for(const e of this.recorders)e.startCapture()}stopCapture(){for(const e of this.recorders)e.stopCapture()}appendRecordedInformation(e){for(const t of this.recorders)t.appendRecordedInformation(e)}initRecorders(){this.recorders.push(new qe(this.contextInformation),new Qe(this.contextInformation),new Ze(this.contextInformation),new Je(this.contextInformation),new et(this.contextInformation));for(const e of this.recorders)e.registerCallbacks(this.onCommandCallbacks)}}class nt{constructor(e){this.contextInformation=e,this.webGlObjects=[],this.initWebglObjects()}tagWebGlObjects(e){for(const t of this.webGlObjects){for(let n=0;n0&&this.currentCapture.commands.length===this.maxCommands&&this.onMaxCommand.trigger(this)}}}spyContext(e){const t=[];for(const n in e)n&&t.push(n);for(let n=0;n{this.spyRequestAnimationFrame("requestAnimationFrame",e.display)})}spyRequestAnimationFrame(e,t){const n=this;y.storeOriginFunction(t,e),t[e]=function(){const r=arguments[0],i=n.getCallback(n,r,()=>{n.spiedScope[e](r)});return y.executeOriginFunction(t,e,[i])}}spySetTimer(e){const t=this,n=this.spiedScope,r="setTimeout"===e;y.storeOriginFunction(n,e),n[e]=function(){const i=arguments[0],s=arguments[1],o=Array.prototype.slice.call(arguments);return at.setTimerCommonValues.indexOf(s)>-1&&(o[0]=t.getCallback(t,i,r?()=>{n[e](i)}:null)),y.executeOriginFunction(n,e,o)}}getCallback(e,t,n=null){return function(){const r=u.now;if(e.lastFrame=++e.lastFrame%e.speedRatio,e.willPlayNextFrame||e.speedRatio&&!e.lastFrame){try{e.onFrameStart.trigger(e)}catch(t){e.onError.trigger(t)}try{t.apply(e.spiedScope,arguments)}catch(t){e.onError.trigger(t)}e.lastSixtyFramesCurrentIndex=(e.lastSixtyFramesCurrentIndex+1)%at.fpsWindowSize,e.lastSixtyFramesDuration[e.lastSixtyFramesCurrentIndex]=r-e.lastSixtyFramesPreviousStart;try{e.onFrameEnd.trigger(e)}catch(t){e.onError.trigger(t)}e.willPlayNextFrame=!1}else n&&n();e.lastSixtyFramesPreviousStart=r}}}at.requestAnimationFrameFunctions=["requestAnimationFrame","msRequestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame"],at.setTimerFunctions=["setTimeout","setInterval"],at.setTimerCommonValues=[0,15,16,33,32,40],at.fpsWindowSize=60;class lt{constructor(e){this.canvas=e,this.onContextRequested=new l,this.init()}init(){const e=this,t=function(){const t="undefined"!=typeof HTMLCanvasElement&&this instanceof HTMLCanvasElement?HTMLCanvasElement:OffscreenCanvas,n=e.canvas?y.executeOriginFunction(this,"getContext",arguments):y.executePrototypeOriginFunction(this,t,"getContext",arguments);if(arguments.length>0){const e=arguments[0];if("webgl"!==e&&"experimental-webgl"!==e&&"webgl2"!==e&&"experimental-webgl2"!==e)return n}if(n){const t=Array.prototype.slice.call(arguments),r="webgl2"===t[0]||"experimental-webgl2"===t[0]?2:1;e.onContextRequested.trigger({context:n,contextVersion:r})}return n};this.canvas?(y.storeOriginFunction(this.canvas,"getContext"),this.canvas.getContext=t):("undefined"!=typeof HTMLCanvasElement&&(y.storePrototypeOriginFunction(HTMLCanvasElement,"getContext"),HTMLCanvasElement.prototype.getContext=t),"undefined"!=typeof OffscreenCanvas&&(y.storePrototypeOriginFunction(OffscreenCanvas,"getContext"),OffscreenCanvas.prototype.getContext=t))}}class ut{static startIntercepting(e){if(ut.intercepting)return;if("undefined"==typeof Worker)return;ut.workerBundleUrl=e,ut.originalWorkerConstructor=Worker,ut.intercepting=!0;const t=Worker;globalThis.Worker=function(e,n){if(n&&"module"===n.type)return new t(e,n);const r=e.toString();try{let i;try{i=new URL(r,location.href).href}catch(r){return new t(e,n)}const s=new XMLHttpRequest;if(s.open("GET",i,!1),s.send(),200===s.status&&ut.shouldInjectSource(s.responseText)){const e=ut.rewriteImportScripts(s.responseText,i),o="(function(){\n var __spectorBase = "+JSON.stringify(i)+';\n self.__SPECTOR_workerBaseUrl = __spectorBase;\n function __spectorResolve(u) {\n if (u == null) return u;\n if (typeof u !== "string") {\n if (u instanceof URL) return u;\n try { u = String(u); } catch (e) { return u; }\n }\n if (/^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i.test(u)) return u;\n try { return new URL(u, __spectorBase).href; }\n catch (e) { return u; }\n }\n self.__SPECTOR_resolveWorkerUrl = __spectorResolve;\n var __origImportScripts = self.importScripts;\n if (typeof __origImportScripts === "function") {\n self.importScripts = function() {\n var args = new Array(arguments.length);\n for (var i = 0; i < arguments.length; i++) args[i] = __spectorResolve(arguments[i]);\n return __origImportScripts.apply(self, args);\n };\n }\n var __origFetch = self.fetch;\n if (typeof __origFetch === "function") {\n self.fetch = function(input, init) {\n try {\n if (typeof input === "string") {\n input = __spectorResolve(input);\n } else if (input && typeof input === "object" && "url" in input && typeof Request === "function") {\n var r = input;\n var resolved = __spectorResolve(r.url);\n if (resolved !== r.url) input = new Request(resolved, r);\n }\n } catch (e) { /* fall through with original input */ }\n return __origFetch.call(self, input, init);\n };\n }\n if (typeof XMLHttpRequest === "function" && XMLHttpRequest.prototype && XMLHttpRequest.prototype.open) {\n var __origXhrOpen = XMLHttpRequest.prototype.open;\n XMLHttpRequest.prototype.open = function(method, url) {\n var args = Array.prototype.slice.call(arguments);\n args[1] = __spectorResolve(url);\n return __origXhrOpen.apply(this, args);\n };\n }\n if (typeof Worker === "function") {\n var __OrigWorker = Worker;\n self.Worker = function(scriptURL, options) {\n var resolved = __spectorResolve(scriptURL);\n return new __OrigWorker(resolved, options);\n };\n self.Worker.prototype = __OrigWorker.prototype;\n }\n})();\n',a="importScripts("+JSON.stringify(ut.workerBundleUrl)+");\n",l=new Blob([o+a+e],{type:"application/javascript"}),u=URL.createObjectURL(l),c=new t(u,n);return ut.spiedWorkers.push({worker:c,originalUrl:r}),c}}catch(e){console.warn("[Spector.js] Could not inject into Worker ("+r+"):",e)}const i=new t(e,n);return ut.spiedWorkers.push({worker:i,originalUrl:r}),i},globalThis.Worker.prototype=t.prototype}static stopIntercepting(){ut.intercepting&&(globalThis.Worker=ut.originalWorkerConstructor,ut.intercepting=!1)}static rewriteImportScripts(e,t){const n=/(['"`])((?:\\.|(?!\1).)*)\1/g;return e.replace(/importScripts\s*\(([^)]*)\)/g,(e,r)=>"importScripts("+r.replace(n,(e,n,r)=>{if("`"===n&&-1!==r.indexOf("${"))return e;let i;try{i=new URL(r,t).href}catch(t){return e}return n+i+n})+")")}static shouldInjectSource(e){return!/\bimport\s*(?:\/\*[\s\S]*?\*\/\s*)?\(/.test(e)&&!/\bnew\s+(?:(?:self|globalThis)\s*\.\s*)?(?:Worker|SharedWorker)\s*\(/.test(e)}static getSpiedWorkers(){return ut.spiedWorkers}static isIntercepting(){return ut.intercepting}}ut.spiedWorkers=[],ut.intercepting=!1;class ct{static getDelay(){return ct.delayMs}static setDelay(e){ct.delayMs="number"==typeof e&&e>0?e:0}static shouldForceIncomplete(e,t,n,r){return!(r<=0)&&e===p.COMPLETION_STATUS_KHR.value&&void 0!==t&&n-tthis._state,this.subscribe=e=>(this._listeners.add(e),()=>{this._listeners.delete(e)}),this._state=e}setState(e){this._state=e(this._state),this._emitChange()}setSnapshot(e){this._state=e,this._emitChange()}_emitChange(){for(const e of this._listeners)e()}}function pt(e){return(0,dt.useSyncExternalStore)(e.subscribe,e.getSnapshot)}var mt=n(848);const gt=(0,dt.createContext)(null);function Et(){const e=(0,dt.useContext)(gt);if(!e)throw new Error("CaptureMenuContext not provided — CaptureMenuRoot must be rendered inside CaptureMenuContext.Provider");return e}function vt({canvas:e}){const t=Et();return(0,mt.jsx)("li",{onClick:()=>t.handleCanvasSelected(e),children:(0,mt.jsx)("span",{children:`Id: ${e.id} - Size: ${e.width}*${e.height}`})})}function Ct(){const e=Et(),t=pt(e.store),n=t.selectedCanvas?`${t.selectedCanvas.id} (${t.selectedCanvas.width}*${t.selectedCanvas.height})`:"Choose Canvas...";return(0,mt.jsxs)("div",{className:"canvasListComponent",children:[(0,mt.jsx)("span",{commandName:"onCanvasSelection",onClick:e.handleCanvasListToggle,children:n}),(0,mt.jsx)("ul",{style:{display:t.showCanvasList?"block":"none",visibility:t.showCanvasList?"visible":"hidden"},children:t.canvases.map((e,t)=>(0,mt.jsx)(vt,{canvas:e},e.id||t))})]})}function Dt(){const e=Et(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"captureMenuActionsComponent",children:[(0,mt.jsx)("div",{commandName:"onCaptureRequested",onClick:e.handleCaptureRequested}),t.isPlaying?(0,mt.jsx)("div",{commandName:"onPauseRequested",onClick:e.handlePauseRequested}):(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("div",{commandName:"onPlayRequested",onClick:e.handlePlayRequested}),(0,mt.jsx)("div",{commandName:"onPlayNextFrameRequested",onClick:e.handlePlayNextFrameRequested})]})]})}function St(){const e=pt(Et().store);return(0,mt.jsxs)("span",{className:"fpsCounterComponent",children:[e.fps.toFixed(2)," Fps"]})}function At(){const e=pt(Et().store);return(0,mt.jsxs)("div",{children:[(0,mt.jsxs)("div",{className:"captureMenuComponent "+(e.visible?"active":""),children:[(0,mt.jsx)(Ct,{}),(0,mt.jsx)(Dt,{}),(0,mt.jsx)(St,{})]}),(0,mt.jsx)("div",{className:"captureMenuLogComponent "+(e.logVisible?"active":""),children:(0,mt.jsx)("span",{className:e.logLevel===i.error?"error":"",children:e.logText})})]})}class _t{constructor(e={}){this.options=e,this.handleCanvasListToggle=()=>{this.store.getSnapshot(),this.store.setState(e=>Object.assign(Object.assign({},e),{selectedCanvas:null,showCanvasList:!e.showCanvasList,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!e.showCanvasList&&!this._hideLog})),this.onCanvasSelected.trigger(null),this._isTrackingCanvas&&this.trackPageCanvases()},this.handleCanvasSelected=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{selectedCanvas:e,showCanvasList:!1,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)},this.handleCaptureRequested=()=>{const e=this.getSelectedCanvasInformation();e&&this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.PleaseWaitHelpText,logVisible:!this._hideLog})),setTimeout(()=>{this.onCaptureRequested.trigger(e)},200)},this.handlePauseRequested=()=>{this.onPauseRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!1}))},this.handlePlayRequested=()=>{this.onPlayRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!0}))},this.handlePlayNextFrameRequested=()=>{this.onPlayNextFrameRequested.trigger(this.getSelectedCanvasInformation())},this._rootPlaceHolder=e.rootPlaceHolder||document.body,this._hideLog=!!e.hideLog,this._isTrackingCanvas=!1,this._extraCanvasEntries=[],this.onCanvasSelected=new l,this.onCaptureRequested=new l,this.onPauseRequested=new l,this.onPlayRequested=new l,this.onPlayNextFrameRequested=new l,this.store=new ft({visible:!0,logText:_t.SelectCanvasHelpText,logLevel:i.info,logVisible:!this._hideLog,canvases:[],selectedCanvas:null,showCanvasList:!1,isPlaying:!0,fps:0}),this._container=document.createElement("div"),this._container.className="spector-react-capture-menu",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(gt.Provider,{value:this},(0,dt.createElement)(At)))}getSelectedCanvasInformation(){return this.store.getSnapshot().selectedCanvas}trackPageCanvases(){if(this._isTrackingCanvas=!0,document.body){const e=document.body.querySelectorAll("canvas");this.updateCanvasesList(e)}}updateCanvasesList(e){const t=[];for(let n=0;nObject.assign(Object.assign({},n),{canvases:t,selectedCanvas:e,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}captureComplete(e){e?this.store.setState(t=>Object.assign(Object.assign({},t),{logLevel:i.error,logText:e,logVisible:!this._hideLog})):this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog}))}setFPS(e){this.store.setState(t=>Object.assign(Object.assign({},t),{fps:e}))}_updateCanvasesInternal(e){for(const t of this._extraCanvasEntries)e.push(t);this.store.getSnapshot().showCanvasList?this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e})):1===e.length?(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:e[0],logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e[0])):(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:null,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(null))}}_t.SelectCanvasHelpText="Please, select a canvas in the list above.",_t.ActionsHelpText="Record with the red button, you can also pause or continue playing the current scene.",_t.PleaseWaitHelpText="Capturing, be patient (this can take up to 3 minutes)...";const yt=(0,dt.createContext)(null);function bt(){const e=(0,dt.useContext)(yt);if(!e)throw new Error("ResultViewContext not provided — ResultViewRoot must be rendered inside ResultViewContext.Provider");return e}function Tt(){const e=bt(),t=pt(e.store),n=(0,dt.useRef)(null),r=(0,dt.useCallback)(e=>{e.preventDefault();const t=e.currentTarget.parentElement,n=t.parentElement;if(!n)return;const r=n.querySelectorAll("li:not(.resultViewMenuSmall)");if("true"===t.getAttribute("open")){t.setAttribute("open","false");for(let e=0;e{e.handleSearchTextChange(t.target.value)},[e]),s=(0,dt.useCallback)(t=>{t.stopPropagation(),e.handleSearchTextChange("")},[e]),o=(0,dt.useCallback)(t=>n=>{n.preventDefault(),e.handleMenuStatusChange(t)},[e]),a=(0,dt.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),e.handleClose()},[e]);return(0,mt.jsxs)("ul",{className:"resultViewMenuComponent",ref:n,children:[(0,mt.jsx)("li",{className:"resultViewMenuOpen resultViewMenuSmall",children:(0,mt.jsx)("a",{href:"#",role:"button",onClick:r,children:"Menu"})}),(0,mt.jsxs)("li",{className:"searchContainer",children:[(0,mt.jsx)("input",{type:"text",placeholder:"Search...",value:t.searchText,commandName:"onSearchTextChanged",commandEventBinding:"change",onChange:i}),(0,mt.jsx)("a",{className:"clearSearch",commandName:"onSearchTextCleared",onClick:s,children:"X"})]}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:0===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCapturesClicked",onClick:o(0),children:"Captures"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:10===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInformationClicked",onClick:o(10),children:"Information"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:20===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInitStateClicked",onClick:o(20),children:"Init State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:40===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCommandsClicked",onClick:o(40),children:"Commands"+(t.commandCount>0?" ("+t.commandCount+")":"")})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:60===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCompareClicked",onClick:o(60),children:"Compare"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:30===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onEndStateClicked",onClick:o(30),children:"End State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{role:"button",commandName:"onCloseClicked",onClick:a,children:"Close"})})]})}function Rt({children:e}){return(0,mt.jsx)("div",{className:"resultViewContentComponent",children:e})}function xt({capture:e,active:t,onCaptureSelected:n,onSaveRequested:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),r()},[r]),s=(0,dt.useCallback)(()=>{n()},[n]),o=new Date(e.startTime).toTimeString().split(" ")[0];return(0,mt.jsxs)("li",{className:t?"active":"",onClick:s,children:[e.endState.VisualState.Attachments?e.endState.VisualState.Attachments.map((e,t)=>(0,mt.jsx)("img",{src:encodeURI(e.src)},t)):(0,mt.jsx)("span",{children:e.endState.VisualState.FrameBufferStatus}),(0,mt.jsxs)("span",{children:[o,(0,mt.jsx)("a",{href:"#",className:"captureListItemSave",commandName:"onSaveRequested",onClick:i})]})]})}function wt({active:e,captures:t,onCaptureSelected:n,onSaveRequested:r,onCaptureLoaded:i}){const s=(0,dt.useRef)(null),o=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault()},[]),l=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),function(e,t){let n=null;if(e&&e.dataTransfer&&e.dataTransfer.files&&(n=e.dataTransfer.files),e&&e.target&&e.target.files&&(n=e.target.files),n&&n.length>0)for(let e=0;e{a.error("Error while reading file: "+r.name+e)},i.onload=e=>{try{const n=JSON.parse(e.target.result);t(n)}catch(e){a.error("Error while reading file: "+r.name+e)}},i.readAsText(r)}}(e.nativeEvent,i)},[i]);return(0,mt.jsxs)("div",{className:"captureListComponent "+(e?"active":""),children:[(0,mt.jsx)("div",{className:"openCaptureFile",ref:s,onDragEnter:o,onDragOver:o,onDrop:l,children:(0,mt.jsx)("span",{children:"Drag files here to open a previously saved capture."})}),(0,mt.jsx)("ul",{children:t.map((e,t)=>(0,mt.jsx)(xt,{capture:e.capture,active:e.active,onCaptureSelected:()=>n(t),onSaveRequested:()=>r(e.capture)},t))})]})}function Ft({children:e}){return(0,mt.jsx)("div",{className:"visualStateListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Nt({item:e,onVisualStateSelected:t}){const n=(0,dt.useRef)(null);(0,dt.useEffect)(()=>{e.active&&n.current&&setTimeout(()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const r=(0,dt.useCallback)(()=>{t()},[t]),i=e.VisualState;return(0,mt.jsxs)("li",{ref:n,className:e.active?"active":"",onClick:r,commandName:"onVisualStateSelected",children:[i.Attachments?i.Attachments.map((e,t)=>e.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{src:encodeURI(e.src)}),i.Attachments.length>1&&(0,mt.jsx)("span",{children:e.attachmentName}),!!e.textureLayer&&(0,mt.jsx)("span",{children:"Layer: "+e.textureLayer}),!!e.textureCubeMapFace&&(0,mt.jsx)("span",{children:e.textureCubeMapFace})]},t):null):(0,mt.jsx)("span",{children:i.FrameBufferStatus}),(0,mt.jsx)("span",{children:i.FrameBuffer?"Frame buffer: "+i.FrameBuffer.__SPECTOR_Object_TAG.id:"Canvas frame buffer"})]})}function Lt({children:e}){return(0,mt.jsx)("div",{className:"commandListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Ot({command:e,onCommandSelected:t,onVertexSelected:n,onFragmentSelected:r,onShaderSelected:i}){var s;const o=(0,dt.useRef)(null),a=e.capture,l=function(e){switch(e){case 50:return"deprecated";case 10:return"unused";case 20:return"disabled";case 30:return"redundant";case 40:return"valid";default:return"unknown"}}(a.status),u=!!a.VisualState;let c="";u&&(c=" drawCall"),e.active&&(c=" active"),(0,dt.useEffect)(()=>{e.active&&o.current&&setTimeout(()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const h=(0,dt.useCallback)(e=>{t()},[t]),d=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==n||n()},[n]),f=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==r||r()},[r]),p=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==i||i()},[i]);let m=null;if(u&&"clear"!==a.name)try{const e=a.DrawCall.shaders[0],t=a.DrawCall.shaders[1];m=(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("a",{href:"#",onClick:d,children:e.name}),(0,mt.jsx)("a",{href:"#",onClick:f,children:t.name})]})}catch(e){}const g=(null===(s=a.shader)||void 0===s?void 0:s.source)?(0,mt.jsx)("a",{href:"#",commandName:"onShaderSourceSelected",onClick:p,children:"Source"}):null;return(0,mt.jsxs)("li",{ref:o,className:c,onClick:h,commandName:"onCommandSelected",children:[a.marker&&(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.marker+" "}),"LOG"===a.name?(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.text+" "}):(0,mt.jsx)("span",{dangerouslySetInnerHTML:{__html:a.text.replace(a.name,`${a.name}`)}}),g,m]})}function It({children:e}){return(0,mt.jsx)("div",{className:"commandDetailComponent",children:e})}function kt({left:e,children:t}){return(0,mt.jsx)("div",{className:e?"informationColumnLeftComponent":"informationColumnRightComponent",children:t})}function Mt({children:e}){return(0,mt.jsx)("div",{className:"jsonContentComponent",children:e})}function Pt(e,t,n,r){return{row:Math.max(0,parseInt(t,10)-1),column:n?Math.max(0,parseInt(n,10)-1):0,text:r.trim()||e,type:e.toLowerCase()}}var Bt,Ut,$t=Object.create,Gt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor,Wt=Object.getOwnPropertyNames,Ht=Object.getPrototypeOf,jt=Object.prototype.hasOwnProperty,zt=e=>{throw TypeError(e)},Xt=(e,t)=>{for(var n in t)Gt(e,n,{get:t[n],enumerable:!0})},Kt=(e,t,n)=>(((e,t)=>{t.has(e)||zt("Cannot access private method")})(e,t),n),Yt=(Bt=e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=/\r\n|[\n\r\u2028\u2029]/;e.codeFrameColumns=function(e,n,r={}){let i=new Proxy({},{get:()=>e=>e}),s=e.split(t),{start:o,end:a,markerLines:l}=function(e,t,n){let r=Object.assign({column:0,line:-1},e.start),i=Object.assign({},r,e.end),{linesAbove:s=2,linesBelow:o=3}=n||{},a=r.line,l=r.column,u=i.line,c=i.column,h=Math.max(a-(s+1),0),d=Math.min(t.length,u+o);-1===a&&(h=0),-1===u&&(d=t.length);let f=u-a,p={};if(f)for(let e=0;e<=f;e++){let n=e+a;if(l)if(0===e){let e=t[n-1].length;p[n]=[l,e-l+1]}else if(e===f)p[n]=[0,c];else{let r=t[n-e].length;p[n]=[0,r]}else p[n]=!0}else p[a]=l===c?!l||[l,0]:[l,c-l];return{start:h,end:d,markerLines:p}}(n,s,r),u=n.start&&"number"==typeof n.start.column,c=String(a).length,h=e.split(t,a).slice(o,a).map((e,t)=>{let n=o+1+t,s=` ${` ${n}`.slice(-c)} |`,a=l[n],u=!l[n+1];if(a){let t="";if(Array.isArray(a)){let n=e.slice(0,Math.max(a[0]-1,0)).replace(/[^\t]/g," "),o=a[1]||1;t=["\n ",i.gutter(s.replace(/\d/g," "))," ",n,i.marker("^").repeat(o)].join(""),u&&r.message&&(t+=" "+i.message(r.message))}return[i.marker(">"),i.gutter(s),e.length>0?` ${e}`:"",t].join("")}return` ${i.gutter(s)}${e.length>0?` ${e}`:""}`}).join("\n");return r.message&&!u&&(h=`${" ".repeat(c+1)}${r.message}\n${h}`),h}},()=>(Ut||Bt((Ut={exports:{}}).exports),Ut.exports));Xt({},{__debug:()=>Hs,check:()=>Vs,doc:()=>vs,format:()=>Gs,formatWithCursor:()=>$s,getSupportInfo:()=>Ws,util:()=>_s,version:()=>As});var qt=(e,t,n,r)=>{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Qt=class{diff(e,t,n={}){let r;"function"==typeof n?(r=n,n={}):"callback"in n&&(r=n.callback);let i=this.castInput(e,n),s=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),a=this.removeEmpty(this.tokenize(s,n));return this.diffWithOptionsObj(o,a,n,r)}diffWithOptionsObj(e,t,n,r){var i;let s=e=>(e=this.postProcess(e,n),r?void setTimeout(function(){r(e)},0):e),o=t.length,a=e.length,l=1,u=o+a;null!=n.maxEditLength&&(u=Math.min(u,n.maxEditLength));let c=null!==(i=n.timeout)&&void 0!==i?i:1/0,h=Date.now()+c,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=a&&f+1>=o)return s(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,g=()=>{for(let r=Math.max(p,-l);r<=Math.min(m,l);r+=2){let i,l=d[r-1],u=d[r+1];l&&(d[r-1]=void 0);let c=!1;if(u){let e=u.oldPos-r;c=u&&0<=e&&e=a&&f+1>=o)return s(this.buildValues(i.lastComponent,t,e))||!0;d[r]=i,i.oldPos+1>=a&&(m=Math.min(m,r-1)),f+1>=o&&(p=Math.max(p,r+1))}else d[r]=void 0}l++};if(r)!function e(){setTimeout(function(){if(l>u||Date.now()>h)return r(void 0);g()||e()},0)}();else for(;l<=u&&Date.now()<=h;){let e=g();if(e)return e}}addToPath(e,t,n,r,i){let s=e.lastComponent;return s&&!i.oneChangePerToken&&s.added===t&&s.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:s.count+1,added:t,removed:n,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:s}}}extractCommon(e,t,n,r,i){let s=t.length,o=n.length,a=e.oldPos,l=a-r,u=0;for(;l+1e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(a,a+e.count));a+=e.count,e.added||(l+=e.count)}}return i}},Zt=new class extends Qt{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Jt(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}function en(e,t){let n;switch(t){case"\n":n=/\n/gu;break;case"\r":n=/\r/gu;break;case"\r\n":n=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let r=e.match(n);return r?r.length:0}var tn="string",nn="array",rn="cursor",sn="indent",on="align",an="trim",ln="group",un="fill",cn="if-break",hn="indent-if-break",dn="line-suffix",fn="line-suffix-boundary",pn="line",mn="label",gn="break-parent",En=new Set([rn,sn,on,an,ln,un,cn,hn,dn,fn,pn,mn,gn]),vn=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},Cn=function(e){if("string"==typeof e)return tn;if(Array.isArray(e))return nn;if(!e)return;let{type:t}=e;return En.has(t)?t:void 0};var Dn=class extends Error{name="InvalidDocError";constructor(e){super(function(e){let t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(Cn(e))throw new Error("doc is valid.");let n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;let r=(e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e))([...En].map(e=>`'${e}'`));return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},Sn=Dn,An={},_n=function(e,t,n,r){let i=[e];for(;i.length>0;){let e=i.pop();if(e===An){n(i.pop());continue}n&&i.push(e,An);let s=Cn(e);if(!s)throw new Sn(e);if(!1!==(null==t?void 0:t(e)))switch(s){case nn:case un:{let t=s===nn?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case cn:i.push(e.flatContents,e.breakContents);break;case ln:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case on:case sn:case hn:case mn:case dn:i.push(e.contents);break;case tn:case rn:case an:case fn:case pn:case gn:break;default:throw new Sn(e)}}};function yn(e,t){if("string"==typeof e)return t(e);let n=new Map;return function e(r){if(n.has(r))return n.get(r);let i=function(n){switch(Cn(n)){case nn:return t(n.map(e));case un:return t({...n,parts:n.parts.map(e)});case cn:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case ln:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case on:case sn:case hn:case mn:case dn:return t({...n,contents:e(n.contents)});case tn:case rn:case an:case fn:case pn:case gn:return t(n);default:throw new Sn(n)}}(r);return n.set(r,i),i}(e)}function bn(e,t,n){let r=n,i=!1;return _n(e,function(e){if(i)return!1;let n=t(e);void 0!==n&&(i=!0,r=n)}),r}function Tn(e){if(e.type===ln&&e.break||e.type===pn&&e.hard||e.type===gn)return!0}function Rn(e){if(e.length>0){let t=vn(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function xn(e){return e.type!==pn||e.hard?e.type===cn?e.flatContents:e:e.soft?"":" "}function wn(e){for(e=[...e];e.length>=2&&vn(!1,e,-2).type===pn&&vn(!1,e,-1).type===gn;)e.length-=2;if(e.length>0){let t=Fn(vn(!1,e,-1));e[e.length-1]=t}return e}function Fn(e){switch(Cn(e)){case sn:case hn:case ln:case dn:case mn:{let t=Fn(e.contents);return{...e,contents:t}}case cn:return{...e,breakContents:Fn(e.breakContents),flatContents:Fn(e.flatContents)};case un:return{...e,parts:wn(e.parts)};case nn:return wn(e);case tn:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return tfunction(e){switch(Cn(e)){case un:if(e.parts.every(e=>""===e))return"";break;case ln:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===ln&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case on:case sn:case hn:case dn:if(!e.contents)return"";break;case cn:if(!e.flatContents&&!e.breakContents)return"";break;case nn:{let t=[];for(let n of e){if(!n)continue;let[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof vn(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case tn:case rn:case an:case fn:case pn:case mn:case gn:break;default:throw new Sn(e)}return e}(e))}(e))}function Ln(e){if(e.type===pn)return!0}function On(e,t){return e.type===mn?{...e,contents:t(e.contents)}:t(e)}var In=()=>{},kn=In,Mn=In,Pn=In;function Bn(e){return kn(e),{type:sn,contents:e}}function Un(e,t){return kn(t),{type:on,contents:t,n:e}}function $n(e,t={}){return kn(e),Mn(t.expandedStates,!0),{type:ln,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Gn(e){return kn(e),{type:dn,contents:e}}var Vn={type:fn},Wn={type:gn},Hn={type:an},jn={type:pn,hard:!0},zn={type:pn,hard:!0,literal:!0},Xn={type:pn},Kn={type:pn,soft:!0},Yn=[jn,Wn],qn=[zn,Wn],Qn={type:rn};function Zn(e,t){kn(e),Mn(t);let n=[];for(let r=0;r0){for(let e=0;e!(function(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}(e)||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e)),nr=/[^\x20-\x7F]/u,rr=function(e){if(!e)return 0;if(!nr.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(let n of e){let e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=tr(e)?1:2)}return t},ir=Symbol("MODE_BREAK"),sr=Symbol("MODE_FLAT"),or=Symbol("cursor"),ar=Symbol("DOC_FILL_PRINTED_LENGTH");function lr(e,t){return cr(e,{type:"indent"},t)}function ur(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?cr(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:cr(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function cr(e,t,n){let r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t],i="",s=0,o=0,a=0;for(let e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function hr(e){let t=0,n=0,r=e.length;e:for(;r--;){let i=e[r];if(i!==or)for(let n=i.length-1;n>=0;n--){let s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(or);return t}function dr(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length,a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}let{mode:e,doc:u}=a.pop(),c=Cn(u);switch(c){case tn:l.push(u),n-=rr(u);break;case nn:case un:{let t=c===nn?u:u.parts,n=u[ar]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case sn:case on:case hn:case mn:a.push({mode:e,doc:u.contents});break;case an:n+=hr(l);break;case ln:{if(s&&u.break)return!1;let t=u.break?ir:e,n=u.expandedStates&&t===ir?vn(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case cn:{let t=(u.groupId?i[u.groupId]||sr:e)===ir?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case pn:if(e===ir||u.hard)return!0;u.soft||(l.push(" "),n--);break;case dn:r=!0;break;case fn:if(r)return!1}}return!1}function fr(e,t){let n={},r=t.printWidth,i=Jt(t.endOfLine),s=0,o=[{ind:{value:"",length:0,queue:[]},mode:ir,doc:e}],a=[],l=!1,u=[],c=0;for(function(e){let t=new Set,n=[];_n(e,function(e){if(e.type===gn&&Rn(n),e.type===ln){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===ln&&n.pop().break&&Rn(n)},!0)}(e);o.length>0;){let{ind:e,mode:h,doc:d}=o.pop();switch(Cn(d)){case tn:{let e="\n"!==i?qt(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=rr(e));break}case nn:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case rn:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(or),c++;break;case sn:o.push({ind:lr(e,t),mode:h,doc:d.contents});break;case on:o.push({ind:ur(e,d.n,t),mode:h,doc:d.contents});break;case an:s-=hr(a);break;case ln:switch(h){case sr:if(!l){o.push({ind:e,mode:d.break?ir:sr,doc:d.contents});break}case ir:{l=!1;let t={ind:e,mode:sr,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&dr(t,o,i,a,n))o.push(t);else if(d.expandedStates){let t=vn(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:ir,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:ir,doc:t});break}{let t=d.expandedStates[r],s={ind:e,mode:sr,doc:t};if(dr(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:ir,doc:d.contents});break}}d.id&&(n[d.id]=vn(!1,o,-1).mode);break;case un:{let t=r-s,i=d[ar]??0,{parts:a}=d,l=a.length-i;if(0===l)break;let c=a[i+0],f=a[i+1],p={ind:e,mode:sr,doc:c},m={ind:e,mode:ir,doc:c},g=dr(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}let E={ind:e,mode:sr,doc:f},v={ind:e,mode:ir,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}let C=a[i+2],D={ind:e,mode:h,doc:{...d,[ar]:i+2}};dr({ind:e,mode:sr,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case cn:case hn:{let t=d.groupId?n[d.groupId]:h;if(t===ir){let t=d.type===cn?d.breakContents:d.negate?d.contents:Bn(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===sr){let t=d.type===cn?d.flatContents:d.negate?Bn(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case dn:u.push({ind:e,mode:h,doc:d.contents});break;case fn:u.length>0&&o.push({ind:e,mode:h,doc:jn});break;case pn:switch(h){case sr:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case ir:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=hr(a),a.push(i+e.value),s=e.length)}break;case mn:o.push({ind:e,mode:h,doc:d.contents});break;case gn:break;default:throw new Sn(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}let h=a.indexOf(or);if(-1!==h){let e=a.indexOf(or,h+1);if(-1===e)return{formatted:a.filter(e=>e!==or).join("")};let t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}var pr,mr,gr,Er=function(e,t,n=0){let r=0;for(let i=n;i=0;n-=2)if(!Array.isArray(t[n])&&--e<0)return n;return-1},gr=function*(){let{stack:e}=this;for(let t=e.length-3;t>=0;t-=2){let n=e[t];Array.isArray(n)||(yield n)}};var vr=class{constructor(e){((e,t)=>{t.has(e)?zt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,void 0)})(this,pr),this.stack=[e]}get key(){let{stack:e,siblings:t}=this;return vn(!1,e,null===t?-2:-4)??null}get index(){return null===this.siblings?null:vn(!1,this.stack,-2)}get node(){return vn(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return null!==this.siblings}get siblings(){let{stack:e}=this,t=vn(!1,e,-3);return Array.isArray(t)?t:null}get next(){let{siblings:e}=this;return null===e?null:e[this.index+1]}get previous(){let{siblings:e}=this;return null===e?null:e[this.index-1]}get isFirst(){return 0===this.index}get isLast(){let{siblings:e,index:t}=this;return null!==e&&t===e.length-1}get isRoot(){return 1===this.stack.length}get root(){return this.stack[0]}get ancestors(){return[...Kt(this,pr,gr).call(this)]}getName(){let{stack:e}=this,{length:t}=e;return t>1?vn(!1,e,-2):null}getValue(){return vn(!1,this.stack,-1)}getNode(e=0){let t=Kt(this,pr,mr).call(this,e);return-1===t?null:this.stack[t]}getParentNode(e=0){return this.getNode(e+1)}call(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{return e(this)}finally{n.length=r}}callParent(e,t=0){let n=Kt(this,pr,mr).call(this,t+1),r=this.stack.splice(n+1);try{return e(this)}finally{this.stack.push(...r)}}each(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{for(let t=0;t{n[r]=e(t,r,i)},...t),n}match(...e){let t=this.stack.length-1,n=null,r=this.stack[t--];for(let i of e){if(void 0===r)return!1;let e=null;if("number"==typeof n&&(e=n,n=this.stack[t--],r=this.stack[t--]),i&&!i(r,n,e))return!1;n=this.stack[t--],r=this.stack[t--]}return!0}findAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return t}hasAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return!0;return!1}},Cr=new Proxy(()=>{},{get:()=>Cr}),Dr=Cr;function*Sr(e,t){let{getVisitorKeys:n,filter:r=()=>!0}=t,i=e=>function(e){return null!==e&&"object"==typeof e}(e)&&r(e);for(let t of n(e)){let n=e[t];if(Array.isArray(n))for(let e of n)i(e)&&(yield e);else i(n)&&(yield n)}}function Ar(e){return(t,n,r)=>{let i=!(null==r||!r.backwards);if(!1===n)return!1;let{length:s}=t,o=n;for(;o>=0&&oObject.keys(e).filter(e=>!wr.has(e)),Nr=function(e){return e?t=>e(t,wr):Fr};function Lr(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=function(e){let t=e.type||e.kind||"(unknown type)",n=String(e.name||e.id&&("object"==typeof e.id?e.id.name:e.id)||e.key&&("object"==typeof e.key?e.key.name:e.key)||e.value&&("object"==typeof e.value?"":String(e.value))||e.operator||"");return n.length>20&&(n=n.slice(0,19)+"…"),t+(n?" "+n:"")}(e)}function Or(e,t){t.leading=!0,t.trailing=!1,Lr(e,t)}function Ir(e,t,n){t.leading=!1,t.trailing=!1,n&&(t.marker=n),Lr(e,t)}function kr(e,t){t.leading=!1,t.trailing=!0,Lr(e,t)}var Mr=new WeakMap;function Pr(e,t){if(Mr.has(e))return Mr.get(e);let{printer:{getCommentChildNodes:n,canAttachComment:r,getVisitorKeys:i},locStart:s,locEnd:o}=t;if(!r)return[];let a=((null==n?void 0:n(e,t))??[...Sr(e,{getVisitorKeys:Nr(i)})]).flatMap(e=>r(e)?[e]:Pr(e,t));return a.sort((e,t)=>s(e)-s(t)||o(e)-o(t)),Mr.set(e,a),a}function Br(e,t,n,r){let i,s,{locStart:o,locEnd:a}=n,l=o(t),u=a(t),c=Pr(e,n),h=0,d=c.length;for(;h>1,r=c[e],f=o(r),p=a(r);if(f<=l&&u<=p)return Br(r,t,n,r);if(p<=l)i=r,h=e+1;else{if(!(u<=f))throw new Error("Comment location overlaps with node location");s=r,d=e}}if("TemplateLiteral"===(null==r?void 0:r.type)){let{quasis:e}=r,o=Hr(e,t,n);i&&Hr(e,i,n)!==o&&(i=null),s&&Hr(e,s,n)!==o&&(s=null)}return{enclosingNode:r,precedingNode:i,followingNode:s}}var Ur=()=>!1,$r=e=>!/[\S\n\u2028\u2029]/u.test(e);function Gr(e,t,n,r){let{comment:i,precedingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=o(i);if(s)for(let t=r-1;t>=0;t--){let{comment:r,precedingNode:i}=n[t];if(i!==s||!$r(e.slice(a(r),l)))break;l=o(r)}return xr(e,l,{backwards:!0})}function Vr(e,t,n,r){let{comment:i,followingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=a(i);if(s)for(let t=r+1;t0;--s){let{comment:i,precedingNode:u,followingNode:c}=e[s-1];Dr.strictEqual(u,o),Dr.strictEqual(c,a);let h=t.originalText.slice(t.locEnd(i),l);if(!((null==(r=(n=t.printer).isGap)?void 0:r.call(n,h,t))??/^[\s(]*$/u.test(h)))break;l=t.locStart(i)}for(let[t,{comment:n}]of e.entries())t1&&e.comments.sort((e,n)=>t.locStart(e)-t.locStart(n));e.length=0}function Hr(e,t,n){let r=n.locStart(t)-1;for(let t=1;t"string"==typeof e||"function"==typeof e,choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>"string"==typeof e||"object"==typeof e,cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:"Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.",cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:"Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.",cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function qr({plugins:e=[],showDeprecated:t=!1}={}){let n=e.flatMap(e=>e.languages??[]),r=[];for(let i of function(e){let t=[];for(let[n,r]of Object.entries(e)){let e={name:n,...r};Array.isArray(e.default)&&(e.default=vn(!1,e.default,-1).value),t.push(e)}return t}(Object.assign({},...e.map(({options:e})=>e),Yr)))!t&&i.deprecated||(Array.isArray(i.choices)&&(t||(i.choices=i.choices.filter(e=>!e.deprecated)),"parser"===i.name&&(i.choices=[...i.choices,...Qr(i.choices,n,e)])),i.pluginDefaults=Object.fromEntries(e.filter(e=>{var t;return void 0!==(null==(t=e.defaultOptions)?void 0:t[i.name])}).map(e=>[e.name,e.defaultOptions[i.name]])),r.push(i));return{languages:n,options:r}}function*Qr(e,t,n){let r=new Set(e.map(e=>e.value));for(let e of t)if(e.parsers)for(let t of e.parsers)if(!r.has(t)){r.add(t);let i=n.find(e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t)),s=e.name;null!=i&&i.name&&(s+=` (plugin: ${i.name})`),yield{value:t,description:s}}}var Zr,Jr,ei,ti,ni,ri="windows"===(null==(Zr=globalThis.Deno)?void 0:Zr.build.os)||(null==(ei=null==(Jr=globalThis.navigator)?void 0:Jr.platform)?void 0:ei.startsWith("Win"))||(null==(ni=null==(ti=globalThis.process)?void 0:ti.platform)?void 0:ni.startsWith("win"))||!1;function ii(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function si(e,t){if(!t)return;let n=(e=>String(e).split(/[/\\]/u).pop())(t).toLowerCase();return e.find(({filenames:e})=>null==e?void 0:e.some(e=>e.toLowerCase()===n))??e.find(({extensions:e})=>null==e?void 0:e.some(e=>n.endsWith(e)))}function oi(e,t){if(t){if(String(t).startsWith("file:"))try{t=function(e){return ri?function(e){e=ii(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return""!==e.hostname&&(t=`\\\\${e.hostname}${t}`),t}(e):function(e){return e=ii(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}(e)}(t)}catch{return}if("string"==typeof t)return e.find(({isSupported:e})=>null==e?void 0:e({filepath:t}))}}var ai=function(e,t){let n=((e,t)=>{if(!e||null!=t)return t.toReversed||!Array.isArray(t)?t.toReversed():[...t].reverse()})(!1,e.plugins).flatMap(e=>e.languages??[]),r=function(e,t){if(t)return e.find(({name:e})=>e.toLowerCase()===t)??e.find(({aliases:e})=>null==e?void 0:e.includes(t))??e.find(({extensions:e})=>null==e?void 0:e.includes(`.${t}`))}(n,t.language)??si(n,t.physicalFile)??si(n,t.file)??oi(n,t.physicalFile)??oi(n,t.file)??void t.physicalFile;return null==r?void 0:r.parsers[0]},li={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(e=>li.value(e)).join(", ")}]`;let t=Object.keys(e);return 0===t.length?"{}":`{ ${t.map(t=>`${li.key(t)}: ${li.value(e[t])}`).join(", ")} }`},pair:({key:e,value:t})=>li.value({[e]:t})},ui=new Proxy(String,{get:()=>ui}),ci=ui,hi=Symbol.for("vnopts.VALUE_NOT_EXIST"),di=Symbol.for("vnopts.VALUE_UNCHANGED"),fi=" ".repeat(2);function pi(e,t,n,r){return[`Invalid ${ci.red(r.key(e))} value.`,`Expected ${ci.blue(n)},`,`but received ${t===hi?ci.gray("nothing"):ci.red(r.value(t))}.`].join(" ")}function mi({text:e,list:t},n){let r=[];return e&&r.push(`- ${ci.blue(e)}`),t&&r.push([`- ${ci.blue(t.title)}:`].concat(t.values.map(e=>mi(e,n-fi.length).replace(/^|\n/g,`$&${fi}`))).join("\n")),gi(r,n)}function gi(e,t){if(1===e.length)return e[0];let[n,r]=e,[i,s]=e.map(e=>e.split("\n",1)[0].length);return i>t&&i>s?r:n}var Ei=[],vi=[],Ci=(e,t,{descriptor:n,logger:r,schemas:i})=>{let s=[`Ignored unknown option ${ci.yellow(n.pair({key:e,value:t}))}.`],o=Object.keys(i).sort().find(t=>function(e,t){if(e===t)return 0;let n=e;e.length>t.length&&(e=t,t=n);let r=e.length,i=t.length;for(;r>0&&e.charCodeAt(~-r)===t.charCodeAt(~-i);)r--,i--;let s=0;for(;sa?u>a?a+1:u:u>l?l+1:u;return a}(e,t)<3);o&&s.push(`Did you mean ${ci.blue(n.key(o))}?`),r.warn(s.join(" "))},Di=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"],Si=class{static create(e){return function(e,t){let n=new e(t),r=Object.create(n);for(let e of Di)e in t&&(r[e]=Ai(t[e],n,Si.prototype[e].length));return r}(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,t){return!1}deprecated(e,t){return!1}forward(e,t){}redirect(e,t){}overlap(e,t,n){return e}preprocess(e,t){return e}postprocess(e,t){return di}};function Ai(e,t,n){return"function"==typeof e?(...r)=>e(...r.slice(0,n-1),t,...r.slice(n-1)):()=>e}var _i=class extends Si{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},yi=class extends Si{expected(){return"anything"}validate(){return!0}},bi=class extends Si{constructor({valueSchema:e,name:t=e.name,...n}){super({...n,name:t}),this._valueSchema=e}expected(e){let{text:t,list:n}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:t&&`an array of ${t}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(e,t){if(!Array.isArray(e))return!1;let n=[];for(let r of e){let e=t.normalizeValidateResult(this._valueSchema.validate(r,t),r);!0!==e&&n.push(e.value)}return 0===n.length||{value:n}}deprecated(e,t){let n=[];for(let r of e){let e=t.normalizeDeprecatedResult(this._valueSchema.deprecated(r,t),r);!1!==e&&n.push(...e.map(({value:e})=>({value:[e]})))}return n}forward(e,t){let n=[];for(let r of e){let e=t.normalizeForwardResult(this._valueSchema.forward(r,t),r);n.push(...e.map(Ti))}return n}redirect(e,t){let n=[],r=[];for(let i of e){let e=t.normalizeRedirectResult(this._valueSchema.redirect(i,t),i);"remain"in e&&n.push(e.remain),r.push(...e.redirect.map(Ti))}return 0===n.length?{redirect:r}:{redirect:r,remain:n}}overlap(e,t){return e.concat(t)}};function Ti({from:e,to:t}){return{from:[e],to:t}}var Ri=class extends Si{expected(){return"true or false"}validate(e){return"boolean"==typeof e}};function xi(e,t){let n=Object.create(null);for(let r of e){let e=r[t];if(n[e])throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n[e]=r}return n}function wi(e,t){if(e===t)return 0;let n=typeof e,r=typeof t,i=["undefined","object","boolean","number","string"];return n!==r?i.indexOf(n)-i.indexOf(r):"string"!==n?Number(e)-Number(t):e.localeCompare(t)}function Fi(e){return void 0===e?{}:e}function Ni(e){if("string"==typeof e)return{text:e};let{text:t,list:n}=e;return function(e){if(!e)throw new Error("Unexpected `expected` result, there should be at least one field.")}(void 0!==(t||n)),n?{text:t,list:{title:n.title,values:n.values.map(Ni)}}:{text:t}}function Li(e,t){return!0===e||(!1===e?{value:t}:e)}function Oi(e,t,n=!1){return!1!==e&&(!0===e?!!n||[{value:t}]:"value"in e?[e]:0!==e.length&&e)}function Ii(e,t){return"string"==typeof e||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function ki(e,t){return void 0===e?[]:Array.isArray(e)?e.map(e=>Ii(e,t)):[Ii(e,t)]}function Mi(e,t){let n=ki("object"==typeof e&&"redirect"in e?e.redirect:e,t);return 0===n.length?{remain:t,redirect:n}:"object"==typeof e&&"remain"in e?{remain:e.remain,redirect:n}:{redirect:n}}var Pi,Bi=class extends Si{constructor(e){super(e),this._choices=function(e,t){let n=new Map;for(let r of e){let e=r[t];if(n.has(e))throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n.set(e,r)}return n}(e.choices.map(e=>e&&"object"==typeof e?e:{value:e}),"value")}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(e=>this._choices.get(e)).filter(({hidden:e})=>!e).map(e=>e.value).sort(wi).map(e.value),n=t.slice(0,-2),r=t.slice(-2);return{text:n.concat(r.join(" or ")).join(", "),list:{title:"one of the following values",values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return!(!t||!t.deprecated)&&{value:e}}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},Ui=class extends Si{expected(){return"a number"}validate(e,t){return"number"==typeof e}},$i=class extends Ui{expected(){return"an integer"}validate(e,t){return!0===t.normalizeValidateResult(super.validate(e,t),e)&&function(e){return e===Math.floor(e)}(e)}},Gi=class extends Si{expected(){return"a string"}validate(e){return"string"==typeof e}},Vi=li,Wi=Ci,Hi=(e,t,n)=>{let{text:r,list:i}=n.normalizeExpectedResult(n.schemas[e].expected(n)),s=[];return r&&s.push(pi(e,t,r,n.descriptor)),i&&s.push([pi(e,t,i.title,n.descriptor)].concat(i.values.map(e=>mi(e,n.loggerPrintWidth))).join("\n")),gi(s,n.loggerPrintWidth)},ji=(e,t,{descriptor:n})=>{let r=[`${ci.yellow("string"==typeof e?n.key(e):n.pair(e))} is deprecated`];return t&&r.push(`we now treat it as ${ci.blue("string"==typeof t?n.key(t):n.pair(t))}`),r.join("; ")+"."},zi=class{constructor(e,t){let{logger:n=console,loggerPrintWidth:r=80,descriptor:i=Vi,unknown:s=Wi,invalid:o=Hi,deprecated:a=ji,missing:l=()=>!1,required:u=()=>!1,preprocess:c=e=>e,postprocess:h=()=>di}=t||{};this._utils={descriptor:i,logger:n||{warn:()=>{}},loggerPrintWidth:r,schemas:xi(e,"name"),normalizeDefaultResult:Fi,normalizeExpectedResult:Ni,normalizeDeprecatedResult:Oi,normalizeForwardResult:ki,normalizeRedirectResult:Mi,normalizeValidateResult:Li},this._unknownHandler=s,this._invalidHandler=function(e){return(...t)=>{let n=e(...t);return"string"==typeof n?new Error(n):n}}(o),this._deprecatedHandler=a,this._identifyMissing=(e,t)=>!(e in t)||l(e,t),this._identifyRequired=u,this._preprocess=c,this._postprocess=h,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=function(){let e=Object.create(null);return t=>{let n=JSON.stringify(t);return!!e[n]||(e[n]=!0,!1)}}()}normalize(e){let t={},n=[this._preprocess(e,this._utils)],r=()=>{for(;0!==n.length;){let e=n.shift(),r=this._applyNormalization(e,t);n.push(...r)}};r();for(let e of Object.keys(this._utils.schemas)){let r=this._utils.schemas[e];if(!(e in t)){let t=Fi(r.default(this._utils));"value"in t&&n.push({[e]:t.value})}}r();for(let e of Object.keys(this._utils.schemas)){if(!(e in t))continue;let n=this._utils.schemas[e],r=t[e],i=n.postprocess(r,this._utils);i!==di&&(this._applyValidation(i,e,n),t[e]=i)}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let n=[],{knownKeys:r,unknownKeys:i}=this._partitionOptionKeys(e);for(let i of r){let r=this._utils.schemas[i],s=r.preprocess(e[i],this._utils);this._applyValidation(s,i,r);let o=({from:e,to:t})=>{n.push("string"==typeof t?{[t]:e}:{[t.key]:t.value})},a=({value:e,redirectTo:t})=>{let n=Oi(r.deprecated(e,this._utils),s,!0);if(!1!==n)if(!0===n)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,t,this._utils));else for(let{value:e}of n){let n={key:i,value:e};if(!this._hasDeprecationWarned(n)){let r="string"==typeof t?{key:t,value:e}:t;this._utils.logger.warn(this._deprecatedHandler(n,r,this._utils))}}};ki(r.forward(s,this._utils),s).forEach(o);let l=Mi(r.redirect(s,this._utils),s);if(l.redirect.forEach(o),"remain"in l){let e=l.remain;t[i]=i in t?r.overlap(t[i],e,this._utils):e,a({value:e})}for(let{from:e,to:t}of l.redirect)a({value:e,redirectTo:t})}for(let r of i){let i=e[r];this._applyUnknownHandler(r,i,t,(e,t)=>{n.push({[e]:t})})}return n}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,hi,this._utils)}_partitionOptionKeys(e){let[t,n]=function(e,t){let n=[],r=[];for(let i of e)t(i)?n.push(i):r.push(i);return[n,r]}(Object.keys(e).filter(t=>!this._identifyMissing(t,e)),e=>e in this._utils.schemas);return{knownKeys:t,unknownKeys:n}}_applyValidation(e,t,n){let r=Li(n.validate(e,this._utils),e);if(!0!==r)throw this._invalidHandler(t,r.value,this._utils)}_applyUnknownHandler(e,t,n,r){let i=this._unknownHandler(e,t,this._utils);if(i)for(let e of Object.keys(i)){if(this._identifyMissing(e,i))continue;let t=i[e];e in this._utils.schemas?r(e,t):n[e]=t}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==di){if(t.delete)for(let n of t.delete)delete e[n];if(t.override){let{knownKeys:n,unknownKeys:r}=this._partitionOptionKeys(t.override);for(let r of n){let n=t.override[r];this._applyValidation(n,r,this._utils.schemas[r]),e[r]=n}for(let n of r){let r=t.override[n];this._applyUnknownHandler(n,r,e,(t,n)=>{let r=this._utils.schemas[t];this._applyValidation(n,t,r),e[t]=n})}}}}};function Xi(e,{isCLI:t,optionInfos:n,FlagSchema:r}){let i,{name:s}=e,o={name:s},a={};switch(e.type){case"int":i=$i,t&&(o.preprocess=Number);break;case"string":case"path":i=Gi;break;case"choice":i=Bi,o.choices=e.choices.map(t=>null!=t&&t.redirect?{...t,redirect:{to:{key:e.name,value:t.redirect}}}:t);break;case"boolean":i=Ri;break;case"flag":i=r,o.flags=n.flatMap(e=>[e.alias,e.description&&e.name,e.oppositeDescription&&`no-${e.name}`].filter(Boolean));break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?o.validate=(t,n,r)=>e.exception(t)||n.validate(t,r):o.validate=(e,t,n)=>void 0===e||t.validate(e,n),e.redirect&&(a.redirect=t=>t?{to:"string"==typeof e.redirect?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(a.deprecated=!0),t&&!e.array){let e=o.preprocess||(e=>e);o.preprocess=(t,n,r)=>n.preprocess(e(Array.isArray(t)?vn(!1,t,-1):t),r)}return e.array?bi.create({...t?{preprocess:e=>Array.isArray(e)?e:[e]}:{},...a,valueSchema:i.create(o)}):i.create({...o,...a})}var Ki=(e,t,n)=>{if(!e||null!=t){if(t.findLast)return t.findLast(n);for(let e=t.length-1;e>=0;e--){let r=t[e];if(n(r,e,t))return r}}};function Yi(e,t){if(!t)throw new Error("parserName is required.");let n=Ki(!1,e,e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t));if(n)return n;let r=`Couldn't resolve parser "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}function qi({plugins:e,parser:t}){return Qi(Yi(e,t),t)}function Qi(e,t){let n=e.parsers[t];return"function"==typeof n?n():n}var Zi={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null},Ji=async function(e,t={}){var n;let r={...e};if(!r.parser){if(!r.filepath)throw new Kr("No parser and no file path given, couldn't infer a parser.");if(r.parser=ai(r,{physicalFile:r.filepath}),!r.parser)throw new Kr(`No parser could be inferred for file "${r.filepath}".`)}let i=qr({plugins:e.plugins,showDeprecated:!0}).options,s={...Zi,...Object.fromEntries(i.filter(e=>void 0!==e.default).map(e=>[e.name,e.default]))},o=Yi(r.plugins,r.parser),a=await Qi(o,r.parser);r.astFormat=a.astFormat,r.locEnd=a.locEnd,r.locStart=a.locStart;let l=null!=(n=o.printers)&&n[a.astFormat]?o:function(e,t){if(!t)throw new Error("astFormat is required.");let n=Ki(!1,e,e=>e.printers&&Object.prototype.hasOwnProperty.call(e.printers,t));if(n)return n;let r=`Couldn't find plugin for AST format "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}(r.plugins,a.astFormat),u=await function(e,t){let n=e.printers[t];return"function"==typeof n?n():n}(l,a.astFormat);r.printer=u;let c={...s,...l.defaultOptions?Object.fromEntries(Object.entries(l.defaultOptions).filter(([,e])=>void 0!==e)):{}};for(let[e,t]of Object.entries(c))(null===r[e]||void 0===r[e])&&(r[e]=t);return"json"===r.parser&&(r.trailingComma="none"),function(e,t,{logger:n=!1,isCLI:r=!1,passThrough:i=!1,FlagSchema:s,descriptor:o}={}){if(r){if(!s)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=li;let a=i?Array.isArray(i)?(e,t)=>i.includes(e)?{[e]:t}:void 0:(e,t)=>({[e]:t}):(e,t,n)=>{let{_:r,...i}=n.schemas;return Ci(e,t,{...n,schemas:i})},l=function(e,{isCLI:t,FlagSchema:n}){let r=[];t&&r.push(yi.create({name:"_"}));for(let i of e)r.push(Xi(i,{isCLI:t,optionInfos:e,FlagSchema:n})),i.alias&&t&&r.push(_i.create({name:i.alias,sourceName:i.name}));return r}(t,{isCLI:r,FlagSchema:s}),u=new zi(l,{logger:n,unknown:a,descriptor:o}),c=!1!==n;c&&Pi&&(u._hasDeprecationWarned=Pi);let h=u.normalize(e);return c&&(Pi=u._hasDeprecationWarned),h}(r,i,{passThrough:Object.keys(Zi),...t})},es=((e,t,n)=>(n=null!=e?$t(Ht(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of Wt(t))!jt.call(e,n)&&void 0!==n&&Gt(e,n,{get:()=>t[n],enumerable:!(r=Vt(t,n))||r.enumerable});return e})(Gt(n,"default",{value:e,enumerable:!0}),e)))(Yt()),ts=async function(e,t){let n,r=await qi(t),i=r.preprocess?r.preprocess(e,t):e;t.originalText=i;try{n=await r.parse(i,t,t)}catch(t){!function(e,t){let{loc:n}=e;if(n){let r=(0,es.codeFrameColumns)(t,n,{highlightCode:!0});throw e.message+="\n"+r,e.codeFrame=r,e}throw e}(t,e)}return{text:i,ast:n}};async function ns(e,t){({ast:e}=await is(e,t));let n=new Map,r=new vr(e),i=()=>{},s=new Map;await async function(e,t,n,r,i){let{embeddedLanguageFormatting:s,printer:{embed:o,hasPrettierIgnore:a=()=>!1,getVisitorKeys:l}}=n;if(!o||"auto"!==s)return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let u=Nr(o.getVisitorKeys??l),c=[];!function t(){let{node:r}=e;if(null===r||"object"!=typeof r||a(e))return;for(let n of u(r))Array.isArray(r[n])?e.each(t,n):e.call(t,n);let s=o(e,n);if(s){if("function"==typeof s)return void c.push({print:s,node:r,pathStack:[...e.stack]});i.set(r,s)}}();let h=e.stack;for(let{print:r,node:s,pathStack:o}of c)try{e.stack=o;let a=await r(d,t,e,n);a&&i.set(s,a)}catch(e){if(globalThis.PRETTIER_DEBUG)throw e}function d(e,t){return async function(e,t,n,r){let i=await Ji({...n,...t,parentParser:n.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:s}=await ts(e,i);return Nn(await r(s,i))}(e,t,n,r)}e.stack=h}(r,a,t,ns,s);let o=await rs(r,t,a,void 0,s);if(function(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:n}=e;for(let e of t){if(!e.printed&&!n.has(e))throw new Error('Comment "'+e.value.trim()+'" was not printed. Please report this error!');delete e.printed}}(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return[Qn,o];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[o,Qn]}return o;function a(e,t){return void 0===e||e===r?l(t):Array.isArray(e)?r.call(()=>l(t),...e):r.call(()=>l(t),e)}function l(e){i(r);let o=r.node;if(null==o)return"";let l=o&&"object"==typeof o&&void 0===e;if(l&&n.has(o))return n.get(o);let u=rs(r,t,a,e,s);return l&&n.set(o,u),u}}function rs(e,t,n,r,i){var s;let o,{node:a}=e,{printer:l}=t;switch(o=null!=(s=l.hasPrettierIgnore)&&s.call(l,e)?function(e,t){let{originalText:n,[Symbol.for("comments")]:r,locStart:i,locEnd:s,[Symbol.for("printedComments")]:o}=t,{node:a}=e,l=i(a),u=s(a);for(let e of r)i(e)>=l&&s(e)<=u&&o.add(e);return n.slice(l,u)}(e,t):i.has(a)?i.get(a):l.print(e,t,n,r),a){case t.cursorNode:o=On(o,e=>[Qn,e,Qn]);break;case t.nodeBeforeCursor:o=On(o,e=>[e,Qn]);break;case t.nodeAfterCursor:o=On(o,e=>[Qn,e])}return l.printComment&&(!l.willPrintOwnComments||!l.willPrintOwnComments(e,t))&&(o=function(e,t,n){let{leading:r,trailing:i}=function(e,t){let n=e.node;if(!n)return{};let r=t[Symbol.for("printedComments")];if(0===(n.comments||[]).filter(e=>!r.has(e)).length)return{leading:"",trailing:""};let i,s=[],o=[];return e.each(()=>{let n=e.node;if(null!=r&&r.has(n))return;let{leading:a,trailing:l}=n;a?s.push(function(e,t){var n;let r=e.node,i=[zr(e,t)],{printer:s,originalText:o,locStart:a,locEnd:l}=t;if(null==(n=s.isBlockComment)?void 0:n.call(s,r)){let e=xr(o,l(r))?xr(o,a(r),{backwards:!0})?Yn:Xn:" ";i.push(e)}else i.push(Yn);let u=Rr(o,yr(o,l(r)));return!1!==u&&xr(o,u)&&i.push(Yn),i}(e,t)):l&&(i=function(e,t,n){var r;let i=e.node,s=zr(e,t),{printer:o,originalText:a,locStart:l}=t,u=null==(r=o.isBlockComment)?void 0:r.call(o,i);if(null!=n&&n.hasLineSuffix&&(null==n||!n.isBlock)||xr(a,l(i),{backwards:!0})){let e=jr(a,l(i));return{doc:Gn([Yn,e?Yn:"",s]),isBlock:u,hasLineSuffix:!0}}return!u||null!=n&&n.hasLineSuffix?{doc:[Gn([" ",s]),Wn],isBlock:u,hasLineSuffix:!0}:{doc:[" ",s],isBlock:u,hasLineSuffix:!1}}(e,t,i),o.push(i.doc))},"comments"),{leading:s,trailing:o}}(e,n);return r||i?On(t,e=>[r,e,i]):t}(e,o,t)),o}async function is(e,t){let n=e.comments??[];t[Symbol.for("comments")]=n,t[Symbol.for("printedComments")]=new Set,function(e,t){let{comments:n}=e;if(delete e.comments,!function(e){return Array.isArray(e)&&e.length>0}(n)||!t.printer.canAttachComment)return;let r=[],{printer:{experimentalFeatures:{avoidAstMutation:i=!1}={},handleComments:s={}},originalText:o}=t,{ownLine:a=Ur,endOfLine:l=Ur,remaining:u=Ur}=s,c=n.map((r,i)=>({...Br(e,r,t),comment:r,text:o,options:t,ast:e,isLastComment:n.length-1===i}));for(let[e,t]of c.entries()){let n,{comment:s,precedingNode:o,enclosingNode:h,followingNode:d,text:f,options:p,ast:m,isLastComment:g}=t;if(i?n=[t]:(s.enclosingNode=h,s.precedingNode=o,s.followingNode=d,n=[s,f,p,m,g]),Gr(f,p,c,e))s.placement="ownLine",a(...n)||(d?Or(d,s):o?kr(o,s):Ir(h||m,s));else if(Vr(f,p,c,e))s.placement="endOfLine",l(...n)||(o?kr(o,s):d?Or(d,s):Ir(h||m,s));else if(s.placement="remaining",!u(...n))if(o&&d){let e=r.length;e>0&&r[e-1].followingNode!==d&&Wr(r,p),r.push(t)}else o?kr(o,s):d?Or(d,s):Ir(h||m,s)}if(Wr(r,t),!i)for(let e of n)delete e.precedingNode,delete e.enclosingNode,delete e.followingNode}(e,t);let{printer:{preprocess:r}}=t;return{ast:e=r?await r(e,t):e,comments:n}}var ss=function(e,t){let{cursorOffset:n,locStart:r,locEnd:i}=t,s=Nr(t.printer.getVisitorKeys),o=e=>r(e)<=n&&i(e)>=n,a=e,l=[e];for(let t of function*(e,t){let n=[e];for(let e=0;e0&&(void 0===u||void 0===c);){a=l.pop();let e=void 0!==u,t=void 0!==c;for(let o of Sr(a,{getVisitorKeys:s})){if(!e){let e=i(o);e<=n&&e>h&&(u=o,h=e)}if(!t){let e=r(o);e>=n&&e{if(!e||null!=t){if(t.findLastIndex)return t.findLastIndex(n);for(let e=t.length-1;e>=0;e--)if(n(t[e],e,t))return e;return-1}})(!1,e,e=>"Program"!==e.type&&"File"!==e.type);return-1===t?e:e.slice(0,t+1)}function as(e,t,n,r,i=[],s){let{locStart:o,locEnd:a}=n,l=o(e),u=a(e);if(!(t>u||t=0&&(t={...t,...ss(r,t)});let s=await ns(r,t);n>0&&(s=Jn([Yn,s],n,t.tabWidth));let o=fr(s,t);if(n>0){let e=o.formatted.trim();void 0!==o.cursorNodeStart&&(o.cursorNodeStart-=o.formatted.indexOf(e),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>e.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=e+Jt(t.endOfLine)}let a=t[Symbol.for("comments")];if(t.cursorOffset>=0){let e,n,r,s;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&o.cursorNodeText)if(r=o.cursorNodeStart,s=o.cursorNodeText,t.cursorNode)e=t.locStart(t.cursorNode),n=i.slice(e,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");e=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let r=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):i.length;n=i.slice(e,r)}else e=0,n=i,r=0,s=o.formatted;let l=t.cursorOffset-e;if(n===s)return{formatted:o.formatted,cursorOffset:r+l,comments:a};let u=n.split("");u.splice(l,0,hs);let c=function(e,t){return Zt.diff(e,t,void 0)}(u,s.split("")),h=r;for(let e of c)if(e.removed){if(e.value.includes(hs))break}else h+=e.count;return{formatted:o.formatted,cursorOffset:h,comments:a}}return{formatted:o.formatted,cursorOffset:-1,comments:a}}function fs(e,t,n){return"number"!=typeof t||Number.isNaN(t)||t<0||t>e.length?n:t}function ps(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i}=t;return n=fs(e,n,-1),r=fs(e,r,0),i=fs(e,i,e.length),{...t,cursorOffset:n,rangeStart:r,rangeEnd:i}}function ms(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s}=ps(e,t),o="\ufeff"===e.charAt(0);if(o&&(e=e.slice(1),n--,r--,i--),"auto"===s&&(s=function(e){let t=e.indexOf("\r");return-1!==t?"\n"===e.charAt(t+1)?"crlf":"cr":"lf"}(e)),e.includes("\r")){let t=t=>en(e.slice(0,Math.max(t,0)),"\r\n");n-=t(n),r-=t(r),i-=t(i),e=function(e){return qt(!1,e,/\r\n?/gu,"\n")}(e)}return{hasBOM:o,text:e,options:ps(e,{...t,cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s})}}async function gs(e,t){let n=await qi(t);return!n.hasPragma||n.hasPragma(e)}async function Es(e,t){let n,{hasBOM:r,text:i,options:s}=ms(e,await Ji(t));return s.rangeStart>=s.rangeEnd&&""!==i||s.requirePragma&&!await gs(i,s)||s.checkIgnorePragma&&await async function(e,t){var n;let r=await qi(t);return null==(n=r.hasIgnorePragma)?void 0:n.call(r,e)}(i,s)?{formatted:e,cursorOffset:t.cursorOffset,comments:[]}:(s.rangeStart>0||s.rangeEndr);let a=e.slice(r,i).search(/\S/u),l=-1===a;if(!l)for(r+=a;i>r&&!/\S/u.test(e[i-1]);--i);let u,c,h=as(n,r,t,(e,n)=>cs(t,e,n),[],"rangeStart"),d=l?h:as(n,i,t,e=>cs(t,e),[],"rangeEnd");if(!h||!d)return{rangeStart:0,rangeEnd:0};if((({parser:e})=>"json"===e||"json5"===e||"jsonc"===e||"json-stringify"===e)(t)){let e=function(e,t){let n=[e.node,...e.parentNodes],r=new Set([t.node,...t.parentNodes]);return n.find(e=>ls.has(e.type)&&r.has(e))}(h,d);u=e,c=e}else({startNode:u,endNode:c}=function(e,t,{locStart:n,locEnd:r}){let i=e.node,s=t.node;if(i===s)return{startNode:i,endNode:s};let o=n(e.node);for(let e of os(t.parentNodes)){if(!(n(e)>=o))break;s=e}let a=r(t.node);for(let t of os(e.parentNodes)){if(!(r(t)<=a))break;if(i=t,i===s)break}return{startNode:i,endNode:s}}(h,d,t));return{rangeStart:Math.min(s(u),s(c)),rangeEnd:Math.max(o(u),o(c))}}(r,t,n),o=r.slice(i,s),a=Math.min(i,r.lastIndexOf("\n",i)+1),l=r.slice(a,i).match(/^\s*/u)[0],u=Er(l,t.tabWidth),c=await ds(o,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>i&&t.cursorOffset<=s?t.cursorOffset-i:-1,endOfLine:"lf"},u),h=c.formatted.trimEnd(),{cursorOffset:d}=t;d>s?d+=h.length-o.length:c.cursorOffset>=0&&(d=c.cursorOffset+i);let f=r.slice(0,i)+h+r.slice(s);if("lf"!==t.endOfLine){let e=Jt(t.endOfLine);d>=0&&"\r\n"===e&&(d+=en(f.slice(0,d),"\n")),f=qt(!1,f,"\n",e)}return{formatted:f,cursorOffset:d,comments:c.comments}}(i,s):(!s.requirePragma&&s.insertPragma&&s.printer.insertPragma&&!await gs(i,s)&&(i=s.printer.insertPragma(i)),n=await ds(i,s)),r&&(n.formatted="\ufeff"+n.formatted,n.cursorOffset>=0&&n.cursorOffset++),n)}var vs={};Xt(vs,{builders:()=>Cs,printer:()=>Ds,utils:()=>Ss});var Cs={join:Zn,line:Xn,softline:Kn,hardline:Yn,literalline:qn,group:$n,conditionalGroup:function(e,t){return $n(e[0],{...t,expandedStates:e})},fill:function(e){return Pn(e),{type:un,parts:e}},lineSuffix:Gn,lineSuffixBoundary:Vn,cursor:Qn,breakParent:Wn,ifBreak:function(e,t="",n={}){return kn(e),""!==t&&kn(t),{type:cn,breakContents:e,flatContents:t,groupId:n.groupId}},trim:Hn,indent:Bn,indentIfBreak:function(e,t){return kn(e),{type:hn,contents:e,groupId:t.groupId,negate:t.negate}},align:Un,addAlignmentToDoc:Jn,markAsRoot:function(e){return Un({type:"root"},e)},dedentToRoot:function(e){return Un(Number.NEGATIVE_INFINITY,e)},dedent:function(e){return Un(-1,e)},hardlineWithoutBreakParent:jn,literallineWithoutBreakParent:zn,label:function(e,t){return kn(t),e?{type:mn,label:e,contents:t}:t},concat:e=>e},Ds={printDocToString:fr},Ss={willBreak:function(e){return bn(e,Tn,!1)},traverseDoc:_n,findInDoc:bn,mapDoc:yn,removeLines:function(e){return yn(e,xn)},stripTrailingHardline:Nn,replaceEndOfLine:function(e,t=qn){return yn(e,e=>"string"==typeof e?Zn(t,e.split("\n")):e)},canBreak:function(e){return bn(e,Ln,!1)}},As="3.6.2",_s={};Xt(_s,{addDanglingComment:()=>Ir,addLeadingComment:()=>Or,addTrailingComment:()=>kr,getAlignmentSize:()=>Er,getIndentSize:()=>xs,getMaxContinuousCount:()=>ws,getNextNonSpaceNonCommentCharacter:()=>Fs,getNextNonSpaceNonCommentCharacterIndex:()=>Ms,getPreferredQuote:()=>Ls,getStringWidth:()=>rr,hasNewline:()=>xr,hasNewlineInRange:()=>Os,hasSpaces:()=>Is,isNextLineEmpty:()=>Bs,isNextLineEmptyAfterIndex:()=>Rs,isPreviousLineEmpty:()=>Ps,makeString:()=>ks,skip:()=>Ar,skipEverythingButNewLine:()=>Tr,skipInlineComment:()=>ys,skipNewline:()=>Rr,skipSpaces:()=>yr,skipToLineEnd:()=>br,skipTrailingComment:()=>bs,skipWhitespace:()=>_r});var ys=function(e,t){if(!1===t)return!1;if("/"===e.charAt(t)&&"*"===e.charAt(t+1))for(let n=t+2;nMath.max(e,n.length/t.length),0)},Fs=function(e,t){let n=Ts(e,t);return!1===n?"":e.charAt(n)},Ns="'",Ls=function(e,t){let n=!0===t||t===Ns?Ns:'"',r=n===Ns?'"':Ns,i=0,s=0;for(let t of e)t===n?i++:t===r&&s++;return i>s?r:n},Os=function(e,t,n){for(let r=t;ri===r?i:s===t?"\\"+s:s||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(i)?i:"\\"+i));return t+i+t};function Ms(e,t){return 2===arguments.length||"number"==typeof t?Ts(e,t):function(e,t,n){return Ts(e,n(t))}(...arguments)}function Ps(e,t){return 2===arguments.length||"number"==typeof t?jr(e,t):function(e,t,n){return jr(e,n(t))}(...arguments)}function Bs(e,t){return 2===arguments.length||"number"==typeof t?Rs(e,t):function(e,t,n){return Rs(e,n(t))}(...arguments)}function Us(e,t=1){return async(...n)=>{let r=n[t]??{},i=r.plugins??[];return n[t]={...r,plugins:Array.isArray(i)?i:Object.values(i)},e(...n)}}var $s=Us(Es);async function Gs(e,t){let{formatted:n}=await $s(e,{...t,cursorOffset:-1});return n}async function Vs(e,t){return await Gs(e,t)===e}var Ws=Us(qr,0),Hs={parse:Us(async function(e,t,n){let{text:r,options:i}=ms(e,await Ji(t)),s=await ts(r,i);return n&&(n.preprocessForPrint&&(s.ast=await is(s.ast,i)),n.massage&&(s.ast=function(e,t){let{printer:{massageAstNode:n,getVisitorKeys:r}}=t;if(!n)return e;let i=Nr(r),s=n.ignoredProperties??new Set;return function e(t,r){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>e(t,r)).filter(Boolean);let o={},a=new Set(i(t));for(let n in t)!Object.prototype.hasOwnProperty.call(t,n)||s.has(n)||(a.has(n)?o[n]=e(t[n],t):o[n]=t[n]);let l=n(t,o,r);return null!==l?l??o:void 0}(e)}(s.ast,i))),s}),formatAST:Us(async function(e,t){return t=await Ji(t),fr(await ns(e,t),t)}),formatDoc:Us(async function(e,t){let n=function(e){let t=Object.create(null),n=new Set;return function e(t,n,i){var s,o;if("string"==typeof t)return JSON.stringify(t);if(Array.isArray(t)){let n=t.map(e).filter(Boolean);return 1===n.length?n[0]:`[${n.join(", ")}]`}if(t.type===pn){let e=(null==(s=null==i?void 0:i[n+1])?void 0:s.type)===gn;return t.literal?e?"literalline":"literallineWithoutBreakParent":t.hard?e?"hardline":"hardlineWithoutBreakParent":t.soft?"softline":"line"}if(t.type===gn)return(null==(o=null==i?void 0:i[n-1])?void 0:o.type)===pn&&i[n-1].hard?void 0:"breakParent";if(t.type===an)return"trim";if(t.type===sn)return"indent("+e(t.contents)+")";if(t.type===on)return t.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+e(t.contents)+")":t.n<0?"dedent("+e(t.contents)+")":"root"===t.n.type?"markAsRoot("+e(t.contents)+")":"align("+JSON.stringify(t.n)+", "+e(t.contents)+")";if(t.type===cn)return"ifBreak("+e(t.breakContents)+(t.flatContents?", "+e(t.flatContents):"")+(t.groupId?(t.flatContents?"":', ""')+`, { groupId: ${r(t.groupId)} }`:"")+")";if(t.type===hn){let n=[];t.negate&&n.push("negate: true"),t.groupId&&n.push(`groupId: ${r(t.groupId)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return`indentIfBreak(${e(t.contents)}${i})`}if(t.type===ln){let n=[];t.break&&"propagated"!==t.break&&n.push("shouldBreak: true"),t.id&&n.push(`id: ${r(t.id)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return t.expandedStates?`conditionalGroup([${t.expandedStates.map(t=>e(t)).join(",")}]${i})`:`group(${e(t.contents)}${i})`}if(t.type===un)return`fill([${t.parts.map(t=>e(t)).join(", ")}])`;if(t.type===dn)return"lineSuffix("+e(t.contents)+")";if(t.type===fn)return"lineSuffixBoundary";if(t.type===mn)return`label(${JSON.stringify(t.label)}, ${e(t.contents)})`;if(t.type===rn)return"cursor";throw new Error("Unknown doc type "+t.type)}(er(e));function r(e){if("symbol"!=typeof e)return JSON.stringify(String(e));if(e in t)return t[e];let r=e.description||"symbol";for(let i=0;;i++){let s=r+(i>0?` #${i}`:"");if(!n.has(s))return n.add(s),t[e]=`Symbol.for(${JSON.stringify(s)})`}}}(e),{formatted:r}=await Es(n,{...t,parser:"__js_expression"});return r}),printToDoc:Us(async function(e,t){t=await Ji(t);let{ast:n}=await ts(e,t);return t.cursorOffset>=0&&(t={...t,...ss(n,t)}),ns(n,t)}),printDocToString:Us(async function(e,t){return fr(e,await Ji(t))})},js=Object.defineProperty;((e,t)=>{for(var n in t)js(e,n,{get:t[n],enumerable:!0})})({},{builders:()=>Jo,printer:()=>ea,utils:()=>ta});var zs="string",Xs="array",Ks="cursor",Ys="indent",qs="align",Qs="trim",Zs="group",Js="fill",eo="if-break",to="indent-if-break",no="line-suffix",ro="line-suffix-boundary",io="line",so="label",oo="break-parent",ao=new Set([Ks,Ys,qs,Qs,Zs,Js,eo,to,no,ro,io,so,oo]),lo=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},uo=function(e){if("string"==typeof e)return zs;if(Array.isArray(e))return Xs;if(!e)return;const{type:t}=e;return ao.has(t)?t:void 0};var co=class extends Error{name="InvalidDocError";constructor(e){super(function(e){const t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(uo(e))throw new Error("doc is valid.");const n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;const r=(i=[...ao].map(e=>`'${e}'`),new Intl.ListFormat("en-US",{type:"disjunction"}).format(i));var i;return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},ho={},fo=function(e,t,n,r){const i=[e];for(;i.length>0;){const e=i.pop();if(e===ho){n(i.pop());continue}n&&i.push(e,ho);const s=uo(e);if(!s)throw new co(e);if(!1!==(null==t?void 0:t(e)))switch(s){case Xs:case Js:{const t=s===Xs?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case eo:i.push(e.flatContents,e.breakContents);break;case Zs:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case qs:case Ys:case to:case so:case no:i.push(e.contents);break;case zs:case Ks:case Qs:case ro:case io:case oo:break;default:throw new co(e)}}};function po(e,t){if("string"==typeof e)return t(e);const n=new Map;return function e(r){if(n.has(r))return n.get(r);const i=function(n){switch(uo(n)){case Xs:return t(n.map(e));case Js:return t({...n,parts:n.parts.map(e)});case eo:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case Zs:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case qs:case Ys:case to:case so:case no:return t({...n,contents:e(n.contents)});case zs:case Ks:case Qs:case ro:case io:case oo:return t(n);default:throw new co(n)}}(r);return n.set(r,i),i}(e)}function mo(e,t,n){let r=n,i=!1;return fo(e,function(e){if(i)return!1;const n=t(e);void 0!==n&&(i=!0,r=n)}),r}function go(e){return!(e.type!==Zs||!e.break)||!(e.type!==io||!e.hard)||e.type===oo||void 0}function Eo(e){if(e.length>0){const t=lo(!1,e,-1);t.expandedStates||t.break||(t.break="propagated")}return null}function vo(e){return e.type!==io||e.hard?e.type===eo?e.flatContents:e:e.soft?"":" "}function Co(e){for(e=[...e];e.length>=2&&lo(!1,e,-2).type===io&&lo(!1,e,-1).type===oo;)e.length-=2;if(e.length>0){const t=Do(lo(!1,e,-1));e[e.length-1]=t}return e}function Do(e){switch(uo(e)){case Ys:case to:case Zs:case no:case so:{const t=Do(e.contents);return{...e,contents:t}}case eo:return{...e,breakContents:Do(e.breakContents),flatContents:Do(e.flatContents)};case Js:return{...e,parts:Co(e.parts)};case Xs:return Co(e);case zs:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return t{},_o=Ao,yo=Ao,bo=Ao;function To(e){return _o(e),{type:Ys,contents:e}}function Ro(e,t){return _o(t),{type:qs,contents:t,n:e}}function xo(e,t={}){return _o(e),yo(t.expandedStates,!0),{type:Zs,id:t.id,contents:e,break:Boolean(t.shouldBreak),expandedStates:t.expandedStates}}var wo={type:ro},Fo={type:oo},No={type:Qs},Lo={type:io,hard:!0},Oo={type:io,hard:!0,literal:!0},Io={type:io},ko={type:io,soft:!0},Mo=[Lo,Fo],Po=[Oo,Fo],Bo={type:Ks};function Uo(e,t){_o(e),yo(t);const n=[];for(let r=0;r{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Go=e=>{return!(12288===(t=e)||t>=65281&&t<=65376||t>=65504&&t<=65510||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e));var t},Vo=/[^\x20-\x7F]/u,Wo=function(e){if(!e)return 0;if(!Vo.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(const n of e){const e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=Go(e)?1:2)}return t},Ho=Symbol("MODE_BREAK"),jo=Symbol("MODE_FLAT"),zo=Symbol("cursor"),Xo=Symbol("DOC_FILL_PRINTED_LENGTH");function Ko(e,t){return qo(e,{type:"indent"},t)}function Yo(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?qo(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:qo(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function qo(e,t,n){const r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t];let i="",s=0,o=0,a=0;for(const e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function Qo(e){let t=0,n=0,r=e.length;e:for(;r--;){const i=e[r];if(i!==zo)for(let n=i.length-1;n>=0;n--){const s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(zo);return t}function Zo(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length;const a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}const{mode:e,doc:u}=a.pop(),c=uo(u);switch(c){case zs:l.push(u),n-=Wo(u);break;case Xs:case Js:{const t=c===Xs?u:u.parts,n=u[Xo]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case Ys:case qs:case to:case so:a.push({mode:e,doc:u.contents});break;case Qs:n+=Qo(l);break;case Zs:{if(s&&u.break)return!1;const t=u.break?Ho:e,n=u.expandedStates&&t===Ho?lo(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case eo:{const t=(u.groupId?i[u.groupId]||jo:e)===Ho?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case io:if(e===Ho||u.hard)return!0;u.soft||(l.push(" "),n--);break;case no:r=!0;break;case ro:if(r)return!1}}return!1}var Jo={join:Uo,line:Io,softline:ko,hardline:Mo,literalline:Po,group:xo,conditionalGroup:function(e,t){return xo(e[0],{...t,expandedStates:e})},fill:function(e){return bo(e),{type:Js,parts:e}},lineSuffix:function(e){return _o(e),{type:no,contents:e}},lineSuffixBoundary:wo,cursor:Bo,breakParent:Fo,ifBreak:function(e,t="",n={}){return _o(e),""!==t&&_o(t),{type:eo,breakContents:e,flatContents:t,groupId:n.groupId}},trim:No,indent:To,indentIfBreak:function(e,t){return _o(e),{type:to,contents:e,groupId:t.groupId,negate:t.negate}},align:Ro,addAlignmentToDoc:function(e,t,n){_o(e);let r=e;if(t>0){for(let e=0;ee},ea={printDocToString:function(e,t){const n={},r=t.printWidth,i=function(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}(t.endOfLine);let s=0;const o=[{ind:{value:"",length:0,queue:[]},mode:Ho,doc:e}],a=[];let l=!1;const u=[];let c=0;for(function(e){const t=new Set,n=[];fo(e,function(e){if(e.type===oo&&Eo(n),e.type===Zs){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===Zs&&n.pop().break&&Eo(n)},!0)}(e);o.length>0;){const{ind:e,mode:h,doc:d}=o.pop();switch(uo(d)){case zs:{const e="\n"!==i?$o(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=Wo(e));break}case Xs:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case Ks:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(zo),c++;break;case Ys:o.push({ind:Ko(e,t),mode:h,doc:d.contents});break;case qs:o.push({ind:Yo(e,d.n,t),mode:h,doc:d.contents});break;case Qs:s-=Qo(a);break;case Zs:switch(h){case jo:if(!l){o.push({ind:e,mode:d.break?Ho:jo,doc:d.contents});break}case Ho:{l=!1;const t={ind:e,mode:jo,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&Zo(t,o,i,a,n))o.push(t);else if(d.expandedStates){const t=lo(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:Ho,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:Ho,doc:t});break}{const t=d.expandedStates[r],s={ind:e,mode:jo,doc:t};if(Zo(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:Ho,doc:d.contents});break}}d.id&&(n[d.id]=lo(!1,o,-1).mode);break;case Js:{const t=r-s,i=d[Xo]??0,{parts:a}=d,l=a.length-i;if(0===l)break;const c=a[i+0],f=a[i+1],p={ind:e,mode:jo,doc:c},m={ind:e,mode:Ho,doc:c},g=Zo(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}const E={ind:e,mode:jo,doc:f},v={ind:e,mode:Ho,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}const C=a[i+2],D={ind:e,mode:h,doc:{...d,[Xo]:i+2}};Zo({ind:e,mode:jo,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case eo:case to:{const t=d.groupId?n[d.groupId]:h;if(t===Ho){const t=d.type===eo?d.breakContents:d.negate?d.contents:To(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===jo){const t=d.type===eo?d.flatContents:d.negate?To(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case no:u.push({ind:e,mode:h,doc:d.contents});break;case ro:u.length>0&&o.push({ind:e,mode:h,doc:Lo});break;case io:switch(h){case jo:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case Ho:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=Qo(a),a.push(i+e.value),s=e.length)}break;case so:o.push({ind:e,mode:h,doc:d.contents});break;case oo:break;default:throw new co(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}const h=a.indexOf(zo);if(-1!==h){const e=a.indexOf(zo,h+1);if(-1===e)return{formatted:a.filter(e=>e!==zo).join("")};const t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}},ta={willBreak:function(e){return mo(e,go,!1)},traverseDoc:fo,findInDoc:mo,mapDoc:po,removeLines:function(e){return po(e,vo)},stripTrailingHardline:function(e){return Do(function(e){return po(e,e=>function(e){switch(uo(e)){case Js:if(e.parts.every(e=>""===e))return"";break;case Zs:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===Zs&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case qs:case Ys:case to:case no:if(!e.contents)return"";break;case eo:if(!e.flatContents&&!e.breakContents)return"";break;case Xs:{const t=[];for(const n of e){if(!n)continue;const[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof lo(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case zs:case Ks:case Qs:case ro:case io:case so:case oo:break;default:throw new co(e)}return e}(e))}(e))},replaceEndOfLine:function(e,t=Po){return po(e,e=>"string"==typeof e?Uo(t,e.split("\n")):e)},canBreak:function(e){return mo(e,So,!1)}};function na(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}class ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class ia extends ra{constructor(e){super([]),this.idx=1,Object.assign(this,ma(e))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class sa extends ra{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ma(e))}}class oa extends ra{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ma(e))}}class aa extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class la extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ua extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ca extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ha extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class da extends ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ma(e))}}class fa{constructor(e){this.idx=1,Object.assign(this,ma(e))}accept(e){e.visit(this)}}function pa(e){function t(e){return e.map(pa)}if(e instanceof ia){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return"string"==typeof e.label&&(t.label=e.label),t}if(e instanceof oa)return{type:"Alternative",definition:t(e.definition)};if(e instanceof aa)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof la)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof ua)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ha)return{type:"RepetitionWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ca)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof da)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof fa){const t={type:"Terminal",name:e.terminalType.name,label:(n=e.terminalType,"string"==typeof(r=n).LABEL&&""!==r.LABEL?n.LABEL:n.name),idx:e.idx};"string"==typeof e.label&&(t.terminalLabel=e.label);const i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=i instanceof RegExp?i.source:i),t}if(e instanceof sa)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match");var n,r}function ma(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}class ga{visit(e){const t=e;switch(t.constructor){case ia:return this.visitNonTerminal(t);case oa:return this.visitAlternative(t);case aa:return this.visitOption(t);case la:return this.visitRepetitionMandatory(t);case ua:return this.visitRepetitionMandatoryWithSeparator(t);case ha:return this.visitRepetitionWithSeparator(t);case ca:return this.visitRepetition(t);case da:return this.visitAlternation(t);case fa:return this.visitTerminal(t);case sa:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Ea(e,t=[]){return!!(e instanceof aa||e instanceof ca||e instanceof ha)||(e instanceof da?e.definition.some(e=>Ea(e,t)):!(e instanceof ia&&t.includes(e))&&e instanceof ra&&(e instanceof ia&&t.push(e),e.definition.every(e=>Ea(e,t))))}function va(e){if(e instanceof ia)return"SUBRULE";if(e instanceof aa)return"OPTION";if(e instanceof da)return"OR";if(e instanceof la)return"AT_LEAST_ONE";if(e instanceof ua)return"AT_LEAST_ONE_SEP";if(e instanceof ha)return"MANY_SEP";if(e instanceof ca)return"MANY";if(e instanceof fa)return"CONSUME";throw Error("non exhaustive match")}class Ca{walk(e,t=[]){e.definition.forEach((n,r)=>{const i=e.definition.slice(r+1);if(n instanceof ia)this.walkProdRef(n,i,t);else if(n instanceof fa)this.walkTerminal(n,i,t);else if(n instanceof oa)this.walkFlat(n,i,t);else if(n instanceof aa)this.walkOption(n,i,t);else if(n instanceof la)this.walkAtLeastOne(n,i,t);else if(n instanceof ua)this.walkAtLeastOneSep(n,i,t);else if(n instanceof ha)this.walkManySep(n,i,t);else if(n instanceof ca)this.walkMany(n,i,t);else{if(!(n instanceof da))throw Error("non exhaustive match");this.walkOr(n,i,t)}})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);e.definition.forEach(e=>{const t=new oa({definition:[e]});this.walk(t,r)})}}function Da(e,t,n){return[new aa({definition:[new fa({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Sa(e){if(e instanceof ia)return Sa(e.referencedRule);if(e instanceof fa)return[e.terminalType];if(function(e){return e instanceof oa||e instanceof aa||e instanceof ca||e instanceof la||e instanceof ua||e instanceof ha||e instanceof fa||e instanceof sa}(e))return function(e){let t=[];const n=e.definition;let r,i=0,s=n.length>i,o=!0;for(;s&&o;)r=n[i],o=Ea(r),t=t.concat(Sa(r)),i+=1,s=n.length>i;return[...new Set(t)]}(e);if(function(e){return e instanceof da}(e))return function(e){const t=e.definition.map(e=>Sa(e));return[...new Set(t.flat())]}(e);throw Error("non exhaustive match")}const Aa="_~IN~_";class _a extends Ca{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=(i=e.referencedRule,s=e.idx,i.name+s+Aa+this.topProd.name);var i,s;const o=t.concat(n),a=Sa(new oa({definition:o}));this.follows[r]=a}}function ya(e){return e.charCodeAt(0)}function ba(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function Ta(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t],e[t]=!0}function Ra(e){if(void 0===e)throw Error("Internal Error - Should never get here!");return!0}function xa(){throw Error("Internal Error - Should never get here!")}function wa(e){return"Character"===e.type}const Fa=[];for(let e=ya("0");e<=ya("9");e++)Fa.push(e);const Na=[ya("_")].concat(Fa);for(let e=ya("a");e<=ya("z");e++)Na.push(e);for(let e=ya("A");e<=ya("Z");e++)Na.push(e);const La=[ya(" "),ya("\f"),ya("\n"),ya("\r"),ya("\t"),ya("\v"),ya("\t"),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya("\u2028"),ya("\u2029"),ya(" "),ya(" "),ya(" "),ya("\ufeff")],Oa=/[0-9a-fA-F]/,Ia=/[0-9]/,ka=/[1-9]/;class Ma{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}function Pa(e){console&&console.error&&console.error(`Error: ${e}`)}function Ba(e){console&&console.warn&&console.warn(`Warning: ${e}`)}let Ua={};const $a=new class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Ta(n,"global");break;case"i":Ta(n,"ignoreCase");break;case"m":Ta(n,"multiLine");break;case"u":Ta(n,"unicode");break;case"y":Ta(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":let t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}}Ra(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return xa()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;Ra(t)}if(!0!==e||void 0!==t)return Ra(t)?("?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t):void 0}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),Ra(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):xa()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ya("\n"),ya("\r"),ya("\u2028"),ya("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=Fa;break;case"D":e=Fa,t=!0;break;case"s":e=La;break;case"S":e=La,t=!0;break;case"w":e=Na;break;case"W":e=Na,t=!0}return Ra(e)?{type:"Set",value:e,complement:t}:xa()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ya("\f");break;case"n":e=ya("\n");break;case"r":e=ya("\r");break;case"t":e=ya("\t");break;case"v":e=ya("\v")}return Ra(e)?{type:"Character",value:e}:xa()}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:ya("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:ya(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:ya(this.popChar())}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const t=this.classAtom();if(t.type,wa(t)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,wa(n)){if(n.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};function Ga(e){const t=e.toString();if(Ua.hasOwnProperty(t))return Ua[t];{const e=$a.pattern(t);return Ua[t]=e,e}}const Va="Complement Sets are not supported for first char optimization",Wa='Unable to use "first char" lexer optimizations:\n';function Ha(e,t=!1){try{const t=Ga(e);return ja(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===Va)t&&Ba(`${Wa}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),Pa(`${Wa}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function ja(e,t,n){switch(e.type){case"Disjunction":for(let r=0;r{if("number"==typeof e)za(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)za(e,t,n);else{for(let e=r.from;e<=r.to&&e=ul){const e=r.from>=ul?r.from:ul,n=r.to,i=hl(e),s=hl(n);for(let e=i;e<=s;e++)t[e]=e}}}});break;case"Group":ja(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}const o=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===Ka(s)||"Group"!==s.type&&!1===o)break}break;default:throw Error("non exhaustive match!")}return Object.values(t)}function za(e,t,n){const r=hl(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=hl(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=hl(e.charCodeAt(0));t[n]=n}}}(e,t)}function Xa(e,t){return e.value.find(e=>{if("number"==typeof e)return t.includes(e);{const n=e;return void 0!==t.find(e=>n.from<=e&&e<=n.to)}})}function Ka(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(Array.isArray(e.value)?e.value.every(Ka):Ka(e.value))}class Ya extends Ma{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e);case"Lookbehind":return void this.visitLookbehind(e);case"NegativeLookbehind":return void this.visitNegativeLookbehind(e)}super.visitChildren(e)}}visitCharacter(e){this.targetCharCodes.includes(e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===Xa(e,this.targetCharCodes)&&(this.found=!0):void 0!==Xa(e,this.targetCharCodes)&&(this.found=!0)}}function qa(e,t){if(t instanceof RegExp){const n=Ga(t),r=new Ya(e);return r.visit(n),r.found}for(const n of t){const t=n.charCodeAt(0);if(e.includes(t))return!0}return!1}const Qa="PATTERN",Za="defaultMode",Ja="modes";const el=/[^\\][$]/,tl=/[^\\[][\^]|^\^/;function nl(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function rl(e){const t=e.PATTERN;if(t instanceof RegExp)return!1;if("function"==typeof t)return!0;if(Object.hasOwn(t,"exec"))return!0;if("string"==typeof t)return!1;throw Error("non exhaustive match")}function il(e){return"string"==typeof e&&1===e.length&&e.charCodeAt(0)}const sl={test:function(e){const t=e.length;for(let n=this.lastIndex;n"string"==typeof e?e.charCodeAt(0):e)}function ll(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const ul=256;let cl=[];function hl(e){return ee.CATEGORIES).flat().filter(Boolean);const e=n.filter(e=>!t.includes(e));t=t.concat(e),0===e.length?r=!1:n=e}return t}(e);!function(e){e.forEach(e=>{var t;Cl(e)||(gl[ml]=e,e.tokenTypeIdx=ml++),Dl(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Dl(e)||(e.CATEGORIES=[]),t=e,Object.hasOwn(null!=t?t:{},"categoryMatches")||(e.categoryMatches=[]),function(e){return Object.hasOwn(null!=e?e:{},"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})})}(t),function(e){e.forEach(e=>{vl([],e)})}(t),function(e){e.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(t=>{e.categoryMatches.push(gl[t].tokenTypeIdx)})})}(t),t.forEach(e=>{e.isParent=e.categoryMatches.length>0})}function vl(e,t){e.forEach(e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),t.CATEGORIES.forEach(n=>{const r=e.concat(t);r.includes(n)||vl(r,n)})}function Cl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}function Dl(e){return Object.hasOwn(null!=e?e:{},"CATEGORIES")}function Sl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}var Al;!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"}(Al||(Al={}));const _l={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:{buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i,s)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`},traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(_l);class yl{constructor(e,t=_l){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=Object.assign({},_l,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===_l.lineTerminatorsPattern)this.config.lineTerminatorsPattern=sl;else if(this.config.lineTerminatorCharacters===_l.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Array.isArray(e)?n={modes:{defaultMode:[...e]},defaultMode:Za}:(r=!1,n=Object.assign({},e))}),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){const t=[];return Object.hasOwn(e,Za)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+Za+"> property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(e,Ja)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(e,Ja)&&Object.hasOwn(e,Za)&&!Object.hasOwn(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${Za}: <${e.defaultMode}>which does not exist\n`,type:Al.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(e,Ja)&&Object.keys(e.modes).forEach(n=>{const r=e.modes[n];r.forEach((e,i)=>{void 0===e?t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:Al.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(e,"LONGER_ALT")&&(Array.isArray(e.LONGER_ALT)?e.LONGER_ALT:[e.LONGER_ALT]).forEach(i=>{void 0===i||r.includes(i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${e.name}> outside of mode <${n}>\n`,type:Al.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(function(e,t,n){const r=[];let i=!1;const s=Object.values(e.modes||{}).flat().filter(Boolean).filter(e=>e[Qa]!==yl.NA),o=al(n);return t&&s.forEach(e=>{const t=ol(e,o);if(!1!==t){const n=function(e,t){if(t.issue===Al.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Al.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else Object.hasOwn(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):qa(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:Al.NO_LINE_BREAKS_FLAGS}),r}(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},Object.entries(n.modes).forEach(([e,t])=>{n.modes[e]=t.filter(e=>void 0!==e)});const i=Object.keys(n.modes);if(Object.entries(n.modes).forEach(([e,n])=>{this.TRACE_INIT(`Mode: <${e}> processing`,()=>{if(this.modes.push(e),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e,t){let n=[];const r=function(e){const t=e.filter(e=>!Object.hasOwn(e,Qa));return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:Al.MISSING_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(e);n=n.concat(r.errors);const i=function(e){const t=e.filter(e=>{const t=e[Qa];return!(t instanceof RegExp||"function"==typeof t||Object.hasOwn(t,"exec")||"string"==typeof t)});return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Al.INVALID_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=e.filter(e=>e[Qa]instanceof RegExp);return t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return el.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return tl.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){return e.filter(e=>{const t=e[Qa];return t instanceof RegExp&&(t.multiline||t.global)}).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Al.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){const t=[];let n=e.map(n=>e.reduce((e,r)=>(n.PATTERN.source!==r.PATTERN.source||t.includes(r)||r.PATTERN===yl.NA||(t.push(r),e.push(r)),e),[]));return n=n.filter(Boolean),n.filter(e=>e.length>1).map(e=>{const t=e.map(e=>e.name);return{message:`The same RegExp pattern ->${e[0].PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:Al.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}(n)),t=t.concat(function(e){return e.filter(e=>e.PATTERN.test("")).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:Al.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}(n)),t}(s)),n=n.concat(function(e){const t=e.filter(e=>{if(!Object.hasOwn(e,"GROUP"))return!1;const t=e.GROUP;return t!==yl.SKIPPED&&t!==yl.NA&&!("string"==typeof t)});return t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Al.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}(s)),n=n.concat(function(e,t){return e.filter(e=>void 0!==e.PUSH_MODE&&!t.includes(e.PUSH_MODE)).map(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:Al.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}(s,t)),n=n.concat(function(e){const t=[],n=e.reduce((e,t,n)=>{const r=t.PATTERN;return r===yl.NA||("string"==typeof r?e.push({str:r,idx:n,tokenType:t}):r instanceof RegExp&&(i=r,void 0===[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(e=>-1!==i.source.indexOf(e)))&&e.push({str:r.source,idx:n,tokenType:t})),e;var i},[]);return e.forEach((e,r)=>{n.forEach(({str:n,idx:i,tokenType:s})=>{if(r${s.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:Al.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}})}),t}(s)),n}(n,i))}),0===this.lexerDefinitionErrors.length){let r;El(n),this.TRACE_INIT("analyzeTokenTypes",()=>{r=function(e,t){const n=(t=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()},t)).tracer;let r;n("initCharCodeToOptimizedIndexMap",()=>{!function(){if(0===cl.length){cl=new Array(65536);for(let e=0;e<65536;e++)cl[e]=e>255?255+~~(e/255):e}}()}),n("Reject Lexer.NA",()=>{r=e.filter(e=>e[Qa]!==yl.NA)});let i,s,o,a,l,u,c,h,d,f,p,m=!1;n("Transform Patterns",()=>{m=!1,i=r.map(e=>{const t=e[Qa];if(t instanceof RegExp){const e=t.source;return 1!==e.length||"^"===e||"$"===e||"."===e||t.ignoreCase?2!==e.length||"\\"!==e[0]||["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(e[1])?nl(t):e[1]:e}if("function"==typeof t)return m=!0,{exec:t};if("object"==typeof t)return m=!0,t;if("string"==typeof t){if(1===t.length)return t;{const e=t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return nl(new RegExp(e))}}throw Error("non exhaustive match")})}),n("misc mapping",()=>{s=r.map(e=>e.tokenTypeIdx),o=r.map(e=>{const t=e.GROUP;if(t!==yl.SKIPPED){if("string"==typeof t)return t;if(void 0===t)return!1;throw Error("non exhaustive match")}}),a=r.map(e=>{const t=e.LONGER_ALT;if(t)return Array.isArray(t)?t.map(e=>r.indexOf(e)):[r.indexOf(t)]}),l=r.map(e=>e.PUSH_MODE),u=r.map(e=>Object.hasOwn(e,"POP_MODE"))}),n("Line Terminator Handling",()=>{const e=al(t.lineTerminatorCharacters);c=r.map(e=>!1),"onlyOffset"!==t.positionTracking&&(c=r.map(t=>Object.hasOwn(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===ol(t,e)&&qa(e,t.PATTERN)))}),n("Misc Mapping #2",()=>{h=r.map(rl),d=i.map(il),f=r.reduce((e,t)=>{const n=t.GROUP;return"string"==typeof n&&n!==yl.SKIPPED&&(e[n]=[]),e},{}),p=i.map((e,t)=>({pattern:i[t],longerAlt:a[t],canLineTerminator:c[t],isCustom:h[t],short:d[t],group:o[t],push:l[t],pop:u[t],tokenTypeIdx:s[t],tokenType:r[t]}))});let g=!0,E=[];return t.safeMode||n("First Char Optimization",()=>{E=r.reduce((e,n,r)=>{if("string"==typeof n.PATTERN){const t=hl(n.PATTERN.charCodeAt(0));ll(e,t,p[r])}else if(Array.isArray(n.START_CHARS_HINT)){let t;n.START_CHARS_HINT.forEach(n=>{const i=hl("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,ll(e,i,p[r]))})}else if(n.PATTERN instanceof RegExp)if(n.PATTERN.unicode)g=!1,t.ensureOptimizations&&Pa(`${Wa}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=Ha(n.PATTERN,t.ensureOptimizations);0===i.length&&(g=!1),i.forEach(t=>{ll(e,t,p[r])})}else t.ensureOptimizations&&Pa(`${Wa}\tTokenType: <${n.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return e},[])}),{emptyGroups:f,patternIdxToConfig:p,charCodeToPatternIdxToConfig:E,hasCustom:m,canBeOptimized:g}}(n,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[e]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[e]=r.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[e]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}this.lexerDefinitionWarning.forEach(e=>{Ba(e.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(r&&(this.handleModes=()=>{}),!1===this.trackStartLines&&(this.computeNewColumn=e=>e),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=()=>{}),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const e=Object.entries(this.canModeBeOptimized).reduce((e,[t,n])=>(!1===n&&e.push(t),e),[]);if(t.ensureOptimizations&&e.length>0)throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Ua={}}),this.TRACE_INIT("toFastProperties",()=>{na(this)})})}tokenize(e,t=this.defaultMode){if(this.lexerDefinitionErrors.length>0){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,s,o,a,l,u,c,h,d,f,p,m,g;const E=e,v=E.length;let C=0,D=0;const S=this.hasCustom?0:Math.floor(e.length/10),A=new Array(S),_=[];let y=this.trackStartLines?1:void 0,b=this.trackStartLines?1:void 0;const T=function(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(!Array.isArray(r))throw Error("non exhaustive match");t[n]=[]}),t}(this.emptyGroups),R=this.trackStartLines,x=this.config.lineTerminatorsPattern;let w=0,F=[],N=[];const L=[],O=[];Object.freeze(O);let I=!1;const k=e=>{if(1===L.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);_.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{L.pop();const e=L.at(-1);F=this.patternIdxToConfig[e],N=this.charCodeToPatternIdxToConfig[e],w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}};function M(e){L.push(e),N=this.charCodeToPatternIdxToConfig[e],F=this.patternIdxToConfig[e],w=F.length,w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}let P;M.call(this,t);const B=this.config.recoveryEnabled;for(;Ca.length){a=s,c=s.length,l=u,P=t;break}}}break}}if(-1!==c){if(h=P.group,void 0!==h&&(a=null!==a?a:e.substring(C,C+c),d=P.tokenTypeIdx,f=this.createTokenInstance(a,C,d,P.tokenType,y,b,c),this.handlePayload(f,l),!1===h?D=this.addToken(A,D,f):T[h].push(f)),!0===R&&!0===P.canLineTerminator){let t,n,r=0;x.lastIndex=0;do{a=null!==a?a:e.substring(C,C+c),t=x.test(a),!0===t&&(n=x.lastIndex-1,r++)}while(!0===t);0!==r?(y+=r,b=c-n,this.updateTokenEndLineColumnLocation(f,h,n,r,y,b,c)):b=this.computeNewColumn(b,c)}else b=this.computeNewColumn(b,c);C+=c,this.handleModes(P,k,M,f)}else{const t=C,n=y,i=b;let s=!1===B;for(;!1===s&&C`Expecting ${Tl(e)?`--\x3e ${bl(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o="\nbut found: '"+t[0].image+"'";return r?s+r+o:s+`one of these possible Token sequences:\n${e.reduce((e,t)=>e.concat(t),[]).map(e=>`[${e.map(e=>bl(e)).join(", ")}]`).map((e,t)=>` ${t+1}. ${e}`).join("\n")}`+o},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",s="\nbut found: '"+t[0].image+"'";return n?i+n+s:i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map(e=>`[${e.map(e=>bl(e)).join(",")}]`).join(" ,")}>`+s}};Object.freeze(Bl);const Ul={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},$l={buildDuplicateFoundError(e,t){const n=e.name,r=t[0],i=r.idx,s=va(r),o=(a=r)instanceof fa?a.terminalType.name:a instanceof ia?a.nonTerminalName:"";var a;let l=`->${s}${i>0?i:""}<- ${o?`with argument: ->${o}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,"\n"),l},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=e.prefixPath.map(e=>bl(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=0===e.alternation.idx?"":e.alternation.idx,n=0===e.prefixPath.length;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule,\n`;return r+=n?"These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n":`<${e.prefixPath.map(e=>bl(e)).join(", ")}> may appears as a prefix path in all these alternatives.\n`,r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=va(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${t} --\x3e ${e.leftRecursionPath.map(e=>e.name).concat([t]).join(" --\x3e ")}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof sa?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class Gl extends ga{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:rc.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Vl extends Ca{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){0===this.ruleStack.length?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Wl extends Vl{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const e=t.concat(n),r=new oa({definition:e});this.possibleTokTypes=Sa(r),this.found=!0}}}class Hl extends Ca{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class jl extends Hl{walkMany(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}}class zl extends Hl{walkManySep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}}class Xl extends Hl{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}}class Kl extends Hl{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}}function Yl(e,t,n=[]){n=[...n];let r=[],i=0;function s(s){const o=Yl(s.concat(e.slice(i+1)),t,n);return r.concat(o)}for(;n.length{0!==e.definition.length&&(r=s(e.definition))}),r;if(!(t instanceof fa))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:e.slice(i)}),r}function ql(e,t,n,r){const i=[...n];i.push(e.name);const s=[...r];return s.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:s}}var Ql;function Zl(e){if(e instanceof aa||"Option"===e)return Ql.OPTION;if(e instanceof ca||"Repetition"===e)return Ql.REPETITION;if(e instanceof la||"RepetitionMandatory"===e)return Ql.REPETITION_MANDATORY;if(e instanceof ua||"RepetitionMandatoryWithSeparator"===e)return Ql.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ha||"RepetitionWithSeparator"===e)return Ql.REPETITION_WITH_SEPARATOR;if(e instanceof da||"Alternation"===e)return Ql.ALTERNATION;throw Error("non exhaustive match")}function Jl(e,t,n,r){const i=e.length,s=e.every(e=>e.every(e=>1===e.length));if(t)return function(t){const r=t.map(e=>e.GATE);for(let t=0;te.flat()).reduce((e,t,n)=>(t.forEach(t=>{t.tokenTypeIdx in e||(e[t.tokenTypeIdx]=n),t.categoryMatches.forEach(t=>{Object.hasOwn(e,t)||(e[t]=n)})}),e),{});return function(){const e=this.LA_FAST(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t1===e.length),i=e.length;if(r&&!n){const t=e.flat();if(1===t.length&&0===t[0].categoryMatches.length){const e=t[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===e}}{const e=t.reduce((e,t,n)=>(e[t.tokenTypeIdx]=!0,t.categoryMatches.forEach(t=>{e[t]=!0}),e),[]);return function(){const t=this.LA_FAST(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;nYl([e],1)),r=ru(n.length),i=n.map(e=>{const t={};return e.forEach(e=>{iu(e.partialPath).forEach(e=>{t[e]=!0})}),t});let s=n;for(let e=1;e<=t;e++){const n=s;s=ru(n.length);for(let o=0;o{iu(e.partialPath).forEach(e=>{i[o][e]=!0})})}}}}return r}function au(e,t,n,r){const i=new nu(e,Ql.ALTERNATION,r);return t.accept(i),ou(i.result,n)}function lu(e,t,n,r){const i=new nu(e,n);t.accept(i);const s=i.result,o=new tu(t,e,n).startWalking();return ou([new oa({definition:s}),new oa({definition:o})],r)}function uu(e,t){e:for(let n=0;ne.every(e=>e.every(e=>0===e.categoryMatches.length)))}function hu(e){return`${va(e)}_#_${e.idx}_#_${du(e)}`}function du(e){return e instanceof fa?e.terminalType.name:e instanceof ia?e.nonTerminalName:""}class fu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function pu(e,t,n,r=[]){const i=[],s=mu(t.definition);if(0===s.length)return[];{const t=e.name;s.includes(e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:rc.LEFT_RECURSION,ruleName:t});const o=r.concat([e]),a=s.filter(e=>!o.includes(e)).flatMap(t=>{const i=[...r];return i.push(t),pu(e,t,n,i)});return i.concat(a)}}function mu(e){let t=[];if(0===e.length)return t;const n=e[0];if(n instanceof ia)t.push(n.referencedRule);else if(n instanceof oa||n instanceof aa||n instanceof la||n instanceof ua||n instanceof ha||n instanceof ca)t=t.concat(mu(n.definition));else if(n instanceof da)t=n.definition.map(e=>mu(e.definition)).flat();else if(!(n instanceof fa))throw Error("non exhaustive match");const r=Ea(n),i=e.length>1;if(r&&i){const n=e.slice(1);return t.concat(mu(n))}return t}class gu extends ga{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}class Eu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}const vu="MismatchedTokenException",Cu="NoViableAltException",Du="EarlyExitException",Su="NotAllInputParsedException",Au=[vu,Cu,Du,Su];function _u(e){return Au.includes(e.name)}Object.freeze(Au);class yu extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class bu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=vu}}class Tu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Cu}}class Ru extends yu{constructor(e,t){super(e,t),this.name=Su}}class xu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Du}}const wu={},Fu="InRuleRecoveryException";class Nu extends Error{constructor(e){super(e),this.name=Fu}}function Lu(e,t,n,r,i,s,o){const a=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[a];if(void 0===l){const e=this.getCurrRuleFullName();l=new s(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[a]=l}let u=l.token,c=l.occurrence;const h=l.isEndOfRule;0===this.RULE_STACK_IDX&&h&&void 0===u&&(u=Ml,c=1),void 0!==u&&void 0!==c&&this.shouldInRepetitionRecoveryBeTried(u,c,o)&&this.tryInRepetitionRecovery(e,t,n,u)}const Ou=1024,Iu=1280,ku=1536;function Mu(e,t,n){return n|t|e}class Pu{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:tc.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(0===t.length){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return e.flatMap(e=>pu(e,e,$l))}validateEmptyOrAlternatives(e){return e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.slice(0,-1).flatMap((r,i)=>0===function(e,t,n){const r="EXIT_NONE_TERMINAL",i=[r],s="EXIT_ALTERNATIVE";let o=!1;const a=t.length,l=a-1-1,u=[],c=[];for(c.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});0!==c.length;){const e=c.pop();if(e===s){o&&c.at(-1).idx<=l&&c.pop();continue}const h=e.def,d=e.idx,f=e.ruleStack,p=e.occurrenceStack;if(0===h.length)continue;const m=h[0];if(m===r){const e={idx:d,def:h.slice(1),ruleStack:f.slice(0,-1),occurrenceStack:p.slice(0,-1)};c.push(e)}else if(m instanceof fa)if(d=0;e--){const t={idx:d,def:m.definition[e].definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p};c.push(t),c.push(s)}else if(m instanceof oa)c.push({idx:d,def:m.definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p});else{if(!(m instanceof sa))throw Error("non exhaustive match");c.push(ql(m,d,f,p))}}return u}([r],[],fl).length?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:rc.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}(e,$l))}validateAmbiguousAlternationAlternatives(e,t){return e.flatMap(e=>function(e,t,n){const r=new gu;e.accept(r);let i=r.alternations;i=i.filter(e=>!0!==e.ignoreAmbiguities);return i.flatMap(r=>{const i=r.idx,s=r.maxLookahead||t,o=au(i,e,s,r),a=function(e,t,n,r){const i=[];return e.reduce((n,r,s)=>(!0===t.definition[s].ignoreAmbiguities||r.forEach(r=>{const o=[s];e.forEach((e,n)=>{s!==n&&uu(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&o.push(n)}),o.length>1&&!uu(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]).map(e=>{const i=e.alts.map(e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}(o,r,e,n),l=function(e,t,n,r){const i=e.reduce((e,t,n)=>{const r=t.map(e=>({idx:n,path:e}));return e.concat(r)},[]);return i.flatMap(e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const s=e.idx,o=e.path;return i.filter(e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx{const n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}));var n,r}).map(e=>{const i=[e.idx+1,s+1],o=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})})}(o,r,e,n);return a.concat(l)})}(e,t,$l))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return e.forEach(e=>{const i=new Eu;e.accept(i),i.allProductions.forEach(i=>{const s=Zl(i),o=i.maxLookahead||t;if(0===lu(i.idx,e,s,o)[0].flat().length){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:rc.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}(e,t,$l)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,s){const o=au(e,t,n);return s(o,r,cu(o)?pl:fl,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Jl)}buildLookaheadForOptional(e){return function(e,t,n,r,i,s){const o=lu(e,t,i,n),a=cu(o)?pl:fl;return s(o[0],a,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Zl(e.prodType),eu)}}const Bu=new class extends ga{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function Uu(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset"function"==typeof e.GATE);return s.hasPredicates=o,n.definition.push(s),i.forEach(e=>{const t=new oa({definition:[]});s.definition.push(t),Object.hasOwn(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Object.hasOwn(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),Hu}function Zu(e){return 0===e?"":`${e}`}function Ju(e){if(e<0||e>zu){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${zu+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const ec=Pl(Ml,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ec);const tc=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Bl,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),nc=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var rc,ic,sc;!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(rc||(rc={}));class oc{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",()=>{na(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=function(e){const t=Object.assign({errMsgProvider:Ul},e),n={};return e.rules.forEach(e=>{n[e.name]=e}),function(e,t){const n=new Gl(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(0===n.length&&!1===this.skipValidations){const e=function(e){var t;const n=null!==(t=e.errMsgProvider)&&void 0!==t?t:$l;return function(e,t,n,r){const i=e.flatMap(e=>function(e,t){const n=new fu;e.accept(n);const r=n.allProductions,i=Object.groupBy(r,hu),s=Object.fromEntries(Object.entries(i).filter(([e,t])=>t.length>1));return Object.values(s).map(n=>{const r=n[0],i=t.buildDuplicateFoundError(e,n),s=va(r),o={message:i,type:rc.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:s,occurrence:r.idx},a=du(r);return a&&(o.parameter=a),o})}(e,n)),s=function(e,t,n){const r=[],i=t.map(e=>e.name);return e.forEach(e=>{const t=e.name;if(i.includes(t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:rc.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}(e,t,n),o=e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:rc.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}(e,n)),a=e.flatMap(t=>function(e,t,n,r){const i=[],s=t.reduce((t,n)=>n.name===e.name?t+1:t,0);if(s>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:rc.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n));return i.concat(s,o,a)}(e.rules,e.tokenTypes,n,e.grammarName)}({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:$l,grammarName:t}),n=function(e){return e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}).map(e=>Object.assign({type:rc.CUSTOM_LOOKAHEAD_VALIDATION},e))}({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(e,n)}}),0===this.definitionErrors.length&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const e=function(e){const t={};return e.forEach(e=>{const n=new _a(e).startWalking();Object.assign(t,n)}),t}(Object.values(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!oc.DEFER_DEFINITION_ERRORS_HANDLING&&0!==this.definitionErrors.length)throw e=this.definitionErrors.map(e=>e.message),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initGastRecorder(t),n.initPerformanceTracer(t),Object.hasOwn(t,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=Object.hasOwn(t,"skipValidations")?t.skipValidations:tc.skipValidations}}oc.DEFER_DEFINITION_ERRORS_HANDLING=!1,ic=oc,sc=[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:tc.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Lu)}getTokenToInsert(e){const t=Pl(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let a=!1;const l=this.LA_FAST(1);let u=this.LA_FAST(1);const c=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),n=new bu(t,l,this.LA(0));n.resyncedTokens=o.slice(0,-1),this.SAVE_ERROR(n)};for(;!a;){if(this.tokenMatcher(u,r))return void c();if(n.call(this))return c(),void e.apply(this,t);this.tokenMatcher(u,i)?a=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o))}this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA_FAST(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getNextPossibleTokenTypes(e){const t=e.ruleStack[0],n=this.getGAstProductions()[t];return new Wl(n,e).startWalking()}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new Nu("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(0===t.length)return!1;const n=this.LA_FAST(1);return void 0!==t.find(e=>this.tokenMatcher(n,e))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(t).includes(e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA_FAST(1),n=2;for(;;){const r=e.find(e=>fl(t,e));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(0===this.RULE_STACK_IDX)return wu;const e=this.currRuleShortName,t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK,n=this.RULE_STACK_IDX+1,r=new Array(n);for(let i=0;ithis.getFollowSetFromFollowKey(e)).flat()}getFollowSetFromFollowKey(e){if(e===wu)return[Ml];const t=e.ruleName+e.idxInCallingRule+Aa+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Ml)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA_FAST(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return t.slice(0,-1)}attemptInRepetitionRecovery(e,t,n,r,i,s,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){const e=this.RULE_STACK_IDX+1,t=new Array(e);for(let n=0;n{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:o}=function(e){Bu.reset(),e.accept(Bu);const t=Bu.dslMethods;return Bu.reset(),t}(e);t.forEach(t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${va(t)}${n}`,()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=Mu(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),n.forEach(t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,va(t))}),r.forEach(t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,va(t))}),i.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Ou,"RepetitionMandatory",t.maxLookahead,va(t))}),s.forEach(t=>{this.computeLookaheadFunc(e,t.idx,ku,"RepetitionMandatoryWithSeparator",t.maxLookahead,va(t))}),o.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Iu,"RepetitionWithSeparator",t.maxLookahead,va(t))})})})}computeLookaheadFunc(e,t,n,r,i,s){this.TRACE_INIT(`${s}${0===t?"":t}`,()=>{const s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=Mu(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,s)})}getKeyForAutomaticLookahead(e,t){return Mu(this.currRuleShortName,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:tc.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=$u,this.setNodeLocationFromNode=$u,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Uu,this.setNodeLocationFromNode=Uu,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{}}else this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{}}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA_FAST(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];var r,i,s;i=t,s=e,void 0===(r=n).children[s]?r.children[s]=[i]:r.children[s].push(i),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(void 0===this.baseCstVisitorConstructor){const e=function(e,t){const n=function(){};Gu(n,e+"BaseSemantics");const r={visit:function(e,t){if(Array.isArray(e)&&(e=e[0]),void 0!==e)return this[e.name](e.children,t)},validateVisitor:function(){const e=function(e,t){const n=function(e,t){return t.filter(t=>"function"==typeof e[t]==0).map(t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Wu.MISSING_METHOD,methodName:t})).filter(Boolean)}(e,t);return n}(this,t);if(0!==e.length){const t=e.map(e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(void 0===this.baseCstVisitorWithDefaultsConstructor){const e=function(e,t,n){const r=function(){};Gu(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return t.forEach(e=>{i[e]=Vu}),(r.prototype=i).constructor=r,r}(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):ec}LA_FAST(e){const t=this.currIdx+e;return this.tokVector[t]}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?ec:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=pl,this.subruleIdx=0,this.currRuleShortName=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(Array.isArray(e)){if(0===e.length)throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(Array.isArray(e))this.tokensMap=e.reduce((e,t)=>(e[t.name]=t,e),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(Sl)){const t=Object.values(e.modes).flat(),n=[...new Set(t)];this.tokensMap=n.reduce((e,t)=>(e[t.name]=t,e),{})}else{if("object"!=typeof e||null===e)throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=Object.assign({},e)}this.tokensMap.EOF=Ml;const n=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every(e=>{var t;return 0==(null===(t=e.categoryMatches)||void 0===t?void 0:t.length)});this.tokenMatcher=n?pl:fl,El(Object.values(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:nc.resyncEnabled,i=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:nc.recoveryValueFunc,s=this.ruleShortNameIdx<<12;let o;return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,o=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...t){this.onBeforeParse(e);try{return o.apply(this,t)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:t,coreRule:o})}invokeRuleCatch(e,t,n){const r=0===this.RULE_STACK_IDX,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(_u(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(Ou,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,Ou,e,Xl)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(ku,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Kl],t,ku,e,Kl)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let s=!0;for(;!0===i.call(this)&&!0===s;)s=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,jl,s)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(Iu,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,zl],t,Iu,e,zl)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,ku,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=Array.isArray(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX]),this.cstFinallyStateUpdate()}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.coreRule.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw _u(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA_FAST(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new bu(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===Fu?n:e}}}saveRecogState(){const e=this.errors,t=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);const t=e.RULE_STACK;for(let e=0;e=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX])}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=n,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ml)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let e=0;e${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:rc.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){var n;const r=null!==(n=e.coreRule)&&void 0!==n?n:e;return function(){this.isBackTrackingStack.push(1);const e=this.saveRecogState();try{return r.apply(this,t),!0}catch(e){if(_u(e))return!1;throw e}finally{this.reloadRecogState(e),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Object.values(this.gastProductionsCache).map(pa)}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:tc.errorMessageProvider}SAVE_ERROR(e){if(_u(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=lu(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],s=[];for(let e=1;e<=this.maxLookahead;e++)s.push(this.LA(e));const o=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:s,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new xu(o,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=au(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));const s=this.LA(0),o=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:s,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Tu(o,this.LA(1),s))}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const n=t>0?t:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return ec}topLevelRuleRecord(e,t){try{const n=new sa({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}}optionInternalRecord(e,t){return qu.call(this,aa,e,t)}atLeastOneInternalRecord(e,t){qu.call(this,la,t,e)}atLeastOneSepFirstInternalRecord(e,t){qu.call(this,ua,t,e,ju)}manyInternalRecord(e,t){qu.call(this,ca,t,e)}manySepFirstInternalRecord(e,t){qu.call(this,ha,t,e,ju)}orInternalRecord(e,t){return Qu.call(this,e,t)}subruleInternalRecord(e,t,n){if(Ju(t),!e||!Object.hasOwn(e,"ruleName")){const n=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=e.ruleName,s=new ia({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(s),this.outputCst?Yu:Hu}consumeInternalRecord(e,t,n){if(Ju(t),!Cl(e)){const n=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=new fa({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),Ku}},class{initPerformanceTracer(e){if(Object.hasOwn(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=tc.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()}}],sc.forEach(e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach(n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(ic.prototype,n,r):ic.prototype[n]=e.prototype[n]})});class ac extends oc{constructor(e,t=tc){const n=Object.assign({},t);n.outputCst=!1,super(e,n)}}function lc(e){return void 0!==e.lineNoCont?e.lineNoCont:e.startLine}class uc{visit(e){return e&&this[e.kind](e)}arraySpecifier(e){this.visit(e.size)}binaryExpression(e){this.visit(e.lhs),this.visit(e.rhs)}methodCall(e){this.visit(e.on),this.visit(e.functionCall)}functionCall(e){this.visit(e.callee);for(const t of e.args)this.visit(t)}arrayAccess(e){this.visit(e.on),this.visit(e.index)}translationUnit(e){for(const t of e.declarations)this.visit(t)}assignmentExpression(e){this.visit(e.lhs),this.visit(e.rhs)}fieldAccess(e){this.visit(e.on)}conditionalExpression(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}postfixExpression(e){this.visit(e.on)}commaExpression(e){this.visit(e.lhs),this.visit(e.rhs)}unaryExpression(e){this.visit(e.on)}functionDefinition(e){this.visit(e.returnType);for(const t of e.params)this.visit(t);this.visit(e.body)}functionPrototype(e){this.visit(e.returnType);for(const t of e.params)this.visit(t)}parameterDeclaration(e){this.visit(e.arraySpecifier),this.visit(e.typeSpecifier)}typeSpecifier(e){hc(e.typeSpecifierNonArray)&&this.visit(e.typeSpecifierNonArray),this.visit(e.arraySpecifier)}compoundStatement(e){for(const t of e.statements)this.visit(t)}returnStatement(e){this.visit(e.what)}continueStatement(e){}breakStatement(e){}discardStatement(e){}declarator(e){this.visit(e.arraySpecifier),this.visit(e.init)}doWhileStatement(e){this.visit(e.statement),this.visit(e.conditionExpression)}whileStatement(e){this.visit(e.conditionExpression),this.visit(e.statement)}forStatement(e){this.visit(e.initExpression),this.visit(e.conditionExpression),this.visit(e.loopExpression),this.visit(e.statement)}expressionStatement(e){this.visit(e.expression)}initDeclaratorListDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}precisionDeclaration(e){this.visit(e.typeSpecifierNoPrec)}selectionStatement(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}storageQualifier(e){}switchStatement(e){this.visit(e.initExpression);for(const t of e.cases)this.visit(t)}caseLabel(e){this.visit(e.case_)}caseBlock(e){this.visit(e.caseLabel);for(const t of e.statements)this.visit(t)}fullySpecifiedType(e){this.visit(e.typeQualifier),this.visit(e.typeSpecifier)}typeQualifier(e){this.visit(e.storageQualifier),this.visit(e.layoutQualifier)}structSpecifier(e){for(const t of e.declarations)this.visit(t)}layoutQualifier(e){}invariantDeclaration(e){}structDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}variableExpression(e){}constantExpression(e){}uniformBlock(e){this.visit(e.typeQualifier);for(const t of e.declarations)this.visit(t);this.visit(e.arraySpecifier)}ppDefine(e){this.visit(e.node)}ppDir(e){}ppExtension(e){}ppCall(e){}ppPragma(e){}}function cc(e){return"tokenType"in e}function hc(e){return"kind"in e}function dc(e,t){const n=e.split("\n"),r=t.startLine,i=t.endLine;return"./src/compiler.lambda:"+r+":"+(t.startColumn-1)+"\n"+n.map((e,t)=>[t+1,e]).slice(r-2,i+2).map(([e,n])=>{var s,o,a;return e>=r&&e<=i&&(s=n,o=6+(r===e?t.startColumn-1:0),a=6+(i===e?t.endColumn:n.length),n=s+"\n"+"-".repeat(o)+"^".repeat(a-o)),(""+e).padStart(5)+" "+n}).join("\n")}const fc=["active","asm","atomic_uint","attribute","cast","class","coherent","common","double","dvec2","dvec3","dvec4","enum","extern","external","filter","fixed","fvec2","fvec3","fvec4","goto","half","hvec2","hvec3","hvec4","iimage1D","iimage1DArray","iimage2D","iimage2DArray","iimage3D","iimageBuffer","iimageCube","image1D","image1DArray","image2D","image2DArray","image3D","imageBuffer","imageCube","inline","input","interface","isampler1D","isampler1DArray","isampler2DMS","isampler2DMSArray","isampler2DRect","isamplerBuffer","long","namespace","noinline","noperspective","output","partition","patch","public","readonly","resource","restrict","sample","sampler1D","sampler1DArray","sampler1DArrayShadow","sampler1DShadow","sampler2DMS","sampler2DMSArray","sampler2DRect","sampler2DRectShadow","sampler3DRect","samplerBuffer","short","sizeof","static","subroutine","superp","template","this","typedef","uimage1D","uimage1DArray","uimage2D","uimage2DArray","uimage3D","uimageBuffer","uimageCube","union","unsigned","usampler1D","usampler1DArray","usampler2DMS","usampler2DMSArray","usampler2DRect","usamplerBuffer","using","volatile","volatile","writeonly"];var pc;!function(e){e.ASSIGN_OP=kl({name:"ASSIGN_OP",pattern:yl.NA}),e.UNARY_OP=kl({name:"UNARY_OP",pattern:yl.NA}),e.POSTFIX_OP=kl({name:"POSTFIX_OP",pattern:yl.NA}),e.PRECISION_QUALIFIER=kl({name:"PRECISION_QUALIFIER",pattern:yl.NA}),e.INTERPOLATION_QUALIFIER=kl({name:"INTERPOLATION_QUALIFIER",pattern:yl.NA}),e.MULTIPLICATIVE_OP=kl({name:"MULTIPLICATIVE_OP",pattern:yl.NA}),e.ADDITIVE_OP=kl({name:"ADDITIVE_OP",pattern:yl.NA}),e.SHIFT_OP=kl({name:"SHIFT_OP",pattern:yl.NA}),e.RELATIONAL_OP=kl({name:"RELATIONAL_OP",pattern:yl.NA}),e.EQUALITY_OP=kl({name:"EQUALITY_OP",pattern:yl.NA}),e.PARAMETER_QUALIFIER=kl({name:"PARAMETER_QUALIFIER",pattern:yl.NA}),e.WHITESPACE=kl({name:"WHITESPACE",pattern:/\s+/,group:yl.SKIPPED}),e.LINE_COMMENT=kl({name:"LINE_COMMENT",pattern:/\/\/[^\r\n]*/,group:"COMMENTS"}),e.MULTILINE_COMMENT=kl({name:"MULTILINE_COMMENT",pattern:/\/\*[\s\S]*?\*\//,group:"COMMENTS"}),e.MULASSIGN=kl({name:"MULASSIGN",pattern:"*=",label:"'*='",categories:e.ASSIGN_OP}),e.DIVASSIGN=kl({name:"DIVASSIGN",pattern:"/=",label:"'/='",categories:e.ASSIGN_OP}),e.MODASSIGN=kl({name:"MODASSIGN",pattern:"%=",label:"'%='",categories:e.ASSIGN_OP}),e.ADDASSIGN=kl({name:"ADDASSIGN",pattern:"+=",label:"'+='",categories:e.ASSIGN_OP}),e.SUBASSIGN=kl({name:"SUBASSIGN",pattern:"-=",label:"'-='",categories:e.ASSIGN_OP}),e.LEFTASSIGN=kl({name:"LEFTASSIGN",pattern:"<<=",label:"'<<='",categories:e.ASSIGN_OP}),e.RIGHTASSIGN=kl({name:"RIGHTASSIGN",pattern:">>=",label:"'>>='",categories:e.ASSIGN_OP}),e.ANDASSIGN=kl({name:"ANDASSIGN",pattern:"&=",label:"'&='",categories:e.ASSIGN_OP}),e.XORASSIGN=kl({name:"XORASSIGN",pattern:"^=",label:"'^='",categories:e.ASSIGN_OP}),e.ORASSIGN=kl({name:"ORASSIGN",pattern:"|=",label:"'|='",categories:e.ASSIGN_OP}),e.INC_OP=kl({name:"INC_OP",pattern:"++",label:"'++'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.QUESTION=kl({name:"QUESTION",pattern:"?",label:"'?'"}),e.COLON=kl({name:"COLON",pattern:":",label:"':'"}),e.DEC_OP=kl({name:"DEC_OP",pattern:"--",label:"'--'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.AND_OP=kl({name:"AND_OP",pattern:"&&",label:"'&&'"}),e.XOR_OP=kl({name:"XOR_OP",pattern:"^^",label:"'^^'"}),e.OR_OP=kl({name:"OR_OP",pattern:"||",label:"'||'"}),e.LEFT_OP=kl({name:"LEFT_OP",pattern:"<<",label:"'<<'",categories:e.SHIFT_OP}),e.RIGHT_OP=kl({name:"RIGHT_OP",pattern:">>",label:"'>>'",categories:e.SHIFT_OP}),e.EQ_OP=kl({name:"EQ_OP",pattern:"==",label:"'=='",categories:e.EQUALITY_OP}),e.NE_OP=kl({name:"NE_OP",pattern:"!=",label:"'!='",categories:e.EQUALITY_OP}),e.LE_OP=kl({name:"LE_OP",pattern:"<=",label:"'<='",categories:e.RELATIONAL_OP}),e.GE_OP=kl({name:"GE_OP",pattern:">=",label:"'>='",categories:e.RELATIONAL_OP}),e.LEFT_ANGLE=kl({name:"LEFT_ANGLE",pattern:"<",label:"'<'",categories:e.RELATIONAL_OP}),e.RIGHT_ANGLE=kl({name:"RIGHT_ANGLE",pattern:">",label:"'>'",categories:e.RELATIONAL_OP}),e.PLUS=kl({name:"PLUS",pattern:"+",label:"'+'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.TILDE=kl({name:"TILDE",pattern:"~",label:"'~'",categories:e.UNARY_OP}),e.BANG=kl({name:"BANG",pattern:"!",label:"'!'",categories:e.UNARY_OP}),e.CARET=kl({name:"CARET",pattern:"^",label:"'^'"}),e.AMPERSAND=kl({name:"AND",pattern:"&",label:"'&'"}),e.VERTICAL_BAR=kl({name:"VERTICAL_BAR",pattern:"|",label:"'|'"}),e.SLASH=kl({name:"SLASH",pattern:"/",label:"'/'",categories:e.MULTIPLICATIVE_OP}),e.PERCENT=kl({name:"PERCENT",pattern:"%",label:"'%'",categories:e.MULTIPLICATIVE_OP}),e.STAR=kl({name:"STAR",pattern:"*",label:"'*'",categories:e.MULTIPLICATIVE_OP}),e.DASH=kl({name:"DASH",pattern:"-",label:"'-'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.COMMA=kl({name:"COMMA",pattern:",",label:"','"}),e.EQUAL=kl({name:"EQUAL",pattern:"=",label:"'='",categories:e.ASSIGN_OP}),e.LEFT_PAREN=kl({name:"LEFT_PAREN",pattern:"(",label:"'('"}),e.RIGHT_PAREN=kl({name:"RIGHT_PAREN",pattern:")",label:"')'"}),e.LEFT_BRACKET=kl({name:"LEFT_BRACKET",pattern:"[",label:"'['"}),e.RIGHT_BRACKET=kl({name:"RIGHT_BRACKET",pattern:"]",label:"']'"}),e.LEFT_BRACE=kl({name:"LEFT_BRACE",pattern:"{",label:"'{'"}),e.RIGHT_BRACE=kl({name:"RIGHT_BRACE",pattern:"}",label:"'}'"}),e.SEMICOLON=kl({name:"SEMICOLON",pattern:";",label:"';'"}),e.IDENTIFIER=kl({name:"IDENTIFIER",pattern:yl.NA}),e.NON_PP_IDENTIFIER=kl({name:"NON_PP_IDENTIFIER",pattern:/[a-z_]\w*/i,categories:e.IDENTIFIER}),e.PP=kl({name:"PP",pattern:yl.NA,categories:e.IDENTIFIER});const t=(t,n)=>kl({name:t,pattern:n,categories:e.PP,longer_alt:e.NON_PP_IDENTIFIER});e.DEFINE=t("DEFINE","define"),e.UNDEF=t("UNDEF","undef"),e.ENDIF=t("ENDIF","endif"),e.IFDEF=t("IFDEF","ifdef"),e.IFNDEF=t("IFNDEF","ifndef"),e.ELIF=t("ELIF","elif"),e.ERROR=t("ERROR","error"),e.VERSION=t("VERSION","version"),e.PRAGMA_DIRECTIVE=kl({name:"PRAGMA_DIRECTIVE",pattern:/#\s*pragma\s+[^\r\n]*/}),e.LINE=t("LINE","line"),e.EXTENSION=t("EXTENSION","extension"),e.INCLUDE=t("INCLUDE","include"),e.HASH_INCLUDE_MODULE=kl({name:"HASH_INCLUDE_MODULE",pattern:/#\s*include\s*<[\w\-./\\$@ ]+>/}),e.HASH=kl({name:"HASH",pattern:"#"}),e.KEYWORD=kl({name:"KEYWORD",pattern:yl.NA});const n=(t,n)=>kl({name:t,pattern:t.toLowerCase(),label:"'"+t.toLowerCase()+"'",longer_alt:e.NON_PP_IDENTIFIER,categories:n?[e.KEYWORD,n]:e.KEYWORD});e.CONST=n("CONST"),e.UNIFORM=n("UNIFORM"),e.LAYOUT=n("LAYOUT"),e.CENTROID=n("CENTROID"),e.FLAT=n("FLAT",e.INTERPOLATION_QUALIFIER),e.SMOOTH=n("SMOOTH",e.INTERPOLATION_QUALIFIER),e.BREAK=n("BREAK"),e.CONTINUE=n("CONTINUE"),e.DO=n("DO"),e.PRECISION=n("PRECISION"),e.FOR=n("FOR"),e.WHILE=n("WHILE"),e.SWITCH=n("SWITCH"),e.CASE=n("CASE"),e.DEFAULT=n("DEFAULT"),e.IF=n("IF"),e.ELSE=n("ELSE"),e.INVARIANT=n("INVARIANT"),e.INOUT=n("INOUT",e.PARAMETER_QUALIFIER),e.OUT=n("OUT",e.PARAMETER_QUALIFIER),e.VOID=n("VOID"),e.STRUCT=n("STRUCT"),e.DISCARD=n("DISCARD"),e.RETURN=n("RETURN"),e.LOWP=n("LOWP",e.PRECISION_QUALIFIER),e.MEDIUMP=n("MEDIUMP",e.PRECISION_QUALIFIER),e.HIGHP=n("HIGHP",e.PRECISION_QUALIFIER),e.CONSTANT=kl({name:"CONSTANT",pattern:yl.NA}),e.BASIC_TYPE=kl({name:"BASIC_TYPE",pattern:yl.NA});const r=t=>kl({name:t.toUpperCase(),pattern:t,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE});e.BOOL=r("bool"),e.INT=r("int"),e.FLOAT=r("float"),e.MAT2X3=r("mat2x3"),e.MAT2X4=r("mat2x4"),e.MAT2X2=kl({name:"mat2x2".toUpperCase(),pattern:/mat2(?:x2)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat2"}),e.MAT3X2=r("mat3x2"),e.MAT3X4=r("mat3x4"),e.MAT3X3=kl({name:"mat3x3".toUpperCase(),pattern:/mat3(?:x3)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat3"}),e.MAT4X2=r("mat4x2"),e.MAT4X3=r("mat4x3"),e.MAT4X4=kl({name:"MAT4X4",pattern:/mat4(?:x4)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat4"}),e.VEC2=r("vec2"),e.VEC3=r("vec3"),e.VEC4=r("vec4"),e.IVEC2=r("ivec2"),e.IVEC3=r("ivec3"),e.IVEC4=r("ivec4"),e.BVEC2=r("bvec2"),e.BVEC3=r("bvec3"),e.BVEC4=r("bvec4"),e.UINT=r("uint"),e.UVEC2=r("uvec2"),e.UVEC3=r("uvec3"),e.UVEC4=r("uvec4"),e.USAMPLERCUBE=r("usamplerCube"),e.USAMPLER3D=r("usampler3D"),e.USAMPLER2DARRAY=r("usampler2DArray"),e.USAMPLER2D=r("usampler2D"),e.SAMPLERCUBESHADOW=r("samplerCubeShadow"),e.SAMPLERCUBE=r("samplerCube"),e.SAMPLER3D=r("sampler3D"),e.SAMPLER2DSHADOW=r("sampler2DShadow"),e.SAMPLER2DARRAYSHADOW=r("sampler2DArrayShadow"),e.SAMPLER2DARRAY=r("sampler2DArray"),e.SAMPLER2D=r("sampler2D"),e.ISAMPLERCUBE=r("isamplerCube"),e.ISAMPLER3D=r("isampler3D"),e.ISAMPLER2DARRAY=r("isampler2DArray"),e.ISAMPLER2D=r("isampler2D"),e.IN=n("IN",e.PARAMETER_QUALIFIER),e.VARYING=n("VARYING"),e.ATTRIBUTE=n("ATTRIBUTE"),e.BOOLCONSTANT=kl({name:"BOOLCONSTANT",pattern:/true|false/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.CONSTANT}),e.FLOATCONSTANT=kl({name:"FLOATCONSTANT",pattern:/((\d+\.\d*|\.\d+)(e[+-]?\d+)?|\d+e[+-]?\d+)f?/i,categories:e.CONSTANT}),e.DOT=kl({name:"DOT",pattern:".",label:"'.'"}),e.UINTCONSTANT=kl({name:"UINTCONSTANT",pattern:/0x[\da-f]+u|\d+u/i,categories:e.CONSTANT}),e.INTCONSTANT=kl({name:"INTCONSTANT",pattern:/0x[\da-f]+|\d+/i,categories:e.CONSTANT}),e.STRING=kl({name:"STRING",pattern:/"([^"\\]+|\\")+"/})}(pc||(pc={}));const mc=Object.values(pc).filter(e=>e!==pc.NON_PP_IDENTIFIER).flatMap(e=>Array.isArray(e)?e:[e]);mc.push(pc.NON_PP_IDENTIFIER);const gc=new yl(mc,{ensureOptimizations:!1});new class extends uc{constructor(){super(...arguments),this.markError=()=>{}}eval(e,t,n){return this.isDefined=t,this.markError=n,super.visit(e)}constantExpression(e){if(e.const_.tokenType!==pc.INTCONSTANT)throw new Error("XX");return+e.const_.image}unaryExpression(e){switch(e.op.tokenType){case pc.NON_PP_IDENTIFIER:return+this.isDefined(e.on.var.image);case pc.DASH:return-this.visit(e.on);case pc.TILDE:return~this.visit(e.on);case pc.BANG:return+!this.visit(e.on);case pc.PLUS:return this.visit(e.on);default:throw new Error(e.op.tokenType.name)}}binaryExpression(e){const t=this.visit(e.lhs);switch(e.op.tokenType){case pc.AND_OP:return t&&this.visit(e.rhs);case pc.OR_OP:return t||this.visit(e.rhs);default:{const n=this.visit(e.rhs);return 0|function(e,t,n){switch(e){case pc.PLUS:return t+n;case pc.DASH:return t-n;case pc.STAR:return t*n;case pc.PERCENT:return t%n;case pc.SLASH:return t/n;case pc.LEFT_OP:return t<>n;case pc.EQ_OP:return t===n;case pc.NE_OP:return t!==n;case pc.LE_OP:return t<=n;case pc.GE_OP:return t>=n;case pc.LEFT_ANGLE:return tn;case pc.XOR_OP:return t!==n;case pc.AND_OP:return t&&n;case pc.OR_OP:return t||n;case pc.AMPERSAND:return t&n;case pc.CARET:return t^n;case pc.VERTICAL_BAR:return t|n;default:throw new Error}}(e.op.tokenType,t,n)}}}variableExpression(e){return this.markError("P0001",e.var,"undefined identifier "+e.var.image),0}};const Ec=new class extends ac{getTokensOnLine(){const e=[],t=lc(this.LA(0));let n;for(;lc(n=this.LA(1))===t;)e.push(n),this.SKIP_TOKEN();return e}constructor(){super(mc,{skipValidations:!0}),this.multiplicativeExpression=this.RR("multiplicativeExpression",()=>this.LEFT_ASSOC(this.preprocessing?this.ppUnaryExpression:this.unaryExpression,pc.MULTIPLICATIVE_OP)),this.additiveExpression=this.RR("additiveExpression",()=>this.LEFT_ASSOC(this.multiplicativeExpression,pc.ADDITIVE_OP)),this.shiftExpression=this.RR("shiftExpression",()=>this.LEFT_ASSOC(this.additiveExpression,pc.SHIFT_OP)),this.relationalExpression=this.RR("relationalExpression",()=>this.LEFT_ASSOC(this.shiftExpression,pc.RELATIONAL_OP)),this.equalityExpression=this.RR("equalityExpression",()=>this.LEFT_ASSOC(this.relationalExpression,pc.EQUALITY_OP)),this.andExpression=this.RR("andExpression",()=>this.LEFT_ASSOC(this.equalityExpression,pc.AMPERSAND)),this.exclusiveOrExpression=this.RR("exclusiveOrExpression",()=>this.LEFT_ASSOC(this.andExpression,pc.CARET)),this.inclusiveOrExpression=this.RR("inclusiveOrExpression",()=>this.LEFT_ASSOC(this.exclusiveOrExpression,pc.VERTICAL_BAR)),this.logicalAndExpression=this.RR("logicalAndExpression",()=>this.LEFT_ASSOC(this.inclusiveOrExpression,pc.AND_OP)),this.logicalXorExpression=this.RR("logicalXorExpression",()=>this.LEFT_ASSOC(this.logicalAndExpression,pc.XOR_OP)),this.logicalOrExpression=this.RR("logicalOrExpression",()=>this.LEFT_ASSOC(this.logicalXorExpression,pc.OR_OP)),this.assignmentExpression=this.RR("assignmentExpression",()=>{const e=this.SUBRULE(this.conditionalExpression);return this.OPTION(()=>{const t=this.CONSUME(pc.ASSIGN_OP),n=this.SUBRULE1(this.assignmentExpression);return{kind:"assignmentExpression",lhs:e,op:t,rhs:n}})??e}),this.expression=this.RR("expression",()=>{let e;return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.SUBRULE(this.assignmentExpression);return e=e?{kind:"commaExpression",lhs:e,rhs:t}:t}}),e}),this.conditionalExpression=this.RR("conditionalExpression",()=>{const e=this.SUBRULE1(this.logicalOrExpression);return this.OPTION(()=>({kind:"conditionalExpression",condition:e,QUESTION:this.CONSUME(pc.QUESTION),yes:this.SUBRULE2(this.expression),COLON:this.CONSUME(pc.COLON),no:this.SUBRULE3(this.assignmentExpression)}))??e}),this.switchStatement=this.RR("switchStatement",()=>{this.CONSUME(pc.SWITCH),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);this.CONSUME(pc.RIGHT_PAREN),this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.caseBlock))),this.CONSUME(pc.RIGHT_BRACE),{kind:"switchStatement",initExpression:e,cases:t}}),this.caseBlock=this.RR("caseBlock",()=>{const e=this.SUBRULE(this.caseLabel),t=[];return this.MANY1(()=>t.push(this.SUBRULE(this.statement))),{kind:"caseBlock",caseLabel:e,statements:t}}),this.jumpStatement=this.RR("jumpStatement",()=>{const e=this.OR([{ALT:()=>(this.CONSUME(pc.CONTINUE),{kind:"continueStatement"})},{ALT:()=>(this.CONSUME(pc.BREAK),{kind:"breakStatement"})},{ALT:()=>(this.CONSUME(pc.DISCARD),{kind:"discardStatement"})},{ALT:()=>(this.CONSUME(pc.RETURN),{kind:"returnStatement",what:this.OPTION(()=>this.SUBRULE(this.expression))})}]);return this.CONSUME(pc.SEMICOLON),e}),this.primaryExpression=this.RR("primaryExpression",()=>this.OR([{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),e}},{ALT:()=>({kind:"variableExpression",var:this.CONSUME(pc.IDENTIFIER)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.CONSTANT)})}])),this.constantExpression=this.RR("constantExpression",()=>this.SUBRULE(this.conditionalExpression)),this.layoutQualifier=this.RR("layoutQualifier",()=>{this.CONSUME(pc.LAYOUT),this.CONSUME(pc.LEFT_PAREN);const e=[];return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.CONSUME(pc.IDENTIFIER);let n;this.OPTION(()=>{this.CONSUME(pc.EQUAL),n=this.OR([{ALT:()=>this.CONSUME(pc.INTCONSTANT)},{ALT:()=>this.CONSUME(pc.UINTCONSTANT)}])}),e.push({IDENTIFIER:t,init:n})}}),this.CONSUME(pc.RIGHT_PAREN),{kind:"layoutQualifier",layoutQualifierIds:e}}),this.storageQualifier=this.RR("storageQualifier",()=>{let e,t,n,r,i,s,o;return this.OR([{ALT:()=>e=this.CONSUME(pc.CONST)},{ALT:()=>{t=this.OPTION(()=>this.CONSUME(pc.CENTROID)),this.OR9([{ALT:()=>n=this.CONSUME(pc.IN)},{ALT:()=>r=this.CONSUME(pc.OUT)},{ALT:()=>s=this.CONSUME(pc.VARYING)},{ALT:()=>o=this.CONSUME(pc.ATTRIBUTE)}])}},{ALT:()=>i=this.CONSUME(pc.UNIFORM)}]),{kind:"storageQualifier",CONST:e,CENTROID:t,IN:n,OUT:r,VARYING:s,ATTRIBUTE:o,UNIFORM:i}}),this.typeQualifier=this.RR("typeQualifier",()=>{let e,t,n,r;return this.OR([{ALT:()=>e=this.SUBRULE(this.storageQualifier)},{ALT:()=>{t=this.SUBRULE1(this.layoutQualifier),e=this.OPTION1(()=>this.SUBRULE2(this.storageQualifier))}},{ALT:()=>{n=this.CONSUME(pc.INTERPOLATION_QUALIFIER),e=this.OPTION2(()=>this.SUBRULE3(this.storageQualifier))}},{ALT:()=>{r=this.CONSUME(pc.INVARIANT),n=this.OPTION3(()=>this.CONSUME1(pc.INTERPOLATION_QUALIFIER)),e=this.SUBRULE7(this.storageQualifier)}}]),{kind:"typeQualifier",storageQualifier:e,layoutQualifier:t,interpolationQualifier:n,invariantQualifier:r}}),this.precisionQualifier=this.RR("precisionQualifier",()=>this.CONSUME(pc.PRECISION_QUALIFIER)),this.arraySpecifier=this.RR("arraySpecifier",()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.OPTION3(()=>this.SUBRULE(this.constantExpression));return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arraySpecifier",size:e}}),this.typeSpecifierNonArray=this.RR("typeSpecifierNonArray",()=>this.OR([{ALT:()=>this.CONSUME(pc.BASIC_TYPE)},{ALT:()=>this.CONSUME(pc.VOID)},{ALT:()=>this.SUBRULE(this.structSpecifier)},{ALT:()=>this.CONSUME(pc.IDENTIFIER)}])),this.typeSpecifierNoPrec=this.RR("typeSpecifierNoPrec",()=>{const e=this.SUBRULE(this.typeSpecifierNonArray);return{kind:"typeSpecifier",precisionQualifier:void 0,arraySpecifier:this.OPTION1(()=>this.SUBRULE(this.arraySpecifier)),typeSpecifierNonArray:e}}),this.functionCall=this.RR("functionCall",()=>{const e=this.SUBRULE(this.typeSpecifierNoPrec);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({DEF:()=>t.push(this.SUBRULE(this.assignmentExpression)),SEP:pc.COMMA}),this.CONSUME(pc.RIGHT_PAREN),{kind:"functionCall",callee:e,args:t}}),this.functionCallHeader=this.RULE("functionCallHeader",()=>{this.SUBRULE(this.typeSpecifierNoPrec),this.CONSUME(pc.LEFT_PAREN)}),this.postfixExpression=this.RR("postfixExpression",()=>{const e=this.LA(1);let t=this.OR1([{GATE:this.BACKTRACK(this.functionCallHeader),ALT:()=>this.SUBRULE1(this.functionCall)},{ALT:()=>this.SUBRULE(this.primaryExpression)}]);return this.MANY(()=>{t=this.OR2([{ALT:()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arrayAccess",on:t,index:e}}},{ALT:()=>{this.CONSUME1(pc.DOT);const e=this.SUBRULE2(this.functionCall);return{kind:"methodCall",on:t,functionCall:e}}},{ALT:()=>{this.CONSUME2(pc.DOT);const e=this.CONSUME(pc.IDENTIFIER);return{kind:"fieldAccess",on:t,field:e}}},{ALT:()=>{const e=this.CONSUME(pc.POSTFIX_OP);return{kind:"postfixExpression",on:t,op:e}}}]),this.FINALIZE(t,e)}),t}),this.unaryExpression=this.RR("unaryExpression",()=>this.OR([{ALT:()=>this.SUBRULE1(this.postfixExpression)},{ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.UNARY_OP),on:this.SUBRULE2(this.unaryExpression)})}])),this.ppUnaryExpression=this.RR("ppUnaryExpression",()=>this.OR([{GATE:()=>this.LA(1).tokenType===pc.NON_PP_IDENTIFIER&&"defined"===this.LA(1).image,ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.IDENTIFIER),on:{kind:"variableExpression",var:this.OR1([{ALT:()=>this.SUBRULE(this.ppIdentifier)},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE1(this.ppIdentifier);return this.CONSUME(pc.RIGHT_PAREN),e}}])}})},{ALT:()=>({kind:"unaryExpression",op:this.OR2([{ALT:()=>this.CONSUME(pc.PLUS)},{ALT:()=>this.CONSUME(pc.DASH)},{ALT:()=>this.CONSUME(pc.TILDE)},{ALT:()=>this.CONSUME(pc.BANG)}]),on:this.SUBRULE2(this.ppUnaryExpression)})},{ALT:()=>this.SUBRULE(this.ppPrimaryExpression)}])),this.ppPrimaryExpression=this.RR("ppPrimaryExpression",()=>this.OR([{ALT:()=>({kind:"variableExpression",var:this.SUBRULE(this.ppIdentifier)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.INTCONSTANT)})},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.ppConstantExpression);return this.CONSUME(pc.RIGHT_PAREN),e}}])),this.ppConstantExpression=this.RR("ppConstantExpression",()=>{try{return this.preprocessing=!0,this.LEFT_ASSOC(this.logicalAndExpression,pc.OR_OP)}finally{this.preprocessing=!1}}),this.typeSpecifier=this.RR("typeSpecifier",()=>{const e=this.OPTION(()=>this.SUBRULE(this.precisionQualifier)),t=this.SUBRULE(this.typeSpecifierNoPrec);return Object.assign({},t,{precisionQualifier:e})}),this.parameterDeclaration=this.RR("parameterDeclaration",()=>{const e=this.OPTION(()=>this.CONSUME(pc.CONST)),t=this.OPTION1(()=>this.CONSUME(pc.PARAMETER_QUALIFIER)),n=this.SUBRULE(this.typeSpecifier);let r,i;return this.OPTION2(()=>{r=this.CONSUME2(pc.IDENTIFIER),i=this.OPTION3(()=>this.SUBRULE(this.arraySpecifier))}),{kind:"parameterDeclaration",parameterTypeQualifier:e,pName:r,arraySpecifier:i,parameterQualifier:t,typeSpecifier:n}}),this.fullySpecifiedType=this.RR("fullySpecifiedType",()=>({kind:"fullySpecifiedType",typeQualifier:this.OPTION(()=>this.SUBRULE(this.typeQualifier)),typeSpecifier:this.SUBRULE(this.typeSpecifier)})),this.structDeclaration=this.RR("structDeclaration",()=>{const e=this.SUBRULE(this.fullySpecifiedType),t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME(pc.IDENTIFIER),arraySpecifier:this.OPTION(()=>this.SUBRULE(this.arraySpecifier)),init:void 0};return t.push(e),e})}),this.CONSUME(pc.SEMICOLON),{kind:"structDeclaration",fsType:e,declarators:t}}),this.structSpecifier=this.RR("structSpecifier",()=>{this.CONSUME(pc.STRUCT);const e=this.OPTION2(()=>this.CONSUME(pc.IDENTIFIER));this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),{kind:"structSpecifier",name:e,declarations:t}}),this.initializer=this.RR("initializer",()=>this.SUBRULE(this.assignmentExpression)),this.singleDeclaration=this.RULE("singleDeclaration",()=>this.OR([{ALT:()=>{this.SUBRULE(this.fullySpecifiedType),this.OPTION1(()=>{this.CONSUME1(pc.IDENTIFIER),this.OPTION2(()=>{this.CONSUME(pc.LEFT_BRACKET),this.OPTION3(()=>this.SUBRULE(this.constantExpression)),this.CONSUME(pc.RIGHT_BRACKET)}),this.OPTION4(()=>{this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)})})}},{ALT:()=>({kind:"invariantDeclaration",INVARIANT:this.CONSUME(pc.INVARIANT),IDENTIFIER:this.CONSUME2(pc.IDENTIFIER)})}])),this.initDeclaratorList=this.RR("initDeclaratorList",()=>this.SUBRULE(this.externalDeclaration,{ARGS:[!1,!1]})),this.expressionStatement=this.RR("expressionStatement",()=>{const e=this.OPTION(()=>this.SUBRULE(this.expression));return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:e}}),this.condition=this.RR("condition",()=>this.OR({MAX_LOOKAHEAD:4,DEF:[{GATE:this.BACKTRACK(this.singleDeclaration),ALT:()=>{const e=this.SUBRULE2(this.fullySpecifiedType),t=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.EQUAL),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:[{kind:"declarator",name:t,init:this.SUBRULE3(this.initializer),arraySpecifier:void 0}]}}},{ALT:()=>this.SUBRULE(this.expression)}]})),this.caseLabel=this.RR("caseLabel",()=>this.OR([{ALT:()=>{this.CONSUME(pc.CASE);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.COLON),{kind:"caseLabel",case_:e}}},{ALT:()=>(this.CONSUME2(pc.DEFAULT),this.CONSUME2(pc.COLON),{kind:"caseLabel",case_:void 0})}])),this.selectionStatement=this.RR("selectionStatement",()=>{this.CONSUME(pc.IF),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),{kind:"selectionStatement",condition:e,yes:this.SUBRULE2(this.statement,{ARGS:[!0]}),no:this.OPTION(()=>(this.CONSUME(pc.ELSE),this.SUBRULE3(this.statement,{ARGS:[!0]})))}}),this.statement=this.RR("statement",e=>this.OR([{ALT:()=>this.SUBRULE(this.ppDirective),IGNORE_AMBIGUITIES:!0},{ALT:()=>{const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:{kind:"variableExpression",var:e}}},IGNORE_AMBIGUITIES:!0},{GATE:this.BACKTRACK(this.expressionStatement),ALT:()=>this.SUBRULE(this.expressionStatement)},{ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.selectionStatement)},{ALT:()=>this.SUBRULE(this.switchStatement)},{ALT:()=>this.SUBRULE(this.iterationStatement)},{ALT:()=>this.SUBRULE(this.jumpStatement)},{ALT:()=>this.SUBRULE(this.compoundStatement,{ARGS:[!!e]})}])),this.compoundStatement=this.RR("compoundStatement",e=>{if("object"==typeof e)throw new Error;this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.statement))),this.CONSUME(pc.RIGHT_BRACE),{kind:"compoundStatement",statements:t,newScope:!!e}}),this.iterationStatement=this.RR("iterationStatement",()=>this.OR([{ALT:()=>{this.CONSUME(pc.WHILE),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.condition);return this.CONSUME(pc.RIGHT_PAREN),{kind:"whileStatement",conditionExpression:e,statement:this.SUBRULE(this.statement)}}},{ALT:()=>{this.CONSUME2(pc.DO);const e=this.SUBRULE2(this.statement,{ARGS:[!0]});this.CONSUME2(pc.WHILE),this.CONSUME2(pc.LEFT_PAREN);const t=this.SUBRULE2(this.expression);return this.CONSUME2(pc.RIGHT_PAREN),this.CONSUME2(pc.SEMICOLON),{kind:"doWhileStatement",statement:e,conditionExpression:t}}},{ALT:()=>{this.CONSUME3(pc.FOR),this.CONSUME3(pc.LEFT_PAREN);const e=this.OR3([{GATE:this.BACKTRACK(this.initDeclaratorList),ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.expressionStatement)}]),t=this.OPTION3(()=>this.SUBRULE3(this.condition));this.CONSUME4(pc.SEMICOLON);const n=this.OPTION4(()=>this.SUBRULE4(this.expression));return this.CONSUME3(pc.RIGHT_PAREN),{kind:"forStatement",initExpression:e,conditionExpression:t,loopExpression:n,statement:this.SUBRULE3(this.statement)}}}])),this.translationUnit=this.RR("translationUnit",()=>{const e=[];return this.AT_LEAST_ONE(()=>e.push(this.SUBRULE(this.externalDeclaration,{ARGS:[!0,!0]}))),{kind:"translationUnit",declarations:e}}),this.uniformBlock=this.RR("uniformBlock",()=>{const e=this.SUBRULE(this.typeQualifier),t=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_BRACE);const n=[];let r,i;return this.MANY(()=>n.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),this.OPTION(()=>{r=this.CONSUME1(pc.IDENTIFIER),i=this.OPTION1(()=>this.SUBRULE(this.arraySpecifier))}),this.CONSUME(pc.SEMICOLON),{kind:"uniformBlock",typeQualifier:e,blockName:t,declarations:n,namespace:r,arraySpecifier:i}}),this.uniformBlockHeader=this.RULE("uniformBlockHeader",()=>{this.OPTION(()=>this.SUBRULE(this.layoutQualifier)),this.CONSUME(pc.UNIFORM),this.CONSUME(pc.IDENTIFIER),this.CONSUME(pc.LEFT_BRACE)}),this.typeQualifierDeclaration=this.RR("typeQualifierDeclaration",()=>{const e=this.SUBRULE(this.typeQualifier);return this.CONSUME(pc.SEMICOLON),{kind:"typeQualifierDeclaration",typeQualifier:e}}),this.externalDeclaration=this.RR("externalDeclaration",(e,t)=>this.OR([{ALT:()=>this.SUBRULE(this.ppCall)},{ALT:()=>this.SUBRULE(this.ppDirective)},{GATE:this.BACKTRACK(this.typeQualifierDeclaration),ALT:()=>this.SUBRULE(this.typeQualifierDeclaration)},{GATE:e?this.BACKTRACK(this.uniformBlockHeader):()=>!1,ALT:()=>this.SUBRULE(this.uniformBlock)},{ALT:()=>{const e=this.SUBRULE(this.fullySpecifiedType);return this.OR2([{GATE:t?void 0:()=>!1,ALT:()=>{const t=this.CONSUME1(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const n=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>n.push(this.SUBRULE(this.parameterDeclaration))}),this.CONSUME(pc.RIGHT_PAREN),this.OR3([{ALT:()=>(this.CONSUME(pc.SEMICOLON),{kind:"functionPrototype",name:t,returnType:e,params:n})},{ALT:()=>{const r=this.SUBRULE(this.compoundStatement);return{kind:"functionDefinition",name:t,returnType:e,params:n,body:r}},IGNORE_AMBIGUITIES:!1}])}},{ALT:()=>{const t=[];return this.MANY_SEP2({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME3(pc.IDENTIFIER),arraySpecifier:this.OPTION5(()=>this.SUBRULE(this.arraySpecifier)),init:this.OPTION7(()=>(this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)))};return t.push(e),e})}),this.CONSUME2(pc.SEMICOLON),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:t}}}])}},{ALT:()=>{this.CONSUME(pc.PRECISION);const e=this.CONSUME(pc.PRECISION_QUALIFIER),t=this.SUBRULE(this.typeSpecifierNoPrec);return this.CONSUME3(pc.SEMICOLON),{kind:"precisionDeclaration",precisionQualifier:e,typeSpecifierNoPrec:t}}}])),this.ppDefine=this.RR("ppDefine",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.DEFINE);const e=this.CONSUME(pc.IDENTIFIER),t=this.LA(1).tokenType===pc.LEFT_PAREN&&e.endOffset+1===this.LA(1).startOffset,n={kind:"ppDefine",what:e,params:this.OPTION({GATE:()=>t,DEF:()=>{this.CONSUME(pc.LEFT_PAREN);const e=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>e.push(this.SUBRULE(this.ppIdentifier))}),this.CONSUME(pc.RIGHT_PAREN),e}}),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(n),n}),this.ppInclude=this.RR("ppInclude",()=>{let e="";return this.OR([{ALT:()=>{const t=this.CONSUME(pc.HASH_INCLUDE_MODULE);e=t.image.substring(t.image.indexOf("<"))}},{ALT:()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.INCLUDE),e=this.CONSUME(pc.STRING).image}}]),{kind:"ppInclude",what:e}}),this.ppCall=this.RR("ppCall",()=>{const e=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>{const e=[];this.MANY(()=>this.OR({DEF:[{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>e.push(this.CONSUME(pc.BASIC_TYPE))},{ALT:()=>e.push(this.CONSUME(pc.ASSIGN_OP))},{ALT:()=>e.push(this.CONSUME(pc.SHIFT_OP))},{ALT:()=>e.push(this.CONSUME(pc.CONSTANT))},{ALT:()=>e.push(this.CONSUME(pc.KEYWORD))},{ALT:()=>e.push(this.CONSUME2(pc.IDENTIFIER))}]})),t.push({tokens:e,node:void 0})},MAX_LOOKAHEAD:1}),this.CONSUME(pc.RIGHT_PAREN),{kind:"ppCall",callee:e,args:t}}),this.ppCallArg=this.RULE("ppCallArg",()=>{const e=[];return e.push(this.CONSUME(pc.LEFT_PAREN)),this.MANY(()=>this.OR([{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>(e.push(this.LA(1)),this.SKIP_TOKEN())}])),e.push(this.CONSUME(pc.RIGHT_PAREN)),e}),this.ppNone=this.RR("ppNone",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.ELSE)},{ALT:()=>this.CONSUME(pc.ENDIF)}]),tokens:[],node:void 0};return this.ppDefs.push(e),e}),this.ppMulti=this.RR("ppMulti",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IF)},{ALT:()=>this.CONSUME(pc.ELIF)},{ALT:()=>this.CONSUME(pc.ERROR)},{ALT:()=>this.CONSUME(pc.VERSION)},{ALT:()=>this.CONSUME(pc.LINE)}]),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(e),e}),this.ppPragma=this.RR("ppPragma",()=>({kind:"ppPragma",dir:this.CONSUME(pc.PRAGMA_DIRECTIVE)})),this.ppSingle=this.RR("ppSingle",()=>(this.CONSUME(pc.HASH),{kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IFDEF)},{ALT:()=>this.CONSUME(pc.IFNDEF)}]),tokens:[this.CONSUME(pc.IDENTIFIER)],node:void 0})),this.ppExtension=this.RR("ppExtension",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.EXTENSION);const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.COLON),{kind:"ppExtension",extension:e,behavior:this.CONSUME1(pc.IDENTIFIER)}}),this.ppDirective=this.RR("ppDirective",()=>this.OR([{ALT:()=>this.SUBRULE(this.ppDefine)},{ALT:()=>this.SUBRULE(this.ppExtension)},{ALT:()=>this.SUBRULE(this.ppNone)},{ALT:()=>this.SUBRULE(this.ppSingle)},{ALT:()=>this.SUBRULE(this.ppMulti)},{ALT:()=>this.SUBRULE(this.ppPragma)},{ALT:()=>this.SUBRULE(this.ppInclude)}])),this.ppIdentifier=this.RR("ppIdentifier",()=>this.OR([{ALT:()=>this.CONSUME(pc.IDENTIFIER)},{ALT:()=>this.CONSUME(pc.KEYWORD)},{ALT:()=>this.CONSUME(pc.BASIC_TYPE)}])),this.ppDefs=[],this.performSelfAnalysis()}reset(){super.reset(),this.ppDefs=[],this.backtracking=!1,this.preprocessing=!1}LEFT_ASSOC(e,t){const n=this.LA(1);let r=this.SUBRULE1(e);return this.MANY(()=>{const i=this.CONSUME(t),s=this.SUBRULE2(e);return r={kind:"binaryExpression",lhs:r,rhs:s,op:i,firstToken:n,lastToken:this.LA(0)},r}),r}ANNOTATE(e){return(...t)=>{const n=this.LA(1),r=e(...t);return r&&hc(r)&&!r.firstToken&&this.FINALIZE(r,n),r}}BACKTRACK(e,t){const n=super.BACKTRACK(e,t);return function(){try{return this.backtracking=!0,n.call(this)}finally{this.backtracking=!1}}}RR(e,t,n){return super.RULE(e,this.ANNOTATE(t),n)}FINALIZE(e,t){this.RECORDING_PHASE||this.backtracking||(e.firstToken=t,e.lastToken=this.LA(0))}isAtEof(){return this.LA(1).tokenType===Ml}};const{ll:{printDocToString:vc},LX:{indentIfBreak:Cc,group:Dc,indent:Sc,join:Ac,line:_c,softline:yc,hardline:bc,fill:Tc,lineSuffixBoundary:Rc}}=r,xc=new class extends uc{constructor(){super(...arguments),this.result=void 0}visit(e){if(!this.result){const t=this.result=[];return super.visit(e),this.result=void 0,t}e&&this.result.push(e)}};function wc(e){return(cc(e)?e:e.lastToken).endOffset+1}const Fc={"glsl-parser":{parse(e,t){const n=function(e){const t=function(e){const t=[];let n="",r=0,i=0;return{result:e.replace(/\\(\r\n|\n\r|\r|\n)(.*?)(?:(?=\\?[\r\n])|$)/g,(s,o,a,l)=>{r++,i+=function(e,t){let n=t;for(;n>=0&&"\r"!==e[n]&&"\n"!==e[n];)n--;return t-n-1}(e,l),t.push({originalOffset:l+1+o.length,newOffset:l-n.length,length:a.length,lineDiff:-r,columnDiff:i}),n+=" "+o;let u="";return e.length>l+s.length&&"\\"===e[l+s.length]||(u=n,n="",r=0,i=0),a+u}),changes:t}}(e),n=gc.tokenize(t.result);!function(e,t){if(t.errors.length)throw new Error("LEXER ERROR: "+t.errors.map(t=>t.message+":\n"+dc(e,{startLine:t.line,startColumn:t.column,endLine:t.line,endColumn:t.column+t.length})).join())}(t.result,n),function(e,t){let n=0;function r(e,t){const n=t.originalOffset-t.newOffset;e.startOffset>=t.newOffset&&(e.lineNoCont=e.startLine,e.startOffset+=n,e.startLine-=t.lineDiff,e.startColumn-=t.columnDiff),e.endOffset+=n,e.endLine-=t.lineDiff,e.endColumn-=t.columnDiff}for(const i of t){for(;e[n]&&e[n].endOffset0)throw new Error("PARSE ERROR: "+t.map(t=>t.message+"\n"+t.context.ruleStack.join(" > ")+"\n"+dc(e,t.token)).join("\n"))}(t.result,Ec.errors);const i=Ec.ppDefs;function s(e,t){Ec.input=e;const n=t(Ec);return Ec.isAtEof()&&0===Ec.errors.length?n:void 0}for(const e of i)e.node=s(e.tokens,e=>e.externalDeclaration(!0,!0))??s(e.tokens,e=>e.statement())??s(e.tokens,e=>e.expression());return r.comments=n.groups.COMMENTS,r}(e);return n.comments?.forEach(e=>e.value=JSON.stringify(e)),n},astFormat:"glsl-ast",locStart:function(e){return(cc(e)?e:e.firstToken).startOffset},locEnd:wc}};function Nc(e){switch(e){case pc.STAR:case pc.SLASH:case pc.PERCENT:return 4;case pc.PLUS:case pc.DASH:return 5;case pc.LEFT_OP:case pc.RIGHT_OP:return 6;case pc.LEFT_ANGLE:case pc.RIGHT_ANGLE:case pc.LE_OP:case pc.GE_OP:return 7;case pc.EQ_OP:case pc.NE_OP:return 8;case pc.AMPERSAND:return 9;case pc.CARET:return 10;case pc.VERTICAL_BAR:return 11;case pc.AND_OP:case pc.XOR_OP:return 12;case pc.OR_OP:return 13;case pc.COMMA:return 17;default:throw new Error}}function Lc(e,t){switch(e.kind){default:return 1;case"variableExpression":return t?.find(t=>t.image===e.var.image)?18:1;case"arrayAccess":case"functionCall":case"fieldAccess":case"postfixExpression":return 2;case"unaryExpression":return 3;case"binaryExpression":return Nc(e.op.tokenType);case"conditionalExpression":return 15;case"assignmentExpression":return 16;case"commaExpression":return 17}}function Oc(e,t){return t?["(",e,")"]:e}function Ic(e,t,n,r){const i="binaryExpression"===n.kind&&"binaryExpression"===n.lhs.kind&&Nc(n.lhs.op.tokenType)===Nc(n.op.tokenType)||"commaExpression"===n.kind&&"commaExpression"===n.lhs.kind,s="binaryExpression"===n.kind?n.op.tokenType:pc.COMMA;let o;return i?(o=e.call(e=>Ic(e,t,e.getValue(),r),"lhs"),o.push("commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))),o):[Oc(e.call(t,"lhs"),Lc(n.lhs,r)>Nc(s)),"commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))]}function kc(e,t,n){return"expressionStatement"!==e.kind||e.expression?"compoundStatement"===e.kind||n?[" ",t]:Sc([_c,t]):";"}function Mc(e,t){return vc(e,Object.assign({},t,{printWidth:t.printWidth-2})).formatted.trim().replace(/^.*(?=[\r\n])/gm,e=>e+" ".repeat(t.printWidth-2-e.length+1)+"\\")}function Pc(e){return"assignmentExpression"===e.kind}function Bc(e){return"assignmentExpression"===e.kind||"declarator"===e.kind}function Uc(e,t,n,r,i,s){const o=function(e,t,n){if(!n)return"only-left";const r=!Pc(n);return e.match(Pc,Bc,e=>!r||"expressionStatement"!==e.kind&&"initDeclaratorListDeclaration"!==e.kind)?r?"chain-tail":"chain":!r&&Pc(n.rhs)||(t.originalText,0)||"binaryExpression"===n.kind||"commaExpression"===n.kind||"conditionalExpression"===n.kind&&"binaryExpression"===n.condition.kind?"break-after-operator":"constantExpression"===n.kind?"never-break-after-operator":"fluid"}(e,t,s);switch(o){case"break-after-operator":return Dc([Dc(n),r,Dc(Sc([_c,i]))]);case"never-break-after-operator":return Dc([Dc(n),r," ",i]);case"fluid":{const e=Symbol("assignment");return Dc([Dc(n),r,Dc(Sc(_c),{id:e}),Rc,Cc(i,{groupId:e})])}case"chain":return[Dc(n),r,_c,i];case"chain-tail":return[Dc(n),r,Sc([_c,i])];case"only-left":return n;default:throw new Error}}const $c={"glsl-ast":{print(e,t,n){const r=t.inMacro,i=e.getValue();if(!i)return[];if(cc(i))return i.image;const s=t=>e.call(n,t);try{switch(i.kind){case"translationUnit":{const r=[];return e.each((e,i)=>{const s=e.getValue();r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc),r.push(bc)},"declarations"),r}case"precisionDeclaration":return["precision ",i.precisionQualifier.image," ",e.call(n,"typeSpecifierNoPrec"),";"];case"fullySpecifiedType":{const e=[];return i.typeQualifier&&e.push(s("typeQualifier")," "),e.push(s("typeSpecifier")),e}case"typeSpecifier":{const e=[];return i.precisionQualifier&&e.push(i.precisionQualifier.image," "),e.push(s("typeSpecifierNonArray")),i.arraySpecifier&&e.push(s("arraySpecifier")),e}case"typeQualifier":{const e=[];return i.invariantQualifier&&e.push("invariant"),i.interpolationQualifier&&e.push(i.interpolationQualifier.image),i.layoutQualifier&&e.push(s("layoutQualifier")),i.storageQualifier&&e.push(s("storageQualifier")),Ac(" ",e)}case"storageQualifier":{const t=[];return i.CONST&&t.push("const"),i.CENTROID&&e.getParentNode().interpolationQualifier?.tokenType!==pc.FLAT&&t.push("centroid"),i.IN&&t.push("in"),i.OUT&&t.push("out"),i.VARYING&&t.push("varying"),i.ATTRIBUTE&&t.push("attribute"),i.UNIFORM&&t.push("uniform"),Ac(" ",t)}case"functionPrototype":case"functionDefinition":return[Dc([s("returnType")," ",s("name"),"(",Sc([yc,Ac([",",_c],e.map(n,"params"))]),yc,")"]),"functionPrototype"===i.kind?";":[" ",s("body")]];case"parameterDeclaration":return[i.parameterTypeQualifier?[s("parameterTypeQualifier")," "]:"",i.parameterQualifier?.tokenType===pc.OUT||i.parameterQualifier?.tokenType===pc.INOUT?i.parameterQualifier?.image+" ":"",s("typeSpecifier")," ",s("pName"),s("arraySpecifier")];case"initDeclaratorListDeclaration":case"structDeclaration":{const t=e.map(n,"declarators"),r="forStatement"===e.getParentNode().kind,o=i.declarators.some(e=>e.init);return Dc([s("fsType"),0===t.length?"":" ",1===t.length?t:Dc(Sc(Ac([",",o&&!r?bc:_c],t))),";"])}case"declarator":{const n=s("arraySpecifier"),r=[i.name.image,n];return Uc(e,t,r," =",s("init"),i.init)}case"arraySpecifier":return Dc(["[",Sc([yc,s("size")]),yc,"]"]);case"arrayAccess":return[Oc(s("on"),Lc(i.on,r)>2),"[",s("index"),"]"];case"structSpecifier":{const r=[];return e.each((e,i,s)=>{const o=e.getValue();r.push(bc),r.push(n(e)),i!==s.length-1&&_s.isNextLineEmpty(t.originalText,o,wc)&&r.push(bc)},"declarations"),Dc(["struct",i.name?" "+i.name.image:""," {",Sc(r),bc,"}"])}case"compoundStatement":{const r=[],s=!!i.comments?.some(e=>!e.leading&&!e.trailing&&!e.printed);return e.each((e,i)=>{const s=e.getValue();0!==i&&r.push(bc),r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc)},"statements"),s&&e.each(e=>{const t=e.getValue();t.leading||t.trailing||(r.push(n(e)),t.printed=!0)},"comments"),Dc(["{",r.length?[Sc([bc,r]),bc]:"","}"])}case"returnStatement":return i.what?["return"," ",s("what"),";"]:"return;";case"breakStatement":return"break;";case"continueStatement":return"continue;";case"discardStatement":return"discard;";case"selectionStatement":{const e=[],t=kc(i.yes,s("yes"),!1),n=Dc(["if (",Dc([Sc([yc,s("condition")]),yc]),")",t]);if(e.push(n),i.no){const t=i.yes.comments?.some(e=>e.trailing&&e.tokenType===pc.LINE_COMMENT)||i.yes.comments?.findLast(e=>!e.leading&&!e.trailing)?.tokenType===pc.LINE_COMMENT,n="compoundStatement"===i.yes.kind&&!t;e.push(n?" ":bc),e.push("else",Dc(kc(i.no,s("no"),"selectionStatement"===i.no.kind)))}return e}case"forStatement":{const e=kc(i.statement,s("statement"),!1),t=!1,n=t?[t,yc]:"";return"expressionStatement"!==i.initExpression.kind||i.initExpression.expression||i.conditionExpression||i.loopExpression?[n,Dc(["for (",Dc([Sc([yc,s("initExpression"),_c,s("conditionExpression"),";",_c,s("loopExpression")]),yc]),")",e])]:[n,Dc(["for (;;)",e])]}case"whileStatement":{const e=kc(i.statement,s("statement"),!1);return["while (",Dc(s("conditionExpression")),")",e]}case"doWhileStatement":return["do ",s("statement")," while (",Dc(s("conditionExpression")),");"];case"functionCall":return function(t){const r=e.map(n,"args");let i,o;if(void 0===t.callee.arraySpecifier&&cc(t.callee.typeSpecifierNonArray)&&void 0!==(i=function(e){switch(e){case pc.MAT2X2:return[2,2];case pc.MAT2X3:return[2,3];case pc.MAT2X4:return[2,4];case pc.MAT3X2:return[3,2];case pc.MAT3X3:return[3,3];case pc.MAT3X4:return[3,4];case pc.MAT4X2:return[4,2];case pc.MAT4X3:return[4,3];case pc.MAT4X4:return[4,4];default:return}}(t.callee.typeSpecifierNonArray.tokenType))&&i[0]*i[1]===t.args.length){const e=t.args.every(e=>"constantExpression"===e.kind&&(e.const_.tokenType===pc.FLOATCONSTANT||e.const_.tokenType===pc.INTCONSTANT)||"unaryExpression"===e.kind&&(e.op.tokenType===pc.PLUS||e.op.tokenType===pc.DASH)&&"constantExpression"===e.on.kind&&(e.on.const_.tokenType===pc.FLOATCONSTANT||e.on.const_.tokenType===pc.INTCONSTANT));if(e){const e=[],n=[];let s=0,a=0;for(let i=0;i2),".",s("functionCall")];case"postfixExpression":return[Oc(s("on"),Lc(i.on,r)>2),s("op")];case"unaryExpression":return[s("op"),Oc(s("on"),Lc(i.on,r)>3)];case"assignmentExpression":{const n=s("lhs");return Uc(e,t,n," "+i.op.image,s("rhs"),i.rhs)}case"conditionalExpression":return[Oc(s("condition"),Lc(i.condition,r)>=15),Sc([_c,"? ",s("yes"),_c,": ",s("no")])];case"commaExpression":case"binaryExpression":{const t=Ic(e,n,i,r),s=e.getParentNode();if("selectionStatement"===s.kind||"whileStatement"===s.kind||"switchStatement"===s.kind||"doWhileStatement"===s.kind)return t;const o=()=>{const t=e.getParentNode();return!!t&&("functionCall"===t.kind&&"commaExpression"===i.kind||"binaryExpression"===t.kind&&((n=t.op.tokenType)===pc.CARET||n===pc.VERTICAL_BAR||n===pc.AMPERSAND));var n},a=e.getParentNode(1);if("returnStatement"===s.kind||"forStatement"===s.kind||"conditionalExpression"===s.kind&&"returnStatement"!==a.kind&&"functionCall"!==a.kind||"assignmentExpression"===s.kind||"declarator"===s.kind)return Dc(t);{const e=t.slice(0,1),n=t.slice(e.length);return Dc(Oc([...e,Sc(n)],o()))}}case"expressionStatement":return[s("expression"),";"];case"fieldAccess":return[Oc(s("on"),Lc(i.on,r)>2),".",s("field")];case"constantExpression":{const e=i.const_;return e.tokenType===pc.FLOATCONSTANT?function(e){const t=e.indexOf(".");return 0===t&&(e="0"+e),e=e.replace("E","e"),-1!==t&&(e=(e=(e=(e=e.replace(".e","e")).replace(/(?=4):Tc(Ac(_c,e.map(n,"tokens")))])]);return t.inMacro=void 0,Mc(r,t)}case"ppDir":return Mc(Dc(["#",i.dir.image," ",Sc(i.node?s("node"):Tc(Ac(_c,e.map(n,"tokens"))))]),t);case"ppPragma":return i.dir.image.replace(/^#\s+/,"#").replace(/^#pragma\s{2,}/,"#pragma ");case"ppCall":return Dc([i.callee.image,"(",Ac([",",_c],e.map((e,t,n)=>n[t].tokens.map(e=>e.image),"args")),")"]);case"ppInclude":return["#include ",i.what];case"ppExtension":return["#extension ",i.extension.image," : ",i.behavior.image];case"switchStatement":return["switch (",Dc([Sc([yc,s("initExpression")]),yc]),") {",i.cases.length?Sc([bc,Ac(bc,e.map(n,"cases"))]):"",bc,"}"];case"caseBlock":{const r=s("caseLabel"),i=[];return e.each((e,r)=>{const s=e.getValue();i.push(bc),i.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&i.push(bc)},"statements"),[r,Sc(i)]}case"caseLabel":return void 0===i.case_?"default:":["case ",s("case_"),":"];case"layoutQualifier":return["layout(",Ac(", ",i.layoutQualifierIds.map(e=>void 0===e.init?e.IDENTIFIER.image:[e.IDENTIFIER.image," = ",e.init.image])),")"];case"uniformBlock":return[s("typeQualifier")," ",i.blockName.image," {",Sc([bc,Ac(bc,e.map(n,"declarations"))]),bc,"};"];case"typeQualifierDeclaration":return[s("typeQualifier"),";"];default:throw new Error("unexpected n type "+i.kind+"\n"+JSON.stringify(i).substring(0,100))}}catch(e){throw console.error("error printing "+JSON.stringify(i).substring(0,100)+"\n"),e}},embed(e,t){const n=e.getValue();return!cc(n)||n.tokenType!==pc.LINE_COMMENT&&n.tokenType!==pc.MULTILINE_COMMENT?null:(e,t,n,r)=>{}},getVisitorKeys:(e,t)=>cc(e)?[]:Object.keys(e).filter(e=>!t.has(e)),getCommentChildNodes:e=>cc(e)?[]:xc.visit(e),canAttachComment:e=>!0,printComment:function(e,t){const n=e.getValue();return n.tokenType===pc.MULTILINE_COMMENT&&"*"===n.image[2]?"/**\n"+n.image.substring(3,n.image.length-2).split("\n").map(e=>" *"===e?"":e.startsWith(" * ")?e.substring(3):e).join("\n").trim().split("\n").map(e=>""===e?" *":" * "+e).join("\n")+"\n */":n.image},hasPrettierIgnore(e){const t=e.getValue();return(t&&hc(t)&&t.comments?.some(e=>/\/\/\s*prettier-ignore\b.*/.test(e.image)))??!1}}},Gc={parsers:Fc,printers:$c};function Vc(e){return e.replace(/^([^\n]*;)\n(?=(?:[A-Za-z_]\w*\s+)+[A-Za-z_]\w*\s*\()/gm,"$1\n\n").replace(/^}\n(?=\S)/gm,"}\n\n")}var Wc,Hc,jc=(Wc={program:function(e){return jc(e.program)+jc(e.wsEnd)},segment:function(e){return jc(e.blocks)},text:function(e){return jc(e.text)},literal:function(e){return jc(e.wsStart)+jc(e.literal)+jc(e.wsEnd)},identifier:function(e){return jc(e.identifier)+jc(e.wsEnd)},binary:function(e){return jc(e.left)+jc(e.operator)+jc(e.right)},group:function(e){return jc(e.lp)+jc(e.expression)+jc(e.rp)},unary:function(e){return jc(e.operator)+jc(e.expression)},unary_defined:function(e){return jc(e.operator)+jc(e.lp)+jc(e.identifier)+jc(e.rp)},int_constant:function(e){return jc(e.token)+jc(e.wsEnd)},elseif:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},if:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},ifdef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},ifndef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},else:function(e){return jc(e.token)+jc(e.wsEnd)+jc(e.body)},error:function(e){return jc(e.error)+jc(e.message)+jc(e.wsEnd)},undef:function(e){return jc(e.undef)+jc(e.identifier)+jc(e.wsEnd)},define:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.body)+jc(e.wsEnd)},define_arguments:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.lp)+jc(e.args)+jc(e.rp)+jc(e.body)+jc(e.wsEnd)},conditional:function(e){return jc(e.wsStart)+jc(e.ifPart)+jc(e.elseIfParts)+jc(e.elsePart)+jc(e.endif)+jc(e.wsEnd)},version:function(e){return jc(e.version)+jc(e.value)+jc(e.profile)+jc(e.wsEnd)},pragma:function(e){return jc(e.pragma)+jc(e.body)+jc(e.wsEnd)},line:function(e){return jc(e.line)+jc(e.value)+jc(e.wsEnd)},extension:function(e){return jc(e.extension)+jc(e.name)+jc(e.colon)+jc(e.behavior)+jc(e.wsEnd)}},Hc=function(e){return"string"==typeof e?e:null==e?"":Array.isArray(e)?e.map(Hc).join(""):e.type in Wc?Wc[e.type](e):"NO GENERATOR FOR ".concat(e.type)+e});const zc=jc;function Xc(e,t,n,r){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Xc.prototype),i.expected=t,i.found=n,i.location=r,i.name="SyntaxError",i}function Kc(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}function Yc(e,t){var n,r={},i=(t=void 0!==t?t:{}).grammarSource,s={program:An,constant_expression:hr},o=An,a="<<",l=">>",u="<=",c=">=",h="==",d="!=",f="&&",p="||",m="(",g=")",E=",",v="!",C="-",D="~",S="+",A="*",_="/",y="%",b="<",T=">",R="|",x="^",w="&",F=":",N="#",L="define",O="line",I="undef",k="error",M="pragma",P="defined",B="if",U="ifdef",$="ifndef",G="elif",V="else",W="endif",H="version",j="extension",z="0",X="//",K="/*",Y="*/",q=/^[A-Za-z_]/,Q=/^[A-Za-z_0-9]/,Z=/^[uU]/,J=/^[1-9]/,ee=/^[0-7]/,te=/^[xX]/,ne=/^[0-9a-fA-F]/,re=/^[0-9]/,ie=/^[\n\r]/,se=/^[^\n\r]/,oe=/^[ \t]/,ae=gn("<<",!1),le=gn(">>",!1),ue=gn("<=",!1),ce=gn(">=",!1),he=gn("==",!1),de=gn("!=",!1),fe=gn("&&",!1),pe=gn("||",!1),me=gn("(",!1),ge=gn(")",!1),Ee=gn(",",!1),ve=gn("!",!1),Ce=gn("-",!1),De=gn("~",!1),Se=gn("+",!1),Ae=gn("*",!1),_e=gn("/",!1),ye=gn("%",!1),be=gn("<",!1),Te=gn(">",!1),Re=gn("|",!1),xe=gn("^",!1),we=gn("&",!1),Fe=gn(":",!1),Ne=gn("#",!1),Le=gn("define",!1),Oe=(gn("include",!1),gn("line",!1)),Ie=gn("undef",!1),ke=gn("error",!1),Me=gn("pragma",!1),Pe=gn("defined",!1),Be=gn("if",!1),Ue=gn("ifdef",!1),$e=gn("ifndef",!1),Ge=gn("elif",!1),Ve=gn("else",!1),We=gn("endif",!1),He=gn("version",!1),je=gn("extension",!1),ze=En([["A","Z"],["a","z"],"_"],!1,!1),Xe=En([["A","Z"],["a","z"],"_",["0","9"]],!1,!1),Ke=vn("number"),Ye=En(["u","U"],!1,!1),qe=En([["1","9"]],!1,!1),Qe=gn("0",!1),Ze=En([["0","7"]],!1,!1),Je=En(["x","X"],!1,!1),et=En([["0","9"],["a","f"],["A","F"]],!1,!1),tt=En([["0","9"]],!1,!1),nt=vn("control line"),rt=En(["\n","\r"],!1,!1),it=vn("token string"),st=En(["\n","\r"],!0,!1),ot=vn("text"),at=vn("if"),lt=vn("primary expression"),ut=vn("unary expression"),ct=vn("multiplicative expression"),ht=vn("additive expression"),dt=vn("shift expression"),ft=vn("relational expression"),pt=vn("equality expression"),mt=vn("and expression"),gt=vn("exclusive or expression"),Et=vn("inclusive or expression"),vt=vn("logical and expression"),Ct=vn("logical or expression"),Dt=vn("constant expression"),St=vn("whitespace or comment"),At=gn("//",!1),_t=gn("/*",!1),yt=gn("*/",!1),bt={type:"any"},Tt=vn("whitespace"),Rt=En([" ","\t"],!1,!1),xt=function(e,t){return gr("program",{program:e.blocks,wsEnd:t})},wt=function(e,t){return gr("int_constant",{token:e,wsEnd:t})},Ft=function(e,t){return gr("literal",{literal:e,wsEnd:t})},Nt=function(e){return"#"},Lt=function(e,t,n){return gr("literal",{literal:t,wsStart:e,wsEnd:n})},Ot=function(e,t){return gr("identifier",{identifier:e,wsEnd:t})},It=function(e){return gr("identifier",{identifier:e})},kt=function(e){return gr("text",{text:e.join("")})},Mt=function(e){return gr("segment",{blocks:e})},Pt=function(e,t,n,r,i){return[r,...i.flat()]},Bt=function(e,t,n,r,i,s){return gr("define_arguments",{define:e,identifier:t,lp:n,args:r||[],rp:i,body:s})},Ut=function(e,t,n){return gr("define",{define:e,identifier:t,body:n})},$t=function(e,t){return gr("line",{line:e,value:t})},Gt=function(e,t){return gr("undef",{undef:e,identifier:t})},Vt=function(e,t){return gr("error",{error:e,message:t})},Wt=function(e,t){return gr("pragma",{pragma:e,body:t})},Ht=function(e,t,n){return gr("version",{version:e,value:t,profile:n})},jt=function(e,t,n,r){return gr("extension",{extension:e,name:t,colon:n,behavior:r})},zt=function(e,t){return{...e,wsEnd:t}},Xt=function(e,t,n){return{...e,body:n,wsEnd:t}},Kt=function(e,t,n,r,i){return gr("elseif",{token:t,expression:n,wsEnd:r,body:i})},Yt=function(e,t,n,r,i){return gr("else",{token:n,wsEnd:r,body:i})},qt=function(e,t,n,r,i){return gr("conditional",{ifPart:e,elseIfParts:t,elsePart:n,endif:r,wsEnd:i})},Qt=function(e,t){return gr("ifdef",{token:e,identifier:t})},Zt=function(e,t){return gr("ifndef",{token:e,identifier:t})},Jt=function(e,t){return gr("if",{token:e,expression:t})},en=function(e,t,n){return gr("group",{lp:e,expression:t,rp:n})},tn=function(e,t,n,r){return gr("unary_defined",{operator:e,lp:t,identifier:n,rp:r})},nn=function(e,t){return gr("unary",{operator:e,expression:t})},rn=function(e,t){return Cr(e,t)},sn=function(e,t){return vr(e,t)},on=function(e,t,n){return Er(t,n)},an=function(e,t){return Er(e,t.flat())},ln=function(e){return e},un=function(e){return e},cn=0,hn=[{line:1,column:1}],dn=0,fn=[],pn=0,mn={};if("startRule"in t){if(!(t.startRule in s))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=s[t.startRule]}function gn(e,t){return{type:"literal",text:e,ignoreCase:t}}function En(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function vn(e){return{type:"other",description:e}}function Cn(t){var n,r=hn[t];if(r)return r;for(n=t-1;!hn[n];)n--;for(r={line:(r=hn[n]).line,column:r.column};ndn&&(dn=cn,fn=[]),fn.push(e))}function An(){var e,t,n,i=75*cn+0,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Qn())!==r?(n=dr(),e=xt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}function _n(){var t,n,i,s=75*cn+2,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===a?(n=a,cn+=2):(n=r,0===pn&&Sn(ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function yn(){var t,n,i,s=75*cn+3,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===l?(n=l,cn+=2):(n=r,0===pn&&Sn(le)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function bn(){var t,n,i,s=75*cn+4,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===u?(n=u,cn+=2):(n=r,0===pn&&Sn(ue)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Tn(){var t,n,i,s=75*cn+5,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===c?(n=c,cn+=2):(n=r,0===pn&&Sn(ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Rn(){var t,n,i,s=75*cn+6,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===h?(n=h,cn+=2):(n=r,0===pn&&Sn(he)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function xn(){var t,n,i,s=75*cn+7,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===d?(n=d,cn+=2):(n=r,0===pn&&Sn(de)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function wn(){var t,n,i,s=75*cn+8,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===f?(n=f,cn+=2):(n=r,0===pn&&Sn(fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Fn(){var t,n,i,s=75*cn+9,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===p?(n=p,cn+=2):(n=r,0===pn&&Sn(pe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Nn(){var t,n,i,s=75*cn+10,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,40===e.charCodeAt(cn)?(n=m,cn++):(n=r,0===pn&&Sn(me)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Ln(){var t,n,i,s=75*cn+11,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,41===e.charCodeAt(cn)?(n=g,cn++):(n=r,0===pn&&Sn(ge)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function On(){var t,n,i,s=75*cn+12,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,44===e.charCodeAt(cn)?(n=E,cn++):(n=r,0===pn&&Sn(Ee)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function In(){var t,n,i,s=75*cn+14,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,45===e.charCodeAt(cn)?(n=C,cn++):(n=r,0===pn&&Sn(Ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function kn(){var t,n,i,s=75*cn+16,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,43===e.charCodeAt(cn)?(n=S,cn++):(n=r,0===pn&&Sn(Se)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Mn(){var t,n,i,s=75*cn+17,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,42===e.charCodeAt(cn)?(n=A,cn++):(n=r,0===pn&&Sn(Ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Pn(){var t,n,i,s=75*cn+18,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,47===e.charCodeAt(cn)?(n=_,cn++):(n=r,0===pn&&Sn(_e)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Bn(){var t,n,i,s=75*cn+19,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,37===e.charCodeAt(cn)?(n=y,cn++):(n=r,0===pn&&Sn(ye)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Un(){var t,n,i,s=75*cn+20,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,60===e.charCodeAt(cn)?(n=b,cn++):(n=r,0===pn&&Sn(be)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function $n(){var t,n,i,s=75*cn+21,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,62===e.charCodeAt(cn)?(n=T,cn++):(n=r,0===pn&&Sn(Te)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Gn(){var t,n,i,s=75*cn+22,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,124===e.charCodeAt(cn)?(n=R,cn++):(n=r,0===pn&&Sn(Re)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Vn(){var t,n,i,s=75*cn+23,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,94===e.charCodeAt(cn)?(n=x,cn++):(n=r,0===pn&&Sn(xe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Wn(){var t,n,i,s=75*cn+24,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,38===e.charCodeAt(cn)?(n=w,cn++):(n=r,0===pn&&Sn(we)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Hn(){var t,n,i,s=75*cn+26,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,35===e.charCodeAt(cn)?(i=N,cn++):(i=r,0===pn&&Sn(Ne)),(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Nt(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function jn(){var t,n,i,s,o,a,l=75*cn+27,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===L?(a=L,cn+=6):(a=r,0===pn&&Sn(Le)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function zn(){var t,n,i,s,o,a,l=75*cn+37,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===G?(a=G,cn+=4):(a=r,0===pn&&Sn(Ge)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function Xn(){var t,n,i,s,o,a,l=75*cn+42,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Ot(n,i)):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t}function Kn(){var t,n,i,s,o=75*cn+44,a=mn[o];return a?(cn=a.nextPos,a.result):(pn++,t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+46,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,J.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(qe)),i!==r){for(s=[],o=qn();o!==r;)s.push(o),o=qn();n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o=75*cn+47,a=mn[o];if(a)return cn=a.nextPos,a.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r){for(i=[],ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));s!==r;)i.push(s),ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));t=n=[n,i]}else cn=t,t=r;return mn[o]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+48,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r)if(te.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Je)),i!==r){for(s=[],ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));o!==r;)s.push(o),ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));t=n=[n,i,s]}else cn=t,t=r;else cn=t,t=r;return mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),t=n!==r?e.substring(t,cn):n)),pn--,t===r&&(n=r,0===pn&&Sn(Ke)),mn[o]={nextPos:cn,result:t},t)}function Yn(){var t,n=75*cn+45,i=mn[n];return i?(cn=i.nextPos,i.result):(Z.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(Ye)),mn[n]={nextPos:cn,result:t},t)}function qn(){var t,n=75*cn+49,i=mn[n];return i?(cn=i.nextPos,i.result):(re.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(tt)),mn[n]={nextPos:cn,result:t},t)}function Qn(){var e,t,n,i,s,o=75*cn+50,a=mn[o];if(a)return cn=a.nextPos,a.result;if(cn,t=[],(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}if(n!==r){for(;n!==r;)if(t.push(n),(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}}else t=r;return t!==r&&(t=Mt(t)),e=t,mn[o]={nextPos:cn,result:e},e}function Zn(){var t,n,i,s,o,a,l,u,c,h,d,f=75*cn+51,p=mn[f];if(p)return cn=p.nextPos,p.result;if(pn++,t=function(){var t,n,i,s,o,a,l,u,c=75*cn+54,h=mn[c];if(h)return cn=h.nextPos,h.result;if(t=cn,n=cn,i=function(){var t,n,i,s=75*cn+55,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+35,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===U?(a=U,cn+=5):(a=r,0===pn&&Sn(Ue)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Qt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+36,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===$?(a=$,cn+=6):(a=r,0===pn&&Sn($e)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Zt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+34,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,2)===B?(a=B,cn+=2):(a=r,0===pn&&Sn(Be)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r?((i=Jn())===r&&(i=null),t=Jt(n,i)):(cn=t,t=r))),pn--,t===r&&(n=r,0===pn&&Sn(at)),mn[s]={nextPos:cn,result:t},t)}(),i!==r?(ie.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(rt)),s!==r?((o=Qn())===r&&(o=null),n=Xt(i,s,o)):(cn=n,n=r)):(cn=n,n=r),n!==r){for(i=[],s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s=cn,o=function(){var t,n,i,s,o,a,l=75*cn+38,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===V?(a=V,cn+=4):(a=r,0===pn&&Sn(Ve)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a!==r?((l=Qn())===r&&(l=null),s=Yt(n,i,o,a,l)):(cn=s,s=r)):(cn=s,s=r),s===r&&(s=null),o=function(){var t,n,i,s,o,a,l=75*cn+39,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===W?(a=W,cn+=5):(a=r,0===pn&&Sn(We)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a===r&&(a=null),t=qt(n,i,s,o,a)):(cn=t,t=r)}else cn=t,t=r;return mn[c]={nextPos:cn,result:t},t}(),t===r){if(t=cn,n=cn,(i=jn())!==r)if(s=function(){var t,n,i,s,o,a,l=75*cn+43,u=mn[l];if(u)return cn=u.nextPos,u.result;if(cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r&&(n=It(n)),t=n,mn[l]={nextPos:cn,result:t},t}(),s!==r)if((o=Nn())!==r){if(a=cn,(l=Xn())!==r){for(u=[],c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);c!==r;)u.push(c),c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);a=Pt(i,s,o,l,u)}else cn=a,a=r;a===r&&(a=null),(l=Ln())!==r?((u=Jn())===r&&(u=null),n=Bt(i,s,o,a,l,u)):(cn=n,n=r)}else cn=n,n=r;else cn=n,n=r;else cn=n,n=r;if(n===r&&(n=cn,(i=jn())!==r&&(s=Xn())!==r?((o=Jn())===r&&(o=null),n=Ut(i,s,o)):(cn=n,n=r),n===r)){if(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+29,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===O?(a=O,cn+=4):(a=r,0===pn&&Sn(Oe)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r){if(s=cn,o=[],(a=qn())!==r)for(;a!==r;)o.push(a),a=qn();else o=r;(s=o!==r?e.substring(s,cn):o)!==r?n=$t(i,s):(cn=n,n=r)}else cn=n,n=r;n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+30,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===I?(a=I,cn+=5):(a=r,0===pn&&Sn(Ie)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?n=Gt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+31,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===k?(a=k,cn+=5):(a=r,0===pn&&Sn(ke)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Vt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+32,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===M?(a=M,cn+=6):(a=r,0===pn&&Sn(Me)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Wt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+40,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,7)===H?(a=H,cn+=7):(a=r,0===pn&&Sn(He)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Kn())!==r?((o=Jn())===r&&(o=null),n=Ht(i,s,o)):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+41,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,9)===j?(a=j,cn+=9):(a=r,0===pn&&Sn(je)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?(o=function(){var t,n,i,s=75*cn+25,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,58===e.charCodeAt(cn)?(n=F,cn++):(n=r,0===pn&&Sn(Fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),o!==r&&(a=Jn())!==r?n=jt(i,s,o,a):(cn=n,n=r)):(cn=n,n=r))))))}n!==r?(ie.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(rt)),i===r&&(i=null),t=zt(n,i)):(cn=t,t=r)}return pn--,t===r&&(n=r,0===pn&&Sn(nt)),mn[f]={nextPos:cn,result:t},t}function Jn(){var t,n,i,s=75*cn+52,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st)),i!==r)for(;i!==r;)n.push(i),se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(it)),mn[s]={nextPos:cn,result:t},t}function er(){var t,n,i,s,o,a,l=75*cn+53,u=mn[l];if(u)return cn=u.nextPos,u.result;if(pn++,t=cn,n=cn,i=cn,pn++,s=cn,(o=pr())===r&&(o=null),35===e.charCodeAt(cn)?(a=N,cn++):(a=r,0===pn&&Sn(Ne)),a!==r?s=o=[o,a]:(cn=s,s=r),pn--,s===r?i=void 0:(cn=i,i=r),i!==r){if(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st)),o!==r)for(;o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));else s=r;s!==r?(ie.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(rt)),o===r&&(o=null),n=i=[i,s,o]):(cn=n,n=r)}else cn=n,n=r;return n===r&&(ie.test(e.charAt(cn))?(n=e.charAt(cn),cn++):(n=r,0===pn&&Sn(rt))),t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(ot)),mn[l]={nextPos:cn,result:t},t}function tr(){var t,n,i,s,o,a=75*cn+57,l=mn[a];return l?(cn=l.nextPos,l.result):(pn++,t=cn,n=function(){var t,n,i,s,o=75*cn+33,a=mn[o];return a?(cn=a.nextPos,a.result):(t=cn,n=dr(),e.substr(cn,7)===P?(i=P,cn+=7):(i=r,0===pn&&Sn(Pe)),i!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[o]={nextPos:cn,result:t},t)}(),n!==r?((i=Nn())===r&&(i=null),(s=Xn())!==r?((o=Ln())===r&&(o=null),t=tn(n,i,s,o)):(cn=t,t=r)):(cn=t,t=r),t===r&&(t=cn,(n=kn())===r&&(n=In())===r&&(n=function(){var t,n,i,s=75*cn+13,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,33===e.charCodeAt(cn)?(n=v,cn++):(n=r,0===pn&&Sn(ve)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),n===r&&(n=function(){var t,n,i,s=75*cn+15,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,126===e.charCodeAt(cn)?(n=D,cn++):(n=r,0===pn&&Sn(De)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}())),n!==r&&(i=tr())!==r?t=nn(n,i):(cn=t,t=r),t===r&&(t=function(){var e,t,n,i,s=75*cn+56,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,e=function(){var e,t,n,i=75*cn+1,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Kn())!==r?(n=dr(),e=wt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}(),e===r&&(e=cn,(t=Nn())!==r&&(n=hr())!==r&&(i=Ln())!==r?e=en(t,n,i):(cn=e,e=r),e===r&&(e=Xn())),pn--,e===r&&(t=r,0===pn&&Sn(lt)),mn[s]={nextPos:cn,result:e},e)}())),pn--,t===r&&(n=r,0===pn&&Sn(ut)),mn[a]={nextPos:cn,result:t},t)}function nr(){var e,t,n,i,s,o,a=75*cn+58,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=tr())!==r){for(n=[],i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ct)),mn[a]={nextPos:cn,result:e},e}function rr(){var e,t,n,i,s,o,a=75*cn+59,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=nr())!==r){for(n=[],i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ht)),mn[a]={nextPos:cn,result:e},e}function ir(){var e,t,n,i,s,o,a=75*cn+60,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=rr())!==r){for(n=[],i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(dt)),mn[a]={nextPos:cn,result:e},e}function sr(){var e,t,n,i,s,o,a=75*cn+61,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ir())!==r){for(n=[],i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ft)),mn[a]={nextPos:cn,result:e},e}function or(){var e,t,n,i,s,o,a=75*cn+62,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=sr())!==r){for(n=[],i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(pt)),mn[a]={nextPos:cn,result:e},e}function ar(){var e,t,n,i,s,o,a=75*cn+63,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=or())!==r){for(n=[],i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(mt)),mn[a]={nextPos:cn,result:e},e}function lr(){var e,t,n,i,s,o,a=75*cn+64,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ar())!==r){for(n=[],i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(gt)),mn[a]={nextPos:cn,result:e},e}function ur(){var e,t,n,i,s,o,a=75*cn+65,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=lr())!==r){for(n=[],i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Et)),mn[a]={nextPos:cn,result:e},e}function cr(){var e,t,n,i,s,o,a=75*cn+66,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ur())!==r){for(n=[],i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(vt)),mn[a]={nextPos:cn,result:e},e}function hr(){var e,t=75*cn+68,n=mn[t];return n?(cn=n.nextPos,n.result):(pn++,e=function(){var e,t,n,i,s,o,a=75*cn+67,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=cr())!==r){for(n=[],i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Ct)),mn[a]={nextPos:cn,result:e},e}(),pn--,e===r&&0===pn&&Sn(Dt),mn[t]={nextPos:cn,result:e},e)}function dr(){var e,t,n,i,s,o,a=75*cn+69,l=mn[a];if(l)return cn=l.nextPos,l.result;for(pn++,cn,(t=pr())===r&&(t=null),n=[],i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);return e=sn(t,n),pn--,t=r,0===pn&&Sn(St),mn[a]={nextPos:cn,result:e},e}function fr(){var t,n,i,s,o,a,l=75*cn+70,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=function(){var t,n,i,s,o,a=75*cn+71,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,e.substr(cn,2)===X?(i=X,cn+=2):(i=r,0===pn&&Sn(At)),i!==r){for(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),t===r)if(t=cn,n=function(){var t,n,i,s,o,a,l,u=75*cn+72,c=mn[u];if(c)return cn=c.nextPos,c.result;if(t=cn,n=cn,e.substr(cn,2)===K?(i=K,cn+=2):(i=r,0===pn&&Sn(_t)),i!==r){for(s=[],o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);o!==r;)s.push(o),o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);e.substr(cn,2)===Y?(o=Y,cn+=2):(o=r,0===pn&&Sn(yt)),o!==r?n=i=[i,s,o]:(cn=n,n=r)}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[u]={nextPos:cn,result:t},t}(),n!==r){for(i=[],s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);t=an(n,i)}else cn=t,t=r;return mn[l]={nextPos:cn,result:t},t}function pr(){var t,n,i,s=75*cn+73,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt)),i!==r)for(;i!==r;)n.push(i),oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(Tt)),mn[s]={nextPos:cn,result:t},t}function mr(){var t,n,i,s=75*cn+74,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,pn++,Q.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Xe)),pn--,i===r?n=void 0:(cn=n,n=r),n!==r?(i=dr(),t=un(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}e=lh(e);const gr=(e,t)=>({type:e,...t}),Er=(...e)=>e.flat().filter(e=>null!=e&&""!==e&&0!==e.length),vr=(...e)=>{return(t=Er(e.flat())).length>1?t:t[0];var t},Cr=(...e)=>e.flat().reduce((e,[t,n])=>({type:"binary",operator:t,left:e,right:n}));if((n=o())!==r&&cn===e.length)return n;throw n!==r&&cn0){for(t=1,n=1;ts.length)throw new Error("'".concat(t,"': Too many arguments for macro"));if(u.length>":return t(n)>>t(r);case"<":return t(n)":return t(n)>t(r);case"<=":return t(n)<=t(r);case">=":return t(n)>=t(r);case"==":return t(n)==t(r);case"!=":return t(n)!=t(r);case"&":return t(n)&t(r);case"^":return t(n)^t(r);case"|":return t(n)|t(r);case"&&":return t(n)&&t(r);case"||":return t(n)||t(r);default:throw new Error("Preprocessing error: Unknown binary operator ".concat(i))}},unary:function(e,t){switch(e.operator.literal){case"+":return t(e.expression);case"-":return-1*t(e.expression);case"!":return!t(e.expression);case"~":return~t(e.expression);default:throw new Error("Preprocessing error: Unknown unary operator ".concat(e.operator.literal))}}},(r=function(e){var t=n[e.type];if(!t)throw new Error("No evaluate() evaluator for ".concat(e.type));return t(e,r)})(e);var n,r}((n=sh(r,t).trim(),eh(s)(n,{grammarSource:"expression",startRule:"constant_expression"})),t)},lh=function(e,t){return void 0===t&&(t={}),e.replace(/\\[\n\r]/g,"")},uh=function(e,t){void 0===t&&(t={});var n,r,i,s,o=Object.entries(t.defines||{}).reduce(function(e,t){var n,r=t[0],i=t[1];return th(th({},e),((n={})[r]={body:i},n))},{}),a=(void 0===(n=t.preserve)&&(n={}),function(e){var t=null==n?void 0:n[e.node.type];return"function"==typeof t?t(e):t});return r={conditional:{enter:function(e){var t=e,n=t.node;a(t)||(function(e,t){return"if"===t.type?!!t.expression&&oh(ah(t.expression,e)):"ifdef"===t.type?t.identifier.identifier in e:"ifndef"===t.type?!(t.identifier.identifier in e):void 0}(o,n.ifPart)?t.replaceWith(n.ifPart.body):n.elseIfParts.reduce(function(e,n){return e||oh(ah(n.expression,o))&&(t.replaceWith(n.body),!0)},!1)||(n.elsePart?t.replaceWith(n.elsePart.body):t.remove()))}},text:{enter:function(e){var t=e;t.node.text=sh(t.node.text,o)}},define_arguments:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body,s=n.args;o[r]={args:s,body:i},!a(t)&&t.remove()}},define:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body;o[r]={body:i},!a(t)&&t.remove()}},undef:{enter:function(e){var t=e;delete o[t.node.identifier.identifier],!a(t)&&t.remove()}},error:{enter:function(e){var n=e;if(t.stopOnError)throw new Error(n.node.message);!a(n)&&n.remove()}},pragma:{enter:function(e){var t=e;!a(t)&&t.remove()}},version:{enter:function(e){var t=e;!a(t)&&t.remove()}},extension:{enter:function(e){var t=e;!a(t)&&t.remove()}},line:{enter:function(e){var t=e;!a(t)&&t.remove()}}},i=!1,(s=function(e,t,n,o,a){var l;if(!i){var u=r[e.type],c=function(e,t,n,r,i){return{node:e,parent:t,parentPath:n,key:r,index:i,stop:function(){this.stopped=!0},skip:function(){this.skipped=!0},remove:function(){this.removed=!0},replaceWith:function(e){this.replaced=e},findParent:function(e){return n?e(n)?n:n.findParent(e):n}}}(e,t,n,o,a),h=t;if(null==u?void 0:u.enter){if(u.enter(c),c.removed){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));return"number"==typeof a?h[o].splice(a,1):h[o]=null,c}if(c.replaced){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));"number"==typeof a?h[o].splice(a,1,c.replaced):h[o]=c.replaced}if(c.skipped)return c}if(c.stopped)i=!0;else if(c.replaced){var d=c.replaced;s(d,t,n,o,a)}else Object.entries(e).filter(function(e){return e[0],function(e){return function(e){return!!(null==e?void 0:e.type)}(e)||Array.isArray(e)}(e[1])}).forEach(function(t){var n=t[0],r=t[1];if(Array.isArray(r))for(var o=0,a=0;o-a{let e=!0;return n?(i({source:o,formatted:null,error:""}),function(e){return Gs(e,{parser:"glsl-parser",plugins:[Gc],printWidth:80,tabWidth:4,useTabs:!1}).then(Vc)}(o).then(t=>{e&&i({source:o,formatted:t,error:""})}).catch(t=>{if(!e)return;const n=dh(t);a.error("shader formatting failed: "+n),i({source:o,formatted:null,error:n})}),()=>{e=!1}):(i({source:o,formatted:null,error:""}),()=>{e=!1})},[n,o]);const c=n&&r.source===o?r.formatted:null;return{source:c||o,formatted:!!c,preprocessed:u,error:(r.source===o?r.error:"")||l}}(C.source,C.preprocessed,e.beautify),S=D.source,A=C.edited,_=[e.fragment?e.sourceFragmentLog:e.sourceVertexLog,e.programLog].filter(e=>!!e).join("\n"),y=!e.translated&&!D.preprocessed&&!D.formatted,b=function(e,t,n,r){return!(e||t||!n||r)}(t,A,_,y);(0,dt.useLayoutEffect)(()=>{g.current={programId:e.programId,sourceVertex:e.sourceVertex,sourceFragment:e.sourceFragment}},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!d.current)return;if(!f.current){const e=ace.edit(d.current);e.setTheme("ace/theme/monokai"),e.getSession().setMode("ace/mode/glsl"),e.setShowPrintMargin(!1),f.current=e}const t=f.current;t.setReadOnly(!e.editable||e.translated),t.getValue()!==S&&t.setValue(S,-1);const n=()=>{const n=t.getValue();e.fragment?m.current.fragment=n:m.current.vertex=n,v(t=>e.fragment?t.fragment?t:Object.assign(Object.assign({},t),{fragment:!0}):t.vertex?t:Object.assign(Object.assign({},t),{vertex:!0})),function(e,t,n,r){e&&n(!1),t&&r(!1)}(e.beautify,e.preprocessed,c,h),-1!==p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{if(p.current=-1,!function(e,t){return e.programId===t.programId&&e.sourceVertex===t.sourceVertex&&e.sourceFragment===t.sourceFragment}(g.current,e))return;const t={sourceVertex:m.current.vertex,sourceFragment:m.current.fragment,translatedSourceVertex:e.translatedSourceVertex,translatedSourceFragment:e.translatedSourceFragment,programId:e.programId};u(t)},1500)},r=e.editable&&!e.translated;return r&&t.getSession().on("change",n),()=>{r&&t.getSession().off("change",n)}},[S,e.editable,e.translated,e.fragment,e.beautify,e.preprocessed,e.sourceVertex,e.sourceFragment,e.translatedSourceVertex,e.translatedSourceFragment,e.programId,c,h,u]),(0,dt.useEffect)(()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),m.current={baseProgramId:e.programId,baseVertex:e.sourceVertex,baseFragment:e.sourceFragment,vertex:e.sourceVertex,fragment:e.sourceFragment},v({vertex:!1,fragment:!1})},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!f.current)return;const e=t||(y&&!A?_:"");f.current.getSession().setAnnotations(function(e){if(!e)return[];const t=[],n=e.split(/\r?\n/);for(const e of n){const n=e.replace(/\0/g,"").trim();if(!n)continue;let r=/^(error|warning|info)\s*:\s*\d+\s*:\s*(\d+)(?:\s*:\s*(\d+))?\s*:\s*(.*)$/i.exec(n);if(r){t.push(Pt(r[1],r[2],r[3],r[4]));continue}if(r=/^\d+\s*\(\s*(\d+)\s*\)\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[2],r[1],"",r[3]));continue}if(r=/^\d+\s*:\s*(\d+)(?:\s*\(\s*(\d+)\s*\))?\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[3],r[1],r[2],r[4]));continue}const i=/\b(error|warning|info)\b/i.exec(n);t.push({row:0,column:0,text:n,type:i?i[1].toLowerCase():"info"})}return t}(e))},[_,y,t,D.formatted,D.preprocessed,A,e.beautify,e.fragment,e.programLog,e.sourceFragmentLog,e.sourceVertexLog,e.translated]),(0,dt.useEffect)(()=>()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),f.current&&(f.current.destroy(),f.current=null)},[]);const T=(0,dt.useCallback)(e=>{e.preventDefault(),n()},[n]),R=(0,dt.useCallback)(e=>{e.preventDefault(),r()},[r]),x=(0,dt.useCallback)(e=>{e.preventDefault(),null==i||i()},[i]),w=(0,dt.useCallback)(e=>{e.preventDefault(),null==o||o()},[o]),F=(0,dt.useCallback)(e=>{e.preventDefault(),l()},[l]),N=!e.singleShader||!e.fragment,L=!e.singleShader||e.fragment,O=D.error;return(0,mt.jsxs)("div",{className:"sourceCodeComponentContainer",children:[(0,mt.jsx)("div",{className:"sourceCodeMenuComponentContainer",children:(0,mt.jsxs)("ul",{className:"sourceCodeMenuComponent",children:[N&&e.translatedSourceVertex&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:!e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedVertexSourceClicked",onClick:x,children:"Translated Vertex"})}),L&&e.translatedSourceFragment&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedFragmentSourceClicked",onClick:w,children:"Translated Fragment"})}),N&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment||e.translated?"":"active",href:"#",role:"button",commandName:"onVertexSourceClicked",onClick:T,children:"Vertex"})}),L&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&!e.translated?"active":"",href:"#",role:"button",commandName:"onFragmentSourceClicked",onClick:R,children:"Fragment"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onSourceCodeCloseClicked",onClick:F,children:"Close"})})]})}),(0,mt.jsx)("div",{className:"sourceCodeComponent",ref:d}),(0,mt.jsx)(hh,{beautify:e.beautify,capturedDiagnosticsHidden:b,fragment:e.fragment,preprocessed:e.preprocessed,processingError:O,onBeautifyChanged:c,onFragmentSourceClicked:r,onPreprocessChanged:h,onVertexSourceClicked:n})]})}function hh({beautify:e,capturedDiagnosticsHidden:t,fragment:n,preprocessed:r,processingError:i,onBeautifyChanged:s,onFragmentSourceClicked:o,onPreprocessChanged:a,onVertexSourceClicked:l}){const u=(0,dt.useCallback)(e=>{s(e.target.checked)},[s]),c=(0,dt.useCallback)(e=>{a(e.target.checked)},[a]),h=(0,dt.useCallback)(e=>{e.preventDefault(),(n?o:l)(),s(!1),a(!1)},[n,s,o,a,l]);return(0,mt.jsx)("div",{className:"sourceCodeMenuComponentFooter",children:(0,mt.jsxs)("p",{children:[(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onBeautifyChanged",checked:e,onChange:u})," Beautify"]}),(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onPreprocessChanged",checked:r,onChange:c})," Preprocess"]}),i&&(0,mt.jsx)("span",{className:"sourceCodeFormatError",role:"alert",title:i,children:"Shader processing failed"}),t&&(0,mt.jsxs)("span",{className:"sourceCodeDiagnosticsNotice",role:"status",children:["Captured diagnostics hidden."," ",(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onShowCapturedDiagnostics",onClick:h,children:"Show original with diagnostics"})]})]})})}function dh(e){return e instanceof Error?e.message:String(e)}function fh({title:e,children:t}){const n=e?e.replace(/([A-Z])/g," $1").trim():"";return(0,mt.jsxs)("div",{className:"jsonGroupComponent",children:[(0,mt.jsx)("div",{className:"jsonGroupComponentTitle",children:n}),(0,mt.jsx)("ul",{children:t})]})}function ph({itemKey:e,value:t}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsx)("span",{className:"jsonItemComponentValue",children:t})]})}function mh({itemKey:e,value:t,pixelated:n,raw:r}){const i=bt();return(0,mt.jsx)("li",{className:"jsonItemImageHolder",children:(0,mt.jsxs)("div",{className:"jsonItemImage jsonItemImageClickable",children:[(0,mt.jsx)("img",{src:t,style:n?{imageRendering:"pixelated"}:void 0,title:"Open in texture viewer",onClick:()=>i.openTextureViewer({src:t,label:e,pixelated:n,raw:r||null})}),(0,mt.jsx)("span",{children:e})]})})}function gh({itemKey:e,value:t,help:n}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("span",{className:"jsonItemComponentValue",children:[t+" (",(0,mt.jsx)("a",{href:n,target:"_blank",className:"jsonSourceItemComponentOpen",children:"Open help page"}),")"]})]})}function Eh({visualState:e}){const t=bt();return(0,mt.jsxs)("div",{className:"jsonVisualStateItemComponent",children:[e.Attachments?e.Attachments.map((n,r)=>n.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{className:"jsonItemImageClickable",src:encodeURI(n.src),title:"Open in texture viewer",onClick:()=>t.openTextureViewer({src:n.src,label:n.attachmentName||"Attachment",pixelated:!1,raw:n.raw||null})}),e.Attachments.length>1&&(0,mt.jsx)("span",{children:n.attachmentName})]},r):null):(0,mt.jsx)("span",{children:e.FrameBufferStatus}),(0,mt.jsx)("span",{children:e.FrameBuffer?e.FrameBuffer.__SPECTOR_Object_TAG.displayText:"Canvas frame buffer"})]})}function vh({itemKey:e,shader:t,programLog:n,onOpen:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),null==r||r(t,n)},[r,n,t]),s=t.source?t.source.length:0,o=`${t.name||"Shader"} (${s} chars)`;return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("a",{href:"#",role:"button",className:"jsonSourceItemComponentOpen",commandName:"onShaderSourceOpen",onClick:i,children:["Open ",o]})]})}function Ch({items:e,onShaderSourceOpen:t}){return e&&0!==e.length?(0,mt.jsx)(mt.Fragment,{children:e.map((e,n)=>{switch(e.type){case"group":return(0,mt.jsx)(fh,{title:e.title,children:(0,mt.jsx)(Ch,{items:e.children,onShaderSourceOpen:t})},n);case"item":return(0,mt.jsx)(ph,{itemKey:e.key,value:e.value},n);case"image":return(0,mt.jsx)(mh,{itemKey:e.key,value:e.value,pixelated:e.pixelated,raw:e.raw},n);case"help":return(0,mt.jsx)(gh,{itemKey:e.key,value:e.value,help:e.help},n);case"shaderSource":return(0,mt.jsx)(vh,{itemKey:e.key,shader:e.shader,programLog:e.programLog,onOpen:t},n);case"visualState":return(0,mt.jsx)(Eh,{visualState:e.visualState},n);default:return null}})}):null}const Dh={added:"+",removed:"-",changed:"~",unchanged:" "};function Sh(e){const t=void 0===e.indexA?"_":String(e.indexA),n=void 0===e.indexB?"_":String(e.indexB);return e.type+"#"+t+"#"+n}function Ah(e){return!(!e.previousImage&&!e.currentImage)}function _h(){const e=bt(),t=pt(e.store),[n,r]=(0,dt.useState)(null);if((0,dt.useEffect)(()=>{r(null)},[t.compareRows]),!t.canCompare)return(0,mt.jsx)("div",{className:"compareViewComponent",children:(0,mt.jsx)("div",{className:"compareViewEmpty",children:"Capture the same page at least twice, then select a capture to compare it against the previous one."})});const{added:i,removed:s,changed:o,unchanged:a}=t.compareSummary,l=t.compareOnlyDifferences?t.compareRows.filter(e=>"unchanged"!==e.type):t.compareRows,u=l.find(e=>Sh(e)===n)||(l.length>0?l[0]:null),c=u?Sh(u):"";return(0,mt.jsxs)("div",{className:"compareViewComponent",children:[(0,mt.jsxs)("div",{className:"compareViewHeader",children:[(0,mt.jsx)("span",{className:"compareViewLabel",children:t.compareLabel}),(0,mt.jsxs)("span",{className:"compareViewSummary",children:[(0,mt.jsxs)("span",{className:"added",children:["+",i]}),(0,mt.jsxs)("span",{className:"removed",children:["-",s]}),(0,mt.jsxs)("span",{className:"changed",children:["~",o]}),(0,mt.jsxs)("span",{className:"unchanged",children:["=",a]})]}),(0,mt.jsxs)("label",{className:"compareViewToggle",children:[(0,mt.jsx)("input",{type:"checkbox",checked:t.compareOnlyDifferences,onChange:t=>e.handleCompareOnlyDifferencesChange(t.target.checked)}),"Differences only"]})]}),(0,mt.jsxs)("div",{className:"compareViewBody",children:[(0,mt.jsx)(yh,{}),(0,mt.jsx)("ul",{className:"compareViewList",children:0===l.length?(0,mt.jsx)("li",{className:"compareViewEmptyRow",children:"No differences between these two captures."}):l.map(e=>{const t=Sh(e);return(0,mt.jsx)(bh,{row:e,selected:t===c,onSelect:()=>r(t)},t)})}),(0,mt.jsx)("div",{className:"compareViewDetail",children:u?(0,mt.jsx)(Th,{row:u,onSelectCommand:e.handleCompareCommandSelected,onOpenTexture:(t,n)=>e.openTextureViewer({src:t,label:n,pixelated:!1,raw:null})}):(0,mt.jsx)("div",{className:"compareDetailEmpty",children:"Select a call to see its details."})})]})]})}function yh(){return(0,mt.jsxs)("div",{className:"compareViewLegend",children:[(0,mt.jsxs)("div",{className:"compareLegendRow added",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Added"]}),(0,mt.jsxs)("div",{className:"compareLegendRow removed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Removed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow changed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Changed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow unchanged",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Unchanged"]})]})}function bh(e){const{row:t,selected:n,onSelect:r}=e,i="removed"===t.type?t.previousText:t.currentText,s=i&&0===i.indexOf(t.name)?i.slice(t.name.length):"",o="compareRow "+t.type+(n?" selected":"");return(0,mt.jsxs)("li",{className:o,onClick:r,title:i,children:[(0,mt.jsx)("span",{className:"compareSign",children:Dh[t.type]}),(0,mt.jsxs)("span",{className:"compareRowText",children:[(0,mt.jsx)("span",{className:"compareCmdName",children:t.name}),s]})]})}function Th(e){const{row:t,onSelectCommand:n,onOpenTexture:r}=e,i=t.fieldDiffs||[],s=i.filter(e=>!Ah(e)),o=i.filter(Ah),a="changed"===t.type&&t.previousText!==t.currentText,l="removed"===t.type?t.previousText:t.currentText;return(0,mt.jsxs)("div",{className:"compareDetail",children:[(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Command"}),(0,mt.jsxs)("ul",{children:[(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"name"}),":"," ",(0,mt.jsx)("span",{className:"compareCmdName "+t.type,children:t.name})]}),(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"call"}),":"," ",a?(0,mt.jsxs)("span",{className:"compareTextChange",children:[(0,mt.jsx)("span",{className:"compareOld",children:t.previousText}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:t.currentText})]}):(0,mt.jsx)("span",{className:"compareNew",children:l})]}),void 0!==t.commandId&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",className:"compareCommandLink",title:"Show this command in the Commands view",onClick:e=>{e.preventDefault(),n(t.commandId)},children:"Show in Commands view →"})})]})]}),s.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Uniform & state changes"}),(0,mt.jsx)("ul",{children:s.map((e,t)=>(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),":"," ",(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:e.current})]},t))})]}),o.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Texture changes"}),(0,mt.jsx)("ul",{children:o.map((e,t)=>(0,mt.jsxs)("li",{className:"compareTextureItem",children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),(0,mt.jsxs)("div",{className:"compareImageDiff",children:[e.previousImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.previousImage,title:"Open in texture viewer",onClick:()=>r(e.previousImage,e.path+" (previous)")}):(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),e.currentImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.currentImage,title:"Open in texture viewer",onClick:()=>r(e.currentImage,e.path+" (current)")}):(0,mt.jsx)("span",{className:"compareNew",children:e.current})]})]},t))})]})]})}function Rh(e){const t=(255&e).toString(16);return 1===t.length?"0"+t:t}function xh(e,t,n,r){return"#"+Rh(e)+Rh(t)+Rh(n)+Rh(r)}function wh(e,t,n,r){const i=e=>(e/255).toFixed(2);return i(e)+", "+i(t)+", "+i(n)+", "+i(r)}function Fh(){const e=bt(),t=pt(e.store).textureViewer;return t.open?(0,mt.jsx)(Lh,{viewer:t,onClose:e.closeTextureViewer}):null}const Nh=120;function Lh(e){const{viewer:t,onClose:n}=e,r=(0,dt.useRef)(null),i=(0,dt.useRef)(null),s=(0,dt.useRef)(null),o=(0,dt.useRef)(null),[a,l]=(0,dt.useState)({r:!0,g:!0,b:!0,a:!0}),[u,c]=(0,dt.useState)(1),[h,d]=(0,dt.useState)("checker"),[f,p]=(0,dt.useState)(null),[m,g]=(0,dt.useState)(null),[E,v]=(0,dt.useState)(!1);(0,dt.useEffect)(()=>{let e=!1;const n=t=>{e||(o.current=t,p({width:t.width,height:t.height}),c(kh(t.width,t.height)),v(!0))};if(t.raw){const r=function(e){try{if(!e.data||e.width<=0||e.height<=0)return null;const t=function(e){const t=atob(e),n=new Uint8ClampedArray(t.length);for(let e=0;e{e=!0}}const r=new Image;return r.onload=()=>{const e=document.createElement("canvas");e.width=r.naturalWidth||1,e.height=r.naturalHeight||1;const t=e.getContext("2d");if(!t)return;t.drawImage(r,0,0);const i=t.getImageData(0,0,e.width,e.height);n({data:new Uint8ClampedArray(i.data),width:e.width,height:e.height})},r.src=t.src,()=>{e=!0}},[t.src,t.raw]),(0,dt.useEffect)(()=>{const e=o.current,t=r.current;if(!E||!e||!t)return;const n=function(e,t,n){let r=e.current;return r||(r=document.createElement("canvas"),e.current=r),r.width!==t&&(r.width=t),r.height!==n&&(r.height=n),r}(s,e.width,e.height),i=n.getContext("2d"),l=t.getContext("2d");if(!i||!l)return;const c=function(e,t){const n=new Uint8ClampedArray(e.length),r=t.a&&!t.r&&!t.g&&!t.b;for(let i=0;i{const e=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]);const C="textureViewerViewport"+("checker"===h?" checker":""),D="black"===h?{background:"#000"}:"white"===h?{background:"#fff"}:void 0;return(0,mt.jsx)("div",{className:"textureViewerOverlay",onClick:n,children:(0,mt.jsxs)("div",{className:"textureViewerModal",onClick:e=>e.stopPropagation(),children:[(0,mt.jsxs)("div",{className:"textureViewerHeader",children:[(0,mt.jsx)("span",{className:"textureViewerTitle",children:t.label}),(0,mt.jsxs)("span",{className:"textureViewerMeta",children:[f?f.width+" × "+f.height:"",!t.raw&&f?" · thumbnail":""]}),(0,mt.jsx)("span",{className:"textureViewerClose",title:"Close (Esc)",onClick:n,children:"✕"})]}),(0,mt.jsxs)("div",{className:"textureViewerToolbar",children:[(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Channels"}),(0,mt.jsx)(Oh,{channel:"r",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"g",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"b",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"a",mask:a,setMask:l})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"tvBtn",title:"Force alpha = 1 to reveal RGB hidden behind transparency",onClick:()=>l({r:!0,g:!0,b:!0,a:!1}),children:"Opaque"}),(0,mt.jsx)("span",{className:"tvBtn",title:"Show the alpha channel as grayscale",onClick:()=>l({r:!1,g:!1,b:!1,a:!0}),children:"Alpha → gray"})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"BG"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)(Ih,{value:"checker",glyph:"▦",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"black",glyph:"■",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"white",glyph:"□",background:h,setBackground:d})]})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Zoom"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.max(1,e/2)),children:"−"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(f?kh(f.width,f.height):1),children:"Fit"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.min(32,2*e)),children:"+"})]}),(0,mt.jsxs)("span",{className:"zoomVal",children:[Math.round(100*u),"%"]})]}),(0,mt.jsx)("div",{className:"textureViewerGroup textureViewerGroupEnd",children:(0,mt.jsx)("span",{className:"tvBtn primary",onClick:()=>{const e=s.current;e&&e.toBlob(e=>{if(!e)return;const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=((t.label||"texture").replace(/[^a-z0-9_\-]+/gi,"_").replace(/^_+|_+$/g,"")||"texture")+".png",r.click(),setTimeout(()=>URL.revokeObjectURL(n),0)})},children:"⭳ Save PNG"})})]}),(0,mt.jsxs)("div",{className:"textureViewerBody",children:[(0,mt.jsxs)("div",{className:C,style:D,children:[(0,mt.jsx)("canvas",{ref:r,className:"textureViewerCanvas",onMouseMove:e=>{const t=o.current,n=r.current,a=i.current,l=s.current;if(!t||!n)return;const c=n.getBoundingClientRect(),h=Math.floor((e.clientX-c.left)/u),d=Math.floor((e.clientY-c.top)/u);if(h<0||d<0||h>=t.width||d>=t.height)return g(null),void(a&&(a.style.display="none"));const f=4*(d*t.width+h);g({x:h,y:d,r:t.data[f],g:t.data[f+1],b:t.data[f+2],a:t.data[f+3]}),function(e,t,n,r){if(!e||!t)return;const i=e.getContext("2d");if(!i)return;i.imageSmoothingEnabled=!1,i.clearRect(0,0,Nh,Nh),i.drawImage(t,n-7,r-7,15,15,0,0,Nh,Nh),i.strokeStyle="#F0640D",i.lineWidth=2,i.strokeRect(56,56,8,8),e.style.display="block"}(a,l,h,d)},onMouseLeave:()=>{g(null),i.current&&(i.current.style.display="none")}}),(0,mt.jsx)("canvas",{ref:i,className:"textureViewerLoupe",width:Nh,height:Nh})]}),(0,mt.jsxs)("div",{className:"textureViewerRail",children:[(0,mt.jsx)("div",{className:"railTitle",children:"Pixel inspector"}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"position"}),(0,mt.jsx)("span",{className:"v",children:m?m.x+", "+m.y:"—"})]}),(0,mt.jsx)("div",{className:"swatch",children:(0,mt.jsx)("div",{className:"swatchInner",style:m?{background:"rgba("+m.r+","+m.g+","+m.b+","+m.a/255+")"}:void 0})}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"R"}),(0,mt.jsx)("span",{className:"v",children:m?m.r:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"G"}),(0,mt.jsx)("span",{className:"v",children:m?m.g:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"B"}),(0,mt.jsx)("span",{className:"v",children:m?m.b:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"A"}),(0,mt.jsx)("span",{className:"v",children:m?m.a:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"hex"}),(0,mt.jsx)("span",{className:"v",children:m?xh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"norm"}),(0,mt.jsx)("span",{className:"v",children:m?wh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"hint",children:["Move over the texture to sample pixels. Toggle channels to isolate RGB / alpha.",(0,mt.jsx)("b",{children:" Opaque"})," reveals colour hidden behind transparency (#183)."]})]})]})]})})}function Oh(e){const{channel:t,mask:n,setMask:r}=e,i=n[t],s="channel "+t+(i?" on":"");return(0,mt.jsx)("span",{className:s,onClick:()=>r(Object.assign(Object.assign({},n),{[t]:!i})),children:t.toUpperCase()})}function Ih(e){const{value:t,glyph:n,background:r,setBackground:i}=e;return(0,mt.jsx)("span",{className:"tvBtn"+(r===t?" active":""),onClick:()=>i(t),children:n})}function kh(e,t){return Math.max(1,Math.min(16,Math.floor(480/Math.max(e,t))||1))}function Mh(){const e=bt(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"resultViewComponent "+(t.visible?"active":""),children:[(0,mt.jsx)(Tt,{}),(0,mt.jsxs)(Rt,{children:[0===t.menuStatus&&(0,mt.jsx)(wt,{active:!0,captures:t.captures,onCaptureSelected:t=>{e.selectCapture(t),e.handleMenuStatusChange(40)},onSaveRequested:e.handleSaveRequested,onCaptureLoaded:e.handleCaptureLoaded}),40===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(Ft,{children:t.visualStates.map((t,n)=>(0,mt.jsx)(Nt,{item:t,onVisualStateSelected:()=>e.handleVisualStateSelected(n)},n))}),(0,mt.jsx)(Lt,{children:t.commands.map((t,n)=>(0,mt.jsx)(Ot,{command:t,onCommandSelected:()=>e.handleCommandSelected(n),onVertexSelected:()=>e.handleVertexSelected(n),onFragmentSelected:()=>e.handleFragmentSelected(n),onShaderSelected:()=>e.handleShaderSelected(n)},n))}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]}),10===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(kt,{left:!0,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationLeft})})}),(0,mt.jsx)(kt,{left:!1,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationRight})})})]}),20===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.initStateData})}),30===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.endStateData})}),60===t.menuStatus&&(0,mt.jsx)(_h,{}),50===t.menuStatus&&t.sourceCodeState&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(ch,{state:t.sourceCodeState,errorMessage:t.sourceCodeError,onVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!1),onFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!1),onTranslatedVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!0),onTranslatedFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!0),onCloseClicked:e.handleSourceCodeClose,onSourceCodeChanged:e.handleSourceCodeChanged,onBeautifyChanged:e.handleBeautifyChanged,onPreprocessChanged:e.handlePreprocessChanged}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]})]}),(0,mt.jsx)(Fh,{})]})}class Ph{static getMDNLink(e){const t=Ph.WebGL2Functions[e];if(t)return Ph.WebGL2RootUrl+t;const n=Ph.WebGLFunctions[e];if(n)return Ph.WebGLRootUrl+n;const r=Ph.AngleInstancedArraysExtFunctions[e];return r?Ph.AngleInstancedArraysExtRootUrl+r:Ph.WebGLRootUrl+e}}Ph.WebGL2RootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/",Ph.WebGLRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/",Ph.AngleInstancedArraysExtRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/",Ph.WebGL2Functions={beginQuery:"beginQuery",beginTransformFeedback:"beginTransformFeedback",bindBufferBase:"bindBufferBase",bindBufferRange:"bindBufferRange",bindSampler:"bindSampler",bindTransformFeedback:"bindTransformFeedback",bindVertexArray:"bindVertexArray",blitFramebuffer:"blitFramebuffer",clearBufferfv:"clearBuffer",clearBufferiv:"clearBuffer",clearBufferuiv:"clearBuffer",clearBufferfi:"clearBuffer",clientWaitSync:"clientWaitSync",compressedTexImage3D:"compressedTexImage3D",compressedTexSubImage3D:"compressedTexSubImage3D",copyBufferSubData:"copyBufferSubData",copyTexSubImage3D:"copyTexSubImage3D",createQuery:"createQuery",createSampler:"createSampler",createTransformFeedback:"createTransformFeedback",createVertexArray:"createVertexArray",deleteQuery:"deleteQuery",deleteSampler:"deleteSampler",deleteSync:"deleteSync",deleteTransformFeedback:"deleteTransformFeedback",deleteVertexArray:"deleteVertexArray",drawArraysInstanced:"drawArraysInstanced",drawBuffers:"drawBuffers",drawElementsInstanced:"drawElementsInstanced",drawRangeElements:"drawRangeElements",endQuery:"endQuery",endTransformFeedback:"endTransformFeedback",fenceSync:"fenceSync",framebufferTextureLayer:"framebufferTextureLayer",getActiveUniformBlockName:"getActiveUniformBlockName",getActiveUniformBlockParameter:"getActiveUniformBlockParameter",getActiveUniforms:"getActiveUniforms",getBufferSubData:"getBufferSubData",getFragDataLocation:"getFragDataLocation",getIndexedParameter:"getIndexedParameter",getInternalformatParameter:"getInternalformatParameter",getQuery:"getQuery",getQueryParameter:"getQueryParameter",getSamplerParameter:"getSamplerParameter",getSyncParameter:"getSyncParameter",getTransformFeedbackVarying:"getTransformFeedbackVarying",getUniformBlockIndex:"getUniformBlockIndex",getUniformIndices:"getUniformIndices",invalidateFramebuffer:"invalidateFramebuffer",invalidateSubFramebuffer:"invalidateSubFramebuffer",isQuery:"isQuery",isSampler:"isSampler",isSync:"isSync",isTransformFeedback:"isTransformFeedback",isVertexArray:"isVertexArray",pauseTransformFeedback:"pauseTransformFeedback",readBuffer:"readBuffer",renderbufferStorageMultisample:"renderbufferStorageMultisample",resumeTransformFeedback:"resumeTransformFeedback",samplerParameteri:"samplerParameter",samplerParameterf:"samplerParameter",texImage3D:"texImage3D",texStorage2D:"texStorage2D",texStorage3D:"texStorage3D",texSubImage3D:"texSubImage3D",transformFeedbackVaryings:"transformFeedbackVaryings",uniform1ui:"uniform",uniform2ui:"uniform",uniform3ui:"uniform",uniform4ui:"uniform",uniform1fv:"uniform",uniform2fv:"uniform",uniform3fv:"uniform",uniform4fv:"uniform",uniform1iv:"uniform",uniform2iv:"uniform",uniform3iv:"uniform",uniform4iv:"uniform",uniform1uiv:"uniform",uniform2uiv:"uniform",uniform3uiv:"uniform",uniform4uiv:"uniform",uniformBlockBinding:"uniformBlockBinding",uniformMatrix2fv:"uniformMatrix",uniformMatrix3x2fv:"uniformMatrix",uniformMatrix4x2fv:"uniformMatrix",uniformMatrix2x3fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4x3fv:"uniformMatrix",uniformMatrix2x4fv:"uniformMatrix",uniformMatrix3x4fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttribDivisor:"vertexAttribDivisor",vertexAttribI4i:"vertexAttribI",vertexAttribI4ui:"vertexAttribI",vertexAttribI4iv:"vertexAttribI",vertexAttribI4uiv:"vertexAttribI",vertexAttribIPointer:"vertexAttribIPointer",waitSync:"waitSync"},Ph.WebGLFunctions={uniform1f:"uniform",uniform1fv:"uniform",uniform1i:"uniform",uniform1iv:"uniform",uniform2f:"uniform",uniform2fv:"uniform",uniform2i:"uniform",uniform2iv:"uniform",uniform3f:"uniform",uniform3i:"uniform",uniform3iv:"uniform",uniform4f:"uniform",uniform4fv:"uniform",uniform4i:"uniform",uniform4iv:"uniform",uniformMatrix2fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttrib1f:"vertexAttrib",vertexAttrib2f:"vertexAttrib",vertexAttrib3f:"vertexAttrib",vertexAttrib4f:"vertexAttrib",vertexAttrib1fv:"vertexAttrib",vertexAttrib2fv:"vertexAttrib",vertexAttrib3fv:"vertexAttrib",vertexAttrib4fv:"vertexAttrib"},Ph.AngleInstancedArraysExtFunctions={drawArraysInstancedANGLE:"drawArraysInstancedANGLE",drawElementsInstancedANGLE:"drawElementsInstancedANGLE",vertexAttribDivisorANGLE:"vertexAttribDivisorANGLE"};const Bh={activeTexture:[["texture"]],attachShader:[["program","shader"]],beginQuery:[["target","query"]],beginTransformFeedback:[["primitiveMode"]],bindAttribLocation:[["program","index","name"]],bindBuffer:[["target","buffer"]],bindBufferBase:[["target","index","buffer"]],bindBufferRange:[["target","index","buffer","offset","size"]],bindFramebuffer:[["target","framebuffer"]],bindRenderbuffer:[["target","renderbuffer"]],bindSampler:[["unit","sampler"]],bindTexture:[["target","texture"]],bindTransformFeedback:[["target","tf"]],bindVertexArray:[["array"]],blendColor:[["red","green","blue","alpha"]],blendEquation:[["mode"]],blendEquationSeparate:[["modeRGB","modeAlpha"]],blendFunc:[["sfactor","dfactor"]],blendFuncSeparate:[["srcRGB","dstRGB","srcAlpha","dstAlpha"]],blitFramebuffer:[["srcX0","srcY0","srcX1","srcY1","dstX0","dstY0","dstX1","dstY1","mask","filter"]],bufferData:[["target","data","usage"],["target","size","usage"],["target","srcData","usage"],["target","srcData","usage","srcOffset","length"]],bufferSubData:[["target","dstByteOffset","srcData"],["target","offset","data"],["target","dstByteOffset","srcData","srcOffset","length"]],checkFramebufferStatus:[["target"]],clear:[["mask"]],clearBufferfi:[["buffer","drawbuffer","depth","stencil"]],clearBufferfv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferiv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferuiv:[["buffer","drawbuffer","values","srcOffset"]],clearColor:[["red","green","blue","alpha"]],clearDepth:[["depth"]],clearStencil:[["s"]],clientWaitSync:[["sync","flags","timeout"]],colorMask:[["red","green","blue","alpha"]],compileShader:[["shader"]],compressedTexImage2D:[["target","level","internalformat","width","height","border","data"],["target","level","internalformat","width","height","border","imageSize","offset"],["target","level","internalformat","width","height","border","srcData","srcOffset","srcLengthOverride"]],compressedTexImage3D:[["target","level","internalformat","width","height","depth","border","imageSize","offset"],["target","level","internalformat","width","height","depth","border","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage2D:[["target","level","xoffset","yoffset","width","height","format","data"],["target","level","xoffset","yoffset","width","height","format","imageSize","offset"],["target","level","xoffset","yoffset","width","height","format","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","imageSize","offset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","srcData","srcOffset","srcLengthOverride"]],copyBufferSubData:[["readTarget","writeTarget","readOffset","writeOffset","size"]],copyTexImage2D:[["target","level","internalformat","x","y","width","height","border"]],copyTexSubImage2D:[["target","level","xoffset","yoffset","x","y","width","height"]],copyTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","x","y","width","height"]],createBuffer:[[]],createFramebuffer:[[]],createProgram:[[]],createQuery:[[]],createRenderbuffer:[[]],createSampler:[[]],createShader:[["type"]],createTexture:[[]],createTransformFeedback:[[]],createVertexArray:[[]],cullFace:[["mode"]],deleteBuffer:[["buffer"]],deleteFramebuffer:[["framebuffer"]],deleteProgram:[["program"]],deleteQuery:[["query"]],deleteRenderbuffer:[["renderbuffer"]],deleteSampler:[["sampler"]],deleteShader:[["shader"]],deleteSync:[["sync"]],deleteTexture:[["texture"]],deleteTransformFeedback:[["tf"]],deleteVertexArray:[["vertexArray"]],depthFunc:[["func"]],depthMask:[["flag"]],depthRange:[["zNear","zFar"]],detachShader:[["program","shader"]],disable:[["cap"]],disableVertexAttribArray:[["index"]],drawArrays:[["mode","first","count"]],drawArraysInstanced:[["mode","first","count","instanceCount"]],drawBuffers:[["buffers"]],drawElements:[["mode","count","type","offset"]],drawElementsInstanced:[["mode","count","type","offset","instanceCount"]],drawRangeElements:[["mode","start","end","count","type","offset"]],enable:[["cap"]],enableVertexAttribArray:[["index"]],endQuery:[["target"]],endTransformFeedback:[[]],fenceSync:[["condition","flags"]],finish:[[]],flush:[[]],framebufferRenderbuffer:[["target","attachment","renderbuffertarget","renderbuffer"]],framebufferTexture2D:[["target","attachment","textarget","texture","level"]],framebufferTextureLayer:[["target","attachment","texture","level","layer"]],frontFace:[["mode"]],generateMipmap:[["target"]],getActiveAttrib:[["program","index"]],getActiveUniform:[["program","index"]],getActiveUniformBlockName:[["program","uniformBlockIndex"]],getActiveUniformBlockParameter:[["program","uniformBlockIndex","pname"]],getActiveUniforms:[["program","uniformIndices","pname"]],getAttachedShaders:[["program"]],getAttribLocation:[["program","name"]],getBufferParameter:[["target","pname"]],getBufferSubData:[["target","srcByteOffset","dstBuffer","dstOffset","length"]],getContextAttributes:[[]],getError:[[]],getExtension:[["extensionName"],["name"]],getFragDataLocation:[["program","name"]],getFramebufferAttachmentParameter:[["target","attachment","pname"]],getIndexedParameter:[["target","index"]],getInternalformatParameter:[["target","internalformat","pname"]],getParameter:[["pname"]],getProgramInfoLog:[["program"]],getProgramParameter:[["program","pname"]],getQuery:[["target","pname"]],getQueryParameter:[["query","pname"]],getRenderbufferParameter:[["target","pname"]],getSamplerParameter:[["sampler","pname"]],getShaderInfoLog:[["shader"]],getShaderParameter:[["shader","pname"]],getShaderPrecisionFormat:[["shadertype","precisiontype"]],getShaderSource:[["shader"]],getSupportedExtensions:[[]],getSyncParameter:[["sync","pname"]],getTexParameter:[["target","pname"]],getTransformFeedbackVarying:[["program","index"]],getUniform:[["program","location"]],getUniformBlockIndex:[["program","uniformBlockName"]],getUniformIndices:[["program","uniformNames"]],getUniformLocation:[["program","name"]],getVertexAttrib:[["index","pname"]],getVertexAttribOffset:[["index","pname"]],hint:[["target","mode"]],invalidateFramebuffer:[["target","attachments"]],invalidateSubFramebuffer:[["target","attachments","x","y","width","height"]],isBuffer:[["buffer"]],isContextLost:[[]],isEnabled:[["cap"]],isFramebuffer:[["framebuffer"]],isProgram:[["program"]],isQuery:[["query"]],isRenderbuffer:[["renderbuffer"]],isSampler:[["sampler"]],isShader:[["shader"]],isSync:[["sync"]],isTexture:[["texture"]],isTransformFeedback:[["tf"]],isVertexArray:[["vertexArray"]],lineWidth:[["width"]],linkProgram:[["program"]],pauseTransformFeedback:[[]],pixelStorei:[["pname","param"]],polygonOffset:[["factor","units"]],readBuffer:[["src"]],readPixels:[["x","y","width","height","format","type","dstData"],["x","y","width","height","format","type","offset"],["x","y","width","height","format","type","pixels"],["x","y","width","height","format","type","dstData","dstOffset"]],renderbufferStorage:[["target","internalformat","width","height"]],renderbufferStorageMultisample:[["target","samples","internalformat","width","height"]],resumeTransformFeedback:[[]],sampleCoverage:[["value","invert"]],samplerParameterf:[["sampler","pname","param"]],samplerParameteri:[["sampler","pname","param"]],scissor:[["x","y","width","height"]],shaderSource:[["shader","source"]],stencilFunc:[["func","ref","mask"]],stencilFuncSeparate:[["face","func","ref","mask"]],stencilMask:[["mask"]],stencilMaskSeparate:[["face","mask"]],stencilOp:[["fail","zfail","zpass"]],stencilOpSeparate:[["face","fail","zfail","zpass"]],texImage2D:[["target","level","internalformat","format","type","source"],["target","level","internalformat","width","height","border","format","type","pboOffset"],["target","level","internalformat","width","height","border","format","type","pixels"],["target","level","internalformat","width","height","border","format","type","source"],["target","level","internalformat","width","height","border","format","type","srcData","srcOffset"]],texImage3D:[["target","level","internalformat","width","height","depth","border","format","type","pboOffset"],["target","level","internalformat","width","height","depth","border","format","type","source"],["target","level","internalformat","width","height","depth","border","format","type","srcData"],["target","level","internalformat","width","height","depth","border","format","type","srcData","srcOffset"]],texParameterf:[["target","pname","param"]],texParameteri:[["target","pname","param"]],texStorage2D:[["target","levels","internalformat","width","height"]],texStorage3D:[["target","levels","internalformat","width","height","depth"]],texSubImage2D:[["target","level","xoffset","yoffset","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","pboOffset"],["target","level","xoffset","yoffset","width","height","format","type","pixels"],["target","level","xoffset","yoffset","width","height","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","srcData","srcOffset"]],texSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","pboOffset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","source"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","srcData","srcOffset"]],transformFeedbackVaryings:[["program","varyings","bufferMode"]],uniform1f:[["location","x"]],uniform1fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1i:[["location","x"]],uniform1iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1ui:[["location","v0"]],uniform1uiv:[["location","data","srcOffset","srcLength"]],uniform2f:[["location","x","y"]],uniform2fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2i:[["location","x","y"]],uniform2iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2ui:[["location","v0","v1"]],uniform2uiv:[["location","data","srcOffset","srcLength"]],uniform3f:[["location","x","y","z"]],uniform3fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3i:[["location","x","y","z"]],uniform3iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3ui:[["location","v0","v1","v2"]],uniform3uiv:[["location","data","srcOffset","srcLength"]],uniform4f:[["location","x","y","z","w"]],uniform4fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4i:[["location","x","y","z","w"]],uniform4iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4ui:[["location","v0","v1","v2","v3"]],uniform4uiv:[["location","data","srcOffset","srcLength"]],uniformBlockBinding:[["program","uniformBlockIndex","uniformBlockBinding"]],uniformMatrix2fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x3fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x3fv:[["location","transpose","data","srcOffset","srcLength"]],useProgram:[["program"]],validateProgram:[["program"]],vertexAttrib1f:[["index","x"]],vertexAttrib1fv:[["index","values"]],vertexAttrib2f:[["index","x","y"]],vertexAttrib2fv:[["index","values"]],vertexAttrib3f:[["index","x","y","z"]],vertexAttrib3fv:[["index","values"]],vertexAttrib4f:[["index","x","y","z","w"]],vertexAttrib4fv:[["index","values"]],vertexAttribDivisor:[["index","divisor"]],vertexAttribI4i:[["index","x","y","z","w"]],vertexAttribI4iv:[["index","values"]],vertexAttribI4ui:[["index","x","y","z","w"]],vertexAttribI4uiv:[["index","values"]],vertexAttribIPointer:[["index","size","type","stride","offset"]],vertexAttribPointer:[["index","size","type","normalized","stride","offset"]],viewport:[["x","y","width","height"]],waitSync:[["sync","flags","timeout"]]};class Uh{static getNames(e,t){const n=Bh[e];if(!n||0===n.length)return null;for(const e of n)if(e.length===t)return e;let r=null;for(const e of n)e.length>=t&&(null===r||e.lengthi.length&&(i=e);return i}static getName(e,t,n){const r=Uh.getNames(e,n);return r&&t>=0&&t{const e={};for(let t=0;t<64;t++)e["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;return e})();class qh{constructor(e){this.sources=e.sources||[],this.names=e.names||[],this.sourceRoot=e.sourceRoot||"",this.lines=qh.parseMappings(e.mappings||"")}originalPositionFor(e,t){const n={source:null,line:null,column:null,name:null},r=e-1;if(r<0||r>=this.lines.length)return n;const i=this.lines[r];if(!i||0===i.length)return n;const s=this.findSegment(i,t);if(!s)return n;const o=s.sourceIndex>=0&&s.sourceIndex=0&&s.nameIndex>1,o=e[s];o.generatedColumn<=t?(i=o,n=s+1):r=s-1}return i}static parseMappings(e){const t=[];let n=0,r=0,i=0,s=0;const o=e.split(";");for(let e=0;e0){const e=a.split(",");for(let t=0;t=4&&(n+=o[1],r+=o[2],i+=o[3],a.sourceIndex=n,a.originalLine=r,a.originalColumn=i,o.length>=5&&(s+=o[4],a.nameIndex=s)),l.push(a)}}l.sort((e,t)=>e.generatedColumn-t.generatedColumn),t.push(l)}return t}static decodeSegment(e){const t=[];let n=0;for(;n>>=1,t.push(o?-r:r)}return t}}var Qh=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})};class Zh{constructor(e){this.cache=new Map,this.inflight=new Map,this.fetchFn=e||("undefined"!=typeof fetch?fetch.bind(globalThis):void 0)}resolveFrames(e){return Qh(this,void 0,void 0,function*(){return e&&0!==e.length?Promise.all(e.map(e=>this.resolveFrame(e))):e||[]})}resolveFrame(e){return Qh(this,void 0,void 0,function*(){const t=Zh.parseFrame(e);if(!t)return e;let n;try{n=yield this.getConsumer(t.url)}catch(t){return e}if(!n)return e;const r=n.originalPositionFor(t.line,t.column);return r.source&&null!==r.line?Zh.formatFrame(t.functionName,r.name,r.source,r.line,r.column||0):e})}static parseFrame(e){if(!e)return null;let t=e.match(/^(.*?)\s*\((.+):(\d+):(\d+)\)\s*$/);return t?{functionName:t[1].trim(),url:t[2],line:parseInt(t[3],10),column:parseInt(t[4],10)}:(t=e.match(/^\s*(.+):(\d+):(\d+)\s*$/),t?{functionName:"",url:t[1].trim(),line:parseInt(t[2],10),column:parseInt(t[3],10)}:null)}static formatFrame(e,t,n,r,i){const s=t||e,o=n+":"+r+":"+i;return s?s+" ("+o+")":o}getConsumer(e){return Qh(this,void 0,void 0,function*(){if(this.cache.has(e))return this.cache.get(e);const t=this.inflight.get(e);if(t)return t;const n=this.loadConsumer(e).then(t=>(this.cache.set(e,t),this.inflight.delete(e),t)).catch(()=>(this.cache.set(e,null),this.inflight.delete(e),null));return this.inflight.set(e,n),n})}loadConsumer(e){return Qh(this,void 0,void 0,function*(){if(!this.fetchFn)return null;const t=yield this.fetchFn(e);if(!t.ok)return null;const n=yield t.text(),r=Zh.extractSourceMappingURL(n);if(!r)return null;let i;if(0===r.indexOf("data:"))i=Zh.parseDataUri(r);else{const t=Zh.resolveUrl(r,e),n=yield this.fetchFn(t);if(!n.ok)return null;i=yield n.json()}return i&&"string"==typeof i.mappings?new qh(i):null})}static extractSourceMappingURL(e){const t=/\/\/[#@]\s*sourceMappingURL=(\S+)\s*$/gm;let n,r=null;for(;null!==(n=t.exec(e));)r=n[1];return r}static parseDataUri(e){const t=e.indexOf(",");if(-1===t)return null;const n=e.substring(0,t),r=e.substring(t+1);try{const e=/;base64/i.test(n)?Zh.decodeBase64(r):decodeURIComponent(r);return JSON.parse(e)}catch(e){return null}}static decodeBase64(e){if("function"==typeof atob)return atob(e);const t=globalThis.Buffer;if(t)return t.from(e,"base64").toString("utf-8");throw new Error("No base64 decoder available.")}static resolveUrl(e,t){try{return new URL(e,t).href}catch(t){return e}}}function Jh(e){return e&&(e.text||e.name)||""}function ed(e,t){const n=[];if(!e||!t)return n;const r=e.DrawCall,i=t.DrawCall;ad("uniform",r&&r.uniforms,i&&i.uniforms,n),ad("uniformBlock",r&&r.uniformBlocks,i&&i.uniformBlocks,n);const s=sd(e,t);for(const r of s){if(td[r])continue;const i=e[r],s=t[r];(rd(i)||rd(s))&&od(i,s,r,n)}return n}const td={id:!0,name:!0,commandArguments:!0,result:!0,status:!0,marker:!0,text:!0,startTime:!0,commandEndTime:!0,endTime:!0,stackTrace:!0,consumeCommandId:!0,VisualState:!0},nd={__SPECTOR_Object_TAG:!0,__SPECTOR_Object_CustomData:!0,__SPECTOR_Metadata:!0,customData:!0,visual:!0,visualPixels:!0,VisualState:!0,texture:!0,sampler:!0,location:!0,source:!0,translatedSource:!0,analyserName:!0,uniforms:!0,uniformBlocks:!0,length:!0};function rd(e){return null!==e&&"object"==typeof e}function id(e){if(!rd(e))return null;const t=e.__SPECTOR_Object_TAG||("string"==typeof e.typeName&&"id"in e?e:null);return t&&"string"==typeof t.typeName?t.typeName:null}function sd(e,t){const n=[],r={},i=e=>{if(rd(e))for(const t in e)e.hasOwnProperty(t)&&!r[t]&&(r[t]=!0,n.push(t))};return i(e),i(t),n}function od(e,t,n,r,i=0){const s=id(e),o=id(t);if(null!==s||null!==o){const e=null!==s?s:"(absent)",t=null!==o?o:"(absent)";return void(e!==t&&r.push({path:n,previous:e,current:t}))}const a=rd(e),l=rd(t);if(!a&&!l){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}if(a!==l||i>=8){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}for(const s of sd(e,t))nd[s]||od(e?e[s]:void 0,t?t[s]:void 0,n+"."+s,r,i+1)}function ad(e,t,n,r){const i=hd(t),s=hd(n),o=[],a={};for(const e in i)i.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const e in s)s.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const t of o){const n=i.hasOwnProperty(t)?i[t]:void 0,o=s.hasOwnProperty(t)?s[t]:void 0,a=n?dd(n.value):"(absent)",l=o?dd(o.value):"(absent)";a!==l&&r.push({path:e+" "+t,previous:a,current:l}),ld(e+" "+t,n,o,r)}}function ld(e,t,n,r){const i=t&&t.texture,s=n&&n.texture;(rd(i)||rd(s))&&cd(e+" texture",i,s,r);const o=t&&t.textures,a=n&&n.textures,l=Array.isArray(o)?o.length:0,u=Array.isArray(a)?a.length:0,c=Math.max(l,u);for(let t=0;t0?o[t]:void 0,u>0?a[t]:void 0,r)}const ud=["width","height","depth","format","internalFormat","textureType"];function cd(e,t,n,r){(rd(t)||rd(n))&&(function(e,t,n,r){for(const i of ud){const s=t?t[i]:void 0,o=n?n[i]:void 0;if(void 0===s&&void 0===o)continue;const a=dd(s),l=dd(o);a!==l&&r.push({path:e+" "+i,previous:a,current:l})}}(e,t,n,r),function(e,t,n,r){if(rd(t)||rd(n))for(const i of sd(t,n)){const s=t?t[i]:void 0,o=n?n[i]:void 0,a="string"==typeof s,l="string"==typeof o;(a||l)&&s!==o&&r.push({path:e+" ("+i+")",previous:a?"(image)":"(absent)",current:l?"(image)":"(absent)",previousImage:a?s:void 0,currentImage:l?o:void 0})}}(e,t&&t.visual,n&&n.visual,r))}function hd(e){const t={};if(Array.isArray(e))for(const n of e)n&&"string"==typeof n.name&&(t[n.name]=n);return t}function dd(e){if(void 0===e)return"(absent)";if(null===e)return"null";try{return JSON.stringify(e)}catch(t){return String(e)}}function fd(e,t){for(let n=0;n{if(this.store.getSnapshot().currentCapture)switch(e){case 0:this._displayCaptures();break;case 40:this._displayCurrentCapture();break;case 10:this._displayInformation();break;case 20:this._displayInitState();break;case 30:this._displayEndState();break;case 60:this._displayCompare()}else this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))},this.handleSearchTextChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{searchText:e})),this._search(e)},this.handleCompareOnlyDifferencesChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{compareOnlyDifferences:e}))},this.handleCompareCommandSelected=e=>{null!=e&&(this._currentCommandId=e,this._displayCurrentCapture())},this.handleCommandSelected=e=>{this.selectCommand(e)},this.openTextureViewer=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{textureViewer:{open:!0,src:e.src,label:e.label,pixelated:e.pixelated,raw:e.raw||null}}))},this.closeTextureViewer=()=>{this.store.setState(e=>Object.assign(Object.assign({},e),{textureViewer:Object.assign(Object.assign({},e.textureViewer),{open:!1})}))},this.handleVisualStateSelected=e=>{this.selectVisualState(e)},this.handleVertexSelected=e=>{this.selectCommand(e),this._openShader(!1)},this.handleFragmentSelected=e=>{this.selectCommand(e),this._openShader(!0)},this.handleShaderSelected=e=>{var t;const n=null===(t=this.store.getSnapshot().commands[e])||void 0===t?void 0:t.capture.shader;n&&(this.selectCommand(e),this._openCapturedShader(n))},this.handleShaderSourceOpen=(e,t)=>{this._openCapturedShader(e,t)},this.handleSourceCodeChanged=e=>{this.onSourceCodeChanged.trigger(e)},this.handleSourceCodeClose=()=>{this._displayCurrentCapture()},this.handleSourceCodeTabChange=(e,t)=>{this.store.setState(n=>n.sourceCodeState?Object.assign(Object.assign({},n),{sourceCodeState:Object.assign(Object.assign({},n.sourceCodeState),{fragment:e,translated:t})}):n)},this.handleBeautifyChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{beautify:e})}):t)},this.handlePreprocessChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{preprocessed:e})}):t)},this.handleSaveRequested=e=>{this.saveCapture(e)},this.handleCaptureLoaded=e=>{this.addCapture(e)},this.handleClose=()=>{this.hide()},this._rootPlaceHolder=e||document.body,this.onSourceCodeChanged=new l,this.store=new ft(Object.assign({},pd)),this._container=document.createElement("div"),this._container.className="spector-react-result-view",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(yt.Provider,{value:this},(0,dt.createElement)(Mh))),this._rootPlaceHolder.addEventListener("keydown",e=>{if(40!==this.store.getSnapshot().menuStatus)return;const t=e.keyCode;38===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousCommand()):40===t?(e.preventDefault(),e.stopPropagation(),this._selectNextCommand()):33===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousVisualState()):34===t&&(e.preventDefault(),e.stopPropagation(),this._selectNextVisualState())})}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}addCapture(e){return this.store.setState(t=>{const n=t.captures.map(e=>({capture:e.capture,active:!1}));return Object.assign(Object.assign({},t),{captures:[{capture:e,active:!0},...n],currentCapture:e})}),this._currentCommandId=-1,this._displayCurrentCapture(),0}selectCapture(e){this._currentCommandId=-1,this.store.setState(t=>{var n,r;const i=t.captures.map((t,n)=>({capture:t.capture,active:n===e}));return Object.assign(Object.assign({},t),{captures:i,currentCapture:null!==(r=null===(n=i[e])||void 0===n?void 0:n.capture)&&void 0!==r?r:null})}),this._displayCurrentCapture()}selectCommand(e){const t=this.store.getSnapshot();if(e<0||e>=t.commands.length)return;const n=t.commands[e];this._currentCommandId=n.capture.id;const r=n.visualStateIndex,i=this._buildCommandDetail(e,t.commands,t.visualStates);this.store.setState(t=>Object.assign(Object.assign({},t),{commands:t.commands.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentCommandIndex:e,visualStates:t.visualStates.map((e,t)=>e.active!==(t===r)?Object.assign(Object.assign({},e),{active:t===r}):e),currentVisualStateIndex:r,commandDetailData:i}))}selectVisualState(e){const t=this.store.getSnapshot();if(e<0||e>=t.visualStates.length)return;const n=t.visualStates[e].commandIndex;if(n===Number.MIN_VALUE)return void this._displayInitState();if(n===Number.MAX_VALUE)return void this._displayEndState();n>=0&&(this._currentCommandId=t.commands[n].capture.id);const r=n>=0?this._buildCommandDetail(n,t.commands,t.visualStates):t.commandDetailData;this.store.setState(t=>Object.assign(Object.assign({},t),{visualStates:t.visualStates.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentVisualStateIndex:e,commands:n>=0?t.commands.map((e,t)=>e.active!==(t===n)?Object.assign(Object.assign({},e),{active:t===n}):e):t.commands,currentCommandIndex:n>=0?n:t.currentCommandIndex,commandDetailData:r}))}showSourceCodeError(e){this.store.setState(t=>Object.assign(Object.assign({},t),{sourceCodeError:e}))}saveCapture(e){const t=JSON.stringify(e,null,4),n=new Blob([t],{type:"octet/stream"}),r="capture "+new Date(e.startTime).toTimeString().split(" ")[0]+".json",i=document.createElement("a"),s=window.URL.createObjectURL(n);i.setAttribute("href",s),i.setAttribute("download",r),i.click()}_displayCaptures(){this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))}_displayCompare(){const e=this.store.getSnapshot(),t=e.captures.findIndex(e=>e.active),n=t>=0?e.captures[t]:null,r=n?e.captures[t+1]:null;if(!n||!r)return void this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:60,canCompare:!1,compareRows:[],compareSummary:{added:0,removed:0,changed:0,unchanged:0},compareLabel:""}));const i=function(e,t){const n=function(e,t){const n=e.length,r=t.length,i=e.map(Jh),s=t.map(Jh),o=[];for(let e=0;e<=n;e++)o.push(new Array(r+1).fill(0));for(let e=n-1;e>=0;e--)for(let t=r-1;t>=0;t--)o[e][t]=i[e]===s[t]?o[e+1][t+1]+1:Math.max(o[e+1][t],o[e][t+1]);const a=[];let l=[];const u=()=>{for(const e of l)a.push(e);l=[]};let c=0,h=0;for(;c0?a.push({type:"changed",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id,fieldDiffs:n}):a.push({type:"unchanged",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id}),c++,h++}else if(o[c+1][h]>=o[c][h+1])l.push({type:"removed",name:e[c].name,previousText:e[c].text,indexA:c}),c++;else{const n=fd(l,t[h].name);n?a.push({type:"changed",name:t[h].name,previousText:n.previousText,currentText:t[h].text,indexA:n.indexA,indexB:h,commandId:t[h].id,fieldDiffs:ed(e[n.indexA],t[h])}):(u(),a.push({type:"added",name:t[h].name,currentText:t[h].text,indexB:h,commandId:t[h].id})),h++}for(;cObject.assign(Object.assign({},e),{menuStatus:60,canCompare:!0,compareRows:i.rows,compareSummary:i.summary,compareLabel:s}))}static _captureLabel(e){try{return new Date(e.startTime).toTimeString().split(" ")[0]}catch(e){return"capture"}}_displayInformation(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];zh(n,"Canvas",t.canvas,e.searchText),zh(n,"Context",t.context,e.searchText);const r=[];for(const n of t.analyses){const t="Primitives"===n.analyserName?"Vertices count":n.analyserName;zh(r,t,n,e.searchText)}zh(r,"Frame Memory Changes",t.frameMemory,e.searchText),zh(r,"Total Memory (seconds since application start: bytes)",t.memory,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:10,commandCount:t.commands.length,informationLeft:n,informationRight:r}))}_displayInitState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.initState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:20,commandCount:t.commands.length,initStateData:n}))}_displayEndState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.endState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:30,commandCount:t.commands.length,endStateData:n}))}_displayCurrentCapture(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=e.searchText,r=e.captures.map(e=>({capture:e.capture,active:e.capture===t})),i=[];i.push({VisualState:t.initState.VisualState,time:t.startTime,commandIndex:Number.MIN_VALUE,active:!1,previousVisualStateIndex:-1,nextVisualStateIndex:-1});const s=[];let o=0,a=!1,l=-1,u=-1;for(let e=0;e0?c-1:-1,nextCommandIndex:-1,visualStateIndex:o,active:!1};if(c>0&&(s[c-1].nextCommandIndex=c),r.VisualState){const e=i.length,t=i.length-1,n={VisualState:r.VisualState,time:r.endTime,commandIndex:c,active:!1,previousVisualStateIndex:t,nextVisualStateIndex:-1};i[t].nextVisualStateIndex=e,i.push(n),o=e,a=!0}else a||(i[0].commandIndex=c,a=!0);h.visualStateIndex=o,s.push(h),(-1===this._currentCommandId&&0===c||this._currentCommandId===r.id)&&(l=c,u=o)}l>=0&&(s[l].active=!0,this._currentCommandId=s[l].capture.id),u>=0&&(i[u].active=!0);let c=[];l>=0&&(c=this._buildCommandDetail(l,s,i)),this.store.setState(e=>Object.assign(Object.assign({},e),{captures:r,menuStatus:40,commandCount:t.commands.length,commands:s,currentCommandIndex:l,visualStates:i,currentVisualStateIndex:u,sourceCodeState:null,sourceCodeError:"",commandDetailData:c}))}_openShader(e){const t=this.store.getSnapshot();if(t.currentCommandIndex<0||t.currentCommandIndex>=t.commands.length)return;const n=t.commands[t.currentCommandIndex].capture.DrawCall;if(!n||!n.shaders||n.shaders.length<2)return;const r={programId:n.programStatus.program.__SPECTOR_Object_TAG.id,nameVertex:n.shaders[0].name,nameFragment:n.shaders[1].name,sourceVertex:n.shaders[0].source,sourceFragment:n.shaders[1].source,translatedSourceVertex:n.shaders[0].translatedSource,translatedSourceFragment:n.shaders[1].translatedSource,fragment:e,translated:!1,editable:n.programStatus.RECOMPILABLE,beautify:!0,preprocessed:!1,singleShader:!1,sourceVertexLog:n.shaders[0].infoLog||"",sourceFragmentLog:n.shaders[1].infoLog||"",programLog:n.programStatus.infoLog||""},i=this._buildCommandDetail(t.currentCommandIndex,t.commands,t.visualStates);this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:"",commandDetailData:i}))}_openCapturedShader(e,t=""){if(!e||"string"!=typeof e.source)return;const n="FRAGMENT_SHADER"===e.shaderType,r={programId:-1,nameVertex:n?"":e.name,nameFragment:n?e.name:"",sourceVertex:n?"":e.source,sourceFragment:n?e.source:"",translatedSourceVertex:n?"":e.translatedSource||"",translatedSourceFragment:n&&e.translatedSource||"",fragment:n,translated:!1,editable:!1,beautify:!0,preprocessed:!1,singleShader:!0,sourceVertexLog:n?"":e.infoLog||"",sourceFragmentLog:n&&e.infoLog||"",programLog:t};this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:""}))}_buildCommandDetail(e,t,n){if(e<0||e>=t.length)return[];const r=t[e],i=n[r.visualStateIndex],s=this._resolvedStackTraces.get(r.capture.id),o=function(e,t,n){const r=[];t&&r.push({type:"visualState",visualState:t});let i="Unknown";switch(e.status){case 50:i="Deprecated";break;case 10:i="Unused";break;case 20:i="Disabled";break;case 30:i="Redundant";break;case 40:i="Valid"}const s=Ph.getMDNLink(e.name);e.result?zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,result:e.result,status:i},""):"LOG"!==e.name&&zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,status:i},"");for(const t in e)"VisualState"!==t&&"result"!==t&&("commandArguments"===t&&Array.isArray(e.commandArguments)?Kh(r,e.name,e.commandArguments):Xh(r,t,e)||("stackTrace"===t&&Array.isArray(e.stackTrace)?zh(r,"stackTrace",n||e.stackTrace,""):"object"==typeof e[t]&&zh(r,t,e[t],"")));return r}(r.capture,null==i?void 0:i.VisualState,s);return s||this._resolveStackTraceAsync(r.capture),o}_resolveStackTraceAsync(e){const t=e.id;this._resolvedStackTraces.has(t)||this._resolvingStackTraces.has(t)||e.stackTrace&&0!==e.stackTrace.length&&(this._resolvingStackTraces.add(t),this._sourceMapResolver.resolveFrames(e.stackTrace).then(n=>{this._resolvingStackTraces.delete(t),this._resolvedStackTraces.set(t,n);let r=!1;for(let t=0;tObject.assign(Object.assign({},t),{commandDetailData:e}))}}).catch(()=>{this._resolvingStackTraces.delete(t)}))}_selectPreviousCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.previousCommandIndex<0||this.selectCommand(t.previousCommandIndex)}_selectNextCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.nextCommandIndex<0||this.selectCommand(t.nextCommandIndex)}_selectPreviousVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.previousVisualStateIndex<0||this.selectVisualState(t.previousVisualStateIndex)}_selectNextVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.nextVisualStateIndex<0||this.selectVisualState(t.nextVisualStateIndex)}_search(e){switch(this.store.getSnapshot().menuStatus){case 0:case 40:this._displayCurrentCapture();break;case 30:this._displayEndState();break;case 10:this._displayInformation();break;case 20:this._displayInitState()}this.store.setState(e=>Object.assign(Object.assign({},e),{searchText:""}))}}class gd{constructor(e,t={}){this.worker=e,this.captureTimeout=t.captureTimeout||1e4,this.disposed=!1,this.captureTimer=null,this.onCapture=new l,this.onCaptureStarted=new l,this.onError=new l,this.onFps=new l,this.onContextReady=new l,this.messageHandler=this.handleMessage.bind(this),this.worker.addEventListener("message",this.messageHandler)}triggerCapture(e=0,t=0,n=!1,r=!1){if(this.disposed)return;this.clearCaptureTimer();const i={type:"spector:trigger-capture",version:1,canvasIndex:e,commandCount:t,quickCapture:n,fullCapture:r};this.worker.postMessage(i),this.captureTimer=setTimeout(()=>{this.onError.trigger("Capture timed out after "+this.captureTimeout+"ms"),this.captureTimer=null},this.captureTimeout)}dispose(){this.disposed||(this.disposed=!0,this.clearCaptureTimer(),this.worker.removeEventListener("message",this.messageHandler),this.onCapture.clear(),this.onCaptureStarted.clear(),this.onError.clear(),this.onFps.clear(),this.onContextReady.clear())}handleMessage(e){const t=e.data;if(!function(e){return null!=e&&"object"==typeof e&&"string"==typeof e.type&&0===e.type.indexOf("spector:")}(t))return;const n=t;switch(n.type){case"spector:context-ready":this.onContextReady.trigger({canvasCount:n.canvasCount,canvasWidth:n.canvasWidth,canvasHeight:n.canvasHeight});break;case"spector:capture-started":this.onCaptureStarted.trigger(void 0);break;case"spector:capture-complete":this.clearCaptureTimer(),this.onCapture.trigger(n.capture);break;case"spector:error":this.clearCaptureTimer(),this.onError.trigger(n.error);break;case"spector:fps":this.onFps.trigger(n.fps)}}clearCaptureTimer(){null!=this.captureTimer&&(clearTimeout(this.captureTimer),this.captureTimer=null)}}var Ed=n(72),vd=n.n(Ed),Cd=n(825),Dd=n.n(Cd),Sd=n(659),Ad=n.n(Sd),_d=n(56),yd=n.n(_d),bd=n(540),Td=n.n(bd),Rd=n(113),xd=n.n(Rd),wd=n(377),Fd={};Fd.styleTagTransform=xd(),Fd.setAttributes=yd(),Fd.insert=Ad().bind(null,"html"),Fd.domAPI=Dd(),Fd.insertStyleElement=Td(),vd()(wd.A,Fd),wd.A&&wd.A.locals&&wd.A.locals;var Nd=n(160),Ld={};Ld.styleTagTransform=xd(),Ld.setAttributes=yd(),Ld.insert=Ad().bind(null,"html"),Ld.domAPI=Dd(),Ld.insertStyleElement=Td(),vd()(Nd.A,Ld),Nd.A&&Nd.A.locals&&Nd.A.locals;class Od{constructor(e){this.timeSpy=e,this.init()}spyXRSession(e){this.currentXRSession&&this.unspyXRSession();for(const e of at.getRequestAnimationFrameFunctionNames())y.resetOriginFunction(this.timeSpy.getSpiedScope(),e);this.timeSpy.spyRequestAnimationFrame("requestAnimationFrame",e),this.currentXRSession=e}unspyXRSession(){if(this.currentXRSession){y.resetOriginFunction(this.currentXRSession,"requestAnimationFrame"),this.currentXRSession=void 0;for(const e of at.getRequestAnimationFrameFunctionNames())this.timeSpy.spyRequestAnimationFrame(e,this.timeSpy.getSpiedScope())}}init(){if(!navigator.xr)return;class e extends XRWebGLLayer{constructor(e,t,n){super(e,t,n),this.glContext=t}getContext(){return this.glContext}}class t extends XRWebGLBinding{constructor(e,t){super(e,t),this.glContext=t}createProjectionLayer(e){const t=super.createProjectionLayer(e);return t.glContext=this.glContext,t}}window.XRWebGLLayer=e,window.XRWebGLBinding=t;const n=navigator.xr.requestSession;Object.defineProperty(navigator.xr,"requestSessionInternal",{writable:!0}),navigator.xr.requestSessionInternal=n,Object.defineProperty(navigator.xr,"requestSession",{writable:!0}),navigator.xr.requestSession=(e,t)=>((e,t)=>navigator.xr.requestSessionInternal(e,t).then(e=>{const t=e;return t._updateRenderState=e.updateRenderState,t.updateRenderState=e=>function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){if(e.baseLayer){const n=e.baseLayer;t.glContext=n.getContext()}if(e.layers)for(const n of e.layers){const e=n;e.glContext&&(t.glContext=e.glContext)}return t._updateRenderState(e)}),this.spyXRSession(t),e.addEventListener("end",()=>{this.unspyXRSession()}),Promise.resolve(e)}))(e,t)}}const Id={CaptureMenu:_t,ResultView:md};class kd{static getFirstAvailable3dContext(e){return this.tryGetContextFromHelperField(e)||this.tryGetContextFromCanvas(e,"webgl")||this.tryGetContextFromCanvas(e,"experimental-webgl")||this.tryGetContextFromCanvas(e,"webgl2")||this.tryGetContextFromCanvas(e,"experimental-webgl2")}static tryGetContextFromHelperField(e){const t=e instanceof HTMLCanvasElement?e.getAttribute("__spector_context_type"):e.__spector_context_type;if(t)return this.tryGetContextFromCanvas(e,t)}static tryGetContextFromCanvas(e,t){let n;try{n=e.getContext(t)}catch(e){}return n}constructor(e={}){this.noFrameTimeout=-1,this.options=Object.assign({enableXRCapture:!1},e),this.captureNextFrames=0,this.captureNextCommands=0,this.quickCapture=!1,this.fullCapture=!1,this.retry=0,this.contexts=[],this.workerBridges=new Map,this.timeSpy=new at,this.onCaptureStarted=new l,this.onCapture=new l,this.onError=new l,this.timeSpy.onFrameStart.add(this.onFrameStart,this),this.timeSpy.onFrameEnd.add(this.onFrameEnd,this),this.timeSpy.onError.add(this.onErrorInternal,this),ct.install(),this.options.enableXRCapture&&(this.xrSpy=new Od(this.timeSpy))}displayUI(e=!1){this.captureMenu||(this.getCaptureUI(),this.captureMenu.onPauseRequested.add(this.pause,this),this.captureMenu.onPlayRequested.add(this.play,this),this.captureMenu.onPlayNextFrameRequested.add(this.playNextFrame,this),this.captureMenu.onCaptureRequested.add(e=>{e&&(e.ref instanceof Worker?this.captureWorker(e.ref):this.captureCanvas(e.ref))},this),setInterval(()=>{this.captureMenu.setFPS(this.getFps())},1e3),e||this.captureMenu.trackPageCanvases(),this.captureMenu.display()),this.resultView||(this.getResultUI(),this.onCapture.add(e=>{this.resultView.display(),this.resultView.addCapture(e)}))}getResultUI(){return this.resultView||(this.resultView=new md,this.resultView.onSourceCodeChanged.add(e=>{this.rebuildProgramFromProgramId(e.programId,e.sourceVertex,e.sourceFragment,t=>{this.referenceNewProgram(e.programId,t),this.resultView.showSourceCodeError(null)},e=>{this.resultView.showSourceCodeError(e)})})),this.resultView}getCaptureUI(){return this.captureMenu||(this.captureMenu=new _t),this.captureMenu}rebuildProgramFromProgramId(e,t,n,r,i){const s=Pe.getFromGlobalStore(e);this.rebuildProgram(s,t,n,r,i)}rebuildProgram(e,t,n,r,i){o.rebuildProgram(e,t,n,r,i)}referenceNewProgram(e,t){Pe.updateInGlobalStore(e,t)}pause(){this.timeSpy.changeSpeedRatio(0)}play(){this.timeSpy.changeSpeedRatio(1)}playNextFrame(){this.timeSpy.playNextFrame()}drawOnlyEveryXFrame(e){this.timeSpy.changeSpeedRatio(e)}getFps(){return this.timeSpy.getFps()}spyCanvases(){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt,this.canvasSpy.onContextRequested.add(this.spyContext,this))}spyCanvas(e){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt(e),this.canvasSpy.onContextRequested.add(this.spyContext,this))}getAvailableContexts(){return this.contexts}setShaderCompileDelay(e){ct.install(),ct.setDelay(e)}clearShaderCompileDelay(){ct.setDelay(0)}getShaderCompileDelay(){return ct.getDelay()}captureCanvas(e,t=0,n=!1,r=!1){const i=this.getAvailableContextSpyByCanvas(e);if(i)this.captureContextSpy(i,t,n,r);else{const i=kd.getFirstAvailable3dContext(e);i?this.captureContext(i,t,n,r):a.error("No webgl context available on the chosen canvas.")}}captureContext(e,t=0,n=!1,r=!1){let i=this.getAvailableContextSpyByCanvas(e.canvas);i||(i=e.getIndexedParameter?new ot({context:e,version:2,recordAlways:!1}):new ot({context:e,version:1,recordAlways:!1}),i.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:i.context.canvas,contextSpy:i})),i&&this.captureContextSpy(i,t,n,r)}captureXRContext(e=0,t=!1,n=!1){this.captureContext(this.getXRContext(),e,t,n)}captureContextSpy(e,t=0,n=!1,r=!1){this.quickCapture=n,this.fullCapture=r,this.capturingContext?this.onErrorInternal("Already capturing a context."):(this.retry=0,this.capturingContext=e,this.capturingContext.setMarker(this.marker),(t=Math.min(t,1e4))>0?this.captureCommands(t):this.captureFrames(1),this.noFrameTimeout=setTimeout(()=>{t>0?this.stopCapture():this.capturingContext&&this.retry>1?this.onErrorInternal("No frames with gl commands detected. Try moving the camera."):this.onErrorInternal("No frames detected. Try moving the camera or implementing requestAnimationFrame.")},1e4))}captureNextFrame(e,t=!1,n=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,0,t,n):this.captureContext(e,0,t,n)}startCapture(e,t,n=!1,r=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,t,n,r):this.captureContext(e,t,n,r)}stopCapture(){if(this.capturingContext){const e=this.capturingContext.stopCapture();if(e.commands.length>0)return this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),this.triggerCapture(e),this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,e;0===this.captureNextCommands&&(this.retry++,this.captureFrames(1))}}setMarker(e){this.marker=e,this.capturingContext&&this.capturingContext.setMarker(e)}clearMarker(){this.marker=null,this.capturingContext&&this.capturingContext.clearMarker()}addRequestAnimationFrameFunctionName(e){this.timeSpy.addRequestAnimationFrameFunctionName(e)}setSpiedScope(e){this.timeSpy.setSpiedScope(e)}log(e){this.capturingContext&&this.capturingContext.log(e)}spyWorkers(e="spector.worker.bundle.js"){ut.startIntercepting(e)}stopSpyingWorkers(){ut.stopIntercepting()}spyWorker(e){let t=this.workerBridges.get(e);return t||(t=new gd(e),t.onCapture.add(e=>{this.triggerCapture(e)},this),t.onError.add(e=>{this.onErrorInternal(e)},this),t.onContextReady.add(t=>{if(this.captureMenu){const n=this.workerBridges.size;this.captureMenu.addCanvasInformation({id:"Worker "+n,width:t.canvasWidth,height:t.canvasHeight,ref:e})}},this),t.onFps.add(e=>{this.captureMenu&&this.captureMenu.setFPS(e)},this),this.workerBridges.set(e,t),t)}captureWorker(e,t=0,n=!1,r=!1){this.workerBridges.has(e)||this.spyWorker(e);const i=this;e.addEventListener("message",function t(n){n.data&&"spector:capture-complete"===n.data.type&&(e.removeEventListener("message",t),i.triggerCapture(n.data.capture))}),e.postMessage({type:"spector:trigger-capture",version:1,canvasIndex:0,commandCount:t,quickCapture:n,fullCapture:r})}captureFrames(e){this.captureNextFrames=e,this.captureNextCommands=0,this.playNextFrame()}captureCommands(e){this.captureNextFrames=0,this.captureNextCommands=e,this.play(),this.capturingContext?(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(e,this.quickCapture,this.fullCapture)):(this.onErrorInternal("No context to capture from."),this.captureNextCommands=0)}spyContext(e){let t=this.getAvailableContextSpyByCanvas(e.context.canvas);t||(t=new ot({context:e.context,version:e.contextVersion,recordAlways:!0}),t.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:t.context.canvas,contextSpy:t})),t.spy()}getAvailableContextSpyByCanvas(e){for(const t of this.contexts)if(t.canvas===e)return t.contextSpy}getXRContext(){return this.options.enableXRCapture||a.error("Cannot retrieve WebXR context if capturing WebXR is disabled."),this.xrSpy.currentXRSession||a.error("No currently active WebXR session."),this.xrSpy.currentXRSession.glContext}onFrameStart(){this.captureNextCommands>0||(this.captureNextFrames>0?(this.capturingContext&&(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(0,this.quickCapture,this.fullCapture)),this.captureNextFrames--):this.capturingContext=void 0)}onFrameEnd(){this.captureNextCommands>0||0===this.captureNextFrames&&this.stopCapture()}triggerCapture(e){this.captureMenu&&this.captureMenu.captureComplete(null),this.onCapture.trigger(e)}onErrorInternal(e){if(a.error(e),this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),!this.capturingContext)throw e;this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,this.retry=0,this.captureMenu&&this.captureMenu.captureComplete(e),this.onError.trigger(e)}}},180(e,t,n){e=n.nmd(e),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/lang"),s=e("../lib/event"),o='.ace_search {background-color: #ddd;color: #666;border: 1px solid #cbcbcb;border-top: 0 none;overflow: hidden;margin: 0;padding: 4px 6px 0 4px;position: absolute;top: 0;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {margin: 0 20px 4px 0;overflow: hidden;line-height: 1.9;}.ace_replace_form {margin-right: 0;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {border-radius: 3px 0 0 3px;background-color: white;color: black;border: 1px solid #cbcbcb;border-right: 0 none;outline: 0;padding: 0;font-size: inherit;margin: 0;line-height: inherit;padding: 0 6px;min-width: 17em;vertical-align: top;min-height: 1.8em;box-sizing: content-box;}.ace_searchbtn {border: 1px solid #cbcbcb;line-height: inherit;display: inline-block;padding: 0 6px;background: #fff;border-right: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;margin: 0;position: relative;color: #666;}.ace_searchbtn:last-child {border-radius: 0 3px 3px 0;border-right: 1px solid #cbcbcb;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn:hover {background-color: #eef1f6;}.ace_searchbtn.prev, .ace_searchbtn.next {padding: 0px 0.7em}.ace_searchbtn.prev:after, .ace_searchbtn.next:after {content: "";border: solid 2px #888;width: 0.5em;height: 0.5em;border-width: 2px 0 0 2px;display:inline-block;transform: rotate(-45deg);}.ace_searchbtn.next:after {border-width: 0 2px 2px 0 ;}.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;font: 16px/16px Arial;padding: 0;height: 14px;width: 14px;top: 9px;right: 7px;position: absolute;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;box-sizing: border-box!important;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;clear: both;}.ace_search_counter {float: left;font-family: arial;padding: 0 8px;}',a=e("../keyboard/hash_handler").HashHandler,l=e("../lib/keys");r.importCssString(o,"ace_searchbox");var u=function(e,t,n){var i=r.createElement("div");r.buildDom(["div",{class:"ace_search right"},["span",{action:"hide",class:"ace_searchbtn_close"}],["div",{class:"ace_search_form"},["input",{class:"ace_search_field",placeholder:"Search for",spellcheck:"false"}],["span",{action:"findPrev",class:"ace_searchbtn prev"},"​"],["span",{action:"findNext",class:"ace_searchbtn next"},"​"],["span",{action:"findAll",class:"ace_searchbtn",title:"Alt-Enter"},"All"]],["div",{class:"ace_replace_form"},["input",{class:"ace_search_field",placeholder:"Replace with",spellcheck:"false"}],["span",{action:"replaceAndFindNext",class:"ace_searchbtn"},"Replace"],["span",{action:"replaceAll",class:"ace_searchbtn"},"All"]],["div",{class:"ace_search_options"},["span",{action:"toggleReplace",class:"ace_button",title:"Toggle Replace mode",style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{class:"ace_search_counter"}],["span",{action:"toggleRegexpMode",class:"ace_button",title:"RegExp Search"},".*"],["span",{action:"toggleCaseSensitive",class:"ace_button",title:"CaseSensitive Search"},"Aa"],["span",{action:"toggleWholeWords",class:"ace_button",title:"Whole Word Search"},"\\b"],["span",{action:"searchInSelection",class:"ace_button",title:"Search In Selection"},"S"]]],i),this.element=i.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),r.importCssString(o,"ace_searchbox",e.container)};(function(){this.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},this.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;s.addListener(e,"mousedown",function(e){setTimeout(function(){t.activeInput.focus()},0),s.stopPropagation(e)}),s.addListener(e,"click",function(e){var n=(e.target||e.srcElement).getAttribute("action");n&&t[n]?t[n]():t.$searchBarKb.commands[n]&&t.$searchBarKb.commands[n].exec(t),s.stopPropagation(e)}),s.addCommandKeyListener(e,function(e,n,r){var i=l.keyCodeToString(r),o=t.$searchBarKb.findKeyCommand(n,i);o&&o.exec&&(o.exec(t),s.stopEvent(e))}),this.$onChange=i.delayedCall(function(){t.find(!1,!1)}),s.addListener(this.searchInput,"input",function(){t.$onChange.schedule(20)}),s.addListener(this.searchInput,"focus",function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()}),s.addListener(this.replaceInput,"focus",function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()})},this.$closeSearchBarKb=new a([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new a,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.editor.getReadOnly()||(e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus())},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),this.setSearchRange=function(e){this.searchRange=e,e?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(e){r.setCssClass(this.replaceOption,"checked",this.searchRange),r.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var t=this.editor.getReadOnly();this.replaceOption.style.display=t?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!t?"":"none",this.find(!1,!1,e)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,n){var i=!this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n,range:this.searchRange})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",i),this.editor._emit("findSearchBox",{match:!i}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,n=0,r=0;if(t){var i=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),s=e.session.doc.positionToIndex(e.selection.anchor);this.searchRange&&(s-=e.session.doc.positionToIndex(this.searchRange.start));for(var o,a=t.lastIndex=0;(o=t.exec(i))&&(n++,(a=o.index)<=s&&r++,!(n>999))&&(o[0]||(t.lastIndex=a+=1,!(a>=i.length))););}this.searchCounter.textContent=r+" of "+(n>999?"999+":n)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(u.prototype),t.SearchBox=u,t.Search=function(e,t){(e.searchBox||new u(e)).show(e.session.getTextRange(),t)}}),ace.require(["ace/ext/searchbox"],function(t){e&&(e.exports=t)})},49(e,t,n){e=n.nmd(e),ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=t.cFunctions="\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b",a=function(){var e=this.$keywords=this.createKeywordMapper({"keyword.control":"break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while|catch|operator|try|throw|using","storage.type":"asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|class|wchar_t|template|char16_t|char32_t","storage.modifier":"const|extern|register|restrict|static|volatile|inline|private|protected|public|friend|explicit|virtual|export|mutable|typename|constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local","keyword.operator":"and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace","variable.language":"this","constant.language":"NULL|true|false|TRUE|FALSE|nullptr"},"identifier"),t=/\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source,n="%"+/(\d+\$)?/.source+/[#0\- +']*/.source+/[,;:_]?/.source+/((-?\d+)|\*(-?\d+\$)?)?/.source+/(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source+/(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source+/(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source;this.$rules={start:[{token:"comment",regex:"//$",next:"start"},{token:"comment",regex:"//",next:"singleLineComment"},i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string",regex:"'(?:"+t+"|.)?'"},{token:"string.start",regex:'"',stateName:"qqstring",next:[{token:"string",regex:/\\\s*$/,next:"qqstring"},{token:"constant.language.escape",regex:t},{token:"constant.language.escape",regex:n},{token:"string.end",regex:'"|$',next:"start"},{defaultToken:"string"}]},{token:"string.start",regex:'R"\\(',stateName:"rawString",next:[{token:"string.end",regex:'\\)"',next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"keyword",regex:"#\\s*(?:include|import|pragma|line|define|undef|version)\\b",next:"directive"},{token:"keyword",regex:"#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b"},{token:"support.function.C99.c",regex:o},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*"},{token:"keyword.operator",regex:/--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],singleLineComment:[{token:"comment",regex:/\\$/,next:"singleLineComment"},{token:"comment",regex:/$/,next:"start"},{defaultToken:"comment"}],directive:[{token:"constant.other.multiline",regex:/\\/},{token:"constant.other.multiline",regex:/.*\\/},{token:"constant.other",regex:"\\s*<.+?>",next:"start"},{token:"constant.other",regex:'\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',next:"start"},{token:"constant.other",regex:"\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",next:"start"},{token:"constant.other",regex:/[^\\\/]+/,next:"start"}]},this.embedRules(i,"doc-",[i.getEndRule("start")]),this.normalizeRules()};r.inherits(a,s),t.c_cppHighlightRules=a}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var i=n[1].length,s=e.findMatchingBracket({row:t,column:i});if(!s||s.row==t)return 0;var o=this.$getIndent(e.getLine(s.row));e.replace(new r(t,0,t,i-1),o)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i,s=e.getLine(n);if(this.startRegionRe.test(s))return this.getCommentRegionBlock(e,s,n);if(i=s.match(this.foldingStartMarker)){var o=i.index;if(i[1])return this.openingBracketBlock(e,i[1],n,o);var a=e.getCommentFoldRange(n,o+i[0].length,1);return a&&!a.isMultiLine()&&(r?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(i=s.match(this.foldingStopMarker))?(o=i.index+i[0].length,i[1]?this.closingBracketBlock(e,i[1],n,o):e.getCommentFoldRange(n,o,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length,a=t+=1,l=e.getLength();++tu)break;var c=this.getFoldWidgetRange(e,"all",t);if(c){if(c.start.row<=s)break;if(c.isMultiLine())t=c.end.row;else if(r==u)break}a=t}}return new i(s,o,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\s*$/),s=e.getLength(),o=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++no)return new i(o,r,n,t.length)}}.call(o.prototype)}),ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./c_cpp_highlight_rules").c_cppHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&"comment"==s[s.length-1].type)return r;if("start"==e)(a=t.match(/^.*[\{\(\[]\s*$/))&&(r+=n);else if("doc-start"==e){if("start"==o)return"";var a;(a=t.match(/^\s*(\/?)\*/))&&(a[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/c_cpp"}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/glsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/c_cpp_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp_highlight_rules").c_cppHighlightRules,s=function(){var e=this.createKeywordMapper({"variable.language":"this",keyword:"layout|attribute|const|uniform|varying|break|continue|do|for|while|if|else|in|out|inout|float|int|void|bool|true|false|lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|samplerCube|struct","constant.language":"radians|degrees|sin|cos|tan|asin|acos|atan|pow|exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|normalize|faceforward|reflect|refract|matrixCompMult|lessThan|lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|texture2DProjLod|textureCube|textureCubeLod|gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|gl_DepthRangeParameters|gl_DepthRange|gl_Position|gl_PointSize|gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData"},"identifier");this.$rules=(new i).$rules,this.$rules.start.forEach(function(t){"function"==typeof t.token&&(t.token=e)})};r.inherits(s,i),t.glslHighlightRules=s}),ace.define("ace/mode/glsl",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/glsl_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp").Mode,s=e("./glsl_highlight_rules").glslHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.$id="ace/mode/glsl"}.call(u.prototype),t.Mode=u}),ace.require(["ace/mode/glsl"],function(t){e&&(e.exports=t)})},429(e,t,n){e=n.nmd(e),ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.require(["ace/theme/monokai"],function(t){e&&(e.exports=t)})}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r](s,s.exports,n),s.loaded=!0,s.exports}return n.amdD=function(){throw new Error("define cannot be used indirect")},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.nc=void 0,n(832),n(49),n(429),n(902),n(180),n(878)})()); \ No newline at end of file diff --git a/readme.md b/readme.md index 8f1fc76..f649949 100644 --- a/readme.md +++ b/readme.md @@ -251,18 +251,22 @@ See [`sample/worker.html`](sample/worker.html) for a working example. ### Auto-injection (best-effort) -`spyWorkers()` monkey-patches the global `Worker` constructor to automatically inject the Spector bundle into every new Worker: +**Browser extension:** Worker auto-injection is **OFF by default**, including for existing users (#394, #395). In the popup, **Auto-inject Workers (experimental)** explicitly enables best-effort instrumentation of Workers, including OffscreenCanvas Workers. Changing the checkbox reloads the tab. Like **Show offscreen canvas(es)**, the choice is stored in page `sessionStorage`, scoped to the tab and origin (and applied to currently loaded frames), not globally to all sites. It survives reloads; an absent setting defaults off. + +With the option off, the extension leaves `window.Worker` exactly as it was: no constructor wrapper, options inspection, URL coercion, or preflight fetch. Main-thread canvas capture still works. Disabling the checkbox and reloading stops installing interception; it does not undo instrumentation in an already-running Worker. + +**Programmatic API:** `spyWorkers()` remains a separate, explicit opt-in. It monkey-patches the global `Worker` constructor to attempt automatic injection into subsequent classic Workers: ```javascript var spector = new SPECTOR.Spector(); spector.spyWorkers('spector.worker.bundle.js'); -// All subsequent new Worker() calls get Spector injected automatically +// Subsequent classic Workers are candidates for best-effort injection // Stop intercepting: // spector.stopSpyingWorkers(); ``` -> **⚠️ Limitations:** Auto-injection may fail with cross-origin Workers, strict CSP policies, or ES module Workers. Use the [manual API](#worker-offscreencanvas-manual-api--recommended) as a reliable fallback. +> **⚠️ Experimental — can alter Worker behavior:** Blob wrapping changes the Worker's `self.location` and can affect credentials or CSP/CORS-dependent code. For same-origin module Worker entry points, the extension initializes Spector in a loader and imports the application module from its original URL, preserving relative imports and `import.meta.url`; startup messages are queued until the module is ready. Module sources with direct nested Worker construction are bypassed because their URL resolution may still depend on `self.location`. Conservative source checks cannot inspect every dependency or establish safety and are **not a compatibility guarantee**. Constructor interception itself can change JavaScript semantics. Leave auto-injection off for native behavior; prefer the [manual API](#worker-offscreencanvas-manual-api--recommended) when you control the Worker source. For module Workers, load the worker bundle using `import` instead of `importScripts`. ### API Reference @@ -270,7 +274,7 @@ spector.spyWorkers('spector.worker.bundle.js'); |--------|-------------| | `spyWorker(worker)` | Bridge a specific Worker for capture. Returns a `WorkerBridge`. | | `captureWorker(worker, commandCount?, quickCapture?, fullCapture?)` | Trigger a capture on a bridged Worker. Auto-bridges if needed. | -| `spyWorkers(bundleUrl?)` | Intercept all `new Worker()` calls to auto-inject Spector. | +| `spyWorkers(bundleUrl?)` | Explicitly opt in to experimental, best-effort Worker auto-injection. | | `stopSpyingWorkers()` | Stop intercepting Worker construction. | ## MCP Server diff --git a/sample/js/workerAutoInject/dynamicImport.js b/sample/js/workerAutoInject/dynamicImport.js new file mode 100644 index 0000000..8a9e02f --- /dev/null +++ b/sample/js/workerAutoInject/dynamicImport.js @@ -0,0 +1,11 @@ +self.onmessage = async function () { + try { + var dependency = await import("./workerAutoInjectDependency.js"); + self.postMessage({ + value: dependency.value, + workerLocation: self.location.href, + }); + } catch (error) { + self.postMessage({ error: String(error) }); + } +}; diff --git a/sample/js/workerAutoInject/moduleParent.js b/sample/js/workerAutoInject/moduleParent.js new file mode 100644 index 0000000..cb9f9e4 --- /dev/null +++ b/sample/js/workerAutoInject/moduleParent.js @@ -0,0 +1,9 @@ +var child = new Worker(new URL("./nestedModule.js", import.meta.url), { type: "module" }); + +child.onmessage = function (event) { + self.postMessage(event.data); +}; + +child.onerror = function (event) { + self.postMessage({ error: event.message }); +}; diff --git a/sample/js/workerAutoInject/nestedClassic.js b/sample/js/workerAutoInject/nestedClassic.js new file mode 100644 index 0000000..e2ae217 --- /dev/null +++ b/sample/js/workerAutoInject/nestedClassic.js @@ -0,0 +1,18 @@ +self.onmessage = function () { + try { + var childUrl = new URL("./nestedModule.js", self.location.href); + var child = new Worker(childUrl, { type: "module" }); + + child.onmessage = function (event) { + self.postMessage({ + value: event.data, + workerLocation: self.location.href, + }); + }; + child.onerror = function (event) { + self.postMessage({ error: event.message }); + }; + } catch (error) { + self.postMessage({ error: String(error) }); + } +}; diff --git a/sample/js/workerAutoInject/nestedModule.js b/sample/js/workerAutoInject/nestedModule.js new file mode 100644 index 0000000..926165f --- /dev/null +++ b/sample/js/workerAutoInject/nestedModule.js @@ -0,0 +1 @@ +self.postMessage("nested-module-ok"); diff --git a/sample/js/workerAutoInject/safeClassic.js b/sample/js/workerAutoInject/safeClassic.js new file mode 100644 index 0000000..98402c6 --- /dev/null +++ b/sample/js/workerAutoInject/safeClassic.js @@ -0,0 +1,9 @@ +self.onmessage = function () { + var canvas = new OffscreenCanvas(8, 8); + var gl = canvas.getContext("webgl"); + + self.postMessage({ + value: gl ? "safe-classic-ok" : "webgl-unavailable", + workerLocation: self.location.href, + }); +}; diff --git a/sample/js/workerAutoInject/workerAutoInjectDependency.js b/sample/js/workerAutoInject/workerAutoInjectDependency.js new file mode 100644 index 0000000..8b9b12e --- /dev/null +++ b/sample/js/workerAutoInject/workerAutoInjectDependency.js @@ -0,0 +1 @@ +export var value = "dynamic-import-ok"; diff --git a/sample/js/workerAutoInjectHarness.js b/sample/js/workerAutoInjectHarness.js new file mode 100644 index 0000000..74925db --- /dev/null +++ b/sample/js/workerAutoInjectHarness.js @@ -0,0 +1,102 @@ +(function () { + "use strict"; + + var fixtureRoot = "js/workerAutoInject/"; + var constructorName = Worker.name || "(anonymous)"; + var constructorElement = document.getElementById("worker-constructor"); + var modeHint = document.getElementById("mode-hint"); + + constructorElement.textContent = constructorName; + modeHint.textContent = constructorName === "Worker" + ? "Native Worker constructor detected. Auto-injection appears to be off." + : "A Worker proxy is active. Auto-injection appears to be on."; + + function setResult(testName, status, details) { + var card = document.querySelector('[data-test="' + testName + '"]'); + var statusElement = card.querySelector(".status"); + var detailsElement = card.querySelector(".details"); + + statusElement.className = "status " + status; + statusElement.textContent = status === "pass" ? "Pass" : status === "fail" ? "Fail" : "Running"; + detailsElement.textContent = details; + } + + function runWorker(testName, scriptName, options) { + setResult(testName, "running", "Waiting for Worker messages..."); + + return new Promise(function (resolve) { + var messages = []; + var worker; + var timeout = setTimeout(function () { + if (worker) { + worker.terminate(); + } + setResult(testName, "fail", "Timed out.\nMessages: " + JSON.stringify(messages, null, 2)); + resolve(false); + }, 10000); + + try { + worker = new Worker(fixtureRoot + scriptName, options); + worker.onmessage = function (event) { + messages.push(event.data); + + if (event.data && event.data.type === "spector:context-ready") { + return; + } + + clearTimeout(timeout); + worker.terminate(); + + if (event.data && event.data.error) { + setResult(testName, "fail", event.data.error); + resolve(false); + return; + } + + var injected = messages.some(function (message) { + return message && message.type === "spector:context-ready"; + }); + setResult( + testName, + "pass", + "Application result: " + JSON.stringify(event.data) + + "\nSpector context message observed: " + injected + ); + resolve(true); + }; + worker.onerror = function (event) { + clearTimeout(timeout); + worker.terminate(); + setResult(testName, "fail", event.message || "Worker startup failed."); + resolve(false); + }; + worker.postMessage("start"); + } catch (error) { + clearTimeout(timeout); + setResult(testName, "fail", String(error)); + resolve(false); + } + }); + } + + async function runAll() { + var results = []; + results.push(await runWorker("safe", "safeClassic.js")); + results.push(await runWorker("dynamic", "dynamicImport.js")); + results.push(await runWorker("nested", "nestedClassic.js")); + results.push(await runWorker("module", "moduleParent.js", { type: "module" })); + + document.getElementById("run-all").textContent = + results.every(Boolean) ? "All tests passed - run again" : "Some tests failed - run again"; + } + + document.getElementById("run-all").addEventListener("click", runAll); + document.getElementById("clear-results").addEventListener("click", function () { + document.querySelectorAll(".test-card").forEach(function (card) { + card.querySelector(".status").className = "status"; + card.querySelector(".status").textContent = "Not run"; + card.querySelector(".details").textContent = "Waiting."; + }); + document.getElementById("run-all").textContent = "Run all Worker tests"; + }); +})(); diff --git a/sample/workerAutoInject.html b/sample/workerAutoInject.html new file mode 100644 index 0000000..505df08 --- /dev/null +++ b/sample/workerAutoInject.html @@ -0,0 +1,203 @@ + + + + + + Spector.js Worker auto-injection test + + + +
+

Worker auto-injection compatibility

+

+ This page checks that Spector.js leaves URL-sensitive Workers functional + and only injects a simple classic Worker after explicit opt-in. +

+ +
+

Setup

+
    +
  1. Open chrome://extensions and load E:\Babylon\Spector.js\extensions unpacked.
  2. +
  3. Enable Spector.js on this page from the extension popup.
  4. +
  5. Use Auto-inject Workers (experimental) in the popup. Changing it reloads this tab.
  6. +
  7. Run all tests with the option off, then enable it and run them again.
  8. +
+
+ +
+ Current Worker constructor: + checking... +

The native constructor should be named Worker when auto-injection is off.

+
+ +
+ + +
+ +
+
+
+

Simple classic Worker

+ Not run +
+

Should always run. With opt-in enabled, it should also report Spector injection.

+

Waiting.

+
+ +
+
+

Classic Worker with relative dynamic import

+ Not run +
+

Must preserve the original URL so import("./workerAutoInjectDependency.js") resolves.

+

Waiting.

+
+ +
+
+

Classic Worker creating a nested module Worker

+ Not run +
+

Must preserve the parent Worker URL used to construct the module child.

+

Waiting.

+
+ +
+
+

Module Worker creating a nested module Worker

+ Not run +
+

Module Workers should always use the native constructor path.

+

Waiting.

+
+
+
+ + + + diff --git a/src/backend/spies/workerSpy.ts b/src/backend/spies/workerSpy.ts index 95f8670..b02beb5 100644 --- a/src/backend/spies/workerSpy.ts +++ b/src/backend/spies/workerSpy.ts @@ -12,7 +12,8 @@ interface ISpiedWorker { * - Module Workers (type: 'module') * * The primary API is manual: spector.spyWorker(worker). - * Auto-injection is a convenience that works in simple cases. + * Auto-injection is an explicit opt-in for simple cases, not a transparent + * replacement: blob wrapping and constructor interception can change behavior. */ export class WorkerSpy { private static readonly spiedWorkers: ISpiedWorker[] = []; @@ -40,13 +41,13 @@ export class WorkerSpy { // Replace the global Worker constructor (globalThis as any).Worker = function SpectorWorkerProxy(scriptURL: string | URL, options?: WorkerOptions): Worker { - const urlStr = scriptURL.toString(); - // Don't intercept module workers — importScripts doesn't work there if (options && options.type === "module") { return new OriginalWorker(scriptURL, options); } + const urlStr = scriptURL.toString(); + try { // Resolve the original script URL to absolute (so we can use it // both as a fetch URL and as a base for rewriting relative imports). @@ -62,7 +63,7 @@ export class WorkerSpy { xhr.open("GET", absoluteScriptUrl, false); // synchronous xhr.send(); - if (xhr.status === 200) { + if (xhr.status === 200 && WorkerSpy.shouldInjectSource(xhr.responseText)) { // Rewrite static `importScripts(...)` calls in source so // relative / root-relative URLs work when the worker runs // from a `blob:` URL. @@ -212,6 +213,19 @@ export class WorkerSpy { }); } + /** + * Best-effort bypass for recognizable dynamic imports and nested Workers. + * This is not a safety check: aliases, dependencies, and other syntax can + * evade detection. Only leaving interception disabled preserves the native + * Worker constructor and its behavior. + */ + private static shouldInjectSource(source: string): boolean { + const dynamicImportPattern = /\bimport\s*(?:\/\*[\s\S]*?\*\/\s*)?\(/; + const nestedWorkerPattern = /\bnew\s+(?:(?:self|globalThis)\s*\.\s*)?(?:Worker|SharedWorker)\s*\(/; + + return !dynamicImportPattern.test(source) && !nestedWorkerPattern.test(source); + } + /** Get all Workers that were created while intercepting. */ public static getSpiedWorkers(): ISpiedWorker[] { return WorkerSpy.spiedWorkers; diff --git a/src/embeddedFrontend/styles/resultView.scss b/src/embeddedFrontend/styles/resultView.scss index e45f7fe..2a8fd40 100644 --- a/src/embeddedFrontend/styles/resultView.scss +++ b/src/embeddedFrontend/styles/resultView.scss @@ -301,7 +301,7 @@ $menuHeight: $menuBaseHeight * 2; position: absolute; } &:before { - background: $foreground-light; + background: $background; border-color: $foreground; border-style: solid; border-width: 7px 2px 1px; diff --git a/src/spector.ts b/src/spector.ts index 696dd74..041a277 100644 --- a/src/spector.ts +++ b/src/spector.ts @@ -477,8 +477,9 @@ export class Spector { } /** - * Intercept all new Worker() calls to auto-inject Spector. - * Best-effort: will fail for CORS, CSP, or module Workers. + * Explicitly opt in to intercepting new Worker() calls to auto-inject Spector. + * Experimental/best-effort: can change Worker behavior and fails for some + * CORS/CSP policies. Module Workers are not injected. Prefer spyWorker(). * @param workerBundleUrl URL to spector.worker.bundle.js */ public spyWorkers(workerBundleUrl: string = "spector.worker.bundle.js"): void { diff --git a/test/e2e/fixtures/worker-dynamic-dependency.js b/test/e2e/fixtures/worker-dynamic-dependency.js new file mode 100644 index 0000000..fe8bc42 --- /dev/null +++ b/test/e2e/fixtures/worker-dynamic-dependency.js @@ -0,0 +1 @@ +export const value = "dynamic-ok"; diff --git a/test/e2e/fixtures/worker-dynamic-import.js b/test/e2e/fixtures/worker-dynamic-import.js new file mode 100644 index 0000000..e7bf72f --- /dev/null +++ b/test/e2e/fixtures/worker-dynamic-import.js @@ -0,0 +1,11 @@ +self.onmessage = async function() { + try { + const dependency = await import("./worker-dynamic-dependency.js"); + self.postMessage({ + value: dependency.value, + injected: self.__spectorTestInjected === true, + }); + } catch (error) { + self.postMessage({ error: String(error) }); + } +}; diff --git a/test/e2e/fixtures/worker-host.html b/test/e2e/fixtures/worker-host.html new file mode 100644 index 0000000..774708b --- /dev/null +++ b/test/e2e/fixtures/worker-host.html @@ -0,0 +1,31 @@ + + + + + Worker interception tests + + + + + + diff --git a/test/e2e/fixtures/worker-module-offscreen-data.txt b/test/e2e/fixtures/worker-module-offscreen-data.txt new file mode 100644 index 0000000..395527d --- /dev/null +++ b/test/e2e/fixtures/worker-module-offscreen-data.txt @@ -0,0 +1 @@ +ready diff --git a/test/e2e/fixtures/worker-module-offscreen-renderer.js b/test/e2e/fixtures/worker-module-offscreen-renderer.js new file mode 100644 index 0000000..5ffb837 --- /dev/null +++ b/test/e2e/fixtures/worker-module-offscreen-renderer.js @@ -0,0 +1,35 @@ +new OffscreenCanvas(1, 1).getContext("2d"); + +export async function startRendering(canvas) { + await fetch("./worker-module-offscreen-data.txt"); + const gl = canvas.getContext("webgl2"); + const vertexShader = gl.createShader(gl.VERTEX_SHADER); + gl.shaderSource(vertexShader, "#version 300 es\nin vec2 p;\nvoid main(){gl_Position=vec4(p,0,1);}"); + gl.compileShader(vertexShader); + const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER); + gl.shaderSource(fragmentShader, "#version 300 es\nprecision mediump float;\nout vec4 c;\nvoid main(){c=vec4(1,0,0,1);}"); + gl.compileShader(fragmentShader); + const program = gl.createProgram(); + gl.attachShader(program, vertexShader); + gl.attachShader(program, fragmentShader); + gl.linkProgram(program); + const vertexArray = gl.createVertexArray(); + gl.bindVertexArray(vertexArray); + const buffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0, 0.5, -0.5, -0.5, 0.5, -0.5]), gl.STATIC_DRAW); + gl.enableVertexAttribArray(0); + gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0); + + function render() { + gl.viewport(0, 0, canvas.width, canvas.height); + gl.clearColor(1, 0, 0, 1); + gl.clear(gl.COLOR_BUFFER_BIT); + gl.useProgram(program); + gl.bindVertexArray(vertexArray); + gl.drawArrays(gl.TRIANGLES, 0, 3); + setTimeout(render, 16); + } + + render(); +} diff --git a/test/e2e/fixtures/worker-module-offscreen.js b/test/e2e/fixtures/worker-module-offscreen.js new file mode 100644 index 0000000..5857037 --- /dev/null +++ b/test/e2e/fixtures/worker-module-offscreen.js @@ -0,0 +1,7 @@ +import { startRendering } from "./worker-module-offscreen-renderer.js"; + +self.addEventListener("message", function(event) { + if (event.data?.type === "init") { + startRendering(event.data.canvas); + } +}); diff --git a/test/e2e/fixtures/worker-module-parent.js b/test/e2e/fixtures/worker-module-parent.js new file mode 100644 index 0000000..c5e72de --- /dev/null +++ b/test/e2e/fixtures/worker-module-parent.js @@ -0,0 +1,9 @@ +const child = new Worker(new URL("./worker-nested-child.js", import.meta.url), { type: "module" }); + +child.onmessage = function(event) { + self.postMessage(event.data); +}; + +child.onerror = function(event) { + self.postMessage({ error: event.message }); +}; diff --git a/test/e2e/fixtures/worker-module-safe-dependency.js b/test/e2e/fixtures/worker-module-safe-dependency.js new file mode 100644 index 0000000..4a377b9 --- /dev/null +++ b/test/e2e/fixtures/worker-module-safe-dependency.js @@ -0,0 +1 @@ +export const value = "module-ok"; diff --git a/test/e2e/fixtures/worker-module-safe.js b/test/e2e/fixtures/worker-module-safe.js new file mode 100644 index 0000000..9d84a2d --- /dev/null +++ b/test/e2e/fixtures/worker-module-safe.js @@ -0,0 +1,8 @@ +import { value } from "./worker-module-safe-dependency.js"; + +self.onmessage = function() { + self.postMessage({ + value: value, + injected: self.__spectorTestInjected === true, + }); +}; diff --git a/test/e2e/fixtures/worker-nested-child.js b/test/e2e/fixtures/worker-nested-child.js new file mode 100644 index 0000000..25a406f --- /dev/null +++ b/test/e2e/fixtures/worker-nested-child.js @@ -0,0 +1 @@ +self.postMessage("nested-ok"); diff --git a/test/e2e/fixtures/worker-nested-parent.js b/test/e2e/fixtures/worker-nested-parent.js new file mode 100644 index 0000000..13d40ce --- /dev/null +++ b/test/e2e/fixtures/worker-nested-parent.js @@ -0,0 +1,17 @@ +self.onmessage = function() { + try { + const childUrl = new URL("./worker-nested-child.js", self.location.href); + const child = new Worker(childUrl, { type: "module" }); + child.onmessage = function(event) { + self.postMessage({ + value: event.data, + injected: self.__spectorTestInjected === true, + }); + }; + child.onerror = function(event) { + self.postMessage({ error: event.message }); + }; + } catch (error) { + self.postMessage({ error: String(error) }); + } +}; diff --git a/test/e2e/fixtures/worker-safe.js b/test/e2e/fixtures/worker-safe.js new file mode 100644 index 0000000..a998d00 --- /dev/null +++ b/test/e2e/fixtures/worker-safe.js @@ -0,0 +1,6 @@ +self.onmessage = function() { + self.postMessage({ + value: "safe-ok", + injected: self.__spectorTestInjected === true, + }); +}; diff --git a/test/e2e/fixtures/worker-spector-stub.js b/test/e2e/fixtures/worker-spector-stub.js new file mode 100644 index 0000000..2f05c5b --- /dev/null +++ b/test/e2e/fixtures/worker-spector-stub.js @@ -0,0 +1 @@ +self.__spectorTestInjected = true; diff --git a/test/e2e/workerInterception.spec.ts b/test/e2e/workerInterception.spec.ts new file mode 100644 index 0000000..00bd292 --- /dev/null +++ b/test/e2e/workerInterception.spec.ts @@ -0,0 +1,301 @@ +import { expect, Page, test } from "@playwright/test"; +import { readFileSync } from "fs"; +import { join } from "path"; + +interface IWorkerResult { + value?: string; + injected?: boolean; + error?: string; +} + +const fixtureRoot = "/test/e2e/fixtures"; +const contentScript = readFileSync(join(__dirname, "..", "..", "extensions", "contentScript.js"), "utf8"); +const moduleWorkerInjector = readFileSync( + join(__dirname, "..", "..", "extensions", "moduleWorkerInjector.js"), + "utf8", +); + +async function installExtensionWorkerProxy(page: Page, enabled?: boolean): Promise { + // One init script fixes the ordering: native snapshot -> session setting -> + // actual MAIN content script, all before the parser/application runs. + await page.addInitScript(` + window.__nativeWorker = window.Worker; + if (!sessionStorage.getItem("__spectorTestInitialized")) { + sessionStorage.setItem("__spectorTestInitialized", "true"); + sessionStorage.setItem("SPECTOR_CAPTUREOFFSCREEN", "true"); + ${enabled === undefined ? "" : `sessionStorage.setItem("SPECTOR_WORKERAUTOINJECT", "${enabled}");`} + } + ${moduleWorkerInjector} + ${contentScript} + `); + await page.goto(`${fixtureRoot}/worker-host.html`); +} + +async function runWorker(page: Page, scriptName: string, options?: WorkerOptions): Promise { + return page.evaluate(({ scriptUrl, workerOptions }) => { + return new Promise((resolve, reject) => { + const worker = new Worker(scriptUrl, workerOptions); + const timeout = setTimeout(() => { + worker.terminate(); + reject(new Error("Worker response timed out")); + }, 10000); + worker.onmessage = (event) => { + clearTimeout(timeout); + worker.terminate(); + resolve(event.data as T); + }; + worker.onerror = (event) => { + clearTimeout(timeout); + worker.terminate(); + reject(new Error(event.message)); + }; + worker.postMessage("start"); + }); + }, { + scriptUrl: `${fixtureRoot}/${scriptName}`, + workerOptions: options, + }); +} + +for (const enabled of [undefined, false, true]) { + test.describe(`Extension Worker auto-injection: ${enabled === undefined ? "default" : enabled ? "on" : "off"}`, () => { + let preflightRequests: string[]; + test.beforeEach(async ({ page }) => { + preflightRequests = []; + page.on("request", (request) => { + if (request.resourceType() === "xhr") { + preflightRequests.push(request.url()); + } + }); + await installExtensionWorkerProxy(page, enabled); + }); + + test("decides interception before application Workers are constructed", async ({ page }) => { + expect(await page.evaluate(() => window.Worker === (window as any).__nativeWorker)).toBe(enabled !== true); + expect(await page.evaluate(() => (window as any).earlyWorkerResult)) + .toEqual({ value: "safe-ok", injected: enabled === true }); + if (enabled !== true) { + expect(preflightRequests).toEqual([]); + } else { + expect(preflightRequests.some((url) => url.endsWith("worker-safe.js"))).toBe(true); + expect(await page.evaluate(() => (window as any).__SPECTOR_Workers[0].injected)).toBe(true); + } + }); + + test("preserves relative dynamic imports in classic Workers", async ({ page }) => { + const result = await runWorker(page, "worker-dynamic-import.js"); + expect(result).toEqual({ value: "dynamic-ok", injected: false }); + if (enabled !== true) { + expect(preflightRequests).toEqual([]); + } + }); + + test("preserves nested module Workers created by classic Workers", async ({ page }) => { + const result = await runWorker(page, "worker-nested-parent.js"); + expect(result).toEqual({ value: "nested-ok", injected: false }); + if (enabled !== true) { + expect(preflightRequests).toEqual([]); + } + }); + + test("preserves module Workers with nested Workers", async ({ page }) => { + const result = await runWorker(page, "worker-module-parent.js", { type: "module" }); + expect(result).toBe("nested-ok"); + expect(await page.evaluate(() => { + const workers = (window as any).__SPECTOR_Workers; + return workers ? workers[workers.length - 1].injected : false; + })).toBe(false); + }); + + test("injects a static-import module Worker only after opt-in", async ({ page }) => { + const result = await runWorker(page, "worker-module-safe.js", { type: "module" }); + expect(result).toEqual({ value: "module-ok", injected: enabled === true }); + expect(preflightRequests.some((url) => url.endsWith("worker-module-safe.js"))) + .toBe(enabled === true); + }); + }); +} + +test("off mode preserves native subclassing, statics, invocation errors and coercion", async ({ page }) => { + await installExtensionWorkerProxy(page); + const result = await page.evaluate(() => { + const NativeWorker = (window as any).__nativeWorker; + NativeWorker.testStatic = "unchanged"; + const inspect = (Ctor: typeof Worker) => { + const calls: string[] = []; + const scriptURL = { + [Symbol.toPrimitive](hint: string) { + calls.push("URL:" + hint); + return "./worker-safe.js"; + }, + toString() { throw new Error("Unexpected toString"); }, + }; + const options = { + get name() { calls.push("name"); return "native"; }, + get type(): WorkerType { calls.push("type"); return "classic"; }, + get credentials(): RequestCredentials { calls.push("credentials"); return "same-origin"; }, + }; + class ChildWorker extends Ctor {} + const worker = new ChildWorker(scriptURL as any, options); + const subclass = worker instanceof ChildWorker; + const nativeInstance = worker instanceof NativeWorker; + worker.terminate(); + let invocationError: string | undefined; + try { (Ctor as any)(scriptURL, options); } catch (error) { invocationError = String(error); } + let missingArgumentError: string | undefined; + try { new (Ctor as any)(); } catch (error) { missingArgumentError = String(error); } + return { calls, subclass, nativeInstance, invocationError, missingArgumentError }; + }; + return { + identical: Worker === NativeWorker, + staticValue: (Worker as any).testStatic, + actual: inspect(Worker), + native: inspect(NativeWorker), + }; + }); + expect(result.identical).toBe(true); + expect(result.staticValue).toBe("unchanged"); + expect(result.actual).toEqual(result.native); + expect(result.actual.subclass).toBe(true); + expect(result.actual.nativeInstance).toBe(true); + expect(result.actual.invocationError).toContain("TypeError"); + expect(result.actual.missingArgumentError).toContain("TypeError"); +}); + +test("opt-in captures a transferred OffscreenCanvas in a module Worker", async ({ page }) => { + await installExtensionWorkerProxy(page, true); + await page.evaluate(() => { + const bundle = document.getElementById("TexturesId_SpectorWorkerBundleUrl") as HTMLInputElement; + bundle.value = `${location.origin}/.temp/spector.worker.bundle.js`; + }); + + const result = await page.evaluate<{ commands: number; names: string[] }, string>((scriptUrl) => { + return new Promise((resolve, reject) => { + const canvas = document.createElement("canvas"); + const offscreen = canvas.transferControlToOffscreen(); + const worker = new Worker(scriptUrl, { type: "module" }); + const timeout = setTimeout(() => { + worker.terminate(); + reject(new Error("Module Worker capture timed out")); + }, 15000); + worker.addEventListener("message", (event) => { + if (event.data?.type === "spector:context-ready") { + worker.postMessage({ + type: "spector:trigger-capture", + version: 1, + canvasIndex: 0, + commandCount: 6, + quickCapture: true, + fullCapture: false, + }); + } + if (event.data?.type === "spector:capture-complete") { + clearTimeout(timeout); + worker.terminate(); + resolve({ + commands: event.data.capture.commands.length, + names: event.data.capture.commands.map((command: { name: string }) => command.name), + }); + } + }); + worker.postMessage({ type: "init", canvas: offscreen }, [offscreen]); + }); + }, `${fixtureRoot}/worker-module-offscreen.js`); + + expect(result.commands).toBeGreaterThan(3); + expect(result.names).toContain("drawArrays"); +}); + +test("disabling persisted opt-in restores native construction on reload", async ({ page }) => { + await installExtensionWorkerProxy(page, true); + expect(await page.evaluate(() => (window as any).earlyWorkerResult)).toEqual({ value: "safe-ok", injected: true }); + await page.reload(); + expect(await page.evaluate(() => (window as any).earlyWorkerResult)).toEqual({ value: "safe-ok", injected: true }); + + // The proxy message handler's write/reload ordering is covered by the unit + // bridge test; here verify fresh-document behavior with that persisted key. + await page.evaluate(() => sessionStorage.setItem("SPECTOR_WORKERAUTOINJECT", "false")); + await page.reload(); + expect(await page.evaluate(() => Worker === (window as any).__nativeWorker)).toBe(true); + expect(await page.evaluate(() => (window as any).earlyWorkerResult)).toEqual({ value: "safe-ok", injected: false }); + expect(await runWorker(page, "worker-dynamic-import.js")).toEqual({ value: "dynamic-ok", injected: false }); + await page.reload(); + expect(await page.evaluate(() => Worker === (window as any).__nativeWorker)).toBe(true); +}); + +test("loaded extension still captures main-thread canvases with Workers left native", async ({ page }) => { + await page.addInitScript(() => { + (window as any).__nativeWorker = Worker; + sessionStorage.setItem("SPECTOR_LOADED", "true"); + sessionStorage.setItem("SPECTOR_CAPTUREOFFSCREEN", "true"); + }); + await page.route(`${fixtureRoot}/worker-host.html`, async (route) => { + const response = await route.fetch(); + const body = (await response.text()).replace("", ` + + + `); + await route.fulfill({ response, body }); + }); + await page.goto(`${fixtureRoot}/worker-host.html`); + await page.waitForFunction(() => !!(window as any).spector); + expect(await page.evaluate(() => Worker === (window as any).__nativeWorker)).toBe(true); + expect(await page.evaluate(() => (window as any).earlyWorkerResult)).toEqual({ value: "safe-ok", injected: false }); + + const commands = await page.evaluate(() => new Promise((resolve, reject) => { + const canvas = document.createElement("canvas"); + document.body.appendChild(canvas); + const gl = canvas.getContext("webgl2"); + if (!gl) { reject(new Error("WebGL2 unavailable")); return; } + const spector = (window as any).spector; + const timeout = setTimeout(() => reject(new Error("Main-thread capture timed out")), 10000); + spector.onCapture.add((capture: any) => { + clearTimeout(timeout); + resolve(capture.commands.map((command: any) => command.name)); + }); + spector.onError.add((error: string) => { + clearTimeout(timeout); + reject(new Error(error)); + }); + spector.captureContext(gl, 3, true); + gl.clearColor(1, 0, 0, 1); + gl.clear(gl.COLOR_BUFFER_BIT); + gl.viewport(0, 0, canvas.width, canvas.height); + })); + expect(commands).toEqual(["clearColor", "clear", "viewport"]); +}); + +test("popup exposes the experimental opt-in as an unchecked, labeled checkbox", async ({ page }) => { + await page.setViewportSize({ width: 418, height: 550 }); + await page.addInitScript(() => { + (window as any).__popupMessages = []; + (window as any).browser = { + runtime: { + onMessage: { addListener() { /* no background in this UI test */ } }, + sendMessage(_message: any, callback: any) { callback({}); }, + }, + tabs: { + query(_query: any, callback: any) { callback([{ id: 7 }]); }, + sendMessage(_tabId: number, message: any, callback: any) { + (window as any).__popupMessages.push(message); + callback({}); + }, + }, + storage: { local: { get(_key: string, callback: any) { callback({}); } } }, + }; + }); + await page.goto("/extensions/popup.html"); + const checkbox = page.getByRole("checkbox", { name: "Auto-inject Workers (experimental)", exact: true }); + await expect(checkbox).not.toBeChecked(); + await expect(checkbox).toHaveAccessibleDescription(/OffscreenCanvas Workers.*may alter Worker behavior/); + await checkbox.focus(); + await page.keyboard.press("Space"); + await expect(checkbox).toBeChecked(); + expect(await page.evaluate(() => (window as any).__popupMessages)) + .toContainEqual({ action: "changeWorkerAutoInject", workerAutoInject: true }); + + const footer = (await page.locator(".footer").boundingBox())!; + const hint = (await page.locator(".captureHint").boundingBox())!; + expect(hint.y + hint.height).toBeLessThanOrEqual(footer.y); + expect(footer.y + footer.height).toBeLessThanOrEqual(550); +}); diff --git a/test/integration/screenshots/visual/result-view.spec.ts-snapshots/result-view-captures-tab-chromium-win32.png b/test/integration/screenshots/visual/result-view.spec.ts-snapshots/result-view-captures-tab-chromium-win32.png index 2af11792e8d55365558e1a8efd7154164e18adb0..eb89998cf1eb4b08cb404f7c5d84fda29142d0d0 100644 GIT binary patch literal 21177 zcmd?RXQ&dD01r!t>Y~TO$InTTEIWNwO=e+TUKk*vYwbr`6>w8^mJ-=sV zarCh4VG$9LqqqLL@jyi6SH6hIzOvu;3Ew;bb?J$S{72;0jX!N47Oc!1`s5o6RooI> z1udD+ylz4>#IB1O{`Sj>>we+?y!fS0H7VTd@ISZw{<``_ry|1Wnq6;t*ZK?X^!95V zF^5n1)js_D)ZwmE`L}X&KFNBwzOd-*{!L8ma}1o&H^t}?U?VAw{+N0|eG?DMVGNcx zDRB6dMgeM?Q=S0W9lQ+PWsyWh^i_7(RTPg#O>cJq_lbP)H4qN-+Q?-TPWb#VfY1;= zo=ZS~5fS;TU{Or?r|&la!dEAhxWf6o)E|}>5qb3W`QDfRu-ZHzBJz9q`~O4##nq5Y zhA^=6sV+LPH|FMd8w zWY?1ucjgqug|9w^L??wnh$Q1G;VCSv@oyZ;KRBh8Ke0uGAdBSozj?b!2+-g^>(%9ZG6>Nm}G{ox@ ztN?=rq3f8`#H;K6`h>b+fca^SBHlFBUBDGC{{zy|I{G4SL9gYih~~{BxtyxhTy6W2 z**kFz2nF(^`;`l^c{RE^|I-gi2iN1-JKv>SWUSDmqzxaf<@)c&E?s`Rb_GvTHE<8Z z!`EL~C>$zx+E%Qz>Pid{@kna=qAM;EJZ>)Sw)s>ezPP^#u-)sBz*I_P_J5!>WLaup zH*Jczw(#Bkid(Ib!a>F2HVW-55slTD)g}u?=#_$l;T&t5L5Z)%lPLeeBykg&hlj}m zKBvoca!b45K{<;-e{1M{$=GjYVq!x3Wz8?+4KbTg3Xd!;vN+o7(ZZ*-Bz$XqOf?m3 zdxkh)#;@5%wh@A@hwJM$We+YSC6owp6LR>FHKOP3pUY9WoYik zgdur7Jz{p;#53lj>ObCVsp}fgT5DI*3jtwY4$OCXJFvdR4(O0n)zyh+5svVMxt+CL z4n@)QM7>gso&Cr<6;-sm5+RlWQHVYj;m#e&PS`9_Op{a8!eIf!FQT@yNxYAOvBD3q5Q;FXmi@NVFJ0!2SAAWRn`QVgL!~0ywCqx!)toIe`QtWUKchdLtE3k$QSKa7$EQRof&?;!u1_%oeV!k zVO7O;TyK7%GVfmSwIZkH?+nbT*z!9UN*&X?-ZuxSCfQ8Hoev|+t971IXSl~RmUXj*UIukQ^K*+FLJ(kf#(1G=X2H^kBMq_4<7g|=@z=0Ce* z-!gPoy-4IfRg8mnmSTo>)_m?8E$yyr?pb3sUo&)K@0813EvbERs%68lMIuPzTTNJo zMlb4BNe(-4-XWpX8M4xRq#!(cJ*=Z>UEg+;6pjslJm(H|mT%&^lf)-~sJxs5(?(z0 z?Yk6P9K9X2qalXvsx*2gG$Q}Lft=ISUNwZ&VqtPMZRYg@4nr9y!wKoEKF7APlJ3%g zlRZ^Fb=31X48gKPi*rcWwkXjV!Ke6spPZv@b)Z*Qi4azB@v;mBG4Yrv388%vayM6?x;Gpt`ZU$L9;&q2}u{?1jz;S96`7ANnISY=_vpV-E%T z=B3#ngfinx2Ctbq+WvCc%E$_47*crm-u$xAl^&w_xz-*jn6I}1ypwF{^Rc5~wsiS* zILB=Zx$gWbCI`6~EMhAdVvbB146urH0r=d}oUtU!VL{7RIgAy$B8KtYY~ zm)~W2BV~1FW(w9~b*kQke`n4-KF!4q5D)beD0VWDzBiy-Z_BS_t1K5fXBclDQxSos zun~+FUaUY}Waz%Q(K<_m|6Su5OF|WnQg=~&-q&?P*AFElxqPd{NczgnfArznRby3h zdMkiThC%oDun^2y@kITDEd34LRYyY0 z-$%*K_0w(Rkp;zt%|48*Ct8UP61V}TgU}V8V(2Bz={ZjU_!VDUQe-~%YBU*Ln5R(n zTDAwcDV3&^ z+){JYO*V1|pRmLLpq5>B!z-<(__ZX(o$q;jPO|1oOMP7G9QSTU;vPVu2zZI6o-v`* zcfno@J9|Ez+`}eMh7@%fU(@l+%(>R2cUVCwbjRP6HxZH1i>G015{|!N;3dVaj=Y?| zHM5@6Rqt!14sx*z?TjY5NlTbd?}m2;O%D{MV+Q6&KV7iaWryC9*@)E%73%|Zcq@qC z7dm9StV3!FPxP8+kFHm%^L6=mvl9Djv~cQ5fmAG>5<28 ze{(|`DkZZ<|MOj{vjrX@HuvX8iV`AL4tLII>}fVl5dbW{>@%Jr9ms{kRS6s(C0)@FchlY&du4S%7V zWwshp!%w6`Mwq8i(RDv6RFoidi4~0u94{TB-d>mWBk_~SU+%moRKc1ezdfI_v+xrs z+w3XJUi9%t=YL@|G#}0!-V3}w-HlE{{tLfJ641W*_&&AzC(icl{|&u_iqCdB%Z+Etkj}PU0Fq=_-bm1((0$TP?K%QXfSyUUK=5qUIl zo?GT&UBgTgv&Kd6*NUv^JH$;qJ5YDHeDCSC0*u z91#(hltoOMuXzo|ahsB{Gp}vG;2me&eSIfxrgsEn!f)+J@-^2DPQkbK9}$l2t`axY zo0pOaFyT5l9LuUzJ?Uh>J9Vl}^q5H$q4$9ZzJc9(?QSTWs(R`0>$v$hG&wO{f ze%F-(r(V(R4!i4-U`U9Qf{r&$PA$#NVm$nSV>3CLev3|xCM7hg+ z^tMKyyN+qBeqV;)MA2aX!EaHrrkY860$(avYaVcQRmJ*+t*w54KI`;0j`pEf^J5jy z4YJ<5y-iZgpQ^7t@o2PjulescD0Cl#BkqR!Tl+g^XFNZ>_DxGX1FZKs!=ILHi_DT@ zI6MBRmZ>hC=LS|NK0ue?aux zrarl~e@{#HRzlibA%%02l6X^B?>En=2lLCc=IC=1Xf}e(?=PLFJY0FFA!mg?dZhm* zW^epgPr6ODS7~k)weKJNEpoIZ^`N2PdbFKq0DADrO6Pp0V7_%0s*)s9a8^z>=ckHo z3pL0i(Gl#=?oO>eXNdCpPr8e{zwt(^Q_j&@^HiZSHHG!mo|UuuWxs@ohum>!eG}Gm zo4C>~J}>IO@xJNyr-Tjeq=*2pK=0$gtmL2TU4sCmRz;A!p_dOL1vDlm$QSZ%iH;Ud$ zuV`24aDHA;?WWH}7g^ zNSmYXRrStCyswxd>sMR`*^`U&VBndWFSa#18u z>;=TK3|XaHS*FV*DSJ9i`ajRs>!&W&syMXCi*;njJZoJ3eAmNhZ%Vw&G>jzHmsB!X zc(qnVgIJby!ASLrq5ysfb*DYi@H)G{V@)DCb%G$F{&?=^_%u*Bm%ggtdC^#f_<^eZ zkoI>01F~t5N4?8-f1i1QLE*iaeZ*AC&IGS#Ok6<2To}2<$tru=KDPP4UDAl>YZWL>Bk@ zKJhy@RC3faY`1^fg>Cd2S!g+7BSGC>oG5nMxZT$21#FRh;r9{@z9?%R7r#+rfjYPS z4QQBRPLjHwCe+`T2Zv+f4Pimsafa!x+S;bSZLb;iux+lHMZT}lv3Z-3g$Sa}dZEd( z^pYT6<@^e}ac4b#O&X=H@#MHrR=*#8&&c|8PR3}ARZ7}Rj@R?NdI6gelfp`U)*Gv&XYEn?13*YJjDcxW(b%tJE(cIIj~*Z)oB z?Iyc82TLhv=H^!t%AC(^+zF84&%x$J_8ilp<4`?HYOEr7o1B!5S3QHY^n*2fT zO-3xHH;OY*)$a?m)_jUe-4p-s!?CE7qfYAuk;hC01xlO&)oNqaDx=DgVZCQC z@}1o;F^5&}eJuJbH$(XwB3jtUz@M4(5pxk=YmHx+Jct^EBe09puGF2(9VOWG#^UB1 z3e3sK zP06lqs@gpdn-It@UdlAHNfKGwv%HZDT-bfo_P5T+bllpGnPIsoJ^5*!!je-lAKlm+UypEnALTfw zp~HM7bqf04N!F+|3O6cCQi{7yeg3ZfyWth3vOI0`v|ht2t7sd+U+~^RurdRlfm|n;$;uvWeNuI3J6S|FWs%N>dm{F&20<6)WZW_P35^>+YDQR*k z9r?UuHuG`Z+>5UJ*!+5xl~wQi*HKjBr6DJUPPc~fmd@cTq{gJ3bZ_cz$4XnQ|AO?~ zkyF9`d;5x$`KB?}3k@N!jL20B$o#@oxWBCwZ64&rh|yrnnMnCU&j#2s>R`W3=E?^( zSFv0*N>Eza(pl2~i6J>weXQFdpG~9{TbkAindm;L!yA^tE_>}x+!VH}K7kDzWKl3b z3Z6QqSDl=hfK8spf4qR_X|VfTSmE0x^=+%XhuuMX-Ajm?MS8JaS2giF&)zTbM~@|c zj%=Zr!?KmEQ`wt)@HsB*W_F==ELAeYG=wtjm~$+J)l?^N{<2=3>Wp>yY(nOp92$B! z0~ob-wA3w|R6wpbbws*@qe_1h#lgG%|(u*5h3|f!4gcURkDbp}>10MEuQUezYL{%NQ#a(qf7VV~oA| zrA~ZrJ}ZB4VNw|XEKt+p+Ng#>?d6YzGS+e(RC=O0Mxs#FN69uM`6h2M)VMI>>KLeK zG)O#6ZHeC4Xh%|8HP%FLw)WSQ*!2BUw|}oO#Cc(3v6QV{X;=P@Vcfn?CfhddiZZe+ z-~^0iHv-qTJ+nz!D;srZ7qALFa+7D3W$B&`%bs>Km17&^!-o9$FVjyAMYRPng8Kcz zqCfS*a?_aQ9@&?q=NjdsS#Y7(LNaD|vW>f)QoMa~h|PMu9mez@xf|LvY7vKNs{-SR zMc+m~b{m$v){*U99uzeno*-C47*`+CmDo_FR-)gYO%2?j*sM5Zn}!b@=!#i&Jat8R z3BPj($_=;<8ML`(sCX4m8w#kd0tHJBVY3bEtog1}&zSesY57ehIXLjrG*tn!D41f6 z-?smC{Pmv6qY4%wy+547SF1{?faq^Kky+pK3CU%j@dc_({ENHg%uu@#q|>`02V-gB z&iI2=3|jq&?u@XM#r)@HHBj3Pk|JNPfZ2ML>z#2&(Z&ZwkjW8F{@Q<_)`ecA6{fs( z;$|&WXtbX9qEblrD`dF|nc`El7TE#%6Rpyntk4<2h0{N0r7{ySUrcp_{BDnJXBtFRpK+~rHREV0 z6+6XK+ojEcQWrtQc_+*b*uA)VqNC7!C%f6QK;sP49&MFc|9(JJ7?&B>n&&Oiyh=Q`t`a5Zy3zrA=db_ zGQ;YX8|C$V$i$zZ`wDp~LAWa9dR>Wwdh(hQM$y0s{T~n1sh@%{--K3rrNyz#Entzm zU*f^^s9x30x5dRlAUgu^sNE^IA82rWLUKMDc-$fTNE*x~7IUb0+u((}gAUXl;2kh{ z&lj!M!>wFqzp(dCi_?mx4Xb3=eo-vkaM(|hs;#IS`M-iW6FVxyt(p1Vn>Xlk@p@dX zmkHuSs{Q#H0Gs2=ubW7ihV|ut%^H*rdCTx@2%E+% z|EYQg9caspLGh=JYxjZ(BF^|JKf^2`FVYH%3D1+mTYfReIq`R{038Yt*byB?I_8G%H8q5`>`+!F!PIZe$NqRT7)2d=dYw z$ALmije3q#I@gzCsbRqGmlH35ta=TrTk{q|YC~(LVx=dDbJk6_Ty_nfRbd&FiE43KCqRJf!w~%Yp>d+EKMS zmf;L$t7Xt8*WRpg0ckYZn0bzoANJo0;7nI`(~M(_GG4Q?hH2Ty+1Vt| z;KAZ*>dlwkavOo>b*S<6=5r(gX@kGnJ?8rAfIhNrv-QYc7Z-$G*w%P=^`ae2<5+gd zaQ{SOyV>Y!%CrMppz2Br2F+&ow&gr%C#7a?9{<*BI} zd5|S}N`~*^JL9W1?qKQ3X#cqUf?8~VmBHPQ8E~MW7Oxi8JE;e((uz`-K8@A`rM=N{ z80Os=dhZlj4>~Q+RbF9Q@DO;zqWINU727S7>;H(RL~w)YkDVZS_xF&dZnCg1b?oM% zo9Wuj`}-e=K?B1{#;8uj{lz=KKIJ}t8&|>%HU5F(e|~E4%nVx!1gSaO+ovaN9Z!k=Lr6H8x`!s$DVyJK^tTKf4_-b#>-m;Ym1C`|+ z=!SzkWb1ujx@4TaEx~8FA{LWzb*UoB%zL}`^=cr9h^FggrPdQ=WEC%Ue$EEL?UI|Z z8peUe41B$@vHt)p*}=iR_TlhsMPt&aHU92^sDAX3JHn09|31x=I%4UDannJ0TR`mX-I{Scaovx z_9trmG;ZZ$j2kX&;#EbXDP>n$p`xwA%R^UhTqrLY%gvdWebvVCgwbR4tBHa4?9#CF zfy4?8hr6(Xt7O_x93tRjW}_2@xoaLrRDY#c%YN^)s)rXly32d;1dsBu&o%Khk&k!oTyMfOVhS;0?lI=o~W!e zhf7Z&oZJ=5+uXI;we9P`f_pUK?&sNmHOn*ViYyk%|K2sVK4;UVP!!i325=IR zAV1sJAC7&G7_W((PbbC44w6g%9KI9=_kS}6DwDmA#BOZ8VYmNf^>H#3zi|@XRL6h& z_N-|I%uL|COz+59LJ(yw^o9rIFwN|WnIvqieEfE~`qoT|jfLby!5=?6(Esy2cbTS3~Y)Kn$VLfpP0Xu2|m4yzt_ z^0p&7j325YUm6i*z!nE=;x-;l{Mat=t5SJO+k{30yD1O#qaFS&_ph;2$-w@pNJDdm>OGl|jm59snh5BW+{DBf0#jiJk+ITx+PvMGgM(hGwUnxE z_E^%$W{PGrJ4BS)TCWH#)avg=Lm~_+HpqRPT$}5458+TmcyZgC`N8EDRZbtOHRc{$ zx%M8D;s=r8tPIss5e!&W@vvD5vkDt>H;!OP*X4X9( zrD^>{7jMpS+4_Q7ZwF)Qw+?H=2QPxYSJt{#15ti8Q-*;OZ9QXXLMA3c{8-4+!D5)vhBU0GQoU2k-YzO#=k3bWw<`XkIFo6 zZ5qFR)FQ=5#o0V)_sf}?+^m~CZkoFp?QO@<#w*Qma5=Yo?Q`d3SKsT{aq?2*0{r&}}r@4slTTVg8Qcn|NxfqnU#o9yWzjoMjr zFfzpm&@xM3bh^MwX>RNUmy(ff7W6s%AY!#}bn-Pf*u~!>Xr32b<1hF=FRgCG9KwSj z9}au}gi)T0S!|41Vv{3auF*2vHFk5`y5Gn^Z`bFM$yB_D z-%s}`0hNRC7DVwaUR4*%!!H;~m6kiJO|^p|w54~R(4JHg-Fo8qWcDF(*Goi_9U~68J3XHYGTv$$bl(J-X|~+Rpc`w- z`OAv#c~hHzaAr0rl|k?*pfGacx|XE9eP1)8nvFb6)HEmxn?7f@OfSi+B}XovtdQ_a zBT9$bk_U9sbuV1Gd~LDd$JKZY4uBoJ*K?f`ol&gh;DgqAw(1$kE~w6&NwW9rj;$(4 zq|KRf(>4-g!~iw<_d~c}lZH;c^zFJt>%wPd z78RO+mQsM})9jf@oB`ukOX5$&)mm|u`z#n7hVMwtZdq&{t9pOmy;|z;8PT-2Elc*L z#pPsqLS9@6QI&hUKSmr0%g=}iEX2t$+2xgB1K@?nHz5JUFU578nsp}XoYKXyMJIp2 zbxMJqw_ZNRwcph!apR44hAK6+Z#(|mir>#jq5S2dTnru1ylF0qZw$s=bdC-qJN)iP zH)vQSVtgSo8?S~geob8;wP$JPVvPNrFt+mieuHw8XS3D4Sw>?q+Mo3>9M%))A@maB zp1^_DxH#~KakalFL?ajCSKw-Jh3D~YB@5q*AO`GlO)!)(cXhn};qZpI8+hu=pTm`G z=B@M5cBEs2hY%^G=I}UA(A|m12VOFgn{m5-x}N>AG!kRJB&BW_J~ZAvbak#~5#9me zfUiScS(LnMVl&QyEy`YU<`M!Mq_D3$z#-ieN2RZ^d@#KE?FHs zTO3?>F@@DrP?H(88%+je5aEOvNaI7w+u@+~$wmvS0Fy7J9|^>?t^!2nuwAm9!@P6v zhLVee}+?Oo?)ke`^GOQpl z>UBLt44n%P?(ayLBaSyMXo5@>bvE%ALW0xY0FsHn+Ae~sSq0JuA2(d}`Pg_g&t0d_|ALtqJ?a}JviBVt`T0MYQA`)V?IeNT=O@(9g$?MQxw z$?;j(wBRSC(%QCMZ_ivYwb5D<*Gl? zcqf8fMi%2ZBa+#tA?vdfqM{RCjpl!73_PBY*<*`a7xcwSK*!-26?eg!&=MA?M-CEJ zZkM;YR4*HBSkVnGGb)briq!^y%s%l*BQRJ>R3IboM9XOG_+Il*>eJ}piUPPqgw((z{ z#wv`*P8CV)7Q%auuL6Go#xoCH*@rW--qfu-ANZT}eZG9&3vr)9_%c{4c3qgM$Z3pae zm-#FDZS{;aYmQ77HV_GZcDo#@*8UF5QND z9NhD?qlM0WwQB7=8dbcI*Ev-@N}lRjx!50|g+^zvdEt(r6uhQ(-+K=WvseBL-LCf~K1 zy6rKDYow}K$rlVN9{!{2CyK#8LMd^jMyVR~xX$4jJ$bpe4zzhs$9?I_E%E*6+Tu}i zg+0poyql>-jY-#tVcct$UCo=r)AnETIN5y?Re>u2Z<#4_WM2WUPD4s_wXsjhGRhzqRnr+{X&~-;2)ki4FU0ka zZijSD>3s@ez0}ii?e9WpG2krJY+$YvG%b#Lqj!k!F$bxDN)OzfN!%2@uEpAd2~Pa= z^j{cs%HMo*2Evn|lGneE#i_JUA)X5aVB%o^hi2-dzuYC9~^g(Stc?^pV)L7;I1OPvU}s5|`;Y4f5eBIm?S^uv%e zo1{oizp4Kv)14oy)xXx6{)@}KM>24RRk>4V@G$`7Fou^9{(te7+2^nWU0rRK(R~t#knb$>rqOz6zKsjQDsecZGP5g;A%~^U; z6WzfNO3IEHOUA*S>9~;3$#b03ow0ULj^0r(+>*7XK7msLcik;Kqw*=u`XEkQB-LNRplKt+J~g;b{$CN#jilkUlO|{j z?3NAQcKVmw(Sg&8vW=R`|LN<+C>tcxJxA2SE=VFg&7#Awr3s#%z#ih&EIH+D5~FR> z&6{?5_@z834Gle2A3uou;XO6Aale=faSEZ$d>CHJp70PHNalA&B!qdgac2QXg3tX7 z4?dkbk%n{9g0OZv7#P!)BS}o|HMSZw>Rg8Iynh$q zlE8Fc=8Y6aRfay6W8OSJ1CcHox+;NA1YD>J|D55uBg;!+HouXmJcUGCyFFZU%UBgi zi=iloCw~8=_Agwza7&wO1!xSz&txRenBO0(tREh`?FiRF;jbnX-=FnGKedo_r|W8_ z$?7SxJ{7Zr9ks-3hbv(1wI-XYPEy&sbSxo;A`34^jnQVfrzgX_ltJ~eB>h!;1A@~l zf^6S;nvJ_LFj!$Z2wa)4xlC_IuNY9r3zLFFdkUlL4(&%JrtNJ-OW9tVg$j27IxTbT z_9UaI)#fJqD&K*)j7sP%6QM}-d%MQ1=bR|~1$n7D%Ki$+NZ`-{)Yrjju<5PbN zX`oL|CtlzTLyhC{`3hnX`-5|#BHB$Z!Q_il8_nS<-xkfuRi9|1f0nR^9{#umO+#kH zsw}B8oGxq@x{OzT=o)zO6yNibu584pXvP3n$ap0=n=vO4zQ;1>Uqmk&@?M)^+yz@>MRuwhPc4RJvVRgpP6L8Z!j1gEm--pk#&D{K*RTDXUYrM%e;&YY`;fdq$ba%LUoZkK@rFS=_ zfAOO`H`*z3PGg&?9=dgnvEF%f-&feE_H=KtKAViH{shBMETNkD2@^4bg=fma3}!k; z+{%>a_{!gWxB}Qk=)#KcEY`iq-w50+&?Cy^jhgI6$CF`xOJwJ=*fjHcWjBy1UN-|I zEo7|8AD1Py9Rw8ts_MP9&w5U)UtG*-5hLZYXOhU`Mn8>#a&|ZOY|;*uC%1j z)h7?jrebX@2XhJ`6K$)4(`~LSOWjPNQxh(7tNp7Rn*(ME{N9xe<2*N%f7Lqysb zAFOvpxenGh#hf)*miWB{w!uz&0B65UTe>=yCB7S}?>&`2rHg1bE2lP3n91B7ew!Hu z4Mk4B;Htlv6mD2!exGkT$UM^;E{$AEoz#_{1LI|ds!kocj&uhk<{wqhGv=E0X;YjH zF%epymX7rQSwFMKOr5?YTnYiR3a}e9-g2e8$v28zm1Gvz>%{@r4ONck(UH9xPx!nN zB3M07G6w5YG!{vJ(F=n#>Cz^Hp@3RMICZ=>VZZ}Erdj!dzT0E$W z+r;{4wa|K2>dqw{%A|aljJ=M`LaQ*y7SMvPvNZFM5~@8CfC;O~GdxU-j@wdBzVDVw$z}YiyN4F` z)?W%$Si-2v+;Qq+I>;;IFBxd-%2hA7-OR2oBI*YnO4G6Dpf2U7^}<}n&?VX6lhf|*^SQy?N**2lnNd2 zo&3gRo{=y_~xV}3S*5@95aaz;#BE!i55o!kL$SS&a-ni1$ z3~BtLdaZLOXgcXus`IPK2Yn^&Rtjq2U@lqz|DW$V5_7#+_NssMVEE2W&{3MySH`aSpUEMmrd0Tb0(jzphero zjjmpVSJl>49sbHaXV&{5`hlG^*j*Z(92cX~5`PCmh=Y`sM&rB!?4K07*$_?L0doO! z`LX+#tx!+!PwYyLRWTyUCqosnp=?LS8Jdgt;?db+Y?kIMVvNiPfTj`9CB_!jF*AMz zfL^K8ili?Snf|Z;y9!yK)k;7$-Y;9`UVX1tR6aP6`vy@BJBF5!PR?FKnyR4|k@CPd zA7{8|G8z2Wt?dfcO@x-%02@Iq=;_o=zE5`ncw?cT7rEjGacZhugIHM)V{7L52H8F=u6eI27jpCC%(5Zi;Lp7)!`nW7B=}tssldO(E4ZJ=G*=l(0PW_ zc@~3~2Lma%a}ox?l|Ya>;LdLfo|^`Y74OAnqyxD)=G5#sqcr+$S^Kx%?`u=#>|NLH zXPDE8DP-eQmwhCrP`I9ti1Lddd1@ur?iS}QK5o$Yy7oC% z@Ew`NosD5Dg2SY~tS`tARZ5jgrszQNUA0S$16Egs7*$9gJW>Nq-JpE&O;s@khs|3Y zOHV;@=Y!G=RIj8ogQMlH&k4U ziTSsCWB}v_#Y@2KRe`y3pLacz?y%Ew8b;Q)t+`^Bqk2P^?CUZL#d~-c-c^b}!~23f zqhbKMWkz%)Nzc~P|Bdp>kesGL{v@VTV*K?dzJX%oOPZx_OZM;=SC@xT?NbYXhEk4R zj7m@RPeY2`mUB4))~n5d-0d#vuB8l?9XlXAWG`~tR<4;sCFeDW3h?ncn>muLFRLaB>jeuIf>@o;&&K3 z@mXpIejdo|onwB22D29BfXiRdseQ2uPGJ1>+9g@vUFXb3J39v}*D;lEvv+~l=|9>R zZe_6g*vpbGSYsif1s|+mfnS!Bj6+^ykS)uwokLa9F2Ez6S1d=}O%#z@G{pM^s2k_v z(?gk2i?&k(5ULL$u#~VqXaQVF(6CD;Y*<|{e;q10?}SVq%Da15NX)Xs6^sqgf~{&* z6I1)~?J*9M!0SC|mG@sy$gZ9Dhx(^<=qb21P@kilwB?LFYZKUR6ELJhmO1_X7lN`f zh~(mJ9eafSclC0d#B05f786hEN$S z(Kov6(o+h{z$N!9jxALYW0ATB{1V1_MoV+p^twjdIxd@=78ztLO>5~D63p_{Nm*%W zcZJ$*H|p-_fBH3y4+t0Z)OF#R=_9%~+=9~B!s%`UiXV*`Q=gJEHb-qYysgA4SD^3` z7vP6p3eSS#F8h$xwUS4rh1Xj8u6vV90^EKlIn8~_2HX+$tl!sE%g^pSux+WI@K zSL04|njZ$#RhtnHBi0Kx`1P$ldtiDGN4VETZ5p%LT?>H7fccSmc3j3A_;}?=5aDfm zukcnL?=aD8$1a{QZ9Z7|ux-sD?e0J_@N{P1_7+U3s)pb`Ryp{-x-3|FQ3>4{GgwTF zG)YlMGD_WUQR$3Q>N(FbyZW<=Wb-;6c2m9|!O-v=+gQ#!*m0nvtq;|nK_~NuTb~Pe zl73eE9xXi8DV2sZcSlU?nuMYOWIg3c*$wt2J2)Z;hf$EjD27J)FfR< zh@iC2Tv2J}K8>8a5MuR_eYDG^%)KMVN|Bzh{D(3lW)Pj^3KAcfC?vuI`MCZ328IB0Ri>bP%d0M;KQHE4oAzW9#(U zbD~+*Zm0XJ$oKv4G!iR;B)}Nxqm3OEc~}Esjo&Qtm+7=EC@w!MKC}IDXamk2@X&Q9 z5&a!%abES9&Y_8tq1dXPmwDXW@_H~;p+{-&;BuX;Uz(bs^L zseg)`Z|5%O^*M+gG3ZNXb;cwY6RmY8$L^(GNkXveP#P@QRPy`>Hdh}o-2jo!M7aZb zuVW2XR{EH|cIGw43L#kYz37OdF1&o$s{6^jFLh^pj34VNhyPrg=jT#!p-F%D$Q|8Y zA!x6Y5%|iB{Qspc!2hRZ5y0;m0zn>cFMr5?`#_hQ9~FO2n5CqD$?yMRiH6b;HY3q% zxzi9{ADPH$TfK}i*>c?WnjbX9Y{5Cde!IeR5G(_*TOArz1UEh%ff(z}L^)qo%u~l&wy^(8l?!y@dLDG8ovO>!}vf zSyZzw&v8?(i{37y5OL*U;2e8!{Od@A$?E1xHHx&i9))#keNHcX@E~VL@uh?=$n9aJ7 zC~vfb{1ge&S$DBoBl`PxMPFt$lO#ojX`}W$Cte7D)3DMSiB}ek^5B}MBO_j5Q~)l8 zHqP7a0+oYHJFm;TGOe&&V-*gc&n!<=Yjv92OX20LOl&;2jz5dzw~CsqweA-;V#E!m zR#Swv8CrzpB82rIgc?Ln6zqoQ27RwD_=X(pO{e`JR41^^#Enn7e5Wz%>t|wISQX=D zE9Jd4THiYxcoo)AWgP#9lIf|WO=0?+w6N%bgop@UhQtm1t4>gvW92<|1gIqGpFMMu z(%E`Sf?>1bvmi>5-yeAg=?Qh#$E8`O)90HlQybfpK*$Tr`hiB#8{!D74Or~NcTuto zkr|_Jt{dTnS_0^j_NrMV`M$_ok1p`ts|)abN=D!NJ2a*6>(cj}WMNY0;4@a>?3S+j z)v7nb+2~tscWRy{E)?u#j&8AqsrLHCR=Q{L3W~A0!lEF;qAo+iYqyVNbjlf9`S5kt zXiFA_T_&S%(E_HM7BtPW=k{|L!AlA#)$H=v>^%m{^`Ebi+J1*P4 zFB{dXW;2L`uxDCMWl3iVMg<1ZB*Tr=YQUketd#p3cR^sAez@Z9q6L6AN$Nc5ysK>0 zNe0u9T10!#tvA5*sU94Z_uq!4acfWYA@RfJ(sn-^u722|l0YXVgb3?&2$NpFxlp)7 zOZ7&d2qh7b0xheDHVjbx9e*@0@L2R`aOCnkvWn! zpWZU0FO|@IzvuHg3s33f=kMFyUvFFYOG=f7q0(*J)J{@DEEpLu(_&iyZ& zHWa^qHRfirF6*yU(?jKVWqi&dg{ORMKLd&Hx>GP87{{4Aw zU+*-RfuZ16$3AJJAJ?8gK0h=3|KAPMN|&#zJ$UMGJm1zkw{3NIR?l8tIQPi>LbDxv zZWmW-uPHhi^x7=EIlp$@3~QUOljP&~ZVmlYep;KIzy5WLo@HCglrRsBaYz4`QR+v(d6X-(JJnpZ3ue|(B`I&d6J?VRF$ zV0JY0_J79$oYp+H6UfQ^`!7?%4(PSm*%EDiqW{MycxzR_rA{vW>c z(vg!+-rM}=*!h}g#=>G9%*CIWRMz`Eliq*$v)i;3qsM#-Bh`VGIhf(1U-5>sd&2ZS#!O1E)p2 z)}E5(mqg$}f<~aT14q)id!reFqKxqUKCnUZ|Nn!fl7T=58z}WKGgzKkdq%7OKX9E1 O1B0ilpUXO@geCxp36Yrq literal 19206 zcmeIacTkggxIfCSyH?8D0Hv)9ic(cNA+Umoh=2_uH6l%F=mA1Nm!={hARsL)y#zuh zv;+kK={3|qq=ptkO-KUCeev8gx6Is`J9p+cbLX7%4XCi;GA9{@o{BT)(loxPHw)`73bc39Lhfi|Y?A{kwOb`KPZ>pZe$)U?sWFQBzTX zE=?8Bppj*P7i!9%{i2&?a^cbI=&Psy>i(B@zgkgU!RM9jhqE!q?g`4-D%i%lDg5#N z_+8L&Y0P&)De&Jy*(cwh$-d3|*Zor`Yw*aKQJszlqO~zX0FT zmyf-a-$P=Jf;_4jvp;L=^AU7*pQUfJ@%m$>u)Rhy&^(!DcTmRmnY zEns^iPmRI<=Rd;~R`n-gb)Q0}1_@JfBtutm$_tk-3P&PwF+GyWpSO#DN=wd7gY)Br zmLPEF#gy}jDF?!sFyyF#%m2~f9%-y;NeO7gRa@#;uGIP;-57cAo!8nr|I6#0ewE;P zmEd(-F&43b#K<7sxE%81MDUL?4zr9z$J0%)2c4M*ok86}tj)V1IM^GrNVQ^jc5--( ztKD{szK2+AGCGa%OhOqi*EfuaYuX^42j;KC^{<}jZ7uAT{&WUxXtr~khHX9^DSC>< zAP8t{C7W(Era_9d{WO#L%s)G$5hdB36D&UC&Gs+Wycqj6FWI`Gx_WoBl`qn}WM79+ zzprzQ%VLDL)`{yyw_N=~ycQ!t>&7;@KO&QQ--9tyy=+j2wv~l=5u4i{IxTN z`=`!t=o_pAw4+i|0?yr5=CT<3fT#L*fPUq&x_oIJM@3TO#Pv`tA~|BO($0GJhD(cm zO@W~OB<36h-4Vhjhu~LE_8h3J96)G6-IaOk^^bXbvFqILGv@Pz^q#m;L5Jbt;RiP_ zM_PSobk9W0*f2_+$&C4z^PR`+ci20)Ce9(X-F{K_ohrqZ?{iIz4QvW zX^$Y+NY%>7kL8;zJ4>cnPvON^Se7-h<*#nUN;N-V-yB<}=3+K|<0GzsDZjpV>#zn#b$jnN0T+tFBju6>^Y+QJz(|>bYHr8Tbl8e9El`n!1*&42vjJ05!#2?|8hd} zW2V>HcRQyo@Hy0jK5CD2G-HJvy8~T};`(D0GSv<06bs_eLqbTRAuMbNh@{J&JTT^N zyR&q4~26`>0Sj4L|pS~s~Fp3UJ>m( zcu@7s=ZR(O!Hf5NZW!TL1MH@n*xW5h8f}F$z;`&{sKuJdCeO*b3)|pHC&Yqo@{J=4 zCV(Nhiy=^j3D&Mg_ObBx$0752fW8N)%)w#6>3R)%E#R+JoC zz~Qu+XH6_9qYGla^&S$&7L(?xE&OS@(Xb#};CU*Y3VVP<`+Mwf&N}-vu{Iiapy4~D ztQ}I|PC@uKal81 zQZnZ+>u-s3GNP@I0JGRXP}~{55wCxRfOGTAEw z(0|>p%Uexsr;at{Yh)Y{cOE`*$f`X!3Bxm%G%x~@agOCp*tx$Jw&A7A1sWetjY+}e zV}hPC&MuA30tO26h)0!DyRyP`JGS#ktwE#9sXA zx_Xyc^IGirUtY^aOFSCUi1IR>v7ULG#yOoP5XCF3`Y2eXMDqP#TnibWbj!0#AcrRS zr=(s?2G*>W>L6o{g2+V0B?LJ19Shi!_GL>4vq5l_5%zX=<=abQ%z;SlJT4Sx4yASd zo;Z2Cn&YiS_g5KZ3LX~T_WHd8;uXm3zf_He7ajfblA3_zzy1EnoCz(~6bhZ1p zC+XVrw3P$-GZ|yWbrG5S-z49+eikOb7nf04E@_4Mit1+_)^~~R;?fvXarCF3qIOi! zlQ!bzi^hDS8v7~zLHQa#=8lbymoVWeK~%>4L9|QH#%KWD)l-5IuxPOaVwRGar33OI zZtRp!Ej7X~?QLu0JE;BVTQZ1=DFzP>JSW?gHUAW#*3K* zytA%x-#(J!AaCu{UtX6MU3+tYokDEX7Zj>4X5Hd|Yf6qMcWE1na$#_^$!*ANWdiJQ z6xJL1HNPz#?`(25<#KZo*84@p1Y%|fs#^#X^d6@VJs<$7HSE zW{c^P{eh*c1720x`{`mP?8lvSlY_@OJ5*i( zHBwDT&_e>0hpYP8F=O_=WAKt=OFLJ$*NFZ6RR)bwRvw_-oujSfbiww{&dE54FEf~c zSw)*B{&J1f*3Vw=PdZ^1q!KG9#`vzco%Hg$!!41q-x6YT9|y>}AOpw&h{s$oVT;BQ zGh(3`Zr&%VcuR?7JEK4Ngm^7AGVIhlu-4LC^vSgfN(^Y@x|f#{x(SG&-JyZj0c(w> z1ni5b1UkRoXL>s1l_YE;Kq89_SnRY6KCxLKpq-TmW#+YS35X>gJdHb1JQpp8(cfYm z9FVo3(~lWh6yX9Zwqe1}j;W~rt)X>S@+Y}apEy`6v(lQOl;V+kUK4@@6ieHe)p{hP z)mQ(ll8Y-ywb==)$X_UDe?w}S+SqPLce@;OEk1I7SlqTemrc(2bM8Aq92O~)Q)~Y4 z&H2F7&?EcWCb^RseQ^G&rG<(7eM1#vr2wq}KKe8q%4V&Zy3ejz#9igofM6kO7NpdI zsMwH$d7Jt6F(7_PYkk*fXktxM*&_{n!JDCsvZYM4v8QFm?!GK6pu6mFvdplsZ_jWj z!LhGDm{!&Hur?F@kVVA4c1D?O|2BlWUS}M<`O_v9q}0n$MqBqDqB5kLRRdnj9QP%U zX@rfHT2m&iB$0tl}E3bgjv+qlyqNW0Wy+^=SyrF@!eiYjdczcuJ*+U*#CA z;Zp3^{LrLKMRI?fMzC&$3df*Vpn1Q|u;aF?%VYM}U;hm3{iVNoOQ?A(LZ#^n0HMFo z02JDLl*4ev-THCqC~r|JsFzCO2QIvJ1N6w`XUbx!w=287Rf?UtEM+$Fe}nf=jj`Rs z$A>KeME-}`F%)xB~F>ee}YzBXclVg^rUk}TeH@w=s;sDs2;=(Nyw#L zjCU|Nw;e*(u5$}mX^V;i^!!D^IV3hgsAbM-c44pcNm8!Mnqc@#rJTLQ=%KwbPnLgu zjw7a|$t(EC($=44Q~l!dt{^OEUligQHYeu?`&?p&+qwJKDEc*rDc#b|yUUMZ%78!= z^mV3MEd|-~v(o)1cb?8S23SC|nx<70Cku4EhPzfdfeQ<72sS{c<2H9mZa-c;5BA>P zJQM%4N?(~g&9+CIP0RJmL8my-E4xL`~;h_wf$-ho(BUrrjd)Q;ik=FwXpd zd-JQ$(~afZdqult!!>6A9s|V7`zI4MCa0g&Y~!)L@wJoS3U16_Q`zQMQ%36%OB9Yr zcFkA&2a$(X52Mh0JVRxMNBqc_7@$?NL(8Ups4Yq1@cT^{@_68Yn?`B-4+jbBwS~O` zNRsxp7|l@r#sTmQL9dq)?7;aR@v=%g!8RW5kf8!FcJ&d7%7@w@oL9Y?P$Q2A_f=wy{`m}KB=RBU|;}u zw_n6W#X7XEp2;`1)~YENeJJfaJ-NI%m$_=#Y|m=Xz@1gU5VWWOFP9kD=Lc?xKkbwNh?dziXsGzq^=U3P)oN7Y}zlkJqNl+RrTcn!jKnx0c0duFftSnr~llA1zTy(c{zZ;xmgY|TYA z+uTBWNU3Q&S6j*lIJ7_IvZ(>H8`B-o8qQ$-R}a+^J}c2{)AlpB=aeBDlm6*fkt%c= z7}Yt1AP*1g?@!~T0Ym)ruWag5s*s;pGn_QoU634MCOtQLtiH4k!|BeJ=pb%53=j`0>tw+e3^BjG1!5PXtE85Ip2 z@_NOO(5w18a>>EWYwrOwo3Zfb4o#)X`Dld_cS!}0YC$41IO_PY1G!+>74U^h8+|-N zvQFT0kao4PYn7*KECLcd|8?sNRKkm?R!5pZ@we;fJv{=BrsRaZyl`OlwQ7U(qIkor z6K)72O?dyiW5d#G=>7Z}-*;WYLd9{aBVI5!L2p4ryNl*d^@smnhFeg)&AjFxY&V6k zG=H`-{{slouPMg6NauxmdY9E1l5gj+6UU{|X6kbNrsOiINEHFXv<)uFf-IU#7MliU1F_srfQ4rB04X04(KAlh0r6H>vK zJ#R;A#EMSqOMh?j_k{uXG9o?AWMfIBY|WyGD_P}~$~{%=*q)UOU(L1`?$D%w<}f=# zhNo--NMyYIE=h7qSHYm42w!DR@1UbSzvpxoYImqEyo@iV-PUdUxFl2h(4vN2{CL37 zrAkFI@lt90Bd4+$KlfT_qlWjZfTgcRg!#~)juHiQMtG>+suFcf9U_16k&z?ec`^LcdmY?MOZnN+zdQ>K|1m-8iw8@J#Ob+!x!$VA5887v^m$fJFuWm_R1o}a%;1cWqk4c4fwM_mx|h;RNAx9 z1P62X64wipXE?MPV^M}iu^_ZrgVk>o&bO`=)MW@L?-xIDrsk>9Q3{T}tye};(Gs-F ziHD7vH)9dYUayW1-uv57iZDHJ(Y~q=H9TsdP8XC?Im|bz+^pIstc2$^`2dl(-0&@)Y$~cF|Jf{fI;%`9-O5~OHQjAt=&!f6 z)E1Fa$g}1#Yy$>H{(E_8{y{$>XbMh(c{;)nv28I@Q`GJus(LVk#TRtA*7-7j6YyZJ z=d-Exz7rd5W5P_PJ%WEHy)Lz;yF77jRkb948a|sJ{lolV_!6?wTC`XJQbYUfOZylx zifle%>WDx5X5ZXMjVtSUz5zV4anZXZ@8$R49lE9OzS9XK@;lGZdo%YM_5FIK?kKu6 zHF*cjJVFpfY9-gNuDts?51uKnCWjY5syr6ZKW$0`SXvixq$}%;vDQxfc{3#s2k=>y zGr03IFwu9CO+hW9SU-vBI8~gzCr9V0f!=Y0f)i-KJN!7f#zaX&C}|-~T}ekr(@3*P zg^BHaX`zd;tqzH^)r{@iu8!xAYhkBab7_Hpl9Ysn%_r$!cIU{)C68ba!*CZY>1SL< z4C?GGfORZ*+OQ8g=SsWa~gaQQm&b@{`B_kHxM=%PH@Q3D&#m zKG8weX?N7!Y9a?QdY;&`S;KwHX&hD)Bg!#yn6vUD`Dj`J4|kDsxb4xhY5&fm*}~wo zm>k$%K56yuxkpeGHelXey|~LL6-CoAMPjsu~4Cvlne8)7uE1Jk(NvyLIy$j;TCE+8~)gwbLa0}}9;UHj(;ibdg9r}|hQ z({d`uVzZvxI?X?V+dl<*YCi0_${`VR(E3MdPoGvc_53x%%0ut&e%#Xca75CMqzn3z zQiP(T6Z+HS`)|>2r>^%$V4kP>>JmF+K~W9SV1B(Ppzxc)mN)KDd;O+8mxdw>`ZY9s z?;T<4J{_RHt7&Ow^{kaxOV1afBuaH$y6uCM7O9CGeW{J~mQTJ?FF)+inR_vI zG{5R}?;n~0v6ORLOi1e0#23Kc_-_4p^P)cbOGgLwYRUsB+=bnPlM% z^MiF_t6u)n5qx9Z-9`Sous2fx^_l5kEAI%~k%cwwt^7i1Zj;+qAXYHw-BY+f->3(@=ZP4a}3wGf3a+Y9-Yq zr#Dar27R27={v8Ud4r@QJSR)!IvZ;zA6*h3e(*=B5jfGk#NdMZaZw0j&3awsL#yAD zY1>yxF$rC95>}pAGiMCtR_}3mIzCYC61xo*a=Bpz*kn_My~W3lg|m_{_}!kbXZWig zefZ0$BX8RLn;T#7%=N+;d`+A(`izLuZAaVCx!~yyR1|e|N`+GY8CU;&ADe`3eKmiu z-gPnFIdOJytjB}d&=wkNl))HUpFNUt@E=IAWQk7qdfIsJm}s~6T6w)F?1^+k(y*R= zDJxi~|BuB=jVb?GRksM{biLC~#7wSri<_v$r04zV$cC-r%6OvYaI}CmK4^9?YKKl$ zkN=5c$tMQso&oIASfW>JMasmi^XU7=-mDfYowwbPtBV%~Y=p(T)jfP4`4m=1_F06l zEfOEqC#sCVj`Qx#P7sn+=yiir{%tukVBX3iA%1x)RkefpL+DR=|1wCgK+p^$VQN0E zB>dvmr#^jizObxju&c(5;AQZGG$$Z>Rz^BMbKliKVb!WTuEgfJHfW;id&s5rsU49S zBRa7DljJ_9OgcB&-MY@}iq&B^jt(S#uM1L_S!blu^gj($7Ny30|al`*@7Bvcv6o;Bg%VqK+I|rTX1~G?8sZ8q_U|KU49gE9DDNo zn6Q+^Qv*Wno20ER2l+*9eQ6klLn)SEPT@uDozG1OPfGQc}C*aCYo)xYkEEMxA@9RIdG5r{Bpnyt($)FEKSbm^r%o1T)#iAH@z&_LrQ42QzZ^OG?0J@Q605C) zy1&3~#)oXU9EFu4AoB`$!GO0uIEtcDEJPd#KsVrf`67!%jMGPH`>FOPIH#&Qb8d+~ z<@aAQz9NJljoFuWX6h{0+0@xecsD$z@`$`^c$_Lq7rwTup+NL)Z6QRhY>&ag!bj5a z$)=iG`M;Q5T{E`!YDde;)hvT1JQ1)B=zgx16WN-vqR+;|mY9kQKTAVNaSZr`ka z-;kv=;RU*AT%77oQ>`9l@gyFk__&cWk}MX9rR!icd2{kLWdJE>_DXiUx_0q*v;fh6 zX&|U!Kh_(13Yf0(UxRRO0V}_y33>nhA8lt^UuqUR`>KpYq4kZUu}#0zOLAc5X)|g? zIy8qX%H&ezl!Ok8_o4d0;Vf}y$Pte`X zxZdg4iD%+UGYV??QR#_?*s&{*yOr(uA-0d~_r%&qm*qL&(s~)Dw@?Aq6Bi_q1 z1~uTdA_Wy1kW{LdW^6OjetdM?{xVJsx7=EAq96~*%6@cSVH(AgXF%5MJu3uc+avj6 zm3nNbi=gBe&+Ug}P{<`%dUK`ixg|S|Xm4>3hv@k2d!D|s*0m?jVQJ5oDBB+^nSYX< z?_+3>q8bx(oT<0WVEV%jgN=b_i^)$Y9)~3bl@n9O8XN@{=b&d~1rU?R#ydPN-@%m6 zI$&wLAmjdVo9CaNcSvuzmxzwYkRwcs*JY~nOMTyIFK!SYNoSi5`!*u0JF3lmdeytD zY=U~`&vx5fc#w8tLVY9`S!j}@Y*&7#i@V61f8Y*-oY z1b^mU{E37W*UxU>S}I4((9X5u?hWCdZGiFARUk)aba7w_u*z1F$!K*W4s;GaohfXd zA#hfuTHC88UfBHVS_~^V!A{k8t%xj_yA!(}c=Lbn8ygDAz%w=?>DHC1u00RThiqw&QOXI%DJ6rKvUoLv? z@-+e5#>px+Mw@ezoZFmP9gOx)8hMJ8mQn$o+QSS*C1cE0tIAVLgi`{pAI(@H8#cVV z-eqsB6|fRrP^s8iNyAlw34=7*Iy0AUXVacqOSmlb_GOr5KtPacO%TB6@46jbahuf_|X&3zB9N-leshvo_gE0(*AH{UN@rnaXr3c zDQpPYTFN?Zl$>C$6q9Ry9F}qaDx}{I!6yeWl5?$meZigPdVoo&{ly&Z*|4bJ=xaTJ z0a-!YRD8m)0G05U=PSr-0LBc>tk#R4gLF6By!@M|=00)UcGP#weg4kqZV0R%MLsEa8q7-eSZF`H1@hEwW7l8^CwrK;ip#n26RMh3 ze{1W#&&G}r`KI|zco40HPoAgmw~u;Mf3@!2HQzVJkIuK2k~ z+Wn>I=N7UJMxV!|e3IOxZ+Q{DF9+s$)$e=c)tOIM`V&!M^@!NgU%iwj9IQG%N~A4N zX8!Wqnk+h#RMxODk^!CGN%>to6JRQUafITFW>E&on4qt5UoB0$aaUH%e<|EI0?9?h z{Hf0S#!2=!2djy)37s4=^Rhv-XWJDwd@*-}J~(@9QV0BRM3<-z%tN*>4_xFsq@Fxr z@(`2ZaQLZe#X!Ja?bhMugNEvOxt}X~yDYTCD`&<2M;w89{=E{&X&d7$h8|bD9v{pG z?>0${obwum8e?MY-0A5Oz1(U{Eb_dUAkszg9O#*mf+Anz&Q_TBDS}c`F*FfX)u+Yp zqk+1#(df!f2_Vq-d&Z6une%o9dL*k8Npb-jTisL*^`6VOWTx$2yT@(Z3-#@OmNL4* zqHrTba>83xoeBtM`P%)WXqD0Y`ND|<(?SuuS3J6X4ccC0GvkvOdrowhpWaE526HKv zPew!?9O8N-BQsO|C!jeAQfC@b%<6X;dSwmtK|(GXWrh$A%r;-<^_>X2(&Z%El?1*} zRKwj$K%vjeC%>s3bSsS9boMcp!tR?^`Rr^E2ZSDU82nan7;^GejaEL8lOftt$c|SI zS7(gn_>7J~UWc2W9w{o*`yieyX6#TYGgVkgyGLA|uLfQBlS>zpGT6RmRYRGyb^1hyD-5qGaS z-O~Fy*)I&ckq2KRx%DWSEPWYVz2ig$S0hhVnHOgapp@?2fQ(5$Xf&qWN(yLQeyvlv z=zWQLt8ez9Ja{`w{V8Hn~G}^7?H&uhypw9qN8x4xqDaFOvHqN_$_DNK34$P9r z6ig7mhEMSy*W;tIqY}TS08-riyk4@L)>pdGxHw`@2gk3A@>bD)Og+dpXc!f9zKg%- zb!KlW6tv?u)JMp=^g$Z1-kq>U?*!%%|2laqvscvR#HG~7e%b_;wF%qhcZXR8f2JEk z1DPnsik{I`=;i#VBT%|d`FA;uyK+LBUyhxxH++bmxY^rYFFhjeE=VGQ-p3{0$Y71G zucXb?r%F}ftA$fmy3~@U4}0FO zqpgxBRun}xz&APRd0z*^cfSIw@}T({?e^x&S8XGv< zI=bX{TBNfIsRKLfi4KiKxAo_iT~GD-ZOLwXe&EA5GsKro2Qc81V2BP&Q!9vg5npRx z{NMsXM3?F_q7UGF&u&lO*c`ajM6<_KrxoX80W|ywPTd;6HK=k50R#K4z%@RZjK#{X zrR&#YU`p!wBER@*sF)P~KA2muX+f#?UO2*2RyjopG||S|qQ%vLb&n_C+%gQ7*VQQ3 zXHDsX*TPn-gJW!h;#?rMIk*x*SbBG22Q=BPk(bK&HhI?`Sf-3L38byQ1-N#<+~>HEeyxrBMY!k5$V&t{^SS)v+;@gI43sfVFQqE+_0 zyE_dZt2l&<30an_3oBJah!d}17mT9bruh=g6Hv4glSdS}$Oz9=S-v7}0tGcCePxeE zr2B)PJFF}R38@_V-J7UVPu}+QZGu1X8@jA&wO-+GGvp7|&if5KGykG4gxccPz0!HU zQR^q+EW=)ITx($9;G&s$cN^7{y;IPH=xql*iK$mkGVQ|{lJbL$8d~;M%KPwA*@Qk? zHT-I>d4K8KsjWIZk}8@YIcKT8%sU$%9o)4*x_$;SrYNVtVWRUP7-Hilv8_mt-w}W0 zifgZJET>(qYQ@1t(&{}mdmLIzDm>iBm^y6_4J>Z#_!0X66&cwu`(y!r*1@Fh2{RkJ zTKJ3cj?EpCG|Tt@_}NnOw%}uBL5$~h)__L8g zxYX1kPY2oB<<>4534f9o1^02sAm~k8Y_+v9vAnx2bRP@I6;~6BPpLl^e(Tvs!jT z3miEwWe)+b<$7&q83azRw_*QC6T1)RfpjBGJ5ESTLwQ#z`JqxND^uFezQYxqL@Q#c^wi9YRW5JHpxV&p&z#Gj{oI8RMYV& z#l5(~&^C6y+-f3t+q#%MggKt<{WP+g-xE|YcDnS++%);NXY9N;_aS2aLAR6im*l*q zJ&0A%E=yEx|4ftu^knBztl5oHU>aHB>d5$38+ej^;&UZTK*Sa$r{^PqH*tMKa8 z-WcDAAx}OFXXAU1{XT!_coDnpw>)0i@C;UkQ#cN%R9Gq(UA~KMqdaa?b*shF$5lE^ z)GX_XwiWg@{L>X3%sjcZb^;pWCPuM$?@vKQbRJaRC<6lPyO$sEPg{#z`2D7Ry*@{b ze)_(qCRHRL(M`jr8R>t>2pJ-DwKrIe)IKaVQ3bn7t(tF$Aq zd^L5C(lAa$&1BDSZcXw?$c+(Wg$%PMx4%nN2(t~=~ zvafiu^4KNkbZyArJc&#jNZ06J5wg%^GJW=7^a`G_Ty_B{Qw; z|KtL6NneMT;JEeikt$iZ+cr`a-Fb93EICdsgfkiB%Cnz!jCo-c&vLIG6d`Z{l0vyrBt#xpjqehziUvpI2FrD}i|Uk;+ZFqei$n*6{exl| z3O+D_{l}vakTQ&K9_+w6-rfH>C1h}JgLK9Qe{c=h+k7j*%)f&3@Ld9l>0>OqBKBq* z30xB*cXebR_!8l%F|@~}4`UEUX$peLlq)MMYR_uPBa(a4*-42j@+Eu- z>!Sh@p_gy*onI5{GdWLG>ogutGL+qpk39Nt)t&U}^5w_HGc#}PvK;5;9`u`mnWj~{ zxhQF!4A3M} z>PQdMu_h{v2Z`uWFAKPwl!-zGI3>wA40DdkDr(`o85V|_zSoe9Emz~wil9EzdDHP# zn%SD)a69f>*6qP(rhJ(-e_l2hPggnqcXV2Eh~-#oFlp7|mMS{8<6eI+!c#|q6tncnd5`!Uj=gM}VCq{P z$TcwvXzR4C-ZLW?gezUcW^1AJ*>oCZW&ik(_BJujl^=6my9KPZN##_Gos%(Qxxu97?3o0=e4gHN2r|Go zc0RPsc$k0*i7>rd&;JNrKz#qT7d^(#`Erj>e@s-z@g!d_E=-p66%@#57wt}K0AZ{b zBUYO>(`4*JbH0{4{#>#BZm%EDFcqoFTAH6Iw;pokzVE&?6rC5?ZSPvu_Xu($yEfFm z23HaI$k#KcT{PhlEK{{;d;h}Fk|>%o-@0b*ry8~;_G|kZA7M(T|N3&Sm*ABTP(k(n ziol+%8546DUky%C)R98J>eDQLWkr>pyOvPC*c z$!UFbs#?g#-{+%K75VY)him8)dA)T)@iSoMgb-VQ_Fdaf=EbA(n zR*_XgNv%F$v1`#cl9kUn=^;QFe&G%6%OqM)r~c#z>&3dc0fO~fJ^GQEbP7hxtt9VL z^?P*N6?-Rux_61qx)iG8c%9O4JFBK6hQ_2N5k+k-bA1E6uzrtJXu1<`mLgWX9H{__<@?l`6Jh7jRg4`OP4wylXZ99!ZshRNu&wFL86f}Zt8s% z753^*u@)NfopE(lu2Xf*a0Bu=Wl;I3NE?6z)V#;{k)4$(9!rEPV71RI5B0sj0onU~ zrT`%*2^=ltwUUX!3nm){_+2 zdWCl&WiT$RFSKU~dTGd3f1B0$NKK)o zejjiGBo)Ek`{&rW?aBFVCvTQdQ-@zsec-$cODg;nz&gM5Kt4g|3RA7DIlwI%>xrML zwWri2TqEx4@&mrC$4fkk;D{w((K06@@(_}YO4B3xZ0`BEwUCcY;}0^D09UsNoE`+u zMhHb;l}ipT<&83wq9@0UiAfc34Abru!iBv~QoLT8>c3i?&nBA}sZmz4!1B)^EdM({ ze5#r5%iM(&+CYzgPEmnQhngvb8rNfnF6gj>YA}f;!AN`kEe=!z z-+Sl>{S)oju5H-7I)qkN?GL-pza+Phy>cBm-}lAH6R$^Nhz0p?O~vrRO*RTdO-(GE&9_!^i|`&iWq*1!6u z9u}+1?3NP93Y4IXPkfd}tG!fni-#V^i#(3N$;;5QNWjG%r?c~9ocO;XUa72fs6;;%4DP7i#)XpAH+IG0_aG!ufi#$|2%#CRlih)N7Pdjtq8C(f;SO0yhXZj znQEXgm)}dzo4;y9GyzG)=EL2a<*fu1R+thW5Y|(}Hyf{8G^waDmN$^iK*sr6^8n2e7f}`Q=P6%~Qrz_UKF1MN)fnPQ-q`$`Ob2?;scdZqGC z#x26?*^pN}!*1MoO3Xi5;!=^hF438z*y1WhH?W6kH%cFJ+Kqb4)${{Tr^6ME=>^N; zH%+*XRn`-vo_f>_rTNURF7Xt#`&DcfIbp!pdE%LJ)7hpv{$?QM;Y#ng3r#Jq$7bDcBHYxlu>}loC+z=P-tA8K z@jIutM~HOEfxZ|E;cW0F&+Ij9TPSF4riEHqS8jK3#jn3jG2qoe5-OGcJTCl1XezAU8>Yn0wjxErL{#%;`n+w&-?nmvEXM zQDXzcCQwV<4jegf(cIx~6e@DHGvg?{*d5n^>3eOaYCKA_YcRbrFR$n`H7^EQ_!74Bqj{YXk)xcFl?3DJ*9kR9(D zcUS~?(-#)NX+v#K1&Vpl;kbPMsc$5peBgA{(fb16cuh->wy@}(x1eT}m&%G=zpgIA zdb+oDbCq;xahp`m&jla$Q-xLITc9(>s$5bj~so^YjSCq z_~MVzWZ6R&^|^nC+XMz|6L3p7RbRi}&qG5GNg!VN0Lp*&|KlS5bqrdk|58|1PVyW0Oi6=cT7 z(HA%lfD$PBF_#3wCy*`{w9aFcmd?c3!i%nFsMSMW8lpfwM&T@v@fuQmW)-x3+C6dR9O)r8iSJXdYf> z=$05V&8(c&fqt*rUHCb-+jOS8zV%D1(>6=dRGDjjQpuYl@_CJ#Gpd}_@&*`GvaPwT zduNU^RL1%4JZ9LEW3>H#i^C|(ZzfMGXzg>ty5_z(5>5eI5HayTtNRbyqjQc! z)w?@oK#yE!&;Bes`hR}8g6~}twzNqO`03v=@j8*bfbnp>P5uQq2JzqJl?(sNeC&Ub z+Nz@n{9pHl8~^k4{|8_Fw|(2p|0w_eDF6Qtm7jf7kjmj4cd(2C{yBaGOOJ6iET6F5 U&z~y=u5jt=8r{Wczxd~W1M0-fga7~l diff --git a/test/integration/visual/result-view.spec.ts b/test/integration/visual/result-view.spec.ts index 1f5b18d..6abbd06 100644 --- a/test/integration/visual/result-view.spec.ts +++ b/test/integration/visual/result-view.spec.ts @@ -1,5 +1,5 @@ import { test, expect } from "../helpers/spector-fixture"; -import { loadCapturedFrame } from "../helpers/capture-helper"; +import { loadCapturedFrame, loadTwoCapturesForCompare } from "../helpers/capture-helper"; test.describe("ResultView — Commands Tab", () => { test("commands tab 3-panel layout", async ({ spectorPage }) => { @@ -87,7 +87,7 @@ test.describe("ResultView — Menu Bar", () => { test("switch to Captures tab", async ({ spectorPage }) => { const { page } = spectorPage; await spectorPage.injectStabilizationCSS(); - await loadCapturedFrame(page); + await loadTwoCapturesForCompare(page); await page.waitForTimeout(200); await page.locator('[commandName="onCapturesClicked"]').click(); diff --git a/test/unit/backend/spies/workerSpy.test.ts b/test/unit/backend/spies/workerSpy.test.ts index ddcc7e1..0d09933 100644 --- a/test/unit/backend/spies/workerSpy.test.ts +++ b/test/unit/backend/spies/workerSpy.test.ts @@ -7,7 +7,7 @@ describe("WorkerSpy", () => { beforeEach(() => { // Create a minimal Worker stub on globalThis so typeof Worker !== "undefined" - OriginalWorkerStub = function MockWorker() { /* noop */ }; + OriginalWorkerStub = jest.fn(function MockWorker() { /* noop */ }); OriginalWorkerStub.prototype = {}; (globalThis as any).Worker = OriginalWorkerStub; @@ -136,4 +136,33 @@ describe("WorkerSpy", () => { ); }); }); + + describe("shouldInjectSource (best-effort bypass)", () => { + const shouldInjectSource = (WorkerSpy as any).shouldInjectSource.bind(WorkerSpy) as + (source: string) => boolean; + + it("allows simple classic Worker scripts", () => { + expect(shouldInjectSource('self.onmessage = function() { postMessage("ok"); };')).toBe(true); + }); + + it("rejects dynamic imports", () => { + expect(shouldInjectSource('import("./dep.js").then(function(dep) { postMessage(dep); });')).toBe(false); + expect(shouldInjectSource('import /* webpackIgnore: true */ ("./dep.js");')).toBe(false); + }); + + it("rejects nested Worker construction", () => { + expect(shouldInjectSource('new Worker("./child.js", { type: "module" });')).toBe(false); + expect(shouldInjectSource('new self.SharedWorker("./child.js");')).toBe(false); + }); + }); + + it("passes module Workers to the native constructor unchanged", () => { + const scriptUrl = new URL("https://example.com/worker.js"); + const options: WorkerOptions = { type: "module", name: "module-worker" }; + + WorkerSpy.startIntercepting("spector.worker.bundle.js"); + new (globalThis as any).Worker(scriptUrl, options); + + expect(OriginalWorkerStub).toHaveBeenCalledWith(scriptUrl, options); + }); }); diff --git a/test/unit/extensions/moduleWorkerInjector.test.ts b/test/unit/extensions/moduleWorkerInjector.test.ts index 3855861..11121f5 100644 --- a/test/unit/extensions/moduleWorkerInjector.test.ts +++ b/test/unit/extensions/moduleWorkerInjector.test.ts @@ -115,4 +115,22 @@ describe("SpectorModuleInjector", () => { expect(result).toBe(`import { x } from "https://example.com/app/foo.js";`); }); }); + + describe("canSafelyInject", () => { + it("allows a module entry point with static relative imports", () => { + expect(injector.canSafelyInject(`import init from "./scene.js";`)).toBe(true); + }); + + it("allows import.meta URL dependencies loaded from the original module URL", () => { + expect(injector.canSafelyInject( + `const url = new URL("./asset.bin", import.meta.url);`, + )).toBe(true); + }); + + it("rejects nested Worker construction", () => { + expect(injector.canSafelyInject( + `new Worker(new URL("./child.js", import.meta.url), { type: "module" });`, + )).toBe(false); + }); + }); }); diff --git a/test/unit/extensions/workerAutoInject.test.ts b/test/unit/extensions/workerAutoInject.test.ts new file mode 100644 index 0000000..40abcc6 --- /dev/null +++ b/test/unit/extensions/workerAutoInject.test.ts @@ -0,0 +1,318 @@ +import { readFileSync } from "fs"; +import { join } from "path"; +import { createContext, runInContext } from "vm"; + +const extensionRoot = join(__dirname, "..", "..", "..", "extensions"); +const settingKey = "SPECTOR_WORKERAUTOINJECT"; + +function createStorage(initial: { [key: string]: string } = {}) { + const values = new Map(Object.entries(initial)); + return { + getItem: jest.fn((key: string) => values.get(key) ?? null), + setItem: jest.fn((key: string, value: string) => values.set(key, String(value))), + }; +} + +function createBrowser() { + return { + tabs: { + query: jest.fn((_query, callback) => callback([{ id: 7 }])), + sendMessage: jest.fn(), + }, + runtime: { + getURL: jest.fn((name) => "https://extension.test/" + name), + sendMessage: jest.fn((_message, callback) => callback?.({ frameId: "extension" })), + onMessage: { addListener: jest.fn() }, + onStartup: { addListener: jest.fn() }, + }, + action: { onClicked: { addListener: jest.fn() } }, + storage: { local: { get: jest.fn(), set: jest.fn(), remove: jest.fn() } }, + }; +} + +function createWorld(storage = createStorage()) { + const testURL: any = class extends URL {}; + testURL.createObjectURL = jest.fn(); + testURL.revokeObjectURL = jest.fn(); + const nativeWorker = jest.fn(function() { + this.addEventListener = jest.fn(); + }); + const nativeGetContext = jest.fn(); + const world: any = { + document: document.implementation.createHTMLDocument(), + sessionStorage: storage, + Worker: nativeWorker, + HTMLCanvasElement: function() { /* isolated prototype */ }, + OffscreenCanvas: function() { /* isolated prototype */ }, + XMLHttpRequest: jest.fn(), + URL: testURL, + location: { href: "https://page.test/index.html", reload: jest.fn() }, + CustomEvent, + console, + setTimeout: jest.fn(), + setInterval: jest.fn(), + addEventListener: jest.fn(), + spectorBundleHook: function() { /* no library execution needed here */ }, + browser: createBrowser(), + }; + world.HTMLCanvasElement.prototype.getContext = nativeGetContext; + world.OffscreenCanvas.prototype.getContext = jest.fn(); + world.window = world; + world.chrome = world.browser; + return createContext(world); +} + +function loadScript(world: any, file: string) { + runInContext(readFileSync(join(extensionRoot, file), "utf8"), world, { filename: file }); +} + +function loadPopup() { + const world = createWorld(); + world.document.documentElement.innerHTML = readFileSync(join(extensionRoot, "popup.html"), "utf8"); + const event = { add: jest.fn() }; + world.SPECTOR = { + EmbeddedFrontend: { + CaptureMenu: function() { + return { + onPlayRequested: event, + onPlayNextFrameRequested: event, + onPauseRequested: event, + onCaptureRequested: event, + display: jest.fn(), + updateCanvasesListInformation: jest.fn(), + }; + }, + }, + }; + loadScript(world, "popup.js"); + world.addEventListener.mock.calls[0][1].call(world); + return world; +} + +// Exercise the real canvas-report -> background -> popup path, not just the +// checkbox setter, including top-frame selection in a tab with other origins. +function refreshPopup(proxy: any, popup: any) { + const background = createWorld(); + loadScript(background, "background.js"); + const receive = background.browser.runtime.onMessage.addListener.mock.calls[0][0]; + proxy.document.dispatchEvent(new CustomEvent("SpectorOnCanvasListEvent", { + detail: { canvasList: [] }, + })); + const report = proxy.browser.runtime.sendMessage.mock.calls.at(-1)[0]; + receive(report, { id: "extension", frameId: 0, tab: { id: 7 } }, jest.fn()); + receive({ canvases: [], workerAutoInject: !report.workerAutoInject }, + { id: "extension", frameId: 2, tab: { id: 7 } }, jest.fn()); + background.refreshCanvases(); + const update = background.browser.runtime.sendMessage.mock.calls.at(-1)[0]; + const receivePopup = popup.browser.runtime.onMessage.addListener.mock.calls[0][0]; + receivePopup(update, { id: "extension" }, jest.fn()); + return report; +} + +describe("Extension Worker auto-injection opt-in", () => { + it.each([undefined, "false", "TRUE", "1"])("does not even read Worker for setting %s", (value) => { + const storage = createStorage({ + SPECTOR_LOADED: "true", + SPECTOR_CAPTUREOFFSCREEN: "true", + ...(value === undefined ? {} : { [settingKey]: value }), + }); + const world = createWorld(storage); + const nativeWorker = world.Worker; + const nativeGetContext = world.HTMLCanvasElement.prototype.getContext; + const get = jest.fn(() => nativeWorker); + const set = jest.fn(); + Object.defineProperty(world, "Worker", { configurable: true, get, set }); + + loadScript(world, "contentScript.js"); + + expect(get).not.toHaveBeenCalled(); + expect(set).not.toHaveBeenCalled(); + expect(world.Worker).toBe(nativeWorker); + expect(world.XMLHttpRequest).not.toHaveBeenCalled(); + expect(world.URL.createObjectURL).not.toHaveBeenCalled(); + expect(world.__SPECTOR_Workers).toBeUndefined(); + // Main-thread capture hooks are still installed with Workers disabled. + expect(world.HTMLCanvasElement.prototype.getContext).not.toBe(nativeGetContext); + }); + + it("installs interception only for the explicit true value", () => { + const world = createWorld(createStorage({ [settingKey]: "true" })); + const nativeWorker = world.Worker; + + loadScript(world, "contentScript.js"); + + expect(world.Worker).not.toBe(nativeWorker); + expect(world.Worker.prototype).toBe(nativeWorker.prototype); + expect(world.__SPECTOR_Workers).toEqual([]); + }); + + it("passes module URLs and options through when the module injector is unavailable", () => { + const world = createWorld(createStorage({ [settingKey]: "true" })); + const nativeWorker = world.Worker; + const scriptURL = { toString: jest.fn(() => { throw new Error("extra coercion"); }) }; + const options = { type: "module" }; + loadScript(world, "contentScript.js"); + + new world.Worker(scriptURL, options); + + expect(nativeWorker).toHaveBeenCalledWith(scriptURL, options); + expect(scriptURL.toString).not.toHaveBeenCalled(); + expect(world.XMLHttpRequest).not.toHaveBeenCalled(); + expect(world.__SPECTOR_Workers[0].injected).toBe(false); + }); + + it("uses the module injector after explicit opt-in", () => { + const world = createWorld(createStorage({ [settingKey]: "true" })); + const nativeWorker = world.Worker; + const injectedWorker = { + addEventListener: jest.fn(), + }; + world.__SPECTOR_ModuleInjector = { + injectModuleWorker: jest.fn(() => ({ worker: injectedWorker, injected: true })), + }; + world.document.body.innerHTML = + ''; + loadScript(world, "contentScript.js"); + + const worker = new world.Worker("./worker.js", { type: "module" }); + + expect(worker).toBe(injectedWorker); + expect(nativeWorker).not.toHaveBeenCalled(); + expect(world.__SPECTOR_ModuleInjector.injectModuleWorker).toHaveBeenCalledWith( + "./worker.js", + { type: "module" }, + "https://extension.test/spector.worker.bundle.js", + nativeWorker, + ); + expect(world.__SPECTOR_Workers[0].injected).toBe(true); + }); + + it("starts the popup unchecked and treats older reports as off", () => { + const popup = loadPopup(); + const checkbox = popup.document.getElementById("workerAutoInject"); + expect(checkbox.checked).toBe(false); + expect(checkbox.closest("label").textContent).toContain("experimental"); + expect(popup.document.getElementById(checkbox.getAttribute("aria-describedby")).textContent) + .toContain("may alter Worker behavior"); + checkbox.checked = true; + + popup.updateCanvasesListInformation({ canvases: [], captureOffScreen: true }); + + expect(checkbox.checked).toBe(false); + }); + + it.each([true, false])("persists checkbox=%s before reload and restores it through the bridge", (enabled) => { + const storage = createStorage({ SPECTOR_LOADED: "true", [settingKey]: String(!enabled) }); + const proxy = createWorld(storage); + loadScript(proxy, "contentScriptProxy.js"); + const popup = loadPopup(); + refreshPopup(proxy, popup); + const checkbox = popup.document.getElementById("workerAutoInject"); + expect(checkbox.checked).toBe(!enabled); + + checkbox.checked = enabled; + checkbox.dispatchEvent(new Event("change")); + const [tabId, message] = popup.browser.tabs.sendMessage.mock.calls.at(-1); + expect(tabId).toBe(7); + expect(message).toEqual({ action: "changeWorkerAutoInject", workerAutoInject: enabled }); + const receiveProxy = proxy.browser.runtime.onMessage.addListener.mock.calls[0][0]; + receiveProxy(message); + + expect(storage.getItem(settingKey)).toBe(String(enabled)); + expect(proxy.location.reload).not.toHaveBeenCalled(); + expect(proxy.setTimeout).toHaveBeenCalledWith(expect.any(Function), 50); + proxy.setTimeout.mock.calls.at(-1)[0](); + expect(proxy.location.reload).toHaveBeenCalledTimes(1); + expect(proxy.browser.storage.local.get).not.toHaveBeenCalled(); + expect(proxy.browser.storage.local.set).not.toHaveBeenCalled(); + + // Simulate a fresh MAIN world before the isolated script starts: the + // saved setting is enough, even without a DOM/storage callback. + const reloadedMain = createWorld(storage); + const nativeWorker = reloadedMain.Worker; + loadScript(reloadedMain, "contentScript.js"); + expect(reloadedMain.Worker === nativeWorker).toBe(!enabled); + + const reloadedProxy = createWorld(storage); + loadScript(reloadedProxy, "contentScriptProxy.js"); + const reopenedPopup = loadPopup(); + const report = refreshPopup(reloadedProxy, reopenedPopup); + expect(report.workerAutoInject).toBe(enabled); + expect(reopenedPopup.document.getElementById("workerAutoInject").checked).toBe(enabled); + }); + + it("does not adopt an iframe's opt-in as the top-level default", () => { + const background = createWorld(); + loadScript(background, "background.js"); + const receive = background.browser.runtime.onMessage.addListener.mock.calls[0][0]; + receive({ canvases: [], workerAutoInject: true }, + { id: "extension", frameId: 2, tab: { id: 7 } }, jest.fn()); + + background.refreshCanvases(); + + expect(background.browser.runtime.sendMessage.mock.calls.at(-1)[0].data.workerAutoInject).toBe(false); + }); + + it("clears capture history when the browser starts", () => { + const background = createWorld(); + loadScript(background, "background.js"); + const onStartup = background.browser.runtime.onStartup.addListener.mock.calls[0][0]; + + onStartup(); + + expect(background.browser.storage.local.remove).toHaveBeenCalledWith( + ["currentCapture", "captureHistory", "currentFrameInfo"], + background.consumeLastError, + ); + }); +}); + +describe("Extension one-way messaging", () => { + function installLastError(world: any) { + const lastErrorRead = jest.fn(); + Object.defineProperty(world.browser.runtime, "lastError", { + configurable: true, + get: () => { + lastErrorRead(); + return { message: "The message port closed before a response was received." }; + }, + }); + world.browser.tabs.sendMessage.mockImplementation( + (_tabId: number, _message: unknown, callback?: () => void) => callback?.(), + ); + return lastErrorRead; + } + + it("consumes runtime errors when the background targets a closed extension page or tab", () => { + const world = createWorld(); + const lastErrorRead = installLastError(world); + loadScript(world, "background.js"); + + world.sendRuntimeMessage({ popup: "closed" }); + world.sendMessage({ action: "no-listener" }); + + expect(lastErrorRead).toHaveBeenCalledTimes(2); + }); + + it("does not invoke content callbacks after a runtime delivery error", () => { + const world = createWorld(); + const lastErrorRead = installLastError(world); + const callback = jest.fn(); + loadScript(world, "contentScriptProxy.js"); + + world.sendMessage({ present: 1 }, callback); + + expect(lastErrorRead).toHaveBeenCalledTimes(1); + expect(callback).not.toHaveBeenCalled(); + }); + + it.each(["popup.js", "result.js"])("consumes tab delivery errors in %s", (file) => { + const world = createWorld(); + const lastErrorRead = installLastError(world); + loadScript(world, file); + + world.sendMessage({ action: "no-listener" }, 7); + + expect(lastErrorRead).toHaveBeenCalledTimes(1); + }); +}); From 3ca5f85e76be30ec909ec3fcb9d6de6fe980b651 Mon Sep 17 00:00:00 2001 From: sebavan Date: Fri, 25 Sep 2026 11:55:38 -0700 Subject: [PATCH 2/3] Fix --- dist/spector.bundle.js | 2 +- dist/spector.d.ts | 10 +- documentation/apis.md | 10 +- extensions/background.js | 2 +- extensions/contentScript.js | 285 ++++------- extensions/contentScriptProxy.js | 12 +- extensions/manifest.json | 2 +- extensions/moduleWorkerInjector.js | 283 +---------- extensions/popup.js | 2 +- extensions/spector.bundle.func.js | 2 +- extensions/spector.bundle.js | 2 +- mcp/package-lock.json | 4 +- readme.md | 4 +- sample/js/workerAutoInject/safeClassic.js | 1 - sample/js/workerAutoInjectHarness.js | 2 +- sample/workerAutoInject.html | 4 +- src/backend/spies/workerSpy.ts | 284 ++++------- src/spector.ts | 36 +- test/e2e/fixtures/worker-module-manual.js | 2 + test/e2e/fixtures/worker-module-startup.js | 11 + test/e2e/fixtures/worker-url-apis.js | 18 + test/e2e/workerExtension.spec.ts | 207 ++++++++ test/e2e/workerInterception.spec.ts | 445 +++++++++++++++++- test/unit/backend/spies/workerSpy.test.ts | 130 ++--- .../extensions/moduleWorkerInjector.test.ts | 157 +----- test/unit/extensions/workerAutoInject.test.ts | 117 ++++- 26 files changed, 1104 insertions(+), 930 deletions(-) create mode 100644 test/e2e/fixtures/worker-module-manual.js create mode 100644 test/e2e/fixtures/worker-module-startup.js create mode 100644 test/e2e/fixtures/worker-url-apis.js create mode 100644 test/e2e/workerExtension.spec.ts diff --git a/dist/spector.bundle.js b/dist/spector.bundle.js index 662efd1..3c6dcc0 100644 --- a/dist/spector.bundle.js +++ b/dist/spector.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see spector.bundle.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("SPECTOR",[],t):"object"==typeof exports?exports.SPECTOR=t():e.SPECTOR=t()}(self,()=>(()=>{var e={377(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.captureMenuComponent{position:absolute;padding:7px;z-index:99999;top:10px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuComponent.active{visibility:visible;display:block}.captureMenuComponent,.captureMenuComponent:after,.captureMenuComponent:before{box-sizing:content-box}.captureMenuLogComponent{position:absolute;padding:7px;z-index:80000;top:66px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuLogComponent.active{visibility:visible;display:block}.captureMenuLogComponent,.captureMenuLogComponent:after,.captureMenuLogComponent:before{box-sizing:content-box}.captureMenuLogComponent span.error{color:red}.canvasListComponent{float:left;width:50%;height:100%}.canvasListComponent [commandName=onCanvasSelection]{vertical-align:center;line-height:40px;white-space:nowrap;text-overflow:ellipsis;width:190px;display:inline-block;overflow:hidden;margin:0px 5px}.canvasListComponent [commandName=onCanvasSelection]:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.canvasListComponent ul{margin:0px;padding:7px;list-style:none;position:absolute;top:54px;left:-2px;width:400px;border:2px solid #222;background-color:#2c2c2c}.canvasListComponent ul li{margin:5px}.canvasListComponent ul li:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.captureMenuActionsComponent{float:left;width:30%;height:100%;margin-top:7.5px}.captureMenuActionsComponent div{float:left}.captureMenuActionsComponent [commandName=onCaptureRequested]{border-radius:50%;background:#2c2c2c;border:2px solid red;width:21px;height:21px}.captureMenuActionsComponent [commandName=onCaptureRequested]:hover{background:red;cursor:pointer;transition:background .3s;-webkit-transition:background .3s;-moz-transition:background .3s}.captureMenuActionsComponent [commandName=onPlayRequested],.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPlayRequested]:before,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{content:"";position:absolute;display:inline-block;margin-top:6px;margin-left:4px;width:7px;height:7px;border-top:2px solid #f9f9f9;border-right:2px solid #f9f9f9;background-color:#f9f9f9;-moz-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg);z-index:-20}.captureMenuActionsComponent [commandName=onPlayRequested]:after,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:after{content:"";position:absolute;display:inline-block;width:8px;height:20px;background-color:#2c2c2c;z-index:-10}.captureMenuActionsComponent [commandName=onPlayRequested]:hover,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPauseRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPauseRequested]:before{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:12px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:after{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:7px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{background-color:#2c2c2c}.fpsCounterComponent{float:left;width:20%;vertical-align:center;line-height:40px;white-space:nowrap}',""]);const a=o},160(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.resultViewComponent{position:absolute;z-index:99999;border:1px solid #000;top:0;left:0;bottom:0;right:0;background-color:#222;opacity:1;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.resultViewComponent.active{visibility:visible;display:block}.resultViewComponent,.resultViewComponent:after,.resultViewComponent:before{box-sizing:content-box}.resultViewMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.resultViewMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.resultViewMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.resultViewMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.resultViewMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.resultViewMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.resultViewMenuComponent a.clearSearch{padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.resultViewMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}@media all and (max-width: 1024px){.resultViewMenuComponent .resultViewMenuOpen{display:block;visibility:visible}.resultViewMenuComponent li:not(.resultViewMenuSmall){display:none;visibility:hidden}.resultViewMenuComponent li{background:#2c2c2c}.resultViewMenuComponent li.searchContainer{background:rgb(69.5,69.5,69.5)}.resultViewMenuComponent{padding:0px;position:absolute;overflow-y:visible;top:0px;left:0px;right:0px;bottom:0px;z-index:999999;display:block}.resultViewMenuComponent a.active{background:#2c2c2c}}.resultViewMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:40px;position:relative;top:-1px;box-sizing:border-box}.resultViewMenuComponent input:focus{border:0;outline:0 none}.resultViewMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.resultViewMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.resultViewMenuComponent ::-webkit-input-placeholder{color:#ccc}.resultViewMenuComponent :-moz-placeholder{color:#ccc}.resultViewMenuComponent ::-moz-placeholder{color:#ccc}.resultViewMenuComponent :-ms-input-placeholder{color:#ccc}.resultViewContentComponent{position:absolute;top:40px;left:0;bottom:0;right:0}.informationColumnLeftComponent{position:absolute;top:0;left:0;bottom:0;right:50%;overflow:auto;overflow-x:hidden;overflow-y:visible}.informationColumnRightComponent{position:absolute;top:0;left:50%;bottom:0;right:0;overflow:auto;overflow-x:hidden;overflow-y:visible}.captureListComponent{position:absolute;top:40px;left:0;bottom:0;right:0;background:#222;z-index:9000;display:none;visibility:hidden;overflow-y:visible;overflow-x:hidden}.captureListComponent.active{display:block;visibility:visible}.captureListComponent .openCaptureFile{border:1px dashed #f9f9f9;display:block;margin:5px;padding:5px;text-align:center;font-style:italic}.captureListComponent .openCaptureFile span{line-height:100%;vertical-align:middle}.captureListComponent ul{margin:0px;padding:0px;list-style:none;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-start}.captureListComponent ul li{margin:5px;border:1px solid #606060}.captureListComponent ul li img{width:295px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;display:block}.captureListComponent ul li span{display:block;text-align:center;border:5px solid #222}.captureListComponent ul li span .captureListItemSave{color:#f9f9f9;font-size:16px;margin-left:10px;position:relative;padding:3px 8px 3px 32px}.captureListComponent ul li span .captureListItemSave:before,.captureListComponent ul li span .captureListItemSave:after{box-sizing:border-box;content:"";position:absolute}.captureListComponent ul li span .captureListItemSave:before{background:#222;border-color:#f9f9f9;border-style:solid;border-width:7px 2px 1px;border-radius:1px;height:16px;left:8px;top:5px;width:16px}.captureListComponent ul li span .captureListItemSave:after{background:#f9f9f9;border-color:#d9d9d9;border-style:solid;border-width:1px 1px 1px 4px;height:5px;left:13px;top:5px;width:7px}.captureListComponent ul li:hover{cursor:pointer}.captureListComponent ul li.active span{background:#f0640d;border:5px solid #f0640d}.captureListComponent ul li.active span .captureListItemSave:before{background:#f0640d}.captureListComponent ul li.active span .captureListItemSave:after{border-color:#f0640d}.visualStateListComponent{position:absolute;top:0;left:0;bottom:0;padding:5px;right:80%;overflow-y:visible;overflow-x:hidden}.visualStateListComponent ul{margin:0px;padding:0px;list-style:none}.visualStateListComponent ul li{margin:20px 15px 0px 15px;border:1px solid #606060}.visualStateListComponent ul li img{display:block;padding:0px;box-sizing:border-box;max-height:600px;width:100%;margin:0 auto;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.visualStateListComponent ul li:hover{cursor:pointer}.visualStateListComponent ul li span{border:5px solid #222;background:#222;box-sizing:border-box;display:inline-block;width:100%;margin:0px;padding:5px;word-wrap:break-word}.visualStateListComponent ul li.active{border:2px solid #f0640d}.commandListComponent{position:absolute;top:0;left:20%;right:40%;bottom:0;color:hsl(0,0%,82.6470588235%)}.commandListComponent ul{margin:0px;padding:0px;list-style:none;overflow-y:visible;overflow-x:hidden;height:100%}.commandListComponent ul li{padding:8px}.commandListComponent ul li span{word-wrap:break-word;line-height:22px}.commandListComponent ul li:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.commandListComponent ul li:nth-child(even){background:#2c2c2c}.commandListComponent ul li:nth-child(odd){background:#222}.commandListComponent ul li .important{font-weight:800}.commandListComponent ul li .important.deprecated{color:red}.commandListComponent ul li .important.unused{color:#ff0}.commandListComponent ul li .important.disabled{color:gray}.commandListComponent ul li .important.redundant{color:orange}.commandListComponent ul li .important.valid{color:#adff2f}.commandListComponent ul li .marker{font-size:16px;font-weight:900;color:#adff2f}.commandListComponent ul li.active{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.commandListComponent ul li.drawCall{background:#5db0d7;color:#222}.commandListComponent ul li a{margin-left:5px;margin-right:5px;color:#5db0d7;background:#222;padding:5px;font-weight:900;display:inline-block}.commandDetailComponent{position:absolute;top:0;left:60%;right:0;bottom:0;overflow-y:visible;overflow-x:hidden}.jsonGroupComponent{display:block;margin:10px;padding:10px;padding-bottom:5px}.jsonGroupComponent .jsonGroupComponentTitle{display:block;font-size:16px;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:5px;margin-bottom:5px;text-transform:capitalize}.jsonGroupComponent ul{margin:0px;padding:0px;list-style:none}.jsonGroupComponent ul li:nth-child(even){background:#222}.jsonGroupComponent ul li:nth-child(odd){background:#222}.jsonItemComponentKey{color:#f0640d}.jsonItemComponentValue{white-space:pre-wrap}.jsonItemImageHolder{width:50%;margin:auto}.jsonItemImageHolder .jsonItemImage{margin:5px;display:block;border:1px solid #606060;width:100%}.jsonItemImageHolder .jsonItemImage img{width:100%;display:block;margin:auto;max-width:256px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.jsonItemImageHolder .jsonItemImage span{margin:0px;padding:5px;word-wrap:break-word;display:inline-block;width:100%;box-sizing:border-box}[commandName=onOpenSourceClicked]:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.jsonVisualStateItemComponent{text-align:center;padding:10px}.jsonVisualStateItemComponent img{background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;border:1px solid #606060;margin:5px;width:100%;max-width:512px;max-height:800px}.jsonVisualStateItemComponent span{display:block}.jsonContentComponent{position:absolute;top:0;left:0;right:0;bottom:0;padding:10px;overflow-y:visible;overflow-x:hidden}.jsonItemComponentValue{word-break:break-all;white-space:normal}.jsonSourceItemComponentOpen{font-weight:bold;color:#5db0d7;text-decoration:underline}.sourceCodeMenuComponentContainer{position:absolute;left:0;top:0;bottom:48px;right:40%}.sourceCodeMenuComponentFooter{position:absolute;left:0;right:40%;bottom:0;padding:0 15px}.sourceCodeFormatError{color:#f0640d;margin-left:15px}.sourceCodeDiagnosticsNotice{color:#5db0d7;margin-left:15px}.sourceCodeDiagnosticsNotice a{color:#c9c9c9;text-decoration:underline}.sourceCodeMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.sourceCodeMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.sourceCodeMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.sourceCodeMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.sourceCodeMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.sourceCodeMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.sourceCodeMenuComponent a.clearSearch{display:inline-block;padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.sourceCodeMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}.sourceCodeMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:100%;position:relative;top:-1px;box-sizing:border-box}.sourceCodeMenuComponent input:focus{border:0;outline:0 none}.sourceCodeMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.sourceCodeMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.sourceCodeMenuComponent ::-webkit-input-placeholder{color:#ccc}.sourceCodeMenuComponent :-moz-placeholder{color:#ccc}.sourceCodeMenuComponent ::-moz-placeholder{color:#ccc}.sourceCodeMenuComponent :-ms-input-placeholder{color:#ccc}.sourceCodeComponent{position:absolute;top:42px;left:0;bottom:48px;right:40%;background:#222;z-index:9000;overflow-x:visible;overflow:auto}.sourceCodeComponent .sourceCodeComponentTitle{font-size:16px;font-weight:800;line-height:50px;color:#f0640d;padding:1em;margin:.5em 0}.compareViewComponent{position:absolute;top:50px;left:0px;right:0px;bottom:0px;overflow:hidden;display:flex;flex-direction:column;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:13px}.compareViewComponent .compareViewEmpty,.compareViewComponent .compareViewEmptyRow,.compareViewComponent .compareDetailEmpty{padding:1em;color:#c9c9c9;text-align:center}.compareViewComponent .compareViewHeader{flex:0 0 auto;display:flex;align-items:center;gap:16px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid rgb(8.5,8.5,8.5);white-space:nowrap}.compareViewComponent .compareViewHeader .compareViewLabel{color:#5db0d7}.compareViewComponent .compareViewHeader .compareViewSummary span{margin-right:8px;font-weight:700}.compareViewComponent .compareViewHeader .compareViewSummary span.added{color:#adff2f}.compareViewComponent .compareViewHeader .compareViewSummary span.removed{color:#ff5a5a}.compareViewComponent .compareViewHeader .compareViewSummary span.changed{color:#f0640d}.compareViewComponent .compareViewHeader .compareViewSummary span.unchanged{color:#c9c9c9}.compareViewComponent .compareViewHeader .compareViewToggle{margin-left:auto;cursor:pointer;user-select:none}.compareViewComponent .compareViewHeader .compareViewToggle input{vertical-align:middle;margin-right:4px}.compareViewComponent .compareViewBody{flex:1 1 auto;display:flex;min-height:0}.compareViewComponent .compareViewLegend{flex:0 0 130px;box-sizing:border-box;padding:10px;background:#2c2c2c;border-right:2px solid #222}.compareViewComponent .compareViewLegend .compareLegendRow{display:flex;align-items:center;gap:8px;margin:8px 0}.compareViewComponent .compareViewLegend .compareLegendRow.unchanged{opacity:.5}.compareViewComponent .compareViewLegend .compareLegendChip{width:12px;height:12px;border-radius:2px;background:#c9c9c9}.compareViewComponent .compareViewLegend .added .compareLegendChip{background:#adff2f}.compareViewComponent .compareViewLegend .removed .compareLegendChip{background:#ff5a5a}.compareViewComponent .compareViewLegend .changed .compareLegendChip{background:#f0640d}.compareViewComponent .compareViewList{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;margin:0;padding:0;list-style:none}.compareViewComponent .compareViewList .compareRow{display:flex;align-items:baseline;padding:3px 10px;line-height:20px;cursor:pointer;white-space:nowrap}.compareViewComponent .compareViewList .compareRow:nth-child(odd){background:#222}.compareViewComponent .compareViewList .compareRow:nth-child(even){background:#2c2c2c}.compareViewComponent .compareViewList .compareRow .compareSign{flex:0 0 14px;font-weight:800}.compareViewComponent .compareViewList .compareRow .compareRowText{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.compareViewComponent .compareViewList .compareRow .compareCmdName{font-weight:700}.compareViewComponent .compareViewList .compareRow.added .compareSign,.compareViewComponent .compareViewList .compareRow.added .compareCmdName{color:#adff2f}.compareViewComponent .compareViewList .compareRow.removed .compareSign,.compareViewComponent .compareViewList .compareRow.removed .compareCmdName{color:#ff5a5a}.compareViewComponent .compareViewList .compareRow.changed .compareSign,.compareViewComponent .compareViewList .compareRow.changed .compareCmdName{color:#f0640d}.compareViewComponent .compareViewList .compareRow.unchanged{opacity:.55}.compareViewComponent .compareViewList .compareRow.selected{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.compareViewComponent .compareViewList .compareRow.selected .compareSign,.compareViewComponent .compareViewList .compareRow.selected .compareCmdName{color:#222}.compareViewComponent .compareViewList .compareViewEmptyRow{cursor:default}.compareViewComponent .compareViewDetail{flex:0 0 42%;box-sizing:border-box;overflow-y:auto;border-left:2px solid #222;padding:4px 12px 12px}.compareViewComponent .compareViewDetail .compareDetailGroup{margin:12px 0}.compareViewComponent .compareViewDetail .compareDetailGroup ul{margin:0;padding:0;list-style:none}.compareViewComponent .compareViewDetail .compareDetailGroup li{padding:2px 0;white-space:pre-wrap;word-break:break-word}.compareViewComponent .compareViewDetail .compareDetailTitle{display:block;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin-bottom:6px;text-transform:capitalize}.compareViewComponent .compareViewDetail .compareDetailKey{color:#f0640d}.compareViewComponent .compareViewDetail .compareCmdName{font-weight:700}.compareViewComponent .compareViewDetail .compareCmdName.added{color:#adff2f}.compareViewComponent .compareViewDetail .compareCmdName.removed{color:#ff5a5a}.compareViewComponent .compareViewDetail .compareCmdName.changed{color:#f0640d}.compareViewComponent .compareViewDetail .compareArrow{color:#c9c9c9}.compareViewComponent .compareViewDetail .compareOld{opacity:.7;text-decoration:line-through}.compareViewComponent .compareViewDetail .compareNew{color:#f9f9f9}.compareViewComponent .compareViewDetail .compareCommandLink{color:#5db0d7;text-decoration:none;cursor:pointer;border-bottom:1px dotted currentColor}.compareViewComponent .compareViewDetail .compareCommandLink:hover{color:#f0640d}.compareViewComponent .compareViewDetail .compareTextureItem{padding-bottom:6px}.compareViewComponent .compareViewDetail .compareImageDiff{display:flex;align-items:center;margin-top:4px}.compareViewComponent .compareViewDetail .compareThumb{width:48px;height:48px;object-fit:contain;margin:2px 6px 2px 0;border:1px solid rgb(8.5,8.5,8.5);background:#222;image-rendering:pixelated}.jsonItemImageClickable{cursor:zoom-in}.textureViewerOverlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:100000;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.6);font-family:Consolas,monaco,monospace;font-size:13px;color:#f9f9f9}.textureViewerOverlay .textureViewerModal{width:min(900px,92vw);height:min(640px,90vh);display:flex;flex-direction:column;overflow:hidden;background:#222;border:1px solid #000;box-shadow:0 10px 40px rgba(0,0,0,.6)}.textureViewerOverlay .textureViewerHeader{flex:0 0 auto;display:flex;align-items:center;gap:12px;height:40px;padding:0 12px;background:#2c2c2c;border-bottom:2px solid #222}.textureViewerOverlay .textureViewerHeader .textureViewerTitle{color:#5db0d7}.textureViewerOverlay .textureViewerHeader .textureViewerMeta{color:#c9c9c9;font-size:12px}.textureViewerOverlay .textureViewerHeader .textureViewerClose{margin-left:auto;width:26px;height:26px;display:flex;align-items:center;justify-content:center;border-radius:3px;color:#c9c9c9;cursor:pointer}.textureViewerOverlay .textureViewerHeader .textureViewerClose:hover{color:#f9f9f9;background:hsla(0,0%,100%,.08)}.textureViewerOverlay .textureViewerToolbar{flex:0 0 auto;display:flex;align-items:center;flex-wrap:wrap;gap:14px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid #000;font-size:12px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup{display:flex;align-items:center;gap:6px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup .lbl{color:#c9c9c9;margin-right:2px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroupEnd{margin-left:auto}.textureViewerOverlay .textureViewerToolbar .channel{width:26px;height:24px;display:flex;align-items:center;justify-content:center;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#777;font-weight:800;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .channel.on.r{background:#e14b4b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.g{background:#4bd44b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.b{background:#4b8fe1;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.a{background:#dedede;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .tvBtn{height:24px;padding:0 10px;display:inline-flex;align-items:center;gap:6px;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#f9f9f9;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .tvBtn:hover{background:#333}.textureViewerOverlay .textureViewerToolbar .tvBtn.active{background:#f0640d;color:#1a1a1a;border-color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary{border-color:#f0640d;color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary:hover{background:#f0640d;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .seg{display:flex}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn{border-radius:0;border-right-width:0}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:first-child{border-radius:3px 0 0 3px}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:last-child{border-radius:0 3px 3px 0;border-right-width:1px}.textureViewerOverlay .textureViewerToolbar .zoomVal{min-width:44px;text-align:center;color:#c9c9c9}.textureViewerOverlay .textureViewerBody{flex:1 1 auto;display:flex;min-height:0}.textureViewerOverlay .textureViewerViewport{flex:1 1 auto;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#141414}.textureViewerOverlay .textureViewerViewport.checker{background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}.textureViewerOverlay .textureViewerCanvas{image-rendering:pixelated;cursor:crosshair;box-shadow:0 0 0 1px #000}.textureViewerOverlay .textureViewerLoupe{position:absolute;display:none;width:120px;height:120px;pointer-events:none;image-rendering:pixelated;border:1px solid #000;box-shadow:0 2px 8px rgba(0,0,0,.6);background:#000;left:16px;top:16px}.textureViewerOverlay .textureViewerRail{flex:0 0 210px;box-sizing:border-box;padding:12px;overflow-y:auto;background:#2c2c2c;border-left:2px solid #222}.textureViewerOverlay .textureViewerRail .railTitle{color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin:0 0 8px;text-transform:capitalize}.textureViewerOverlay .textureViewerRail .kv{display:flex;justify-content:space-between;margin:4px 0}.textureViewerOverlay .textureViewerRail .kv .k{color:#f0640d}.textureViewerOverlay .textureViewerRail .kv .v{color:#f9f9f9}.textureViewerOverlay .textureViewerRail .swatch{width:100%;height:34px;margin:8px 0;border:1px solid #000;background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0}.textureViewerOverlay .textureViewerRail .swatch .swatchInner{width:100%;height:100%}.textureViewerOverlay .textureViewerRail .hint{color:#c9c9c9;margin-top:10px;line-height:1.5}',""]);const a=o},636(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,".ace-monokai {\n color: #f9f9f9;\n font-size: 14px;\n}\n\n.ace-monokai .ace_entity.ace_name.ace_tag,\n.ace-monokai .ace_keyword,\n.ace-monokai .ace_meta.ace_tag,\n.ace-monokai .ace_storage {\n color: #F0640D\n}\n\n.ace-monokai .ace_constant.ace_character,\n.ace-monokai .ace_constant.ace_other {\n color: #5db0d7;\n}\n\n.ace-monokai .ace_marker-layer .ace_selection {\n background: #a6e22e\n}\n\n.ace-monokai .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #a6e22e;\n}\n\n.ace-monokai .ace_marker-layer .ace_active-line {\n background: #2c2c2c\n}\n.ace-monokai .ace_gutter-active-line {\n background-color: #2c2c2c\n}\n.ace-monokai .ace_marker-layer .ace_selected-word {\n border: 1px solid #a6e22e\n}\n\n.ace-monokai .ace_constant.ace_language {\n color: #e6db74\n}\n.ace-monokai .ace_constant.ace_numeric {\n color: #ae81ff\n}\n\n.ace-monokai .ace_gutter {\n background: #222;\n color: #8F908A;\n}",""]);const a=o},314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var a=0;a0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},601(e){"use strict";e.exports=function(e){return e[1]}},832(e,t,n){e=n.nmd(e),function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,n,r){"string"==typeof e?(2==arguments.length&&(r=n),t.modules[e]||(t.payloads[e]=r,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var n,r,i=function(e,t,n){if("string"==typeof t){var r=a(e,t);if(null!=r)return n&&n(),r}else if("[object Array]"===Object.prototype.toString.call(t)){for(var i=[],o=0,l=t.length;o1&&function(e,t,n){if(Array.prototype.indexOf)return e.indexOf("",n);for(var r=0;r-1&&(n=RegExp(this.source,i.replace.call(((r=this).global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),"g","")),i.replace.call(e.slice(a.index),n,function(){for(var e=1;ea.index&&this.lastIndex--}return a},o||(RegExp.prototype.test=function(e){var t=i.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError("Function.prototype.bind called on incompatible "+t);var n=d.call(arguments,1),i=function(){if(this instanceof i){var r=t.apply(this,n.concat(d.call(arguments)));return Object(r)===r?r:this}return t.apply(e,n.concat(d.call(arguments)))};return t.prototype&&(r.prototype=t.prototype,i.prototype=new r,r.prototype=null),i});var i,s,o,a,l,u=Function.prototype.call,c=Array.prototype,h=Object.prototype,d=c.slice,f=u.bind(h.toString),p=u.bind(h.hasOwnProperty);if((l=p(h,"__defineGetter__"))&&(i=u.bind(h.__defineGetter__),s=u.bind(h.__defineSetter__),o=u.bind(h.__lookupGetter__),a=u.bind(h.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,n=[];if(n.splice.apply(n,e(20)),n.splice.apply(n,e(26)),t=n.length,n.splice(5,0,"XXX"),n.length,t+1==n.length)return!0}()){var m=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?m.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(d.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):null==e?e=0:e<0&&(e=Math.max(n+e,0)),e+ta)for(h=u;h--;)this[l+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else for(this.length=c+s,h=0;h>>0;if("[object Function]"!=f(e))throw new TypeError;for(;++i>>0,i=Array(r),s=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var o=0;o>>0,s=[],o=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var a=0;a>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,s=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s++];break}if(++s>=r)throw new TypeError("reduce of empty array with no initial value")}for(;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,s=r-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s--];break}if(--s<0)throw new TypeError("reduceRight of empty array with no initial value")}do{s in this&&(i=e.call(void 0,i,n[s],s,t))}while(s--);return i}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=C&&"[object String]"==f(this)?this.split(""):L(this),n=t.length>>>0;if(!n)return-1;var r=0;for(arguments.length>1&&(r=N(arguments[1])),r=r>=0?r:Math.max(0,n+r);r>>0;if(!n)return-1;var r=n-1;for(arguments.length>1&&(r=Math.min(r,N(arguments[1]))),r=r>=0?r:n-Math.abs(r);r>=0;r--)if(r in t&&e===t[r])return r;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:h)}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(p(e,t)){var n;if(n={enumerable:!0,configurable:!0},l){var r=e.__proto__;e.__proto__=h;var i=o(e,t),s=a(e,t);if(e.__proto__=r,i||s)return i&&(n.get=i),s&&(n.set=s),n}return n.value=e[t],n}}),Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),Object.create||(g=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var n;if(null===e)n=g();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var r=function(){};r.prototype=e,(n=new r).__proto__=e}return void 0!==t&&Object.defineProperties(n,t),n}),Object.defineProperty){var S=D({}),A="undefined"==typeof document||D(document.createElement("div"));if(!S||!A)var _=Object.defineProperty}Object.defineProperty&&!_||(Object.defineProperty=function(e,t,n){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof n&&"function"!=typeof n||null===n)throw new TypeError("Property description must be an object: "+n);if(_)try{return _.call(Object,e,t,n)}catch(e){}if(p(n,"value"))if(l&&(o(e,t)||a(e,t))){var r=e.__proto__;e.__proto__=h,delete e[t],e[t]=n.value,e.__proto__=r}else e[t]=n.value;else{if(!l)throw new TypeError("getters & setters can not be defined on this javascript engine");p(n,"get")&&i(e,t,n.get),p(n,"set")&&s(e,t,n.set)}return e}),Object.defineProperties||(Object.defineProperties=function(e,t){for(var n in t)p(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=(E=Object.freeze,function(e){return"function"==typeof e?e:E(e)})}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";p(e,t);)t+="?";e[t]=!0;var n=p(e,t);return delete e[t],n}),!Object.keys){var y=!0,b=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],T=b.length;for(var R in{toString:null})y=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)p(e,n)&&t.push(n);if(y)for(var r=0,i=T;r0||-1)*Math.floor(Math.abs(e))),e}var L=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,n){"use strict";e("./regexp"),e("./es5-shim"),"undefined"==typeof Element||Element.prototype.remove||Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,n){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var r="object"==typeof navigator?navigator:{},i=(/mac|win|linux/i.exec(r.platform)||["other"])[0].toLowerCase(),s=r.userAgent||"",o=r.appName||"";t.isWin="win"==i,t.isMac="mac"==i,t.isLinux="linux"==i,t.isIE="Microsoft Internet Explorer"==o||o.indexOf("MSAppHost")>=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,t.isAIR=s.indexOf("AdobeAIR")>=0,t.isAndroid=s.indexOf("Android")>=0,t.isChromeOS=s.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./useragent");if(t.buildDom=function e(t,n,r){if("string"==typeof t&&t){var i=document.createTextNode(t);return n&&n.appendChild(i),i}if(!Array.isArray(t))return t;if("string"!=typeof t[0]||!t[0]){for(var s=[],o=0;o=1.5,"undefined"!=typeof document){var i=document.createElement("div");t.HI_DPI&&void 0!==i.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),r.isEdge||void 0===i.style.animationName||(t.HAS_CSS_ANIMATION=!0),i=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./oop"),i=function(){var e,t,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in n.FUNCTION_KEYS)e=n.FUNCTION_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);for(t in n.PRINTABLE_KEYS)e=n.PRINTABLE_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);return r.mixin(n,n.MODIFIER_KEYS),r.mixin(n,n.PRINTABLE_KEYS),r.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)n.KEY_MODS[t]=e.filter(function(e){return t&n.KEY_MODS[e]}).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();r.mixin(t,i),t.keyCodeToString=function(e){var t=i[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./keys"),i=e("./useragent"),s=null,o=0;t.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var r=function(){n.call(e,window.event)};n._wrapper=r,e.attachEvent("on"+t,r)}},t.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,n,r){function i(e){n&&n(e),r&&r(e),t.removeListener(document,"mousemove",n,!0),t.removeListener(document,"mouseup",i,!0),t.removeListener(document,"dragstart",i,!0)}return t.addListener(document,"mousemove",n,!0),t.addListener(document,"mouseup",i,!0),t.addListener(document,"dragstart",i,!0),i},t.addMouseWheelListener=function(e,n){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),n(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}n(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),n(e)})},t.addMultiMouseDownListener=function(e,n,r,s){var o,a,l,u=0,c={2:"dblclick",3:"tripleclick",4:"quadclick"};function h(e){if(0!==t.getButton(e)?u=0:e.detail>1?++u>4&&(u=1):u=1,i.isIE){var h=Math.abs(e.clientX-o)>5||Math.abs(e.clientY-a)>5;l&&!h||(u=1),l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),1==u&&(o=e.clientX,a=e.clientY)}if(e._clicks=u,r[s]("mousedown",e),u>4)u=0;else if(u>1)return r[s](c[u],e)}function d(e){u=2,l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),r[s]("mousedown",e),r[s](c[u],e)}Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",h),i.isOldIE&&t.addListener(e,"dblclick",d)})};var a=i.isMac&&i.isOpera&&!("KeyboardEvent"in window)?function(e){return(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)}:function(e){return(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};function l(e,t,n){var l=a(t);if(!i.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(l|=8),s.altGr){if(!(3&~l))return;s.altGr=0}if(18===n||17===n){var u="location"in t?t.location:t.keyLocation;17===n&&1===u?1==s[n]&&(o=t.timeStamp):18===n&&3===l&&2===u&&t.timeStamp-o<50&&(s.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),l||13!==n||3!==(u="location"in t?t.location:t.keyLocation)||(e(t,l,-n),!t.defaultPrevented)){if(i.isChromeOS&&8&l){if(e(t,l,n),t.defaultPrevented)return;l&=-9}return!!(l||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&e(t,l,n)}}function u(){s=Object.create(null)}if(t.getModifierString=function(e){return r.KEY_MODS[a(e)]},t.addCommandKeyListener=function(e,n){var r=t.addListener;if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var o=null;r(e,"keydown",function(e){o=e.keyCode}),r(e,"keypress",function(e){return l(n,e,o)})}else{var a=null;r(e,"keydown",function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=l(n,e,e.keyCode);return a=e.defaultPrevented,t}),r(e,"keypress",function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),r(e,"keyup",function(e){s[e.keyCode]=null}),s||(u(),r(window,"focus",u))}},"object"==typeof window&&window.postMessage&&!i.isOldIE){var c=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+c++,i=function(s){s.data==r&&(t.stopPropagation(s),t.removeListener(n,"message",i),e())};t.addListener(n,"message",i),n.postMessage(r,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function n(){t.$idleBlocked?setTimeout(n,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,n=e.end,r=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(r.row,r.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(r.row,r.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else this.end.rowt)var i={row:t+1,column:0};else this.start.row0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;nDate.now()-50)||(r=!1)},cancel:function(){r=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("../lib/dom"),o=e("../lib/lang"),a=e("../clipboard"),l=i.isChrome<18,u=i.isIE,c=i.isChrome>63,h=400,d=e("../lib/keys"),f=d.KEY_MODS,p=i.isIOS,m=p?/\s/:/\n/;t.TextInput=function(e,t){var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild);var g=!1,E=!1,v=!1,C=!1,D="";i.isMobile||(n.style.fontSize="1px");var S=!1,A=!1,_="",y=0,b=0,T=0;try{var R=document.activeElement===n}catch(e){}r.addListener(n,"blur",function(e){A||(t.onBlur(e),R=!1)}),r.addListener(n,"focus",function(e){if(!A){if(R=!0,i.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),i.isEdge?setTimeout(x):x()}}),this.$focusScroll=!1,this.focus=function(){if(D||c||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var t=0!=n.getBoundingClientRect().top}catch(e){return}var r=[];if(t)for(var i=n.parentElement;i&&1==i.nodeType;)r.push(i),i.setAttribute("ace_nocontext",!0),i=!i.parentElement&&i.getRootNode?i.getRootNode().host:i.parentElement;n.focus({preventScroll:!0}),t&&r.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="","0px"==n.style.top&&(n.style.top=e)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return R},t.on("beforeEndOperation",function(){t.curOp&&"insertstring"==t.curOp.command.name||(v&&(_=n.value="",U()),x())});var x=p?function(e){if(R&&(!g||e)&&!C){e||(e="");var r="\n ab"+e+"cde fg\n";r!=n.value&&(n.value=_=r);var i=4+(e.length||(t.selection.isEmpty()?0:1));4==y&&b==i||n.setSelectionRange(4,i),y=4,b=i}}:function(){if(!v&&!C&&(R||F)){v=!0;var e=t.selection,r=e.getRange(),i=e.cursor.row,s=r.start.column,o=r.end.column,a=t.session.getLine(i);if(r.start.row!=i){var l=t.session.getLine(i-1);s=r.start.rowi+1?u.length:o,o+=a.length+1,a=a+"\n"+u}a.length>h&&(s0&&_[h]==e[h];)h++,o--;for(l=l.slice(h),h=1;a>0&&_.length-h>y-1&&_[_.length-h]==e[e.length-h];)h++,a--;u-=h-1,c-=h-1;var d=l.length-h+1;return d<0&&(o=-d,d=0),l=l.slice(0,d),r||l||u||o||a||c?(C=!0,l&&!o&&!a&&!u&&!c||S?t.onTextInput(l):t.onTextInput(l,{extendLeft:o,extendRight:a,restoreStart:u,restoreEnd:c}),C=!1,_=e,y=i,b=s,T=c,l):""},L=function(e){if(v)return B();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var r=n.value,i=N(r,!0);(r.length>500||m.test(i))&&x()},O=function(e,t,n){var r=e.clipboardData||window.clipboardData;if(r&&!l){var i=u||n?"Text":"text/plain";try{return t?!1!==r.setData(i,t):r.getData(i)}catch(e){if(!n)return O(e,t,!0)}}},I=function(e,i){var s=t.getCopyText();if(!s)return r.preventDefault(e);O(e,s)?(p&&(x(s),g=s,setTimeout(function(){g=!1},10)),i?t.onCut():t.onCopy(),r.preventDefault(e)):(g=!0,n.value=s,n.select(),setTimeout(function(){g=!1,x(),i?t.onCut():t.onCopy()}))},k=function(e){I(e,!0)},M=function(e){I(e,!1)},P=function(e){var s=O(e);a.pasteCancelled()||("string"==typeof s?(s&&t.onPaste(s,e),i.isIE&&setTimeout(x),r.preventDefault(e)):(n.value="",E=!0))};r.addCommandKeyListener(n,t.onCommandKey.bind(t)),r.addListener(n,"select",function(e){v||(g?g=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=_.length&&e.value===_&&_&&e.selectionEnd!==b}(n)&&(t.selectAll(),x()))}),r.addListener(n,"input",L),r.addListener(n,"cut",k),r.addListener(n,"copy",M),r.addListener(n,"paste",P),"oncut"in n&&"oncopy"in n&&"onpaste"in n||r.addListener(e,"keydown",function(e){if((!i.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:M(e);break;case 86:P(e);break;case 88:k(e)}});var B=function(){if(v&&t.onCompositionUpdate&&!t.$readOnly){if(S)return $();if(v.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;N(e),v.markerRange&&(v.context&&(v.markerRange.start.column=v.selectionStart=v.context.compositionStartOffset),v.markerRange.end.column=v.markerRange.start.column+b-v.selectionStart+T)}}},U=function(e){t.onCompositionEnd&&!t.$readOnly&&(v=!1,t.onCompositionEnd(),t.off("mousedown",$),e&&L())};function $(){A=!0,n.blur(),n.focus(),A=!1}var G,V=o.delayedCall(B,50).schedule.bind(null,null);function W(){clearTimeout(G),G=setTimeout(function(){D&&(n.style.cssText=D,D=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()},0)}r.addListener(n,"compositionstart",function(e){if(!v&&t.onCompositionStart&&!t.$readOnly&&(v={},!S)){setTimeout(B,0),t.on("mousedown",$);var r=t.getSelectionRange();r.end.row=r.start.row,r.end.column=r.start.column,v.markerRange=r,v.selectionStart=y,t.onCompositionStart(v),v.useTextareaForIME?(n.value="",_="",y=0,b=0):(n.msGetInputContext&&(v.context=n.msGetInputContext()),n.getInputContext&&(v.context=n.getInputContext()))}}),r.addListener(n,"compositionupdate",B),r.addListener(n,"keyup",function(e){27==e.keyCode&&n.value.lengthb&&"\n"==_[s]?o=d.end:rb&&_.slice(0,s).split("\n").length>2?o=d.down:s>b&&" "==_[s-1]?(o=d.right,a=f.option):(s>b||s==b&&b!=y&&r==s)&&(o=d.right),r!==s&&(a|=f.shift),o){if(!t.onCommandKey({},a,o)&&t.commands){o=d.keyCodeToString(o);var l=t.commands.findKeyCommand(a,o);l&&t.execCommand(l)}y=r,b=s,x("")}}};document.addEventListener("selectionchange",s),t.on("destroy",function(){document.removeEventListener("selectionchange",s)})}(0,t,n)}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/useragent");function i(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function s(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)n=2*t.row-e.start.row-e.end.row;else n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,s=e.getButton();return 0!==s?((i.getSelectionRange().isEmpty()||1==s)&&i.selection.moveToPosition(n),void(2==s&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||i.isFocused()||(i.focus(),!this.$focusTimeout||this.$clickSelection||i.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(-1==r)e=this.$clickSelection.end;else if(1==r)e=this.$clickSelection.start;else{var i=s(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(i.start),a=this.$clickSelection.comparePoint(i.end);if(-1==o&&a<=0)t=this.$clickSelection.end,i.end.row==r.row&&i.end.column==r.column||(r=i.start);else if(1==a&&o>=0)t=this.$clickSelection.start,i.start.row==r.row&&i.start.column==r.column||(r=i.end);else if(-1==o&&1==a)r=i.end,t=i.start;else{var l=s(this.$clickSelection,r);r=l.cursor,t=l.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e,t,n,r,i=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,n=this.x,r=this.y,Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))),s=Date.now();(i>0||s-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session.getBracketRange(t);r?(r.isEmpty()&&(r.start.column--,r.end.column++),this.setState("select")):(r=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=r,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,s=i?e.wheelX/i:n.vx,o=i?e.wheelY/i:n.vy;i<550&&(s=(s+n.vx)/2,o=(o+n.vy)/2);var a=Math.abs(s/o),l=!1;return a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?n.allowed=r:r-n.allowed<550&&(Math.abs(s)<=1.5*Math.abs(n.vx)&&Math.abs(o)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=r):n.allowed=0),n.t=r,n.vx=s,n.vy=o,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(i.prototype),t.DefaultHandlers=i}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}(function(){this.$init=function(){return this.$element=r.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){r.addCssClass(this.getElement(),e)},this.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(i.prototype),t.Tooltip=i}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/event"),o=e("../tooltip").Tooltip;function a(e){o.call(this,e)}i.inherits(a,o),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),s=this.getHeight();(e+=15)+i>n&&(e-=e+i-n),(t+=15)+s>r&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=function(e){var t,n,i,o=e.editor,l=o.renderer.$gutterLayer,u=new a(o.container);function c(){t&&(t=clearTimeout(t)),i&&(u.hide(),i=null,o._signal("hideGutterTooltip",u),o.removeEventListener("mousewheel",c))}function h(e){u.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",function(t){if(o.isFocused()&&0==t.getButton()&&"foldWidgets"!=l.getRegion(t)){var n=t.getDocumentPosition().row,r=o.session.selection;if(t.getShiftKey())r.selectTo(n,0);else{if(2==t.domEvent.detail)return o.selectAll(),t.preventDefault();e.$clickSelection=o.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}),e.editor.setDefaultHandler("guttermousemove",function(s){var a=s.domEvent.target||s.domEvent.srcElement;if(r.hasCssClass(a,"ace_fold-widget"))return c();i&&e.$tooltipFollowsMouse&&h(s),n=s,t||(t=setTimeout(function(){t=null,n&&!e.isMousePressed?function(){var t=n.getDocumentPosition().row,r=l.$annotations[t];if(!r)return c();if(t==o.session.getLength()){var s=o.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(s>o.session.documentToScreenRow(a.row,a.column))return c()}if(i!=r)if(i=r.text.join("
"),u.setHtml(i),u.show(),o._signal("showGutterTooltip",u),o.on("mousewheel",c),e.$tooltipFollowsMouse)h(n);else{var d=n.domEvent.target.getBoundingClientRect(),f=u.getElement().style;f.left=d.right+"px",f.top=d.bottom+"px"}}():c()},50))}),s.addListener(o.renderer.$gutter,"mouseout",function(e){n=null,i&&!t&&(t=setTimeout(function(){t=null,c()},50))}),o.on("changeSession",c)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent");function o(e){var t=e.editor,n=r.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),t.addEventListener("mousedown",this.onMouseDown.bind(e));var o,l,u,c,h,d,f,p,m,g,E,v=t.container,C=0;function D(){var e=d;(function(e,n){var r=Date.now(),i=!n||e.row!=n.row,s=!n||e.column!=n.column;!g||i||s?(t.moveCursorToPosition(e),g=r,E={x:l,y:u}):a(E.x,E.y,l,u)>5?g=null:r-g>=200&&(t.renderer.scrollCursorIntoView(),g=null)})(d=t.renderer.screenToTextCoordinates(l,u),e),function(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,s=t.renderer.layerConfig.characterWidth,o=t.renderer.scroller.getBoundingClientRect(),a={x:{left:l-o.left,right:o.right-l},y:{top:u-o.top,bottom:o.bottom-u}},c=Math.min(a.x.left,a.x.right),h=Math.min(a.y.top,a.y.bottom),d={row:e.row,column:e.column};c/s<=2&&(d.column+=a.x.left=200&&t.renderer.scrollCursorIntoView(d):m=r:m=null}(d,e)}function S(){h=t.selection.toOrientedRange(),o=t.session.addMarker(h,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(c),D(),c=setInterval(D,20),C=0,i.addListener(document,"mousemove",y)}function A(){clearInterval(c),t.session.removeMarker(o),o=null,t.selection.fromOrientedRange(h),t.isFocused()&&!p&&t.$resetCursorStyle(),h=null,d=null,C=0,m=null,g=null,i.removeListener(document,"mousemove",y)}this.onDragStart=function(e){if(this.cancelDrag||!v.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}h=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?"copy":"copyMove",s.isOpera&&(t.container.appendChild(n),n.scrollTop=0),i.setDragImage&&i.setDragImage(n,0,0),s.isOpera&&t.container.removeChild(n),i.clearData(),i.setData("Text",t.session.getTextRange()),p=!0,this.setState("drag")},this.onDragEnd=function(e){if(v.draggable=!1,p=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;f||"move"!=n||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||S(),C++,e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||(S(),C++),null!==_&&(_=null),e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragLeave=function(e){if(--C<=0&&o)return A(),f=null,i.preventDefault(e)},this.onDrop=function(e){if(d){var n=e.dataTransfer;if(p)switch(f){case"move":h=h.contains(d.row,d.column)?{start:d,end:d}:t.moveText(h,d);break;case"copy":h=t.moveText(h,d,!0)}else{var r=n.getData("Text");h={start:d,end:t.session.insert(d,r)},t.focus(),f=null}return A(),i.preventDefault(e)}},i.addListener(v,"dragstart",this.onDragStart.bind(e)),i.addListener(v,"dragend",this.onDragEnd.bind(e)),i.addListener(v,"dragenter",this.onDragEnter.bind(e)),i.addListener(v,"dragover",this.onDragOver.bind(e)),i.addListener(v,"dragleave",this.onDragLeave.bind(e)),i.addListener(v,"drop",this.onDrop.bind(e));var _=null;function y(){null==_&&(_=setTimeout(function(){null!=_&&o&&A()},20))}function b(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function T(e){var t=["copy","copymove","all","uninitialized"],n=s.isMac?e.altKey:e.ctrlKey,r="uninitialized";try{r=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var i="none";return n&&t.indexOf(r)>=0?i="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(r)>=0?i="move":t.indexOf(r)>=0&&(i="copy"),i}}function a(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=s.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;s.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton();if(1===(e.domEvent.detail||1)&&0===r&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var i=e.domEvent.target||e.domEvent.srcElement;"unselectable"in i&&(i.unselectable="on"),t.getDragDelay()?(s.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(o.prototype),t.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./mouse_event").MouseEvent,i=e("../lib/dom");t.addTouchListeners=function(e,t){var n,s,o,a,l,u,c,h,d,f="scroll",p=0,m=0,g=0,E=0;function v(){var e,n,r;d||(e=window.navigator&&window.navigator.clipboard,n=!1,r=function(r){var s,o,a=r.target.getAttribute("action");if("more"==a||!n)return n=!n,s=t.getCopyText(),o=t.session.getUndoManager().hasUndo(),void d.replaceChild(i.buildDom(n?["span",!s&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],s&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],s&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],o&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),d.firstChild);"paste"==a?e.readText().then(function(e){t.execCommand(a,e)}):a&&("cut"!=a&&"copy"!=a||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(a)),d.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&t.focus()},d=i.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){f="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),r(e)},onclick:r},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container));var s=t.selection.cursor,o=t.renderer.textToScreenCoordinates(s.row,s.column),a=t.container.getBoundingClientRect();d.style.top=o.pageY-a.top-3+"px",d.style.right="10px",d.style.display="",d.firstChild.style.display="none",t.on("input",C)}function C(e){d&&(d.style.display="none"),t.off("input",C)}function D(){l=null,clearTimeout(l);var e=t.selection.getRange(),n=e.contains(c.row,c.column);!e.isEmpty()&&n||(t.selection.moveToPosition(c),t.selection.selectWord()),f="wait",v()}e.addEventListener("contextmenu",function(e){h&&t.textInput.getElement().focus()}),e.addEventListener("touchstart",function(e){var i=e.touches;if(l||i.length>1)return clearTimeout(l),l=null,o=-1,void(f="zoom");h=t.$mouseHandler.isMousePressed=!0;var u=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,v=e.timeStamp;a=v;var C=i[0],S=C.clientX,A=C.clientY;Math.abs(n-S)+Math.abs(s-A)>u&&(o=-1),n=e.clientX=S,s=e.clientY=A,g=E=0;var _=new r(e,t);if(c=_.getDocumentPosition(),v-o<500&&1==i.length&&!p)m++,e.preventDefault(),e.button=0,function(){l=null,clearTimeout(l),t.selection.moveToPosition(c);var e=m>=2?t.selection.getLineRange(c.row):t.session.getBracketRange(c);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),f="wait"}();else{m=0;var y=t.selection.cursor,b=t.selection.isEmpty()?y:t.selection.anchor,T=t.renderer.$cursorLayer.getPixelPosition(y,!0),R=t.renderer.$cursorLayer.getPixelPosition(b,!0),x=t.renderer.scroller.getBoundingClientRect(),w=function(e,t){return(e/=d)*e+(t=t/u-.75)*t};if(e.clientXN?"cursor":"anchor"),f=N<3.5?"anchor":F<3.5?"cursor":"scroll",l=setTimeout(D,450)}o=v}),e.addEventListener("touchend",function(e){h=t.$mouseHandler.isMousePressed=!1,u&&clearInterval(u),"zoom"==f?(f="",p=0):l?(t.selection.moveToPosition(c),p=0,v()):"scroll"==f?(p+=60,u=setInterval(function(){p--<=0&&(clearInterval(u),u=null),Math.abs(g)<.01&&(g=0),Math.abs(E)<.01&&(E=0),p<20&&(g*=.9),p<20&&(E*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*g,10*E),e==t.session.getScrollTop()&&(p=0)},10),e.preventDefault(),C()):v(),clearTimeout(l),l=null}),e.addEventListener("touchmove",function(e){l&&(clearTimeout(l),l=null);var i=e.touches;if(!(i.length>1||"zoom"==f)){var o=i[0],u=n-o.clientX,c=s-o.clientY;if("wait"==f){if(!(u*u+c*c>4))return e.preventDefault();f="cursor"}n=o.clientX,s=o.clientY,e.clientX=o.clientX,e.clientY=o.clientY;var h=e.timeStamp,d=h-a;if(a=h,"scroll"==f){var p=new r(e,t);p.speed=1,p.wheelX=u,p.wheelY=c,10*Math.abs(u)1&&(i=n[n.length-2]);var o=l[t+"Path"];return null==o?o=l.basePath:"/"==r&&(t=r=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+t+r+i+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,r){var i,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{i=e(n)}catch(e){}if(i&&!t.$loading[n])return r&&r(i);if(t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r),!(t.$loading[n].length>1)){var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var r=t.$loading[n];t.$loading[n]=null,r.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,o),a),u()}};var u=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),u=function(){})};function c(i){if(a&&a.document){l.packaged=i||e.packaged||r.packaged||a.define&&n.amdD.packaged;for(var s={},o="",u=document.currentScript||document._currentScript,c=(u&&u.ownerDocument||document).getElementsByTagName("script"),d=0;d=e){for(s=h+1;s=e;)s++;for(a=h,l=s-1;a=t.length||2!=(l=n[i-1])&&3!=l||2!=(u=t[i+1])&&3!=u?4:(s&&(u=3),u==l?u:4);case 10:return 2==(l=i>0?n[i-1]:5)&&i+10&&2==n[i-1])return 2;if(s)return 4;for(f=i+1,d=t.length;f=1425&&m<=2303||64286==m;if(l=t[f],g&&(1==l||7==l))return 1}return i<1||5==(l=t[i-1])?4:n[i-1];case 5:return s=!1,o=!0,r;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:s=!1;case h:return 4}}function g(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?t>191?0:d[t]:5==n?/[\u0591-\u05f4]/.test(e)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?12:/[\u0660-\u0669\u066b-\u066c]/.test(e)?3:1642==t?c:/[\u06f0-\u06f9]/.test(e)?2:7:32==n&&t<=8287?f[255&t]:254==n&&t>=65136?7:4}t.L=0,t.R=1,t.EN=2,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,n,c){if(e.length<2)return{};var d=e.split(""),f=new Array(d.length),E=new Array(d.length),v=[];r=c?1:0,function(e,t,n,c){var h=r?u:l,d=null,f=null,p=null,E=0,v=null,C=-1,D=null,S=null,A=[];if(!c)for(D=0,c=[];D0)if(16==v){for(D=C;D-1){for(D=C;D=0&&8==c[_];_--)t[_]=r}}(d,v,d.length,n);for(var C=0;C7&&n[C]<13||4===n[C]||n[C]===h)?v[C]=t.ON_R:C>0&&"ل"===d[C-1]&&/\u0622|\u0623|\u0625|\u0627/.test(d[C])&&(v[C-1]=v[C]=t.R_H,C++);for(d[d.length-1]===t.DOT&&(v[d.length-1]=t.B),"‫"===d[0]&&(v[0]=t.RLE),C=0;C=0&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,r=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===r;)r=n,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[e];s&&(void 0===t&&(t=this.getSplitIndex()),t>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&s[i]%2!=0&&i++;for(var a=0;at&&s[i]%2==0&&(o+=this.charWidths[s[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(e,t){var n,r=this.bidiMap,i=r.bidiLevels,s=[],o=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,u=!1,c=!1,h=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,f=0;f=a&&dn+s/2;){if(n+=s,r===i.length-1){s=0;break}s=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!=0&&i[r]%2==0?(e0&&i[r-1]%2==0&&i[r]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&0===s&&i[r-1]%2==0||!this.isRtlDir&&0===r&&i[r]%2!=0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!=0&&0!==s&&r--,t=this.bidiMap.logicalFromVisual[r]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(o.prototype),t.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")})};(function(){r.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},this.$setSelection=function(e,t,n,r){var i=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||s)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n,r="number"==typeof e?e:this.lead.row,i=this.session.getFoldLine(r);return i?(r=i.start.row,n=i.end.row):n=r,!0===t?new o(r,0,n,this.session.getLine(n).length):new o(r,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i)this.moveCursorTo(i.end.row,i.end.column);else{if(this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t)),t>=n.length)return this.moveCursorTo(e,n.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(s)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)}},this.$shortWordEndIndex=function(e){var t,n=0,r=/\s/,i=this.session.tokenRe;if(i.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&r.test(t);)n++;if(n<1)for(i.lastIndex=0;(t=e[n])&&!i.test(t);)if(i.lastIndex=0,n++,r.test(t)){if(n>2){n--;break}for(;(t=e[n])&&r.test(t);)n++;if(n>2)break}}return i.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do{e++,r=this.doc.getLine(e)}while(e0&&/^\s*$/.test(r));n=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(t,n-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n,r=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(r.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(r.column),r.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=r.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?r.column=this.$desiredColumn:this.$desiredColumn=r.column);var i=this.session.screenToDocumentPosition(r.row+e,r.column,n);0!==e&&0===t&&i.row===this.lead.row&&i.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[i.row]&&(i.row>0||e>0)&&i.row++,this.moveCursorTo(i.row,i.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch(e){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,n){"use strict";var r=e("./config"),i=2e3,s=function(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],r=[],i=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",a=[],l=0;l1?this.$applyToken:u.token),h>1&&(/\\\d/.test(u.regex)?c=u.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(h=1,c=this.removeCapturingGroups(u.regex)),u.splitRegex||"string"==typeof u.token||a.push(u)),s[i]=l,i+=h,r.push(c),u.onMatch||(u.onMatch=null)}}r.length||(s[0]=0,r.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){i=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var r=[],i=0,s=n.length;ic){var E=e.substring(c,g-m.length);d.type==f?d.value+=E:(d.type&&u.push(d),d={type:f,value:E})}for(var v=0;vi){for(h>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});c1&&n[0]!==r&&n.unshift("#tmp",r),{tokens:u,state:n.length?n:r}},this.reportError=r.reportError}).call(s.prototype),t.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var n in e){for(var r=e[n],i=0;i=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(void 0!==n)return n;for(n=0;t>0;)n+=e[t-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)}}).call(i.prototype),t.TokenIterator=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r,i=e("../../lib/oop"),s=e("../behaviour").Behaviour,o=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],u=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],c={},h={'"':'"',"'":"'"},d=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,c.rangeCount!=e.multiSelect.rangeCount&&(c={rangeCount:e.multiSelect.rangeCount})),c[t])return r=c[t];r=c[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},f=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},p=function(e){this.add("braces","insertion",function(t,n,i,s,o){var l=i.getCursorPosition(),u=s.doc.getLine(l.row);if("{"==o){d(i);var c=i.getSelectionRange(),h=s.doc.getTextRange(c);if(""!==h&&"{"!==h&&i.getWrapBehavioursEnabled())return f(c,h,"{","}");if(p.isSaneInsertion(i,s))return/[\]\}\)]/.test(u[l.column])||i.inMultiSelectMode||e&&e.braces?(p.recordAutoInsert(i,s,"}"),{text:"{}",selection:[1,1]}):(p.recordMaybeInsert(i,s,"{"),{text:"{",selection:[1,1]})}else if("}"==o){if(d(i),"}"==u.substring(l.column,l.column+1)&&null!==s.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&p.isAutoInsertedClosing(l,u,o))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==o||"\r\n"==o){d(i);var m="";if(p.isMaybeInsertedClosing(l,u)&&(m=a.stringRepeat("}",r.maybeInsertedBrackets),p.clearMaybeInsertedClosing()),"}"===u.substring(l.column,l.column+1)){var g=s.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!g)return null;var E=this.$getIndent(s.getLine(g.row))}else{if(!m)return void p.clearMaybeInsertedClosing();E=this.$getIndent(u)}var v=E+s.getTabString();return{text:"\n"+v+"\n"+E+m,selection:[1,v.length,1,v.length]}}p.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,i,s){var o=i.doc.getTextRange(s);if(!s.isMultiLine()&&"{"==o){if(d(n),"}"==i.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s;r.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if("("==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"(",")");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(")"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"("==s&&(d(n),")"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("brackets","insertion",function(e,t,n,r,i){if("["==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"[","]");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if("]"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"["==s&&(d(n),"]"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("string_dquotes","insertion",function(e,t,n,r,i){var s=r.$mode.$quotes||h;if(1==i.length&&s[i]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(i))return;d(n);var o=i,a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(!(""===l||1==l.length&&s[l])&&n.getWrapBehavioursEnabled())return f(a,l,o,o);if(!l){var u=n.getCursorPosition(),c=r.doc.getLine(u.row),p=c.substring(u.column-1,u.column),m=c.substring(u.column,u.column+1),g=r.getTokenAt(u.row,u.column),E=r.getTokenAt(u.row,u.column+1);if("\\"==p&&g&&/escape/.test(g.type))return null;var v,C=g&&/string|escape/.test(g.type),D=!E||/string|escape/.test(E.type);if(m==o)(v=C!==D)&&/string\.end/.test(E.type)&&(v=!1);else{if(C&&!D)return null;if(C&&D)return null;var S=r.$mode.tokenRe;S.lastIndex=0;var A=S.test(p);S.lastIndex=0;var _=S.test(p);if(A||_)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;var y=c[u.column-2];if(p==o&&(y==o||S.test(y)))return null;v=!0}return{text:v?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.$mode.$quotes||h,o=r.doc.getTextRange(i);if(!i.isMultiLine()&&s.hasOwnProperty(o)&&(d(n),r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==o))return i.end.column++,i})};p.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new o(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",l)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var i=new o(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",l))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",u)},p.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},p.recordAutoInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isAutoInsertedClosing(i,s,r.autoInsertedLineEnd[0])||(r.autoInsertedBrackets=0),r.autoInsertedRow=i.row,r.autoInsertedLineEnd=n+s.substr(i.column),r.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isMaybeInsertedClosing(i,s)||(r.maybeInsertedBrackets=0),r.maybeInsertedRow=i.row,r.maybeInsertedLineStart=s.substr(0,i.column)+n,r.maybeInsertedLineEnd=s.substr(i.column),r.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return r.autoInsertedBrackets>0&&e.row===r.autoInsertedRow&&n===r.autoInsertedLineEnd[0]&&t.substr(e.column)===r.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return r.maybeInsertedBrackets>0&&e.row===r.maybeInsertedRow&&t.substr(e.column)===r.maybeInsertedLineEnd&&t.substr(0,e.column)==r.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){r.autoInsertedLineEnd=r.autoInsertedLineEnd.substr(1),r.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){r&&(r.maybeInsertedBrackets=0,r.maybeInsertedRow=-1)},i.inherits(p,s),t.CstyleBehaviour=p}),ace.define("ace/unicode",["require","exports","module"],function(e,t,n){"use strict";for(var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,s=[],o=0;o2?r%u!=u-1:r%u==0})}else{if(!this.blockComment)return!1;var f=this.blockComment.start,p=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+l.escapeRegExp(f)+")"),g=new RegExp("(?:"+l.escapeRegExp(p)+")\\s*$"),E=function(e,t){C(e,t)||s&&!/\S/.test(e)||(i.insertInLine({row:t,column:e.length},p),i.insertInLine({row:t,column:a},f))},v=function(e,t){var n;(n=e.match(g))&&i.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(m))&&i.removeInLine(t,n[1].length,n[0].length)},C=function(e,n){if(m.test(e))return!0;for(var r=t.getTokens(n),i=0;ie.length&&(S=e.length)}),a==1/0&&(a=S,s=!1,o=!1),c&&a%u!=0&&(a=Math.floor(a/u)*u),D(o?v:E)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(i){!i.start&&i[0]&&(i=i[0]);var s,o,a=(m=new u(t,r.row,r.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var h,d;a&&/comment/.test(a.type);){if(-1!=(g=a.value.indexOf(i.start))){var f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g;h=new c(f,p,f,p+i.start.length);break}a=m.stepBackward()}var m;for(a=(m=new u(t,r.row,r.column)).getCurrentToken();a&&/comment/.test(a.type);){var g;if(-1!=(g=a.value.indexOf(i.end))){f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g,d=new c(f,p,f,p+i.end.length);break}a=m.stepForward()}d&&t.remove(d),h&&(t.remove(h),s=h.start.row,o=-i.start.length)}else o=i.start.length,s=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);l.start.row==s&&(l.start.column+=o),l.end.row==s&&(l.end.column+=o),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var n=e[t],i=n.prototype.$id,s=r.$modes[i];s||(r.$modes[i]=s=new n),r.$modes[t]||(r.$modes[t]=s),this.$embeds.push(t),this.$modes[t]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;tthis.row)){var n=function(t,n,r){var i="insert"==t.action,s=(i?1:-1)*(t.end.row-t.start.row),o=(i?1:-1)*(t.end.column-t.start.column),a=t.start,l=i?a:t.end;return e(n,a,r)?{row:n.row,column:n.column}:e(l,n,!r)?{row:n.row+s,column:n.column+(n.row==l.row?o:0)}:{row:a.row,column:a.column}}(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(e,t,n){var r;if(r=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=r.row||this.column!=r.column){var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=e("./anchor").Anchor,l=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new a(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();void 0===e?e=n:e<0?e=0:e>=n&&(e=n-1,t=void 0);var r=this.getLine(e);return null==t&&(t=r.length),{row:e,column:t=Math.min(Math.max(t,0),r.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof o||(e=o.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,r=n.length-t+1,i=e.start.row,s=e.start.column,o=0,a=0;o20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,-1==r&&(r=t),s<=r&&n.fireUpdateEvent(s,r)}}};(function(){r.implement(this,i),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens}}).call(s.prototype),t.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=(e("./lib/oop"),e("./range").Range),s=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,n,s){if(this.regExp)for(var o=s.firstRow,a=s.lastRow,l=o;l<=a;l++){var u=this.cache[l];null==u&&((u=r.getMatchOffsets(n.getLine(l),this.regExp)).length>this.MAX_RANGES&&(u=u.slice(0,this.MAX_RANGES)),u=u.map(function(e){return new i(l,e.offset,l,e.offset+e.length)}),this.cache[l]=u.length?u:"");for(var c=u.length;c--;)t.drawSingleLineMarker(e,u[c].toScreenRange(n),this.clazz,s)}}}).call(s.prototype),t.SearchHighlight=s}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range;function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var r,i,s=0,o=this.folds,a=!0;null==t&&(t=this.end.row,n=this.end.column);for(var l=0;l0)){var l=r(e,o.start);return 0===a?t&&0!==l?-s-2:s:l>0||0===l&&!t?s:-s-1}}return-s-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},this.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],n=this.ranges,i=(n=n.sort(function(e,t){return r(e.start,t.start)}))[0],s=1;s=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=r);o++);if("insert"==e.action){for(var l=i-r,u=-t.column+n.column;or);o++)if(c.start.row==r&&c.start.column>=t.column&&(c.start.column==t.column&&this.$bias<=0||(c.start.column+=u,c.start.row+=l)),c.end.row==r&&c.end.column>=t.column){if(c.end.column==t.column&&this.$bias<0)continue;c.end.column==t.column&&u>0&&oc.start.column&&c.end.column==s[o+1].start.column&&(c.end.column-=u),c.end.column+=u,c.end.row+=l}}else for(l=r-i,u=t.column-n.column;oi);o++)c.end.rowt.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=u,c.end.row+=l):c.end.row>i&&(c.end.row+=l),c.start.rowt.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=u,c.start.row+=l):c.start.row>i&&(c.start.row+=l);if(0!=l&&o=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;for(t&&(r=n.indexOf(t)),-1==r&&(r=0);r=e)return i}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,r=t-e+1,i=0;i=t){a=e?r-=t-a:r=0);break}o>=e&&(r-=a>=e?o-a:o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n,r=this.$foldData,o=!1;e instanceof s?n=e:(n=new s(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,u=n.end.row,c=n.end.column,h=this.getFoldAt(a,l,1),d=this.getFoldAt(u,c,-1);if(h&&d==h)return h.addSubFold(n);h&&!h.range.isStart(a,l)&&this.removeFold(h),d&&!d.range.isEnd(u,c)&&this.removeFold(d);var f=this.getFoldsInRange(n.range);f.length>0&&(this.removeFolds(f),f.forEach(function(e){n.addSubFold(e)}));for(var p=0;p0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;if(null==e?(n=new r(0,0,this.getLength(),0),t=!0):n="number"==typeof e?new r(e,0,e,this.getLine(e).length):"row"in e?r.fromPoints(e,e):e,i=this.getFoldsInRangeList(n),t)this.removeFolds(i);else for(var s=i;s.length;)this.expandFolds(s),s=this.getFoldsInRangeList(n);if(i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){null==r&&(r=e.start.row),null==i&&(i=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var s=this.doc,o="";return e.walk(function(e,t,n,a){if(!(tc)break}while(s&&l.test(s.type));s=i.stepBackward()}else s=i.getCurrentToken();return u.end.row=i.getCurrentTokenRow(),u.end.column=i.getCurrentTokenColumn()+s.value.length-2,u}},this.foldAll=function(e,t,n){null==n&&(n=1e5);var r=this.foldWidgets;if(r){t=t||this.getLength();for(var i=e=e||0;i=e){i=s.end.row;try{var o=this.addFold("...",s);o&&(o.collapseChildren=n)}catch(e){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};for(var r,i=e-1;i>=0;){var s=n[i];if(null==s&&(s=n[i]=this.getFoldWidget(i)),"start"==s){var o=this.getFoldWidgetRange(i);if(r||(r=o),o&&o.end.row>=e)break}i--}return{range:-1!==i&&o,firstRange:r}},this.onFoldWidgetClick=function(e,t){var n={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var r=t.target||t.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),r=this.getLine(e),i="end"===n?-1:1,s=this.getFoldAt(e,-1===i?0:r.length,i);if(s)return t.children||t.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()&&(s=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(s.range))return this.removeFold(s),s;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,u=a.range.end.row;this.foldAll(l,u,t.all?1e4:0)}else t.children?(u=o?o.end.row:this.getLength(),this.foldAll(e+1,u,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var r=this.getParentFoldRangeData(t,!0);if(n=r.range||r.firstRange){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold("...",n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){"use strict";var r=e("../token_iterator").TokenIterator,i=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(""==n)return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t,n=this.getLine(e.row),r=!0,s=n.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(o||(s=n.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),r=!1),!o)return null;if(o[1]){if(!(a=this.$findClosingBracket(o[1],e)))return null;t=i.fromPoints(e,a),r||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a;if(!(a=this.$findOpeningBracket(o[2],e)))return null;t=i.fromPoints(a,e),r||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn()-2,u=a.value;;){for(;l>=0;){var c=u.charAt(l);if(c==i){if(0==(s-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else c==e&&(s+=1);l-=1}do{a=o.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(u=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn();;){for(var u=a.value,c=u.length;ln&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>1,s=e[i];if(t>s)n=i+1;else{if(!(t=t);s++);return(n=r[s])?(n.index=s,n.start=i-n.value.length,n):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe)),r)var i=this.tokenRe;else i=/^\s+$/.test(n.slice(t-1,t+1))?/\s/:this.nonTokenRe;var s=t;if(s>0){do{s--}while(s>=0&&n.charAt(s).match(i));s++}for(var o=t;oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,s=this.$foldData[i],o=s?s.start.row:1/0,a=t.length,l=0;lo){if((l=s.end.row+1)>=a)break;o=(s=this.$foldData[i++])?s.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>r&&(r=n[l])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var r=e[n];"insert"==r.action||"remove"==r.action?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;ne.end.column&&(s.start.column+=u),s.end.row==e.end.row&&s.end.column>e.end.column&&(s.end.column+=u)),o&&s.start.row>=e.end.row&&(s.start.row+=o,s.end.row+=o)}if(s.end=this.insert(s.start,r),i.length){var a=e.start,l=s.start,u=(o=l.row-a.row,l.column-a.column);this.addFolds(i.map(function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=u),e.end.row==a.row&&(e.end.column+=u),e.start.row+=o,e.end.row+=o,e}))}return s},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},this.outdentRows=function(e){for(var t=e.collapseRows(),n=new c(0,0,0,0),r=this.getTabSize(),i=t.start.row;i<=t.end.row;++i){var s=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o0){var i;if((i=this.getRowFoldEnd(t+n))>this.doc.getLength()-1)return 0;r=i-t}else e=this.$clipRowToDocument(e),r=(t=this.$clipRowToDocument(t))-e+1;var s=new c(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(e){return(e=e.clone()).start.row+=r,e.end.row+=r,e}),a=0==n?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+r,a),o.length&&this.addFolds(o),r},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1&&(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,i=e.end,s=r.row,o=i.row,a=o-s,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[t?"$wrapData":"$rowLengthCache"].splice(s,a);var u=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var c=0;if(m=this.getFoldLine(i.row)){m.addRemoveChars(i.row,i.column,r.column-i.column),m.shiftRow(-a);var h=this.getFoldLine(s);h&&h!==m&&(h.merge(m),m=h),c=u.indexOf(m)+1}for(;c=i.row&&m.shiftRow(-a);o=s}else{var d=Array(a);d.unshift(s,0);var f=t?this.$wrapData:this.$rowLengthCache;if(f.splice.apply(f,d),u=this.$foldData,c=0,m=this.getFoldLine(s)){var p=m.range.compareInside(r.row,r.column);0==p?(m=m.split(r.row,r.column))&&(m.shiftRow(a),m.addRemoveChars(o,0,i.column-r.column)):-1==p&&(m.addRemoveChars(s,0,i.column-r.column),m.shiftRow(a)),c=u.indexOf(m)+1}for(;c=s&&m.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===n&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(m=this.getFoldLine(s))&&m.addRemoveChars(s,r.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),l},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(n,r){var i,s,o=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,u=this.$wrapLimit,c=n;for(r=Math.min(r,o.length-1);c<=r;)(s=this.getFoldLine(c,s))?(i=[],s.walk(function(n,r,s,a){var l;if(null!=n){(l=this.$getDisplayTokens(n,i.length))[0]=e;for(var u=1;u=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}this.$computeWrapSplits=function(n,r,i){if(0==n.length)return[];var s=[],o=n.length,a=0,l=0,u=this.$wrapAsCode,c=this.$indentedSoftWrap,h=r<=Math.max(2*i,8)||!1===c?0:Math.floor(r/2);function d(e){for(var t=e-a,r=a;rr-f;){var p=a+r-f;if(n[p-1]>=10&&n[p]>=10)d(p);else if(n[p]!=e&&n[p]!=t){for(var m=Math.max(p-(r-(r>>2)),a-1);p>m&&n[p]m&&n[p]m&&9==n[p];)p--}else for(;p>m&&n[p]<10;)p--;p>m?d(++p):(2==n[p=a+r]&&p--,d(p-f))}else{for(;p!=a-1&&n[p]!=e;p--);if(p>a){d(p);continue}for(p=a+r;p39&&o<48||o>57&&o<64?i.push(9):o>=4352&&n(o)?i.push(1,2):i.push(1)}return i},this.$getStringScreenWidth=function(e,t,r){if(0==t)return[0,0];var i,s;for(null==t&&(t=1/0),r=r||0,s=0;s=4352&&n(i)?r+=2:r+=1,!(r>t));s++);return[r,s]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0){a=u[c],s=this.$docRowCache[c];var d=e>u[h-1]}else d=!h;for(var f=this.getLength()-1,p=this.getNextFoldLine(s),m=p?p.start.row:1/0;a<=e&&!(a+(l=this.getRowLength(s))>e||s>=f);)a+=l,++s>m&&(s=p.end.row+1,m=(p=this.getNextFoldLine(s,p))?p.start.row:1/0),d&&(this.$docRowCache.push(s),this.$screenRowCache.push(a));if(p&&p.start.row<=s)r=this.getFoldDisplayLine(p),s=p.start.row;else{if(a+l<=e||s>f)return{row:f,column:this.getLine(f).length};r=this.getLine(s),p=null}var g=0,E=Math.floor(e-a);if(this.$useWrapMode){var v=this.$wrapData[s];v&&(i=v[E],E>0&&v.length&&(g=v.indent,o=v[E-1]||v[v.length-1],r=r.substring(o)))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+E,s,E)&&(t=this.$bidiHandler.offsetToCol(n)),o+=this.$getStringScreenWidth(r,t-g)[1],this.$useWrapMode&&o>=i&&(o=i-1),p?p.idxToPosition(o):{row:s,column:o}},this.documentToScreenPosition=function(e,t){if(void 0===t)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r,i=0,s=null;(r=this.getFoldAt(e,t,1))&&(e=r.start.row,t=r.start.column);var o,a=0,l=this.$docRowCache,u=this.$getRowCacheIndex(l,e),c=l.length;if(c&&u>=0){a=l[u],i=this.$screenRowCache[u];var h=e>l[c-1]}else h=!c;for(var d=this.getNextFoldLine(a),f=d?d.start.row:1/0;a=f){if((o=d.end.row+1)>e)break;f=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;i+=this.getRowLength(a),a=o,h&&(this.$docRowCache.push(a),this.$screenRowCache.push(i))}var p="";d&&a>=f?(p=this.getFoldDisplayLine(d,e,t),s=d.start.row):(p=this.getLine(e).substring(0,t),s=e);var m=0;if(this.$useWrapMode){var g=this.$wrapData[s];if(g){for(var E=0;p.length>=g[E];)i++,E++;p=p.substring(g[E-1]||0,p.length),m=E>0?g.indent:0}}return{row:i,column:m+this.$getStringScreenWidth(p)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,r=0,i=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);ri&&(r=t.end.row+1,i=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var o=this.$foldData,a=0;an);s++);return[r,s]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=n}.call(p.prototype),e("./edit_session/folding").Folding.call(p.prototype),e("./edit_session/bracket_match").BracketMatch.call(p.prototype),o.defineOptions(p.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=p}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(){this.$options={}};(function(){this.set=function(e){return i.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i,o){return r=new s(e,n,i,o),!(n==o&&t.start&&t.start.start&&0!=t.skipCurrent&&r.isEqual(t.start)&&(r=null,1))}),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],a=t.re;if(t.$isMultiLine){var l,u=a.length,c=i.length-u;e:for(var h=a.offset||0;h<=c;h++){for(var d=0;dm||(o.push(l=new s(h,m,h+u-1,g)),u>2&&(h=h+u-2))}}else for(var E=0;ES&&o[d].end.row==n.end.row;)d--;for(o=o.slice(E,d+1),E=0,d=o.length;E=a;n--)if(h(n,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(n=l,a=o.row;n>=a;n--)if(h(n,Number.MAX_VALUE,e))return}};else u=function(e){var n=o.row;if(!h(n,o.column,e)){for(n+=1;n<=l;n++)if(h(n,0,e))return;if(0!=t.wrap)for(n=a,l=o.row;n<=l;n++)if(h(n,0,e))return}};if(t.$isMultiLine)var c=n.length,h=function(t,i,s){var o=r?t-c+1:t;if(!(o<0)){var a=e.getLine(o),l=a.search(n[0]);if(!(!r&&li))return!!s(o,l,o+c-1,h)||void 0}}};else h=r?function(t,r,i){var s,o=e.getLine(t),a=[],l=0;for(n.lastIndex=0;s=n.exec(o);){var u=s[0].length;if(l=s.index,!u){if(l>=o.length)break;n.lastIndex=l+=1}if(s.index+u>r)break;a.push(s.index,u)}for(var c=a.length-1;c>=0;c-=2){var h=a[c-1];if(i(t,h,t,h+(u=a[c])))return!0}}:function(t,r,i){var s,o,a=e.getLine(t);for(n.lastIndex=r;o=n.exec(a);){var l=o[0].length;if(i(t,s=o.index,t,s+l))return!0;if(!l&&(n.lastIndex=s+=1,s>=a.length))return!1}};return{forEach:u}}}).call(o.prototype),t.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/keys"),i=e("../lib/useragent"),s=r.KEY_MODS;function o(e,t){this.platform=t||(i.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function a(e,t){o.call(this,e,t),this.$singleCommand=!1}a.prototype=o.prototype,function(){function e(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var n=e&&("string"==typeof e?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var s=r[i];if(s==e)delete r[i];else if(Array.isArray(s)){var o=s.indexOf(e);-1!=o&&(s.splice(o,1),1==s.length&&(r[i]=s[0]))}}},this.bindKey=function(e,t,n){if("object"==typeof e&&e&&(null==n&&(n=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach(function(e){var r="";if(-1!=e.indexOf(" ")){var i=e.split(/\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=s[t.hashId]+t.key;r+=(r?" ":"")+n,this._addCommandToBinding(r,"chainKeys")},this),r+=" "}var o=this.parseKeys(e),a=s[o.hashId]+o.key;this._addCommandToBinding(r+a,t,n)},this)},this._addCommandToBinding=function(t,n,r){var i,s=this.commandKeyBinding;if(n)if(!s[t]||this.$singleCommand)s[t]=n;else{Array.isArray(s[t])?-1!=(i=s[t].indexOf(n))&&s[t].splice(i,1):s[t]=[s[t]],"number"!=typeof r&&(r=e(n));var o=s[t];for(i=0;ir);i++);o.splice(i,0,n)}else delete s[t]},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(n){if("string"==typeof n)return this.bindKey(n,t);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=t),this.addCommand(n))}},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),i=r[n];if(r.FUNCTION_KEYS[i])n=r.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:n.toUpperCase(),hashId:-1}}for(var s=0,o=t.length;o--;){var a=r.KEY_MODS[t[o]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[o]+" in "+e),!1;s|=a}return{key:n,hashId:s}},this.findKeyCommand=function(e,t){var n=s[e]+t;return this.commandKeyBinding[n]},this.handleKeyboard=function(e,t,n,r){if(!(r<0)){var i=s[t]+n,o=this.commandKeyBinding[i];return e.$keyChain&&(e.$keyChain+=" "+i,o=this.commandKeyBinding[e.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(e.$keyChain&&(t&&4!=t||1!=n.length?(-1==t||r>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-i.length-1)),{command:o}):(e.$keyChain=e.$keyChain||i,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(o.prototype),t.HashHandler=o,t.MultiHashHandler=a}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){i.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};r.inherits(o,i),function(){r.implement(this,s),this.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var i={editor:t,command:e,args:n};return i.returnValue=this._emit("exec",i),this._signal("afterExec",i),!1!==i.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map(function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=e("../config"),s=e("../range").Range;function o(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(e){i.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,a=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(n.row),u=n.row+1;u<=i.row+1;u++){var c=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(u)));0!==c.length&&(c=" "+c),l+=c}i.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;o=i.lastRow||r.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var i=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&-1!==n.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var n=this;E.loadModule(["keybinding",e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||i.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=t.findMatchingBracket(e.getCursorPosition());if(n)var r=new f(n.row,n.column,n.row,n.column+1);else t.$mode.getMatching&&(r=t.$mode.getMatching(e.session));r&&(t.$bracketHighlight=t.addMarker(r,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=e.getCursorPosition(),r=new v(e.session,n.row,n.column),i=r.getCurrentToken();if(!i||!/\b(?:tag-open|tag-name)/.test(i.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1==i.type.indexOf("tag-open")||(i=r.stepForward())){var s=i.value,o=0,a=r.stepBackward();if("<"==a.value)do{a=i,(i=r.stepForward())&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"=0);else{do{i=a,a=r.stepBackward(),i&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var n=new f(e.row,e.column,e.row,1/0);n.id=t.addMarker(n,"ace_active-line","screenLine"),t.$highlightLineMarker=n}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var n=t.start.column,r=t.end.column,i=e.getLine(t.start.row),s=i.substring(n,r);if(!(s.length>5e3)&&/[\w\d]/.test(s)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),a=i.substring(n-1,r+1);if(o.test(a))return o}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var r=this.selection.getAllRanges(),i=0;ia.search(/\S|$/)){var l=a.substr(i.column).search(/\S|$/);n.doc.removeInLine(i.row,i.column,i.column+l)}}this.clearSelection();var u=i.column,c=n.getState(i.row),h=(a=n.getLine(i.row),r.checkOutdent(c,a,e));if(n.insert(i,e),s&&s.selection&&(2==s.selection.length?this.selection.setSelectionRange(new f(i.row,u+s.selection[0],i.row,u+s.selection[1])):this.selection.setSelectionRange(new f(i.row+s.selection[0],s.selection[1],i.row+s.selection[2],s.selection[3]))),n.getDocument().isNewLine(e)){var d=r.getNextLineIndent(c,a.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},d)}h&&r.autoOutdent(c,n,i.row)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(e,t){var n;(t.extendLeft||t.extendRight)&&((n=this.selection.getRange()).start.column-=t.extendLeft,n.end.column+=t.extendRight,this.selection.setRange(n),e||n.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((n=this.selection.getRange()).start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,"deletion",this,n,t);if(0===t.end.column){var s=n.getTextRange(t);if("\n"==s[s.length-1]){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var n,r,i=this.session.getLine(e.row);tt.toLowerCase()?1:0});var i=new f(0,0,0,0);for(r=e.first;r<=e.last;r++){var s=t.getLine(r);i.start.row=r,i.end.row=r,i.end.column=s.length,t.replace(i,n[r-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var r=this.session.getLine(e);n.lastIndex=t)return{value:i[0],start:i.index,end:i.index+i[0].length}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new f(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var s=this.getNumberAt(t,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,a=s.start+s.value.length-o,l=parseFloat(s.value);l*=Math.pow(10,a),o!==s.end&&n=a&&o<=l&&(n=t,u.selection.clearSelection(),u.moveCursorTo(e,a+r),u.selection.selectTo(e,l+r)),a=l});for(var c,h=this.$toggleWordPairs,d=0;df+1)break;f=p.last}for(c--,a=this.session.$moveLines(d,f,t?0:e),t&&-1==e&&(h=c+1);h<=c;)o[h].moveBy(a,0),h++;t||(a=0),l+=a}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);!0===t?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):!1===t&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,i*r.lineHeight),null!=t&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new v(this.session,n.row,n.column),i=r.getCurrentToken(),s=i||r.stepForward();if(s){var o,a,l=!1,u={},c=n.column-s.start,h={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;c=0;--s)this.$tryReplace(n[s],e)&&r++;return this.selection.setSelectionRange(i),r},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return null!==(t=this.$search.replace(n,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&r.mixin(t,e);var i=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(i)||this.$search.$options.needle)||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var s=this.$search.find(this.session);return t.preventScroll?s:s?(this.revealRange(s,n),s):(t.backwards?i.start=i.end:i.end=i.start,void this.selection.setRange(i))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(e){var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var s=this.on("changeSelection",function(){r=!0}),o=this.renderer.on("beforeRender",function(){r&&(t=n.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,s=e.$cursorLayer.$pixelPos,o=e.layerConfig,a=s.top-o.offset;null!=(r=s.top>=0&&a+t.top<0||!(s.topwindow.innerHeight)&&null)&&(i.style.top=a+"px",i.style.left=s.left+"px",i.style.height=o.lineHeight+"px",i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",o))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,i.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},this.prompt=function(e,t,n){var r=this;E.loadModule("./ext/prompt",function(i){i.prompt(r,e,t,n)})}}.call(D.prototype),E.defineOptions(D.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?S.attach(this):S.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?S.attach(this):S.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.renderer.$composition||this.getValue();if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),i.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!e&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),i.addCssClass(this.container,"ace_hasPlaceholder");var t=i.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var S={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=D}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,n){this.$fromUndo||e!=this.$lastDelta&&(!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,r=n.length;r--;){var i=n[r][0];if(i.id<=e)break;i.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?a(e):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(r.prototype);var i=e("./range").Range,s=i.comparePoints;function o(e){return{row:e.row,column:e.column}}function a(e){if(e=e||this,Array.isArray(e))return e.map(a).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function u(e,t){var n="insert"==e.action,r="insert"==t.action;if(n&&r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}else if(!n&&r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(!n&&!r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}return[t,e]}function c(e,t){for(var n=e.length;n--;)for(var r=0;r=0?d(e,t,-1):(s(e.start,t.start)<=0||d(e,i.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!n&&r)s(t.start,e.end)>=0?d(t,e,-1):(s(t.start,e.start)<=0||d(t,i.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{var o,a;if(!(s(t.end,e.start)<=0))return s(e.start,t.start)<0&&(o=e,e=p(e,t.start)),s(e.end,t.end)>0&&(a=p(e,t.end)),f(t.end,e.start,e.end,-1),a&&!o&&(e.lines=a.lines,e.start=a.start,e.end=a.end,a=e),[t,o,a].filter(Boolean);d(e,t,-1)}return[t,e]}function d(e,t,n){f(e.start,t.start,t.end,n),f(e.end,t.start,t.end,n)}function f(e,t,n,r){e.row==(1==r?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function p(e,t){var n=e.lines,r=e.end;e.end=o(t);var i=e.end.row-e.start.row,s=n.splice(i,n.length),a=i?t.column:t.column-e.start.column;return n.push(s[0].substring(0,a)),s[0]=s[0].substr(a),{start:o(t),end:r,lines:s,action:e.action}}function m(e,t){t=function(e){return{start:o(e.start),end:o(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var n=e.length;n--;){for(var r=e[n],i=0;is&&(l=i.end.row+1,s=(i=t.getNextFoldLine(l,i))?i.start.row:1/0),l>r){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,e,this.session,u),this.$lines.push(o)),this.$renderCell(o,e,i,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,i=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(i=t.getLength()+r-1);var s=n?n.getWidth(t,i,e):i.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();(s+=o.left+o.right)===this.gutterWidth||isNaN(s)||(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(r.row>this.$cursorRow){var i=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&i&&i.start.row==t[n-1].row))break;r=t[n-1]}r.element.className="ace_gutter-active-line "+r.element.className,this.$cursorCell=r;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;if(this.oldLastRow=n,!t||r0;i--)this.$lines.shift();if(r>n)for(i=this.session.getFoldedRowCount(n+1,r);i>0;i--)this.$lines.pop();e.firstRowr&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,n){for(var r=[],i=t,s=this.session.getNextFoldLine(i),o=s?s.start.row:1/0;i>o&&(i=s.end.row+1,o=(s=this.session.getNextFoldLine(i,s))?s.start.row:1/0),!(i>n);){var a=this.$lines.createCell(i,e,this.session,u);this.$renderCell(a,e,s,i),r.push(a),i++}return r},this.$renderCell=function(e,t,n,i){var s=e.element,o=this.session,a=s.childNodes[0],l=s.childNodes[1],u=o.$firstLineNumber,c=o.$breakpoints,h=o.$decorations,d=o.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&o.foldWidgets,p=n?n.start.row:Number.MAX_VALUE,m="ace_gutter-cell ";if(this.$highlightGutterLine&&(i==this.$cursorRow||n&&i=p&&this.$cursorRow<=n.end.row)&&(m+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),c[i]&&(m+=c[i]),h[i]&&(m+=h[i]),this.$annotations[i]&&(m+=this.$annotations[i].className),s.className!=m&&(s.className=m),f){var g=f[i];null==g&&(g=f[i]=o.getFoldWidget(i))}if(g){m="ace_fold-widget ace_"+g,"start"==g&&i==p&&in.right-t.right?"foldWidgets":void 0}}).call(l.prototype),t.Gutter=l}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/dom"),s=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){function e(e,t,n,r){return(e?1:0)|(t?2:0)|(n?4:0)|(r?8:0)}this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},this.update=function(e){if(e){var t;for(var n in this.config=e,this.i=0,this.markers){var r=this.markers[n];if(r.range){var i=r.range.clipRows(e.firstRow,e.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),r.renderer){var s=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,s,e)}else"fullLine"==r.type?this.drawFullLineMarker(t,i,r.clazz,e):"screenLine"==r.type?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?"text"==r.type?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+" ace_start ace_br15",e)}else r.update(t,this,this.session,e)}if(-1!=this.i)for(;this.if,c==u),s,c==u?0:1,o)},this.drawMultiLineMarker=function(e,t,n,r,i){var s=this.$padding,o=r.lineHeight,a=this.$getTop(t.start.row,r),l=s+t.start.column*r.characterWidth;if(i=i||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((u=t.clone()).end.row=u.start.row,u.end.column=this.session.getLine(u.start.row).length,this.drawBidiSingleLineMarker(e,u,n+" ace_br1 ace_start",r,null,i)):this.elt(n+" ace_br1 ace_start","height:"+o+"px;right:0;top:"+a+"px;left:"+l+"px;"+(i||"")),this.session.$bidiHandler.isBidiRow(t.end.row)){var u;(u=t.clone()).start.row=u.end.row,u.start.column=0,this.drawBidiSingleLineMarker(e,u,n+" ace_br12",r,null,i)}else{a=this.$getTop(t.end.row,r);var c=t.end.column*r.characterWidth;this.elt(n+" ace_br12","height:"+o+"px;width:"+c+"px;top:"+a+"px;left:"+s+"px;"+(i||""))}if(!((o=(t.end.row-t.start.row-1)*r.lineHeight)<=0)){a=this.$getTop(t.start.row+1,r);var h=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+o+"px;right:0;top:"+a+"px;left:"+s+"px;"+(i||""))}},this.drawSingleLineMarker=function(e,t,n,r,i,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,i,s);var o=r.lineHeight,a=(t.end.column+(i||0)-t.start.column)*r.characterWidth,l=this.$getTop(t.start.row,r),u=this.$padding+t.start.column*r.characterWidth;this.elt(n,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+u+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(e,t,n,r,i,s){var o=r.lineHeight,a=this.$getTop(t.start.row,r),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(n,"height:"+o+"px;width:"+e.width+(i||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-s),this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))},this.drawScreenLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))}}).call(s.prototype),t.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=function(e){this.dom=i,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){r.implement(this,a),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;nc&&(a=l.end.row+1,c=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(a>i);){var h=s[o++];if(h){this.dom.removeChildren(h),this.$renderLine(h,a,a==c&&l),u&&(h.style.top=this.$lines.computeLineTop(a,e,this.session)+"px");var d=e.lineHeight*this.session.getRowLength(a)+"px";h.style.height!=d&&(u=!0,h.style.height=d)}a++}if(u)for(;o0;i--)this.$lines.shift();if(t.lastRow>e.lastRow)for(i=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);i>0;i--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,n){for(var r=[],s=t,o=this.session.getNextFoldLine(s),a=o?o.start.row:1/0;s>a&&(s=o.end.row+1,a=(o=this.session.getNextFoldLine(s,o))?o.start.row:1/0),!(s>n);){var l=this.$lines.createCell(s,e,this.session),u=l.element;this.dom.removeChildren(u),i.setStyle(u.style,"height",this.$lines.computeLineHeight(s,e,this.session)+"px"),i.setStyle(u.style,"top",this.$lines.computeLineTop(s,e,this.session)+"px"),this.$renderLine(u,s,s==a&&o),this.$useLineGroups()?u.className="ace_line_group":u.className="ace_line",r.push(l),s++}return r},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,n=e.lastRow,r=this.$lines;r.getLength();)r.pop();r.push(this.$renderLinesFragment(e,t,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,r){for(var i,o=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),u=0;i=a.exec(r);){var c=i[1],h=i[2],d=i[3],f=i[4],p=i[5];if(o.showInvisibles||!h){var m=u!=i.index?r.slice(u,i.index):"";if(u=i.index+i[0].length,m&&l.appendChild(this.dom.createTextNode(m,this.element)),c){var g=o.session.getScreenTabSize(t+i.index);l.appendChild(o.$tabStrings[g].cloneNode(!0)),t+=g-1}else h?o.showInvisibles?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",v.textContent=s.stringRepeat(o.SPACE_CHAR,h.length),l.appendChild(v)):l.appendChild(this.com.createTextNode(h,this.element)):d?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",v.textContent=s.stringRepeat(o.SPACE_CHAR,d.length),l.appendChild(v)):f?(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className=o.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",v.textContent=o.showInvisibles?o.SPACE_CHAR:f,l.appendChild(v)):p&&(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className="ace_cjk",v.textContent=p,l.appendChild(v))}}if(l.appendChild(this.dom.createTextNode(u?r.slice(u):r,this.element)),this.$textToken[n.type])e.appendChild(l);else{var E="ace_"+n.type.replace(/\./g," ace_"),v=this.dom.createElement("span");"fold"==n.type&&(v.style.width=n.value.length*this.config.characterWidth+"px"),v.className=E,v.appendChild(l),e.appendChild(v)}return t+r.length},this.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(" "==t[0]){for(var i=(r-=r%this.tabSize)/this.tabSize,s=0;s=o;)a=this.$renderToken(l,a,c,h.substring(0,o-r)),h=h.substring(o-r),r=o,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(s.stringRepeat(" ",n.indent),this.element)),a=0,o=n[++i]||Number.MAX_VALUE;0!=h.length&&(r+=h.length,a=this.$renderToken(l,a,c,h))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(e,t){var n=0,r=t[0],i=r.value;this.displayIndentGuides&&(i=this.renderIndentGuide(e,i)),i&&(n=this.$renderToken(e,n,r,i));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,r,i);n=this.$renderToken(e,n,r,i)}},this.$renderOverflowMessage=function(e,t,n,r,i){n&&this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=i?"":"",e.appendChild(s)},this.$renderLine=function(e,t,n){if(n||0==n||(n=this.session.getFoldLine(t)),n)var r=this.$getFoldLineTokens(t,n);else r=this.session.getTokens(t);var i=e;if(r.length){var s=this.session.getRowSplitData(t);s&&s.length?(this.$renderWrappedLine(e,r,s),i=e.lastChild):(i=e,this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i)),this.$renderSimpleLine(i,r))}else this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i));if(this.showInvisibles&&i){n&&(t=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,i.appendChild(o)}},this.$getFoldLineTokens=function(e,t){var n=this.session,r=[],i=n.getTokens(e);return t.walk(function(e,t,s,o,a){null!=e?r.push({type:"fold",value:e}):(a&&(i=n.getTokens(t)),i.length&&function(e,t,n){for(var i=0,s=0;s+e[i].value.lengthn-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),s=t+o.length,i+=1);sn?r.push({type:e[i].type,value:o.substring(0,n-s)}):r.push(e[i]),s+=o.length,i+=1}}(i,o,s))},t.end.row,this.session.getLine(t.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),t.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)r.setStyle(t[n].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){r.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){r.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&r.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}else this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||o.top<0)&&n>1)){var a=this.cursors[i++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,o,e,t[n],this.session):this.isCursorInView(o,e)?(r.setStyle(l,"display","block"),r.translate(a,o.left,o.top),r.setStyle(l,"width",Math.round(e.characterWidth)+"px"),r.setStyle(l,"height",e.lineHeight+"px")):r.setStyle(l,"display","none")}}for(;this.cursors.length>i;)this.removeCursor();var u=this.session.getOverwrite();this.$setOverwrite(u),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(i.prototype),t.Cursor=i}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,a=32768,l=function(e){this.element=i.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){r.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(l.prototype);var u=function(e,t){l.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=i.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};r.inherits(u,l),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>a?(this.coeff=a/e,e=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(u.prototype);var c=function(e,t){l.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};r.inherits(c,l),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(c.prototype),t.ScrollBar=u,t.ScrollBarV=u,t.ScrollBarH=c,t.VScrollBar=u,t.HScrollBar=c}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){"use strict";var r=e("./lib/event"),i=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(r.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(i.prototype),t.RenderLoop=i}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,u=256,c="function"==typeof ResizeObserver,h=200,d=t.FontMetrics=function(e){this.el=i.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.innerHTML=s.stringRepeat("X",u),this.$characterSize={width:0,height:0},c?this.$addObserver():this.checkForSizeChanges()};(function(){r.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){var n=t[0].contentRect;e.checkForSizeChanges({height:n.height,width:n.width/u})}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/u};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.innerHTML=s.stringRepeat(e,u),this.$main.getBoundingClientRect().width/u},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=i.buildDom([e(0,0),e(h,0),e(0,h),e(h,h)],this.el)},this.transformCoordinates=function(e,t){function n(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function r(e,t){return[e[0]-t[0],e[1]-t[1]]}function i(e,t){return[e[0]+t[0],e[1]+t[1]]}function s(e,t){return[e*t[0],e*t[1]]}function o(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=s(1/this.$getZoom(this.el),e)),this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),u=o(this.els[2]),c=o(this.els[3]),d=n(r(c,l),r(c,u),r(i(l,u),i(c,a))),f=s(1+d[0],r(l,a)),p=s(1+d[1],r(u,a));if(t){var m=t,g=d[0]*m[0]/h+d[1]*m[1]/h+1,E=i(s(m[0],f),s(m[1],p));return i(s(1/g/h,E),a)}var v=r(e,a),C=n(r(f,s(d[0],v)),r(p,s(d[1],v)),v);return s(h,C)}}).call(d.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./config"),o=e("./layer/gutter").Gutter,a=e("./layer/marker").Marker,l=e("./layer/text").Text,u=e("./layer/cursor").Cursor,c=e("./scrollbar").HScrollBar,h=e("./scrollbar").VScrollBar,d=e("./renderloop").RenderLoop,f=e("./layer/font_metrics").FontMetrics,p=e("./lib/event_emitter").EventEmitter,m='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);opacity: 0.7;transform-origin: left;text-indent: 10px;}',g=e("./lib/useragent"),E=g.isIE;i.importCssString(m,"ace_editor.css");var v=function(e,t){var n=this;this.container=e||i.createElement("div"),i.addCssClass(this.container,"ace_editor"),i.HI_DPI&&i.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=i.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=i.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=i.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var r=this.$textLayer=new l(this.content);this.canvas=r.element,this.$markerFront=new a(this.content),this.$cursorLayer=new u(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new f(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!g.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,p),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),i.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,n){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,r){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var i=this.container;r||(r=i.clientHeight||i.scrollHeight),n||(n=i.clientWidth||i.scrollWidth);var s=this.$updateCachedSize(e,t,n,r);if(!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var s=0,o=this.$size,a={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if(r&&(e||o.height!=r)&&(o.height=r,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL),n&&(e||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,i.setStyle(this.scrollBarH.element.style,"left",t+"px"),i.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),i.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";i.setStyle(this.scrollBarH.element.style,"right",l),i.setStyle(this.scroller.style,"right",l),i.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(s|=this.CHANGE_FULL)}return o.$dirty=!n||!r,s&&this._signal("resize",a),s},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=i.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=i.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var n=this.$cursorLayer.$pixelPos;if(n){t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var r=this.layerConfig,s=n.top,o=n.left;s-=r.offset;var a=t&&t.useTextareaForIME?this.lineHeight:E?0:1;if(s<0||s>r.height-a)i.translate(this.textarea,0,0);else{var l=1,u=this.$size.height-a;if(t)if(t.useTextareaForIME){var c=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(c)[0]}else s+=this.lineHeight+2;else s+=this.lineHeight;(o-=this.scrollLeft)>this.$size.scrollerWidth-l&&(o=this.$size.scrollerWidth-l),o+=this.gutterWidth+this.margin.left,i.setStyle(e,"height",a+"px"),i.setStyle(e,"width",l+"px"),i.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-l),Math.min(s,u))}}}else i.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},this.setMargin=function(e,t,n,r){var i=this.margin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),i.translate(this.content,-this.scrollLeft,-n.offset);var s=n.width+2*this.$padding+"px",o=n.minHeight+"px";i.setStyle(this.content.style,"width",s),i.setStyle(this.content.style,"height",o)}if(e&this.CHANGE_H_SCROLL&&(i.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender")}else this.$changes|=e},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=!(n<=2*this.lineHeight)&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||r!=this.$vScroll){r!=this.$vScroll&&(this.$vScroll=r,this.scrollBarV.setVisible(r));var i=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,i,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength()*this.lineHeight,i=this.$getLongestLine(),s=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-i-2*this.$padding<0),o=this.$horizScroll!==s;o&&(this.$horizScroll=s,this.scrollBarH.setVisible(s));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,u=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;r+=u;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,r-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,i+2*this.$padding-t.scrollerWidth+c.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-r+u<0||this.scrollTop>c.top),d=a!==h;d&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var f,p,m=this.scrollTop%this.lineHeight,g=Math.ceil(l/this.lineHeight)-1,E=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),v=E+g,C=this.lineHeight;E=e.screenToDocumentRow(E,0);var D=e.getFoldLine(E);D&&(E=D.start.row),f=e.documentToScreenRow(E,0),p=e.getRowLength(E)*C,v=Math.min(e.screenToDocumentRow(v,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(v)*C+p,m=this.scrollTop-f*C;var S=0;return(this.layerConfig.width!=i||o)&&(S=this.CHANGE_H_SCROLL),(o||d)&&(S|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(i=this.$getLongestLine())),this.layerConfig={width:i,padding:this.$padding,firstRow:E,firstRowScreen:f,lastRow:v,lineHeight:C,characterWidth:this.characterWidth,minHeight:l,maxHeight:r,offset:m,gutterOffset:C?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/C)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(i-this.$padding),S},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1||tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t,n){if(0!==this.$size.scrollerHeight){var r=this.$cursorLayer.getPixelPosition(e),i=r.left,s=r.top,o=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+o>s?(t&&l+o>s+this.lineHeight&&(s-=t*this.$size.scrollerHeight),0===s&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):l+this.$size.scrollerHeight-ai?(i=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:a,side:s-a>0?1:-1,offsetX:i}},this.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),a=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),i)},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),s=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+s-this.scrollTop}},this.visualizeFocus=function(){i.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){i.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),e.useTextareaForIME=this.$useTextareaForIME,this.$useTextareaForIME?(i.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),i.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText,this.$composition=null,this.$cursorLayer.element.style.display="")},this.addToken=function(e,t,n,r){var i=this.session;i.bgTokenizer.lines[n]=null;var s={type:t,value:e},o=i.getTokens(n);if(null==r)o.push(s);else for(var a=0,l=0;l50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,n){var r=null,i=!1,a=Object.create(s),u=[],c=new l({messageBuffer:u,terminate:function(){},postMessage:function(e){u.push(e),r&&(i?setTimeout(h):h())}});c.setEmitSync=function(e){i=e};var h=function(){var e=u.shift();e.command?r[e.command].apply(r,e.args):e.event&&a._signal(e.event,e.data)};return a.postMessage=function(e){c.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},o.loadModule(["worker",t],function(e){for(r=new e[n](a);u.length;)h()}),c},t.WorkerClient=l,t.createWorker=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(e,t,n,r,i,s){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,i),this.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,s=t.start.column-this.pos.column;if(this.updateAnchors(e),i&&(this.length+=n),i&&!this.session.$fromUndo)if("insert"===e.action)for(var o=this.others.length-1;o>=0;o--){var a={row:(l=this.others[o]).row,column:l.column+s};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(o=this.others.length-1;o>=0;o--){var l;a={row:(l=this.others[o]).row,column:l.column+s},this.doc.remove(new r(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,i){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),i,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)}},this.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new r,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{n=this.getRange();var r=this.isBackwards(),s=n.start.row,o=n.end.row;if(s==o){if(r)var a=n.end,l=n.start;else a=n.start,l=n.end;return this.addRange(i.fromPoints(l,l)),void this.addRange(i.fromPoints(a,a))}var u=[],c=this.getLineRange(s,!0);c.start.column=n.start.column,u.push(c);for(var h=s+1;h1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(r,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],s=e.column0;)E--;if(E>0)for(var v=0;r[v].isEmpty();)v++;for(var C=E;C>=v;C--)r[C].isEmpty()&&r.splice(C,1)}return r}}.call(s.prototype);var d=e("./editor").Editor;function f(e,t){return e.row==t.row&&e.column==t.column}function p(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",o),e.commands.addCommands(u.defaultCommands),function(e){if(e.textInput){var t=e.textInput.getElement(),n=!1;a.addListener(t,"keydown",function(t){var i=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&i?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&r()}),a.addListener(t,"keyup",r),a.addListener(t,"blur",r)}function r(t){n&&(e.renderer.setMouseCursor(""),n=!1)}}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var r=e[n];if(r.marker){this.session.removeMarker(r.marker);var i=t.indexOf(r);-1!=i&&t.splice(i,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(u.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(u.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?r=n.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?r=n.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});else{var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return r}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var r,i=n&&n.keepOrder,o=1==n||n&&n.$byLines,a=this.session,l=this.selection,u=l.rangeList,c=(i?l:u).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var h=l._eventRegistry;l._eventRegistry={};var d=new s(a);this.inVirtualSelectionMode=!0;for(var f=c.length;f--;){if(o)for(;f>0&&c[f].start.row==c[f-1].end.row;)f--;d.fromOrientedRange(c[f]),d.index=f,this.selection=a.selection=d;var p=e.exec?e.exec(this,t||{}):e(this,t||{});r||void 0===p||(r=p),d.toOrientedRange(c[f])}d.detach(),this.selection=a.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=h,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),r}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],r=0;ro&&(o=n.column),rc?e.insert(r,l.stringRepeat(" ",s-c)):e.remove(new i(r.row,r.column,r.row,r.column-s+c)),t.start.column=t.end.column=o,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var c=this.selection.getRange(),h=c.start.row,d=c.end.row,f=h==d;if(f){var p,m=this.session.getLength();do{p=this.session.getLine(d)}while(/[=:]/.test(p)&&++d0);h<0&&(h=0),d>=m&&(d=m-1)}var g=this.session.removeFullLines(h,d);g=this.$reAlignText(g,f),this.session.insert({row:h,column:0},g.join("\n")+"\n"),f||(c.start.column=0,c.end.column=g[g.length-1].length),this.selection.setRange(c)}},this.$reAlignText=function(e,t){var n,r,i,s=!0,o=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==n?(n=t[1].length,r=t[2].length,i=t[3].length,t):(n+r+i!=t[1].length+t[2].length+t[3].length&&(o=!1),n!=t[1].length&&(s=!1),n>t[1].length&&(n=t[1].length),rt[3].length&&(i=t[3].length),t):[e]}).map(t?u:s?o?function(e){return e[2]?a(n+r-e[2].length)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:u:function(e){return e[2]?a(n)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function a(e){return l.stringRepeat(" ",e)}function u(e){return e[2]?a(n)+e[2]+a(r-e[2].length+i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=p,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){p(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,s=e.getLine(t),o=s.search(i);if(-1!=o){for(var a=n||s.length,l=e.getLength(),u=t,c=t;++tu){var f=e.getLine(c).length;return new r(u,a,c,f)}}},this.openingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i+1},a=e.$findClosingBracket(t,o,s);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>o.row&&(a.row--,a.column=e.getLine(a.row).length),r.fromPoints(o,a)}},this.closingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i},a=e.$findOpeningBracket(t,o);if(a)return a.column++,o.column--,r.fromPoints(a,o)}}).call(i.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}e("./range").Range,function(){this.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(n&&e.action){for(var r=e.data,i=r.start.row,s=r.end.row,o="add"==e.action,a=i+1;a0&&!r[i];)i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=s;o++){var a=r[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var u=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(u-=t.scrollLeft),a.el.style.left=u+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}.call(i.prototype),t.LineWidgets=i}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,n){"use strict";var r=e("../line_widgets").LineWidgets,i=e("../lib/dom"),s=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var o=e.getCursorPosition(),a=o.row,l=n.widgetManager.getWidgetsAtRow(a).filter(function(e){return"errorMarker"==e.type})[0];l?l.destroy():a-=t;var u,c=function(e,t,n){var r=e.getAnnotations().sort(s.comparePoints);if(r.length){var i=function(e,t,n){for(var r=0,i=e.length-1;r<=i;){var s=r+i>>1,o=n(t,e[s]);if(o>0)r=s+1;else{if(!(o<0))return s;i=s-1}}return-(r+1)}(r,{row:t,column:-1},s.comparePoints);i<0&&(i=-i-1),i>=r.length?i=n>0?0:r.length-1:0===i&&n<0&&(i=r.length-1);var o=r[i];if(o&&n){if(o.row===t){do{o=r[i+=n]}while(o&&o.row===t);if(!o)return r.slice()}var a=[];t=o.row;do{a[n<0?"unshift":"push"](o),o=r[i+=n]}while(o&&o.row==t);return a.length&&a}}}(n,a,t);if(c){var h=c[0];o.column=(h.pos&&"number"!=typeof h.column?h.pos.sc:h.column)||0,o.row=h.row,u=e.renderer.$gutterLayer.$annotations[o.row]}else{if(l)return;u={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(o.row),e.selection.moveToPosition(o);var d={row:o.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},f=d.el.appendChild(i.createElement("div")),p=d.el.appendChild(i.createElement("div"));p.className="error_widget_arrow "+u.className;var m=e.renderer.$cursorLayer.getPixelPosition(o).left;p.style.left=m+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",f.className="error_widget "+u.className,f.innerHTML=u.text.join("
"),f.appendChild(i.createElement("div"));var g=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(g),n.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(g),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t,r){"use strict";e("./lib/fixoldbrowsers");var i=e("./lib/dom"),s=e("./lib/event"),o=e("./range").Range,a=e("./editor").Editor,l=e("./edit_session").EditSession,u=e("./undomanager").UndoManager,c=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,t.define=n.amdD,t.edit=function(e,n){if("string"==typeof e){var r=e;if(!(e=document.getElementById(r)))throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof a)return e.env.editor;var o="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;o=l.value,e=i.createElement("pre"),l.parentNode.replaceChild(e,l)}else e&&(o=e.textContent,e.innerHTML="");var u=t.createEditSession(o),h=new a(new c(e),u,n),d={document:u,editor:h,onResize:h.resize.bind(h,null)};return l&&(d.textarea=l),s.addListener(window,"resize",d.onResize),h.on("destroy",function(){s.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),h.container.env=h.env=d,h},t.createEditSession=function(e,t){var n=new l(e,t);return n.setUndoManager(new u),n},t.Range=o,t.Editor=a,t.EditSession=l,t.UndoManager=u,t.VirtualRenderer=c,t.version=t.config.version}),ace.require(["ace/ace"],function(t){for(var n in t&&(t.config.init(!0),t.define=ace.define),window.ace||(window.ace=t),t)t.hasOwnProperty(n)&&(window.ace[n]=t[n]);window.ace.default=window.ace,e&&(e.exports=window.ace)}),e.exports={ace}},247(e,t,n){"use strict";var r=n(982),i=n(159),s=n(961);function o(e){var t="https://react.dev/errors/"+e;if(1P||(e.current=M[P],M[P]=null,P--)}function $(e,t){P++,M[P]=e.current,e.current=t}var G,V,W=B(null),H=B(null),j=B(null),z=B(null);function X(e,t){switch($(j,t),$(H,e),$(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=Eh(t=gh(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(W),$(W,e)}function K(){U(W),U(H),U(j)}function Y(e){null!==e.memoizedState&&$(z,e);var t=W.current,n=Eh(t,e.type);t!==n&&($(H,e),$(W,n))}function q(e){H.current===e&&(U(W),U(H)),z.current===e&&(U(z),ud._currentValue=k)}function Q(e){if(void 0===G)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);G=t&&t[1]||"",V=-1)":-1--i||l[r]!==u[i]){var c="\n"+l[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}}while(1<=r&&0<=i);break}}}finally{Z=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Q(n):""}function ee(e,t){switch(e.tag){case 26:case 27:case 5:return Q(e.type);case 16:return Q("Lazy");case 13:return e.child!==t&&null!==t?Q("Suspense Fallback"):Q("Suspense");case 19:return Q("SuspenseList");case 0:case 15:return J(e.type,!1);case 11:return J(e.type.render,!1);case 1:return J(e.type,!0);case 31:return Q("Activity");default:return""}}function te(e){try{var t="",n=null;do{t+=ee(e,n),n=e,e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var ne=Object.prototype.hasOwnProperty,re=r.unstable_scheduleCallback,ie=r.unstable_cancelCallback,se=r.unstable_shouldYield,oe=r.unstable_requestPaint,ae=r.unstable_now,le=r.unstable_getCurrentPriorityLevel,ue=r.unstable_ImmediatePriority,ce=r.unstable_UserBlockingPriority,he=r.unstable_NormalPriority,de=r.unstable_LowPriority,fe=r.unstable_IdlePriority,pe=r.log,me=r.unstable_setDisableYieldValue,ge=null,Ee=null;function ve(e){if("function"==typeof pe&&me(e),Ee&&"function"==typeof Ee.setStrictMode)try{Ee.setStrictMode(ge,e)}catch(e){}}var Ce=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(De(e)/Se|0)|0},De=Math.log,Se=Math.LN2,Ae=256,_e=262144,ye=4194304;function be(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Te(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var i=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var a=134217727&r;return 0!==a?0!==(r=a&~s)?i=be(r):0!==(o&=a)?i=be(o):n||0!==(n=a&~e)&&(i=be(n)):0!==(a=r&~s)?i=be(a):0!==o?i=be(o):n||0!==(n=r&~e)&&(i=be(n)),0===i?0:0!==t&&t!==i&&0===(t&s)&&((s=i&-i)>=(n=t&-t)||32===s&&4194048&n)?t:i}function Re(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function we(){var e=ye;return!(62914560&(ye<<=1))&&(ye=4194304),e}function Fe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ne(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Le(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ce(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function Oe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ce(n),i=1<=bn),xn=String.fromCharCode(32),wn=!1;function Fn(e,t){switch(e){case"keyup":return-1!==_n.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Ln=!1,On={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function In(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!On[e.type]:"textarea"===t}function kn(e,t,n,r){It?kt?kt.push(r):kt=[r]:It=r,0<(t=nh(t,"onChange")).length&&(n=new tn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Mn=null,Pn=null;function Bn(e){Kc(e,0)}function Un(e){if(ft(Qe(e)))return e}function $n(e,t){if("change"===e)return t}var Gn=!1;if($t){var Vn;if($t){var Wn="oninput"in document;if(!Wn){var Hn=document.createElement("div");Hn.setAttribute("oninput","return;"),Wn="function"==typeof Hn.oninput}Vn=Wn}else Vn=!1;Gn=Vn&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Jn(r)}}function tr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?tr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function nr(e){for(var t=pt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=pt((e=t.contentWindow).document)}return t}function rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var ir=$t&&"documentMode"in document&&11>=document.documentMode,sr=null,or=null,ar=null,lr=!1;function ur(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;lr||null==sr||sr!==pt(r)||(r="selectionStart"in(r=sr)&&rr(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},ar&&Zn(ar,r)||(ar=r,0<(r=nh(or,"onSelect")).length&&(t=new tn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=sr)))}function cr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var hr={animationend:cr("Animation","AnimationEnd"),animationiteration:cr("Animation","AnimationIteration"),animationstart:cr("Animation","AnimationStart"),transitionrun:cr("Transition","TransitionRun"),transitionstart:cr("Transition","TransitionStart"),transitioncancel:cr("Transition","TransitionCancel"),transitionend:cr("Transition","TransitionEnd")},dr={},fr={};function pr(e){if(dr[e])return dr[e];if(!hr[e])return e;var t,n=hr[e];for(t in n)if(n.hasOwnProperty(t)&&t in fr)return dr[e]=n[t];return e}$t&&(fr=document.createElement("div").style,"AnimationEvent"in window||(delete hr.animationend.animation,delete hr.animationiteration.animation,delete hr.animationstart.animation),"TransitionEvent"in window||delete hr.transitionend.transition);var mr=pr("animationend"),gr=pr("animationiteration"),Er=pr("animationstart"),vr=pr("transitionrun"),Cr=pr("transitionstart"),Dr=pr("transitioncancel"),Sr=pr("transitionend"),Ar=new Map,_r="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function yr(e,t){Ar.set(e,t),nt(t,[e])}_r.push("scrollEnd");var br="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Tr=[],Rr=0,xr=0;function wr(){for(var e=Rr,t=xr=Rr=0;t>=o,i-=o,ti=1<<32-Ce(t)+i|n<p?(m=h,h=null):m=h.sibling;var g=f(i,h,a[p],l);if(null===g){null===h&&(h=m);break}e&&h&&null===g.alternate&&t(i,h),o=s(g,o,p),null===c?u=g:c.sibling=g,c=g,h=m}if(p===a.length)return n(i,h),ci&&ri(i,p),u;if(null===h){for(;pm?(g=p,p=null):g=p.sibling;var C=f(i,p,v.value,u);if(null===C){null===p&&(p=g);break}e&&p&&null===C.alternate&&t(i,p),a=s(C,a,m),null===h?c=C:h.sibling=C,h=C,p=g}if(v.done)return n(i,p),ci&&ri(i,m),c;if(null===p){for(;!v.done;m++,v=l.next())null!==(v=d(i,v.value,u))&&(a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return ci&&ri(i,m),c}for(p=r(p);!v.done;m++,v=l.next())null!==(v=E(p,i,m,v.value,u))&&(e&&null!==v.alternate&&p.delete(null===v.key?m:v.key),a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return e&&p.forEach(function(e){return t(i,e)}),ci&&ri(i,m),c}(l,u,c=C.call(c),h)}if("function"==typeof c.then)return v(l,u,ls(c),h);if(c.$$typeof===D)return v(l,u,Li(l,c),h);cs(l,c)}return"string"==typeof c&&""!==c||"number"==typeof c||"bigint"==typeof c?(c=""+c,null!==u&&6===u.tag?(n(l,u.sibling),(h=i(u,c)).return=l,l=h):(n(l,u),(h=Wr(c,l.mode,h)).return=l,l=h),a(l)):n(l,u)}return function(e,t,n,r){try{as=0;var i=v(e,t,n,r);return os=null,i}catch(t){if(t===qi||t===Zi)throw t;var s=Pr(29,t,null,e.mode);return s.lanes=r,s.return=e,s}}}var ds=hs(!0),fs=hs(!1),ps=!1;function ms(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Es(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vs(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&du){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ir(e),Or(e,null,n),t}return Fr(e,r,t,n),Ir(e)}function Cs(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Oe(e,n)}}function Ds(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===s?i=s=o:s=s.next=o,n=n.next}while(null!==n);null===s?i=s=t:s=s.next=t}else i=s=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ss=!1;function As(){if(Ss&&null!==Wi)throw Wi}function _s(e,t,n,r){Ss=!1;var i=e.updateQueue;ps=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var l=a,u=l.next;l.next=null,null===o?s=u:o.next=u,o=l;var c=e.alternate;null!==c&&(a=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===a?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l)}if(null!==s){var h=i.baseState;for(o=0,c=u=l=null,a=s;;){var f=-536870913&a.lane,p=f!==a.lane;if(p?(mu&f)===f:(r&f)===f){0!==f&&f===Vi&&(Ss=!0),null!==c&&(c=c.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var m=e,g=a;f=t;var E=n;switch(g.tag){case 1:if("function"==typeof(m=g.payload)){h=m.call(E,h,f);break e}h=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(f="function"==typeof(m=g.payload)?m.call(E,h,f):m))break e;h=d({},h,f);break e;case 2:ps=!0}}null!==(f=a.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=i.callbacks)?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===c?(u=c=p,l=h):c=c.next=p,o|=f;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(p=a).next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}null===c&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null===s&&(i.shared.lanes=0),_u|=o,e.lanes=o,e.memoizedState=h}}function ys(e,t){if("function"!=typeof e)throw Error(o(191,e));e.call(t)}function bs(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;es?s:8;var o,a,l,u=O.T,c={};O.T=c,ca(e,!1,t,n);try{var h=i(),d=O.S;null!==d&&d(c,h),null!==h&&"object"==typeof h&&"function"==typeof h.then?ua(e,t,(o=r,a=[],l={status:"pending",value:null,reason:null,then:function(e){a.push(e)}},h.then(function(){l.status="fulfilled",l.value=o;for(var e=0;e<\/script>",s=s.removeChild(s.firstChild);break;case"select":s="string"==typeof r.is?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s="string"==typeof r.is?a.createElement(i,{is:r.is}):a.createElement(i)}}s[$e]=t,s[Ge]=r;e:for(a=t.child;null!==a;){if(5===a.tag||6===a.tag)s.appendChild(a.stateNode);else if(4!==a.tag&&27!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;null===a.sibling;){if(null===a.return||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=s;e:switch(hh(s,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&ol(t)}}return hl(t),al(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&ol(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));if(e=j.current,Ei(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(i=li))switch(i.tag){case 27:case 5:r=i.memoizedProps}e[$e]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||lh(e.nodeValue,n)))||pi(t,!0)}else(e=mh(e).createTextNode(r))[$e]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(r=Ei(t),null!==n){if(null===e){if(!r)throw Error(o(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(o(557));e[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Ps(t),t):(Ps(t),null);if(128&t.flags)throw Error(o(558))}return hl(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=Ei(t),null!==r&&null!==r.dehydrated){if(null===e){if(!i)throw Error(o(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(o(317));i[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),i=!1}else i=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return 256&t.flags?(Ps(t),t):(Ps(t),null)}return Ps(t),128&t.flags?(t.lanes=n,t):(n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(i=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(i=r.alternate.memoizedState.cachePool.pool),s=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(s=r.memoizedState.cachePool.pool),s!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ul(t,t.updateQueue),hl(t),null);case 4:return K(),null===e&&Zc(t.stateNode.containerInfo),hl(t),null;case 10:return bi(t.type),hl(t),null;case 19:if(U(Bs),null===(r=t.memoizedState))return hl(t),null;if(i=!!(128&t.flags),null===(s=r.rendering))if(i)cl(r,!1);else{if(0!==Au||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(s=Us(e))){for(t.flags|=128,cl(r,!1),e=s.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)$r(n,e),n=n.sibling;return $(Bs,1&Bs.current|2),ci&&ri(t,r.treeForkCount),t.child}e=e.sibling}null!==r.tail&&ae()>Ou&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=Us(s))){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),cl(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!ci)return hl(t),null}else 2*ae()-r.renderingStartTime>Ou&&536870912!==n&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=r.last)?e.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ae(),e.sibling=null,n=Bs.current,$(Bs,i?1&n|2:1&n),ci&&ri(t,r.treeForkCount),e):(hl(t),null);case 22:case 23:return Ps(t),Fs(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?!!(536870912&n)&&!(128&t.flags)&&(hl(t),6&t.subtreeFlags&&(t.flags|=8192)):hl(t),null!==(n=t.updateQueue)&&ul(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&U(zi),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),bi(Pi),hl(t),null;case 25:case 30:return null}throw Error(o(156,t.tag))}function fl(e,t){switch(oi(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return bi(Pi),K(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return q(t),null;case 31:if(null!==t.memoizedState){if(Ps(t),null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Ps(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return U(Bs),null;case 4:return K(),null;case 10:return bi(t.type),null;case 22:case 23:return Ps(t),Fs(),null!==e&&U(zi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return bi(Pi),null;default:return null}}function pl(e,t){switch(oi(t),t.tag){case 3:bi(Pi),K();break;case 26:case 27:case 5:q(t);break;case 4:K();break;case 31:null!==t.memoizedState&&Ps(t);break;case 13:Ps(t);break;case 19:U(Bs);break;case 10:bi(t.type);break;case 22:case 23:Ps(t),Fs(),null!==e&&U(zi);break;case 24:bi(Pi)}}function ml(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var s=n.create,o=n.inst;r=s(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ac(t,t.return,e)}}function gl(e,t,n){try{var r=t.updateQueue,i=null!==r?r.lastEffect:null;if(null!==i){var s=i.next;r=s;do{if((r.tag&e)===e){var o=r.inst,a=o.destroy;if(void 0!==a){o.destroy=void 0,i=t;var l=n,u=a;try{u()}catch(e){Ac(i,l,e)}}}r=r.next}while(r!==s)}}catch(e){Ac(t,t.return,e)}}function El(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{bs(t,n)}catch(t){Ac(e,e.return,t)}}}function vl(e,t,n){n.props=Aa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ac(e,t,n)}}function Cl(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(n){Ac(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(n){Ac(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){Ac(e,t,n)}else n.current=null}function Sl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ac(e,e.return,t)}}function Al(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,a=null,l=null,u=null,c=null,h=null;for(p in n){var d=n[p];if(n.hasOwnProperty(p)&&null!=d)switch(p){case"checked":case"value":break;case"defaultValue":u=d;default:r.hasOwnProperty(p)||uh(e,t,p,null,r,d)}}for(var f in r){var p=r[f];if(d=n[f],r.hasOwnProperty(f)&&(null!=p||null!=d))switch(f){case"type":s=p;break;case"name":i=p;break;case"checked":c=p;break;case"defaultChecked":h=p;break;case"value":a=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(o(137,t));break;default:p!==d&&uh(e,t,f,p,r,d)}}return void Et(e,a,l,u,c,h,s,i);case"select":for(s in p=a=l=f=null,n)if(u=n[s],n.hasOwnProperty(s)&&null!=u)switch(s){case"value":break;case"multiple":p=u;default:r.hasOwnProperty(s)||uh(e,t,s,null,r,u)}for(i in r)if(s=r[i],u=n[i],r.hasOwnProperty(i)&&(null!=s||null!=u))switch(i){case"value":f=s;break;case"defaultValue":l=s;break;case"multiple":a=s;default:s!==u&&uh(e,t,i,s,r,u)}return t=l,n=a,r=p,void(null!=f?Dt(e,!!n,f,!1):!!r!=!!n&&(null!=t?Dt(e,!!n,t,!0):Dt(e,!!n,n?[]:"",!1)));case"textarea":for(l in p=f=null,n)if(i=n[l],n.hasOwnProperty(l)&&null!=i&&!r.hasOwnProperty(l))switch(l){case"value":case"children":break;default:uh(e,t,l,null,r,i)}for(a in r)if(i=r[a],s=n[a],r.hasOwnProperty(a)&&(null!=i||null!=s))switch(a){case"value":f=i;break;case"defaultValue":p=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(o(91));break;default:i!==s&&uh(e,t,a,i,r,s)}return void St(e,f,p);case"option":for(var m in n)f=n[m],n.hasOwnProperty(m)&&null!=f&&!r.hasOwnProperty(m)&&("selected"===m?e.selected=!1:uh(e,t,m,null,r,f));for(u in r)f=r[u],p=n[u],!r.hasOwnProperty(u)||f===p||null==f&&null==p||("selected"===u?e.selected=f&&"function"!=typeof f&&"symbol"!=typeof f:uh(e,t,u,f,r,p));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)f=n[g],n.hasOwnProperty(g)&&null!=f&&!r.hasOwnProperty(g)&&uh(e,t,g,null,r,f);for(c in r)if(f=r[c],p=n[c],r.hasOwnProperty(c)&&f!==p&&(null!=f||null!=p))switch(c){case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(o(137,t));break;default:uh(e,t,c,f,r,p)}return;default:if(Rt(t)){for(var E in n)f=n[E],n.hasOwnProperty(E)&&void 0!==f&&!r.hasOwnProperty(E)&&ch(e,t,E,void 0,r,f);for(h in r)f=r[h],p=n[h],!r.hasOwnProperty(h)||f===p||void 0===f&&void 0===p||ch(e,t,h,f,r,p);return}}for(var v in n)f=n[v],n.hasOwnProperty(v)&&null!=f&&!r.hasOwnProperty(v)&&uh(e,t,v,null,r,f);for(d in r)f=r[d],p=n[d],!r.hasOwnProperty(d)||f===p||null==f&&null==p||uh(e,t,d,f,r,p)}(r,e.type,n,t),r[Ge]=t}catch(t){Ac(e,e.return,t)}}function _l(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&bh(e.type)||4===e.tag}function yl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||_l(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&bh(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function bl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Nt));else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(bl(e,t,n),e=e.sibling;null!==e;)bl(e,t,n),e=e.sibling}function Tl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Tl(e,t,n),e=e.sibling;null!==e;)Tl(e,t,n),e=e.sibling}function Rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);hh(t,r,n),t[$e]=e,t[Ge]=n}catch(t){Ac(e,e.return,t)}}var xl=!1,wl=!1,Fl=!1,Nl="function"==typeof WeakSet?WeakSet:Set,Ll=null;function Ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Xl(e,n),4&r&&ml(5,n);break;case 1:if(Xl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){Ac(n,n.return,e)}else{var i=Aa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ac(n,n.return,e)}}64&r&&El(n),512&r&&Cl(n,n.return);break;case 3:if(Xl(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{bs(e,t)}catch(e){Ac(n,n.return,e)}}break;case 27:null===t&&4&r&&Rl(n);case 26:case 5:Xl(e,n),null===t&&4&r&&Sl(n),512&r&&Cl(n,n.return);break;case 12:Xl(e,n);break;case 31:Xl(e,n),4&r&&Ul(e,n);break;case 13:Xl(e,n),4&r&&$l(e,n),64&r&&null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Tc.bind(null,n));break;case 22:if(!(r=null!==n.memoizedState||xl)){t=null!==t&&null!==t.memoizedState||wl,i=xl;var s=wl;xl=r,(wl=t)&&!s?Yl(e,n,!!(8772&n.subtreeFlags)):Xl(e,n),xl=i,wl=s}break;case 30:break;default:Xl(e,n)}}function Il(e){var t=e.alternate;null!==t&&(e.alternate=null,Il(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&Ke(t),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var kl=null,Ml=!1;function Pl(e,t,n){for(n=n.child;null!==n;)Bl(e,t,n),n=n.sibling}function Bl(e,t,n){if(Ee&&"function"==typeof Ee.onCommitFiberUnmount)try{Ee.onCommitFiberUnmount(ge,n)}catch(e){}switch(n.tag){case 26:wl||Dl(n,t),Pl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:wl||Dl(n,t);var r=kl,i=Ml;bh(n.type)&&(kl=n.stateNode,Ml=!1),Pl(e,t,n),Ph(n.stateNode),kl=r,Ml=i;break;case 5:wl||Dl(n,t);case 6:if(r=kl,i=Ml,kl=null,Pl(e,t,n),Ml=i,null!==(kl=r))if(Ml)try{(9===kl.nodeType?kl.body:"HTML"===kl.nodeName?kl.ownerDocument.body:kl).removeChild(n.stateNode)}catch(e){Ac(n,t,e)}else try{kl.removeChild(n.stateNode)}catch(e){Ac(n,t,e)}break;case 18:null!==kl&&(Ml?(Th(9===(e=kl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Gd(e)):Th(kl,n.stateNode));break;case 4:r=kl,i=Ml,kl=n.stateNode.containerInfo,Ml=!0,Pl(e,t,n),kl=r,Ml=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),wl||gl(4,n,t),Pl(e,t,n);break;case 1:wl||(Dl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&vl(n,t,r)),Pl(e,t,n);break;case 21:Pl(e,t,n);break;case 22:wl=(r=wl)||null!==n.memoizedState,Pl(e,t,n),wl=r;break;default:Pl(e,t,n)}}function Ul(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)){e=e.dehydrated;try{Gd(e)}catch(e){Ac(t,t.return,e)}}}function $l(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{Gd(e)}catch(e){Ac(t,t.return,e)}}function Gl(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Nl),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Nl),t;default:throw Error(o(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Rc.bind(null,e,t);t.then(r,r)}})}function Vl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r title"))),hh(s,r,n),s[$e]=e,Je(s),r=s;break e;case"link":var a=td("link","href",i).get(r+(n.href||""));if(a)for(var l=0;la)break;var c=l.transferSize,h=l.initiatorType;c&&dh(h)&&(o+=c*((l=l.responseEnd)id?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}(h,p)))return Uu=s,e.cancelPendingCommit=p(pc.bind(null,e,t,s,n,r,i,o,a,l,c,h,null,d,f)),void Qu(e,s,o,!u)}pc(e,t,s,n,r,i,o,a,l)}function qu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var r=0;rg&&(o=g,g=m,m=o);var E=er(a,m),v=er(a,g);if(E&&v&&(1!==f.rangeCount||f.anchorNode!==E.node||f.anchorOffset!==E.offset||f.focusNode!==v.node||f.focusOffset!==v.offset)){var C=h.createRange();C.setStart(E.node,E.offset),f.removeAllRanges(),m>g?(f.addRange(C),f.extend(v.node,v.offset)):(C.setEnd(v.node,v.offset),f.addRange(C))}}}}for(h=[],f=a;f=f.parentNode;)1===f.nodeType&&h.push({element:f,left:f.scrollLeft,top:f.scrollTop});for("function"==typeof a.focus&&a.focus(),a=0;an?32:n,O.T=null,n=Gu,Gu=null;var s=Pu,a=Uu;if(Mu=0,Bu=Pu=null,Uu=0,6&du)throw Error(o(331));var l=du;if(du|=4,au(s.current),Jl(s,s.current,a,n),du=l,kc(0,!1),Ee&&"function"==typeof Ee.onPostCommitFiberRoot)try{Ee.onPostCommitFiberRoot(ge,s)}catch(e){}return!0}finally{I.p=i,O.T=r,vc(e,t)}}function Sc(e,t,n){t=Xr(n,t),null!==(e=vs(e,t=xa(e.stateNode,t,2),2))&&(Ne(e,2),Ic(e))}function Ac(e,t,n){if(3===e.tag)Sc(e,e,n);else for(;null!==t;){if(3===t.tag){Sc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===ku||!ku.has(r))){e=Xr(n,e),null!==(r=vs(t,n=wa(2),2))&&(Fa(n,r,t,e),Ne(r,2),Ic(r));break}}t=t.return}}function _c(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hu;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(Du=!0,i.add(n),e=yc.bind(null,e,t,n),t.then(e,e))}function yc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,fu===e&&(mu&n)===n&&(4===Au||3===Au&&(62914560&mu)===mu&&300>ae()-Nu?!(2&du)&&ec(e,0):bu|=n,Ru===mu&&(Ru=0)),Ic(e)}function bc(e,t){0===t&&(t=we()),null!==(e=Lr(e,t))&&(Ne(e,t),Ic(e))}function Tc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),bc(e,n)}function Rc(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}null!==r&&r.delete(t),bc(e,n)}var xc=null,wc=null,Fc=!1,Nc=!1,Lc=!1,Oc=0;function Ic(e){e!==wc&&null===e.next&&(null===wc?xc=wc=e:wc=wc.next=e),Nc=!0,Fc||(Fc=!0,_h(function(){6&du?re(ue,Mc):Pc()}))}function kc(e,t){if(!Lc&&Nc){Lc=!0;do{for(var n=!1,r=xc;null!==r;){if(!t)if(0!==e){var i=r.pendingLanes;if(0===i)var s=0;else{var o=r.suspendedLanes,a=r.pingedLanes;s=(1<<31-Ce(42|e)+1)-1,s=201326741&(s&=i&~(o&~a))?201326741&s|1:s?2|s:0}0!==s&&(n=!0,$c(r,s))}else s=mu,!(3&(s=Te(r,r===fu?s:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Re(r,s)||(n=!0,$c(r,s));r=r.next}}while(n);Lc=!1}}function Mc(){Pc()}function Pc(){Nc=Fc=!1;var e,t=0;0!==Oc&&((e=window.event)&&"popstate"===e.type?e!==Ch&&(Ch=e,1):(Ch=null,0))&&(t=Oc);for(var n=ae(),r=null,i=xc;null!==i;){var s=i.next,o=Bc(i,n);0===o?(i.next=null,null===r?xc=s:r.next=s,null===s&&(wc=r)):(r=i,(0!==t||3&o)&&(Nc=!0)),i=s}0!==Mu&&5!==Mu||kc(t,!1),0!==Oc&&(Oc=0)}function Bc(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=-62914561&e.pendingLanes;0 title"):null)}function rd(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var id=0;function sd(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)ad(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var od=null;function ad(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,od=new Map,t.forEach(ld,e),od=null,sd.call(e))}function ld(e,t){if(!(4&t.state.loading)){var n=od.get(e);if(n)var r=n.get(null);else{n=new Map,od.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s>>1,i=e[r];if(!(0>>1;rs(l,n))us(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[a]=n,r=a);else{if(!(us(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var u=[],c=[],h=1,d=null,f=3,p=!1,m=!1,g=!1,E=!1,v="function"==typeof setTimeout?setTimeout:null,C="function"==typeof clearTimeout?clearTimeout:null,D="undefined"!=typeof setImmediate?setImmediate:null;function S(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function A(e){if(g=!1,S(e),!m)if(null!==r(u))m=!0,y||(y=!0,_());else{var t=r(c);null!==t&&L(A,t.startTime-e)}}var _,y=!1,b=-1,T=5,R=-1;function x(){return!(!E&&t.unstable_now()-Re&&x());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var a=o(d.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof a){d.callback=a,S(e),n=!0;break t}d===r(u)&&i(u),S(e)}else i(u);d=r(u)}if(null!==d)n=!0;else{var l=r(c);null!==l&&L(A,l.startTime-e),n=!1}}break e}finally{d=null,f=s,p=!1}n=void 0}}finally{n?_():y=!1}}}if("function"==typeof D)_=function(){D(w)};else if("undefined"!=typeof MessageChannel){var F=new MessageChannel,N=F.port2;F.port1.onmessage=w,_=function(){N.postMessage(null)}}else _=function(){v(w,0)};function L(e,n){b=v(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125o?(e.sortIndex=s,n(c,e),null===r(u)&&e===r(c)&&(g?(C(b),b=-1):g=!0,L(A,s-o))):(e.sortIndex=a,n(u,e),m||p||(m=!0,y||(y=!0,_()))),e},t.unstable_shouldYield=x,t.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}},982(e,t,n){"use strict";e.exports=n(477)},902(e,t,n){"use strict";var r=n(72),i=n.n(r),s=n(825),o=n.n(s),a=n(659),l=n.n(a),u=n(56),c=n.n(u),h=n(540),d=n.n(h),f=n(113),p=n.n(f),m=n(636),g={};g.styleTagTransform=p(),g.setAttributes=c(),g.insert=l().bind(null,"html"),g.domAPI=o(),g.insertStyleElement=d(),i()(m.A,g),m.A&&m.A.locals&&m.A.locals},72(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},878(e,t,n){"use strict";n.r(t),n.d(t,{EmbeddedFrontend:()=>Id,Spector:()=>kd});var r={};n.r(r),n.d(r,{LX:()=>Jo,ll:()=>ea});var i,s={};n.r(s),n.d(s,{SyntaxError:()=>Xc,parse:()=>Yc});class o{static isBuildableProgram(e){return!!e&&!!e[this.rebuildProgramFunctionName]}static rebuildProgram(e,t,n,r,i){this.isBuildableProgram(e)&&e[this.rebuildProgramFunctionName](t,n,r,i)}}o.rebuildProgramFunctionName="__SPECTOR_rebuildProgram",function(e){e[e.noLog=0]="noLog",e[e.error=1]="error",e[e.warning=2]="warning",e[e.info=3]="info"}(i||(i={}));class a{static error(e,...t){this.level>0&&console.error(e,t)}static warn(e,...t){this.level>1&&console.warn(e,t)}static info(e,...t){this.level>2&&console.log(e,t)}}a.level=i.warning;class l{constructor(){this.callbacks=[],this.counter=-1}add(e,t){return this.counter++,t&&(e=e.bind(t)),this.callbacks[this.counter]=e,this.counter}remove(e){delete this.callbacks[e]}clear(){this.callbacks={}}trigger(e){for(const t in this.callbacks)this.callbacks.hasOwnProperty(t)&&this.callbacks[t](e)}}class u{constructor(){if("undefined"!=typeof performance&&performance.now)this.nowFunction=()=>performance.now();else{const e=new Date;this.nowFunction=e.getTime.bind(e)}}static get now(){return u.instance.nowFunction()}}u.instance=new u;class c{constructor(e){this.options=e}appendAnalysis(e){e.analyses=e.analyses||[];const t=this.getAnalysis(e);e.analyses.push(t)}getAnalysis(e){const t={analyserName:this.analyserName};return this.appendToAnalysis(e,t),t}}class h extends c{get analyserName(){return h.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={};for(const t of e.commands)n[t.name]=n[t.name]||0,n[t.name]++;const r=Object.keys(n).map(e=>[e,n[e]]);r.sort((e,t)=>{const n=t[1]-e[1];return 0===n?e[0].localeCompare(t[0]):n});for(const e of r)t[e[0]]=e[1]}}h.analyserName="Commands";const d=["drawArrays","drawElements","drawArraysInstanced","drawArraysInstancedANGLE","drawElementsInstanced","drawElementsInstancedANGLE","drawRangeElements","multiDrawArraysWEBGL","multiDrawElementsWEBGL","multiDrawArraysInstancedWEBGL","multiDrawElementsInstancedWEBGL","multiDrawArraysInstancedBaseInstanceWEBGL","multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL","drawArraysInstancedBaseInstanceWEBGL","drawElementsInstancedBaseVertexBaseInstanceWEBGL"];class f extends c{get analyserName(){return f.analyserName}appendToAnalysis(e,t){if(e.commands){t.total=e.commands.length,t.draw=0,t.clear=0;for(const n of e.commands)"clear"===n.name?t.clear++:d.indexOf(n.name)>-1&&t.draw++}}}f.analyserName="CommandsSummary";class p{static isWebGlConstant(e){return null!==g[e]&&void 0!==g[e]}static stringifyWebGlConstant(e,t){if(null==e)return"";if(0===e){return this.zeroMeaningByCommand[t]||"0"}if(1===e){return this.oneMeaningByCommand[t]||"1"}const n=g[e];return n?n.name:e+""}}p.DEPTH_BUFFER_BIT={name:"DEPTH_BUFFER_BIT",value:256,description:"Passed to clear to clear the current depth buffer."},p.STENCIL_BUFFER_BIT={name:"STENCIL_BUFFER_BIT",value:1024,description:"Passed to clear to clear the current stencil buffer."},p.COLOR_BUFFER_BIT={name:"COLOR_BUFFER_BIT",value:16384,description:"Passed to clear to clear the current color buffer."},p.POINTS={name:"POINTS",value:0,description:"Passed to drawElements or drawArrays to draw single points."},p.LINES={name:"LINES",value:1,description:"Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it."},p.LINE_LOOP={name:"LINE_LOOP",value:2,description:"Passed to drawElements or drawArrays to draw lines. Each set of two vertices is treated as a separate line segment."},p.LINE_STRIP={name:"LINE_STRIP",value:3,description:"Passed to drawElements or drawArrays to draw a connected group of line segments from the first vertex to the last."},p.TRIANGLES={name:"TRIANGLES",value:4,description:"Passed to drawElements or drawArrays to draw triangles. Each set of three vertices creates a separate triangle."},p.TRIANGLE_STRIP={name:"TRIANGLE_STRIP",value:5,description:"Passed to drawElements or drawArrays to draw a connected group of triangles."},p.TRIANGLE_FAN={name:"TRIANGLE_FAN",value:6,description:"Passed to drawElements or drawArrays to draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan."},p.ZERO={name:"ZERO",value:0,description:"Passed to blendFunc or blendFuncSeparate to turn off a component."},p.ONE={name:"ONE",value:1,description:"Passed to blendFunc or blendFuncSeparate to turn on a component."},p.SRC_COLOR={name:"SRC_COLOR",value:768,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source elements color."},p.ONE_MINUS_SRC_COLOR={name:"ONE_MINUS_SRC_COLOR",value:769,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source elements color."},p.SRC_ALPHA={name:"SRC_ALPHA",value:770,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source's alpha."},p.ONE_MINUS_SRC_ALPHA={name:"ONE_MINUS_SRC_ALPHA",value:771,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source's alpha."},p.DST_ALPHA={name:"DST_ALPHA",value:772,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's alpha."},p.ONE_MINUS_DST_ALPHA={name:"ONE_MINUS_DST_ALPHA",value:773,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's alpha."},p.DST_COLOR={name:"DST_COLOR",value:774,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's color."},p.ONE_MINUS_DST_COLOR={name:"ONE_MINUS_DST_COLOR",value:775,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's color."},p.SRC_ALPHA_SATURATE={name:"SRC_ALPHA_SATURATE",value:776,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the minimum of source's alpha or one minus the destination's alpha."},p.CONSTANT_COLOR={name:"CONSTANT_COLOR",value:32769,description:"Passed to blendFunc or blendFuncSeparate to specify a constant color blend function."},p.ONE_MINUS_CONSTANT_COLOR={name:"ONE_MINUS_CONSTANT_COLOR",value:32770,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant color blend function."},p.CONSTANT_ALPHA={name:"CONSTANT_ALPHA",value:32771,description:"Passed to blendFunc or blendFuncSeparate to specify a constant alpha blend function."},p.ONE_MINUS_CONSTANT_ALPHA={name:"ONE_MINUS_CONSTANT_ALPHA",value:32772,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant alpha blend function."},p.FUNC_ADD={name:"FUNC_ADD",value:32774,description:"Passed to blendEquation or blendEquationSeparate to set an addition blend function."},p.FUNC_SUBSTRACT={name:"FUNC_SUBSTRACT",value:32778,description:"Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination)."},p.FUNC_REVERSE_SUBTRACT={name:"FUNC_REVERSE_SUBTRACT",value:32779,description:"Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source)."},p.BLEND_EQUATION={name:"BLEND_EQUATION",value:32777,description:"Passed to getParameter to get the current RGB blend function."},p.BLEND_EQUATION_RGB={name:"BLEND_EQUATION_RGB",value:32777,description:"Passed to getParameter to get the current RGB blend function. Same as BLEND_EQUATION"},p.BLEND_EQUATION_ALPHA={name:"BLEND_EQUATION_ALPHA",value:34877,description:"Passed to getParameter to get the current alpha blend function. Same as BLEND_EQUATION"},p.BLEND_DST_RGB={name:"BLEND_DST_RGB",value:32968,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_SRC_RGB={name:"BLEND_SRC_RGB",value:32969,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_DST_ALPHA={name:"BLEND_DST_ALPHA",value:32970,description:"Passed to getParameter to get the current destination alpha blend function."},p.BLEND_SRC_ALPHA={name:"BLEND_SRC_ALPHA",value:32971,description:"Passed to getParameter to get the current source alpha blend function."},p.BLEND_COLOR={name:"BLEND_COLOR",value:32773,description:"Passed to getParameter to return a the current blend color."},p.ARRAY_BUFFER_BINDING={name:"ARRAY_BUFFER_BINDING",value:34964,description:"Passed to getParameter to get the array buffer binding."},p.ELEMENT_ARRAY_BUFFER_BINDING={name:"ELEMENT_ARRAY_BUFFER_BINDING",value:34965,description:"Passed to getParameter to get the current element array buffer."},p.LINE_WIDTH={name:"LINE_WIDTH",value:2849,description:"Passed to getParameter to get the current lineWidth (set by the lineWidth method)."},p.ALIASED_POINT_SIZE_RANGE={name:"ALIASED_POINT_SIZE_RANGE",value:33901,description:"Passed to getParameter to get the current size of a point drawn with gl.POINTS"},p.ALIASED_LINE_WIDTH_RANGE={name:"ALIASED_LINE_WIDTH_RANGE",value:33902,description:"Passed to getParameter to get the range of available widths for a line. Returns a length-2 array with the lo value at 0, and hight at 1."},p.CULL_FACE_MODE={name:"CULL_FACE_MODE",value:2885,description:"Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK"},p.FRONT_FACE={name:"FRONT_FACE",value:2886,description:"Passed to getParameter to determine the current value of frontFace. Should return CW or CCW."},p.DEPTH_RANGE={name:"DEPTH_RANGE",value:2928,description:"Passed to getParameter to return a length-2 array of floats giving the current depth range."},p.DEPTH_WRITEMASK={name:"DEPTH_WRITEMASK",value:2930,description:"Passed to getParameter to determine if the depth write mask is enabled."},p.DEPTH_CLEAR_VALUE={name:"DEPTH_CLEAR_VALUE",value:2931,description:"Passed to getParameter to determine the current depth clear value."},p.DEPTH_FUNC={name:"DEPTH_FUNC",value:2932,description:"Passed to getParameter to get the current depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_CLEAR_VALUE={name:"STENCIL_CLEAR_VALUE",value:2961,description:"Passed to getParameter to get the value the stencil will be cleared to."},p.STENCIL_FUNC={name:"STENCIL_FUNC",value:2962,description:"Passed to getParameter to get the current stencil function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_FAIL={name:"STENCIL_FAIL",value:2964,description:"Passed to getParameter to get the current stencil fail function. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_FAIL={name:"STENCIL_PASS_DEPTH_FAIL",value:2965,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test fail. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_PASS={name:"STENCIL_PASS_DEPTH_PASS",value:2966,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test pass. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_REF={name:"STENCIL_REF",value:2967,description:"Passed to getParameter to get the reference value used for stencil tests."},p.STENCIL_VALUE_MASK={name:"STENCIL_VALUE_MASK",value:2963,description:" "},p.STENCIL_WRITEMASK={name:"STENCIL_WRITEMASK",value:2968,description:" "},p.STENCIL_BACK_FUNC={name:"STENCIL_BACK_FUNC",value:34816,description:" "},p.STENCIL_BACK_FAIL={name:"STENCIL_BACK_FAIL",value:34817,description:" "},p.STENCIL_BACK_PASS_DEPTH_FAIL={name:"STENCIL_BACK_PASS_DEPTH_FAIL",value:34818,description:" "},p.STENCIL_BACK_PASS_DEPTH_PASS={name:"STENCIL_BACK_PASS_DEPTH_PASS",value:34819,description:" "},p.STENCIL_BACK_REF={name:"STENCIL_BACK_REF",value:36003,description:" "},p.STENCIL_BACK_VALUE_MASK={name:"STENCIL_BACK_VALUE_MASK",value:36004,description:" "},p.STENCIL_BACK_WRITEMASK={name:"STENCIL_BACK_WRITEMASK",value:36005,description:" "},p.VIEWPORT={name:"VIEWPORT",value:2978,description:"Returns an Int32Array with four elements for the current viewport dimensions."},p.SCISSOR_BOX={name:"SCISSOR_BOX",value:3088,description:"Returns an Int32Array with four elements for the current scissor box dimensions."},p.COLOR_CLEAR_VALUE={name:"COLOR_CLEAR_VALUE",value:3106,description:" "},p.COLOR_WRITEMASK={name:"COLOR_WRITEMASK",value:3107,description:" "},p.UNPACK_ALIGNMENT={name:"UNPACK_ALIGNMENT",value:3317,description:" "},p.PACK_ALIGNMENT={name:"PACK_ALIGNMENT",value:3333,description:" "},p.MAX_TEXTURE_SIZE={name:"MAX_TEXTURE_SIZE",value:3379,description:" "},p.MAX_VIEWPORT_DIMS={name:"MAX_VIEWPORT_DIMS",value:3386,description:" "},p.SUBPIXEL_BITS={name:"SUBPIXEL_BITS",value:3408,description:" "},p.RED_BITS={name:"RED_BITS",value:3410,description:" "},p.GREEN_BITS={name:"GREEN_BITS",value:3411,description:" "},p.BLUE_BITS={name:"BLUE_BITS",value:3412,description:" "},p.ALPHA_BITS={name:"ALPHA_BITS",value:3413,description:" "},p.DEPTH_BITS={name:"DEPTH_BITS",value:3414,description:" "},p.STENCIL_BITS={name:"STENCIL_BITS",value:3415,description:" "},p.POLYGON_OFFSET_UNITS={name:"POLYGON_OFFSET_UNITS",value:10752,description:" "},p.POLYGON_OFFSET_FACTOR={name:"POLYGON_OFFSET_FACTOR",value:32824,description:" "},p.TEXTURE_BINDING_2D={name:"TEXTURE_BINDING_2D",value:32873,description:" "},p.SAMPLE_BUFFERS={name:"SAMPLE_BUFFERS",value:32936,description:" "},p.SAMPLES={name:"SAMPLES",value:32937,description:" "},p.SAMPLE_COVERAGE_VALUE={name:"SAMPLE_COVERAGE_VALUE",value:32938,description:" "},p.SAMPLE_COVERAGE_INVERT={name:"SAMPLE_COVERAGE_INVERT",value:32939,description:" "},p.COMPRESSED_TEXTURE_FORMATS={name:"COMPRESSED_TEXTURE_FORMATS",value:34467,description:" "},p.VENDOR={name:"VENDOR",value:7936,description:" "},p.RENDERER={name:"RENDERER",value:7937,description:" "},p.VERSION={name:"VERSION",value:7938,description:" "},p.IMPLEMENTATION_COLOR_READ_TYPE={name:"IMPLEMENTATION_COLOR_READ_TYPE",value:35738,description:" "},p.IMPLEMENTATION_COLOR_READ_FORMAT={name:"IMPLEMENTATION_COLOR_READ_FORMAT",value:35739,description:" "},p.BROWSER_DEFAULT_WEBGL={name:"BROWSER_DEFAULT_WEBGL",value:37444,description:" "},p.STATIC_DRAW={name:"STATIC_DRAW",value:35044,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and not change often."},p.STREAM_DRAW={name:"STREAM_DRAW",value:35040,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to not be used often."},p.DYNAMIC_DRAW={name:"DYNAMIC_DRAW",value:35048,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and change often."},p.ARRAY_BUFFER={name:"ARRAY_BUFFER",value:34962,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.ELEMENT_ARRAY_BUFFER={name:"ELEMENT_ARRAY_BUFFER",value:34963,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.BUFFER_SIZE={name:"BUFFER_SIZE",value:34660,description:"Passed to getBufferParameter to get a buffer's size."},p.BUFFER_USAGE={name:"BUFFER_USAGE",value:34661,description:"Passed to getBufferParameter to get the hint for the buffer passed in when it was created."},p.CURRENT_VERTEX_ATTRIB={name:"CURRENT_VERTEX_ATTRIB",value:34342,description:"Passed to getVertexAttrib to read back the current vertex attribute."},p.VERTEX_ATTRIB_ARRAY_ENABLED={name:"VERTEX_ATTRIB_ARRAY_ENABLED",value:34338,description:" "},p.VERTEX_ATTRIB_ARRAY_SIZE={name:"VERTEX_ATTRIB_ARRAY_SIZE",value:34339,description:" "},p.VERTEX_ATTRIB_ARRAY_STRIDE={name:"VERTEX_ATTRIB_ARRAY_STRIDE",value:34340,description:" "},p.VERTEX_ATTRIB_ARRAY_TYPE={name:"VERTEX_ATTRIB_ARRAY_TYPE",value:34341,description:" "},p.VERTEX_ATTRIB_ARRAY_NORMALIZED={name:"VERTEX_ATTRIB_ARRAY_NORMALIZED",value:34922,description:" "},p.VERTEX_ATTRIB_ARRAY_POINTER={name:"VERTEX_ATTRIB_ARRAY_POINTER",value:34373,description:" "},p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING={name:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",value:34975,description:" "},p.CULL_FACE={name:"CULL_FACE",value:2884,description:"Passed to enable/disable to turn on/off culling. Can also be used with getParameter to find the current culling method."},p.FRONT={name:"FRONT",value:1028,description:"Passed to cullFace to specify that only front faces should be drawn."},p.BACK={name:"BACK",value:1029,description:"Passed to cullFace to specify that only back faces should be drawn."},p.FRONT_AND_BACK={name:"FRONT_AND_BACK",value:1032,description:"Passed to cullFace to specify that front and back faces should be drawn."},p.BLEND={name:"BLEND",value:3042,description:"Passed to enable/disable to turn on/off blending. Can also be used with getParameter to find the current blending method."},p.DEPTH_TEST={name:"DEPTH_TEST",value:2929,description:"Passed to enable/disable to turn on/off the depth test. Can also be used with getParameter to query the depth test."},p.DITHER={name:"DITHER",value:3024,description:"Passed to enable/disable to turn on/off dithering. Can also be used with getParameter to find the current dithering method."},p.POLYGON_OFFSET_FILL={name:"POLYGON_OFFSET_FILL",value:32823,description:"Passed to enable/disable to turn on/off the polygon offset. Useful for rendering hidden-line images, decals, and or solids with highlighted edges. Can also be used with getParameter to query the scissor test."},p.SAMPLE_ALPHA_TO_COVERAGE={name:"SAMPLE_ALPHA_TO_COVERAGE",value:32926,description:"Passed to enable/disable to turn on/off the alpha to coverage. Used in multi-sampling alpha channels."},p.SAMPLE_COVERAGE={name:"SAMPLE_COVERAGE",value:32928,description:"Passed to enable/disable to turn on/off the sample coverage. Used in multi-sampling."},p.SCISSOR_TEST={name:"SCISSOR_TEST",value:3089,description:"Passed to enable/disable to turn on/off the scissor test. Can also be used with getParameter to query the scissor test."},p.STENCIL_TEST={name:"STENCIL_TEST",value:2960,description:"Passed to enable/disable to turn on/off the stencil test. Can also be used with getParameter to query the stencil test."},p.NO_ERROR={name:"NO_ERROR",value:0,description:"Returned from getError."},p.INVALID_ENUM={name:"INVALID_ENUM",value:1280,description:"Returned from getError."},p.INVALID_VALUE={name:"INVALID_VALUE",value:1281,description:"Returned from getError."},p.INVALID_OPERATION={name:"INVALID_OPERATION",value:1282,description:"Returned from getError."},p.OUT_OF_MEMORY={name:"OUT_OF_MEMORY",value:1285,description:"Returned from getError."},p.CONTEXT_LOST_WEBGL={name:"CONTEXT_LOST_WEBGL",value:37442,description:"Returned from getError."},p.CW={name:"CW",value:2304,description:"Passed to frontFace to specify the front face of a polygon is drawn in the clockwise direction"},p.CCW={name:"CCW",value:2305,description:"Passed to frontFace to specify the front face of a polygon is drawn in the counter clockwise direction"},p.DONT_CARE={name:"DONT_CARE",value:4352,description:"There is no preference for this behavior."},p.FASTEST={name:"FASTEST",value:4353,description:"The most efficient behavior should be used."},p.NICEST={name:"NICEST",value:4354,description:"The most correct or the highest quality option should be used."},p.GENERATE_MIPMAP_HINT={name:"GENERATE_MIPMAP_HINT",value:33170,description:"Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap()."},p.BYTE={name:"BYTE",value:5120,description:" "},p.UNSIGNED_BYTE={name:"UNSIGNED_BYTE",value:5121,description:" "},p.SHORT={name:"SHORT",value:5122,description:" "},p.UNSIGNED_SHORT={name:"UNSIGNED_SHORT",value:5123,description:" "},p.INT={name:"INT",value:5124,description:" "},p.UNSIGNED_INT={name:"UNSIGNED_INT",value:5125,description:" "},p.FLOAT={name:"FLOAT",value:5126,description:" "},p.DEPTH_COMPONENT={name:"DEPTH_COMPONENT",value:6402,description:" "},p.ALPHA={name:"ALPHA",value:6406,description:" "},p.RGB={name:"RGB",value:6407,description:" "},p.RGBA={name:"RGBA",value:6408,description:" "},p.LUMINANCE={name:"LUMINANCE",value:6409,description:" "},p.LUMINANCE_ALPHA={name:"LUMINANCE_ALPHA",value:6410,description:" "},p.UNSIGNED_SHORT_4_4_4_4={name:"UNSIGNED_SHORT_4_4_4_4",value:32819,description:" "},p.UNSIGNED_SHORT_5_5_5_1={name:"UNSIGNED_SHORT_5_5_5_1",value:32820,description:" "},p.UNSIGNED_SHORT_5_6_5={name:"UNSIGNED_SHORT_5_6_5",value:33635,description:" "},p.FRAGMENT_SHADER={name:"FRAGMENT_SHADER",value:35632,description:"Passed to createShader to define a fragment shader."},p.VERTEX_SHADER={name:"VERTEX_SHADER",value:35633,description:"Passed to createShader to define a vertex shader"},p.COMPILE_STATUS={name:"COMPILE_STATUS",value:35713,description:"Passed to getShaderParamter to get the status of the compilation. Returns false if the shader was not compiled. You can then query getShaderInfoLog to find the exact error"},p.DELETE_STATUS={name:"DELETE_STATUS",value:35712,description:"Passed to getShaderParamter to determine if a shader was deleted via deleteShader. Returns true if it was, false otherwise."},p.LINK_STATUS={name:"LINK_STATUS",value:35714,description:"Passed to getProgramParameter after calling linkProgram to determine if a program was linked correctly. Returns false if there were errors. Use getProgramInfoLog to find the exact error."},p.VALIDATE_STATUS={name:"VALIDATE_STATUS",value:35715,description:"Passed to getProgramParameter after calling validateProgram to determine if it is valid. Returns false if errors were found."},p.ATTACHED_SHADERS={name:"ATTACHED_SHADERS",value:35717,description:"Passed to getProgramParameter after calling attachShader to determine if the shader was attached correctly. Returns false if errors occurred."},p.COMPLETION_STATUS_KHR={name:"COMPLETION_STATUS_KHR",value:37297,description:"Passed to getProgramParameter (KHR_parallel_shader_compile) to query whether an asynchronous shader/program link has completed. Returns true once the program is ready to use without blocking."},p.ACTIVE_ATTRIBUTES={name:"ACTIVE_ATTRIBUTES",value:35721,description:"Passed to getProgramParameter to get the number of attributes active in a program."},p.ACTIVE_UNIFORMS={name:"ACTIVE_UNIFORMS",value:35718,description:"Passed to getProgramParamter to get the number of uniforms active in a program."},p.MAX_VERTEX_ATTRIBS={name:"MAX_VERTEX_ATTRIBS",value:34921,description:" "},p.MAX_VERTEX_UNIFORM_VECTORS={name:"MAX_VERTEX_UNIFORM_VECTORS",value:36347,description:" "},p.MAX_VARYING_VECTORS={name:"MAX_VARYING_VECTORS",value:36348,description:" "},p.MAX_COMBINED_TEXTURE_IMAGE_UNITS={name:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",value:35661,description:" "},p.MAX_VERTEX_TEXTURE_IMAGE_UNITS={name:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",value:35660,description:" "},p.MAX_TEXTURE_IMAGE_UNITS={name:"MAX_TEXTURE_IMAGE_UNITS",value:34930,description:"Implementation dependent number of maximum texture units. At least 8."},p.MAX_FRAGMENT_UNIFORM_VECTORS={name:"MAX_FRAGMENT_UNIFORM_VECTORS",value:36349,description:" "},p.SHADER_TYPE={name:"SHADER_TYPE",value:35663,description:" "},p.SHADING_LANGUAGE_VERSION={name:"SHADING_LANGUAGE_VERSION",value:35724,description:" "},p.CURRENT_PROGRAM={name:"CURRENT_PROGRAM",value:35725,description:" "},p.NEVER={name:"NEVER",value:512,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn."},p.ALWAYS={name:"ALWAYS",value:519,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn."},p.LESS={name:"LESS",value:513,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value."},p.EQUAL={name:"EQUAL",value:514,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value."},p.LEQUAL={name:"LEQUAL",value:515,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value."},p.GREATER={name:"GREATER",value:516,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value."},p.GEQUAL={name:"GEQUAL",value:518,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value."},p.NOTEQUAL={name:"NOTEQUAL",value:517,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value."},p.KEEP={name:"KEEP",value:7680,description:" "},p.REPLACE={name:"REPLACE",value:7681,description:" "},p.INCR={name:"INCR",value:7682,description:" "},p.DECR={name:"DECR",value:7683,description:" "},p.INVERT={name:"INVERT",value:5386,description:" "},p.INCR_WRAP={name:"INCR_WRAP",value:34055,description:" "},p.DECR_WRAP={name:"DECR_WRAP",value:34056,description:" "},p.NEAREST={name:"NEAREST",value:9728,description:" "},p.LINEAR={name:"LINEAR",value:9729,description:" "},p.NEAREST_MIPMAP_NEAREST={name:"NEAREST_MIPMAP_NEAREST",value:9984,description:" "},p.LINEAR_MIPMAP_NEAREST={name:"LINEAR_MIPMAP_NEAREST",value:9985,description:" "},p.NEAREST_MIPMAP_LINEAR={name:"NEAREST_MIPMAP_LINEAR",value:9986,description:" "},p.LINEAR_MIPMAP_LINEAR={name:"LINEAR_MIPMAP_LINEAR",value:9987,description:" "},p.TEXTURE_MAG_FILTER={name:"TEXTURE_MAG_FILTER",value:10240,description:" "},p.TEXTURE_MIN_FILTER={name:"TEXTURE_MIN_FILTER",value:10241,description:" "},p.TEXTURE_WRAP_S={name:"TEXTURE_WRAP_S",value:10242,description:" "},p.TEXTURE_WRAP_T={name:"TEXTURE_WRAP_T",value:10243,description:" "},p.TEXTURE_2D={name:"TEXTURE_2D",value:3553,description:" "},p.TEXTURE={name:"TEXTURE",value:5890,description:" "},p.TEXTURE_CUBE_MAP={name:"TEXTURE_CUBE_MAP",value:34067,description:" "},p.TEXTURE_BINDING_CUBE_MAP={name:"TEXTURE_BINDING_CUBE_MAP",value:34068,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_X={name:"TEXTURE_CUBE_MAP_POSITIVE_X",value:34069,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_X={name:"TEXTURE_CUBE_MAP_NEGATIVE_X",value:34070,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Y={name:"TEXTURE_CUBE_MAP_POSITIVE_Y",value:34071,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Y={name:"TEXTURE_CUBE_MAP_NEGATIVE_Y",value:34072,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Z={name:"TEXTURE_CUBE_MAP_POSITIVE_Z",value:34073,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Z={name:"TEXTURE_CUBE_MAP_NEGATIVE_Z",value:34074,description:" "},p.MAX_CUBE_MAP_TEXTURE_SIZE={name:"MAX_CUBE_MAP_TEXTURE_SIZE",value:34076,description:" "},p.TEXTURE0={name:"TEXTURE0",value:33984,description:"A texture unit."},p.TEXTURE1={name:"TEXTURE1",value:33985,description:"A texture unit."},p.TEXTURE2={name:"TEXTURE2",value:33986,description:"A texture unit."},p.TEXTURE3={name:"TEXTURE3",value:33987,description:"A texture unit."},p.TEXTURE4={name:"TEXTURE4",value:33988,description:"A texture unit."},p.TEXTURE5={name:"TEXTURE5",value:33989,description:"A texture unit."},p.TEXTURE6={name:"TEXTURE6",value:33990,description:"A texture unit."},p.TEXTURE7={name:"TEXTURE7",value:33991,description:"A texture unit."},p.TEXTURE8={name:"TEXTURE8",value:33992,description:"A texture unit."},p.TEXTURE9={name:"TEXTURE9",value:33993,description:"A texture unit."},p.TEXTURE10={name:"TEXTURE10",value:33994,description:"A texture unit."},p.TEXTURE11={name:"TEXTURE11",value:33995,description:"A texture unit."},p.TEXTURE12={name:"TEXTURE12",value:33996,description:"A texture unit."},p.TEXTURE13={name:"TEXTURE13",value:33997,description:"A texture unit."},p.TEXTURE14={name:"TEXTURE14",value:33998,description:"A texture unit."},p.TEXTURE15={name:"TEXTURE15",value:33999,description:"A texture unit."},p.TEXTURE16={name:"TEXTURE16",value:34e3,description:"A texture unit."},p.TEXTURE17={name:"TEXTURE17",value:34001,description:"A texture unit."},p.TEXTURE18={name:"TEXTURE18",value:34002,description:"A texture unit."},p.TEXTURE19={name:"TEXTURE19",value:34003,description:"A texture unit."},p.TEXTURE20={name:"TEXTURE20",value:34004,description:"A texture unit."},p.TEXTURE21={name:"TEXTURE21",value:34005,description:"A texture unit."},p.TEXTURE22={name:"TEXTURE22",value:34006,description:"A texture unit."},p.TEXTURE23={name:"TEXTURE23",value:34007,description:"A texture unit."},p.TEXTURE24={name:"TEXTURE24",value:34008,description:"A texture unit."},p.TEXTURE25={name:"TEXTURE25",value:34009,description:"A texture unit."},p.TEXTURE26={name:"TEXTURE26",value:34010,description:"A texture unit."},p.TEXTURE27={name:"TEXTURE27",value:34011,description:"A texture unit."},p.TEXTURE28={name:"TEXTURE28",value:34012,description:"A texture unit."},p.TEXTURE29={name:"TEXTURE29",value:34013,description:"A texture unit."},p.TEXTURE30={name:"TEXTURE30",value:34014,description:"A texture unit."},p.TEXTURE31={name:"TEXTURE31",value:34015,description:"A texture unit."},p.ACTIVE_TEXTURE={name:"ACTIVE_TEXTURE",value:34016,description:"The current active texture unit."},p.REPEAT={name:"REPEAT",value:10497,description:" "},p.CLAMP_TO_EDGE={name:"CLAMP_TO_EDGE",value:33071,description:" "},p.MIRRORED_REPEAT={name:"MIRRORED_REPEAT",value:33648,description:" "},p.FLOAT_VEC2={name:"FLOAT_VEC2",value:35664,description:" "},p.FLOAT_VEC3={name:"FLOAT_VEC3",value:35665,description:" "},p.FLOAT_VEC4={name:"FLOAT_VEC4",value:35666,description:" "},p.INT_VEC2={name:"INT_VEC2",value:35667,description:" "},p.INT_VEC3={name:"INT_VEC3",value:35668,description:" "},p.INT_VEC4={name:"INT_VEC4",value:35669,description:" "},p.BOOL={name:"BOOL",value:35670,description:" "},p.BOOL_VEC2={name:"BOOL_VEC2",value:35671,description:" "},p.BOOL_VEC3={name:"BOOL_VEC3",value:35672,description:" "},p.BOOL_VEC4={name:"BOOL_VEC4",value:35673,description:" "},p.FLOAT_MAT2={name:"FLOAT_MAT2",value:35674,description:" "},p.FLOAT_MAT3={name:"FLOAT_MAT3",value:35675,description:" "},p.FLOAT_MAT4={name:"FLOAT_MAT4",value:35676,description:" "},p.SAMPLER_2D={name:"SAMPLER_2D",value:35678,description:" "},p.SAMPLER_CUBE={name:"SAMPLER_CUBE",value:35680,description:" "},p.LOW_FLOAT={name:"LOW_FLOAT",value:36336,description:" "},p.MEDIUM_FLOAT={name:"MEDIUM_FLOAT",value:36337,description:" "},p.HIGH_FLOAT={name:"HIGH_FLOAT",value:36338,description:" "},p.LOW_INT={name:"LOW_INT",value:36339,description:" "},p.MEDIUM_INT={name:"MEDIUM_INT",value:36340,description:" "},p.HIGH_INT={name:"HIGH_INT",value:36341,description:" "},p.FRAMEBUFFER={name:"FRAMEBUFFER",value:36160,description:" "},p.RENDERBUFFER={name:"RENDERBUFFER",value:36161,description:" "},p.RGBA4={name:"RGBA4",value:32854,description:" "},p.RGB5_A1={name:"RGB5_A1",value:32855,description:" "},p.RGB565={name:"RGB565",value:36194,description:" "},p.DEPTH_COMPONENT16={name:"DEPTH_COMPONENT16",value:33189,description:" "},p.STENCIL_INDEX={name:"STENCIL_INDEX",value:6401,description:" "},p.STENCIL_INDEX8={name:"STENCIL_INDEX8",value:36168,description:" "},p.DEPTH_STENCIL={name:"DEPTH_STENCIL",value:34041,description:" "},p.RENDERBUFFER_WIDTH={name:"RENDERBUFFER_WIDTH",value:36162,description:" "},p.RENDERBUFFER_HEIGHT={name:"RENDERBUFFER_HEIGHT",value:36163,description:" "},p.RENDERBUFFER_INTERNAL_FORMAT={name:"RENDERBUFFER_INTERNAL_FORMAT",value:36164,description:" "},p.RENDERBUFFER_RED_SIZE={name:"RENDERBUFFER_RED_SIZE",value:36176,description:" "},p.RENDERBUFFER_GREEN_SIZE={name:"RENDERBUFFER_GREEN_SIZE",value:36177,description:" "},p.RENDERBUFFER_BLUE_SIZE={name:"RENDERBUFFER_BLUE_SIZE",value:36178,description:" "},p.RENDERBUFFER_ALPHA_SIZE={name:"RENDERBUFFER_ALPHA_SIZE",value:36179,description:" "},p.RENDERBUFFER_DEPTH_SIZE={name:"RENDERBUFFER_DEPTH_SIZE",value:36180,description:" "},p.RENDERBUFFER_STENCIL_SIZE={name:"RENDERBUFFER_STENCIL_SIZE",value:36181,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",value:36048,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",value:36049,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",value:36050,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",value:36051,description:" "},p.COLOR_ATTACHMENT0={name:"COLOR_ATTACHMENT0",value:36064,description:" "},p.DEPTH_ATTACHMENT={name:"DEPTH_ATTACHMENT",value:36096,description:" "},p.STENCIL_ATTACHMENT={name:"STENCIL_ATTACHMENT",value:36128,description:" "},p.DEPTH_STENCIL_ATTACHMENT={name:"DEPTH_STENCIL_ATTACHMENT",value:33306,description:" "},p.NONE={name:"NONE",value:0,description:" "},p.FRAMEBUFFER_COMPLETE={name:"FRAMEBUFFER_COMPLETE",value:36053,description:" "},p.FRAMEBUFFER_INCOMPLETE_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",value:36054,description:" "},p.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",value:36055,description:" "},p.FRAMEBUFFER_INCOMPLETE_DIMENSIONS={name:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",value:36057,description:" "},p.FRAMEBUFFER_UNSUPPORTED={name:"FRAMEBUFFER_UNSUPPORTED",value:36061,description:" "},p.FRAMEBUFFER_BINDING={name:"FRAMEBUFFER_BINDING",value:36006,description:" "},p.RENDERBUFFER_BINDING={name:"RENDERBUFFER_BINDING",value:36007,description:" "},p.MAX_RENDERBUFFER_SIZE={name:"MAX_RENDERBUFFER_SIZE",value:34024,description:" "},p.INVALID_FRAMEBUFFER_OPERATION={name:"INVALID_FRAMEBUFFER_OPERATION",value:1286,description:" "},p.UNPACK_FLIP_Y_WEBGL={name:"UNPACK_FLIP_Y_WEBGL",value:37440,description:" "},p.UNPACK_PREMULTIPLY_ALPHA_WEBGL={name:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",value:37441,description:" "},p.UNPACK_COLORSPACE_CONVERSION_WEBGL={name:"UNPACK_COLORSPACE_CONVERSION_WEBGL",value:37443,description:" "},p.READ_BUFFER={name:"READ_BUFFER",value:3074,description:" "},p.UNPACK_ROW_LENGTH={name:"UNPACK_ROW_LENGTH",value:3314,description:" "},p.UNPACK_SKIP_ROWS={name:"UNPACK_SKIP_ROWS",value:3315,description:" "},p.UNPACK_SKIP_PIXELS={name:"UNPACK_SKIP_PIXELS",value:3316,description:" "},p.PACK_ROW_LENGTH={name:"PACK_ROW_LENGTH",value:3330,description:" "},p.PACK_SKIP_ROWS={name:"PACK_SKIP_ROWS",value:3331,description:" "},p.PACK_SKIP_PIXELS={name:"PACK_SKIP_PIXELS",value:3332,description:" "},p.TEXTURE_BINDING_3D={name:"TEXTURE_BINDING_3D",value:32874,description:" "},p.UNPACK_SKIP_IMAGES={name:"UNPACK_SKIP_IMAGES",value:32877,description:" "},p.UNPACK_IMAGE_HEIGHT={name:"UNPACK_IMAGE_HEIGHT",value:32878,description:" "},p.MAX_3D_TEXTURE_SIZE={name:"MAX_3D_TEXTURE_SIZE",value:32883,description:" "},p.MAX_ELEMENTS_VERTICES={name:"MAX_ELEMENTS_VERTICES",value:33e3,description:" "},p.MAX_ELEMENTS_INDICES={name:"MAX_ELEMENTS_INDICES",value:33001,description:" "},p.MAX_TEXTURE_LOD_BIAS={name:"MAX_TEXTURE_LOD_BIAS",value:34045,description:" "},p.MAX_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_FRAGMENT_UNIFORM_COMPONENTS",value:35657,description:" "},p.MAX_VERTEX_UNIFORM_COMPONENTS={name:"MAX_VERTEX_UNIFORM_COMPONENTS",value:35658,description:" "},p.MAX_ARRAY_TEXTURE_LAYERS={name:"MAX_ARRAY_TEXTURE_LAYERS",value:35071,description:" "},p.MIN_PROGRAM_TEXEL_OFFSET={name:"MIN_PROGRAM_TEXEL_OFFSET",value:35076,description:" "},p.MAX_PROGRAM_TEXEL_OFFSET={name:"MAX_PROGRAM_TEXEL_OFFSET",value:35077,description:" "},p.MAX_VARYING_COMPONENTS={name:"MAX_VARYING_COMPONENTS",value:35659,description:" "},p.FRAGMENT_SHADER_DERIVATIVE_HINT={name:"FRAGMENT_SHADER_DERIVATIVE_HINT",value:35723,description:" "},p.RASTERIZER_DISCARD={name:"RASTERIZER_DISCARD",value:35977,description:" "},p.VERTEX_ARRAY_BINDING={name:"VERTEX_ARRAY_BINDING",value:34229,description:" "},p.MAX_VERTEX_OUTPUT_COMPONENTS={name:"MAX_VERTEX_OUTPUT_COMPONENTS",value:37154,description:" "},p.MAX_FRAGMENT_INPUT_COMPONENTS={name:"MAX_FRAGMENT_INPUT_COMPONENTS",value:37157,description:" "},p.MAX_SERVER_WAIT_TIMEOUT={name:"MAX_SERVER_WAIT_TIMEOUT",value:37137,description:" "},p.MAX_ELEMENT_INDEX={name:"MAX_ELEMENT_INDEX",value:36203,description:" "},p.RED={name:"RED",value:6403,description:" "},p.RGB8={name:"RGB8",value:32849,description:" "},p.RGBA8={name:"RGBA8",value:32856,description:" "},p.RGB10_A2={name:"RGB10_A2",value:32857,description:" "},p.TEXTURE_3D={name:"TEXTURE_3D",value:32879,description:" "},p.TEXTURE_WRAP_R={name:"TEXTURE_WRAP_R",value:32882,description:" "},p.TEXTURE_MIN_LOD={name:"TEXTURE_MIN_LOD",value:33082,description:" "},p.TEXTURE_MAX_LOD={name:"TEXTURE_MAX_LOD",value:33083,description:" "},p.TEXTURE_BASE_LEVEL={name:"TEXTURE_BASE_LEVEL",value:33084,description:" "},p.TEXTURE_MAX_LEVEL={name:"TEXTURE_MAX_LEVEL",value:33085,description:" "},p.TEXTURE_COMPARE_MODE={name:"TEXTURE_COMPARE_MODE",value:34892,description:" "},p.TEXTURE_COMPARE_FUNC={name:"TEXTURE_COMPARE_FUNC",value:34893,description:" "},p.SRGB={name:"SRGB",value:35904,description:" "},p.SRGB8={name:"SRGB8",value:35905,description:" "},p.SRGB8_ALPHA8={name:"SRGB8_ALPHA8",value:35907,description:" "},p.COMPARE_REF_TO_TEXTURE={name:"COMPARE_REF_TO_TEXTURE",value:34894,description:" "},p.RGBA32F={name:"RGBA32F",value:34836,description:" "},p.RGB32F={name:"RGB32F",value:34837,description:" "},p.RGBA16F={name:"RGBA16F",value:34842,description:" "},p.RGB16F={name:"RGB16F",value:34843,description:" "},p.TEXTURE_2D_ARRAY={name:"TEXTURE_2D_ARRAY",value:35866,description:" "},p.TEXTURE_BINDING_2D_ARRAY={name:"TEXTURE_BINDING_2D_ARRAY",value:35869,description:" "},p.R11F_G11F_B10F={name:"R11F_G11F_B10F",value:35898,description:" "},p.RGB9_E5={name:"RGB9_E5",value:35901,description:" "},p.RGBA32UI={name:"RGBA32UI",value:36208,description:" "},p.RGB32UI={name:"RGB32UI",value:36209,description:" "},p.RGBA16UI={name:"RGBA16UI",value:36214,description:" "},p.RGB16UI={name:"RGB16UI",value:36215,description:" "},p.RGBA8UI={name:"RGBA8UI",value:36220,description:" "},p.RGB8UI={name:"RGB8UI",value:36221,description:" "},p.RGBA32I={name:"RGBA32I",value:36226,description:" "},p.RGB32I={name:"RGB32I",value:36227,description:" "},p.RGBA16I={name:"RGBA16I",value:36232,description:" "},p.RGB16I={name:"RGB16I",value:36233,description:" "},p.RGBA8I={name:"RGBA8I",value:36238,description:" "},p.RGB8I={name:"RGB8I",value:36239,description:" "},p.RED_INTEGER={name:"RED_INTEGER",value:36244,description:" "},p.RGB_INTEGER={name:"RGB_INTEGER",value:36248,description:" "},p.RGBA_INTEGER={name:"RGBA_INTEGER",value:36249,description:" "},p.R8={name:"R8",value:33321,description:" "},p.RG8={name:"RG8",value:33323,description:" "},p.R16F={name:"R16F",value:33325,description:" "},p.R32F={name:"R32F",value:33326,description:" "},p.RG16F={name:"RG16F",value:33327,description:" "},p.RG32F={name:"RG32F",value:33328,description:" "},p.R8I={name:"R8I",value:33329,description:" "},p.R8UI={name:"R8UI",value:33330,description:" "},p.R16I={name:"R16I",value:33331,description:" "},p.R16UI={name:"R16UI",value:33332,description:" "},p.R32I={name:"R32I",value:33333,description:" "},p.R32UI={name:"R32UI",value:33334,description:" "},p.RG8I={name:"RG8I",value:33335,description:" "},p.RG8UI={name:"RG8UI",value:33336,description:" "},p.RG16I={name:"RG16I",value:33337,description:" "},p.RG16UI={name:"RG16UI",value:33338,description:" "},p.RG32I={name:"RG32I",value:33339,description:" "},p.RG32UI={name:"RG32UI",value:33340,description:" "},p.R8_SNORM={name:"R8_SNORM",value:36756,description:" "},p.RG8_SNORM={name:"RG8_SNORM",value:36757,description:" "},p.RGB8_SNORM={name:"RGB8_SNORM",value:36758,description:" "},p.RGBA8_SNORM={name:"RGBA8_SNORM",value:36759,description:" "},p.RGB10_A2UI={name:"RGB10_A2UI",value:36975,description:" "},p.TEXTURE_IMMUTABLE_FORMAT={name:"TEXTURE_IMMUTABLE_FORMAT",value:37167,description:" "},p.TEXTURE_IMMUTABLE_LEVELS={name:"TEXTURE_IMMUTABLE_LEVELS",value:33503,description:" "},p.UNSIGNED_INT_2_10_10_10_REV={name:"UNSIGNED_INT_2_10_10_10_REV",value:33640,description:" "},p.UNSIGNED_INT_10F_11F_11F_REV={name:"UNSIGNED_INT_10F_11F_11F_REV",value:35899,description:" "},p.UNSIGNED_INT_5_9_9_9_REV={name:"UNSIGNED_INT_5_9_9_9_REV",value:35902,description:" "},p.FLOAT_32_UNSIGNED_INT_24_8_REV={name:"FLOAT_32_UNSIGNED_INT_24_8_REV",value:36269,description:" "},p.UNSIGNED_INT_24_8={name:"UNSIGNED_INT_24_8",value:34042,description:" "},p.HALF_FLOAT={name:"HALF_FLOAT",value:5131,description:" "},p.RG={name:"RG",value:33319,description:" "},p.RG_INTEGER={name:"RG_INTEGER",value:33320,description:" "},p.INT_2_10_10_10_REV={name:"INT_2_10_10_10_REV",value:36255,description:" "},p.CURRENT_QUERY={name:"CURRENT_QUERY",value:34917,description:" "},p.QUERY_RESULT={name:"QUERY_RESULT",value:34918,description:" "},p.QUERY_RESULT_AVAILABLE={name:"QUERY_RESULT_AVAILABLE",value:34919,description:" "},p.ANY_SAMPLES_PASSED={name:"ANY_SAMPLES_PASSED",value:35887,description:" "},p.ANY_SAMPLES_PASSED_CONSERVATIVE={name:"ANY_SAMPLES_PASSED_CONSERVATIVE",value:36202,description:" "},p.MAX_DRAW_BUFFERS={name:"MAX_DRAW_BUFFERS",value:34852,description:" "},p.DRAW_BUFFER0={name:"DRAW_BUFFER0",value:34853,description:" "},p.DRAW_BUFFER1={name:"DRAW_BUFFER1",value:34854,description:" "},p.DRAW_BUFFER2={name:"DRAW_BUFFER2",value:34855,description:" "},p.DRAW_BUFFER3={name:"DRAW_BUFFER3",value:34856,description:" "},p.DRAW_BUFFER4={name:"DRAW_BUFFER4",value:34857,description:" "},p.DRAW_BUFFER5={name:"DRAW_BUFFER5",value:34858,description:" "},p.DRAW_BUFFER6={name:"DRAW_BUFFER6",value:34859,description:" "},p.DRAW_BUFFER7={name:"DRAW_BUFFER7",value:34860,description:" "},p.DRAW_BUFFER8={name:"DRAW_BUFFER8",value:34861,description:" "},p.DRAW_BUFFER9={name:"DRAW_BUFFER9",value:34862,description:" "},p.DRAW_BUFFER10={name:"DRAW_BUFFER10",value:34863,description:" "},p.DRAW_BUFFER11={name:"DRAW_BUFFER11",value:34864,description:" "},p.DRAW_BUFFER12={name:"DRAW_BUFFER12",value:34865,description:" "},p.DRAW_BUFFER13={name:"DRAW_BUFFER13",value:34866,description:" "},p.DRAW_BUFFER14={name:"DRAW_BUFFER14",value:34867,description:" "},p.DRAW_BUFFER15={name:"DRAW_BUFFER15",value:34868,description:" "},p.MAX_COLOR_ATTACHMENTS={name:"MAX_COLOR_ATTACHMENTS",value:36063,description:" "},p.COLOR_ATTACHMENT1={name:"COLOR_ATTACHMENT1",value:36065,description:" "},p.COLOR_ATTACHMENT2={name:"COLOR_ATTACHMENT2",value:36066,description:" "},p.COLOR_ATTACHMENT3={name:"COLOR_ATTACHMENT3",value:36067,description:" "},p.COLOR_ATTACHMENT4={name:"COLOR_ATTACHMENT4",value:36068,description:" "},p.COLOR_ATTACHMENT5={name:"COLOR_ATTACHMENT5",value:36069,description:" "},p.COLOR_ATTACHMENT6={name:"COLOR_ATTACHMENT6",value:36070,description:" "},p.COLOR_ATTACHMENT7={name:"COLOR_ATTACHMENT7",value:36071,description:" "},p.COLOR_ATTACHMENT8={name:"COLOR_ATTACHMENT8",value:36072,description:" "},p.COLOR_ATTACHMENT9={name:"COLOR_ATTACHMENT9",value:36073,description:" "},p.COLOR_ATTACHMENT10={name:"COLOR_ATTACHMENT10",value:36074,description:" "},p.COLOR_ATTACHMENT11={name:"COLOR_ATTACHMENT11",value:36075,description:" "},p.COLOR_ATTACHMENT12={name:"COLOR_ATTACHMENT12",value:36076,description:" "},p.COLOR_ATTACHMENT13={name:"COLOR_ATTACHMENT13",value:36077,description:" "},p.COLOR_ATTACHMENT14={name:"COLOR_ATTACHMENT14",value:36078,description:" "},p.COLOR_ATTACHMENT15={name:"COLOR_ATTACHMENT15",value:36079,description:" "},p.SAMPLER_3D={name:"SAMPLER_3D",value:35679,description:" "},p.SAMPLER_2D_SHADOW={name:"SAMPLER_2D_SHADOW",value:35682,description:" "},p.SAMPLER_2D_ARRAY={name:"SAMPLER_2D_ARRAY",value:36289,description:" "},p.SAMPLER_2D_ARRAY_SHADOW={name:"SAMPLER_2D_ARRAY_SHADOW",value:36292,description:" "},p.SAMPLER_CUBE_SHADOW={name:"SAMPLER_CUBE_SHADOW",value:36293,description:" "},p.INT_SAMPLER_2D={name:"INT_SAMPLER_2D",value:36298,description:" "},p.INT_SAMPLER_3D={name:"INT_SAMPLER_3D",value:36299,description:" "},p.INT_SAMPLER_CUBE={name:"INT_SAMPLER_CUBE",value:36300,description:" "},p.INT_SAMPLER_2D_ARRAY={name:"INT_SAMPLER_2D_ARRAY",value:36303,description:" "},p.UNSIGNED_INT_SAMPLER_2D={name:"UNSIGNED_INT_SAMPLER_2D",value:36306,description:" "},p.UNSIGNED_INT_SAMPLER_3D={name:"UNSIGNED_INT_SAMPLER_3D",value:36307,description:" "},p.UNSIGNED_INT_SAMPLER_CUBE={name:"UNSIGNED_INT_SAMPLER_CUBE",value:36308,description:" "},p.UNSIGNED_INT_SAMPLER_2D_ARRAY={name:"UNSIGNED_INT_SAMPLER_2D_ARRAY",value:36311,description:" "},p.MAX_SAMPLES={name:"MAX_SAMPLES",value:36183,description:" "},p.SAMPLER_BINDING={name:"SAMPLER_BINDING",value:35097,description:" "},p.PIXEL_PACK_BUFFER={name:"PIXEL_PACK_BUFFER",value:35051,description:" "},p.PIXEL_UNPACK_BUFFER={name:"PIXEL_UNPACK_BUFFER",value:35052,description:" "},p.PIXEL_PACK_BUFFER_BINDING={name:"PIXEL_PACK_BUFFER_BINDING",value:35053,description:" "},p.PIXEL_UNPACK_BUFFER_BINDING={name:"PIXEL_UNPACK_BUFFER_BINDING",value:35055,description:" "},p.COPY_READ_BUFFER={name:"COPY_READ_BUFFER",value:36662,description:" "},p.COPY_WRITE_BUFFER={name:"COPY_WRITE_BUFFER",value:36663,description:" "},p.COPY_READ_BUFFER_BINDING={name:"COPY_READ_BUFFER_BINDING",value:36662,description:" "},p.COPY_WRITE_BUFFER_BINDING={name:"COPY_WRITE_BUFFER_BINDING",value:36663,description:" "},p.FLOAT_MAT2x3={name:"FLOAT_MAT2x3",value:35685,description:" "},p.FLOAT_MAT2x4={name:"FLOAT_MAT2x4",value:35686,description:" "},p.FLOAT_MAT3x2={name:"FLOAT_MAT3x2",value:35687,description:" "},p.FLOAT_MAT3x4={name:"FLOAT_MAT3x4",value:35688,description:" "},p.FLOAT_MAT4x2={name:"FLOAT_MAT4x2",value:35689,description:" "},p.FLOAT_MAT4x3={name:"FLOAT_MAT4x3",value:35690,description:" "},p.UNSIGNED_INT_VEC2={name:"UNSIGNED_INT_VEC2",value:36294,description:" "},p.UNSIGNED_INT_VEC3={name:"UNSIGNED_INT_VEC3",value:36295,description:" "},p.UNSIGNED_INT_VEC4={name:"UNSIGNED_INT_VEC4",value:36296,description:" "},p.UNSIGNED_NORMALIZED={name:"UNSIGNED_NORMALIZED",value:35863,description:" "},p.SIGNED_NORMALIZED={name:"SIGNED_NORMALIZED",value:36764,description:" "},p.VERTEX_ATTRIB_ARRAY_INTEGER={name:"VERTEX_ATTRIB_ARRAY_INTEGER",value:35069,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR={name:"VERTEX_ATTRIB_ARRAY_DIVISOR",value:35070,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_MODE={name:"TRANSFORM_FEEDBACK_BUFFER_MODE",value:35967,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",value:35968,description:" "},p.TRANSFORM_FEEDBACK_VARYINGS={name:"TRANSFORM_FEEDBACK_VARYINGS",value:35971,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_START={name:"TRANSFORM_FEEDBACK_BUFFER_START",value:35972,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_SIZE={name:"TRANSFORM_FEEDBACK_BUFFER_SIZE",value:35973,description:" "},p.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN={name:"TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",value:35976,description:" "},p.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",value:35978,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",value:35979,description:" "},p.INTERLEAVED_ATTRIBS={name:"INTERLEAVED_ATTRIBS",value:35980,description:" "},p.SEPARATE_ATTRIBS={name:"SEPARATE_ATTRIBS",value:35981,description:" "},p.TRANSFORM_FEEDBACK_BUFFER={name:"TRANSFORM_FEEDBACK_BUFFER",value:35982,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_BINDING={name:"TRANSFORM_FEEDBACK_BUFFER_BINDING",value:35983,description:" "},p.TRANSFORM_FEEDBACK={name:"TRANSFORM_FEEDBACK",value:36386,description:" "},p.TRANSFORM_FEEDBACK_PAUSED={name:"TRANSFORM_FEEDBACK_PAUSED",value:36387,description:" "},p.TRANSFORM_FEEDBACK_ACTIVE={name:"TRANSFORM_FEEDBACK_ACTIVE",value:36388,description:" "},p.TRANSFORM_FEEDBACK_BINDING={name:"TRANSFORM_FEEDBACK_BINDING",value:36389,description:" "},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",value:33296,description:" "},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",value:33297,description:" "},p.FRAMEBUFFER_ATTACHMENT_RED_SIZE={name:"FRAMEBUFFER_ATTACHMENT_RED_SIZE",value:33298,description:" "},p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE={name:"FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",value:33299,description:" "},p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE={name:"FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",value:33300,description:" "},p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE={name:"FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",value:33301,description:" "},p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE={name:"FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",value:33302,description:" "},p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE={name:"FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",value:33303,description:" "},p.FRAMEBUFFER_DEFAULT={name:"FRAMEBUFFER_DEFAULT",value:33304,description:" "},p.DEPTH24_STENCIL8={name:"DEPTH24_STENCIL8",value:35056,description:" "},p.DRAW_FRAMEBUFFER_BINDING={name:"DRAW_FRAMEBUFFER_BINDING",value:36006,description:" "},p.READ_FRAMEBUFFER={name:"READ_FRAMEBUFFER",value:36008,description:" "},p.DRAW_FRAMEBUFFER={name:"DRAW_FRAMEBUFFER",value:36009,description:" "},p.READ_FRAMEBUFFER_BINDING={name:"READ_FRAMEBUFFER_BINDING",value:36010,description:" "},p.RENDERBUFFER_SAMPLES={name:"RENDERBUFFER_SAMPLES",value:36011,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",value:36052,description:" "},p.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE={name:"FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",value:36182,description:" "},p.UNIFORM_BUFFER={name:"UNIFORM_BUFFER",value:35345,description:" "},p.UNIFORM_BUFFER_BINDING={name:"UNIFORM_BUFFER_BINDING",value:35368,description:" "},p.UNIFORM_BUFFER_START={name:"UNIFORM_BUFFER_START",value:35369,description:" "},p.UNIFORM_BUFFER_SIZE={name:"UNIFORM_BUFFER_SIZE",value:35370,description:" "},p.MAX_VERTEX_UNIFORM_BLOCKS={name:"MAX_VERTEX_UNIFORM_BLOCKS",value:35371,description:" "},p.MAX_FRAGMENT_UNIFORM_BLOCKS={name:"MAX_FRAGMENT_UNIFORM_BLOCKS",value:35373,description:" "},p.MAX_COMBINED_UNIFORM_BLOCKS={name:"MAX_COMBINED_UNIFORM_BLOCKS",value:35374,description:" "},p.MAX_UNIFORM_BUFFER_BINDINGS={name:"MAX_UNIFORM_BUFFER_BINDINGS",value:35375,description:" "},p.MAX_UNIFORM_BLOCK_SIZE={name:"MAX_UNIFORM_BLOCK_SIZE",value:35376,description:" "},p.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS={name:"MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",value:35377,description:" "},p.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",value:35379,description:" "},p.UNIFORM_BUFFER_OFFSET_ALIGNMENT={name:"UNIFORM_BUFFER_OFFSET_ALIGNMENT",value:35380,description:" "},p.ACTIVE_UNIFORM_BLOCKS={name:"ACTIVE_UNIFORM_BLOCKS",value:35382,description:" "},p.UNIFORM_TYPE={name:"UNIFORM_TYPE",value:35383,description:" "},p.UNIFORM_SIZE={name:"UNIFORM_SIZE",value:35384,description:" "},p.UNIFORM_BLOCK_INDEX={name:"UNIFORM_BLOCK_INDEX",value:35386,description:" "},p.UNIFORM_OFFSET={name:"UNIFORM_OFFSET",value:35387,description:" "},p.UNIFORM_ARRAY_STRIDE={name:"UNIFORM_ARRAY_STRIDE",value:35388,description:" "},p.UNIFORM_MATRIX_STRIDE={name:"UNIFORM_MATRIX_STRIDE",value:35389,description:" "},p.UNIFORM_IS_ROW_MAJOR={name:"UNIFORM_IS_ROW_MAJOR",value:35390,description:" "},p.UNIFORM_BLOCK_BINDING={name:"UNIFORM_BLOCK_BINDING",value:35391,description:" "},p.UNIFORM_BLOCK_DATA_SIZE={name:"UNIFORM_BLOCK_DATA_SIZE",value:35392,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORMS={name:"UNIFORM_BLOCK_ACTIVE_UNIFORMS",value:35394,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES={name:"UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",value:35395,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",value:35396,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",value:35398,description:" "},p.OBJECT_TYPE={name:"OBJECT_TYPE",value:37138,description:" "},p.SYNC_CONDITION={name:"SYNC_CONDITION",value:37139,description:" "},p.SYNC_STATUS={name:"SYNC_STATUS",value:37140,description:" "},p.SYNC_FLAGS={name:"SYNC_FLAGS",value:37141,description:" "},p.SYNC_FENCE={name:"SYNC_FENCE",value:37142,description:" "},p.SYNC_GPU_COMMANDS_COMPLETE={name:"SYNC_GPU_COMMANDS_COMPLETE",value:37143,description:" "},p.UNSIGNALED={name:"UNSIGNALED",value:37144,description:" "},p.SIGNALED={name:"SIGNALED",value:37145,description:" "},p.ALREADY_SIGNALED={name:"ALREADY_SIGNALED",value:37146,description:" "},p.TIMEOUT_EXPIRED={name:"TIMEOUT_EXPIRED",value:37147,description:" "},p.CONDITION_SATISFIED={name:"CONDITION_SATISFIED",value:37148,description:" "},p.WAIT_FAILED={name:"WAIT_FAILED",value:37149,description:" "},p.SYNC_FLUSH_COMMANDS_BIT={name:"SYNC_FLUSH_COMMANDS_BIT",value:1,description:" "},p.COLOR={name:"COLOR",value:6144,description:" "},p.DEPTH={name:"DEPTH",value:6145,description:" "},p.STENCIL={name:"STENCIL",value:6146,description:" "},p.MIN={name:"MIN",value:32775,description:" "},p.MAX={name:"MAX",value:32776,description:" "},p.DEPTH_COMPONENT24={name:"DEPTH_COMPONENT24",value:33190,description:" "},p.STREAM_READ={name:"STREAM_READ",value:35041,description:" "},p.STREAM_COPY={name:"STREAM_COPY",value:35042,description:" "},p.STATIC_READ={name:"STATIC_READ",value:35045,description:" "},p.STATIC_COPY={name:"STATIC_COPY",value:35046,description:" "},p.DYNAMIC_READ={name:"DYNAMIC_READ",value:35049,description:" "},p.DYNAMIC_COPY={name:"DYNAMIC_COPY",value:35050,description:" "},p.DEPTH_COMPONENT32F={name:"DEPTH_COMPONENT32F",value:36012,description:" "},p.DEPTH32F_STENCIL8={name:"DEPTH32F_STENCIL8",value:36013,description:" "},p.INVALID_INDEX={name:"INVALID_INDEX",value:4294967295,description:" "},p.TIMEOUT_IGNORED={name:"TIMEOUT_IGNORED",value:-1,description:" "},p.MAX_CLIENT_WAIT_TIMEOUT_WEBGL={name:"MAX_CLIENT_WAIT_TIMEOUT_WEBGL",value:37447,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE={name:"VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",value:35070,description:"Describes the frequency divisor used for instanced rendering.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_VENDOR_WEBGL={name:"UNMASKED_VENDOR_WEBGL",value:37445,description:"Passed to getParameter to get the vendor string of the graphics driver.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_RENDERER_WEBGL={name:"UNMASKED_RENDERER_WEBGL",value:37446,description:"Passed to getParameter to get the renderer string of the graphics driver.",extensionName:"WEBGL_debug_renderer_info"},p.MAX_TEXTURE_MAX_ANISOTROPY_EXT={name:"MAX_TEXTURE_MAX_ANISOTROPY_EXT",value:34047,description:"Returns the maximum available anisotropy.",extensionName:"EXT_texture_filter_anisotropic"},p.TEXTURE_MAX_ANISOTROPY_EXT={name:"TEXTURE_MAX_ANISOTROPY_EXT",value:34046,description:"Passed to texParameter to set the desired maximum anisotropy for a texture.",extensionName:"EXT_texture_filter_anisotropic"},p.COMPRESSED_RGB_S3TC_DXT1_EXT={name:"COMPRESSED_RGB_S3TC_DXT1_EXT",value:33776,description:"A DXT1-compressed image in an RGB image format.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT1_EXT={name:"COMPRESSED_RGBA_S3TC_DXT1_EXT",value:33777,description:"A DXT1-compressed image in an RGB image format with a simple on/off alpha value.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT3_EXT={name:"COMPRESSED_RGBA_S3TC_DXT3_EXT",value:33778,description:"A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT5_EXT={name:"COMPRESSED_RGBA_S3TC_DXT5_EXT",value:33779,description:"A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_R11_EAC={name:"COMPRESSED_R11_EAC",value:37488,description:"One-channel (red) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_R11_EAC={name:"COMPRESSED_SIGNED_R11_EAC",value:37489,description:"One-channel (red) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RG11_EAC={name:"COMPRESSED_RG11_EAC",value:37490,description:"Two-channel (red and green) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_RG11_EAC={name:"COMPRESSED_SIGNED_RG11_EAC",value:37491,description:"Two-channel (red and green) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_ETC2={name:"COMPRESSED_RGB8_ETC2",value:37492,description:"Compresses RBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGBA8_ETC2_EAC={name:"COMPRESSED_RGBA8_ETC2_EAC",value:37493,description:"Compresses RGBA8 data. The RGB part is encoded the same as RGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ETC2={name:"COMPRESSED_SRGB8_ETC2",value:37494,description:"Compresses sRBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC={name:"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",value:37495,description:"Compresses sRGBA8 data. The sRGB part is encoded the same as SRGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37496,description:"Similar to RGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37497,description:"Similar to SRGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_4BPPV1_IMG",value:35840,description:"RGB compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",value:35842,description:"RGBA compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_2BPPV1_IMG",value:35841,description:"RGB compression in 2-bit mode. One block for each 8×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",value:35843,description:"RGBA compression in 2-bit mode. One block for each 8×4 pixe",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_ETC1_WEBGL={name:"COMPRESSED_RGB_ETC1_WEBGL",value:36196,description:"Compresses 24-bit RGB data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc1"},p.COMPRESSED_RGB_ATC_WEBGL={name:"COMPRESSED_RGB_ATC_WEBGL",value:35986,description:"Compresses RGB textures with no alpha channel.",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",value:35986,description:"Compresses RGBA textures using explicit alpha encoding (useful when alpha transitions are sharp).",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",value:34798,description:"Compresses RGBA textures using interpolated alpha encoding (useful when alpha transitions are gradient).",extensionName:"WEBGL_compressed_texture_atc"},p.UNSIGNED_INT_24_8_WEBGL={name:"UNSIGNED_INT_24_8_WEBGL",value:34042,description:"Unsigned integer type for 24-bit depth texture data.",extensionName:"WEBGL_depth_texture"},p.HALF_FLOAT_OES={name:"HALF_FLOAT_OES",value:36193,description:"Half floating-point type (16-bit).",extensionName:"OES_texture_half_float"},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",value:33297,description:" ",extensionName:"WEBGL_color_buffer_float"},p.UNSIGNED_NORMALIZED_EXT={name:"UNSIGNED_NORMALIZED_EXT",value:35863,description:" ",extensionName:"WEBGL_color_buffer_float"},p.MIN_EXT={name:"MIN_EXT",value:32775,description:"Produces the minimum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.MAX_EXT={name:"MAX_EXT",value:32776,description:"Produces the maximum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.SRGB_EXT={name:"SRGB_EXT",value:35904,description:"Unsized sRGB format that leaves the precision up to the driver.",extensionName:"EXT_sRGB"},p.SRGB_ALPHA_EXT={name:"SRGB_ALPHA_EXT",value:35906,description:"Unsized sRGB format with unsized alpha component.",extensionName:"EXT_sRGB"},p.SRGB8_ALPHA8_EXT={name:"SRGB8_ALPHA8_EXT",value:35907,description:"Sized (8-bit) sRGB and alpha formats.",extensionName:"EXT_sRGB"},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",value:33296,description:"Returns the framebuffer color encoding.",extensionName:"EXT_sRGB"},p.FRAGMENT_SHADER_DERIVATIVE_HINT_OES={name:"FRAGMENT_SHADER_DERIVATIVE_HINT_OES",value:35723,description:"Indicates the accuracy of the derivative calculation for the GLSL built-in functions: dFdx, dFdy, and fwidth.",extensionName:"OES_standard_derivatives"},p.COLOR_ATTACHMENT0_WEBGL={name:"COLOR_ATTACHMENT0_WEBGL",value:36064,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT1_WEBGL={name:"COLOR_ATTACHMENT1_WEBGL",value:36065,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT2_WEBGL={name:"COLOR_ATTACHMENT2_WEBGL",value:36066,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT3_WEBGL={name:"COLOR_ATTACHMENT3_WEBGL",value:36067,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT4_WEBGL={name:"COLOR_ATTACHMENT4_WEBGL",value:36068,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT5_WEBGL={name:"COLOR_ATTACHMENT5_WEBGL",value:36069,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT6_WEBGL={name:"COLOR_ATTACHMENT6_WEBGL",value:36070,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT7_WEBGL={name:"COLOR_ATTACHMENT7_WEBGL",value:36071,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT8_WEBGL={name:"COLOR_ATTACHMENT8_WEBGL",value:36072,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT9_WEBGL={name:"COLOR_ATTACHMENT9_WEBGL",value:36073,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT10_WEBGL={name:"COLOR_ATTACHMENT10_WEBGL",value:36074,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT11_WEBGL={name:"COLOR_ATTACHMENT11_WEBGL",value:36075,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT12_WEBGL={name:"COLOR_ATTACHMENT12_WEBGL",value:36076,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT13_WEBGL={name:"COLOR_ATTACHMENT13_WEBGL",value:36077,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT14_WEBGL={name:"COLOR_ATTACHMENT14_WEBGL",value:36078,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT15_WEBGL={name:"COLOR_ATTACHMENT15_WEBGL",value:36079,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER0_WEBGL={name:"DRAW_BUFFER0_WEBGL",value:34853,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER1_WEBGL={name:"DRAW_BUFFER1_WEBGL",value:34854,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER2_WEBGL={name:"DRAW_BUFFER2_WEBGL",value:34855,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER3_WEBGL={name:"DRAW_BUFFER3_WEBGL",value:34856,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER4_WEBGL={name:"DRAW_BUFFER4_WEBGL",value:34857,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER5_WEBGL={name:"DRAW_BUFFER5_WEBGL",value:34858,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER6_WEBGL={name:"DRAW_BUFFER6_WEBGL",value:34859,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER7_WEBGL={name:"DRAW_BUFFER7_WEBGL",value:34860,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER8_WEBGL={name:"DRAW_BUFFER8_WEBGL",value:34861,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER9_WEBGL={name:"DRAW_BUFFER9_WEBGL",value:34862,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER10_WEBGL={name:"DRAW_BUFFER10_WEBGL",value:34863,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER11_WEBGL={name:"DRAW_BUFFER11_WEBGL",value:34864,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER12_WEBGL={name:"DRAW_BUFFER12_WEBGL",value:34865,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER13_WEBGL={name:"DRAW_BUFFER13_WEBGL",value:34866,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER14_WEBGL={name:"DRAW_BUFFER14_WEBGL",value:34867,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER15_WEBGL={name:"DRAW_BUFFER15_WEBGL",value:34868,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.MAX_COLOR_ATTACHMENTS_WEBGL={name:"MAX_COLOR_ATTACHMENTS_WEBGL",value:36063,description:"Maximum number of framebuffer color attachment points",extensionName:"WEBGL_draw_buffers"},p.MAX_DRAW_BUFFERS_WEBGL={name:"MAX_DRAW_BUFFERS_WEBGL",value:34852,description:"Maximum number of draw buffers",extensionName:"WEBGL_draw_buffers"},p.VERTEX_ARRAY_BINDING_OES={name:"VERTEX_ARRAY_BINDING_OES",value:34229,description:"The bound vertex array object (VAO).",extensionName:"VERTEX_ARRAY_BINDING_OES"},p.QUERY_COUNTER_BITS_EXT={name:"QUERY_COUNTER_BITS_EXT",value:34916,description:"The number of bits used to hold the query result for the given target.",extensionName:"EXT_disjoint_timer_query"},p.CURRENT_QUERY_EXT={name:"CURRENT_QUERY_EXT",value:34917,description:"The currently active query.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_EXT={name:"QUERY_RESULT_EXT",value:34918,description:"The query result.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_AVAILABLE_EXT={name:"QUERY_RESULT_AVAILABLE_EXT",value:34919,description:"A Boolean indicating whether or not a query result is available.",extensionName:"EXT_disjoint_timer_query"},p.TIME_ELAPSED_EXT={name:"TIME_ELAPSED_EXT",value:35007,description:"Elapsed time (in nanoseconds).",extensionName:"EXT_disjoint_timer_query"},p.TIMESTAMP_EXT={name:"TIMESTAMP_EXT",value:36392,description:"The current time.",extensionName:"EXT_disjoint_timer_query"},p.GPU_DISJOINT_EXT={name:"GPU_DISJOINT_EXT",value:36795,description:"A Boolean indicating whether or not the GPU performed any disjoint operation.",extensionName:"EXT_disjoint_timer_query"},p.zeroMeaningByCommand={getError:"NO_ERROR",blendFunc:"ZERO",blendFuncSeparate:"ZERO",readBuffer:"NONE",getFramebufferAttachmentParameter:"NONE",texParameterf:"NONE",texParameteri:"NONE",drawArrays:"POINTS",drawElements:"POINTS",drawArraysInstanced:"POINTS",drawArraysInstancedAngle:"POINTS",drawBuffers:"POINTS",drawElementsInstanced:"POINTS",drawRangeElements:"POINTS"},p.oneMeaningByCommand={blendFunc:"ONE",blendFuncSeparate:"ONE",drawArrays:"LINES",drawElements:"LINES",drawArraysInstanced:"LINES",drawArraysInstancedAngle:"LINES",drawBuffers:"LINES",drawElementsInstanced:"LINES",drawRangeElements:"LINES"};const m={},g={};!function(){for(const e in p)if(p.hasOwnProperty(e)){const t=p[e];m[t.name]=t,g[t.value]=t}}();class E extends c{get analyserName(){return E.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={total:0,totalTriangles:0,totalTriangleStrip:0,totalTriangleFan:0,totalLines:0,totalLineStrip:0,totalLineLoop:0,totalPoints:0};for(const t of e.commands)"drawArrays"===t.name&&t.commandArguments.length>=3||"drawArraysInstanced"===t.name&&t.commandArguments.length>=3||"drawArraysInstancedANGLE"===t.name&&t.commandArguments.length>=3?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[2]):"drawElements"===t.name&&t.commandArguments.length>=2||"drawElementsInstanced"===t.name&&t.commandArguments.length>=2||"drawElementsInstancedANGLE"===t.name&&t.commandArguments.length>=2?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[1]):"drawRangeElements"===t.name&&t.commandArguments.length>=4&&this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[3]);t.total=n.total,t.triangles=n.totalTriangles,t.triangleStrip=n.totalTriangleStrip,t.triangleFan=n.totalTriangleFan,t.lines=n.totalLines,t.lineStrip=n.totalLineStrip,t.lineLoop=n.totalLineLoop,t.points=n.totalPoints}appendToPrimitives(e,t,n){t===p.POINTS.value?e.totalPoints+=n:t===p.LINES.value?e.totalLines+=n:t===p.LINE_STRIP.value?e.totalLineStrip+=n:t===p.LINE_LOOP.value?e.totalLineLoop+=n:t===p.TRIANGLES.value?e.totalTriangles+=n:t===p.TRIANGLE_STRIP.value?e.totalTriangleStrip+=n:t===p.TRIANGLE_FAN.value&&(e.totalTriangleFan+=n),e.total+=n}}E.analyserName="Primitives";class v{constructor(e){this.contextInformation=e,this.analysers=[],this.initAnalysers()}appendAnalyses(e){for(const t in this.analysers)this.analysers.hasOwnProperty(t)&&this.analysers[t].appendAnalysis(e)}initAnalysers(){this.analysers.push(new h(this.contextInformation),new f(this.contextInformation),new E(this.contextInformation))}}class C{static getStackTrace(e=0,t=0){const n=[];try{throw new Error("Errorator.")}catch(e){if(e.stack){const t=e.stack.split("\n");for(let e=0,r=t.length;e0;t++)n.shift();for(let e=0;e0;e++)n.pop()}return n}}class D{static getWebGlObjectTag(e){return e[D.SPECTOROBJECTTAGKEY]}static attachWebGlObjectTag(e,t){t.displayText=D.stringifyWebGlObjectTag(t),e[D.SPECTOROBJECTTAGKEY]=t}static stringifyWebGlObjectTag(e){return e?`${e.typeName} - ID: ${e.id}`:"No tag available."}}D.SPECTOROBJECTTAGKEY="__SPECTOR_Object_TAG";class S{get type(){return("undefined"!=typeof globalThis?globalThis:self)[this.typeName]||null}constructor(){this.id=0}tagWebGlObject(e){if(!this.type)return;let t;if(!e)return t;if(t=D.getWebGlObjectTag(e),t)return t;if(e instanceof this.type){const n=this.getNextId();return t={typeName:this.typeName,id:n},D.attachWebGlObjectTag(e,t),t}return t}getNextId(){return this.id++}}class A{constructor(e){this.options=e}createCapture(e,t,n){const r=C.getStackTrace(4,1),i=0===e.name.indexOf("uniform")?this.stringifyUniform(e.arguments):this.stringify(e.arguments,e.result),s={id:t,startTime:e.startTime,commandEndTime:e.endTime,endTime:0,name:e.name,commandArguments:e.arguments,result:e.result,stackTrace:r,status:0,marker:n,text:i};this.transformCapture(s);for(let e=0;e50&&(s.commandArguments[e]="Array Length: "+t.length)}if(s.commandArguments){const e=[];for(let t=0;t0&&(n+=": "+this.stringifyArgs(e).join(", ")),null!=t&&(n+=" -> "+this.stringifyResult(t)),n}stringifyUniform(e){let t=this.spiedCommandName;if(e&&e.length>0){const n=[];n.push(this.stringifyValue(e[0]));for(let t=1;t0&&"number"==typeof s)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");else{const e=this.stringifyValue(s);r.push(e)}}return r}}_.commandName="bufferSubData";class y{static storeOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]||(e[n]=e[t])}static resetOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]&&(e[t]=e[n],delete e[n])}static storePrototypeOriginFunction(e,t){if(!e)return;if(!e.prototype[t])return;const n=this.getOriginFunctionName(t);e.prototype[n]||(e.prototype[n]=e.prototype[t])}static executePrototypeOriginFunction(e,t,n,r){if(!e)return;const i=this.getOriginFunctionName(n);return t.prototype[i]?(e[i]||(e[i]=t.prototype[i]),this.executeFunction(e,i,r)):void 0}static executeOriginFunction(e,t,n){if(!e)return;const r=this.getOriginFunctionName(t);return e[r]?this.executeFunction(e,r,n):void 0}static executeFunction(e,t,n){const r=n;if(void 0===r||0===r.length)return e[t]();switch(r.length){case 1:return e[t](r[0]);case 2:return e[t](r[0],r[1]);case 3:return e[t](r[0],r[1],r[2]);case 4:return e[t](r[0],r[1],r[2],r[3]);case 5:return e[t](r[0],r[1],r[2],r[3],r[4]);case 6:return e[t](r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6]);case 8:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]);case 9:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8]);case 10:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9]);case 11:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10]);case 12:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11]);case 13:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12]);case 14:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13]);case 15:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14]);case 16:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);case 17:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16]);case 18:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17]);case 19:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18]);case 20:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19]);default:return e[t].apply(e,r)}}static getOriginFunctionName(e){return this.originFunctionPrefix+e}}y.originFunctionPrefix="__SPECTOR_Origin_";class b extends A{get spiedCommandName(){return b.commandName}stringifyArgs(e){const t=[];if(e.length>0){const n=e[0],r=this.stringifyValue(n);t.push(r)}if(e.length>1){const n=""+e[1];t.push(n)}return e.length>2&&t.push(e[2]),t}}b.commandName="bindAttribLocation";class T extends A{get spiedCommandName(){return T.commandName}stringifyArgs(e){const t=[],n=this.options.context.getParameter(p.READ_FRAMEBUFFER_BINDING.value),r=this.options.tagWebGlObject(n);t.push("READ FROM: "+this.stringifyValue(r));const i=this.options.context.getParameter(p.DRAW_FRAMEBUFFER_BINDING.value),s=this.options.tagWebGlObject(i);t.push("WRITE TO: "+this.stringifyValue(s));for(let n=0;n<8;n++)t.push(e[n]);return(e[8]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[8]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[8]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t.push(p.stringifyWebGlConstant(e[9],"blitFrameBuffer")),t}}T.commandName="blitFrameBuffer";class R extends A{get spiedCommandName(){return R.commandName}stringifyArgs(e){const t=[];return(e[0]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[0]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[0]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t}}R.commandName="clear";class x{static getProgramData(e,t){const n={LINK_STATUS:e.getProgramParameter(t,p.LINK_STATUS.value),VALIDATE_STATUS:e.getProgramParameter(t,p.VALIDATE_STATUS.value),infoLog:e.getProgramInfoLog(t)||""},r=e.getAttachedShaders(t)||[],i=new Array(2);let s=0;for(const t of r){const n=this.getShaderData(e,t);s+=n.source.length,n.shaderType===p.FRAGMENT_SHADER.name?i[1]=n:i[0]=n}return{programStatus:n,shaders:i,length:s}}static getShaderData(e,t){const n=e.getShaderSource(t)||"",r=e.getExtension("WEBGL_debug_shaders"),i=r?r.getTranslatedShaderSource(t):null,s=e.getShaderParameter(t,p.SHADER_TYPE.value)===p.FRAGMENT_SHADER.value;let o=t&&t.__SPECTOR_Metadata&&t.__SPECTOR_Metadata.name?t.__SPECTOR_Metadata.name:this.readNameFromShaderSource(n);return o||(o=s?"Fragment":"Vertex"),{COMPILE_STATUS:e.getShaderParameter(t,p.COMPILE_STATUS.value),shaderType:s?p.FRAGMENT_SHADER.name:p.VERTEX_SHADER.name,name:o,source:n,translatedSource:i,infoLog:e.getShaderInfoLog(t)||""}}static readNameFromShaderSource(e){try{let t,n="";const r=/#define[\s]+SHADER_NAME[\s]+([\S]+)(\n|$)/gi;if(t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),""===n){const r=/#define[\s]+SHADER_NAME_B64[\s]+([\S]+)(\n|$)/gi;t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),n&&(n=decodeURIComponent(atob(n)))}return n}catch(e){return null}}}class w extends A{constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.shader=x.getShaderData(this.options.context,t)}finally{n&&n(!0)}}getShaderDisplayText(e){return this.stringifyValue(e.commandArguments[0])}}class F extends w{get spiedCommandName(){return F.commandName}transformCapture(e){if(super.transformCapture(e),e.shader){const t=e.shader.COMPILE_STATUS?"compiled":"failed";e.text=`${this.spiedCommandName}: ${this.getShaderDisplayText(e)} -> ${t}`}}}F.commandName="compileShader";const N=["lineWidth"];class L extends A{get spiedCommandName(){return this.internalSpiedCommandName}constructor(e,t){super(e),this.internalSpiedCommandName=t,this.isDeprecated=N.indexOf(this.spiedCommandName)>-1}transformCapture(e){this.isDeprecated&&(e.status=50)}}class O extends A{get spiedCommandName(){return O.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}O.commandName="disableVertexAttribArray";class I extends A{get spiedCommandName(){return I.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(e[1]+" indices"),t.push(e[2]),t}}I.commandName="drawArrays";class k extends A{get spiedCommandName(){return k.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}k.commandName="drawArraysInstanced";class M extends A{get spiedCommandName(){return M.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstancedANGLE")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}M.commandName="drawArraysInstancedANGLE";class P extends A{get spiedCommandName(){return P.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElements")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElements")),t.push(e[3]),t}}P.commandName="drawElements";class B extends A{get spiedCommandName(){return B.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstancedANGLE")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstancedANGLE")),t.push(e[3]),t.push(e[4]),t}}B.commandName="drawElementsInstancedANGLE";class U extends A{get spiedCommandName(){return U.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t}}U.commandName="drawElementsInstanced";class $ extends A{get spiedCommandName(){return $.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawRangeElements")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(p.stringifyWebGlConstant(e[4],"drawRangeElements")),t.push(e[5]),t}}$.commandName="drawRangeElements";class G extends A{get spiedCommandName(){return G.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}G.commandName="getActiveAttrib";class V extends A{get spiedCommandName(){return V.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}V.commandName="getActiveUniform";class W extends A{get spiedCommandName(){return W.commandName}stringifyResult(e){var t;if(null!=e)return null!==(t=null==e?void 0:e.toFixed(0))&&void 0!==t?t:"0"}}W.commandName="getAttribLocation";class H extends A{get spiedCommandName(){return H.commandName}stringifyResult(e){return e?"true":"false"}}H.commandName="getExtension";class j extends A{get spiedCommandName(){return j.commandName}stringifyResult(e){if(!e)return"null";const t=D.getWebGlObjectTag(e);return t?t.displayText:e}}j.commandName="getParameter";class z extends A{get spiedCommandName(){return z.commandName}stringifyResult(e){if(e)return`min: ${e.rangeMin}, max: ${e.rangeMax}, precision: ${e.precision}`}}z.commandName="getShaderPrecisionFormat";class X extends w{get spiedCommandName(){return X.commandName}stringifyResult(e){if("string"!=typeof e||0===e.trim().length)return"No messages";const t=e.split(/\r?\n/).filter(e=>e.trim().length>0).length;return t+(1===t?" message":" messages")}}X.commandName="getShaderInfoLog";class K extends A{get spiedCommandName(){return K.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}K.commandName="getTransformFeedbackVarying";class Y extends A{get spiedCommandName(){return Y.commandName}constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.program=x.getProgramData(this.options.context,t)}finally{n&&n(!0)}const r=e.program.programStatus.LINK_STATUS?"linked":"failed";e.text=`${this.spiedCommandName}: ${this.stringifyValue(t)} -> ${r}`}}Y.commandName="linkProgram";class q extends A{get spiedCommandName(){return q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"multiDrawArraysInstancedBaseInstanceWEBGL")),t.push(`drawCount=${e[9]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t}}q.commandName="multiDrawArraysInstancedBaseInstanceWEBGL";class Q extends A{get spiedCommandName(){return Q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[7]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t}}Q.commandName="multiDrawArraysInstancedWEBGL";class Z extends A{get spiedCommandName(){return Z.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[5]}`),t.push(e[2]),t.push(e[4]),t}}Z.commandName="multiDrawArraysWEBGL";class J extends A{get spiedCommandName(){return J.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[11]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t.push(e[10]),t}}J.commandName="multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL";class ee extends A{get spiedCommandName(){return ee.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[8]}`),t.push(e[2]),t.push(e[5]),t.push(e[7]),t}}ee.commandName="multiDrawElementsInstancedWEBGL";class te extends A{get spiedCommandName(){return te.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[6]}`),t.push(e[2]),t.push(e[5]),t}}te.commandName="multiDrawElementsWEBGL";class ne extends A{get spiedCommandName(){return ne.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(`baseInstance = ${e[4]}`),t}}ne.commandName="drawArraysInstancedBaseInstanceWEBGL";class re extends A{get spiedCommandName(){return re.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t.push(`baseVertex = ${e[5]}`),t.push(`baseInstance = ${e[6]}`),t}}re.commandName="drawElementsInstancedBaseVertexBaseInstanceWEBGL";class ie extends A{get spiedCommandName(){return ie.commandName}stringifyArgs(e){var t,n;const r=[];for(let i=0;i<4;i++)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");return r}}function se(e){return null==e?"":`${e.toFixed(0)} (0b${(e>>>0).toString(2)})`}ie.commandName="scissor";class oe extends A{get spiedCommandName(){return oe.commandName}stringifyArgs(e){const t=[];return t.push(se(e[0])),t}}oe.commandName="stencilMask";class ae extends A{get spiedCommandName(){return ae.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilMaskSeparate")),t.push(se(e[1])),t}}ae.commandName="stencilMaskSeparate";class le extends A{get spiedCommandName(){return le.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFunc")),t.push(se(e[1])),t.push(se(e[2])),t}}le.commandName="stencilFunc";class ue extends A{get spiedCommandName(){return ue.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFuncSeparate")),t.push(p.stringifyWebGlConstant(e[1],"stencilFuncSeparate")),t.push(se(e[2])),t.push(se(e[3])),t}}ue.commandName="stencilFuncSeparate";class ce extends A{get spiedCommandName(){return ce.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t.push(e[1]),t.push(p.stringifyWebGlConstant(e[2],"vertexAttribPointer")),t.push(e[3]),t.push(e[4]),t.push(e[5]),t}}ce.commandName="vertexAttribPointer";class he extends A{get spiedCommandName(){return he.commandName}stringifyArgs(e){const t=[];for(let n=0;n<4;n++)t.push(e[n].toFixed(0));return t}}he.commandName="viewport";class de extends A{get spiedCommandName(){return de.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}de.commandName="enableVertexAttribArray";class fe extends w{get spiedCommandName(){return fe.commandName}stringifyArgs(e){const t="string"==typeof e[1]?e[1]:"";return[this.stringifyValue(e[0]),t.length+" chars"]}transformCapture(e){super.transformCapture(e);const t=e.commandArguments[1];e.shader&&"string"==typeof t&&(e.shader.source=t,e.shader.COMPILE_STATUS=null,e.shader.translatedSource="",e.shader.infoLog="")}}fe.commandName="shaderSource";class pe{constructor(e){this.spiedCommandName=e.spiedCommandName,this.spiedCommandRunningContext=e.spiedCommandRunningContext,this.spiedCommand=this.spiedCommandRunningContext[this.spiedCommandName],y.storeOriginFunction(this.spiedCommandRunningContext,this.spiedCommandName),this.callback=e.callback,this.commandOptions={context:e.context,contextVersion:e.contextVersion,extensions:e.extensions,toggleCapture:e.toggleCapture},this.initCustomCommands(),this.initCommand()}spy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.overloadedCommand}unSpy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.spiedCommand}createCapture(e,t,n){return this.command.createCapture(e,t,n)}initCommand(){pe.customCommandsConstructors[this.spiedCommandName]?this.command=pe.customCommandsConstructors[this.spiedCommandName](this.commandOptions):this.command=new L(this.commandOptions,this.spiedCommandName),this.overloadedCommand=this.getSpy()}getSpy(){const e=this;return function(){const t=u.now,n=y.executeOriginFunction(e.spiedCommandRunningContext,e.spiedCommandName,arguments),r=u.now;try{const i={name:e.spiedCommandName,arguments,result:n,startTime:t,endTime:r};e.callback(e,i)}catch(e){}return n}}initCustomCommands(){pe.customCommandsConstructors||(pe.customCommandsConstructors={[b.commandName]:e=>new b(e),[T.commandName]:e=>new T(e),[_.commandName]:e=>new _(e),[R.commandName]:e=>new R(e),[F.commandName]:e=>new F(e),[O.commandName]:e=>new O(e),[I.commandName]:e=>new I(e),[k.commandName]:e=>new k(e),[M.commandName]:e=>new M(e),[P.commandName]:e=>new P(e),[U.commandName]:e=>new U(e),[B.commandName]:e=>new B(e),[$.commandName]:e=>new $(e),[G.commandName]:e=>new G(e),[V.commandName]:e=>new V(e),[W.commandName]:e=>new W(e),[H.commandName]:e=>new H(e),[j.commandName]:e=>new j(e),[X.commandName]:e=>new X(e),[z.commandName]:e=>new z(e),[K.commandName]:e=>new K(e),[Y.commandName]:e=>new Y(e),[q.commandName]:e=>new q(e),[Q.commandName]:e=>new Q(e),[Z.commandName]:e=>new Z(e),[J.commandName]:e=>new J(e),[ee.commandName]:e=>new ee(e),[te.commandName]:e=>new te(e),[ne.commandName]:e=>new ne(e),[re.commandName]:e=>new re(e),[ie.commandName]:e=>new ie(e),[fe.commandName]:e=>new fe(e),[oe.commandName]:e=>new oe(e),[ae.commandName]:e=>new ae(e),[le.commandName]:e=>new le(e),[ue.commandName]:e=>new ue(e),[ce.commandName]:e=>new ce(e),[he.commandName]:e=>new he(e),[de.commandName]:e=>new de(e)})}}class me{constructor(e){this.options=e,this.context=e.context,this.contextVersion=e.contextVersion,this.extensions=e.extensions,this.toggleCapture=e.toggleCapture,this.consumeCommands=this.getConsumeCommands(),this.changeCommandsByState=this.getChangeCommandsByState(),this.commandNameToStates=this.getCommandNameToStates()}get requireStartAndStopStates(){return!0}startCapture(e,t,n){return this.quickCapture=t,this.fullCapture=n,this.capturedCommandsByState={},e&&this.requireStartAndStopStates&&(this.currentState={},this.readFromContextNoSideEffects()),this.copyCurrentStateToPrevious(),this.currentState={},this.previousState}stopCapture(){return this.requireStartAndStopStates&&this.readFromContextNoSideEffects(),this.analyse(void 0),this.currentState}registerCallbacks(e){for(const t in this.changeCommandsByState)if(this.changeCommandsByState.hasOwnProperty(t))for(const n of this.changeCommandsByState[t])e[n]=e[n]||[],e[n].push(this.onChangeCommand.bind(this));for(const t of this.consumeCommands)e[t]=e[t]||[],e[t].push(this.onConsumeCommand.bind(this))}getStateData(){return this.currentState}getConsumeCommands(){return[]}getChangeCommandsByState(){return{}}copyCurrentStateToPrevious(){this.currentState&&(this.previousState=this.currentState)}onChangeCommand(e){const t=this.commandNameToStates[e.name];for(const n of t){if(!this.isValidChangeCommand(e,n))return;this.capturedCommandsByState[n]=this.capturedCommandsByState[n]||[],this.capturedCommandsByState[n].push(e)}}isValidChangeCommand(e,t){return!0}onConsumeCommand(e){this.isValidConsumeCommand(e)&&(this.readFromContextNoSideEffects(),this.analyse(e),this.storeCommandIds(),e[this.stateName]=this.currentState,this.startCapture(!1,this.quickCapture,this.fullCapture))}isValidConsumeCommand(e){return this.lastCommandName=null==e?void 0:e.name,!0}analyse(e){for(const t in this.capturedCommandsByState)if(this.capturedCommandsByState.hasOwnProperty(t)){const n=this.capturedCommandsByState[t],r=n.length-1;if(r>=0)if(e){for(let t=0;t1&&this.parameters.push(this.getWebgl2Parameters());const e={};for(let t=1;t<=this.contextVersion&&!(t>this.parameters.length);t++)if(this.parameters[t-1])for(const n of this.parameters[t-1])if(n.changeCommands)for(const t of n.changeCommands)e[n.constant.name]=e[n.constant.name]||[],e[n.constant.name].push(t);return e}readFromContext(){for(let e=1;e<=this.contextVersion&&!(e>this.parameters.length);e++)for(const t of this.parameters[e-1]){const e=this.readParameterFromContext(t);if(null==e){const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n;continue}const n=D.getWebGlObjectTag(e);if(n)this.currentState[t.constant.name]=n;else{const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n}}}readParameterFromContext(e){return e.constant.extensionName&&!this.extensions[e.constant.extensionName]?`Extension ${e.constant.extensionName} is unavailable.`:this.context.getParameter(e.constant.value)}stringifyParameterValue(e,t){if(null===e)return"null";if(void 0===e)return"undefined";if(30===t.returnType)return se(e);if("number"==typeof e&&p.isWebGlConstant(e)){if(20===t.returnType){const n=t.changeCommands&&t.changeCommands[0]||"";return p.stringifyWebGlConstant(e,n)}return e}if(e.length&&"string"!=typeof e){const t=[];for(let n=0;n1?r=this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value):this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.value)===p.RENDERBUFFER.value&&(r=e.getRenderbufferParameter(e.RENDERBUFFER,e.RENDERBUFFER_STENCIL_SIZE))):r=this.readParameterFromContext({constant:p.STENCIL_BITS}),this.currentState[p.STENCIL_BITS.name]=""+r}isValidChangeCommand(e,t){return"enable"===e.name||"disable"===e.name?e.commandArguments[0]===p.STENCIL_TEST.value:"stencilOp"===e.name||"stencilOpSeparate"===e.name?xe.stencilOpStates.indexOf(e.commandArguments[0])>0:"stencilFunc"===e.name||"stencilFuncSeparate"===e.name?xe.stencilFuncStates.indexOf(e.commandArguments[0])>0:"stencilMask"!==e.name&&"stencilMaskSeparate"!==e.name||xe.stencilMaskStates.indexOf(e.commandArguments[0])>0}getConsumeCommands(){return d}isStateEnable(e,t){return this.context.isEnabled(p.STENCIL_TEST.value)}}xe.stateName="StencilState",xe.stencilOpStates=[p.STENCIL_BACK_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_PASS.value,p.STENCIL_FAIL.value,p.STENCIL_PASS_DEPTH_FAIL.value,p.STENCIL_PASS_DEPTH_PASS.value],xe.stencilFuncStates=[p.STENCIL_BACK_FUNC.value,p.STENCIL_BACK_REF.value,p.STENCIL_BACK_VALUE_MASK.value,p.STENCIL_FUNC.value,p.STENCIL_REF.value,p.STENCIL_VALUE_MASK.value],xe.stencilMaskStates=[p.STENCIL_BACK_WRITEMASK.value,p.STENCIL_WRITEMASK.value];class we{static isSupportedCombination(e,t,n){return e=e||p.UNSIGNED_BYTE.value,((t=t||p.RGBA.value)===p.RGB.value||t===p.RGBA.value)&&(n===p.RGB.value||n===p.RGBA.value||n===p.RGBA8.value||n===p.RGBA16F.value||n===p.RGBA32F.value||n===p.RGB16F.value||n===p.RGB32F.value||n===p.R11F_G11F_B10F.value||n===p.SRGB8.value||n===p.SRGB8_ALPHA8.value)&&this.isSupportedComponentType(e)}static readPixels(e,t,n,r,i,s){e.getError(),s===p.UNSIGNED_NORMALIZED.value&&(s=p.UNSIGNED_BYTE.value);const o=r*i*4;let a;if(s===p.UNSIGNED_BYTE.value?a=new Uint8Array(o):(s=p.FLOAT.value,a=new Float32Array(o)),e.readPixels(t,n,r,i,e.RGBA,s,a),e.getError())return;if(s===p.UNSIGNED_BYTE.value)return a;const l=new Uint8Array(r*i*4);for(let e=0;e1){const e=this.context.getParameter(p.MAX_DRAW_BUFFERS.value);for(let n=0;n1?this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value):p.UNSIGNED_BYTE.value;l===p.RENDERBUFFER.value?this.readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,c,u):l===p.TEXTURE.value&&this.readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,c,u)}readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,l,u){let c=0,h=0;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,c=e.samples,h=e.internalFormat,!c&&!we.isSupportedCombination(l,p.RGBA.value,h))return}else s+=r,o+=i;if(r=i=0,c){const a=e,u=e.createRenderbuffer(),c=e.getParameter(e.RENDERBUFFER_BINDING);e.bindRenderbuffer(e.RENDERBUFFER,u),e.renderbufferStorage(e.RENDERBUFFER,h,s,o),e.bindRenderbuffer(e.RENDERBUFFER,c),e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u);const d=a.getParameter(a.READ_FRAMEBUFFER_BINDING),f=a.getParameter(a.DRAW_FRAMEBUFFER_BINDING);a.bindFramebuffer(a.READ_FRAMEBUFFER,t),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,this.captureFrameBuffer),a.blitFramebuffer(0,0,s,o,0,0,s,o,e.COLOR_BUFFER_BIT,e.NEAREST),a.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),a.bindFramebuffer(a.READ_FRAMEBUFFER,d),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,f),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t),e.deleteRenderbuffer(u)}else e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,l,u){let c=0;this.contextVersion>1&&(c=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value));const h=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL.value),d=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE.value);d>0?g[d].name:p.TEXTURE_2D.name;let f=!1,m=l;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,void 0!==e.type&&(m=e.type),f=e.target===p.TEXTURE_2D_ARRAY.name,!we.isSupportedCombination(e.type,e.format,e.internalFormat))return}else s+=r,o+=i;r=i=0,e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),c>0||f?e.framebufferTextureLayer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,u,h,c):e.framebufferTexture2D(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,d||p.TEXTURE_2D.value,u,h),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,d,c,m),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}getCapture(e,t,n,r,i,s,o,l,u){i=Math.floor(i),s=Math.floor(s);const c={attachmentName:t,src:null,textureCubeMapFace:o?g[o].name:null,textureLayer:l,raw:null};if(!this.quickCapture)try{const t=we.readPixels(e,n,r,i,s,u);if(t){c.raw=Ne.encode(t,i,s),this.workingCanvas.width=i,this.workingCanvas.height=s;const e=this.workingContext2D.createImageData(i,s);if(e.data.set(t),this.workingContext2D.putImageData(e,0,0),this.fullCapture)this.captureCanvas.width=this.workingCanvas.width,this.captureCanvas.height=this.workingCanvas.height;else{const e=i/s;e<1?(this.captureCanvas.width=Le.captureBaseSize*e,this.captureCanvas.height=Le.captureBaseSize):e>1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this.captureContext2D.drawImage(this.workingCanvas,0,0,i,s,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",c.src=Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D)}}catch(e){a.warn("Spector can not capture the visual state: "+e)}this.currentState.Attachments.push(c)}analyse(e){}}Le.stateName="VisualState",Le.captureBaseSize=256;class Oe{constructor(e){this.context=e.context,this.captureFrameBuffer=e.context.createFramebuffer(),this.workingCanvas=Fe.createCanvas(1,1),this.workingContext2D=Fe.get2DContext(this.workingCanvas),this.captureCanvas=Fe.createCanvas(1,1),this.captureContext2D=Fe.get2DContext(this.captureCanvas),Fe.setImageSmoothing(this.captureContext2D,!0)}appendTextureState(e,t,n=null,r){if(!t)return;const i=t.__SPECTOR_Object_CustomData;if(i&&(this.fullCapture=r,i.type&&(e.textureType=this.getWebGlConstant(i.type)),i.format&&(e.format=this.getWebGlConstant(i.format)),i.internalFormat&&(e.internalFormat=this.getWebGlConstant(i.internalFormat)),e.width=i.width,e.height=i.height,i.depth&&(e.depth=i.depth),n)){const r="NEAREST"===e.samplerMagFilter||"NEAREST"===e.magFilter,s=this.getTextureVisualState(n,t,i,r);if(s){e.visual=s.visual;for(const t in s.visualPixels)if(s.visualPixels.hasOwnProperty(t)){e.visualPixels=s.visualPixels;break}}}}getTextureVisualState(e,t,n,r){try{const i=this.context,s={},o={};if(!we.isSupportedCombination(n.type,n.format,n.internalFormat))return{visual:s,visualPixels:o};const a=this.context.getParameter(p.FRAMEBUFFER_BINDING.value);i.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer);try{const a=0,l=n.width,u=n.height;if(e===p.TEXTURE_3D&&n.depth){const e=i;for(let c=0;c2&&c2&&c1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}return this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this._setSmoothing(!o),this.captureContext2D.drawImage(this.workingCanvas,0,0,r,i,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",{src:Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D),raw:l}}catch(e){}return{src:void 0,raw:null}}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}_setSmoothing(e){Fe.setImageSmoothing(this.captureContext2D,e)}}Oe.captureBaseSize=64,Oe.cubeMapFaces=[p.TEXTURE_CUBE_MAP_POSITIVE_X,p.TEXTURE_CUBE_MAP_POSITIVE_Y,p.TEXTURE_CUBE_MAP_POSITIVE_Z,p.TEXTURE_CUBE_MAP_NEGATIVE_X,p.TEXTURE_CUBE_MAP_NEGATIVE_Y,p.TEXTURE_CUBE_MAP_NEGATIVE_Z];class Ie{constructor(e){this.context=e.context}getUboValue(e,t,n,r){const i=Ie.uboTypes[r];if(!i)return;const s=new i.arrayBufferView(n*i.lengthMultiplier),o=this.context,a=o.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,e);if(a){const n=o.getIndexedParameter(p.UNIFORM_BUFFER_START.value,e),r=o.getParameter(p.UNIFORM_BUFFER_BINDING.value);try{o.bindBuffer(p.UNIFORM_BUFFER.value,a),o.getBufferSubData(p.UNIFORM_BUFFER.value,n+t,s)}catch(e){return}r&&o.bindBuffer(p.UNIFORM_BUFFER.value,r)}return Array.prototype.slice.call(s)}}Ie.uboTypes={[p.BOOL.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.BOOL_VEC2.value]:{arrayBufferView:Uint8Array,lengthMultiplier:2},[p.BOOL_VEC3.value]:{arrayBufferView:Uint8Array,lengthMultiplier:3},[p.BOOL_VEC4.value]:{arrayBufferView:Uint8Array,lengthMultiplier:4},[p.INT.value]:{arrayBufferView:Int32Array,lengthMultiplier:1},[p.INT_VEC2.value]:{arrayBufferView:Int32Array,lengthMultiplier:2},[p.INT_VEC3.value]:{arrayBufferView:Int32Array,lengthMultiplier:3},[p.INT_VEC4.value]:{arrayBufferView:Int32Array,lengthMultiplier:4},[p.UNSIGNED_INT.value]:{arrayBufferView:Uint32Array,lengthMultiplier:1},[p.UNSIGNED_INT_VEC2.value]:{arrayBufferView:Uint32Array,lengthMultiplier:2},[p.UNSIGNED_INT_VEC3.value]:{arrayBufferView:Uint32Array,lengthMultiplier:3},[p.UNSIGNED_INT_VEC4.value]:{arrayBufferView:Uint32Array,lengthMultiplier:4},[p.FLOAT.value]:{arrayBufferView:Float32Array,lengthMultiplier:1},[p.FLOAT_VEC2.value]:{arrayBufferView:Float32Array,lengthMultiplier:2},[p.FLOAT_VEC3.value]:{arrayBufferView:Float32Array,lengthMultiplier:3},[p.FLOAT_VEC4.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT2x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT3.value]:{arrayBufferView:Float32Array,lengthMultiplier:9},[p.FLOAT_MAT3x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT3x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.FLOAT_MAT4.value]:{arrayBufferView:Float32Array,lengthMultiplier:16},[p.FLOAT_MAT4x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT4x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.SAMPLER_2D.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.SAMPLER_CUBE.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1}};class ke extends S{get typeName(){return"WebGLBuffer"}}class Me extends S{get typeName(){return"WebGLFramebuffer"}}class Pe extends S{get typeName(){return"WebGLProgram"}static saveInGlobalStore(e){const t=D.getWebGlObjectTag(e);t&&(this.store[t.id]=e)}static getFromGlobalStore(e){return this.store[e]}static updateInGlobalStore(e,t){if(!t)return;const n=this.getFromGlobalStore(e);if(!n)return;const r=D.getWebGlObjectTag(n);r&&(D.attachWebGlObjectTag(t,r),this.store[r.id]=t)}}Pe.store={};class Be extends S{get typeName(){return"WebGLQuery"}}class Ue extends S{get typeName(){return"WebGLRenderbuffer"}}class $e extends S{get typeName(){return"WebGLSampler"}}class Ge extends S{get typeName(){return"WebGLShader"}}class Ve extends S{get typeName(){return"WebGLSync"}}class We extends S{get typeName(){return"WebGLTexture"}}class He extends S{get typeName(){return"WebGLTransformFeedback"}}class je extends S{get typeName(){return"WebGLUniformLocation"}}class ze extends S{get typeName(){return"WebGLVertexArrayObject"}}class Xe extends me{get stateName(){return Xe.stateName}get requireStartAndStopStates(){return!1}constructor(e){super(e),this.drawCallTextureInputState=new Oe(e),this.drawCallUboInputState=new Ie(e)}getConsumeCommands(){return d}getChangeCommandsByState(){return{}}readFromContext(){var e,t;const n=this.context.getParameter(p.CURRENT_PROGRAM.value);if(!n)return;this.currentState.frameBuffer=this.readFrameBufferFromContext();const r=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData:x.getProgramData(this.context,n);if(this.currentState.programStatus=Object.assign({},r.programStatus),this.currentState.programStatus.program=this.getSpectorData(n),this.currentState.programStatus.RECOMPILABLE=o.isBuildableProgram(n),this.currentState.programStatus.RECOMPILABLE&&Pe.saveInGlobalStore(n),this.currentState.shaders=r.shaders,(null===(e=this.lastCommandName)||void 0===e?void 0:e.indexOf("Elements"))>=0){const e=this.context.getParameter(this.context.ELEMENT_ARRAY_BUFFER_BINDING);e&&(this.currentState.elementArray={},this.currentState.elementArray.arrayBuffer=this.getSpectorData(e))}const i=this.context.getProgramParameter(n,p.ACTIVE_ATTRIBUTES.value);this.currentState.attributes=[];for(let e=0;e1){const e=this.context.getProgramParameter(n,p.ACTIVE_UNIFORM_BLOCKS.value);this.currentState.uniformBlocks=[];for(let t=0;t1){const e=this.context;t.colorAttachments=[];const n=e.getParameter(p.MAX_DRAW_BUFFERS.value);for(let e=0;e1&&(r.alphaSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE.value),r.blueSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE.value),r.encoding=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.value)),r.componentType=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value)),r.depthSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE.value),r.greenSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE.value),r.redSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_RED_SIZE.value),r.stencilSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value),n===p.TEXTURE.value&&(r.textureLayer=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value))),r}readAttributeFromContext(e,t){const n=this.context.getActiveAttrib(e,t),r=this.context.getAttribLocation(e,n.name);if(-1===r)return{name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:-1};const i=this.context.getVertexAttrib(r,p.CURRENT_VERTEX_ATTRIB.value),s=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING.value),o={name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:r,offsetPointer:this.context.getVertexAttribOffset(r,p.VERTEX_ATTRIB_ARRAY_POINTER.value),bufferBinding:this.getSpectorData(s),enabled:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_ENABLED.value),arraySize:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_SIZE.value),stride:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_STRIDE.value),arrayType:this.getWebGlConstant(this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_TYPE.value)),normalized:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_NORMALIZED.value),vertexAttrib:Array.prototype.slice.call(i)};return this.extensions[p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.extensionName]?o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.value):this.contextVersion>1&&(o.integer=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_INTEGER.value),o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR.value)),this.appendBufferCustomData(o,s),o}readUniformFromContext(e,t){const n=this.context.getActiveUniform(e,t),r=this.context.getUniformLocation(e,n.name);if(r){if(n.size>1&&n.name&&n.name.indexOf("[0]")===n.name.length-3){const t=[];for(let r=0;r1){r.baseLevel=this.context.getTexParameter(t.value,p.TEXTURE_BASE_LEVEL.value),r.immutable=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_FORMAT.value),r.immutableLevels=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_LEVELS.value),r.maxLevel=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LEVEL.value);const e=this.context.getParameter(p.SAMPLER_BINDING.value);if(e){r.sampler=this.getSpectorData(e);const t=this.context;r.samplerMaxLod=t.getSamplerParameter(e,p.TEXTURE_MAX_LOD.value),r.samplerMinLod=t.getSamplerParameter(e,p.TEXTURE_MIN_LOD.value),r.samplerCompareFunc=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_FUNC.value)),r.samplerCompareMode=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_MODE.value)),r.samplerWrapS=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_S.value)),r.samplerWrapT=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_T.value)),r.samplerWrapR=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_R.value)),r.samplerMagFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MAG_FILTER.value)),r.samplerMinFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MIN_FILTER.value))}else r.maxLod=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LOD.value),r.minLod=this.context.getTexParameter(t.value,p.TEXTURE_MIN_LOD.value),r.compareFunc=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_FUNC.value)),r.compareMode=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_MODE.value)),r.wrapR=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_WRAP_R.value))}const i=this.getTextureStorage(t);if(i){const e=this.quickCapture?null:t;this.drawCallTextureInputState.appendTextureState(r,i,e,this.fullCapture)}return this.context.activeTexture(n),r}getTextureStorage(e){return e===p.TEXTURE_2D?this.context.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP?this.context.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):e===p.TEXTURE_3D?this.context.getParameter(p.TEXTURE_BINDING_3D.value):e===p.TEXTURE_2D_ARRAY?this.context.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):void 0}readUniformsFromContextIntoState(e,t,n,r){const i=this.context,s=i.getActiveUniforms(e,t,p.UNIFORM_TYPE.value),o=i.getActiveUniforms(e,t,p.UNIFORM_SIZE.value),a=i.getActiveUniforms(e,t,p.UNIFORM_BLOCK_INDEX.value),l=i.getActiveUniforms(e,t,p.UNIFORM_OFFSET.value),u=i.getActiveUniforms(e,t,p.UNIFORM_ARRAY_STRIDE.value),c=i.getActiveUniforms(e,t,p.UNIFORM_MATRIX_STRIDE.value),h=i.getActiveUniforms(e,t,p.UNIFORM_IS_ROW_MAJOR.value);for(let d=0;d-1&&(t.blockName=i.getActiveUniformBlockName(e,t.blockIndice)),t.offset=l[d],t.arrayStride=u[d],t.matrixStride=c[d],t.rowMajor=h[d],t.blockIndice>-1){const e=r[a[d]].bindingPoint;t.value=this.drawCallUboInputState.getUboValue(e,t.offset,t.size,s[d])}}}readTransformFeedbackFromContext(e,t){const n=this.context,r=n.getTransformFeedbackVarying(e,t),i=n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value,t),s={name:r.name,size:r.size,type:this.getWebGlConstant(r.type),buffer:this.getSpectorData(i),bufferSize:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_SIZE.value,t),bufferStart:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_START.value,t)};return this.appendBufferCustomData(s,i),s}readUniformBlockFromContext(e,t){const n=this.context,r=n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_BINDING.value),i=n.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,r),s={name:n.getActiveUniformBlockName(e,t),bindingPoint:r,size:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_DATA_SIZE.value),activeUniformCount:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_ACTIVE_UNIFORMS.value),vertex:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER.value),fragment:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER.value),buffer:this.getSpectorData(i)};return this.appendBufferCustomData(s,i),s}appendBufferCustomData(e,t){if(t){const n=t.__SPECTOR_Object_CustomData;n&&(n.usage&&(e.bufferUsage=this.getWebGlConstant(n.usage)),e.bufferLength=n.length,n.offset&&(e.bufferOffset=n.offset),n.sourceLength&&(e.bufferSourceLength=n.sourceLength))}}getWebGlConstant(e){const t=g[e];return t?t.name:e}}Xe.stateName="DrawCall",Xe.samplerTypes={[p.SAMPLER_2D.value]:p.TEXTURE_2D,[p.SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.SAMPLER_3D.value]:p.TEXTURE_3D,[p.SAMPLER_2D_SHADOW.value]:p.TEXTURE_2D,[p.SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_2D_ARRAY_SHADOW.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_CUBE_SHADOW.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.UNSIGNED_INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.UNSIGNED_INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.UNSIGNED_INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.UNSIGNED_INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY};class Ke{constructor(e){this.contextInformation=e,this.stateTrackers=[],this.onCommandCapturedCallbacks={},this.initStateTrackers()}startCapture(e,t,n){for(const r of this.stateTrackers){const i=r.startCapture(!0,t,n);r.requireStartAndStopStates&&(e.initState[r.stateName]=i)}}stopCapture(e){for(const t of this.stateTrackers){const n=t.stopCapture();t.requireStartAndStopStates&&(e.endState[t.stateName]=n)}}captureState(e){const t=this.onCommandCapturedCallbacks[e.name];if(t)for(const n of t)n(e)}initStateTrackers(){this.stateTrackers.push(new Ee(this.contextInformation),new ve(this.contextInformation),new Ce(this.contextInformation),new De(this.contextInformation),new Se(this.contextInformation),new Ae(this.contextInformation),new _e(this.contextInformation),new ye(this.contextInformation),new be(this.contextInformation),new Te(this.contextInformation),new Re(this.contextInformation),new xe(this.contextInformation),new Le(this.contextInformation),new Xe(this.contextInformation));for(const e of this.stateTrackers)e.registerCallbacks(this.onCommandCapturedCallbacks)}}class Ye{static initializeByteSizeFormat(){this.byteSizePerInternalFormat||(this.byteSizePerInternalFormat={[p.R8.value]:1,[p.R16F.value]:2,[p.R32F.value]:4,[p.R8UI.value]:1,[p.RG8.value]:2,[p.RG16F.value]:4,[p.RG32F.value]:8,[p.ALPHA.value]:1,[p.RGB.value]:3,[p.RGBA.value]:4,[p.LUMINANCE.value]:1,[p.LUMINANCE_ALPHA.value]:2,[p.DEPTH_COMPONENT.value]:1,[p.DEPTH_STENCIL.value]:2,[p.SRGB_EXT.value]:3,[p.SRGB_ALPHA_EXT.value]:4,[p.RGB8.value]:3,[p.SRGB8.value]:3,[p.RGB565.value]:2,[p.R11F_G11F_B10F.value]:4,[p.RGB9_E5.value]:2,[p.RGB16F.value]:6,[p.RGB32F.value]:12,[p.RGB8UI.value]:3,[p.RGBA8.value]:4,[p.RGB5_A1.value]:2,[p.RGBA16F.value]:8,[p.RGBA32F.value]:16,[p.RGBA8UI.value]:4,[p.COMPRESSED_R11_EAC.value]:4,[p.COMPRESSED_SIGNED_R11_EAC.value]:4,[p.COMPRESSED_RG11_EAC.value]:4,[p.COMPRESSED_SIGNED_RG11_EAC.value]:4,[p.COMPRESSED_RGB8_ETC2.value]:4,[p.COMPRESSED_RGBA8_ETC2_EAC.value]:4,[p.COMPRESSED_SRGB8_ETC2.value]:4,[p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC.value]:4,[p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_RGB_S3TC_DXT1_EXT.value]:.5,[p.COMPRESSED_RGBA_S3TC_DXT3_EXT.value]:1,[p.COMPRESSED_RGBA_S3TC_DXT5_EXT.value]:1,[p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGB_ETC1_WEBGL.value]:.5,[p.COMPRESSED_RGB_ATC_WEBGL.value]:.5,[p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL.value]:1,[p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL.value]:1})}constructor(e){this.options=e,this.createCommandNames=this.getCreateCommandNames(),this.updateCommandNames=this.getUpdateCommandNames(),this.deleteCommandNames=this.getDeleteCommandNames(),this.startTime=u.now,this.memoryPerSecond={},this.totalMemory=0,this.frameMemory=0,this.capturing=!1,Ye.initializeByteSizeFormat()}registerCallbacks(e){for(const t of this.createCommandNames)e[t]=e[t]||[],e[t].push(this.createWithoutSideEffects.bind(this));for(const t of this.updateCommandNames)e[t]=e[t]||[],e[t].push(this.updateWithoutSideEffects.bind(this));for(const t of this.deleteCommandNames)e[t]=e[t]||[],e[t].push(this.deleteWithoutSideEffects.bind(this))}startCapture(){this.frameMemory=0,this.capturing=!0}stopCapture(){this.frameMemory=0,this.capturing=!1}appendRecordedInformation(e){e.frameMemory[this.objectName]=this.frameMemory,e.memory[this.objectName]=this.memoryPerSecond}create(e){}createWithoutSideEffects(e){this.options.toggleCapture(!1);try{this.create(e)}finally{this.options.toggleCapture(!0)}}updateWithoutSideEffects(e){if(e&&0!==e.arguments.length){this.options.toggleCapture(!1);try{const t=e.arguments[0],n=this.getBoundInstance(t);if(!n)return;if(!D.getWebGlObjectTag(n))return;const r=this.getWebGlConstant(t),i=this.update(e,r,n);this.changeMemorySize(i)}finally{this.options.toggleCapture(!0)}}}deleteWithoutSideEffects(e){if(!e||!e.arguments||e.arguments.length<1)return;const t=e.arguments[0];if(t){this.options.toggleCapture(!1);try{const e=this.delete(t);this.changeMemorySize(-e)}finally{this.options.toggleCapture(!0)}}}changeMemorySize(e){this.totalMemory+=e,this.capturing&&(this.frameMemory+=e);const t=u.now-this.startTime,n=Math.round(t/1e3);this.memoryPerSecond[n]=this.totalMemory}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}getByteSizeForInternalFormat(e){return Ye.byteSizePerInternalFormat[e]||4}readPixelStoreState(){const e=this.options.context,t={UNPACK_FLIP_Y_WEBGL:e.getParameter(p.UNPACK_FLIP_Y_WEBGL.value),UNPACK_PREMULTIPLY_ALPHA_WEBGL:e.getParameter(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL.value),UNPACK_COLORSPACE_CONVERSION_WEBGL:e.getParameter(p.UNPACK_COLORSPACE_CONVERSION_WEBGL.value),UNPACK_ALIGNMENT:e.getParameter(p.UNPACK_ALIGNMENT.value)};return e instanceof WebGL2RenderingContext&&(t.UNPACK_ROW_LENGTH=e.getParameter(p.UNPACK_ROW_LENGTH.value),t.UNPACK_IMAGE_HEIGHT=e.getParameter(p.UNPACK_IMAGE_HEIGHT.value),t.UNPACK_SKIP_PIXELS=e.getParameter(p.UNPACK_SKIP_PIXELS.value),t.UNPACK_SKIP_ROWS=e.getParameter(p.UNPACK_SKIP_ROWS.value),t.UNPACK_SKIP_IMAGES=e.getParameter(p.UNPACK_SKIP_IMAGES.value)),t}}class qe extends Ye{get objectName(){return"Buffer"}getCreateCommandNames(){return["createBuffer"]}getUpdateCommandNames(){return["bufferData"]}getDeleteCommandNames(){return["deleteBuffer"]}getBoundInstance(e){const t=this.options.context;return e===p.ARRAY_BUFFER.value?t.getParameter(p.ARRAY_BUFFER_BINDING.value):e===p.ELEMENT_ARRAY_BUFFER.value?t.getParameter(p.ELEMENT_ARRAY_BUFFER_BINDING.value):e===p.COPY_READ_BUFFER.value?t.getParameter(p.COPY_READ_BUFFER_BINDING.value):e===p.COPY_WRITE_BUFFER.value?t.getParameter(p.COPY_WRITE_BUFFER_BINDING.value):e===p.TRANSFORM_FEEDBACK_BUFFER.value?t.getParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value):e===p.UNIFORM_BUFFER.value?t.getParameter(p.UNIFORM_BUFFER_BINDING.value):e===p.PIXEL_PACK_BUFFER.value?t.getParameter(p.PIXEL_PACK_BUFFER_BINDING.value):e===p.PIXEL_UNPACK_BUFFER.value?t.getParameter(p.PIXEL_UNPACK_BUFFER_BINDING.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(t,e);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){const n=this.getLength(t);return t.arguments.length>=4?{target:e,length:n,usage:t.arguments[2],offset:t.arguments[3],sourceLength:t.arguments[1]?t.arguments[1].length:-1}:3===t.arguments.length?{target:e,length:n,usage:t.arguments[2]}:void 0}getLength(e){const t=e.arguments[1],n=e.arguments[3],r=e.arguments[4];if("number"==typeof t)return t;if("number"==typeof r&&r>0)return r;const i=t.byteLength||t.length||0;return"number"==typeof n&&n>0?i-n:i}}class Qe extends Ye{get objectName(){return"Renderbuffer"}getCreateCommandNames(){return["createRenderbuffer"]}getUpdateCommandNames(){return["renderbufferStorage","renderbufferStorageMultisample"]}getDeleteCommandNames(){return["deleteRenderbuffer"]}getBoundInstance(e){const t=this.options.context;if(e===p.RENDERBUFFER.value)return t.getParameter(p.RENDERBUFFER_BINDING.value)}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(e,t);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return r.length=r.width*r.height*this.getByteSizeForInternalFormat(r.internalFormat),n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){return 4===e.arguments.length?{target:t,internalFormat:e.arguments[1],width:e.arguments[2],height:e.arguments[3],length:0,samples:0}:{target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,samples:e.arguments[1]}}}class Ze extends Ye{get objectName(){return"Texture2d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage2D","compressedTexImage2D","texStorage2D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D.value?t.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP_POSITIVE_X.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Y.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Z.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_X.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Y.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Z.value?t.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target===p.TEXTURE_2D_ARRAY.name||t.target===p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else{const e="TEXTURE_2D"===t?1:6;let n=r.internalFormat;n===p.RGBA.value&&(r.type===p.FLOAT.value&&(n=p.RGBA32F.value),r.type===p.HALF_FLOAT_OES.value&&(n=p.RGBA16F.value)),r.length=r.width*r.height*e*this.getByteSizeForInternalFormat(n)}return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage2D"===e.name?this.getTexImage2DCustomData(e,t,n):"compressedTexImage2D"===e.name?this.getCompressedTexImage2DCustomData(e,t,n):"texStorage2D"===e.name?this.getTexStorage2DCustomData(e,t,n):void 0}getTexStorage2DCustomData(e,t,n){let r;return 5===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!1}),r}getCompressedTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=7&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!0}),r}getTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8?r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],format:e.arguments[6],type:e.arguments[7],length:0,isCompressed:!1}:6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[5].width,height:e.arguments[5].height,format:e.arguments[3],type:e.arguments[4],length:0,isCompressed:!1}),r}}class Je extends Ye{get objectName(){return"Texture3d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage3D","compressedTexImage3D","texStorage3D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D_ARRAY.value?t.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):e===p.TEXTURE_3D.value?t.getParameter(p.TEXTURE_BINDING_3D.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target!==p.TEXTURE_2D_ARRAY.name&&t.target!==p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){if(e.arguments.length>=2&&0!==e.arguments[1])return 0;const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else r.length=r.width*r.height*r.depth*this.getByteSizeForInternalFormat(r.internalFormat);return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage3D"===e.name?this.getTexImage3DCustomData(e,t,n):"compressedTexImage3D"===e.name?this.getCompressedTexImage3DCustomData(e,t,n):"texStorage3D"===e.name?this.getTexStorage3DCustomData(e,t,n):void 0}getTexStorage3DCustomData(e,t,n){let r;return 6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!1}),r}getCompressedTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!0}),r}getTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=9&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],format:e.arguments[7],type:e.arguments[8],length:0,isCompressed:!1}),r}}class et extends Ye{get objectName(){return"Program"}getCreateCommandNames(){return["createProgram"]}getUpdateCommandNames(){return["linkProgram"]}getDeleteCommandNames(){return["deleteProgram"]}getBoundInstance(e){return e}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){if(e.arguments.length>=1&&!e.arguments[0])return 0;const r=this.getCustomData(n);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e){const t=this.options.context;return x.getProgramData(t,e)}}class tt{constructor(e){this.contextInformation=e,this.onCommandCallbacks={},this.recorders=[],this.initRecorders()}recordCommand(e){const t=this.onCommandCallbacks[e.name];if(t)for(const n of t)n(e)}startCapture(){for(const e of this.recorders)e.startCapture()}stopCapture(){for(const e of this.recorders)e.stopCapture()}appendRecordedInformation(e){for(const t of this.recorders)t.appendRecordedInformation(e)}initRecorders(){this.recorders.push(new qe(this.contextInformation),new Qe(this.contextInformation),new Ze(this.contextInformation),new Je(this.contextInformation),new et(this.contextInformation));for(const e of this.recorders)e.registerCallbacks(this.onCommandCallbacks)}}class nt{constructor(e){this.contextInformation=e,this.webGlObjects=[],this.initWebglObjects()}tagWebGlObjects(e){for(const t of this.webGlObjects){for(let n=0;n0&&this.currentCapture.commands.length===this.maxCommands&&this.onMaxCommand.trigger(this)}}}spyContext(e){const t=[];for(const n in e)n&&t.push(n);for(let n=0;n{this.spyRequestAnimationFrame("requestAnimationFrame",e.display)})}spyRequestAnimationFrame(e,t){const n=this;y.storeOriginFunction(t,e),t[e]=function(){const r=arguments[0],i=n.getCallback(n,r,()=>{n.spiedScope[e](r)});return y.executeOriginFunction(t,e,[i])}}spySetTimer(e){const t=this,n=this.spiedScope,r="setTimeout"===e;y.storeOriginFunction(n,e),n[e]=function(){const i=arguments[0],s=arguments[1],o=Array.prototype.slice.call(arguments);return at.setTimerCommonValues.indexOf(s)>-1&&(o[0]=t.getCallback(t,i,r?()=>{n[e](i)}:null)),y.executeOriginFunction(n,e,o)}}getCallback(e,t,n=null){return function(){const r=u.now;if(e.lastFrame=++e.lastFrame%e.speedRatio,e.willPlayNextFrame||e.speedRatio&&!e.lastFrame){try{e.onFrameStart.trigger(e)}catch(t){e.onError.trigger(t)}try{t.apply(e.spiedScope,arguments)}catch(t){e.onError.trigger(t)}e.lastSixtyFramesCurrentIndex=(e.lastSixtyFramesCurrentIndex+1)%at.fpsWindowSize,e.lastSixtyFramesDuration[e.lastSixtyFramesCurrentIndex]=r-e.lastSixtyFramesPreviousStart;try{e.onFrameEnd.trigger(e)}catch(t){e.onError.trigger(t)}e.willPlayNextFrame=!1}else n&&n();e.lastSixtyFramesPreviousStart=r}}}at.requestAnimationFrameFunctions=["requestAnimationFrame","msRequestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame"],at.setTimerFunctions=["setTimeout","setInterval"],at.setTimerCommonValues=[0,15,16,33,32,40],at.fpsWindowSize=60;class lt{constructor(e){this.canvas=e,this.onContextRequested=new l,this.init()}init(){const e=this,t=function(){const t="undefined"!=typeof HTMLCanvasElement&&this instanceof HTMLCanvasElement?HTMLCanvasElement:OffscreenCanvas,n=e.canvas?y.executeOriginFunction(this,"getContext",arguments):y.executePrototypeOriginFunction(this,t,"getContext",arguments);if(arguments.length>0){const e=arguments[0];if("webgl"!==e&&"experimental-webgl"!==e&&"webgl2"!==e&&"experimental-webgl2"!==e)return n}if(n){const t=Array.prototype.slice.call(arguments),r="webgl2"===t[0]||"experimental-webgl2"===t[0]?2:1;e.onContextRequested.trigger({context:n,contextVersion:r})}return n};this.canvas?(y.storeOriginFunction(this.canvas,"getContext"),this.canvas.getContext=t):("undefined"!=typeof HTMLCanvasElement&&(y.storePrototypeOriginFunction(HTMLCanvasElement,"getContext"),HTMLCanvasElement.prototype.getContext=t),"undefined"!=typeof OffscreenCanvas&&(y.storePrototypeOriginFunction(OffscreenCanvas,"getContext"),OffscreenCanvas.prototype.getContext=t))}}class ut{static startIntercepting(e){if(ut.intercepting)return;if("undefined"==typeof Worker)return;ut.workerBundleUrl=e,ut.originalWorkerConstructor=Worker,ut.intercepting=!0;const t=Worker;globalThis.Worker=function(e,n){if(n&&"module"===n.type)return new t(e,n);const r=e.toString();try{let i;try{i=new URL(r,location.href).href}catch(r){return new t(e,n)}const s=new XMLHttpRequest;if(s.open("GET",i,!1),s.send(),200===s.status&&ut.shouldInjectSource(s.responseText)){const e=ut.rewriteImportScripts(s.responseText,i),o="(function(){\n var __spectorBase = "+JSON.stringify(i)+';\n self.__SPECTOR_workerBaseUrl = __spectorBase;\n function __spectorResolve(u) {\n if (u == null) return u;\n if (typeof u !== "string") {\n if (u instanceof URL) return u;\n try { u = String(u); } catch (e) { return u; }\n }\n if (/^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i.test(u)) return u;\n try { return new URL(u, __spectorBase).href; }\n catch (e) { return u; }\n }\n self.__SPECTOR_resolveWorkerUrl = __spectorResolve;\n var __origImportScripts = self.importScripts;\n if (typeof __origImportScripts === "function") {\n self.importScripts = function() {\n var args = new Array(arguments.length);\n for (var i = 0; i < arguments.length; i++) args[i] = __spectorResolve(arguments[i]);\n return __origImportScripts.apply(self, args);\n };\n }\n var __origFetch = self.fetch;\n if (typeof __origFetch === "function") {\n self.fetch = function(input, init) {\n try {\n if (typeof input === "string") {\n input = __spectorResolve(input);\n } else if (input && typeof input === "object" && "url" in input && typeof Request === "function") {\n var r = input;\n var resolved = __spectorResolve(r.url);\n if (resolved !== r.url) input = new Request(resolved, r);\n }\n } catch (e) { /* fall through with original input */ }\n return __origFetch.call(self, input, init);\n };\n }\n if (typeof XMLHttpRequest === "function" && XMLHttpRequest.prototype && XMLHttpRequest.prototype.open) {\n var __origXhrOpen = XMLHttpRequest.prototype.open;\n XMLHttpRequest.prototype.open = function(method, url) {\n var args = Array.prototype.slice.call(arguments);\n args[1] = __spectorResolve(url);\n return __origXhrOpen.apply(this, args);\n };\n }\n if (typeof Worker === "function") {\n var __OrigWorker = Worker;\n self.Worker = function(scriptURL, options) {\n var resolved = __spectorResolve(scriptURL);\n return new __OrigWorker(resolved, options);\n };\n self.Worker.prototype = __OrigWorker.prototype;\n }\n})();\n',a="importScripts("+JSON.stringify(ut.workerBundleUrl)+");\n",l=new Blob([o+a+e],{type:"application/javascript"}),u=URL.createObjectURL(l),c=new t(u,n);return ut.spiedWorkers.push({worker:c,originalUrl:r}),c}}catch(e){console.warn("[Spector.js] Could not inject into Worker ("+r+"):",e)}const i=new t(e,n);return ut.spiedWorkers.push({worker:i,originalUrl:r}),i},globalThis.Worker.prototype=t.prototype}static stopIntercepting(){ut.intercepting&&(globalThis.Worker=ut.originalWorkerConstructor,ut.intercepting=!1)}static rewriteImportScripts(e,t){const n=/(['"`])((?:\\.|(?!\1).)*)\1/g;return e.replace(/importScripts\s*\(([^)]*)\)/g,(e,r)=>"importScripts("+r.replace(n,(e,n,r)=>{if("`"===n&&-1!==r.indexOf("${"))return e;let i;try{i=new URL(r,t).href}catch(t){return e}return n+i+n})+")")}static shouldInjectSource(e){return!/\bimport\s*(?:\/\*[\s\S]*?\*\/\s*)?\(/.test(e)&&!/\bnew\s+(?:(?:self|globalThis)\s*\.\s*)?(?:Worker|SharedWorker)\s*\(/.test(e)}static getSpiedWorkers(){return ut.spiedWorkers}static isIntercepting(){return ut.intercepting}}ut.spiedWorkers=[],ut.intercepting=!1;class ct{static getDelay(){return ct.delayMs}static setDelay(e){ct.delayMs="number"==typeof e&&e>0?e:0}static shouldForceIncomplete(e,t,n,r){return!(r<=0)&&e===p.COMPLETION_STATUS_KHR.value&&void 0!==t&&n-tthis._state,this.subscribe=e=>(this._listeners.add(e),()=>{this._listeners.delete(e)}),this._state=e}setState(e){this._state=e(this._state),this._emitChange()}setSnapshot(e){this._state=e,this._emitChange()}_emitChange(){for(const e of this._listeners)e()}}function pt(e){return(0,dt.useSyncExternalStore)(e.subscribe,e.getSnapshot)}var mt=n(848);const gt=(0,dt.createContext)(null);function Et(){const e=(0,dt.useContext)(gt);if(!e)throw new Error("CaptureMenuContext not provided — CaptureMenuRoot must be rendered inside CaptureMenuContext.Provider");return e}function vt({canvas:e}){const t=Et();return(0,mt.jsx)("li",{onClick:()=>t.handleCanvasSelected(e),children:(0,mt.jsx)("span",{children:`Id: ${e.id} - Size: ${e.width}*${e.height}`})})}function Ct(){const e=Et(),t=pt(e.store),n=t.selectedCanvas?`${t.selectedCanvas.id} (${t.selectedCanvas.width}*${t.selectedCanvas.height})`:"Choose Canvas...";return(0,mt.jsxs)("div",{className:"canvasListComponent",children:[(0,mt.jsx)("span",{commandName:"onCanvasSelection",onClick:e.handleCanvasListToggle,children:n}),(0,mt.jsx)("ul",{style:{display:t.showCanvasList?"block":"none",visibility:t.showCanvasList?"visible":"hidden"},children:t.canvases.map((e,t)=>(0,mt.jsx)(vt,{canvas:e},e.id||t))})]})}function Dt(){const e=Et(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"captureMenuActionsComponent",children:[(0,mt.jsx)("div",{commandName:"onCaptureRequested",onClick:e.handleCaptureRequested}),t.isPlaying?(0,mt.jsx)("div",{commandName:"onPauseRequested",onClick:e.handlePauseRequested}):(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("div",{commandName:"onPlayRequested",onClick:e.handlePlayRequested}),(0,mt.jsx)("div",{commandName:"onPlayNextFrameRequested",onClick:e.handlePlayNextFrameRequested})]})]})}function St(){const e=pt(Et().store);return(0,mt.jsxs)("span",{className:"fpsCounterComponent",children:[e.fps.toFixed(2)," Fps"]})}function At(){const e=pt(Et().store);return(0,mt.jsxs)("div",{children:[(0,mt.jsxs)("div",{className:"captureMenuComponent "+(e.visible?"active":""),children:[(0,mt.jsx)(Ct,{}),(0,mt.jsx)(Dt,{}),(0,mt.jsx)(St,{})]}),(0,mt.jsx)("div",{className:"captureMenuLogComponent "+(e.logVisible?"active":""),children:(0,mt.jsx)("span",{className:e.logLevel===i.error?"error":"",children:e.logText})})]})}class _t{constructor(e={}){this.options=e,this.handleCanvasListToggle=()=>{this.store.getSnapshot(),this.store.setState(e=>Object.assign(Object.assign({},e),{selectedCanvas:null,showCanvasList:!e.showCanvasList,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!e.showCanvasList&&!this._hideLog})),this.onCanvasSelected.trigger(null),this._isTrackingCanvas&&this.trackPageCanvases()},this.handleCanvasSelected=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{selectedCanvas:e,showCanvasList:!1,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)},this.handleCaptureRequested=()=>{const e=this.getSelectedCanvasInformation();e&&this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.PleaseWaitHelpText,logVisible:!this._hideLog})),setTimeout(()=>{this.onCaptureRequested.trigger(e)},200)},this.handlePauseRequested=()=>{this.onPauseRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!1}))},this.handlePlayRequested=()=>{this.onPlayRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!0}))},this.handlePlayNextFrameRequested=()=>{this.onPlayNextFrameRequested.trigger(this.getSelectedCanvasInformation())},this._rootPlaceHolder=e.rootPlaceHolder||document.body,this._hideLog=!!e.hideLog,this._isTrackingCanvas=!1,this._extraCanvasEntries=[],this.onCanvasSelected=new l,this.onCaptureRequested=new l,this.onPauseRequested=new l,this.onPlayRequested=new l,this.onPlayNextFrameRequested=new l,this.store=new ft({visible:!0,logText:_t.SelectCanvasHelpText,logLevel:i.info,logVisible:!this._hideLog,canvases:[],selectedCanvas:null,showCanvasList:!1,isPlaying:!0,fps:0}),this._container=document.createElement("div"),this._container.className="spector-react-capture-menu",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(gt.Provider,{value:this},(0,dt.createElement)(At)))}getSelectedCanvasInformation(){return this.store.getSnapshot().selectedCanvas}trackPageCanvases(){if(this._isTrackingCanvas=!0,document.body){const e=document.body.querySelectorAll("canvas");this.updateCanvasesList(e)}}updateCanvasesList(e){const t=[];for(let n=0;nObject.assign(Object.assign({},n),{canvases:t,selectedCanvas:e,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}captureComplete(e){e?this.store.setState(t=>Object.assign(Object.assign({},t),{logLevel:i.error,logText:e,logVisible:!this._hideLog})):this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog}))}setFPS(e){this.store.setState(t=>Object.assign(Object.assign({},t),{fps:e}))}_updateCanvasesInternal(e){for(const t of this._extraCanvasEntries)e.push(t);this.store.getSnapshot().showCanvasList?this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e})):1===e.length?(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:e[0],logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e[0])):(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:null,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(null))}}_t.SelectCanvasHelpText="Please, select a canvas in the list above.",_t.ActionsHelpText="Record with the red button, you can also pause or continue playing the current scene.",_t.PleaseWaitHelpText="Capturing, be patient (this can take up to 3 minutes)...";const yt=(0,dt.createContext)(null);function bt(){const e=(0,dt.useContext)(yt);if(!e)throw new Error("ResultViewContext not provided — ResultViewRoot must be rendered inside ResultViewContext.Provider");return e}function Tt(){const e=bt(),t=pt(e.store),n=(0,dt.useRef)(null),r=(0,dt.useCallback)(e=>{e.preventDefault();const t=e.currentTarget.parentElement,n=t.parentElement;if(!n)return;const r=n.querySelectorAll("li:not(.resultViewMenuSmall)");if("true"===t.getAttribute("open")){t.setAttribute("open","false");for(let e=0;e{e.handleSearchTextChange(t.target.value)},[e]),s=(0,dt.useCallback)(t=>{t.stopPropagation(),e.handleSearchTextChange("")},[e]),o=(0,dt.useCallback)(t=>n=>{n.preventDefault(),e.handleMenuStatusChange(t)},[e]),a=(0,dt.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),e.handleClose()},[e]);return(0,mt.jsxs)("ul",{className:"resultViewMenuComponent",ref:n,children:[(0,mt.jsx)("li",{className:"resultViewMenuOpen resultViewMenuSmall",children:(0,mt.jsx)("a",{href:"#",role:"button",onClick:r,children:"Menu"})}),(0,mt.jsxs)("li",{className:"searchContainer",children:[(0,mt.jsx)("input",{type:"text",placeholder:"Search...",value:t.searchText,commandName:"onSearchTextChanged",commandEventBinding:"change",onChange:i}),(0,mt.jsx)("a",{className:"clearSearch",commandName:"onSearchTextCleared",onClick:s,children:"X"})]}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:0===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCapturesClicked",onClick:o(0),children:"Captures"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:10===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInformationClicked",onClick:o(10),children:"Information"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:20===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInitStateClicked",onClick:o(20),children:"Init State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:40===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCommandsClicked",onClick:o(40),children:"Commands"+(t.commandCount>0?" ("+t.commandCount+")":"")})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:60===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCompareClicked",onClick:o(60),children:"Compare"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:30===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onEndStateClicked",onClick:o(30),children:"End State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{role:"button",commandName:"onCloseClicked",onClick:a,children:"Close"})})]})}function Rt({children:e}){return(0,mt.jsx)("div",{className:"resultViewContentComponent",children:e})}function xt({capture:e,active:t,onCaptureSelected:n,onSaveRequested:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),r()},[r]),s=(0,dt.useCallback)(()=>{n()},[n]),o=new Date(e.startTime).toTimeString().split(" ")[0];return(0,mt.jsxs)("li",{className:t?"active":"",onClick:s,children:[e.endState.VisualState.Attachments?e.endState.VisualState.Attachments.map((e,t)=>(0,mt.jsx)("img",{src:encodeURI(e.src)},t)):(0,mt.jsx)("span",{children:e.endState.VisualState.FrameBufferStatus}),(0,mt.jsxs)("span",{children:[o,(0,mt.jsx)("a",{href:"#",className:"captureListItemSave",commandName:"onSaveRequested",onClick:i})]})]})}function wt({active:e,captures:t,onCaptureSelected:n,onSaveRequested:r,onCaptureLoaded:i}){const s=(0,dt.useRef)(null),o=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault()},[]),l=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),function(e,t){let n=null;if(e&&e.dataTransfer&&e.dataTransfer.files&&(n=e.dataTransfer.files),e&&e.target&&e.target.files&&(n=e.target.files),n&&n.length>0)for(let e=0;e{a.error("Error while reading file: "+r.name+e)},i.onload=e=>{try{const n=JSON.parse(e.target.result);t(n)}catch(e){a.error("Error while reading file: "+r.name+e)}},i.readAsText(r)}}(e.nativeEvent,i)},[i]);return(0,mt.jsxs)("div",{className:"captureListComponent "+(e?"active":""),children:[(0,mt.jsx)("div",{className:"openCaptureFile",ref:s,onDragEnter:o,onDragOver:o,onDrop:l,children:(0,mt.jsx)("span",{children:"Drag files here to open a previously saved capture."})}),(0,mt.jsx)("ul",{children:t.map((e,t)=>(0,mt.jsx)(xt,{capture:e.capture,active:e.active,onCaptureSelected:()=>n(t),onSaveRequested:()=>r(e.capture)},t))})]})}function Ft({children:e}){return(0,mt.jsx)("div",{className:"visualStateListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Nt({item:e,onVisualStateSelected:t}){const n=(0,dt.useRef)(null);(0,dt.useEffect)(()=>{e.active&&n.current&&setTimeout(()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const r=(0,dt.useCallback)(()=>{t()},[t]),i=e.VisualState;return(0,mt.jsxs)("li",{ref:n,className:e.active?"active":"",onClick:r,commandName:"onVisualStateSelected",children:[i.Attachments?i.Attachments.map((e,t)=>e.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{src:encodeURI(e.src)}),i.Attachments.length>1&&(0,mt.jsx)("span",{children:e.attachmentName}),!!e.textureLayer&&(0,mt.jsx)("span",{children:"Layer: "+e.textureLayer}),!!e.textureCubeMapFace&&(0,mt.jsx)("span",{children:e.textureCubeMapFace})]},t):null):(0,mt.jsx)("span",{children:i.FrameBufferStatus}),(0,mt.jsx)("span",{children:i.FrameBuffer?"Frame buffer: "+i.FrameBuffer.__SPECTOR_Object_TAG.id:"Canvas frame buffer"})]})}function Lt({children:e}){return(0,mt.jsx)("div",{className:"commandListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Ot({command:e,onCommandSelected:t,onVertexSelected:n,onFragmentSelected:r,onShaderSelected:i}){var s;const o=(0,dt.useRef)(null),a=e.capture,l=function(e){switch(e){case 50:return"deprecated";case 10:return"unused";case 20:return"disabled";case 30:return"redundant";case 40:return"valid";default:return"unknown"}}(a.status),u=!!a.VisualState;let c="";u&&(c=" drawCall"),e.active&&(c=" active"),(0,dt.useEffect)(()=>{e.active&&o.current&&setTimeout(()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const h=(0,dt.useCallback)(e=>{t()},[t]),d=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==n||n()},[n]),f=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==r||r()},[r]),p=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==i||i()},[i]);let m=null;if(u&&"clear"!==a.name)try{const e=a.DrawCall.shaders[0],t=a.DrawCall.shaders[1];m=(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("a",{href:"#",onClick:d,children:e.name}),(0,mt.jsx)("a",{href:"#",onClick:f,children:t.name})]})}catch(e){}const g=(null===(s=a.shader)||void 0===s?void 0:s.source)?(0,mt.jsx)("a",{href:"#",commandName:"onShaderSourceSelected",onClick:p,children:"Source"}):null;return(0,mt.jsxs)("li",{ref:o,className:c,onClick:h,commandName:"onCommandSelected",children:[a.marker&&(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.marker+" "}),"LOG"===a.name?(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.text+" "}):(0,mt.jsx)("span",{dangerouslySetInnerHTML:{__html:a.text.replace(a.name,`${a.name}`)}}),g,m]})}function It({children:e}){return(0,mt.jsx)("div",{className:"commandDetailComponent",children:e})}function kt({left:e,children:t}){return(0,mt.jsx)("div",{className:e?"informationColumnLeftComponent":"informationColumnRightComponent",children:t})}function Mt({children:e}){return(0,mt.jsx)("div",{className:"jsonContentComponent",children:e})}function Pt(e,t,n,r){return{row:Math.max(0,parseInt(t,10)-1),column:n?Math.max(0,parseInt(n,10)-1):0,text:r.trim()||e,type:e.toLowerCase()}}var Bt,Ut,$t=Object.create,Gt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor,Wt=Object.getOwnPropertyNames,Ht=Object.getPrototypeOf,jt=Object.prototype.hasOwnProperty,zt=e=>{throw TypeError(e)},Xt=(e,t)=>{for(var n in t)Gt(e,n,{get:t[n],enumerable:!0})},Kt=(e,t,n)=>(((e,t)=>{t.has(e)||zt("Cannot access private method")})(e,t),n),Yt=(Bt=e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=/\r\n|[\n\r\u2028\u2029]/;e.codeFrameColumns=function(e,n,r={}){let i=new Proxy({},{get:()=>e=>e}),s=e.split(t),{start:o,end:a,markerLines:l}=function(e,t,n){let r=Object.assign({column:0,line:-1},e.start),i=Object.assign({},r,e.end),{linesAbove:s=2,linesBelow:o=3}=n||{},a=r.line,l=r.column,u=i.line,c=i.column,h=Math.max(a-(s+1),0),d=Math.min(t.length,u+o);-1===a&&(h=0),-1===u&&(d=t.length);let f=u-a,p={};if(f)for(let e=0;e<=f;e++){let n=e+a;if(l)if(0===e){let e=t[n-1].length;p[n]=[l,e-l+1]}else if(e===f)p[n]=[0,c];else{let r=t[n-e].length;p[n]=[0,r]}else p[n]=!0}else p[a]=l===c?!l||[l,0]:[l,c-l];return{start:h,end:d,markerLines:p}}(n,s,r),u=n.start&&"number"==typeof n.start.column,c=String(a).length,h=e.split(t,a).slice(o,a).map((e,t)=>{let n=o+1+t,s=` ${` ${n}`.slice(-c)} |`,a=l[n],u=!l[n+1];if(a){let t="";if(Array.isArray(a)){let n=e.slice(0,Math.max(a[0]-1,0)).replace(/[^\t]/g," "),o=a[1]||1;t=["\n ",i.gutter(s.replace(/\d/g," "))," ",n,i.marker("^").repeat(o)].join(""),u&&r.message&&(t+=" "+i.message(r.message))}return[i.marker(">"),i.gutter(s),e.length>0?` ${e}`:"",t].join("")}return` ${i.gutter(s)}${e.length>0?` ${e}`:""}`}).join("\n");return r.message&&!u&&(h=`${" ".repeat(c+1)}${r.message}\n${h}`),h}},()=>(Ut||Bt((Ut={exports:{}}).exports),Ut.exports));Xt({},{__debug:()=>Hs,check:()=>Vs,doc:()=>vs,format:()=>Gs,formatWithCursor:()=>$s,getSupportInfo:()=>Ws,util:()=>_s,version:()=>As});var qt=(e,t,n,r)=>{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Qt=class{diff(e,t,n={}){let r;"function"==typeof n?(r=n,n={}):"callback"in n&&(r=n.callback);let i=this.castInput(e,n),s=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),a=this.removeEmpty(this.tokenize(s,n));return this.diffWithOptionsObj(o,a,n,r)}diffWithOptionsObj(e,t,n,r){var i;let s=e=>(e=this.postProcess(e,n),r?void setTimeout(function(){r(e)},0):e),o=t.length,a=e.length,l=1,u=o+a;null!=n.maxEditLength&&(u=Math.min(u,n.maxEditLength));let c=null!==(i=n.timeout)&&void 0!==i?i:1/0,h=Date.now()+c,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=a&&f+1>=o)return s(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,g=()=>{for(let r=Math.max(p,-l);r<=Math.min(m,l);r+=2){let i,l=d[r-1],u=d[r+1];l&&(d[r-1]=void 0);let c=!1;if(u){let e=u.oldPos-r;c=u&&0<=e&&e=a&&f+1>=o)return s(this.buildValues(i.lastComponent,t,e))||!0;d[r]=i,i.oldPos+1>=a&&(m=Math.min(m,r-1)),f+1>=o&&(p=Math.max(p,r+1))}else d[r]=void 0}l++};if(r)!function e(){setTimeout(function(){if(l>u||Date.now()>h)return r(void 0);g()||e()},0)}();else for(;l<=u&&Date.now()<=h;){let e=g();if(e)return e}}addToPath(e,t,n,r,i){let s=e.lastComponent;return s&&!i.oneChangePerToken&&s.added===t&&s.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:s.count+1,added:t,removed:n,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:s}}}extractCommon(e,t,n,r,i){let s=t.length,o=n.length,a=e.oldPos,l=a-r,u=0;for(;l+1e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(a,a+e.count));a+=e.count,e.added||(l+=e.count)}}return i}},Zt=new class extends Qt{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Jt(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}function en(e,t){let n;switch(t){case"\n":n=/\n/gu;break;case"\r":n=/\r/gu;break;case"\r\n":n=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let r=e.match(n);return r?r.length:0}var tn="string",nn="array",rn="cursor",sn="indent",on="align",an="trim",ln="group",un="fill",cn="if-break",hn="indent-if-break",dn="line-suffix",fn="line-suffix-boundary",pn="line",mn="label",gn="break-parent",En=new Set([rn,sn,on,an,ln,un,cn,hn,dn,fn,pn,mn,gn]),vn=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},Cn=function(e){if("string"==typeof e)return tn;if(Array.isArray(e))return nn;if(!e)return;let{type:t}=e;return En.has(t)?t:void 0};var Dn=class extends Error{name="InvalidDocError";constructor(e){super(function(e){let t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(Cn(e))throw new Error("doc is valid.");let n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;let r=(e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e))([...En].map(e=>`'${e}'`));return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},Sn=Dn,An={},_n=function(e,t,n,r){let i=[e];for(;i.length>0;){let e=i.pop();if(e===An){n(i.pop());continue}n&&i.push(e,An);let s=Cn(e);if(!s)throw new Sn(e);if(!1!==(null==t?void 0:t(e)))switch(s){case nn:case un:{let t=s===nn?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case cn:i.push(e.flatContents,e.breakContents);break;case ln:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case on:case sn:case hn:case mn:case dn:i.push(e.contents);break;case tn:case rn:case an:case fn:case pn:case gn:break;default:throw new Sn(e)}}};function yn(e,t){if("string"==typeof e)return t(e);let n=new Map;return function e(r){if(n.has(r))return n.get(r);let i=function(n){switch(Cn(n)){case nn:return t(n.map(e));case un:return t({...n,parts:n.parts.map(e)});case cn:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case ln:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case on:case sn:case hn:case mn:case dn:return t({...n,contents:e(n.contents)});case tn:case rn:case an:case fn:case pn:case gn:return t(n);default:throw new Sn(n)}}(r);return n.set(r,i),i}(e)}function bn(e,t,n){let r=n,i=!1;return _n(e,function(e){if(i)return!1;let n=t(e);void 0!==n&&(i=!0,r=n)}),r}function Tn(e){if(e.type===ln&&e.break||e.type===pn&&e.hard||e.type===gn)return!0}function Rn(e){if(e.length>0){let t=vn(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function xn(e){return e.type!==pn||e.hard?e.type===cn?e.flatContents:e:e.soft?"":" "}function wn(e){for(e=[...e];e.length>=2&&vn(!1,e,-2).type===pn&&vn(!1,e,-1).type===gn;)e.length-=2;if(e.length>0){let t=Fn(vn(!1,e,-1));e[e.length-1]=t}return e}function Fn(e){switch(Cn(e)){case sn:case hn:case ln:case dn:case mn:{let t=Fn(e.contents);return{...e,contents:t}}case cn:return{...e,breakContents:Fn(e.breakContents),flatContents:Fn(e.flatContents)};case un:return{...e,parts:wn(e.parts)};case nn:return wn(e);case tn:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return tfunction(e){switch(Cn(e)){case un:if(e.parts.every(e=>""===e))return"";break;case ln:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===ln&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case on:case sn:case hn:case dn:if(!e.contents)return"";break;case cn:if(!e.flatContents&&!e.breakContents)return"";break;case nn:{let t=[];for(let n of e){if(!n)continue;let[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof vn(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case tn:case rn:case an:case fn:case pn:case mn:case gn:break;default:throw new Sn(e)}return e}(e))}(e))}function Ln(e){if(e.type===pn)return!0}function On(e,t){return e.type===mn?{...e,contents:t(e.contents)}:t(e)}var In=()=>{},kn=In,Mn=In,Pn=In;function Bn(e){return kn(e),{type:sn,contents:e}}function Un(e,t){return kn(t),{type:on,contents:t,n:e}}function $n(e,t={}){return kn(e),Mn(t.expandedStates,!0),{type:ln,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Gn(e){return kn(e),{type:dn,contents:e}}var Vn={type:fn},Wn={type:gn},Hn={type:an},jn={type:pn,hard:!0},zn={type:pn,hard:!0,literal:!0},Xn={type:pn},Kn={type:pn,soft:!0},Yn=[jn,Wn],qn=[zn,Wn],Qn={type:rn};function Zn(e,t){kn(e),Mn(t);let n=[];for(let r=0;r0){for(let e=0;e!(function(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}(e)||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e)),nr=/[^\x20-\x7F]/u,rr=function(e){if(!e)return 0;if(!nr.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(let n of e){let e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=tr(e)?1:2)}return t},ir=Symbol("MODE_BREAK"),sr=Symbol("MODE_FLAT"),or=Symbol("cursor"),ar=Symbol("DOC_FILL_PRINTED_LENGTH");function lr(e,t){return cr(e,{type:"indent"},t)}function ur(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?cr(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:cr(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function cr(e,t,n){let r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t],i="",s=0,o=0,a=0;for(let e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function hr(e){let t=0,n=0,r=e.length;e:for(;r--;){let i=e[r];if(i!==or)for(let n=i.length-1;n>=0;n--){let s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(or);return t}function dr(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length,a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}let{mode:e,doc:u}=a.pop(),c=Cn(u);switch(c){case tn:l.push(u),n-=rr(u);break;case nn:case un:{let t=c===nn?u:u.parts,n=u[ar]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case sn:case on:case hn:case mn:a.push({mode:e,doc:u.contents});break;case an:n+=hr(l);break;case ln:{if(s&&u.break)return!1;let t=u.break?ir:e,n=u.expandedStates&&t===ir?vn(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case cn:{let t=(u.groupId?i[u.groupId]||sr:e)===ir?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case pn:if(e===ir||u.hard)return!0;u.soft||(l.push(" "),n--);break;case dn:r=!0;break;case fn:if(r)return!1}}return!1}function fr(e,t){let n={},r=t.printWidth,i=Jt(t.endOfLine),s=0,o=[{ind:{value:"",length:0,queue:[]},mode:ir,doc:e}],a=[],l=!1,u=[],c=0;for(function(e){let t=new Set,n=[];_n(e,function(e){if(e.type===gn&&Rn(n),e.type===ln){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===ln&&n.pop().break&&Rn(n)},!0)}(e);o.length>0;){let{ind:e,mode:h,doc:d}=o.pop();switch(Cn(d)){case tn:{let e="\n"!==i?qt(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=rr(e));break}case nn:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case rn:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(or),c++;break;case sn:o.push({ind:lr(e,t),mode:h,doc:d.contents});break;case on:o.push({ind:ur(e,d.n,t),mode:h,doc:d.contents});break;case an:s-=hr(a);break;case ln:switch(h){case sr:if(!l){o.push({ind:e,mode:d.break?ir:sr,doc:d.contents});break}case ir:{l=!1;let t={ind:e,mode:sr,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&dr(t,o,i,a,n))o.push(t);else if(d.expandedStates){let t=vn(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:ir,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:ir,doc:t});break}{let t=d.expandedStates[r],s={ind:e,mode:sr,doc:t};if(dr(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:ir,doc:d.contents});break}}d.id&&(n[d.id]=vn(!1,o,-1).mode);break;case un:{let t=r-s,i=d[ar]??0,{parts:a}=d,l=a.length-i;if(0===l)break;let c=a[i+0],f=a[i+1],p={ind:e,mode:sr,doc:c},m={ind:e,mode:ir,doc:c},g=dr(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}let E={ind:e,mode:sr,doc:f},v={ind:e,mode:ir,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}let C=a[i+2],D={ind:e,mode:h,doc:{...d,[ar]:i+2}};dr({ind:e,mode:sr,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case cn:case hn:{let t=d.groupId?n[d.groupId]:h;if(t===ir){let t=d.type===cn?d.breakContents:d.negate?d.contents:Bn(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===sr){let t=d.type===cn?d.flatContents:d.negate?Bn(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case dn:u.push({ind:e,mode:h,doc:d.contents});break;case fn:u.length>0&&o.push({ind:e,mode:h,doc:jn});break;case pn:switch(h){case sr:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case ir:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=hr(a),a.push(i+e.value),s=e.length)}break;case mn:o.push({ind:e,mode:h,doc:d.contents});break;case gn:break;default:throw new Sn(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}let h=a.indexOf(or);if(-1!==h){let e=a.indexOf(or,h+1);if(-1===e)return{formatted:a.filter(e=>e!==or).join("")};let t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}var pr,mr,gr,Er=function(e,t,n=0){let r=0;for(let i=n;i=0;n-=2)if(!Array.isArray(t[n])&&--e<0)return n;return-1},gr=function*(){let{stack:e}=this;for(let t=e.length-3;t>=0;t-=2){let n=e[t];Array.isArray(n)||(yield n)}};var vr=class{constructor(e){((e,t)=>{t.has(e)?zt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,void 0)})(this,pr),this.stack=[e]}get key(){let{stack:e,siblings:t}=this;return vn(!1,e,null===t?-2:-4)??null}get index(){return null===this.siblings?null:vn(!1,this.stack,-2)}get node(){return vn(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return null!==this.siblings}get siblings(){let{stack:e}=this,t=vn(!1,e,-3);return Array.isArray(t)?t:null}get next(){let{siblings:e}=this;return null===e?null:e[this.index+1]}get previous(){let{siblings:e}=this;return null===e?null:e[this.index-1]}get isFirst(){return 0===this.index}get isLast(){let{siblings:e,index:t}=this;return null!==e&&t===e.length-1}get isRoot(){return 1===this.stack.length}get root(){return this.stack[0]}get ancestors(){return[...Kt(this,pr,gr).call(this)]}getName(){let{stack:e}=this,{length:t}=e;return t>1?vn(!1,e,-2):null}getValue(){return vn(!1,this.stack,-1)}getNode(e=0){let t=Kt(this,pr,mr).call(this,e);return-1===t?null:this.stack[t]}getParentNode(e=0){return this.getNode(e+1)}call(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{return e(this)}finally{n.length=r}}callParent(e,t=0){let n=Kt(this,pr,mr).call(this,t+1),r=this.stack.splice(n+1);try{return e(this)}finally{this.stack.push(...r)}}each(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{for(let t=0;t{n[r]=e(t,r,i)},...t),n}match(...e){let t=this.stack.length-1,n=null,r=this.stack[t--];for(let i of e){if(void 0===r)return!1;let e=null;if("number"==typeof n&&(e=n,n=this.stack[t--],r=this.stack[t--]),i&&!i(r,n,e))return!1;n=this.stack[t--],r=this.stack[t--]}return!0}findAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return t}hasAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return!0;return!1}},Cr=new Proxy(()=>{},{get:()=>Cr}),Dr=Cr;function*Sr(e,t){let{getVisitorKeys:n,filter:r=()=>!0}=t,i=e=>function(e){return null!==e&&"object"==typeof e}(e)&&r(e);for(let t of n(e)){let n=e[t];if(Array.isArray(n))for(let e of n)i(e)&&(yield e);else i(n)&&(yield n)}}function Ar(e){return(t,n,r)=>{let i=!(null==r||!r.backwards);if(!1===n)return!1;let{length:s}=t,o=n;for(;o>=0&&oObject.keys(e).filter(e=>!wr.has(e)),Nr=function(e){return e?t=>e(t,wr):Fr};function Lr(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=function(e){let t=e.type||e.kind||"(unknown type)",n=String(e.name||e.id&&("object"==typeof e.id?e.id.name:e.id)||e.key&&("object"==typeof e.key?e.key.name:e.key)||e.value&&("object"==typeof e.value?"":String(e.value))||e.operator||"");return n.length>20&&(n=n.slice(0,19)+"…"),t+(n?" "+n:"")}(e)}function Or(e,t){t.leading=!0,t.trailing=!1,Lr(e,t)}function Ir(e,t,n){t.leading=!1,t.trailing=!1,n&&(t.marker=n),Lr(e,t)}function kr(e,t){t.leading=!1,t.trailing=!0,Lr(e,t)}var Mr=new WeakMap;function Pr(e,t){if(Mr.has(e))return Mr.get(e);let{printer:{getCommentChildNodes:n,canAttachComment:r,getVisitorKeys:i},locStart:s,locEnd:o}=t;if(!r)return[];let a=((null==n?void 0:n(e,t))??[...Sr(e,{getVisitorKeys:Nr(i)})]).flatMap(e=>r(e)?[e]:Pr(e,t));return a.sort((e,t)=>s(e)-s(t)||o(e)-o(t)),Mr.set(e,a),a}function Br(e,t,n,r){let i,s,{locStart:o,locEnd:a}=n,l=o(t),u=a(t),c=Pr(e,n),h=0,d=c.length;for(;h>1,r=c[e],f=o(r),p=a(r);if(f<=l&&u<=p)return Br(r,t,n,r);if(p<=l)i=r,h=e+1;else{if(!(u<=f))throw new Error("Comment location overlaps with node location");s=r,d=e}}if("TemplateLiteral"===(null==r?void 0:r.type)){let{quasis:e}=r,o=Hr(e,t,n);i&&Hr(e,i,n)!==o&&(i=null),s&&Hr(e,s,n)!==o&&(s=null)}return{enclosingNode:r,precedingNode:i,followingNode:s}}var Ur=()=>!1,$r=e=>!/[\S\n\u2028\u2029]/u.test(e);function Gr(e,t,n,r){let{comment:i,precedingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=o(i);if(s)for(let t=r-1;t>=0;t--){let{comment:r,precedingNode:i}=n[t];if(i!==s||!$r(e.slice(a(r),l)))break;l=o(r)}return xr(e,l,{backwards:!0})}function Vr(e,t,n,r){let{comment:i,followingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=a(i);if(s)for(let t=r+1;t0;--s){let{comment:i,precedingNode:u,followingNode:c}=e[s-1];Dr.strictEqual(u,o),Dr.strictEqual(c,a);let h=t.originalText.slice(t.locEnd(i),l);if(!((null==(r=(n=t.printer).isGap)?void 0:r.call(n,h,t))??/^[\s(]*$/u.test(h)))break;l=t.locStart(i)}for(let[t,{comment:n}]of e.entries())t1&&e.comments.sort((e,n)=>t.locStart(e)-t.locStart(n));e.length=0}function Hr(e,t,n){let r=n.locStart(t)-1;for(let t=1;t"string"==typeof e||"function"==typeof e,choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>"string"==typeof e||"object"==typeof e,cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:"Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.",cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:"Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.",cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function qr({plugins:e=[],showDeprecated:t=!1}={}){let n=e.flatMap(e=>e.languages??[]),r=[];for(let i of function(e){let t=[];for(let[n,r]of Object.entries(e)){let e={name:n,...r};Array.isArray(e.default)&&(e.default=vn(!1,e.default,-1).value),t.push(e)}return t}(Object.assign({},...e.map(({options:e})=>e),Yr)))!t&&i.deprecated||(Array.isArray(i.choices)&&(t||(i.choices=i.choices.filter(e=>!e.deprecated)),"parser"===i.name&&(i.choices=[...i.choices,...Qr(i.choices,n,e)])),i.pluginDefaults=Object.fromEntries(e.filter(e=>{var t;return void 0!==(null==(t=e.defaultOptions)?void 0:t[i.name])}).map(e=>[e.name,e.defaultOptions[i.name]])),r.push(i));return{languages:n,options:r}}function*Qr(e,t,n){let r=new Set(e.map(e=>e.value));for(let e of t)if(e.parsers)for(let t of e.parsers)if(!r.has(t)){r.add(t);let i=n.find(e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t)),s=e.name;null!=i&&i.name&&(s+=` (plugin: ${i.name})`),yield{value:t,description:s}}}var Zr,Jr,ei,ti,ni,ri="windows"===(null==(Zr=globalThis.Deno)?void 0:Zr.build.os)||(null==(ei=null==(Jr=globalThis.navigator)?void 0:Jr.platform)?void 0:ei.startsWith("Win"))||(null==(ni=null==(ti=globalThis.process)?void 0:ti.platform)?void 0:ni.startsWith("win"))||!1;function ii(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function si(e,t){if(!t)return;let n=(e=>String(e).split(/[/\\]/u).pop())(t).toLowerCase();return e.find(({filenames:e})=>null==e?void 0:e.some(e=>e.toLowerCase()===n))??e.find(({extensions:e})=>null==e?void 0:e.some(e=>n.endsWith(e)))}function oi(e,t){if(t){if(String(t).startsWith("file:"))try{t=function(e){return ri?function(e){e=ii(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return""!==e.hostname&&(t=`\\\\${e.hostname}${t}`),t}(e):function(e){return e=ii(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}(e)}(t)}catch{return}if("string"==typeof t)return e.find(({isSupported:e})=>null==e?void 0:e({filepath:t}))}}var ai=function(e,t){let n=((e,t)=>{if(!e||null!=t)return t.toReversed||!Array.isArray(t)?t.toReversed():[...t].reverse()})(!1,e.plugins).flatMap(e=>e.languages??[]),r=function(e,t){if(t)return e.find(({name:e})=>e.toLowerCase()===t)??e.find(({aliases:e})=>null==e?void 0:e.includes(t))??e.find(({extensions:e})=>null==e?void 0:e.includes(`.${t}`))}(n,t.language)??si(n,t.physicalFile)??si(n,t.file)??oi(n,t.physicalFile)??oi(n,t.file)??void t.physicalFile;return null==r?void 0:r.parsers[0]},li={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(e=>li.value(e)).join(", ")}]`;let t=Object.keys(e);return 0===t.length?"{}":`{ ${t.map(t=>`${li.key(t)}: ${li.value(e[t])}`).join(", ")} }`},pair:({key:e,value:t})=>li.value({[e]:t})},ui=new Proxy(String,{get:()=>ui}),ci=ui,hi=Symbol.for("vnopts.VALUE_NOT_EXIST"),di=Symbol.for("vnopts.VALUE_UNCHANGED"),fi=" ".repeat(2);function pi(e,t,n,r){return[`Invalid ${ci.red(r.key(e))} value.`,`Expected ${ci.blue(n)},`,`but received ${t===hi?ci.gray("nothing"):ci.red(r.value(t))}.`].join(" ")}function mi({text:e,list:t},n){let r=[];return e&&r.push(`- ${ci.blue(e)}`),t&&r.push([`- ${ci.blue(t.title)}:`].concat(t.values.map(e=>mi(e,n-fi.length).replace(/^|\n/g,`$&${fi}`))).join("\n")),gi(r,n)}function gi(e,t){if(1===e.length)return e[0];let[n,r]=e,[i,s]=e.map(e=>e.split("\n",1)[0].length);return i>t&&i>s?r:n}var Ei=[],vi=[],Ci=(e,t,{descriptor:n,logger:r,schemas:i})=>{let s=[`Ignored unknown option ${ci.yellow(n.pair({key:e,value:t}))}.`],o=Object.keys(i).sort().find(t=>function(e,t){if(e===t)return 0;let n=e;e.length>t.length&&(e=t,t=n);let r=e.length,i=t.length;for(;r>0&&e.charCodeAt(~-r)===t.charCodeAt(~-i);)r--,i--;let s=0;for(;sa?u>a?a+1:u:u>l?l+1:u;return a}(e,t)<3);o&&s.push(`Did you mean ${ci.blue(n.key(o))}?`),r.warn(s.join(" "))},Di=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"],Si=class{static create(e){return function(e,t){let n=new e(t),r=Object.create(n);for(let e of Di)e in t&&(r[e]=Ai(t[e],n,Si.prototype[e].length));return r}(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,t){return!1}deprecated(e,t){return!1}forward(e,t){}redirect(e,t){}overlap(e,t,n){return e}preprocess(e,t){return e}postprocess(e,t){return di}};function Ai(e,t,n){return"function"==typeof e?(...r)=>e(...r.slice(0,n-1),t,...r.slice(n-1)):()=>e}var _i=class extends Si{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},yi=class extends Si{expected(){return"anything"}validate(){return!0}},bi=class extends Si{constructor({valueSchema:e,name:t=e.name,...n}){super({...n,name:t}),this._valueSchema=e}expected(e){let{text:t,list:n}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:t&&`an array of ${t}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(e,t){if(!Array.isArray(e))return!1;let n=[];for(let r of e){let e=t.normalizeValidateResult(this._valueSchema.validate(r,t),r);!0!==e&&n.push(e.value)}return 0===n.length||{value:n}}deprecated(e,t){let n=[];for(let r of e){let e=t.normalizeDeprecatedResult(this._valueSchema.deprecated(r,t),r);!1!==e&&n.push(...e.map(({value:e})=>({value:[e]})))}return n}forward(e,t){let n=[];for(let r of e){let e=t.normalizeForwardResult(this._valueSchema.forward(r,t),r);n.push(...e.map(Ti))}return n}redirect(e,t){let n=[],r=[];for(let i of e){let e=t.normalizeRedirectResult(this._valueSchema.redirect(i,t),i);"remain"in e&&n.push(e.remain),r.push(...e.redirect.map(Ti))}return 0===n.length?{redirect:r}:{redirect:r,remain:n}}overlap(e,t){return e.concat(t)}};function Ti({from:e,to:t}){return{from:[e],to:t}}var Ri=class extends Si{expected(){return"true or false"}validate(e){return"boolean"==typeof e}};function xi(e,t){let n=Object.create(null);for(let r of e){let e=r[t];if(n[e])throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n[e]=r}return n}function wi(e,t){if(e===t)return 0;let n=typeof e,r=typeof t,i=["undefined","object","boolean","number","string"];return n!==r?i.indexOf(n)-i.indexOf(r):"string"!==n?Number(e)-Number(t):e.localeCompare(t)}function Fi(e){return void 0===e?{}:e}function Ni(e){if("string"==typeof e)return{text:e};let{text:t,list:n}=e;return function(e){if(!e)throw new Error("Unexpected `expected` result, there should be at least one field.")}(void 0!==(t||n)),n?{text:t,list:{title:n.title,values:n.values.map(Ni)}}:{text:t}}function Li(e,t){return!0===e||(!1===e?{value:t}:e)}function Oi(e,t,n=!1){return!1!==e&&(!0===e?!!n||[{value:t}]:"value"in e?[e]:0!==e.length&&e)}function Ii(e,t){return"string"==typeof e||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function ki(e,t){return void 0===e?[]:Array.isArray(e)?e.map(e=>Ii(e,t)):[Ii(e,t)]}function Mi(e,t){let n=ki("object"==typeof e&&"redirect"in e?e.redirect:e,t);return 0===n.length?{remain:t,redirect:n}:"object"==typeof e&&"remain"in e?{remain:e.remain,redirect:n}:{redirect:n}}var Pi,Bi=class extends Si{constructor(e){super(e),this._choices=function(e,t){let n=new Map;for(let r of e){let e=r[t];if(n.has(e))throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n.set(e,r)}return n}(e.choices.map(e=>e&&"object"==typeof e?e:{value:e}),"value")}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(e=>this._choices.get(e)).filter(({hidden:e})=>!e).map(e=>e.value).sort(wi).map(e.value),n=t.slice(0,-2),r=t.slice(-2);return{text:n.concat(r.join(" or ")).join(", "),list:{title:"one of the following values",values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return!(!t||!t.deprecated)&&{value:e}}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},Ui=class extends Si{expected(){return"a number"}validate(e,t){return"number"==typeof e}},$i=class extends Ui{expected(){return"an integer"}validate(e,t){return!0===t.normalizeValidateResult(super.validate(e,t),e)&&function(e){return e===Math.floor(e)}(e)}},Gi=class extends Si{expected(){return"a string"}validate(e){return"string"==typeof e}},Vi=li,Wi=Ci,Hi=(e,t,n)=>{let{text:r,list:i}=n.normalizeExpectedResult(n.schemas[e].expected(n)),s=[];return r&&s.push(pi(e,t,r,n.descriptor)),i&&s.push([pi(e,t,i.title,n.descriptor)].concat(i.values.map(e=>mi(e,n.loggerPrintWidth))).join("\n")),gi(s,n.loggerPrintWidth)},ji=(e,t,{descriptor:n})=>{let r=[`${ci.yellow("string"==typeof e?n.key(e):n.pair(e))} is deprecated`];return t&&r.push(`we now treat it as ${ci.blue("string"==typeof t?n.key(t):n.pair(t))}`),r.join("; ")+"."},zi=class{constructor(e,t){let{logger:n=console,loggerPrintWidth:r=80,descriptor:i=Vi,unknown:s=Wi,invalid:o=Hi,deprecated:a=ji,missing:l=()=>!1,required:u=()=>!1,preprocess:c=e=>e,postprocess:h=()=>di}=t||{};this._utils={descriptor:i,logger:n||{warn:()=>{}},loggerPrintWidth:r,schemas:xi(e,"name"),normalizeDefaultResult:Fi,normalizeExpectedResult:Ni,normalizeDeprecatedResult:Oi,normalizeForwardResult:ki,normalizeRedirectResult:Mi,normalizeValidateResult:Li},this._unknownHandler=s,this._invalidHandler=function(e){return(...t)=>{let n=e(...t);return"string"==typeof n?new Error(n):n}}(o),this._deprecatedHandler=a,this._identifyMissing=(e,t)=>!(e in t)||l(e,t),this._identifyRequired=u,this._preprocess=c,this._postprocess=h,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=function(){let e=Object.create(null);return t=>{let n=JSON.stringify(t);return!!e[n]||(e[n]=!0,!1)}}()}normalize(e){let t={},n=[this._preprocess(e,this._utils)],r=()=>{for(;0!==n.length;){let e=n.shift(),r=this._applyNormalization(e,t);n.push(...r)}};r();for(let e of Object.keys(this._utils.schemas)){let r=this._utils.schemas[e];if(!(e in t)){let t=Fi(r.default(this._utils));"value"in t&&n.push({[e]:t.value})}}r();for(let e of Object.keys(this._utils.schemas)){if(!(e in t))continue;let n=this._utils.schemas[e],r=t[e],i=n.postprocess(r,this._utils);i!==di&&(this._applyValidation(i,e,n),t[e]=i)}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let n=[],{knownKeys:r,unknownKeys:i}=this._partitionOptionKeys(e);for(let i of r){let r=this._utils.schemas[i],s=r.preprocess(e[i],this._utils);this._applyValidation(s,i,r);let o=({from:e,to:t})=>{n.push("string"==typeof t?{[t]:e}:{[t.key]:t.value})},a=({value:e,redirectTo:t})=>{let n=Oi(r.deprecated(e,this._utils),s,!0);if(!1!==n)if(!0===n)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,t,this._utils));else for(let{value:e}of n){let n={key:i,value:e};if(!this._hasDeprecationWarned(n)){let r="string"==typeof t?{key:t,value:e}:t;this._utils.logger.warn(this._deprecatedHandler(n,r,this._utils))}}};ki(r.forward(s,this._utils),s).forEach(o);let l=Mi(r.redirect(s,this._utils),s);if(l.redirect.forEach(o),"remain"in l){let e=l.remain;t[i]=i in t?r.overlap(t[i],e,this._utils):e,a({value:e})}for(let{from:e,to:t}of l.redirect)a({value:e,redirectTo:t})}for(let r of i){let i=e[r];this._applyUnknownHandler(r,i,t,(e,t)=>{n.push({[e]:t})})}return n}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,hi,this._utils)}_partitionOptionKeys(e){let[t,n]=function(e,t){let n=[],r=[];for(let i of e)t(i)?n.push(i):r.push(i);return[n,r]}(Object.keys(e).filter(t=>!this._identifyMissing(t,e)),e=>e in this._utils.schemas);return{knownKeys:t,unknownKeys:n}}_applyValidation(e,t,n){let r=Li(n.validate(e,this._utils),e);if(!0!==r)throw this._invalidHandler(t,r.value,this._utils)}_applyUnknownHandler(e,t,n,r){let i=this._unknownHandler(e,t,this._utils);if(i)for(let e of Object.keys(i)){if(this._identifyMissing(e,i))continue;let t=i[e];e in this._utils.schemas?r(e,t):n[e]=t}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==di){if(t.delete)for(let n of t.delete)delete e[n];if(t.override){let{knownKeys:n,unknownKeys:r}=this._partitionOptionKeys(t.override);for(let r of n){let n=t.override[r];this._applyValidation(n,r,this._utils.schemas[r]),e[r]=n}for(let n of r){let r=t.override[n];this._applyUnknownHandler(n,r,e,(t,n)=>{let r=this._utils.schemas[t];this._applyValidation(n,t,r),e[t]=n})}}}}};function Xi(e,{isCLI:t,optionInfos:n,FlagSchema:r}){let i,{name:s}=e,o={name:s},a={};switch(e.type){case"int":i=$i,t&&(o.preprocess=Number);break;case"string":case"path":i=Gi;break;case"choice":i=Bi,o.choices=e.choices.map(t=>null!=t&&t.redirect?{...t,redirect:{to:{key:e.name,value:t.redirect}}}:t);break;case"boolean":i=Ri;break;case"flag":i=r,o.flags=n.flatMap(e=>[e.alias,e.description&&e.name,e.oppositeDescription&&`no-${e.name}`].filter(Boolean));break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?o.validate=(t,n,r)=>e.exception(t)||n.validate(t,r):o.validate=(e,t,n)=>void 0===e||t.validate(e,n),e.redirect&&(a.redirect=t=>t?{to:"string"==typeof e.redirect?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(a.deprecated=!0),t&&!e.array){let e=o.preprocess||(e=>e);o.preprocess=(t,n,r)=>n.preprocess(e(Array.isArray(t)?vn(!1,t,-1):t),r)}return e.array?bi.create({...t?{preprocess:e=>Array.isArray(e)?e:[e]}:{},...a,valueSchema:i.create(o)}):i.create({...o,...a})}var Ki=(e,t,n)=>{if(!e||null!=t){if(t.findLast)return t.findLast(n);for(let e=t.length-1;e>=0;e--){let r=t[e];if(n(r,e,t))return r}}};function Yi(e,t){if(!t)throw new Error("parserName is required.");let n=Ki(!1,e,e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t));if(n)return n;let r=`Couldn't resolve parser "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}function qi({plugins:e,parser:t}){return Qi(Yi(e,t),t)}function Qi(e,t){let n=e.parsers[t];return"function"==typeof n?n():n}var Zi={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null},Ji=async function(e,t={}){var n;let r={...e};if(!r.parser){if(!r.filepath)throw new Kr("No parser and no file path given, couldn't infer a parser.");if(r.parser=ai(r,{physicalFile:r.filepath}),!r.parser)throw new Kr(`No parser could be inferred for file "${r.filepath}".`)}let i=qr({plugins:e.plugins,showDeprecated:!0}).options,s={...Zi,...Object.fromEntries(i.filter(e=>void 0!==e.default).map(e=>[e.name,e.default]))},o=Yi(r.plugins,r.parser),a=await Qi(o,r.parser);r.astFormat=a.astFormat,r.locEnd=a.locEnd,r.locStart=a.locStart;let l=null!=(n=o.printers)&&n[a.astFormat]?o:function(e,t){if(!t)throw new Error("astFormat is required.");let n=Ki(!1,e,e=>e.printers&&Object.prototype.hasOwnProperty.call(e.printers,t));if(n)return n;let r=`Couldn't find plugin for AST format "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}(r.plugins,a.astFormat),u=await function(e,t){let n=e.printers[t];return"function"==typeof n?n():n}(l,a.astFormat);r.printer=u;let c={...s,...l.defaultOptions?Object.fromEntries(Object.entries(l.defaultOptions).filter(([,e])=>void 0!==e)):{}};for(let[e,t]of Object.entries(c))(null===r[e]||void 0===r[e])&&(r[e]=t);return"json"===r.parser&&(r.trailingComma="none"),function(e,t,{logger:n=!1,isCLI:r=!1,passThrough:i=!1,FlagSchema:s,descriptor:o}={}){if(r){if(!s)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=li;let a=i?Array.isArray(i)?(e,t)=>i.includes(e)?{[e]:t}:void 0:(e,t)=>({[e]:t}):(e,t,n)=>{let{_:r,...i}=n.schemas;return Ci(e,t,{...n,schemas:i})},l=function(e,{isCLI:t,FlagSchema:n}){let r=[];t&&r.push(yi.create({name:"_"}));for(let i of e)r.push(Xi(i,{isCLI:t,optionInfos:e,FlagSchema:n})),i.alias&&t&&r.push(_i.create({name:i.alias,sourceName:i.name}));return r}(t,{isCLI:r,FlagSchema:s}),u=new zi(l,{logger:n,unknown:a,descriptor:o}),c=!1!==n;c&&Pi&&(u._hasDeprecationWarned=Pi);let h=u.normalize(e);return c&&(Pi=u._hasDeprecationWarned),h}(r,i,{passThrough:Object.keys(Zi),...t})},es=((e,t,n)=>(n=null!=e?$t(Ht(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of Wt(t))!jt.call(e,n)&&void 0!==n&&Gt(e,n,{get:()=>t[n],enumerable:!(r=Vt(t,n))||r.enumerable});return e})(Gt(n,"default",{value:e,enumerable:!0}),e)))(Yt()),ts=async function(e,t){let n,r=await qi(t),i=r.preprocess?r.preprocess(e,t):e;t.originalText=i;try{n=await r.parse(i,t,t)}catch(t){!function(e,t){let{loc:n}=e;if(n){let r=(0,es.codeFrameColumns)(t,n,{highlightCode:!0});throw e.message+="\n"+r,e.codeFrame=r,e}throw e}(t,e)}return{text:i,ast:n}};async function ns(e,t){({ast:e}=await is(e,t));let n=new Map,r=new vr(e),i=()=>{},s=new Map;await async function(e,t,n,r,i){let{embeddedLanguageFormatting:s,printer:{embed:o,hasPrettierIgnore:a=()=>!1,getVisitorKeys:l}}=n;if(!o||"auto"!==s)return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let u=Nr(o.getVisitorKeys??l),c=[];!function t(){let{node:r}=e;if(null===r||"object"!=typeof r||a(e))return;for(let n of u(r))Array.isArray(r[n])?e.each(t,n):e.call(t,n);let s=o(e,n);if(s){if("function"==typeof s)return void c.push({print:s,node:r,pathStack:[...e.stack]});i.set(r,s)}}();let h=e.stack;for(let{print:r,node:s,pathStack:o}of c)try{e.stack=o;let a=await r(d,t,e,n);a&&i.set(s,a)}catch(e){if(globalThis.PRETTIER_DEBUG)throw e}function d(e,t){return async function(e,t,n,r){let i=await Ji({...n,...t,parentParser:n.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:s}=await ts(e,i);return Nn(await r(s,i))}(e,t,n,r)}e.stack=h}(r,a,t,ns,s);let o=await rs(r,t,a,void 0,s);if(function(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:n}=e;for(let e of t){if(!e.printed&&!n.has(e))throw new Error('Comment "'+e.value.trim()+'" was not printed. Please report this error!');delete e.printed}}(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return[Qn,o];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[o,Qn]}return o;function a(e,t){return void 0===e||e===r?l(t):Array.isArray(e)?r.call(()=>l(t),...e):r.call(()=>l(t),e)}function l(e){i(r);let o=r.node;if(null==o)return"";let l=o&&"object"==typeof o&&void 0===e;if(l&&n.has(o))return n.get(o);let u=rs(r,t,a,e,s);return l&&n.set(o,u),u}}function rs(e,t,n,r,i){var s;let o,{node:a}=e,{printer:l}=t;switch(o=null!=(s=l.hasPrettierIgnore)&&s.call(l,e)?function(e,t){let{originalText:n,[Symbol.for("comments")]:r,locStart:i,locEnd:s,[Symbol.for("printedComments")]:o}=t,{node:a}=e,l=i(a),u=s(a);for(let e of r)i(e)>=l&&s(e)<=u&&o.add(e);return n.slice(l,u)}(e,t):i.has(a)?i.get(a):l.print(e,t,n,r),a){case t.cursorNode:o=On(o,e=>[Qn,e,Qn]);break;case t.nodeBeforeCursor:o=On(o,e=>[e,Qn]);break;case t.nodeAfterCursor:o=On(o,e=>[Qn,e])}return l.printComment&&(!l.willPrintOwnComments||!l.willPrintOwnComments(e,t))&&(o=function(e,t,n){let{leading:r,trailing:i}=function(e,t){let n=e.node;if(!n)return{};let r=t[Symbol.for("printedComments")];if(0===(n.comments||[]).filter(e=>!r.has(e)).length)return{leading:"",trailing:""};let i,s=[],o=[];return e.each(()=>{let n=e.node;if(null!=r&&r.has(n))return;let{leading:a,trailing:l}=n;a?s.push(function(e,t){var n;let r=e.node,i=[zr(e,t)],{printer:s,originalText:o,locStart:a,locEnd:l}=t;if(null==(n=s.isBlockComment)?void 0:n.call(s,r)){let e=xr(o,l(r))?xr(o,a(r),{backwards:!0})?Yn:Xn:" ";i.push(e)}else i.push(Yn);let u=Rr(o,yr(o,l(r)));return!1!==u&&xr(o,u)&&i.push(Yn),i}(e,t)):l&&(i=function(e,t,n){var r;let i=e.node,s=zr(e,t),{printer:o,originalText:a,locStart:l}=t,u=null==(r=o.isBlockComment)?void 0:r.call(o,i);if(null!=n&&n.hasLineSuffix&&(null==n||!n.isBlock)||xr(a,l(i),{backwards:!0})){let e=jr(a,l(i));return{doc:Gn([Yn,e?Yn:"",s]),isBlock:u,hasLineSuffix:!0}}return!u||null!=n&&n.hasLineSuffix?{doc:[Gn([" ",s]),Wn],isBlock:u,hasLineSuffix:!0}:{doc:[" ",s],isBlock:u,hasLineSuffix:!1}}(e,t,i),o.push(i.doc))},"comments"),{leading:s,trailing:o}}(e,n);return r||i?On(t,e=>[r,e,i]):t}(e,o,t)),o}async function is(e,t){let n=e.comments??[];t[Symbol.for("comments")]=n,t[Symbol.for("printedComments")]=new Set,function(e,t){let{comments:n}=e;if(delete e.comments,!function(e){return Array.isArray(e)&&e.length>0}(n)||!t.printer.canAttachComment)return;let r=[],{printer:{experimentalFeatures:{avoidAstMutation:i=!1}={},handleComments:s={}},originalText:o}=t,{ownLine:a=Ur,endOfLine:l=Ur,remaining:u=Ur}=s,c=n.map((r,i)=>({...Br(e,r,t),comment:r,text:o,options:t,ast:e,isLastComment:n.length-1===i}));for(let[e,t]of c.entries()){let n,{comment:s,precedingNode:o,enclosingNode:h,followingNode:d,text:f,options:p,ast:m,isLastComment:g}=t;if(i?n=[t]:(s.enclosingNode=h,s.precedingNode=o,s.followingNode=d,n=[s,f,p,m,g]),Gr(f,p,c,e))s.placement="ownLine",a(...n)||(d?Or(d,s):o?kr(o,s):Ir(h||m,s));else if(Vr(f,p,c,e))s.placement="endOfLine",l(...n)||(o?kr(o,s):d?Or(d,s):Ir(h||m,s));else if(s.placement="remaining",!u(...n))if(o&&d){let e=r.length;e>0&&r[e-1].followingNode!==d&&Wr(r,p),r.push(t)}else o?kr(o,s):d?Or(d,s):Ir(h||m,s)}if(Wr(r,t),!i)for(let e of n)delete e.precedingNode,delete e.enclosingNode,delete e.followingNode}(e,t);let{printer:{preprocess:r}}=t;return{ast:e=r?await r(e,t):e,comments:n}}var ss=function(e,t){let{cursorOffset:n,locStart:r,locEnd:i}=t,s=Nr(t.printer.getVisitorKeys),o=e=>r(e)<=n&&i(e)>=n,a=e,l=[e];for(let t of function*(e,t){let n=[e];for(let e=0;e0&&(void 0===u||void 0===c);){a=l.pop();let e=void 0!==u,t=void 0!==c;for(let o of Sr(a,{getVisitorKeys:s})){if(!e){let e=i(o);e<=n&&e>h&&(u=o,h=e)}if(!t){let e=r(o);e>=n&&e{if(!e||null!=t){if(t.findLastIndex)return t.findLastIndex(n);for(let e=t.length-1;e>=0;e--)if(n(t[e],e,t))return e;return-1}})(!1,e,e=>"Program"!==e.type&&"File"!==e.type);return-1===t?e:e.slice(0,t+1)}function as(e,t,n,r,i=[],s){let{locStart:o,locEnd:a}=n,l=o(e),u=a(e);if(!(t>u||t=0&&(t={...t,...ss(r,t)});let s=await ns(r,t);n>0&&(s=Jn([Yn,s],n,t.tabWidth));let o=fr(s,t);if(n>0){let e=o.formatted.trim();void 0!==o.cursorNodeStart&&(o.cursorNodeStart-=o.formatted.indexOf(e),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>e.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=e+Jt(t.endOfLine)}let a=t[Symbol.for("comments")];if(t.cursorOffset>=0){let e,n,r,s;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&o.cursorNodeText)if(r=o.cursorNodeStart,s=o.cursorNodeText,t.cursorNode)e=t.locStart(t.cursorNode),n=i.slice(e,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");e=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let r=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):i.length;n=i.slice(e,r)}else e=0,n=i,r=0,s=o.formatted;let l=t.cursorOffset-e;if(n===s)return{formatted:o.formatted,cursorOffset:r+l,comments:a};let u=n.split("");u.splice(l,0,hs);let c=function(e,t){return Zt.diff(e,t,void 0)}(u,s.split("")),h=r;for(let e of c)if(e.removed){if(e.value.includes(hs))break}else h+=e.count;return{formatted:o.formatted,cursorOffset:h,comments:a}}return{formatted:o.formatted,cursorOffset:-1,comments:a}}function fs(e,t,n){return"number"!=typeof t||Number.isNaN(t)||t<0||t>e.length?n:t}function ps(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i}=t;return n=fs(e,n,-1),r=fs(e,r,0),i=fs(e,i,e.length),{...t,cursorOffset:n,rangeStart:r,rangeEnd:i}}function ms(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s}=ps(e,t),o="\ufeff"===e.charAt(0);if(o&&(e=e.slice(1),n--,r--,i--),"auto"===s&&(s=function(e){let t=e.indexOf("\r");return-1!==t?"\n"===e.charAt(t+1)?"crlf":"cr":"lf"}(e)),e.includes("\r")){let t=t=>en(e.slice(0,Math.max(t,0)),"\r\n");n-=t(n),r-=t(r),i-=t(i),e=function(e){return qt(!1,e,/\r\n?/gu,"\n")}(e)}return{hasBOM:o,text:e,options:ps(e,{...t,cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s})}}async function gs(e,t){let n=await qi(t);return!n.hasPragma||n.hasPragma(e)}async function Es(e,t){let n,{hasBOM:r,text:i,options:s}=ms(e,await Ji(t));return s.rangeStart>=s.rangeEnd&&""!==i||s.requirePragma&&!await gs(i,s)||s.checkIgnorePragma&&await async function(e,t){var n;let r=await qi(t);return null==(n=r.hasIgnorePragma)?void 0:n.call(r,e)}(i,s)?{formatted:e,cursorOffset:t.cursorOffset,comments:[]}:(s.rangeStart>0||s.rangeEndr);let a=e.slice(r,i).search(/\S/u),l=-1===a;if(!l)for(r+=a;i>r&&!/\S/u.test(e[i-1]);--i);let u,c,h=as(n,r,t,(e,n)=>cs(t,e,n),[],"rangeStart"),d=l?h:as(n,i,t,e=>cs(t,e),[],"rangeEnd");if(!h||!d)return{rangeStart:0,rangeEnd:0};if((({parser:e})=>"json"===e||"json5"===e||"jsonc"===e||"json-stringify"===e)(t)){let e=function(e,t){let n=[e.node,...e.parentNodes],r=new Set([t.node,...t.parentNodes]);return n.find(e=>ls.has(e.type)&&r.has(e))}(h,d);u=e,c=e}else({startNode:u,endNode:c}=function(e,t,{locStart:n,locEnd:r}){let i=e.node,s=t.node;if(i===s)return{startNode:i,endNode:s};let o=n(e.node);for(let e of os(t.parentNodes)){if(!(n(e)>=o))break;s=e}let a=r(t.node);for(let t of os(e.parentNodes)){if(!(r(t)<=a))break;if(i=t,i===s)break}return{startNode:i,endNode:s}}(h,d,t));return{rangeStart:Math.min(s(u),s(c)),rangeEnd:Math.max(o(u),o(c))}}(r,t,n),o=r.slice(i,s),a=Math.min(i,r.lastIndexOf("\n",i)+1),l=r.slice(a,i).match(/^\s*/u)[0],u=Er(l,t.tabWidth),c=await ds(o,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>i&&t.cursorOffset<=s?t.cursorOffset-i:-1,endOfLine:"lf"},u),h=c.formatted.trimEnd(),{cursorOffset:d}=t;d>s?d+=h.length-o.length:c.cursorOffset>=0&&(d=c.cursorOffset+i);let f=r.slice(0,i)+h+r.slice(s);if("lf"!==t.endOfLine){let e=Jt(t.endOfLine);d>=0&&"\r\n"===e&&(d+=en(f.slice(0,d),"\n")),f=qt(!1,f,"\n",e)}return{formatted:f,cursorOffset:d,comments:c.comments}}(i,s):(!s.requirePragma&&s.insertPragma&&s.printer.insertPragma&&!await gs(i,s)&&(i=s.printer.insertPragma(i)),n=await ds(i,s)),r&&(n.formatted="\ufeff"+n.formatted,n.cursorOffset>=0&&n.cursorOffset++),n)}var vs={};Xt(vs,{builders:()=>Cs,printer:()=>Ds,utils:()=>Ss});var Cs={join:Zn,line:Xn,softline:Kn,hardline:Yn,literalline:qn,group:$n,conditionalGroup:function(e,t){return $n(e[0],{...t,expandedStates:e})},fill:function(e){return Pn(e),{type:un,parts:e}},lineSuffix:Gn,lineSuffixBoundary:Vn,cursor:Qn,breakParent:Wn,ifBreak:function(e,t="",n={}){return kn(e),""!==t&&kn(t),{type:cn,breakContents:e,flatContents:t,groupId:n.groupId}},trim:Hn,indent:Bn,indentIfBreak:function(e,t){return kn(e),{type:hn,contents:e,groupId:t.groupId,negate:t.negate}},align:Un,addAlignmentToDoc:Jn,markAsRoot:function(e){return Un({type:"root"},e)},dedentToRoot:function(e){return Un(Number.NEGATIVE_INFINITY,e)},dedent:function(e){return Un(-1,e)},hardlineWithoutBreakParent:jn,literallineWithoutBreakParent:zn,label:function(e,t){return kn(t),e?{type:mn,label:e,contents:t}:t},concat:e=>e},Ds={printDocToString:fr},Ss={willBreak:function(e){return bn(e,Tn,!1)},traverseDoc:_n,findInDoc:bn,mapDoc:yn,removeLines:function(e){return yn(e,xn)},stripTrailingHardline:Nn,replaceEndOfLine:function(e,t=qn){return yn(e,e=>"string"==typeof e?Zn(t,e.split("\n")):e)},canBreak:function(e){return bn(e,Ln,!1)}},As="3.6.2",_s={};Xt(_s,{addDanglingComment:()=>Ir,addLeadingComment:()=>Or,addTrailingComment:()=>kr,getAlignmentSize:()=>Er,getIndentSize:()=>xs,getMaxContinuousCount:()=>ws,getNextNonSpaceNonCommentCharacter:()=>Fs,getNextNonSpaceNonCommentCharacterIndex:()=>Ms,getPreferredQuote:()=>Ls,getStringWidth:()=>rr,hasNewline:()=>xr,hasNewlineInRange:()=>Os,hasSpaces:()=>Is,isNextLineEmpty:()=>Bs,isNextLineEmptyAfterIndex:()=>Rs,isPreviousLineEmpty:()=>Ps,makeString:()=>ks,skip:()=>Ar,skipEverythingButNewLine:()=>Tr,skipInlineComment:()=>ys,skipNewline:()=>Rr,skipSpaces:()=>yr,skipToLineEnd:()=>br,skipTrailingComment:()=>bs,skipWhitespace:()=>_r});var ys=function(e,t){if(!1===t)return!1;if("/"===e.charAt(t)&&"*"===e.charAt(t+1))for(let n=t+2;nMath.max(e,n.length/t.length),0)},Fs=function(e,t){let n=Ts(e,t);return!1===n?"":e.charAt(n)},Ns="'",Ls=function(e,t){let n=!0===t||t===Ns?Ns:'"',r=n===Ns?'"':Ns,i=0,s=0;for(let t of e)t===n?i++:t===r&&s++;return i>s?r:n},Os=function(e,t,n){for(let r=t;ri===r?i:s===t?"\\"+s:s||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(i)?i:"\\"+i));return t+i+t};function Ms(e,t){return 2===arguments.length||"number"==typeof t?Ts(e,t):function(e,t,n){return Ts(e,n(t))}(...arguments)}function Ps(e,t){return 2===arguments.length||"number"==typeof t?jr(e,t):function(e,t,n){return jr(e,n(t))}(...arguments)}function Bs(e,t){return 2===arguments.length||"number"==typeof t?Rs(e,t):function(e,t,n){return Rs(e,n(t))}(...arguments)}function Us(e,t=1){return async(...n)=>{let r=n[t]??{},i=r.plugins??[];return n[t]={...r,plugins:Array.isArray(i)?i:Object.values(i)},e(...n)}}var $s=Us(Es);async function Gs(e,t){let{formatted:n}=await $s(e,{...t,cursorOffset:-1});return n}async function Vs(e,t){return await Gs(e,t)===e}var Ws=Us(qr,0),Hs={parse:Us(async function(e,t,n){let{text:r,options:i}=ms(e,await Ji(t)),s=await ts(r,i);return n&&(n.preprocessForPrint&&(s.ast=await is(s.ast,i)),n.massage&&(s.ast=function(e,t){let{printer:{massageAstNode:n,getVisitorKeys:r}}=t;if(!n)return e;let i=Nr(r),s=n.ignoredProperties??new Set;return function e(t,r){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>e(t,r)).filter(Boolean);let o={},a=new Set(i(t));for(let n in t)!Object.prototype.hasOwnProperty.call(t,n)||s.has(n)||(a.has(n)?o[n]=e(t[n],t):o[n]=t[n]);let l=n(t,o,r);return null!==l?l??o:void 0}(e)}(s.ast,i))),s}),formatAST:Us(async function(e,t){return t=await Ji(t),fr(await ns(e,t),t)}),formatDoc:Us(async function(e,t){let n=function(e){let t=Object.create(null),n=new Set;return function e(t,n,i){var s,o;if("string"==typeof t)return JSON.stringify(t);if(Array.isArray(t)){let n=t.map(e).filter(Boolean);return 1===n.length?n[0]:`[${n.join(", ")}]`}if(t.type===pn){let e=(null==(s=null==i?void 0:i[n+1])?void 0:s.type)===gn;return t.literal?e?"literalline":"literallineWithoutBreakParent":t.hard?e?"hardline":"hardlineWithoutBreakParent":t.soft?"softline":"line"}if(t.type===gn)return(null==(o=null==i?void 0:i[n-1])?void 0:o.type)===pn&&i[n-1].hard?void 0:"breakParent";if(t.type===an)return"trim";if(t.type===sn)return"indent("+e(t.contents)+")";if(t.type===on)return t.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+e(t.contents)+")":t.n<0?"dedent("+e(t.contents)+")":"root"===t.n.type?"markAsRoot("+e(t.contents)+")":"align("+JSON.stringify(t.n)+", "+e(t.contents)+")";if(t.type===cn)return"ifBreak("+e(t.breakContents)+(t.flatContents?", "+e(t.flatContents):"")+(t.groupId?(t.flatContents?"":', ""')+`, { groupId: ${r(t.groupId)} }`:"")+")";if(t.type===hn){let n=[];t.negate&&n.push("negate: true"),t.groupId&&n.push(`groupId: ${r(t.groupId)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return`indentIfBreak(${e(t.contents)}${i})`}if(t.type===ln){let n=[];t.break&&"propagated"!==t.break&&n.push("shouldBreak: true"),t.id&&n.push(`id: ${r(t.id)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return t.expandedStates?`conditionalGroup([${t.expandedStates.map(t=>e(t)).join(",")}]${i})`:`group(${e(t.contents)}${i})`}if(t.type===un)return`fill([${t.parts.map(t=>e(t)).join(", ")}])`;if(t.type===dn)return"lineSuffix("+e(t.contents)+")";if(t.type===fn)return"lineSuffixBoundary";if(t.type===mn)return`label(${JSON.stringify(t.label)}, ${e(t.contents)})`;if(t.type===rn)return"cursor";throw new Error("Unknown doc type "+t.type)}(er(e));function r(e){if("symbol"!=typeof e)return JSON.stringify(String(e));if(e in t)return t[e];let r=e.description||"symbol";for(let i=0;;i++){let s=r+(i>0?` #${i}`:"");if(!n.has(s))return n.add(s),t[e]=`Symbol.for(${JSON.stringify(s)})`}}}(e),{formatted:r}=await Es(n,{...t,parser:"__js_expression"});return r}),printToDoc:Us(async function(e,t){t=await Ji(t);let{ast:n}=await ts(e,t);return t.cursorOffset>=0&&(t={...t,...ss(n,t)}),ns(n,t)}),printDocToString:Us(async function(e,t){return fr(e,await Ji(t))})},js=Object.defineProperty;((e,t)=>{for(var n in t)js(e,n,{get:t[n],enumerable:!0})})({},{builders:()=>Jo,printer:()=>ea,utils:()=>ta});var zs="string",Xs="array",Ks="cursor",Ys="indent",qs="align",Qs="trim",Zs="group",Js="fill",eo="if-break",to="indent-if-break",no="line-suffix",ro="line-suffix-boundary",io="line",so="label",oo="break-parent",ao=new Set([Ks,Ys,qs,Qs,Zs,Js,eo,to,no,ro,io,so,oo]),lo=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},uo=function(e){if("string"==typeof e)return zs;if(Array.isArray(e))return Xs;if(!e)return;const{type:t}=e;return ao.has(t)?t:void 0};var co=class extends Error{name="InvalidDocError";constructor(e){super(function(e){const t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(uo(e))throw new Error("doc is valid.");const n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;const r=(i=[...ao].map(e=>`'${e}'`),new Intl.ListFormat("en-US",{type:"disjunction"}).format(i));var i;return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},ho={},fo=function(e,t,n,r){const i=[e];for(;i.length>0;){const e=i.pop();if(e===ho){n(i.pop());continue}n&&i.push(e,ho);const s=uo(e);if(!s)throw new co(e);if(!1!==(null==t?void 0:t(e)))switch(s){case Xs:case Js:{const t=s===Xs?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case eo:i.push(e.flatContents,e.breakContents);break;case Zs:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case qs:case Ys:case to:case so:case no:i.push(e.contents);break;case zs:case Ks:case Qs:case ro:case io:case oo:break;default:throw new co(e)}}};function po(e,t){if("string"==typeof e)return t(e);const n=new Map;return function e(r){if(n.has(r))return n.get(r);const i=function(n){switch(uo(n)){case Xs:return t(n.map(e));case Js:return t({...n,parts:n.parts.map(e)});case eo:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case Zs:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case qs:case Ys:case to:case so:case no:return t({...n,contents:e(n.contents)});case zs:case Ks:case Qs:case ro:case io:case oo:return t(n);default:throw new co(n)}}(r);return n.set(r,i),i}(e)}function mo(e,t,n){let r=n,i=!1;return fo(e,function(e){if(i)return!1;const n=t(e);void 0!==n&&(i=!0,r=n)}),r}function go(e){return!(e.type!==Zs||!e.break)||!(e.type!==io||!e.hard)||e.type===oo||void 0}function Eo(e){if(e.length>0){const t=lo(!1,e,-1);t.expandedStates||t.break||(t.break="propagated")}return null}function vo(e){return e.type!==io||e.hard?e.type===eo?e.flatContents:e:e.soft?"":" "}function Co(e){for(e=[...e];e.length>=2&&lo(!1,e,-2).type===io&&lo(!1,e,-1).type===oo;)e.length-=2;if(e.length>0){const t=Do(lo(!1,e,-1));e[e.length-1]=t}return e}function Do(e){switch(uo(e)){case Ys:case to:case Zs:case no:case so:{const t=Do(e.contents);return{...e,contents:t}}case eo:return{...e,breakContents:Do(e.breakContents),flatContents:Do(e.flatContents)};case Js:return{...e,parts:Co(e.parts)};case Xs:return Co(e);case zs:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return t{},_o=Ao,yo=Ao,bo=Ao;function To(e){return _o(e),{type:Ys,contents:e}}function Ro(e,t){return _o(t),{type:qs,contents:t,n:e}}function xo(e,t={}){return _o(e),yo(t.expandedStates,!0),{type:Zs,id:t.id,contents:e,break:Boolean(t.shouldBreak),expandedStates:t.expandedStates}}var wo={type:ro},Fo={type:oo},No={type:Qs},Lo={type:io,hard:!0},Oo={type:io,hard:!0,literal:!0},Io={type:io},ko={type:io,soft:!0},Mo=[Lo,Fo],Po=[Oo,Fo],Bo={type:Ks};function Uo(e,t){_o(e),yo(t);const n=[];for(let r=0;r{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Go=e=>{return!(12288===(t=e)||t>=65281&&t<=65376||t>=65504&&t<=65510||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e));var t},Vo=/[^\x20-\x7F]/u,Wo=function(e){if(!e)return 0;if(!Vo.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(const n of e){const e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=Go(e)?1:2)}return t},Ho=Symbol("MODE_BREAK"),jo=Symbol("MODE_FLAT"),zo=Symbol("cursor"),Xo=Symbol("DOC_FILL_PRINTED_LENGTH");function Ko(e,t){return qo(e,{type:"indent"},t)}function Yo(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?qo(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:qo(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function qo(e,t,n){const r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t];let i="",s=0,o=0,a=0;for(const e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function Qo(e){let t=0,n=0,r=e.length;e:for(;r--;){const i=e[r];if(i!==zo)for(let n=i.length-1;n>=0;n--){const s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(zo);return t}function Zo(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length;const a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}const{mode:e,doc:u}=a.pop(),c=uo(u);switch(c){case zs:l.push(u),n-=Wo(u);break;case Xs:case Js:{const t=c===Xs?u:u.parts,n=u[Xo]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case Ys:case qs:case to:case so:a.push({mode:e,doc:u.contents});break;case Qs:n+=Qo(l);break;case Zs:{if(s&&u.break)return!1;const t=u.break?Ho:e,n=u.expandedStates&&t===Ho?lo(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case eo:{const t=(u.groupId?i[u.groupId]||jo:e)===Ho?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case io:if(e===Ho||u.hard)return!0;u.soft||(l.push(" "),n--);break;case no:r=!0;break;case ro:if(r)return!1}}return!1}var Jo={join:Uo,line:Io,softline:ko,hardline:Mo,literalline:Po,group:xo,conditionalGroup:function(e,t){return xo(e[0],{...t,expandedStates:e})},fill:function(e){return bo(e),{type:Js,parts:e}},lineSuffix:function(e){return _o(e),{type:no,contents:e}},lineSuffixBoundary:wo,cursor:Bo,breakParent:Fo,ifBreak:function(e,t="",n={}){return _o(e),""!==t&&_o(t),{type:eo,breakContents:e,flatContents:t,groupId:n.groupId}},trim:No,indent:To,indentIfBreak:function(e,t){return _o(e),{type:to,contents:e,groupId:t.groupId,negate:t.negate}},align:Ro,addAlignmentToDoc:function(e,t,n){_o(e);let r=e;if(t>0){for(let e=0;ee},ea={printDocToString:function(e,t){const n={},r=t.printWidth,i=function(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}(t.endOfLine);let s=0;const o=[{ind:{value:"",length:0,queue:[]},mode:Ho,doc:e}],a=[];let l=!1;const u=[];let c=0;for(function(e){const t=new Set,n=[];fo(e,function(e){if(e.type===oo&&Eo(n),e.type===Zs){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===Zs&&n.pop().break&&Eo(n)},!0)}(e);o.length>0;){const{ind:e,mode:h,doc:d}=o.pop();switch(uo(d)){case zs:{const e="\n"!==i?$o(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=Wo(e));break}case Xs:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case Ks:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(zo),c++;break;case Ys:o.push({ind:Ko(e,t),mode:h,doc:d.contents});break;case qs:o.push({ind:Yo(e,d.n,t),mode:h,doc:d.contents});break;case Qs:s-=Qo(a);break;case Zs:switch(h){case jo:if(!l){o.push({ind:e,mode:d.break?Ho:jo,doc:d.contents});break}case Ho:{l=!1;const t={ind:e,mode:jo,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&Zo(t,o,i,a,n))o.push(t);else if(d.expandedStates){const t=lo(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:Ho,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:Ho,doc:t});break}{const t=d.expandedStates[r],s={ind:e,mode:jo,doc:t};if(Zo(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:Ho,doc:d.contents});break}}d.id&&(n[d.id]=lo(!1,o,-1).mode);break;case Js:{const t=r-s,i=d[Xo]??0,{parts:a}=d,l=a.length-i;if(0===l)break;const c=a[i+0],f=a[i+1],p={ind:e,mode:jo,doc:c},m={ind:e,mode:Ho,doc:c},g=Zo(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}const E={ind:e,mode:jo,doc:f},v={ind:e,mode:Ho,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}const C=a[i+2],D={ind:e,mode:h,doc:{...d,[Xo]:i+2}};Zo({ind:e,mode:jo,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case eo:case to:{const t=d.groupId?n[d.groupId]:h;if(t===Ho){const t=d.type===eo?d.breakContents:d.negate?d.contents:To(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===jo){const t=d.type===eo?d.flatContents:d.negate?To(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case no:u.push({ind:e,mode:h,doc:d.contents});break;case ro:u.length>0&&o.push({ind:e,mode:h,doc:Lo});break;case io:switch(h){case jo:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case Ho:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=Qo(a),a.push(i+e.value),s=e.length)}break;case so:o.push({ind:e,mode:h,doc:d.contents});break;case oo:break;default:throw new co(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}const h=a.indexOf(zo);if(-1!==h){const e=a.indexOf(zo,h+1);if(-1===e)return{formatted:a.filter(e=>e!==zo).join("")};const t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}},ta={willBreak:function(e){return mo(e,go,!1)},traverseDoc:fo,findInDoc:mo,mapDoc:po,removeLines:function(e){return po(e,vo)},stripTrailingHardline:function(e){return Do(function(e){return po(e,e=>function(e){switch(uo(e)){case Js:if(e.parts.every(e=>""===e))return"";break;case Zs:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===Zs&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case qs:case Ys:case to:case no:if(!e.contents)return"";break;case eo:if(!e.flatContents&&!e.breakContents)return"";break;case Xs:{const t=[];for(const n of e){if(!n)continue;const[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof lo(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case zs:case Ks:case Qs:case ro:case io:case so:case oo:break;default:throw new co(e)}return e}(e))}(e))},replaceEndOfLine:function(e,t=Po){return po(e,e=>"string"==typeof e?Uo(t,e.split("\n")):e)},canBreak:function(e){return mo(e,So,!1)}};function na(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}class ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class ia extends ra{constructor(e){super([]),this.idx=1,Object.assign(this,ma(e))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class sa extends ra{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ma(e))}}class oa extends ra{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ma(e))}}class aa extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class la extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ua extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ca extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ha extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class da extends ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ma(e))}}class fa{constructor(e){this.idx=1,Object.assign(this,ma(e))}accept(e){e.visit(this)}}function pa(e){function t(e){return e.map(pa)}if(e instanceof ia){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return"string"==typeof e.label&&(t.label=e.label),t}if(e instanceof oa)return{type:"Alternative",definition:t(e.definition)};if(e instanceof aa)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof la)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof ua)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ha)return{type:"RepetitionWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ca)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof da)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof fa){const t={type:"Terminal",name:e.terminalType.name,label:(n=e.terminalType,"string"==typeof(r=n).LABEL&&""!==r.LABEL?n.LABEL:n.name),idx:e.idx};"string"==typeof e.label&&(t.terminalLabel=e.label);const i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=i instanceof RegExp?i.source:i),t}if(e instanceof sa)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match");var n,r}function ma(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}class ga{visit(e){const t=e;switch(t.constructor){case ia:return this.visitNonTerminal(t);case oa:return this.visitAlternative(t);case aa:return this.visitOption(t);case la:return this.visitRepetitionMandatory(t);case ua:return this.visitRepetitionMandatoryWithSeparator(t);case ha:return this.visitRepetitionWithSeparator(t);case ca:return this.visitRepetition(t);case da:return this.visitAlternation(t);case fa:return this.visitTerminal(t);case sa:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Ea(e,t=[]){return!!(e instanceof aa||e instanceof ca||e instanceof ha)||(e instanceof da?e.definition.some(e=>Ea(e,t)):!(e instanceof ia&&t.includes(e))&&e instanceof ra&&(e instanceof ia&&t.push(e),e.definition.every(e=>Ea(e,t))))}function va(e){if(e instanceof ia)return"SUBRULE";if(e instanceof aa)return"OPTION";if(e instanceof da)return"OR";if(e instanceof la)return"AT_LEAST_ONE";if(e instanceof ua)return"AT_LEAST_ONE_SEP";if(e instanceof ha)return"MANY_SEP";if(e instanceof ca)return"MANY";if(e instanceof fa)return"CONSUME";throw Error("non exhaustive match")}class Ca{walk(e,t=[]){e.definition.forEach((n,r)=>{const i=e.definition.slice(r+1);if(n instanceof ia)this.walkProdRef(n,i,t);else if(n instanceof fa)this.walkTerminal(n,i,t);else if(n instanceof oa)this.walkFlat(n,i,t);else if(n instanceof aa)this.walkOption(n,i,t);else if(n instanceof la)this.walkAtLeastOne(n,i,t);else if(n instanceof ua)this.walkAtLeastOneSep(n,i,t);else if(n instanceof ha)this.walkManySep(n,i,t);else if(n instanceof ca)this.walkMany(n,i,t);else{if(!(n instanceof da))throw Error("non exhaustive match");this.walkOr(n,i,t)}})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);e.definition.forEach(e=>{const t=new oa({definition:[e]});this.walk(t,r)})}}function Da(e,t,n){return[new aa({definition:[new fa({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Sa(e){if(e instanceof ia)return Sa(e.referencedRule);if(e instanceof fa)return[e.terminalType];if(function(e){return e instanceof oa||e instanceof aa||e instanceof ca||e instanceof la||e instanceof ua||e instanceof ha||e instanceof fa||e instanceof sa}(e))return function(e){let t=[];const n=e.definition;let r,i=0,s=n.length>i,o=!0;for(;s&&o;)r=n[i],o=Ea(r),t=t.concat(Sa(r)),i+=1,s=n.length>i;return[...new Set(t)]}(e);if(function(e){return e instanceof da}(e))return function(e){const t=e.definition.map(e=>Sa(e));return[...new Set(t.flat())]}(e);throw Error("non exhaustive match")}const Aa="_~IN~_";class _a extends Ca{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=(i=e.referencedRule,s=e.idx,i.name+s+Aa+this.topProd.name);var i,s;const o=t.concat(n),a=Sa(new oa({definition:o}));this.follows[r]=a}}function ya(e){return e.charCodeAt(0)}function ba(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function Ta(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t],e[t]=!0}function Ra(e){if(void 0===e)throw Error("Internal Error - Should never get here!");return!0}function xa(){throw Error("Internal Error - Should never get here!")}function wa(e){return"Character"===e.type}const Fa=[];for(let e=ya("0");e<=ya("9");e++)Fa.push(e);const Na=[ya("_")].concat(Fa);for(let e=ya("a");e<=ya("z");e++)Na.push(e);for(let e=ya("A");e<=ya("Z");e++)Na.push(e);const La=[ya(" "),ya("\f"),ya("\n"),ya("\r"),ya("\t"),ya("\v"),ya("\t"),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya("\u2028"),ya("\u2029"),ya(" "),ya(" "),ya(" "),ya("\ufeff")],Oa=/[0-9a-fA-F]/,Ia=/[0-9]/,ka=/[1-9]/;class Ma{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}function Pa(e){console&&console.error&&console.error(`Error: ${e}`)}function Ba(e){console&&console.warn&&console.warn(`Warning: ${e}`)}let Ua={};const $a=new class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Ta(n,"global");break;case"i":Ta(n,"ignoreCase");break;case"m":Ta(n,"multiLine");break;case"u":Ta(n,"unicode");break;case"y":Ta(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":let t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}}Ra(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return xa()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;Ra(t)}if(!0!==e||void 0!==t)return Ra(t)?("?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t):void 0}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),Ra(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):xa()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ya("\n"),ya("\r"),ya("\u2028"),ya("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=Fa;break;case"D":e=Fa,t=!0;break;case"s":e=La;break;case"S":e=La,t=!0;break;case"w":e=Na;break;case"W":e=Na,t=!0}return Ra(e)?{type:"Set",value:e,complement:t}:xa()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ya("\f");break;case"n":e=ya("\n");break;case"r":e=ya("\r");break;case"t":e=ya("\t");break;case"v":e=ya("\v")}return Ra(e)?{type:"Character",value:e}:xa()}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:ya("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:ya(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:ya(this.popChar())}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const t=this.classAtom();if(t.type,wa(t)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,wa(n)){if(n.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};function Ga(e){const t=e.toString();if(Ua.hasOwnProperty(t))return Ua[t];{const e=$a.pattern(t);return Ua[t]=e,e}}const Va="Complement Sets are not supported for first char optimization",Wa='Unable to use "first char" lexer optimizations:\n';function Ha(e,t=!1){try{const t=Ga(e);return ja(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===Va)t&&Ba(`${Wa}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),Pa(`${Wa}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function ja(e,t,n){switch(e.type){case"Disjunction":for(let r=0;r{if("number"==typeof e)za(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)za(e,t,n);else{for(let e=r.from;e<=r.to&&e=ul){const e=r.from>=ul?r.from:ul,n=r.to,i=hl(e),s=hl(n);for(let e=i;e<=s;e++)t[e]=e}}}});break;case"Group":ja(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}const o=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===Ka(s)||"Group"!==s.type&&!1===o)break}break;default:throw Error("non exhaustive match!")}return Object.values(t)}function za(e,t,n){const r=hl(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=hl(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=hl(e.charCodeAt(0));t[n]=n}}}(e,t)}function Xa(e,t){return e.value.find(e=>{if("number"==typeof e)return t.includes(e);{const n=e;return void 0!==t.find(e=>n.from<=e&&e<=n.to)}})}function Ka(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(Array.isArray(e.value)?e.value.every(Ka):Ka(e.value))}class Ya extends Ma{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e);case"Lookbehind":return void this.visitLookbehind(e);case"NegativeLookbehind":return void this.visitNegativeLookbehind(e)}super.visitChildren(e)}}visitCharacter(e){this.targetCharCodes.includes(e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===Xa(e,this.targetCharCodes)&&(this.found=!0):void 0!==Xa(e,this.targetCharCodes)&&(this.found=!0)}}function qa(e,t){if(t instanceof RegExp){const n=Ga(t),r=new Ya(e);return r.visit(n),r.found}for(const n of t){const t=n.charCodeAt(0);if(e.includes(t))return!0}return!1}const Qa="PATTERN",Za="defaultMode",Ja="modes";const el=/[^\\][$]/,tl=/[^\\[][\^]|^\^/;function nl(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function rl(e){const t=e.PATTERN;if(t instanceof RegExp)return!1;if("function"==typeof t)return!0;if(Object.hasOwn(t,"exec"))return!0;if("string"==typeof t)return!1;throw Error("non exhaustive match")}function il(e){return"string"==typeof e&&1===e.length&&e.charCodeAt(0)}const sl={test:function(e){const t=e.length;for(let n=this.lastIndex;n"string"==typeof e?e.charCodeAt(0):e)}function ll(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const ul=256;let cl=[];function hl(e){return ee.CATEGORIES).flat().filter(Boolean);const e=n.filter(e=>!t.includes(e));t=t.concat(e),0===e.length?r=!1:n=e}return t}(e);!function(e){e.forEach(e=>{var t;Cl(e)||(gl[ml]=e,e.tokenTypeIdx=ml++),Dl(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Dl(e)||(e.CATEGORIES=[]),t=e,Object.hasOwn(null!=t?t:{},"categoryMatches")||(e.categoryMatches=[]),function(e){return Object.hasOwn(null!=e?e:{},"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})})}(t),function(e){e.forEach(e=>{vl([],e)})}(t),function(e){e.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(t=>{e.categoryMatches.push(gl[t].tokenTypeIdx)})})}(t),t.forEach(e=>{e.isParent=e.categoryMatches.length>0})}function vl(e,t){e.forEach(e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),t.CATEGORIES.forEach(n=>{const r=e.concat(t);r.includes(n)||vl(r,n)})}function Cl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}function Dl(e){return Object.hasOwn(null!=e?e:{},"CATEGORIES")}function Sl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}var Al;!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"}(Al||(Al={}));const _l={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:{buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i,s)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`},traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(_l);class yl{constructor(e,t=_l){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=Object.assign({},_l,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===_l.lineTerminatorsPattern)this.config.lineTerminatorsPattern=sl;else if(this.config.lineTerminatorCharacters===_l.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Array.isArray(e)?n={modes:{defaultMode:[...e]},defaultMode:Za}:(r=!1,n=Object.assign({},e))}),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){const t=[];return Object.hasOwn(e,Za)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+Za+"> property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(e,Ja)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(e,Ja)&&Object.hasOwn(e,Za)&&!Object.hasOwn(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${Za}: <${e.defaultMode}>which does not exist\n`,type:Al.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(e,Ja)&&Object.keys(e.modes).forEach(n=>{const r=e.modes[n];r.forEach((e,i)=>{void 0===e?t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:Al.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(e,"LONGER_ALT")&&(Array.isArray(e.LONGER_ALT)?e.LONGER_ALT:[e.LONGER_ALT]).forEach(i=>{void 0===i||r.includes(i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${e.name}> outside of mode <${n}>\n`,type:Al.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(function(e,t,n){const r=[];let i=!1;const s=Object.values(e.modes||{}).flat().filter(Boolean).filter(e=>e[Qa]!==yl.NA),o=al(n);return t&&s.forEach(e=>{const t=ol(e,o);if(!1!==t){const n=function(e,t){if(t.issue===Al.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Al.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else Object.hasOwn(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):qa(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:Al.NO_LINE_BREAKS_FLAGS}),r}(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},Object.entries(n.modes).forEach(([e,t])=>{n.modes[e]=t.filter(e=>void 0!==e)});const i=Object.keys(n.modes);if(Object.entries(n.modes).forEach(([e,n])=>{this.TRACE_INIT(`Mode: <${e}> processing`,()=>{if(this.modes.push(e),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e,t){let n=[];const r=function(e){const t=e.filter(e=>!Object.hasOwn(e,Qa));return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:Al.MISSING_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(e);n=n.concat(r.errors);const i=function(e){const t=e.filter(e=>{const t=e[Qa];return!(t instanceof RegExp||"function"==typeof t||Object.hasOwn(t,"exec")||"string"==typeof t)});return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Al.INVALID_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=e.filter(e=>e[Qa]instanceof RegExp);return t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return el.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return tl.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){return e.filter(e=>{const t=e[Qa];return t instanceof RegExp&&(t.multiline||t.global)}).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Al.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){const t=[];let n=e.map(n=>e.reduce((e,r)=>(n.PATTERN.source!==r.PATTERN.source||t.includes(r)||r.PATTERN===yl.NA||(t.push(r),e.push(r)),e),[]));return n=n.filter(Boolean),n.filter(e=>e.length>1).map(e=>{const t=e.map(e=>e.name);return{message:`The same RegExp pattern ->${e[0].PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:Al.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}(n)),t=t.concat(function(e){return e.filter(e=>e.PATTERN.test("")).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:Al.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}(n)),t}(s)),n=n.concat(function(e){const t=e.filter(e=>{if(!Object.hasOwn(e,"GROUP"))return!1;const t=e.GROUP;return t!==yl.SKIPPED&&t!==yl.NA&&!("string"==typeof t)});return t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Al.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}(s)),n=n.concat(function(e,t){return e.filter(e=>void 0!==e.PUSH_MODE&&!t.includes(e.PUSH_MODE)).map(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:Al.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}(s,t)),n=n.concat(function(e){const t=[],n=e.reduce((e,t,n)=>{const r=t.PATTERN;return r===yl.NA||("string"==typeof r?e.push({str:r,idx:n,tokenType:t}):r instanceof RegExp&&(i=r,void 0===[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(e=>-1!==i.source.indexOf(e)))&&e.push({str:r.source,idx:n,tokenType:t})),e;var i},[]);return e.forEach((e,r)=>{n.forEach(({str:n,idx:i,tokenType:s})=>{if(r${s.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:Al.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}})}),t}(s)),n}(n,i))}),0===this.lexerDefinitionErrors.length){let r;El(n),this.TRACE_INIT("analyzeTokenTypes",()=>{r=function(e,t){const n=(t=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()},t)).tracer;let r;n("initCharCodeToOptimizedIndexMap",()=>{!function(){if(0===cl.length){cl=new Array(65536);for(let e=0;e<65536;e++)cl[e]=e>255?255+~~(e/255):e}}()}),n("Reject Lexer.NA",()=>{r=e.filter(e=>e[Qa]!==yl.NA)});let i,s,o,a,l,u,c,h,d,f,p,m=!1;n("Transform Patterns",()=>{m=!1,i=r.map(e=>{const t=e[Qa];if(t instanceof RegExp){const e=t.source;return 1!==e.length||"^"===e||"$"===e||"."===e||t.ignoreCase?2!==e.length||"\\"!==e[0]||["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(e[1])?nl(t):e[1]:e}if("function"==typeof t)return m=!0,{exec:t};if("object"==typeof t)return m=!0,t;if("string"==typeof t){if(1===t.length)return t;{const e=t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return nl(new RegExp(e))}}throw Error("non exhaustive match")})}),n("misc mapping",()=>{s=r.map(e=>e.tokenTypeIdx),o=r.map(e=>{const t=e.GROUP;if(t!==yl.SKIPPED){if("string"==typeof t)return t;if(void 0===t)return!1;throw Error("non exhaustive match")}}),a=r.map(e=>{const t=e.LONGER_ALT;if(t)return Array.isArray(t)?t.map(e=>r.indexOf(e)):[r.indexOf(t)]}),l=r.map(e=>e.PUSH_MODE),u=r.map(e=>Object.hasOwn(e,"POP_MODE"))}),n("Line Terminator Handling",()=>{const e=al(t.lineTerminatorCharacters);c=r.map(e=>!1),"onlyOffset"!==t.positionTracking&&(c=r.map(t=>Object.hasOwn(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===ol(t,e)&&qa(e,t.PATTERN)))}),n("Misc Mapping #2",()=>{h=r.map(rl),d=i.map(il),f=r.reduce((e,t)=>{const n=t.GROUP;return"string"==typeof n&&n!==yl.SKIPPED&&(e[n]=[]),e},{}),p=i.map((e,t)=>({pattern:i[t],longerAlt:a[t],canLineTerminator:c[t],isCustom:h[t],short:d[t],group:o[t],push:l[t],pop:u[t],tokenTypeIdx:s[t],tokenType:r[t]}))});let g=!0,E=[];return t.safeMode||n("First Char Optimization",()=>{E=r.reduce((e,n,r)=>{if("string"==typeof n.PATTERN){const t=hl(n.PATTERN.charCodeAt(0));ll(e,t,p[r])}else if(Array.isArray(n.START_CHARS_HINT)){let t;n.START_CHARS_HINT.forEach(n=>{const i=hl("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,ll(e,i,p[r]))})}else if(n.PATTERN instanceof RegExp)if(n.PATTERN.unicode)g=!1,t.ensureOptimizations&&Pa(`${Wa}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=Ha(n.PATTERN,t.ensureOptimizations);0===i.length&&(g=!1),i.forEach(t=>{ll(e,t,p[r])})}else t.ensureOptimizations&&Pa(`${Wa}\tTokenType: <${n.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return e},[])}),{emptyGroups:f,patternIdxToConfig:p,charCodeToPatternIdxToConfig:E,hasCustom:m,canBeOptimized:g}}(n,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[e]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[e]=r.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[e]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}this.lexerDefinitionWarning.forEach(e=>{Ba(e.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(r&&(this.handleModes=()=>{}),!1===this.trackStartLines&&(this.computeNewColumn=e=>e),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=()=>{}),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const e=Object.entries(this.canModeBeOptimized).reduce((e,[t,n])=>(!1===n&&e.push(t),e),[]);if(t.ensureOptimizations&&e.length>0)throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Ua={}}),this.TRACE_INIT("toFastProperties",()=>{na(this)})})}tokenize(e,t=this.defaultMode){if(this.lexerDefinitionErrors.length>0){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,s,o,a,l,u,c,h,d,f,p,m,g;const E=e,v=E.length;let C=0,D=0;const S=this.hasCustom?0:Math.floor(e.length/10),A=new Array(S),_=[];let y=this.trackStartLines?1:void 0,b=this.trackStartLines?1:void 0;const T=function(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(!Array.isArray(r))throw Error("non exhaustive match");t[n]=[]}),t}(this.emptyGroups),R=this.trackStartLines,x=this.config.lineTerminatorsPattern;let w=0,F=[],N=[];const L=[],O=[];Object.freeze(O);let I=!1;const k=e=>{if(1===L.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);_.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{L.pop();const e=L.at(-1);F=this.patternIdxToConfig[e],N=this.charCodeToPatternIdxToConfig[e],w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}};function M(e){L.push(e),N=this.charCodeToPatternIdxToConfig[e],F=this.patternIdxToConfig[e],w=F.length,w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}let P;M.call(this,t);const B=this.config.recoveryEnabled;for(;Ca.length){a=s,c=s.length,l=u,P=t;break}}}break}}if(-1!==c){if(h=P.group,void 0!==h&&(a=null!==a?a:e.substring(C,C+c),d=P.tokenTypeIdx,f=this.createTokenInstance(a,C,d,P.tokenType,y,b,c),this.handlePayload(f,l),!1===h?D=this.addToken(A,D,f):T[h].push(f)),!0===R&&!0===P.canLineTerminator){let t,n,r=0;x.lastIndex=0;do{a=null!==a?a:e.substring(C,C+c),t=x.test(a),!0===t&&(n=x.lastIndex-1,r++)}while(!0===t);0!==r?(y+=r,b=c-n,this.updateTokenEndLineColumnLocation(f,h,n,r,y,b,c)):b=this.computeNewColumn(b,c)}else b=this.computeNewColumn(b,c);C+=c,this.handleModes(P,k,M,f)}else{const t=C,n=y,i=b;let s=!1===B;for(;!1===s&&C`Expecting ${Tl(e)?`--\x3e ${bl(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o="\nbut found: '"+t[0].image+"'";return r?s+r+o:s+`one of these possible Token sequences:\n${e.reduce((e,t)=>e.concat(t),[]).map(e=>`[${e.map(e=>bl(e)).join(", ")}]`).map((e,t)=>` ${t+1}. ${e}`).join("\n")}`+o},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",s="\nbut found: '"+t[0].image+"'";return n?i+n+s:i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map(e=>`[${e.map(e=>bl(e)).join(",")}]`).join(" ,")}>`+s}};Object.freeze(Bl);const Ul={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},$l={buildDuplicateFoundError(e,t){const n=e.name,r=t[0],i=r.idx,s=va(r),o=(a=r)instanceof fa?a.terminalType.name:a instanceof ia?a.nonTerminalName:"";var a;let l=`->${s}${i>0?i:""}<- ${o?`with argument: ->${o}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,"\n"),l},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=e.prefixPath.map(e=>bl(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=0===e.alternation.idx?"":e.alternation.idx,n=0===e.prefixPath.length;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule,\n`;return r+=n?"These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n":`<${e.prefixPath.map(e=>bl(e)).join(", ")}> may appears as a prefix path in all these alternatives.\n`,r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=va(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${t} --\x3e ${e.leftRecursionPath.map(e=>e.name).concat([t]).join(" --\x3e ")}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof sa?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class Gl extends ga{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:rc.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Vl extends Ca{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){0===this.ruleStack.length?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Wl extends Vl{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const e=t.concat(n),r=new oa({definition:e});this.possibleTokTypes=Sa(r),this.found=!0}}}class Hl extends Ca{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class jl extends Hl{walkMany(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}}class zl extends Hl{walkManySep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}}class Xl extends Hl{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}}class Kl extends Hl{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}}function Yl(e,t,n=[]){n=[...n];let r=[],i=0;function s(s){const o=Yl(s.concat(e.slice(i+1)),t,n);return r.concat(o)}for(;n.length{0!==e.definition.length&&(r=s(e.definition))}),r;if(!(t instanceof fa))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:e.slice(i)}),r}function ql(e,t,n,r){const i=[...n];i.push(e.name);const s=[...r];return s.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:s}}var Ql;function Zl(e){if(e instanceof aa||"Option"===e)return Ql.OPTION;if(e instanceof ca||"Repetition"===e)return Ql.REPETITION;if(e instanceof la||"RepetitionMandatory"===e)return Ql.REPETITION_MANDATORY;if(e instanceof ua||"RepetitionMandatoryWithSeparator"===e)return Ql.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ha||"RepetitionWithSeparator"===e)return Ql.REPETITION_WITH_SEPARATOR;if(e instanceof da||"Alternation"===e)return Ql.ALTERNATION;throw Error("non exhaustive match")}function Jl(e,t,n,r){const i=e.length,s=e.every(e=>e.every(e=>1===e.length));if(t)return function(t){const r=t.map(e=>e.GATE);for(let t=0;te.flat()).reduce((e,t,n)=>(t.forEach(t=>{t.tokenTypeIdx in e||(e[t.tokenTypeIdx]=n),t.categoryMatches.forEach(t=>{Object.hasOwn(e,t)||(e[t]=n)})}),e),{});return function(){const e=this.LA_FAST(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t1===e.length),i=e.length;if(r&&!n){const t=e.flat();if(1===t.length&&0===t[0].categoryMatches.length){const e=t[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===e}}{const e=t.reduce((e,t,n)=>(e[t.tokenTypeIdx]=!0,t.categoryMatches.forEach(t=>{e[t]=!0}),e),[]);return function(){const t=this.LA_FAST(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;nYl([e],1)),r=ru(n.length),i=n.map(e=>{const t={};return e.forEach(e=>{iu(e.partialPath).forEach(e=>{t[e]=!0})}),t});let s=n;for(let e=1;e<=t;e++){const n=s;s=ru(n.length);for(let o=0;o{iu(e.partialPath).forEach(e=>{i[o][e]=!0})})}}}}return r}function au(e,t,n,r){const i=new nu(e,Ql.ALTERNATION,r);return t.accept(i),ou(i.result,n)}function lu(e,t,n,r){const i=new nu(e,n);t.accept(i);const s=i.result,o=new tu(t,e,n).startWalking();return ou([new oa({definition:s}),new oa({definition:o})],r)}function uu(e,t){e:for(let n=0;ne.every(e=>e.every(e=>0===e.categoryMatches.length)))}function hu(e){return`${va(e)}_#_${e.idx}_#_${du(e)}`}function du(e){return e instanceof fa?e.terminalType.name:e instanceof ia?e.nonTerminalName:""}class fu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function pu(e,t,n,r=[]){const i=[],s=mu(t.definition);if(0===s.length)return[];{const t=e.name;s.includes(e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:rc.LEFT_RECURSION,ruleName:t});const o=r.concat([e]),a=s.filter(e=>!o.includes(e)).flatMap(t=>{const i=[...r];return i.push(t),pu(e,t,n,i)});return i.concat(a)}}function mu(e){let t=[];if(0===e.length)return t;const n=e[0];if(n instanceof ia)t.push(n.referencedRule);else if(n instanceof oa||n instanceof aa||n instanceof la||n instanceof ua||n instanceof ha||n instanceof ca)t=t.concat(mu(n.definition));else if(n instanceof da)t=n.definition.map(e=>mu(e.definition)).flat();else if(!(n instanceof fa))throw Error("non exhaustive match");const r=Ea(n),i=e.length>1;if(r&&i){const n=e.slice(1);return t.concat(mu(n))}return t}class gu extends ga{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}class Eu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}const vu="MismatchedTokenException",Cu="NoViableAltException",Du="EarlyExitException",Su="NotAllInputParsedException",Au=[vu,Cu,Du,Su];function _u(e){return Au.includes(e.name)}Object.freeze(Au);class yu extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class bu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=vu}}class Tu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Cu}}class Ru extends yu{constructor(e,t){super(e,t),this.name=Su}}class xu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Du}}const wu={},Fu="InRuleRecoveryException";class Nu extends Error{constructor(e){super(e),this.name=Fu}}function Lu(e,t,n,r,i,s,o){const a=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[a];if(void 0===l){const e=this.getCurrRuleFullName();l=new s(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[a]=l}let u=l.token,c=l.occurrence;const h=l.isEndOfRule;0===this.RULE_STACK_IDX&&h&&void 0===u&&(u=Ml,c=1),void 0!==u&&void 0!==c&&this.shouldInRepetitionRecoveryBeTried(u,c,o)&&this.tryInRepetitionRecovery(e,t,n,u)}const Ou=1024,Iu=1280,ku=1536;function Mu(e,t,n){return n|t|e}class Pu{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:tc.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(0===t.length){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return e.flatMap(e=>pu(e,e,$l))}validateEmptyOrAlternatives(e){return e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.slice(0,-1).flatMap((r,i)=>0===function(e,t,n){const r="EXIT_NONE_TERMINAL",i=[r],s="EXIT_ALTERNATIVE";let o=!1;const a=t.length,l=a-1-1,u=[],c=[];for(c.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});0!==c.length;){const e=c.pop();if(e===s){o&&c.at(-1).idx<=l&&c.pop();continue}const h=e.def,d=e.idx,f=e.ruleStack,p=e.occurrenceStack;if(0===h.length)continue;const m=h[0];if(m===r){const e={idx:d,def:h.slice(1),ruleStack:f.slice(0,-1),occurrenceStack:p.slice(0,-1)};c.push(e)}else if(m instanceof fa)if(d=0;e--){const t={idx:d,def:m.definition[e].definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p};c.push(t),c.push(s)}else if(m instanceof oa)c.push({idx:d,def:m.definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p});else{if(!(m instanceof sa))throw Error("non exhaustive match");c.push(ql(m,d,f,p))}}return u}([r],[],fl).length?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:rc.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}(e,$l))}validateAmbiguousAlternationAlternatives(e,t){return e.flatMap(e=>function(e,t,n){const r=new gu;e.accept(r);let i=r.alternations;i=i.filter(e=>!0!==e.ignoreAmbiguities);return i.flatMap(r=>{const i=r.idx,s=r.maxLookahead||t,o=au(i,e,s,r),a=function(e,t,n,r){const i=[];return e.reduce((n,r,s)=>(!0===t.definition[s].ignoreAmbiguities||r.forEach(r=>{const o=[s];e.forEach((e,n)=>{s!==n&&uu(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&o.push(n)}),o.length>1&&!uu(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]).map(e=>{const i=e.alts.map(e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}(o,r,e,n),l=function(e,t,n,r){const i=e.reduce((e,t,n)=>{const r=t.map(e=>({idx:n,path:e}));return e.concat(r)},[]);return i.flatMap(e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const s=e.idx,o=e.path;return i.filter(e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx{const n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}));var n,r}).map(e=>{const i=[e.idx+1,s+1],o=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})})}(o,r,e,n);return a.concat(l)})}(e,t,$l))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return e.forEach(e=>{const i=new Eu;e.accept(i),i.allProductions.forEach(i=>{const s=Zl(i),o=i.maxLookahead||t;if(0===lu(i.idx,e,s,o)[0].flat().length){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:rc.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}(e,t,$l)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,s){const o=au(e,t,n);return s(o,r,cu(o)?pl:fl,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Jl)}buildLookaheadForOptional(e){return function(e,t,n,r,i,s){const o=lu(e,t,i,n),a=cu(o)?pl:fl;return s(o[0],a,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Zl(e.prodType),eu)}}const Bu=new class extends ga{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function Uu(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset"function"==typeof e.GATE);return s.hasPredicates=o,n.definition.push(s),i.forEach(e=>{const t=new oa({definition:[]});s.definition.push(t),Object.hasOwn(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Object.hasOwn(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),Hu}function Zu(e){return 0===e?"":`${e}`}function Ju(e){if(e<0||e>zu){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${zu+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const ec=Pl(Ml,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ec);const tc=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Bl,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),nc=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var rc,ic,sc;!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(rc||(rc={}));class oc{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",()=>{na(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=function(e){const t=Object.assign({errMsgProvider:Ul},e),n={};return e.rules.forEach(e=>{n[e.name]=e}),function(e,t){const n=new Gl(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(0===n.length&&!1===this.skipValidations){const e=function(e){var t;const n=null!==(t=e.errMsgProvider)&&void 0!==t?t:$l;return function(e,t,n,r){const i=e.flatMap(e=>function(e,t){const n=new fu;e.accept(n);const r=n.allProductions,i=Object.groupBy(r,hu),s=Object.fromEntries(Object.entries(i).filter(([e,t])=>t.length>1));return Object.values(s).map(n=>{const r=n[0],i=t.buildDuplicateFoundError(e,n),s=va(r),o={message:i,type:rc.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:s,occurrence:r.idx},a=du(r);return a&&(o.parameter=a),o})}(e,n)),s=function(e,t,n){const r=[],i=t.map(e=>e.name);return e.forEach(e=>{const t=e.name;if(i.includes(t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:rc.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}(e,t,n),o=e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:rc.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}(e,n)),a=e.flatMap(t=>function(e,t,n,r){const i=[],s=t.reduce((t,n)=>n.name===e.name?t+1:t,0);if(s>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:rc.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n));return i.concat(s,o,a)}(e.rules,e.tokenTypes,n,e.grammarName)}({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:$l,grammarName:t}),n=function(e){return e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}).map(e=>Object.assign({type:rc.CUSTOM_LOOKAHEAD_VALIDATION},e))}({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(e,n)}}),0===this.definitionErrors.length&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const e=function(e){const t={};return e.forEach(e=>{const n=new _a(e).startWalking();Object.assign(t,n)}),t}(Object.values(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!oc.DEFER_DEFINITION_ERRORS_HANDLING&&0!==this.definitionErrors.length)throw e=this.definitionErrors.map(e=>e.message),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initGastRecorder(t),n.initPerformanceTracer(t),Object.hasOwn(t,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=Object.hasOwn(t,"skipValidations")?t.skipValidations:tc.skipValidations}}oc.DEFER_DEFINITION_ERRORS_HANDLING=!1,ic=oc,sc=[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:tc.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Lu)}getTokenToInsert(e){const t=Pl(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let a=!1;const l=this.LA_FAST(1);let u=this.LA_FAST(1);const c=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),n=new bu(t,l,this.LA(0));n.resyncedTokens=o.slice(0,-1),this.SAVE_ERROR(n)};for(;!a;){if(this.tokenMatcher(u,r))return void c();if(n.call(this))return c(),void e.apply(this,t);this.tokenMatcher(u,i)?a=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o))}this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA_FAST(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getNextPossibleTokenTypes(e){const t=e.ruleStack[0],n=this.getGAstProductions()[t];return new Wl(n,e).startWalking()}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new Nu("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(0===t.length)return!1;const n=this.LA_FAST(1);return void 0!==t.find(e=>this.tokenMatcher(n,e))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(t).includes(e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA_FAST(1),n=2;for(;;){const r=e.find(e=>fl(t,e));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(0===this.RULE_STACK_IDX)return wu;const e=this.currRuleShortName,t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK,n=this.RULE_STACK_IDX+1,r=new Array(n);for(let i=0;ithis.getFollowSetFromFollowKey(e)).flat()}getFollowSetFromFollowKey(e){if(e===wu)return[Ml];const t=e.ruleName+e.idxInCallingRule+Aa+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Ml)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA_FAST(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return t.slice(0,-1)}attemptInRepetitionRecovery(e,t,n,r,i,s,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){const e=this.RULE_STACK_IDX+1,t=new Array(e);for(let n=0;n{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:o}=function(e){Bu.reset(),e.accept(Bu);const t=Bu.dslMethods;return Bu.reset(),t}(e);t.forEach(t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${va(t)}${n}`,()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=Mu(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),n.forEach(t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,va(t))}),r.forEach(t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,va(t))}),i.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Ou,"RepetitionMandatory",t.maxLookahead,va(t))}),s.forEach(t=>{this.computeLookaheadFunc(e,t.idx,ku,"RepetitionMandatoryWithSeparator",t.maxLookahead,va(t))}),o.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Iu,"RepetitionWithSeparator",t.maxLookahead,va(t))})})})}computeLookaheadFunc(e,t,n,r,i,s){this.TRACE_INIT(`${s}${0===t?"":t}`,()=>{const s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=Mu(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,s)})}getKeyForAutomaticLookahead(e,t){return Mu(this.currRuleShortName,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:tc.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=$u,this.setNodeLocationFromNode=$u,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Uu,this.setNodeLocationFromNode=Uu,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{}}else this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{}}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA_FAST(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];var r,i,s;i=t,s=e,void 0===(r=n).children[s]?r.children[s]=[i]:r.children[s].push(i),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(void 0===this.baseCstVisitorConstructor){const e=function(e,t){const n=function(){};Gu(n,e+"BaseSemantics");const r={visit:function(e,t){if(Array.isArray(e)&&(e=e[0]),void 0!==e)return this[e.name](e.children,t)},validateVisitor:function(){const e=function(e,t){const n=function(e,t){return t.filter(t=>"function"==typeof e[t]==0).map(t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Wu.MISSING_METHOD,methodName:t})).filter(Boolean)}(e,t);return n}(this,t);if(0!==e.length){const t=e.map(e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(void 0===this.baseCstVisitorWithDefaultsConstructor){const e=function(e,t,n){const r=function(){};Gu(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return t.forEach(e=>{i[e]=Vu}),(r.prototype=i).constructor=r,r}(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):ec}LA_FAST(e){const t=this.currIdx+e;return this.tokVector[t]}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?ec:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=pl,this.subruleIdx=0,this.currRuleShortName=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(Array.isArray(e)){if(0===e.length)throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(Array.isArray(e))this.tokensMap=e.reduce((e,t)=>(e[t.name]=t,e),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(Sl)){const t=Object.values(e.modes).flat(),n=[...new Set(t)];this.tokensMap=n.reduce((e,t)=>(e[t.name]=t,e),{})}else{if("object"!=typeof e||null===e)throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=Object.assign({},e)}this.tokensMap.EOF=Ml;const n=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every(e=>{var t;return 0==(null===(t=e.categoryMatches)||void 0===t?void 0:t.length)});this.tokenMatcher=n?pl:fl,El(Object.values(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:nc.resyncEnabled,i=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:nc.recoveryValueFunc,s=this.ruleShortNameIdx<<12;let o;return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,o=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...t){this.onBeforeParse(e);try{return o.apply(this,t)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:t,coreRule:o})}invokeRuleCatch(e,t,n){const r=0===this.RULE_STACK_IDX,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(_u(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(Ou,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,Ou,e,Xl)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(ku,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Kl],t,ku,e,Kl)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let s=!0;for(;!0===i.call(this)&&!0===s;)s=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,jl,s)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(Iu,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,zl],t,Iu,e,zl)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,ku,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=Array.isArray(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX]),this.cstFinallyStateUpdate()}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.coreRule.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw _u(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA_FAST(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new bu(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===Fu?n:e}}}saveRecogState(){const e=this.errors,t=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);const t=e.RULE_STACK;for(let e=0;e=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX])}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=n,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ml)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let e=0;e${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:rc.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){var n;const r=null!==(n=e.coreRule)&&void 0!==n?n:e;return function(){this.isBackTrackingStack.push(1);const e=this.saveRecogState();try{return r.apply(this,t),!0}catch(e){if(_u(e))return!1;throw e}finally{this.reloadRecogState(e),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Object.values(this.gastProductionsCache).map(pa)}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:tc.errorMessageProvider}SAVE_ERROR(e){if(_u(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=lu(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],s=[];for(let e=1;e<=this.maxLookahead;e++)s.push(this.LA(e));const o=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:s,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new xu(o,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=au(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));const s=this.LA(0),o=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:s,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Tu(o,this.LA(1),s))}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const n=t>0?t:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return ec}topLevelRuleRecord(e,t){try{const n=new sa({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}}optionInternalRecord(e,t){return qu.call(this,aa,e,t)}atLeastOneInternalRecord(e,t){qu.call(this,la,t,e)}atLeastOneSepFirstInternalRecord(e,t){qu.call(this,ua,t,e,ju)}manyInternalRecord(e,t){qu.call(this,ca,t,e)}manySepFirstInternalRecord(e,t){qu.call(this,ha,t,e,ju)}orInternalRecord(e,t){return Qu.call(this,e,t)}subruleInternalRecord(e,t,n){if(Ju(t),!e||!Object.hasOwn(e,"ruleName")){const n=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=e.ruleName,s=new ia({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(s),this.outputCst?Yu:Hu}consumeInternalRecord(e,t,n){if(Ju(t),!Cl(e)){const n=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=new fa({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),Ku}},class{initPerformanceTracer(e){if(Object.hasOwn(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=tc.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()}}],sc.forEach(e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach(n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(ic.prototype,n,r):ic.prototype[n]=e.prototype[n]})});class ac extends oc{constructor(e,t=tc){const n=Object.assign({},t);n.outputCst=!1,super(e,n)}}function lc(e){return void 0!==e.lineNoCont?e.lineNoCont:e.startLine}class uc{visit(e){return e&&this[e.kind](e)}arraySpecifier(e){this.visit(e.size)}binaryExpression(e){this.visit(e.lhs),this.visit(e.rhs)}methodCall(e){this.visit(e.on),this.visit(e.functionCall)}functionCall(e){this.visit(e.callee);for(const t of e.args)this.visit(t)}arrayAccess(e){this.visit(e.on),this.visit(e.index)}translationUnit(e){for(const t of e.declarations)this.visit(t)}assignmentExpression(e){this.visit(e.lhs),this.visit(e.rhs)}fieldAccess(e){this.visit(e.on)}conditionalExpression(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}postfixExpression(e){this.visit(e.on)}commaExpression(e){this.visit(e.lhs),this.visit(e.rhs)}unaryExpression(e){this.visit(e.on)}functionDefinition(e){this.visit(e.returnType);for(const t of e.params)this.visit(t);this.visit(e.body)}functionPrototype(e){this.visit(e.returnType);for(const t of e.params)this.visit(t)}parameterDeclaration(e){this.visit(e.arraySpecifier),this.visit(e.typeSpecifier)}typeSpecifier(e){hc(e.typeSpecifierNonArray)&&this.visit(e.typeSpecifierNonArray),this.visit(e.arraySpecifier)}compoundStatement(e){for(const t of e.statements)this.visit(t)}returnStatement(e){this.visit(e.what)}continueStatement(e){}breakStatement(e){}discardStatement(e){}declarator(e){this.visit(e.arraySpecifier),this.visit(e.init)}doWhileStatement(e){this.visit(e.statement),this.visit(e.conditionExpression)}whileStatement(e){this.visit(e.conditionExpression),this.visit(e.statement)}forStatement(e){this.visit(e.initExpression),this.visit(e.conditionExpression),this.visit(e.loopExpression),this.visit(e.statement)}expressionStatement(e){this.visit(e.expression)}initDeclaratorListDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}precisionDeclaration(e){this.visit(e.typeSpecifierNoPrec)}selectionStatement(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}storageQualifier(e){}switchStatement(e){this.visit(e.initExpression);for(const t of e.cases)this.visit(t)}caseLabel(e){this.visit(e.case_)}caseBlock(e){this.visit(e.caseLabel);for(const t of e.statements)this.visit(t)}fullySpecifiedType(e){this.visit(e.typeQualifier),this.visit(e.typeSpecifier)}typeQualifier(e){this.visit(e.storageQualifier),this.visit(e.layoutQualifier)}structSpecifier(e){for(const t of e.declarations)this.visit(t)}layoutQualifier(e){}invariantDeclaration(e){}structDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}variableExpression(e){}constantExpression(e){}uniformBlock(e){this.visit(e.typeQualifier);for(const t of e.declarations)this.visit(t);this.visit(e.arraySpecifier)}ppDefine(e){this.visit(e.node)}ppDir(e){}ppExtension(e){}ppCall(e){}ppPragma(e){}}function cc(e){return"tokenType"in e}function hc(e){return"kind"in e}function dc(e,t){const n=e.split("\n"),r=t.startLine,i=t.endLine;return"./src/compiler.lambda:"+r+":"+(t.startColumn-1)+"\n"+n.map((e,t)=>[t+1,e]).slice(r-2,i+2).map(([e,n])=>{var s,o,a;return e>=r&&e<=i&&(s=n,o=6+(r===e?t.startColumn-1:0),a=6+(i===e?t.endColumn:n.length),n=s+"\n"+"-".repeat(o)+"^".repeat(a-o)),(""+e).padStart(5)+" "+n}).join("\n")}const fc=["active","asm","atomic_uint","attribute","cast","class","coherent","common","double","dvec2","dvec3","dvec4","enum","extern","external","filter","fixed","fvec2","fvec3","fvec4","goto","half","hvec2","hvec3","hvec4","iimage1D","iimage1DArray","iimage2D","iimage2DArray","iimage3D","iimageBuffer","iimageCube","image1D","image1DArray","image2D","image2DArray","image3D","imageBuffer","imageCube","inline","input","interface","isampler1D","isampler1DArray","isampler2DMS","isampler2DMSArray","isampler2DRect","isamplerBuffer","long","namespace","noinline","noperspective","output","partition","patch","public","readonly","resource","restrict","sample","sampler1D","sampler1DArray","sampler1DArrayShadow","sampler1DShadow","sampler2DMS","sampler2DMSArray","sampler2DRect","sampler2DRectShadow","sampler3DRect","samplerBuffer","short","sizeof","static","subroutine","superp","template","this","typedef","uimage1D","uimage1DArray","uimage2D","uimage2DArray","uimage3D","uimageBuffer","uimageCube","union","unsigned","usampler1D","usampler1DArray","usampler2DMS","usampler2DMSArray","usampler2DRect","usamplerBuffer","using","volatile","volatile","writeonly"];var pc;!function(e){e.ASSIGN_OP=kl({name:"ASSIGN_OP",pattern:yl.NA}),e.UNARY_OP=kl({name:"UNARY_OP",pattern:yl.NA}),e.POSTFIX_OP=kl({name:"POSTFIX_OP",pattern:yl.NA}),e.PRECISION_QUALIFIER=kl({name:"PRECISION_QUALIFIER",pattern:yl.NA}),e.INTERPOLATION_QUALIFIER=kl({name:"INTERPOLATION_QUALIFIER",pattern:yl.NA}),e.MULTIPLICATIVE_OP=kl({name:"MULTIPLICATIVE_OP",pattern:yl.NA}),e.ADDITIVE_OP=kl({name:"ADDITIVE_OP",pattern:yl.NA}),e.SHIFT_OP=kl({name:"SHIFT_OP",pattern:yl.NA}),e.RELATIONAL_OP=kl({name:"RELATIONAL_OP",pattern:yl.NA}),e.EQUALITY_OP=kl({name:"EQUALITY_OP",pattern:yl.NA}),e.PARAMETER_QUALIFIER=kl({name:"PARAMETER_QUALIFIER",pattern:yl.NA}),e.WHITESPACE=kl({name:"WHITESPACE",pattern:/\s+/,group:yl.SKIPPED}),e.LINE_COMMENT=kl({name:"LINE_COMMENT",pattern:/\/\/[^\r\n]*/,group:"COMMENTS"}),e.MULTILINE_COMMENT=kl({name:"MULTILINE_COMMENT",pattern:/\/\*[\s\S]*?\*\//,group:"COMMENTS"}),e.MULASSIGN=kl({name:"MULASSIGN",pattern:"*=",label:"'*='",categories:e.ASSIGN_OP}),e.DIVASSIGN=kl({name:"DIVASSIGN",pattern:"/=",label:"'/='",categories:e.ASSIGN_OP}),e.MODASSIGN=kl({name:"MODASSIGN",pattern:"%=",label:"'%='",categories:e.ASSIGN_OP}),e.ADDASSIGN=kl({name:"ADDASSIGN",pattern:"+=",label:"'+='",categories:e.ASSIGN_OP}),e.SUBASSIGN=kl({name:"SUBASSIGN",pattern:"-=",label:"'-='",categories:e.ASSIGN_OP}),e.LEFTASSIGN=kl({name:"LEFTASSIGN",pattern:"<<=",label:"'<<='",categories:e.ASSIGN_OP}),e.RIGHTASSIGN=kl({name:"RIGHTASSIGN",pattern:">>=",label:"'>>='",categories:e.ASSIGN_OP}),e.ANDASSIGN=kl({name:"ANDASSIGN",pattern:"&=",label:"'&='",categories:e.ASSIGN_OP}),e.XORASSIGN=kl({name:"XORASSIGN",pattern:"^=",label:"'^='",categories:e.ASSIGN_OP}),e.ORASSIGN=kl({name:"ORASSIGN",pattern:"|=",label:"'|='",categories:e.ASSIGN_OP}),e.INC_OP=kl({name:"INC_OP",pattern:"++",label:"'++'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.QUESTION=kl({name:"QUESTION",pattern:"?",label:"'?'"}),e.COLON=kl({name:"COLON",pattern:":",label:"':'"}),e.DEC_OP=kl({name:"DEC_OP",pattern:"--",label:"'--'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.AND_OP=kl({name:"AND_OP",pattern:"&&",label:"'&&'"}),e.XOR_OP=kl({name:"XOR_OP",pattern:"^^",label:"'^^'"}),e.OR_OP=kl({name:"OR_OP",pattern:"||",label:"'||'"}),e.LEFT_OP=kl({name:"LEFT_OP",pattern:"<<",label:"'<<'",categories:e.SHIFT_OP}),e.RIGHT_OP=kl({name:"RIGHT_OP",pattern:">>",label:"'>>'",categories:e.SHIFT_OP}),e.EQ_OP=kl({name:"EQ_OP",pattern:"==",label:"'=='",categories:e.EQUALITY_OP}),e.NE_OP=kl({name:"NE_OP",pattern:"!=",label:"'!='",categories:e.EQUALITY_OP}),e.LE_OP=kl({name:"LE_OP",pattern:"<=",label:"'<='",categories:e.RELATIONAL_OP}),e.GE_OP=kl({name:"GE_OP",pattern:">=",label:"'>='",categories:e.RELATIONAL_OP}),e.LEFT_ANGLE=kl({name:"LEFT_ANGLE",pattern:"<",label:"'<'",categories:e.RELATIONAL_OP}),e.RIGHT_ANGLE=kl({name:"RIGHT_ANGLE",pattern:">",label:"'>'",categories:e.RELATIONAL_OP}),e.PLUS=kl({name:"PLUS",pattern:"+",label:"'+'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.TILDE=kl({name:"TILDE",pattern:"~",label:"'~'",categories:e.UNARY_OP}),e.BANG=kl({name:"BANG",pattern:"!",label:"'!'",categories:e.UNARY_OP}),e.CARET=kl({name:"CARET",pattern:"^",label:"'^'"}),e.AMPERSAND=kl({name:"AND",pattern:"&",label:"'&'"}),e.VERTICAL_BAR=kl({name:"VERTICAL_BAR",pattern:"|",label:"'|'"}),e.SLASH=kl({name:"SLASH",pattern:"/",label:"'/'",categories:e.MULTIPLICATIVE_OP}),e.PERCENT=kl({name:"PERCENT",pattern:"%",label:"'%'",categories:e.MULTIPLICATIVE_OP}),e.STAR=kl({name:"STAR",pattern:"*",label:"'*'",categories:e.MULTIPLICATIVE_OP}),e.DASH=kl({name:"DASH",pattern:"-",label:"'-'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.COMMA=kl({name:"COMMA",pattern:",",label:"','"}),e.EQUAL=kl({name:"EQUAL",pattern:"=",label:"'='",categories:e.ASSIGN_OP}),e.LEFT_PAREN=kl({name:"LEFT_PAREN",pattern:"(",label:"'('"}),e.RIGHT_PAREN=kl({name:"RIGHT_PAREN",pattern:")",label:"')'"}),e.LEFT_BRACKET=kl({name:"LEFT_BRACKET",pattern:"[",label:"'['"}),e.RIGHT_BRACKET=kl({name:"RIGHT_BRACKET",pattern:"]",label:"']'"}),e.LEFT_BRACE=kl({name:"LEFT_BRACE",pattern:"{",label:"'{'"}),e.RIGHT_BRACE=kl({name:"RIGHT_BRACE",pattern:"}",label:"'}'"}),e.SEMICOLON=kl({name:"SEMICOLON",pattern:";",label:"';'"}),e.IDENTIFIER=kl({name:"IDENTIFIER",pattern:yl.NA}),e.NON_PP_IDENTIFIER=kl({name:"NON_PP_IDENTIFIER",pattern:/[a-z_]\w*/i,categories:e.IDENTIFIER}),e.PP=kl({name:"PP",pattern:yl.NA,categories:e.IDENTIFIER});const t=(t,n)=>kl({name:t,pattern:n,categories:e.PP,longer_alt:e.NON_PP_IDENTIFIER});e.DEFINE=t("DEFINE","define"),e.UNDEF=t("UNDEF","undef"),e.ENDIF=t("ENDIF","endif"),e.IFDEF=t("IFDEF","ifdef"),e.IFNDEF=t("IFNDEF","ifndef"),e.ELIF=t("ELIF","elif"),e.ERROR=t("ERROR","error"),e.VERSION=t("VERSION","version"),e.PRAGMA_DIRECTIVE=kl({name:"PRAGMA_DIRECTIVE",pattern:/#\s*pragma\s+[^\r\n]*/}),e.LINE=t("LINE","line"),e.EXTENSION=t("EXTENSION","extension"),e.INCLUDE=t("INCLUDE","include"),e.HASH_INCLUDE_MODULE=kl({name:"HASH_INCLUDE_MODULE",pattern:/#\s*include\s*<[\w\-./\\$@ ]+>/}),e.HASH=kl({name:"HASH",pattern:"#"}),e.KEYWORD=kl({name:"KEYWORD",pattern:yl.NA});const n=(t,n)=>kl({name:t,pattern:t.toLowerCase(),label:"'"+t.toLowerCase()+"'",longer_alt:e.NON_PP_IDENTIFIER,categories:n?[e.KEYWORD,n]:e.KEYWORD});e.CONST=n("CONST"),e.UNIFORM=n("UNIFORM"),e.LAYOUT=n("LAYOUT"),e.CENTROID=n("CENTROID"),e.FLAT=n("FLAT",e.INTERPOLATION_QUALIFIER),e.SMOOTH=n("SMOOTH",e.INTERPOLATION_QUALIFIER),e.BREAK=n("BREAK"),e.CONTINUE=n("CONTINUE"),e.DO=n("DO"),e.PRECISION=n("PRECISION"),e.FOR=n("FOR"),e.WHILE=n("WHILE"),e.SWITCH=n("SWITCH"),e.CASE=n("CASE"),e.DEFAULT=n("DEFAULT"),e.IF=n("IF"),e.ELSE=n("ELSE"),e.INVARIANT=n("INVARIANT"),e.INOUT=n("INOUT",e.PARAMETER_QUALIFIER),e.OUT=n("OUT",e.PARAMETER_QUALIFIER),e.VOID=n("VOID"),e.STRUCT=n("STRUCT"),e.DISCARD=n("DISCARD"),e.RETURN=n("RETURN"),e.LOWP=n("LOWP",e.PRECISION_QUALIFIER),e.MEDIUMP=n("MEDIUMP",e.PRECISION_QUALIFIER),e.HIGHP=n("HIGHP",e.PRECISION_QUALIFIER),e.CONSTANT=kl({name:"CONSTANT",pattern:yl.NA}),e.BASIC_TYPE=kl({name:"BASIC_TYPE",pattern:yl.NA});const r=t=>kl({name:t.toUpperCase(),pattern:t,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE});e.BOOL=r("bool"),e.INT=r("int"),e.FLOAT=r("float"),e.MAT2X3=r("mat2x3"),e.MAT2X4=r("mat2x4"),e.MAT2X2=kl({name:"mat2x2".toUpperCase(),pattern:/mat2(?:x2)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat2"}),e.MAT3X2=r("mat3x2"),e.MAT3X4=r("mat3x4"),e.MAT3X3=kl({name:"mat3x3".toUpperCase(),pattern:/mat3(?:x3)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat3"}),e.MAT4X2=r("mat4x2"),e.MAT4X3=r("mat4x3"),e.MAT4X4=kl({name:"MAT4X4",pattern:/mat4(?:x4)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat4"}),e.VEC2=r("vec2"),e.VEC3=r("vec3"),e.VEC4=r("vec4"),e.IVEC2=r("ivec2"),e.IVEC3=r("ivec3"),e.IVEC4=r("ivec4"),e.BVEC2=r("bvec2"),e.BVEC3=r("bvec3"),e.BVEC4=r("bvec4"),e.UINT=r("uint"),e.UVEC2=r("uvec2"),e.UVEC3=r("uvec3"),e.UVEC4=r("uvec4"),e.USAMPLERCUBE=r("usamplerCube"),e.USAMPLER3D=r("usampler3D"),e.USAMPLER2DARRAY=r("usampler2DArray"),e.USAMPLER2D=r("usampler2D"),e.SAMPLERCUBESHADOW=r("samplerCubeShadow"),e.SAMPLERCUBE=r("samplerCube"),e.SAMPLER3D=r("sampler3D"),e.SAMPLER2DSHADOW=r("sampler2DShadow"),e.SAMPLER2DARRAYSHADOW=r("sampler2DArrayShadow"),e.SAMPLER2DARRAY=r("sampler2DArray"),e.SAMPLER2D=r("sampler2D"),e.ISAMPLERCUBE=r("isamplerCube"),e.ISAMPLER3D=r("isampler3D"),e.ISAMPLER2DARRAY=r("isampler2DArray"),e.ISAMPLER2D=r("isampler2D"),e.IN=n("IN",e.PARAMETER_QUALIFIER),e.VARYING=n("VARYING"),e.ATTRIBUTE=n("ATTRIBUTE"),e.BOOLCONSTANT=kl({name:"BOOLCONSTANT",pattern:/true|false/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.CONSTANT}),e.FLOATCONSTANT=kl({name:"FLOATCONSTANT",pattern:/((\d+\.\d*|\.\d+)(e[+-]?\d+)?|\d+e[+-]?\d+)f?/i,categories:e.CONSTANT}),e.DOT=kl({name:"DOT",pattern:".",label:"'.'"}),e.UINTCONSTANT=kl({name:"UINTCONSTANT",pattern:/0x[\da-f]+u|\d+u/i,categories:e.CONSTANT}),e.INTCONSTANT=kl({name:"INTCONSTANT",pattern:/0x[\da-f]+|\d+/i,categories:e.CONSTANT}),e.STRING=kl({name:"STRING",pattern:/"([^"\\]+|\\")+"/})}(pc||(pc={}));const mc=Object.values(pc).filter(e=>e!==pc.NON_PP_IDENTIFIER).flatMap(e=>Array.isArray(e)?e:[e]);mc.push(pc.NON_PP_IDENTIFIER);const gc=new yl(mc,{ensureOptimizations:!1});new class extends uc{constructor(){super(...arguments),this.markError=()=>{}}eval(e,t,n){return this.isDefined=t,this.markError=n,super.visit(e)}constantExpression(e){if(e.const_.tokenType!==pc.INTCONSTANT)throw new Error("XX");return+e.const_.image}unaryExpression(e){switch(e.op.tokenType){case pc.NON_PP_IDENTIFIER:return+this.isDefined(e.on.var.image);case pc.DASH:return-this.visit(e.on);case pc.TILDE:return~this.visit(e.on);case pc.BANG:return+!this.visit(e.on);case pc.PLUS:return this.visit(e.on);default:throw new Error(e.op.tokenType.name)}}binaryExpression(e){const t=this.visit(e.lhs);switch(e.op.tokenType){case pc.AND_OP:return t&&this.visit(e.rhs);case pc.OR_OP:return t||this.visit(e.rhs);default:{const n=this.visit(e.rhs);return 0|function(e,t,n){switch(e){case pc.PLUS:return t+n;case pc.DASH:return t-n;case pc.STAR:return t*n;case pc.PERCENT:return t%n;case pc.SLASH:return t/n;case pc.LEFT_OP:return t<>n;case pc.EQ_OP:return t===n;case pc.NE_OP:return t!==n;case pc.LE_OP:return t<=n;case pc.GE_OP:return t>=n;case pc.LEFT_ANGLE:return tn;case pc.XOR_OP:return t!==n;case pc.AND_OP:return t&&n;case pc.OR_OP:return t||n;case pc.AMPERSAND:return t&n;case pc.CARET:return t^n;case pc.VERTICAL_BAR:return t|n;default:throw new Error}}(e.op.tokenType,t,n)}}}variableExpression(e){return this.markError("P0001",e.var,"undefined identifier "+e.var.image),0}};const Ec=new class extends ac{getTokensOnLine(){const e=[],t=lc(this.LA(0));let n;for(;lc(n=this.LA(1))===t;)e.push(n),this.SKIP_TOKEN();return e}constructor(){super(mc,{skipValidations:!0}),this.multiplicativeExpression=this.RR("multiplicativeExpression",()=>this.LEFT_ASSOC(this.preprocessing?this.ppUnaryExpression:this.unaryExpression,pc.MULTIPLICATIVE_OP)),this.additiveExpression=this.RR("additiveExpression",()=>this.LEFT_ASSOC(this.multiplicativeExpression,pc.ADDITIVE_OP)),this.shiftExpression=this.RR("shiftExpression",()=>this.LEFT_ASSOC(this.additiveExpression,pc.SHIFT_OP)),this.relationalExpression=this.RR("relationalExpression",()=>this.LEFT_ASSOC(this.shiftExpression,pc.RELATIONAL_OP)),this.equalityExpression=this.RR("equalityExpression",()=>this.LEFT_ASSOC(this.relationalExpression,pc.EQUALITY_OP)),this.andExpression=this.RR("andExpression",()=>this.LEFT_ASSOC(this.equalityExpression,pc.AMPERSAND)),this.exclusiveOrExpression=this.RR("exclusiveOrExpression",()=>this.LEFT_ASSOC(this.andExpression,pc.CARET)),this.inclusiveOrExpression=this.RR("inclusiveOrExpression",()=>this.LEFT_ASSOC(this.exclusiveOrExpression,pc.VERTICAL_BAR)),this.logicalAndExpression=this.RR("logicalAndExpression",()=>this.LEFT_ASSOC(this.inclusiveOrExpression,pc.AND_OP)),this.logicalXorExpression=this.RR("logicalXorExpression",()=>this.LEFT_ASSOC(this.logicalAndExpression,pc.XOR_OP)),this.logicalOrExpression=this.RR("logicalOrExpression",()=>this.LEFT_ASSOC(this.logicalXorExpression,pc.OR_OP)),this.assignmentExpression=this.RR("assignmentExpression",()=>{const e=this.SUBRULE(this.conditionalExpression);return this.OPTION(()=>{const t=this.CONSUME(pc.ASSIGN_OP),n=this.SUBRULE1(this.assignmentExpression);return{kind:"assignmentExpression",lhs:e,op:t,rhs:n}})??e}),this.expression=this.RR("expression",()=>{let e;return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.SUBRULE(this.assignmentExpression);return e=e?{kind:"commaExpression",lhs:e,rhs:t}:t}}),e}),this.conditionalExpression=this.RR("conditionalExpression",()=>{const e=this.SUBRULE1(this.logicalOrExpression);return this.OPTION(()=>({kind:"conditionalExpression",condition:e,QUESTION:this.CONSUME(pc.QUESTION),yes:this.SUBRULE2(this.expression),COLON:this.CONSUME(pc.COLON),no:this.SUBRULE3(this.assignmentExpression)}))??e}),this.switchStatement=this.RR("switchStatement",()=>{this.CONSUME(pc.SWITCH),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);this.CONSUME(pc.RIGHT_PAREN),this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.caseBlock))),this.CONSUME(pc.RIGHT_BRACE),{kind:"switchStatement",initExpression:e,cases:t}}),this.caseBlock=this.RR("caseBlock",()=>{const e=this.SUBRULE(this.caseLabel),t=[];return this.MANY1(()=>t.push(this.SUBRULE(this.statement))),{kind:"caseBlock",caseLabel:e,statements:t}}),this.jumpStatement=this.RR("jumpStatement",()=>{const e=this.OR([{ALT:()=>(this.CONSUME(pc.CONTINUE),{kind:"continueStatement"})},{ALT:()=>(this.CONSUME(pc.BREAK),{kind:"breakStatement"})},{ALT:()=>(this.CONSUME(pc.DISCARD),{kind:"discardStatement"})},{ALT:()=>(this.CONSUME(pc.RETURN),{kind:"returnStatement",what:this.OPTION(()=>this.SUBRULE(this.expression))})}]);return this.CONSUME(pc.SEMICOLON),e}),this.primaryExpression=this.RR("primaryExpression",()=>this.OR([{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),e}},{ALT:()=>({kind:"variableExpression",var:this.CONSUME(pc.IDENTIFIER)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.CONSTANT)})}])),this.constantExpression=this.RR("constantExpression",()=>this.SUBRULE(this.conditionalExpression)),this.layoutQualifier=this.RR("layoutQualifier",()=>{this.CONSUME(pc.LAYOUT),this.CONSUME(pc.LEFT_PAREN);const e=[];return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.CONSUME(pc.IDENTIFIER);let n;this.OPTION(()=>{this.CONSUME(pc.EQUAL),n=this.OR([{ALT:()=>this.CONSUME(pc.INTCONSTANT)},{ALT:()=>this.CONSUME(pc.UINTCONSTANT)}])}),e.push({IDENTIFIER:t,init:n})}}),this.CONSUME(pc.RIGHT_PAREN),{kind:"layoutQualifier",layoutQualifierIds:e}}),this.storageQualifier=this.RR("storageQualifier",()=>{let e,t,n,r,i,s,o;return this.OR([{ALT:()=>e=this.CONSUME(pc.CONST)},{ALT:()=>{t=this.OPTION(()=>this.CONSUME(pc.CENTROID)),this.OR9([{ALT:()=>n=this.CONSUME(pc.IN)},{ALT:()=>r=this.CONSUME(pc.OUT)},{ALT:()=>s=this.CONSUME(pc.VARYING)},{ALT:()=>o=this.CONSUME(pc.ATTRIBUTE)}])}},{ALT:()=>i=this.CONSUME(pc.UNIFORM)}]),{kind:"storageQualifier",CONST:e,CENTROID:t,IN:n,OUT:r,VARYING:s,ATTRIBUTE:o,UNIFORM:i}}),this.typeQualifier=this.RR("typeQualifier",()=>{let e,t,n,r;return this.OR([{ALT:()=>e=this.SUBRULE(this.storageQualifier)},{ALT:()=>{t=this.SUBRULE1(this.layoutQualifier),e=this.OPTION1(()=>this.SUBRULE2(this.storageQualifier))}},{ALT:()=>{n=this.CONSUME(pc.INTERPOLATION_QUALIFIER),e=this.OPTION2(()=>this.SUBRULE3(this.storageQualifier))}},{ALT:()=>{r=this.CONSUME(pc.INVARIANT),n=this.OPTION3(()=>this.CONSUME1(pc.INTERPOLATION_QUALIFIER)),e=this.SUBRULE7(this.storageQualifier)}}]),{kind:"typeQualifier",storageQualifier:e,layoutQualifier:t,interpolationQualifier:n,invariantQualifier:r}}),this.precisionQualifier=this.RR("precisionQualifier",()=>this.CONSUME(pc.PRECISION_QUALIFIER)),this.arraySpecifier=this.RR("arraySpecifier",()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.OPTION3(()=>this.SUBRULE(this.constantExpression));return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arraySpecifier",size:e}}),this.typeSpecifierNonArray=this.RR("typeSpecifierNonArray",()=>this.OR([{ALT:()=>this.CONSUME(pc.BASIC_TYPE)},{ALT:()=>this.CONSUME(pc.VOID)},{ALT:()=>this.SUBRULE(this.structSpecifier)},{ALT:()=>this.CONSUME(pc.IDENTIFIER)}])),this.typeSpecifierNoPrec=this.RR("typeSpecifierNoPrec",()=>{const e=this.SUBRULE(this.typeSpecifierNonArray);return{kind:"typeSpecifier",precisionQualifier:void 0,arraySpecifier:this.OPTION1(()=>this.SUBRULE(this.arraySpecifier)),typeSpecifierNonArray:e}}),this.functionCall=this.RR("functionCall",()=>{const e=this.SUBRULE(this.typeSpecifierNoPrec);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({DEF:()=>t.push(this.SUBRULE(this.assignmentExpression)),SEP:pc.COMMA}),this.CONSUME(pc.RIGHT_PAREN),{kind:"functionCall",callee:e,args:t}}),this.functionCallHeader=this.RULE("functionCallHeader",()=>{this.SUBRULE(this.typeSpecifierNoPrec),this.CONSUME(pc.LEFT_PAREN)}),this.postfixExpression=this.RR("postfixExpression",()=>{const e=this.LA(1);let t=this.OR1([{GATE:this.BACKTRACK(this.functionCallHeader),ALT:()=>this.SUBRULE1(this.functionCall)},{ALT:()=>this.SUBRULE(this.primaryExpression)}]);return this.MANY(()=>{t=this.OR2([{ALT:()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arrayAccess",on:t,index:e}}},{ALT:()=>{this.CONSUME1(pc.DOT);const e=this.SUBRULE2(this.functionCall);return{kind:"methodCall",on:t,functionCall:e}}},{ALT:()=>{this.CONSUME2(pc.DOT);const e=this.CONSUME(pc.IDENTIFIER);return{kind:"fieldAccess",on:t,field:e}}},{ALT:()=>{const e=this.CONSUME(pc.POSTFIX_OP);return{kind:"postfixExpression",on:t,op:e}}}]),this.FINALIZE(t,e)}),t}),this.unaryExpression=this.RR("unaryExpression",()=>this.OR([{ALT:()=>this.SUBRULE1(this.postfixExpression)},{ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.UNARY_OP),on:this.SUBRULE2(this.unaryExpression)})}])),this.ppUnaryExpression=this.RR("ppUnaryExpression",()=>this.OR([{GATE:()=>this.LA(1).tokenType===pc.NON_PP_IDENTIFIER&&"defined"===this.LA(1).image,ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.IDENTIFIER),on:{kind:"variableExpression",var:this.OR1([{ALT:()=>this.SUBRULE(this.ppIdentifier)},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE1(this.ppIdentifier);return this.CONSUME(pc.RIGHT_PAREN),e}}])}})},{ALT:()=>({kind:"unaryExpression",op:this.OR2([{ALT:()=>this.CONSUME(pc.PLUS)},{ALT:()=>this.CONSUME(pc.DASH)},{ALT:()=>this.CONSUME(pc.TILDE)},{ALT:()=>this.CONSUME(pc.BANG)}]),on:this.SUBRULE2(this.ppUnaryExpression)})},{ALT:()=>this.SUBRULE(this.ppPrimaryExpression)}])),this.ppPrimaryExpression=this.RR("ppPrimaryExpression",()=>this.OR([{ALT:()=>({kind:"variableExpression",var:this.SUBRULE(this.ppIdentifier)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.INTCONSTANT)})},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.ppConstantExpression);return this.CONSUME(pc.RIGHT_PAREN),e}}])),this.ppConstantExpression=this.RR("ppConstantExpression",()=>{try{return this.preprocessing=!0,this.LEFT_ASSOC(this.logicalAndExpression,pc.OR_OP)}finally{this.preprocessing=!1}}),this.typeSpecifier=this.RR("typeSpecifier",()=>{const e=this.OPTION(()=>this.SUBRULE(this.precisionQualifier)),t=this.SUBRULE(this.typeSpecifierNoPrec);return Object.assign({},t,{precisionQualifier:e})}),this.parameterDeclaration=this.RR("parameterDeclaration",()=>{const e=this.OPTION(()=>this.CONSUME(pc.CONST)),t=this.OPTION1(()=>this.CONSUME(pc.PARAMETER_QUALIFIER)),n=this.SUBRULE(this.typeSpecifier);let r,i;return this.OPTION2(()=>{r=this.CONSUME2(pc.IDENTIFIER),i=this.OPTION3(()=>this.SUBRULE(this.arraySpecifier))}),{kind:"parameterDeclaration",parameterTypeQualifier:e,pName:r,arraySpecifier:i,parameterQualifier:t,typeSpecifier:n}}),this.fullySpecifiedType=this.RR("fullySpecifiedType",()=>({kind:"fullySpecifiedType",typeQualifier:this.OPTION(()=>this.SUBRULE(this.typeQualifier)),typeSpecifier:this.SUBRULE(this.typeSpecifier)})),this.structDeclaration=this.RR("structDeclaration",()=>{const e=this.SUBRULE(this.fullySpecifiedType),t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME(pc.IDENTIFIER),arraySpecifier:this.OPTION(()=>this.SUBRULE(this.arraySpecifier)),init:void 0};return t.push(e),e})}),this.CONSUME(pc.SEMICOLON),{kind:"structDeclaration",fsType:e,declarators:t}}),this.structSpecifier=this.RR("structSpecifier",()=>{this.CONSUME(pc.STRUCT);const e=this.OPTION2(()=>this.CONSUME(pc.IDENTIFIER));this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),{kind:"structSpecifier",name:e,declarations:t}}),this.initializer=this.RR("initializer",()=>this.SUBRULE(this.assignmentExpression)),this.singleDeclaration=this.RULE("singleDeclaration",()=>this.OR([{ALT:()=>{this.SUBRULE(this.fullySpecifiedType),this.OPTION1(()=>{this.CONSUME1(pc.IDENTIFIER),this.OPTION2(()=>{this.CONSUME(pc.LEFT_BRACKET),this.OPTION3(()=>this.SUBRULE(this.constantExpression)),this.CONSUME(pc.RIGHT_BRACKET)}),this.OPTION4(()=>{this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)})})}},{ALT:()=>({kind:"invariantDeclaration",INVARIANT:this.CONSUME(pc.INVARIANT),IDENTIFIER:this.CONSUME2(pc.IDENTIFIER)})}])),this.initDeclaratorList=this.RR("initDeclaratorList",()=>this.SUBRULE(this.externalDeclaration,{ARGS:[!1,!1]})),this.expressionStatement=this.RR("expressionStatement",()=>{const e=this.OPTION(()=>this.SUBRULE(this.expression));return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:e}}),this.condition=this.RR("condition",()=>this.OR({MAX_LOOKAHEAD:4,DEF:[{GATE:this.BACKTRACK(this.singleDeclaration),ALT:()=>{const e=this.SUBRULE2(this.fullySpecifiedType),t=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.EQUAL),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:[{kind:"declarator",name:t,init:this.SUBRULE3(this.initializer),arraySpecifier:void 0}]}}},{ALT:()=>this.SUBRULE(this.expression)}]})),this.caseLabel=this.RR("caseLabel",()=>this.OR([{ALT:()=>{this.CONSUME(pc.CASE);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.COLON),{kind:"caseLabel",case_:e}}},{ALT:()=>(this.CONSUME2(pc.DEFAULT),this.CONSUME2(pc.COLON),{kind:"caseLabel",case_:void 0})}])),this.selectionStatement=this.RR("selectionStatement",()=>{this.CONSUME(pc.IF),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),{kind:"selectionStatement",condition:e,yes:this.SUBRULE2(this.statement,{ARGS:[!0]}),no:this.OPTION(()=>(this.CONSUME(pc.ELSE),this.SUBRULE3(this.statement,{ARGS:[!0]})))}}),this.statement=this.RR("statement",e=>this.OR([{ALT:()=>this.SUBRULE(this.ppDirective),IGNORE_AMBIGUITIES:!0},{ALT:()=>{const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:{kind:"variableExpression",var:e}}},IGNORE_AMBIGUITIES:!0},{GATE:this.BACKTRACK(this.expressionStatement),ALT:()=>this.SUBRULE(this.expressionStatement)},{ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.selectionStatement)},{ALT:()=>this.SUBRULE(this.switchStatement)},{ALT:()=>this.SUBRULE(this.iterationStatement)},{ALT:()=>this.SUBRULE(this.jumpStatement)},{ALT:()=>this.SUBRULE(this.compoundStatement,{ARGS:[!!e]})}])),this.compoundStatement=this.RR("compoundStatement",e=>{if("object"==typeof e)throw new Error;this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.statement))),this.CONSUME(pc.RIGHT_BRACE),{kind:"compoundStatement",statements:t,newScope:!!e}}),this.iterationStatement=this.RR("iterationStatement",()=>this.OR([{ALT:()=>{this.CONSUME(pc.WHILE),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.condition);return this.CONSUME(pc.RIGHT_PAREN),{kind:"whileStatement",conditionExpression:e,statement:this.SUBRULE(this.statement)}}},{ALT:()=>{this.CONSUME2(pc.DO);const e=this.SUBRULE2(this.statement,{ARGS:[!0]});this.CONSUME2(pc.WHILE),this.CONSUME2(pc.LEFT_PAREN);const t=this.SUBRULE2(this.expression);return this.CONSUME2(pc.RIGHT_PAREN),this.CONSUME2(pc.SEMICOLON),{kind:"doWhileStatement",statement:e,conditionExpression:t}}},{ALT:()=>{this.CONSUME3(pc.FOR),this.CONSUME3(pc.LEFT_PAREN);const e=this.OR3([{GATE:this.BACKTRACK(this.initDeclaratorList),ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.expressionStatement)}]),t=this.OPTION3(()=>this.SUBRULE3(this.condition));this.CONSUME4(pc.SEMICOLON);const n=this.OPTION4(()=>this.SUBRULE4(this.expression));return this.CONSUME3(pc.RIGHT_PAREN),{kind:"forStatement",initExpression:e,conditionExpression:t,loopExpression:n,statement:this.SUBRULE3(this.statement)}}}])),this.translationUnit=this.RR("translationUnit",()=>{const e=[];return this.AT_LEAST_ONE(()=>e.push(this.SUBRULE(this.externalDeclaration,{ARGS:[!0,!0]}))),{kind:"translationUnit",declarations:e}}),this.uniformBlock=this.RR("uniformBlock",()=>{const e=this.SUBRULE(this.typeQualifier),t=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_BRACE);const n=[];let r,i;return this.MANY(()=>n.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),this.OPTION(()=>{r=this.CONSUME1(pc.IDENTIFIER),i=this.OPTION1(()=>this.SUBRULE(this.arraySpecifier))}),this.CONSUME(pc.SEMICOLON),{kind:"uniformBlock",typeQualifier:e,blockName:t,declarations:n,namespace:r,arraySpecifier:i}}),this.uniformBlockHeader=this.RULE("uniformBlockHeader",()=>{this.OPTION(()=>this.SUBRULE(this.layoutQualifier)),this.CONSUME(pc.UNIFORM),this.CONSUME(pc.IDENTIFIER),this.CONSUME(pc.LEFT_BRACE)}),this.typeQualifierDeclaration=this.RR("typeQualifierDeclaration",()=>{const e=this.SUBRULE(this.typeQualifier);return this.CONSUME(pc.SEMICOLON),{kind:"typeQualifierDeclaration",typeQualifier:e}}),this.externalDeclaration=this.RR("externalDeclaration",(e,t)=>this.OR([{ALT:()=>this.SUBRULE(this.ppCall)},{ALT:()=>this.SUBRULE(this.ppDirective)},{GATE:this.BACKTRACK(this.typeQualifierDeclaration),ALT:()=>this.SUBRULE(this.typeQualifierDeclaration)},{GATE:e?this.BACKTRACK(this.uniformBlockHeader):()=>!1,ALT:()=>this.SUBRULE(this.uniformBlock)},{ALT:()=>{const e=this.SUBRULE(this.fullySpecifiedType);return this.OR2([{GATE:t?void 0:()=>!1,ALT:()=>{const t=this.CONSUME1(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const n=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>n.push(this.SUBRULE(this.parameterDeclaration))}),this.CONSUME(pc.RIGHT_PAREN),this.OR3([{ALT:()=>(this.CONSUME(pc.SEMICOLON),{kind:"functionPrototype",name:t,returnType:e,params:n})},{ALT:()=>{const r=this.SUBRULE(this.compoundStatement);return{kind:"functionDefinition",name:t,returnType:e,params:n,body:r}},IGNORE_AMBIGUITIES:!1}])}},{ALT:()=>{const t=[];return this.MANY_SEP2({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME3(pc.IDENTIFIER),arraySpecifier:this.OPTION5(()=>this.SUBRULE(this.arraySpecifier)),init:this.OPTION7(()=>(this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)))};return t.push(e),e})}),this.CONSUME2(pc.SEMICOLON),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:t}}}])}},{ALT:()=>{this.CONSUME(pc.PRECISION);const e=this.CONSUME(pc.PRECISION_QUALIFIER),t=this.SUBRULE(this.typeSpecifierNoPrec);return this.CONSUME3(pc.SEMICOLON),{kind:"precisionDeclaration",precisionQualifier:e,typeSpecifierNoPrec:t}}}])),this.ppDefine=this.RR("ppDefine",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.DEFINE);const e=this.CONSUME(pc.IDENTIFIER),t=this.LA(1).tokenType===pc.LEFT_PAREN&&e.endOffset+1===this.LA(1).startOffset,n={kind:"ppDefine",what:e,params:this.OPTION({GATE:()=>t,DEF:()=>{this.CONSUME(pc.LEFT_PAREN);const e=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>e.push(this.SUBRULE(this.ppIdentifier))}),this.CONSUME(pc.RIGHT_PAREN),e}}),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(n),n}),this.ppInclude=this.RR("ppInclude",()=>{let e="";return this.OR([{ALT:()=>{const t=this.CONSUME(pc.HASH_INCLUDE_MODULE);e=t.image.substring(t.image.indexOf("<"))}},{ALT:()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.INCLUDE),e=this.CONSUME(pc.STRING).image}}]),{kind:"ppInclude",what:e}}),this.ppCall=this.RR("ppCall",()=>{const e=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>{const e=[];this.MANY(()=>this.OR({DEF:[{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>e.push(this.CONSUME(pc.BASIC_TYPE))},{ALT:()=>e.push(this.CONSUME(pc.ASSIGN_OP))},{ALT:()=>e.push(this.CONSUME(pc.SHIFT_OP))},{ALT:()=>e.push(this.CONSUME(pc.CONSTANT))},{ALT:()=>e.push(this.CONSUME(pc.KEYWORD))},{ALT:()=>e.push(this.CONSUME2(pc.IDENTIFIER))}]})),t.push({tokens:e,node:void 0})},MAX_LOOKAHEAD:1}),this.CONSUME(pc.RIGHT_PAREN),{kind:"ppCall",callee:e,args:t}}),this.ppCallArg=this.RULE("ppCallArg",()=>{const e=[];return e.push(this.CONSUME(pc.LEFT_PAREN)),this.MANY(()=>this.OR([{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>(e.push(this.LA(1)),this.SKIP_TOKEN())}])),e.push(this.CONSUME(pc.RIGHT_PAREN)),e}),this.ppNone=this.RR("ppNone",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.ELSE)},{ALT:()=>this.CONSUME(pc.ENDIF)}]),tokens:[],node:void 0};return this.ppDefs.push(e),e}),this.ppMulti=this.RR("ppMulti",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IF)},{ALT:()=>this.CONSUME(pc.ELIF)},{ALT:()=>this.CONSUME(pc.ERROR)},{ALT:()=>this.CONSUME(pc.VERSION)},{ALT:()=>this.CONSUME(pc.LINE)}]),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(e),e}),this.ppPragma=this.RR("ppPragma",()=>({kind:"ppPragma",dir:this.CONSUME(pc.PRAGMA_DIRECTIVE)})),this.ppSingle=this.RR("ppSingle",()=>(this.CONSUME(pc.HASH),{kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IFDEF)},{ALT:()=>this.CONSUME(pc.IFNDEF)}]),tokens:[this.CONSUME(pc.IDENTIFIER)],node:void 0})),this.ppExtension=this.RR("ppExtension",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.EXTENSION);const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.COLON),{kind:"ppExtension",extension:e,behavior:this.CONSUME1(pc.IDENTIFIER)}}),this.ppDirective=this.RR("ppDirective",()=>this.OR([{ALT:()=>this.SUBRULE(this.ppDefine)},{ALT:()=>this.SUBRULE(this.ppExtension)},{ALT:()=>this.SUBRULE(this.ppNone)},{ALT:()=>this.SUBRULE(this.ppSingle)},{ALT:()=>this.SUBRULE(this.ppMulti)},{ALT:()=>this.SUBRULE(this.ppPragma)},{ALT:()=>this.SUBRULE(this.ppInclude)}])),this.ppIdentifier=this.RR("ppIdentifier",()=>this.OR([{ALT:()=>this.CONSUME(pc.IDENTIFIER)},{ALT:()=>this.CONSUME(pc.KEYWORD)},{ALT:()=>this.CONSUME(pc.BASIC_TYPE)}])),this.ppDefs=[],this.performSelfAnalysis()}reset(){super.reset(),this.ppDefs=[],this.backtracking=!1,this.preprocessing=!1}LEFT_ASSOC(e,t){const n=this.LA(1);let r=this.SUBRULE1(e);return this.MANY(()=>{const i=this.CONSUME(t),s=this.SUBRULE2(e);return r={kind:"binaryExpression",lhs:r,rhs:s,op:i,firstToken:n,lastToken:this.LA(0)},r}),r}ANNOTATE(e){return(...t)=>{const n=this.LA(1),r=e(...t);return r&&hc(r)&&!r.firstToken&&this.FINALIZE(r,n),r}}BACKTRACK(e,t){const n=super.BACKTRACK(e,t);return function(){try{return this.backtracking=!0,n.call(this)}finally{this.backtracking=!1}}}RR(e,t,n){return super.RULE(e,this.ANNOTATE(t),n)}FINALIZE(e,t){this.RECORDING_PHASE||this.backtracking||(e.firstToken=t,e.lastToken=this.LA(0))}isAtEof(){return this.LA(1).tokenType===Ml}};const{ll:{printDocToString:vc},LX:{indentIfBreak:Cc,group:Dc,indent:Sc,join:Ac,line:_c,softline:yc,hardline:bc,fill:Tc,lineSuffixBoundary:Rc}}=r,xc=new class extends uc{constructor(){super(...arguments),this.result=void 0}visit(e){if(!this.result){const t=this.result=[];return super.visit(e),this.result=void 0,t}e&&this.result.push(e)}};function wc(e){return(cc(e)?e:e.lastToken).endOffset+1}const Fc={"glsl-parser":{parse(e,t){const n=function(e){const t=function(e){const t=[];let n="",r=0,i=0;return{result:e.replace(/\\(\r\n|\n\r|\r|\n)(.*?)(?:(?=\\?[\r\n])|$)/g,(s,o,a,l)=>{r++,i+=function(e,t){let n=t;for(;n>=0&&"\r"!==e[n]&&"\n"!==e[n];)n--;return t-n-1}(e,l),t.push({originalOffset:l+1+o.length,newOffset:l-n.length,length:a.length,lineDiff:-r,columnDiff:i}),n+=" "+o;let u="";return e.length>l+s.length&&"\\"===e[l+s.length]||(u=n,n="",r=0,i=0),a+u}),changes:t}}(e),n=gc.tokenize(t.result);!function(e,t){if(t.errors.length)throw new Error("LEXER ERROR: "+t.errors.map(t=>t.message+":\n"+dc(e,{startLine:t.line,startColumn:t.column,endLine:t.line,endColumn:t.column+t.length})).join())}(t.result,n),function(e,t){let n=0;function r(e,t){const n=t.originalOffset-t.newOffset;e.startOffset>=t.newOffset&&(e.lineNoCont=e.startLine,e.startOffset+=n,e.startLine-=t.lineDiff,e.startColumn-=t.columnDiff),e.endOffset+=n,e.endLine-=t.lineDiff,e.endColumn-=t.columnDiff}for(const i of t){for(;e[n]&&e[n].endOffset0)throw new Error("PARSE ERROR: "+t.map(t=>t.message+"\n"+t.context.ruleStack.join(" > ")+"\n"+dc(e,t.token)).join("\n"))}(t.result,Ec.errors);const i=Ec.ppDefs;function s(e,t){Ec.input=e;const n=t(Ec);return Ec.isAtEof()&&0===Ec.errors.length?n:void 0}for(const e of i)e.node=s(e.tokens,e=>e.externalDeclaration(!0,!0))??s(e.tokens,e=>e.statement())??s(e.tokens,e=>e.expression());return r.comments=n.groups.COMMENTS,r}(e);return n.comments?.forEach(e=>e.value=JSON.stringify(e)),n},astFormat:"glsl-ast",locStart:function(e){return(cc(e)?e:e.firstToken).startOffset},locEnd:wc}};function Nc(e){switch(e){case pc.STAR:case pc.SLASH:case pc.PERCENT:return 4;case pc.PLUS:case pc.DASH:return 5;case pc.LEFT_OP:case pc.RIGHT_OP:return 6;case pc.LEFT_ANGLE:case pc.RIGHT_ANGLE:case pc.LE_OP:case pc.GE_OP:return 7;case pc.EQ_OP:case pc.NE_OP:return 8;case pc.AMPERSAND:return 9;case pc.CARET:return 10;case pc.VERTICAL_BAR:return 11;case pc.AND_OP:case pc.XOR_OP:return 12;case pc.OR_OP:return 13;case pc.COMMA:return 17;default:throw new Error}}function Lc(e,t){switch(e.kind){default:return 1;case"variableExpression":return t?.find(t=>t.image===e.var.image)?18:1;case"arrayAccess":case"functionCall":case"fieldAccess":case"postfixExpression":return 2;case"unaryExpression":return 3;case"binaryExpression":return Nc(e.op.tokenType);case"conditionalExpression":return 15;case"assignmentExpression":return 16;case"commaExpression":return 17}}function Oc(e,t){return t?["(",e,")"]:e}function Ic(e,t,n,r){const i="binaryExpression"===n.kind&&"binaryExpression"===n.lhs.kind&&Nc(n.lhs.op.tokenType)===Nc(n.op.tokenType)||"commaExpression"===n.kind&&"commaExpression"===n.lhs.kind,s="binaryExpression"===n.kind?n.op.tokenType:pc.COMMA;let o;return i?(o=e.call(e=>Ic(e,t,e.getValue(),r),"lhs"),o.push("commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))),o):[Oc(e.call(t,"lhs"),Lc(n.lhs,r)>Nc(s)),"commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))]}function kc(e,t,n){return"expressionStatement"!==e.kind||e.expression?"compoundStatement"===e.kind||n?[" ",t]:Sc([_c,t]):";"}function Mc(e,t){return vc(e,Object.assign({},t,{printWidth:t.printWidth-2})).formatted.trim().replace(/^.*(?=[\r\n])/gm,e=>e+" ".repeat(t.printWidth-2-e.length+1)+"\\")}function Pc(e){return"assignmentExpression"===e.kind}function Bc(e){return"assignmentExpression"===e.kind||"declarator"===e.kind}function Uc(e,t,n,r,i,s){const o=function(e,t,n){if(!n)return"only-left";const r=!Pc(n);return e.match(Pc,Bc,e=>!r||"expressionStatement"!==e.kind&&"initDeclaratorListDeclaration"!==e.kind)?r?"chain-tail":"chain":!r&&Pc(n.rhs)||(t.originalText,0)||"binaryExpression"===n.kind||"commaExpression"===n.kind||"conditionalExpression"===n.kind&&"binaryExpression"===n.condition.kind?"break-after-operator":"constantExpression"===n.kind?"never-break-after-operator":"fluid"}(e,t,s);switch(o){case"break-after-operator":return Dc([Dc(n),r,Dc(Sc([_c,i]))]);case"never-break-after-operator":return Dc([Dc(n),r," ",i]);case"fluid":{const e=Symbol("assignment");return Dc([Dc(n),r,Dc(Sc(_c),{id:e}),Rc,Cc(i,{groupId:e})])}case"chain":return[Dc(n),r,_c,i];case"chain-tail":return[Dc(n),r,Sc([_c,i])];case"only-left":return n;default:throw new Error}}const $c={"glsl-ast":{print(e,t,n){const r=t.inMacro,i=e.getValue();if(!i)return[];if(cc(i))return i.image;const s=t=>e.call(n,t);try{switch(i.kind){case"translationUnit":{const r=[];return e.each((e,i)=>{const s=e.getValue();r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc),r.push(bc)},"declarations"),r}case"precisionDeclaration":return["precision ",i.precisionQualifier.image," ",e.call(n,"typeSpecifierNoPrec"),";"];case"fullySpecifiedType":{const e=[];return i.typeQualifier&&e.push(s("typeQualifier")," "),e.push(s("typeSpecifier")),e}case"typeSpecifier":{const e=[];return i.precisionQualifier&&e.push(i.precisionQualifier.image," "),e.push(s("typeSpecifierNonArray")),i.arraySpecifier&&e.push(s("arraySpecifier")),e}case"typeQualifier":{const e=[];return i.invariantQualifier&&e.push("invariant"),i.interpolationQualifier&&e.push(i.interpolationQualifier.image),i.layoutQualifier&&e.push(s("layoutQualifier")),i.storageQualifier&&e.push(s("storageQualifier")),Ac(" ",e)}case"storageQualifier":{const t=[];return i.CONST&&t.push("const"),i.CENTROID&&e.getParentNode().interpolationQualifier?.tokenType!==pc.FLAT&&t.push("centroid"),i.IN&&t.push("in"),i.OUT&&t.push("out"),i.VARYING&&t.push("varying"),i.ATTRIBUTE&&t.push("attribute"),i.UNIFORM&&t.push("uniform"),Ac(" ",t)}case"functionPrototype":case"functionDefinition":return[Dc([s("returnType")," ",s("name"),"(",Sc([yc,Ac([",",_c],e.map(n,"params"))]),yc,")"]),"functionPrototype"===i.kind?";":[" ",s("body")]];case"parameterDeclaration":return[i.parameterTypeQualifier?[s("parameterTypeQualifier")," "]:"",i.parameterQualifier?.tokenType===pc.OUT||i.parameterQualifier?.tokenType===pc.INOUT?i.parameterQualifier?.image+" ":"",s("typeSpecifier")," ",s("pName"),s("arraySpecifier")];case"initDeclaratorListDeclaration":case"structDeclaration":{const t=e.map(n,"declarators"),r="forStatement"===e.getParentNode().kind,o=i.declarators.some(e=>e.init);return Dc([s("fsType"),0===t.length?"":" ",1===t.length?t:Dc(Sc(Ac([",",o&&!r?bc:_c],t))),";"])}case"declarator":{const n=s("arraySpecifier"),r=[i.name.image,n];return Uc(e,t,r," =",s("init"),i.init)}case"arraySpecifier":return Dc(["[",Sc([yc,s("size")]),yc,"]"]);case"arrayAccess":return[Oc(s("on"),Lc(i.on,r)>2),"[",s("index"),"]"];case"structSpecifier":{const r=[];return e.each((e,i,s)=>{const o=e.getValue();r.push(bc),r.push(n(e)),i!==s.length-1&&_s.isNextLineEmpty(t.originalText,o,wc)&&r.push(bc)},"declarations"),Dc(["struct",i.name?" "+i.name.image:""," {",Sc(r),bc,"}"])}case"compoundStatement":{const r=[],s=!!i.comments?.some(e=>!e.leading&&!e.trailing&&!e.printed);return e.each((e,i)=>{const s=e.getValue();0!==i&&r.push(bc),r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc)},"statements"),s&&e.each(e=>{const t=e.getValue();t.leading||t.trailing||(r.push(n(e)),t.printed=!0)},"comments"),Dc(["{",r.length?[Sc([bc,r]),bc]:"","}"])}case"returnStatement":return i.what?["return"," ",s("what"),";"]:"return;";case"breakStatement":return"break;";case"continueStatement":return"continue;";case"discardStatement":return"discard;";case"selectionStatement":{const e=[],t=kc(i.yes,s("yes"),!1),n=Dc(["if (",Dc([Sc([yc,s("condition")]),yc]),")",t]);if(e.push(n),i.no){const t=i.yes.comments?.some(e=>e.trailing&&e.tokenType===pc.LINE_COMMENT)||i.yes.comments?.findLast(e=>!e.leading&&!e.trailing)?.tokenType===pc.LINE_COMMENT,n="compoundStatement"===i.yes.kind&&!t;e.push(n?" ":bc),e.push("else",Dc(kc(i.no,s("no"),"selectionStatement"===i.no.kind)))}return e}case"forStatement":{const e=kc(i.statement,s("statement"),!1),t=!1,n=t?[t,yc]:"";return"expressionStatement"!==i.initExpression.kind||i.initExpression.expression||i.conditionExpression||i.loopExpression?[n,Dc(["for (",Dc([Sc([yc,s("initExpression"),_c,s("conditionExpression"),";",_c,s("loopExpression")]),yc]),")",e])]:[n,Dc(["for (;;)",e])]}case"whileStatement":{const e=kc(i.statement,s("statement"),!1);return["while (",Dc(s("conditionExpression")),")",e]}case"doWhileStatement":return["do ",s("statement")," while (",Dc(s("conditionExpression")),");"];case"functionCall":return function(t){const r=e.map(n,"args");let i,o;if(void 0===t.callee.arraySpecifier&&cc(t.callee.typeSpecifierNonArray)&&void 0!==(i=function(e){switch(e){case pc.MAT2X2:return[2,2];case pc.MAT2X3:return[2,3];case pc.MAT2X4:return[2,4];case pc.MAT3X2:return[3,2];case pc.MAT3X3:return[3,3];case pc.MAT3X4:return[3,4];case pc.MAT4X2:return[4,2];case pc.MAT4X3:return[4,3];case pc.MAT4X4:return[4,4];default:return}}(t.callee.typeSpecifierNonArray.tokenType))&&i[0]*i[1]===t.args.length){const e=t.args.every(e=>"constantExpression"===e.kind&&(e.const_.tokenType===pc.FLOATCONSTANT||e.const_.tokenType===pc.INTCONSTANT)||"unaryExpression"===e.kind&&(e.op.tokenType===pc.PLUS||e.op.tokenType===pc.DASH)&&"constantExpression"===e.on.kind&&(e.on.const_.tokenType===pc.FLOATCONSTANT||e.on.const_.tokenType===pc.INTCONSTANT));if(e){const e=[],n=[];let s=0,a=0;for(let i=0;i2),".",s("functionCall")];case"postfixExpression":return[Oc(s("on"),Lc(i.on,r)>2),s("op")];case"unaryExpression":return[s("op"),Oc(s("on"),Lc(i.on,r)>3)];case"assignmentExpression":{const n=s("lhs");return Uc(e,t,n," "+i.op.image,s("rhs"),i.rhs)}case"conditionalExpression":return[Oc(s("condition"),Lc(i.condition,r)>=15),Sc([_c,"? ",s("yes"),_c,": ",s("no")])];case"commaExpression":case"binaryExpression":{const t=Ic(e,n,i,r),s=e.getParentNode();if("selectionStatement"===s.kind||"whileStatement"===s.kind||"switchStatement"===s.kind||"doWhileStatement"===s.kind)return t;const o=()=>{const t=e.getParentNode();return!!t&&("functionCall"===t.kind&&"commaExpression"===i.kind||"binaryExpression"===t.kind&&((n=t.op.tokenType)===pc.CARET||n===pc.VERTICAL_BAR||n===pc.AMPERSAND));var n},a=e.getParentNode(1);if("returnStatement"===s.kind||"forStatement"===s.kind||"conditionalExpression"===s.kind&&"returnStatement"!==a.kind&&"functionCall"!==a.kind||"assignmentExpression"===s.kind||"declarator"===s.kind)return Dc(t);{const e=t.slice(0,1),n=t.slice(e.length);return Dc(Oc([...e,Sc(n)],o()))}}case"expressionStatement":return[s("expression"),";"];case"fieldAccess":return[Oc(s("on"),Lc(i.on,r)>2),".",s("field")];case"constantExpression":{const e=i.const_;return e.tokenType===pc.FLOATCONSTANT?function(e){const t=e.indexOf(".");return 0===t&&(e="0"+e),e=e.replace("E","e"),-1!==t&&(e=(e=(e=(e=e.replace(".e","e")).replace(/(?=4):Tc(Ac(_c,e.map(n,"tokens")))])]);return t.inMacro=void 0,Mc(r,t)}case"ppDir":return Mc(Dc(["#",i.dir.image," ",Sc(i.node?s("node"):Tc(Ac(_c,e.map(n,"tokens"))))]),t);case"ppPragma":return i.dir.image.replace(/^#\s+/,"#").replace(/^#pragma\s{2,}/,"#pragma ");case"ppCall":return Dc([i.callee.image,"(",Ac([",",_c],e.map((e,t,n)=>n[t].tokens.map(e=>e.image),"args")),")"]);case"ppInclude":return["#include ",i.what];case"ppExtension":return["#extension ",i.extension.image," : ",i.behavior.image];case"switchStatement":return["switch (",Dc([Sc([yc,s("initExpression")]),yc]),") {",i.cases.length?Sc([bc,Ac(bc,e.map(n,"cases"))]):"",bc,"}"];case"caseBlock":{const r=s("caseLabel"),i=[];return e.each((e,r)=>{const s=e.getValue();i.push(bc),i.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&i.push(bc)},"statements"),[r,Sc(i)]}case"caseLabel":return void 0===i.case_?"default:":["case ",s("case_"),":"];case"layoutQualifier":return["layout(",Ac(", ",i.layoutQualifierIds.map(e=>void 0===e.init?e.IDENTIFIER.image:[e.IDENTIFIER.image," = ",e.init.image])),")"];case"uniformBlock":return[s("typeQualifier")," ",i.blockName.image," {",Sc([bc,Ac(bc,e.map(n,"declarations"))]),bc,"};"];case"typeQualifierDeclaration":return[s("typeQualifier"),";"];default:throw new Error("unexpected n type "+i.kind+"\n"+JSON.stringify(i).substring(0,100))}}catch(e){throw console.error("error printing "+JSON.stringify(i).substring(0,100)+"\n"),e}},embed(e,t){const n=e.getValue();return!cc(n)||n.tokenType!==pc.LINE_COMMENT&&n.tokenType!==pc.MULTILINE_COMMENT?null:(e,t,n,r)=>{}},getVisitorKeys:(e,t)=>cc(e)?[]:Object.keys(e).filter(e=>!t.has(e)),getCommentChildNodes:e=>cc(e)?[]:xc.visit(e),canAttachComment:e=>!0,printComment:function(e,t){const n=e.getValue();return n.tokenType===pc.MULTILINE_COMMENT&&"*"===n.image[2]?"/**\n"+n.image.substring(3,n.image.length-2).split("\n").map(e=>" *"===e?"":e.startsWith(" * ")?e.substring(3):e).join("\n").trim().split("\n").map(e=>""===e?" *":" * "+e).join("\n")+"\n */":n.image},hasPrettierIgnore(e){const t=e.getValue();return(t&&hc(t)&&t.comments?.some(e=>/\/\/\s*prettier-ignore\b.*/.test(e.image)))??!1}}},Gc={parsers:Fc,printers:$c};function Vc(e){return e.replace(/^([^\n]*;)\n(?=(?:[A-Za-z_]\w*\s+)+[A-Za-z_]\w*\s*\()/gm,"$1\n\n").replace(/^}\n(?=\S)/gm,"}\n\n")}var Wc,Hc,jc=(Wc={program:function(e){return jc(e.program)+jc(e.wsEnd)},segment:function(e){return jc(e.blocks)},text:function(e){return jc(e.text)},literal:function(e){return jc(e.wsStart)+jc(e.literal)+jc(e.wsEnd)},identifier:function(e){return jc(e.identifier)+jc(e.wsEnd)},binary:function(e){return jc(e.left)+jc(e.operator)+jc(e.right)},group:function(e){return jc(e.lp)+jc(e.expression)+jc(e.rp)},unary:function(e){return jc(e.operator)+jc(e.expression)},unary_defined:function(e){return jc(e.operator)+jc(e.lp)+jc(e.identifier)+jc(e.rp)},int_constant:function(e){return jc(e.token)+jc(e.wsEnd)},elseif:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},if:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},ifdef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},ifndef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},else:function(e){return jc(e.token)+jc(e.wsEnd)+jc(e.body)},error:function(e){return jc(e.error)+jc(e.message)+jc(e.wsEnd)},undef:function(e){return jc(e.undef)+jc(e.identifier)+jc(e.wsEnd)},define:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.body)+jc(e.wsEnd)},define_arguments:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.lp)+jc(e.args)+jc(e.rp)+jc(e.body)+jc(e.wsEnd)},conditional:function(e){return jc(e.wsStart)+jc(e.ifPart)+jc(e.elseIfParts)+jc(e.elsePart)+jc(e.endif)+jc(e.wsEnd)},version:function(e){return jc(e.version)+jc(e.value)+jc(e.profile)+jc(e.wsEnd)},pragma:function(e){return jc(e.pragma)+jc(e.body)+jc(e.wsEnd)},line:function(e){return jc(e.line)+jc(e.value)+jc(e.wsEnd)},extension:function(e){return jc(e.extension)+jc(e.name)+jc(e.colon)+jc(e.behavior)+jc(e.wsEnd)}},Hc=function(e){return"string"==typeof e?e:null==e?"":Array.isArray(e)?e.map(Hc).join(""):e.type in Wc?Wc[e.type](e):"NO GENERATOR FOR ".concat(e.type)+e});const zc=jc;function Xc(e,t,n,r){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Xc.prototype),i.expected=t,i.found=n,i.location=r,i.name="SyntaxError",i}function Kc(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}function Yc(e,t){var n,r={},i=(t=void 0!==t?t:{}).grammarSource,s={program:An,constant_expression:hr},o=An,a="<<",l=">>",u="<=",c=">=",h="==",d="!=",f="&&",p="||",m="(",g=")",E=",",v="!",C="-",D="~",S="+",A="*",_="/",y="%",b="<",T=">",R="|",x="^",w="&",F=":",N="#",L="define",O="line",I="undef",k="error",M="pragma",P="defined",B="if",U="ifdef",$="ifndef",G="elif",V="else",W="endif",H="version",j="extension",z="0",X="//",K="/*",Y="*/",q=/^[A-Za-z_]/,Q=/^[A-Za-z_0-9]/,Z=/^[uU]/,J=/^[1-9]/,ee=/^[0-7]/,te=/^[xX]/,ne=/^[0-9a-fA-F]/,re=/^[0-9]/,ie=/^[\n\r]/,se=/^[^\n\r]/,oe=/^[ \t]/,ae=gn("<<",!1),le=gn(">>",!1),ue=gn("<=",!1),ce=gn(">=",!1),he=gn("==",!1),de=gn("!=",!1),fe=gn("&&",!1),pe=gn("||",!1),me=gn("(",!1),ge=gn(")",!1),Ee=gn(",",!1),ve=gn("!",!1),Ce=gn("-",!1),De=gn("~",!1),Se=gn("+",!1),Ae=gn("*",!1),_e=gn("/",!1),ye=gn("%",!1),be=gn("<",!1),Te=gn(">",!1),Re=gn("|",!1),xe=gn("^",!1),we=gn("&",!1),Fe=gn(":",!1),Ne=gn("#",!1),Le=gn("define",!1),Oe=(gn("include",!1),gn("line",!1)),Ie=gn("undef",!1),ke=gn("error",!1),Me=gn("pragma",!1),Pe=gn("defined",!1),Be=gn("if",!1),Ue=gn("ifdef",!1),$e=gn("ifndef",!1),Ge=gn("elif",!1),Ve=gn("else",!1),We=gn("endif",!1),He=gn("version",!1),je=gn("extension",!1),ze=En([["A","Z"],["a","z"],"_"],!1,!1),Xe=En([["A","Z"],["a","z"],"_",["0","9"]],!1,!1),Ke=vn("number"),Ye=En(["u","U"],!1,!1),qe=En([["1","9"]],!1,!1),Qe=gn("0",!1),Ze=En([["0","7"]],!1,!1),Je=En(["x","X"],!1,!1),et=En([["0","9"],["a","f"],["A","F"]],!1,!1),tt=En([["0","9"]],!1,!1),nt=vn("control line"),rt=En(["\n","\r"],!1,!1),it=vn("token string"),st=En(["\n","\r"],!0,!1),ot=vn("text"),at=vn("if"),lt=vn("primary expression"),ut=vn("unary expression"),ct=vn("multiplicative expression"),ht=vn("additive expression"),dt=vn("shift expression"),ft=vn("relational expression"),pt=vn("equality expression"),mt=vn("and expression"),gt=vn("exclusive or expression"),Et=vn("inclusive or expression"),vt=vn("logical and expression"),Ct=vn("logical or expression"),Dt=vn("constant expression"),St=vn("whitespace or comment"),At=gn("//",!1),_t=gn("/*",!1),yt=gn("*/",!1),bt={type:"any"},Tt=vn("whitespace"),Rt=En([" ","\t"],!1,!1),xt=function(e,t){return gr("program",{program:e.blocks,wsEnd:t})},wt=function(e,t){return gr("int_constant",{token:e,wsEnd:t})},Ft=function(e,t){return gr("literal",{literal:e,wsEnd:t})},Nt=function(e){return"#"},Lt=function(e,t,n){return gr("literal",{literal:t,wsStart:e,wsEnd:n})},Ot=function(e,t){return gr("identifier",{identifier:e,wsEnd:t})},It=function(e){return gr("identifier",{identifier:e})},kt=function(e){return gr("text",{text:e.join("")})},Mt=function(e){return gr("segment",{blocks:e})},Pt=function(e,t,n,r,i){return[r,...i.flat()]},Bt=function(e,t,n,r,i,s){return gr("define_arguments",{define:e,identifier:t,lp:n,args:r||[],rp:i,body:s})},Ut=function(e,t,n){return gr("define",{define:e,identifier:t,body:n})},$t=function(e,t){return gr("line",{line:e,value:t})},Gt=function(e,t){return gr("undef",{undef:e,identifier:t})},Vt=function(e,t){return gr("error",{error:e,message:t})},Wt=function(e,t){return gr("pragma",{pragma:e,body:t})},Ht=function(e,t,n){return gr("version",{version:e,value:t,profile:n})},jt=function(e,t,n,r){return gr("extension",{extension:e,name:t,colon:n,behavior:r})},zt=function(e,t){return{...e,wsEnd:t}},Xt=function(e,t,n){return{...e,body:n,wsEnd:t}},Kt=function(e,t,n,r,i){return gr("elseif",{token:t,expression:n,wsEnd:r,body:i})},Yt=function(e,t,n,r,i){return gr("else",{token:n,wsEnd:r,body:i})},qt=function(e,t,n,r,i){return gr("conditional",{ifPart:e,elseIfParts:t,elsePart:n,endif:r,wsEnd:i})},Qt=function(e,t){return gr("ifdef",{token:e,identifier:t})},Zt=function(e,t){return gr("ifndef",{token:e,identifier:t})},Jt=function(e,t){return gr("if",{token:e,expression:t})},en=function(e,t,n){return gr("group",{lp:e,expression:t,rp:n})},tn=function(e,t,n,r){return gr("unary_defined",{operator:e,lp:t,identifier:n,rp:r})},nn=function(e,t){return gr("unary",{operator:e,expression:t})},rn=function(e,t){return Cr(e,t)},sn=function(e,t){return vr(e,t)},on=function(e,t,n){return Er(t,n)},an=function(e,t){return Er(e,t.flat())},ln=function(e){return e},un=function(e){return e},cn=0,hn=[{line:1,column:1}],dn=0,fn=[],pn=0,mn={};if("startRule"in t){if(!(t.startRule in s))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=s[t.startRule]}function gn(e,t){return{type:"literal",text:e,ignoreCase:t}}function En(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function vn(e){return{type:"other",description:e}}function Cn(t){var n,r=hn[t];if(r)return r;for(n=t-1;!hn[n];)n--;for(r={line:(r=hn[n]).line,column:r.column};ndn&&(dn=cn,fn=[]),fn.push(e))}function An(){var e,t,n,i=75*cn+0,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Qn())!==r?(n=dr(),e=xt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}function _n(){var t,n,i,s=75*cn+2,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===a?(n=a,cn+=2):(n=r,0===pn&&Sn(ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function yn(){var t,n,i,s=75*cn+3,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===l?(n=l,cn+=2):(n=r,0===pn&&Sn(le)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function bn(){var t,n,i,s=75*cn+4,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===u?(n=u,cn+=2):(n=r,0===pn&&Sn(ue)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Tn(){var t,n,i,s=75*cn+5,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===c?(n=c,cn+=2):(n=r,0===pn&&Sn(ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Rn(){var t,n,i,s=75*cn+6,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===h?(n=h,cn+=2):(n=r,0===pn&&Sn(he)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function xn(){var t,n,i,s=75*cn+7,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===d?(n=d,cn+=2):(n=r,0===pn&&Sn(de)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function wn(){var t,n,i,s=75*cn+8,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===f?(n=f,cn+=2):(n=r,0===pn&&Sn(fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Fn(){var t,n,i,s=75*cn+9,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===p?(n=p,cn+=2):(n=r,0===pn&&Sn(pe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Nn(){var t,n,i,s=75*cn+10,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,40===e.charCodeAt(cn)?(n=m,cn++):(n=r,0===pn&&Sn(me)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Ln(){var t,n,i,s=75*cn+11,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,41===e.charCodeAt(cn)?(n=g,cn++):(n=r,0===pn&&Sn(ge)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function On(){var t,n,i,s=75*cn+12,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,44===e.charCodeAt(cn)?(n=E,cn++):(n=r,0===pn&&Sn(Ee)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function In(){var t,n,i,s=75*cn+14,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,45===e.charCodeAt(cn)?(n=C,cn++):(n=r,0===pn&&Sn(Ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function kn(){var t,n,i,s=75*cn+16,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,43===e.charCodeAt(cn)?(n=S,cn++):(n=r,0===pn&&Sn(Se)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Mn(){var t,n,i,s=75*cn+17,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,42===e.charCodeAt(cn)?(n=A,cn++):(n=r,0===pn&&Sn(Ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Pn(){var t,n,i,s=75*cn+18,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,47===e.charCodeAt(cn)?(n=_,cn++):(n=r,0===pn&&Sn(_e)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Bn(){var t,n,i,s=75*cn+19,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,37===e.charCodeAt(cn)?(n=y,cn++):(n=r,0===pn&&Sn(ye)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Un(){var t,n,i,s=75*cn+20,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,60===e.charCodeAt(cn)?(n=b,cn++):(n=r,0===pn&&Sn(be)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function $n(){var t,n,i,s=75*cn+21,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,62===e.charCodeAt(cn)?(n=T,cn++):(n=r,0===pn&&Sn(Te)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Gn(){var t,n,i,s=75*cn+22,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,124===e.charCodeAt(cn)?(n=R,cn++):(n=r,0===pn&&Sn(Re)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Vn(){var t,n,i,s=75*cn+23,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,94===e.charCodeAt(cn)?(n=x,cn++):(n=r,0===pn&&Sn(xe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Wn(){var t,n,i,s=75*cn+24,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,38===e.charCodeAt(cn)?(n=w,cn++):(n=r,0===pn&&Sn(we)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Hn(){var t,n,i,s=75*cn+26,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,35===e.charCodeAt(cn)?(i=N,cn++):(i=r,0===pn&&Sn(Ne)),(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Nt(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function jn(){var t,n,i,s,o,a,l=75*cn+27,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===L?(a=L,cn+=6):(a=r,0===pn&&Sn(Le)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function zn(){var t,n,i,s,o,a,l=75*cn+37,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===G?(a=G,cn+=4):(a=r,0===pn&&Sn(Ge)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function Xn(){var t,n,i,s,o,a,l=75*cn+42,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Ot(n,i)):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t}function Kn(){var t,n,i,s,o=75*cn+44,a=mn[o];return a?(cn=a.nextPos,a.result):(pn++,t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+46,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,J.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(qe)),i!==r){for(s=[],o=qn();o!==r;)s.push(o),o=qn();n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o=75*cn+47,a=mn[o];if(a)return cn=a.nextPos,a.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r){for(i=[],ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));s!==r;)i.push(s),ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));t=n=[n,i]}else cn=t,t=r;return mn[o]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+48,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r)if(te.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Je)),i!==r){for(s=[],ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));o!==r;)s.push(o),ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));t=n=[n,i,s]}else cn=t,t=r;else cn=t,t=r;return mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),t=n!==r?e.substring(t,cn):n)),pn--,t===r&&(n=r,0===pn&&Sn(Ke)),mn[o]={nextPos:cn,result:t},t)}function Yn(){var t,n=75*cn+45,i=mn[n];return i?(cn=i.nextPos,i.result):(Z.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(Ye)),mn[n]={nextPos:cn,result:t},t)}function qn(){var t,n=75*cn+49,i=mn[n];return i?(cn=i.nextPos,i.result):(re.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(tt)),mn[n]={nextPos:cn,result:t},t)}function Qn(){var e,t,n,i,s,o=75*cn+50,a=mn[o];if(a)return cn=a.nextPos,a.result;if(cn,t=[],(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}if(n!==r){for(;n!==r;)if(t.push(n),(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}}else t=r;return t!==r&&(t=Mt(t)),e=t,mn[o]={nextPos:cn,result:e},e}function Zn(){var t,n,i,s,o,a,l,u,c,h,d,f=75*cn+51,p=mn[f];if(p)return cn=p.nextPos,p.result;if(pn++,t=function(){var t,n,i,s,o,a,l,u,c=75*cn+54,h=mn[c];if(h)return cn=h.nextPos,h.result;if(t=cn,n=cn,i=function(){var t,n,i,s=75*cn+55,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+35,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===U?(a=U,cn+=5):(a=r,0===pn&&Sn(Ue)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Qt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+36,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===$?(a=$,cn+=6):(a=r,0===pn&&Sn($e)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Zt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+34,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,2)===B?(a=B,cn+=2):(a=r,0===pn&&Sn(Be)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r?((i=Jn())===r&&(i=null),t=Jt(n,i)):(cn=t,t=r))),pn--,t===r&&(n=r,0===pn&&Sn(at)),mn[s]={nextPos:cn,result:t},t)}(),i!==r?(ie.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(rt)),s!==r?((o=Qn())===r&&(o=null),n=Xt(i,s,o)):(cn=n,n=r)):(cn=n,n=r),n!==r){for(i=[],s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s=cn,o=function(){var t,n,i,s,o,a,l=75*cn+38,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===V?(a=V,cn+=4):(a=r,0===pn&&Sn(Ve)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a!==r?((l=Qn())===r&&(l=null),s=Yt(n,i,o,a,l)):(cn=s,s=r)):(cn=s,s=r),s===r&&(s=null),o=function(){var t,n,i,s,o,a,l=75*cn+39,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===W?(a=W,cn+=5):(a=r,0===pn&&Sn(We)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a===r&&(a=null),t=qt(n,i,s,o,a)):(cn=t,t=r)}else cn=t,t=r;return mn[c]={nextPos:cn,result:t},t}(),t===r){if(t=cn,n=cn,(i=jn())!==r)if(s=function(){var t,n,i,s,o,a,l=75*cn+43,u=mn[l];if(u)return cn=u.nextPos,u.result;if(cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r&&(n=It(n)),t=n,mn[l]={nextPos:cn,result:t},t}(),s!==r)if((o=Nn())!==r){if(a=cn,(l=Xn())!==r){for(u=[],c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);c!==r;)u.push(c),c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);a=Pt(i,s,o,l,u)}else cn=a,a=r;a===r&&(a=null),(l=Ln())!==r?((u=Jn())===r&&(u=null),n=Bt(i,s,o,a,l,u)):(cn=n,n=r)}else cn=n,n=r;else cn=n,n=r;else cn=n,n=r;if(n===r&&(n=cn,(i=jn())!==r&&(s=Xn())!==r?((o=Jn())===r&&(o=null),n=Ut(i,s,o)):(cn=n,n=r),n===r)){if(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+29,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===O?(a=O,cn+=4):(a=r,0===pn&&Sn(Oe)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r){if(s=cn,o=[],(a=qn())!==r)for(;a!==r;)o.push(a),a=qn();else o=r;(s=o!==r?e.substring(s,cn):o)!==r?n=$t(i,s):(cn=n,n=r)}else cn=n,n=r;n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+30,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===I?(a=I,cn+=5):(a=r,0===pn&&Sn(Ie)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?n=Gt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+31,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===k?(a=k,cn+=5):(a=r,0===pn&&Sn(ke)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Vt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+32,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===M?(a=M,cn+=6):(a=r,0===pn&&Sn(Me)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Wt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+40,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,7)===H?(a=H,cn+=7):(a=r,0===pn&&Sn(He)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Kn())!==r?((o=Jn())===r&&(o=null),n=Ht(i,s,o)):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+41,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,9)===j?(a=j,cn+=9):(a=r,0===pn&&Sn(je)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?(o=function(){var t,n,i,s=75*cn+25,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,58===e.charCodeAt(cn)?(n=F,cn++):(n=r,0===pn&&Sn(Fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),o!==r&&(a=Jn())!==r?n=jt(i,s,o,a):(cn=n,n=r)):(cn=n,n=r))))))}n!==r?(ie.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(rt)),i===r&&(i=null),t=zt(n,i)):(cn=t,t=r)}return pn--,t===r&&(n=r,0===pn&&Sn(nt)),mn[f]={nextPos:cn,result:t},t}function Jn(){var t,n,i,s=75*cn+52,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st)),i!==r)for(;i!==r;)n.push(i),se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(it)),mn[s]={nextPos:cn,result:t},t}function er(){var t,n,i,s,o,a,l=75*cn+53,u=mn[l];if(u)return cn=u.nextPos,u.result;if(pn++,t=cn,n=cn,i=cn,pn++,s=cn,(o=pr())===r&&(o=null),35===e.charCodeAt(cn)?(a=N,cn++):(a=r,0===pn&&Sn(Ne)),a!==r?s=o=[o,a]:(cn=s,s=r),pn--,s===r?i=void 0:(cn=i,i=r),i!==r){if(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st)),o!==r)for(;o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));else s=r;s!==r?(ie.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(rt)),o===r&&(o=null),n=i=[i,s,o]):(cn=n,n=r)}else cn=n,n=r;return n===r&&(ie.test(e.charAt(cn))?(n=e.charAt(cn),cn++):(n=r,0===pn&&Sn(rt))),t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(ot)),mn[l]={nextPos:cn,result:t},t}function tr(){var t,n,i,s,o,a=75*cn+57,l=mn[a];return l?(cn=l.nextPos,l.result):(pn++,t=cn,n=function(){var t,n,i,s,o=75*cn+33,a=mn[o];return a?(cn=a.nextPos,a.result):(t=cn,n=dr(),e.substr(cn,7)===P?(i=P,cn+=7):(i=r,0===pn&&Sn(Pe)),i!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[o]={nextPos:cn,result:t},t)}(),n!==r?((i=Nn())===r&&(i=null),(s=Xn())!==r?((o=Ln())===r&&(o=null),t=tn(n,i,s,o)):(cn=t,t=r)):(cn=t,t=r),t===r&&(t=cn,(n=kn())===r&&(n=In())===r&&(n=function(){var t,n,i,s=75*cn+13,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,33===e.charCodeAt(cn)?(n=v,cn++):(n=r,0===pn&&Sn(ve)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),n===r&&(n=function(){var t,n,i,s=75*cn+15,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,126===e.charCodeAt(cn)?(n=D,cn++):(n=r,0===pn&&Sn(De)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}())),n!==r&&(i=tr())!==r?t=nn(n,i):(cn=t,t=r),t===r&&(t=function(){var e,t,n,i,s=75*cn+56,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,e=function(){var e,t,n,i=75*cn+1,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Kn())!==r?(n=dr(),e=wt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}(),e===r&&(e=cn,(t=Nn())!==r&&(n=hr())!==r&&(i=Ln())!==r?e=en(t,n,i):(cn=e,e=r),e===r&&(e=Xn())),pn--,e===r&&(t=r,0===pn&&Sn(lt)),mn[s]={nextPos:cn,result:e},e)}())),pn--,t===r&&(n=r,0===pn&&Sn(ut)),mn[a]={nextPos:cn,result:t},t)}function nr(){var e,t,n,i,s,o,a=75*cn+58,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=tr())!==r){for(n=[],i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ct)),mn[a]={nextPos:cn,result:e},e}function rr(){var e,t,n,i,s,o,a=75*cn+59,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=nr())!==r){for(n=[],i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ht)),mn[a]={nextPos:cn,result:e},e}function ir(){var e,t,n,i,s,o,a=75*cn+60,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=rr())!==r){for(n=[],i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(dt)),mn[a]={nextPos:cn,result:e},e}function sr(){var e,t,n,i,s,o,a=75*cn+61,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ir())!==r){for(n=[],i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ft)),mn[a]={nextPos:cn,result:e},e}function or(){var e,t,n,i,s,o,a=75*cn+62,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=sr())!==r){for(n=[],i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(pt)),mn[a]={nextPos:cn,result:e},e}function ar(){var e,t,n,i,s,o,a=75*cn+63,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=or())!==r){for(n=[],i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(mt)),mn[a]={nextPos:cn,result:e},e}function lr(){var e,t,n,i,s,o,a=75*cn+64,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ar())!==r){for(n=[],i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(gt)),mn[a]={nextPos:cn,result:e},e}function ur(){var e,t,n,i,s,o,a=75*cn+65,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=lr())!==r){for(n=[],i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Et)),mn[a]={nextPos:cn,result:e},e}function cr(){var e,t,n,i,s,o,a=75*cn+66,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ur())!==r){for(n=[],i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(vt)),mn[a]={nextPos:cn,result:e},e}function hr(){var e,t=75*cn+68,n=mn[t];return n?(cn=n.nextPos,n.result):(pn++,e=function(){var e,t,n,i,s,o,a=75*cn+67,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=cr())!==r){for(n=[],i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Ct)),mn[a]={nextPos:cn,result:e},e}(),pn--,e===r&&0===pn&&Sn(Dt),mn[t]={nextPos:cn,result:e},e)}function dr(){var e,t,n,i,s,o,a=75*cn+69,l=mn[a];if(l)return cn=l.nextPos,l.result;for(pn++,cn,(t=pr())===r&&(t=null),n=[],i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);return e=sn(t,n),pn--,t=r,0===pn&&Sn(St),mn[a]={nextPos:cn,result:e},e}function fr(){var t,n,i,s,o,a,l=75*cn+70,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=function(){var t,n,i,s,o,a=75*cn+71,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,e.substr(cn,2)===X?(i=X,cn+=2):(i=r,0===pn&&Sn(At)),i!==r){for(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),t===r)if(t=cn,n=function(){var t,n,i,s,o,a,l,u=75*cn+72,c=mn[u];if(c)return cn=c.nextPos,c.result;if(t=cn,n=cn,e.substr(cn,2)===K?(i=K,cn+=2):(i=r,0===pn&&Sn(_t)),i!==r){for(s=[],o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);o!==r;)s.push(o),o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);e.substr(cn,2)===Y?(o=Y,cn+=2):(o=r,0===pn&&Sn(yt)),o!==r?n=i=[i,s,o]:(cn=n,n=r)}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[u]={nextPos:cn,result:t},t}(),n!==r){for(i=[],s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);t=an(n,i)}else cn=t,t=r;return mn[l]={nextPos:cn,result:t},t}function pr(){var t,n,i,s=75*cn+73,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt)),i!==r)for(;i!==r;)n.push(i),oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(Tt)),mn[s]={nextPos:cn,result:t},t}function mr(){var t,n,i,s=75*cn+74,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,pn++,Q.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Xe)),pn--,i===r?n=void 0:(cn=n,n=r),n!==r?(i=dr(),t=un(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}e=lh(e);const gr=(e,t)=>({type:e,...t}),Er=(...e)=>e.flat().filter(e=>null!=e&&""!==e&&0!==e.length),vr=(...e)=>{return(t=Er(e.flat())).length>1?t:t[0];var t},Cr=(...e)=>e.flat().reduce((e,[t,n])=>({type:"binary",operator:t,left:e,right:n}));if((n=o())!==r&&cn===e.length)return n;throw n!==r&&cn0){for(t=1,n=1;ts.length)throw new Error("'".concat(t,"': Too many arguments for macro"));if(u.length>":return t(n)>>t(r);case"<":return t(n)":return t(n)>t(r);case"<=":return t(n)<=t(r);case">=":return t(n)>=t(r);case"==":return t(n)==t(r);case"!=":return t(n)!=t(r);case"&":return t(n)&t(r);case"^":return t(n)^t(r);case"|":return t(n)|t(r);case"&&":return t(n)&&t(r);case"||":return t(n)||t(r);default:throw new Error("Preprocessing error: Unknown binary operator ".concat(i))}},unary:function(e,t){switch(e.operator.literal){case"+":return t(e.expression);case"-":return-1*t(e.expression);case"!":return!t(e.expression);case"~":return~t(e.expression);default:throw new Error("Preprocessing error: Unknown unary operator ".concat(e.operator.literal))}}},(r=function(e){var t=n[e.type];if(!t)throw new Error("No evaluate() evaluator for ".concat(e.type));return t(e,r)})(e);var n,r}((n=sh(r,t).trim(),eh(s)(n,{grammarSource:"expression",startRule:"constant_expression"})),t)},lh=function(e,t){return void 0===t&&(t={}),e.replace(/\\[\n\r]/g,"")},uh=function(e,t){void 0===t&&(t={});var n,r,i,s,o=Object.entries(t.defines||{}).reduce(function(e,t){var n,r=t[0],i=t[1];return th(th({},e),((n={})[r]={body:i},n))},{}),a=(void 0===(n=t.preserve)&&(n={}),function(e){var t=null==n?void 0:n[e.node.type];return"function"==typeof t?t(e):t});return r={conditional:{enter:function(e){var t=e,n=t.node;a(t)||(function(e,t){return"if"===t.type?!!t.expression&&oh(ah(t.expression,e)):"ifdef"===t.type?t.identifier.identifier in e:"ifndef"===t.type?!(t.identifier.identifier in e):void 0}(o,n.ifPart)?t.replaceWith(n.ifPart.body):n.elseIfParts.reduce(function(e,n){return e||oh(ah(n.expression,o))&&(t.replaceWith(n.body),!0)},!1)||(n.elsePart?t.replaceWith(n.elsePart.body):t.remove()))}},text:{enter:function(e){var t=e;t.node.text=sh(t.node.text,o)}},define_arguments:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body,s=n.args;o[r]={args:s,body:i},!a(t)&&t.remove()}},define:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body;o[r]={body:i},!a(t)&&t.remove()}},undef:{enter:function(e){var t=e;delete o[t.node.identifier.identifier],!a(t)&&t.remove()}},error:{enter:function(e){var n=e;if(t.stopOnError)throw new Error(n.node.message);!a(n)&&n.remove()}},pragma:{enter:function(e){var t=e;!a(t)&&t.remove()}},version:{enter:function(e){var t=e;!a(t)&&t.remove()}},extension:{enter:function(e){var t=e;!a(t)&&t.remove()}},line:{enter:function(e){var t=e;!a(t)&&t.remove()}}},i=!1,(s=function(e,t,n,o,a){var l;if(!i){var u=r[e.type],c=function(e,t,n,r,i){return{node:e,parent:t,parentPath:n,key:r,index:i,stop:function(){this.stopped=!0},skip:function(){this.skipped=!0},remove:function(){this.removed=!0},replaceWith:function(e){this.replaced=e},findParent:function(e){return n?e(n)?n:n.findParent(e):n}}}(e,t,n,o,a),h=t;if(null==u?void 0:u.enter){if(u.enter(c),c.removed){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));return"number"==typeof a?h[o].splice(a,1):h[o]=null,c}if(c.replaced){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));"number"==typeof a?h[o].splice(a,1,c.replaced):h[o]=c.replaced}if(c.skipped)return c}if(c.stopped)i=!0;else if(c.replaced){var d=c.replaced;s(d,t,n,o,a)}else Object.entries(e).filter(function(e){return e[0],function(e){return function(e){return!!(null==e?void 0:e.type)}(e)||Array.isArray(e)}(e[1])}).forEach(function(t){var n=t[0],r=t[1];if(Array.isArray(r))for(var o=0,a=0;o-a{let e=!0;return n?(i({source:o,formatted:null,error:""}),function(e){return Gs(e,{parser:"glsl-parser",plugins:[Gc],printWidth:80,tabWidth:4,useTabs:!1}).then(Vc)}(o).then(t=>{e&&i({source:o,formatted:t,error:""})}).catch(t=>{if(!e)return;const n=dh(t);a.error("shader formatting failed: "+n),i({source:o,formatted:null,error:n})}),()=>{e=!1}):(i({source:o,formatted:null,error:""}),()=>{e=!1})},[n,o]);const c=n&&r.source===o?r.formatted:null;return{source:c||o,formatted:!!c,preprocessed:u,error:(r.source===o?r.error:"")||l}}(C.source,C.preprocessed,e.beautify),S=D.source,A=C.edited,_=[e.fragment?e.sourceFragmentLog:e.sourceVertexLog,e.programLog].filter(e=>!!e).join("\n"),y=!e.translated&&!D.preprocessed&&!D.formatted,b=function(e,t,n,r){return!(e||t||!n||r)}(t,A,_,y);(0,dt.useLayoutEffect)(()=>{g.current={programId:e.programId,sourceVertex:e.sourceVertex,sourceFragment:e.sourceFragment}},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!d.current)return;if(!f.current){const e=ace.edit(d.current);e.setTheme("ace/theme/monokai"),e.getSession().setMode("ace/mode/glsl"),e.setShowPrintMargin(!1),f.current=e}const t=f.current;t.setReadOnly(!e.editable||e.translated),t.getValue()!==S&&t.setValue(S,-1);const n=()=>{const n=t.getValue();e.fragment?m.current.fragment=n:m.current.vertex=n,v(t=>e.fragment?t.fragment?t:Object.assign(Object.assign({},t),{fragment:!0}):t.vertex?t:Object.assign(Object.assign({},t),{vertex:!0})),function(e,t,n,r){e&&n(!1),t&&r(!1)}(e.beautify,e.preprocessed,c,h),-1!==p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{if(p.current=-1,!function(e,t){return e.programId===t.programId&&e.sourceVertex===t.sourceVertex&&e.sourceFragment===t.sourceFragment}(g.current,e))return;const t={sourceVertex:m.current.vertex,sourceFragment:m.current.fragment,translatedSourceVertex:e.translatedSourceVertex,translatedSourceFragment:e.translatedSourceFragment,programId:e.programId};u(t)},1500)},r=e.editable&&!e.translated;return r&&t.getSession().on("change",n),()=>{r&&t.getSession().off("change",n)}},[S,e.editable,e.translated,e.fragment,e.beautify,e.preprocessed,e.sourceVertex,e.sourceFragment,e.translatedSourceVertex,e.translatedSourceFragment,e.programId,c,h,u]),(0,dt.useEffect)(()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),m.current={baseProgramId:e.programId,baseVertex:e.sourceVertex,baseFragment:e.sourceFragment,vertex:e.sourceVertex,fragment:e.sourceFragment},v({vertex:!1,fragment:!1})},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!f.current)return;const e=t||(y&&!A?_:"");f.current.getSession().setAnnotations(function(e){if(!e)return[];const t=[],n=e.split(/\r?\n/);for(const e of n){const n=e.replace(/\0/g,"").trim();if(!n)continue;let r=/^(error|warning|info)\s*:\s*\d+\s*:\s*(\d+)(?:\s*:\s*(\d+))?\s*:\s*(.*)$/i.exec(n);if(r){t.push(Pt(r[1],r[2],r[3],r[4]));continue}if(r=/^\d+\s*\(\s*(\d+)\s*\)\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[2],r[1],"",r[3]));continue}if(r=/^\d+\s*:\s*(\d+)(?:\s*\(\s*(\d+)\s*\))?\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[3],r[1],r[2],r[4]));continue}const i=/\b(error|warning|info)\b/i.exec(n);t.push({row:0,column:0,text:n,type:i?i[1].toLowerCase():"info"})}return t}(e))},[_,y,t,D.formatted,D.preprocessed,A,e.beautify,e.fragment,e.programLog,e.sourceFragmentLog,e.sourceVertexLog,e.translated]),(0,dt.useEffect)(()=>()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),f.current&&(f.current.destroy(),f.current=null)},[]);const T=(0,dt.useCallback)(e=>{e.preventDefault(),n()},[n]),R=(0,dt.useCallback)(e=>{e.preventDefault(),r()},[r]),x=(0,dt.useCallback)(e=>{e.preventDefault(),null==i||i()},[i]),w=(0,dt.useCallback)(e=>{e.preventDefault(),null==o||o()},[o]),F=(0,dt.useCallback)(e=>{e.preventDefault(),l()},[l]),N=!e.singleShader||!e.fragment,L=!e.singleShader||e.fragment,O=D.error;return(0,mt.jsxs)("div",{className:"sourceCodeComponentContainer",children:[(0,mt.jsx)("div",{className:"sourceCodeMenuComponentContainer",children:(0,mt.jsxs)("ul",{className:"sourceCodeMenuComponent",children:[N&&e.translatedSourceVertex&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:!e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedVertexSourceClicked",onClick:x,children:"Translated Vertex"})}),L&&e.translatedSourceFragment&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedFragmentSourceClicked",onClick:w,children:"Translated Fragment"})}),N&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment||e.translated?"":"active",href:"#",role:"button",commandName:"onVertexSourceClicked",onClick:T,children:"Vertex"})}),L&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&!e.translated?"active":"",href:"#",role:"button",commandName:"onFragmentSourceClicked",onClick:R,children:"Fragment"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onSourceCodeCloseClicked",onClick:F,children:"Close"})})]})}),(0,mt.jsx)("div",{className:"sourceCodeComponent",ref:d}),(0,mt.jsx)(hh,{beautify:e.beautify,capturedDiagnosticsHidden:b,fragment:e.fragment,preprocessed:e.preprocessed,processingError:O,onBeautifyChanged:c,onFragmentSourceClicked:r,onPreprocessChanged:h,onVertexSourceClicked:n})]})}function hh({beautify:e,capturedDiagnosticsHidden:t,fragment:n,preprocessed:r,processingError:i,onBeautifyChanged:s,onFragmentSourceClicked:o,onPreprocessChanged:a,onVertexSourceClicked:l}){const u=(0,dt.useCallback)(e=>{s(e.target.checked)},[s]),c=(0,dt.useCallback)(e=>{a(e.target.checked)},[a]),h=(0,dt.useCallback)(e=>{e.preventDefault(),(n?o:l)(),s(!1),a(!1)},[n,s,o,a,l]);return(0,mt.jsx)("div",{className:"sourceCodeMenuComponentFooter",children:(0,mt.jsxs)("p",{children:[(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onBeautifyChanged",checked:e,onChange:u})," Beautify"]}),(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onPreprocessChanged",checked:r,onChange:c})," Preprocess"]}),i&&(0,mt.jsx)("span",{className:"sourceCodeFormatError",role:"alert",title:i,children:"Shader processing failed"}),t&&(0,mt.jsxs)("span",{className:"sourceCodeDiagnosticsNotice",role:"status",children:["Captured diagnostics hidden."," ",(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onShowCapturedDiagnostics",onClick:h,children:"Show original with diagnostics"})]})]})})}function dh(e){return e instanceof Error?e.message:String(e)}function fh({title:e,children:t}){const n=e?e.replace(/([A-Z])/g," $1").trim():"";return(0,mt.jsxs)("div",{className:"jsonGroupComponent",children:[(0,mt.jsx)("div",{className:"jsonGroupComponentTitle",children:n}),(0,mt.jsx)("ul",{children:t})]})}function ph({itemKey:e,value:t}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsx)("span",{className:"jsonItemComponentValue",children:t})]})}function mh({itemKey:e,value:t,pixelated:n,raw:r}){const i=bt();return(0,mt.jsx)("li",{className:"jsonItemImageHolder",children:(0,mt.jsxs)("div",{className:"jsonItemImage jsonItemImageClickable",children:[(0,mt.jsx)("img",{src:t,style:n?{imageRendering:"pixelated"}:void 0,title:"Open in texture viewer",onClick:()=>i.openTextureViewer({src:t,label:e,pixelated:n,raw:r||null})}),(0,mt.jsx)("span",{children:e})]})})}function gh({itemKey:e,value:t,help:n}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("span",{className:"jsonItemComponentValue",children:[t+" (",(0,mt.jsx)("a",{href:n,target:"_blank",className:"jsonSourceItemComponentOpen",children:"Open help page"}),")"]})]})}function Eh({visualState:e}){const t=bt();return(0,mt.jsxs)("div",{className:"jsonVisualStateItemComponent",children:[e.Attachments?e.Attachments.map((n,r)=>n.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{className:"jsonItemImageClickable",src:encodeURI(n.src),title:"Open in texture viewer",onClick:()=>t.openTextureViewer({src:n.src,label:n.attachmentName||"Attachment",pixelated:!1,raw:n.raw||null})}),e.Attachments.length>1&&(0,mt.jsx)("span",{children:n.attachmentName})]},r):null):(0,mt.jsx)("span",{children:e.FrameBufferStatus}),(0,mt.jsx)("span",{children:e.FrameBuffer?e.FrameBuffer.__SPECTOR_Object_TAG.displayText:"Canvas frame buffer"})]})}function vh({itemKey:e,shader:t,programLog:n,onOpen:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),null==r||r(t,n)},[r,n,t]),s=t.source?t.source.length:0,o=`${t.name||"Shader"} (${s} chars)`;return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("a",{href:"#",role:"button",className:"jsonSourceItemComponentOpen",commandName:"onShaderSourceOpen",onClick:i,children:["Open ",o]})]})}function Ch({items:e,onShaderSourceOpen:t}){return e&&0!==e.length?(0,mt.jsx)(mt.Fragment,{children:e.map((e,n)=>{switch(e.type){case"group":return(0,mt.jsx)(fh,{title:e.title,children:(0,mt.jsx)(Ch,{items:e.children,onShaderSourceOpen:t})},n);case"item":return(0,mt.jsx)(ph,{itemKey:e.key,value:e.value},n);case"image":return(0,mt.jsx)(mh,{itemKey:e.key,value:e.value,pixelated:e.pixelated,raw:e.raw},n);case"help":return(0,mt.jsx)(gh,{itemKey:e.key,value:e.value,help:e.help},n);case"shaderSource":return(0,mt.jsx)(vh,{itemKey:e.key,shader:e.shader,programLog:e.programLog,onOpen:t},n);case"visualState":return(0,mt.jsx)(Eh,{visualState:e.visualState},n);default:return null}})}):null}const Dh={added:"+",removed:"-",changed:"~",unchanged:" "};function Sh(e){const t=void 0===e.indexA?"_":String(e.indexA),n=void 0===e.indexB?"_":String(e.indexB);return e.type+"#"+t+"#"+n}function Ah(e){return!(!e.previousImage&&!e.currentImage)}function _h(){const e=bt(),t=pt(e.store),[n,r]=(0,dt.useState)(null);if((0,dt.useEffect)(()=>{r(null)},[t.compareRows]),!t.canCompare)return(0,mt.jsx)("div",{className:"compareViewComponent",children:(0,mt.jsx)("div",{className:"compareViewEmpty",children:"Capture the same page at least twice, then select a capture to compare it against the previous one."})});const{added:i,removed:s,changed:o,unchanged:a}=t.compareSummary,l=t.compareOnlyDifferences?t.compareRows.filter(e=>"unchanged"!==e.type):t.compareRows,u=l.find(e=>Sh(e)===n)||(l.length>0?l[0]:null),c=u?Sh(u):"";return(0,mt.jsxs)("div",{className:"compareViewComponent",children:[(0,mt.jsxs)("div",{className:"compareViewHeader",children:[(0,mt.jsx)("span",{className:"compareViewLabel",children:t.compareLabel}),(0,mt.jsxs)("span",{className:"compareViewSummary",children:[(0,mt.jsxs)("span",{className:"added",children:["+",i]}),(0,mt.jsxs)("span",{className:"removed",children:["-",s]}),(0,mt.jsxs)("span",{className:"changed",children:["~",o]}),(0,mt.jsxs)("span",{className:"unchanged",children:["=",a]})]}),(0,mt.jsxs)("label",{className:"compareViewToggle",children:[(0,mt.jsx)("input",{type:"checkbox",checked:t.compareOnlyDifferences,onChange:t=>e.handleCompareOnlyDifferencesChange(t.target.checked)}),"Differences only"]})]}),(0,mt.jsxs)("div",{className:"compareViewBody",children:[(0,mt.jsx)(yh,{}),(0,mt.jsx)("ul",{className:"compareViewList",children:0===l.length?(0,mt.jsx)("li",{className:"compareViewEmptyRow",children:"No differences between these two captures."}):l.map(e=>{const t=Sh(e);return(0,mt.jsx)(bh,{row:e,selected:t===c,onSelect:()=>r(t)},t)})}),(0,mt.jsx)("div",{className:"compareViewDetail",children:u?(0,mt.jsx)(Th,{row:u,onSelectCommand:e.handleCompareCommandSelected,onOpenTexture:(t,n)=>e.openTextureViewer({src:t,label:n,pixelated:!1,raw:null})}):(0,mt.jsx)("div",{className:"compareDetailEmpty",children:"Select a call to see its details."})})]})]})}function yh(){return(0,mt.jsxs)("div",{className:"compareViewLegend",children:[(0,mt.jsxs)("div",{className:"compareLegendRow added",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Added"]}),(0,mt.jsxs)("div",{className:"compareLegendRow removed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Removed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow changed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Changed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow unchanged",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Unchanged"]})]})}function bh(e){const{row:t,selected:n,onSelect:r}=e,i="removed"===t.type?t.previousText:t.currentText,s=i&&0===i.indexOf(t.name)?i.slice(t.name.length):"",o="compareRow "+t.type+(n?" selected":"");return(0,mt.jsxs)("li",{className:o,onClick:r,title:i,children:[(0,mt.jsx)("span",{className:"compareSign",children:Dh[t.type]}),(0,mt.jsxs)("span",{className:"compareRowText",children:[(0,mt.jsx)("span",{className:"compareCmdName",children:t.name}),s]})]})}function Th(e){const{row:t,onSelectCommand:n,onOpenTexture:r}=e,i=t.fieldDiffs||[],s=i.filter(e=>!Ah(e)),o=i.filter(Ah),a="changed"===t.type&&t.previousText!==t.currentText,l="removed"===t.type?t.previousText:t.currentText;return(0,mt.jsxs)("div",{className:"compareDetail",children:[(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Command"}),(0,mt.jsxs)("ul",{children:[(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"name"}),":"," ",(0,mt.jsx)("span",{className:"compareCmdName "+t.type,children:t.name})]}),(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"call"}),":"," ",a?(0,mt.jsxs)("span",{className:"compareTextChange",children:[(0,mt.jsx)("span",{className:"compareOld",children:t.previousText}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:t.currentText})]}):(0,mt.jsx)("span",{className:"compareNew",children:l})]}),void 0!==t.commandId&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",className:"compareCommandLink",title:"Show this command in the Commands view",onClick:e=>{e.preventDefault(),n(t.commandId)},children:"Show in Commands view →"})})]})]}),s.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Uniform & state changes"}),(0,mt.jsx)("ul",{children:s.map((e,t)=>(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),":"," ",(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:e.current})]},t))})]}),o.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Texture changes"}),(0,mt.jsx)("ul",{children:o.map((e,t)=>(0,mt.jsxs)("li",{className:"compareTextureItem",children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),(0,mt.jsxs)("div",{className:"compareImageDiff",children:[e.previousImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.previousImage,title:"Open in texture viewer",onClick:()=>r(e.previousImage,e.path+" (previous)")}):(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),e.currentImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.currentImage,title:"Open in texture viewer",onClick:()=>r(e.currentImage,e.path+" (current)")}):(0,mt.jsx)("span",{className:"compareNew",children:e.current})]})]},t))})]})]})}function Rh(e){const t=(255&e).toString(16);return 1===t.length?"0"+t:t}function xh(e,t,n,r){return"#"+Rh(e)+Rh(t)+Rh(n)+Rh(r)}function wh(e,t,n,r){const i=e=>(e/255).toFixed(2);return i(e)+", "+i(t)+", "+i(n)+", "+i(r)}function Fh(){const e=bt(),t=pt(e.store).textureViewer;return t.open?(0,mt.jsx)(Lh,{viewer:t,onClose:e.closeTextureViewer}):null}const Nh=120;function Lh(e){const{viewer:t,onClose:n}=e,r=(0,dt.useRef)(null),i=(0,dt.useRef)(null),s=(0,dt.useRef)(null),o=(0,dt.useRef)(null),[a,l]=(0,dt.useState)({r:!0,g:!0,b:!0,a:!0}),[u,c]=(0,dt.useState)(1),[h,d]=(0,dt.useState)("checker"),[f,p]=(0,dt.useState)(null),[m,g]=(0,dt.useState)(null),[E,v]=(0,dt.useState)(!1);(0,dt.useEffect)(()=>{let e=!1;const n=t=>{e||(o.current=t,p({width:t.width,height:t.height}),c(kh(t.width,t.height)),v(!0))};if(t.raw){const r=function(e){try{if(!e.data||e.width<=0||e.height<=0)return null;const t=function(e){const t=atob(e),n=new Uint8ClampedArray(t.length);for(let e=0;e{e=!0}}const r=new Image;return r.onload=()=>{const e=document.createElement("canvas");e.width=r.naturalWidth||1,e.height=r.naturalHeight||1;const t=e.getContext("2d");if(!t)return;t.drawImage(r,0,0);const i=t.getImageData(0,0,e.width,e.height);n({data:new Uint8ClampedArray(i.data),width:e.width,height:e.height})},r.src=t.src,()=>{e=!0}},[t.src,t.raw]),(0,dt.useEffect)(()=>{const e=o.current,t=r.current;if(!E||!e||!t)return;const n=function(e,t,n){let r=e.current;return r||(r=document.createElement("canvas"),e.current=r),r.width!==t&&(r.width=t),r.height!==n&&(r.height=n),r}(s,e.width,e.height),i=n.getContext("2d"),l=t.getContext("2d");if(!i||!l)return;const c=function(e,t){const n=new Uint8ClampedArray(e.length),r=t.a&&!t.r&&!t.g&&!t.b;for(let i=0;i{const e=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]);const C="textureViewerViewport"+("checker"===h?" checker":""),D="black"===h?{background:"#000"}:"white"===h?{background:"#fff"}:void 0;return(0,mt.jsx)("div",{className:"textureViewerOverlay",onClick:n,children:(0,mt.jsxs)("div",{className:"textureViewerModal",onClick:e=>e.stopPropagation(),children:[(0,mt.jsxs)("div",{className:"textureViewerHeader",children:[(0,mt.jsx)("span",{className:"textureViewerTitle",children:t.label}),(0,mt.jsxs)("span",{className:"textureViewerMeta",children:[f?f.width+" × "+f.height:"",!t.raw&&f?" · thumbnail":""]}),(0,mt.jsx)("span",{className:"textureViewerClose",title:"Close (Esc)",onClick:n,children:"✕"})]}),(0,mt.jsxs)("div",{className:"textureViewerToolbar",children:[(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Channels"}),(0,mt.jsx)(Oh,{channel:"r",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"g",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"b",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"a",mask:a,setMask:l})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"tvBtn",title:"Force alpha = 1 to reveal RGB hidden behind transparency",onClick:()=>l({r:!0,g:!0,b:!0,a:!1}),children:"Opaque"}),(0,mt.jsx)("span",{className:"tvBtn",title:"Show the alpha channel as grayscale",onClick:()=>l({r:!1,g:!1,b:!1,a:!0}),children:"Alpha → gray"})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"BG"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)(Ih,{value:"checker",glyph:"▦",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"black",glyph:"■",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"white",glyph:"□",background:h,setBackground:d})]})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Zoom"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.max(1,e/2)),children:"−"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(f?kh(f.width,f.height):1),children:"Fit"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.min(32,2*e)),children:"+"})]}),(0,mt.jsxs)("span",{className:"zoomVal",children:[Math.round(100*u),"%"]})]}),(0,mt.jsx)("div",{className:"textureViewerGroup textureViewerGroupEnd",children:(0,mt.jsx)("span",{className:"tvBtn primary",onClick:()=>{const e=s.current;e&&e.toBlob(e=>{if(!e)return;const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=((t.label||"texture").replace(/[^a-z0-9_\-]+/gi,"_").replace(/^_+|_+$/g,"")||"texture")+".png",r.click(),setTimeout(()=>URL.revokeObjectURL(n),0)})},children:"⭳ Save PNG"})})]}),(0,mt.jsxs)("div",{className:"textureViewerBody",children:[(0,mt.jsxs)("div",{className:C,style:D,children:[(0,mt.jsx)("canvas",{ref:r,className:"textureViewerCanvas",onMouseMove:e=>{const t=o.current,n=r.current,a=i.current,l=s.current;if(!t||!n)return;const c=n.getBoundingClientRect(),h=Math.floor((e.clientX-c.left)/u),d=Math.floor((e.clientY-c.top)/u);if(h<0||d<0||h>=t.width||d>=t.height)return g(null),void(a&&(a.style.display="none"));const f=4*(d*t.width+h);g({x:h,y:d,r:t.data[f],g:t.data[f+1],b:t.data[f+2],a:t.data[f+3]}),function(e,t,n,r){if(!e||!t)return;const i=e.getContext("2d");if(!i)return;i.imageSmoothingEnabled=!1,i.clearRect(0,0,Nh,Nh),i.drawImage(t,n-7,r-7,15,15,0,0,Nh,Nh),i.strokeStyle="#F0640D",i.lineWidth=2,i.strokeRect(56,56,8,8),e.style.display="block"}(a,l,h,d)},onMouseLeave:()=>{g(null),i.current&&(i.current.style.display="none")}}),(0,mt.jsx)("canvas",{ref:i,className:"textureViewerLoupe",width:Nh,height:Nh})]}),(0,mt.jsxs)("div",{className:"textureViewerRail",children:[(0,mt.jsx)("div",{className:"railTitle",children:"Pixel inspector"}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"position"}),(0,mt.jsx)("span",{className:"v",children:m?m.x+", "+m.y:"—"})]}),(0,mt.jsx)("div",{className:"swatch",children:(0,mt.jsx)("div",{className:"swatchInner",style:m?{background:"rgba("+m.r+","+m.g+","+m.b+","+m.a/255+")"}:void 0})}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"R"}),(0,mt.jsx)("span",{className:"v",children:m?m.r:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"G"}),(0,mt.jsx)("span",{className:"v",children:m?m.g:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"B"}),(0,mt.jsx)("span",{className:"v",children:m?m.b:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"A"}),(0,mt.jsx)("span",{className:"v",children:m?m.a:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"hex"}),(0,mt.jsx)("span",{className:"v",children:m?xh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"norm"}),(0,mt.jsx)("span",{className:"v",children:m?wh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"hint",children:["Move over the texture to sample pixels. Toggle channels to isolate RGB / alpha.",(0,mt.jsx)("b",{children:" Opaque"})," reveals colour hidden behind transparency (#183)."]})]})]})]})})}function Oh(e){const{channel:t,mask:n,setMask:r}=e,i=n[t],s="channel "+t+(i?" on":"");return(0,mt.jsx)("span",{className:s,onClick:()=>r(Object.assign(Object.assign({},n),{[t]:!i})),children:t.toUpperCase()})}function Ih(e){const{value:t,glyph:n,background:r,setBackground:i}=e;return(0,mt.jsx)("span",{className:"tvBtn"+(r===t?" active":""),onClick:()=>i(t),children:n})}function kh(e,t){return Math.max(1,Math.min(16,Math.floor(480/Math.max(e,t))||1))}function Mh(){const e=bt(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"resultViewComponent "+(t.visible?"active":""),children:[(0,mt.jsx)(Tt,{}),(0,mt.jsxs)(Rt,{children:[0===t.menuStatus&&(0,mt.jsx)(wt,{active:!0,captures:t.captures,onCaptureSelected:t=>{e.selectCapture(t),e.handleMenuStatusChange(40)},onSaveRequested:e.handleSaveRequested,onCaptureLoaded:e.handleCaptureLoaded}),40===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(Ft,{children:t.visualStates.map((t,n)=>(0,mt.jsx)(Nt,{item:t,onVisualStateSelected:()=>e.handleVisualStateSelected(n)},n))}),(0,mt.jsx)(Lt,{children:t.commands.map((t,n)=>(0,mt.jsx)(Ot,{command:t,onCommandSelected:()=>e.handleCommandSelected(n),onVertexSelected:()=>e.handleVertexSelected(n),onFragmentSelected:()=>e.handleFragmentSelected(n),onShaderSelected:()=>e.handleShaderSelected(n)},n))}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]}),10===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(kt,{left:!0,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationLeft})})}),(0,mt.jsx)(kt,{left:!1,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationRight})})})]}),20===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.initStateData})}),30===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.endStateData})}),60===t.menuStatus&&(0,mt.jsx)(_h,{}),50===t.menuStatus&&t.sourceCodeState&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(ch,{state:t.sourceCodeState,errorMessage:t.sourceCodeError,onVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!1),onFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!1),onTranslatedVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!0),onTranslatedFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!0),onCloseClicked:e.handleSourceCodeClose,onSourceCodeChanged:e.handleSourceCodeChanged,onBeautifyChanged:e.handleBeautifyChanged,onPreprocessChanged:e.handlePreprocessChanged}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]})]}),(0,mt.jsx)(Fh,{})]})}class Ph{static getMDNLink(e){const t=Ph.WebGL2Functions[e];if(t)return Ph.WebGL2RootUrl+t;const n=Ph.WebGLFunctions[e];if(n)return Ph.WebGLRootUrl+n;const r=Ph.AngleInstancedArraysExtFunctions[e];return r?Ph.AngleInstancedArraysExtRootUrl+r:Ph.WebGLRootUrl+e}}Ph.WebGL2RootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/",Ph.WebGLRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/",Ph.AngleInstancedArraysExtRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/",Ph.WebGL2Functions={beginQuery:"beginQuery",beginTransformFeedback:"beginTransformFeedback",bindBufferBase:"bindBufferBase",bindBufferRange:"bindBufferRange",bindSampler:"bindSampler",bindTransformFeedback:"bindTransformFeedback",bindVertexArray:"bindVertexArray",blitFramebuffer:"blitFramebuffer",clearBufferfv:"clearBuffer",clearBufferiv:"clearBuffer",clearBufferuiv:"clearBuffer",clearBufferfi:"clearBuffer",clientWaitSync:"clientWaitSync",compressedTexImage3D:"compressedTexImage3D",compressedTexSubImage3D:"compressedTexSubImage3D",copyBufferSubData:"copyBufferSubData",copyTexSubImage3D:"copyTexSubImage3D",createQuery:"createQuery",createSampler:"createSampler",createTransformFeedback:"createTransformFeedback",createVertexArray:"createVertexArray",deleteQuery:"deleteQuery",deleteSampler:"deleteSampler",deleteSync:"deleteSync",deleteTransformFeedback:"deleteTransformFeedback",deleteVertexArray:"deleteVertexArray",drawArraysInstanced:"drawArraysInstanced",drawBuffers:"drawBuffers",drawElementsInstanced:"drawElementsInstanced",drawRangeElements:"drawRangeElements",endQuery:"endQuery",endTransformFeedback:"endTransformFeedback",fenceSync:"fenceSync",framebufferTextureLayer:"framebufferTextureLayer",getActiveUniformBlockName:"getActiveUniformBlockName",getActiveUniformBlockParameter:"getActiveUniformBlockParameter",getActiveUniforms:"getActiveUniforms",getBufferSubData:"getBufferSubData",getFragDataLocation:"getFragDataLocation",getIndexedParameter:"getIndexedParameter",getInternalformatParameter:"getInternalformatParameter",getQuery:"getQuery",getQueryParameter:"getQueryParameter",getSamplerParameter:"getSamplerParameter",getSyncParameter:"getSyncParameter",getTransformFeedbackVarying:"getTransformFeedbackVarying",getUniformBlockIndex:"getUniformBlockIndex",getUniformIndices:"getUniformIndices",invalidateFramebuffer:"invalidateFramebuffer",invalidateSubFramebuffer:"invalidateSubFramebuffer",isQuery:"isQuery",isSampler:"isSampler",isSync:"isSync",isTransformFeedback:"isTransformFeedback",isVertexArray:"isVertexArray",pauseTransformFeedback:"pauseTransformFeedback",readBuffer:"readBuffer",renderbufferStorageMultisample:"renderbufferStorageMultisample",resumeTransformFeedback:"resumeTransformFeedback",samplerParameteri:"samplerParameter",samplerParameterf:"samplerParameter",texImage3D:"texImage3D",texStorage2D:"texStorage2D",texStorage3D:"texStorage3D",texSubImage3D:"texSubImage3D",transformFeedbackVaryings:"transformFeedbackVaryings",uniform1ui:"uniform",uniform2ui:"uniform",uniform3ui:"uniform",uniform4ui:"uniform",uniform1fv:"uniform",uniform2fv:"uniform",uniform3fv:"uniform",uniform4fv:"uniform",uniform1iv:"uniform",uniform2iv:"uniform",uniform3iv:"uniform",uniform4iv:"uniform",uniform1uiv:"uniform",uniform2uiv:"uniform",uniform3uiv:"uniform",uniform4uiv:"uniform",uniformBlockBinding:"uniformBlockBinding",uniformMatrix2fv:"uniformMatrix",uniformMatrix3x2fv:"uniformMatrix",uniformMatrix4x2fv:"uniformMatrix",uniformMatrix2x3fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4x3fv:"uniformMatrix",uniformMatrix2x4fv:"uniformMatrix",uniformMatrix3x4fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttribDivisor:"vertexAttribDivisor",vertexAttribI4i:"vertexAttribI",vertexAttribI4ui:"vertexAttribI",vertexAttribI4iv:"vertexAttribI",vertexAttribI4uiv:"vertexAttribI",vertexAttribIPointer:"vertexAttribIPointer",waitSync:"waitSync"},Ph.WebGLFunctions={uniform1f:"uniform",uniform1fv:"uniform",uniform1i:"uniform",uniform1iv:"uniform",uniform2f:"uniform",uniform2fv:"uniform",uniform2i:"uniform",uniform2iv:"uniform",uniform3f:"uniform",uniform3i:"uniform",uniform3iv:"uniform",uniform4f:"uniform",uniform4fv:"uniform",uniform4i:"uniform",uniform4iv:"uniform",uniformMatrix2fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttrib1f:"vertexAttrib",vertexAttrib2f:"vertexAttrib",vertexAttrib3f:"vertexAttrib",vertexAttrib4f:"vertexAttrib",vertexAttrib1fv:"vertexAttrib",vertexAttrib2fv:"vertexAttrib",vertexAttrib3fv:"vertexAttrib",vertexAttrib4fv:"vertexAttrib"},Ph.AngleInstancedArraysExtFunctions={drawArraysInstancedANGLE:"drawArraysInstancedANGLE",drawElementsInstancedANGLE:"drawElementsInstancedANGLE",vertexAttribDivisorANGLE:"vertexAttribDivisorANGLE"};const Bh={activeTexture:[["texture"]],attachShader:[["program","shader"]],beginQuery:[["target","query"]],beginTransformFeedback:[["primitiveMode"]],bindAttribLocation:[["program","index","name"]],bindBuffer:[["target","buffer"]],bindBufferBase:[["target","index","buffer"]],bindBufferRange:[["target","index","buffer","offset","size"]],bindFramebuffer:[["target","framebuffer"]],bindRenderbuffer:[["target","renderbuffer"]],bindSampler:[["unit","sampler"]],bindTexture:[["target","texture"]],bindTransformFeedback:[["target","tf"]],bindVertexArray:[["array"]],blendColor:[["red","green","blue","alpha"]],blendEquation:[["mode"]],blendEquationSeparate:[["modeRGB","modeAlpha"]],blendFunc:[["sfactor","dfactor"]],blendFuncSeparate:[["srcRGB","dstRGB","srcAlpha","dstAlpha"]],blitFramebuffer:[["srcX0","srcY0","srcX1","srcY1","dstX0","dstY0","dstX1","dstY1","mask","filter"]],bufferData:[["target","data","usage"],["target","size","usage"],["target","srcData","usage"],["target","srcData","usage","srcOffset","length"]],bufferSubData:[["target","dstByteOffset","srcData"],["target","offset","data"],["target","dstByteOffset","srcData","srcOffset","length"]],checkFramebufferStatus:[["target"]],clear:[["mask"]],clearBufferfi:[["buffer","drawbuffer","depth","stencil"]],clearBufferfv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferiv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferuiv:[["buffer","drawbuffer","values","srcOffset"]],clearColor:[["red","green","blue","alpha"]],clearDepth:[["depth"]],clearStencil:[["s"]],clientWaitSync:[["sync","flags","timeout"]],colorMask:[["red","green","blue","alpha"]],compileShader:[["shader"]],compressedTexImage2D:[["target","level","internalformat","width","height","border","data"],["target","level","internalformat","width","height","border","imageSize","offset"],["target","level","internalformat","width","height","border","srcData","srcOffset","srcLengthOverride"]],compressedTexImage3D:[["target","level","internalformat","width","height","depth","border","imageSize","offset"],["target","level","internalformat","width","height","depth","border","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage2D:[["target","level","xoffset","yoffset","width","height","format","data"],["target","level","xoffset","yoffset","width","height","format","imageSize","offset"],["target","level","xoffset","yoffset","width","height","format","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","imageSize","offset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","srcData","srcOffset","srcLengthOverride"]],copyBufferSubData:[["readTarget","writeTarget","readOffset","writeOffset","size"]],copyTexImage2D:[["target","level","internalformat","x","y","width","height","border"]],copyTexSubImage2D:[["target","level","xoffset","yoffset","x","y","width","height"]],copyTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","x","y","width","height"]],createBuffer:[[]],createFramebuffer:[[]],createProgram:[[]],createQuery:[[]],createRenderbuffer:[[]],createSampler:[[]],createShader:[["type"]],createTexture:[[]],createTransformFeedback:[[]],createVertexArray:[[]],cullFace:[["mode"]],deleteBuffer:[["buffer"]],deleteFramebuffer:[["framebuffer"]],deleteProgram:[["program"]],deleteQuery:[["query"]],deleteRenderbuffer:[["renderbuffer"]],deleteSampler:[["sampler"]],deleteShader:[["shader"]],deleteSync:[["sync"]],deleteTexture:[["texture"]],deleteTransformFeedback:[["tf"]],deleteVertexArray:[["vertexArray"]],depthFunc:[["func"]],depthMask:[["flag"]],depthRange:[["zNear","zFar"]],detachShader:[["program","shader"]],disable:[["cap"]],disableVertexAttribArray:[["index"]],drawArrays:[["mode","first","count"]],drawArraysInstanced:[["mode","first","count","instanceCount"]],drawBuffers:[["buffers"]],drawElements:[["mode","count","type","offset"]],drawElementsInstanced:[["mode","count","type","offset","instanceCount"]],drawRangeElements:[["mode","start","end","count","type","offset"]],enable:[["cap"]],enableVertexAttribArray:[["index"]],endQuery:[["target"]],endTransformFeedback:[[]],fenceSync:[["condition","flags"]],finish:[[]],flush:[[]],framebufferRenderbuffer:[["target","attachment","renderbuffertarget","renderbuffer"]],framebufferTexture2D:[["target","attachment","textarget","texture","level"]],framebufferTextureLayer:[["target","attachment","texture","level","layer"]],frontFace:[["mode"]],generateMipmap:[["target"]],getActiveAttrib:[["program","index"]],getActiveUniform:[["program","index"]],getActiveUniformBlockName:[["program","uniformBlockIndex"]],getActiveUniformBlockParameter:[["program","uniformBlockIndex","pname"]],getActiveUniforms:[["program","uniformIndices","pname"]],getAttachedShaders:[["program"]],getAttribLocation:[["program","name"]],getBufferParameter:[["target","pname"]],getBufferSubData:[["target","srcByteOffset","dstBuffer","dstOffset","length"]],getContextAttributes:[[]],getError:[[]],getExtension:[["extensionName"],["name"]],getFragDataLocation:[["program","name"]],getFramebufferAttachmentParameter:[["target","attachment","pname"]],getIndexedParameter:[["target","index"]],getInternalformatParameter:[["target","internalformat","pname"]],getParameter:[["pname"]],getProgramInfoLog:[["program"]],getProgramParameter:[["program","pname"]],getQuery:[["target","pname"]],getQueryParameter:[["query","pname"]],getRenderbufferParameter:[["target","pname"]],getSamplerParameter:[["sampler","pname"]],getShaderInfoLog:[["shader"]],getShaderParameter:[["shader","pname"]],getShaderPrecisionFormat:[["shadertype","precisiontype"]],getShaderSource:[["shader"]],getSupportedExtensions:[[]],getSyncParameter:[["sync","pname"]],getTexParameter:[["target","pname"]],getTransformFeedbackVarying:[["program","index"]],getUniform:[["program","location"]],getUniformBlockIndex:[["program","uniformBlockName"]],getUniformIndices:[["program","uniformNames"]],getUniformLocation:[["program","name"]],getVertexAttrib:[["index","pname"]],getVertexAttribOffset:[["index","pname"]],hint:[["target","mode"]],invalidateFramebuffer:[["target","attachments"]],invalidateSubFramebuffer:[["target","attachments","x","y","width","height"]],isBuffer:[["buffer"]],isContextLost:[[]],isEnabled:[["cap"]],isFramebuffer:[["framebuffer"]],isProgram:[["program"]],isQuery:[["query"]],isRenderbuffer:[["renderbuffer"]],isSampler:[["sampler"]],isShader:[["shader"]],isSync:[["sync"]],isTexture:[["texture"]],isTransformFeedback:[["tf"]],isVertexArray:[["vertexArray"]],lineWidth:[["width"]],linkProgram:[["program"]],pauseTransformFeedback:[[]],pixelStorei:[["pname","param"]],polygonOffset:[["factor","units"]],readBuffer:[["src"]],readPixels:[["x","y","width","height","format","type","dstData"],["x","y","width","height","format","type","offset"],["x","y","width","height","format","type","pixels"],["x","y","width","height","format","type","dstData","dstOffset"]],renderbufferStorage:[["target","internalformat","width","height"]],renderbufferStorageMultisample:[["target","samples","internalformat","width","height"]],resumeTransformFeedback:[[]],sampleCoverage:[["value","invert"]],samplerParameterf:[["sampler","pname","param"]],samplerParameteri:[["sampler","pname","param"]],scissor:[["x","y","width","height"]],shaderSource:[["shader","source"]],stencilFunc:[["func","ref","mask"]],stencilFuncSeparate:[["face","func","ref","mask"]],stencilMask:[["mask"]],stencilMaskSeparate:[["face","mask"]],stencilOp:[["fail","zfail","zpass"]],stencilOpSeparate:[["face","fail","zfail","zpass"]],texImage2D:[["target","level","internalformat","format","type","source"],["target","level","internalformat","width","height","border","format","type","pboOffset"],["target","level","internalformat","width","height","border","format","type","pixels"],["target","level","internalformat","width","height","border","format","type","source"],["target","level","internalformat","width","height","border","format","type","srcData","srcOffset"]],texImage3D:[["target","level","internalformat","width","height","depth","border","format","type","pboOffset"],["target","level","internalformat","width","height","depth","border","format","type","source"],["target","level","internalformat","width","height","depth","border","format","type","srcData"],["target","level","internalformat","width","height","depth","border","format","type","srcData","srcOffset"]],texParameterf:[["target","pname","param"]],texParameteri:[["target","pname","param"]],texStorage2D:[["target","levels","internalformat","width","height"]],texStorage3D:[["target","levels","internalformat","width","height","depth"]],texSubImage2D:[["target","level","xoffset","yoffset","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","pboOffset"],["target","level","xoffset","yoffset","width","height","format","type","pixels"],["target","level","xoffset","yoffset","width","height","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","srcData","srcOffset"]],texSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","pboOffset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","source"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","srcData","srcOffset"]],transformFeedbackVaryings:[["program","varyings","bufferMode"]],uniform1f:[["location","x"]],uniform1fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1i:[["location","x"]],uniform1iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1ui:[["location","v0"]],uniform1uiv:[["location","data","srcOffset","srcLength"]],uniform2f:[["location","x","y"]],uniform2fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2i:[["location","x","y"]],uniform2iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2ui:[["location","v0","v1"]],uniform2uiv:[["location","data","srcOffset","srcLength"]],uniform3f:[["location","x","y","z"]],uniform3fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3i:[["location","x","y","z"]],uniform3iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3ui:[["location","v0","v1","v2"]],uniform3uiv:[["location","data","srcOffset","srcLength"]],uniform4f:[["location","x","y","z","w"]],uniform4fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4i:[["location","x","y","z","w"]],uniform4iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4ui:[["location","v0","v1","v2","v3"]],uniform4uiv:[["location","data","srcOffset","srcLength"]],uniformBlockBinding:[["program","uniformBlockIndex","uniformBlockBinding"]],uniformMatrix2fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x3fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x3fv:[["location","transpose","data","srcOffset","srcLength"]],useProgram:[["program"]],validateProgram:[["program"]],vertexAttrib1f:[["index","x"]],vertexAttrib1fv:[["index","values"]],vertexAttrib2f:[["index","x","y"]],vertexAttrib2fv:[["index","values"]],vertexAttrib3f:[["index","x","y","z"]],vertexAttrib3fv:[["index","values"]],vertexAttrib4f:[["index","x","y","z","w"]],vertexAttrib4fv:[["index","values"]],vertexAttribDivisor:[["index","divisor"]],vertexAttribI4i:[["index","x","y","z","w"]],vertexAttribI4iv:[["index","values"]],vertexAttribI4ui:[["index","x","y","z","w"]],vertexAttribI4uiv:[["index","values"]],vertexAttribIPointer:[["index","size","type","stride","offset"]],vertexAttribPointer:[["index","size","type","normalized","stride","offset"]],viewport:[["x","y","width","height"]],waitSync:[["sync","flags","timeout"]]};class Uh{static getNames(e,t){const n=Bh[e];if(!n||0===n.length)return null;for(const e of n)if(e.length===t)return e;let r=null;for(const e of n)e.length>=t&&(null===r||e.lengthi.length&&(i=e);return i}static getName(e,t,n){const r=Uh.getNames(e,n);return r&&t>=0&&t{const e={};for(let t=0;t<64;t++)e["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;return e})();class qh{constructor(e){this.sources=e.sources||[],this.names=e.names||[],this.sourceRoot=e.sourceRoot||"",this.lines=qh.parseMappings(e.mappings||"")}originalPositionFor(e,t){const n={source:null,line:null,column:null,name:null},r=e-1;if(r<0||r>=this.lines.length)return n;const i=this.lines[r];if(!i||0===i.length)return n;const s=this.findSegment(i,t);if(!s)return n;const o=s.sourceIndex>=0&&s.sourceIndex=0&&s.nameIndex>1,o=e[s];o.generatedColumn<=t?(i=o,n=s+1):r=s-1}return i}static parseMappings(e){const t=[];let n=0,r=0,i=0,s=0;const o=e.split(";");for(let e=0;e0){const e=a.split(",");for(let t=0;t=4&&(n+=o[1],r+=o[2],i+=o[3],a.sourceIndex=n,a.originalLine=r,a.originalColumn=i,o.length>=5&&(s+=o[4],a.nameIndex=s)),l.push(a)}}l.sort((e,t)=>e.generatedColumn-t.generatedColumn),t.push(l)}return t}static decodeSegment(e){const t=[];let n=0;for(;n>>=1,t.push(o?-r:r)}return t}}var Qh=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})};class Zh{constructor(e){this.cache=new Map,this.inflight=new Map,this.fetchFn=e||("undefined"!=typeof fetch?fetch.bind(globalThis):void 0)}resolveFrames(e){return Qh(this,void 0,void 0,function*(){return e&&0!==e.length?Promise.all(e.map(e=>this.resolveFrame(e))):e||[]})}resolveFrame(e){return Qh(this,void 0,void 0,function*(){const t=Zh.parseFrame(e);if(!t)return e;let n;try{n=yield this.getConsumer(t.url)}catch(t){return e}if(!n)return e;const r=n.originalPositionFor(t.line,t.column);return r.source&&null!==r.line?Zh.formatFrame(t.functionName,r.name,r.source,r.line,r.column||0):e})}static parseFrame(e){if(!e)return null;let t=e.match(/^(.*?)\s*\((.+):(\d+):(\d+)\)\s*$/);return t?{functionName:t[1].trim(),url:t[2],line:parseInt(t[3],10),column:parseInt(t[4],10)}:(t=e.match(/^\s*(.+):(\d+):(\d+)\s*$/),t?{functionName:"",url:t[1].trim(),line:parseInt(t[2],10),column:parseInt(t[3],10)}:null)}static formatFrame(e,t,n,r,i){const s=t||e,o=n+":"+r+":"+i;return s?s+" ("+o+")":o}getConsumer(e){return Qh(this,void 0,void 0,function*(){if(this.cache.has(e))return this.cache.get(e);const t=this.inflight.get(e);if(t)return t;const n=this.loadConsumer(e).then(t=>(this.cache.set(e,t),this.inflight.delete(e),t)).catch(()=>(this.cache.set(e,null),this.inflight.delete(e),null));return this.inflight.set(e,n),n})}loadConsumer(e){return Qh(this,void 0,void 0,function*(){if(!this.fetchFn)return null;const t=yield this.fetchFn(e);if(!t.ok)return null;const n=yield t.text(),r=Zh.extractSourceMappingURL(n);if(!r)return null;let i;if(0===r.indexOf("data:"))i=Zh.parseDataUri(r);else{const t=Zh.resolveUrl(r,e),n=yield this.fetchFn(t);if(!n.ok)return null;i=yield n.json()}return i&&"string"==typeof i.mappings?new qh(i):null})}static extractSourceMappingURL(e){const t=/\/\/[#@]\s*sourceMappingURL=(\S+)\s*$/gm;let n,r=null;for(;null!==(n=t.exec(e));)r=n[1];return r}static parseDataUri(e){const t=e.indexOf(",");if(-1===t)return null;const n=e.substring(0,t),r=e.substring(t+1);try{const e=/;base64/i.test(n)?Zh.decodeBase64(r):decodeURIComponent(r);return JSON.parse(e)}catch(e){return null}}static decodeBase64(e){if("function"==typeof atob)return atob(e);const t=globalThis.Buffer;if(t)return t.from(e,"base64").toString("utf-8");throw new Error("No base64 decoder available.")}static resolveUrl(e,t){try{return new URL(e,t).href}catch(t){return e}}}function Jh(e){return e&&(e.text||e.name)||""}function ed(e,t){const n=[];if(!e||!t)return n;const r=e.DrawCall,i=t.DrawCall;ad("uniform",r&&r.uniforms,i&&i.uniforms,n),ad("uniformBlock",r&&r.uniformBlocks,i&&i.uniformBlocks,n);const s=sd(e,t);for(const r of s){if(td[r])continue;const i=e[r],s=t[r];(rd(i)||rd(s))&&od(i,s,r,n)}return n}const td={id:!0,name:!0,commandArguments:!0,result:!0,status:!0,marker:!0,text:!0,startTime:!0,commandEndTime:!0,endTime:!0,stackTrace:!0,consumeCommandId:!0,VisualState:!0},nd={__SPECTOR_Object_TAG:!0,__SPECTOR_Object_CustomData:!0,__SPECTOR_Metadata:!0,customData:!0,visual:!0,visualPixels:!0,VisualState:!0,texture:!0,sampler:!0,location:!0,source:!0,translatedSource:!0,analyserName:!0,uniforms:!0,uniformBlocks:!0,length:!0};function rd(e){return null!==e&&"object"==typeof e}function id(e){if(!rd(e))return null;const t=e.__SPECTOR_Object_TAG||("string"==typeof e.typeName&&"id"in e?e:null);return t&&"string"==typeof t.typeName?t.typeName:null}function sd(e,t){const n=[],r={},i=e=>{if(rd(e))for(const t in e)e.hasOwnProperty(t)&&!r[t]&&(r[t]=!0,n.push(t))};return i(e),i(t),n}function od(e,t,n,r,i=0){const s=id(e),o=id(t);if(null!==s||null!==o){const e=null!==s?s:"(absent)",t=null!==o?o:"(absent)";return void(e!==t&&r.push({path:n,previous:e,current:t}))}const a=rd(e),l=rd(t);if(!a&&!l){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}if(a!==l||i>=8){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}for(const s of sd(e,t))nd[s]||od(e?e[s]:void 0,t?t[s]:void 0,n+"."+s,r,i+1)}function ad(e,t,n,r){const i=hd(t),s=hd(n),o=[],a={};for(const e in i)i.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const e in s)s.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const t of o){const n=i.hasOwnProperty(t)?i[t]:void 0,o=s.hasOwnProperty(t)?s[t]:void 0,a=n?dd(n.value):"(absent)",l=o?dd(o.value):"(absent)";a!==l&&r.push({path:e+" "+t,previous:a,current:l}),ld(e+" "+t,n,o,r)}}function ld(e,t,n,r){const i=t&&t.texture,s=n&&n.texture;(rd(i)||rd(s))&&cd(e+" texture",i,s,r);const o=t&&t.textures,a=n&&n.textures,l=Array.isArray(o)?o.length:0,u=Array.isArray(a)?a.length:0,c=Math.max(l,u);for(let t=0;t0?o[t]:void 0,u>0?a[t]:void 0,r)}const ud=["width","height","depth","format","internalFormat","textureType"];function cd(e,t,n,r){(rd(t)||rd(n))&&(function(e,t,n,r){for(const i of ud){const s=t?t[i]:void 0,o=n?n[i]:void 0;if(void 0===s&&void 0===o)continue;const a=dd(s),l=dd(o);a!==l&&r.push({path:e+" "+i,previous:a,current:l})}}(e,t,n,r),function(e,t,n,r){if(rd(t)||rd(n))for(const i of sd(t,n)){const s=t?t[i]:void 0,o=n?n[i]:void 0,a="string"==typeof s,l="string"==typeof o;(a||l)&&s!==o&&r.push({path:e+" ("+i+")",previous:a?"(image)":"(absent)",current:l?"(image)":"(absent)",previousImage:a?s:void 0,currentImage:l?o:void 0})}}(e,t&&t.visual,n&&n.visual,r))}function hd(e){const t={};if(Array.isArray(e))for(const n of e)n&&"string"==typeof n.name&&(t[n.name]=n);return t}function dd(e){if(void 0===e)return"(absent)";if(null===e)return"null";try{return JSON.stringify(e)}catch(t){return String(e)}}function fd(e,t){for(let n=0;n{if(this.store.getSnapshot().currentCapture)switch(e){case 0:this._displayCaptures();break;case 40:this._displayCurrentCapture();break;case 10:this._displayInformation();break;case 20:this._displayInitState();break;case 30:this._displayEndState();break;case 60:this._displayCompare()}else this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))},this.handleSearchTextChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{searchText:e})),this._search(e)},this.handleCompareOnlyDifferencesChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{compareOnlyDifferences:e}))},this.handleCompareCommandSelected=e=>{null!=e&&(this._currentCommandId=e,this._displayCurrentCapture())},this.handleCommandSelected=e=>{this.selectCommand(e)},this.openTextureViewer=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{textureViewer:{open:!0,src:e.src,label:e.label,pixelated:e.pixelated,raw:e.raw||null}}))},this.closeTextureViewer=()=>{this.store.setState(e=>Object.assign(Object.assign({},e),{textureViewer:Object.assign(Object.assign({},e.textureViewer),{open:!1})}))},this.handleVisualStateSelected=e=>{this.selectVisualState(e)},this.handleVertexSelected=e=>{this.selectCommand(e),this._openShader(!1)},this.handleFragmentSelected=e=>{this.selectCommand(e),this._openShader(!0)},this.handleShaderSelected=e=>{var t;const n=null===(t=this.store.getSnapshot().commands[e])||void 0===t?void 0:t.capture.shader;n&&(this.selectCommand(e),this._openCapturedShader(n))},this.handleShaderSourceOpen=(e,t)=>{this._openCapturedShader(e,t)},this.handleSourceCodeChanged=e=>{this.onSourceCodeChanged.trigger(e)},this.handleSourceCodeClose=()=>{this._displayCurrentCapture()},this.handleSourceCodeTabChange=(e,t)=>{this.store.setState(n=>n.sourceCodeState?Object.assign(Object.assign({},n),{sourceCodeState:Object.assign(Object.assign({},n.sourceCodeState),{fragment:e,translated:t})}):n)},this.handleBeautifyChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{beautify:e})}):t)},this.handlePreprocessChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{preprocessed:e})}):t)},this.handleSaveRequested=e=>{this.saveCapture(e)},this.handleCaptureLoaded=e=>{this.addCapture(e)},this.handleClose=()=>{this.hide()},this._rootPlaceHolder=e||document.body,this.onSourceCodeChanged=new l,this.store=new ft(Object.assign({},pd)),this._container=document.createElement("div"),this._container.className="spector-react-result-view",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(yt.Provider,{value:this},(0,dt.createElement)(Mh))),this._rootPlaceHolder.addEventListener("keydown",e=>{if(40!==this.store.getSnapshot().menuStatus)return;const t=e.keyCode;38===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousCommand()):40===t?(e.preventDefault(),e.stopPropagation(),this._selectNextCommand()):33===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousVisualState()):34===t&&(e.preventDefault(),e.stopPropagation(),this._selectNextVisualState())})}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}addCapture(e){return this.store.setState(t=>{const n=t.captures.map(e=>({capture:e.capture,active:!1}));return Object.assign(Object.assign({},t),{captures:[{capture:e,active:!0},...n],currentCapture:e})}),this._currentCommandId=-1,this._displayCurrentCapture(),0}selectCapture(e){this._currentCommandId=-1,this.store.setState(t=>{var n,r;const i=t.captures.map((t,n)=>({capture:t.capture,active:n===e}));return Object.assign(Object.assign({},t),{captures:i,currentCapture:null!==(r=null===(n=i[e])||void 0===n?void 0:n.capture)&&void 0!==r?r:null})}),this._displayCurrentCapture()}selectCommand(e){const t=this.store.getSnapshot();if(e<0||e>=t.commands.length)return;const n=t.commands[e];this._currentCommandId=n.capture.id;const r=n.visualStateIndex,i=this._buildCommandDetail(e,t.commands,t.visualStates);this.store.setState(t=>Object.assign(Object.assign({},t),{commands:t.commands.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentCommandIndex:e,visualStates:t.visualStates.map((e,t)=>e.active!==(t===r)?Object.assign(Object.assign({},e),{active:t===r}):e),currentVisualStateIndex:r,commandDetailData:i}))}selectVisualState(e){const t=this.store.getSnapshot();if(e<0||e>=t.visualStates.length)return;const n=t.visualStates[e].commandIndex;if(n===Number.MIN_VALUE)return void this._displayInitState();if(n===Number.MAX_VALUE)return void this._displayEndState();n>=0&&(this._currentCommandId=t.commands[n].capture.id);const r=n>=0?this._buildCommandDetail(n,t.commands,t.visualStates):t.commandDetailData;this.store.setState(t=>Object.assign(Object.assign({},t),{visualStates:t.visualStates.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentVisualStateIndex:e,commands:n>=0?t.commands.map((e,t)=>e.active!==(t===n)?Object.assign(Object.assign({},e),{active:t===n}):e):t.commands,currentCommandIndex:n>=0?n:t.currentCommandIndex,commandDetailData:r}))}showSourceCodeError(e){this.store.setState(t=>Object.assign(Object.assign({},t),{sourceCodeError:e}))}saveCapture(e){const t=JSON.stringify(e,null,4),n=new Blob([t],{type:"octet/stream"}),r="capture "+new Date(e.startTime).toTimeString().split(" ")[0]+".json",i=document.createElement("a"),s=window.URL.createObjectURL(n);i.setAttribute("href",s),i.setAttribute("download",r),i.click()}_displayCaptures(){this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))}_displayCompare(){const e=this.store.getSnapshot(),t=e.captures.findIndex(e=>e.active),n=t>=0?e.captures[t]:null,r=n?e.captures[t+1]:null;if(!n||!r)return void this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:60,canCompare:!1,compareRows:[],compareSummary:{added:0,removed:0,changed:0,unchanged:0},compareLabel:""}));const i=function(e,t){const n=function(e,t){const n=e.length,r=t.length,i=e.map(Jh),s=t.map(Jh),o=[];for(let e=0;e<=n;e++)o.push(new Array(r+1).fill(0));for(let e=n-1;e>=0;e--)for(let t=r-1;t>=0;t--)o[e][t]=i[e]===s[t]?o[e+1][t+1]+1:Math.max(o[e+1][t],o[e][t+1]);const a=[];let l=[];const u=()=>{for(const e of l)a.push(e);l=[]};let c=0,h=0;for(;c0?a.push({type:"changed",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id,fieldDiffs:n}):a.push({type:"unchanged",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id}),c++,h++}else if(o[c+1][h]>=o[c][h+1])l.push({type:"removed",name:e[c].name,previousText:e[c].text,indexA:c}),c++;else{const n=fd(l,t[h].name);n?a.push({type:"changed",name:t[h].name,previousText:n.previousText,currentText:t[h].text,indexA:n.indexA,indexB:h,commandId:t[h].id,fieldDiffs:ed(e[n.indexA],t[h])}):(u(),a.push({type:"added",name:t[h].name,currentText:t[h].text,indexB:h,commandId:t[h].id})),h++}for(;cObject.assign(Object.assign({},e),{menuStatus:60,canCompare:!0,compareRows:i.rows,compareSummary:i.summary,compareLabel:s}))}static _captureLabel(e){try{return new Date(e.startTime).toTimeString().split(" ")[0]}catch(e){return"capture"}}_displayInformation(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];zh(n,"Canvas",t.canvas,e.searchText),zh(n,"Context",t.context,e.searchText);const r=[];for(const n of t.analyses){const t="Primitives"===n.analyserName?"Vertices count":n.analyserName;zh(r,t,n,e.searchText)}zh(r,"Frame Memory Changes",t.frameMemory,e.searchText),zh(r,"Total Memory (seconds since application start: bytes)",t.memory,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:10,commandCount:t.commands.length,informationLeft:n,informationRight:r}))}_displayInitState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.initState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:20,commandCount:t.commands.length,initStateData:n}))}_displayEndState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.endState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:30,commandCount:t.commands.length,endStateData:n}))}_displayCurrentCapture(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=e.searchText,r=e.captures.map(e=>({capture:e.capture,active:e.capture===t})),i=[];i.push({VisualState:t.initState.VisualState,time:t.startTime,commandIndex:Number.MIN_VALUE,active:!1,previousVisualStateIndex:-1,nextVisualStateIndex:-1});const s=[];let o=0,a=!1,l=-1,u=-1;for(let e=0;e0?c-1:-1,nextCommandIndex:-1,visualStateIndex:o,active:!1};if(c>0&&(s[c-1].nextCommandIndex=c),r.VisualState){const e=i.length,t=i.length-1,n={VisualState:r.VisualState,time:r.endTime,commandIndex:c,active:!1,previousVisualStateIndex:t,nextVisualStateIndex:-1};i[t].nextVisualStateIndex=e,i.push(n),o=e,a=!0}else a||(i[0].commandIndex=c,a=!0);h.visualStateIndex=o,s.push(h),(-1===this._currentCommandId&&0===c||this._currentCommandId===r.id)&&(l=c,u=o)}l>=0&&(s[l].active=!0,this._currentCommandId=s[l].capture.id),u>=0&&(i[u].active=!0);let c=[];l>=0&&(c=this._buildCommandDetail(l,s,i)),this.store.setState(e=>Object.assign(Object.assign({},e),{captures:r,menuStatus:40,commandCount:t.commands.length,commands:s,currentCommandIndex:l,visualStates:i,currentVisualStateIndex:u,sourceCodeState:null,sourceCodeError:"",commandDetailData:c}))}_openShader(e){const t=this.store.getSnapshot();if(t.currentCommandIndex<0||t.currentCommandIndex>=t.commands.length)return;const n=t.commands[t.currentCommandIndex].capture.DrawCall;if(!n||!n.shaders||n.shaders.length<2)return;const r={programId:n.programStatus.program.__SPECTOR_Object_TAG.id,nameVertex:n.shaders[0].name,nameFragment:n.shaders[1].name,sourceVertex:n.shaders[0].source,sourceFragment:n.shaders[1].source,translatedSourceVertex:n.shaders[0].translatedSource,translatedSourceFragment:n.shaders[1].translatedSource,fragment:e,translated:!1,editable:n.programStatus.RECOMPILABLE,beautify:!0,preprocessed:!1,singleShader:!1,sourceVertexLog:n.shaders[0].infoLog||"",sourceFragmentLog:n.shaders[1].infoLog||"",programLog:n.programStatus.infoLog||""},i=this._buildCommandDetail(t.currentCommandIndex,t.commands,t.visualStates);this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:"",commandDetailData:i}))}_openCapturedShader(e,t=""){if(!e||"string"!=typeof e.source)return;const n="FRAGMENT_SHADER"===e.shaderType,r={programId:-1,nameVertex:n?"":e.name,nameFragment:n?e.name:"",sourceVertex:n?"":e.source,sourceFragment:n?e.source:"",translatedSourceVertex:n?"":e.translatedSource||"",translatedSourceFragment:n&&e.translatedSource||"",fragment:n,translated:!1,editable:!1,beautify:!0,preprocessed:!1,singleShader:!0,sourceVertexLog:n?"":e.infoLog||"",sourceFragmentLog:n&&e.infoLog||"",programLog:t};this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:""}))}_buildCommandDetail(e,t,n){if(e<0||e>=t.length)return[];const r=t[e],i=n[r.visualStateIndex],s=this._resolvedStackTraces.get(r.capture.id),o=function(e,t,n){const r=[];t&&r.push({type:"visualState",visualState:t});let i="Unknown";switch(e.status){case 50:i="Deprecated";break;case 10:i="Unused";break;case 20:i="Disabled";break;case 30:i="Redundant";break;case 40:i="Valid"}const s=Ph.getMDNLink(e.name);e.result?zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,result:e.result,status:i},""):"LOG"!==e.name&&zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,status:i},"");for(const t in e)"VisualState"!==t&&"result"!==t&&("commandArguments"===t&&Array.isArray(e.commandArguments)?Kh(r,e.name,e.commandArguments):Xh(r,t,e)||("stackTrace"===t&&Array.isArray(e.stackTrace)?zh(r,"stackTrace",n||e.stackTrace,""):"object"==typeof e[t]&&zh(r,t,e[t],"")));return r}(r.capture,null==i?void 0:i.VisualState,s);return s||this._resolveStackTraceAsync(r.capture),o}_resolveStackTraceAsync(e){const t=e.id;this._resolvedStackTraces.has(t)||this._resolvingStackTraces.has(t)||e.stackTrace&&0!==e.stackTrace.length&&(this._resolvingStackTraces.add(t),this._sourceMapResolver.resolveFrames(e.stackTrace).then(n=>{this._resolvingStackTraces.delete(t),this._resolvedStackTraces.set(t,n);let r=!1;for(let t=0;tObject.assign(Object.assign({},t),{commandDetailData:e}))}}).catch(()=>{this._resolvingStackTraces.delete(t)}))}_selectPreviousCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.previousCommandIndex<0||this.selectCommand(t.previousCommandIndex)}_selectNextCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.nextCommandIndex<0||this.selectCommand(t.nextCommandIndex)}_selectPreviousVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.previousVisualStateIndex<0||this.selectVisualState(t.previousVisualStateIndex)}_selectNextVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.nextVisualStateIndex<0||this.selectVisualState(t.nextVisualStateIndex)}_search(e){switch(this.store.getSnapshot().menuStatus){case 0:case 40:this._displayCurrentCapture();break;case 30:this._displayEndState();break;case 10:this._displayInformation();break;case 20:this._displayInitState()}this.store.setState(e=>Object.assign(Object.assign({},e),{searchText:""}))}}class gd{constructor(e,t={}){this.worker=e,this.captureTimeout=t.captureTimeout||1e4,this.disposed=!1,this.captureTimer=null,this.onCapture=new l,this.onCaptureStarted=new l,this.onError=new l,this.onFps=new l,this.onContextReady=new l,this.messageHandler=this.handleMessage.bind(this),this.worker.addEventListener("message",this.messageHandler)}triggerCapture(e=0,t=0,n=!1,r=!1){if(this.disposed)return;this.clearCaptureTimer();const i={type:"spector:trigger-capture",version:1,canvasIndex:e,commandCount:t,quickCapture:n,fullCapture:r};this.worker.postMessage(i),this.captureTimer=setTimeout(()=>{this.onError.trigger("Capture timed out after "+this.captureTimeout+"ms"),this.captureTimer=null},this.captureTimeout)}dispose(){this.disposed||(this.disposed=!0,this.clearCaptureTimer(),this.worker.removeEventListener("message",this.messageHandler),this.onCapture.clear(),this.onCaptureStarted.clear(),this.onError.clear(),this.onFps.clear(),this.onContextReady.clear())}handleMessage(e){const t=e.data;if(!function(e){return null!=e&&"object"==typeof e&&"string"==typeof e.type&&0===e.type.indexOf("spector:")}(t))return;const n=t;switch(n.type){case"spector:context-ready":this.onContextReady.trigger({canvasCount:n.canvasCount,canvasWidth:n.canvasWidth,canvasHeight:n.canvasHeight});break;case"spector:capture-started":this.onCaptureStarted.trigger(void 0);break;case"spector:capture-complete":this.clearCaptureTimer(),this.onCapture.trigger(n.capture);break;case"spector:error":this.clearCaptureTimer(),this.onError.trigger(n.error);break;case"spector:fps":this.onFps.trigger(n.fps)}}clearCaptureTimer(){null!=this.captureTimer&&(clearTimeout(this.captureTimer),this.captureTimer=null)}}var Ed=n(72),vd=n.n(Ed),Cd=n(825),Dd=n.n(Cd),Sd=n(659),Ad=n.n(Sd),_d=n(56),yd=n.n(_d),bd=n(540),Td=n.n(bd),Rd=n(113),xd=n.n(Rd),wd=n(377),Fd={};Fd.styleTagTransform=xd(),Fd.setAttributes=yd(),Fd.insert=Ad().bind(null,"html"),Fd.domAPI=Dd(),Fd.insertStyleElement=Td(),vd()(wd.A,Fd),wd.A&&wd.A.locals&&wd.A.locals;var Nd=n(160),Ld={};Ld.styleTagTransform=xd(),Ld.setAttributes=yd(),Ld.insert=Ad().bind(null,"html"),Ld.domAPI=Dd(),Ld.insertStyleElement=Td(),vd()(Nd.A,Ld),Nd.A&&Nd.A.locals&&Nd.A.locals;class Od{constructor(e){this.timeSpy=e,this.init()}spyXRSession(e){this.currentXRSession&&this.unspyXRSession();for(const e of at.getRequestAnimationFrameFunctionNames())y.resetOriginFunction(this.timeSpy.getSpiedScope(),e);this.timeSpy.spyRequestAnimationFrame("requestAnimationFrame",e),this.currentXRSession=e}unspyXRSession(){if(this.currentXRSession){y.resetOriginFunction(this.currentXRSession,"requestAnimationFrame"),this.currentXRSession=void 0;for(const e of at.getRequestAnimationFrameFunctionNames())this.timeSpy.spyRequestAnimationFrame(e,this.timeSpy.getSpiedScope())}}init(){if(!navigator.xr)return;class e extends XRWebGLLayer{constructor(e,t,n){super(e,t,n),this.glContext=t}getContext(){return this.glContext}}class t extends XRWebGLBinding{constructor(e,t){super(e,t),this.glContext=t}createProjectionLayer(e){const t=super.createProjectionLayer(e);return t.glContext=this.glContext,t}}window.XRWebGLLayer=e,window.XRWebGLBinding=t;const n=navigator.xr.requestSession;Object.defineProperty(navigator.xr,"requestSessionInternal",{writable:!0}),navigator.xr.requestSessionInternal=n,Object.defineProperty(navigator.xr,"requestSession",{writable:!0}),navigator.xr.requestSession=(e,t)=>((e,t)=>navigator.xr.requestSessionInternal(e,t).then(e=>{const t=e;return t._updateRenderState=e.updateRenderState,t.updateRenderState=e=>function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){if(e.baseLayer){const n=e.baseLayer;t.glContext=n.getContext()}if(e.layers)for(const n of e.layers){const e=n;e.glContext&&(t.glContext=e.glContext)}return t._updateRenderState(e)}),this.spyXRSession(t),e.addEventListener("end",()=>{this.unspyXRSession()}),Promise.resolve(e)}))(e,t)}}const Id={CaptureMenu:_t,ResultView:md};class kd{static getFirstAvailable3dContext(e){return this.tryGetContextFromHelperField(e)||this.tryGetContextFromCanvas(e,"webgl")||this.tryGetContextFromCanvas(e,"experimental-webgl")||this.tryGetContextFromCanvas(e,"webgl2")||this.tryGetContextFromCanvas(e,"experimental-webgl2")}static tryGetContextFromHelperField(e){const t=e instanceof HTMLCanvasElement?e.getAttribute("__spector_context_type"):e.__spector_context_type;if(t)return this.tryGetContextFromCanvas(e,t)}static tryGetContextFromCanvas(e,t){let n;try{n=e.getContext(t)}catch(e){}return n}constructor(e={}){this.noFrameTimeout=-1,this.options=Object.assign({enableXRCapture:!1},e),this.captureNextFrames=0,this.captureNextCommands=0,this.quickCapture=!1,this.fullCapture=!1,this.retry=0,this.contexts=[],this.workerBridges=new Map,this.timeSpy=new at,this.onCaptureStarted=new l,this.onCapture=new l,this.onError=new l,this.timeSpy.onFrameStart.add(this.onFrameStart,this),this.timeSpy.onFrameEnd.add(this.onFrameEnd,this),this.timeSpy.onError.add(this.onErrorInternal,this),ct.install(),this.options.enableXRCapture&&(this.xrSpy=new Od(this.timeSpy))}displayUI(e=!1){this.captureMenu||(this.getCaptureUI(),this.captureMenu.onPauseRequested.add(this.pause,this),this.captureMenu.onPlayRequested.add(this.play,this),this.captureMenu.onPlayNextFrameRequested.add(this.playNextFrame,this),this.captureMenu.onCaptureRequested.add(e=>{e&&(e.ref instanceof Worker?this.captureWorker(e.ref):this.captureCanvas(e.ref))},this),setInterval(()=>{this.captureMenu.setFPS(this.getFps())},1e3),e||this.captureMenu.trackPageCanvases(),this.captureMenu.display()),this.resultView||(this.getResultUI(),this.onCapture.add(e=>{this.resultView.display(),this.resultView.addCapture(e)}))}getResultUI(){return this.resultView||(this.resultView=new md,this.resultView.onSourceCodeChanged.add(e=>{this.rebuildProgramFromProgramId(e.programId,e.sourceVertex,e.sourceFragment,t=>{this.referenceNewProgram(e.programId,t),this.resultView.showSourceCodeError(null)},e=>{this.resultView.showSourceCodeError(e)})})),this.resultView}getCaptureUI(){return this.captureMenu||(this.captureMenu=new _t),this.captureMenu}rebuildProgramFromProgramId(e,t,n,r,i){const s=Pe.getFromGlobalStore(e);this.rebuildProgram(s,t,n,r,i)}rebuildProgram(e,t,n,r,i){o.rebuildProgram(e,t,n,r,i)}referenceNewProgram(e,t){Pe.updateInGlobalStore(e,t)}pause(){this.timeSpy.changeSpeedRatio(0)}play(){this.timeSpy.changeSpeedRatio(1)}playNextFrame(){this.timeSpy.playNextFrame()}drawOnlyEveryXFrame(e){this.timeSpy.changeSpeedRatio(e)}getFps(){return this.timeSpy.getFps()}spyCanvases(){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt,this.canvasSpy.onContextRequested.add(this.spyContext,this))}spyCanvas(e){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt(e),this.canvasSpy.onContextRequested.add(this.spyContext,this))}getAvailableContexts(){return this.contexts}setShaderCompileDelay(e){ct.install(),ct.setDelay(e)}clearShaderCompileDelay(){ct.setDelay(0)}getShaderCompileDelay(){return ct.getDelay()}captureCanvas(e,t=0,n=!1,r=!1){const i=this.getAvailableContextSpyByCanvas(e);if(i)this.captureContextSpy(i,t,n,r);else{const i=kd.getFirstAvailable3dContext(e);i?this.captureContext(i,t,n,r):a.error("No webgl context available on the chosen canvas.")}}captureContext(e,t=0,n=!1,r=!1){let i=this.getAvailableContextSpyByCanvas(e.canvas);i||(i=e.getIndexedParameter?new ot({context:e,version:2,recordAlways:!1}):new ot({context:e,version:1,recordAlways:!1}),i.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:i.context.canvas,contextSpy:i})),i&&this.captureContextSpy(i,t,n,r)}captureXRContext(e=0,t=!1,n=!1){this.captureContext(this.getXRContext(),e,t,n)}captureContextSpy(e,t=0,n=!1,r=!1){this.quickCapture=n,this.fullCapture=r,this.capturingContext?this.onErrorInternal("Already capturing a context."):(this.retry=0,this.capturingContext=e,this.capturingContext.setMarker(this.marker),(t=Math.min(t,1e4))>0?this.captureCommands(t):this.captureFrames(1),this.noFrameTimeout=setTimeout(()=>{t>0?this.stopCapture():this.capturingContext&&this.retry>1?this.onErrorInternal("No frames with gl commands detected. Try moving the camera."):this.onErrorInternal("No frames detected. Try moving the camera or implementing requestAnimationFrame.")},1e4))}captureNextFrame(e,t=!1,n=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,0,t,n):this.captureContext(e,0,t,n)}startCapture(e,t,n=!1,r=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,t,n,r):this.captureContext(e,t,n,r)}stopCapture(){if(this.capturingContext){const e=this.capturingContext.stopCapture();if(e.commands.length>0)return this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),this.triggerCapture(e),this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,e;0===this.captureNextCommands&&(this.retry++,this.captureFrames(1))}}setMarker(e){this.marker=e,this.capturingContext&&this.capturingContext.setMarker(e)}clearMarker(){this.marker=null,this.capturingContext&&this.capturingContext.clearMarker()}addRequestAnimationFrameFunctionName(e){this.timeSpy.addRequestAnimationFrameFunctionName(e)}setSpiedScope(e){this.timeSpy.setSpiedScope(e)}log(e){this.capturingContext&&this.capturingContext.log(e)}spyWorkers(e="spector.worker.bundle.js"){ut.startIntercepting(e)}stopSpyingWorkers(){ut.stopIntercepting()}spyWorker(e){let t=this.workerBridges.get(e);return t||(t=new gd(e),t.onCapture.add(e=>{this.triggerCapture(e)},this),t.onError.add(e=>{this.onErrorInternal(e)},this),t.onContextReady.add(t=>{if(this.captureMenu){const n=this.workerBridges.size;this.captureMenu.addCanvasInformation({id:"Worker "+n,width:t.canvasWidth,height:t.canvasHeight,ref:e})}},this),t.onFps.add(e=>{this.captureMenu&&this.captureMenu.setFPS(e)},this),this.workerBridges.set(e,t),t)}captureWorker(e,t=0,n=!1,r=!1){this.workerBridges.has(e)||this.spyWorker(e);const i=this;e.addEventListener("message",function t(n){n.data&&"spector:capture-complete"===n.data.type&&(e.removeEventListener("message",t),i.triggerCapture(n.data.capture))}),e.postMessage({type:"spector:trigger-capture",version:1,canvasIndex:0,commandCount:t,quickCapture:n,fullCapture:r})}captureFrames(e){this.captureNextFrames=e,this.captureNextCommands=0,this.playNextFrame()}captureCommands(e){this.captureNextFrames=0,this.captureNextCommands=e,this.play(),this.capturingContext?(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(e,this.quickCapture,this.fullCapture)):(this.onErrorInternal("No context to capture from."),this.captureNextCommands=0)}spyContext(e){let t=this.getAvailableContextSpyByCanvas(e.context.canvas);t||(t=new ot({context:e.context,version:e.contextVersion,recordAlways:!0}),t.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:t.context.canvas,contextSpy:t})),t.spy()}getAvailableContextSpyByCanvas(e){for(const t of this.contexts)if(t.canvas===e)return t.contextSpy}getXRContext(){return this.options.enableXRCapture||a.error("Cannot retrieve WebXR context if capturing WebXR is disabled."),this.xrSpy.currentXRSession||a.error("No currently active WebXR session."),this.xrSpy.currentXRSession.glContext}onFrameStart(){this.captureNextCommands>0||(this.captureNextFrames>0?(this.capturingContext&&(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(0,this.quickCapture,this.fullCapture)),this.captureNextFrames--):this.capturingContext=void 0)}onFrameEnd(){this.captureNextCommands>0||0===this.captureNextFrames&&this.stopCapture()}triggerCapture(e){this.captureMenu&&this.captureMenu.captureComplete(null),this.onCapture.trigger(e)}onErrorInternal(e){if(a.error(e),this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),!this.capturingContext)throw e;this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,this.retry=0,this.captureMenu&&this.captureMenu.captureComplete(e),this.onError.trigger(e)}}},180(e,t,n){e=n.nmd(e),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/lang"),s=e("../lib/event"),o='.ace_search {background-color: #ddd;color: #666;border: 1px solid #cbcbcb;border-top: 0 none;overflow: hidden;margin: 0;padding: 4px 6px 0 4px;position: absolute;top: 0;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {margin: 0 20px 4px 0;overflow: hidden;line-height: 1.9;}.ace_replace_form {margin-right: 0;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {border-radius: 3px 0 0 3px;background-color: white;color: black;border: 1px solid #cbcbcb;border-right: 0 none;outline: 0;padding: 0;font-size: inherit;margin: 0;line-height: inherit;padding: 0 6px;min-width: 17em;vertical-align: top;min-height: 1.8em;box-sizing: content-box;}.ace_searchbtn {border: 1px solid #cbcbcb;line-height: inherit;display: inline-block;padding: 0 6px;background: #fff;border-right: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;margin: 0;position: relative;color: #666;}.ace_searchbtn:last-child {border-radius: 0 3px 3px 0;border-right: 1px solid #cbcbcb;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn:hover {background-color: #eef1f6;}.ace_searchbtn.prev, .ace_searchbtn.next {padding: 0px 0.7em}.ace_searchbtn.prev:after, .ace_searchbtn.next:after {content: "";border: solid 2px #888;width: 0.5em;height: 0.5em;border-width: 2px 0 0 2px;display:inline-block;transform: rotate(-45deg);}.ace_searchbtn.next:after {border-width: 0 2px 2px 0 ;}.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;font: 16px/16px Arial;padding: 0;height: 14px;width: 14px;top: 9px;right: 7px;position: absolute;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;box-sizing: border-box!important;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;clear: both;}.ace_search_counter {float: left;font-family: arial;padding: 0 8px;}',a=e("../keyboard/hash_handler").HashHandler,l=e("../lib/keys");r.importCssString(o,"ace_searchbox");var u=function(e,t,n){var i=r.createElement("div");r.buildDom(["div",{class:"ace_search right"},["span",{action:"hide",class:"ace_searchbtn_close"}],["div",{class:"ace_search_form"},["input",{class:"ace_search_field",placeholder:"Search for",spellcheck:"false"}],["span",{action:"findPrev",class:"ace_searchbtn prev"},"​"],["span",{action:"findNext",class:"ace_searchbtn next"},"​"],["span",{action:"findAll",class:"ace_searchbtn",title:"Alt-Enter"},"All"]],["div",{class:"ace_replace_form"},["input",{class:"ace_search_field",placeholder:"Replace with",spellcheck:"false"}],["span",{action:"replaceAndFindNext",class:"ace_searchbtn"},"Replace"],["span",{action:"replaceAll",class:"ace_searchbtn"},"All"]],["div",{class:"ace_search_options"},["span",{action:"toggleReplace",class:"ace_button",title:"Toggle Replace mode",style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{class:"ace_search_counter"}],["span",{action:"toggleRegexpMode",class:"ace_button",title:"RegExp Search"},".*"],["span",{action:"toggleCaseSensitive",class:"ace_button",title:"CaseSensitive Search"},"Aa"],["span",{action:"toggleWholeWords",class:"ace_button",title:"Whole Word Search"},"\\b"],["span",{action:"searchInSelection",class:"ace_button",title:"Search In Selection"},"S"]]],i),this.element=i.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),r.importCssString(o,"ace_searchbox",e.container)};(function(){this.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},this.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;s.addListener(e,"mousedown",function(e){setTimeout(function(){t.activeInput.focus()},0),s.stopPropagation(e)}),s.addListener(e,"click",function(e){var n=(e.target||e.srcElement).getAttribute("action");n&&t[n]?t[n]():t.$searchBarKb.commands[n]&&t.$searchBarKb.commands[n].exec(t),s.stopPropagation(e)}),s.addCommandKeyListener(e,function(e,n,r){var i=l.keyCodeToString(r),o=t.$searchBarKb.findKeyCommand(n,i);o&&o.exec&&(o.exec(t),s.stopEvent(e))}),this.$onChange=i.delayedCall(function(){t.find(!1,!1)}),s.addListener(this.searchInput,"input",function(){t.$onChange.schedule(20)}),s.addListener(this.searchInput,"focus",function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()}),s.addListener(this.replaceInput,"focus",function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()})},this.$closeSearchBarKb=new a([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new a,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.editor.getReadOnly()||(e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus())},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),this.setSearchRange=function(e){this.searchRange=e,e?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(e){r.setCssClass(this.replaceOption,"checked",this.searchRange),r.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var t=this.editor.getReadOnly();this.replaceOption.style.display=t?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!t?"":"none",this.find(!1,!1,e)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,n){var i=!this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n,range:this.searchRange})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",i),this.editor._emit("findSearchBox",{match:!i}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,n=0,r=0;if(t){var i=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),s=e.session.doc.positionToIndex(e.selection.anchor);this.searchRange&&(s-=e.session.doc.positionToIndex(this.searchRange.start));for(var o,a=t.lastIndex=0;(o=t.exec(i))&&(n++,(a=o.index)<=s&&r++,!(n>999))&&(o[0]||(t.lastIndex=a+=1,!(a>=i.length))););}this.searchCounter.textContent=r+" of "+(n>999?"999+":n)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(u.prototype),t.SearchBox=u,t.Search=function(e,t){(e.searchBox||new u(e)).show(e.session.getTextRange(),t)}}),ace.require(["ace/ext/searchbox"],function(t){e&&(e.exports=t)})},49(e,t,n){e=n.nmd(e),ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=t.cFunctions="\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b",a=function(){var e=this.$keywords=this.createKeywordMapper({"keyword.control":"break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while|catch|operator|try|throw|using","storage.type":"asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|class|wchar_t|template|char16_t|char32_t","storage.modifier":"const|extern|register|restrict|static|volatile|inline|private|protected|public|friend|explicit|virtual|export|mutable|typename|constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local","keyword.operator":"and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace","variable.language":"this","constant.language":"NULL|true|false|TRUE|FALSE|nullptr"},"identifier"),t=/\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source,n="%"+/(\d+\$)?/.source+/[#0\- +']*/.source+/[,;:_]?/.source+/((-?\d+)|\*(-?\d+\$)?)?/.source+/(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source+/(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source+/(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source;this.$rules={start:[{token:"comment",regex:"//$",next:"start"},{token:"comment",regex:"//",next:"singleLineComment"},i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string",regex:"'(?:"+t+"|.)?'"},{token:"string.start",regex:'"',stateName:"qqstring",next:[{token:"string",regex:/\\\s*$/,next:"qqstring"},{token:"constant.language.escape",regex:t},{token:"constant.language.escape",regex:n},{token:"string.end",regex:'"|$',next:"start"},{defaultToken:"string"}]},{token:"string.start",regex:'R"\\(',stateName:"rawString",next:[{token:"string.end",regex:'\\)"',next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"keyword",regex:"#\\s*(?:include|import|pragma|line|define|undef|version)\\b",next:"directive"},{token:"keyword",regex:"#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b"},{token:"support.function.C99.c",regex:o},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*"},{token:"keyword.operator",regex:/--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],singleLineComment:[{token:"comment",regex:/\\$/,next:"singleLineComment"},{token:"comment",regex:/$/,next:"start"},{defaultToken:"comment"}],directive:[{token:"constant.other.multiline",regex:/\\/},{token:"constant.other.multiline",regex:/.*\\/},{token:"constant.other",regex:"\\s*<.+?>",next:"start"},{token:"constant.other",regex:'\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',next:"start"},{token:"constant.other",regex:"\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",next:"start"},{token:"constant.other",regex:/[^\\\/]+/,next:"start"}]},this.embedRules(i,"doc-",[i.getEndRule("start")]),this.normalizeRules()};r.inherits(a,s),t.c_cppHighlightRules=a}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var i=n[1].length,s=e.findMatchingBracket({row:t,column:i});if(!s||s.row==t)return 0;var o=this.$getIndent(e.getLine(s.row));e.replace(new r(t,0,t,i-1),o)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i,s=e.getLine(n);if(this.startRegionRe.test(s))return this.getCommentRegionBlock(e,s,n);if(i=s.match(this.foldingStartMarker)){var o=i.index;if(i[1])return this.openingBracketBlock(e,i[1],n,o);var a=e.getCommentFoldRange(n,o+i[0].length,1);return a&&!a.isMultiLine()&&(r?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(i=s.match(this.foldingStopMarker))?(o=i.index+i[0].length,i[1]?this.closingBracketBlock(e,i[1],n,o):e.getCommentFoldRange(n,o,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length,a=t+=1,l=e.getLength();++tu)break;var c=this.getFoldWidgetRange(e,"all",t);if(c){if(c.start.row<=s)break;if(c.isMultiLine())t=c.end.row;else if(r==u)break}a=t}}return new i(s,o,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\s*$/),s=e.getLength(),o=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++no)return new i(o,r,n,t.length)}}.call(o.prototype)}),ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./c_cpp_highlight_rules").c_cppHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&"comment"==s[s.length-1].type)return r;if("start"==e)(a=t.match(/^.*[\{\(\[]\s*$/))&&(r+=n);else if("doc-start"==e){if("start"==o)return"";var a;(a=t.match(/^\s*(\/?)\*/))&&(a[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/c_cpp"}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/glsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/c_cpp_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp_highlight_rules").c_cppHighlightRules,s=function(){var e=this.createKeywordMapper({"variable.language":"this",keyword:"layout|attribute|const|uniform|varying|break|continue|do|for|while|if|else|in|out|inout|float|int|void|bool|true|false|lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|samplerCube|struct","constant.language":"radians|degrees|sin|cos|tan|asin|acos|atan|pow|exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|normalize|faceforward|reflect|refract|matrixCompMult|lessThan|lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|texture2DProjLod|textureCube|textureCubeLod|gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|gl_DepthRangeParameters|gl_DepthRange|gl_Position|gl_PointSize|gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData"},"identifier");this.$rules=(new i).$rules,this.$rules.start.forEach(function(t){"function"==typeof t.token&&(t.token=e)})};r.inherits(s,i),t.glslHighlightRules=s}),ace.define("ace/mode/glsl",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/glsl_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp").Mode,s=e("./glsl_highlight_rules").glslHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.$id="ace/mode/glsl"}.call(u.prototype),t.Mode=u}),ace.require(["ace/mode/glsl"],function(t){e&&(e.exports=t)})},429(e,t,n){e=n.nmd(e),ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.require(["ace/theme/monokai"],function(t){e&&(e.exports=t)})}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r](s,s.exports,n),s.loaded=!0,s.exports}return n.amdD=function(){throw new Error("define cannot be used indirect")},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.nc=void 0,n(832),n(49),n(429),n(902),n(180),n(878)})()); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("SPECTOR",[],t):"object"==typeof exports?exports.SPECTOR=t():e.SPECTOR=t()}(self,()=>(()=>{var e={377(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.captureMenuComponent{position:absolute;padding:7px;z-index:99999;top:10px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuComponent.active{visibility:visible;display:block}.captureMenuComponent,.captureMenuComponent:after,.captureMenuComponent:before{box-sizing:content-box}.captureMenuLogComponent{position:absolute;padding:7px;z-index:80000;top:66px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuLogComponent.active{visibility:visible;display:block}.captureMenuLogComponent,.captureMenuLogComponent:after,.captureMenuLogComponent:before{box-sizing:content-box}.captureMenuLogComponent span.error{color:red}.canvasListComponent{float:left;width:50%;height:100%}.canvasListComponent [commandName=onCanvasSelection]{vertical-align:center;line-height:40px;white-space:nowrap;text-overflow:ellipsis;width:190px;display:inline-block;overflow:hidden;margin:0px 5px}.canvasListComponent [commandName=onCanvasSelection]:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.canvasListComponent ul{margin:0px;padding:7px;list-style:none;position:absolute;top:54px;left:-2px;width:400px;border:2px solid #222;background-color:#2c2c2c}.canvasListComponent ul li{margin:5px}.canvasListComponent ul li:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.captureMenuActionsComponent{float:left;width:30%;height:100%;margin-top:7.5px}.captureMenuActionsComponent div{float:left}.captureMenuActionsComponent [commandName=onCaptureRequested]{border-radius:50%;background:#2c2c2c;border:2px solid red;width:21px;height:21px}.captureMenuActionsComponent [commandName=onCaptureRequested]:hover{background:red;cursor:pointer;transition:background .3s;-webkit-transition:background .3s;-moz-transition:background .3s}.captureMenuActionsComponent [commandName=onPlayRequested],.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPlayRequested]:before,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{content:"";position:absolute;display:inline-block;margin-top:6px;margin-left:4px;width:7px;height:7px;border-top:2px solid #f9f9f9;border-right:2px solid #f9f9f9;background-color:#f9f9f9;-moz-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg);z-index:-20}.captureMenuActionsComponent [commandName=onPlayRequested]:after,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:after{content:"";position:absolute;display:inline-block;width:8px;height:20px;background-color:#2c2c2c;z-index:-10}.captureMenuActionsComponent [commandName=onPlayRequested]:hover,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPauseRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPauseRequested]:before{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:12px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:after{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:7px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{background-color:#2c2c2c}.fpsCounterComponent{float:left;width:20%;vertical-align:center;line-height:40px;white-space:nowrap}',""]);const a=o},160(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.resultViewComponent{position:absolute;z-index:99999;border:1px solid #000;top:0;left:0;bottom:0;right:0;background-color:#222;opacity:1;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.resultViewComponent.active{visibility:visible;display:block}.resultViewComponent,.resultViewComponent:after,.resultViewComponent:before{box-sizing:content-box}.resultViewMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.resultViewMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.resultViewMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.resultViewMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.resultViewMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.resultViewMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.resultViewMenuComponent a.clearSearch{padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.resultViewMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}@media all and (max-width: 1024px){.resultViewMenuComponent .resultViewMenuOpen{display:block;visibility:visible}.resultViewMenuComponent li:not(.resultViewMenuSmall){display:none;visibility:hidden}.resultViewMenuComponent li{background:#2c2c2c}.resultViewMenuComponent li.searchContainer{background:rgb(69.5,69.5,69.5)}.resultViewMenuComponent{padding:0px;position:absolute;overflow-y:visible;top:0px;left:0px;right:0px;bottom:0px;z-index:999999;display:block}.resultViewMenuComponent a.active{background:#2c2c2c}}.resultViewMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:40px;position:relative;top:-1px;box-sizing:border-box}.resultViewMenuComponent input:focus{border:0;outline:0 none}.resultViewMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.resultViewMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.resultViewMenuComponent ::-webkit-input-placeholder{color:#ccc}.resultViewMenuComponent :-moz-placeholder{color:#ccc}.resultViewMenuComponent ::-moz-placeholder{color:#ccc}.resultViewMenuComponent :-ms-input-placeholder{color:#ccc}.resultViewContentComponent{position:absolute;top:40px;left:0;bottom:0;right:0}.informationColumnLeftComponent{position:absolute;top:0;left:0;bottom:0;right:50%;overflow:auto;overflow-x:hidden;overflow-y:visible}.informationColumnRightComponent{position:absolute;top:0;left:50%;bottom:0;right:0;overflow:auto;overflow-x:hidden;overflow-y:visible}.captureListComponent{position:absolute;top:40px;left:0;bottom:0;right:0;background:#222;z-index:9000;display:none;visibility:hidden;overflow-y:visible;overflow-x:hidden}.captureListComponent.active{display:block;visibility:visible}.captureListComponent .openCaptureFile{border:1px dashed #f9f9f9;display:block;margin:5px;padding:5px;text-align:center;font-style:italic}.captureListComponent .openCaptureFile span{line-height:100%;vertical-align:middle}.captureListComponent ul{margin:0px;padding:0px;list-style:none;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-start}.captureListComponent ul li{margin:5px;border:1px solid #606060}.captureListComponent ul li img{width:295px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;display:block}.captureListComponent ul li span{display:block;text-align:center;border:5px solid #222}.captureListComponent ul li span .captureListItemSave{color:#f9f9f9;font-size:16px;margin-left:10px;position:relative;padding:3px 8px 3px 32px}.captureListComponent ul li span .captureListItemSave:before,.captureListComponent ul li span .captureListItemSave:after{box-sizing:border-box;content:"";position:absolute}.captureListComponent ul li span .captureListItemSave:before{background:#222;border-color:#f9f9f9;border-style:solid;border-width:7px 2px 1px;border-radius:1px;height:16px;left:8px;top:5px;width:16px}.captureListComponent ul li span .captureListItemSave:after{background:#f9f9f9;border-color:#d9d9d9;border-style:solid;border-width:1px 1px 1px 4px;height:5px;left:13px;top:5px;width:7px}.captureListComponent ul li:hover{cursor:pointer}.captureListComponent ul li.active span{background:#f0640d;border:5px solid #f0640d}.captureListComponent ul li.active span .captureListItemSave:before{background:#f0640d}.captureListComponent ul li.active span .captureListItemSave:after{border-color:#f0640d}.visualStateListComponent{position:absolute;top:0;left:0;bottom:0;padding:5px;right:80%;overflow-y:visible;overflow-x:hidden}.visualStateListComponent ul{margin:0px;padding:0px;list-style:none}.visualStateListComponent ul li{margin:20px 15px 0px 15px;border:1px solid #606060}.visualStateListComponent ul li img{display:block;padding:0px;box-sizing:border-box;max-height:600px;width:100%;margin:0 auto;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.visualStateListComponent ul li:hover{cursor:pointer}.visualStateListComponent ul li span{border:5px solid #222;background:#222;box-sizing:border-box;display:inline-block;width:100%;margin:0px;padding:5px;word-wrap:break-word}.visualStateListComponent ul li.active{border:2px solid #f0640d}.commandListComponent{position:absolute;top:0;left:20%;right:40%;bottom:0;color:hsl(0,0%,82.6470588235%)}.commandListComponent ul{margin:0px;padding:0px;list-style:none;overflow-y:visible;overflow-x:hidden;height:100%}.commandListComponent ul li{padding:8px}.commandListComponent ul li span{word-wrap:break-word;line-height:22px}.commandListComponent ul li:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.commandListComponent ul li:nth-child(even){background:#2c2c2c}.commandListComponent ul li:nth-child(odd){background:#222}.commandListComponent ul li .important{font-weight:800}.commandListComponent ul li .important.deprecated{color:red}.commandListComponent ul li .important.unused{color:#ff0}.commandListComponent ul li .important.disabled{color:gray}.commandListComponent ul li .important.redundant{color:orange}.commandListComponent ul li .important.valid{color:#adff2f}.commandListComponent ul li .marker{font-size:16px;font-weight:900;color:#adff2f}.commandListComponent ul li.active{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.commandListComponent ul li.drawCall{background:#5db0d7;color:#222}.commandListComponent ul li a{margin-left:5px;margin-right:5px;color:#5db0d7;background:#222;padding:5px;font-weight:900;display:inline-block}.commandDetailComponent{position:absolute;top:0;left:60%;right:0;bottom:0;overflow-y:visible;overflow-x:hidden}.jsonGroupComponent{display:block;margin:10px;padding:10px;padding-bottom:5px}.jsonGroupComponent .jsonGroupComponentTitle{display:block;font-size:16px;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:5px;margin-bottom:5px;text-transform:capitalize}.jsonGroupComponent ul{margin:0px;padding:0px;list-style:none}.jsonGroupComponent ul li:nth-child(even){background:#222}.jsonGroupComponent ul li:nth-child(odd){background:#222}.jsonItemComponentKey{color:#f0640d}.jsonItemComponentValue{white-space:pre-wrap}.jsonItemImageHolder{width:50%;margin:auto}.jsonItemImageHolder .jsonItemImage{margin:5px;display:block;border:1px solid #606060;width:100%}.jsonItemImageHolder .jsonItemImage img{width:100%;display:block;margin:auto;max-width:256px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.jsonItemImageHolder .jsonItemImage span{margin:0px;padding:5px;word-wrap:break-word;display:inline-block;width:100%;box-sizing:border-box}[commandName=onOpenSourceClicked]:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.jsonVisualStateItemComponent{text-align:center;padding:10px}.jsonVisualStateItemComponent img{background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;border:1px solid #606060;margin:5px;width:100%;max-width:512px;max-height:800px}.jsonVisualStateItemComponent span{display:block}.jsonContentComponent{position:absolute;top:0;left:0;right:0;bottom:0;padding:10px;overflow-y:visible;overflow-x:hidden}.jsonItemComponentValue{word-break:break-all;white-space:normal}.jsonSourceItemComponentOpen{font-weight:bold;color:#5db0d7;text-decoration:underline}.sourceCodeMenuComponentContainer{position:absolute;left:0;top:0;bottom:48px;right:40%}.sourceCodeMenuComponentFooter{position:absolute;left:0;right:40%;bottom:0;padding:0 15px}.sourceCodeFormatError{color:#f0640d;margin-left:15px}.sourceCodeDiagnosticsNotice{color:#5db0d7;margin-left:15px}.sourceCodeDiagnosticsNotice a{color:#c9c9c9;text-decoration:underline}.sourceCodeMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.sourceCodeMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.sourceCodeMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.sourceCodeMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.sourceCodeMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.sourceCodeMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.sourceCodeMenuComponent a.clearSearch{display:inline-block;padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.sourceCodeMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}.sourceCodeMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:100%;position:relative;top:-1px;box-sizing:border-box}.sourceCodeMenuComponent input:focus{border:0;outline:0 none}.sourceCodeMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.sourceCodeMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.sourceCodeMenuComponent ::-webkit-input-placeholder{color:#ccc}.sourceCodeMenuComponent :-moz-placeholder{color:#ccc}.sourceCodeMenuComponent ::-moz-placeholder{color:#ccc}.sourceCodeMenuComponent :-ms-input-placeholder{color:#ccc}.sourceCodeComponent{position:absolute;top:42px;left:0;bottom:48px;right:40%;background:#222;z-index:9000;overflow-x:visible;overflow:auto}.sourceCodeComponent .sourceCodeComponentTitle{font-size:16px;font-weight:800;line-height:50px;color:#f0640d;padding:1em;margin:.5em 0}.compareViewComponent{position:absolute;top:50px;left:0px;right:0px;bottom:0px;overflow:hidden;display:flex;flex-direction:column;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:13px}.compareViewComponent .compareViewEmpty,.compareViewComponent .compareViewEmptyRow,.compareViewComponent .compareDetailEmpty{padding:1em;color:#c9c9c9;text-align:center}.compareViewComponent .compareViewHeader{flex:0 0 auto;display:flex;align-items:center;gap:16px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid rgb(8.5,8.5,8.5);white-space:nowrap}.compareViewComponent .compareViewHeader .compareViewLabel{color:#5db0d7}.compareViewComponent .compareViewHeader .compareViewSummary span{margin-right:8px;font-weight:700}.compareViewComponent .compareViewHeader .compareViewSummary span.added{color:#adff2f}.compareViewComponent .compareViewHeader .compareViewSummary span.removed{color:#ff5a5a}.compareViewComponent .compareViewHeader .compareViewSummary span.changed{color:#f0640d}.compareViewComponent .compareViewHeader .compareViewSummary span.unchanged{color:#c9c9c9}.compareViewComponent .compareViewHeader .compareViewToggle{margin-left:auto;cursor:pointer;user-select:none}.compareViewComponent .compareViewHeader .compareViewToggle input{vertical-align:middle;margin-right:4px}.compareViewComponent .compareViewBody{flex:1 1 auto;display:flex;min-height:0}.compareViewComponent .compareViewLegend{flex:0 0 130px;box-sizing:border-box;padding:10px;background:#2c2c2c;border-right:2px solid #222}.compareViewComponent .compareViewLegend .compareLegendRow{display:flex;align-items:center;gap:8px;margin:8px 0}.compareViewComponent .compareViewLegend .compareLegendRow.unchanged{opacity:.5}.compareViewComponent .compareViewLegend .compareLegendChip{width:12px;height:12px;border-radius:2px;background:#c9c9c9}.compareViewComponent .compareViewLegend .added .compareLegendChip{background:#adff2f}.compareViewComponent .compareViewLegend .removed .compareLegendChip{background:#ff5a5a}.compareViewComponent .compareViewLegend .changed .compareLegendChip{background:#f0640d}.compareViewComponent .compareViewList{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;margin:0;padding:0;list-style:none}.compareViewComponent .compareViewList .compareRow{display:flex;align-items:baseline;padding:3px 10px;line-height:20px;cursor:pointer;white-space:nowrap}.compareViewComponent .compareViewList .compareRow:nth-child(odd){background:#222}.compareViewComponent .compareViewList .compareRow:nth-child(even){background:#2c2c2c}.compareViewComponent .compareViewList .compareRow .compareSign{flex:0 0 14px;font-weight:800}.compareViewComponent .compareViewList .compareRow .compareRowText{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.compareViewComponent .compareViewList .compareRow .compareCmdName{font-weight:700}.compareViewComponent .compareViewList .compareRow.added .compareSign,.compareViewComponent .compareViewList .compareRow.added .compareCmdName{color:#adff2f}.compareViewComponent .compareViewList .compareRow.removed .compareSign,.compareViewComponent .compareViewList .compareRow.removed .compareCmdName{color:#ff5a5a}.compareViewComponent .compareViewList .compareRow.changed .compareSign,.compareViewComponent .compareViewList .compareRow.changed .compareCmdName{color:#f0640d}.compareViewComponent .compareViewList .compareRow.unchanged{opacity:.55}.compareViewComponent .compareViewList .compareRow.selected{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.compareViewComponent .compareViewList .compareRow.selected .compareSign,.compareViewComponent .compareViewList .compareRow.selected .compareCmdName{color:#222}.compareViewComponent .compareViewList .compareViewEmptyRow{cursor:default}.compareViewComponent .compareViewDetail{flex:0 0 42%;box-sizing:border-box;overflow-y:auto;border-left:2px solid #222;padding:4px 12px 12px}.compareViewComponent .compareViewDetail .compareDetailGroup{margin:12px 0}.compareViewComponent .compareViewDetail .compareDetailGroup ul{margin:0;padding:0;list-style:none}.compareViewComponent .compareViewDetail .compareDetailGroup li{padding:2px 0;white-space:pre-wrap;word-break:break-word}.compareViewComponent .compareViewDetail .compareDetailTitle{display:block;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin-bottom:6px;text-transform:capitalize}.compareViewComponent .compareViewDetail .compareDetailKey{color:#f0640d}.compareViewComponent .compareViewDetail .compareCmdName{font-weight:700}.compareViewComponent .compareViewDetail .compareCmdName.added{color:#adff2f}.compareViewComponent .compareViewDetail .compareCmdName.removed{color:#ff5a5a}.compareViewComponent .compareViewDetail .compareCmdName.changed{color:#f0640d}.compareViewComponent .compareViewDetail .compareArrow{color:#c9c9c9}.compareViewComponent .compareViewDetail .compareOld{opacity:.7;text-decoration:line-through}.compareViewComponent .compareViewDetail .compareNew{color:#f9f9f9}.compareViewComponent .compareViewDetail .compareCommandLink{color:#5db0d7;text-decoration:none;cursor:pointer;border-bottom:1px dotted currentColor}.compareViewComponent .compareViewDetail .compareCommandLink:hover{color:#f0640d}.compareViewComponent .compareViewDetail .compareTextureItem{padding-bottom:6px}.compareViewComponent .compareViewDetail .compareImageDiff{display:flex;align-items:center;margin-top:4px}.compareViewComponent .compareViewDetail .compareThumb{width:48px;height:48px;object-fit:contain;margin:2px 6px 2px 0;border:1px solid rgb(8.5,8.5,8.5);background:#222;image-rendering:pixelated}.jsonItemImageClickable{cursor:zoom-in}.textureViewerOverlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:100000;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.6);font-family:Consolas,monaco,monospace;font-size:13px;color:#f9f9f9}.textureViewerOverlay .textureViewerModal{width:min(900px,92vw);height:min(640px,90vh);display:flex;flex-direction:column;overflow:hidden;background:#222;border:1px solid #000;box-shadow:0 10px 40px rgba(0,0,0,.6)}.textureViewerOverlay .textureViewerHeader{flex:0 0 auto;display:flex;align-items:center;gap:12px;height:40px;padding:0 12px;background:#2c2c2c;border-bottom:2px solid #222}.textureViewerOverlay .textureViewerHeader .textureViewerTitle{color:#5db0d7}.textureViewerOverlay .textureViewerHeader .textureViewerMeta{color:#c9c9c9;font-size:12px}.textureViewerOverlay .textureViewerHeader .textureViewerClose{margin-left:auto;width:26px;height:26px;display:flex;align-items:center;justify-content:center;border-radius:3px;color:#c9c9c9;cursor:pointer}.textureViewerOverlay .textureViewerHeader .textureViewerClose:hover{color:#f9f9f9;background:hsla(0,0%,100%,.08)}.textureViewerOverlay .textureViewerToolbar{flex:0 0 auto;display:flex;align-items:center;flex-wrap:wrap;gap:14px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid #000;font-size:12px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup{display:flex;align-items:center;gap:6px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup .lbl{color:#c9c9c9;margin-right:2px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroupEnd{margin-left:auto}.textureViewerOverlay .textureViewerToolbar .channel{width:26px;height:24px;display:flex;align-items:center;justify-content:center;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#777;font-weight:800;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .channel.on.r{background:#e14b4b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.g{background:#4bd44b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.b{background:#4b8fe1;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.a{background:#dedede;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .tvBtn{height:24px;padding:0 10px;display:inline-flex;align-items:center;gap:6px;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#f9f9f9;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .tvBtn:hover{background:#333}.textureViewerOverlay .textureViewerToolbar .tvBtn.active{background:#f0640d;color:#1a1a1a;border-color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary{border-color:#f0640d;color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary:hover{background:#f0640d;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .seg{display:flex}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn{border-radius:0;border-right-width:0}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:first-child{border-radius:3px 0 0 3px}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:last-child{border-radius:0 3px 3px 0;border-right-width:1px}.textureViewerOverlay .textureViewerToolbar .zoomVal{min-width:44px;text-align:center;color:#c9c9c9}.textureViewerOverlay .textureViewerBody{flex:1 1 auto;display:flex;min-height:0}.textureViewerOverlay .textureViewerViewport{flex:1 1 auto;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#141414}.textureViewerOverlay .textureViewerViewport.checker{background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}.textureViewerOverlay .textureViewerCanvas{image-rendering:pixelated;cursor:crosshair;box-shadow:0 0 0 1px #000}.textureViewerOverlay .textureViewerLoupe{position:absolute;display:none;width:120px;height:120px;pointer-events:none;image-rendering:pixelated;border:1px solid #000;box-shadow:0 2px 8px rgba(0,0,0,.6);background:#000;left:16px;top:16px}.textureViewerOverlay .textureViewerRail{flex:0 0 210px;box-sizing:border-box;padding:12px;overflow-y:auto;background:#2c2c2c;border-left:2px solid #222}.textureViewerOverlay .textureViewerRail .railTitle{color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin:0 0 8px;text-transform:capitalize}.textureViewerOverlay .textureViewerRail .kv{display:flex;justify-content:space-between;margin:4px 0}.textureViewerOverlay .textureViewerRail .kv .k{color:#f0640d}.textureViewerOverlay .textureViewerRail .kv .v{color:#f9f9f9}.textureViewerOverlay .textureViewerRail .swatch{width:100%;height:34px;margin:8px 0;border:1px solid #000;background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0}.textureViewerOverlay .textureViewerRail .swatch .swatchInner{width:100%;height:100%}.textureViewerOverlay .textureViewerRail .hint{color:#c9c9c9;margin-top:10px;line-height:1.5}',""]);const a=o},636(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,".ace-monokai {\n color: #f9f9f9;\n font-size: 14px;\n}\n\n.ace-monokai .ace_entity.ace_name.ace_tag,\n.ace-monokai .ace_keyword,\n.ace-monokai .ace_meta.ace_tag,\n.ace-monokai .ace_storage {\n color: #F0640D\n}\n\n.ace-monokai .ace_constant.ace_character,\n.ace-monokai .ace_constant.ace_other {\n color: #5db0d7;\n}\n\n.ace-monokai .ace_marker-layer .ace_selection {\n background: #a6e22e\n}\n\n.ace-monokai .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #a6e22e;\n}\n\n.ace-monokai .ace_marker-layer .ace_active-line {\n background: #2c2c2c\n}\n.ace-monokai .ace_gutter-active-line {\n background-color: #2c2c2c\n}\n.ace-monokai .ace_marker-layer .ace_selected-word {\n border: 1px solid #a6e22e\n}\n\n.ace-monokai .ace_constant.ace_language {\n color: #e6db74\n}\n.ace-monokai .ace_constant.ace_numeric {\n color: #ae81ff\n}\n\n.ace-monokai .ace_gutter {\n background: #222;\n color: #8F908A;\n}",""]);const a=o},314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var a=0;a0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},601(e){"use strict";e.exports=function(e){return e[1]}},832(e,t,n){e=n.nmd(e),function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,n,r){"string"==typeof e?(2==arguments.length&&(r=n),t.modules[e]||(t.payloads[e]=r,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var n,r,i=function(e,t,n){if("string"==typeof t){var r=a(e,t);if(null!=r)return n&&n(),r}else if("[object Array]"===Object.prototype.toString.call(t)){for(var i=[],o=0,l=t.length;o1&&function(e,t,n){if(Array.prototype.indexOf)return e.indexOf("",n);for(var r=0;r-1&&(n=RegExp(this.source,i.replace.call(((r=this).global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),"g","")),i.replace.call(e.slice(a.index),n,function(){for(var e=1;ea.index&&this.lastIndex--}return a},o||(RegExp.prototype.test=function(e){var t=i.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError("Function.prototype.bind called on incompatible "+t);var n=d.call(arguments,1),i=function(){if(this instanceof i){var r=t.apply(this,n.concat(d.call(arguments)));return Object(r)===r?r:this}return t.apply(e,n.concat(d.call(arguments)))};return t.prototype&&(r.prototype=t.prototype,i.prototype=new r,r.prototype=null),i});var i,s,o,a,l,u=Function.prototype.call,c=Array.prototype,h=Object.prototype,d=c.slice,f=u.bind(h.toString),p=u.bind(h.hasOwnProperty);if((l=p(h,"__defineGetter__"))&&(i=u.bind(h.__defineGetter__),s=u.bind(h.__defineSetter__),o=u.bind(h.__lookupGetter__),a=u.bind(h.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,n=[];if(n.splice.apply(n,e(20)),n.splice.apply(n,e(26)),t=n.length,n.splice(5,0,"XXX"),n.length,t+1==n.length)return!0}()){var m=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?m.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(d.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):null==e?e=0:e<0&&(e=Math.max(n+e,0)),e+ta)for(h=u;h--;)this[l+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else for(this.length=c+s,h=0;h>>0;if("[object Function]"!=f(e))throw new TypeError;for(;++i>>0,i=Array(r),s=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var o=0;o>>0,s=[],o=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var a=0;a>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,s=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s++];break}if(++s>=r)throw new TypeError("reduce of empty array with no initial value")}for(;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,s=r-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s--];break}if(--s<0)throw new TypeError("reduceRight of empty array with no initial value")}do{s in this&&(i=e.call(void 0,i,n[s],s,t))}while(s--);return i}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=C&&"[object String]"==f(this)?this.split(""):L(this),n=t.length>>>0;if(!n)return-1;var r=0;for(arguments.length>1&&(r=N(arguments[1])),r=r>=0?r:Math.max(0,n+r);r>>0;if(!n)return-1;var r=n-1;for(arguments.length>1&&(r=Math.min(r,N(arguments[1]))),r=r>=0?r:n-Math.abs(r);r>=0;r--)if(r in t&&e===t[r])return r;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:h)}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(p(e,t)){var n;if(n={enumerable:!0,configurable:!0},l){var r=e.__proto__;e.__proto__=h;var i=o(e,t),s=a(e,t);if(e.__proto__=r,i||s)return i&&(n.get=i),s&&(n.set=s),n}return n.value=e[t],n}}),Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),Object.create||(g=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var n;if(null===e)n=g();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var r=function(){};r.prototype=e,(n=new r).__proto__=e}return void 0!==t&&Object.defineProperties(n,t),n}),Object.defineProperty){var S=D({}),A="undefined"==typeof document||D(document.createElement("div"));if(!S||!A)var _=Object.defineProperty}Object.defineProperty&&!_||(Object.defineProperty=function(e,t,n){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof n&&"function"!=typeof n||null===n)throw new TypeError("Property description must be an object: "+n);if(_)try{return _.call(Object,e,t,n)}catch(e){}if(p(n,"value"))if(l&&(o(e,t)||a(e,t))){var r=e.__proto__;e.__proto__=h,delete e[t],e[t]=n.value,e.__proto__=r}else e[t]=n.value;else{if(!l)throw new TypeError("getters & setters can not be defined on this javascript engine");p(n,"get")&&i(e,t,n.get),p(n,"set")&&s(e,t,n.set)}return e}),Object.defineProperties||(Object.defineProperties=function(e,t){for(var n in t)p(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=(E=Object.freeze,function(e){return"function"==typeof e?e:E(e)})}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";p(e,t);)t+="?";e[t]=!0;var n=p(e,t);return delete e[t],n}),!Object.keys){var y=!0,b=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],T=b.length;for(var R in{toString:null})y=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)p(e,n)&&t.push(n);if(y)for(var r=0,i=T;r0||-1)*Math.floor(Math.abs(e))),e}var L=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,n){"use strict";e("./regexp"),e("./es5-shim"),"undefined"==typeof Element||Element.prototype.remove||Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,n){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var r="object"==typeof navigator?navigator:{},i=(/mac|win|linux/i.exec(r.platform)||["other"])[0].toLowerCase(),s=r.userAgent||"",o=r.appName||"";t.isWin="win"==i,t.isMac="mac"==i,t.isLinux="linux"==i,t.isIE="Microsoft Internet Explorer"==o||o.indexOf("MSAppHost")>=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,t.isAIR=s.indexOf("AdobeAIR")>=0,t.isAndroid=s.indexOf("Android")>=0,t.isChromeOS=s.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./useragent");if(t.buildDom=function e(t,n,r){if("string"==typeof t&&t){var i=document.createTextNode(t);return n&&n.appendChild(i),i}if(!Array.isArray(t))return t;if("string"!=typeof t[0]||!t[0]){for(var s=[],o=0;o=1.5,"undefined"!=typeof document){var i=document.createElement("div");t.HI_DPI&&void 0!==i.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),r.isEdge||void 0===i.style.animationName||(t.HAS_CSS_ANIMATION=!0),i=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./oop"),i=function(){var e,t,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in n.FUNCTION_KEYS)e=n.FUNCTION_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);for(t in n.PRINTABLE_KEYS)e=n.PRINTABLE_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);return r.mixin(n,n.MODIFIER_KEYS),r.mixin(n,n.PRINTABLE_KEYS),r.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)n.KEY_MODS[t]=e.filter(function(e){return t&n.KEY_MODS[e]}).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();r.mixin(t,i),t.keyCodeToString=function(e){var t=i[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./keys"),i=e("./useragent"),s=null,o=0;t.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var r=function(){n.call(e,window.event)};n._wrapper=r,e.attachEvent("on"+t,r)}},t.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,n,r){function i(e){n&&n(e),r&&r(e),t.removeListener(document,"mousemove",n,!0),t.removeListener(document,"mouseup",i,!0),t.removeListener(document,"dragstart",i,!0)}return t.addListener(document,"mousemove",n,!0),t.addListener(document,"mouseup",i,!0),t.addListener(document,"dragstart",i,!0),i},t.addMouseWheelListener=function(e,n){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),n(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}n(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),n(e)})},t.addMultiMouseDownListener=function(e,n,r,s){var o,a,l,u=0,c={2:"dblclick",3:"tripleclick",4:"quadclick"};function h(e){if(0!==t.getButton(e)?u=0:e.detail>1?++u>4&&(u=1):u=1,i.isIE){var h=Math.abs(e.clientX-o)>5||Math.abs(e.clientY-a)>5;l&&!h||(u=1),l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),1==u&&(o=e.clientX,a=e.clientY)}if(e._clicks=u,r[s]("mousedown",e),u>4)u=0;else if(u>1)return r[s](c[u],e)}function d(e){u=2,l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),r[s]("mousedown",e),r[s](c[u],e)}Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",h),i.isOldIE&&t.addListener(e,"dblclick",d)})};var a=i.isMac&&i.isOpera&&!("KeyboardEvent"in window)?function(e){return(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)}:function(e){return(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};function l(e,t,n){var l=a(t);if(!i.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(l|=8),s.altGr){if(!(3&~l))return;s.altGr=0}if(18===n||17===n){var u="location"in t?t.location:t.keyLocation;17===n&&1===u?1==s[n]&&(o=t.timeStamp):18===n&&3===l&&2===u&&t.timeStamp-o<50&&(s.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),l||13!==n||3!==(u="location"in t?t.location:t.keyLocation)||(e(t,l,-n),!t.defaultPrevented)){if(i.isChromeOS&&8&l){if(e(t,l,n),t.defaultPrevented)return;l&=-9}return!!(l||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&e(t,l,n)}}function u(){s=Object.create(null)}if(t.getModifierString=function(e){return r.KEY_MODS[a(e)]},t.addCommandKeyListener=function(e,n){var r=t.addListener;if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var o=null;r(e,"keydown",function(e){o=e.keyCode}),r(e,"keypress",function(e){return l(n,e,o)})}else{var a=null;r(e,"keydown",function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=l(n,e,e.keyCode);return a=e.defaultPrevented,t}),r(e,"keypress",function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),r(e,"keyup",function(e){s[e.keyCode]=null}),s||(u(),r(window,"focus",u))}},"object"==typeof window&&window.postMessage&&!i.isOldIE){var c=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+c++,i=function(s){s.data==r&&(t.stopPropagation(s),t.removeListener(n,"message",i),e())};t.addListener(n,"message",i),n.postMessage(r,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function n(){t.$idleBlocked?setTimeout(n,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,n=e.end,r=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(r.row,r.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(r.row,r.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else this.end.rowt)var i={row:t+1,column:0};else this.start.row0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;nDate.now()-50)||(r=!1)},cancel:function(){r=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("../lib/dom"),o=e("../lib/lang"),a=e("../clipboard"),l=i.isChrome<18,u=i.isIE,c=i.isChrome>63,h=400,d=e("../lib/keys"),f=d.KEY_MODS,p=i.isIOS,m=p?/\s/:/\n/;t.TextInput=function(e,t){var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild);var g=!1,E=!1,v=!1,C=!1,D="";i.isMobile||(n.style.fontSize="1px");var S=!1,A=!1,_="",y=0,b=0,T=0;try{var R=document.activeElement===n}catch(e){}r.addListener(n,"blur",function(e){A||(t.onBlur(e),R=!1)}),r.addListener(n,"focus",function(e){if(!A){if(R=!0,i.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),i.isEdge?setTimeout(x):x()}}),this.$focusScroll=!1,this.focus=function(){if(D||c||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var t=0!=n.getBoundingClientRect().top}catch(e){return}var r=[];if(t)for(var i=n.parentElement;i&&1==i.nodeType;)r.push(i),i.setAttribute("ace_nocontext",!0),i=!i.parentElement&&i.getRootNode?i.getRootNode().host:i.parentElement;n.focus({preventScroll:!0}),t&&r.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="","0px"==n.style.top&&(n.style.top=e)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return R},t.on("beforeEndOperation",function(){t.curOp&&"insertstring"==t.curOp.command.name||(v&&(_=n.value="",U()),x())});var x=p?function(e){if(R&&(!g||e)&&!C){e||(e="");var r="\n ab"+e+"cde fg\n";r!=n.value&&(n.value=_=r);var i=4+(e.length||(t.selection.isEmpty()?0:1));4==y&&b==i||n.setSelectionRange(4,i),y=4,b=i}}:function(){if(!v&&!C&&(R||F)){v=!0;var e=t.selection,r=e.getRange(),i=e.cursor.row,s=r.start.column,o=r.end.column,a=t.session.getLine(i);if(r.start.row!=i){var l=t.session.getLine(i-1);s=r.start.rowi+1?u.length:o,o+=a.length+1,a=a+"\n"+u}a.length>h&&(s0&&_[h]==e[h];)h++,o--;for(l=l.slice(h),h=1;a>0&&_.length-h>y-1&&_[_.length-h]==e[e.length-h];)h++,a--;u-=h-1,c-=h-1;var d=l.length-h+1;return d<0&&(o=-d,d=0),l=l.slice(0,d),r||l||u||o||a||c?(C=!0,l&&!o&&!a&&!u&&!c||S?t.onTextInput(l):t.onTextInput(l,{extendLeft:o,extendRight:a,restoreStart:u,restoreEnd:c}),C=!1,_=e,y=i,b=s,T=c,l):""},L=function(e){if(v)return B();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var r=n.value,i=N(r,!0);(r.length>500||m.test(i))&&x()},O=function(e,t,n){var r=e.clipboardData||window.clipboardData;if(r&&!l){var i=u||n?"Text":"text/plain";try{return t?!1!==r.setData(i,t):r.getData(i)}catch(e){if(!n)return O(e,t,!0)}}},I=function(e,i){var s=t.getCopyText();if(!s)return r.preventDefault(e);O(e,s)?(p&&(x(s),g=s,setTimeout(function(){g=!1},10)),i?t.onCut():t.onCopy(),r.preventDefault(e)):(g=!0,n.value=s,n.select(),setTimeout(function(){g=!1,x(),i?t.onCut():t.onCopy()}))},k=function(e){I(e,!0)},M=function(e){I(e,!1)},P=function(e){var s=O(e);a.pasteCancelled()||("string"==typeof s?(s&&t.onPaste(s,e),i.isIE&&setTimeout(x),r.preventDefault(e)):(n.value="",E=!0))};r.addCommandKeyListener(n,t.onCommandKey.bind(t)),r.addListener(n,"select",function(e){v||(g?g=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=_.length&&e.value===_&&_&&e.selectionEnd!==b}(n)&&(t.selectAll(),x()))}),r.addListener(n,"input",L),r.addListener(n,"cut",k),r.addListener(n,"copy",M),r.addListener(n,"paste",P),"oncut"in n&&"oncopy"in n&&"onpaste"in n||r.addListener(e,"keydown",function(e){if((!i.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:M(e);break;case 86:P(e);break;case 88:k(e)}});var B=function(){if(v&&t.onCompositionUpdate&&!t.$readOnly){if(S)return $();if(v.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;N(e),v.markerRange&&(v.context&&(v.markerRange.start.column=v.selectionStart=v.context.compositionStartOffset),v.markerRange.end.column=v.markerRange.start.column+b-v.selectionStart+T)}}},U=function(e){t.onCompositionEnd&&!t.$readOnly&&(v=!1,t.onCompositionEnd(),t.off("mousedown",$),e&&L())};function $(){A=!0,n.blur(),n.focus(),A=!1}var G,V=o.delayedCall(B,50).schedule.bind(null,null);function W(){clearTimeout(G),G=setTimeout(function(){D&&(n.style.cssText=D,D=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()},0)}r.addListener(n,"compositionstart",function(e){if(!v&&t.onCompositionStart&&!t.$readOnly&&(v={},!S)){setTimeout(B,0),t.on("mousedown",$);var r=t.getSelectionRange();r.end.row=r.start.row,r.end.column=r.start.column,v.markerRange=r,v.selectionStart=y,t.onCompositionStart(v),v.useTextareaForIME?(n.value="",_="",y=0,b=0):(n.msGetInputContext&&(v.context=n.msGetInputContext()),n.getInputContext&&(v.context=n.getInputContext()))}}),r.addListener(n,"compositionupdate",B),r.addListener(n,"keyup",function(e){27==e.keyCode&&n.value.lengthb&&"\n"==_[s]?o=d.end:rb&&_.slice(0,s).split("\n").length>2?o=d.down:s>b&&" "==_[s-1]?(o=d.right,a=f.option):(s>b||s==b&&b!=y&&r==s)&&(o=d.right),r!==s&&(a|=f.shift),o){if(!t.onCommandKey({},a,o)&&t.commands){o=d.keyCodeToString(o);var l=t.commands.findKeyCommand(a,o);l&&t.execCommand(l)}y=r,b=s,x("")}}};document.addEventListener("selectionchange",s),t.on("destroy",function(){document.removeEventListener("selectionchange",s)})}(0,t,n)}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/useragent");function i(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function s(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)n=2*t.row-e.start.row-e.end.row;else n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,s=e.getButton();return 0!==s?((i.getSelectionRange().isEmpty()||1==s)&&i.selection.moveToPosition(n),void(2==s&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||i.isFocused()||(i.focus(),!this.$focusTimeout||this.$clickSelection||i.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(-1==r)e=this.$clickSelection.end;else if(1==r)e=this.$clickSelection.start;else{var i=s(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(i.start),a=this.$clickSelection.comparePoint(i.end);if(-1==o&&a<=0)t=this.$clickSelection.end,i.end.row==r.row&&i.end.column==r.column||(r=i.start);else if(1==a&&o>=0)t=this.$clickSelection.start,i.start.row==r.row&&i.start.column==r.column||(r=i.end);else if(-1==o&&1==a)r=i.end,t=i.start;else{var l=s(this.$clickSelection,r);r=l.cursor,t=l.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e,t,n,r,i=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,n=this.x,r=this.y,Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))),s=Date.now();(i>0||s-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session.getBracketRange(t);r?(r.isEmpty()&&(r.start.column--,r.end.column++),this.setState("select")):(r=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=r,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,s=i?e.wheelX/i:n.vx,o=i?e.wheelY/i:n.vy;i<550&&(s=(s+n.vx)/2,o=(o+n.vy)/2);var a=Math.abs(s/o),l=!1;return a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?n.allowed=r:r-n.allowed<550&&(Math.abs(s)<=1.5*Math.abs(n.vx)&&Math.abs(o)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=r):n.allowed=0),n.t=r,n.vx=s,n.vy=o,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(i.prototype),t.DefaultHandlers=i}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}(function(){this.$init=function(){return this.$element=r.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){r.addCssClass(this.getElement(),e)},this.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(i.prototype),t.Tooltip=i}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/event"),o=e("../tooltip").Tooltip;function a(e){o.call(this,e)}i.inherits(a,o),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),s=this.getHeight();(e+=15)+i>n&&(e-=e+i-n),(t+=15)+s>r&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=function(e){var t,n,i,o=e.editor,l=o.renderer.$gutterLayer,u=new a(o.container);function c(){t&&(t=clearTimeout(t)),i&&(u.hide(),i=null,o._signal("hideGutterTooltip",u),o.removeEventListener("mousewheel",c))}function h(e){u.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",function(t){if(o.isFocused()&&0==t.getButton()&&"foldWidgets"!=l.getRegion(t)){var n=t.getDocumentPosition().row,r=o.session.selection;if(t.getShiftKey())r.selectTo(n,0);else{if(2==t.domEvent.detail)return o.selectAll(),t.preventDefault();e.$clickSelection=o.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}),e.editor.setDefaultHandler("guttermousemove",function(s){var a=s.domEvent.target||s.domEvent.srcElement;if(r.hasCssClass(a,"ace_fold-widget"))return c();i&&e.$tooltipFollowsMouse&&h(s),n=s,t||(t=setTimeout(function(){t=null,n&&!e.isMousePressed?function(){var t=n.getDocumentPosition().row,r=l.$annotations[t];if(!r)return c();if(t==o.session.getLength()){var s=o.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(s>o.session.documentToScreenRow(a.row,a.column))return c()}if(i!=r)if(i=r.text.join("
"),u.setHtml(i),u.show(),o._signal("showGutterTooltip",u),o.on("mousewheel",c),e.$tooltipFollowsMouse)h(n);else{var d=n.domEvent.target.getBoundingClientRect(),f=u.getElement().style;f.left=d.right+"px",f.top=d.bottom+"px"}}():c()},50))}),s.addListener(o.renderer.$gutter,"mouseout",function(e){n=null,i&&!t&&(t=setTimeout(function(){t=null,c()},50))}),o.on("changeSession",c)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent");function o(e){var t=e.editor,n=r.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),t.addEventListener("mousedown",this.onMouseDown.bind(e));var o,l,u,c,h,d,f,p,m,g,E,v=t.container,C=0;function D(){var e=d;(function(e,n){var r=Date.now(),i=!n||e.row!=n.row,s=!n||e.column!=n.column;!g||i||s?(t.moveCursorToPosition(e),g=r,E={x:l,y:u}):a(E.x,E.y,l,u)>5?g=null:r-g>=200&&(t.renderer.scrollCursorIntoView(),g=null)})(d=t.renderer.screenToTextCoordinates(l,u),e),function(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,s=t.renderer.layerConfig.characterWidth,o=t.renderer.scroller.getBoundingClientRect(),a={x:{left:l-o.left,right:o.right-l},y:{top:u-o.top,bottom:o.bottom-u}},c=Math.min(a.x.left,a.x.right),h=Math.min(a.y.top,a.y.bottom),d={row:e.row,column:e.column};c/s<=2&&(d.column+=a.x.left=200&&t.renderer.scrollCursorIntoView(d):m=r:m=null}(d,e)}function S(){h=t.selection.toOrientedRange(),o=t.session.addMarker(h,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(c),D(),c=setInterval(D,20),C=0,i.addListener(document,"mousemove",y)}function A(){clearInterval(c),t.session.removeMarker(o),o=null,t.selection.fromOrientedRange(h),t.isFocused()&&!p&&t.$resetCursorStyle(),h=null,d=null,C=0,m=null,g=null,i.removeListener(document,"mousemove",y)}this.onDragStart=function(e){if(this.cancelDrag||!v.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}h=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?"copy":"copyMove",s.isOpera&&(t.container.appendChild(n),n.scrollTop=0),i.setDragImage&&i.setDragImage(n,0,0),s.isOpera&&t.container.removeChild(n),i.clearData(),i.setData("Text",t.session.getTextRange()),p=!0,this.setState("drag")},this.onDragEnd=function(e){if(v.draggable=!1,p=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;f||"move"!=n||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||S(),C++,e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||(S(),C++),null!==_&&(_=null),e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragLeave=function(e){if(--C<=0&&o)return A(),f=null,i.preventDefault(e)},this.onDrop=function(e){if(d){var n=e.dataTransfer;if(p)switch(f){case"move":h=h.contains(d.row,d.column)?{start:d,end:d}:t.moveText(h,d);break;case"copy":h=t.moveText(h,d,!0)}else{var r=n.getData("Text");h={start:d,end:t.session.insert(d,r)},t.focus(),f=null}return A(),i.preventDefault(e)}},i.addListener(v,"dragstart",this.onDragStart.bind(e)),i.addListener(v,"dragend",this.onDragEnd.bind(e)),i.addListener(v,"dragenter",this.onDragEnter.bind(e)),i.addListener(v,"dragover",this.onDragOver.bind(e)),i.addListener(v,"dragleave",this.onDragLeave.bind(e)),i.addListener(v,"drop",this.onDrop.bind(e));var _=null;function y(){null==_&&(_=setTimeout(function(){null!=_&&o&&A()},20))}function b(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function T(e){var t=["copy","copymove","all","uninitialized"],n=s.isMac?e.altKey:e.ctrlKey,r="uninitialized";try{r=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var i="none";return n&&t.indexOf(r)>=0?i="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(r)>=0?i="move":t.indexOf(r)>=0&&(i="copy"),i}}function a(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=s.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;s.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton();if(1===(e.domEvent.detail||1)&&0===r&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var i=e.domEvent.target||e.domEvent.srcElement;"unselectable"in i&&(i.unselectable="on"),t.getDragDelay()?(s.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(o.prototype),t.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./mouse_event").MouseEvent,i=e("../lib/dom");t.addTouchListeners=function(e,t){var n,s,o,a,l,u,c,h,d,f="scroll",p=0,m=0,g=0,E=0;function v(){var e,n,r;d||(e=window.navigator&&window.navigator.clipboard,n=!1,r=function(r){var s,o,a=r.target.getAttribute("action");if("more"==a||!n)return n=!n,s=t.getCopyText(),o=t.session.getUndoManager().hasUndo(),void d.replaceChild(i.buildDom(n?["span",!s&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],s&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],s&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],o&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),d.firstChild);"paste"==a?e.readText().then(function(e){t.execCommand(a,e)}):a&&("cut"!=a&&"copy"!=a||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(a)),d.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&t.focus()},d=i.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){f="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),r(e)},onclick:r},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container));var s=t.selection.cursor,o=t.renderer.textToScreenCoordinates(s.row,s.column),a=t.container.getBoundingClientRect();d.style.top=o.pageY-a.top-3+"px",d.style.right="10px",d.style.display="",d.firstChild.style.display="none",t.on("input",C)}function C(e){d&&(d.style.display="none"),t.off("input",C)}function D(){l=null,clearTimeout(l);var e=t.selection.getRange(),n=e.contains(c.row,c.column);!e.isEmpty()&&n||(t.selection.moveToPosition(c),t.selection.selectWord()),f="wait",v()}e.addEventListener("contextmenu",function(e){h&&t.textInput.getElement().focus()}),e.addEventListener("touchstart",function(e){var i=e.touches;if(l||i.length>1)return clearTimeout(l),l=null,o=-1,void(f="zoom");h=t.$mouseHandler.isMousePressed=!0;var u=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,v=e.timeStamp;a=v;var C=i[0],S=C.clientX,A=C.clientY;Math.abs(n-S)+Math.abs(s-A)>u&&(o=-1),n=e.clientX=S,s=e.clientY=A,g=E=0;var _=new r(e,t);if(c=_.getDocumentPosition(),v-o<500&&1==i.length&&!p)m++,e.preventDefault(),e.button=0,function(){l=null,clearTimeout(l),t.selection.moveToPosition(c);var e=m>=2?t.selection.getLineRange(c.row):t.session.getBracketRange(c);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),f="wait"}();else{m=0;var y=t.selection.cursor,b=t.selection.isEmpty()?y:t.selection.anchor,T=t.renderer.$cursorLayer.getPixelPosition(y,!0),R=t.renderer.$cursorLayer.getPixelPosition(b,!0),x=t.renderer.scroller.getBoundingClientRect(),w=function(e,t){return(e/=d)*e+(t=t/u-.75)*t};if(e.clientXN?"cursor":"anchor"),f=N<3.5?"anchor":F<3.5?"cursor":"scroll",l=setTimeout(D,450)}o=v}),e.addEventListener("touchend",function(e){h=t.$mouseHandler.isMousePressed=!1,u&&clearInterval(u),"zoom"==f?(f="",p=0):l?(t.selection.moveToPosition(c),p=0,v()):"scroll"==f?(p+=60,u=setInterval(function(){p--<=0&&(clearInterval(u),u=null),Math.abs(g)<.01&&(g=0),Math.abs(E)<.01&&(E=0),p<20&&(g*=.9),p<20&&(E*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*g,10*E),e==t.session.getScrollTop()&&(p=0)},10),e.preventDefault(),C()):v(),clearTimeout(l),l=null}),e.addEventListener("touchmove",function(e){l&&(clearTimeout(l),l=null);var i=e.touches;if(!(i.length>1||"zoom"==f)){var o=i[0],u=n-o.clientX,c=s-o.clientY;if("wait"==f){if(!(u*u+c*c>4))return e.preventDefault();f="cursor"}n=o.clientX,s=o.clientY,e.clientX=o.clientX,e.clientY=o.clientY;var h=e.timeStamp,d=h-a;if(a=h,"scroll"==f){var p=new r(e,t);p.speed=1,p.wheelX=u,p.wheelY=c,10*Math.abs(u)1&&(i=n[n.length-2]);var o=l[t+"Path"];return null==o?o=l.basePath:"/"==r&&(t=r=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+t+r+i+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,r){var i,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{i=e(n)}catch(e){}if(i&&!t.$loading[n])return r&&r(i);if(t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r),!(t.$loading[n].length>1)){var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var r=t.$loading[n];t.$loading[n]=null,r.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,o),a),u()}};var u=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),u=function(){})};function c(i){if(a&&a.document){l.packaged=i||e.packaged||r.packaged||a.define&&n.amdD.packaged;for(var s={},o="",u=document.currentScript||document._currentScript,c=(u&&u.ownerDocument||document).getElementsByTagName("script"),d=0;d=e){for(s=h+1;s=e;)s++;for(a=h,l=s-1;a=t.length||2!=(l=n[i-1])&&3!=l||2!=(u=t[i+1])&&3!=u?4:(s&&(u=3),u==l?u:4);case 10:return 2==(l=i>0?n[i-1]:5)&&i+10&&2==n[i-1])return 2;if(s)return 4;for(f=i+1,d=t.length;f=1425&&m<=2303||64286==m;if(l=t[f],g&&(1==l||7==l))return 1}return i<1||5==(l=t[i-1])?4:n[i-1];case 5:return s=!1,o=!0,r;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:s=!1;case h:return 4}}function g(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?t>191?0:d[t]:5==n?/[\u0591-\u05f4]/.test(e)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?12:/[\u0660-\u0669\u066b-\u066c]/.test(e)?3:1642==t?c:/[\u06f0-\u06f9]/.test(e)?2:7:32==n&&t<=8287?f[255&t]:254==n&&t>=65136?7:4}t.L=0,t.R=1,t.EN=2,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,n,c){if(e.length<2)return{};var d=e.split(""),f=new Array(d.length),E=new Array(d.length),v=[];r=c?1:0,function(e,t,n,c){var h=r?u:l,d=null,f=null,p=null,E=0,v=null,C=-1,D=null,S=null,A=[];if(!c)for(D=0,c=[];D0)if(16==v){for(D=C;D-1){for(D=C;D=0&&8==c[_];_--)t[_]=r}}(d,v,d.length,n);for(var C=0;C7&&n[C]<13||4===n[C]||n[C]===h)?v[C]=t.ON_R:C>0&&"ل"===d[C-1]&&/\u0622|\u0623|\u0625|\u0627/.test(d[C])&&(v[C-1]=v[C]=t.R_H,C++);for(d[d.length-1]===t.DOT&&(v[d.length-1]=t.B),"‫"===d[0]&&(v[0]=t.RLE),C=0;C=0&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,r=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===r;)r=n,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[e];s&&(void 0===t&&(t=this.getSplitIndex()),t>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&s[i]%2!=0&&i++;for(var a=0;at&&s[i]%2==0&&(o+=this.charWidths[s[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(e,t){var n,r=this.bidiMap,i=r.bidiLevels,s=[],o=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,u=!1,c=!1,h=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,f=0;f=a&&dn+s/2;){if(n+=s,r===i.length-1){s=0;break}s=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!=0&&i[r]%2==0?(e0&&i[r-1]%2==0&&i[r]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&0===s&&i[r-1]%2==0||!this.isRtlDir&&0===r&&i[r]%2!=0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!=0&&0!==s&&r--,t=this.bidiMap.logicalFromVisual[r]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(o.prototype),t.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")})};(function(){r.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},this.$setSelection=function(e,t,n,r){var i=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||s)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n,r="number"==typeof e?e:this.lead.row,i=this.session.getFoldLine(r);return i?(r=i.start.row,n=i.end.row):n=r,!0===t?new o(r,0,n,this.session.getLine(n).length):new o(r,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i)this.moveCursorTo(i.end.row,i.end.column);else{if(this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t)),t>=n.length)return this.moveCursorTo(e,n.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(s)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)}},this.$shortWordEndIndex=function(e){var t,n=0,r=/\s/,i=this.session.tokenRe;if(i.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&r.test(t);)n++;if(n<1)for(i.lastIndex=0;(t=e[n])&&!i.test(t);)if(i.lastIndex=0,n++,r.test(t)){if(n>2){n--;break}for(;(t=e[n])&&r.test(t);)n++;if(n>2)break}}return i.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do{e++,r=this.doc.getLine(e)}while(e0&&/^\s*$/.test(r));n=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(t,n-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n,r=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(r.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(r.column),r.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=r.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?r.column=this.$desiredColumn:this.$desiredColumn=r.column);var i=this.session.screenToDocumentPosition(r.row+e,r.column,n);0!==e&&0===t&&i.row===this.lead.row&&i.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[i.row]&&(i.row>0||e>0)&&i.row++,this.moveCursorTo(i.row,i.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch(e){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,n){"use strict";var r=e("./config"),i=2e3,s=function(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],r=[],i=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",a=[],l=0;l1?this.$applyToken:u.token),h>1&&(/\\\d/.test(u.regex)?c=u.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(h=1,c=this.removeCapturingGroups(u.regex)),u.splitRegex||"string"==typeof u.token||a.push(u)),s[i]=l,i+=h,r.push(c),u.onMatch||(u.onMatch=null)}}r.length||(s[0]=0,r.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){i=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var r=[],i=0,s=n.length;ic){var E=e.substring(c,g-m.length);d.type==f?d.value+=E:(d.type&&u.push(d),d={type:f,value:E})}for(var v=0;vi){for(h>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});c1&&n[0]!==r&&n.unshift("#tmp",r),{tokens:u,state:n.length?n:r}},this.reportError=r.reportError}).call(s.prototype),t.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var n in e){for(var r=e[n],i=0;i=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(void 0!==n)return n;for(n=0;t>0;)n+=e[t-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)}}).call(i.prototype),t.TokenIterator=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r,i=e("../../lib/oop"),s=e("../behaviour").Behaviour,o=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],u=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],c={},h={'"':'"',"'":"'"},d=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,c.rangeCount!=e.multiSelect.rangeCount&&(c={rangeCount:e.multiSelect.rangeCount})),c[t])return r=c[t];r=c[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},f=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},p=function(e){this.add("braces","insertion",function(t,n,i,s,o){var l=i.getCursorPosition(),u=s.doc.getLine(l.row);if("{"==o){d(i);var c=i.getSelectionRange(),h=s.doc.getTextRange(c);if(""!==h&&"{"!==h&&i.getWrapBehavioursEnabled())return f(c,h,"{","}");if(p.isSaneInsertion(i,s))return/[\]\}\)]/.test(u[l.column])||i.inMultiSelectMode||e&&e.braces?(p.recordAutoInsert(i,s,"}"),{text:"{}",selection:[1,1]}):(p.recordMaybeInsert(i,s,"{"),{text:"{",selection:[1,1]})}else if("}"==o){if(d(i),"}"==u.substring(l.column,l.column+1)&&null!==s.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&p.isAutoInsertedClosing(l,u,o))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==o||"\r\n"==o){d(i);var m="";if(p.isMaybeInsertedClosing(l,u)&&(m=a.stringRepeat("}",r.maybeInsertedBrackets),p.clearMaybeInsertedClosing()),"}"===u.substring(l.column,l.column+1)){var g=s.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!g)return null;var E=this.$getIndent(s.getLine(g.row))}else{if(!m)return void p.clearMaybeInsertedClosing();E=this.$getIndent(u)}var v=E+s.getTabString();return{text:"\n"+v+"\n"+E+m,selection:[1,v.length,1,v.length]}}p.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,i,s){var o=i.doc.getTextRange(s);if(!s.isMultiLine()&&"{"==o){if(d(n),"}"==i.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s;r.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if("("==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"(",")");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(")"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"("==s&&(d(n),")"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("brackets","insertion",function(e,t,n,r,i){if("["==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"[","]");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if("]"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"["==s&&(d(n),"]"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("string_dquotes","insertion",function(e,t,n,r,i){var s=r.$mode.$quotes||h;if(1==i.length&&s[i]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(i))return;d(n);var o=i,a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(!(""===l||1==l.length&&s[l])&&n.getWrapBehavioursEnabled())return f(a,l,o,o);if(!l){var u=n.getCursorPosition(),c=r.doc.getLine(u.row),p=c.substring(u.column-1,u.column),m=c.substring(u.column,u.column+1),g=r.getTokenAt(u.row,u.column),E=r.getTokenAt(u.row,u.column+1);if("\\"==p&&g&&/escape/.test(g.type))return null;var v,C=g&&/string|escape/.test(g.type),D=!E||/string|escape/.test(E.type);if(m==o)(v=C!==D)&&/string\.end/.test(E.type)&&(v=!1);else{if(C&&!D)return null;if(C&&D)return null;var S=r.$mode.tokenRe;S.lastIndex=0;var A=S.test(p);S.lastIndex=0;var _=S.test(p);if(A||_)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;var y=c[u.column-2];if(p==o&&(y==o||S.test(y)))return null;v=!0}return{text:v?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.$mode.$quotes||h,o=r.doc.getTextRange(i);if(!i.isMultiLine()&&s.hasOwnProperty(o)&&(d(n),r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==o))return i.end.column++,i})};p.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new o(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",l)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var i=new o(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",l))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",u)},p.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},p.recordAutoInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isAutoInsertedClosing(i,s,r.autoInsertedLineEnd[0])||(r.autoInsertedBrackets=0),r.autoInsertedRow=i.row,r.autoInsertedLineEnd=n+s.substr(i.column),r.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isMaybeInsertedClosing(i,s)||(r.maybeInsertedBrackets=0),r.maybeInsertedRow=i.row,r.maybeInsertedLineStart=s.substr(0,i.column)+n,r.maybeInsertedLineEnd=s.substr(i.column),r.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return r.autoInsertedBrackets>0&&e.row===r.autoInsertedRow&&n===r.autoInsertedLineEnd[0]&&t.substr(e.column)===r.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return r.maybeInsertedBrackets>0&&e.row===r.maybeInsertedRow&&t.substr(e.column)===r.maybeInsertedLineEnd&&t.substr(0,e.column)==r.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){r.autoInsertedLineEnd=r.autoInsertedLineEnd.substr(1),r.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){r&&(r.maybeInsertedBrackets=0,r.maybeInsertedRow=-1)},i.inherits(p,s),t.CstyleBehaviour=p}),ace.define("ace/unicode",["require","exports","module"],function(e,t,n){"use strict";for(var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,s=[],o=0;o2?r%u!=u-1:r%u==0})}else{if(!this.blockComment)return!1;var f=this.blockComment.start,p=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+l.escapeRegExp(f)+")"),g=new RegExp("(?:"+l.escapeRegExp(p)+")\\s*$"),E=function(e,t){C(e,t)||s&&!/\S/.test(e)||(i.insertInLine({row:t,column:e.length},p),i.insertInLine({row:t,column:a},f))},v=function(e,t){var n;(n=e.match(g))&&i.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(m))&&i.removeInLine(t,n[1].length,n[0].length)},C=function(e,n){if(m.test(e))return!0;for(var r=t.getTokens(n),i=0;ie.length&&(S=e.length)}),a==1/0&&(a=S,s=!1,o=!1),c&&a%u!=0&&(a=Math.floor(a/u)*u),D(o?v:E)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(i){!i.start&&i[0]&&(i=i[0]);var s,o,a=(m=new u(t,r.row,r.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var h,d;a&&/comment/.test(a.type);){if(-1!=(g=a.value.indexOf(i.start))){var f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g;h=new c(f,p,f,p+i.start.length);break}a=m.stepBackward()}var m;for(a=(m=new u(t,r.row,r.column)).getCurrentToken();a&&/comment/.test(a.type);){var g;if(-1!=(g=a.value.indexOf(i.end))){f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g,d=new c(f,p,f,p+i.end.length);break}a=m.stepForward()}d&&t.remove(d),h&&(t.remove(h),s=h.start.row,o=-i.start.length)}else o=i.start.length,s=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);l.start.row==s&&(l.start.column+=o),l.end.row==s&&(l.end.column+=o),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var n=e[t],i=n.prototype.$id,s=r.$modes[i];s||(r.$modes[i]=s=new n),r.$modes[t]||(r.$modes[t]=s),this.$embeds.push(t),this.$modes[t]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;tthis.row)){var n=function(t,n,r){var i="insert"==t.action,s=(i?1:-1)*(t.end.row-t.start.row),o=(i?1:-1)*(t.end.column-t.start.column),a=t.start,l=i?a:t.end;return e(n,a,r)?{row:n.row,column:n.column}:e(l,n,!r)?{row:n.row+s,column:n.column+(n.row==l.row?o:0)}:{row:a.row,column:a.column}}(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(e,t,n){var r;if(r=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=r.row||this.column!=r.column){var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=e("./anchor").Anchor,l=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new a(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();void 0===e?e=n:e<0?e=0:e>=n&&(e=n-1,t=void 0);var r=this.getLine(e);return null==t&&(t=r.length),{row:e,column:t=Math.min(Math.max(t,0),r.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof o||(e=o.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,r=n.length-t+1,i=e.start.row,s=e.start.column,o=0,a=0;o20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,-1==r&&(r=t),s<=r&&n.fireUpdateEvent(s,r)}}};(function(){r.implement(this,i),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens}}).call(s.prototype),t.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=(e("./lib/oop"),e("./range").Range),s=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,n,s){if(this.regExp)for(var o=s.firstRow,a=s.lastRow,l=o;l<=a;l++){var u=this.cache[l];null==u&&((u=r.getMatchOffsets(n.getLine(l),this.regExp)).length>this.MAX_RANGES&&(u=u.slice(0,this.MAX_RANGES)),u=u.map(function(e){return new i(l,e.offset,l,e.offset+e.length)}),this.cache[l]=u.length?u:"");for(var c=u.length;c--;)t.drawSingleLineMarker(e,u[c].toScreenRange(n),this.clazz,s)}}}).call(s.prototype),t.SearchHighlight=s}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range;function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var r,i,s=0,o=this.folds,a=!0;null==t&&(t=this.end.row,n=this.end.column);for(var l=0;l0)){var l=r(e,o.start);return 0===a?t&&0!==l?-s-2:s:l>0||0===l&&!t?s:-s-1}}return-s-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},this.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],n=this.ranges,i=(n=n.sort(function(e,t){return r(e.start,t.start)}))[0],s=1;s=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=r);o++);if("insert"==e.action){for(var l=i-r,u=-t.column+n.column;or);o++)if(c.start.row==r&&c.start.column>=t.column&&(c.start.column==t.column&&this.$bias<=0||(c.start.column+=u,c.start.row+=l)),c.end.row==r&&c.end.column>=t.column){if(c.end.column==t.column&&this.$bias<0)continue;c.end.column==t.column&&u>0&&oc.start.column&&c.end.column==s[o+1].start.column&&(c.end.column-=u),c.end.column+=u,c.end.row+=l}}else for(l=r-i,u=t.column-n.column;oi);o++)c.end.rowt.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=u,c.end.row+=l):c.end.row>i&&(c.end.row+=l),c.start.rowt.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=u,c.start.row+=l):c.start.row>i&&(c.start.row+=l);if(0!=l&&o=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;for(t&&(r=n.indexOf(t)),-1==r&&(r=0);r=e)return i}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,r=t-e+1,i=0;i=t){a=e?r-=t-a:r=0);break}o>=e&&(r-=a>=e?o-a:o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n,r=this.$foldData,o=!1;e instanceof s?n=e:(n=new s(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,u=n.end.row,c=n.end.column,h=this.getFoldAt(a,l,1),d=this.getFoldAt(u,c,-1);if(h&&d==h)return h.addSubFold(n);h&&!h.range.isStart(a,l)&&this.removeFold(h),d&&!d.range.isEnd(u,c)&&this.removeFold(d);var f=this.getFoldsInRange(n.range);f.length>0&&(this.removeFolds(f),f.forEach(function(e){n.addSubFold(e)}));for(var p=0;p0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;if(null==e?(n=new r(0,0,this.getLength(),0),t=!0):n="number"==typeof e?new r(e,0,e,this.getLine(e).length):"row"in e?r.fromPoints(e,e):e,i=this.getFoldsInRangeList(n),t)this.removeFolds(i);else for(var s=i;s.length;)this.expandFolds(s),s=this.getFoldsInRangeList(n);if(i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){null==r&&(r=e.start.row),null==i&&(i=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var s=this.doc,o="";return e.walk(function(e,t,n,a){if(!(tc)break}while(s&&l.test(s.type));s=i.stepBackward()}else s=i.getCurrentToken();return u.end.row=i.getCurrentTokenRow(),u.end.column=i.getCurrentTokenColumn()+s.value.length-2,u}},this.foldAll=function(e,t,n){null==n&&(n=1e5);var r=this.foldWidgets;if(r){t=t||this.getLength();for(var i=e=e||0;i=e){i=s.end.row;try{var o=this.addFold("...",s);o&&(o.collapseChildren=n)}catch(e){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};for(var r,i=e-1;i>=0;){var s=n[i];if(null==s&&(s=n[i]=this.getFoldWidget(i)),"start"==s){var o=this.getFoldWidgetRange(i);if(r||(r=o),o&&o.end.row>=e)break}i--}return{range:-1!==i&&o,firstRange:r}},this.onFoldWidgetClick=function(e,t){var n={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var r=t.target||t.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),r=this.getLine(e),i="end"===n?-1:1,s=this.getFoldAt(e,-1===i?0:r.length,i);if(s)return t.children||t.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()&&(s=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(s.range))return this.removeFold(s),s;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,u=a.range.end.row;this.foldAll(l,u,t.all?1e4:0)}else t.children?(u=o?o.end.row:this.getLength(),this.foldAll(e+1,u,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var r=this.getParentFoldRangeData(t,!0);if(n=r.range||r.firstRange){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold("...",n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){"use strict";var r=e("../token_iterator").TokenIterator,i=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(""==n)return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t,n=this.getLine(e.row),r=!0,s=n.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(o||(s=n.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),r=!1),!o)return null;if(o[1]){if(!(a=this.$findClosingBracket(o[1],e)))return null;t=i.fromPoints(e,a),r||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a;if(!(a=this.$findOpeningBracket(o[2],e)))return null;t=i.fromPoints(a,e),r||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn()-2,u=a.value;;){for(;l>=0;){var c=u.charAt(l);if(c==i){if(0==(s-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else c==e&&(s+=1);l-=1}do{a=o.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(u=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn();;){for(var u=a.value,c=u.length;ln&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>1,s=e[i];if(t>s)n=i+1;else{if(!(t=t);s++);return(n=r[s])?(n.index=s,n.start=i-n.value.length,n):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe)),r)var i=this.tokenRe;else i=/^\s+$/.test(n.slice(t-1,t+1))?/\s/:this.nonTokenRe;var s=t;if(s>0){do{s--}while(s>=0&&n.charAt(s).match(i));s++}for(var o=t;oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,s=this.$foldData[i],o=s?s.start.row:1/0,a=t.length,l=0;lo){if((l=s.end.row+1)>=a)break;o=(s=this.$foldData[i++])?s.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>r&&(r=n[l])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var r=e[n];"insert"==r.action||"remove"==r.action?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;ne.end.column&&(s.start.column+=u),s.end.row==e.end.row&&s.end.column>e.end.column&&(s.end.column+=u)),o&&s.start.row>=e.end.row&&(s.start.row+=o,s.end.row+=o)}if(s.end=this.insert(s.start,r),i.length){var a=e.start,l=s.start,u=(o=l.row-a.row,l.column-a.column);this.addFolds(i.map(function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=u),e.end.row==a.row&&(e.end.column+=u),e.start.row+=o,e.end.row+=o,e}))}return s},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},this.outdentRows=function(e){for(var t=e.collapseRows(),n=new c(0,0,0,0),r=this.getTabSize(),i=t.start.row;i<=t.end.row;++i){var s=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o0){var i;if((i=this.getRowFoldEnd(t+n))>this.doc.getLength()-1)return 0;r=i-t}else e=this.$clipRowToDocument(e),r=(t=this.$clipRowToDocument(t))-e+1;var s=new c(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(e){return(e=e.clone()).start.row+=r,e.end.row+=r,e}),a=0==n?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+r,a),o.length&&this.addFolds(o),r},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1&&(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,i=e.end,s=r.row,o=i.row,a=o-s,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[t?"$wrapData":"$rowLengthCache"].splice(s,a);var u=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var c=0;if(m=this.getFoldLine(i.row)){m.addRemoveChars(i.row,i.column,r.column-i.column),m.shiftRow(-a);var h=this.getFoldLine(s);h&&h!==m&&(h.merge(m),m=h),c=u.indexOf(m)+1}for(;c=i.row&&m.shiftRow(-a);o=s}else{var d=Array(a);d.unshift(s,0);var f=t?this.$wrapData:this.$rowLengthCache;if(f.splice.apply(f,d),u=this.$foldData,c=0,m=this.getFoldLine(s)){var p=m.range.compareInside(r.row,r.column);0==p?(m=m.split(r.row,r.column))&&(m.shiftRow(a),m.addRemoveChars(o,0,i.column-r.column)):-1==p&&(m.addRemoveChars(s,0,i.column-r.column),m.shiftRow(a)),c=u.indexOf(m)+1}for(;c=s&&m.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===n&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(m=this.getFoldLine(s))&&m.addRemoveChars(s,r.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),l},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(n,r){var i,s,o=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,u=this.$wrapLimit,c=n;for(r=Math.min(r,o.length-1);c<=r;)(s=this.getFoldLine(c,s))?(i=[],s.walk(function(n,r,s,a){var l;if(null!=n){(l=this.$getDisplayTokens(n,i.length))[0]=e;for(var u=1;u=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}this.$computeWrapSplits=function(n,r,i){if(0==n.length)return[];var s=[],o=n.length,a=0,l=0,u=this.$wrapAsCode,c=this.$indentedSoftWrap,h=r<=Math.max(2*i,8)||!1===c?0:Math.floor(r/2);function d(e){for(var t=e-a,r=a;rr-f;){var p=a+r-f;if(n[p-1]>=10&&n[p]>=10)d(p);else if(n[p]!=e&&n[p]!=t){for(var m=Math.max(p-(r-(r>>2)),a-1);p>m&&n[p]m&&n[p]m&&9==n[p];)p--}else for(;p>m&&n[p]<10;)p--;p>m?d(++p):(2==n[p=a+r]&&p--,d(p-f))}else{for(;p!=a-1&&n[p]!=e;p--);if(p>a){d(p);continue}for(p=a+r;p39&&o<48||o>57&&o<64?i.push(9):o>=4352&&n(o)?i.push(1,2):i.push(1)}return i},this.$getStringScreenWidth=function(e,t,r){if(0==t)return[0,0];var i,s;for(null==t&&(t=1/0),r=r||0,s=0;s=4352&&n(i)?r+=2:r+=1,!(r>t));s++);return[r,s]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0){a=u[c],s=this.$docRowCache[c];var d=e>u[h-1]}else d=!h;for(var f=this.getLength()-1,p=this.getNextFoldLine(s),m=p?p.start.row:1/0;a<=e&&!(a+(l=this.getRowLength(s))>e||s>=f);)a+=l,++s>m&&(s=p.end.row+1,m=(p=this.getNextFoldLine(s,p))?p.start.row:1/0),d&&(this.$docRowCache.push(s),this.$screenRowCache.push(a));if(p&&p.start.row<=s)r=this.getFoldDisplayLine(p),s=p.start.row;else{if(a+l<=e||s>f)return{row:f,column:this.getLine(f).length};r=this.getLine(s),p=null}var g=0,E=Math.floor(e-a);if(this.$useWrapMode){var v=this.$wrapData[s];v&&(i=v[E],E>0&&v.length&&(g=v.indent,o=v[E-1]||v[v.length-1],r=r.substring(o)))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+E,s,E)&&(t=this.$bidiHandler.offsetToCol(n)),o+=this.$getStringScreenWidth(r,t-g)[1],this.$useWrapMode&&o>=i&&(o=i-1),p?p.idxToPosition(o):{row:s,column:o}},this.documentToScreenPosition=function(e,t){if(void 0===t)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r,i=0,s=null;(r=this.getFoldAt(e,t,1))&&(e=r.start.row,t=r.start.column);var o,a=0,l=this.$docRowCache,u=this.$getRowCacheIndex(l,e),c=l.length;if(c&&u>=0){a=l[u],i=this.$screenRowCache[u];var h=e>l[c-1]}else h=!c;for(var d=this.getNextFoldLine(a),f=d?d.start.row:1/0;a=f){if((o=d.end.row+1)>e)break;f=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;i+=this.getRowLength(a),a=o,h&&(this.$docRowCache.push(a),this.$screenRowCache.push(i))}var p="";d&&a>=f?(p=this.getFoldDisplayLine(d,e,t),s=d.start.row):(p=this.getLine(e).substring(0,t),s=e);var m=0;if(this.$useWrapMode){var g=this.$wrapData[s];if(g){for(var E=0;p.length>=g[E];)i++,E++;p=p.substring(g[E-1]||0,p.length),m=E>0?g.indent:0}}return{row:i,column:m+this.$getStringScreenWidth(p)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,r=0,i=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);ri&&(r=t.end.row+1,i=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var o=this.$foldData,a=0;an);s++);return[r,s]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=n}.call(p.prototype),e("./edit_session/folding").Folding.call(p.prototype),e("./edit_session/bracket_match").BracketMatch.call(p.prototype),o.defineOptions(p.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=p}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(){this.$options={}};(function(){this.set=function(e){return i.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i,o){return r=new s(e,n,i,o),!(n==o&&t.start&&t.start.start&&0!=t.skipCurrent&&r.isEqual(t.start)&&(r=null,1))}),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],a=t.re;if(t.$isMultiLine){var l,u=a.length,c=i.length-u;e:for(var h=a.offset||0;h<=c;h++){for(var d=0;dm||(o.push(l=new s(h,m,h+u-1,g)),u>2&&(h=h+u-2))}}else for(var E=0;ES&&o[d].end.row==n.end.row;)d--;for(o=o.slice(E,d+1),E=0,d=o.length;E=a;n--)if(h(n,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(n=l,a=o.row;n>=a;n--)if(h(n,Number.MAX_VALUE,e))return}};else u=function(e){var n=o.row;if(!h(n,o.column,e)){for(n+=1;n<=l;n++)if(h(n,0,e))return;if(0!=t.wrap)for(n=a,l=o.row;n<=l;n++)if(h(n,0,e))return}};if(t.$isMultiLine)var c=n.length,h=function(t,i,s){var o=r?t-c+1:t;if(!(o<0)){var a=e.getLine(o),l=a.search(n[0]);if(!(!r&&li))return!!s(o,l,o+c-1,h)||void 0}}};else h=r?function(t,r,i){var s,o=e.getLine(t),a=[],l=0;for(n.lastIndex=0;s=n.exec(o);){var u=s[0].length;if(l=s.index,!u){if(l>=o.length)break;n.lastIndex=l+=1}if(s.index+u>r)break;a.push(s.index,u)}for(var c=a.length-1;c>=0;c-=2){var h=a[c-1];if(i(t,h,t,h+(u=a[c])))return!0}}:function(t,r,i){var s,o,a=e.getLine(t);for(n.lastIndex=r;o=n.exec(a);){var l=o[0].length;if(i(t,s=o.index,t,s+l))return!0;if(!l&&(n.lastIndex=s+=1,s>=a.length))return!1}};return{forEach:u}}}).call(o.prototype),t.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/keys"),i=e("../lib/useragent"),s=r.KEY_MODS;function o(e,t){this.platform=t||(i.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function a(e,t){o.call(this,e,t),this.$singleCommand=!1}a.prototype=o.prototype,function(){function e(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var n=e&&("string"==typeof e?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var s=r[i];if(s==e)delete r[i];else if(Array.isArray(s)){var o=s.indexOf(e);-1!=o&&(s.splice(o,1),1==s.length&&(r[i]=s[0]))}}},this.bindKey=function(e,t,n){if("object"==typeof e&&e&&(null==n&&(n=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach(function(e){var r="";if(-1!=e.indexOf(" ")){var i=e.split(/\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=s[t.hashId]+t.key;r+=(r?" ":"")+n,this._addCommandToBinding(r,"chainKeys")},this),r+=" "}var o=this.parseKeys(e),a=s[o.hashId]+o.key;this._addCommandToBinding(r+a,t,n)},this)},this._addCommandToBinding=function(t,n,r){var i,s=this.commandKeyBinding;if(n)if(!s[t]||this.$singleCommand)s[t]=n;else{Array.isArray(s[t])?-1!=(i=s[t].indexOf(n))&&s[t].splice(i,1):s[t]=[s[t]],"number"!=typeof r&&(r=e(n));var o=s[t];for(i=0;ir);i++);o.splice(i,0,n)}else delete s[t]},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(n){if("string"==typeof n)return this.bindKey(n,t);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=t),this.addCommand(n))}},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),i=r[n];if(r.FUNCTION_KEYS[i])n=r.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:n.toUpperCase(),hashId:-1}}for(var s=0,o=t.length;o--;){var a=r.KEY_MODS[t[o]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[o]+" in "+e),!1;s|=a}return{key:n,hashId:s}},this.findKeyCommand=function(e,t){var n=s[e]+t;return this.commandKeyBinding[n]},this.handleKeyboard=function(e,t,n,r){if(!(r<0)){var i=s[t]+n,o=this.commandKeyBinding[i];return e.$keyChain&&(e.$keyChain+=" "+i,o=this.commandKeyBinding[e.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(e.$keyChain&&(t&&4!=t||1!=n.length?(-1==t||r>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-i.length-1)),{command:o}):(e.$keyChain=e.$keyChain||i,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(o.prototype),t.HashHandler=o,t.MultiHashHandler=a}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){i.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};r.inherits(o,i),function(){r.implement(this,s),this.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var i={editor:t,command:e,args:n};return i.returnValue=this._emit("exec",i),this._signal("afterExec",i),!1!==i.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map(function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=e("../config"),s=e("../range").Range;function o(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(e){i.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,a=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(n.row),u=n.row+1;u<=i.row+1;u++){var c=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(u)));0!==c.length&&(c=" "+c),l+=c}i.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;o=i.lastRow||r.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var i=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&-1!==n.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var n=this;E.loadModule(["keybinding",e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||i.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=t.findMatchingBracket(e.getCursorPosition());if(n)var r=new f(n.row,n.column,n.row,n.column+1);else t.$mode.getMatching&&(r=t.$mode.getMatching(e.session));r&&(t.$bracketHighlight=t.addMarker(r,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=e.getCursorPosition(),r=new v(e.session,n.row,n.column),i=r.getCurrentToken();if(!i||!/\b(?:tag-open|tag-name)/.test(i.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1==i.type.indexOf("tag-open")||(i=r.stepForward())){var s=i.value,o=0,a=r.stepBackward();if("<"==a.value)do{a=i,(i=r.stepForward())&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"=0);else{do{i=a,a=r.stepBackward(),i&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var n=new f(e.row,e.column,e.row,1/0);n.id=t.addMarker(n,"ace_active-line","screenLine"),t.$highlightLineMarker=n}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var n=t.start.column,r=t.end.column,i=e.getLine(t.start.row),s=i.substring(n,r);if(!(s.length>5e3)&&/[\w\d]/.test(s)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),a=i.substring(n-1,r+1);if(o.test(a))return o}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var r=this.selection.getAllRanges(),i=0;ia.search(/\S|$/)){var l=a.substr(i.column).search(/\S|$/);n.doc.removeInLine(i.row,i.column,i.column+l)}}this.clearSelection();var u=i.column,c=n.getState(i.row),h=(a=n.getLine(i.row),r.checkOutdent(c,a,e));if(n.insert(i,e),s&&s.selection&&(2==s.selection.length?this.selection.setSelectionRange(new f(i.row,u+s.selection[0],i.row,u+s.selection[1])):this.selection.setSelectionRange(new f(i.row+s.selection[0],s.selection[1],i.row+s.selection[2],s.selection[3]))),n.getDocument().isNewLine(e)){var d=r.getNextLineIndent(c,a.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},d)}h&&r.autoOutdent(c,n,i.row)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(e,t){var n;(t.extendLeft||t.extendRight)&&((n=this.selection.getRange()).start.column-=t.extendLeft,n.end.column+=t.extendRight,this.selection.setRange(n),e||n.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((n=this.selection.getRange()).start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,"deletion",this,n,t);if(0===t.end.column){var s=n.getTextRange(t);if("\n"==s[s.length-1]){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var n,r,i=this.session.getLine(e.row);tt.toLowerCase()?1:0});var i=new f(0,0,0,0);for(r=e.first;r<=e.last;r++){var s=t.getLine(r);i.start.row=r,i.end.row=r,i.end.column=s.length,t.replace(i,n[r-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var r=this.session.getLine(e);n.lastIndex=t)return{value:i[0],start:i.index,end:i.index+i[0].length}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new f(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var s=this.getNumberAt(t,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,a=s.start+s.value.length-o,l=parseFloat(s.value);l*=Math.pow(10,a),o!==s.end&&n=a&&o<=l&&(n=t,u.selection.clearSelection(),u.moveCursorTo(e,a+r),u.selection.selectTo(e,l+r)),a=l});for(var c,h=this.$toggleWordPairs,d=0;df+1)break;f=p.last}for(c--,a=this.session.$moveLines(d,f,t?0:e),t&&-1==e&&(h=c+1);h<=c;)o[h].moveBy(a,0),h++;t||(a=0),l+=a}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);!0===t?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):!1===t&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,i*r.lineHeight),null!=t&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new v(this.session,n.row,n.column),i=r.getCurrentToken(),s=i||r.stepForward();if(s){var o,a,l=!1,u={},c=n.column-s.start,h={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;c=0;--s)this.$tryReplace(n[s],e)&&r++;return this.selection.setSelectionRange(i),r},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return null!==(t=this.$search.replace(n,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&r.mixin(t,e);var i=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(i)||this.$search.$options.needle)||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var s=this.$search.find(this.session);return t.preventScroll?s:s?(this.revealRange(s,n),s):(t.backwards?i.start=i.end:i.end=i.start,void this.selection.setRange(i))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(e){var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var s=this.on("changeSelection",function(){r=!0}),o=this.renderer.on("beforeRender",function(){r&&(t=n.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,s=e.$cursorLayer.$pixelPos,o=e.layerConfig,a=s.top-o.offset;null!=(r=s.top>=0&&a+t.top<0||!(s.topwindow.innerHeight)&&null)&&(i.style.top=a+"px",i.style.left=s.left+"px",i.style.height=o.lineHeight+"px",i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",o))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,i.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},this.prompt=function(e,t,n){var r=this;E.loadModule("./ext/prompt",function(i){i.prompt(r,e,t,n)})}}.call(D.prototype),E.defineOptions(D.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?S.attach(this):S.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?S.attach(this):S.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.renderer.$composition||this.getValue();if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),i.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!e&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),i.addCssClass(this.container,"ace_hasPlaceholder");var t=i.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var S={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=D}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,n){this.$fromUndo||e!=this.$lastDelta&&(!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,r=n.length;r--;){var i=n[r][0];if(i.id<=e)break;i.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?a(e):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(r.prototype);var i=e("./range").Range,s=i.comparePoints;function o(e){return{row:e.row,column:e.column}}function a(e){if(e=e||this,Array.isArray(e))return e.map(a).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function u(e,t){var n="insert"==e.action,r="insert"==t.action;if(n&&r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}else if(!n&&r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(!n&&!r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}return[t,e]}function c(e,t){for(var n=e.length;n--;)for(var r=0;r=0?d(e,t,-1):(s(e.start,t.start)<=0||d(e,i.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!n&&r)s(t.start,e.end)>=0?d(t,e,-1):(s(t.start,e.start)<=0||d(t,i.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{var o,a;if(!(s(t.end,e.start)<=0))return s(e.start,t.start)<0&&(o=e,e=p(e,t.start)),s(e.end,t.end)>0&&(a=p(e,t.end)),f(t.end,e.start,e.end,-1),a&&!o&&(e.lines=a.lines,e.start=a.start,e.end=a.end,a=e),[t,o,a].filter(Boolean);d(e,t,-1)}return[t,e]}function d(e,t,n){f(e.start,t.start,t.end,n),f(e.end,t.start,t.end,n)}function f(e,t,n,r){e.row==(1==r?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function p(e,t){var n=e.lines,r=e.end;e.end=o(t);var i=e.end.row-e.start.row,s=n.splice(i,n.length),a=i?t.column:t.column-e.start.column;return n.push(s[0].substring(0,a)),s[0]=s[0].substr(a),{start:o(t),end:r,lines:s,action:e.action}}function m(e,t){t=function(e){return{start:o(e.start),end:o(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var n=e.length;n--;){for(var r=e[n],i=0;is&&(l=i.end.row+1,s=(i=t.getNextFoldLine(l,i))?i.start.row:1/0),l>r){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,e,this.session,u),this.$lines.push(o)),this.$renderCell(o,e,i,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,i=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(i=t.getLength()+r-1);var s=n?n.getWidth(t,i,e):i.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();(s+=o.left+o.right)===this.gutterWidth||isNaN(s)||(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(r.row>this.$cursorRow){var i=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&i&&i.start.row==t[n-1].row))break;r=t[n-1]}r.element.className="ace_gutter-active-line "+r.element.className,this.$cursorCell=r;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;if(this.oldLastRow=n,!t||r0;i--)this.$lines.shift();if(r>n)for(i=this.session.getFoldedRowCount(n+1,r);i>0;i--)this.$lines.pop();e.firstRowr&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,n){for(var r=[],i=t,s=this.session.getNextFoldLine(i),o=s?s.start.row:1/0;i>o&&(i=s.end.row+1,o=(s=this.session.getNextFoldLine(i,s))?s.start.row:1/0),!(i>n);){var a=this.$lines.createCell(i,e,this.session,u);this.$renderCell(a,e,s,i),r.push(a),i++}return r},this.$renderCell=function(e,t,n,i){var s=e.element,o=this.session,a=s.childNodes[0],l=s.childNodes[1],u=o.$firstLineNumber,c=o.$breakpoints,h=o.$decorations,d=o.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&o.foldWidgets,p=n?n.start.row:Number.MAX_VALUE,m="ace_gutter-cell ";if(this.$highlightGutterLine&&(i==this.$cursorRow||n&&i=p&&this.$cursorRow<=n.end.row)&&(m+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),c[i]&&(m+=c[i]),h[i]&&(m+=h[i]),this.$annotations[i]&&(m+=this.$annotations[i].className),s.className!=m&&(s.className=m),f){var g=f[i];null==g&&(g=f[i]=o.getFoldWidget(i))}if(g){m="ace_fold-widget ace_"+g,"start"==g&&i==p&&in.right-t.right?"foldWidgets":void 0}}).call(l.prototype),t.Gutter=l}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/dom"),s=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){function e(e,t,n,r){return(e?1:0)|(t?2:0)|(n?4:0)|(r?8:0)}this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},this.update=function(e){if(e){var t;for(var n in this.config=e,this.i=0,this.markers){var r=this.markers[n];if(r.range){var i=r.range.clipRows(e.firstRow,e.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),r.renderer){var s=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,s,e)}else"fullLine"==r.type?this.drawFullLineMarker(t,i,r.clazz,e):"screenLine"==r.type?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?"text"==r.type?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+" ace_start ace_br15",e)}else r.update(t,this,this.session,e)}if(-1!=this.i)for(;this.if,c==u),s,c==u?0:1,o)},this.drawMultiLineMarker=function(e,t,n,r,i){var s=this.$padding,o=r.lineHeight,a=this.$getTop(t.start.row,r),l=s+t.start.column*r.characterWidth;if(i=i||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((u=t.clone()).end.row=u.start.row,u.end.column=this.session.getLine(u.start.row).length,this.drawBidiSingleLineMarker(e,u,n+" ace_br1 ace_start",r,null,i)):this.elt(n+" ace_br1 ace_start","height:"+o+"px;right:0;top:"+a+"px;left:"+l+"px;"+(i||"")),this.session.$bidiHandler.isBidiRow(t.end.row)){var u;(u=t.clone()).start.row=u.end.row,u.start.column=0,this.drawBidiSingleLineMarker(e,u,n+" ace_br12",r,null,i)}else{a=this.$getTop(t.end.row,r);var c=t.end.column*r.characterWidth;this.elt(n+" ace_br12","height:"+o+"px;width:"+c+"px;top:"+a+"px;left:"+s+"px;"+(i||""))}if(!((o=(t.end.row-t.start.row-1)*r.lineHeight)<=0)){a=this.$getTop(t.start.row+1,r);var h=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+o+"px;right:0;top:"+a+"px;left:"+s+"px;"+(i||""))}},this.drawSingleLineMarker=function(e,t,n,r,i,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,i,s);var o=r.lineHeight,a=(t.end.column+(i||0)-t.start.column)*r.characterWidth,l=this.$getTop(t.start.row,r),u=this.$padding+t.start.column*r.characterWidth;this.elt(n,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+u+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(e,t,n,r,i,s){var o=r.lineHeight,a=this.$getTop(t.start.row,r),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(n,"height:"+o+"px;width:"+e.width+(i||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-s),this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))},this.drawScreenLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))}}).call(s.prototype),t.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=function(e){this.dom=i,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){r.implement(this,a),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;nc&&(a=l.end.row+1,c=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(a>i);){var h=s[o++];if(h){this.dom.removeChildren(h),this.$renderLine(h,a,a==c&&l),u&&(h.style.top=this.$lines.computeLineTop(a,e,this.session)+"px");var d=e.lineHeight*this.session.getRowLength(a)+"px";h.style.height!=d&&(u=!0,h.style.height=d)}a++}if(u)for(;o0;i--)this.$lines.shift();if(t.lastRow>e.lastRow)for(i=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);i>0;i--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,n){for(var r=[],s=t,o=this.session.getNextFoldLine(s),a=o?o.start.row:1/0;s>a&&(s=o.end.row+1,a=(o=this.session.getNextFoldLine(s,o))?o.start.row:1/0),!(s>n);){var l=this.$lines.createCell(s,e,this.session),u=l.element;this.dom.removeChildren(u),i.setStyle(u.style,"height",this.$lines.computeLineHeight(s,e,this.session)+"px"),i.setStyle(u.style,"top",this.$lines.computeLineTop(s,e,this.session)+"px"),this.$renderLine(u,s,s==a&&o),this.$useLineGroups()?u.className="ace_line_group":u.className="ace_line",r.push(l),s++}return r},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,n=e.lastRow,r=this.$lines;r.getLength();)r.pop();r.push(this.$renderLinesFragment(e,t,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,r){for(var i,o=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),u=0;i=a.exec(r);){var c=i[1],h=i[2],d=i[3],f=i[4],p=i[5];if(o.showInvisibles||!h){var m=u!=i.index?r.slice(u,i.index):"";if(u=i.index+i[0].length,m&&l.appendChild(this.dom.createTextNode(m,this.element)),c){var g=o.session.getScreenTabSize(t+i.index);l.appendChild(o.$tabStrings[g].cloneNode(!0)),t+=g-1}else h?o.showInvisibles?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",v.textContent=s.stringRepeat(o.SPACE_CHAR,h.length),l.appendChild(v)):l.appendChild(this.com.createTextNode(h,this.element)):d?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",v.textContent=s.stringRepeat(o.SPACE_CHAR,d.length),l.appendChild(v)):f?(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className=o.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",v.textContent=o.showInvisibles?o.SPACE_CHAR:f,l.appendChild(v)):p&&(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className="ace_cjk",v.textContent=p,l.appendChild(v))}}if(l.appendChild(this.dom.createTextNode(u?r.slice(u):r,this.element)),this.$textToken[n.type])e.appendChild(l);else{var E="ace_"+n.type.replace(/\./g," ace_"),v=this.dom.createElement("span");"fold"==n.type&&(v.style.width=n.value.length*this.config.characterWidth+"px"),v.className=E,v.appendChild(l),e.appendChild(v)}return t+r.length},this.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(" "==t[0]){for(var i=(r-=r%this.tabSize)/this.tabSize,s=0;s=o;)a=this.$renderToken(l,a,c,h.substring(0,o-r)),h=h.substring(o-r),r=o,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(s.stringRepeat(" ",n.indent),this.element)),a=0,o=n[++i]||Number.MAX_VALUE;0!=h.length&&(r+=h.length,a=this.$renderToken(l,a,c,h))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(e,t){var n=0,r=t[0],i=r.value;this.displayIndentGuides&&(i=this.renderIndentGuide(e,i)),i&&(n=this.$renderToken(e,n,r,i));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,r,i);n=this.$renderToken(e,n,r,i)}},this.$renderOverflowMessage=function(e,t,n,r,i){n&&this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=i?"":"",e.appendChild(s)},this.$renderLine=function(e,t,n){if(n||0==n||(n=this.session.getFoldLine(t)),n)var r=this.$getFoldLineTokens(t,n);else r=this.session.getTokens(t);var i=e;if(r.length){var s=this.session.getRowSplitData(t);s&&s.length?(this.$renderWrappedLine(e,r,s),i=e.lastChild):(i=e,this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i)),this.$renderSimpleLine(i,r))}else this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i));if(this.showInvisibles&&i){n&&(t=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,i.appendChild(o)}},this.$getFoldLineTokens=function(e,t){var n=this.session,r=[],i=n.getTokens(e);return t.walk(function(e,t,s,o,a){null!=e?r.push({type:"fold",value:e}):(a&&(i=n.getTokens(t)),i.length&&function(e,t,n){for(var i=0,s=0;s+e[i].value.lengthn-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),s=t+o.length,i+=1);sn?r.push({type:e[i].type,value:o.substring(0,n-s)}):r.push(e[i]),s+=o.length,i+=1}}(i,o,s))},t.end.row,this.session.getLine(t.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),t.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)r.setStyle(t[n].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){r.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){r.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&r.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}else this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||o.top<0)&&n>1)){var a=this.cursors[i++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,o,e,t[n],this.session):this.isCursorInView(o,e)?(r.setStyle(l,"display","block"),r.translate(a,o.left,o.top),r.setStyle(l,"width",Math.round(e.characterWidth)+"px"),r.setStyle(l,"height",e.lineHeight+"px")):r.setStyle(l,"display","none")}}for(;this.cursors.length>i;)this.removeCursor();var u=this.session.getOverwrite();this.$setOverwrite(u),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(i.prototype),t.Cursor=i}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,a=32768,l=function(e){this.element=i.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){r.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(l.prototype);var u=function(e,t){l.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=i.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};r.inherits(u,l),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>a?(this.coeff=a/e,e=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(u.prototype);var c=function(e,t){l.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};r.inherits(c,l),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(c.prototype),t.ScrollBar=u,t.ScrollBarV=u,t.ScrollBarH=c,t.VScrollBar=u,t.HScrollBar=c}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){"use strict";var r=e("./lib/event"),i=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(r.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(i.prototype),t.RenderLoop=i}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,u=256,c="function"==typeof ResizeObserver,h=200,d=t.FontMetrics=function(e){this.el=i.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.innerHTML=s.stringRepeat("X",u),this.$characterSize={width:0,height:0},c?this.$addObserver():this.checkForSizeChanges()};(function(){r.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){var n=t[0].contentRect;e.checkForSizeChanges({height:n.height,width:n.width/u})}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/u};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.innerHTML=s.stringRepeat(e,u),this.$main.getBoundingClientRect().width/u},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=i.buildDom([e(0,0),e(h,0),e(0,h),e(h,h)],this.el)},this.transformCoordinates=function(e,t){function n(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function r(e,t){return[e[0]-t[0],e[1]-t[1]]}function i(e,t){return[e[0]+t[0],e[1]+t[1]]}function s(e,t){return[e*t[0],e*t[1]]}function o(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=s(1/this.$getZoom(this.el),e)),this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),u=o(this.els[2]),c=o(this.els[3]),d=n(r(c,l),r(c,u),r(i(l,u),i(c,a))),f=s(1+d[0],r(l,a)),p=s(1+d[1],r(u,a));if(t){var m=t,g=d[0]*m[0]/h+d[1]*m[1]/h+1,E=i(s(m[0],f),s(m[1],p));return i(s(1/g/h,E),a)}var v=r(e,a),C=n(r(f,s(d[0],v)),r(p,s(d[1],v)),v);return s(h,C)}}).call(d.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./config"),o=e("./layer/gutter").Gutter,a=e("./layer/marker").Marker,l=e("./layer/text").Text,u=e("./layer/cursor").Cursor,c=e("./scrollbar").HScrollBar,h=e("./scrollbar").VScrollBar,d=e("./renderloop").RenderLoop,f=e("./layer/font_metrics").FontMetrics,p=e("./lib/event_emitter").EventEmitter,m='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);opacity: 0.7;transform-origin: left;text-indent: 10px;}',g=e("./lib/useragent"),E=g.isIE;i.importCssString(m,"ace_editor.css");var v=function(e,t){var n=this;this.container=e||i.createElement("div"),i.addCssClass(this.container,"ace_editor"),i.HI_DPI&&i.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=i.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=i.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=i.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var r=this.$textLayer=new l(this.content);this.canvas=r.element,this.$markerFront=new a(this.content),this.$cursorLayer=new u(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new f(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!g.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,p),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),i.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,n){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,r){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var i=this.container;r||(r=i.clientHeight||i.scrollHeight),n||(n=i.clientWidth||i.scrollWidth);var s=this.$updateCachedSize(e,t,n,r);if(!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var s=0,o=this.$size,a={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if(r&&(e||o.height!=r)&&(o.height=r,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL),n&&(e||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,i.setStyle(this.scrollBarH.element.style,"left",t+"px"),i.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),i.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";i.setStyle(this.scrollBarH.element.style,"right",l),i.setStyle(this.scroller.style,"right",l),i.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(s|=this.CHANGE_FULL)}return o.$dirty=!n||!r,s&&this._signal("resize",a),s},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=i.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=i.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var n=this.$cursorLayer.$pixelPos;if(n){t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var r=this.layerConfig,s=n.top,o=n.left;s-=r.offset;var a=t&&t.useTextareaForIME?this.lineHeight:E?0:1;if(s<0||s>r.height-a)i.translate(this.textarea,0,0);else{var l=1,u=this.$size.height-a;if(t)if(t.useTextareaForIME){var c=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(c)[0]}else s+=this.lineHeight+2;else s+=this.lineHeight;(o-=this.scrollLeft)>this.$size.scrollerWidth-l&&(o=this.$size.scrollerWidth-l),o+=this.gutterWidth+this.margin.left,i.setStyle(e,"height",a+"px"),i.setStyle(e,"width",l+"px"),i.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-l),Math.min(s,u))}}}else i.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},this.setMargin=function(e,t,n,r){var i=this.margin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),i.translate(this.content,-this.scrollLeft,-n.offset);var s=n.width+2*this.$padding+"px",o=n.minHeight+"px";i.setStyle(this.content.style,"width",s),i.setStyle(this.content.style,"height",o)}if(e&this.CHANGE_H_SCROLL&&(i.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender")}else this.$changes|=e},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=!(n<=2*this.lineHeight)&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||r!=this.$vScroll){r!=this.$vScroll&&(this.$vScroll=r,this.scrollBarV.setVisible(r));var i=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,i,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength()*this.lineHeight,i=this.$getLongestLine(),s=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-i-2*this.$padding<0),o=this.$horizScroll!==s;o&&(this.$horizScroll=s,this.scrollBarH.setVisible(s));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,u=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;r+=u;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,r-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,i+2*this.$padding-t.scrollerWidth+c.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-r+u<0||this.scrollTop>c.top),d=a!==h;d&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var f,p,m=this.scrollTop%this.lineHeight,g=Math.ceil(l/this.lineHeight)-1,E=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),v=E+g,C=this.lineHeight;E=e.screenToDocumentRow(E,0);var D=e.getFoldLine(E);D&&(E=D.start.row),f=e.documentToScreenRow(E,0),p=e.getRowLength(E)*C,v=Math.min(e.screenToDocumentRow(v,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(v)*C+p,m=this.scrollTop-f*C;var S=0;return(this.layerConfig.width!=i||o)&&(S=this.CHANGE_H_SCROLL),(o||d)&&(S|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(i=this.$getLongestLine())),this.layerConfig={width:i,padding:this.$padding,firstRow:E,firstRowScreen:f,lastRow:v,lineHeight:C,characterWidth:this.characterWidth,minHeight:l,maxHeight:r,offset:m,gutterOffset:C?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/C)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(i-this.$padding),S},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1||tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t,n){if(0!==this.$size.scrollerHeight){var r=this.$cursorLayer.getPixelPosition(e),i=r.left,s=r.top,o=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+o>s?(t&&l+o>s+this.lineHeight&&(s-=t*this.$size.scrollerHeight),0===s&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):l+this.$size.scrollerHeight-ai?(i=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:a,side:s-a>0?1:-1,offsetX:i}},this.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),a=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),i)},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),s=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+s-this.scrollTop}},this.visualizeFocus=function(){i.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){i.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),e.useTextareaForIME=this.$useTextareaForIME,this.$useTextareaForIME?(i.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),i.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText,this.$composition=null,this.$cursorLayer.element.style.display="")},this.addToken=function(e,t,n,r){var i=this.session;i.bgTokenizer.lines[n]=null;var s={type:t,value:e},o=i.getTokens(n);if(null==r)o.push(s);else for(var a=0,l=0;l50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,n){var r=null,i=!1,a=Object.create(s),u=[],c=new l({messageBuffer:u,terminate:function(){},postMessage:function(e){u.push(e),r&&(i?setTimeout(h):h())}});c.setEmitSync=function(e){i=e};var h=function(){var e=u.shift();e.command?r[e.command].apply(r,e.args):e.event&&a._signal(e.event,e.data)};return a.postMessage=function(e){c.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},o.loadModule(["worker",t],function(e){for(r=new e[n](a);u.length;)h()}),c},t.WorkerClient=l,t.createWorker=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(e,t,n,r,i,s){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,i),this.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,s=t.start.column-this.pos.column;if(this.updateAnchors(e),i&&(this.length+=n),i&&!this.session.$fromUndo)if("insert"===e.action)for(var o=this.others.length-1;o>=0;o--){var a={row:(l=this.others[o]).row,column:l.column+s};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(o=this.others.length-1;o>=0;o--){var l;a={row:(l=this.others[o]).row,column:l.column+s},this.doc.remove(new r(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,i){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),i,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)}},this.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new r,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{n=this.getRange();var r=this.isBackwards(),s=n.start.row,o=n.end.row;if(s==o){if(r)var a=n.end,l=n.start;else a=n.start,l=n.end;return this.addRange(i.fromPoints(l,l)),void this.addRange(i.fromPoints(a,a))}var u=[],c=this.getLineRange(s,!0);c.start.column=n.start.column,u.push(c);for(var h=s+1;h1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(r,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],s=e.column0;)E--;if(E>0)for(var v=0;r[v].isEmpty();)v++;for(var C=E;C>=v;C--)r[C].isEmpty()&&r.splice(C,1)}return r}}.call(s.prototype);var d=e("./editor").Editor;function f(e,t){return e.row==t.row&&e.column==t.column}function p(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",o),e.commands.addCommands(u.defaultCommands),function(e){if(e.textInput){var t=e.textInput.getElement(),n=!1;a.addListener(t,"keydown",function(t){var i=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&i?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&r()}),a.addListener(t,"keyup",r),a.addListener(t,"blur",r)}function r(t){n&&(e.renderer.setMouseCursor(""),n=!1)}}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var r=e[n];if(r.marker){this.session.removeMarker(r.marker);var i=t.indexOf(r);-1!=i&&t.splice(i,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(u.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(u.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?r=n.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?r=n.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});else{var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return r}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var r,i=n&&n.keepOrder,o=1==n||n&&n.$byLines,a=this.session,l=this.selection,u=l.rangeList,c=(i?l:u).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var h=l._eventRegistry;l._eventRegistry={};var d=new s(a);this.inVirtualSelectionMode=!0;for(var f=c.length;f--;){if(o)for(;f>0&&c[f].start.row==c[f-1].end.row;)f--;d.fromOrientedRange(c[f]),d.index=f,this.selection=a.selection=d;var p=e.exec?e.exec(this,t||{}):e(this,t||{});r||void 0===p||(r=p),d.toOrientedRange(c[f])}d.detach(),this.selection=a.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=h,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),r}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],r=0;ro&&(o=n.column),rc?e.insert(r,l.stringRepeat(" ",s-c)):e.remove(new i(r.row,r.column,r.row,r.column-s+c)),t.start.column=t.end.column=o,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var c=this.selection.getRange(),h=c.start.row,d=c.end.row,f=h==d;if(f){var p,m=this.session.getLength();do{p=this.session.getLine(d)}while(/[=:]/.test(p)&&++d0);h<0&&(h=0),d>=m&&(d=m-1)}var g=this.session.removeFullLines(h,d);g=this.$reAlignText(g,f),this.session.insert({row:h,column:0},g.join("\n")+"\n"),f||(c.start.column=0,c.end.column=g[g.length-1].length),this.selection.setRange(c)}},this.$reAlignText=function(e,t){var n,r,i,s=!0,o=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==n?(n=t[1].length,r=t[2].length,i=t[3].length,t):(n+r+i!=t[1].length+t[2].length+t[3].length&&(o=!1),n!=t[1].length&&(s=!1),n>t[1].length&&(n=t[1].length),rt[3].length&&(i=t[3].length),t):[e]}).map(t?u:s?o?function(e){return e[2]?a(n+r-e[2].length)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:u:function(e){return e[2]?a(n)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function a(e){return l.stringRepeat(" ",e)}function u(e){return e[2]?a(n)+e[2]+a(r-e[2].length+i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=p,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){p(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,s=e.getLine(t),o=s.search(i);if(-1!=o){for(var a=n||s.length,l=e.getLength(),u=t,c=t;++tu){var f=e.getLine(c).length;return new r(u,a,c,f)}}},this.openingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i+1},a=e.$findClosingBracket(t,o,s);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>o.row&&(a.row--,a.column=e.getLine(a.row).length),r.fromPoints(o,a)}},this.closingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i},a=e.$findOpeningBracket(t,o);if(a)return a.column++,o.column--,r.fromPoints(a,o)}}).call(i.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}e("./range").Range,function(){this.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(n&&e.action){for(var r=e.data,i=r.start.row,s=r.end.row,o="add"==e.action,a=i+1;a0&&!r[i];)i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=s;o++){var a=r[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var u=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(u-=t.scrollLeft),a.el.style.left=u+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}.call(i.prototype),t.LineWidgets=i}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,n){"use strict";var r=e("../line_widgets").LineWidgets,i=e("../lib/dom"),s=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var o=e.getCursorPosition(),a=o.row,l=n.widgetManager.getWidgetsAtRow(a).filter(function(e){return"errorMarker"==e.type})[0];l?l.destroy():a-=t;var u,c=function(e,t,n){var r=e.getAnnotations().sort(s.comparePoints);if(r.length){var i=function(e,t,n){for(var r=0,i=e.length-1;r<=i;){var s=r+i>>1,o=n(t,e[s]);if(o>0)r=s+1;else{if(!(o<0))return s;i=s-1}}return-(r+1)}(r,{row:t,column:-1},s.comparePoints);i<0&&(i=-i-1),i>=r.length?i=n>0?0:r.length-1:0===i&&n<0&&(i=r.length-1);var o=r[i];if(o&&n){if(o.row===t){do{o=r[i+=n]}while(o&&o.row===t);if(!o)return r.slice()}var a=[];t=o.row;do{a[n<0?"unshift":"push"](o),o=r[i+=n]}while(o&&o.row==t);return a.length&&a}}}(n,a,t);if(c){var h=c[0];o.column=(h.pos&&"number"!=typeof h.column?h.pos.sc:h.column)||0,o.row=h.row,u=e.renderer.$gutterLayer.$annotations[o.row]}else{if(l)return;u={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(o.row),e.selection.moveToPosition(o);var d={row:o.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},f=d.el.appendChild(i.createElement("div")),p=d.el.appendChild(i.createElement("div"));p.className="error_widget_arrow "+u.className;var m=e.renderer.$cursorLayer.getPixelPosition(o).left;p.style.left=m+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",f.className="error_widget "+u.className,f.innerHTML=u.text.join("
"),f.appendChild(i.createElement("div"));var g=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(g),n.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(g),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t,r){"use strict";e("./lib/fixoldbrowsers");var i=e("./lib/dom"),s=e("./lib/event"),o=e("./range").Range,a=e("./editor").Editor,l=e("./edit_session").EditSession,u=e("./undomanager").UndoManager,c=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,t.define=n.amdD,t.edit=function(e,n){if("string"==typeof e){var r=e;if(!(e=document.getElementById(r)))throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof a)return e.env.editor;var o="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;o=l.value,e=i.createElement("pre"),l.parentNode.replaceChild(e,l)}else e&&(o=e.textContent,e.innerHTML="");var u=t.createEditSession(o),h=new a(new c(e),u,n),d={document:u,editor:h,onResize:h.resize.bind(h,null)};return l&&(d.textarea=l),s.addListener(window,"resize",d.onResize),h.on("destroy",function(){s.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),h.container.env=h.env=d,h},t.createEditSession=function(e,t){var n=new l(e,t);return n.setUndoManager(new u),n},t.Range=o,t.Editor=a,t.EditSession=l,t.UndoManager=u,t.VirtualRenderer=c,t.version=t.config.version}),ace.require(["ace/ace"],function(t){for(var n in t&&(t.config.init(!0),t.define=ace.define),window.ace||(window.ace=t),t)t.hasOwnProperty(n)&&(window.ace[n]=t[n]);window.ace.default=window.ace,e&&(e.exports=window.ace)}),e.exports={ace}},247(e,t,n){"use strict";var r=n(982),i=n(159),s=n(961);function o(e){var t="https://react.dev/errors/"+e;if(1P||(e.current=M[P],M[P]=null,P--)}function $(e,t){P++,M[P]=e.current,e.current=t}var G,V,W=B(null),H=B(null),j=B(null),z=B(null);function X(e,t){switch($(j,t),$(H,e),$(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=Eh(t=gh(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(W),$(W,e)}function K(){U(W),U(H),U(j)}function Y(e){null!==e.memoizedState&&$(z,e);var t=W.current,n=Eh(t,e.type);t!==n&&($(H,e),$(W,n))}function q(e){H.current===e&&(U(W),U(H)),z.current===e&&(U(z),ud._currentValue=k)}function Q(e){if(void 0===G)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);G=t&&t[1]||"",V=-1)":-1--i||l[r]!==u[i]){var c="\n"+l[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}}while(1<=r&&0<=i);break}}}finally{Z=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Q(n):""}function ee(e,t){switch(e.tag){case 26:case 27:case 5:return Q(e.type);case 16:return Q("Lazy");case 13:return e.child!==t&&null!==t?Q("Suspense Fallback"):Q("Suspense");case 19:return Q("SuspenseList");case 0:case 15:return J(e.type,!1);case 11:return J(e.type.render,!1);case 1:return J(e.type,!0);case 31:return Q("Activity");default:return""}}function te(e){try{var t="",n=null;do{t+=ee(e,n),n=e,e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var ne=Object.prototype.hasOwnProperty,re=r.unstable_scheduleCallback,ie=r.unstable_cancelCallback,se=r.unstable_shouldYield,oe=r.unstable_requestPaint,ae=r.unstable_now,le=r.unstable_getCurrentPriorityLevel,ue=r.unstable_ImmediatePriority,ce=r.unstable_UserBlockingPriority,he=r.unstable_NormalPriority,de=r.unstable_LowPriority,fe=r.unstable_IdlePriority,pe=r.log,me=r.unstable_setDisableYieldValue,ge=null,Ee=null;function ve(e){if("function"==typeof pe&&me(e),Ee&&"function"==typeof Ee.setStrictMode)try{Ee.setStrictMode(ge,e)}catch(e){}}var Ce=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(De(e)/Se|0)|0},De=Math.log,Se=Math.LN2,Ae=256,_e=262144,ye=4194304;function be(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Te(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var i=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var a=134217727&r;return 0!==a?0!==(r=a&~s)?i=be(r):0!==(o&=a)?i=be(o):n||0!==(n=a&~e)&&(i=be(n)):0!==(a=r&~s)?i=be(a):0!==o?i=be(o):n||0!==(n=r&~e)&&(i=be(n)),0===i?0:0!==t&&t!==i&&0===(t&s)&&((s=i&-i)>=(n=t&-t)||32===s&&4194048&n)?t:i}function Re(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function we(){var e=ye;return!(62914560&(ye<<=1))&&(ye=4194304),e}function Fe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ne(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Le(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ce(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function Oe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ce(n),i=1<=bn),xn=String.fromCharCode(32),wn=!1;function Fn(e,t){switch(e){case"keyup":return-1!==_n.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Ln=!1,On={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function In(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!On[e.type]:"textarea"===t}function kn(e,t,n,r){It?kt?kt.push(r):kt=[r]:It=r,0<(t=nh(t,"onChange")).length&&(n=new tn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Mn=null,Pn=null;function Bn(e){Kc(e,0)}function Un(e){if(ft(Qe(e)))return e}function $n(e,t){if("change"===e)return t}var Gn=!1;if($t){var Vn;if($t){var Wn="oninput"in document;if(!Wn){var Hn=document.createElement("div");Hn.setAttribute("oninput","return;"),Wn="function"==typeof Hn.oninput}Vn=Wn}else Vn=!1;Gn=Vn&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Jn(r)}}function tr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?tr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function nr(e){for(var t=pt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=pt((e=t.contentWindow).document)}return t}function rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var ir=$t&&"documentMode"in document&&11>=document.documentMode,sr=null,or=null,ar=null,lr=!1;function ur(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;lr||null==sr||sr!==pt(r)||(r="selectionStart"in(r=sr)&&rr(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},ar&&Zn(ar,r)||(ar=r,0<(r=nh(or,"onSelect")).length&&(t=new tn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=sr)))}function cr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var hr={animationend:cr("Animation","AnimationEnd"),animationiteration:cr("Animation","AnimationIteration"),animationstart:cr("Animation","AnimationStart"),transitionrun:cr("Transition","TransitionRun"),transitionstart:cr("Transition","TransitionStart"),transitioncancel:cr("Transition","TransitionCancel"),transitionend:cr("Transition","TransitionEnd")},dr={},fr={};function pr(e){if(dr[e])return dr[e];if(!hr[e])return e;var t,n=hr[e];for(t in n)if(n.hasOwnProperty(t)&&t in fr)return dr[e]=n[t];return e}$t&&(fr=document.createElement("div").style,"AnimationEvent"in window||(delete hr.animationend.animation,delete hr.animationiteration.animation,delete hr.animationstart.animation),"TransitionEvent"in window||delete hr.transitionend.transition);var mr=pr("animationend"),gr=pr("animationiteration"),Er=pr("animationstart"),vr=pr("transitionrun"),Cr=pr("transitionstart"),Dr=pr("transitioncancel"),Sr=pr("transitionend"),Ar=new Map,_r="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function yr(e,t){Ar.set(e,t),nt(t,[e])}_r.push("scrollEnd");var br="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Tr=[],Rr=0,xr=0;function wr(){for(var e=Rr,t=xr=Rr=0;t>=o,i-=o,ti=1<<32-Ce(t)+i|n<p?(m=h,h=null):m=h.sibling;var g=f(i,h,a[p],l);if(null===g){null===h&&(h=m);break}e&&h&&null===g.alternate&&t(i,h),o=s(g,o,p),null===c?u=g:c.sibling=g,c=g,h=m}if(p===a.length)return n(i,h),ci&&ri(i,p),u;if(null===h){for(;pm?(g=p,p=null):g=p.sibling;var C=f(i,p,v.value,u);if(null===C){null===p&&(p=g);break}e&&p&&null===C.alternate&&t(i,p),a=s(C,a,m),null===h?c=C:h.sibling=C,h=C,p=g}if(v.done)return n(i,p),ci&&ri(i,m),c;if(null===p){for(;!v.done;m++,v=l.next())null!==(v=d(i,v.value,u))&&(a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return ci&&ri(i,m),c}for(p=r(p);!v.done;m++,v=l.next())null!==(v=E(p,i,m,v.value,u))&&(e&&null!==v.alternate&&p.delete(null===v.key?m:v.key),a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return e&&p.forEach(function(e){return t(i,e)}),ci&&ri(i,m),c}(l,u,c=C.call(c),h)}if("function"==typeof c.then)return v(l,u,ls(c),h);if(c.$$typeof===D)return v(l,u,Li(l,c),h);cs(l,c)}return"string"==typeof c&&""!==c||"number"==typeof c||"bigint"==typeof c?(c=""+c,null!==u&&6===u.tag?(n(l,u.sibling),(h=i(u,c)).return=l,l=h):(n(l,u),(h=Wr(c,l.mode,h)).return=l,l=h),a(l)):n(l,u)}return function(e,t,n,r){try{as=0;var i=v(e,t,n,r);return os=null,i}catch(t){if(t===qi||t===Zi)throw t;var s=Pr(29,t,null,e.mode);return s.lanes=r,s.return=e,s}}}var ds=hs(!0),fs=hs(!1),ps=!1;function ms(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Es(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vs(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&du){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ir(e),Or(e,null,n),t}return Fr(e,r,t,n),Ir(e)}function Cs(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Oe(e,n)}}function Ds(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===s?i=s=o:s=s.next=o,n=n.next}while(null!==n);null===s?i=s=t:s=s.next=t}else i=s=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ss=!1;function As(){if(Ss&&null!==Wi)throw Wi}function _s(e,t,n,r){Ss=!1;var i=e.updateQueue;ps=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var l=a,u=l.next;l.next=null,null===o?s=u:o.next=u,o=l;var c=e.alternate;null!==c&&(a=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===a?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l)}if(null!==s){var h=i.baseState;for(o=0,c=u=l=null,a=s;;){var f=-536870913&a.lane,p=f!==a.lane;if(p?(mu&f)===f:(r&f)===f){0!==f&&f===Vi&&(Ss=!0),null!==c&&(c=c.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var m=e,g=a;f=t;var E=n;switch(g.tag){case 1:if("function"==typeof(m=g.payload)){h=m.call(E,h,f);break e}h=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(f="function"==typeof(m=g.payload)?m.call(E,h,f):m))break e;h=d({},h,f);break e;case 2:ps=!0}}null!==(f=a.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=i.callbacks)?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===c?(u=c=p,l=h):c=c.next=p,o|=f;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(p=a).next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}null===c&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null===s&&(i.shared.lanes=0),_u|=o,e.lanes=o,e.memoizedState=h}}function ys(e,t){if("function"!=typeof e)throw Error(o(191,e));e.call(t)}function bs(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;es?s:8;var o,a,l,u=O.T,c={};O.T=c,ca(e,!1,t,n);try{var h=i(),d=O.S;null!==d&&d(c,h),null!==h&&"object"==typeof h&&"function"==typeof h.then?ua(e,t,(o=r,a=[],l={status:"pending",value:null,reason:null,then:function(e){a.push(e)}},h.then(function(){l.status="fulfilled",l.value=o;for(var e=0;e<\/script>",s=s.removeChild(s.firstChild);break;case"select":s="string"==typeof r.is?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s="string"==typeof r.is?a.createElement(i,{is:r.is}):a.createElement(i)}}s[$e]=t,s[Ge]=r;e:for(a=t.child;null!==a;){if(5===a.tag||6===a.tag)s.appendChild(a.stateNode);else if(4!==a.tag&&27!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;null===a.sibling;){if(null===a.return||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=s;e:switch(hh(s,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&ol(t)}}return hl(t),al(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&ol(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));if(e=j.current,Ei(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(i=li))switch(i.tag){case 27:case 5:r=i.memoizedProps}e[$e]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||lh(e.nodeValue,n)))||pi(t,!0)}else(e=mh(e).createTextNode(r))[$e]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(r=Ei(t),null!==n){if(null===e){if(!r)throw Error(o(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(o(557));e[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Ps(t),t):(Ps(t),null);if(128&t.flags)throw Error(o(558))}return hl(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=Ei(t),null!==r&&null!==r.dehydrated){if(null===e){if(!i)throw Error(o(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(o(317));i[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),i=!1}else i=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return 256&t.flags?(Ps(t),t):(Ps(t),null)}return Ps(t),128&t.flags?(t.lanes=n,t):(n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(i=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(i=r.alternate.memoizedState.cachePool.pool),s=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(s=r.memoizedState.cachePool.pool),s!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ul(t,t.updateQueue),hl(t),null);case 4:return K(),null===e&&Zc(t.stateNode.containerInfo),hl(t),null;case 10:return bi(t.type),hl(t),null;case 19:if(U(Bs),null===(r=t.memoizedState))return hl(t),null;if(i=!!(128&t.flags),null===(s=r.rendering))if(i)cl(r,!1);else{if(0!==Au||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(s=Us(e))){for(t.flags|=128,cl(r,!1),e=s.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)$r(n,e),n=n.sibling;return $(Bs,1&Bs.current|2),ci&&ri(t,r.treeForkCount),t.child}e=e.sibling}null!==r.tail&&ae()>Ou&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=Us(s))){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),cl(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!ci)return hl(t),null}else 2*ae()-r.renderingStartTime>Ou&&536870912!==n&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=r.last)?e.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ae(),e.sibling=null,n=Bs.current,$(Bs,i?1&n|2:1&n),ci&&ri(t,r.treeForkCount),e):(hl(t),null);case 22:case 23:return Ps(t),Fs(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?!!(536870912&n)&&!(128&t.flags)&&(hl(t),6&t.subtreeFlags&&(t.flags|=8192)):hl(t),null!==(n=t.updateQueue)&&ul(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&U(zi),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),bi(Pi),hl(t),null;case 25:case 30:return null}throw Error(o(156,t.tag))}function fl(e,t){switch(oi(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return bi(Pi),K(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return q(t),null;case 31:if(null!==t.memoizedState){if(Ps(t),null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Ps(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return U(Bs),null;case 4:return K(),null;case 10:return bi(t.type),null;case 22:case 23:return Ps(t),Fs(),null!==e&&U(zi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return bi(Pi),null;default:return null}}function pl(e,t){switch(oi(t),t.tag){case 3:bi(Pi),K();break;case 26:case 27:case 5:q(t);break;case 4:K();break;case 31:null!==t.memoizedState&&Ps(t);break;case 13:Ps(t);break;case 19:U(Bs);break;case 10:bi(t.type);break;case 22:case 23:Ps(t),Fs(),null!==e&&U(zi);break;case 24:bi(Pi)}}function ml(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var s=n.create,o=n.inst;r=s(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ac(t,t.return,e)}}function gl(e,t,n){try{var r=t.updateQueue,i=null!==r?r.lastEffect:null;if(null!==i){var s=i.next;r=s;do{if((r.tag&e)===e){var o=r.inst,a=o.destroy;if(void 0!==a){o.destroy=void 0,i=t;var l=n,u=a;try{u()}catch(e){Ac(i,l,e)}}}r=r.next}while(r!==s)}}catch(e){Ac(t,t.return,e)}}function El(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{bs(t,n)}catch(t){Ac(e,e.return,t)}}}function vl(e,t,n){n.props=Aa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ac(e,t,n)}}function Cl(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(n){Ac(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(n){Ac(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){Ac(e,t,n)}else n.current=null}function Sl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ac(e,e.return,t)}}function Al(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,a=null,l=null,u=null,c=null,h=null;for(p in n){var d=n[p];if(n.hasOwnProperty(p)&&null!=d)switch(p){case"checked":case"value":break;case"defaultValue":u=d;default:r.hasOwnProperty(p)||uh(e,t,p,null,r,d)}}for(var f in r){var p=r[f];if(d=n[f],r.hasOwnProperty(f)&&(null!=p||null!=d))switch(f){case"type":s=p;break;case"name":i=p;break;case"checked":c=p;break;case"defaultChecked":h=p;break;case"value":a=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(o(137,t));break;default:p!==d&&uh(e,t,f,p,r,d)}}return void Et(e,a,l,u,c,h,s,i);case"select":for(s in p=a=l=f=null,n)if(u=n[s],n.hasOwnProperty(s)&&null!=u)switch(s){case"value":break;case"multiple":p=u;default:r.hasOwnProperty(s)||uh(e,t,s,null,r,u)}for(i in r)if(s=r[i],u=n[i],r.hasOwnProperty(i)&&(null!=s||null!=u))switch(i){case"value":f=s;break;case"defaultValue":l=s;break;case"multiple":a=s;default:s!==u&&uh(e,t,i,s,r,u)}return t=l,n=a,r=p,void(null!=f?Dt(e,!!n,f,!1):!!r!=!!n&&(null!=t?Dt(e,!!n,t,!0):Dt(e,!!n,n?[]:"",!1)));case"textarea":for(l in p=f=null,n)if(i=n[l],n.hasOwnProperty(l)&&null!=i&&!r.hasOwnProperty(l))switch(l){case"value":case"children":break;default:uh(e,t,l,null,r,i)}for(a in r)if(i=r[a],s=n[a],r.hasOwnProperty(a)&&(null!=i||null!=s))switch(a){case"value":f=i;break;case"defaultValue":p=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(o(91));break;default:i!==s&&uh(e,t,a,i,r,s)}return void St(e,f,p);case"option":for(var m in n)f=n[m],n.hasOwnProperty(m)&&null!=f&&!r.hasOwnProperty(m)&&("selected"===m?e.selected=!1:uh(e,t,m,null,r,f));for(u in r)f=r[u],p=n[u],!r.hasOwnProperty(u)||f===p||null==f&&null==p||("selected"===u?e.selected=f&&"function"!=typeof f&&"symbol"!=typeof f:uh(e,t,u,f,r,p));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)f=n[g],n.hasOwnProperty(g)&&null!=f&&!r.hasOwnProperty(g)&&uh(e,t,g,null,r,f);for(c in r)if(f=r[c],p=n[c],r.hasOwnProperty(c)&&f!==p&&(null!=f||null!=p))switch(c){case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(o(137,t));break;default:uh(e,t,c,f,r,p)}return;default:if(Rt(t)){for(var E in n)f=n[E],n.hasOwnProperty(E)&&void 0!==f&&!r.hasOwnProperty(E)&&ch(e,t,E,void 0,r,f);for(h in r)f=r[h],p=n[h],!r.hasOwnProperty(h)||f===p||void 0===f&&void 0===p||ch(e,t,h,f,r,p);return}}for(var v in n)f=n[v],n.hasOwnProperty(v)&&null!=f&&!r.hasOwnProperty(v)&&uh(e,t,v,null,r,f);for(d in r)f=r[d],p=n[d],!r.hasOwnProperty(d)||f===p||null==f&&null==p||uh(e,t,d,f,r,p)}(r,e.type,n,t),r[Ge]=t}catch(t){Ac(e,e.return,t)}}function _l(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&bh(e.type)||4===e.tag}function yl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||_l(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&bh(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function bl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Nt));else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(bl(e,t,n),e=e.sibling;null!==e;)bl(e,t,n),e=e.sibling}function Tl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Tl(e,t,n),e=e.sibling;null!==e;)Tl(e,t,n),e=e.sibling}function Rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);hh(t,r,n),t[$e]=e,t[Ge]=n}catch(t){Ac(e,e.return,t)}}var xl=!1,wl=!1,Fl=!1,Nl="function"==typeof WeakSet?WeakSet:Set,Ll=null;function Ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Xl(e,n),4&r&&ml(5,n);break;case 1:if(Xl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){Ac(n,n.return,e)}else{var i=Aa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ac(n,n.return,e)}}64&r&&El(n),512&r&&Cl(n,n.return);break;case 3:if(Xl(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{bs(e,t)}catch(e){Ac(n,n.return,e)}}break;case 27:null===t&&4&r&&Rl(n);case 26:case 5:Xl(e,n),null===t&&4&r&&Sl(n),512&r&&Cl(n,n.return);break;case 12:Xl(e,n);break;case 31:Xl(e,n),4&r&&Ul(e,n);break;case 13:Xl(e,n),4&r&&$l(e,n),64&r&&null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Tc.bind(null,n));break;case 22:if(!(r=null!==n.memoizedState||xl)){t=null!==t&&null!==t.memoizedState||wl,i=xl;var s=wl;xl=r,(wl=t)&&!s?Yl(e,n,!!(8772&n.subtreeFlags)):Xl(e,n),xl=i,wl=s}break;case 30:break;default:Xl(e,n)}}function Il(e){var t=e.alternate;null!==t&&(e.alternate=null,Il(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&Ke(t),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var kl=null,Ml=!1;function Pl(e,t,n){for(n=n.child;null!==n;)Bl(e,t,n),n=n.sibling}function Bl(e,t,n){if(Ee&&"function"==typeof Ee.onCommitFiberUnmount)try{Ee.onCommitFiberUnmount(ge,n)}catch(e){}switch(n.tag){case 26:wl||Dl(n,t),Pl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:wl||Dl(n,t);var r=kl,i=Ml;bh(n.type)&&(kl=n.stateNode,Ml=!1),Pl(e,t,n),Ph(n.stateNode),kl=r,Ml=i;break;case 5:wl||Dl(n,t);case 6:if(r=kl,i=Ml,kl=null,Pl(e,t,n),Ml=i,null!==(kl=r))if(Ml)try{(9===kl.nodeType?kl.body:"HTML"===kl.nodeName?kl.ownerDocument.body:kl).removeChild(n.stateNode)}catch(e){Ac(n,t,e)}else try{kl.removeChild(n.stateNode)}catch(e){Ac(n,t,e)}break;case 18:null!==kl&&(Ml?(Th(9===(e=kl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Gd(e)):Th(kl,n.stateNode));break;case 4:r=kl,i=Ml,kl=n.stateNode.containerInfo,Ml=!0,Pl(e,t,n),kl=r,Ml=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),wl||gl(4,n,t),Pl(e,t,n);break;case 1:wl||(Dl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&vl(n,t,r)),Pl(e,t,n);break;case 21:Pl(e,t,n);break;case 22:wl=(r=wl)||null!==n.memoizedState,Pl(e,t,n),wl=r;break;default:Pl(e,t,n)}}function Ul(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)){e=e.dehydrated;try{Gd(e)}catch(e){Ac(t,t.return,e)}}}function $l(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{Gd(e)}catch(e){Ac(t,t.return,e)}}function Gl(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Nl),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Nl),t;default:throw Error(o(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Rc.bind(null,e,t);t.then(r,r)}})}function Vl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r title"))),hh(s,r,n),s[$e]=e,Je(s),r=s;break e;case"link":var a=td("link","href",i).get(r+(n.href||""));if(a)for(var l=0;la)break;var c=l.transferSize,h=l.initiatorType;c&&dh(h)&&(o+=c*((l=l.responseEnd)id?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}(h,p)))return Uu=s,e.cancelPendingCommit=p(pc.bind(null,e,t,s,n,r,i,o,a,l,c,h,null,d,f)),void Qu(e,s,o,!u)}pc(e,t,s,n,r,i,o,a,l)}function qu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var r=0;rg&&(o=g,g=m,m=o);var E=er(a,m),v=er(a,g);if(E&&v&&(1!==f.rangeCount||f.anchorNode!==E.node||f.anchorOffset!==E.offset||f.focusNode!==v.node||f.focusOffset!==v.offset)){var C=h.createRange();C.setStart(E.node,E.offset),f.removeAllRanges(),m>g?(f.addRange(C),f.extend(v.node,v.offset)):(C.setEnd(v.node,v.offset),f.addRange(C))}}}}for(h=[],f=a;f=f.parentNode;)1===f.nodeType&&h.push({element:f,left:f.scrollLeft,top:f.scrollTop});for("function"==typeof a.focus&&a.focus(),a=0;an?32:n,O.T=null,n=Gu,Gu=null;var s=Pu,a=Uu;if(Mu=0,Bu=Pu=null,Uu=0,6&du)throw Error(o(331));var l=du;if(du|=4,au(s.current),Jl(s,s.current,a,n),du=l,kc(0,!1),Ee&&"function"==typeof Ee.onPostCommitFiberRoot)try{Ee.onPostCommitFiberRoot(ge,s)}catch(e){}return!0}finally{I.p=i,O.T=r,vc(e,t)}}function Sc(e,t,n){t=Xr(n,t),null!==(e=vs(e,t=xa(e.stateNode,t,2),2))&&(Ne(e,2),Ic(e))}function Ac(e,t,n){if(3===e.tag)Sc(e,e,n);else for(;null!==t;){if(3===t.tag){Sc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===ku||!ku.has(r))){e=Xr(n,e),null!==(r=vs(t,n=wa(2),2))&&(Fa(n,r,t,e),Ne(r,2),Ic(r));break}}t=t.return}}function _c(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hu;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(Du=!0,i.add(n),e=yc.bind(null,e,t,n),t.then(e,e))}function yc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,fu===e&&(mu&n)===n&&(4===Au||3===Au&&(62914560&mu)===mu&&300>ae()-Nu?!(2&du)&&ec(e,0):bu|=n,Ru===mu&&(Ru=0)),Ic(e)}function bc(e,t){0===t&&(t=we()),null!==(e=Lr(e,t))&&(Ne(e,t),Ic(e))}function Tc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),bc(e,n)}function Rc(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}null!==r&&r.delete(t),bc(e,n)}var xc=null,wc=null,Fc=!1,Nc=!1,Lc=!1,Oc=0;function Ic(e){e!==wc&&null===e.next&&(null===wc?xc=wc=e:wc=wc.next=e),Nc=!0,Fc||(Fc=!0,_h(function(){6&du?re(ue,Mc):Pc()}))}function kc(e,t){if(!Lc&&Nc){Lc=!0;do{for(var n=!1,r=xc;null!==r;){if(!t)if(0!==e){var i=r.pendingLanes;if(0===i)var s=0;else{var o=r.suspendedLanes,a=r.pingedLanes;s=(1<<31-Ce(42|e)+1)-1,s=201326741&(s&=i&~(o&~a))?201326741&s|1:s?2|s:0}0!==s&&(n=!0,$c(r,s))}else s=mu,!(3&(s=Te(r,r===fu?s:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Re(r,s)||(n=!0,$c(r,s));r=r.next}}while(n);Lc=!1}}function Mc(){Pc()}function Pc(){Nc=Fc=!1;var e,t=0;0!==Oc&&((e=window.event)&&"popstate"===e.type?e!==Ch&&(Ch=e,1):(Ch=null,0))&&(t=Oc);for(var n=ae(),r=null,i=xc;null!==i;){var s=i.next,o=Bc(i,n);0===o?(i.next=null,null===r?xc=s:r.next=s,null===s&&(wc=r)):(r=i,(0!==t||3&o)&&(Nc=!0)),i=s}0!==Mu&&5!==Mu||kc(t,!1),0!==Oc&&(Oc=0)}function Bc(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=-62914561&e.pendingLanes;0 title"):null)}function rd(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var id=0;function sd(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)ad(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var od=null;function ad(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,od=new Map,t.forEach(ld,e),od=null,sd.call(e))}function ld(e,t){if(!(4&t.state.loading)){var n=od.get(e);if(n)var r=n.get(null);else{n=new Map,od.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s>>1,i=e[r];if(!(0>>1;rs(l,n))us(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[a]=n,r=a);else{if(!(us(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var u=[],c=[],h=1,d=null,f=3,p=!1,m=!1,g=!1,E=!1,v="function"==typeof setTimeout?setTimeout:null,C="function"==typeof clearTimeout?clearTimeout:null,D="undefined"!=typeof setImmediate?setImmediate:null;function S(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function A(e){if(g=!1,S(e),!m)if(null!==r(u))m=!0,y||(y=!0,_());else{var t=r(c);null!==t&&L(A,t.startTime-e)}}var _,y=!1,b=-1,T=5,R=-1;function x(){return!(!E&&t.unstable_now()-Re&&x());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var a=o(d.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof a){d.callback=a,S(e),n=!0;break t}d===r(u)&&i(u),S(e)}else i(u);d=r(u)}if(null!==d)n=!0;else{var l=r(c);null!==l&&L(A,l.startTime-e),n=!1}}break e}finally{d=null,f=s,p=!1}n=void 0}}finally{n?_():y=!1}}}if("function"==typeof D)_=function(){D(w)};else if("undefined"!=typeof MessageChannel){var F=new MessageChannel,N=F.port2;F.port1.onmessage=w,_=function(){N.postMessage(null)}}else _=function(){v(w,0)};function L(e,n){b=v(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125o?(e.sortIndex=s,n(c,e),null===r(u)&&e===r(c)&&(g?(C(b),b=-1):g=!0,L(A,s-o))):(e.sortIndex=a,n(u,e),m||p||(m=!0,y||(y=!0,_()))),e},t.unstable_shouldYield=x,t.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}},982(e,t,n){"use strict";e.exports=n(477)},902(e,t,n){"use strict";var r=n(72),i=n.n(r),s=n(825),o=n.n(s),a=n(659),l=n.n(a),u=n(56),c=n.n(u),h=n(540),d=n.n(h),f=n(113),p=n.n(f),m=n(636),g={};g.styleTagTransform=p(),g.setAttributes=c(),g.insert=l().bind(null,"html"),g.domAPI=o(),g.insertStyleElement=d(),i()(m.A,g),m.A&&m.A.locals&&m.A.locals},72(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},878(e,t,n){"use strict";n.r(t),n.d(t,{EmbeddedFrontend:()=>Id,Spector:()=>kd});var r={};n.r(r),n.d(r,{LX:()=>Jo,ll:()=>ea});var i,s={};n.r(s),n.d(s,{SyntaxError:()=>Xc,parse:()=>Yc});class o{static isBuildableProgram(e){return!!e&&!!e[this.rebuildProgramFunctionName]}static rebuildProgram(e,t,n,r,i){this.isBuildableProgram(e)&&e[this.rebuildProgramFunctionName](t,n,r,i)}}o.rebuildProgramFunctionName="__SPECTOR_rebuildProgram",function(e){e[e.noLog=0]="noLog",e[e.error=1]="error",e[e.warning=2]="warning",e[e.info=3]="info"}(i||(i={}));class a{static error(e,...t){this.level>0&&console.error(e,t)}static warn(e,...t){this.level>1&&console.warn(e,t)}static info(e,...t){this.level>2&&console.log(e,t)}}a.level=i.warning;class l{constructor(){this.callbacks=[],this.counter=-1}add(e,t){return this.counter++,t&&(e=e.bind(t)),this.callbacks[this.counter]=e,this.counter}remove(e){delete this.callbacks[e]}clear(){this.callbacks={}}trigger(e){for(const t in this.callbacks)this.callbacks.hasOwnProperty(t)&&this.callbacks[t](e)}}class u{constructor(){if("undefined"!=typeof performance&&performance.now)this.nowFunction=()=>performance.now();else{const e=new Date;this.nowFunction=e.getTime.bind(e)}}static get now(){return u.instance.nowFunction()}}u.instance=new u;class c{constructor(e){this.options=e}appendAnalysis(e){e.analyses=e.analyses||[];const t=this.getAnalysis(e);e.analyses.push(t)}getAnalysis(e){const t={analyserName:this.analyserName};return this.appendToAnalysis(e,t),t}}class h extends c{get analyserName(){return h.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={};for(const t of e.commands)n[t.name]=n[t.name]||0,n[t.name]++;const r=Object.keys(n).map(e=>[e,n[e]]);r.sort((e,t)=>{const n=t[1]-e[1];return 0===n?e[0].localeCompare(t[0]):n});for(const e of r)t[e[0]]=e[1]}}h.analyserName="Commands";const d=["drawArrays","drawElements","drawArraysInstanced","drawArraysInstancedANGLE","drawElementsInstanced","drawElementsInstancedANGLE","drawRangeElements","multiDrawArraysWEBGL","multiDrawElementsWEBGL","multiDrawArraysInstancedWEBGL","multiDrawElementsInstancedWEBGL","multiDrawArraysInstancedBaseInstanceWEBGL","multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL","drawArraysInstancedBaseInstanceWEBGL","drawElementsInstancedBaseVertexBaseInstanceWEBGL"];class f extends c{get analyserName(){return f.analyserName}appendToAnalysis(e,t){if(e.commands){t.total=e.commands.length,t.draw=0,t.clear=0;for(const n of e.commands)"clear"===n.name?t.clear++:d.indexOf(n.name)>-1&&t.draw++}}}f.analyserName="CommandsSummary";class p{static isWebGlConstant(e){return null!==g[e]&&void 0!==g[e]}static stringifyWebGlConstant(e,t){if(null==e)return"";if(0===e){return this.zeroMeaningByCommand[t]||"0"}if(1===e){return this.oneMeaningByCommand[t]||"1"}const n=g[e];return n?n.name:e+""}}p.DEPTH_BUFFER_BIT={name:"DEPTH_BUFFER_BIT",value:256,description:"Passed to clear to clear the current depth buffer."},p.STENCIL_BUFFER_BIT={name:"STENCIL_BUFFER_BIT",value:1024,description:"Passed to clear to clear the current stencil buffer."},p.COLOR_BUFFER_BIT={name:"COLOR_BUFFER_BIT",value:16384,description:"Passed to clear to clear the current color buffer."},p.POINTS={name:"POINTS",value:0,description:"Passed to drawElements or drawArrays to draw single points."},p.LINES={name:"LINES",value:1,description:"Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it."},p.LINE_LOOP={name:"LINE_LOOP",value:2,description:"Passed to drawElements or drawArrays to draw lines. Each set of two vertices is treated as a separate line segment."},p.LINE_STRIP={name:"LINE_STRIP",value:3,description:"Passed to drawElements or drawArrays to draw a connected group of line segments from the first vertex to the last."},p.TRIANGLES={name:"TRIANGLES",value:4,description:"Passed to drawElements or drawArrays to draw triangles. Each set of three vertices creates a separate triangle."},p.TRIANGLE_STRIP={name:"TRIANGLE_STRIP",value:5,description:"Passed to drawElements or drawArrays to draw a connected group of triangles."},p.TRIANGLE_FAN={name:"TRIANGLE_FAN",value:6,description:"Passed to drawElements or drawArrays to draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan."},p.ZERO={name:"ZERO",value:0,description:"Passed to blendFunc or blendFuncSeparate to turn off a component."},p.ONE={name:"ONE",value:1,description:"Passed to blendFunc or blendFuncSeparate to turn on a component."},p.SRC_COLOR={name:"SRC_COLOR",value:768,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source elements color."},p.ONE_MINUS_SRC_COLOR={name:"ONE_MINUS_SRC_COLOR",value:769,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source elements color."},p.SRC_ALPHA={name:"SRC_ALPHA",value:770,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source's alpha."},p.ONE_MINUS_SRC_ALPHA={name:"ONE_MINUS_SRC_ALPHA",value:771,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source's alpha."},p.DST_ALPHA={name:"DST_ALPHA",value:772,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's alpha."},p.ONE_MINUS_DST_ALPHA={name:"ONE_MINUS_DST_ALPHA",value:773,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's alpha."},p.DST_COLOR={name:"DST_COLOR",value:774,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's color."},p.ONE_MINUS_DST_COLOR={name:"ONE_MINUS_DST_COLOR",value:775,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's color."},p.SRC_ALPHA_SATURATE={name:"SRC_ALPHA_SATURATE",value:776,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the minimum of source's alpha or one minus the destination's alpha."},p.CONSTANT_COLOR={name:"CONSTANT_COLOR",value:32769,description:"Passed to blendFunc or blendFuncSeparate to specify a constant color blend function."},p.ONE_MINUS_CONSTANT_COLOR={name:"ONE_MINUS_CONSTANT_COLOR",value:32770,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant color blend function."},p.CONSTANT_ALPHA={name:"CONSTANT_ALPHA",value:32771,description:"Passed to blendFunc or blendFuncSeparate to specify a constant alpha blend function."},p.ONE_MINUS_CONSTANT_ALPHA={name:"ONE_MINUS_CONSTANT_ALPHA",value:32772,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant alpha blend function."},p.FUNC_ADD={name:"FUNC_ADD",value:32774,description:"Passed to blendEquation or blendEquationSeparate to set an addition blend function."},p.FUNC_SUBSTRACT={name:"FUNC_SUBSTRACT",value:32778,description:"Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination)."},p.FUNC_REVERSE_SUBTRACT={name:"FUNC_REVERSE_SUBTRACT",value:32779,description:"Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source)."},p.BLEND_EQUATION={name:"BLEND_EQUATION",value:32777,description:"Passed to getParameter to get the current RGB blend function."},p.BLEND_EQUATION_RGB={name:"BLEND_EQUATION_RGB",value:32777,description:"Passed to getParameter to get the current RGB blend function. Same as BLEND_EQUATION"},p.BLEND_EQUATION_ALPHA={name:"BLEND_EQUATION_ALPHA",value:34877,description:"Passed to getParameter to get the current alpha blend function. Same as BLEND_EQUATION"},p.BLEND_DST_RGB={name:"BLEND_DST_RGB",value:32968,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_SRC_RGB={name:"BLEND_SRC_RGB",value:32969,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_DST_ALPHA={name:"BLEND_DST_ALPHA",value:32970,description:"Passed to getParameter to get the current destination alpha blend function."},p.BLEND_SRC_ALPHA={name:"BLEND_SRC_ALPHA",value:32971,description:"Passed to getParameter to get the current source alpha blend function."},p.BLEND_COLOR={name:"BLEND_COLOR",value:32773,description:"Passed to getParameter to return a the current blend color."},p.ARRAY_BUFFER_BINDING={name:"ARRAY_BUFFER_BINDING",value:34964,description:"Passed to getParameter to get the array buffer binding."},p.ELEMENT_ARRAY_BUFFER_BINDING={name:"ELEMENT_ARRAY_BUFFER_BINDING",value:34965,description:"Passed to getParameter to get the current element array buffer."},p.LINE_WIDTH={name:"LINE_WIDTH",value:2849,description:"Passed to getParameter to get the current lineWidth (set by the lineWidth method)."},p.ALIASED_POINT_SIZE_RANGE={name:"ALIASED_POINT_SIZE_RANGE",value:33901,description:"Passed to getParameter to get the current size of a point drawn with gl.POINTS"},p.ALIASED_LINE_WIDTH_RANGE={name:"ALIASED_LINE_WIDTH_RANGE",value:33902,description:"Passed to getParameter to get the range of available widths for a line. Returns a length-2 array with the lo value at 0, and hight at 1."},p.CULL_FACE_MODE={name:"CULL_FACE_MODE",value:2885,description:"Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK"},p.FRONT_FACE={name:"FRONT_FACE",value:2886,description:"Passed to getParameter to determine the current value of frontFace. Should return CW or CCW."},p.DEPTH_RANGE={name:"DEPTH_RANGE",value:2928,description:"Passed to getParameter to return a length-2 array of floats giving the current depth range."},p.DEPTH_WRITEMASK={name:"DEPTH_WRITEMASK",value:2930,description:"Passed to getParameter to determine if the depth write mask is enabled."},p.DEPTH_CLEAR_VALUE={name:"DEPTH_CLEAR_VALUE",value:2931,description:"Passed to getParameter to determine the current depth clear value."},p.DEPTH_FUNC={name:"DEPTH_FUNC",value:2932,description:"Passed to getParameter to get the current depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_CLEAR_VALUE={name:"STENCIL_CLEAR_VALUE",value:2961,description:"Passed to getParameter to get the value the stencil will be cleared to."},p.STENCIL_FUNC={name:"STENCIL_FUNC",value:2962,description:"Passed to getParameter to get the current stencil function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_FAIL={name:"STENCIL_FAIL",value:2964,description:"Passed to getParameter to get the current stencil fail function. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_FAIL={name:"STENCIL_PASS_DEPTH_FAIL",value:2965,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test fail. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_PASS={name:"STENCIL_PASS_DEPTH_PASS",value:2966,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test pass. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_REF={name:"STENCIL_REF",value:2967,description:"Passed to getParameter to get the reference value used for stencil tests."},p.STENCIL_VALUE_MASK={name:"STENCIL_VALUE_MASK",value:2963,description:" "},p.STENCIL_WRITEMASK={name:"STENCIL_WRITEMASK",value:2968,description:" "},p.STENCIL_BACK_FUNC={name:"STENCIL_BACK_FUNC",value:34816,description:" "},p.STENCIL_BACK_FAIL={name:"STENCIL_BACK_FAIL",value:34817,description:" "},p.STENCIL_BACK_PASS_DEPTH_FAIL={name:"STENCIL_BACK_PASS_DEPTH_FAIL",value:34818,description:" "},p.STENCIL_BACK_PASS_DEPTH_PASS={name:"STENCIL_BACK_PASS_DEPTH_PASS",value:34819,description:" "},p.STENCIL_BACK_REF={name:"STENCIL_BACK_REF",value:36003,description:" "},p.STENCIL_BACK_VALUE_MASK={name:"STENCIL_BACK_VALUE_MASK",value:36004,description:" "},p.STENCIL_BACK_WRITEMASK={name:"STENCIL_BACK_WRITEMASK",value:36005,description:" "},p.VIEWPORT={name:"VIEWPORT",value:2978,description:"Returns an Int32Array with four elements for the current viewport dimensions."},p.SCISSOR_BOX={name:"SCISSOR_BOX",value:3088,description:"Returns an Int32Array with four elements for the current scissor box dimensions."},p.COLOR_CLEAR_VALUE={name:"COLOR_CLEAR_VALUE",value:3106,description:" "},p.COLOR_WRITEMASK={name:"COLOR_WRITEMASK",value:3107,description:" "},p.UNPACK_ALIGNMENT={name:"UNPACK_ALIGNMENT",value:3317,description:" "},p.PACK_ALIGNMENT={name:"PACK_ALIGNMENT",value:3333,description:" "},p.MAX_TEXTURE_SIZE={name:"MAX_TEXTURE_SIZE",value:3379,description:" "},p.MAX_VIEWPORT_DIMS={name:"MAX_VIEWPORT_DIMS",value:3386,description:" "},p.SUBPIXEL_BITS={name:"SUBPIXEL_BITS",value:3408,description:" "},p.RED_BITS={name:"RED_BITS",value:3410,description:" "},p.GREEN_BITS={name:"GREEN_BITS",value:3411,description:" "},p.BLUE_BITS={name:"BLUE_BITS",value:3412,description:" "},p.ALPHA_BITS={name:"ALPHA_BITS",value:3413,description:" "},p.DEPTH_BITS={name:"DEPTH_BITS",value:3414,description:" "},p.STENCIL_BITS={name:"STENCIL_BITS",value:3415,description:" "},p.POLYGON_OFFSET_UNITS={name:"POLYGON_OFFSET_UNITS",value:10752,description:" "},p.POLYGON_OFFSET_FACTOR={name:"POLYGON_OFFSET_FACTOR",value:32824,description:" "},p.TEXTURE_BINDING_2D={name:"TEXTURE_BINDING_2D",value:32873,description:" "},p.SAMPLE_BUFFERS={name:"SAMPLE_BUFFERS",value:32936,description:" "},p.SAMPLES={name:"SAMPLES",value:32937,description:" "},p.SAMPLE_COVERAGE_VALUE={name:"SAMPLE_COVERAGE_VALUE",value:32938,description:" "},p.SAMPLE_COVERAGE_INVERT={name:"SAMPLE_COVERAGE_INVERT",value:32939,description:" "},p.COMPRESSED_TEXTURE_FORMATS={name:"COMPRESSED_TEXTURE_FORMATS",value:34467,description:" "},p.VENDOR={name:"VENDOR",value:7936,description:" "},p.RENDERER={name:"RENDERER",value:7937,description:" "},p.VERSION={name:"VERSION",value:7938,description:" "},p.IMPLEMENTATION_COLOR_READ_TYPE={name:"IMPLEMENTATION_COLOR_READ_TYPE",value:35738,description:" "},p.IMPLEMENTATION_COLOR_READ_FORMAT={name:"IMPLEMENTATION_COLOR_READ_FORMAT",value:35739,description:" "},p.BROWSER_DEFAULT_WEBGL={name:"BROWSER_DEFAULT_WEBGL",value:37444,description:" "},p.STATIC_DRAW={name:"STATIC_DRAW",value:35044,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and not change often."},p.STREAM_DRAW={name:"STREAM_DRAW",value:35040,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to not be used often."},p.DYNAMIC_DRAW={name:"DYNAMIC_DRAW",value:35048,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and change often."},p.ARRAY_BUFFER={name:"ARRAY_BUFFER",value:34962,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.ELEMENT_ARRAY_BUFFER={name:"ELEMENT_ARRAY_BUFFER",value:34963,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.BUFFER_SIZE={name:"BUFFER_SIZE",value:34660,description:"Passed to getBufferParameter to get a buffer's size."},p.BUFFER_USAGE={name:"BUFFER_USAGE",value:34661,description:"Passed to getBufferParameter to get the hint for the buffer passed in when it was created."},p.CURRENT_VERTEX_ATTRIB={name:"CURRENT_VERTEX_ATTRIB",value:34342,description:"Passed to getVertexAttrib to read back the current vertex attribute."},p.VERTEX_ATTRIB_ARRAY_ENABLED={name:"VERTEX_ATTRIB_ARRAY_ENABLED",value:34338,description:" "},p.VERTEX_ATTRIB_ARRAY_SIZE={name:"VERTEX_ATTRIB_ARRAY_SIZE",value:34339,description:" "},p.VERTEX_ATTRIB_ARRAY_STRIDE={name:"VERTEX_ATTRIB_ARRAY_STRIDE",value:34340,description:" "},p.VERTEX_ATTRIB_ARRAY_TYPE={name:"VERTEX_ATTRIB_ARRAY_TYPE",value:34341,description:" "},p.VERTEX_ATTRIB_ARRAY_NORMALIZED={name:"VERTEX_ATTRIB_ARRAY_NORMALIZED",value:34922,description:" "},p.VERTEX_ATTRIB_ARRAY_POINTER={name:"VERTEX_ATTRIB_ARRAY_POINTER",value:34373,description:" "},p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING={name:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",value:34975,description:" "},p.CULL_FACE={name:"CULL_FACE",value:2884,description:"Passed to enable/disable to turn on/off culling. Can also be used with getParameter to find the current culling method."},p.FRONT={name:"FRONT",value:1028,description:"Passed to cullFace to specify that only front faces should be drawn."},p.BACK={name:"BACK",value:1029,description:"Passed to cullFace to specify that only back faces should be drawn."},p.FRONT_AND_BACK={name:"FRONT_AND_BACK",value:1032,description:"Passed to cullFace to specify that front and back faces should be drawn."},p.BLEND={name:"BLEND",value:3042,description:"Passed to enable/disable to turn on/off blending. Can also be used with getParameter to find the current blending method."},p.DEPTH_TEST={name:"DEPTH_TEST",value:2929,description:"Passed to enable/disable to turn on/off the depth test. Can also be used with getParameter to query the depth test."},p.DITHER={name:"DITHER",value:3024,description:"Passed to enable/disable to turn on/off dithering. Can also be used with getParameter to find the current dithering method."},p.POLYGON_OFFSET_FILL={name:"POLYGON_OFFSET_FILL",value:32823,description:"Passed to enable/disable to turn on/off the polygon offset. Useful for rendering hidden-line images, decals, and or solids with highlighted edges. Can also be used with getParameter to query the scissor test."},p.SAMPLE_ALPHA_TO_COVERAGE={name:"SAMPLE_ALPHA_TO_COVERAGE",value:32926,description:"Passed to enable/disable to turn on/off the alpha to coverage. Used in multi-sampling alpha channels."},p.SAMPLE_COVERAGE={name:"SAMPLE_COVERAGE",value:32928,description:"Passed to enable/disable to turn on/off the sample coverage. Used in multi-sampling."},p.SCISSOR_TEST={name:"SCISSOR_TEST",value:3089,description:"Passed to enable/disable to turn on/off the scissor test. Can also be used with getParameter to query the scissor test."},p.STENCIL_TEST={name:"STENCIL_TEST",value:2960,description:"Passed to enable/disable to turn on/off the stencil test. Can also be used with getParameter to query the stencil test."},p.NO_ERROR={name:"NO_ERROR",value:0,description:"Returned from getError."},p.INVALID_ENUM={name:"INVALID_ENUM",value:1280,description:"Returned from getError."},p.INVALID_VALUE={name:"INVALID_VALUE",value:1281,description:"Returned from getError."},p.INVALID_OPERATION={name:"INVALID_OPERATION",value:1282,description:"Returned from getError."},p.OUT_OF_MEMORY={name:"OUT_OF_MEMORY",value:1285,description:"Returned from getError."},p.CONTEXT_LOST_WEBGL={name:"CONTEXT_LOST_WEBGL",value:37442,description:"Returned from getError."},p.CW={name:"CW",value:2304,description:"Passed to frontFace to specify the front face of a polygon is drawn in the clockwise direction"},p.CCW={name:"CCW",value:2305,description:"Passed to frontFace to specify the front face of a polygon is drawn in the counter clockwise direction"},p.DONT_CARE={name:"DONT_CARE",value:4352,description:"There is no preference for this behavior."},p.FASTEST={name:"FASTEST",value:4353,description:"The most efficient behavior should be used."},p.NICEST={name:"NICEST",value:4354,description:"The most correct or the highest quality option should be used."},p.GENERATE_MIPMAP_HINT={name:"GENERATE_MIPMAP_HINT",value:33170,description:"Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap()."},p.BYTE={name:"BYTE",value:5120,description:" "},p.UNSIGNED_BYTE={name:"UNSIGNED_BYTE",value:5121,description:" "},p.SHORT={name:"SHORT",value:5122,description:" "},p.UNSIGNED_SHORT={name:"UNSIGNED_SHORT",value:5123,description:" "},p.INT={name:"INT",value:5124,description:" "},p.UNSIGNED_INT={name:"UNSIGNED_INT",value:5125,description:" "},p.FLOAT={name:"FLOAT",value:5126,description:" "},p.DEPTH_COMPONENT={name:"DEPTH_COMPONENT",value:6402,description:" "},p.ALPHA={name:"ALPHA",value:6406,description:" "},p.RGB={name:"RGB",value:6407,description:" "},p.RGBA={name:"RGBA",value:6408,description:" "},p.LUMINANCE={name:"LUMINANCE",value:6409,description:" "},p.LUMINANCE_ALPHA={name:"LUMINANCE_ALPHA",value:6410,description:" "},p.UNSIGNED_SHORT_4_4_4_4={name:"UNSIGNED_SHORT_4_4_4_4",value:32819,description:" "},p.UNSIGNED_SHORT_5_5_5_1={name:"UNSIGNED_SHORT_5_5_5_1",value:32820,description:" "},p.UNSIGNED_SHORT_5_6_5={name:"UNSIGNED_SHORT_5_6_5",value:33635,description:" "},p.FRAGMENT_SHADER={name:"FRAGMENT_SHADER",value:35632,description:"Passed to createShader to define a fragment shader."},p.VERTEX_SHADER={name:"VERTEX_SHADER",value:35633,description:"Passed to createShader to define a vertex shader"},p.COMPILE_STATUS={name:"COMPILE_STATUS",value:35713,description:"Passed to getShaderParamter to get the status of the compilation. Returns false if the shader was not compiled. You can then query getShaderInfoLog to find the exact error"},p.DELETE_STATUS={name:"DELETE_STATUS",value:35712,description:"Passed to getShaderParamter to determine if a shader was deleted via deleteShader. Returns true if it was, false otherwise."},p.LINK_STATUS={name:"LINK_STATUS",value:35714,description:"Passed to getProgramParameter after calling linkProgram to determine if a program was linked correctly. Returns false if there were errors. Use getProgramInfoLog to find the exact error."},p.VALIDATE_STATUS={name:"VALIDATE_STATUS",value:35715,description:"Passed to getProgramParameter after calling validateProgram to determine if it is valid. Returns false if errors were found."},p.ATTACHED_SHADERS={name:"ATTACHED_SHADERS",value:35717,description:"Passed to getProgramParameter after calling attachShader to determine if the shader was attached correctly. Returns false if errors occurred."},p.COMPLETION_STATUS_KHR={name:"COMPLETION_STATUS_KHR",value:37297,description:"Passed to getProgramParameter (KHR_parallel_shader_compile) to query whether an asynchronous shader/program link has completed. Returns true once the program is ready to use without blocking."},p.ACTIVE_ATTRIBUTES={name:"ACTIVE_ATTRIBUTES",value:35721,description:"Passed to getProgramParameter to get the number of attributes active in a program."},p.ACTIVE_UNIFORMS={name:"ACTIVE_UNIFORMS",value:35718,description:"Passed to getProgramParamter to get the number of uniforms active in a program."},p.MAX_VERTEX_ATTRIBS={name:"MAX_VERTEX_ATTRIBS",value:34921,description:" "},p.MAX_VERTEX_UNIFORM_VECTORS={name:"MAX_VERTEX_UNIFORM_VECTORS",value:36347,description:" "},p.MAX_VARYING_VECTORS={name:"MAX_VARYING_VECTORS",value:36348,description:" "},p.MAX_COMBINED_TEXTURE_IMAGE_UNITS={name:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",value:35661,description:" "},p.MAX_VERTEX_TEXTURE_IMAGE_UNITS={name:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",value:35660,description:" "},p.MAX_TEXTURE_IMAGE_UNITS={name:"MAX_TEXTURE_IMAGE_UNITS",value:34930,description:"Implementation dependent number of maximum texture units. At least 8."},p.MAX_FRAGMENT_UNIFORM_VECTORS={name:"MAX_FRAGMENT_UNIFORM_VECTORS",value:36349,description:" "},p.SHADER_TYPE={name:"SHADER_TYPE",value:35663,description:" "},p.SHADING_LANGUAGE_VERSION={name:"SHADING_LANGUAGE_VERSION",value:35724,description:" "},p.CURRENT_PROGRAM={name:"CURRENT_PROGRAM",value:35725,description:" "},p.NEVER={name:"NEVER",value:512,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn."},p.ALWAYS={name:"ALWAYS",value:519,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn."},p.LESS={name:"LESS",value:513,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value."},p.EQUAL={name:"EQUAL",value:514,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value."},p.LEQUAL={name:"LEQUAL",value:515,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value."},p.GREATER={name:"GREATER",value:516,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value."},p.GEQUAL={name:"GEQUAL",value:518,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value."},p.NOTEQUAL={name:"NOTEQUAL",value:517,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value."},p.KEEP={name:"KEEP",value:7680,description:" "},p.REPLACE={name:"REPLACE",value:7681,description:" "},p.INCR={name:"INCR",value:7682,description:" "},p.DECR={name:"DECR",value:7683,description:" "},p.INVERT={name:"INVERT",value:5386,description:" "},p.INCR_WRAP={name:"INCR_WRAP",value:34055,description:" "},p.DECR_WRAP={name:"DECR_WRAP",value:34056,description:" "},p.NEAREST={name:"NEAREST",value:9728,description:" "},p.LINEAR={name:"LINEAR",value:9729,description:" "},p.NEAREST_MIPMAP_NEAREST={name:"NEAREST_MIPMAP_NEAREST",value:9984,description:" "},p.LINEAR_MIPMAP_NEAREST={name:"LINEAR_MIPMAP_NEAREST",value:9985,description:" "},p.NEAREST_MIPMAP_LINEAR={name:"NEAREST_MIPMAP_LINEAR",value:9986,description:" "},p.LINEAR_MIPMAP_LINEAR={name:"LINEAR_MIPMAP_LINEAR",value:9987,description:" "},p.TEXTURE_MAG_FILTER={name:"TEXTURE_MAG_FILTER",value:10240,description:" "},p.TEXTURE_MIN_FILTER={name:"TEXTURE_MIN_FILTER",value:10241,description:" "},p.TEXTURE_WRAP_S={name:"TEXTURE_WRAP_S",value:10242,description:" "},p.TEXTURE_WRAP_T={name:"TEXTURE_WRAP_T",value:10243,description:" "},p.TEXTURE_2D={name:"TEXTURE_2D",value:3553,description:" "},p.TEXTURE={name:"TEXTURE",value:5890,description:" "},p.TEXTURE_CUBE_MAP={name:"TEXTURE_CUBE_MAP",value:34067,description:" "},p.TEXTURE_BINDING_CUBE_MAP={name:"TEXTURE_BINDING_CUBE_MAP",value:34068,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_X={name:"TEXTURE_CUBE_MAP_POSITIVE_X",value:34069,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_X={name:"TEXTURE_CUBE_MAP_NEGATIVE_X",value:34070,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Y={name:"TEXTURE_CUBE_MAP_POSITIVE_Y",value:34071,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Y={name:"TEXTURE_CUBE_MAP_NEGATIVE_Y",value:34072,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Z={name:"TEXTURE_CUBE_MAP_POSITIVE_Z",value:34073,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Z={name:"TEXTURE_CUBE_MAP_NEGATIVE_Z",value:34074,description:" "},p.MAX_CUBE_MAP_TEXTURE_SIZE={name:"MAX_CUBE_MAP_TEXTURE_SIZE",value:34076,description:" "},p.TEXTURE0={name:"TEXTURE0",value:33984,description:"A texture unit."},p.TEXTURE1={name:"TEXTURE1",value:33985,description:"A texture unit."},p.TEXTURE2={name:"TEXTURE2",value:33986,description:"A texture unit."},p.TEXTURE3={name:"TEXTURE3",value:33987,description:"A texture unit."},p.TEXTURE4={name:"TEXTURE4",value:33988,description:"A texture unit."},p.TEXTURE5={name:"TEXTURE5",value:33989,description:"A texture unit."},p.TEXTURE6={name:"TEXTURE6",value:33990,description:"A texture unit."},p.TEXTURE7={name:"TEXTURE7",value:33991,description:"A texture unit."},p.TEXTURE8={name:"TEXTURE8",value:33992,description:"A texture unit."},p.TEXTURE9={name:"TEXTURE9",value:33993,description:"A texture unit."},p.TEXTURE10={name:"TEXTURE10",value:33994,description:"A texture unit."},p.TEXTURE11={name:"TEXTURE11",value:33995,description:"A texture unit."},p.TEXTURE12={name:"TEXTURE12",value:33996,description:"A texture unit."},p.TEXTURE13={name:"TEXTURE13",value:33997,description:"A texture unit."},p.TEXTURE14={name:"TEXTURE14",value:33998,description:"A texture unit."},p.TEXTURE15={name:"TEXTURE15",value:33999,description:"A texture unit."},p.TEXTURE16={name:"TEXTURE16",value:34e3,description:"A texture unit."},p.TEXTURE17={name:"TEXTURE17",value:34001,description:"A texture unit."},p.TEXTURE18={name:"TEXTURE18",value:34002,description:"A texture unit."},p.TEXTURE19={name:"TEXTURE19",value:34003,description:"A texture unit."},p.TEXTURE20={name:"TEXTURE20",value:34004,description:"A texture unit."},p.TEXTURE21={name:"TEXTURE21",value:34005,description:"A texture unit."},p.TEXTURE22={name:"TEXTURE22",value:34006,description:"A texture unit."},p.TEXTURE23={name:"TEXTURE23",value:34007,description:"A texture unit."},p.TEXTURE24={name:"TEXTURE24",value:34008,description:"A texture unit."},p.TEXTURE25={name:"TEXTURE25",value:34009,description:"A texture unit."},p.TEXTURE26={name:"TEXTURE26",value:34010,description:"A texture unit."},p.TEXTURE27={name:"TEXTURE27",value:34011,description:"A texture unit."},p.TEXTURE28={name:"TEXTURE28",value:34012,description:"A texture unit."},p.TEXTURE29={name:"TEXTURE29",value:34013,description:"A texture unit."},p.TEXTURE30={name:"TEXTURE30",value:34014,description:"A texture unit."},p.TEXTURE31={name:"TEXTURE31",value:34015,description:"A texture unit."},p.ACTIVE_TEXTURE={name:"ACTIVE_TEXTURE",value:34016,description:"The current active texture unit."},p.REPEAT={name:"REPEAT",value:10497,description:" "},p.CLAMP_TO_EDGE={name:"CLAMP_TO_EDGE",value:33071,description:" "},p.MIRRORED_REPEAT={name:"MIRRORED_REPEAT",value:33648,description:" "},p.FLOAT_VEC2={name:"FLOAT_VEC2",value:35664,description:" "},p.FLOAT_VEC3={name:"FLOAT_VEC3",value:35665,description:" "},p.FLOAT_VEC4={name:"FLOAT_VEC4",value:35666,description:" "},p.INT_VEC2={name:"INT_VEC2",value:35667,description:" "},p.INT_VEC3={name:"INT_VEC3",value:35668,description:" "},p.INT_VEC4={name:"INT_VEC4",value:35669,description:" "},p.BOOL={name:"BOOL",value:35670,description:" "},p.BOOL_VEC2={name:"BOOL_VEC2",value:35671,description:" "},p.BOOL_VEC3={name:"BOOL_VEC3",value:35672,description:" "},p.BOOL_VEC4={name:"BOOL_VEC4",value:35673,description:" "},p.FLOAT_MAT2={name:"FLOAT_MAT2",value:35674,description:" "},p.FLOAT_MAT3={name:"FLOAT_MAT3",value:35675,description:" "},p.FLOAT_MAT4={name:"FLOAT_MAT4",value:35676,description:" "},p.SAMPLER_2D={name:"SAMPLER_2D",value:35678,description:" "},p.SAMPLER_CUBE={name:"SAMPLER_CUBE",value:35680,description:" "},p.LOW_FLOAT={name:"LOW_FLOAT",value:36336,description:" "},p.MEDIUM_FLOAT={name:"MEDIUM_FLOAT",value:36337,description:" "},p.HIGH_FLOAT={name:"HIGH_FLOAT",value:36338,description:" "},p.LOW_INT={name:"LOW_INT",value:36339,description:" "},p.MEDIUM_INT={name:"MEDIUM_INT",value:36340,description:" "},p.HIGH_INT={name:"HIGH_INT",value:36341,description:" "},p.FRAMEBUFFER={name:"FRAMEBUFFER",value:36160,description:" "},p.RENDERBUFFER={name:"RENDERBUFFER",value:36161,description:" "},p.RGBA4={name:"RGBA4",value:32854,description:" "},p.RGB5_A1={name:"RGB5_A1",value:32855,description:" "},p.RGB565={name:"RGB565",value:36194,description:" "},p.DEPTH_COMPONENT16={name:"DEPTH_COMPONENT16",value:33189,description:" "},p.STENCIL_INDEX={name:"STENCIL_INDEX",value:6401,description:" "},p.STENCIL_INDEX8={name:"STENCIL_INDEX8",value:36168,description:" "},p.DEPTH_STENCIL={name:"DEPTH_STENCIL",value:34041,description:" "},p.RENDERBUFFER_WIDTH={name:"RENDERBUFFER_WIDTH",value:36162,description:" "},p.RENDERBUFFER_HEIGHT={name:"RENDERBUFFER_HEIGHT",value:36163,description:" "},p.RENDERBUFFER_INTERNAL_FORMAT={name:"RENDERBUFFER_INTERNAL_FORMAT",value:36164,description:" "},p.RENDERBUFFER_RED_SIZE={name:"RENDERBUFFER_RED_SIZE",value:36176,description:" "},p.RENDERBUFFER_GREEN_SIZE={name:"RENDERBUFFER_GREEN_SIZE",value:36177,description:" "},p.RENDERBUFFER_BLUE_SIZE={name:"RENDERBUFFER_BLUE_SIZE",value:36178,description:" "},p.RENDERBUFFER_ALPHA_SIZE={name:"RENDERBUFFER_ALPHA_SIZE",value:36179,description:" "},p.RENDERBUFFER_DEPTH_SIZE={name:"RENDERBUFFER_DEPTH_SIZE",value:36180,description:" "},p.RENDERBUFFER_STENCIL_SIZE={name:"RENDERBUFFER_STENCIL_SIZE",value:36181,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",value:36048,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",value:36049,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",value:36050,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",value:36051,description:" "},p.COLOR_ATTACHMENT0={name:"COLOR_ATTACHMENT0",value:36064,description:" "},p.DEPTH_ATTACHMENT={name:"DEPTH_ATTACHMENT",value:36096,description:" "},p.STENCIL_ATTACHMENT={name:"STENCIL_ATTACHMENT",value:36128,description:" "},p.DEPTH_STENCIL_ATTACHMENT={name:"DEPTH_STENCIL_ATTACHMENT",value:33306,description:" "},p.NONE={name:"NONE",value:0,description:" "},p.FRAMEBUFFER_COMPLETE={name:"FRAMEBUFFER_COMPLETE",value:36053,description:" "},p.FRAMEBUFFER_INCOMPLETE_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",value:36054,description:" "},p.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",value:36055,description:" "},p.FRAMEBUFFER_INCOMPLETE_DIMENSIONS={name:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",value:36057,description:" "},p.FRAMEBUFFER_UNSUPPORTED={name:"FRAMEBUFFER_UNSUPPORTED",value:36061,description:" "},p.FRAMEBUFFER_BINDING={name:"FRAMEBUFFER_BINDING",value:36006,description:" "},p.RENDERBUFFER_BINDING={name:"RENDERBUFFER_BINDING",value:36007,description:" "},p.MAX_RENDERBUFFER_SIZE={name:"MAX_RENDERBUFFER_SIZE",value:34024,description:" "},p.INVALID_FRAMEBUFFER_OPERATION={name:"INVALID_FRAMEBUFFER_OPERATION",value:1286,description:" "},p.UNPACK_FLIP_Y_WEBGL={name:"UNPACK_FLIP_Y_WEBGL",value:37440,description:" "},p.UNPACK_PREMULTIPLY_ALPHA_WEBGL={name:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",value:37441,description:" "},p.UNPACK_COLORSPACE_CONVERSION_WEBGL={name:"UNPACK_COLORSPACE_CONVERSION_WEBGL",value:37443,description:" "},p.READ_BUFFER={name:"READ_BUFFER",value:3074,description:" "},p.UNPACK_ROW_LENGTH={name:"UNPACK_ROW_LENGTH",value:3314,description:" "},p.UNPACK_SKIP_ROWS={name:"UNPACK_SKIP_ROWS",value:3315,description:" "},p.UNPACK_SKIP_PIXELS={name:"UNPACK_SKIP_PIXELS",value:3316,description:" "},p.PACK_ROW_LENGTH={name:"PACK_ROW_LENGTH",value:3330,description:" "},p.PACK_SKIP_ROWS={name:"PACK_SKIP_ROWS",value:3331,description:" "},p.PACK_SKIP_PIXELS={name:"PACK_SKIP_PIXELS",value:3332,description:" "},p.TEXTURE_BINDING_3D={name:"TEXTURE_BINDING_3D",value:32874,description:" "},p.UNPACK_SKIP_IMAGES={name:"UNPACK_SKIP_IMAGES",value:32877,description:" "},p.UNPACK_IMAGE_HEIGHT={name:"UNPACK_IMAGE_HEIGHT",value:32878,description:" "},p.MAX_3D_TEXTURE_SIZE={name:"MAX_3D_TEXTURE_SIZE",value:32883,description:" "},p.MAX_ELEMENTS_VERTICES={name:"MAX_ELEMENTS_VERTICES",value:33e3,description:" "},p.MAX_ELEMENTS_INDICES={name:"MAX_ELEMENTS_INDICES",value:33001,description:" "},p.MAX_TEXTURE_LOD_BIAS={name:"MAX_TEXTURE_LOD_BIAS",value:34045,description:" "},p.MAX_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_FRAGMENT_UNIFORM_COMPONENTS",value:35657,description:" "},p.MAX_VERTEX_UNIFORM_COMPONENTS={name:"MAX_VERTEX_UNIFORM_COMPONENTS",value:35658,description:" "},p.MAX_ARRAY_TEXTURE_LAYERS={name:"MAX_ARRAY_TEXTURE_LAYERS",value:35071,description:" "},p.MIN_PROGRAM_TEXEL_OFFSET={name:"MIN_PROGRAM_TEXEL_OFFSET",value:35076,description:" "},p.MAX_PROGRAM_TEXEL_OFFSET={name:"MAX_PROGRAM_TEXEL_OFFSET",value:35077,description:" "},p.MAX_VARYING_COMPONENTS={name:"MAX_VARYING_COMPONENTS",value:35659,description:" "},p.FRAGMENT_SHADER_DERIVATIVE_HINT={name:"FRAGMENT_SHADER_DERIVATIVE_HINT",value:35723,description:" "},p.RASTERIZER_DISCARD={name:"RASTERIZER_DISCARD",value:35977,description:" "},p.VERTEX_ARRAY_BINDING={name:"VERTEX_ARRAY_BINDING",value:34229,description:" "},p.MAX_VERTEX_OUTPUT_COMPONENTS={name:"MAX_VERTEX_OUTPUT_COMPONENTS",value:37154,description:" "},p.MAX_FRAGMENT_INPUT_COMPONENTS={name:"MAX_FRAGMENT_INPUT_COMPONENTS",value:37157,description:" "},p.MAX_SERVER_WAIT_TIMEOUT={name:"MAX_SERVER_WAIT_TIMEOUT",value:37137,description:" "},p.MAX_ELEMENT_INDEX={name:"MAX_ELEMENT_INDEX",value:36203,description:" "},p.RED={name:"RED",value:6403,description:" "},p.RGB8={name:"RGB8",value:32849,description:" "},p.RGBA8={name:"RGBA8",value:32856,description:" "},p.RGB10_A2={name:"RGB10_A2",value:32857,description:" "},p.TEXTURE_3D={name:"TEXTURE_3D",value:32879,description:" "},p.TEXTURE_WRAP_R={name:"TEXTURE_WRAP_R",value:32882,description:" "},p.TEXTURE_MIN_LOD={name:"TEXTURE_MIN_LOD",value:33082,description:" "},p.TEXTURE_MAX_LOD={name:"TEXTURE_MAX_LOD",value:33083,description:" "},p.TEXTURE_BASE_LEVEL={name:"TEXTURE_BASE_LEVEL",value:33084,description:" "},p.TEXTURE_MAX_LEVEL={name:"TEXTURE_MAX_LEVEL",value:33085,description:" "},p.TEXTURE_COMPARE_MODE={name:"TEXTURE_COMPARE_MODE",value:34892,description:" "},p.TEXTURE_COMPARE_FUNC={name:"TEXTURE_COMPARE_FUNC",value:34893,description:" "},p.SRGB={name:"SRGB",value:35904,description:" "},p.SRGB8={name:"SRGB8",value:35905,description:" "},p.SRGB8_ALPHA8={name:"SRGB8_ALPHA8",value:35907,description:" "},p.COMPARE_REF_TO_TEXTURE={name:"COMPARE_REF_TO_TEXTURE",value:34894,description:" "},p.RGBA32F={name:"RGBA32F",value:34836,description:" "},p.RGB32F={name:"RGB32F",value:34837,description:" "},p.RGBA16F={name:"RGBA16F",value:34842,description:" "},p.RGB16F={name:"RGB16F",value:34843,description:" "},p.TEXTURE_2D_ARRAY={name:"TEXTURE_2D_ARRAY",value:35866,description:" "},p.TEXTURE_BINDING_2D_ARRAY={name:"TEXTURE_BINDING_2D_ARRAY",value:35869,description:" "},p.R11F_G11F_B10F={name:"R11F_G11F_B10F",value:35898,description:" "},p.RGB9_E5={name:"RGB9_E5",value:35901,description:" "},p.RGBA32UI={name:"RGBA32UI",value:36208,description:" "},p.RGB32UI={name:"RGB32UI",value:36209,description:" "},p.RGBA16UI={name:"RGBA16UI",value:36214,description:" "},p.RGB16UI={name:"RGB16UI",value:36215,description:" "},p.RGBA8UI={name:"RGBA8UI",value:36220,description:" "},p.RGB8UI={name:"RGB8UI",value:36221,description:" "},p.RGBA32I={name:"RGBA32I",value:36226,description:" "},p.RGB32I={name:"RGB32I",value:36227,description:" "},p.RGBA16I={name:"RGBA16I",value:36232,description:" "},p.RGB16I={name:"RGB16I",value:36233,description:" "},p.RGBA8I={name:"RGBA8I",value:36238,description:" "},p.RGB8I={name:"RGB8I",value:36239,description:" "},p.RED_INTEGER={name:"RED_INTEGER",value:36244,description:" "},p.RGB_INTEGER={name:"RGB_INTEGER",value:36248,description:" "},p.RGBA_INTEGER={name:"RGBA_INTEGER",value:36249,description:" "},p.R8={name:"R8",value:33321,description:" "},p.RG8={name:"RG8",value:33323,description:" "},p.R16F={name:"R16F",value:33325,description:" "},p.R32F={name:"R32F",value:33326,description:" "},p.RG16F={name:"RG16F",value:33327,description:" "},p.RG32F={name:"RG32F",value:33328,description:" "},p.R8I={name:"R8I",value:33329,description:" "},p.R8UI={name:"R8UI",value:33330,description:" "},p.R16I={name:"R16I",value:33331,description:" "},p.R16UI={name:"R16UI",value:33332,description:" "},p.R32I={name:"R32I",value:33333,description:" "},p.R32UI={name:"R32UI",value:33334,description:" "},p.RG8I={name:"RG8I",value:33335,description:" "},p.RG8UI={name:"RG8UI",value:33336,description:" "},p.RG16I={name:"RG16I",value:33337,description:" "},p.RG16UI={name:"RG16UI",value:33338,description:" "},p.RG32I={name:"RG32I",value:33339,description:" "},p.RG32UI={name:"RG32UI",value:33340,description:" "},p.R8_SNORM={name:"R8_SNORM",value:36756,description:" "},p.RG8_SNORM={name:"RG8_SNORM",value:36757,description:" "},p.RGB8_SNORM={name:"RGB8_SNORM",value:36758,description:" "},p.RGBA8_SNORM={name:"RGBA8_SNORM",value:36759,description:" "},p.RGB10_A2UI={name:"RGB10_A2UI",value:36975,description:" "},p.TEXTURE_IMMUTABLE_FORMAT={name:"TEXTURE_IMMUTABLE_FORMAT",value:37167,description:" "},p.TEXTURE_IMMUTABLE_LEVELS={name:"TEXTURE_IMMUTABLE_LEVELS",value:33503,description:" "},p.UNSIGNED_INT_2_10_10_10_REV={name:"UNSIGNED_INT_2_10_10_10_REV",value:33640,description:" "},p.UNSIGNED_INT_10F_11F_11F_REV={name:"UNSIGNED_INT_10F_11F_11F_REV",value:35899,description:" "},p.UNSIGNED_INT_5_9_9_9_REV={name:"UNSIGNED_INT_5_9_9_9_REV",value:35902,description:" "},p.FLOAT_32_UNSIGNED_INT_24_8_REV={name:"FLOAT_32_UNSIGNED_INT_24_8_REV",value:36269,description:" "},p.UNSIGNED_INT_24_8={name:"UNSIGNED_INT_24_8",value:34042,description:" "},p.HALF_FLOAT={name:"HALF_FLOAT",value:5131,description:" "},p.RG={name:"RG",value:33319,description:" "},p.RG_INTEGER={name:"RG_INTEGER",value:33320,description:" "},p.INT_2_10_10_10_REV={name:"INT_2_10_10_10_REV",value:36255,description:" "},p.CURRENT_QUERY={name:"CURRENT_QUERY",value:34917,description:" "},p.QUERY_RESULT={name:"QUERY_RESULT",value:34918,description:" "},p.QUERY_RESULT_AVAILABLE={name:"QUERY_RESULT_AVAILABLE",value:34919,description:" "},p.ANY_SAMPLES_PASSED={name:"ANY_SAMPLES_PASSED",value:35887,description:" "},p.ANY_SAMPLES_PASSED_CONSERVATIVE={name:"ANY_SAMPLES_PASSED_CONSERVATIVE",value:36202,description:" "},p.MAX_DRAW_BUFFERS={name:"MAX_DRAW_BUFFERS",value:34852,description:" "},p.DRAW_BUFFER0={name:"DRAW_BUFFER0",value:34853,description:" "},p.DRAW_BUFFER1={name:"DRAW_BUFFER1",value:34854,description:" "},p.DRAW_BUFFER2={name:"DRAW_BUFFER2",value:34855,description:" "},p.DRAW_BUFFER3={name:"DRAW_BUFFER3",value:34856,description:" "},p.DRAW_BUFFER4={name:"DRAW_BUFFER4",value:34857,description:" "},p.DRAW_BUFFER5={name:"DRAW_BUFFER5",value:34858,description:" "},p.DRAW_BUFFER6={name:"DRAW_BUFFER6",value:34859,description:" "},p.DRAW_BUFFER7={name:"DRAW_BUFFER7",value:34860,description:" "},p.DRAW_BUFFER8={name:"DRAW_BUFFER8",value:34861,description:" "},p.DRAW_BUFFER9={name:"DRAW_BUFFER9",value:34862,description:" "},p.DRAW_BUFFER10={name:"DRAW_BUFFER10",value:34863,description:" "},p.DRAW_BUFFER11={name:"DRAW_BUFFER11",value:34864,description:" "},p.DRAW_BUFFER12={name:"DRAW_BUFFER12",value:34865,description:" "},p.DRAW_BUFFER13={name:"DRAW_BUFFER13",value:34866,description:" "},p.DRAW_BUFFER14={name:"DRAW_BUFFER14",value:34867,description:" "},p.DRAW_BUFFER15={name:"DRAW_BUFFER15",value:34868,description:" "},p.MAX_COLOR_ATTACHMENTS={name:"MAX_COLOR_ATTACHMENTS",value:36063,description:" "},p.COLOR_ATTACHMENT1={name:"COLOR_ATTACHMENT1",value:36065,description:" "},p.COLOR_ATTACHMENT2={name:"COLOR_ATTACHMENT2",value:36066,description:" "},p.COLOR_ATTACHMENT3={name:"COLOR_ATTACHMENT3",value:36067,description:" "},p.COLOR_ATTACHMENT4={name:"COLOR_ATTACHMENT4",value:36068,description:" "},p.COLOR_ATTACHMENT5={name:"COLOR_ATTACHMENT5",value:36069,description:" "},p.COLOR_ATTACHMENT6={name:"COLOR_ATTACHMENT6",value:36070,description:" "},p.COLOR_ATTACHMENT7={name:"COLOR_ATTACHMENT7",value:36071,description:" "},p.COLOR_ATTACHMENT8={name:"COLOR_ATTACHMENT8",value:36072,description:" "},p.COLOR_ATTACHMENT9={name:"COLOR_ATTACHMENT9",value:36073,description:" "},p.COLOR_ATTACHMENT10={name:"COLOR_ATTACHMENT10",value:36074,description:" "},p.COLOR_ATTACHMENT11={name:"COLOR_ATTACHMENT11",value:36075,description:" "},p.COLOR_ATTACHMENT12={name:"COLOR_ATTACHMENT12",value:36076,description:" "},p.COLOR_ATTACHMENT13={name:"COLOR_ATTACHMENT13",value:36077,description:" "},p.COLOR_ATTACHMENT14={name:"COLOR_ATTACHMENT14",value:36078,description:" "},p.COLOR_ATTACHMENT15={name:"COLOR_ATTACHMENT15",value:36079,description:" "},p.SAMPLER_3D={name:"SAMPLER_3D",value:35679,description:" "},p.SAMPLER_2D_SHADOW={name:"SAMPLER_2D_SHADOW",value:35682,description:" "},p.SAMPLER_2D_ARRAY={name:"SAMPLER_2D_ARRAY",value:36289,description:" "},p.SAMPLER_2D_ARRAY_SHADOW={name:"SAMPLER_2D_ARRAY_SHADOW",value:36292,description:" "},p.SAMPLER_CUBE_SHADOW={name:"SAMPLER_CUBE_SHADOW",value:36293,description:" "},p.INT_SAMPLER_2D={name:"INT_SAMPLER_2D",value:36298,description:" "},p.INT_SAMPLER_3D={name:"INT_SAMPLER_3D",value:36299,description:" "},p.INT_SAMPLER_CUBE={name:"INT_SAMPLER_CUBE",value:36300,description:" "},p.INT_SAMPLER_2D_ARRAY={name:"INT_SAMPLER_2D_ARRAY",value:36303,description:" "},p.UNSIGNED_INT_SAMPLER_2D={name:"UNSIGNED_INT_SAMPLER_2D",value:36306,description:" "},p.UNSIGNED_INT_SAMPLER_3D={name:"UNSIGNED_INT_SAMPLER_3D",value:36307,description:" "},p.UNSIGNED_INT_SAMPLER_CUBE={name:"UNSIGNED_INT_SAMPLER_CUBE",value:36308,description:" "},p.UNSIGNED_INT_SAMPLER_2D_ARRAY={name:"UNSIGNED_INT_SAMPLER_2D_ARRAY",value:36311,description:" "},p.MAX_SAMPLES={name:"MAX_SAMPLES",value:36183,description:" "},p.SAMPLER_BINDING={name:"SAMPLER_BINDING",value:35097,description:" "},p.PIXEL_PACK_BUFFER={name:"PIXEL_PACK_BUFFER",value:35051,description:" "},p.PIXEL_UNPACK_BUFFER={name:"PIXEL_UNPACK_BUFFER",value:35052,description:" "},p.PIXEL_PACK_BUFFER_BINDING={name:"PIXEL_PACK_BUFFER_BINDING",value:35053,description:" "},p.PIXEL_UNPACK_BUFFER_BINDING={name:"PIXEL_UNPACK_BUFFER_BINDING",value:35055,description:" "},p.COPY_READ_BUFFER={name:"COPY_READ_BUFFER",value:36662,description:" "},p.COPY_WRITE_BUFFER={name:"COPY_WRITE_BUFFER",value:36663,description:" "},p.COPY_READ_BUFFER_BINDING={name:"COPY_READ_BUFFER_BINDING",value:36662,description:" "},p.COPY_WRITE_BUFFER_BINDING={name:"COPY_WRITE_BUFFER_BINDING",value:36663,description:" "},p.FLOAT_MAT2x3={name:"FLOAT_MAT2x3",value:35685,description:" "},p.FLOAT_MAT2x4={name:"FLOAT_MAT2x4",value:35686,description:" "},p.FLOAT_MAT3x2={name:"FLOAT_MAT3x2",value:35687,description:" "},p.FLOAT_MAT3x4={name:"FLOAT_MAT3x4",value:35688,description:" "},p.FLOAT_MAT4x2={name:"FLOAT_MAT4x2",value:35689,description:" "},p.FLOAT_MAT4x3={name:"FLOAT_MAT4x3",value:35690,description:" "},p.UNSIGNED_INT_VEC2={name:"UNSIGNED_INT_VEC2",value:36294,description:" "},p.UNSIGNED_INT_VEC3={name:"UNSIGNED_INT_VEC3",value:36295,description:" "},p.UNSIGNED_INT_VEC4={name:"UNSIGNED_INT_VEC4",value:36296,description:" "},p.UNSIGNED_NORMALIZED={name:"UNSIGNED_NORMALIZED",value:35863,description:" "},p.SIGNED_NORMALIZED={name:"SIGNED_NORMALIZED",value:36764,description:" "},p.VERTEX_ATTRIB_ARRAY_INTEGER={name:"VERTEX_ATTRIB_ARRAY_INTEGER",value:35069,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR={name:"VERTEX_ATTRIB_ARRAY_DIVISOR",value:35070,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_MODE={name:"TRANSFORM_FEEDBACK_BUFFER_MODE",value:35967,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",value:35968,description:" "},p.TRANSFORM_FEEDBACK_VARYINGS={name:"TRANSFORM_FEEDBACK_VARYINGS",value:35971,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_START={name:"TRANSFORM_FEEDBACK_BUFFER_START",value:35972,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_SIZE={name:"TRANSFORM_FEEDBACK_BUFFER_SIZE",value:35973,description:" "},p.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN={name:"TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",value:35976,description:" "},p.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",value:35978,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",value:35979,description:" "},p.INTERLEAVED_ATTRIBS={name:"INTERLEAVED_ATTRIBS",value:35980,description:" "},p.SEPARATE_ATTRIBS={name:"SEPARATE_ATTRIBS",value:35981,description:" "},p.TRANSFORM_FEEDBACK_BUFFER={name:"TRANSFORM_FEEDBACK_BUFFER",value:35982,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_BINDING={name:"TRANSFORM_FEEDBACK_BUFFER_BINDING",value:35983,description:" "},p.TRANSFORM_FEEDBACK={name:"TRANSFORM_FEEDBACK",value:36386,description:" "},p.TRANSFORM_FEEDBACK_PAUSED={name:"TRANSFORM_FEEDBACK_PAUSED",value:36387,description:" "},p.TRANSFORM_FEEDBACK_ACTIVE={name:"TRANSFORM_FEEDBACK_ACTIVE",value:36388,description:" "},p.TRANSFORM_FEEDBACK_BINDING={name:"TRANSFORM_FEEDBACK_BINDING",value:36389,description:" "},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",value:33296,description:" "},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",value:33297,description:" "},p.FRAMEBUFFER_ATTACHMENT_RED_SIZE={name:"FRAMEBUFFER_ATTACHMENT_RED_SIZE",value:33298,description:" "},p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE={name:"FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",value:33299,description:" "},p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE={name:"FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",value:33300,description:" "},p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE={name:"FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",value:33301,description:" "},p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE={name:"FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",value:33302,description:" "},p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE={name:"FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",value:33303,description:" "},p.FRAMEBUFFER_DEFAULT={name:"FRAMEBUFFER_DEFAULT",value:33304,description:" "},p.DEPTH24_STENCIL8={name:"DEPTH24_STENCIL8",value:35056,description:" "},p.DRAW_FRAMEBUFFER_BINDING={name:"DRAW_FRAMEBUFFER_BINDING",value:36006,description:" "},p.READ_FRAMEBUFFER={name:"READ_FRAMEBUFFER",value:36008,description:" "},p.DRAW_FRAMEBUFFER={name:"DRAW_FRAMEBUFFER",value:36009,description:" "},p.READ_FRAMEBUFFER_BINDING={name:"READ_FRAMEBUFFER_BINDING",value:36010,description:" "},p.RENDERBUFFER_SAMPLES={name:"RENDERBUFFER_SAMPLES",value:36011,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",value:36052,description:" "},p.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE={name:"FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",value:36182,description:" "},p.UNIFORM_BUFFER={name:"UNIFORM_BUFFER",value:35345,description:" "},p.UNIFORM_BUFFER_BINDING={name:"UNIFORM_BUFFER_BINDING",value:35368,description:" "},p.UNIFORM_BUFFER_START={name:"UNIFORM_BUFFER_START",value:35369,description:" "},p.UNIFORM_BUFFER_SIZE={name:"UNIFORM_BUFFER_SIZE",value:35370,description:" "},p.MAX_VERTEX_UNIFORM_BLOCKS={name:"MAX_VERTEX_UNIFORM_BLOCKS",value:35371,description:" "},p.MAX_FRAGMENT_UNIFORM_BLOCKS={name:"MAX_FRAGMENT_UNIFORM_BLOCKS",value:35373,description:" "},p.MAX_COMBINED_UNIFORM_BLOCKS={name:"MAX_COMBINED_UNIFORM_BLOCKS",value:35374,description:" "},p.MAX_UNIFORM_BUFFER_BINDINGS={name:"MAX_UNIFORM_BUFFER_BINDINGS",value:35375,description:" "},p.MAX_UNIFORM_BLOCK_SIZE={name:"MAX_UNIFORM_BLOCK_SIZE",value:35376,description:" "},p.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS={name:"MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",value:35377,description:" "},p.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",value:35379,description:" "},p.UNIFORM_BUFFER_OFFSET_ALIGNMENT={name:"UNIFORM_BUFFER_OFFSET_ALIGNMENT",value:35380,description:" "},p.ACTIVE_UNIFORM_BLOCKS={name:"ACTIVE_UNIFORM_BLOCKS",value:35382,description:" "},p.UNIFORM_TYPE={name:"UNIFORM_TYPE",value:35383,description:" "},p.UNIFORM_SIZE={name:"UNIFORM_SIZE",value:35384,description:" "},p.UNIFORM_BLOCK_INDEX={name:"UNIFORM_BLOCK_INDEX",value:35386,description:" "},p.UNIFORM_OFFSET={name:"UNIFORM_OFFSET",value:35387,description:" "},p.UNIFORM_ARRAY_STRIDE={name:"UNIFORM_ARRAY_STRIDE",value:35388,description:" "},p.UNIFORM_MATRIX_STRIDE={name:"UNIFORM_MATRIX_STRIDE",value:35389,description:" "},p.UNIFORM_IS_ROW_MAJOR={name:"UNIFORM_IS_ROW_MAJOR",value:35390,description:" "},p.UNIFORM_BLOCK_BINDING={name:"UNIFORM_BLOCK_BINDING",value:35391,description:" "},p.UNIFORM_BLOCK_DATA_SIZE={name:"UNIFORM_BLOCK_DATA_SIZE",value:35392,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORMS={name:"UNIFORM_BLOCK_ACTIVE_UNIFORMS",value:35394,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES={name:"UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",value:35395,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",value:35396,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",value:35398,description:" "},p.OBJECT_TYPE={name:"OBJECT_TYPE",value:37138,description:" "},p.SYNC_CONDITION={name:"SYNC_CONDITION",value:37139,description:" "},p.SYNC_STATUS={name:"SYNC_STATUS",value:37140,description:" "},p.SYNC_FLAGS={name:"SYNC_FLAGS",value:37141,description:" "},p.SYNC_FENCE={name:"SYNC_FENCE",value:37142,description:" "},p.SYNC_GPU_COMMANDS_COMPLETE={name:"SYNC_GPU_COMMANDS_COMPLETE",value:37143,description:" "},p.UNSIGNALED={name:"UNSIGNALED",value:37144,description:" "},p.SIGNALED={name:"SIGNALED",value:37145,description:" "},p.ALREADY_SIGNALED={name:"ALREADY_SIGNALED",value:37146,description:" "},p.TIMEOUT_EXPIRED={name:"TIMEOUT_EXPIRED",value:37147,description:" "},p.CONDITION_SATISFIED={name:"CONDITION_SATISFIED",value:37148,description:" "},p.WAIT_FAILED={name:"WAIT_FAILED",value:37149,description:" "},p.SYNC_FLUSH_COMMANDS_BIT={name:"SYNC_FLUSH_COMMANDS_BIT",value:1,description:" "},p.COLOR={name:"COLOR",value:6144,description:" "},p.DEPTH={name:"DEPTH",value:6145,description:" "},p.STENCIL={name:"STENCIL",value:6146,description:" "},p.MIN={name:"MIN",value:32775,description:" "},p.MAX={name:"MAX",value:32776,description:" "},p.DEPTH_COMPONENT24={name:"DEPTH_COMPONENT24",value:33190,description:" "},p.STREAM_READ={name:"STREAM_READ",value:35041,description:" "},p.STREAM_COPY={name:"STREAM_COPY",value:35042,description:" "},p.STATIC_READ={name:"STATIC_READ",value:35045,description:" "},p.STATIC_COPY={name:"STATIC_COPY",value:35046,description:" "},p.DYNAMIC_READ={name:"DYNAMIC_READ",value:35049,description:" "},p.DYNAMIC_COPY={name:"DYNAMIC_COPY",value:35050,description:" "},p.DEPTH_COMPONENT32F={name:"DEPTH_COMPONENT32F",value:36012,description:" "},p.DEPTH32F_STENCIL8={name:"DEPTH32F_STENCIL8",value:36013,description:" "},p.INVALID_INDEX={name:"INVALID_INDEX",value:4294967295,description:" "},p.TIMEOUT_IGNORED={name:"TIMEOUT_IGNORED",value:-1,description:" "},p.MAX_CLIENT_WAIT_TIMEOUT_WEBGL={name:"MAX_CLIENT_WAIT_TIMEOUT_WEBGL",value:37447,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE={name:"VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",value:35070,description:"Describes the frequency divisor used for instanced rendering.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_VENDOR_WEBGL={name:"UNMASKED_VENDOR_WEBGL",value:37445,description:"Passed to getParameter to get the vendor string of the graphics driver.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_RENDERER_WEBGL={name:"UNMASKED_RENDERER_WEBGL",value:37446,description:"Passed to getParameter to get the renderer string of the graphics driver.",extensionName:"WEBGL_debug_renderer_info"},p.MAX_TEXTURE_MAX_ANISOTROPY_EXT={name:"MAX_TEXTURE_MAX_ANISOTROPY_EXT",value:34047,description:"Returns the maximum available anisotropy.",extensionName:"EXT_texture_filter_anisotropic"},p.TEXTURE_MAX_ANISOTROPY_EXT={name:"TEXTURE_MAX_ANISOTROPY_EXT",value:34046,description:"Passed to texParameter to set the desired maximum anisotropy for a texture.",extensionName:"EXT_texture_filter_anisotropic"},p.COMPRESSED_RGB_S3TC_DXT1_EXT={name:"COMPRESSED_RGB_S3TC_DXT1_EXT",value:33776,description:"A DXT1-compressed image in an RGB image format.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT1_EXT={name:"COMPRESSED_RGBA_S3TC_DXT1_EXT",value:33777,description:"A DXT1-compressed image in an RGB image format with a simple on/off alpha value.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT3_EXT={name:"COMPRESSED_RGBA_S3TC_DXT3_EXT",value:33778,description:"A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT5_EXT={name:"COMPRESSED_RGBA_S3TC_DXT5_EXT",value:33779,description:"A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_R11_EAC={name:"COMPRESSED_R11_EAC",value:37488,description:"One-channel (red) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_R11_EAC={name:"COMPRESSED_SIGNED_R11_EAC",value:37489,description:"One-channel (red) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RG11_EAC={name:"COMPRESSED_RG11_EAC",value:37490,description:"Two-channel (red and green) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_RG11_EAC={name:"COMPRESSED_SIGNED_RG11_EAC",value:37491,description:"Two-channel (red and green) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_ETC2={name:"COMPRESSED_RGB8_ETC2",value:37492,description:"Compresses RBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGBA8_ETC2_EAC={name:"COMPRESSED_RGBA8_ETC2_EAC",value:37493,description:"Compresses RGBA8 data. The RGB part is encoded the same as RGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ETC2={name:"COMPRESSED_SRGB8_ETC2",value:37494,description:"Compresses sRBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC={name:"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",value:37495,description:"Compresses sRGBA8 data. The sRGB part is encoded the same as SRGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37496,description:"Similar to RGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37497,description:"Similar to SRGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_4BPPV1_IMG",value:35840,description:"RGB compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",value:35842,description:"RGBA compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_2BPPV1_IMG",value:35841,description:"RGB compression in 2-bit mode. One block for each 8×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",value:35843,description:"RGBA compression in 2-bit mode. One block for each 8×4 pixe",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_ETC1_WEBGL={name:"COMPRESSED_RGB_ETC1_WEBGL",value:36196,description:"Compresses 24-bit RGB data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc1"},p.COMPRESSED_RGB_ATC_WEBGL={name:"COMPRESSED_RGB_ATC_WEBGL",value:35986,description:"Compresses RGB textures with no alpha channel.",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",value:35986,description:"Compresses RGBA textures using explicit alpha encoding (useful when alpha transitions are sharp).",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",value:34798,description:"Compresses RGBA textures using interpolated alpha encoding (useful when alpha transitions are gradient).",extensionName:"WEBGL_compressed_texture_atc"},p.UNSIGNED_INT_24_8_WEBGL={name:"UNSIGNED_INT_24_8_WEBGL",value:34042,description:"Unsigned integer type for 24-bit depth texture data.",extensionName:"WEBGL_depth_texture"},p.HALF_FLOAT_OES={name:"HALF_FLOAT_OES",value:36193,description:"Half floating-point type (16-bit).",extensionName:"OES_texture_half_float"},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",value:33297,description:" ",extensionName:"WEBGL_color_buffer_float"},p.UNSIGNED_NORMALIZED_EXT={name:"UNSIGNED_NORMALIZED_EXT",value:35863,description:" ",extensionName:"WEBGL_color_buffer_float"},p.MIN_EXT={name:"MIN_EXT",value:32775,description:"Produces the minimum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.MAX_EXT={name:"MAX_EXT",value:32776,description:"Produces the maximum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.SRGB_EXT={name:"SRGB_EXT",value:35904,description:"Unsized sRGB format that leaves the precision up to the driver.",extensionName:"EXT_sRGB"},p.SRGB_ALPHA_EXT={name:"SRGB_ALPHA_EXT",value:35906,description:"Unsized sRGB format with unsized alpha component.",extensionName:"EXT_sRGB"},p.SRGB8_ALPHA8_EXT={name:"SRGB8_ALPHA8_EXT",value:35907,description:"Sized (8-bit) sRGB and alpha formats.",extensionName:"EXT_sRGB"},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",value:33296,description:"Returns the framebuffer color encoding.",extensionName:"EXT_sRGB"},p.FRAGMENT_SHADER_DERIVATIVE_HINT_OES={name:"FRAGMENT_SHADER_DERIVATIVE_HINT_OES",value:35723,description:"Indicates the accuracy of the derivative calculation for the GLSL built-in functions: dFdx, dFdy, and fwidth.",extensionName:"OES_standard_derivatives"},p.COLOR_ATTACHMENT0_WEBGL={name:"COLOR_ATTACHMENT0_WEBGL",value:36064,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT1_WEBGL={name:"COLOR_ATTACHMENT1_WEBGL",value:36065,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT2_WEBGL={name:"COLOR_ATTACHMENT2_WEBGL",value:36066,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT3_WEBGL={name:"COLOR_ATTACHMENT3_WEBGL",value:36067,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT4_WEBGL={name:"COLOR_ATTACHMENT4_WEBGL",value:36068,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT5_WEBGL={name:"COLOR_ATTACHMENT5_WEBGL",value:36069,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT6_WEBGL={name:"COLOR_ATTACHMENT6_WEBGL",value:36070,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT7_WEBGL={name:"COLOR_ATTACHMENT7_WEBGL",value:36071,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT8_WEBGL={name:"COLOR_ATTACHMENT8_WEBGL",value:36072,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT9_WEBGL={name:"COLOR_ATTACHMENT9_WEBGL",value:36073,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT10_WEBGL={name:"COLOR_ATTACHMENT10_WEBGL",value:36074,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT11_WEBGL={name:"COLOR_ATTACHMENT11_WEBGL",value:36075,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT12_WEBGL={name:"COLOR_ATTACHMENT12_WEBGL",value:36076,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT13_WEBGL={name:"COLOR_ATTACHMENT13_WEBGL",value:36077,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT14_WEBGL={name:"COLOR_ATTACHMENT14_WEBGL",value:36078,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT15_WEBGL={name:"COLOR_ATTACHMENT15_WEBGL",value:36079,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER0_WEBGL={name:"DRAW_BUFFER0_WEBGL",value:34853,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER1_WEBGL={name:"DRAW_BUFFER1_WEBGL",value:34854,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER2_WEBGL={name:"DRAW_BUFFER2_WEBGL",value:34855,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER3_WEBGL={name:"DRAW_BUFFER3_WEBGL",value:34856,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER4_WEBGL={name:"DRAW_BUFFER4_WEBGL",value:34857,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER5_WEBGL={name:"DRAW_BUFFER5_WEBGL",value:34858,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER6_WEBGL={name:"DRAW_BUFFER6_WEBGL",value:34859,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER7_WEBGL={name:"DRAW_BUFFER7_WEBGL",value:34860,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER8_WEBGL={name:"DRAW_BUFFER8_WEBGL",value:34861,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER9_WEBGL={name:"DRAW_BUFFER9_WEBGL",value:34862,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER10_WEBGL={name:"DRAW_BUFFER10_WEBGL",value:34863,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER11_WEBGL={name:"DRAW_BUFFER11_WEBGL",value:34864,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER12_WEBGL={name:"DRAW_BUFFER12_WEBGL",value:34865,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER13_WEBGL={name:"DRAW_BUFFER13_WEBGL",value:34866,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER14_WEBGL={name:"DRAW_BUFFER14_WEBGL",value:34867,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER15_WEBGL={name:"DRAW_BUFFER15_WEBGL",value:34868,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.MAX_COLOR_ATTACHMENTS_WEBGL={name:"MAX_COLOR_ATTACHMENTS_WEBGL",value:36063,description:"Maximum number of framebuffer color attachment points",extensionName:"WEBGL_draw_buffers"},p.MAX_DRAW_BUFFERS_WEBGL={name:"MAX_DRAW_BUFFERS_WEBGL",value:34852,description:"Maximum number of draw buffers",extensionName:"WEBGL_draw_buffers"},p.VERTEX_ARRAY_BINDING_OES={name:"VERTEX_ARRAY_BINDING_OES",value:34229,description:"The bound vertex array object (VAO).",extensionName:"VERTEX_ARRAY_BINDING_OES"},p.QUERY_COUNTER_BITS_EXT={name:"QUERY_COUNTER_BITS_EXT",value:34916,description:"The number of bits used to hold the query result for the given target.",extensionName:"EXT_disjoint_timer_query"},p.CURRENT_QUERY_EXT={name:"CURRENT_QUERY_EXT",value:34917,description:"The currently active query.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_EXT={name:"QUERY_RESULT_EXT",value:34918,description:"The query result.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_AVAILABLE_EXT={name:"QUERY_RESULT_AVAILABLE_EXT",value:34919,description:"A Boolean indicating whether or not a query result is available.",extensionName:"EXT_disjoint_timer_query"},p.TIME_ELAPSED_EXT={name:"TIME_ELAPSED_EXT",value:35007,description:"Elapsed time (in nanoseconds).",extensionName:"EXT_disjoint_timer_query"},p.TIMESTAMP_EXT={name:"TIMESTAMP_EXT",value:36392,description:"The current time.",extensionName:"EXT_disjoint_timer_query"},p.GPU_DISJOINT_EXT={name:"GPU_DISJOINT_EXT",value:36795,description:"A Boolean indicating whether or not the GPU performed any disjoint operation.",extensionName:"EXT_disjoint_timer_query"},p.zeroMeaningByCommand={getError:"NO_ERROR",blendFunc:"ZERO",blendFuncSeparate:"ZERO",readBuffer:"NONE",getFramebufferAttachmentParameter:"NONE",texParameterf:"NONE",texParameteri:"NONE",drawArrays:"POINTS",drawElements:"POINTS",drawArraysInstanced:"POINTS",drawArraysInstancedAngle:"POINTS",drawBuffers:"POINTS",drawElementsInstanced:"POINTS",drawRangeElements:"POINTS"},p.oneMeaningByCommand={blendFunc:"ONE",blendFuncSeparate:"ONE",drawArrays:"LINES",drawElements:"LINES",drawArraysInstanced:"LINES",drawArraysInstancedAngle:"LINES",drawBuffers:"LINES",drawElementsInstanced:"LINES",drawRangeElements:"LINES"};const m={},g={};!function(){for(const e in p)if(p.hasOwnProperty(e)){const t=p[e];m[t.name]=t,g[t.value]=t}}();class E extends c{get analyserName(){return E.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={total:0,totalTriangles:0,totalTriangleStrip:0,totalTriangleFan:0,totalLines:0,totalLineStrip:0,totalLineLoop:0,totalPoints:0};for(const t of e.commands)"drawArrays"===t.name&&t.commandArguments.length>=3||"drawArraysInstanced"===t.name&&t.commandArguments.length>=3||"drawArraysInstancedANGLE"===t.name&&t.commandArguments.length>=3?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[2]):"drawElements"===t.name&&t.commandArguments.length>=2||"drawElementsInstanced"===t.name&&t.commandArguments.length>=2||"drawElementsInstancedANGLE"===t.name&&t.commandArguments.length>=2?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[1]):"drawRangeElements"===t.name&&t.commandArguments.length>=4&&this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[3]);t.total=n.total,t.triangles=n.totalTriangles,t.triangleStrip=n.totalTriangleStrip,t.triangleFan=n.totalTriangleFan,t.lines=n.totalLines,t.lineStrip=n.totalLineStrip,t.lineLoop=n.totalLineLoop,t.points=n.totalPoints}appendToPrimitives(e,t,n){t===p.POINTS.value?e.totalPoints+=n:t===p.LINES.value?e.totalLines+=n:t===p.LINE_STRIP.value?e.totalLineStrip+=n:t===p.LINE_LOOP.value?e.totalLineLoop+=n:t===p.TRIANGLES.value?e.totalTriangles+=n:t===p.TRIANGLE_STRIP.value?e.totalTriangleStrip+=n:t===p.TRIANGLE_FAN.value&&(e.totalTriangleFan+=n),e.total+=n}}E.analyserName="Primitives";class v{constructor(e){this.contextInformation=e,this.analysers=[],this.initAnalysers()}appendAnalyses(e){for(const t in this.analysers)this.analysers.hasOwnProperty(t)&&this.analysers[t].appendAnalysis(e)}initAnalysers(){this.analysers.push(new h(this.contextInformation),new f(this.contextInformation),new E(this.contextInformation))}}class C{static getStackTrace(e=0,t=0){const n=[];try{throw new Error("Errorator.")}catch(e){if(e.stack){const t=e.stack.split("\n");for(let e=0,r=t.length;e0;t++)n.shift();for(let e=0;e0;e++)n.pop()}return n}}class D{static getWebGlObjectTag(e){return e[D.SPECTOROBJECTTAGKEY]}static attachWebGlObjectTag(e,t){t.displayText=D.stringifyWebGlObjectTag(t),e[D.SPECTOROBJECTTAGKEY]=t}static stringifyWebGlObjectTag(e){return e?`${e.typeName} - ID: ${e.id}`:"No tag available."}}D.SPECTOROBJECTTAGKEY="__SPECTOR_Object_TAG";class S{get type(){return("undefined"!=typeof globalThis?globalThis:self)[this.typeName]||null}constructor(){this.id=0}tagWebGlObject(e){if(!this.type)return;let t;if(!e)return t;if(t=D.getWebGlObjectTag(e),t)return t;if(e instanceof this.type){const n=this.getNextId();return t={typeName:this.typeName,id:n},D.attachWebGlObjectTag(e,t),t}return t}getNextId(){return this.id++}}class A{constructor(e){this.options=e}createCapture(e,t,n){const r=C.getStackTrace(4,1),i=0===e.name.indexOf("uniform")?this.stringifyUniform(e.arguments):this.stringify(e.arguments,e.result),s={id:t,startTime:e.startTime,commandEndTime:e.endTime,endTime:0,name:e.name,commandArguments:e.arguments,result:e.result,stackTrace:r,status:0,marker:n,text:i};this.transformCapture(s);for(let e=0;e50&&(s.commandArguments[e]="Array Length: "+t.length)}if(s.commandArguments){const e=[];for(let t=0;t0&&(n+=": "+this.stringifyArgs(e).join(", ")),null!=t&&(n+=" -> "+this.stringifyResult(t)),n}stringifyUniform(e){let t=this.spiedCommandName;if(e&&e.length>0){const n=[];n.push(this.stringifyValue(e[0]));for(let t=1;t0&&"number"==typeof s)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");else{const e=this.stringifyValue(s);r.push(e)}}return r}}_.commandName="bufferSubData";class y{static storeOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]||(e[n]=e[t])}static resetOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]&&(e[t]=e[n],delete e[n])}static storePrototypeOriginFunction(e,t){if(!e)return;if(!e.prototype[t])return;const n=this.getOriginFunctionName(t);e.prototype[n]||(e.prototype[n]=e.prototype[t])}static executePrototypeOriginFunction(e,t,n,r){if(!e)return;const i=this.getOriginFunctionName(n);return t.prototype[i]?(e[i]||(e[i]=t.prototype[i]),this.executeFunction(e,i,r)):void 0}static executeOriginFunction(e,t,n){if(!e)return;const r=this.getOriginFunctionName(t);return e[r]?this.executeFunction(e,r,n):void 0}static executeFunction(e,t,n){const r=n;if(void 0===r||0===r.length)return e[t]();switch(r.length){case 1:return e[t](r[0]);case 2:return e[t](r[0],r[1]);case 3:return e[t](r[0],r[1],r[2]);case 4:return e[t](r[0],r[1],r[2],r[3]);case 5:return e[t](r[0],r[1],r[2],r[3],r[4]);case 6:return e[t](r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6]);case 8:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]);case 9:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8]);case 10:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9]);case 11:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10]);case 12:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11]);case 13:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12]);case 14:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13]);case 15:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14]);case 16:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);case 17:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16]);case 18:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17]);case 19:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18]);case 20:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19]);default:return e[t].apply(e,r)}}static getOriginFunctionName(e){return this.originFunctionPrefix+e}}y.originFunctionPrefix="__SPECTOR_Origin_";class b extends A{get spiedCommandName(){return b.commandName}stringifyArgs(e){const t=[];if(e.length>0){const n=e[0],r=this.stringifyValue(n);t.push(r)}if(e.length>1){const n=""+e[1];t.push(n)}return e.length>2&&t.push(e[2]),t}}b.commandName="bindAttribLocation";class T extends A{get spiedCommandName(){return T.commandName}stringifyArgs(e){const t=[],n=this.options.context.getParameter(p.READ_FRAMEBUFFER_BINDING.value),r=this.options.tagWebGlObject(n);t.push("READ FROM: "+this.stringifyValue(r));const i=this.options.context.getParameter(p.DRAW_FRAMEBUFFER_BINDING.value),s=this.options.tagWebGlObject(i);t.push("WRITE TO: "+this.stringifyValue(s));for(let n=0;n<8;n++)t.push(e[n]);return(e[8]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[8]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[8]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t.push(p.stringifyWebGlConstant(e[9],"blitFrameBuffer")),t}}T.commandName="blitFrameBuffer";class R extends A{get spiedCommandName(){return R.commandName}stringifyArgs(e){const t=[];return(e[0]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[0]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[0]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t}}R.commandName="clear";class x{static getProgramData(e,t){const n={LINK_STATUS:e.getProgramParameter(t,p.LINK_STATUS.value),VALIDATE_STATUS:e.getProgramParameter(t,p.VALIDATE_STATUS.value),infoLog:e.getProgramInfoLog(t)||""},r=e.getAttachedShaders(t)||[],i=new Array(2);let s=0;for(const t of r){const n=this.getShaderData(e,t);s+=n.source.length,n.shaderType===p.FRAGMENT_SHADER.name?i[1]=n:i[0]=n}return{programStatus:n,shaders:i,length:s}}static getShaderData(e,t){const n=e.getShaderSource(t)||"",r=e.getExtension("WEBGL_debug_shaders"),i=r?r.getTranslatedShaderSource(t):null,s=e.getShaderParameter(t,p.SHADER_TYPE.value)===p.FRAGMENT_SHADER.value;let o=t&&t.__SPECTOR_Metadata&&t.__SPECTOR_Metadata.name?t.__SPECTOR_Metadata.name:this.readNameFromShaderSource(n);return o||(o=s?"Fragment":"Vertex"),{COMPILE_STATUS:e.getShaderParameter(t,p.COMPILE_STATUS.value),shaderType:s?p.FRAGMENT_SHADER.name:p.VERTEX_SHADER.name,name:o,source:n,translatedSource:i,infoLog:e.getShaderInfoLog(t)||""}}static readNameFromShaderSource(e){try{let t,n="";const r=/#define[\s]+SHADER_NAME[\s]+([\S]+)(\n|$)/gi;if(t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),""===n){const r=/#define[\s]+SHADER_NAME_B64[\s]+([\S]+)(\n|$)/gi;t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),n&&(n=decodeURIComponent(atob(n)))}return n}catch(e){return null}}}class w extends A{constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.shader=x.getShaderData(this.options.context,t)}finally{n&&n(!0)}}getShaderDisplayText(e){return this.stringifyValue(e.commandArguments[0])}}class F extends w{get spiedCommandName(){return F.commandName}transformCapture(e){if(super.transformCapture(e),e.shader){const t=e.shader.COMPILE_STATUS?"compiled":"failed";e.text=`${this.spiedCommandName}: ${this.getShaderDisplayText(e)} -> ${t}`}}}F.commandName="compileShader";const N=["lineWidth"];class L extends A{get spiedCommandName(){return this.internalSpiedCommandName}constructor(e,t){super(e),this.internalSpiedCommandName=t,this.isDeprecated=N.indexOf(this.spiedCommandName)>-1}transformCapture(e){this.isDeprecated&&(e.status=50)}}class O extends A{get spiedCommandName(){return O.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}O.commandName="disableVertexAttribArray";class I extends A{get spiedCommandName(){return I.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(e[1]+" indices"),t.push(e[2]),t}}I.commandName="drawArrays";class k extends A{get spiedCommandName(){return k.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}k.commandName="drawArraysInstanced";class M extends A{get spiedCommandName(){return M.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstancedANGLE")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}M.commandName="drawArraysInstancedANGLE";class P extends A{get spiedCommandName(){return P.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElements")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElements")),t.push(e[3]),t}}P.commandName="drawElements";class B extends A{get spiedCommandName(){return B.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstancedANGLE")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstancedANGLE")),t.push(e[3]),t.push(e[4]),t}}B.commandName="drawElementsInstancedANGLE";class U extends A{get spiedCommandName(){return U.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t}}U.commandName="drawElementsInstanced";class $ extends A{get spiedCommandName(){return $.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawRangeElements")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(p.stringifyWebGlConstant(e[4],"drawRangeElements")),t.push(e[5]),t}}$.commandName="drawRangeElements";class G extends A{get spiedCommandName(){return G.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}G.commandName="getActiveAttrib";class V extends A{get spiedCommandName(){return V.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}V.commandName="getActiveUniform";class W extends A{get spiedCommandName(){return W.commandName}stringifyResult(e){var t;if(null!=e)return null!==(t=null==e?void 0:e.toFixed(0))&&void 0!==t?t:"0"}}W.commandName="getAttribLocation";class H extends A{get spiedCommandName(){return H.commandName}stringifyResult(e){return e?"true":"false"}}H.commandName="getExtension";class j extends A{get spiedCommandName(){return j.commandName}stringifyResult(e){if(!e)return"null";const t=D.getWebGlObjectTag(e);return t?t.displayText:e}}j.commandName="getParameter";class z extends A{get spiedCommandName(){return z.commandName}stringifyResult(e){if(e)return`min: ${e.rangeMin}, max: ${e.rangeMax}, precision: ${e.precision}`}}z.commandName="getShaderPrecisionFormat";class X extends w{get spiedCommandName(){return X.commandName}stringifyResult(e){if("string"!=typeof e||0===e.trim().length)return"No messages";const t=e.split(/\r?\n/).filter(e=>e.trim().length>0).length;return t+(1===t?" message":" messages")}}X.commandName="getShaderInfoLog";class K extends A{get spiedCommandName(){return K.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}K.commandName="getTransformFeedbackVarying";class Y extends A{get spiedCommandName(){return Y.commandName}constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.program=x.getProgramData(this.options.context,t)}finally{n&&n(!0)}const r=e.program.programStatus.LINK_STATUS?"linked":"failed";e.text=`${this.spiedCommandName}: ${this.stringifyValue(t)} -> ${r}`}}Y.commandName="linkProgram";class q extends A{get spiedCommandName(){return q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"multiDrawArraysInstancedBaseInstanceWEBGL")),t.push(`drawCount=${e[9]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t}}q.commandName="multiDrawArraysInstancedBaseInstanceWEBGL";class Q extends A{get spiedCommandName(){return Q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[7]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t}}Q.commandName="multiDrawArraysInstancedWEBGL";class Z extends A{get spiedCommandName(){return Z.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[5]}`),t.push(e[2]),t.push(e[4]),t}}Z.commandName="multiDrawArraysWEBGL";class J extends A{get spiedCommandName(){return J.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[11]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t.push(e[10]),t}}J.commandName="multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL";class ee extends A{get spiedCommandName(){return ee.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[8]}`),t.push(e[2]),t.push(e[5]),t.push(e[7]),t}}ee.commandName="multiDrawElementsInstancedWEBGL";class te extends A{get spiedCommandName(){return te.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[6]}`),t.push(e[2]),t.push(e[5]),t}}te.commandName="multiDrawElementsWEBGL";class ne extends A{get spiedCommandName(){return ne.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(`baseInstance = ${e[4]}`),t}}ne.commandName="drawArraysInstancedBaseInstanceWEBGL";class re extends A{get spiedCommandName(){return re.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t.push(`baseVertex = ${e[5]}`),t.push(`baseInstance = ${e[6]}`),t}}re.commandName="drawElementsInstancedBaseVertexBaseInstanceWEBGL";class ie extends A{get spiedCommandName(){return ie.commandName}stringifyArgs(e){var t,n;const r=[];for(let i=0;i<4;i++)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");return r}}function se(e){return null==e?"":`${e.toFixed(0)} (0b${(e>>>0).toString(2)})`}ie.commandName="scissor";class oe extends A{get spiedCommandName(){return oe.commandName}stringifyArgs(e){const t=[];return t.push(se(e[0])),t}}oe.commandName="stencilMask";class ae extends A{get spiedCommandName(){return ae.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilMaskSeparate")),t.push(se(e[1])),t}}ae.commandName="stencilMaskSeparate";class le extends A{get spiedCommandName(){return le.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFunc")),t.push(se(e[1])),t.push(se(e[2])),t}}le.commandName="stencilFunc";class ue extends A{get spiedCommandName(){return ue.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFuncSeparate")),t.push(p.stringifyWebGlConstant(e[1],"stencilFuncSeparate")),t.push(se(e[2])),t.push(se(e[3])),t}}ue.commandName="stencilFuncSeparate";class ce extends A{get spiedCommandName(){return ce.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t.push(e[1]),t.push(p.stringifyWebGlConstant(e[2],"vertexAttribPointer")),t.push(e[3]),t.push(e[4]),t.push(e[5]),t}}ce.commandName="vertexAttribPointer";class he extends A{get spiedCommandName(){return he.commandName}stringifyArgs(e){const t=[];for(let n=0;n<4;n++)t.push(e[n].toFixed(0));return t}}he.commandName="viewport";class de extends A{get spiedCommandName(){return de.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}de.commandName="enableVertexAttribArray";class fe extends w{get spiedCommandName(){return fe.commandName}stringifyArgs(e){const t="string"==typeof e[1]?e[1]:"";return[this.stringifyValue(e[0]),t.length+" chars"]}transformCapture(e){super.transformCapture(e);const t=e.commandArguments[1];e.shader&&"string"==typeof t&&(e.shader.source=t,e.shader.COMPILE_STATUS=null,e.shader.translatedSource="",e.shader.infoLog="")}}fe.commandName="shaderSource";class pe{constructor(e){this.spiedCommandName=e.spiedCommandName,this.spiedCommandRunningContext=e.spiedCommandRunningContext,this.spiedCommand=this.spiedCommandRunningContext[this.spiedCommandName],y.storeOriginFunction(this.spiedCommandRunningContext,this.spiedCommandName),this.callback=e.callback,this.commandOptions={context:e.context,contextVersion:e.contextVersion,extensions:e.extensions,toggleCapture:e.toggleCapture},this.initCustomCommands(),this.initCommand()}spy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.overloadedCommand}unSpy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.spiedCommand}createCapture(e,t,n){return this.command.createCapture(e,t,n)}initCommand(){pe.customCommandsConstructors[this.spiedCommandName]?this.command=pe.customCommandsConstructors[this.spiedCommandName](this.commandOptions):this.command=new L(this.commandOptions,this.spiedCommandName),this.overloadedCommand=this.getSpy()}getSpy(){const e=this;return function(){const t=u.now,n=y.executeOriginFunction(e.spiedCommandRunningContext,e.spiedCommandName,arguments),r=u.now;try{const i={name:e.spiedCommandName,arguments,result:n,startTime:t,endTime:r};e.callback(e,i)}catch(e){}return n}}initCustomCommands(){pe.customCommandsConstructors||(pe.customCommandsConstructors={[b.commandName]:e=>new b(e),[T.commandName]:e=>new T(e),[_.commandName]:e=>new _(e),[R.commandName]:e=>new R(e),[F.commandName]:e=>new F(e),[O.commandName]:e=>new O(e),[I.commandName]:e=>new I(e),[k.commandName]:e=>new k(e),[M.commandName]:e=>new M(e),[P.commandName]:e=>new P(e),[U.commandName]:e=>new U(e),[B.commandName]:e=>new B(e),[$.commandName]:e=>new $(e),[G.commandName]:e=>new G(e),[V.commandName]:e=>new V(e),[W.commandName]:e=>new W(e),[H.commandName]:e=>new H(e),[j.commandName]:e=>new j(e),[X.commandName]:e=>new X(e),[z.commandName]:e=>new z(e),[K.commandName]:e=>new K(e),[Y.commandName]:e=>new Y(e),[q.commandName]:e=>new q(e),[Q.commandName]:e=>new Q(e),[Z.commandName]:e=>new Z(e),[J.commandName]:e=>new J(e),[ee.commandName]:e=>new ee(e),[te.commandName]:e=>new te(e),[ne.commandName]:e=>new ne(e),[re.commandName]:e=>new re(e),[ie.commandName]:e=>new ie(e),[fe.commandName]:e=>new fe(e),[oe.commandName]:e=>new oe(e),[ae.commandName]:e=>new ae(e),[le.commandName]:e=>new le(e),[ue.commandName]:e=>new ue(e),[ce.commandName]:e=>new ce(e),[he.commandName]:e=>new he(e),[de.commandName]:e=>new de(e)})}}class me{constructor(e){this.options=e,this.context=e.context,this.contextVersion=e.contextVersion,this.extensions=e.extensions,this.toggleCapture=e.toggleCapture,this.consumeCommands=this.getConsumeCommands(),this.changeCommandsByState=this.getChangeCommandsByState(),this.commandNameToStates=this.getCommandNameToStates()}get requireStartAndStopStates(){return!0}startCapture(e,t,n){return this.quickCapture=t,this.fullCapture=n,this.capturedCommandsByState={},e&&this.requireStartAndStopStates&&(this.currentState={},this.readFromContextNoSideEffects()),this.copyCurrentStateToPrevious(),this.currentState={},this.previousState}stopCapture(){return this.requireStartAndStopStates&&this.readFromContextNoSideEffects(),this.analyse(void 0),this.currentState}registerCallbacks(e){for(const t in this.changeCommandsByState)if(this.changeCommandsByState.hasOwnProperty(t))for(const n of this.changeCommandsByState[t])e[n]=e[n]||[],e[n].push(this.onChangeCommand.bind(this));for(const t of this.consumeCommands)e[t]=e[t]||[],e[t].push(this.onConsumeCommand.bind(this))}getStateData(){return this.currentState}getConsumeCommands(){return[]}getChangeCommandsByState(){return{}}copyCurrentStateToPrevious(){this.currentState&&(this.previousState=this.currentState)}onChangeCommand(e){const t=this.commandNameToStates[e.name];for(const n of t){if(!this.isValidChangeCommand(e,n))return;this.capturedCommandsByState[n]=this.capturedCommandsByState[n]||[],this.capturedCommandsByState[n].push(e)}}isValidChangeCommand(e,t){return!0}onConsumeCommand(e){this.isValidConsumeCommand(e)&&(this.readFromContextNoSideEffects(),this.analyse(e),this.storeCommandIds(),e[this.stateName]=this.currentState,this.startCapture(!1,this.quickCapture,this.fullCapture))}isValidConsumeCommand(e){return this.lastCommandName=null==e?void 0:e.name,!0}analyse(e){for(const t in this.capturedCommandsByState)if(this.capturedCommandsByState.hasOwnProperty(t)){const n=this.capturedCommandsByState[t],r=n.length-1;if(r>=0)if(e){for(let t=0;t1&&this.parameters.push(this.getWebgl2Parameters());const e={};for(let t=1;t<=this.contextVersion&&!(t>this.parameters.length);t++)if(this.parameters[t-1])for(const n of this.parameters[t-1])if(n.changeCommands)for(const t of n.changeCommands)e[n.constant.name]=e[n.constant.name]||[],e[n.constant.name].push(t);return e}readFromContext(){for(let e=1;e<=this.contextVersion&&!(e>this.parameters.length);e++)for(const t of this.parameters[e-1]){const e=this.readParameterFromContext(t);if(null==e){const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n;continue}const n=D.getWebGlObjectTag(e);if(n)this.currentState[t.constant.name]=n;else{const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n}}}readParameterFromContext(e){return e.constant.extensionName&&!this.extensions[e.constant.extensionName]?`Extension ${e.constant.extensionName} is unavailable.`:this.context.getParameter(e.constant.value)}stringifyParameterValue(e,t){if(null===e)return"null";if(void 0===e)return"undefined";if(30===t.returnType)return se(e);if("number"==typeof e&&p.isWebGlConstant(e)){if(20===t.returnType){const n=t.changeCommands&&t.changeCommands[0]||"";return p.stringifyWebGlConstant(e,n)}return e}if(e.length&&"string"!=typeof e){const t=[];for(let n=0;n1?r=this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value):this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.value)===p.RENDERBUFFER.value&&(r=e.getRenderbufferParameter(e.RENDERBUFFER,e.RENDERBUFFER_STENCIL_SIZE))):r=this.readParameterFromContext({constant:p.STENCIL_BITS}),this.currentState[p.STENCIL_BITS.name]=""+r}isValidChangeCommand(e,t){return"enable"===e.name||"disable"===e.name?e.commandArguments[0]===p.STENCIL_TEST.value:"stencilOp"===e.name||"stencilOpSeparate"===e.name?xe.stencilOpStates.indexOf(e.commandArguments[0])>0:"stencilFunc"===e.name||"stencilFuncSeparate"===e.name?xe.stencilFuncStates.indexOf(e.commandArguments[0])>0:"stencilMask"!==e.name&&"stencilMaskSeparate"!==e.name||xe.stencilMaskStates.indexOf(e.commandArguments[0])>0}getConsumeCommands(){return d}isStateEnable(e,t){return this.context.isEnabled(p.STENCIL_TEST.value)}}xe.stateName="StencilState",xe.stencilOpStates=[p.STENCIL_BACK_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_PASS.value,p.STENCIL_FAIL.value,p.STENCIL_PASS_DEPTH_FAIL.value,p.STENCIL_PASS_DEPTH_PASS.value],xe.stencilFuncStates=[p.STENCIL_BACK_FUNC.value,p.STENCIL_BACK_REF.value,p.STENCIL_BACK_VALUE_MASK.value,p.STENCIL_FUNC.value,p.STENCIL_REF.value,p.STENCIL_VALUE_MASK.value],xe.stencilMaskStates=[p.STENCIL_BACK_WRITEMASK.value,p.STENCIL_WRITEMASK.value];class we{static isSupportedCombination(e,t,n){return e=e||p.UNSIGNED_BYTE.value,((t=t||p.RGBA.value)===p.RGB.value||t===p.RGBA.value)&&(n===p.RGB.value||n===p.RGBA.value||n===p.RGBA8.value||n===p.RGBA16F.value||n===p.RGBA32F.value||n===p.RGB16F.value||n===p.RGB32F.value||n===p.R11F_G11F_B10F.value||n===p.SRGB8.value||n===p.SRGB8_ALPHA8.value)&&this.isSupportedComponentType(e)}static readPixels(e,t,n,r,i,s){e.getError(),s===p.UNSIGNED_NORMALIZED.value&&(s=p.UNSIGNED_BYTE.value);const o=r*i*4;let a;if(s===p.UNSIGNED_BYTE.value?a=new Uint8Array(o):(s=p.FLOAT.value,a=new Float32Array(o)),e.readPixels(t,n,r,i,e.RGBA,s,a),e.getError())return;if(s===p.UNSIGNED_BYTE.value)return a;const l=new Uint8Array(r*i*4);for(let e=0;e1){const e=this.context.getParameter(p.MAX_DRAW_BUFFERS.value);for(let n=0;n1?this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value):p.UNSIGNED_BYTE.value;l===p.RENDERBUFFER.value?this.readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,c,u):l===p.TEXTURE.value&&this.readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,c,u)}readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,l,u){let c=0,h=0;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,c=e.samples,h=e.internalFormat,!c&&!we.isSupportedCombination(l,p.RGBA.value,h))return}else s+=r,o+=i;if(r=i=0,c){const a=e,u=e.createRenderbuffer(),c=e.getParameter(e.RENDERBUFFER_BINDING);e.bindRenderbuffer(e.RENDERBUFFER,u),e.renderbufferStorage(e.RENDERBUFFER,h,s,o),e.bindRenderbuffer(e.RENDERBUFFER,c),e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u);const d=a.getParameter(a.READ_FRAMEBUFFER_BINDING),f=a.getParameter(a.DRAW_FRAMEBUFFER_BINDING);a.bindFramebuffer(a.READ_FRAMEBUFFER,t),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,this.captureFrameBuffer),a.blitFramebuffer(0,0,s,o,0,0,s,o,e.COLOR_BUFFER_BIT,e.NEAREST),a.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),a.bindFramebuffer(a.READ_FRAMEBUFFER,d),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,f),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t),e.deleteRenderbuffer(u)}else e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,l,u){let c=0;this.contextVersion>1&&(c=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value));const h=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL.value),d=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE.value);d>0?g[d].name:p.TEXTURE_2D.name;let f=!1,m=l;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,void 0!==e.type&&(m=e.type),f=e.target===p.TEXTURE_2D_ARRAY.name,!we.isSupportedCombination(e.type,e.format,e.internalFormat))return}else s+=r,o+=i;r=i=0,e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),c>0||f?e.framebufferTextureLayer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,u,h,c):e.framebufferTexture2D(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,d||p.TEXTURE_2D.value,u,h),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,d,c,m),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}getCapture(e,t,n,r,i,s,o,l,u){i=Math.floor(i),s=Math.floor(s);const c={attachmentName:t,src:null,textureCubeMapFace:o?g[o].name:null,textureLayer:l,raw:null};if(!this.quickCapture)try{const t=we.readPixels(e,n,r,i,s,u);if(t){c.raw=Ne.encode(t,i,s),this.workingCanvas.width=i,this.workingCanvas.height=s;const e=this.workingContext2D.createImageData(i,s);if(e.data.set(t),this.workingContext2D.putImageData(e,0,0),this.fullCapture)this.captureCanvas.width=this.workingCanvas.width,this.captureCanvas.height=this.workingCanvas.height;else{const e=i/s;e<1?(this.captureCanvas.width=Le.captureBaseSize*e,this.captureCanvas.height=Le.captureBaseSize):e>1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this.captureContext2D.drawImage(this.workingCanvas,0,0,i,s,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",c.src=Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D)}}catch(e){a.warn("Spector can not capture the visual state: "+e)}this.currentState.Attachments.push(c)}analyse(e){}}Le.stateName="VisualState",Le.captureBaseSize=256;class Oe{constructor(e){this.context=e.context,this.captureFrameBuffer=e.context.createFramebuffer(),this.workingCanvas=Fe.createCanvas(1,1),this.workingContext2D=Fe.get2DContext(this.workingCanvas),this.captureCanvas=Fe.createCanvas(1,1),this.captureContext2D=Fe.get2DContext(this.captureCanvas),Fe.setImageSmoothing(this.captureContext2D,!0)}appendTextureState(e,t,n=null,r){if(!t)return;const i=t.__SPECTOR_Object_CustomData;if(i&&(this.fullCapture=r,i.type&&(e.textureType=this.getWebGlConstant(i.type)),i.format&&(e.format=this.getWebGlConstant(i.format)),i.internalFormat&&(e.internalFormat=this.getWebGlConstant(i.internalFormat)),e.width=i.width,e.height=i.height,i.depth&&(e.depth=i.depth),n)){const r="NEAREST"===e.samplerMagFilter||"NEAREST"===e.magFilter,s=this.getTextureVisualState(n,t,i,r);if(s){e.visual=s.visual;for(const t in s.visualPixels)if(s.visualPixels.hasOwnProperty(t)){e.visualPixels=s.visualPixels;break}}}}getTextureVisualState(e,t,n,r){try{const i=this.context,s={},o={};if(!we.isSupportedCombination(n.type,n.format,n.internalFormat))return{visual:s,visualPixels:o};const a=this.context.getParameter(p.FRAMEBUFFER_BINDING.value);i.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer);try{const a=0,l=n.width,u=n.height;if(e===p.TEXTURE_3D&&n.depth){const e=i;for(let c=0;c2&&c2&&c1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}return this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this._setSmoothing(!o),this.captureContext2D.drawImage(this.workingCanvas,0,0,r,i,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",{src:Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D),raw:l}}catch(e){}return{src:void 0,raw:null}}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}_setSmoothing(e){Fe.setImageSmoothing(this.captureContext2D,e)}}Oe.captureBaseSize=64,Oe.cubeMapFaces=[p.TEXTURE_CUBE_MAP_POSITIVE_X,p.TEXTURE_CUBE_MAP_POSITIVE_Y,p.TEXTURE_CUBE_MAP_POSITIVE_Z,p.TEXTURE_CUBE_MAP_NEGATIVE_X,p.TEXTURE_CUBE_MAP_NEGATIVE_Y,p.TEXTURE_CUBE_MAP_NEGATIVE_Z];class Ie{constructor(e){this.context=e.context}getUboValue(e,t,n,r){const i=Ie.uboTypes[r];if(!i)return;const s=new i.arrayBufferView(n*i.lengthMultiplier),o=this.context,a=o.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,e);if(a){const n=o.getIndexedParameter(p.UNIFORM_BUFFER_START.value,e),r=o.getParameter(p.UNIFORM_BUFFER_BINDING.value);try{o.bindBuffer(p.UNIFORM_BUFFER.value,a),o.getBufferSubData(p.UNIFORM_BUFFER.value,n+t,s)}catch(e){return}r&&o.bindBuffer(p.UNIFORM_BUFFER.value,r)}return Array.prototype.slice.call(s)}}Ie.uboTypes={[p.BOOL.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.BOOL_VEC2.value]:{arrayBufferView:Uint8Array,lengthMultiplier:2},[p.BOOL_VEC3.value]:{arrayBufferView:Uint8Array,lengthMultiplier:3},[p.BOOL_VEC4.value]:{arrayBufferView:Uint8Array,lengthMultiplier:4},[p.INT.value]:{arrayBufferView:Int32Array,lengthMultiplier:1},[p.INT_VEC2.value]:{arrayBufferView:Int32Array,lengthMultiplier:2},[p.INT_VEC3.value]:{arrayBufferView:Int32Array,lengthMultiplier:3},[p.INT_VEC4.value]:{arrayBufferView:Int32Array,lengthMultiplier:4},[p.UNSIGNED_INT.value]:{arrayBufferView:Uint32Array,lengthMultiplier:1},[p.UNSIGNED_INT_VEC2.value]:{arrayBufferView:Uint32Array,lengthMultiplier:2},[p.UNSIGNED_INT_VEC3.value]:{arrayBufferView:Uint32Array,lengthMultiplier:3},[p.UNSIGNED_INT_VEC4.value]:{arrayBufferView:Uint32Array,lengthMultiplier:4},[p.FLOAT.value]:{arrayBufferView:Float32Array,lengthMultiplier:1},[p.FLOAT_VEC2.value]:{arrayBufferView:Float32Array,lengthMultiplier:2},[p.FLOAT_VEC3.value]:{arrayBufferView:Float32Array,lengthMultiplier:3},[p.FLOAT_VEC4.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT2x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT3.value]:{arrayBufferView:Float32Array,lengthMultiplier:9},[p.FLOAT_MAT3x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT3x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.FLOAT_MAT4.value]:{arrayBufferView:Float32Array,lengthMultiplier:16},[p.FLOAT_MAT4x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT4x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.SAMPLER_2D.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.SAMPLER_CUBE.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1}};class ke extends S{get typeName(){return"WebGLBuffer"}}class Me extends S{get typeName(){return"WebGLFramebuffer"}}class Pe extends S{get typeName(){return"WebGLProgram"}static saveInGlobalStore(e){const t=D.getWebGlObjectTag(e);t&&(this.store[t.id]=e)}static getFromGlobalStore(e){return this.store[e]}static updateInGlobalStore(e,t){if(!t)return;const n=this.getFromGlobalStore(e);if(!n)return;const r=D.getWebGlObjectTag(n);r&&(D.attachWebGlObjectTag(t,r),this.store[r.id]=t)}}Pe.store={};class Be extends S{get typeName(){return"WebGLQuery"}}class Ue extends S{get typeName(){return"WebGLRenderbuffer"}}class $e extends S{get typeName(){return"WebGLSampler"}}class Ge extends S{get typeName(){return"WebGLShader"}}class Ve extends S{get typeName(){return"WebGLSync"}}class We extends S{get typeName(){return"WebGLTexture"}}class He extends S{get typeName(){return"WebGLTransformFeedback"}}class je extends S{get typeName(){return"WebGLUniformLocation"}}class ze extends S{get typeName(){return"WebGLVertexArrayObject"}}class Xe extends me{get stateName(){return Xe.stateName}get requireStartAndStopStates(){return!1}constructor(e){super(e),this.drawCallTextureInputState=new Oe(e),this.drawCallUboInputState=new Ie(e)}getConsumeCommands(){return d}getChangeCommandsByState(){return{}}readFromContext(){var e,t;const n=this.context.getParameter(p.CURRENT_PROGRAM.value);if(!n)return;this.currentState.frameBuffer=this.readFrameBufferFromContext();const r=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData:x.getProgramData(this.context,n);if(this.currentState.programStatus=Object.assign({},r.programStatus),this.currentState.programStatus.program=this.getSpectorData(n),this.currentState.programStatus.RECOMPILABLE=o.isBuildableProgram(n),this.currentState.programStatus.RECOMPILABLE&&Pe.saveInGlobalStore(n),this.currentState.shaders=r.shaders,(null===(e=this.lastCommandName)||void 0===e?void 0:e.indexOf("Elements"))>=0){const e=this.context.getParameter(this.context.ELEMENT_ARRAY_BUFFER_BINDING);e&&(this.currentState.elementArray={},this.currentState.elementArray.arrayBuffer=this.getSpectorData(e))}const i=this.context.getProgramParameter(n,p.ACTIVE_ATTRIBUTES.value);this.currentState.attributes=[];for(let e=0;e1){const e=this.context.getProgramParameter(n,p.ACTIVE_UNIFORM_BLOCKS.value);this.currentState.uniformBlocks=[];for(let t=0;t1){const e=this.context;t.colorAttachments=[];const n=e.getParameter(p.MAX_DRAW_BUFFERS.value);for(let e=0;e1&&(r.alphaSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE.value),r.blueSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE.value),r.encoding=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.value)),r.componentType=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value)),r.depthSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE.value),r.greenSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE.value),r.redSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_RED_SIZE.value),r.stencilSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value),n===p.TEXTURE.value&&(r.textureLayer=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value))),r}readAttributeFromContext(e,t){const n=this.context.getActiveAttrib(e,t),r=this.context.getAttribLocation(e,n.name);if(-1===r)return{name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:-1};const i=this.context.getVertexAttrib(r,p.CURRENT_VERTEX_ATTRIB.value),s=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING.value),o={name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:r,offsetPointer:this.context.getVertexAttribOffset(r,p.VERTEX_ATTRIB_ARRAY_POINTER.value),bufferBinding:this.getSpectorData(s),enabled:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_ENABLED.value),arraySize:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_SIZE.value),stride:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_STRIDE.value),arrayType:this.getWebGlConstant(this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_TYPE.value)),normalized:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_NORMALIZED.value),vertexAttrib:Array.prototype.slice.call(i)};return this.extensions[p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.extensionName]?o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.value):this.contextVersion>1&&(o.integer=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_INTEGER.value),o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR.value)),this.appendBufferCustomData(o,s),o}readUniformFromContext(e,t){const n=this.context.getActiveUniform(e,t),r=this.context.getUniformLocation(e,n.name);if(r){if(n.size>1&&n.name&&n.name.indexOf("[0]")===n.name.length-3){const t=[];for(let r=0;r1){r.baseLevel=this.context.getTexParameter(t.value,p.TEXTURE_BASE_LEVEL.value),r.immutable=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_FORMAT.value),r.immutableLevels=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_LEVELS.value),r.maxLevel=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LEVEL.value);const e=this.context.getParameter(p.SAMPLER_BINDING.value);if(e){r.sampler=this.getSpectorData(e);const t=this.context;r.samplerMaxLod=t.getSamplerParameter(e,p.TEXTURE_MAX_LOD.value),r.samplerMinLod=t.getSamplerParameter(e,p.TEXTURE_MIN_LOD.value),r.samplerCompareFunc=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_FUNC.value)),r.samplerCompareMode=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_MODE.value)),r.samplerWrapS=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_S.value)),r.samplerWrapT=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_T.value)),r.samplerWrapR=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_R.value)),r.samplerMagFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MAG_FILTER.value)),r.samplerMinFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MIN_FILTER.value))}else r.maxLod=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LOD.value),r.minLod=this.context.getTexParameter(t.value,p.TEXTURE_MIN_LOD.value),r.compareFunc=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_FUNC.value)),r.compareMode=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_MODE.value)),r.wrapR=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_WRAP_R.value))}const i=this.getTextureStorage(t);if(i){const e=this.quickCapture?null:t;this.drawCallTextureInputState.appendTextureState(r,i,e,this.fullCapture)}return this.context.activeTexture(n),r}getTextureStorage(e){return e===p.TEXTURE_2D?this.context.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP?this.context.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):e===p.TEXTURE_3D?this.context.getParameter(p.TEXTURE_BINDING_3D.value):e===p.TEXTURE_2D_ARRAY?this.context.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):void 0}readUniformsFromContextIntoState(e,t,n,r){const i=this.context,s=i.getActiveUniforms(e,t,p.UNIFORM_TYPE.value),o=i.getActiveUniforms(e,t,p.UNIFORM_SIZE.value),a=i.getActiveUniforms(e,t,p.UNIFORM_BLOCK_INDEX.value),l=i.getActiveUniforms(e,t,p.UNIFORM_OFFSET.value),u=i.getActiveUniforms(e,t,p.UNIFORM_ARRAY_STRIDE.value),c=i.getActiveUniforms(e,t,p.UNIFORM_MATRIX_STRIDE.value),h=i.getActiveUniforms(e,t,p.UNIFORM_IS_ROW_MAJOR.value);for(let d=0;d-1&&(t.blockName=i.getActiveUniformBlockName(e,t.blockIndice)),t.offset=l[d],t.arrayStride=u[d],t.matrixStride=c[d],t.rowMajor=h[d],t.blockIndice>-1){const e=r[a[d]].bindingPoint;t.value=this.drawCallUboInputState.getUboValue(e,t.offset,t.size,s[d])}}}readTransformFeedbackFromContext(e,t){const n=this.context,r=n.getTransformFeedbackVarying(e,t),i=n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value,t),s={name:r.name,size:r.size,type:this.getWebGlConstant(r.type),buffer:this.getSpectorData(i),bufferSize:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_SIZE.value,t),bufferStart:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_START.value,t)};return this.appendBufferCustomData(s,i),s}readUniformBlockFromContext(e,t){const n=this.context,r=n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_BINDING.value),i=n.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,r),s={name:n.getActiveUniformBlockName(e,t),bindingPoint:r,size:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_DATA_SIZE.value),activeUniformCount:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_ACTIVE_UNIFORMS.value),vertex:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER.value),fragment:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER.value),buffer:this.getSpectorData(i)};return this.appendBufferCustomData(s,i),s}appendBufferCustomData(e,t){if(t){const n=t.__SPECTOR_Object_CustomData;n&&(n.usage&&(e.bufferUsage=this.getWebGlConstant(n.usage)),e.bufferLength=n.length,n.offset&&(e.bufferOffset=n.offset),n.sourceLength&&(e.bufferSourceLength=n.sourceLength))}}getWebGlConstant(e){const t=g[e];return t?t.name:e}}Xe.stateName="DrawCall",Xe.samplerTypes={[p.SAMPLER_2D.value]:p.TEXTURE_2D,[p.SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.SAMPLER_3D.value]:p.TEXTURE_3D,[p.SAMPLER_2D_SHADOW.value]:p.TEXTURE_2D,[p.SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_2D_ARRAY_SHADOW.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_CUBE_SHADOW.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.UNSIGNED_INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.UNSIGNED_INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.UNSIGNED_INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.UNSIGNED_INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY};class Ke{constructor(e){this.contextInformation=e,this.stateTrackers=[],this.onCommandCapturedCallbacks={},this.initStateTrackers()}startCapture(e,t,n){for(const r of this.stateTrackers){const i=r.startCapture(!0,t,n);r.requireStartAndStopStates&&(e.initState[r.stateName]=i)}}stopCapture(e){for(const t of this.stateTrackers){const n=t.stopCapture();t.requireStartAndStopStates&&(e.endState[t.stateName]=n)}}captureState(e){const t=this.onCommandCapturedCallbacks[e.name];if(t)for(const n of t)n(e)}initStateTrackers(){this.stateTrackers.push(new Ee(this.contextInformation),new ve(this.contextInformation),new Ce(this.contextInformation),new De(this.contextInformation),new Se(this.contextInformation),new Ae(this.contextInformation),new _e(this.contextInformation),new ye(this.contextInformation),new be(this.contextInformation),new Te(this.contextInformation),new Re(this.contextInformation),new xe(this.contextInformation),new Le(this.contextInformation),new Xe(this.contextInformation));for(const e of this.stateTrackers)e.registerCallbacks(this.onCommandCapturedCallbacks)}}class Ye{static initializeByteSizeFormat(){this.byteSizePerInternalFormat||(this.byteSizePerInternalFormat={[p.R8.value]:1,[p.R16F.value]:2,[p.R32F.value]:4,[p.R8UI.value]:1,[p.RG8.value]:2,[p.RG16F.value]:4,[p.RG32F.value]:8,[p.ALPHA.value]:1,[p.RGB.value]:3,[p.RGBA.value]:4,[p.LUMINANCE.value]:1,[p.LUMINANCE_ALPHA.value]:2,[p.DEPTH_COMPONENT.value]:1,[p.DEPTH_STENCIL.value]:2,[p.SRGB_EXT.value]:3,[p.SRGB_ALPHA_EXT.value]:4,[p.RGB8.value]:3,[p.SRGB8.value]:3,[p.RGB565.value]:2,[p.R11F_G11F_B10F.value]:4,[p.RGB9_E5.value]:2,[p.RGB16F.value]:6,[p.RGB32F.value]:12,[p.RGB8UI.value]:3,[p.RGBA8.value]:4,[p.RGB5_A1.value]:2,[p.RGBA16F.value]:8,[p.RGBA32F.value]:16,[p.RGBA8UI.value]:4,[p.COMPRESSED_R11_EAC.value]:4,[p.COMPRESSED_SIGNED_R11_EAC.value]:4,[p.COMPRESSED_RG11_EAC.value]:4,[p.COMPRESSED_SIGNED_RG11_EAC.value]:4,[p.COMPRESSED_RGB8_ETC2.value]:4,[p.COMPRESSED_RGBA8_ETC2_EAC.value]:4,[p.COMPRESSED_SRGB8_ETC2.value]:4,[p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC.value]:4,[p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_RGB_S3TC_DXT1_EXT.value]:.5,[p.COMPRESSED_RGBA_S3TC_DXT3_EXT.value]:1,[p.COMPRESSED_RGBA_S3TC_DXT5_EXT.value]:1,[p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGB_ETC1_WEBGL.value]:.5,[p.COMPRESSED_RGB_ATC_WEBGL.value]:.5,[p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL.value]:1,[p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL.value]:1})}constructor(e){this.options=e,this.createCommandNames=this.getCreateCommandNames(),this.updateCommandNames=this.getUpdateCommandNames(),this.deleteCommandNames=this.getDeleteCommandNames(),this.startTime=u.now,this.memoryPerSecond={},this.totalMemory=0,this.frameMemory=0,this.capturing=!1,Ye.initializeByteSizeFormat()}registerCallbacks(e){for(const t of this.createCommandNames)e[t]=e[t]||[],e[t].push(this.createWithoutSideEffects.bind(this));for(const t of this.updateCommandNames)e[t]=e[t]||[],e[t].push(this.updateWithoutSideEffects.bind(this));for(const t of this.deleteCommandNames)e[t]=e[t]||[],e[t].push(this.deleteWithoutSideEffects.bind(this))}startCapture(){this.frameMemory=0,this.capturing=!0}stopCapture(){this.frameMemory=0,this.capturing=!1}appendRecordedInformation(e){e.frameMemory[this.objectName]=this.frameMemory,e.memory[this.objectName]=this.memoryPerSecond}create(e){}createWithoutSideEffects(e){this.options.toggleCapture(!1);try{this.create(e)}finally{this.options.toggleCapture(!0)}}updateWithoutSideEffects(e){if(e&&0!==e.arguments.length){this.options.toggleCapture(!1);try{const t=e.arguments[0],n=this.getBoundInstance(t);if(!n)return;if(!D.getWebGlObjectTag(n))return;const r=this.getWebGlConstant(t),i=this.update(e,r,n);this.changeMemorySize(i)}finally{this.options.toggleCapture(!0)}}}deleteWithoutSideEffects(e){if(!e||!e.arguments||e.arguments.length<1)return;const t=e.arguments[0];if(t){this.options.toggleCapture(!1);try{const e=this.delete(t);this.changeMemorySize(-e)}finally{this.options.toggleCapture(!0)}}}changeMemorySize(e){this.totalMemory+=e,this.capturing&&(this.frameMemory+=e);const t=u.now-this.startTime,n=Math.round(t/1e3);this.memoryPerSecond[n]=this.totalMemory}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}getByteSizeForInternalFormat(e){return Ye.byteSizePerInternalFormat[e]||4}readPixelStoreState(){const e=this.options.context,t={UNPACK_FLIP_Y_WEBGL:e.getParameter(p.UNPACK_FLIP_Y_WEBGL.value),UNPACK_PREMULTIPLY_ALPHA_WEBGL:e.getParameter(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL.value),UNPACK_COLORSPACE_CONVERSION_WEBGL:e.getParameter(p.UNPACK_COLORSPACE_CONVERSION_WEBGL.value),UNPACK_ALIGNMENT:e.getParameter(p.UNPACK_ALIGNMENT.value)};return e instanceof WebGL2RenderingContext&&(t.UNPACK_ROW_LENGTH=e.getParameter(p.UNPACK_ROW_LENGTH.value),t.UNPACK_IMAGE_HEIGHT=e.getParameter(p.UNPACK_IMAGE_HEIGHT.value),t.UNPACK_SKIP_PIXELS=e.getParameter(p.UNPACK_SKIP_PIXELS.value),t.UNPACK_SKIP_ROWS=e.getParameter(p.UNPACK_SKIP_ROWS.value),t.UNPACK_SKIP_IMAGES=e.getParameter(p.UNPACK_SKIP_IMAGES.value)),t}}class qe extends Ye{get objectName(){return"Buffer"}getCreateCommandNames(){return["createBuffer"]}getUpdateCommandNames(){return["bufferData"]}getDeleteCommandNames(){return["deleteBuffer"]}getBoundInstance(e){const t=this.options.context;return e===p.ARRAY_BUFFER.value?t.getParameter(p.ARRAY_BUFFER_BINDING.value):e===p.ELEMENT_ARRAY_BUFFER.value?t.getParameter(p.ELEMENT_ARRAY_BUFFER_BINDING.value):e===p.COPY_READ_BUFFER.value?t.getParameter(p.COPY_READ_BUFFER_BINDING.value):e===p.COPY_WRITE_BUFFER.value?t.getParameter(p.COPY_WRITE_BUFFER_BINDING.value):e===p.TRANSFORM_FEEDBACK_BUFFER.value?t.getParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value):e===p.UNIFORM_BUFFER.value?t.getParameter(p.UNIFORM_BUFFER_BINDING.value):e===p.PIXEL_PACK_BUFFER.value?t.getParameter(p.PIXEL_PACK_BUFFER_BINDING.value):e===p.PIXEL_UNPACK_BUFFER.value?t.getParameter(p.PIXEL_UNPACK_BUFFER_BINDING.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(t,e);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){const n=this.getLength(t);return t.arguments.length>=4?{target:e,length:n,usage:t.arguments[2],offset:t.arguments[3],sourceLength:t.arguments[1]?t.arguments[1].length:-1}:3===t.arguments.length?{target:e,length:n,usage:t.arguments[2]}:void 0}getLength(e){const t=e.arguments[1],n=e.arguments[3],r=e.arguments[4];if("number"==typeof t)return t;if("number"==typeof r&&r>0)return r;const i=t.byteLength||t.length||0;return"number"==typeof n&&n>0?i-n:i}}class Qe extends Ye{get objectName(){return"Renderbuffer"}getCreateCommandNames(){return["createRenderbuffer"]}getUpdateCommandNames(){return["renderbufferStorage","renderbufferStorageMultisample"]}getDeleteCommandNames(){return["deleteRenderbuffer"]}getBoundInstance(e){const t=this.options.context;if(e===p.RENDERBUFFER.value)return t.getParameter(p.RENDERBUFFER_BINDING.value)}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(e,t);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return r.length=r.width*r.height*this.getByteSizeForInternalFormat(r.internalFormat),n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){return 4===e.arguments.length?{target:t,internalFormat:e.arguments[1],width:e.arguments[2],height:e.arguments[3],length:0,samples:0}:{target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,samples:e.arguments[1]}}}class Ze extends Ye{get objectName(){return"Texture2d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage2D","compressedTexImage2D","texStorage2D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D.value?t.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP_POSITIVE_X.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Y.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Z.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_X.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Y.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Z.value?t.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target===p.TEXTURE_2D_ARRAY.name||t.target===p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else{const e="TEXTURE_2D"===t?1:6;let n=r.internalFormat;n===p.RGBA.value&&(r.type===p.FLOAT.value&&(n=p.RGBA32F.value),r.type===p.HALF_FLOAT_OES.value&&(n=p.RGBA16F.value)),r.length=r.width*r.height*e*this.getByteSizeForInternalFormat(n)}return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage2D"===e.name?this.getTexImage2DCustomData(e,t,n):"compressedTexImage2D"===e.name?this.getCompressedTexImage2DCustomData(e,t,n):"texStorage2D"===e.name?this.getTexStorage2DCustomData(e,t,n):void 0}getTexStorage2DCustomData(e,t,n){let r;return 5===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!1}),r}getCompressedTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=7&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!0}),r}getTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8?r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],format:e.arguments[6],type:e.arguments[7],length:0,isCompressed:!1}:6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[5].width,height:e.arguments[5].height,format:e.arguments[3],type:e.arguments[4],length:0,isCompressed:!1}),r}}class Je extends Ye{get objectName(){return"Texture3d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage3D","compressedTexImage3D","texStorage3D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D_ARRAY.value?t.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):e===p.TEXTURE_3D.value?t.getParameter(p.TEXTURE_BINDING_3D.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target!==p.TEXTURE_2D_ARRAY.name&&t.target!==p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){if(e.arguments.length>=2&&0!==e.arguments[1])return 0;const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else r.length=r.width*r.height*r.depth*this.getByteSizeForInternalFormat(r.internalFormat);return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage3D"===e.name?this.getTexImage3DCustomData(e,t,n):"compressedTexImage3D"===e.name?this.getCompressedTexImage3DCustomData(e,t,n):"texStorage3D"===e.name?this.getTexStorage3DCustomData(e,t,n):void 0}getTexStorage3DCustomData(e,t,n){let r;return 6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!1}),r}getCompressedTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!0}),r}getTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=9&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],format:e.arguments[7],type:e.arguments[8],length:0,isCompressed:!1}),r}}class et extends Ye{get objectName(){return"Program"}getCreateCommandNames(){return["createProgram"]}getUpdateCommandNames(){return["linkProgram"]}getDeleteCommandNames(){return["deleteProgram"]}getBoundInstance(e){return e}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){if(e.arguments.length>=1&&!e.arguments[0])return 0;const r=this.getCustomData(n);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e){const t=this.options.context;return x.getProgramData(t,e)}}class tt{constructor(e){this.contextInformation=e,this.onCommandCallbacks={},this.recorders=[],this.initRecorders()}recordCommand(e){const t=this.onCommandCallbacks[e.name];if(t)for(const n of t)n(e)}startCapture(){for(const e of this.recorders)e.startCapture()}stopCapture(){for(const e of this.recorders)e.stopCapture()}appendRecordedInformation(e){for(const t of this.recorders)t.appendRecordedInformation(e)}initRecorders(){this.recorders.push(new qe(this.contextInformation),new Qe(this.contextInformation),new Ze(this.contextInformation),new Je(this.contextInformation),new et(this.contextInformation));for(const e of this.recorders)e.registerCallbacks(this.onCommandCallbacks)}}class nt{constructor(e){this.contextInformation=e,this.webGlObjects=[],this.initWebglObjects()}tagWebGlObjects(e){for(const t of this.webGlObjects){for(let n=0;n0&&this.currentCapture.commands.length===this.maxCommands&&this.onMaxCommand.trigger(this)}}}spyContext(e){const t=[];for(const n in e)n&&t.push(n);for(let n=0;n{this.spyRequestAnimationFrame("requestAnimationFrame",e.display)})}spyRequestAnimationFrame(e,t){const n=this;y.storeOriginFunction(t,e),t[e]=function(){const r=arguments[0],i=n.getCallback(n,r,()=>{n.spiedScope[e](r)});return y.executeOriginFunction(t,e,[i])}}spySetTimer(e){const t=this,n=this.spiedScope,r="setTimeout"===e;y.storeOriginFunction(n,e),n[e]=function(){const i=arguments[0],s=arguments[1],o=Array.prototype.slice.call(arguments);return at.setTimerCommonValues.indexOf(s)>-1&&(o[0]=t.getCallback(t,i,r?()=>{n[e](i)}:null)),y.executeOriginFunction(n,e,o)}}getCallback(e,t,n=null){return function(){const r=u.now;if(e.lastFrame=++e.lastFrame%e.speedRatio,e.willPlayNextFrame||e.speedRatio&&!e.lastFrame){try{e.onFrameStart.trigger(e)}catch(t){e.onError.trigger(t)}try{t.apply(e.spiedScope,arguments)}catch(t){e.onError.trigger(t)}e.lastSixtyFramesCurrentIndex=(e.lastSixtyFramesCurrentIndex+1)%at.fpsWindowSize,e.lastSixtyFramesDuration[e.lastSixtyFramesCurrentIndex]=r-e.lastSixtyFramesPreviousStart;try{e.onFrameEnd.trigger(e)}catch(t){e.onError.trigger(t)}e.willPlayNextFrame=!1}else n&&n();e.lastSixtyFramesPreviousStart=r}}}at.requestAnimationFrameFunctions=["requestAnimationFrame","msRequestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame"],at.setTimerFunctions=["setTimeout","setInterval"],at.setTimerCommonValues=[0,15,16,33,32,40],at.fpsWindowSize=60;class lt{constructor(e){this.canvas=e,this.onContextRequested=new l,this.init()}init(){const e=this,t=function(){const t="undefined"!=typeof HTMLCanvasElement&&this instanceof HTMLCanvasElement?HTMLCanvasElement:OffscreenCanvas,n=e.canvas?y.executeOriginFunction(this,"getContext",arguments):y.executePrototypeOriginFunction(this,t,"getContext",arguments);if(arguments.length>0){const e=arguments[0];if("webgl"!==e&&"experimental-webgl"!==e&&"webgl2"!==e&&"experimental-webgl2"!==e)return n}if(n){const t=Array.prototype.slice.call(arguments),r="webgl2"===t[0]||"experimental-webgl2"===t[0]?2:1;e.onContextRequested.trigger({context:n,contextVersion:r})}return n};this.canvas?(y.storeOriginFunction(this.canvas,"getContext"),this.canvas.getContext=t):("undefined"!=typeof HTMLCanvasElement&&(y.storePrototypeOriginFunction(HTMLCanvasElement,"getContext"),HTMLCanvasElement.prototype.getContext=t),"undefined"!=typeof OffscreenCanvas&&(y.storePrototypeOriginFunction(OffscreenCanvas,"getContext"),OffscreenCanvas.prototype.getContext=t))}}class ut{static startIntercepting(e){if(ut.intercepting||"undefined"==typeof Worker)return;const t=Worker,n=new Proxy(t,{construct(t,r,i){if(ut.workerProxy!==n)return Reflect.construct(t,r,i);const s=r[0],o="string"==typeof s?s:"Worker",a=e=>(ut.spiedWorkers.push({worker:e,originalUrl:o}),e),l=()=>a(Reflect.construct(t,r,i));if(i!==n||"string"!=typeof s||r.length>2||void 0!==r[1])return l();let u;try{const t="undefined"==typeof document?location.href:document.baseURI,n=new URL(s,t);if(e&&/^https?:$/.test(n.protocol)&&n.origin===location.origin){const r=new URL(e,t).href;n.hash="";const i=new XMLHttpRequest;if(i.open("GET",n.href,!1),i.send(),ut.isJavaScriptResponse(i,n.href)&&!i.getResponseHeader("Content-Security-Policy")&&!i.getResponseHeader("Content-Security-Policy-Report-Only")&&ut.shouldInjectSource(i.responseText)){const e=new XMLHttpRequest;if(e.open("GET",r,!1),e.send(),ut.isJavaScriptResponse(e,r)){const e="try { importScripts("+JSON.stringify(r)+'); } catch (e) { console.warn("[Spector.js] Worker auto-injection failed:", e); }\n';u=URL.createObjectURL(new Blob([e,i.responseText],{type:"application/javascript"}))}}}}catch(e){console.warn("[Spector.js] Could not inject into Worker ("+o+"):",e)}if(u){let e;try{e=Reflect.construct(t,[u],i)}catch(e){return URL.revokeObjectURL(u),l()}return setTimeout(()=>URL.revokeObjectURL(u),5e3),a(e)}return l()}});globalThis.Worker=n,ut.originalWorkerConstructor=t,ut.workerProxy=n,ut.intercepting=!0}static stopIntercepting(){if(!ut.intercepting)return;const e=ut.workerProxy;if(ut.workerProxy=void 0,ut.intercepting=!1,globalThis.Worker===e)try{globalThis.Worker=ut.originalWorkerConstructor}catch(e){}}static isJavaScriptResponse(e,t){const n=(e.getResponseHeader("Content-Type")||"").split(";")[0].trim();return 200===e.status&&e.responseURL===t&&/^(?:text|application)\/(?:x-)?(?:java|ecma)script$/i.test(n)}static shouldInjectSource(e){return!/\b(?:import|importScripts|Worker|SharedWorker|location|fetch|Request|XMLHttpRequest|WebSocket|EventSource|crossOriginIsolated|SharedArrayBuffer|Atomics|WebAssembly|eval|Function)\b|\\u|["']use strict["']|^(?:\uFEFF)?#!/.test(e)}static getSpiedWorkers(){return ut.spiedWorkers}static isIntercepting(){return ut.intercepting}}ut.spiedWorkers=[],ut.intercepting=!1;class ct{static getDelay(){return ct.delayMs}static setDelay(e){ct.delayMs="number"==typeof e&&e>0?e:0}static shouldForceIncomplete(e,t,n,r){return!(r<=0)&&e===p.COMPLETION_STATUS_KHR.value&&void 0!==t&&n-tthis._state,this.subscribe=e=>(this._listeners.add(e),()=>{this._listeners.delete(e)}),this._state=e}setState(e){this._state=e(this._state),this._emitChange()}setSnapshot(e){this._state=e,this._emitChange()}_emitChange(){for(const e of this._listeners)e()}}function pt(e){return(0,dt.useSyncExternalStore)(e.subscribe,e.getSnapshot)}var mt=n(848);const gt=(0,dt.createContext)(null);function Et(){const e=(0,dt.useContext)(gt);if(!e)throw new Error("CaptureMenuContext not provided — CaptureMenuRoot must be rendered inside CaptureMenuContext.Provider");return e}function vt({canvas:e}){const t=Et();return(0,mt.jsx)("li",{onClick:()=>t.handleCanvasSelected(e),children:(0,mt.jsx)("span",{children:`Id: ${e.id} - Size: ${e.width}*${e.height}`})})}function Ct(){const e=Et(),t=pt(e.store),n=t.selectedCanvas?`${t.selectedCanvas.id} (${t.selectedCanvas.width}*${t.selectedCanvas.height})`:"Choose Canvas...";return(0,mt.jsxs)("div",{className:"canvasListComponent",children:[(0,mt.jsx)("span",{commandName:"onCanvasSelection",onClick:e.handleCanvasListToggle,children:n}),(0,mt.jsx)("ul",{style:{display:t.showCanvasList?"block":"none",visibility:t.showCanvasList?"visible":"hidden"},children:t.canvases.map((e,t)=>(0,mt.jsx)(vt,{canvas:e},e.id||t))})]})}function Dt(){const e=Et(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"captureMenuActionsComponent",children:[(0,mt.jsx)("div",{commandName:"onCaptureRequested",onClick:e.handleCaptureRequested}),t.isPlaying?(0,mt.jsx)("div",{commandName:"onPauseRequested",onClick:e.handlePauseRequested}):(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("div",{commandName:"onPlayRequested",onClick:e.handlePlayRequested}),(0,mt.jsx)("div",{commandName:"onPlayNextFrameRequested",onClick:e.handlePlayNextFrameRequested})]})]})}function St(){const e=pt(Et().store);return(0,mt.jsxs)("span",{className:"fpsCounterComponent",children:[e.fps.toFixed(2)," Fps"]})}function At(){const e=pt(Et().store);return(0,mt.jsxs)("div",{children:[(0,mt.jsxs)("div",{className:"captureMenuComponent "+(e.visible?"active":""),children:[(0,mt.jsx)(Ct,{}),(0,mt.jsx)(Dt,{}),(0,mt.jsx)(St,{})]}),(0,mt.jsx)("div",{className:"captureMenuLogComponent "+(e.logVisible?"active":""),children:(0,mt.jsx)("span",{className:e.logLevel===i.error?"error":"",children:e.logText})})]})}class _t{constructor(e={}){this.options=e,this.handleCanvasListToggle=()=>{this.store.getSnapshot(),this.store.setState(e=>Object.assign(Object.assign({},e),{selectedCanvas:null,showCanvasList:!e.showCanvasList,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!e.showCanvasList&&!this._hideLog})),this.onCanvasSelected.trigger(null),this._isTrackingCanvas&&this.trackPageCanvases()},this.handleCanvasSelected=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{selectedCanvas:e,showCanvasList:!1,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)},this.handleCaptureRequested=()=>{const e=this.getSelectedCanvasInformation();e&&this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.PleaseWaitHelpText,logVisible:!this._hideLog})),setTimeout(()=>{this.onCaptureRequested.trigger(e)},200)},this.handlePauseRequested=()=>{this.onPauseRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!1}))},this.handlePlayRequested=()=>{this.onPlayRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!0}))},this.handlePlayNextFrameRequested=()=>{this.onPlayNextFrameRequested.trigger(this.getSelectedCanvasInformation())},this._rootPlaceHolder=e.rootPlaceHolder||document.body,this._hideLog=!!e.hideLog,this._isTrackingCanvas=!1,this._extraCanvasEntries=[],this.onCanvasSelected=new l,this.onCaptureRequested=new l,this.onPauseRequested=new l,this.onPlayRequested=new l,this.onPlayNextFrameRequested=new l,this.store=new ft({visible:!0,logText:_t.SelectCanvasHelpText,logLevel:i.info,logVisible:!this._hideLog,canvases:[],selectedCanvas:null,showCanvasList:!1,isPlaying:!0,fps:0}),this._container=document.createElement("div"),this._container.className="spector-react-capture-menu",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(gt.Provider,{value:this},(0,dt.createElement)(At)))}getSelectedCanvasInformation(){return this.store.getSnapshot().selectedCanvas}trackPageCanvases(){if(this._isTrackingCanvas=!0,document.body){const e=document.body.querySelectorAll("canvas");this.updateCanvasesList(e)}}updateCanvasesList(e){const t=[];for(let n=0;nObject.assign(Object.assign({},n),{canvases:t,selectedCanvas:e,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}captureComplete(e){e?this.store.setState(t=>Object.assign(Object.assign({},t),{logLevel:i.error,logText:e,logVisible:!this._hideLog})):this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog}))}setFPS(e){this.store.setState(t=>Object.assign(Object.assign({},t),{fps:e}))}_updateCanvasesInternal(e){for(const t of this._extraCanvasEntries)e.push(t);this.store.getSnapshot().showCanvasList?this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e})):1===e.length?(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:e[0],logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e[0])):(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:null,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(null))}}_t.SelectCanvasHelpText="Please, select a canvas in the list above.",_t.ActionsHelpText="Record with the red button, you can also pause or continue playing the current scene.",_t.PleaseWaitHelpText="Capturing, be patient (this can take up to 3 minutes)...";const yt=(0,dt.createContext)(null);function bt(){const e=(0,dt.useContext)(yt);if(!e)throw new Error("ResultViewContext not provided — ResultViewRoot must be rendered inside ResultViewContext.Provider");return e}function Tt(){const e=bt(),t=pt(e.store),n=(0,dt.useRef)(null),r=(0,dt.useCallback)(e=>{e.preventDefault();const t=e.currentTarget.parentElement,n=t.parentElement;if(!n)return;const r=n.querySelectorAll("li:not(.resultViewMenuSmall)");if("true"===t.getAttribute("open")){t.setAttribute("open","false");for(let e=0;e{e.handleSearchTextChange(t.target.value)},[e]),s=(0,dt.useCallback)(t=>{t.stopPropagation(),e.handleSearchTextChange("")},[e]),o=(0,dt.useCallback)(t=>n=>{n.preventDefault(),e.handleMenuStatusChange(t)},[e]),a=(0,dt.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),e.handleClose()},[e]);return(0,mt.jsxs)("ul",{className:"resultViewMenuComponent",ref:n,children:[(0,mt.jsx)("li",{className:"resultViewMenuOpen resultViewMenuSmall",children:(0,mt.jsx)("a",{href:"#",role:"button",onClick:r,children:"Menu"})}),(0,mt.jsxs)("li",{className:"searchContainer",children:[(0,mt.jsx)("input",{type:"text",placeholder:"Search...",value:t.searchText,commandName:"onSearchTextChanged",commandEventBinding:"change",onChange:i}),(0,mt.jsx)("a",{className:"clearSearch",commandName:"onSearchTextCleared",onClick:s,children:"X"})]}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:0===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCapturesClicked",onClick:o(0),children:"Captures"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:10===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInformationClicked",onClick:o(10),children:"Information"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:20===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInitStateClicked",onClick:o(20),children:"Init State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:40===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCommandsClicked",onClick:o(40),children:"Commands"+(t.commandCount>0?" ("+t.commandCount+")":"")})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:60===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCompareClicked",onClick:o(60),children:"Compare"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:30===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onEndStateClicked",onClick:o(30),children:"End State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{role:"button",commandName:"onCloseClicked",onClick:a,children:"Close"})})]})}function Rt({children:e}){return(0,mt.jsx)("div",{className:"resultViewContentComponent",children:e})}function xt({capture:e,active:t,onCaptureSelected:n,onSaveRequested:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),r()},[r]),s=(0,dt.useCallback)(()=>{n()},[n]),o=new Date(e.startTime).toTimeString().split(" ")[0];return(0,mt.jsxs)("li",{className:t?"active":"",onClick:s,children:[e.endState.VisualState.Attachments?e.endState.VisualState.Attachments.map((e,t)=>(0,mt.jsx)("img",{src:encodeURI(e.src)},t)):(0,mt.jsx)("span",{children:e.endState.VisualState.FrameBufferStatus}),(0,mt.jsxs)("span",{children:[o,(0,mt.jsx)("a",{href:"#",className:"captureListItemSave",commandName:"onSaveRequested",onClick:i})]})]})}function wt({active:e,captures:t,onCaptureSelected:n,onSaveRequested:r,onCaptureLoaded:i}){const s=(0,dt.useRef)(null),o=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault()},[]),l=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),function(e,t){let n=null;if(e&&e.dataTransfer&&e.dataTransfer.files&&(n=e.dataTransfer.files),e&&e.target&&e.target.files&&(n=e.target.files),n&&n.length>0)for(let e=0;e{a.error("Error while reading file: "+r.name+e)},i.onload=e=>{try{const n=JSON.parse(e.target.result);t(n)}catch(e){a.error("Error while reading file: "+r.name+e)}},i.readAsText(r)}}(e.nativeEvent,i)},[i]);return(0,mt.jsxs)("div",{className:"captureListComponent "+(e?"active":""),children:[(0,mt.jsx)("div",{className:"openCaptureFile",ref:s,onDragEnter:o,onDragOver:o,onDrop:l,children:(0,mt.jsx)("span",{children:"Drag files here to open a previously saved capture."})}),(0,mt.jsx)("ul",{children:t.map((e,t)=>(0,mt.jsx)(xt,{capture:e.capture,active:e.active,onCaptureSelected:()=>n(t),onSaveRequested:()=>r(e.capture)},t))})]})}function Ft({children:e}){return(0,mt.jsx)("div",{className:"visualStateListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Nt({item:e,onVisualStateSelected:t}){const n=(0,dt.useRef)(null);(0,dt.useEffect)(()=>{e.active&&n.current&&setTimeout(()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const r=(0,dt.useCallback)(()=>{t()},[t]),i=e.VisualState;return(0,mt.jsxs)("li",{ref:n,className:e.active?"active":"",onClick:r,commandName:"onVisualStateSelected",children:[i.Attachments?i.Attachments.map((e,t)=>e.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{src:encodeURI(e.src)}),i.Attachments.length>1&&(0,mt.jsx)("span",{children:e.attachmentName}),!!e.textureLayer&&(0,mt.jsx)("span",{children:"Layer: "+e.textureLayer}),!!e.textureCubeMapFace&&(0,mt.jsx)("span",{children:e.textureCubeMapFace})]},t):null):(0,mt.jsx)("span",{children:i.FrameBufferStatus}),(0,mt.jsx)("span",{children:i.FrameBuffer?"Frame buffer: "+i.FrameBuffer.__SPECTOR_Object_TAG.id:"Canvas frame buffer"})]})}function Lt({children:e}){return(0,mt.jsx)("div",{className:"commandListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Ot({command:e,onCommandSelected:t,onVertexSelected:n,onFragmentSelected:r,onShaderSelected:i}){var s;const o=(0,dt.useRef)(null),a=e.capture,l=function(e){switch(e){case 50:return"deprecated";case 10:return"unused";case 20:return"disabled";case 30:return"redundant";case 40:return"valid";default:return"unknown"}}(a.status),u=!!a.VisualState;let c="";u&&(c=" drawCall"),e.active&&(c=" active"),(0,dt.useEffect)(()=>{e.active&&o.current&&setTimeout(()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const h=(0,dt.useCallback)(e=>{t()},[t]),d=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==n||n()},[n]),f=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==r||r()},[r]),p=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==i||i()},[i]);let m=null;if(u&&"clear"!==a.name)try{const e=a.DrawCall.shaders[0],t=a.DrawCall.shaders[1];m=(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("a",{href:"#",onClick:d,children:e.name}),(0,mt.jsx)("a",{href:"#",onClick:f,children:t.name})]})}catch(e){}const g=(null===(s=a.shader)||void 0===s?void 0:s.source)?(0,mt.jsx)("a",{href:"#",commandName:"onShaderSourceSelected",onClick:p,children:"Source"}):null;return(0,mt.jsxs)("li",{ref:o,className:c,onClick:h,commandName:"onCommandSelected",children:[a.marker&&(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.marker+" "}),"LOG"===a.name?(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.text+" "}):(0,mt.jsx)("span",{dangerouslySetInnerHTML:{__html:a.text.replace(a.name,`${a.name}`)}}),g,m]})}function It({children:e}){return(0,mt.jsx)("div",{className:"commandDetailComponent",children:e})}function kt({left:e,children:t}){return(0,mt.jsx)("div",{className:e?"informationColumnLeftComponent":"informationColumnRightComponent",children:t})}function Mt({children:e}){return(0,mt.jsx)("div",{className:"jsonContentComponent",children:e})}function Pt(e,t,n,r){return{row:Math.max(0,parseInt(t,10)-1),column:n?Math.max(0,parseInt(n,10)-1):0,text:r.trim()||e,type:e.toLowerCase()}}var Bt,Ut,$t=Object.create,Gt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor,Wt=Object.getOwnPropertyNames,Ht=Object.getPrototypeOf,jt=Object.prototype.hasOwnProperty,zt=e=>{throw TypeError(e)},Xt=(e,t)=>{for(var n in t)Gt(e,n,{get:t[n],enumerable:!0})},Kt=(e,t,n)=>(((e,t)=>{t.has(e)||zt("Cannot access private method")})(e,t),n),Yt=(Bt=e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=/\r\n|[\n\r\u2028\u2029]/;e.codeFrameColumns=function(e,n,r={}){let i=new Proxy({},{get:()=>e=>e}),s=e.split(t),{start:o,end:a,markerLines:l}=function(e,t,n){let r=Object.assign({column:0,line:-1},e.start),i=Object.assign({},r,e.end),{linesAbove:s=2,linesBelow:o=3}=n||{},a=r.line,l=r.column,u=i.line,c=i.column,h=Math.max(a-(s+1),0),d=Math.min(t.length,u+o);-1===a&&(h=0),-1===u&&(d=t.length);let f=u-a,p={};if(f)for(let e=0;e<=f;e++){let n=e+a;if(l)if(0===e){let e=t[n-1].length;p[n]=[l,e-l+1]}else if(e===f)p[n]=[0,c];else{let r=t[n-e].length;p[n]=[0,r]}else p[n]=!0}else p[a]=l===c?!l||[l,0]:[l,c-l];return{start:h,end:d,markerLines:p}}(n,s,r),u=n.start&&"number"==typeof n.start.column,c=String(a).length,h=e.split(t,a).slice(o,a).map((e,t)=>{let n=o+1+t,s=` ${` ${n}`.slice(-c)} |`,a=l[n],u=!l[n+1];if(a){let t="";if(Array.isArray(a)){let n=e.slice(0,Math.max(a[0]-1,0)).replace(/[^\t]/g," "),o=a[1]||1;t=["\n ",i.gutter(s.replace(/\d/g," "))," ",n,i.marker("^").repeat(o)].join(""),u&&r.message&&(t+=" "+i.message(r.message))}return[i.marker(">"),i.gutter(s),e.length>0?` ${e}`:"",t].join("")}return` ${i.gutter(s)}${e.length>0?` ${e}`:""}`}).join("\n");return r.message&&!u&&(h=`${" ".repeat(c+1)}${r.message}\n${h}`),h}},()=>(Ut||Bt((Ut={exports:{}}).exports),Ut.exports));Xt({},{__debug:()=>Hs,check:()=>Vs,doc:()=>vs,format:()=>Gs,formatWithCursor:()=>$s,getSupportInfo:()=>Ws,util:()=>_s,version:()=>As});var qt=(e,t,n,r)=>{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Qt=class{diff(e,t,n={}){let r;"function"==typeof n?(r=n,n={}):"callback"in n&&(r=n.callback);let i=this.castInput(e,n),s=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),a=this.removeEmpty(this.tokenize(s,n));return this.diffWithOptionsObj(o,a,n,r)}diffWithOptionsObj(e,t,n,r){var i;let s=e=>(e=this.postProcess(e,n),r?void setTimeout(function(){r(e)},0):e),o=t.length,a=e.length,l=1,u=o+a;null!=n.maxEditLength&&(u=Math.min(u,n.maxEditLength));let c=null!==(i=n.timeout)&&void 0!==i?i:1/0,h=Date.now()+c,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=a&&f+1>=o)return s(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,g=()=>{for(let r=Math.max(p,-l);r<=Math.min(m,l);r+=2){let i,l=d[r-1],u=d[r+1];l&&(d[r-1]=void 0);let c=!1;if(u){let e=u.oldPos-r;c=u&&0<=e&&e=a&&f+1>=o)return s(this.buildValues(i.lastComponent,t,e))||!0;d[r]=i,i.oldPos+1>=a&&(m=Math.min(m,r-1)),f+1>=o&&(p=Math.max(p,r+1))}else d[r]=void 0}l++};if(r)!function e(){setTimeout(function(){if(l>u||Date.now()>h)return r(void 0);g()||e()},0)}();else for(;l<=u&&Date.now()<=h;){let e=g();if(e)return e}}addToPath(e,t,n,r,i){let s=e.lastComponent;return s&&!i.oneChangePerToken&&s.added===t&&s.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:s.count+1,added:t,removed:n,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:s}}}extractCommon(e,t,n,r,i){let s=t.length,o=n.length,a=e.oldPos,l=a-r,u=0;for(;l+1e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(a,a+e.count));a+=e.count,e.added||(l+=e.count)}}return i}},Zt=new class extends Qt{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Jt(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}function en(e,t){let n;switch(t){case"\n":n=/\n/gu;break;case"\r":n=/\r/gu;break;case"\r\n":n=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let r=e.match(n);return r?r.length:0}var tn="string",nn="array",rn="cursor",sn="indent",on="align",an="trim",ln="group",un="fill",cn="if-break",hn="indent-if-break",dn="line-suffix",fn="line-suffix-boundary",pn="line",mn="label",gn="break-parent",En=new Set([rn,sn,on,an,ln,un,cn,hn,dn,fn,pn,mn,gn]),vn=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},Cn=function(e){if("string"==typeof e)return tn;if(Array.isArray(e))return nn;if(!e)return;let{type:t}=e;return En.has(t)?t:void 0};var Dn=class extends Error{name="InvalidDocError";constructor(e){super(function(e){let t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(Cn(e))throw new Error("doc is valid.");let n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;let r=(e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e))([...En].map(e=>`'${e}'`));return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},Sn=Dn,An={},_n=function(e,t,n,r){let i=[e];for(;i.length>0;){let e=i.pop();if(e===An){n(i.pop());continue}n&&i.push(e,An);let s=Cn(e);if(!s)throw new Sn(e);if(!1!==(null==t?void 0:t(e)))switch(s){case nn:case un:{let t=s===nn?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case cn:i.push(e.flatContents,e.breakContents);break;case ln:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case on:case sn:case hn:case mn:case dn:i.push(e.contents);break;case tn:case rn:case an:case fn:case pn:case gn:break;default:throw new Sn(e)}}};function yn(e,t){if("string"==typeof e)return t(e);let n=new Map;return function e(r){if(n.has(r))return n.get(r);let i=function(n){switch(Cn(n)){case nn:return t(n.map(e));case un:return t({...n,parts:n.parts.map(e)});case cn:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case ln:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case on:case sn:case hn:case mn:case dn:return t({...n,contents:e(n.contents)});case tn:case rn:case an:case fn:case pn:case gn:return t(n);default:throw new Sn(n)}}(r);return n.set(r,i),i}(e)}function bn(e,t,n){let r=n,i=!1;return _n(e,function(e){if(i)return!1;let n=t(e);void 0!==n&&(i=!0,r=n)}),r}function Tn(e){if(e.type===ln&&e.break||e.type===pn&&e.hard||e.type===gn)return!0}function Rn(e){if(e.length>0){let t=vn(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function xn(e){return e.type!==pn||e.hard?e.type===cn?e.flatContents:e:e.soft?"":" "}function wn(e){for(e=[...e];e.length>=2&&vn(!1,e,-2).type===pn&&vn(!1,e,-1).type===gn;)e.length-=2;if(e.length>0){let t=Fn(vn(!1,e,-1));e[e.length-1]=t}return e}function Fn(e){switch(Cn(e)){case sn:case hn:case ln:case dn:case mn:{let t=Fn(e.contents);return{...e,contents:t}}case cn:return{...e,breakContents:Fn(e.breakContents),flatContents:Fn(e.flatContents)};case un:return{...e,parts:wn(e.parts)};case nn:return wn(e);case tn:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return tfunction(e){switch(Cn(e)){case un:if(e.parts.every(e=>""===e))return"";break;case ln:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===ln&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case on:case sn:case hn:case dn:if(!e.contents)return"";break;case cn:if(!e.flatContents&&!e.breakContents)return"";break;case nn:{let t=[];for(let n of e){if(!n)continue;let[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof vn(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case tn:case rn:case an:case fn:case pn:case mn:case gn:break;default:throw new Sn(e)}return e}(e))}(e))}function Ln(e){if(e.type===pn)return!0}function On(e,t){return e.type===mn?{...e,contents:t(e.contents)}:t(e)}var In=()=>{},kn=In,Mn=In,Pn=In;function Bn(e){return kn(e),{type:sn,contents:e}}function Un(e,t){return kn(t),{type:on,contents:t,n:e}}function $n(e,t={}){return kn(e),Mn(t.expandedStates,!0),{type:ln,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Gn(e){return kn(e),{type:dn,contents:e}}var Vn={type:fn},Wn={type:gn},Hn={type:an},jn={type:pn,hard:!0},zn={type:pn,hard:!0,literal:!0},Xn={type:pn},Kn={type:pn,soft:!0},Yn=[jn,Wn],qn=[zn,Wn],Qn={type:rn};function Zn(e,t){kn(e),Mn(t);let n=[];for(let r=0;r0){for(let e=0;e!(function(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}(e)||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e)),nr=/[^\x20-\x7F]/u,rr=function(e){if(!e)return 0;if(!nr.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(let n of e){let e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=tr(e)?1:2)}return t},ir=Symbol("MODE_BREAK"),sr=Symbol("MODE_FLAT"),or=Symbol("cursor"),ar=Symbol("DOC_FILL_PRINTED_LENGTH");function lr(e,t){return cr(e,{type:"indent"},t)}function ur(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?cr(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:cr(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function cr(e,t,n){let r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t],i="",s=0,o=0,a=0;for(let e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function hr(e){let t=0,n=0,r=e.length;e:for(;r--;){let i=e[r];if(i!==or)for(let n=i.length-1;n>=0;n--){let s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(or);return t}function dr(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length,a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}let{mode:e,doc:u}=a.pop(),c=Cn(u);switch(c){case tn:l.push(u),n-=rr(u);break;case nn:case un:{let t=c===nn?u:u.parts,n=u[ar]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case sn:case on:case hn:case mn:a.push({mode:e,doc:u.contents});break;case an:n+=hr(l);break;case ln:{if(s&&u.break)return!1;let t=u.break?ir:e,n=u.expandedStates&&t===ir?vn(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case cn:{let t=(u.groupId?i[u.groupId]||sr:e)===ir?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case pn:if(e===ir||u.hard)return!0;u.soft||(l.push(" "),n--);break;case dn:r=!0;break;case fn:if(r)return!1}}return!1}function fr(e,t){let n={},r=t.printWidth,i=Jt(t.endOfLine),s=0,o=[{ind:{value:"",length:0,queue:[]},mode:ir,doc:e}],a=[],l=!1,u=[],c=0;for(function(e){let t=new Set,n=[];_n(e,function(e){if(e.type===gn&&Rn(n),e.type===ln){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===ln&&n.pop().break&&Rn(n)},!0)}(e);o.length>0;){let{ind:e,mode:h,doc:d}=o.pop();switch(Cn(d)){case tn:{let e="\n"!==i?qt(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=rr(e));break}case nn:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case rn:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(or),c++;break;case sn:o.push({ind:lr(e,t),mode:h,doc:d.contents});break;case on:o.push({ind:ur(e,d.n,t),mode:h,doc:d.contents});break;case an:s-=hr(a);break;case ln:switch(h){case sr:if(!l){o.push({ind:e,mode:d.break?ir:sr,doc:d.contents});break}case ir:{l=!1;let t={ind:e,mode:sr,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&dr(t,o,i,a,n))o.push(t);else if(d.expandedStates){let t=vn(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:ir,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:ir,doc:t});break}{let t=d.expandedStates[r],s={ind:e,mode:sr,doc:t};if(dr(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:ir,doc:d.contents});break}}d.id&&(n[d.id]=vn(!1,o,-1).mode);break;case un:{let t=r-s,i=d[ar]??0,{parts:a}=d,l=a.length-i;if(0===l)break;let c=a[i+0],f=a[i+1],p={ind:e,mode:sr,doc:c},m={ind:e,mode:ir,doc:c},g=dr(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}let E={ind:e,mode:sr,doc:f},v={ind:e,mode:ir,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}let C=a[i+2],D={ind:e,mode:h,doc:{...d,[ar]:i+2}};dr({ind:e,mode:sr,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case cn:case hn:{let t=d.groupId?n[d.groupId]:h;if(t===ir){let t=d.type===cn?d.breakContents:d.negate?d.contents:Bn(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===sr){let t=d.type===cn?d.flatContents:d.negate?Bn(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case dn:u.push({ind:e,mode:h,doc:d.contents});break;case fn:u.length>0&&o.push({ind:e,mode:h,doc:jn});break;case pn:switch(h){case sr:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case ir:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=hr(a),a.push(i+e.value),s=e.length)}break;case mn:o.push({ind:e,mode:h,doc:d.contents});break;case gn:break;default:throw new Sn(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}let h=a.indexOf(or);if(-1!==h){let e=a.indexOf(or,h+1);if(-1===e)return{formatted:a.filter(e=>e!==or).join("")};let t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}var pr,mr,gr,Er=function(e,t,n=0){let r=0;for(let i=n;i=0;n-=2)if(!Array.isArray(t[n])&&--e<0)return n;return-1},gr=function*(){let{stack:e}=this;for(let t=e.length-3;t>=0;t-=2){let n=e[t];Array.isArray(n)||(yield n)}};var vr=class{constructor(e){((e,t)=>{t.has(e)?zt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,void 0)})(this,pr),this.stack=[e]}get key(){let{stack:e,siblings:t}=this;return vn(!1,e,null===t?-2:-4)??null}get index(){return null===this.siblings?null:vn(!1,this.stack,-2)}get node(){return vn(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return null!==this.siblings}get siblings(){let{stack:e}=this,t=vn(!1,e,-3);return Array.isArray(t)?t:null}get next(){let{siblings:e}=this;return null===e?null:e[this.index+1]}get previous(){let{siblings:e}=this;return null===e?null:e[this.index-1]}get isFirst(){return 0===this.index}get isLast(){let{siblings:e,index:t}=this;return null!==e&&t===e.length-1}get isRoot(){return 1===this.stack.length}get root(){return this.stack[0]}get ancestors(){return[...Kt(this,pr,gr).call(this)]}getName(){let{stack:e}=this,{length:t}=e;return t>1?vn(!1,e,-2):null}getValue(){return vn(!1,this.stack,-1)}getNode(e=0){let t=Kt(this,pr,mr).call(this,e);return-1===t?null:this.stack[t]}getParentNode(e=0){return this.getNode(e+1)}call(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{return e(this)}finally{n.length=r}}callParent(e,t=0){let n=Kt(this,pr,mr).call(this,t+1),r=this.stack.splice(n+1);try{return e(this)}finally{this.stack.push(...r)}}each(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{for(let t=0;t{n[r]=e(t,r,i)},...t),n}match(...e){let t=this.stack.length-1,n=null,r=this.stack[t--];for(let i of e){if(void 0===r)return!1;let e=null;if("number"==typeof n&&(e=n,n=this.stack[t--],r=this.stack[t--]),i&&!i(r,n,e))return!1;n=this.stack[t--],r=this.stack[t--]}return!0}findAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return t}hasAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return!0;return!1}},Cr=new Proxy(()=>{},{get:()=>Cr}),Dr=Cr;function*Sr(e,t){let{getVisitorKeys:n,filter:r=()=>!0}=t,i=e=>function(e){return null!==e&&"object"==typeof e}(e)&&r(e);for(let t of n(e)){let n=e[t];if(Array.isArray(n))for(let e of n)i(e)&&(yield e);else i(n)&&(yield n)}}function Ar(e){return(t,n,r)=>{let i=!(null==r||!r.backwards);if(!1===n)return!1;let{length:s}=t,o=n;for(;o>=0&&oObject.keys(e).filter(e=>!wr.has(e)),Nr=function(e){return e?t=>e(t,wr):Fr};function Lr(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=function(e){let t=e.type||e.kind||"(unknown type)",n=String(e.name||e.id&&("object"==typeof e.id?e.id.name:e.id)||e.key&&("object"==typeof e.key?e.key.name:e.key)||e.value&&("object"==typeof e.value?"":String(e.value))||e.operator||"");return n.length>20&&(n=n.slice(0,19)+"…"),t+(n?" "+n:"")}(e)}function Or(e,t){t.leading=!0,t.trailing=!1,Lr(e,t)}function Ir(e,t,n){t.leading=!1,t.trailing=!1,n&&(t.marker=n),Lr(e,t)}function kr(e,t){t.leading=!1,t.trailing=!0,Lr(e,t)}var Mr=new WeakMap;function Pr(e,t){if(Mr.has(e))return Mr.get(e);let{printer:{getCommentChildNodes:n,canAttachComment:r,getVisitorKeys:i},locStart:s,locEnd:o}=t;if(!r)return[];let a=((null==n?void 0:n(e,t))??[...Sr(e,{getVisitorKeys:Nr(i)})]).flatMap(e=>r(e)?[e]:Pr(e,t));return a.sort((e,t)=>s(e)-s(t)||o(e)-o(t)),Mr.set(e,a),a}function Br(e,t,n,r){let i,s,{locStart:o,locEnd:a}=n,l=o(t),u=a(t),c=Pr(e,n),h=0,d=c.length;for(;h>1,r=c[e],f=o(r),p=a(r);if(f<=l&&u<=p)return Br(r,t,n,r);if(p<=l)i=r,h=e+1;else{if(!(u<=f))throw new Error("Comment location overlaps with node location");s=r,d=e}}if("TemplateLiteral"===(null==r?void 0:r.type)){let{quasis:e}=r,o=Hr(e,t,n);i&&Hr(e,i,n)!==o&&(i=null),s&&Hr(e,s,n)!==o&&(s=null)}return{enclosingNode:r,precedingNode:i,followingNode:s}}var Ur=()=>!1,$r=e=>!/[\S\n\u2028\u2029]/u.test(e);function Gr(e,t,n,r){let{comment:i,precedingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=o(i);if(s)for(let t=r-1;t>=0;t--){let{comment:r,precedingNode:i}=n[t];if(i!==s||!$r(e.slice(a(r),l)))break;l=o(r)}return xr(e,l,{backwards:!0})}function Vr(e,t,n,r){let{comment:i,followingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=a(i);if(s)for(let t=r+1;t0;--s){let{comment:i,precedingNode:u,followingNode:c}=e[s-1];Dr.strictEqual(u,o),Dr.strictEqual(c,a);let h=t.originalText.slice(t.locEnd(i),l);if(!((null==(r=(n=t.printer).isGap)?void 0:r.call(n,h,t))??/^[\s(]*$/u.test(h)))break;l=t.locStart(i)}for(let[t,{comment:n}]of e.entries())t1&&e.comments.sort((e,n)=>t.locStart(e)-t.locStart(n));e.length=0}function Hr(e,t,n){let r=n.locStart(t)-1;for(let t=1;t"string"==typeof e||"function"==typeof e,choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>"string"==typeof e||"object"==typeof e,cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:"Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.",cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:"Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.",cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function qr({plugins:e=[],showDeprecated:t=!1}={}){let n=e.flatMap(e=>e.languages??[]),r=[];for(let i of function(e){let t=[];for(let[n,r]of Object.entries(e)){let e={name:n,...r};Array.isArray(e.default)&&(e.default=vn(!1,e.default,-1).value),t.push(e)}return t}(Object.assign({},...e.map(({options:e})=>e),Yr)))!t&&i.deprecated||(Array.isArray(i.choices)&&(t||(i.choices=i.choices.filter(e=>!e.deprecated)),"parser"===i.name&&(i.choices=[...i.choices,...Qr(i.choices,n,e)])),i.pluginDefaults=Object.fromEntries(e.filter(e=>{var t;return void 0!==(null==(t=e.defaultOptions)?void 0:t[i.name])}).map(e=>[e.name,e.defaultOptions[i.name]])),r.push(i));return{languages:n,options:r}}function*Qr(e,t,n){let r=new Set(e.map(e=>e.value));for(let e of t)if(e.parsers)for(let t of e.parsers)if(!r.has(t)){r.add(t);let i=n.find(e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t)),s=e.name;null!=i&&i.name&&(s+=` (plugin: ${i.name})`),yield{value:t,description:s}}}var Zr,Jr,ei,ti,ni,ri="windows"===(null==(Zr=globalThis.Deno)?void 0:Zr.build.os)||(null==(ei=null==(Jr=globalThis.navigator)?void 0:Jr.platform)?void 0:ei.startsWith("Win"))||(null==(ni=null==(ti=globalThis.process)?void 0:ti.platform)?void 0:ni.startsWith("win"))||!1;function ii(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function si(e,t){if(!t)return;let n=(e=>String(e).split(/[/\\]/u).pop())(t).toLowerCase();return e.find(({filenames:e})=>null==e?void 0:e.some(e=>e.toLowerCase()===n))??e.find(({extensions:e})=>null==e?void 0:e.some(e=>n.endsWith(e)))}function oi(e,t){if(t){if(String(t).startsWith("file:"))try{t=function(e){return ri?function(e){e=ii(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return""!==e.hostname&&(t=`\\\\${e.hostname}${t}`),t}(e):function(e){return e=ii(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}(e)}(t)}catch{return}if("string"==typeof t)return e.find(({isSupported:e})=>null==e?void 0:e({filepath:t}))}}var ai=function(e,t){let n=((e,t)=>{if(!e||null!=t)return t.toReversed||!Array.isArray(t)?t.toReversed():[...t].reverse()})(!1,e.plugins).flatMap(e=>e.languages??[]),r=function(e,t){if(t)return e.find(({name:e})=>e.toLowerCase()===t)??e.find(({aliases:e})=>null==e?void 0:e.includes(t))??e.find(({extensions:e})=>null==e?void 0:e.includes(`.${t}`))}(n,t.language)??si(n,t.physicalFile)??si(n,t.file)??oi(n,t.physicalFile)??oi(n,t.file)??void t.physicalFile;return null==r?void 0:r.parsers[0]},li={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(e=>li.value(e)).join(", ")}]`;let t=Object.keys(e);return 0===t.length?"{}":`{ ${t.map(t=>`${li.key(t)}: ${li.value(e[t])}`).join(", ")} }`},pair:({key:e,value:t})=>li.value({[e]:t})},ui=new Proxy(String,{get:()=>ui}),ci=ui,hi=Symbol.for("vnopts.VALUE_NOT_EXIST"),di=Symbol.for("vnopts.VALUE_UNCHANGED"),fi=" ".repeat(2);function pi(e,t,n,r){return[`Invalid ${ci.red(r.key(e))} value.`,`Expected ${ci.blue(n)},`,`but received ${t===hi?ci.gray("nothing"):ci.red(r.value(t))}.`].join(" ")}function mi({text:e,list:t},n){let r=[];return e&&r.push(`- ${ci.blue(e)}`),t&&r.push([`- ${ci.blue(t.title)}:`].concat(t.values.map(e=>mi(e,n-fi.length).replace(/^|\n/g,`$&${fi}`))).join("\n")),gi(r,n)}function gi(e,t){if(1===e.length)return e[0];let[n,r]=e,[i,s]=e.map(e=>e.split("\n",1)[0].length);return i>t&&i>s?r:n}var Ei=[],vi=[],Ci=(e,t,{descriptor:n,logger:r,schemas:i})=>{let s=[`Ignored unknown option ${ci.yellow(n.pair({key:e,value:t}))}.`],o=Object.keys(i).sort().find(t=>function(e,t){if(e===t)return 0;let n=e;e.length>t.length&&(e=t,t=n);let r=e.length,i=t.length;for(;r>0&&e.charCodeAt(~-r)===t.charCodeAt(~-i);)r--,i--;let s=0;for(;sa?u>a?a+1:u:u>l?l+1:u;return a}(e,t)<3);o&&s.push(`Did you mean ${ci.blue(n.key(o))}?`),r.warn(s.join(" "))},Di=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"],Si=class{static create(e){return function(e,t){let n=new e(t),r=Object.create(n);for(let e of Di)e in t&&(r[e]=Ai(t[e],n,Si.prototype[e].length));return r}(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,t){return!1}deprecated(e,t){return!1}forward(e,t){}redirect(e,t){}overlap(e,t,n){return e}preprocess(e,t){return e}postprocess(e,t){return di}};function Ai(e,t,n){return"function"==typeof e?(...r)=>e(...r.slice(0,n-1),t,...r.slice(n-1)):()=>e}var _i=class extends Si{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},yi=class extends Si{expected(){return"anything"}validate(){return!0}},bi=class extends Si{constructor({valueSchema:e,name:t=e.name,...n}){super({...n,name:t}),this._valueSchema=e}expected(e){let{text:t,list:n}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:t&&`an array of ${t}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(e,t){if(!Array.isArray(e))return!1;let n=[];for(let r of e){let e=t.normalizeValidateResult(this._valueSchema.validate(r,t),r);!0!==e&&n.push(e.value)}return 0===n.length||{value:n}}deprecated(e,t){let n=[];for(let r of e){let e=t.normalizeDeprecatedResult(this._valueSchema.deprecated(r,t),r);!1!==e&&n.push(...e.map(({value:e})=>({value:[e]})))}return n}forward(e,t){let n=[];for(let r of e){let e=t.normalizeForwardResult(this._valueSchema.forward(r,t),r);n.push(...e.map(Ti))}return n}redirect(e,t){let n=[],r=[];for(let i of e){let e=t.normalizeRedirectResult(this._valueSchema.redirect(i,t),i);"remain"in e&&n.push(e.remain),r.push(...e.redirect.map(Ti))}return 0===n.length?{redirect:r}:{redirect:r,remain:n}}overlap(e,t){return e.concat(t)}};function Ti({from:e,to:t}){return{from:[e],to:t}}var Ri=class extends Si{expected(){return"true or false"}validate(e){return"boolean"==typeof e}};function xi(e,t){let n=Object.create(null);for(let r of e){let e=r[t];if(n[e])throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n[e]=r}return n}function wi(e,t){if(e===t)return 0;let n=typeof e,r=typeof t,i=["undefined","object","boolean","number","string"];return n!==r?i.indexOf(n)-i.indexOf(r):"string"!==n?Number(e)-Number(t):e.localeCompare(t)}function Fi(e){return void 0===e?{}:e}function Ni(e){if("string"==typeof e)return{text:e};let{text:t,list:n}=e;return function(e){if(!e)throw new Error("Unexpected `expected` result, there should be at least one field.")}(void 0!==(t||n)),n?{text:t,list:{title:n.title,values:n.values.map(Ni)}}:{text:t}}function Li(e,t){return!0===e||(!1===e?{value:t}:e)}function Oi(e,t,n=!1){return!1!==e&&(!0===e?!!n||[{value:t}]:"value"in e?[e]:0!==e.length&&e)}function Ii(e,t){return"string"==typeof e||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function ki(e,t){return void 0===e?[]:Array.isArray(e)?e.map(e=>Ii(e,t)):[Ii(e,t)]}function Mi(e,t){let n=ki("object"==typeof e&&"redirect"in e?e.redirect:e,t);return 0===n.length?{remain:t,redirect:n}:"object"==typeof e&&"remain"in e?{remain:e.remain,redirect:n}:{redirect:n}}var Pi,Bi=class extends Si{constructor(e){super(e),this._choices=function(e,t){let n=new Map;for(let r of e){let e=r[t];if(n.has(e))throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n.set(e,r)}return n}(e.choices.map(e=>e&&"object"==typeof e?e:{value:e}),"value")}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(e=>this._choices.get(e)).filter(({hidden:e})=>!e).map(e=>e.value).sort(wi).map(e.value),n=t.slice(0,-2),r=t.slice(-2);return{text:n.concat(r.join(" or ")).join(", "),list:{title:"one of the following values",values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return!(!t||!t.deprecated)&&{value:e}}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},Ui=class extends Si{expected(){return"a number"}validate(e,t){return"number"==typeof e}},$i=class extends Ui{expected(){return"an integer"}validate(e,t){return!0===t.normalizeValidateResult(super.validate(e,t),e)&&function(e){return e===Math.floor(e)}(e)}},Gi=class extends Si{expected(){return"a string"}validate(e){return"string"==typeof e}},Vi=li,Wi=Ci,Hi=(e,t,n)=>{let{text:r,list:i}=n.normalizeExpectedResult(n.schemas[e].expected(n)),s=[];return r&&s.push(pi(e,t,r,n.descriptor)),i&&s.push([pi(e,t,i.title,n.descriptor)].concat(i.values.map(e=>mi(e,n.loggerPrintWidth))).join("\n")),gi(s,n.loggerPrintWidth)},ji=(e,t,{descriptor:n})=>{let r=[`${ci.yellow("string"==typeof e?n.key(e):n.pair(e))} is deprecated`];return t&&r.push(`we now treat it as ${ci.blue("string"==typeof t?n.key(t):n.pair(t))}`),r.join("; ")+"."},zi=class{constructor(e,t){let{logger:n=console,loggerPrintWidth:r=80,descriptor:i=Vi,unknown:s=Wi,invalid:o=Hi,deprecated:a=ji,missing:l=()=>!1,required:u=()=>!1,preprocess:c=e=>e,postprocess:h=()=>di}=t||{};this._utils={descriptor:i,logger:n||{warn:()=>{}},loggerPrintWidth:r,schemas:xi(e,"name"),normalizeDefaultResult:Fi,normalizeExpectedResult:Ni,normalizeDeprecatedResult:Oi,normalizeForwardResult:ki,normalizeRedirectResult:Mi,normalizeValidateResult:Li},this._unknownHandler=s,this._invalidHandler=function(e){return(...t)=>{let n=e(...t);return"string"==typeof n?new Error(n):n}}(o),this._deprecatedHandler=a,this._identifyMissing=(e,t)=>!(e in t)||l(e,t),this._identifyRequired=u,this._preprocess=c,this._postprocess=h,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=function(){let e=Object.create(null);return t=>{let n=JSON.stringify(t);return!!e[n]||(e[n]=!0,!1)}}()}normalize(e){let t={},n=[this._preprocess(e,this._utils)],r=()=>{for(;0!==n.length;){let e=n.shift(),r=this._applyNormalization(e,t);n.push(...r)}};r();for(let e of Object.keys(this._utils.schemas)){let r=this._utils.schemas[e];if(!(e in t)){let t=Fi(r.default(this._utils));"value"in t&&n.push({[e]:t.value})}}r();for(let e of Object.keys(this._utils.schemas)){if(!(e in t))continue;let n=this._utils.schemas[e],r=t[e],i=n.postprocess(r,this._utils);i!==di&&(this._applyValidation(i,e,n),t[e]=i)}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let n=[],{knownKeys:r,unknownKeys:i}=this._partitionOptionKeys(e);for(let i of r){let r=this._utils.schemas[i],s=r.preprocess(e[i],this._utils);this._applyValidation(s,i,r);let o=({from:e,to:t})=>{n.push("string"==typeof t?{[t]:e}:{[t.key]:t.value})},a=({value:e,redirectTo:t})=>{let n=Oi(r.deprecated(e,this._utils),s,!0);if(!1!==n)if(!0===n)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,t,this._utils));else for(let{value:e}of n){let n={key:i,value:e};if(!this._hasDeprecationWarned(n)){let r="string"==typeof t?{key:t,value:e}:t;this._utils.logger.warn(this._deprecatedHandler(n,r,this._utils))}}};ki(r.forward(s,this._utils),s).forEach(o);let l=Mi(r.redirect(s,this._utils),s);if(l.redirect.forEach(o),"remain"in l){let e=l.remain;t[i]=i in t?r.overlap(t[i],e,this._utils):e,a({value:e})}for(let{from:e,to:t}of l.redirect)a({value:e,redirectTo:t})}for(let r of i){let i=e[r];this._applyUnknownHandler(r,i,t,(e,t)=>{n.push({[e]:t})})}return n}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,hi,this._utils)}_partitionOptionKeys(e){let[t,n]=function(e,t){let n=[],r=[];for(let i of e)t(i)?n.push(i):r.push(i);return[n,r]}(Object.keys(e).filter(t=>!this._identifyMissing(t,e)),e=>e in this._utils.schemas);return{knownKeys:t,unknownKeys:n}}_applyValidation(e,t,n){let r=Li(n.validate(e,this._utils),e);if(!0!==r)throw this._invalidHandler(t,r.value,this._utils)}_applyUnknownHandler(e,t,n,r){let i=this._unknownHandler(e,t,this._utils);if(i)for(let e of Object.keys(i)){if(this._identifyMissing(e,i))continue;let t=i[e];e in this._utils.schemas?r(e,t):n[e]=t}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==di){if(t.delete)for(let n of t.delete)delete e[n];if(t.override){let{knownKeys:n,unknownKeys:r}=this._partitionOptionKeys(t.override);for(let r of n){let n=t.override[r];this._applyValidation(n,r,this._utils.schemas[r]),e[r]=n}for(let n of r){let r=t.override[n];this._applyUnknownHandler(n,r,e,(t,n)=>{let r=this._utils.schemas[t];this._applyValidation(n,t,r),e[t]=n})}}}}};function Xi(e,{isCLI:t,optionInfos:n,FlagSchema:r}){let i,{name:s}=e,o={name:s},a={};switch(e.type){case"int":i=$i,t&&(o.preprocess=Number);break;case"string":case"path":i=Gi;break;case"choice":i=Bi,o.choices=e.choices.map(t=>null!=t&&t.redirect?{...t,redirect:{to:{key:e.name,value:t.redirect}}}:t);break;case"boolean":i=Ri;break;case"flag":i=r,o.flags=n.flatMap(e=>[e.alias,e.description&&e.name,e.oppositeDescription&&`no-${e.name}`].filter(Boolean));break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?o.validate=(t,n,r)=>e.exception(t)||n.validate(t,r):o.validate=(e,t,n)=>void 0===e||t.validate(e,n),e.redirect&&(a.redirect=t=>t?{to:"string"==typeof e.redirect?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(a.deprecated=!0),t&&!e.array){let e=o.preprocess||(e=>e);o.preprocess=(t,n,r)=>n.preprocess(e(Array.isArray(t)?vn(!1,t,-1):t),r)}return e.array?bi.create({...t?{preprocess:e=>Array.isArray(e)?e:[e]}:{},...a,valueSchema:i.create(o)}):i.create({...o,...a})}var Ki=(e,t,n)=>{if(!e||null!=t){if(t.findLast)return t.findLast(n);for(let e=t.length-1;e>=0;e--){let r=t[e];if(n(r,e,t))return r}}};function Yi(e,t){if(!t)throw new Error("parserName is required.");let n=Ki(!1,e,e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t));if(n)return n;let r=`Couldn't resolve parser "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}function qi({plugins:e,parser:t}){return Qi(Yi(e,t),t)}function Qi(e,t){let n=e.parsers[t];return"function"==typeof n?n():n}var Zi={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null},Ji=async function(e,t={}){var n;let r={...e};if(!r.parser){if(!r.filepath)throw new Kr("No parser and no file path given, couldn't infer a parser.");if(r.parser=ai(r,{physicalFile:r.filepath}),!r.parser)throw new Kr(`No parser could be inferred for file "${r.filepath}".`)}let i=qr({plugins:e.plugins,showDeprecated:!0}).options,s={...Zi,...Object.fromEntries(i.filter(e=>void 0!==e.default).map(e=>[e.name,e.default]))},o=Yi(r.plugins,r.parser),a=await Qi(o,r.parser);r.astFormat=a.astFormat,r.locEnd=a.locEnd,r.locStart=a.locStart;let l=null!=(n=o.printers)&&n[a.astFormat]?o:function(e,t){if(!t)throw new Error("astFormat is required.");let n=Ki(!1,e,e=>e.printers&&Object.prototype.hasOwnProperty.call(e.printers,t));if(n)return n;let r=`Couldn't find plugin for AST format "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}(r.plugins,a.astFormat),u=await function(e,t){let n=e.printers[t];return"function"==typeof n?n():n}(l,a.astFormat);r.printer=u;let c={...s,...l.defaultOptions?Object.fromEntries(Object.entries(l.defaultOptions).filter(([,e])=>void 0!==e)):{}};for(let[e,t]of Object.entries(c))(null===r[e]||void 0===r[e])&&(r[e]=t);return"json"===r.parser&&(r.trailingComma="none"),function(e,t,{logger:n=!1,isCLI:r=!1,passThrough:i=!1,FlagSchema:s,descriptor:o}={}){if(r){if(!s)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=li;let a=i?Array.isArray(i)?(e,t)=>i.includes(e)?{[e]:t}:void 0:(e,t)=>({[e]:t}):(e,t,n)=>{let{_:r,...i}=n.schemas;return Ci(e,t,{...n,schemas:i})},l=function(e,{isCLI:t,FlagSchema:n}){let r=[];t&&r.push(yi.create({name:"_"}));for(let i of e)r.push(Xi(i,{isCLI:t,optionInfos:e,FlagSchema:n})),i.alias&&t&&r.push(_i.create({name:i.alias,sourceName:i.name}));return r}(t,{isCLI:r,FlagSchema:s}),u=new zi(l,{logger:n,unknown:a,descriptor:o}),c=!1!==n;c&&Pi&&(u._hasDeprecationWarned=Pi);let h=u.normalize(e);return c&&(Pi=u._hasDeprecationWarned),h}(r,i,{passThrough:Object.keys(Zi),...t})},es=((e,t,n)=>(n=null!=e?$t(Ht(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of Wt(t))!jt.call(e,n)&&void 0!==n&&Gt(e,n,{get:()=>t[n],enumerable:!(r=Vt(t,n))||r.enumerable});return e})(Gt(n,"default",{value:e,enumerable:!0}),e)))(Yt()),ts=async function(e,t){let n,r=await qi(t),i=r.preprocess?r.preprocess(e,t):e;t.originalText=i;try{n=await r.parse(i,t,t)}catch(t){!function(e,t){let{loc:n}=e;if(n){let r=(0,es.codeFrameColumns)(t,n,{highlightCode:!0});throw e.message+="\n"+r,e.codeFrame=r,e}throw e}(t,e)}return{text:i,ast:n}};async function ns(e,t){({ast:e}=await is(e,t));let n=new Map,r=new vr(e),i=()=>{},s=new Map;await async function(e,t,n,r,i){let{embeddedLanguageFormatting:s,printer:{embed:o,hasPrettierIgnore:a=()=>!1,getVisitorKeys:l}}=n;if(!o||"auto"!==s)return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let u=Nr(o.getVisitorKeys??l),c=[];!function t(){let{node:r}=e;if(null===r||"object"!=typeof r||a(e))return;for(let n of u(r))Array.isArray(r[n])?e.each(t,n):e.call(t,n);let s=o(e,n);if(s){if("function"==typeof s)return void c.push({print:s,node:r,pathStack:[...e.stack]});i.set(r,s)}}();let h=e.stack;for(let{print:r,node:s,pathStack:o}of c)try{e.stack=o;let a=await r(d,t,e,n);a&&i.set(s,a)}catch(e){if(globalThis.PRETTIER_DEBUG)throw e}function d(e,t){return async function(e,t,n,r){let i=await Ji({...n,...t,parentParser:n.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:s}=await ts(e,i);return Nn(await r(s,i))}(e,t,n,r)}e.stack=h}(r,a,t,ns,s);let o=await rs(r,t,a,void 0,s);if(function(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:n}=e;for(let e of t){if(!e.printed&&!n.has(e))throw new Error('Comment "'+e.value.trim()+'" was not printed. Please report this error!');delete e.printed}}(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return[Qn,o];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[o,Qn]}return o;function a(e,t){return void 0===e||e===r?l(t):Array.isArray(e)?r.call(()=>l(t),...e):r.call(()=>l(t),e)}function l(e){i(r);let o=r.node;if(null==o)return"";let l=o&&"object"==typeof o&&void 0===e;if(l&&n.has(o))return n.get(o);let u=rs(r,t,a,e,s);return l&&n.set(o,u),u}}function rs(e,t,n,r,i){var s;let o,{node:a}=e,{printer:l}=t;switch(o=null!=(s=l.hasPrettierIgnore)&&s.call(l,e)?function(e,t){let{originalText:n,[Symbol.for("comments")]:r,locStart:i,locEnd:s,[Symbol.for("printedComments")]:o}=t,{node:a}=e,l=i(a),u=s(a);for(let e of r)i(e)>=l&&s(e)<=u&&o.add(e);return n.slice(l,u)}(e,t):i.has(a)?i.get(a):l.print(e,t,n,r),a){case t.cursorNode:o=On(o,e=>[Qn,e,Qn]);break;case t.nodeBeforeCursor:o=On(o,e=>[e,Qn]);break;case t.nodeAfterCursor:o=On(o,e=>[Qn,e])}return l.printComment&&(!l.willPrintOwnComments||!l.willPrintOwnComments(e,t))&&(o=function(e,t,n){let{leading:r,trailing:i}=function(e,t){let n=e.node;if(!n)return{};let r=t[Symbol.for("printedComments")];if(0===(n.comments||[]).filter(e=>!r.has(e)).length)return{leading:"",trailing:""};let i,s=[],o=[];return e.each(()=>{let n=e.node;if(null!=r&&r.has(n))return;let{leading:a,trailing:l}=n;a?s.push(function(e,t){var n;let r=e.node,i=[zr(e,t)],{printer:s,originalText:o,locStart:a,locEnd:l}=t;if(null==(n=s.isBlockComment)?void 0:n.call(s,r)){let e=xr(o,l(r))?xr(o,a(r),{backwards:!0})?Yn:Xn:" ";i.push(e)}else i.push(Yn);let u=Rr(o,yr(o,l(r)));return!1!==u&&xr(o,u)&&i.push(Yn),i}(e,t)):l&&(i=function(e,t,n){var r;let i=e.node,s=zr(e,t),{printer:o,originalText:a,locStart:l}=t,u=null==(r=o.isBlockComment)?void 0:r.call(o,i);if(null!=n&&n.hasLineSuffix&&(null==n||!n.isBlock)||xr(a,l(i),{backwards:!0})){let e=jr(a,l(i));return{doc:Gn([Yn,e?Yn:"",s]),isBlock:u,hasLineSuffix:!0}}return!u||null!=n&&n.hasLineSuffix?{doc:[Gn([" ",s]),Wn],isBlock:u,hasLineSuffix:!0}:{doc:[" ",s],isBlock:u,hasLineSuffix:!1}}(e,t,i),o.push(i.doc))},"comments"),{leading:s,trailing:o}}(e,n);return r||i?On(t,e=>[r,e,i]):t}(e,o,t)),o}async function is(e,t){let n=e.comments??[];t[Symbol.for("comments")]=n,t[Symbol.for("printedComments")]=new Set,function(e,t){let{comments:n}=e;if(delete e.comments,!function(e){return Array.isArray(e)&&e.length>0}(n)||!t.printer.canAttachComment)return;let r=[],{printer:{experimentalFeatures:{avoidAstMutation:i=!1}={},handleComments:s={}},originalText:o}=t,{ownLine:a=Ur,endOfLine:l=Ur,remaining:u=Ur}=s,c=n.map((r,i)=>({...Br(e,r,t),comment:r,text:o,options:t,ast:e,isLastComment:n.length-1===i}));for(let[e,t]of c.entries()){let n,{comment:s,precedingNode:o,enclosingNode:h,followingNode:d,text:f,options:p,ast:m,isLastComment:g}=t;if(i?n=[t]:(s.enclosingNode=h,s.precedingNode=o,s.followingNode=d,n=[s,f,p,m,g]),Gr(f,p,c,e))s.placement="ownLine",a(...n)||(d?Or(d,s):o?kr(o,s):Ir(h||m,s));else if(Vr(f,p,c,e))s.placement="endOfLine",l(...n)||(o?kr(o,s):d?Or(d,s):Ir(h||m,s));else if(s.placement="remaining",!u(...n))if(o&&d){let e=r.length;e>0&&r[e-1].followingNode!==d&&Wr(r,p),r.push(t)}else o?kr(o,s):d?Or(d,s):Ir(h||m,s)}if(Wr(r,t),!i)for(let e of n)delete e.precedingNode,delete e.enclosingNode,delete e.followingNode}(e,t);let{printer:{preprocess:r}}=t;return{ast:e=r?await r(e,t):e,comments:n}}var ss=function(e,t){let{cursorOffset:n,locStart:r,locEnd:i}=t,s=Nr(t.printer.getVisitorKeys),o=e=>r(e)<=n&&i(e)>=n,a=e,l=[e];for(let t of function*(e,t){let n=[e];for(let e=0;e0&&(void 0===u||void 0===c);){a=l.pop();let e=void 0!==u,t=void 0!==c;for(let o of Sr(a,{getVisitorKeys:s})){if(!e){let e=i(o);e<=n&&e>h&&(u=o,h=e)}if(!t){let e=r(o);e>=n&&e{if(!e||null!=t){if(t.findLastIndex)return t.findLastIndex(n);for(let e=t.length-1;e>=0;e--)if(n(t[e],e,t))return e;return-1}})(!1,e,e=>"Program"!==e.type&&"File"!==e.type);return-1===t?e:e.slice(0,t+1)}function as(e,t,n,r,i=[],s){let{locStart:o,locEnd:a}=n,l=o(e),u=a(e);if(!(t>u||t=0&&(t={...t,...ss(r,t)});let s=await ns(r,t);n>0&&(s=Jn([Yn,s],n,t.tabWidth));let o=fr(s,t);if(n>0){let e=o.formatted.trim();void 0!==o.cursorNodeStart&&(o.cursorNodeStart-=o.formatted.indexOf(e),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>e.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=e+Jt(t.endOfLine)}let a=t[Symbol.for("comments")];if(t.cursorOffset>=0){let e,n,r,s;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&o.cursorNodeText)if(r=o.cursorNodeStart,s=o.cursorNodeText,t.cursorNode)e=t.locStart(t.cursorNode),n=i.slice(e,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");e=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let r=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):i.length;n=i.slice(e,r)}else e=0,n=i,r=0,s=o.formatted;let l=t.cursorOffset-e;if(n===s)return{formatted:o.formatted,cursorOffset:r+l,comments:a};let u=n.split("");u.splice(l,0,hs);let c=function(e,t){return Zt.diff(e,t,void 0)}(u,s.split("")),h=r;for(let e of c)if(e.removed){if(e.value.includes(hs))break}else h+=e.count;return{formatted:o.formatted,cursorOffset:h,comments:a}}return{formatted:o.formatted,cursorOffset:-1,comments:a}}function fs(e,t,n){return"number"!=typeof t||Number.isNaN(t)||t<0||t>e.length?n:t}function ps(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i}=t;return n=fs(e,n,-1),r=fs(e,r,0),i=fs(e,i,e.length),{...t,cursorOffset:n,rangeStart:r,rangeEnd:i}}function ms(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s}=ps(e,t),o="\ufeff"===e.charAt(0);if(o&&(e=e.slice(1),n--,r--,i--),"auto"===s&&(s=function(e){let t=e.indexOf("\r");return-1!==t?"\n"===e.charAt(t+1)?"crlf":"cr":"lf"}(e)),e.includes("\r")){let t=t=>en(e.slice(0,Math.max(t,0)),"\r\n");n-=t(n),r-=t(r),i-=t(i),e=function(e){return qt(!1,e,/\r\n?/gu,"\n")}(e)}return{hasBOM:o,text:e,options:ps(e,{...t,cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s})}}async function gs(e,t){let n=await qi(t);return!n.hasPragma||n.hasPragma(e)}async function Es(e,t){let n,{hasBOM:r,text:i,options:s}=ms(e,await Ji(t));return s.rangeStart>=s.rangeEnd&&""!==i||s.requirePragma&&!await gs(i,s)||s.checkIgnorePragma&&await async function(e,t){var n;let r=await qi(t);return null==(n=r.hasIgnorePragma)?void 0:n.call(r,e)}(i,s)?{formatted:e,cursorOffset:t.cursorOffset,comments:[]}:(s.rangeStart>0||s.rangeEndr);let a=e.slice(r,i).search(/\S/u),l=-1===a;if(!l)for(r+=a;i>r&&!/\S/u.test(e[i-1]);--i);let u,c,h=as(n,r,t,(e,n)=>cs(t,e,n),[],"rangeStart"),d=l?h:as(n,i,t,e=>cs(t,e),[],"rangeEnd");if(!h||!d)return{rangeStart:0,rangeEnd:0};if((({parser:e})=>"json"===e||"json5"===e||"jsonc"===e||"json-stringify"===e)(t)){let e=function(e,t){let n=[e.node,...e.parentNodes],r=new Set([t.node,...t.parentNodes]);return n.find(e=>ls.has(e.type)&&r.has(e))}(h,d);u=e,c=e}else({startNode:u,endNode:c}=function(e,t,{locStart:n,locEnd:r}){let i=e.node,s=t.node;if(i===s)return{startNode:i,endNode:s};let o=n(e.node);for(let e of os(t.parentNodes)){if(!(n(e)>=o))break;s=e}let a=r(t.node);for(let t of os(e.parentNodes)){if(!(r(t)<=a))break;if(i=t,i===s)break}return{startNode:i,endNode:s}}(h,d,t));return{rangeStart:Math.min(s(u),s(c)),rangeEnd:Math.max(o(u),o(c))}}(r,t,n),o=r.slice(i,s),a=Math.min(i,r.lastIndexOf("\n",i)+1),l=r.slice(a,i).match(/^\s*/u)[0],u=Er(l,t.tabWidth),c=await ds(o,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>i&&t.cursorOffset<=s?t.cursorOffset-i:-1,endOfLine:"lf"},u),h=c.formatted.trimEnd(),{cursorOffset:d}=t;d>s?d+=h.length-o.length:c.cursorOffset>=0&&(d=c.cursorOffset+i);let f=r.slice(0,i)+h+r.slice(s);if("lf"!==t.endOfLine){let e=Jt(t.endOfLine);d>=0&&"\r\n"===e&&(d+=en(f.slice(0,d),"\n")),f=qt(!1,f,"\n",e)}return{formatted:f,cursorOffset:d,comments:c.comments}}(i,s):(!s.requirePragma&&s.insertPragma&&s.printer.insertPragma&&!await gs(i,s)&&(i=s.printer.insertPragma(i)),n=await ds(i,s)),r&&(n.formatted="\ufeff"+n.formatted,n.cursorOffset>=0&&n.cursorOffset++),n)}var vs={};Xt(vs,{builders:()=>Cs,printer:()=>Ds,utils:()=>Ss});var Cs={join:Zn,line:Xn,softline:Kn,hardline:Yn,literalline:qn,group:$n,conditionalGroup:function(e,t){return $n(e[0],{...t,expandedStates:e})},fill:function(e){return Pn(e),{type:un,parts:e}},lineSuffix:Gn,lineSuffixBoundary:Vn,cursor:Qn,breakParent:Wn,ifBreak:function(e,t="",n={}){return kn(e),""!==t&&kn(t),{type:cn,breakContents:e,flatContents:t,groupId:n.groupId}},trim:Hn,indent:Bn,indentIfBreak:function(e,t){return kn(e),{type:hn,contents:e,groupId:t.groupId,negate:t.negate}},align:Un,addAlignmentToDoc:Jn,markAsRoot:function(e){return Un({type:"root"},e)},dedentToRoot:function(e){return Un(Number.NEGATIVE_INFINITY,e)},dedent:function(e){return Un(-1,e)},hardlineWithoutBreakParent:jn,literallineWithoutBreakParent:zn,label:function(e,t){return kn(t),e?{type:mn,label:e,contents:t}:t},concat:e=>e},Ds={printDocToString:fr},Ss={willBreak:function(e){return bn(e,Tn,!1)},traverseDoc:_n,findInDoc:bn,mapDoc:yn,removeLines:function(e){return yn(e,xn)},stripTrailingHardline:Nn,replaceEndOfLine:function(e,t=qn){return yn(e,e=>"string"==typeof e?Zn(t,e.split("\n")):e)},canBreak:function(e){return bn(e,Ln,!1)}},As="3.6.2",_s={};Xt(_s,{addDanglingComment:()=>Ir,addLeadingComment:()=>Or,addTrailingComment:()=>kr,getAlignmentSize:()=>Er,getIndentSize:()=>xs,getMaxContinuousCount:()=>ws,getNextNonSpaceNonCommentCharacter:()=>Fs,getNextNonSpaceNonCommentCharacterIndex:()=>Ms,getPreferredQuote:()=>Ls,getStringWidth:()=>rr,hasNewline:()=>xr,hasNewlineInRange:()=>Os,hasSpaces:()=>Is,isNextLineEmpty:()=>Bs,isNextLineEmptyAfterIndex:()=>Rs,isPreviousLineEmpty:()=>Ps,makeString:()=>ks,skip:()=>Ar,skipEverythingButNewLine:()=>Tr,skipInlineComment:()=>ys,skipNewline:()=>Rr,skipSpaces:()=>yr,skipToLineEnd:()=>br,skipTrailingComment:()=>bs,skipWhitespace:()=>_r});var ys=function(e,t){if(!1===t)return!1;if("/"===e.charAt(t)&&"*"===e.charAt(t+1))for(let n=t+2;nMath.max(e,n.length/t.length),0)},Fs=function(e,t){let n=Ts(e,t);return!1===n?"":e.charAt(n)},Ns="'",Ls=function(e,t){let n=!0===t||t===Ns?Ns:'"',r=n===Ns?'"':Ns,i=0,s=0;for(let t of e)t===n?i++:t===r&&s++;return i>s?r:n},Os=function(e,t,n){for(let r=t;ri===r?i:s===t?"\\"+s:s||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(i)?i:"\\"+i));return t+i+t};function Ms(e,t){return 2===arguments.length||"number"==typeof t?Ts(e,t):function(e,t,n){return Ts(e,n(t))}(...arguments)}function Ps(e,t){return 2===arguments.length||"number"==typeof t?jr(e,t):function(e,t,n){return jr(e,n(t))}(...arguments)}function Bs(e,t){return 2===arguments.length||"number"==typeof t?Rs(e,t):function(e,t,n){return Rs(e,n(t))}(...arguments)}function Us(e,t=1){return async(...n)=>{let r=n[t]??{},i=r.plugins??[];return n[t]={...r,plugins:Array.isArray(i)?i:Object.values(i)},e(...n)}}var $s=Us(Es);async function Gs(e,t){let{formatted:n}=await $s(e,{...t,cursorOffset:-1});return n}async function Vs(e,t){return await Gs(e,t)===e}var Ws=Us(qr,0),Hs={parse:Us(async function(e,t,n){let{text:r,options:i}=ms(e,await Ji(t)),s=await ts(r,i);return n&&(n.preprocessForPrint&&(s.ast=await is(s.ast,i)),n.massage&&(s.ast=function(e,t){let{printer:{massageAstNode:n,getVisitorKeys:r}}=t;if(!n)return e;let i=Nr(r),s=n.ignoredProperties??new Set;return function e(t,r){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>e(t,r)).filter(Boolean);let o={},a=new Set(i(t));for(let n in t)!Object.prototype.hasOwnProperty.call(t,n)||s.has(n)||(a.has(n)?o[n]=e(t[n],t):o[n]=t[n]);let l=n(t,o,r);return null!==l?l??o:void 0}(e)}(s.ast,i))),s}),formatAST:Us(async function(e,t){return t=await Ji(t),fr(await ns(e,t),t)}),formatDoc:Us(async function(e,t){let n=function(e){let t=Object.create(null),n=new Set;return function e(t,n,i){var s,o;if("string"==typeof t)return JSON.stringify(t);if(Array.isArray(t)){let n=t.map(e).filter(Boolean);return 1===n.length?n[0]:`[${n.join(", ")}]`}if(t.type===pn){let e=(null==(s=null==i?void 0:i[n+1])?void 0:s.type)===gn;return t.literal?e?"literalline":"literallineWithoutBreakParent":t.hard?e?"hardline":"hardlineWithoutBreakParent":t.soft?"softline":"line"}if(t.type===gn)return(null==(o=null==i?void 0:i[n-1])?void 0:o.type)===pn&&i[n-1].hard?void 0:"breakParent";if(t.type===an)return"trim";if(t.type===sn)return"indent("+e(t.contents)+")";if(t.type===on)return t.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+e(t.contents)+")":t.n<0?"dedent("+e(t.contents)+")":"root"===t.n.type?"markAsRoot("+e(t.contents)+")":"align("+JSON.stringify(t.n)+", "+e(t.contents)+")";if(t.type===cn)return"ifBreak("+e(t.breakContents)+(t.flatContents?", "+e(t.flatContents):"")+(t.groupId?(t.flatContents?"":', ""')+`, { groupId: ${r(t.groupId)} }`:"")+")";if(t.type===hn){let n=[];t.negate&&n.push("negate: true"),t.groupId&&n.push(`groupId: ${r(t.groupId)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return`indentIfBreak(${e(t.contents)}${i})`}if(t.type===ln){let n=[];t.break&&"propagated"!==t.break&&n.push("shouldBreak: true"),t.id&&n.push(`id: ${r(t.id)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return t.expandedStates?`conditionalGroup([${t.expandedStates.map(t=>e(t)).join(",")}]${i})`:`group(${e(t.contents)}${i})`}if(t.type===un)return`fill([${t.parts.map(t=>e(t)).join(", ")}])`;if(t.type===dn)return"lineSuffix("+e(t.contents)+")";if(t.type===fn)return"lineSuffixBoundary";if(t.type===mn)return`label(${JSON.stringify(t.label)}, ${e(t.contents)})`;if(t.type===rn)return"cursor";throw new Error("Unknown doc type "+t.type)}(er(e));function r(e){if("symbol"!=typeof e)return JSON.stringify(String(e));if(e in t)return t[e];let r=e.description||"symbol";for(let i=0;;i++){let s=r+(i>0?` #${i}`:"");if(!n.has(s))return n.add(s),t[e]=`Symbol.for(${JSON.stringify(s)})`}}}(e),{formatted:r}=await Es(n,{...t,parser:"__js_expression"});return r}),printToDoc:Us(async function(e,t){t=await Ji(t);let{ast:n}=await ts(e,t);return t.cursorOffset>=0&&(t={...t,...ss(n,t)}),ns(n,t)}),printDocToString:Us(async function(e,t){return fr(e,await Ji(t))})},js=Object.defineProperty;((e,t)=>{for(var n in t)js(e,n,{get:t[n],enumerable:!0})})({},{builders:()=>Jo,printer:()=>ea,utils:()=>ta});var zs="string",Xs="array",Ks="cursor",Ys="indent",qs="align",Qs="trim",Zs="group",Js="fill",eo="if-break",to="indent-if-break",no="line-suffix",ro="line-suffix-boundary",io="line",so="label",oo="break-parent",ao=new Set([Ks,Ys,qs,Qs,Zs,Js,eo,to,no,ro,io,so,oo]),lo=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},uo=function(e){if("string"==typeof e)return zs;if(Array.isArray(e))return Xs;if(!e)return;const{type:t}=e;return ao.has(t)?t:void 0};var co=class extends Error{name="InvalidDocError";constructor(e){super(function(e){const t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(uo(e))throw new Error("doc is valid.");const n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;const r=(i=[...ao].map(e=>`'${e}'`),new Intl.ListFormat("en-US",{type:"disjunction"}).format(i));var i;return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},ho={},fo=function(e,t,n,r){const i=[e];for(;i.length>0;){const e=i.pop();if(e===ho){n(i.pop());continue}n&&i.push(e,ho);const s=uo(e);if(!s)throw new co(e);if(!1!==(null==t?void 0:t(e)))switch(s){case Xs:case Js:{const t=s===Xs?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case eo:i.push(e.flatContents,e.breakContents);break;case Zs:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case qs:case Ys:case to:case so:case no:i.push(e.contents);break;case zs:case Ks:case Qs:case ro:case io:case oo:break;default:throw new co(e)}}};function po(e,t){if("string"==typeof e)return t(e);const n=new Map;return function e(r){if(n.has(r))return n.get(r);const i=function(n){switch(uo(n)){case Xs:return t(n.map(e));case Js:return t({...n,parts:n.parts.map(e)});case eo:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case Zs:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case qs:case Ys:case to:case so:case no:return t({...n,contents:e(n.contents)});case zs:case Ks:case Qs:case ro:case io:case oo:return t(n);default:throw new co(n)}}(r);return n.set(r,i),i}(e)}function mo(e,t,n){let r=n,i=!1;return fo(e,function(e){if(i)return!1;const n=t(e);void 0!==n&&(i=!0,r=n)}),r}function go(e){return!(e.type!==Zs||!e.break)||!(e.type!==io||!e.hard)||e.type===oo||void 0}function Eo(e){if(e.length>0){const t=lo(!1,e,-1);t.expandedStates||t.break||(t.break="propagated")}return null}function vo(e){return e.type!==io||e.hard?e.type===eo?e.flatContents:e:e.soft?"":" "}function Co(e){for(e=[...e];e.length>=2&&lo(!1,e,-2).type===io&&lo(!1,e,-1).type===oo;)e.length-=2;if(e.length>0){const t=Do(lo(!1,e,-1));e[e.length-1]=t}return e}function Do(e){switch(uo(e)){case Ys:case to:case Zs:case no:case so:{const t=Do(e.contents);return{...e,contents:t}}case eo:return{...e,breakContents:Do(e.breakContents),flatContents:Do(e.flatContents)};case Js:return{...e,parts:Co(e.parts)};case Xs:return Co(e);case zs:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return t{},_o=Ao,yo=Ao,bo=Ao;function To(e){return _o(e),{type:Ys,contents:e}}function Ro(e,t){return _o(t),{type:qs,contents:t,n:e}}function xo(e,t={}){return _o(e),yo(t.expandedStates,!0),{type:Zs,id:t.id,contents:e,break:Boolean(t.shouldBreak),expandedStates:t.expandedStates}}var wo={type:ro},Fo={type:oo},No={type:Qs},Lo={type:io,hard:!0},Oo={type:io,hard:!0,literal:!0},Io={type:io},ko={type:io,soft:!0},Mo=[Lo,Fo],Po=[Oo,Fo],Bo={type:Ks};function Uo(e,t){_o(e),yo(t);const n=[];for(let r=0;r{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Go=e=>{return!(12288===(t=e)||t>=65281&&t<=65376||t>=65504&&t<=65510||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e));var t},Vo=/[^\x20-\x7F]/u,Wo=function(e){if(!e)return 0;if(!Vo.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(const n of e){const e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=Go(e)?1:2)}return t},Ho=Symbol("MODE_BREAK"),jo=Symbol("MODE_FLAT"),zo=Symbol("cursor"),Xo=Symbol("DOC_FILL_PRINTED_LENGTH");function Ko(e,t){return qo(e,{type:"indent"},t)}function Yo(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?qo(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:qo(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function qo(e,t,n){const r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t];let i="",s=0,o=0,a=0;for(const e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function Qo(e){let t=0,n=0,r=e.length;e:for(;r--;){const i=e[r];if(i!==zo)for(let n=i.length-1;n>=0;n--){const s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(zo);return t}function Zo(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length;const a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}const{mode:e,doc:u}=a.pop(),c=uo(u);switch(c){case zs:l.push(u),n-=Wo(u);break;case Xs:case Js:{const t=c===Xs?u:u.parts,n=u[Xo]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case Ys:case qs:case to:case so:a.push({mode:e,doc:u.contents});break;case Qs:n+=Qo(l);break;case Zs:{if(s&&u.break)return!1;const t=u.break?Ho:e,n=u.expandedStates&&t===Ho?lo(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case eo:{const t=(u.groupId?i[u.groupId]||jo:e)===Ho?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case io:if(e===Ho||u.hard)return!0;u.soft||(l.push(" "),n--);break;case no:r=!0;break;case ro:if(r)return!1}}return!1}var Jo={join:Uo,line:Io,softline:ko,hardline:Mo,literalline:Po,group:xo,conditionalGroup:function(e,t){return xo(e[0],{...t,expandedStates:e})},fill:function(e){return bo(e),{type:Js,parts:e}},lineSuffix:function(e){return _o(e),{type:no,contents:e}},lineSuffixBoundary:wo,cursor:Bo,breakParent:Fo,ifBreak:function(e,t="",n={}){return _o(e),""!==t&&_o(t),{type:eo,breakContents:e,flatContents:t,groupId:n.groupId}},trim:No,indent:To,indentIfBreak:function(e,t){return _o(e),{type:to,contents:e,groupId:t.groupId,negate:t.negate}},align:Ro,addAlignmentToDoc:function(e,t,n){_o(e);let r=e;if(t>0){for(let e=0;ee},ea={printDocToString:function(e,t){const n={},r=t.printWidth,i=function(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}(t.endOfLine);let s=0;const o=[{ind:{value:"",length:0,queue:[]},mode:Ho,doc:e}],a=[];let l=!1;const u=[];let c=0;for(function(e){const t=new Set,n=[];fo(e,function(e){if(e.type===oo&&Eo(n),e.type===Zs){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===Zs&&n.pop().break&&Eo(n)},!0)}(e);o.length>0;){const{ind:e,mode:h,doc:d}=o.pop();switch(uo(d)){case zs:{const e="\n"!==i?$o(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=Wo(e));break}case Xs:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case Ks:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(zo),c++;break;case Ys:o.push({ind:Ko(e,t),mode:h,doc:d.contents});break;case qs:o.push({ind:Yo(e,d.n,t),mode:h,doc:d.contents});break;case Qs:s-=Qo(a);break;case Zs:switch(h){case jo:if(!l){o.push({ind:e,mode:d.break?Ho:jo,doc:d.contents});break}case Ho:{l=!1;const t={ind:e,mode:jo,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&Zo(t,o,i,a,n))o.push(t);else if(d.expandedStates){const t=lo(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:Ho,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:Ho,doc:t});break}{const t=d.expandedStates[r],s={ind:e,mode:jo,doc:t};if(Zo(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:Ho,doc:d.contents});break}}d.id&&(n[d.id]=lo(!1,o,-1).mode);break;case Js:{const t=r-s,i=d[Xo]??0,{parts:a}=d,l=a.length-i;if(0===l)break;const c=a[i+0],f=a[i+1],p={ind:e,mode:jo,doc:c},m={ind:e,mode:Ho,doc:c},g=Zo(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}const E={ind:e,mode:jo,doc:f},v={ind:e,mode:Ho,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}const C=a[i+2],D={ind:e,mode:h,doc:{...d,[Xo]:i+2}};Zo({ind:e,mode:jo,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case eo:case to:{const t=d.groupId?n[d.groupId]:h;if(t===Ho){const t=d.type===eo?d.breakContents:d.negate?d.contents:To(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===jo){const t=d.type===eo?d.flatContents:d.negate?To(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case no:u.push({ind:e,mode:h,doc:d.contents});break;case ro:u.length>0&&o.push({ind:e,mode:h,doc:Lo});break;case io:switch(h){case jo:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case Ho:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=Qo(a),a.push(i+e.value),s=e.length)}break;case so:o.push({ind:e,mode:h,doc:d.contents});break;case oo:break;default:throw new co(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}const h=a.indexOf(zo);if(-1!==h){const e=a.indexOf(zo,h+1);if(-1===e)return{formatted:a.filter(e=>e!==zo).join("")};const t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}},ta={willBreak:function(e){return mo(e,go,!1)},traverseDoc:fo,findInDoc:mo,mapDoc:po,removeLines:function(e){return po(e,vo)},stripTrailingHardline:function(e){return Do(function(e){return po(e,e=>function(e){switch(uo(e)){case Js:if(e.parts.every(e=>""===e))return"";break;case Zs:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===Zs&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case qs:case Ys:case to:case no:if(!e.contents)return"";break;case eo:if(!e.flatContents&&!e.breakContents)return"";break;case Xs:{const t=[];for(const n of e){if(!n)continue;const[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof lo(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case zs:case Ks:case Qs:case ro:case io:case so:case oo:break;default:throw new co(e)}return e}(e))}(e))},replaceEndOfLine:function(e,t=Po){return po(e,e=>"string"==typeof e?Uo(t,e.split("\n")):e)},canBreak:function(e){return mo(e,So,!1)}};function na(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}class ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class ia extends ra{constructor(e){super([]),this.idx=1,Object.assign(this,ma(e))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class sa extends ra{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ma(e))}}class oa extends ra{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ma(e))}}class aa extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class la extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ua extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ca extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ha extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class da extends ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ma(e))}}class fa{constructor(e){this.idx=1,Object.assign(this,ma(e))}accept(e){e.visit(this)}}function pa(e){function t(e){return e.map(pa)}if(e instanceof ia){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return"string"==typeof e.label&&(t.label=e.label),t}if(e instanceof oa)return{type:"Alternative",definition:t(e.definition)};if(e instanceof aa)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof la)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof ua)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ha)return{type:"RepetitionWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ca)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof da)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof fa){const t={type:"Terminal",name:e.terminalType.name,label:(n=e.terminalType,"string"==typeof(r=n).LABEL&&""!==r.LABEL?n.LABEL:n.name),idx:e.idx};"string"==typeof e.label&&(t.terminalLabel=e.label);const i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=i instanceof RegExp?i.source:i),t}if(e instanceof sa)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match");var n,r}function ma(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}class ga{visit(e){const t=e;switch(t.constructor){case ia:return this.visitNonTerminal(t);case oa:return this.visitAlternative(t);case aa:return this.visitOption(t);case la:return this.visitRepetitionMandatory(t);case ua:return this.visitRepetitionMandatoryWithSeparator(t);case ha:return this.visitRepetitionWithSeparator(t);case ca:return this.visitRepetition(t);case da:return this.visitAlternation(t);case fa:return this.visitTerminal(t);case sa:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Ea(e,t=[]){return!!(e instanceof aa||e instanceof ca||e instanceof ha)||(e instanceof da?e.definition.some(e=>Ea(e,t)):!(e instanceof ia&&t.includes(e))&&e instanceof ra&&(e instanceof ia&&t.push(e),e.definition.every(e=>Ea(e,t))))}function va(e){if(e instanceof ia)return"SUBRULE";if(e instanceof aa)return"OPTION";if(e instanceof da)return"OR";if(e instanceof la)return"AT_LEAST_ONE";if(e instanceof ua)return"AT_LEAST_ONE_SEP";if(e instanceof ha)return"MANY_SEP";if(e instanceof ca)return"MANY";if(e instanceof fa)return"CONSUME";throw Error("non exhaustive match")}class Ca{walk(e,t=[]){e.definition.forEach((n,r)=>{const i=e.definition.slice(r+1);if(n instanceof ia)this.walkProdRef(n,i,t);else if(n instanceof fa)this.walkTerminal(n,i,t);else if(n instanceof oa)this.walkFlat(n,i,t);else if(n instanceof aa)this.walkOption(n,i,t);else if(n instanceof la)this.walkAtLeastOne(n,i,t);else if(n instanceof ua)this.walkAtLeastOneSep(n,i,t);else if(n instanceof ha)this.walkManySep(n,i,t);else if(n instanceof ca)this.walkMany(n,i,t);else{if(!(n instanceof da))throw Error("non exhaustive match");this.walkOr(n,i,t)}})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);e.definition.forEach(e=>{const t=new oa({definition:[e]});this.walk(t,r)})}}function Da(e,t,n){return[new aa({definition:[new fa({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Sa(e){if(e instanceof ia)return Sa(e.referencedRule);if(e instanceof fa)return[e.terminalType];if(function(e){return e instanceof oa||e instanceof aa||e instanceof ca||e instanceof la||e instanceof ua||e instanceof ha||e instanceof fa||e instanceof sa}(e))return function(e){let t=[];const n=e.definition;let r,i=0,s=n.length>i,o=!0;for(;s&&o;)r=n[i],o=Ea(r),t=t.concat(Sa(r)),i+=1,s=n.length>i;return[...new Set(t)]}(e);if(function(e){return e instanceof da}(e))return function(e){const t=e.definition.map(e=>Sa(e));return[...new Set(t.flat())]}(e);throw Error("non exhaustive match")}const Aa="_~IN~_";class _a extends Ca{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=(i=e.referencedRule,s=e.idx,i.name+s+Aa+this.topProd.name);var i,s;const o=t.concat(n),a=Sa(new oa({definition:o}));this.follows[r]=a}}function ya(e){return e.charCodeAt(0)}function ba(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function Ta(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t],e[t]=!0}function Ra(e){if(void 0===e)throw Error("Internal Error - Should never get here!");return!0}function xa(){throw Error("Internal Error - Should never get here!")}function wa(e){return"Character"===e.type}const Fa=[];for(let e=ya("0");e<=ya("9");e++)Fa.push(e);const Na=[ya("_")].concat(Fa);for(let e=ya("a");e<=ya("z");e++)Na.push(e);for(let e=ya("A");e<=ya("Z");e++)Na.push(e);const La=[ya(" "),ya("\f"),ya("\n"),ya("\r"),ya("\t"),ya("\v"),ya("\t"),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya("\u2028"),ya("\u2029"),ya(" "),ya(" "),ya(" "),ya("\ufeff")],Oa=/[0-9a-fA-F]/,Ia=/[0-9]/,ka=/[1-9]/;class Ma{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}function Pa(e){console&&console.error&&console.error(`Error: ${e}`)}function Ba(e){console&&console.warn&&console.warn(`Warning: ${e}`)}let Ua={};const $a=new class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Ta(n,"global");break;case"i":Ta(n,"ignoreCase");break;case"m":Ta(n,"multiLine");break;case"u":Ta(n,"unicode");break;case"y":Ta(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":let t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}}Ra(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return xa()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;Ra(t)}if(!0!==e||void 0!==t)return Ra(t)?("?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t):void 0}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),Ra(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):xa()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ya("\n"),ya("\r"),ya("\u2028"),ya("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=Fa;break;case"D":e=Fa,t=!0;break;case"s":e=La;break;case"S":e=La,t=!0;break;case"w":e=Na;break;case"W":e=Na,t=!0}return Ra(e)?{type:"Set",value:e,complement:t}:xa()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ya("\f");break;case"n":e=ya("\n");break;case"r":e=ya("\r");break;case"t":e=ya("\t");break;case"v":e=ya("\v")}return Ra(e)?{type:"Character",value:e}:xa()}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:ya("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:ya(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:ya(this.popChar())}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const t=this.classAtom();if(t.type,wa(t)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,wa(n)){if(n.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};function Ga(e){const t=e.toString();if(Ua.hasOwnProperty(t))return Ua[t];{const e=$a.pattern(t);return Ua[t]=e,e}}const Va="Complement Sets are not supported for first char optimization",Wa='Unable to use "first char" lexer optimizations:\n';function Ha(e,t=!1){try{const t=Ga(e);return ja(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===Va)t&&Ba(`${Wa}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),Pa(`${Wa}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function ja(e,t,n){switch(e.type){case"Disjunction":for(let r=0;r{if("number"==typeof e)za(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)za(e,t,n);else{for(let e=r.from;e<=r.to&&e=ul){const e=r.from>=ul?r.from:ul,n=r.to,i=hl(e),s=hl(n);for(let e=i;e<=s;e++)t[e]=e}}}});break;case"Group":ja(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}const o=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===Ka(s)||"Group"!==s.type&&!1===o)break}break;default:throw Error("non exhaustive match!")}return Object.values(t)}function za(e,t,n){const r=hl(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=hl(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=hl(e.charCodeAt(0));t[n]=n}}}(e,t)}function Xa(e,t){return e.value.find(e=>{if("number"==typeof e)return t.includes(e);{const n=e;return void 0!==t.find(e=>n.from<=e&&e<=n.to)}})}function Ka(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(Array.isArray(e.value)?e.value.every(Ka):Ka(e.value))}class Ya extends Ma{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e);case"Lookbehind":return void this.visitLookbehind(e);case"NegativeLookbehind":return void this.visitNegativeLookbehind(e)}super.visitChildren(e)}}visitCharacter(e){this.targetCharCodes.includes(e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===Xa(e,this.targetCharCodes)&&(this.found=!0):void 0!==Xa(e,this.targetCharCodes)&&(this.found=!0)}}function qa(e,t){if(t instanceof RegExp){const n=Ga(t),r=new Ya(e);return r.visit(n),r.found}for(const n of t){const t=n.charCodeAt(0);if(e.includes(t))return!0}return!1}const Qa="PATTERN",Za="defaultMode",Ja="modes";const el=/[^\\][$]/,tl=/[^\\[][\^]|^\^/;function nl(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function rl(e){const t=e.PATTERN;if(t instanceof RegExp)return!1;if("function"==typeof t)return!0;if(Object.hasOwn(t,"exec"))return!0;if("string"==typeof t)return!1;throw Error("non exhaustive match")}function il(e){return"string"==typeof e&&1===e.length&&e.charCodeAt(0)}const sl={test:function(e){const t=e.length;for(let n=this.lastIndex;n"string"==typeof e?e.charCodeAt(0):e)}function ll(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const ul=256;let cl=[];function hl(e){return ee.CATEGORIES).flat().filter(Boolean);const e=n.filter(e=>!t.includes(e));t=t.concat(e),0===e.length?r=!1:n=e}return t}(e);!function(e){e.forEach(e=>{var t;Cl(e)||(gl[ml]=e,e.tokenTypeIdx=ml++),Dl(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Dl(e)||(e.CATEGORIES=[]),t=e,Object.hasOwn(null!=t?t:{},"categoryMatches")||(e.categoryMatches=[]),function(e){return Object.hasOwn(null!=e?e:{},"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})})}(t),function(e){e.forEach(e=>{vl([],e)})}(t),function(e){e.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(t=>{e.categoryMatches.push(gl[t].tokenTypeIdx)})})}(t),t.forEach(e=>{e.isParent=e.categoryMatches.length>0})}function vl(e,t){e.forEach(e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),t.CATEGORIES.forEach(n=>{const r=e.concat(t);r.includes(n)||vl(r,n)})}function Cl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}function Dl(e){return Object.hasOwn(null!=e?e:{},"CATEGORIES")}function Sl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}var Al;!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"}(Al||(Al={}));const _l={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:{buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i,s)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`},traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(_l);class yl{constructor(e,t=_l){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=Object.assign({},_l,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===_l.lineTerminatorsPattern)this.config.lineTerminatorsPattern=sl;else if(this.config.lineTerminatorCharacters===_l.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Array.isArray(e)?n={modes:{defaultMode:[...e]},defaultMode:Za}:(r=!1,n=Object.assign({},e))}),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){const t=[];return Object.hasOwn(e,Za)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+Za+"> property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(e,Ja)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(e,Ja)&&Object.hasOwn(e,Za)&&!Object.hasOwn(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${Za}: <${e.defaultMode}>which does not exist\n`,type:Al.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(e,Ja)&&Object.keys(e.modes).forEach(n=>{const r=e.modes[n];r.forEach((e,i)=>{void 0===e?t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:Al.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(e,"LONGER_ALT")&&(Array.isArray(e.LONGER_ALT)?e.LONGER_ALT:[e.LONGER_ALT]).forEach(i=>{void 0===i||r.includes(i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${e.name}> outside of mode <${n}>\n`,type:Al.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(function(e,t,n){const r=[];let i=!1;const s=Object.values(e.modes||{}).flat().filter(Boolean).filter(e=>e[Qa]!==yl.NA),o=al(n);return t&&s.forEach(e=>{const t=ol(e,o);if(!1!==t){const n=function(e,t){if(t.issue===Al.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Al.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else Object.hasOwn(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):qa(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:Al.NO_LINE_BREAKS_FLAGS}),r}(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},Object.entries(n.modes).forEach(([e,t])=>{n.modes[e]=t.filter(e=>void 0!==e)});const i=Object.keys(n.modes);if(Object.entries(n.modes).forEach(([e,n])=>{this.TRACE_INIT(`Mode: <${e}> processing`,()=>{if(this.modes.push(e),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e,t){let n=[];const r=function(e){const t=e.filter(e=>!Object.hasOwn(e,Qa));return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:Al.MISSING_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(e);n=n.concat(r.errors);const i=function(e){const t=e.filter(e=>{const t=e[Qa];return!(t instanceof RegExp||"function"==typeof t||Object.hasOwn(t,"exec")||"string"==typeof t)});return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Al.INVALID_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=e.filter(e=>e[Qa]instanceof RegExp);return t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return el.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return tl.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){return e.filter(e=>{const t=e[Qa];return t instanceof RegExp&&(t.multiline||t.global)}).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Al.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){const t=[];let n=e.map(n=>e.reduce((e,r)=>(n.PATTERN.source!==r.PATTERN.source||t.includes(r)||r.PATTERN===yl.NA||(t.push(r),e.push(r)),e),[]));return n=n.filter(Boolean),n.filter(e=>e.length>1).map(e=>{const t=e.map(e=>e.name);return{message:`The same RegExp pattern ->${e[0].PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:Al.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}(n)),t=t.concat(function(e){return e.filter(e=>e.PATTERN.test("")).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:Al.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}(n)),t}(s)),n=n.concat(function(e){const t=e.filter(e=>{if(!Object.hasOwn(e,"GROUP"))return!1;const t=e.GROUP;return t!==yl.SKIPPED&&t!==yl.NA&&!("string"==typeof t)});return t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Al.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}(s)),n=n.concat(function(e,t){return e.filter(e=>void 0!==e.PUSH_MODE&&!t.includes(e.PUSH_MODE)).map(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:Al.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}(s,t)),n=n.concat(function(e){const t=[],n=e.reduce((e,t,n)=>{const r=t.PATTERN;return r===yl.NA||("string"==typeof r?e.push({str:r,idx:n,tokenType:t}):r instanceof RegExp&&(i=r,void 0===[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(e=>-1!==i.source.indexOf(e)))&&e.push({str:r.source,idx:n,tokenType:t})),e;var i},[]);return e.forEach((e,r)=>{n.forEach(({str:n,idx:i,tokenType:s})=>{if(r${s.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:Al.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}})}),t}(s)),n}(n,i))}),0===this.lexerDefinitionErrors.length){let r;El(n),this.TRACE_INIT("analyzeTokenTypes",()=>{r=function(e,t){const n=(t=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()},t)).tracer;let r;n("initCharCodeToOptimizedIndexMap",()=>{!function(){if(0===cl.length){cl=new Array(65536);for(let e=0;e<65536;e++)cl[e]=e>255?255+~~(e/255):e}}()}),n("Reject Lexer.NA",()=>{r=e.filter(e=>e[Qa]!==yl.NA)});let i,s,o,a,l,u,c,h,d,f,p,m=!1;n("Transform Patterns",()=>{m=!1,i=r.map(e=>{const t=e[Qa];if(t instanceof RegExp){const e=t.source;return 1!==e.length||"^"===e||"$"===e||"."===e||t.ignoreCase?2!==e.length||"\\"!==e[0]||["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(e[1])?nl(t):e[1]:e}if("function"==typeof t)return m=!0,{exec:t};if("object"==typeof t)return m=!0,t;if("string"==typeof t){if(1===t.length)return t;{const e=t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return nl(new RegExp(e))}}throw Error("non exhaustive match")})}),n("misc mapping",()=>{s=r.map(e=>e.tokenTypeIdx),o=r.map(e=>{const t=e.GROUP;if(t!==yl.SKIPPED){if("string"==typeof t)return t;if(void 0===t)return!1;throw Error("non exhaustive match")}}),a=r.map(e=>{const t=e.LONGER_ALT;if(t)return Array.isArray(t)?t.map(e=>r.indexOf(e)):[r.indexOf(t)]}),l=r.map(e=>e.PUSH_MODE),u=r.map(e=>Object.hasOwn(e,"POP_MODE"))}),n("Line Terminator Handling",()=>{const e=al(t.lineTerminatorCharacters);c=r.map(e=>!1),"onlyOffset"!==t.positionTracking&&(c=r.map(t=>Object.hasOwn(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===ol(t,e)&&qa(e,t.PATTERN)))}),n("Misc Mapping #2",()=>{h=r.map(rl),d=i.map(il),f=r.reduce((e,t)=>{const n=t.GROUP;return"string"==typeof n&&n!==yl.SKIPPED&&(e[n]=[]),e},{}),p=i.map((e,t)=>({pattern:i[t],longerAlt:a[t],canLineTerminator:c[t],isCustom:h[t],short:d[t],group:o[t],push:l[t],pop:u[t],tokenTypeIdx:s[t],tokenType:r[t]}))});let g=!0,E=[];return t.safeMode||n("First Char Optimization",()=>{E=r.reduce((e,n,r)=>{if("string"==typeof n.PATTERN){const t=hl(n.PATTERN.charCodeAt(0));ll(e,t,p[r])}else if(Array.isArray(n.START_CHARS_HINT)){let t;n.START_CHARS_HINT.forEach(n=>{const i=hl("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,ll(e,i,p[r]))})}else if(n.PATTERN instanceof RegExp)if(n.PATTERN.unicode)g=!1,t.ensureOptimizations&&Pa(`${Wa}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=Ha(n.PATTERN,t.ensureOptimizations);0===i.length&&(g=!1),i.forEach(t=>{ll(e,t,p[r])})}else t.ensureOptimizations&&Pa(`${Wa}\tTokenType: <${n.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return e},[])}),{emptyGroups:f,patternIdxToConfig:p,charCodeToPatternIdxToConfig:E,hasCustom:m,canBeOptimized:g}}(n,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[e]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[e]=r.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[e]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}this.lexerDefinitionWarning.forEach(e=>{Ba(e.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(r&&(this.handleModes=()=>{}),!1===this.trackStartLines&&(this.computeNewColumn=e=>e),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=()=>{}),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const e=Object.entries(this.canModeBeOptimized).reduce((e,[t,n])=>(!1===n&&e.push(t),e),[]);if(t.ensureOptimizations&&e.length>0)throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Ua={}}),this.TRACE_INIT("toFastProperties",()=>{na(this)})})}tokenize(e,t=this.defaultMode){if(this.lexerDefinitionErrors.length>0){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,s,o,a,l,u,c,h,d,f,p,m,g;const E=e,v=E.length;let C=0,D=0;const S=this.hasCustom?0:Math.floor(e.length/10),A=new Array(S),_=[];let y=this.trackStartLines?1:void 0,b=this.trackStartLines?1:void 0;const T=function(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(!Array.isArray(r))throw Error("non exhaustive match");t[n]=[]}),t}(this.emptyGroups),R=this.trackStartLines,x=this.config.lineTerminatorsPattern;let w=0,F=[],N=[];const L=[],O=[];Object.freeze(O);let I=!1;const k=e=>{if(1===L.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);_.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{L.pop();const e=L.at(-1);F=this.patternIdxToConfig[e],N=this.charCodeToPatternIdxToConfig[e],w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}};function M(e){L.push(e),N=this.charCodeToPatternIdxToConfig[e],F=this.patternIdxToConfig[e],w=F.length,w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}let P;M.call(this,t);const B=this.config.recoveryEnabled;for(;Ca.length){a=s,c=s.length,l=u,P=t;break}}}break}}if(-1!==c){if(h=P.group,void 0!==h&&(a=null!==a?a:e.substring(C,C+c),d=P.tokenTypeIdx,f=this.createTokenInstance(a,C,d,P.tokenType,y,b,c),this.handlePayload(f,l),!1===h?D=this.addToken(A,D,f):T[h].push(f)),!0===R&&!0===P.canLineTerminator){let t,n,r=0;x.lastIndex=0;do{a=null!==a?a:e.substring(C,C+c),t=x.test(a),!0===t&&(n=x.lastIndex-1,r++)}while(!0===t);0!==r?(y+=r,b=c-n,this.updateTokenEndLineColumnLocation(f,h,n,r,y,b,c)):b=this.computeNewColumn(b,c)}else b=this.computeNewColumn(b,c);C+=c,this.handleModes(P,k,M,f)}else{const t=C,n=y,i=b;let s=!1===B;for(;!1===s&&C`Expecting ${Tl(e)?`--\x3e ${bl(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o="\nbut found: '"+t[0].image+"'";return r?s+r+o:s+`one of these possible Token sequences:\n${e.reduce((e,t)=>e.concat(t),[]).map(e=>`[${e.map(e=>bl(e)).join(", ")}]`).map((e,t)=>` ${t+1}. ${e}`).join("\n")}`+o},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",s="\nbut found: '"+t[0].image+"'";return n?i+n+s:i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map(e=>`[${e.map(e=>bl(e)).join(",")}]`).join(" ,")}>`+s}};Object.freeze(Bl);const Ul={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},$l={buildDuplicateFoundError(e,t){const n=e.name,r=t[0],i=r.idx,s=va(r),o=(a=r)instanceof fa?a.terminalType.name:a instanceof ia?a.nonTerminalName:"";var a;let l=`->${s}${i>0?i:""}<- ${o?`with argument: ->${o}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,"\n"),l},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=e.prefixPath.map(e=>bl(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=0===e.alternation.idx?"":e.alternation.idx,n=0===e.prefixPath.length;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule,\n`;return r+=n?"These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n":`<${e.prefixPath.map(e=>bl(e)).join(", ")}> may appears as a prefix path in all these alternatives.\n`,r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=va(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${t} --\x3e ${e.leftRecursionPath.map(e=>e.name).concat([t]).join(" --\x3e ")}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof sa?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class Gl extends ga{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:rc.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Vl extends Ca{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){0===this.ruleStack.length?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Wl extends Vl{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const e=t.concat(n),r=new oa({definition:e});this.possibleTokTypes=Sa(r),this.found=!0}}}class Hl extends Ca{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class jl extends Hl{walkMany(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}}class zl extends Hl{walkManySep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}}class Xl extends Hl{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}}class Kl extends Hl{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}}function Yl(e,t,n=[]){n=[...n];let r=[],i=0;function s(s){const o=Yl(s.concat(e.slice(i+1)),t,n);return r.concat(o)}for(;n.length{0!==e.definition.length&&(r=s(e.definition))}),r;if(!(t instanceof fa))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:e.slice(i)}),r}function ql(e,t,n,r){const i=[...n];i.push(e.name);const s=[...r];return s.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:s}}var Ql;function Zl(e){if(e instanceof aa||"Option"===e)return Ql.OPTION;if(e instanceof ca||"Repetition"===e)return Ql.REPETITION;if(e instanceof la||"RepetitionMandatory"===e)return Ql.REPETITION_MANDATORY;if(e instanceof ua||"RepetitionMandatoryWithSeparator"===e)return Ql.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ha||"RepetitionWithSeparator"===e)return Ql.REPETITION_WITH_SEPARATOR;if(e instanceof da||"Alternation"===e)return Ql.ALTERNATION;throw Error("non exhaustive match")}function Jl(e,t,n,r){const i=e.length,s=e.every(e=>e.every(e=>1===e.length));if(t)return function(t){const r=t.map(e=>e.GATE);for(let t=0;te.flat()).reduce((e,t,n)=>(t.forEach(t=>{t.tokenTypeIdx in e||(e[t.tokenTypeIdx]=n),t.categoryMatches.forEach(t=>{Object.hasOwn(e,t)||(e[t]=n)})}),e),{});return function(){const e=this.LA_FAST(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t1===e.length),i=e.length;if(r&&!n){const t=e.flat();if(1===t.length&&0===t[0].categoryMatches.length){const e=t[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===e}}{const e=t.reduce((e,t,n)=>(e[t.tokenTypeIdx]=!0,t.categoryMatches.forEach(t=>{e[t]=!0}),e),[]);return function(){const t=this.LA_FAST(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;nYl([e],1)),r=ru(n.length),i=n.map(e=>{const t={};return e.forEach(e=>{iu(e.partialPath).forEach(e=>{t[e]=!0})}),t});let s=n;for(let e=1;e<=t;e++){const n=s;s=ru(n.length);for(let o=0;o{iu(e.partialPath).forEach(e=>{i[o][e]=!0})})}}}}return r}function au(e,t,n,r){const i=new nu(e,Ql.ALTERNATION,r);return t.accept(i),ou(i.result,n)}function lu(e,t,n,r){const i=new nu(e,n);t.accept(i);const s=i.result,o=new tu(t,e,n).startWalking();return ou([new oa({definition:s}),new oa({definition:o})],r)}function uu(e,t){e:for(let n=0;ne.every(e=>e.every(e=>0===e.categoryMatches.length)))}function hu(e){return`${va(e)}_#_${e.idx}_#_${du(e)}`}function du(e){return e instanceof fa?e.terminalType.name:e instanceof ia?e.nonTerminalName:""}class fu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function pu(e,t,n,r=[]){const i=[],s=mu(t.definition);if(0===s.length)return[];{const t=e.name;s.includes(e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:rc.LEFT_RECURSION,ruleName:t});const o=r.concat([e]),a=s.filter(e=>!o.includes(e)).flatMap(t=>{const i=[...r];return i.push(t),pu(e,t,n,i)});return i.concat(a)}}function mu(e){let t=[];if(0===e.length)return t;const n=e[0];if(n instanceof ia)t.push(n.referencedRule);else if(n instanceof oa||n instanceof aa||n instanceof la||n instanceof ua||n instanceof ha||n instanceof ca)t=t.concat(mu(n.definition));else if(n instanceof da)t=n.definition.map(e=>mu(e.definition)).flat();else if(!(n instanceof fa))throw Error("non exhaustive match");const r=Ea(n),i=e.length>1;if(r&&i){const n=e.slice(1);return t.concat(mu(n))}return t}class gu extends ga{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}class Eu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}const vu="MismatchedTokenException",Cu="NoViableAltException",Du="EarlyExitException",Su="NotAllInputParsedException",Au=[vu,Cu,Du,Su];function _u(e){return Au.includes(e.name)}Object.freeze(Au);class yu extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class bu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=vu}}class Tu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Cu}}class Ru extends yu{constructor(e,t){super(e,t),this.name=Su}}class xu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Du}}const wu={},Fu="InRuleRecoveryException";class Nu extends Error{constructor(e){super(e),this.name=Fu}}function Lu(e,t,n,r,i,s,o){const a=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[a];if(void 0===l){const e=this.getCurrRuleFullName();l=new s(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[a]=l}let u=l.token,c=l.occurrence;const h=l.isEndOfRule;0===this.RULE_STACK_IDX&&h&&void 0===u&&(u=Ml,c=1),void 0!==u&&void 0!==c&&this.shouldInRepetitionRecoveryBeTried(u,c,o)&&this.tryInRepetitionRecovery(e,t,n,u)}const Ou=1024,Iu=1280,ku=1536;function Mu(e,t,n){return n|t|e}class Pu{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:tc.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(0===t.length){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return e.flatMap(e=>pu(e,e,$l))}validateEmptyOrAlternatives(e){return e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.slice(0,-1).flatMap((r,i)=>0===function(e,t,n){const r="EXIT_NONE_TERMINAL",i=[r],s="EXIT_ALTERNATIVE";let o=!1;const a=t.length,l=a-1-1,u=[],c=[];for(c.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});0!==c.length;){const e=c.pop();if(e===s){o&&c.at(-1).idx<=l&&c.pop();continue}const h=e.def,d=e.idx,f=e.ruleStack,p=e.occurrenceStack;if(0===h.length)continue;const m=h[0];if(m===r){const e={idx:d,def:h.slice(1),ruleStack:f.slice(0,-1),occurrenceStack:p.slice(0,-1)};c.push(e)}else if(m instanceof fa)if(d=0;e--){const t={idx:d,def:m.definition[e].definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p};c.push(t),c.push(s)}else if(m instanceof oa)c.push({idx:d,def:m.definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p});else{if(!(m instanceof sa))throw Error("non exhaustive match");c.push(ql(m,d,f,p))}}return u}([r],[],fl).length?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:rc.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}(e,$l))}validateAmbiguousAlternationAlternatives(e,t){return e.flatMap(e=>function(e,t,n){const r=new gu;e.accept(r);let i=r.alternations;i=i.filter(e=>!0!==e.ignoreAmbiguities);return i.flatMap(r=>{const i=r.idx,s=r.maxLookahead||t,o=au(i,e,s,r),a=function(e,t,n,r){const i=[];return e.reduce((n,r,s)=>(!0===t.definition[s].ignoreAmbiguities||r.forEach(r=>{const o=[s];e.forEach((e,n)=>{s!==n&&uu(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&o.push(n)}),o.length>1&&!uu(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]).map(e=>{const i=e.alts.map(e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}(o,r,e,n),l=function(e,t,n,r){const i=e.reduce((e,t,n)=>{const r=t.map(e=>({idx:n,path:e}));return e.concat(r)},[]);return i.flatMap(e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const s=e.idx,o=e.path;return i.filter(e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx{const n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}));var n,r}).map(e=>{const i=[e.idx+1,s+1],o=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})})}(o,r,e,n);return a.concat(l)})}(e,t,$l))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return e.forEach(e=>{const i=new Eu;e.accept(i),i.allProductions.forEach(i=>{const s=Zl(i),o=i.maxLookahead||t;if(0===lu(i.idx,e,s,o)[0].flat().length){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:rc.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}(e,t,$l)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,s){const o=au(e,t,n);return s(o,r,cu(o)?pl:fl,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Jl)}buildLookaheadForOptional(e){return function(e,t,n,r,i,s){const o=lu(e,t,i,n),a=cu(o)?pl:fl;return s(o[0],a,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Zl(e.prodType),eu)}}const Bu=new class extends ga{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function Uu(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset"function"==typeof e.GATE);return s.hasPredicates=o,n.definition.push(s),i.forEach(e=>{const t=new oa({definition:[]});s.definition.push(t),Object.hasOwn(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Object.hasOwn(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),Hu}function Zu(e){return 0===e?"":`${e}`}function Ju(e){if(e<0||e>zu){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${zu+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const ec=Pl(Ml,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ec);const tc=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Bl,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),nc=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var rc,ic,sc;!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(rc||(rc={}));class oc{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",()=>{na(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=function(e){const t=Object.assign({errMsgProvider:Ul},e),n={};return e.rules.forEach(e=>{n[e.name]=e}),function(e,t){const n=new Gl(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(0===n.length&&!1===this.skipValidations){const e=function(e){var t;const n=null!==(t=e.errMsgProvider)&&void 0!==t?t:$l;return function(e,t,n,r){const i=e.flatMap(e=>function(e,t){const n=new fu;e.accept(n);const r=n.allProductions,i=Object.groupBy(r,hu),s=Object.fromEntries(Object.entries(i).filter(([e,t])=>t.length>1));return Object.values(s).map(n=>{const r=n[0],i=t.buildDuplicateFoundError(e,n),s=va(r),o={message:i,type:rc.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:s,occurrence:r.idx},a=du(r);return a&&(o.parameter=a),o})}(e,n)),s=function(e,t,n){const r=[],i=t.map(e=>e.name);return e.forEach(e=>{const t=e.name;if(i.includes(t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:rc.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}(e,t,n),o=e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:rc.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}(e,n)),a=e.flatMap(t=>function(e,t,n,r){const i=[],s=t.reduce((t,n)=>n.name===e.name?t+1:t,0);if(s>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:rc.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n));return i.concat(s,o,a)}(e.rules,e.tokenTypes,n,e.grammarName)}({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:$l,grammarName:t}),n=function(e){return e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}).map(e=>Object.assign({type:rc.CUSTOM_LOOKAHEAD_VALIDATION},e))}({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(e,n)}}),0===this.definitionErrors.length&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const e=function(e){const t={};return e.forEach(e=>{const n=new _a(e).startWalking();Object.assign(t,n)}),t}(Object.values(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!oc.DEFER_DEFINITION_ERRORS_HANDLING&&0!==this.definitionErrors.length)throw e=this.definitionErrors.map(e=>e.message),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initGastRecorder(t),n.initPerformanceTracer(t),Object.hasOwn(t,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=Object.hasOwn(t,"skipValidations")?t.skipValidations:tc.skipValidations}}oc.DEFER_DEFINITION_ERRORS_HANDLING=!1,ic=oc,sc=[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:tc.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Lu)}getTokenToInsert(e){const t=Pl(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let a=!1;const l=this.LA_FAST(1);let u=this.LA_FAST(1);const c=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),n=new bu(t,l,this.LA(0));n.resyncedTokens=o.slice(0,-1),this.SAVE_ERROR(n)};for(;!a;){if(this.tokenMatcher(u,r))return void c();if(n.call(this))return c(),void e.apply(this,t);this.tokenMatcher(u,i)?a=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o))}this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA_FAST(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getNextPossibleTokenTypes(e){const t=e.ruleStack[0],n=this.getGAstProductions()[t];return new Wl(n,e).startWalking()}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new Nu("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(0===t.length)return!1;const n=this.LA_FAST(1);return void 0!==t.find(e=>this.tokenMatcher(n,e))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(t).includes(e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA_FAST(1),n=2;for(;;){const r=e.find(e=>fl(t,e));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(0===this.RULE_STACK_IDX)return wu;const e=this.currRuleShortName,t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK,n=this.RULE_STACK_IDX+1,r=new Array(n);for(let i=0;ithis.getFollowSetFromFollowKey(e)).flat()}getFollowSetFromFollowKey(e){if(e===wu)return[Ml];const t=e.ruleName+e.idxInCallingRule+Aa+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Ml)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA_FAST(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return t.slice(0,-1)}attemptInRepetitionRecovery(e,t,n,r,i,s,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){const e=this.RULE_STACK_IDX+1,t=new Array(e);for(let n=0;n{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:o}=function(e){Bu.reset(),e.accept(Bu);const t=Bu.dslMethods;return Bu.reset(),t}(e);t.forEach(t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${va(t)}${n}`,()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=Mu(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),n.forEach(t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,va(t))}),r.forEach(t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,va(t))}),i.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Ou,"RepetitionMandatory",t.maxLookahead,va(t))}),s.forEach(t=>{this.computeLookaheadFunc(e,t.idx,ku,"RepetitionMandatoryWithSeparator",t.maxLookahead,va(t))}),o.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Iu,"RepetitionWithSeparator",t.maxLookahead,va(t))})})})}computeLookaheadFunc(e,t,n,r,i,s){this.TRACE_INIT(`${s}${0===t?"":t}`,()=>{const s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=Mu(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,s)})}getKeyForAutomaticLookahead(e,t){return Mu(this.currRuleShortName,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:tc.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=$u,this.setNodeLocationFromNode=$u,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Uu,this.setNodeLocationFromNode=Uu,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{}}else this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{}}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA_FAST(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];var r,i,s;i=t,s=e,void 0===(r=n).children[s]?r.children[s]=[i]:r.children[s].push(i),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(void 0===this.baseCstVisitorConstructor){const e=function(e,t){const n=function(){};Gu(n,e+"BaseSemantics");const r={visit:function(e,t){if(Array.isArray(e)&&(e=e[0]),void 0!==e)return this[e.name](e.children,t)},validateVisitor:function(){const e=function(e,t){const n=function(e,t){return t.filter(t=>"function"==typeof e[t]==0).map(t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Wu.MISSING_METHOD,methodName:t})).filter(Boolean)}(e,t);return n}(this,t);if(0!==e.length){const t=e.map(e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(void 0===this.baseCstVisitorWithDefaultsConstructor){const e=function(e,t,n){const r=function(){};Gu(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return t.forEach(e=>{i[e]=Vu}),(r.prototype=i).constructor=r,r}(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):ec}LA_FAST(e){const t=this.currIdx+e;return this.tokVector[t]}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?ec:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=pl,this.subruleIdx=0,this.currRuleShortName=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(Array.isArray(e)){if(0===e.length)throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(Array.isArray(e))this.tokensMap=e.reduce((e,t)=>(e[t.name]=t,e),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(Sl)){const t=Object.values(e.modes).flat(),n=[...new Set(t)];this.tokensMap=n.reduce((e,t)=>(e[t.name]=t,e),{})}else{if("object"!=typeof e||null===e)throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=Object.assign({},e)}this.tokensMap.EOF=Ml;const n=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every(e=>{var t;return 0==(null===(t=e.categoryMatches)||void 0===t?void 0:t.length)});this.tokenMatcher=n?pl:fl,El(Object.values(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:nc.resyncEnabled,i=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:nc.recoveryValueFunc,s=this.ruleShortNameIdx<<12;let o;return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,o=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...t){this.onBeforeParse(e);try{return o.apply(this,t)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:t,coreRule:o})}invokeRuleCatch(e,t,n){const r=0===this.RULE_STACK_IDX,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(_u(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(Ou,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,Ou,e,Xl)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(ku,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Kl],t,ku,e,Kl)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let s=!0;for(;!0===i.call(this)&&!0===s;)s=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,jl,s)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(Iu,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,zl],t,Iu,e,zl)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,ku,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=Array.isArray(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX]),this.cstFinallyStateUpdate()}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.coreRule.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw _u(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA_FAST(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new bu(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===Fu?n:e}}}saveRecogState(){const e=this.errors,t=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);const t=e.RULE_STACK;for(let e=0;e=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX])}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=n,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ml)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let e=0;e${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:rc.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){var n;const r=null!==(n=e.coreRule)&&void 0!==n?n:e;return function(){this.isBackTrackingStack.push(1);const e=this.saveRecogState();try{return r.apply(this,t),!0}catch(e){if(_u(e))return!1;throw e}finally{this.reloadRecogState(e),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Object.values(this.gastProductionsCache).map(pa)}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:tc.errorMessageProvider}SAVE_ERROR(e){if(_u(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=lu(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],s=[];for(let e=1;e<=this.maxLookahead;e++)s.push(this.LA(e));const o=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:s,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new xu(o,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=au(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));const s=this.LA(0),o=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:s,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Tu(o,this.LA(1),s))}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const n=t>0?t:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return ec}topLevelRuleRecord(e,t){try{const n=new sa({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}}optionInternalRecord(e,t){return qu.call(this,aa,e,t)}atLeastOneInternalRecord(e,t){qu.call(this,la,t,e)}atLeastOneSepFirstInternalRecord(e,t){qu.call(this,ua,t,e,ju)}manyInternalRecord(e,t){qu.call(this,ca,t,e)}manySepFirstInternalRecord(e,t){qu.call(this,ha,t,e,ju)}orInternalRecord(e,t){return Qu.call(this,e,t)}subruleInternalRecord(e,t,n){if(Ju(t),!e||!Object.hasOwn(e,"ruleName")){const n=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=e.ruleName,s=new ia({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(s),this.outputCst?Yu:Hu}consumeInternalRecord(e,t,n){if(Ju(t),!Cl(e)){const n=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=new fa({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),Ku}},class{initPerformanceTracer(e){if(Object.hasOwn(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=tc.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()}}],sc.forEach(e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach(n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(ic.prototype,n,r):ic.prototype[n]=e.prototype[n]})});class ac extends oc{constructor(e,t=tc){const n=Object.assign({},t);n.outputCst=!1,super(e,n)}}function lc(e){return void 0!==e.lineNoCont?e.lineNoCont:e.startLine}class uc{visit(e){return e&&this[e.kind](e)}arraySpecifier(e){this.visit(e.size)}binaryExpression(e){this.visit(e.lhs),this.visit(e.rhs)}methodCall(e){this.visit(e.on),this.visit(e.functionCall)}functionCall(e){this.visit(e.callee);for(const t of e.args)this.visit(t)}arrayAccess(e){this.visit(e.on),this.visit(e.index)}translationUnit(e){for(const t of e.declarations)this.visit(t)}assignmentExpression(e){this.visit(e.lhs),this.visit(e.rhs)}fieldAccess(e){this.visit(e.on)}conditionalExpression(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}postfixExpression(e){this.visit(e.on)}commaExpression(e){this.visit(e.lhs),this.visit(e.rhs)}unaryExpression(e){this.visit(e.on)}functionDefinition(e){this.visit(e.returnType);for(const t of e.params)this.visit(t);this.visit(e.body)}functionPrototype(e){this.visit(e.returnType);for(const t of e.params)this.visit(t)}parameterDeclaration(e){this.visit(e.arraySpecifier),this.visit(e.typeSpecifier)}typeSpecifier(e){hc(e.typeSpecifierNonArray)&&this.visit(e.typeSpecifierNonArray),this.visit(e.arraySpecifier)}compoundStatement(e){for(const t of e.statements)this.visit(t)}returnStatement(e){this.visit(e.what)}continueStatement(e){}breakStatement(e){}discardStatement(e){}declarator(e){this.visit(e.arraySpecifier),this.visit(e.init)}doWhileStatement(e){this.visit(e.statement),this.visit(e.conditionExpression)}whileStatement(e){this.visit(e.conditionExpression),this.visit(e.statement)}forStatement(e){this.visit(e.initExpression),this.visit(e.conditionExpression),this.visit(e.loopExpression),this.visit(e.statement)}expressionStatement(e){this.visit(e.expression)}initDeclaratorListDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}precisionDeclaration(e){this.visit(e.typeSpecifierNoPrec)}selectionStatement(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}storageQualifier(e){}switchStatement(e){this.visit(e.initExpression);for(const t of e.cases)this.visit(t)}caseLabel(e){this.visit(e.case_)}caseBlock(e){this.visit(e.caseLabel);for(const t of e.statements)this.visit(t)}fullySpecifiedType(e){this.visit(e.typeQualifier),this.visit(e.typeSpecifier)}typeQualifier(e){this.visit(e.storageQualifier),this.visit(e.layoutQualifier)}structSpecifier(e){for(const t of e.declarations)this.visit(t)}layoutQualifier(e){}invariantDeclaration(e){}structDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}variableExpression(e){}constantExpression(e){}uniformBlock(e){this.visit(e.typeQualifier);for(const t of e.declarations)this.visit(t);this.visit(e.arraySpecifier)}ppDefine(e){this.visit(e.node)}ppDir(e){}ppExtension(e){}ppCall(e){}ppPragma(e){}}function cc(e){return"tokenType"in e}function hc(e){return"kind"in e}function dc(e,t){const n=e.split("\n"),r=t.startLine,i=t.endLine;return"./src/compiler.lambda:"+r+":"+(t.startColumn-1)+"\n"+n.map((e,t)=>[t+1,e]).slice(r-2,i+2).map(([e,n])=>{var s,o,a;return e>=r&&e<=i&&(s=n,o=6+(r===e?t.startColumn-1:0),a=6+(i===e?t.endColumn:n.length),n=s+"\n"+"-".repeat(o)+"^".repeat(a-o)),(""+e).padStart(5)+" "+n}).join("\n")}const fc=["active","asm","atomic_uint","attribute","cast","class","coherent","common","double","dvec2","dvec3","dvec4","enum","extern","external","filter","fixed","fvec2","fvec3","fvec4","goto","half","hvec2","hvec3","hvec4","iimage1D","iimage1DArray","iimage2D","iimage2DArray","iimage3D","iimageBuffer","iimageCube","image1D","image1DArray","image2D","image2DArray","image3D","imageBuffer","imageCube","inline","input","interface","isampler1D","isampler1DArray","isampler2DMS","isampler2DMSArray","isampler2DRect","isamplerBuffer","long","namespace","noinline","noperspective","output","partition","patch","public","readonly","resource","restrict","sample","sampler1D","sampler1DArray","sampler1DArrayShadow","sampler1DShadow","sampler2DMS","sampler2DMSArray","sampler2DRect","sampler2DRectShadow","sampler3DRect","samplerBuffer","short","sizeof","static","subroutine","superp","template","this","typedef","uimage1D","uimage1DArray","uimage2D","uimage2DArray","uimage3D","uimageBuffer","uimageCube","union","unsigned","usampler1D","usampler1DArray","usampler2DMS","usampler2DMSArray","usampler2DRect","usamplerBuffer","using","volatile","volatile","writeonly"];var pc;!function(e){e.ASSIGN_OP=kl({name:"ASSIGN_OP",pattern:yl.NA}),e.UNARY_OP=kl({name:"UNARY_OP",pattern:yl.NA}),e.POSTFIX_OP=kl({name:"POSTFIX_OP",pattern:yl.NA}),e.PRECISION_QUALIFIER=kl({name:"PRECISION_QUALIFIER",pattern:yl.NA}),e.INTERPOLATION_QUALIFIER=kl({name:"INTERPOLATION_QUALIFIER",pattern:yl.NA}),e.MULTIPLICATIVE_OP=kl({name:"MULTIPLICATIVE_OP",pattern:yl.NA}),e.ADDITIVE_OP=kl({name:"ADDITIVE_OP",pattern:yl.NA}),e.SHIFT_OP=kl({name:"SHIFT_OP",pattern:yl.NA}),e.RELATIONAL_OP=kl({name:"RELATIONAL_OP",pattern:yl.NA}),e.EQUALITY_OP=kl({name:"EQUALITY_OP",pattern:yl.NA}),e.PARAMETER_QUALIFIER=kl({name:"PARAMETER_QUALIFIER",pattern:yl.NA}),e.WHITESPACE=kl({name:"WHITESPACE",pattern:/\s+/,group:yl.SKIPPED}),e.LINE_COMMENT=kl({name:"LINE_COMMENT",pattern:/\/\/[^\r\n]*/,group:"COMMENTS"}),e.MULTILINE_COMMENT=kl({name:"MULTILINE_COMMENT",pattern:/\/\*[\s\S]*?\*\//,group:"COMMENTS"}),e.MULASSIGN=kl({name:"MULASSIGN",pattern:"*=",label:"'*='",categories:e.ASSIGN_OP}),e.DIVASSIGN=kl({name:"DIVASSIGN",pattern:"/=",label:"'/='",categories:e.ASSIGN_OP}),e.MODASSIGN=kl({name:"MODASSIGN",pattern:"%=",label:"'%='",categories:e.ASSIGN_OP}),e.ADDASSIGN=kl({name:"ADDASSIGN",pattern:"+=",label:"'+='",categories:e.ASSIGN_OP}),e.SUBASSIGN=kl({name:"SUBASSIGN",pattern:"-=",label:"'-='",categories:e.ASSIGN_OP}),e.LEFTASSIGN=kl({name:"LEFTASSIGN",pattern:"<<=",label:"'<<='",categories:e.ASSIGN_OP}),e.RIGHTASSIGN=kl({name:"RIGHTASSIGN",pattern:">>=",label:"'>>='",categories:e.ASSIGN_OP}),e.ANDASSIGN=kl({name:"ANDASSIGN",pattern:"&=",label:"'&='",categories:e.ASSIGN_OP}),e.XORASSIGN=kl({name:"XORASSIGN",pattern:"^=",label:"'^='",categories:e.ASSIGN_OP}),e.ORASSIGN=kl({name:"ORASSIGN",pattern:"|=",label:"'|='",categories:e.ASSIGN_OP}),e.INC_OP=kl({name:"INC_OP",pattern:"++",label:"'++'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.QUESTION=kl({name:"QUESTION",pattern:"?",label:"'?'"}),e.COLON=kl({name:"COLON",pattern:":",label:"':'"}),e.DEC_OP=kl({name:"DEC_OP",pattern:"--",label:"'--'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.AND_OP=kl({name:"AND_OP",pattern:"&&",label:"'&&'"}),e.XOR_OP=kl({name:"XOR_OP",pattern:"^^",label:"'^^'"}),e.OR_OP=kl({name:"OR_OP",pattern:"||",label:"'||'"}),e.LEFT_OP=kl({name:"LEFT_OP",pattern:"<<",label:"'<<'",categories:e.SHIFT_OP}),e.RIGHT_OP=kl({name:"RIGHT_OP",pattern:">>",label:"'>>'",categories:e.SHIFT_OP}),e.EQ_OP=kl({name:"EQ_OP",pattern:"==",label:"'=='",categories:e.EQUALITY_OP}),e.NE_OP=kl({name:"NE_OP",pattern:"!=",label:"'!='",categories:e.EQUALITY_OP}),e.LE_OP=kl({name:"LE_OP",pattern:"<=",label:"'<='",categories:e.RELATIONAL_OP}),e.GE_OP=kl({name:"GE_OP",pattern:">=",label:"'>='",categories:e.RELATIONAL_OP}),e.LEFT_ANGLE=kl({name:"LEFT_ANGLE",pattern:"<",label:"'<'",categories:e.RELATIONAL_OP}),e.RIGHT_ANGLE=kl({name:"RIGHT_ANGLE",pattern:">",label:"'>'",categories:e.RELATIONAL_OP}),e.PLUS=kl({name:"PLUS",pattern:"+",label:"'+'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.TILDE=kl({name:"TILDE",pattern:"~",label:"'~'",categories:e.UNARY_OP}),e.BANG=kl({name:"BANG",pattern:"!",label:"'!'",categories:e.UNARY_OP}),e.CARET=kl({name:"CARET",pattern:"^",label:"'^'"}),e.AMPERSAND=kl({name:"AND",pattern:"&",label:"'&'"}),e.VERTICAL_BAR=kl({name:"VERTICAL_BAR",pattern:"|",label:"'|'"}),e.SLASH=kl({name:"SLASH",pattern:"/",label:"'/'",categories:e.MULTIPLICATIVE_OP}),e.PERCENT=kl({name:"PERCENT",pattern:"%",label:"'%'",categories:e.MULTIPLICATIVE_OP}),e.STAR=kl({name:"STAR",pattern:"*",label:"'*'",categories:e.MULTIPLICATIVE_OP}),e.DASH=kl({name:"DASH",pattern:"-",label:"'-'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.COMMA=kl({name:"COMMA",pattern:",",label:"','"}),e.EQUAL=kl({name:"EQUAL",pattern:"=",label:"'='",categories:e.ASSIGN_OP}),e.LEFT_PAREN=kl({name:"LEFT_PAREN",pattern:"(",label:"'('"}),e.RIGHT_PAREN=kl({name:"RIGHT_PAREN",pattern:")",label:"')'"}),e.LEFT_BRACKET=kl({name:"LEFT_BRACKET",pattern:"[",label:"'['"}),e.RIGHT_BRACKET=kl({name:"RIGHT_BRACKET",pattern:"]",label:"']'"}),e.LEFT_BRACE=kl({name:"LEFT_BRACE",pattern:"{",label:"'{'"}),e.RIGHT_BRACE=kl({name:"RIGHT_BRACE",pattern:"}",label:"'}'"}),e.SEMICOLON=kl({name:"SEMICOLON",pattern:";",label:"';'"}),e.IDENTIFIER=kl({name:"IDENTIFIER",pattern:yl.NA}),e.NON_PP_IDENTIFIER=kl({name:"NON_PP_IDENTIFIER",pattern:/[a-z_]\w*/i,categories:e.IDENTIFIER}),e.PP=kl({name:"PP",pattern:yl.NA,categories:e.IDENTIFIER});const t=(t,n)=>kl({name:t,pattern:n,categories:e.PP,longer_alt:e.NON_PP_IDENTIFIER});e.DEFINE=t("DEFINE","define"),e.UNDEF=t("UNDEF","undef"),e.ENDIF=t("ENDIF","endif"),e.IFDEF=t("IFDEF","ifdef"),e.IFNDEF=t("IFNDEF","ifndef"),e.ELIF=t("ELIF","elif"),e.ERROR=t("ERROR","error"),e.VERSION=t("VERSION","version"),e.PRAGMA_DIRECTIVE=kl({name:"PRAGMA_DIRECTIVE",pattern:/#\s*pragma\s+[^\r\n]*/}),e.LINE=t("LINE","line"),e.EXTENSION=t("EXTENSION","extension"),e.INCLUDE=t("INCLUDE","include"),e.HASH_INCLUDE_MODULE=kl({name:"HASH_INCLUDE_MODULE",pattern:/#\s*include\s*<[\w\-./\\$@ ]+>/}),e.HASH=kl({name:"HASH",pattern:"#"}),e.KEYWORD=kl({name:"KEYWORD",pattern:yl.NA});const n=(t,n)=>kl({name:t,pattern:t.toLowerCase(),label:"'"+t.toLowerCase()+"'",longer_alt:e.NON_PP_IDENTIFIER,categories:n?[e.KEYWORD,n]:e.KEYWORD});e.CONST=n("CONST"),e.UNIFORM=n("UNIFORM"),e.LAYOUT=n("LAYOUT"),e.CENTROID=n("CENTROID"),e.FLAT=n("FLAT",e.INTERPOLATION_QUALIFIER),e.SMOOTH=n("SMOOTH",e.INTERPOLATION_QUALIFIER),e.BREAK=n("BREAK"),e.CONTINUE=n("CONTINUE"),e.DO=n("DO"),e.PRECISION=n("PRECISION"),e.FOR=n("FOR"),e.WHILE=n("WHILE"),e.SWITCH=n("SWITCH"),e.CASE=n("CASE"),e.DEFAULT=n("DEFAULT"),e.IF=n("IF"),e.ELSE=n("ELSE"),e.INVARIANT=n("INVARIANT"),e.INOUT=n("INOUT",e.PARAMETER_QUALIFIER),e.OUT=n("OUT",e.PARAMETER_QUALIFIER),e.VOID=n("VOID"),e.STRUCT=n("STRUCT"),e.DISCARD=n("DISCARD"),e.RETURN=n("RETURN"),e.LOWP=n("LOWP",e.PRECISION_QUALIFIER),e.MEDIUMP=n("MEDIUMP",e.PRECISION_QUALIFIER),e.HIGHP=n("HIGHP",e.PRECISION_QUALIFIER),e.CONSTANT=kl({name:"CONSTANT",pattern:yl.NA}),e.BASIC_TYPE=kl({name:"BASIC_TYPE",pattern:yl.NA});const r=t=>kl({name:t.toUpperCase(),pattern:t,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE});e.BOOL=r("bool"),e.INT=r("int"),e.FLOAT=r("float"),e.MAT2X3=r("mat2x3"),e.MAT2X4=r("mat2x4"),e.MAT2X2=kl({name:"mat2x2".toUpperCase(),pattern:/mat2(?:x2)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat2"}),e.MAT3X2=r("mat3x2"),e.MAT3X4=r("mat3x4"),e.MAT3X3=kl({name:"mat3x3".toUpperCase(),pattern:/mat3(?:x3)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat3"}),e.MAT4X2=r("mat4x2"),e.MAT4X3=r("mat4x3"),e.MAT4X4=kl({name:"MAT4X4",pattern:/mat4(?:x4)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat4"}),e.VEC2=r("vec2"),e.VEC3=r("vec3"),e.VEC4=r("vec4"),e.IVEC2=r("ivec2"),e.IVEC3=r("ivec3"),e.IVEC4=r("ivec4"),e.BVEC2=r("bvec2"),e.BVEC3=r("bvec3"),e.BVEC4=r("bvec4"),e.UINT=r("uint"),e.UVEC2=r("uvec2"),e.UVEC3=r("uvec3"),e.UVEC4=r("uvec4"),e.USAMPLERCUBE=r("usamplerCube"),e.USAMPLER3D=r("usampler3D"),e.USAMPLER2DARRAY=r("usampler2DArray"),e.USAMPLER2D=r("usampler2D"),e.SAMPLERCUBESHADOW=r("samplerCubeShadow"),e.SAMPLERCUBE=r("samplerCube"),e.SAMPLER3D=r("sampler3D"),e.SAMPLER2DSHADOW=r("sampler2DShadow"),e.SAMPLER2DARRAYSHADOW=r("sampler2DArrayShadow"),e.SAMPLER2DARRAY=r("sampler2DArray"),e.SAMPLER2D=r("sampler2D"),e.ISAMPLERCUBE=r("isamplerCube"),e.ISAMPLER3D=r("isampler3D"),e.ISAMPLER2DARRAY=r("isampler2DArray"),e.ISAMPLER2D=r("isampler2D"),e.IN=n("IN",e.PARAMETER_QUALIFIER),e.VARYING=n("VARYING"),e.ATTRIBUTE=n("ATTRIBUTE"),e.BOOLCONSTANT=kl({name:"BOOLCONSTANT",pattern:/true|false/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.CONSTANT}),e.FLOATCONSTANT=kl({name:"FLOATCONSTANT",pattern:/((\d+\.\d*|\.\d+)(e[+-]?\d+)?|\d+e[+-]?\d+)f?/i,categories:e.CONSTANT}),e.DOT=kl({name:"DOT",pattern:".",label:"'.'"}),e.UINTCONSTANT=kl({name:"UINTCONSTANT",pattern:/0x[\da-f]+u|\d+u/i,categories:e.CONSTANT}),e.INTCONSTANT=kl({name:"INTCONSTANT",pattern:/0x[\da-f]+|\d+/i,categories:e.CONSTANT}),e.STRING=kl({name:"STRING",pattern:/"([^"\\]+|\\")+"/})}(pc||(pc={}));const mc=Object.values(pc).filter(e=>e!==pc.NON_PP_IDENTIFIER).flatMap(e=>Array.isArray(e)?e:[e]);mc.push(pc.NON_PP_IDENTIFIER);const gc=new yl(mc,{ensureOptimizations:!1});new class extends uc{constructor(){super(...arguments),this.markError=()=>{}}eval(e,t,n){return this.isDefined=t,this.markError=n,super.visit(e)}constantExpression(e){if(e.const_.tokenType!==pc.INTCONSTANT)throw new Error("XX");return+e.const_.image}unaryExpression(e){switch(e.op.tokenType){case pc.NON_PP_IDENTIFIER:return+this.isDefined(e.on.var.image);case pc.DASH:return-this.visit(e.on);case pc.TILDE:return~this.visit(e.on);case pc.BANG:return+!this.visit(e.on);case pc.PLUS:return this.visit(e.on);default:throw new Error(e.op.tokenType.name)}}binaryExpression(e){const t=this.visit(e.lhs);switch(e.op.tokenType){case pc.AND_OP:return t&&this.visit(e.rhs);case pc.OR_OP:return t||this.visit(e.rhs);default:{const n=this.visit(e.rhs);return 0|function(e,t,n){switch(e){case pc.PLUS:return t+n;case pc.DASH:return t-n;case pc.STAR:return t*n;case pc.PERCENT:return t%n;case pc.SLASH:return t/n;case pc.LEFT_OP:return t<>n;case pc.EQ_OP:return t===n;case pc.NE_OP:return t!==n;case pc.LE_OP:return t<=n;case pc.GE_OP:return t>=n;case pc.LEFT_ANGLE:return tn;case pc.XOR_OP:return t!==n;case pc.AND_OP:return t&&n;case pc.OR_OP:return t||n;case pc.AMPERSAND:return t&n;case pc.CARET:return t^n;case pc.VERTICAL_BAR:return t|n;default:throw new Error}}(e.op.tokenType,t,n)}}}variableExpression(e){return this.markError("P0001",e.var,"undefined identifier "+e.var.image),0}};const Ec=new class extends ac{getTokensOnLine(){const e=[],t=lc(this.LA(0));let n;for(;lc(n=this.LA(1))===t;)e.push(n),this.SKIP_TOKEN();return e}constructor(){super(mc,{skipValidations:!0}),this.multiplicativeExpression=this.RR("multiplicativeExpression",()=>this.LEFT_ASSOC(this.preprocessing?this.ppUnaryExpression:this.unaryExpression,pc.MULTIPLICATIVE_OP)),this.additiveExpression=this.RR("additiveExpression",()=>this.LEFT_ASSOC(this.multiplicativeExpression,pc.ADDITIVE_OP)),this.shiftExpression=this.RR("shiftExpression",()=>this.LEFT_ASSOC(this.additiveExpression,pc.SHIFT_OP)),this.relationalExpression=this.RR("relationalExpression",()=>this.LEFT_ASSOC(this.shiftExpression,pc.RELATIONAL_OP)),this.equalityExpression=this.RR("equalityExpression",()=>this.LEFT_ASSOC(this.relationalExpression,pc.EQUALITY_OP)),this.andExpression=this.RR("andExpression",()=>this.LEFT_ASSOC(this.equalityExpression,pc.AMPERSAND)),this.exclusiveOrExpression=this.RR("exclusiveOrExpression",()=>this.LEFT_ASSOC(this.andExpression,pc.CARET)),this.inclusiveOrExpression=this.RR("inclusiveOrExpression",()=>this.LEFT_ASSOC(this.exclusiveOrExpression,pc.VERTICAL_BAR)),this.logicalAndExpression=this.RR("logicalAndExpression",()=>this.LEFT_ASSOC(this.inclusiveOrExpression,pc.AND_OP)),this.logicalXorExpression=this.RR("logicalXorExpression",()=>this.LEFT_ASSOC(this.logicalAndExpression,pc.XOR_OP)),this.logicalOrExpression=this.RR("logicalOrExpression",()=>this.LEFT_ASSOC(this.logicalXorExpression,pc.OR_OP)),this.assignmentExpression=this.RR("assignmentExpression",()=>{const e=this.SUBRULE(this.conditionalExpression);return this.OPTION(()=>{const t=this.CONSUME(pc.ASSIGN_OP),n=this.SUBRULE1(this.assignmentExpression);return{kind:"assignmentExpression",lhs:e,op:t,rhs:n}})??e}),this.expression=this.RR("expression",()=>{let e;return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.SUBRULE(this.assignmentExpression);return e=e?{kind:"commaExpression",lhs:e,rhs:t}:t}}),e}),this.conditionalExpression=this.RR("conditionalExpression",()=>{const e=this.SUBRULE1(this.logicalOrExpression);return this.OPTION(()=>({kind:"conditionalExpression",condition:e,QUESTION:this.CONSUME(pc.QUESTION),yes:this.SUBRULE2(this.expression),COLON:this.CONSUME(pc.COLON),no:this.SUBRULE3(this.assignmentExpression)}))??e}),this.switchStatement=this.RR("switchStatement",()=>{this.CONSUME(pc.SWITCH),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);this.CONSUME(pc.RIGHT_PAREN),this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.caseBlock))),this.CONSUME(pc.RIGHT_BRACE),{kind:"switchStatement",initExpression:e,cases:t}}),this.caseBlock=this.RR("caseBlock",()=>{const e=this.SUBRULE(this.caseLabel),t=[];return this.MANY1(()=>t.push(this.SUBRULE(this.statement))),{kind:"caseBlock",caseLabel:e,statements:t}}),this.jumpStatement=this.RR("jumpStatement",()=>{const e=this.OR([{ALT:()=>(this.CONSUME(pc.CONTINUE),{kind:"continueStatement"})},{ALT:()=>(this.CONSUME(pc.BREAK),{kind:"breakStatement"})},{ALT:()=>(this.CONSUME(pc.DISCARD),{kind:"discardStatement"})},{ALT:()=>(this.CONSUME(pc.RETURN),{kind:"returnStatement",what:this.OPTION(()=>this.SUBRULE(this.expression))})}]);return this.CONSUME(pc.SEMICOLON),e}),this.primaryExpression=this.RR("primaryExpression",()=>this.OR([{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),e}},{ALT:()=>({kind:"variableExpression",var:this.CONSUME(pc.IDENTIFIER)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.CONSTANT)})}])),this.constantExpression=this.RR("constantExpression",()=>this.SUBRULE(this.conditionalExpression)),this.layoutQualifier=this.RR("layoutQualifier",()=>{this.CONSUME(pc.LAYOUT),this.CONSUME(pc.LEFT_PAREN);const e=[];return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.CONSUME(pc.IDENTIFIER);let n;this.OPTION(()=>{this.CONSUME(pc.EQUAL),n=this.OR([{ALT:()=>this.CONSUME(pc.INTCONSTANT)},{ALT:()=>this.CONSUME(pc.UINTCONSTANT)}])}),e.push({IDENTIFIER:t,init:n})}}),this.CONSUME(pc.RIGHT_PAREN),{kind:"layoutQualifier",layoutQualifierIds:e}}),this.storageQualifier=this.RR("storageQualifier",()=>{let e,t,n,r,i,s,o;return this.OR([{ALT:()=>e=this.CONSUME(pc.CONST)},{ALT:()=>{t=this.OPTION(()=>this.CONSUME(pc.CENTROID)),this.OR9([{ALT:()=>n=this.CONSUME(pc.IN)},{ALT:()=>r=this.CONSUME(pc.OUT)},{ALT:()=>s=this.CONSUME(pc.VARYING)},{ALT:()=>o=this.CONSUME(pc.ATTRIBUTE)}])}},{ALT:()=>i=this.CONSUME(pc.UNIFORM)}]),{kind:"storageQualifier",CONST:e,CENTROID:t,IN:n,OUT:r,VARYING:s,ATTRIBUTE:o,UNIFORM:i}}),this.typeQualifier=this.RR("typeQualifier",()=>{let e,t,n,r;return this.OR([{ALT:()=>e=this.SUBRULE(this.storageQualifier)},{ALT:()=>{t=this.SUBRULE1(this.layoutQualifier),e=this.OPTION1(()=>this.SUBRULE2(this.storageQualifier))}},{ALT:()=>{n=this.CONSUME(pc.INTERPOLATION_QUALIFIER),e=this.OPTION2(()=>this.SUBRULE3(this.storageQualifier))}},{ALT:()=>{r=this.CONSUME(pc.INVARIANT),n=this.OPTION3(()=>this.CONSUME1(pc.INTERPOLATION_QUALIFIER)),e=this.SUBRULE7(this.storageQualifier)}}]),{kind:"typeQualifier",storageQualifier:e,layoutQualifier:t,interpolationQualifier:n,invariantQualifier:r}}),this.precisionQualifier=this.RR("precisionQualifier",()=>this.CONSUME(pc.PRECISION_QUALIFIER)),this.arraySpecifier=this.RR("arraySpecifier",()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.OPTION3(()=>this.SUBRULE(this.constantExpression));return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arraySpecifier",size:e}}),this.typeSpecifierNonArray=this.RR("typeSpecifierNonArray",()=>this.OR([{ALT:()=>this.CONSUME(pc.BASIC_TYPE)},{ALT:()=>this.CONSUME(pc.VOID)},{ALT:()=>this.SUBRULE(this.structSpecifier)},{ALT:()=>this.CONSUME(pc.IDENTIFIER)}])),this.typeSpecifierNoPrec=this.RR("typeSpecifierNoPrec",()=>{const e=this.SUBRULE(this.typeSpecifierNonArray);return{kind:"typeSpecifier",precisionQualifier:void 0,arraySpecifier:this.OPTION1(()=>this.SUBRULE(this.arraySpecifier)),typeSpecifierNonArray:e}}),this.functionCall=this.RR("functionCall",()=>{const e=this.SUBRULE(this.typeSpecifierNoPrec);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({DEF:()=>t.push(this.SUBRULE(this.assignmentExpression)),SEP:pc.COMMA}),this.CONSUME(pc.RIGHT_PAREN),{kind:"functionCall",callee:e,args:t}}),this.functionCallHeader=this.RULE("functionCallHeader",()=>{this.SUBRULE(this.typeSpecifierNoPrec),this.CONSUME(pc.LEFT_PAREN)}),this.postfixExpression=this.RR("postfixExpression",()=>{const e=this.LA(1);let t=this.OR1([{GATE:this.BACKTRACK(this.functionCallHeader),ALT:()=>this.SUBRULE1(this.functionCall)},{ALT:()=>this.SUBRULE(this.primaryExpression)}]);return this.MANY(()=>{t=this.OR2([{ALT:()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arrayAccess",on:t,index:e}}},{ALT:()=>{this.CONSUME1(pc.DOT);const e=this.SUBRULE2(this.functionCall);return{kind:"methodCall",on:t,functionCall:e}}},{ALT:()=>{this.CONSUME2(pc.DOT);const e=this.CONSUME(pc.IDENTIFIER);return{kind:"fieldAccess",on:t,field:e}}},{ALT:()=>{const e=this.CONSUME(pc.POSTFIX_OP);return{kind:"postfixExpression",on:t,op:e}}}]),this.FINALIZE(t,e)}),t}),this.unaryExpression=this.RR("unaryExpression",()=>this.OR([{ALT:()=>this.SUBRULE1(this.postfixExpression)},{ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.UNARY_OP),on:this.SUBRULE2(this.unaryExpression)})}])),this.ppUnaryExpression=this.RR("ppUnaryExpression",()=>this.OR([{GATE:()=>this.LA(1).tokenType===pc.NON_PP_IDENTIFIER&&"defined"===this.LA(1).image,ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.IDENTIFIER),on:{kind:"variableExpression",var:this.OR1([{ALT:()=>this.SUBRULE(this.ppIdentifier)},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE1(this.ppIdentifier);return this.CONSUME(pc.RIGHT_PAREN),e}}])}})},{ALT:()=>({kind:"unaryExpression",op:this.OR2([{ALT:()=>this.CONSUME(pc.PLUS)},{ALT:()=>this.CONSUME(pc.DASH)},{ALT:()=>this.CONSUME(pc.TILDE)},{ALT:()=>this.CONSUME(pc.BANG)}]),on:this.SUBRULE2(this.ppUnaryExpression)})},{ALT:()=>this.SUBRULE(this.ppPrimaryExpression)}])),this.ppPrimaryExpression=this.RR("ppPrimaryExpression",()=>this.OR([{ALT:()=>({kind:"variableExpression",var:this.SUBRULE(this.ppIdentifier)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.INTCONSTANT)})},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.ppConstantExpression);return this.CONSUME(pc.RIGHT_PAREN),e}}])),this.ppConstantExpression=this.RR("ppConstantExpression",()=>{try{return this.preprocessing=!0,this.LEFT_ASSOC(this.logicalAndExpression,pc.OR_OP)}finally{this.preprocessing=!1}}),this.typeSpecifier=this.RR("typeSpecifier",()=>{const e=this.OPTION(()=>this.SUBRULE(this.precisionQualifier)),t=this.SUBRULE(this.typeSpecifierNoPrec);return Object.assign({},t,{precisionQualifier:e})}),this.parameterDeclaration=this.RR("parameterDeclaration",()=>{const e=this.OPTION(()=>this.CONSUME(pc.CONST)),t=this.OPTION1(()=>this.CONSUME(pc.PARAMETER_QUALIFIER)),n=this.SUBRULE(this.typeSpecifier);let r,i;return this.OPTION2(()=>{r=this.CONSUME2(pc.IDENTIFIER),i=this.OPTION3(()=>this.SUBRULE(this.arraySpecifier))}),{kind:"parameterDeclaration",parameterTypeQualifier:e,pName:r,arraySpecifier:i,parameterQualifier:t,typeSpecifier:n}}),this.fullySpecifiedType=this.RR("fullySpecifiedType",()=>({kind:"fullySpecifiedType",typeQualifier:this.OPTION(()=>this.SUBRULE(this.typeQualifier)),typeSpecifier:this.SUBRULE(this.typeSpecifier)})),this.structDeclaration=this.RR("structDeclaration",()=>{const e=this.SUBRULE(this.fullySpecifiedType),t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME(pc.IDENTIFIER),arraySpecifier:this.OPTION(()=>this.SUBRULE(this.arraySpecifier)),init:void 0};return t.push(e),e})}),this.CONSUME(pc.SEMICOLON),{kind:"structDeclaration",fsType:e,declarators:t}}),this.structSpecifier=this.RR("structSpecifier",()=>{this.CONSUME(pc.STRUCT);const e=this.OPTION2(()=>this.CONSUME(pc.IDENTIFIER));this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),{kind:"structSpecifier",name:e,declarations:t}}),this.initializer=this.RR("initializer",()=>this.SUBRULE(this.assignmentExpression)),this.singleDeclaration=this.RULE("singleDeclaration",()=>this.OR([{ALT:()=>{this.SUBRULE(this.fullySpecifiedType),this.OPTION1(()=>{this.CONSUME1(pc.IDENTIFIER),this.OPTION2(()=>{this.CONSUME(pc.LEFT_BRACKET),this.OPTION3(()=>this.SUBRULE(this.constantExpression)),this.CONSUME(pc.RIGHT_BRACKET)}),this.OPTION4(()=>{this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)})})}},{ALT:()=>({kind:"invariantDeclaration",INVARIANT:this.CONSUME(pc.INVARIANT),IDENTIFIER:this.CONSUME2(pc.IDENTIFIER)})}])),this.initDeclaratorList=this.RR("initDeclaratorList",()=>this.SUBRULE(this.externalDeclaration,{ARGS:[!1,!1]})),this.expressionStatement=this.RR("expressionStatement",()=>{const e=this.OPTION(()=>this.SUBRULE(this.expression));return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:e}}),this.condition=this.RR("condition",()=>this.OR({MAX_LOOKAHEAD:4,DEF:[{GATE:this.BACKTRACK(this.singleDeclaration),ALT:()=>{const e=this.SUBRULE2(this.fullySpecifiedType),t=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.EQUAL),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:[{kind:"declarator",name:t,init:this.SUBRULE3(this.initializer),arraySpecifier:void 0}]}}},{ALT:()=>this.SUBRULE(this.expression)}]})),this.caseLabel=this.RR("caseLabel",()=>this.OR([{ALT:()=>{this.CONSUME(pc.CASE);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.COLON),{kind:"caseLabel",case_:e}}},{ALT:()=>(this.CONSUME2(pc.DEFAULT),this.CONSUME2(pc.COLON),{kind:"caseLabel",case_:void 0})}])),this.selectionStatement=this.RR("selectionStatement",()=>{this.CONSUME(pc.IF),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),{kind:"selectionStatement",condition:e,yes:this.SUBRULE2(this.statement,{ARGS:[!0]}),no:this.OPTION(()=>(this.CONSUME(pc.ELSE),this.SUBRULE3(this.statement,{ARGS:[!0]})))}}),this.statement=this.RR("statement",e=>this.OR([{ALT:()=>this.SUBRULE(this.ppDirective),IGNORE_AMBIGUITIES:!0},{ALT:()=>{const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:{kind:"variableExpression",var:e}}},IGNORE_AMBIGUITIES:!0},{GATE:this.BACKTRACK(this.expressionStatement),ALT:()=>this.SUBRULE(this.expressionStatement)},{ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.selectionStatement)},{ALT:()=>this.SUBRULE(this.switchStatement)},{ALT:()=>this.SUBRULE(this.iterationStatement)},{ALT:()=>this.SUBRULE(this.jumpStatement)},{ALT:()=>this.SUBRULE(this.compoundStatement,{ARGS:[!!e]})}])),this.compoundStatement=this.RR("compoundStatement",e=>{if("object"==typeof e)throw new Error;this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.statement))),this.CONSUME(pc.RIGHT_BRACE),{kind:"compoundStatement",statements:t,newScope:!!e}}),this.iterationStatement=this.RR("iterationStatement",()=>this.OR([{ALT:()=>{this.CONSUME(pc.WHILE),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.condition);return this.CONSUME(pc.RIGHT_PAREN),{kind:"whileStatement",conditionExpression:e,statement:this.SUBRULE(this.statement)}}},{ALT:()=>{this.CONSUME2(pc.DO);const e=this.SUBRULE2(this.statement,{ARGS:[!0]});this.CONSUME2(pc.WHILE),this.CONSUME2(pc.LEFT_PAREN);const t=this.SUBRULE2(this.expression);return this.CONSUME2(pc.RIGHT_PAREN),this.CONSUME2(pc.SEMICOLON),{kind:"doWhileStatement",statement:e,conditionExpression:t}}},{ALT:()=>{this.CONSUME3(pc.FOR),this.CONSUME3(pc.LEFT_PAREN);const e=this.OR3([{GATE:this.BACKTRACK(this.initDeclaratorList),ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.expressionStatement)}]),t=this.OPTION3(()=>this.SUBRULE3(this.condition));this.CONSUME4(pc.SEMICOLON);const n=this.OPTION4(()=>this.SUBRULE4(this.expression));return this.CONSUME3(pc.RIGHT_PAREN),{kind:"forStatement",initExpression:e,conditionExpression:t,loopExpression:n,statement:this.SUBRULE3(this.statement)}}}])),this.translationUnit=this.RR("translationUnit",()=>{const e=[];return this.AT_LEAST_ONE(()=>e.push(this.SUBRULE(this.externalDeclaration,{ARGS:[!0,!0]}))),{kind:"translationUnit",declarations:e}}),this.uniformBlock=this.RR("uniformBlock",()=>{const e=this.SUBRULE(this.typeQualifier),t=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_BRACE);const n=[];let r,i;return this.MANY(()=>n.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),this.OPTION(()=>{r=this.CONSUME1(pc.IDENTIFIER),i=this.OPTION1(()=>this.SUBRULE(this.arraySpecifier))}),this.CONSUME(pc.SEMICOLON),{kind:"uniformBlock",typeQualifier:e,blockName:t,declarations:n,namespace:r,arraySpecifier:i}}),this.uniformBlockHeader=this.RULE("uniformBlockHeader",()=>{this.OPTION(()=>this.SUBRULE(this.layoutQualifier)),this.CONSUME(pc.UNIFORM),this.CONSUME(pc.IDENTIFIER),this.CONSUME(pc.LEFT_BRACE)}),this.typeQualifierDeclaration=this.RR("typeQualifierDeclaration",()=>{const e=this.SUBRULE(this.typeQualifier);return this.CONSUME(pc.SEMICOLON),{kind:"typeQualifierDeclaration",typeQualifier:e}}),this.externalDeclaration=this.RR("externalDeclaration",(e,t)=>this.OR([{ALT:()=>this.SUBRULE(this.ppCall)},{ALT:()=>this.SUBRULE(this.ppDirective)},{GATE:this.BACKTRACK(this.typeQualifierDeclaration),ALT:()=>this.SUBRULE(this.typeQualifierDeclaration)},{GATE:e?this.BACKTRACK(this.uniformBlockHeader):()=>!1,ALT:()=>this.SUBRULE(this.uniformBlock)},{ALT:()=>{const e=this.SUBRULE(this.fullySpecifiedType);return this.OR2([{GATE:t?void 0:()=>!1,ALT:()=>{const t=this.CONSUME1(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const n=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>n.push(this.SUBRULE(this.parameterDeclaration))}),this.CONSUME(pc.RIGHT_PAREN),this.OR3([{ALT:()=>(this.CONSUME(pc.SEMICOLON),{kind:"functionPrototype",name:t,returnType:e,params:n})},{ALT:()=>{const r=this.SUBRULE(this.compoundStatement);return{kind:"functionDefinition",name:t,returnType:e,params:n,body:r}},IGNORE_AMBIGUITIES:!1}])}},{ALT:()=>{const t=[];return this.MANY_SEP2({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME3(pc.IDENTIFIER),arraySpecifier:this.OPTION5(()=>this.SUBRULE(this.arraySpecifier)),init:this.OPTION7(()=>(this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)))};return t.push(e),e})}),this.CONSUME2(pc.SEMICOLON),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:t}}}])}},{ALT:()=>{this.CONSUME(pc.PRECISION);const e=this.CONSUME(pc.PRECISION_QUALIFIER),t=this.SUBRULE(this.typeSpecifierNoPrec);return this.CONSUME3(pc.SEMICOLON),{kind:"precisionDeclaration",precisionQualifier:e,typeSpecifierNoPrec:t}}}])),this.ppDefine=this.RR("ppDefine",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.DEFINE);const e=this.CONSUME(pc.IDENTIFIER),t=this.LA(1).tokenType===pc.LEFT_PAREN&&e.endOffset+1===this.LA(1).startOffset,n={kind:"ppDefine",what:e,params:this.OPTION({GATE:()=>t,DEF:()=>{this.CONSUME(pc.LEFT_PAREN);const e=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>e.push(this.SUBRULE(this.ppIdentifier))}),this.CONSUME(pc.RIGHT_PAREN),e}}),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(n),n}),this.ppInclude=this.RR("ppInclude",()=>{let e="";return this.OR([{ALT:()=>{const t=this.CONSUME(pc.HASH_INCLUDE_MODULE);e=t.image.substring(t.image.indexOf("<"))}},{ALT:()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.INCLUDE),e=this.CONSUME(pc.STRING).image}}]),{kind:"ppInclude",what:e}}),this.ppCall=this.RR("ppCall",()=>{const e=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>{const e=[];this.MANY(()=>this.OR({DEF:[{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>e.push(this.CONSUME(pc.BASIC_TYPE))},{ALT:()=>e.push(this.CONSUME(pc.ASSIGN_OP))},{ALT:()=>e.push(this.CONSUME(pc.SHIFT_OP))},{ALT:()=>e.push(this.CONSUME(pc.CONSTANT))},{ALT:()=>e.push(this.CONSUME(pc.KEYWORD))},{ALT:()=>e.push(this.CONSUME2(pc.IDENTIFIER))}]})),t.push({tokens:e,node:void 0})},MAX_LOOKAHEAD:1}),this.CONSUME(pc.RIGHT_PAREN),{kind:"ppCall",callee:e,args:t}}),this.ppCallArg=this.RULE("ppCallArg",()=>{const e=[];return e.push(this.CONSUME(pc.LEFT_PAREN)),this.MANY(()=>this.OR([{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>(e.push(this.LA(1)),this.SKIP_TOKEN())}])),e.push(this.CONSUME(pc.RIGHT_PAREN)),e}),this.ppNone=this.RR("ppNone",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.ELSE)},{ALT:()=>this.CONSUME(pc.ENDIF)}]),tokens:[],node:void 0};return this.ppDefs.push(e),e}),this.ppMulti=this.RR("ppMulti",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IF)},{ALT:()=>this.CONSUME(pc.ELIF)},{ALT:()=>this.CONSUME(pc.ERROR)},{ALT:()=>this.CONSUME(pc.VERSION)},{ALT:()=>this.CONSUME(pc.LINE)}]),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(e),e}),this.ppPragma=this.RR("ppPragma",()=>({kind:"ppPragma",dir:this.CONSUME(pc.PRAGMA_DIRECTIVE)})),this.ppSingle=this.RR("ppSingle",()=>(this.CONSUME(pc.HASH),{kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IFDEF)},{ALT:()=>this.CONSUME(pc.IFNDEF)}]),tokens:[this.CONSUME(pc.IDENTIFIER)],node:void 0})),this.ppExtension=this.RR("ppExtension",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.EXTENSION);const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.COLON),{kind:"ppExtension",extension:e,behavior:this.CONSUME1(pc.IDENTIFIER)}}),this.ppDirective=this.RR("ppDirective",()=>this.OR([{ALT:()=>this.SUBRULE(this.ppDefine)},{ALT:()=>this.SUBRULE(this.ppExtension)},{ALT:()=>this.SUBRULE(this.ppNone)},{ALT:()=>this.SUBRULE(this.ppSingle)},{ALT:()=>this.SUBRULE(this.ppMulti)},{ALT:()=>this.SUBRULE(this.ppPragma)},{ALT:()=>this.SUBRULE(this.ppInclude)}])),this.ppIdentifier=this.RR("ppIdentifier",()=>this.OR([{ALT:()=>this.CONSUME(pc.IDENTIFIER)},{ALT:()=>this.CONSUME(pc.KEYWORD)},{ALT:()=>this.CONSUME(pc.BASIC_TYPE)}])),this.ppDefs=[],this.performSelfAnalysis()}reset(){super.reset(),this.ppDefs=[],this.backtracking=!1,this.preprocessing=!1}LEFT_ASSOC(e,t){const n=this.LA(1);let r=this.SUBRULE1(e);return this.MANY(()=>{const i=this.CONSUME(t),s=this.SUBRULE2(e);return r={kind:"binaryExpression",lhs:r,rhs:s,op:i,firstToken:n,lastToken:this.LA(0)},r}),r}ANNOTATE(e){return(...t)=>{const n=this.LA(1),r=e(...t);return r&&hc(r)&&!r.firstToken&&this.FINALIZE(r,n),r}}BACKTRACK(e,t){const n=super.BACKTRACK(e,t);return function(){try{return this.backtracking=!0,n.call(this)}finally{this.backtracking=!1}}}RR(e,t,n){return super.RULE(e,this.ANNOTATE(t),n)}FINALIZE(e,t){this.RECORDING_PHASE||this.backtracking||(e.firstToken=t,e.lastToken=this.LA(0))}isAtEof(){return this.LA(1).tokenType===Ml}};const{ll:{printDocToString:vc},LX:{indentIfBreak:Cc,group:Dc,indent:Sc,join:Ac,line:_c,softline:yc,hardline:bc,fill:Tc,lineSuffixBoundary:Rc}}=r,xc=new class extends uc{constructor(){super(...arguments),this.result=void 0}visit(e){if(!this.result){const t=this.result=[];return super.visit(e),this.result=void 0,t}e&&this.result.push(e)}};function wc(e){return(cc(e)?e:e.lastToken).endOffset+1}const Fc={"glsl-parser":{parse(e,t){const n=function(e){const t=function(e){const t=[];let n="",r=0,i=0;return{result:e.replace(/\\(\r\n|\n\r|\r|\n)(.*?)(?:(?=\\?[\r\n])|$)/g,(s,o,a,l)=>{r++,i+=function(e,t){let n=t;for(;n>=0&&"\r"!==e[n]&&"\n"!==e[n];)n--;return t-n-1}(e,l),t.push({originalOffset:l+1+o.length,newOffset:l-n.length,length:a.length,lineDiff:-r,columnDiff:i}),n+=" "+o;let u="";return e.length>l+s.length&&"\\"===e[l+s.length]||(u=n,n="",r=0,i=0),a+u}),changes:t}}(e),n=gc.tokenize(t.result);!function(e,t){if(t.errors.length)throw new Error("LEXER ERROR: "+t.errors.map(t=>t.message+":\n"+dc(e,{startLine:t.line,startColumn:t.column,endLine:t.line,endColumn:t.column+t.length})).join())}(t.result,n),function(e,t){let n=0;function r(e,t){const n=t.originalOffset-t.newOffset;e.startOffset>=t.newOffset&&(e.lineNoCont=e.startLine,e.startOffset+=n,e.startLine-=t.lineDiff,e.startColumn-=t.columnDiff),e.endOffset+=n,e.endLine-=t.lineDiff,e.endColumn-=t.columnDiff}for(const i of t){for(;e[n]&&e[n].endOffset0)throw new Error("PARSE ERROR: "+t.map(t=>t.message+"\n"+t.context.ruleStack.join(" > ")+"\n"+dc(e,t.token)).join("\n"))}(t.result,Ec.errors);const i=Ec.ppDefs;function s(e,t){Ec.input=e;const n=t(Ec);return Ec.isAtEof()&&0===Ec.errors.length?n:void 0}for(const e of i)e.node=s(e.tokens,e=>e.externalDeclaration(!0,!0))??s(e.tokens,e=>e.statement())??s(e.tokens,e=>e.expression());return r.comments=n.groups.COMMENTS,r}(e);return n.comments?.forEach(e=>e.value=JSON.stringify(e)),n},astFormat:"glsl-ast",locStart:function(e){return(cc(e)?e:e.firstToken).startOffset},locEnd:wc}};function Nc(e){switch(e){case pc.STAR:case pc.SLASH:case pc.PERCENT:return 4;case pc.PLUS:case pc.DASH:return 5;case pc.LEFT_OP:case pc.RIGHT_OP:return 6;case pc.LEFT_ANGLE:case pc.RIGHT_ANGLE:case pc.LE_OP:case pc.GE_OP:return 7;case pc.EQ_OP:case pc.NE_OP:return 8;case pc.AMPERSAND:return 9;case pc.CARET:return 10;case pc.VERTICAL_BAR:return 11;case pc.AND_OP:case pc.XOR_OP:return 12;case pc.OR_OP:return 13;case pc.COMMA:return 17;default:throw new Error}}function Lc(e,t){switch(e.kind){default:return 1;case"variableExpression":return t?.find(t=>t.image===e.var.image)?18:1;case"arrayAccess":case"functionCall":case"fieldAccess":case"postfixExpression":return 2;case"unaryExpression":return 3;case"binaryExpression":return Nc(e.op.tokenType);case"conditionalExpression":return 15;case"assignmentExpression":return 16;case"commaExpression":return 17}}function Oc(e,t){return t?["(",e,")"]:e}function Ic(e,t,n,r){const i="binaryExpression"===n.kind&&"binaryExpression"===n.lhs.kind&&Nc(n.lhs.op.tokenType)===Nc(n.op.tokenType)||"commaExpression"===n.kind&&"commaExpression"===n.lhs.kind,s="binaryExpression"===n.kind?n.op.tokenType:pc.COMMA;let o;return i?(o=e.call(e=>Ic(e,t,e.getValue(),r),"lhs"),o.push("commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))),o):[Oc(e.call(t,"lhs"),Lc(n.lhs,r)>Nc(s)),"commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))]}function kc(e,t,n){return"expressionStatement"!==e.kind||e.expression?"compoundStatement"===e.kind||n?[" ",t]:Sc([_c,t]):";"}function Mc(e,t){return vc(e,Object.assign({},t,{printWidth:t.printWidth-2})).formatted.trim().replace(/^.*(?=[\r\n])/gm,e=>e+" ".repeat(t.printWidth-2-e.length+1)+"\\")}function Pc(e){return"assignmentExpression"===e.kind}function Bc(e){return"assignmentExpression"===e.kind||"declarator"===e.kind}function Uc(e,t,n,r,i,s){const o=function(e,t,n){if(!n)return"only-left";const r=!Pc(n);return e.match(Pc,Bc,e=>!r||"expressionStatement"!==e.kind&&"initDeclaratorListDeclaration"!==e.kind)?r?"chain-tail":"chain":!r&&Pc(n.rhs)||(t.originalText,0)||"binaryExpression"===n.kind||"commaExpression"===n.kind||"conditionalExpression"===n.kind&&"binaryExpression"===n.condition.kind?"break-after-operator":"constantExpression"===n.kind?"never-break-after-operator":"fluid"}(e,t,s);switch(o){case"break-after-operator":return Dc([Dc(n),r,Dc(Sc([_c,i]))]);case"never-break-after-operator":return Dc([Dc(n),r," ",i]);case"fluid":{const e=Symbol("assignment");return Dc([Dc(n),r,Dc(Sc(_c),{id:e}),Rc,Cc(i,{groupId:e})])}case"chain":return[Dc(n),r,_c,i];case"chain-tail":return[Dc(n),r,Sc([_c,i])];case"only-left":return n;default:throw new Error}}const $c={"glsl-ast":{print(e,t,n){const r=t.inMacro,i=e.getValue();if(!i)return[];if(cc(i))return i.image;const s=t=>e.call(n,t);try{switch(i.kind){case"translationUnit":{const r=[];return e.each((e,i)=>{const s=e.getValue();r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc),r.push(bc)},"declarations"),r}case"precisionDeclaration":return["precision ",i.precisionQualifier.image," ",e.call(n,"typeSpecifierNoPrec"),";"];case"fullySpecifiedType":{const e=[];return i.typeQualifier&&e.push(s("typeQualifier")," "),e.push(s("typeSpecifier")),e}case"typeSpecifier":{const e=[];return i.precisionQualifier&&e.push(i.precisionQualifier.image," "),e.push(s("typeSpecifierNonArray")),i.arraySpecifier&&e.push(s("arraySpecifier")),e}case"typeQualifier":{const e=[];return i.invariantQualifier&&e.push("invariant"),i.interpolationQualifier&&e.push(i.interpolationQualifier.image),i.layoutQualifier&&e.push(s("layoutQualifier")),i.storageQualifier&&e.push(s("storageQualifier")),Ac(" ",e)}case"storageQualifier":{const t=[];return i.CONST&&t.push("const"),i.CENTROID&&e.getParentNode().interpolationQualifier?.tokenType!==pc.FLAT&&t.push("centroid"),i.IN&&t.push("in"),i.OUT&&t.push("out"),i.VARYING&&t.push("varying"),i.ATTRIBUTE&&t.push("attribute"),i.UNIFORM&&t.push("uniform"),Ac(" ",t)}case"functionPrototype":case"functionDefinition":return[Dc([s("returnType")," ",s("name"),"(",Sc([yc,Ac([",",_c],e.map(n,"params"))]),yc,")"]),"functionPrototype"===i.kind?";":[" ",s("body")]];case"parameterDeclaration":return[i.parameterTypeQualifier?[s("parameterTypeQualifier")," "]:"",i.parameterQualifier?.tokenType===pc.OUT||i.parameterQualifier?.tokenType===pc.INOUT?i.parameterQualifier?.image+" ":"",s("typeSpecifier")," ",s("pName"),s("arraySpecifier")];case"initDeclaratorListDeclaration":case"structDeclaration":{const t=e.map(n,"declarators"),r="forStatement"===e.getParentNode().kind,o=i.declarators.some(e=>e.init);return Dc([s("fsType"),0===t.length?"":" ",1===t.length?t:Dc(Sc(Ac([",",o&&!r?bc:_c],t))),";"])}case"declarator":{const n=s("arraySpecifier"),r=[i.name.image,n];return Uc(e,t,r," =",s("init"),i.init)}case"arraySpecifier":return Dc(["[",Sc([yc,s("size")]),yc,"]"]);case"arrayAccess":return[Oc(s("on"),Lc(i.on,r)>2),"[",s("index"),"]"];case"structSpecifier":{const r=[];return e.each((e,i,s)=>{const o=e.getValue();r.push(bc),r.push(n(e)),i!==s.length-1&&_s.isNextLineEmpty(t.originalText,o,wc)&&r.push(bc)},"declarations"),Dc(["struct",i.name?" "+i.name.image:""," {",Sc(r),bc,"}"])}case"compoundStatement":{const r=[],s=!!i.comments?.some(e=>!e.leading&&!e.trailing&&!e.printed);return e.each((e,i)=>{const s=e.getValue();0!==i&&r.push(bc),r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc)},"statements"),s&&e.each(e=>{const t=e.getValue();t.leading||t.trailing||(r.push(n(e)),t.printed=!0)},"comments"),Dc(["{",r.length?[Sc([bc,r]),bc]:"","}"])}case"returnStatement":return i.what?["return"," ",s("what"),";"]:"return;";case"breakStatement":return"break;";case"continueStatement":return"continue;";case"discardStatement":return"discard;";case"selectionStatement":{const e=[],t=kc(i.yes,s("yes"),!1),n=Dc(["if (",Dc([Sc([yc,s("condition")]),yc]),")",t]);if(e.push(n),i.no){const t=i.yes.comments?.some(e=>e.trailing&&e.tokenType===pc.LINE_COMMENT)||i.yes.comments?.findLast(e=>!e.leading&&!e.trailing)?.tokenType===pc.LINE_COMMENT,n="compoundStatement"===i.yes.kind&&!t;e.push(n?" ":bc),e.push("else",Dc(kc(i.no,s("no"),"selectionStatement"===i.no.kind)))}return e}case"forStatement":{const e=kc(i.statement,s("statement"),!1),t=!1,n=t?[t,yc]:"";return"expressionStatement"!==i.initExpression.kind||i.initExpression.expression||i.conditionExpression||i.loopExpression?[n,Dc(["for (",Dc([Sc([yc,s("initExpression"),_c,s("conditionExpression"),";",_c,s("loopExpression")]),yc]),")",e])]:[n,Dc(["for (;;)",e])]}case"whileStatement":{const e=kc(i.statement,s("statement"),!1);return["while (",Dc(s("conditionExpression")),")",e]}case"doWhileStatement":return["do ",s("statement")," while (",Dc(s("conditionExpression")),");"];case"functionCall":return function(t){const r=e.map(n,"args");let i,o;if(void 0===t.callee.arraySpecifier&&cc(t.callee.typeSpecifierNonArray)&&void 0!==(i=function(e){switch(e){case pc.MAT2X2:return[2,2];case pc.MAT2X3:return[2,3];case pc.MAT2X4:return[2,4];case pc.MAT3X2:return[3,2];case pc.MAT3X3:return[3,3];case pc.MAT3X4:return[3,4];case pc.MAT4X2:return[4,2];case pc.MAT4X3:return[4,3];case pc.MAT4X4:return[4,4];default:return}}(t.callee.typeSpecifierNonArray.tokenType))&&i[0]*i[1]===t.args.length){const e=t.args.every(e=>"constantExpression"===e.kind&&(e.const_.tokenType===pc.FLOATCONSTANT||e.const_.tokenType===pc.INTCONSTANT)||"unaryExpression"===e.kind&&(e.op.tokenType===pc.PLUS||e.op.tokenType===pc.DASH)&&"constantExpression"===e.on.kind&&(e.on.const_.tokenType===pc.FLOATCONSTANT||e.on.const_.tokenType===pc.INTCONSTANT));if(e){const e=[],n=[];let s=0,a=0;for(let i=0;i2),".",s("functionCall")];case"postfixExpression":return[Oc(s("on"),Lc(i.on,r)>2),s("op")];case"unaryExpression":return[s("op"),Oc(s("on"),Lc(i.on,r)>3)];case"assignmentExpression":{const n=s("lhs");return Uc(e,t,n," "+i.op.image,s("rhs"),i.rhs)}case"conditionalExpression":return[Oc(s("condition"),Lc(i.condition,r)>=15),Sc([_c,"? ",s("yes"),_c,": ",s("no")])];case"commaExpression":case"binaryExpression":{const t=Ic(e,n,i,r),s=e.getParentNode();if("selectionStatement"===s.kind||"whileStatement"===s.kind||"switchStatement"===s.kind||"doWhileStatement"===s.kind)return t;const o=()=>{const t=e.getParentNode();return!!t&&("functionCall"===t.kind&&"commaExpression"===i.kind||"binaryExpression"===t.kind&&((n=t.op.tokenType)===pc.CARET||n===pc.VERTICAL_BAR||n===pc.AMPERSAND));var n},a=e.getParentNode(1);if("returnStatement"===s.kind||"forStatement"===s.kind||"conditionalExpression"===s.kind&&"returnStatement"!==a.kind&&"functionCall"!==a.kind||"assignmentExpression"===s.kind||"declarator"===s.kind)return Dc(t);{const e=t.slice(0,1),n=t.slice(e.length);return Dc(Oc([...e,Sc(n)],o()))}}case"expressionStatement":return[s("expression"),";"];case"fieldAccess":return[Oc(s("on"),Lc(i.on,r)>2),".",s("field")];case"constantExpression":{const e=i.const_;return e.tokenType===pc.FLOATCONSTANT?function(e){const t=e.indexOf(".");return 0===t&&(e="0"+e),e=e.replace("E","e"),-1!==t&&(e=(e=(e=(e=e.replace(".e","e")).replace(/(?=4):Tc(Ac(_c,e.map(n,"tokens")))])]);return t.inMacro=void 0,Mc(r,t)}case"ppDir":return Mc(Dc(["#",i.dir.image," ",Sc(i.node?s("node"):Tc(Ac(_c,e.map(n,"tokens"))))]),t);case"ppPragma":return i.dir.image.replace(/^#\s+/,"#").replace(/^#pragma\s{2,}/,"#pragma ");case"ppCall":return Dc([i.callee.image,"(",Ac([",",_c],e.map((e,t,n)=>n[t].tokens.map(e=>e.image),"args")),")"]);case"ppInclude":return["#include ",i.what];case"ppExtension":return["#extension ",i.extension.image," : ",i.behavior.image];case"switchStatement":return["switch (",Dc([Sc([yc,s("initExpression")]),yc]),") {",i.cases.length?Sc([bc,Ac(bc,e.map(n,"cases"))]):"",bc,"}"];case"caseBlock":{const r=s("caseLabel"),i=[];return e.each((e,r)=>{const s=e.getValue();i.push(bc),i.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&i.push(bc)},"statements"),[r,Sc(i)]}case"caseLabel":return void 0===i.case_?"default:":["case ",s("case_"),":"];case"layoutQualifier":return["layout(",Ac(", ",i.layoutQualifierIds.map(e=>void 0===e.init?e.IDENTIFIER.image:[e.IDENTIFIER.image," = ",e.init.image])),")"];case"uniformBlock":return[s("typeQualifier")," ",i.blockName.image," {",Sc([bc,Ac(bc,e.map(n,"declarations"))]),bc,"};"];case"typeQualifierDeclaration":return[s("typeQualifier"),";"];default:throw new Error("unexpected n type "+i.kind+"\n"+JSON.stringify(i).substring(0,100))}}catch(e){throw console.error("error printing "+JSON.stringify(i).substring(0,100)+"\n"),e}},embed(e,t){const n=e.getValue();return!cc(n)||n.tokenType!==pc.LINE_COMMENT&&n.tokenType!==pc.MULTILINE_COMMENT?null:(e,t,n,r)=>{}},getVisitorKeys:(e,t)=>cc(e)?[]:Object.keys(e).filter(e=>!t.has(e)),getCommentChildNodes:e=>cc(e)?[]:xc.visit(e),canAttachComment:e=>!0,printComment:function(e,t){const n=e.getValue();return n.tokenType===pc.MULTILINE_COMMENT&&"*"===n.image[2]?"/**\n"+n.image.substring(3,n.image.length-2).split("\n").map(e=>" *"===e?"":e.startsWith(" * ")?e.substring(3):e).join("\n").trim().split("\n").map(e=>""===e?" *":" * "+e).join("\n")+"\n */":n.image},hasPrettierIgnore(e){const t=e.getValue();return(t&&hc(t)&&t.comments?.some(e=>/\/\/\s*prettier-ignore\b.*/.test(e.image)))??!1}}},Gc={parsers:Fc,printers:$c};function Vc(e){return e.replace(/^([^\n]*;)\n(?=(?:[A-Za-z_]\w*\s+)+[A-Za-z_]\w*\s*\()/gm,"$1\n\n").replace(/^}\n(?=\S)/gm,"}\n\n")}var Wc,Hc,jc=(Wc={program:function(e){return jc(e.program)+jc(e.wsEnd)},segment:function(e){return jc(e.blocks)},text:function(e){return jc(e.text)},literal:function(e){return jc(e.wsStart)+jc(e.literal)+jc(e.wsEnd)},identifier:function(e){return jc(e.identifier)+jc(e.wsEnd)},binary:function(e){return jc(e.left)+jc(e.operator)+jc(e.right)},group:function(e){return jc(e.lp)+jc(e.expression)+jc(e.rp)},unary:function(e){return jc(e.operator)+jc(e.expression)},unary_defined:function(e){return jc(e.operator)+jc(e.lp)+jc(e.identifier)+jc(e.rp)},int_constant:function(e){return jc(e.token)+jc(e.wsEnd)},elseif:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},if:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},ifdef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},ifndef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},else:function(e){return jc(e.token)+jc(e.wsEnd)+jc(e.body)},error:function(e){return jc(e.error)+jc(e.message)+jc(e.wsEnd)},undef:function(e){return jc(e.undef)+jc(e.identifier)+jc(e.wsEnd)},define:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.body)+jc(e.wsEnd)},define_arguments:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.lp)+jc(e.args)+jc(e.rp)+jc(e.body)+jc(e.wsEnd)},conditional:function(e){return jc(e.wsStart)+jc(e.ifPart)+jc(e.elseIfParts)+jc(e.elsePart)+jc(e.endif)+jc(e.wsEnd)},version:function(e){return jc(e.version)+jc(e.value)+jc(e.profile)+jc(e.wsEnd)},pragma:function(e){return jc(e.pragma)+jc(e.body)+jc(e.wsEnd)},line:function(e){return jc(e.line)+jc(e.value)+jc(e.wsEnd)},extension:function(e){return jc(e.extension)+jc(e.name)+jc(e.colon)+jc(e.behavior)+jc(e.wsEnd)}},Hc=function(e){return"string"==typeof e?e:null==e?"":Array.isArray(e)?e.map(Hc).join(""):e.type in Wc?Wc[e.type](e):"NO GENERATOR FOR ".concat(e.type)+e});const zc=jc;function Xc(e,t,n,r){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Xc.prototype),i.expected=t,i.found=n,i.location=r,i.name="SyntaxError",i}function Kc(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}function Yc(e,t){var n,r={},i=(t=void 0!==t?t:{}).grammarSource,s={program:An,constant_expression:hr},o=An,a="<<",l=">>",u="<=",c=">=",h="==",d="!=",f="&&",p="||",m="(",g=")",E=",",v="!",C="-",D="~",S="+",A="*",_="/",y="%",b="<",T=">",R="|",x="^",w="&",F=":",N="#",L="define",O="line",I="undef",k="error",M="pragma",P="defined",B="if",U="ifdef",$="ifndef",G="elif",V="else",W="endif",H="version",j="extension",z="0",X="//",K="/*",Y="*/",q=/^[A-Za-z_]/,Q=/^[A-Za-z_0-9]/,Z=/^[uU]/,J=/^[1-9]/,ee=/^[0-7]/,te=/^[xX]/,ne=/^[0-9a-fA-F]/,re=/^[0-9]/,ie=/^[\n\r]/,se=/^[^\n\r]/,oe=/^[ \t]/,ae=gn("<<",!1),le=gn(">>",!1),ue=gn("<=",!1),ce=gn(">=",!1),he=gn("==",!1),de=gn("!=",!1),fe=gn("&&",!1),pe=gn("||",!1),me=gn("(",!1),ge=gn(")",!1),Ee=gn(",",!1),ve=gn("!",!1),Ce=gn("-",!1),De=gn("~",!1),Se=gn("+",!1),Ae=gn("*",!1),_e=gn("/",!1),ye=gn("%",!1),be=gn("<",!1),Te=gn(">",!1),Re=gn("|",!1),xe=gn("^",!1),we=gn("&",!1),Fe=gn(":",!1),Ne=gn("#",!1),Le=gn("define",!1),Oe=(gn("include",!1),gn("line",!1)),Ie=gn("undef",!1),ke=gn("error",!1),Me=gn("pragma",!1),Pe=gn("defined",!1),Be=gn("if",!1),Ue=gn("ifdef",!1),$e=gn("ifndef",!1),Ge=gn("elif",!1),Ve=gn("else",!1),We=gn("endif",!1),He=gn("version",!1),je=gn("extension",!1),ze=En([["A","Z"],["a","z"],"_"],!1,!1),Xe=En([["A","Z"],["a","z"],"_",["0","9"]],!1,!1),Ke=vn("number"),Ye=En(["u","U"],!1,!1),qe=En([["1","9"]],!1,!1),Qe=gn("0",!1),Ze=En([["0","7"]],!1,!1),Je=En(["x","X"],!1,!1),et=En([["0","9"],["a","f"],["A","F"]],!1,!1),tt=En([["0","9"]],!1,!1),nt=vn("control line"),rt=En(["\n","\r"],!1,!1),it=vn("token string"),st=En(["\n","\r"],!0,!1),ot=vn("text"),at=vn("if"),lt=vn("primary expression"),ut=vn("unary expression"),ct=vn("multiplicative expression"),ht=vn("additive expression"),dt=vn("shift expression"),ft=vn("relational expression"),pt=vn("equality expression"),mt=vn("and expression"),gt=vn("exclusive or expression"),Et=vn("inclusive or expression"),vt=vn("logical and expression"),Ct=vn("logical or expression"),Dt=vn("constant expression"),St=vn("whitespace or comment"),At=gn("//",!1),_t=gn("/*",!1),yt=gn("*/",!1),bt={type:"any"},Tt=vn("whitespace"),Rt=En([" ","\t"],!1,!1),xt=function(e,t){return gr("program",{program:e.blocks,wsEnd:t})},wt=function(e,t){return gr("int_constant",{token:e,wsEnd:t})},Ft=function(e,t){return gr("literal",{literal:e,wsEnd:t})},Nt=function(e){return"#"},Lt=function(e,t,n){return gr("literal",{literal:t,wsStart:e,wsEnd:n})},Ot=function(e,t){return gr("identifier",{identifier:e,wsEnd:t})},It=function(e){return gr("identifier",{identifier:e})},kt=function(e){return gr("text",{text:e.join("")})},Mt=function(e){return gr("segment",{blocks:e})},Pt=function(e,t,n,r,i){return[r,...i.flat()]},Bt=function(e,t,n,r,i,s){return gr("define_arguments",{define:e,identifier:t,lp:n,args:r||[],rp:i,body:s})},Ut=function(e,t,n){return gr("define",{define:e,identifier:t,body:n})},$t=function(e,t){return gr("line",{line:e,value:t})},Gt=function(e,t){return gr("undef",{undef:e,identifier:t})},Vt=function(e,t){return gr("error",{error:e,message:t})},Wt=function(e,t){return gr("pragma",{pragma:e,body:t})},Ht=function(e,t,n){return gr("version",{version:e,value:t,profile:n})},jt=function(e,t,n,r){return gr("extension",{extension:e,name:t,colon:n,behavior:r})},zt=function(e,t){return{...e,wsEnd:t}},Xt=function(e,t,n){return{...e,body:n,wsEnd:t}},Kt=function(e,t,n,r,i){return gr("elseif",{token:t,expression:n,wsEnd:r,body:i})},Yt=function(e,t,n,r,i){return gr("else",{token:n,wsEnd:r,body:i})},qt=function(e,t,n,r,i){return gr("conditional",{ifPart:e,elseIfParts:t,elsePart:n,endif:r,wsEnd:i})},Qt=function(e,t){return gr("ifdef",{token:e,identifier:t})},Zt=function(e,t){return gr("ifndef",{token:e,identifier:t})},Jt=function(e,t){return gr("if",{token:e,expression:t})},en=function(e,t,n){return gr("group",{lp:e,expression:t,rp:n})},tn=function(e,t,n,r){return gr("unary_defined",{operator:e,lp:t,identifier:n,rp:r})},nn=function(e,t){return gr("unary",{operator:e,expression:t})},rn=function(e,t){return Cr(e,t)},sn=function(e,t){return vr(e,t)},on=function(e,t,n){return Er(t,n)},an=function(e,t){return Er(e,t.flat())},ln=function(e){return e},un=function(e){return e},cn=0,hn=[{line:1,column:1}],dn=0,fn=[],pn=0,mn={};if("startRule"in t){if(!(t.startRule in s))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=s[t.startRule]}function gn(e,t){return{type:"literal",text:e,ignoreCase:t}}function En(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function vn(e){return{type:"other",description:e}}function Cn(t){var n,r=hn[t];if(r)return r;for(n=t-1;!hn[n];)n--;for(r={line:(r=hn[n]).line,column:r.column};ndn&&(dn=cn,fn=[]),fn.push(e))}function An(){var e,t,n,i=75*cn+0,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Qn())!==r?(n=dr(),e=xt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}function _n(){var t,n,i,s=75*cn+2,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===a?(n=a,cn+=2):(n=r,0===pn&&Sn(ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function yn(){var t,n,i,s=75*cn+3,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===l?(n=l,cn+=2):(n=r,0===pn&&Sn(le)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function bn(){var t,n,i,s=75*cn+4,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===u?(n=u,cn+=2):(n=r,0===pn&&Sn(ue)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Tn(){var t,n,i,s=75*cn+5,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===c?(n=c,cn+=2):(n=r,0===pn&&Sn(ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Rn(){var t,n,i,s=75*cn+6,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===h?(n=h,cn+=2):(n=r,0===pn&&Sn(he)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function xn(){var t,n,i,s=75*cn+7,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===d?(n=d,cn+=2):(n=r,0===pn&&Sn(de)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function wn(){var t,n,i,s=75*cn+8,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===f?(n=f,cn+=2):(n=r,0===pn&&Sn(fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Fn(){var t,n,i,s=75*cn+9,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===p?(n=p,cn+=2):(n=r,0===pn&&Sn(pe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Nn(){var t,n,i,s=75*cn+10,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,40===e.charCodeAt(cn)?(n=m,cn++):(n=r,0===pn&&Sn(me)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Ln(){var t,n,i,s=75*cn+11,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,41===e.charCodeAt(cn)?(n=g,cn++):(n=r,0===pn&&Sn(ge)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function On(){var t,n,i,s=75*cn+12,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,44===e.charCodeAt(cn)?(n=E,cn++):(n=r,0===pn&&Sn(Ee)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function In(){var t,n,i,s=75*cn+14,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,45===e.charCodeAt(cn)?(n=C,cn++):(n=r,0===pn&&Sn(Ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function kn(){var t,n,i,s=75*cn+16,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,43===e.charCodeAt(cn)?(n=S,cn++):(n=r,0===pn&&Sn(Se)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Mn(){var t,n,i,s=75*cn+17,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,42===e.charCodeAt(cn)?(n=A,cn++):(n=r,0===pn&&Sn(Ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Pn(){var t,n,i,s=75*cn+18,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,47===e.charCodeAt(cn)?(n=_,cn++):(n=r,0===pn&&Sn(_e)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Bn(){var t,n,i,s=75*cn+19,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,37===e.charCodeAt(cn)?(n=y,cn++):(n=r,0===pn&&Sn(ye)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Un(){var t,n,i,s=75*cn+20,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,60===e.charCodeAt(cn)?(n=b,cn++):(n=r,0===pn&&Sn(be)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function $n(){var t,n,i,s=75*cn+21,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,62===e.charCodeAt(cn)?(n=T,cn++):(n=r,0===pn&&Sn(Te)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Gn(){var t,n,i,s=75*cn+22,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,124===e.charCodeAt(cn)?(n=R,cn++):(n=r,0===pn&&Sn(Re)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Vn(){var t,n,i,s=75*cn+23,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,94===e.charCodeAt(cn)?(n=x,cn++):(n=r,0===pn&&Sn(xe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Wn(){var t,n,i,s=75*cn+24,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,38===e.charCodeAt(cn)?(n=w,cn++):(n=r,0===pn&&Sn(we)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Hn(){var t,n,i,s=75*cn+26,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,35===e.charCodeAt(cn)?(i=N,cn++):(i=r,0===pn&&Sn(Ne)),(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Nt(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function jn(){var t,n,i,s,o,a,l=75*cn+27,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===L?(a=L,cn+=6):(a=r,0===pn&&Sn(Le)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function zn(){var t,n,i,s,o,a,l=75*cn+37,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===G?(a=G,cn+=4):(a=r,0===pn&&Sn(Ge)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function Xn(){var t,n,i,s,o,a,l=75*cn+42,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Ot(n,i)):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t}function Kn(){var t,n,i,s,o=75*cn+44,a=mn[o];return a?(cn=a.nextPos,a.result):(pn++,t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+46,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,J.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(qe)),i!==r){for(s=[],o=qn();o!==r;)s.push(o),o=qn();n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o=75*cn+47,a=mn[o];if(a)return cn=a.nextPos,a.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r){for(i=[],ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));s!==r;)i.push(s),ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));t=n=[n,i]}else cn=t,t=r;return mn[o]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+48,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r)if(te.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Je)),i!==r){for(s=[],ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));o!==r;)s.push(o),ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));t=n=[n,i,s]}else cn=t,t=r;else cn=t,t=r;return mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),t=n!==r?e.substring(t,cn):n)),pn--,t===r&&(n=r,0===pn&&Sn(Ke)),mn[o]={nextPos:cn,result:t},t)}function Yn(){var t,n=75*cn+45,i=mn[n];return i?(cn=i.nextPos,i.result):(Z.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(Ye)),mn[n]={nextPos:cn,result:t},t)}function qn(){var t,n=75*cn+49,i=mn[n];return i?(cn=i.nextPos,i.result):(re.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(tt)),mn[n]={nextPos:cn,result:t},t)}function Qn(){var e,t,n,i,s,o=75*cn+50,a=mn[o];if(a)return cn=a.nextPos,a.result;if(cn,t=[],(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}if(n!==r){for(;n!==r;)if(t.push(n),(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}}else t=r;return t!==r&&(t=Mt(t)),e=t,mn[o]={nextPos:cn,result:e},e}function Zn(){var t,n,i,s,o,a,l,u,c,h,d,f=75*cn+51,p=mn[f];if(p)return cn=p.nextPos,p.result;if(pn++,t=function(){var t,n,i,s,o,a,l,u,c=75*cn+54,h=mn[c];if(h)return cn=h.nextPos,h.result;if(t=cn,n=cn,i=function(){var t,n,i,s=75*cn+55,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+35,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===U?(a=U,cn+=5):(a=r,0===pn&&Sn(Ue)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Qt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+36,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===$?(a=$,cn+=6):(a=r,0===pn&&Sn($e)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Zt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+34,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,2)===B?(a=B,cn+=2):(a=r,0===pn&&Sn(Be)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r?((i=Jn())===r&&(i=null),t=Jt(n,i)):(cn=t,t=r))),pn--,t===r&&(n=r,0===pn&&Sn(at)),mn[s]={nextPos:cn,result:t},t)}(),i!==r?(ie.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(rt)),s!==r?((o=Qn())===r&&(o=null),n=Xt(i,s,o)):(cn=n,n=r)):(cn=n,n=r),n!==r){for(i=[],s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s=cn,o=function(){var t,n,i,s,o,a,l=75*cn+38,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===V?(a=V,cn+=4):(a=r,0===pn&&Sn(Ve)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a!==r?((l=Qn())===r&&(l=null),s=Yt(n,i,o,a,l)):(cn=s,s=r)):(cn=s,s=r),s===r&&(s=null),o=function(){var t,n,i,s,o,a,l=75*cn+39,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===W?(a=W,cn+=5):(a=r,0===pn&&Sn(We)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a===r&&(a=null),t=qt(n,i,s,o,a)):(cn=t,t=r)}else cn=t,t=r;return mn[c]={nextPos:cn,result:t},t}(),t===r){if(t=cn,n=cn,(i=jn())!==r)if(s=function(){var t,n,i,s,o,a,l=75*cn+43,u=mn[l];if(u)return cn=u.nextPos,u.result;if(cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r&&(n=It(n)),t=n,mn[l]={nextPos:cn,result:t},t}(),s!==r)if((o=Nn())!==r){if(a=cn,(l=Xn())!==r){for(u=[],c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);c!==r;)u.push(c),c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);a=Pt(i,s,o,l,u)}else cn=a,a=r;a===r&&(a=null),(l=Ln())!==r?((u=Jn())===r&&(u=null),n=Bt(i,s,o,a,l,u)):(cn=n,n=r)}else cn=n,n=r;else cn=n,n=r;else cn=n,n=r;if(n===r&&(n=cn,(i=jn())!==r&&(s=Xn())!==r?((o=Jn())===r&&(o=null),n=Ut(i,s,o)):(cn=n,n=r),n===r)){if(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+29,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===O?(a=O,cn+=4):(a=r,0===pn&&Sn(Oe)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r){if(s=cn,o=[],(a=qn())!==r)for(;a!==r;)o.push(a),a=qn();else o=r;(s=o!==r?e.substring(s,cn):o)!==r?n=$t(i,s):(cn=n,n=r)}else cn=n,n=r;n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+30,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===I?(a=I,cn+=5):(a=r,0===pn&&Sn(Ie)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?n=Gt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+31,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===k?(a=k,cn+=5):(a=r,0===pn&&Sn(ke)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Vt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+32,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===M?(a=M,cn+=6):(a=r,0===pn&&Sn(Me)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Wt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+40,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,7)===H?(a=H,cn+=7):(a=r,0===pn&&Sn(He)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Kn())!==r?((o=Jn())===r&&(o=null),n=Ht(i,s,o)):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+41,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,9)===j?(a=j,cn+=9):(a=r,0===pn&&Sn(je)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?(o=function(){var t,n,i,s=75*cn+25,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,58===e.charCodeAt(cn)?(n=F,cn++):(n=r,0===pn&&Sn(Fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),o!==r&&(a=Jn())!==r?n=jt(i,s,o,a):(cn=n,n=r)):(cn=n,n=r))))))}n!==r?(ie.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(rt)),i===r&&(i=null),t=zt(n,i)):(cn=t,t=r)}return pn--,t===r&&(n=r,0===pn&&Sn(nt)),mn[f]={nextPos:cn,result:t},t}function Jn(){var t,n,i,s=75*cn+52,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st)),i!==r)for(;i!==r;)n.push(i),se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(it)),mn[s]={nextPos:cn,result:t},t}function er(){var t,n,i,s,o,a,l=75*cn+53,u=mn[l];if(u)return cn=u.nextPos,u.result;if(pn++,t=cn,n=cn,i=cn,pn++,s=cn,(o=pr())===r&&(o=null),35===e.charCodeAt(cn)?(a=N,cn++):(a=r,0===pn&&Sn(Ne)),a!==r?s=o=[o,a]:(cn=s,s=r),pn--,s===r?i=void 0:(cn=i,i=r),i!==r){if(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st)),o!==r)for(;o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));else s=r;s!==r?(ie.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(rt)),o===r&&(o=null),n=i=[i,s,o]):(cn=n,n=r)}else cn=n,n=r;return n===r&&(ie.test(e.charAt(cn))?(n=e.charAt(cn),cn++):(n=r,0===pn&&Sn(rt))),t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(ot)),mn[l]={nextPos:cn,result:t},t}function tr(){var t,n,i,s,o,a=75*cn+57,l=mn[a];return l?(cn=l.nextPos,l.result):(pn++,t=cn,n=function(){var t,n,i,s,o=75*cn+33,a=mn[o];return a?(cn=a.nextPos,a.result):(t=cn,n=dr(),e.substr(cn,7)===P?(i=P,cn+=7):(i=r,0===pn&&Sn(Pe)),i!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[o]={nextPos:cn,result:t},t)}(),n!==r?((i=Nn())===r&&(i=null),(s=Xn())!==r?((o=Ln())===r&&(o=null),t=tn(n,i,s,o)):(cn=t,t=r)):(cn=t,t=r),t===r&&(t=cn,(n=kn())===r&&(n=In())===r&&(n=function(){var t,n,i,s=75*cn+13,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,33===e.charCodeAt(cn)?(n=v,cn++):(n=r,0===pn&&Sn(ve)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),n===r&&(n=function(){var t,n,i,s=75*cn+15,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,126===e.charCodeAt(cn)?(n=D,cn++):(n=r,0===pn&&Sn(De)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}())),n!==r&&(i=tr())!==r?t=nn(n,i):(cn=t,t=r),t===r&&(t=function(){var e,t,n,i,s=75*cn+56,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,e=function(){var e,t,n,i=75*cn+1,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Kn())!==r?(n=dr(),e=wt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}(),e===r&&(e=cn,(t=Nn())!==r&&(n=hr())!==r&&(i=Ln())!==r?e=en(t,n,i):(cn=e,e=r),e===r&&(e=Xn())),pn--,e===r&&(t=r,0===pn&&Sn(lt)),mn[s]={nextPos:cn,result:e},e)}())),pn--,t===r&&(n=r,0===pn&&Sn(ut)),mn[a]={nextPos:cn,result:t},t)}function nr(){var e,t,n,i,s,o,a=75*cn+58,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=tr())!==r){for(n=[],i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ct)),mn[a]={nextPos:cn,result:e},e}function rr(){var e,t,n,i,s,o,a=75*cn+59,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=nr())!==r){for(n=[],i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ht)),mn[a]={nextPos:cn,result:e},e}function ir(){var e,t,n,i,s,o,a=75*cn+60,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=rr())!==r){for(n=[],i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(dt)),mn[a]={nextPos:cn,result:e},e}function sr(){var e,t,n,i,s,o,a=75*cn+61,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ir())!==r){for(n=[],i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ft)),mn[a]={nextPos:cn,result:e},e}function or(){var e,t,n,i,s,o,a=75*cn+62,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=sr())!==r){for(n=[],i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(pt)),mn[a]={nextPos:cn,result:e},e}function ar(){var e,t,n,i,s,o,a=75*cn+63,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=or())!==r){for(n=[],i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(mt)),mn[a]={nextPos:cn,result:e},e}function lr(){var e,t,n,i,s,o,a=75*cn+64,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ar())!==r){for(n=[],i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(gt)),mn[a]={nextPos:cn,result:e},e}function ur(){var e,t,n,i,s,o,a=75*cn+65,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=lr())!==r){for(n=[],i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Et)),mn[a]={nextPos:cn,result:e},e}function cr(){var e,t,n,i,s,o,a=75*cn+66,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ur())!==r){for(n=[],i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(vt)),mn[a]={nextPos:cn,result:e},e}function hr(){var e,t=75*cn+68,n=mn[t];return n?(cn=n.nextPos,n.result):(pn++,e=function(){var e,t,n,i,s,o,a=75*cn+67,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=cr())!==r){for(n=[],i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Ct)),mn[a]={nextPos:cn,result:e},e}(),pn--,e===r&&0===pn&&Sn(Dt),mn[t]={nextPos:cn,result:e},e)}function dr(){var e,t,n,i,s,o,a=75*cn+69,l=mn[a];if(l)return cn=l.nextPos,l.result;for(pn++,cn,(t=pr())===r&&(t=null),n=[],i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);return e=sn(t,n),pn--,t=r,0===pn&&Sn(St),mn[a]={nextPos:cn,result:e},e}function fr(){var t,n,i,s,o,a,l=75*cn+70,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=function(){var t,n,i,s,o,a=75*cn+71,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,e.substr(cn,2)===X?(i=X,cn+=2):(i=r,0===pn&&Sn(At)),i!==r){for(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),t===r)if(t=cn,n=function(){var t,n,i,s,o,a,l,u=75*cn+72,c=mn[u];if(c)return cn=c.nextPos,c.result;if(t=cn,n=cn,e.substr(cn,2)===K?(i=K,cn+=2):(i=r,0===pn&&Sn(_t)),i!==r){for(s=[],o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);o!==r;)s.push(o),o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);e.substr(cn,2)===Y?(o=Y,cn+=2):(o=r,0===pn&&Sn(yt)),o!==r?n=i=[i,s,o]:(cn=n,n=r)}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[u]={nextPos:cn,result:t},t}(),n!==r){for(i=[],s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);t=an(n,i)}else cn=t,t=r;return mn[l]={nextPos:cn,result:t},t}function pr(){var t,n,i,s=75*cn+73,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt)),i!==r)for(;i!==r;)n.push(i),oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(Tt)),mn[s]={nextPos:cn,result:t},t}function mr(){var t,n,i,s=75*cn+74,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,pn++,Q.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Xe)),pn--,i===r?n=void 0:(cn=n,n=r),n!==r?(i=dr(),t=un(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}e=lh(e);const gr=(e,t)=>({type:e,...t}),Er=(...e)=>e.flat().filter(e=>null!=e&&""!==e&&0!==e.length),vr=(...e)=>{return(t=Er(e.flat())).length>1?t:t[0];var t},Cr=(...e)=>e.flat().reduce((e,[t,n])=>({type:"binary",operator:t,left:e,right:n}));if((n=o())!==r&&cn===e.length)return n;throw n!==r&&cn0){for(t=1,n=1;ts.length)throw new Error("'".concat(t,"': Too many arguments for macro"));if(u.length>":return t(n)>>t(r);case"<":return t(n)":return t(n)>t(r);case"<=":return t(n)<=t(r);case">=":return t(n)>=t(r);case"==":return t(n)==t(r);case"!=":return t(n)!=t(r);case"&":return t(n)&t(r);case"^":return t(n)^t(r);case"|":return t(n)|t(r);case"&&":return t(n)&&t(r);case"||":return t(n)||t(r);default:throw new Error("Preprocessing error: Unknown binary operator ".concat(i))}},unary:function(e,t){switch(e.operator.literal){case"+":return t(e.expression);case"-":return-1*t(e.expression);case"!":return!t(e.expression);case"~":return~t(e.expression);default:throw new Error("Preprocessing error: Unknown unary operator ".concat(e.operator.literal))}}},(r=function(e){var t=n[e.type];if(!t)throw new Error("No evaluate() evaluator for ".concat(e.type));return t(e,r)})(e);var n,r}((n=sh(r,t).trim(),eh(s)(n,{grammarSource:"expression",startRule:"constant_expression"})),t)},lh=function(e,t){return void 0===t&&(t={}),e.replace(/\\[\n\r]/g,"")},uh=function(e,t){void 0===t&&(t={});var n,r,i,s,o=Object.entries(t.defines||{}).reduce(function(e,t){var n,r=t[0],i=t[1];return th(th({},e),((n={})[r]={body:i},n))},{}),a=(void 0===(n=t.preserve)&&(n={}),function(e){var t=null==n?void 0:n[e.node.type];return"function"==typeof t?t(e):t});return r={conditional:{enter:function(e){var t=e,n=t.node;a(t)||(function(e,t){return"if"===t.type?!!t.expression&&oh(ah(t.expression,e)):"ifdef"===t.type?t.identifier.identifier in e:"ifndef"===t.type?!(t.identifier.identifier in e):void 0}(o,n.ifPart)?t.replaceWith(n.ifPart.body):n.elseIfParts.reduce(function(e,n){return e||oh(ah(n.expression,o))&&(t.replaceWith(n.body),!0)},!1)||(n.elsePart?t.replaceWith(n.elsePart.body):t.remove()))}},text:{enter:function(e){var t=e;t.node.text=sh(t.node.text,o)}},define_arguments:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body,s=n.args;o[r]={args:s,body:i},!a(t)&&t.remove()}},define:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body;o[r]={body:i},!a(t)&&t.remove()}},undef:{enter:function(e){var t=e;delete o[t.node.identifier.identifier],!a(t)&&t.remove()}},error:{enter:function(e){var n=e;if(t.stopOnError)throw new Error(n.node.message);!a(n)&&n.remove()}},pragma:{enter:function(e){var t=e;!a(t)&&t.remove()}},version:{enter:function(e){var t=e;!a(t)&&t.remove()}},extension:{enter:function(e){var t=e;!a(t)&&t.remove()}},line:{enter:function(e){var t=e;!a(t)&&t.remove()}}},i=!1,(s=function(e,t,n,o,a){var l;if(!i){var u=r[e.type],c=function(e,t,n,r,i){return{node:e,parent:t,parentPath:n,key:r,index:i,stop:function(){this.stopped=!0},skip:function(){this.skipped=!0},remove:function(){this.removed=!0},replaceWith:function(e){this.replaced=e},findParent:function(e){return n?e(n)?n:n.findParent(e):n}}}(e,t,n,o,a),h=t;if(null==u?void 0:u.enter){if(u.enter(c),c.removed){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));return"number"==typeof a?h[o].splice(a,1):h[o]=null,c}if(c.replaced){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));"number"==typeof a?h[o].splice(a,1,c.replaced):h[o]=c.replaced}if(c.skipped)return c}if(c.stopped)i=!0;else if(c.replaced){var d=c.replaced;s(d,t,n,o,a)}else Object.entries(e).filter(function(e){return e[0],function(e){return function(e){return!!(null==e?void 0:e.type)}(e)||Array.isArray(e)}(e[1])}).forEach(function(t){var n=t[0],r=t[1];if(Array.isArray(r))for(var o=0,a=0;o-a{let e=!0;return n?(i({source:o,formatted:null,error:""}),function(e){return Gs(e,{parser:"glsl-parser",plugins:[Gc],printWidth:80,tabWidth:4,useTabs:!1}).then(Vc)}(o).then(t=>{e&&i({source:o,formatted:t,error:""})}).catch(t=>{if(!e)return;const n=dh(t);a.error("shader formatting failed: "+n),i({source:o,formatted:null,error:n})}),()=>{e=!1}):(i({source:o,formatted:null,error:""}),()=>{e=!1})},[n,o]);const c=n&&r.source===o?r.formatted:null;return{source:c||o,formatted:!!c,preprocessed:u,error:(r.source===o?r.error:"")||l}}(C.source,C.preprocessed,e.beautify),S=D.source,A=C.edited,_=[e.fragment?e.sourceFragmentLog:e.sourceVertexLog,e.programLog].filter(e=>!!e).join("\n"),y=!e.translated&&!D.preprocessed&&!D.formatted,b=function(e,t,n,r){return!(e||t||!n||r)}(t,A,_,y);(0,dt.useLayoutEffect)(()=>{g.current={programId:e.programId,sourceVertex:e.sourceVertex,sourceFragment:e.sourceFragment}},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!d.current)return;if(!f.current){const e=ace.edit(d.current);e.setTheme("ace/theme/monokai"),e.getSession().setMode("ace/mode/glsl"),e.setShowPrintMargin(!1),f.current=e}const t=f.current;t.setReadOnly(!e.editable||e.translated),t.getValue()!==S&&t.setValue(S,-1);const n=()=>{const n=t.getValue();e.fragment?m.current.fragment=n:m.current.vertex=n,v(t=>e.fragment?t.fragment?t:Object.assign(Object.assign({},t),{fragment:!0}):t.vertex?t:Object.assign(Object.assign({},t),{vertex:!0})),function(e,t,n,r){e&&n(!1),t&&r(!1)}(e.beautify,e.preprocessed,c,h),-1!==p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{if(p.current=-1,!function(e,t){return e.programId===t.programId&&e.sourceVertex===t.sourceVertex&&e.sourceFragment===t.sourceFragment}(g.current,e))return;const t={sourceVertex:m.current.vertex,sourceFragment:m.current.fragment,translatedSourceVertex:e.translatedSourceVertex,translatedSourceFragment:e.translatedSourceFragment,programId:e.programId};u(t)},1500)},r=e.editable&&!e.translated;return r&&t.getSession().on("change",n),()=>{r&&t.getSession().off("change",n)}},[S,e.editable,e.translated,e.fragment,e.beautify,e.preprocessed,e.sourceVertex,e.sourceFragment,e.translatedSourceVertex,e.translatedSourceFragment,e.programId,c,h,u]),(0,dt.useEffect)(()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),m.current={baseProgramId:e.programId,baseVertex:e.sourceVertex,baseFragment:e.sourceFragment,vertex:e.sourceVertex,fragment:e.sourceFragment},v({vertex:!1,fragment:!1})},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!f.current)return;const e=t||(y&&!A?_:"");f.current.getSession().setAnnotations(function(e){if(!e)return[];const t=[],n=e.split(/\r?\n/);for(const e of n){const n=e.replace(/\0/g,"").trim();if(!n)continue;let r=/^(error|warning|info)\s*:\s*\d+\s*:\s*(\d+)(?:\s*:\s*(\d+))?\s*:\s*(.*)$/i.exec(n);if(r){t.push(Pt(r[1],r[2],r[3],r[4]));continue}if(r=/^\d+\s*\(\s*(\d+)\s*\)\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[2],r[1],"",r[3]));continue}if(r=/^\d+\s*:\s*(\d+)(?:\s*\(\s*(\d+)\s*\))?\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[3],r[1],r[2],r[4]));continue}const i=/\b(error|warning|info)\b/i.exec(n);t.push({row:0,column:0,text:n,type:i?i[1].toLowerCase():"info"})}return t}(e))},[_,y,t,D.formatted,D.preprocessed,A,e.beautify,e.fragment,e.programLog,e.sourceFragmentLog,e.sourceVertexLog,e.translated]),(0,dt.useEffect)(()=>()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),f.current&&(f.current.destroy(),f.current=null)},[]);const T=(0,dt.useCallback)(e=>{e.preventDefault(),n()},[n]),R=(0,dt.useCallback)(e=>{e.preventDefault(),r()},[r]),x=(0,dt.useCallback)(e=>{e.preventDefault(),null==i||i()},[i]),w=(0,dt.useCallback)(e=>{e.preventDefault(),null==o||o()},[o]),F=(0,dt.useCallback)(e=>{e.preventDefault(),l()},[l]),N=!e.singleShader||!e.fragment,L=!e.singleShader||e.fragment,O=D.error;return(0,mt.jsxs)("div",{className:"sourceCodeComponentContainer",children:[(0,mt.jsx)("div",{className:"sourceCodeMenuComponentContainer",children:(0,mt.jsxs)("ul",{className:"sourceCodeMenuComponent",children:[N&&e.translatedSourceVertex&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:!e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedVertexSourceClicked",onClick:x,children:"Translated Vertex"})}),L&&e.translatedSourceFragment&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedFragmentSourceClicked",onClick:w,children:"Translated Fragment"})}),N&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment||e.translated?"":"active",href:"#",role:"button",commandName:"onVertexSourceClicked",onClick:T,children:"Vertex"})}),L&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&!e.translated?"active":"",href:"#",role:"button",commandName:"onFragmentSourceClicked",onClick:R,children:"Fragment"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onSourceCodeCloseClicked",onClick:F,children:"Close"})})]})}),(0,mt.jsx)("div",{className:"sourceCodeComponent",ref:d}),(0,mt.jsx)(hh,{beautify:e.beautify,capturedDiagnosticsHidden:b,fragment:e.fragment,preprocessed:e.preprocessed,processingError:O,onBeautifyChanged:c,onFragmentSourceClicked:r,onPreprocessChanged:h,onVertexSourceClicked:n})]})}function hh({beautify:e,capturedDiagnosticsHidden:t,fragment:n,preprocessed:r,processingError:i,onBeautifyChanged:s,onFragmentSourceClicked:o,onPreprocessChanged:a,onVertexSourceClicked:l}){const u=(0,dt.useCallback)(e=>{s(e.target.checked)},[s]),c=(0,dt.useCallback)(e=>{a(e.target.checked)},[a]),h=(0,dt.useCallback)(e=>{e.preventDefault(),(n?o:l)(),s(!1),a(!1)},[n,s,o,a,l]);return(0,mt.jsx)("div",{className:"sourceCodeMenuComponentFooter",children:(0,mt.jsxs)("p",{children:[(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onBeautifyChanged",checked:e,onChange:u})," Beautify"]}),(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onPreprocessChanged",checked:r,onChange:c})," Preprocess"]}),i&&(0,mt.jsx)("span",{className:"sourceCodeFormatError",role:"alert",title:i,children:"Shader processing failed"}),t&&(0,mt.jsxs)("span",{className:"sourceCodeDiagnosticsNotice",role:"status",children:["Captured diagnostics hidden."," ",(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onShowCapturedDiagnostics",onClick:h,children:"Show original with diagnostics"})]})]})})}function dh(e){return e instanceof Error?e.message:String(e)}function fh({title:e,children:t}){const n=e?e.replace(/([A-Z])/g," $1").trim():"";return(0,mt.jsxs)("div",{className:"jsonGroupComponent",children:[(0,mt.jsx)("div",{className:"jsonGroupComponentTitle",children:n}),(0,mt.jsx)("ul",{children:t})]})}function ph({itemKey:e,value:t}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsx)("span",{className:"jsonItemComponentValue",children:t})]})}function mh({itemKey:e,value:t,pixelated:n,raw:r}){const i=bt();return(0,mt.jsx)("li",{className:"jsonItemImageHolder",children:(0,mt.jsxs)("div",{className:"jsonItemImage jsonItemImageClickable",children:[(0,mt.jsx)("img",{src:t,style:n?{imageRendering:"pixelated"}:void 0,title:"Open in texture viewer",onClick:()=>i.openTextureViewer({src:t,label:e,pixelated:n,raw:r||null})}),(0,mt.jsx)("span",{children:e})]})})}function gh({itemKey:e,value:t,help:n}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("span",{className:"jsonItemComponentValue",children:[t+" (",(0,mt.jsx)("a",{href:n,target:"_blank",className:"jsonSourceItemComponentOpen",children:"Open help page"}),")"]})]})}function Eh({visualState:e}){const t=bt();return(0,mt.jsxs)("div",{className:"jsonVisualStateItemComponent",children:[e.Attachments?e.Attachments.map((n,r)=>n.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{className:"jsonItemImageClickable",src:encodeURI(n.src),title:"Open in texture viewer",onClick:()=>t.openTextureViewer({src:n.src,label:n.attachmentName||"Attachment",pixelated:!1,raw:n.raw||null})}),e.Attachments.length>1&&(0,mt.jsx)("span",{children:n.attachmentName})]},r):null):(0,mt.jsx)("span",{children:e.FrameBufferStatus}),(0,mt.jsx)("span",{children:e.FrameBuffer?e.FrameBuffer.__SPECTOR_Object_TAG.displayText:"Canvas frame buffer"})]})}function vh({itemKey:e,shader:t,programLog:n,onOpen:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),null==r||r(t,n)},[r,n,t]),s=t.source?t.source.length:0,o=`${t.name||"Shader"} (${s} chars)`;return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("a",{href:"#",role:"button",className:"jsonSourceItemComponentOpen",commandName:"onShaderSourceOpen",onClick:i,children:["Open ",o]})]})}function Ch({items:e,onShaderSourceOpen:t}){return e&&0!==e.length?(0,mt.jsx)(mt.Fragment,{children:e.map((e,n)=>{switch(e.type){case"group":return(0,mt.jsx)(fh,{title:e.title,children:(0,mt.jsx)(Ch,{items:e.children,onShaderSourceOpen:t})},n);case"item":return(0,mt.jsx)(ph,{itemKey:e.key,value:e.value},n);case"image":return(0,mt.jsx)(mh,{itemKey:e.key,value:e.value,pixelated:e.pixelated,raw:e.raw},n);case"help":return(0,mt.jsx)(gh,{itemKey:e.key,value:e.value,help:e.help},n);case"shaderSource":return(0,mt.jsx)(vh,{itemKey:e.key,shader:e.shader,programLog:e.programLog,onOpen:t},n);case"visualState":return(0,mt.jsx)(Eh,{visualState:e.visualState},n);default:return null}})}):null}const Dh={added:"+",removed:"-",changed:"~",unchanged:" "};function Sh(e){const t=void 0===e.indexA?"_":String(e.indexA),n=void 0===e.indexB?"_":String(e.indexB);return e.type+"#"+t+"#"+n}function Ah(e){return!(!e.previousImage&&!e.currentImage)}function _h(){const e=bt(),t=pt(e.store),[n,r]=(0,dt.useState)(null);if((0,dt.useEffect)(()=>{r(null)},[t.compareRows]),!t.canCompare)return(0,mt.jsx)("div",{className:"compareViewComponent",children:(0,mt.jsx)("div",{className:"compareViewEmpty",children:"Capture the same page at least twice, then select a capture to compare it against the previous one."})});const{added:i,removed:s,changed:o,unchanged:a}=t.compareSummary,l=t.compareOnlyDifferences?t.compareRows.filter(e=>"unchanged"!==e.type):t.compareRows,u=l.find(e=>Sh(e)===n)||(l.length>0?l[0]:null),c=u?Sh(u):"";return(0,mt.jsxs)("div",{className:"compareViewComponent",children:[(0,mt.jsxs)("div",{className:"compareViewHeader",children:[(0,mt.jsx)("span",{className:"compareViewLabel",children:t.compareLabel}),(0,mt.jsxs)("span",{className:"compareViewSummary",children:[(0,mt.jsxs)("span",{className:"added",children:["+",i]}),(0,mt.jsxs)("span",{className:"removed",children:["-",s]}),(0,mt.jsxs)("span",{className:"changed",children:["~",o]}),(0,mt.jsxs)("span",{className:"unchanged",children:["=",a]})]}),(0,mt.jsxs)("label",{className:"compareViewToggle",children:[(0,mt.jsx)("input",{type:"checkbox",checked:t.compareOnlyDifferences,onChange:t=>e.handleCompareOnlyDifferencesChange(t.target.checked)}),"Differences only"]})]}),(0,mt.jsxs)("div",{className:"compareViewBody",children:[(0,mt.jsx)(yh,{}),(0,mt.jsx)("ul",{className:"compareViewList",children:0===l.length?(0,mt.jsx)("li",{className:"compareViewEmptyRow",children:"No differences between these two captures."}):l.map(e=>{const t=Sh(e);return(0,mt.jsx)(bh,{row:e,selected:t===c,onSelect:()=>r(t)},t)})}),(0,mt.jsx)("div",{className:"compareViewDetail",children:u?(0,mt.jsx)(Th,{row:u,onSelectCommand:e.handleCompareCommandSelected,onOpenTexture:(t,n)=>e.openTextureViewer({src:t,label:n,pixelated:!1,raw:null})}):(0,mt.jsx)("div",{className:"compareDetailEmpty",children:"Select a call to see its details."})})]})]})}function yh(){return(0,mt.jsxs)("div",{className:"compareViewLegend",children:[(0,mt.jsxs)("div",{className:"compareLegendRow added",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Added"]}),(0,mt.jsxs)("div",{className:"compareLegendRow removed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Removed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow changed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Changed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow unchanged",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Unchanged"]})]})}function bh(e){const{row:t,selected:n,onSelect:r}=e,i="removed"===t.type?t.previousText:t.currentText,s=i&&0===i.indexOf(t.name)?i.slice(t.name.length):"",o="compareRow "+t.type+(n?" selected":"");return(0,mt.jsxs)("li",{className:o,onClick:r,title:i,children:[(0,mt.jsx)("span",{className:"compareSign",children:Dh[t.type]}),(0,mt.jsxs)("span",{className:"compareRowText",children:[(0,mt.jsx)("span",{className:"compareCmdName",children:t.name}),s]})]})}function Th(e){const{row:t,onSelectCommand:n,onOpenTexture:r}=e,i=t.fieldDiffs||[],s=i.filter(e=>!Ah(e)),o=i.filter(Ah),a="changed"===t.type&&t.previousText!==t.currentText,l="removed"===t.type?t.previousText:t.currentText;return(0,mt.jsxs)("div",{className:"compareDetail",children:[(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Command"}),(0,mt.jsxs)("ul",{children:[(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"name"}),":"," ",(0,mt.jsx)("span",{className:"compareCmdName "+t.type,children:t.name})]}),(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"call"}),":"," ",a?(0,mt.jsxs)("span",{className:"compareTextChange",children:[(0,mt.jsx)("span",{className:"compareOld",children:t.previousText}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:t.currentText})]}):(0,mt.jsx)("span",{className:"compareNew",children:l})]}),void 0!==t.commandId&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",className:"compareCommandLink",title:"Show this command in the Commands view",onClick:e=>{e.preventDefault(),n(t.commandId)},children:"Show in Commands view →"})})]})]}),s.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Uniform & state changes"}),(0,mt.jsx)("ul",{children:s.map((e,t)=>(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),":"," ",(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:e.current})]},t))})]}),o.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Texture changes"}),(0,mt.jsx)("ul",{children:o.map((e,t)=>(0,mt.jsxs)("li",{className:"compareTextureItem",children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),(0,mt.jsxs)("div",{className:"compareImageDiff",children:[e.previousImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.previousImage,title:"Open in texture viewer",onClick:()=>r(e.previousImage,e.path+" (previous)")}):(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),e.currentImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.currentImage,title:"Open in texture viewer",onClick:()=>r(e.currentImage,e.path+" (current)")}):(0,mt.jsx)("span",{className:"compareNew",children:e.current})]})]},t))})]})]})}function Rh(e){const t=(255&e).toString(16);return 1===t.length?"0"+t:t}function xh(e,t,n,r){return"#"+Rh(e)+Rh(t)+Rh(n)+Rh(r)}function wh(e,t,n,r){const i=e=>(e/255).toFixed(2);return i(e)+", "+i(t)+", "+i(n)+", "+i(r)}function Fh(){const e=bt(),t=pt(e.store).textureViewer;return t.open?(0,mt.jsx)(Lh,{viewer:t,onClose:e.closeTextureViewer}):null}const Nh=120;function Lh(e){const{viewer:t,onClose:n}=e,r=(0,dt.useRef)(null),i=(0,dt.useRef)(null),s=(0,dt.useRef)(null),o=(0,dt.useRef)(null),[a,l]=(0,dt.useState)({r:!0,g:!0,b:!0,a:!0}),[u,c]=(0,dt.useState)(1),[h,d]=(0,dt.useState)("checker"),[f,p]=(0,dt.useState)(null),[m,g]=(0,dt.useState)(null),[E,v]=(0,dt.useState)(!1);(0,dt.useEffect)(()=>{let e=!1;const n=t=>{e||(o.current=t,p({width:t.width,height:t.height}),c(kh(t.width,t.height)),v(!0))};if(t.raw){const r=function(e){try{if(!e.data||e.width<=0||e.height<=0)return null;const t=function(e){const t=atob(e),n=new Uint8ClampedArray(t.length);for(let e=0;e{e=!0}}const r=new Image;return r.onload=()=>{const e=document.createElement("canvas");e.width=r.naturalWidth||1,e.height=r.naturalHeight||1;const t=e.getContext("2d");if(!t)return;t.drawImage(r,0,0);const i=t.getImageData(0,0,e.width,e.height);n({data:new Uint8ClampedArray(i.data),width:e.width,height:e.height})},r.src=t.src,()=>{e=!0}},[t.src,t.raw]),(0,dt.useEffect)(()=>{const e=o.current,t=r.current;if(!E||!e||!t)return;const n=function(e,t,n){let r=e.current;return r||(r=document.createElement("canvas"),e.current=r),r.width!==t&&(r.width=t),r.height!==n&&(r.height=n),r}(s,e.width,e.height),i=n.getContext("2d"),l=t.getContext("2d");if(!i||!l)return;const c=function(e,t){const n=new Uint8ClampedArray(e.length),r=t.a&&!t.r&&!t.g&&!t.b;for(let i=0;i{const e=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]);const C="textureViewerViewport"+("checker"===h?" checker":""),D="black"===h?{background:"#000"}:"white"===h?{background:"#fff"}:void 0;return(0,mt.jsx)("div",{className:"textureViewerOverlay",onClick:n,children:(0,mt.jsxs)("div",{className:"textureViewerModal",onClick:e=>e.stopPropagation(),children:[(0,mt.jsxs)("div",{className:"textureViewerHeader",children:[(0,mt.jsx)("span",{className:"textureViewerTitle",children:t.label}),(0,mt.jsxs)("span",{className:"textureViewerMeta",children:[f?f.width+" × "+f.height:"",!t.raw&&f?" · thumbnail":""]}),(0,mt.jsx)("span",{className:"textureViewerClose",title:"Close (Esc)",onClick:n,children:"✕"})]}),(0,mt.jsxs)("div",{className:"textureViewerToolbar",children:[(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Channels"}),(0,mt.jsx)(Oh,{channel:"r",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"g",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"b",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"a",mask:a,setMask:l})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"tvBtn",title:"Force alpha = 1 to reveal RGB hidden behind transparency",onClick:()=>l({r:!0,g:!0,b:!0,a:!1}),children:"Opaque"}),(0,mt.jsx)("span",{className:"tvBtn",title:"Show the alpha channel as grayscale",onClick:()=>l({r:!1,g:!1,b:!1,a:!0}),children:"Alpha → gray"})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"BG"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)(Ih,{value:"checker",glyph:"▦",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"black",glyph:"■",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"white",glyph:"□",background:h,setBackground:d})]})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Zoom"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.max(1,e/2)),children:"−"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(f?kh(f.width,f.height):1),children:"Fit"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.min(32,2*e)),children:"+"})]}),(0,mt.jsxs)("span",{className:"zoomVal",children:[Math.round(100*u),"%"]})]}),(0,mt.jsx)("div",{className:"textureViewerGroup textureViewerGroupEnd",children:(0,mt.jsx)("span",{className:"tvBtn primary",onClick:()=>{const e=s.current;e&&e.toBlob(e=>{if(!e)return;const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=((t.label||"texture").replace(/[^a-z0-9_\-]+/gi,"_").replace(/^_+|_+$/g,"")||"texture")+".png",r.click(),setTimeout(()=>URL.revokeObjectURL(n),0)})},children:"⭳ Save PNG"})})]}),(0,mt.jsxs)("div",{className:"textureViewerBody",children:[(0,mt.jsxs)("div",{className:C,style:D,children:[(0,mt.jsx)("canvas",{ref:r,className:"textureViewerCanvas",onMouseMove:e=>{const t=o.current,n=r.current,a=i.current,l=s.current;if(!t||!n)return;const c=n.getBoundingClientRect(),h=Math.floor((e.clientX-c.left)/u),d=Math.floor((e.clientY-c.top)/u);if(h<0||d<0||h>=t.width||d>=t.height)return g(null),void(a&&(a.style.display="none"));const f=4*(d*t.width+h);g({x:h,y:d,r:t.data[f],g:t.data[f+1],b:t.data[f+2],a:t.data[f+3]}),function(e,t,n,r){if(!e||!t)return;const i=e.getContext("2d");if(!i)return;i.imageSmoothingEnabled=!1,i.clearRect(0,0,Nh,Nh),i.drawImage(t,n-7,r-7,15,15,0,0,Nh,Nh),i.strokeStyle="#F0640D",i.lineWidth=2,i.strokeRect(56,56,8,8),e.style.display="block"}(a,l,h,d)},onMouseLeave:()=>{g(null),i.current&&(i.current.style.display="none")}}),(0,mt.jsx)("canvas",{ref:i,className:"textureViewerLoupe",width:Nh,height:Nh})]}),(0,mt.jsxs)("div",{className:"textureViewerRail",children:[(0,mt.jsx)("div",{className:"railTitle",children:"Pixel inspector"}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"position"}),(0,mt.jsx)("span",{className:"v",children:m?m.x+", "+m.y:"—"})]}),(0,mt.jsx)("div",{className:"swatch",children:(0,mt.jsx)("div",{className:"swatchInner",style:m?{background:"rgba("+m.r+","+m.g+","+m.b+","+m.a/255+")"}:void 0})}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"R"}),(0,mt.jsx)("span",{className:"v",children:m?m.r:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"G"}),(0,mt.jsx)("span",{className:"v",children:m?m.g:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"B"}),(0,mt.jsx)("span",{className:"v",children:m?m.b:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"A"}),(0,mt.jsx)("span",{className:"v",children:m?m.a:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"hex"}),(0,mt.jsx)("span",{className:"v",children:m?xh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"norm"}),(0,mt.jsx)("span",{className:"v",children:m?wh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"hint",children:["Move over the texture to sample pixels. Toggle channels to isolate RGB / alpha.",(0,mt.jsx)("b",{children:" Opaque"})," reveals colour hidden behind transparency (#183)."]})]})]})]})})}function Oh(e){const{channel:t,mask:n,setMask:r}=e,i=n[t],s="channel "+t+(i?" on":"");return(0,mt.jsx)("span",{className:s,onClick:()=>r(Object.assign(Object.assign({},n),{[t]:!i})),children:t.toUpperCase()})}function Ih(e){const{value:t,glyph:n,background:r,setBackground:i}=e;return(0,mt.jsx)("span",{className:"tvBtn"+(r===t?" active":""),onClick:()=>i(t),children:n})}function kh(e,t){return Math.max(1,Math.min(16,Math.floor(480/Math.max(e,t))||1))}function Mh(){const e=bt(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"resultViewComponent "+(t.visible?"active":""),children:[(0,mt.jsx)(Tt,{}),(0,mt.jsxs)(Rt,{children:[0===t.menuStatus&&(0,mt.jsx)(wt,{active:!0,captures:t.captures,onCaptureSelected:t=>{e.selectCapture(t),e.handleMenuStatusChange(40)},onSaveRequested:e.handleSaveRequested,onCaptureLoaded:e.handleCaptureLoaded}),40===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(Ft,{children:t.visualStates.map((t,n)=>(0,mt.jsx)(Nt,{item:t,onVisualStateSelected:()=>e.handleVisualStateSelected(n)},n))}),(0,mt.jsx)(Lt,{children:t.commands.map((t,n)=>(0,mt.jsx)(Ot,{command:t,onCommandSelected:()=>e.handleCommandSelected(n),onVertexSelected:()=>e.handleVertexSelected(n),onFragmentSelected:()=>e.handleFragmentSelected(n),onShaderSelected:()=>e.handleShaderSelected(n)},n))}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]}),10===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(kt,{left:!0,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationLeft})})}),(0,mt.jsx)(kt,{left:!1,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationRight})})})]}),20===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.initStateData})}),30===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.endStateData})}),60===t.menuStatus&&(0,mt.jsx)(_h,{}),50===t.menuStatus&&t.sourceCodeState&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(ch,{state:t.sourceCodeState,errorMessage:t.sourceCodeError,onVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!1),onFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!1),onTranslatedVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!0),onTranslatedFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!0),onCloseClicked:e.handleSourceCodeClose,onSourceCodeChanged:e.handleSourceCodeChanged,onBeautifyChanged:e.handleBeautifyChanged,onPreprocessChanged:e.handlePreprocessChanged}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]})]}),(0,mt.jsx)(Fh,{})]})}class Ph{static getMDNLink(e){const t=Ph.WebGL2Functions[e];if(t)return Ph.WebGL2RootUrl+t;const n=Ph.WebGLFunctions[e];if(n)return Ph.WebGLRootUrl+n;const r=Ph.AngleInstancedArraysExtFunctions[e];return r?Ph.AngleInstancedArraysExtRootUrl+r:Ph.WebGLRootUrl+e}}Ph.WebGL2RootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/",Ph.WebGLRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/",Ph.AngleInstancedArraysExtRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/",Ph.WebGL2Functions={beginQuery:"beginQuery",beginTransformFeedback:"beginTransformFeedback",bindBufferBase:"bindBufferBase",bindBufferRange:"bindBufferRange",bindSampler:"bindSampler",bindTransformFeedback:"bindTransformFeedback",bindVertexArray:"bindVertexArray",blitFramebuffer:"blitFramebuffer",clearBufferfv:"clearBuffer",clearBufferiv:"clearBuffer",clearBufferuiv:"clearBuffer",clearBufferfi:"clearBuffer",clientWaitSync:"clientWaitSync",compressedTexImage3D:"compressedTexImage3D",compressedTexSubImage3D:"compressedTexSubImage3D",copyBufferSubData:"copyBufferSubData",copyTexSubImage3D:"copyTexSubImage3D",createQuery:"createQuery",createSampler:"createSampler",createTransformFeedback:"createTransformFeedback",createVertexArray:"createVertexArray",deleteQuery:"deleteQuery",deleteSampler:"deleteSampler",deleteSync:"deleteSync",deleteTransformFeedback:"deleteTransformFeedback",deleteVertexArray:"deleteVertexArray",drawArraysInstanced:"drawArraysInstanced",drawBuffers:"drawBuffers",drawElementsInstanced:"drawElementsInstanced",drawRangeElements:"drawRangeElements",endQuery:"endQuery",endTransformFeedback:"endTransformFeedback",fenceSync:"fenceSync",framebufferTextureLayer:"framebufferTextureLayer",getActiveUniformBlockName:"getActiveUniformBlockName",getActiveUniformBlockParameter:"getActiveUniformBlockParameter",getActiveUniforms:"getActiveUniforms",getBufferSubData:"getBufferSubData",getFragDataLocation:"getFragDataLocation",getIndexedParameter:"getIndexedParameter",getInternalformatParameter:"getInternalformatParameter",getQuery:"getQuery",getQueryParameter:"getQueryParameter",getSamplerParameter:"getSamplerParameter",getSyncParameter:"getSyncParameter",getTransformFeedbackVarying:"getTransformFeedbackVarying",getUniformBlockIndex:"getUniformBlockIndex",getUniformIndices:"getUniformIndices",invalidateFramebuffer:"invalidateFramebuffer",invalidateSubFramebuffer:"invalidateSubFramebuffer",isQuery:"isQuery",isSampler:"isSampler",isSync:"isSync",isTransformFeedback:"isTransformFeedback",isVertexArray:"isVertexArray",pauseTransformFeedback:"pauseTransformFeedback",readBuffer:"readBuffer",renderbufferStorageMultisample:"renderbufferStorageMultisample",resumeTransformFeedback:"resumeTransformFeedback",samplerParameteri:"samplerParameter",samplerParameterf:"samplerParameter",texImage3D:"texImage3D",texStorage2D:"texStorage2D",texStorage3D:"texStorage3D",texSubImage3D:"texSubImage3D",transformFeedbackVaryings:"transformFeedbackVaryings",uniform1ui:"uniform",uniform2ui:"uniform",uniform3ui:"uniform",uniform4ui:"uniform",uniform1fv:"uniform",uniform2fv:"uniform",uniform3fv:"uniform",uniform4fv:"uniform",uniform1iv:"uniform",uniform2iv:"uniform",uniform3iv:"uniform",uniform4iv:"uniform",uniform1uiv:"uniform",uniform2uiv:"uniform",uniform3uiv:"uniform",uniform4uiv:"uniform",uniformBlockBinding:"uniformBlockBinding",uniformMatrix2fv:"uniformMatrix",uniformMatrix3x2fv:"uniformMatrix",uniformMatrix4x2fv:"uniformMatrix",uniformMatrix2x3fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4x3fv:"uniformMatrix",uniformMatrix2x4fv:"uniformMatrix",uniformMatrix3x4fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttribDivisor:"vertexAttribDivisor",vertexAttribI4i:"vertexAttribI",vertexAttribI4ui:"vertexAttribI",vertexAttribI4iv:"vertexAttribI",vertexAttribI4uiv:"vertexAttribI",vertexAttribIPointer:"vertexAttribIPointer",waitSync:"waitSync"},Ph.WebGLFunctions={uniform1f:"uniform",uniform1fv:"uniform",uniform1i:"uniform",uniform1iv:"uniform",uniform2f:"uniform",uniform2fv:"uniform",uniform2i:"uniform",uniform2iv:"uniform",uniform3f:"uniform",uniform3i:"uniform",uniform3iv:"uniform",uniform4f:"uniform",uniform4fv:"uniform",uniform4i:"uniform",uniform4iv:"uniform",uniformMatrix2fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttrib1f:"vertexAttrib",vertexAttrib2f:"vertexAttrib",vertexAttrib3f:"vertexAttrib",vertexAttrib4f:"vertexAttrib",vertexAttrib1fv:"vertexAttrib",vertexAttrib2fv:"vertexAttrib",vertexAttrib3fv:"vertexAttrib",vertexAttrib4fv:"vertexAttrib"},Ph.AngleInstancedArraysExtFunctions={drawArraysInstancedANGLE:"drawArraysInstancedANGLE",drawElementsInstancedANGLE:"drawElementsInstancedANGLE",vertexAttribDivisorANGLE:"vertexAttribDivisorANGLE"};const Bh={activeTexture:[["texture"]],attachShader:[["program","shader"]],beginQuery:[["target","query"]],beginTransformFeedback:[["primitiveMode"]],bindAttribLocation:[["program","index","name"]],bindBuffer:[["target","buffer"]],bindBufferBase:[["target","index","buffer"]],bindBufferRange:[["target","index","buffer","offset","size"]],bindFramebuffer:[["target","framebuffer"]],bindRenderbuffer:[["target","renderbuffer"]],bindSampler:[["unit","sampler"]],bindTexture:[["target","texture"]],bindTransformFeedback:[["target","tf"]],bindVertexArray:[["array"]],blendColor:[["red","green","blue","alpha"]],blendEquation:[["mode"]],blendEquationSeparate:[["modeRGB","modeAlpha"]],blendFunc:[["sfactor","dfactor"]],blendFuncSeparate:[["srcRGB","dstRGB","srcAlpha","dstAlpha"]],blitFramebuffer:[["srcX0","srcY0","srcX1","srcY1","dstX0","dstY0","dstX1","dstY1","mask","filter"]],bufferData:[["target","data","usage"],["target","size","usage"],["target","srcData","usage"],["target","srcData","usage","srcOffset","length"]],bufferSubData:[["target","dstByteOffset","srcData"],["target","offset","data"],["target","dstByteOffset","srcData","srcOffset","length"]],checkFramebufferStatus:[["target"]],clear:[["mask"]],clearBufferfi:[["buffer","drawbuffer","depth","stencil"]],clearBufferfv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferiv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferuiv:[["buffer","drawbuffer","values","srcOffset"]],clearColor:[["red","green","blue","alpha"]],clearDepth:[["depth"]],clearStencil:[["s"]],clientWaitSync:[["sync","flags","timeout"]],colorMask:[["red","green","blue","alpha"]],compileShader:[["shader"]],compressedTexImage2D:[["target","level","internalformat","width","height","border","data"],["target","level","internalformat","width","height","border","imageSize","offset"],["target","level","internalformat","width","height","border","srcData","srcOffset","srcLengthOverride"]],compressedTexImage3D:[["target","level","internalformat","width","height","depth","border","imageSize","offset"],["target","level","internalformat","width","height","depth","border","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage2D:[["target","level","xoffset","yoffset","width","height","format","data"],["target","level","xoffset","yoffset","width","height","format","imageSize","offset"],["target","level","xoffset","yoffset","width","height","format","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","imageSize","offset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","srcData","srcOffset","srcLengthOverride"]],copyBufferSubData:[["readTarget","writeTarget","readOffset","writeOffset","size"]],copyTexImage2D:[["target","level","internalformat","x","y","width","height","border"]],copyTexSubImage2D:[["target","level","xoffset","yoffset","x","y","width","height"]],copyTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","x","y","width","height"]],createBuffer:[[]],createFramebuffer:[[]],createProgram:[[]],createQuery:[[]],createRenderbuffer:[[]],createSampler:[[]],createShader:[["type"]],createTexture:[[]],createTransformFeedback:[[]],createVertexArray:[[]],cullFace:[["mode"]],deleteBuffer:[["buffer"]],deleteFramebuffer:[["framebuffer"]],deleteProgram:[["program"]],deleteQuery:[["query"]],deleteRenderbuffer:[["renderbuffer"]],deleteSampler:[["sampler"]],deleteShader:[["shader"]],deleteSync:[["sync"]],deleteTexture:[["texture"]],deleteTransformFeedback:[["tf"]],deleteVertexArray:[["vertexArray"]],depthFunc:[["func"]],depthMask:[["flag"]],depthRange:[["zNear","zFar"]],detachShader:[["program","shader"]],disable:[["cap"]],disableVertexAttribArray:[["index"]],drawArrays:[["mode","first","count"]],drawArraysInstanced:[["mode","first","count","instanceCount"]],drawBuffers:[["buffers"]],drawElements:[["mode","count","type","offset"]],drawElementsInstanced:[["mode","count","type","offset","instanceCount"]],drawRangeElements:[["mode","start","end","count","type","offset"]],enable:[["cap"]],enableVertexAttribArray:[["index"]],endQuery:[["target"]],endTransformFeedback:[[]],fenceSync:[["condition","flags"]],finish:[[]],flush:[[]],framebufferRenderbuffer:[["target","attachment","renderbuffertarget","renderbuffer"]],framebufferTexture2D:[["target","attachment","textarget","texture","level"]],framebufferTextureLayer:[["target","attachment","texture","level","layer"]],frontFace:[["mode"]],generateMipmap:[["target"]],getActiveAttrib:[["program","index"]],getActiveUniform:[["program","index"]],getActiveUniformBlockName:[["program","uniformBlockIndex"]],getActiveUniformBlockParameter:[["program","uniformBlockIndex","pname"]],getActiveUniforms:[["program","uniformIndices","pname"]],getAttachedShaders:[["program"]],getAttribLocation:[["program","name"]],getBufferParameter:[["target","pname"]],getBufferSubData:[["target","srcByteOffset","dstBuffer","dstOffset","length"]],getContextAttributes:[[]],getError:[[]],getExtension:[["extensionName"],["name"]],getFragDataLocation:[["program","name"]],getFramebufferAttachmentParameter:[["target","attachment","pname"]],getIndexedParameter:[["target","index"]],getInternalformatParameter:[["target","internalformat","pname"]],getParameter:[["pname"]],getProgramInfoLog:[["program"]],getProgramParameter:[["program","pname"]],getQuery:[["target","pname"]],getQueryParameter:[["query","pname"]],getRenderbufferParameter:[["target","pname"]],getSamplerParameter:[["sampler","pname"]],getShaderInfoLog:[["shader"]],getShaderParameter:[["shader","pname"]],getShaderPrecisionFormat:[["shadertype","precisiontype"]],getShaderSource:[["shader"]],getSupportedExtensions:[[]],getSyncParameter:[["sync","pname"]],getTexParameter:[["target","pname"]],getTransformFeedbackVarying:[["program","index"]],getUniform:[["program","location"]],getUniformBlockIndex:[["program","uniformBlockName"]],getUniformIndices:[["program","uniformNames"]],getUniformLocation:[["program","name"]],getVertexAttrib:[["index","pname"]],getVertexAttribOffset:[["index","pname"]],hint:[["target","mode"]],invalidateFramebuffer:[["target","attachments"]],invalidateSubFramebuffer:[["target","attachments","x","y","width","height"]],isBuffer:[["buffer"]],isContextLost:[[]],isEnabled:[["cap"]],isFramebuffer:[["framebuffer"]],isProgram:[["program"]],isQuery:[["query"]],isRenderbuffer:[["renderbuffer"]],isSampler:[["sampler"]],isShader:[["shader"]],isSync:[["sync"]],isTexture:[["texture"]],isTransformFeedback:[["tf"]],isVertexArray:[["vertexArray"]],lineWidth:[["width"]],linkProgram:[["program"]],pauseTransformFeedback:[[]],pixelStorei:[["pname","param"]],polygonOffset:[["factor","units"]],readBuffer:[["src"]],readPixels:[["x","y","width","height","format","type","dstData"],["x","y","width","height","format","type","offset"],["x","y","width","height","format","type","pixels"],["x","y","width","height","format","type","dstData","dstOffset"]],renderbufferStorage:[["target","internalformat","width","height"]],renderbufferStorageMultisample:[["target","samples","internalformat","width","height"]],resumeTransformFeedback:[[]],sampleCoverage:[["value","invert"]],samplerParameterf:[["sampler","pname","param"]],samplerParameteri:[["sampler","pname","param"]],scissor:[["x","y","width","height"]],shaderSource:[["shader","source"]],stencilFunc:[["func","ref","mask"]],stencilFuncSeparate:[["face","func","ref","mask"]],stencilMask:[["mask"]],stencilMaskSeparate:[["face","mask"]],stencilOp:[["fail","zfail","zpass"]],stencilOpSeparate:[["face","fail","zfail","zpass"]],texImage2D:[["target","level","internalformat","format","type","source"],["target","level","internalformat","width","height","border","format","type","pboOffset"],["target","level","internalformat","width","height","border","format","type","pixels"],["target","level","internalformat","width","height","border","format","type","source"],["target","level","internalformat","width","height","border","format","type","srcData","srcOffset"]],texImage3D:[["target","level","internalformat","width","height","depth","border","format","type","pboOffset"],["target","level","internalformat","width","height","depth","border","format","type","source"],["target","level","internalformat","width","height","depth","border","format","type","srcData"],["target","level","internalformat","width","height","depth","border","format","type","srcData","srcOffset"]],texParameterf:[["target","pname","param"]],texParameteri:[["target","pname","param"]],texStorage2D:[["target","levels","internalformat","width","height"]],texStorage3D:[["target","levels","internalformat","width","height","depth"]],texSubImage2D:[["target","level","xoffset","yoffset","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","pboOffset"],["target","level","xoffset","yoffset","width","height","format","type","pixels"],["target","level","xoffset","yoffset","width","height","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","srcData","srcOffset"]],texSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","pboOffset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","source"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","srcData","srcOffset"]],transformFeedbackVaryings:[["program","varyings","bufferMode"]],uniform1f:[["location","x"]],uniform1fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1i:[["location","x"]],uniform1iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1ui:[["location","v0"]],uniform1uiv:[["location","data","srcOffset","srcLength"]],uniform2f:[["location","x","y"]],uniform2fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2i:[["location","x","y"]],uniform2iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2ui:[["location","v0","v1"]],uniform2uiv:[["location","data","srcOffset","srcLength"]],uniform3f:[["location","x","y","z"]],uniform3fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3i:[["location","x","y","z"]],uniform3iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3ui:[["location","v0","v1","v2"]],uniform3uiv:[["location","data","srcOffset","srcLength"]],uniform4f:[["location","x","y","z","w"]],uniform4fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4i:[["location","x","y","z","w"]],uniform4iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4ui:[["location","v0","v1","v2","v3"]],uniform4uiv:[["location","data","srcOffset","srcLength"]],uniformBlockBinding:[["program","uniformBlockIndex","uniformBlockBinding"]],uniformMatrix2fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x3fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x3fv:[["location","transpose","data","srcOffset","srcLength"]],useProgram:[["program"]],validateProgram:[["program"]],vertexAttrib1f:[["index","x"]],vertexAttrib1fv:[["index","values"]],vertexAttrib2f:[["index","x","y"]],vertexAttrib2fv:[["index","values"]],vertexAttrib3f:[["index","x","y","z"]],vertexAttrib3fv:[["index","values"]],vertexAttrib4f:[["index","x","y","z","w"]],vertexAttrib4fv:[["index","values"]],vertexAttribDivisor:[["index","divisor"]],vertexAttribI4i:[["index","x","y","z","w"]],vertexAttribI4iv:[["index","values"]],vertexAttribI4ui:[["index","x","y","z","w"]],vertexAttribI4uiv:[["index","values"]],vertexAttribIPointer:[["index","size","type","stride","offset"]],vertexAttribPointer:[["index","size","type","normalized","stride","offset"]],viewport:[["x","y","width","height"]],waitSync:[["sync","flags","timeout"]]};class Uh{static getNames(e,t){const n=Bh[e];if(!n||0===n.length)return null;for(const e of n)if(e.length===t)return e;let r=null;for(const e of n)e.length>=t&&(null===r||e.lengthi.length&&(i=e);return i}static getName(e,t,n){const r=Uh.getNames(e,n);return r&&t>=0&&t{const e={};for(let t=0;t<64;t++)e["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;return e})();class qh{constructor(e){this.sources=e.sources||[],this.names=e.names||[],this.sourceRoot=e.sourceRoot||"",this.lines=qh.parseMappings(e.mappings||"")}originalPositionFor(e,t){const n={source:null,line:null,column:null,name:null},r=e-1;if(r<0||r>=this.lines.length)return n;const i=this.lines[r];if(!i||0===i.length)return n;const s=this.findSegment(i,t);if(!s)return n;const o=s.sourceIndex>=0&&s.sourceIndex=0&&s.nameIndex>1,o=e[s];o.generatedColumn<=t?(i=o,n=s+1):r=s-1}return i}static parseMappings(e){const t=[];let n=0,r=0,i=0,s=0;const o=e.split(";");for(let e=0;e0){const e=a.split(",");for(let t=0;t=4&&(n+=o[1],r+=o[2],i+=o[3],a.sourceIndex=n,a.originalLine=r,a.originalColumn=i,o.length>=5&&(s+=o[4],a.nameIndex=s)),l.push(a)}}l.sort((e,t)=>e.generatedColumn-t.generatedColumn),t.push(l)}return t}static decodeSegment(e){const t=[];let n=0;for(;n>>=1,t.push(o?-r:r)}return t}}var Qh=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})};class Zh{constructor(e){this.cache=new Map,this.inflight=new Map,this.fetchFn=e||("undefined"!=typeof fetch?fetch.bind(globalThis):void 0)}resolveFrames(e){return Qh(this,void 0,void 0,function*(){return e&&0!==e.length?Promise.all(e.map(e=>this.resolveFrame(e))):e||[]})}resolveFrame(e){return Qh(this,void 0,void 0,function*(){const t=Zh.parseFrame(e);if(!t)return e;let n;try{n=yield this.getConsumer(t.url)}catch(t){return e}if(!n)return e;const r=n.originalPositionFor(t.line,t.column);return r.source&&null!==r.line?Zh.formatFrame(t.functionName,r.name,r.source,r.line,r.column||0):e})}static parseFrame(e){if(!e)return null;let t=e.match(/^(.*?)\s*\((.+):(\d+):(\d+)\)\s*$/);return t?{functionName:t[1].trim(),url:t[2],line:parseInt(t[3],10),column:parseInt(t[4],10)}:(t=e.match(/^\s*(.+):(\d+):(\d+)\s*$/),t?{functionName:"",url:t[1].trim(),line:parseInt(t[2],10),column:parseInt(t[3],10)}:null)}static formatFrame(e,t,n,r,i){const s=t||e,o=n+":"+r+":"+i;return s?s+" ("+o+")":o}getConsumer(e){return Qh(this,void 0,void 0,function*(){if(this.cache.has(e))return this.cache.get(e);const t=this.inflight.get(e);if(t)return t;const n=this.loadConsumer(e).then(t=>(this.cache.set(e,t),this.inflight.delete(e),t)).catch(()=>(this.cache.set(e,null),this.inflight.delete(e),null));return this.inflight.set(e,n),n})}loadConsumer(e){return Qh(this,void 0,void 0,function*(){if(!this.fetchFn)return null;const t=yield this.fetchFn(e);if(!t.ok)return null;const n=yield t.text(),r=Zh.extractSourceMappingURL(n);if(!r)return null;let i;if(0===r.indexOf("data:"))i=Zh.parseDataUri(r);else{const t=Zh.resolveUrl(r,e),n=yield this.fetchFn(t);if(!n.ok)return null;i=yield n.json()}return i&&"string"==typeof i.mappings?new qh(i):null})}static extractSourceMappingURL(e){const t=/\/\/[#@]\s*sourceMappingURL=(\S+)\s*$/gm;let n,r=null;for(;null!==(n=t.exec(e));)r=n[1];return r}static parseDataUri(e){const t=e.indexOf(",");if(-1===t)return null;const n=e.substring(0,t),r=e.substring(t+1);try{const e=/;base64/i.test(n)?Zh.decodeBase64(r):decodeURIComponent(r);return JSON.parse(e)}catch(e){return null}}static decodeBase64(e){if("function"==typeof atob)return atob(e);const t=globalThis.Buffer;if(t)return t.from(e,"base64").toString("utf-8");throw new Error("No base64 decoder available.")}static resolveUrl(e,t){try{return new URL(e,t).href}catch(t){return e}}}function Jh(e){return e&&(e.text||e.name)||""}function ed(e,t){const n=[];if(!e||!t)return n;const r=e.DrawCall,i=t.DrawCall;ad("uniform",r&&r.uniforms,i&&i.uniforms,n),ad("uniformBlock",r&&r.uniformBlocks,i&&i.uniformBlocks,n);const s=sd(e,t);for(const r of s){if(td[r])continue;const i=e[r],s=t[r];(rd(i)||rd(s))&&od(i,s,r,n)}return n}const td={id:!0,name:!0,commandArguments:!0,result:!0,status:!0,marker:!0,text:!0,startTime:!0,commandEndTime:!0,endTime:!0,stackTrace:!0,consumeCommandId:!0,VisualState:!0},nd={__SPECTOR_Object_TAG:!0,__SPECTOR_Object_CustomData:!0,__SPECTOR_Metadata:!0,customData:!0,visual:!0,visualPixels:!0,VisualState:!0,texture:!0,sampler:!0,location:!0,source:!0,translatedSource:!0,analyserName:!0,uniforms:!0,uniformBlocks:!0,length:!0};function rd(e){return null!==e&&"object"==typeof e}function id(e){if(!rd(e))return null;const t=e.__SPECTOR_Object_TAG||("string"==typeof e.typeName&&"id"in e?e:null);return t&&"string"==typeof t.typeName?t.typeName:null}function sd(e,t){const n=[],r={},i=e=>{if(rd(e))for(const t in e)e.hasOwnProperty(t)&&!r[t]&&(r[t]=!0,n.push(t))};return i(e),i(t),n}function od(e,t,n,r,i=0){const s=id(e),o=id(t);if(null!==s||null!==o){const e=null!==s?s:"(absent)",t=null!==o?o:"(absent)";return void(e!==t&&r.push({path:n,previous:e,current:t}))}const a=rd(e),l=rd(t);if(!a&&!l){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}if(a!==l||i>=8){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}for(const s of sd(e,t))nd[s]||od(e?e[s]:void 0,t?t[s]:void 0,n+"."+s,r,i+1)}function ad(e,t,n,r){const i=hd(t),s=hd(n),o=[],a={};for(const e in i)i.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const e in s)s.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const t of o){const n=i.hasOwnProperty(t)?i[t]:void 0,o=s.hasOwnProperty(t)?s[t]:void 0,a=n?dd(n.value):"(absent)",l=o?dd(o.value):"(absent)";a!==l&&r.push({path:e+" "+t,previous:a,current:l}),ld(e+" "+t,n,o,r)}}function ld(e,t,n,r){const i=t&&t.texture,s=n&&n.texture;(rd(i)||rd(s))&&cd(e+" texture",i,s,r);const o=t&&t.textures,a=n&&n.textures,l=Array.isArray(o)?o.length:0,u=Array.isArray(a)?a.length:0,c=Math.max(l,u);for(let t=0;t0?o[t]:void 0,u>0?a[t]:void 0,r)}const ud=["width","height","depth","format","internalFormat","textureType"];function cd(e,t,n,r){(rd(t)||rd(n))&&(function(e,t,n,r){for(const i of ud){const s=t?t[i]:void 0,o=n?n[i]:void 0;if(void 0===s&&void 0===o)continue;const a=dd(s),l=dd(o);a!==l&&r.push({path:e+" "+i,previous:a,current:l})}}(e,t,n,r),function(e,t,n,r){if(rd(t)||rd(n))for(const i of sd(t,n)){const s=t?t[i]:void 0,o=n?n[i]:void 0,a="string"==typeof s,l="string"==typeof o;(a||l)&&s!==o&&r.push({path:e+" ("+i+")",previous:a?"(image)":"(absent)",current:l?"(image)":"(absent)",previousImage:a?s:void 0,currentImage:l?o:void 0})}}(e,t&&t.visual,n&&n.visual,r))}function hd(e){const t={};if(Array.isArray(e))for(const n of e)n&&"string"==typeof n.name&&(t[n.name]=n);return t}function dd(e){if(void 0===e)return"(absent)";if(null===e)return"null";try{return JSON.stringify(e)}catch(t){return String(e)}}function fd(e,t){for(let n=0;n{if(this.store.getSnapshot().currentCapture)switch(e){case 0:this._displayCaptures();break;case 40:this._displayCurrentCapture();break;case 10:this._displayInformation();break;case 20:this._displayInitState();break;case 30:this._displayEndState();break;case 60:this._displayCompare()}else this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))},this.handleSearchTextChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{searchText:e})),this._search(e)},this.handleCompareOnlyDifferencesChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{compareOnlyDifferences:e}))},this.handleCompareCommandSelected=e=>{null!=e&&(this._currentCommandId=e,this._displayCurrentCapture())},this.handleCommandSelected=e=>{this.selectCommand(e)},this.openTextureViewer=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{textureViewer:{open:!0,src:e.src,label:e.label,pixelated:e.pixelated,raw:e.raw||null}}))},this.closeTextureViewer=()=>{this.store.setState(e=>Object.assign(Object.assign({},e),{textureViewer:Object.assign(Object.assign({},e.textureViewer),{open:!1})}))},this.handleVisualStateSelected=e=>{this.selectVisualState(e)},this.handleVertexSelected=e=>{this.selectCommand(e),this._openShader(!1)},this.handleFragmentSelected=e=>{this.selectCommand(e),this._openShader(!0)},this.handleShaderSelected=e=>{var t;const n=null===(t=this.store.getSnapshot().commands[e])||void 0===t?void 0:t.capture.shader;n&&(this.selectCommand(e),this._openCapturedShader(n))},this.handleShaderSourceOpen=(e,t)=>{this._openCapturedShader(e,t)},this.handleSourceCodeChanged=e=>{this.onSourceCodeChanged.trigger(e)},this.handleSourceCodeClose=()=>{this._displayCurrentCapture()},this.handleSourceCodeTabChange=(e,t)=>{this.store.setState(n=>n.sourceCodeState?Object.assign(Object.assign({},n),{sourceCodeState:Object.assign(Object.assign({},n.sourceCodeState),{fragment:e,translated:t})}):n)},this.handleBeautifyChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{beautify:e})}):t)},this.handlePreprocessChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{preprocessed:e})}):t)},this.handleSaveRequested=e=>{this.saveCapture(e)},this.handleCaptureLoaded=e=>{this.addCapture(e)},this.handleClose=()=>{this.hide()},this._rootPlaceHolder=e||document.body,this.onSourceCodeChanged=new l,this.store=new ft(Object.assign({},pd)),this._container=document.createElement("div"),this._container.className="spector-react-result-view",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(yt.Provider,{value:this},(0,dt.createElement)(Mh))),this._rootPlaceHolder.addEventListener("keydown",e=>{if(40!==this.store.getSnapshot().menuStatus)return;const t=e.keyCode;38===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousCommand()):40===t?(e.preventDefault(),e.stopPropagation(),this._selectNextCommand()):33===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousVisualState()):34===t&&(e.preventDefault(),e.stopPropagation(),this._selectNextVisualState())})}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}addCapture(e){return this.store.setState(t=>{const n=t.captures.map(e=>({capture:e.capture,active:!1}));return Object.assign(Object.assign({},t),{captures:[{capture:e,active:!0},...n],currentCapture:e})}),this._currentCommandId=-1,this._displayCurrentCapture(),0}selectCapture(e){this._currentCommandId=-1,this.store.setState(t=>{var n,r;const i=t.captures.map((t,n)=>({capture:t.capture,active:n===e}));return Object.assign(Object.assign({},t),{captures:i,currentCapture:null!==(r=null===(n=i[e])||void 0===n?void 0:n.capture)&&void 0!==r?r:null})}),this._displayCurrentCapture()}selectCommand(e){const t=this.store.getSnapshot();if(e<0||e>=t.commands.length)return;const n=t.commands[e];this._currentCommandId=n.capture.id;const r=n.visualStateIndex,i=this._buildCommandDetail(e,t.commands,t.visualStates);this.store.setState(t=>Object.assign(Object.assign({},t),{commands:t.commands.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentCommandIndex:e,visualStates:t.visualStates.map((e,t)=>e.active!==(t===r)?Object.assign(Object.assign({},e),{active:t===r}):e),currentVisualStateIndex:r,commandDetailData:i}))}selectVisualState(e){const t=this.store.getSnapshot();if(e<0||e>=t.visualStates.length)return;const n=t.visualStates[e].commandIndex;if(n===Number.MIN_VALUE)return void this._displayInitState();if(n===Number.MAX_VALUE)return void this._displayEndState();n>=0&&(this._currentCommandId=t.commands[n].capture.id);const r=n>=0?this._buildCommandDetail(n,t.commands,t.visualStates):t.commandDetailData;this.store.setState(t=>Object.assign(Object.assign({},t),{visualStates:t.visualStates.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentVisualStateIndex:e,commands:n>=0?t.commands.map((e,t)=>e.active!==(t===n)?Object.assign(Object.assign({},e),{active:t===n}):e):t.commands,currentCommandIndex:n>=0?n:t.currentCommandIndex,commandDetailData:r}))}showSourceCodeError(e){this.store.setState(t=>Object.assign(Object.assign({},t),{sourceCodeError:e}))}saveCapture(e){const t=JSON.stringify(e,null,4),n=new Blob([t],{type:"octet/stream"}),r="capture "+new Date(e.startTime).toTimeString().split(" ")[0]+".json",i=document.createElement("a"),s=window.URL.createObjectURL(n);i.setAttribute("href",s),i.setAttribute("download",r),i.click()}_displayCaptures(){this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))}_displayCompare(){const e=this.store.getSnapshot(),t=e.captures.findIndex(e=>e.active),n=t>=0?e.captures[t]:null,r=n?e.captures[t+1]:null;if(!n||!r)return void this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:60,canCompare:!1,compareRows:[],compareSummary:{added:0,removed:0,changed:0,unchanged:0},compareLabel:""}));const i=function(e,t){const n=function(e,t){const n=e.length,r=t.length,i=e.map(Jh),s=t.map(Jh),o=[];for(let e=0;e<=n;e++)o.push(new Array(r+1).fill(0));for(let e=n-1;e>=0;e--)for(let t=r-1;t>=0;t--)o[e][t]=i[e]===s[t]?o[e+1][t+1]+1:Math.max(o[e+1][t],o[e][t+1]);const a=[];let l=[];const u=()=>{for(const e of l)a.push(e);l=[]};let c=0,h=0;for(;c0?a.push({type:"changed",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id,fieldDiffs:n}):a.push({type:"unchanged",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id}),c++,h++}else if(o[c+1][h]>=o[c][h+1])l.push({type:"removed",name:e[c].name,previousText:e[c].text,indexA:c}),c++;else{const n=fd(l,t[h].name);n?a.push({type:"changed",name:t[h].name,previousText:n.previousText,currentText:t[h].text,indexA:n.indexA,indexB:h,commandId:t[h].id,fieldDiffs:ed(e[n.indexA],t[h])}):(u(),a.push({type:"added",name:t[h].name,currentText:t[h].text,indexB:h,commandId:t[h].id})),h++}for(;cObject.assign(Object.assign({},e),{menuStatus:60,canCompare:!0,compareRows:i.rows,compareSummary:i.summary,compareLabel:s}))}static _captureLabel(e){try{return new Date(e.startTime).toTimeString().split(" ")[0]}catch(e){return"capture"}}_displayInformation(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];zh(n,"Canvas",t.canvas,e.searchText),zh(n,"Context",t.context,e.searchText);const r=[];for(const n of t.analyses){const t="Primitives"===n.analyserName?"Vertices count":n.analyserName;zh(r,t,n,e.searchText)}zh(r,"Frame Memory Changes",t.frameMemory,e.searchText),zh(r,"Total Memory (seconds since application start: bytes)",t.memory,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:10,commandCount:t.commands.length,informationLeft:n,informationRight:r}))}_displayInitState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.initState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:20,commandCount:t.commands.length,initStateData:n}))}_displayEndState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.endState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:30,commandCount:t.commands.length,endStateData:n}))}_displayCurrentCapture(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=e.searchText,r=e.captures.map(e=>({capture:e.capture,active:e.capture===t})),i=[];i.push({VisualState:t.initState.VisualState,time:t.startTime,commandIndex:Number.MIN_VALUE,active:!1,previousVisualStateIndex:-1,nextVisualStateIndex:-1});const s=[];let o=0,a=!1,l=-1,u=-1;for(let e=0;e0?c-1:-1,nextCommandIndex:-1,visualStateIndex:o,active:!1};if(c>0&&(s[c-1].nextCommandIndex=c),r.VisualState){const e=i.length,t=i.length-1,n={VisualState:r.VisualState,time:r.endTime,commandIndex:c,active:!1,previousVisualStateIndex:t,nextVisualStateIndex:-1};i[t].nextVisualStateIndex=e,i.push(n),o=e,a=!0}else a||(i[0].commandIndex=c,a=!0);h.visualStateIndex=o,s.push(h),(-1===this._currentCommandId&&0===c||this._currentCommandId===r.id)&&(l=c,u=o)}l>=0&&(s[l].active=!0,this._currentCommandId=s[l].capture.id),u>=0&&(i[u].active=!0);let c=[];l>=0&&(c=this._buildCommandDetail(l,s,i)),this.store.setState(e=>Object.assign(Object.assign({},e),{captures:r,menuStatus:40,commandCount:t.commands.length,commands:s,currentCommandIndex:l,visualStates:i,currentVisualStateIndex:u,sourceCodeState:null,sourceCodeError:"",commandDetailData:c}))}_openShader(e){const t=this.store.getSnapshot();if(t.currentCommandIndex<0||t.currentCommandIndex>=t.commands.length)return;const n=t.commands[t.currentCommandIndex].capture.DrawCall;if(!n||!n.shaders||n.shaders.length<2)return;const r={programId:n.programStatus.program.__SPECTOR_Object_TAG.id,nameVertex:n.shaders[0].name,nameFragment:n.shaders[1].name,sourceVertex:n.shaders[0].source,sourceFragment:n.shaders[1].source,translatedSourceVertex:n.shaders[0].translatedSource,translatedSourceFragment:n.shaders[1].translatedSource,fragment:e,translated:!1,editable:n.programStatus.RECOMPILABLE,beautify:!0,preprocessed:!1,singleShader:!1,sourceVertexLog:n.shaders[0].infoLog||"",sourceFragmentLog:n.shaders[1].infoLog||"",programLog:n.programStatus.infoLog||""},i=this._buildCommandDetail(t.currentCommandIndex,t.commands,t.visualStates);this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:"",commandDetailData:i}))}_openCapturedShader(e,t=""){if(!e||"string"!=typeof e.source)return;const n="FRAGMENT_SHADER"===e.shaderType,r={programId:-1,nameVertex:n?"":e.name,nameFragment:n?e.name:"",sourceVertex:n?"":e.source,sourceFragment:n?e.source:"",translatedSourceVertex:n?"":e.translatedSource||"",translatedSourceFragment:n&&e.translatedSource||"",fragment:n,translated:!1,editable:!1,beautify:!0,preprocessed:!1,singleShader:!0,sourceVertexLog:n?"":e.infoLog||"",sourceFragmentLog:n&&e.infoLog||"",programLog:t};this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:""}))}_buildCommandDetail(e,t,n){if(e<0||e>=t.length)return[];const r=t[e],i=n[r.visualStateIndex],s=this._resolvedStackTraces.get(r.capture.id),o=function(e,t,n){const r=[];t&&r.push({type:"visualState",visualState:t});let i="Unknown";switch(e.status){case 50:i="Deprecated";break;case 10:i="Unused";break;case 20:i="Disabled";break;case 30:i="Redundant";break;case 40:i="Valid"}const s=Ph.getMDNLink(e.name);e.result?zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,result:e.result,status:i},""):"LOG"!==e.name&&zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,status:i},"");for(const t in e)"VisualState"!==t&&"result"!==t&&("commandArguments"===t&&Array.isArray(e.commandArguments)?Kh(r,e.name,e.commandArguments):Xh(r,t,e)||("stackTrace"===t&&Array.isArray(e.stackTrace)?zh(r,"stackTrace",n||e.stackTrace,""):"object"==typeof e[t]&&zh(r,t,e[t],"")));return r}(r.capture,null==i?void 0:i.VisualState,s);return s||this._resolveStackTraceAsync(r.capture),o}_resolveStackTraceAsync(e){const t=e.id;this._resolvedStackTraces.has(t)||this._resolvingStackTraces.has(t)||e.stackTrace&&0!==e.stackTrace.length&&(this._resolvingStackTraces.add(t),this._sourceMapResolver.resolveFrames(e.stackTrace).then(n=>{this._resolvingStackTraces.delete(t),this._resolvedStackTraces.set(t,n);let r=!1;for(let t=0;tObject.assign(Object.assign({},t),{commandDetailData:e}))}}).catch(()=>{this._resolvingStackTraces.delete(t)}))}_selectPreviousCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.previousCommandIndex<0||this.selectCommand(t.previousCommandIndex)}_selectNextCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.nextCommandIndex<0||this.selectCommand(t.nextCommandIndex)}_selectPreviousVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.previousVisualStateIndex<0||this.selectVisualState(t.previousVisualStateIndex)}_selectNextVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.nextVisualStateIndex<0||this.selectVisualState(t.nextVisualStateIndex)}_search(e){switch(this.store.getSnapshot().menuStatus){case 0:case 40:this._displayCurrentCapture();break;case 30:this._displayEndState();break;case 10:this._displayInformation();break;case 20:this._displayInitState()}this.store.setState(e=>Object.assign(Object.assign({},e),{searchText:""}))}}class gd{constructor(e,t={}){this.worker=e,this.captureTimeout=t.captureTimeout||1e4,this.disposed=!1,this.captureTimer=null,this.onCapture=new l,this.onCaptureStarted=new l,this.onError=new l,this.onFps=new l,this.onContextReady=new l,this.messageHandler=this.handleMessage.bind(this),this.worker.addEventListener("message",this.messageHandler)}triggerCapture(e=0,t=0,n=!1,r=!1){if(this.disposed)return;this.clearCaptureTimer();const i={type:"spector:trigger-capture",version:1,canvasIndex:e,commandCount:t,quickCapture:n,fullCapture:r};this.worker.postMessage(i),this.captureTimer=setTimeout(()=>{this.onError.trigger("Capture timed out after "+this.captureTimeout+"ms"),this.captureTimer=null},this.captureTimeout)}dispose(){this.disposed||(this.disposed=!0,this.clearCaptureTimer(),this.worker.removeEventListener("message",this.messageHandler),this.onCapture.clear(),this.onCaptureStarted.clear(),this.onError.clear(),this.onFps.clear(),this.onContextReady.clear())}handleMessage(e){const t=e.data;if(!function(e){return null!=e&&"object"==typeof e&&"string"==typeof e.type&&0===e.type.indexOf("spector:")}(t))return;const n=t;switch(n.type){case"spector:context-ready":this.onContextReady.trigger({canvasCount:n.canvasCount,canvasWidth:n.canvasWidth,canvasHeight:n.canvasHeight});break;case"spector:capture-started":this.onCaptureStarted.trigger(void 0);break;case"spector:capture-complete":this.clearCaptureTimer(),this.onCapture.trigger(n.capture);break;case"spector:error":this.clearCaptureTimer(),this.onError.trigger(n.error);break;case"spector:fps":this.onFps.trigger(n.fps)}}clearCaptureTimer(){null!=this.captureTimer&&(clearTimeout(this.captureTimer),this.captureTimer=null)}}var Ed=n(72),vd=n.n(Ed),Cd=n(825),Dd=n.n(Cd),Sd=n(659),Ad=n.n(Sd),_d=n(56),yd=n.n(_d),bd=n(540),Td=n.n(bd),Rd=n(113),xd=n.n(Rd),wd=n(377),Fd={};Fd.styleTagTransform=xd(),Fd.setAttributes=yd(),Fd.insert=Ad().bind(null,"html"),Fd.domAPI=Dd(),Fd.insertStyleElement=Td(),vd()(wd.A,Fd),wd.A&&wd.A.locals&&wd.A.locals;var Nd=n(160),Ld={};Ld.styleTagTransform=xd(),Ld.setAttributes=yd(),Ld.insert=Ad().bind(null,"html"),Ld.domAPI=Dd(),Ld.insertStyleElement=Td(),vd()(Nd.A,Ld),Nd.A&&Nd.A.locals&&Nd.A.locals;class Od{constructor(e){this.timeSpy=e,this.init()}spyXRSession(e){this.currentXRSession&&this.unspyXRSession();for(const e of at.getRequestAnimationFrameFunctionNames())y.resetOriginFunction(this.timeSpy.getSpiedScope(),e);this.timeSpy.spyRequestAnimationFrame("requestAnimationFrame",e),this.currentXRSession=e}unspyXRSession(){if(this.currentXRSession){y.resetOriginFunction(this.currentXRSession,"requestAnimationFrame"),this.currentXRSession=void 0;for(const e of at.getRequestAnimationFrameFunctionNames())this.timeSpy.spyRequestAnimationFrame(e,this.timeSpy.getSpiedScope())}}init(){if(!navigator.xr)return;class e extends XRWebGLLayer{constructor(e,t,n){super(e,t,n),this.glContext=t}getContext(){return this.glContext}}class t extends XRWebGLBinding{constructor(e,t){super(e,t),this.glContext=t}createProjectionLayer(e){const t=super.createProjectionLayer(e);return t.glContext=this.glContext,t}}window.XRWebGLLayer=e,window.XRWebGLBinding=t;const n=navigator.xr.requestSession;Object.defineProperty(navigator.xr,"requestSessionInternal",{writable:!0}),navigator.xr.requestSessionInternal=n,Object.defineProperty(navigator.xr,"requestSession",{writable:!0}),navigator.xr.requestSession=(e,t)=>((e,t)=>navigator.xr.requestSessionInternal(e,t).then(e=>{const t=e;return t._updateRenderState=e.updateRenderState,t.updateRenderState=e=>function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){if(e.baseLayer){const n=e.baseLayer;t.glContext=n.getContext()}if(e.layers)for(const n of e.layers){const e=n;e.glContext&&(t.glContext=e.glContext)}return t._updateRenderState(e)}),this.spyXRSession(t),e.addEventListener("end",()=>{this.unspyXRSession()}),Promise.resolve(e)}))(e,t)}}const Id={CaptureMenu:_t,ResultView:md};class kd{static getFirstAvailable3dContext(e){return this.tryGetContextFromHelperField(e)||this.tryGetContextFromCanvas(e,"webgl")||this.tryGetContextFromCanvas(e,"experimental-webgl")||this.tryGetContextFromCanvas(e,"webgl2")||this.tryGetContextFromCanvas(e,"experimental-webgl2")}static tryGetContextFromHelperField(e){const t=e instanceof HTMLCanvasElement?e.getAttribute("__spector_context_type"):e.__spector_context_type;if(t)return this.tryGetContextFromCanvas(e,t)}static tryGetContextFromCanvas(e,t){let n;try{n=e.getContext(t)}catch(e){}return n}constructor(e={}){this.noFrameTimeout=-1,this.options=Object.assign({enableXRCapture:!1},e),this.captureNextFrames=0,this.captureNextCommands=0,this.quickCapture=!1,this.fullCapture=!1,this.retry=0,this.contexts=[],this.workerBridges=new Map,this.timeSpy=new at,this.onCaptureStarted=new l,this.onCapture=new l,this.onError=new l,this.timeSpy.onFrameStart.add(this.onFrameStart,this),this.timeSpy.onFrameEnd.add(this.onFrameEnd,this),this.timeSpy.onError.add(this.onErrorInternal,this),ct.install(),this.options.enableXRCapture&&(this.xrSpy=new Od(this.timeSpy))}displayUI(e=!1){this.captureMenu||(this.getCaptureUI(),this.captureMenu.onPauseRequested.add(this.pause,this),this.captureMenu.onPlayRequested.add(this.play,this),this.captureMenu.onPlayNextFrameRequested.add(this.playNextFrame,this),this.captureMenu.onCaptureRequested.add(e=>{e&&(e.ref instanceof Worker?this.captureWorker(e.ref):this.captureCanvas(e.ref))},this),setInterval(()=>{this.captureMenu.setFPS(this.getFps())},1e3),e||this.captureMenu.trackPageCanvases(),this.captureMenu.display()),this.resultView||(this.getResultUI(),this.onCapture.add(e=>{this.resultView.display(),this.resultView.addCapture(e)}))}getResultUI(){return this.resultView||(this.resultView=new md,this.resultView.onSourceCodeChanged.add(e=>{this.rebuildProgramFromProgramId(e.programId,e.sourceVertex,e.sourceFragment,t=>{this.referenceNewProgram(e.programId,t),this.resultView.showSourceCodeError(null)},e=>{this.resultView.showSourceCodeError(e)})})),this.resultView}getCaptureUI(){return this.captureMenu||(this.captureMenu=new _t),this.captureMenu}rebuildProgramFromProgramId(e,t,n,r,i){const s=Pe.getFromGlobalStore(e);this.rebuildProgram(s,t,n,r,i)}rebuildProgram(e,t,n,r,i){o.rebuildProgram(e,t,n,r,i)}referenceNewProgram(e,t){Pe.updateInGlobalStore(e,t)}pause(){this.timeSpy.changeSpeedRatio(0)}play(){this.timeSpy.changeSpeedRatio(1)}playNextFrame(){this.timeSpy.playNextFrame()}drawOnlyEveryXFrame(e){this.timeSpy.changeSpeedRatio(e)}getFps(){return this.timeSpy.getFps()}spyCanvases(){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt,this.canvasSpy.onContextRequested.add(this.spyContext,this))}spyCanvas(e){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt(e),this.canvasSpy.onContextRequested.add(this.spyContext,this))}getAvailableContexts(){return this.contexts}setShaderCompileDelay(e){ct.install(),ct.setDelay(e)}clearShaderCompileDelay(){ct.setDelay(0)}getShaderCompileDelay(){return ct.getDelay()}captureCanvas(e,t=0,n=!1,r=!1){const i=this.getAvailableContextSpyByCanvas(e);if(i)this.captureContextSpy(i,t,n,r);else{const i=kd.getFirstAvailable3dContext(e);i?this.captureContext(i,t,n,r):a.error("No webgl context available on the chosen canvas.")}}captureContext(e,t=0,n=!1,r=!1){let i=this.getAvailableContextSpyByCanvas(e.canvas);i||(i=e.getIndexedParameter?new ot({context:e,version:2,recordAlways:!1}):new ot({context:e,version:1,recordAlways:!1}),i.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:i.context.canvas,contextSpy:i})),i&&this.captureContextSpy(i,t,n,r)}captureXRContext(e=0,t=!1,n=!1){this.captureContext(this.getXRContext(),e,t,n)}captureContextSpy(e,t=0,n=!1,r=!1){this.quickCapture=n,this.fullCapture=r,this.capturingContext?this.onErrorInternal("Already capturing a context."):(this.retry=0,this.capturingContext=e,this.capturingContext.setMarker(this.marker),(t=Math.min(t,1e4))>0?this.captureCommands(t):this.captureFrames(1),this.noFrameTimeout=setTimeout(()=>{t>0?this.stopCapture():this.capturingContext&&this.retry>1?this.onErrorInternal("No frames with gl commands detected. Try moving the camera."):this.onErrorInternal("No frames detected. Try moving the camera or implementing requestAnimationFrame.")},1e4))}captureNextFrame(e,t=!1,n=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,0,t,n):this.captureContext(e,0,t,n)}startCapture(e,t,n=!1,r=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,t,n,r):this.captureContext(e,t,n,r)}stopCapture(){if(this.capturingContext){const e=this.capturingContext.stopCapture();if(e.commands.length>0)return this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),this.triggerCapture(e),this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,e;0===this.captureNextCommands&&(this.retry++,this.captureFrames(1))}}setMarker(e){this.marker=e,this.capturingContext&&this.capturingContext.setMarker(e)}clearMarker(){this.marker=null,this.capturingContext&&this.capturingContext.clearMarker()}addRequestAnimationFrameFunctionName(e){this.timeSpy.addRequestAnimationFrameFunctionName(e)}setSpiedScope(e){this.timeSpy.setSpiedScope(e)}log(e){this.capturingContext&&this.capturingContext.log(e)}spyWorkers(e="spector.worker.bundle.js"){ut.startIntercepting(e)}stopSpyingWorkers(){ut.stopIntercepting()}spyWorker(e){let t=this.workerBridges.get(e);return t||(t=new gd(e),t.onCapture.add(e=>{this.triggerCapture(e)},this),t.onError.add(e=>{this.onErrorInternal(e)},this),t.onContextReady.add(t=>{if(this.captureMenu){const n=this.workerBridges.size;this.captureMenu.addCanvasInformation({id:"Worker "+n,width:t.canvasWidth,height:t.canvasHeight,ref:e})}},this),t.onFps.add(e=>{this.captureMenu&&this.captureMenu.setFPS(e)},this),this.workerBridges.set(e,t),t)}captureWorker(e,t=0,n=!1,r=!1){this.spyWorker(e).triggerCapture(0,t,n,r)}captureFrames(e){this.captureNextFrames=e,this.captureNextCommands=0,this.playNextFrame()}captureCommands(e){this.captureNextFrames=0,this.captureNextCommands=e,this.play(),this.capturingContext?(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(e,this.quickCapture,this.fullCapture)):(this.onErrorInternal("No context to capture from."),this.captureNextCommands=0)}spyContext(e){let t=this.getAvailableContextSpyByCanvas(e.context.canvas);t||(t=new ot({context:e.context,version:e.contextVersion,recordAlways:!0}),t.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:t.context.canvas,contextSpy:t})),t.spy()}getAvailableContextSpyByCanvas(e){for(const t of this.contexts)if(t.canvas===e)return t.contextSpy}getXRContext(){return this.options.enableXRCapture||a.error("Cannot retrieve WebXR context if capturing WebXR is disabled."),this.xrSpy.currentXRSession||a.error("No currently active WebXR session."),this.xrSpy.currentXRSession.glContext}onFrameStart(){this.captureNextCommands>0||(this.captureNextFrames>0?(this.capturingContext&&(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(0,this.quickCapture,this.fullCapture)),this.captureNextFrames--):this.capturingContext=void 0)}onFrameEnd(){this.captureNextCommands>0||0===this.captureNextFrames&&this.stopCapture()}triggerCapture(e){this.captureMenu&&this.captureMenu.captureComplete(null),this.onCapture.trigger(e)}onErrorInternal(e){if(a.error(e),this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),!this.capturingContext)throw e;this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,this.retry=0,this.captureMenu&&this.captureMenu.captureComplete(e),this.onError.trigger(e)}}},180(e,t,n){e=n.nmd(e),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/lang"),s=e("../lib/event"),o='.ace_search {background-color: #ddd;color: #666;border: 1px solid #cbcbcb;border-top: 0 none;overflow: hidden;margin: 0;padding: 4px 6px 0 4px;position: absolute;top: 0;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {margin: 0 20px 4px 0;overflow: hidden;line-height: 1.9;}.ace_replace_form {margin-right: 0;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {border-radius: 3px 0 0 3px;background-color: white;color: black;border: 1px solid #cbcbcb;border-right: 0 none;outline: 0;padding: 0;font-size: inherit;margin: 0;line-height: inherit;padding: 0 6px;min-width: 17em;vertical-align: top;min-height: 1.8em;box-sizing: content-box;}.ace_searchbtn {border: 1px solid #cbcbcb;line-height: inherit;display: inline-block;padding: 0 6px;background: #fff;border-right: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;margin: 0;position: relative;color: #666;}.ace_searchbtn:last-child {border-radius: 0 3px 3px 0;border-right: 1px solid #cbcbcb;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn:hover {background-color: #eef1f6;}.ace_searchbtn.prev, .ace_searchbtn.next {padding: 0px 0.7em}.ace_searchbtn.prev:after, .ace_searchbtn.next:after {content: "";border: solid 2px #888;width: 0.5em;height: 0.5em;border-width: 2px 0 0 2px;display:inline-block;transform: rotate(-45deg);}.ace_searchbtn.next:after {border-width: 0 2px 2px 0 ;}.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;font: 16px/16px Arial;padding: 0;height: 14px;width: 14px;top: 9px;right: 7px;position: absolute;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;box-sizing: border-box!important;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;clear: both;}.ace_search_counter {float: left;font-family: arial;padding: 0 8px;}',a=e("../keyboard/hash_handler").HashHandler,l=e("../lib/keys");r.importCssString(o,"ace_searchbox");var u=function(e,t,n){var i=r.createElement("div");r.buildDom(["div",{class:"ace_search right"},["span",{action:"hide",class:"ace_searchbtn_close"}],["div",{class:"ace_search_form"},["input",{class:"ace_search_field",placeholder:"Search for",spellcheck:"false"}],["span",{action:"findPrev",class:"ace_searchbtn prev"},"​"],["span",{action:"findNext",class:"ace_searchbtn next"},"​"],["span",{action:"findAll",class:"ace_searchbtn",title:"Alt-Enter"},"All"]],["div",{class:"ace_replace_form"},["input",{class:"ace_search_field",placeholder:"Replace with",spellcheck:"false"}],["span",{action:"replaceAndFindNext",class:"ace_searchbtn"},"Replace"],["span",{action:"replaceAll",class:"ace_searchbtn"},"All"]],["div",{class:"ace_search_options"},["span",{action:"toggleReplace",class:"ace_button",title:"Toggle Replace mode",style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{class:"ace_search_counter"}],["span",{action:"toggleRegexpMode",class:"ace_button",title:"RegExp Search"},".*"],["span",{action:"toggleCaseSensitive",class:"ace_button",title:"CaseSensitive Search"},"Aa"],["span",{action:"toggleWholeWords",class:"ace_button",title:"Whole Word Search"},"\\b"],["span",{action:"searchInSelection",class:"ace_button",title:"Search In Selection"},"S"]]],i),this.element=i.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),r.importCssString(o,"ace_searchbox",e.container)};(function(){this.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},this.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;s.addListener(e,"mousedown",function(e){setTimeout(function(){t.activeInput.focus()},0),s.stopPropagation(e)}),s.addListener(e,"click",function(e){var n=(e.target||e.srcElement).getAttribute("action");n&&t[n]?t[n]():t.$searchBarKb.commands[n]&&t.$searchBarKb.commands[n].exec(t),s.stopPropagation(e)}),s.addCommandKeyListener(e,function(e,n,r){var i=l.keyCodeToString(r),o=t.$searchBarKb.findKeyCommand(n,i);o&&o.exec&&(o.exec(t),s.stopEvent(e))}),this.$onChange=i.delayedCall(function(){t.find(!1,!1)}),s.addListener(this.searchInput,"input",function(){t.$onChange.schedule(20)}),s.addListener(this.searchInput,"focus",function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()}),s.addListener(this.replaceInput,"focus",function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()})},this.$closeSearchBarKb=new a([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new a,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.editor.getReadOnly()||(e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus())},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),this.setSearchRange=function(e){this.searchRange=e,e?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(e){r.setCssClass(this.replaceOption,"checked",this.searchRange),r.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var t=this.editor.getReadOnly();this.replaceOption.style.display=t?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!t?"":"none",this.find(!1,!1,e)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,n){var i=!this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n,range:this.searchRange})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",i),this.editor._emit("findSearchBox",{match:!i}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,n=0,r=0;if(t){var i=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),s=e.session.doc.positionToIndex(e.selection.anchor);this.searchRange&&(s-=e.session.doc.positionToIndex(this.searchRange.start));for(var o,a=t.lastIndex=0;(o=t.exec(i))&&(n++,(a=o.index)<=s&&r++,!(n>999))&&(o[0]||(t.lastIndex=a+=1,!(a>=i.length))););}this.searchCounter.textContent=r+" of "+(n>999?"999+":n)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(u.prototype),t.SearchBox=u,t.Search=function(e,t){(e.searchBox||new u(e)).show(e.session.getTextRange(),t)}}),ace.require(["ace/ext/searchbox"],function(t){e&&(e.exports=t)})},49(e,t,n){e=n.nmd(e),ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=t.cFunctions="\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b",a=function(){var e=this.$keywords=this.createKeywordMapper({"keyword.control":"break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while|catch|operator|try|throw|using","storage.type":"asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|class|wchar_t|template|char16_t|char32_t","storage.modifier":"const|extern|register|restrict|static|volatile|inline|private|protected|public|friend|explicit|virtual|export|mutable|typename|constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local","keyword.operator":"and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace","variable.language":"this","constant.language":"NULL|true|false|TRUE|FALSE|nullptr"},"identifier"),t=/\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source,n="%"+/(\d+\$)?/.source+/[#0\- +']*/.source+/[,;:_]?/.source+/((-?\d+)|\*(-?\d+\$)?)?/.source+/(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source+/(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source+/(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source;this.$rules={start:[{token:"comment",regex:"//$",next:"start"},{token:"comment",regex:"//",next:"singleLineComment"},i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string",regex:"'(?:"+t+"|.)?'"},{token:"string.start",regex:'"',stateName:"qqstring",next:[{token:"string",regex:/\\\s*$/,next:"qqstring"},{token:"constant.language.escape",regex:t},{token:"constant.language.escape",regex:n},{token:"string.end",regex:'"|$',next:"start"},{defaultToken:"string"}]},{token:"string.start",regex:'R"\\(',stateName:"rawString",next:[{token:"string.end",regex:'\\)"',next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"keyword",regex:"#\\s*(?:include|import|pragma|line|define|undef|version)\\b",next:"directive"},{token:"keyword",regex:"#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b"},{token:"support.function.C99.c",regex:o},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*"},{token:"keyword.operator",regex:/--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],singleLineComment:[{token:"comment",regex:/\\$/,next:"singleLineComment"},{token:"comment",regex:/$/,next:"start"},{defaultToken:"comment"}],directive:[{token:"constant.other.multiline",regex:/\\/},{token:"constant.other.multiline",regex:/.*\\/},{token:"constant.other",regex:"\\s*<.+?>",next:"start"},{token:"constant.other",regex:'\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',next:"start"},{token:"constant.other",regex:"\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",next:"start"},{token:"constant.other",regex:/[^\\\/]+/,next:"start"}]},this.embedRules(i,"doc-",[i.getEndRule("start")]),this.normalizeRules()};r.inherits(a,s),t.c_cppHighlightRules=a}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var i=n[1].length,s=e.findMatchingBracket({row:t,column:i});if(!s||s.row==t)return 0;var o=this.$getIndent(e.getLine(s.row));e.replace(new r(t,0,t,i-1),o)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i,s=e.getLine(n);if(this.startRegionRe.test(s))return this.getCommentRegionBlock(e,s,n);if(i=s.match(this.foldingStartMarker)){var o=i.index;if(i[1])return this.openingBracketBlock(e,i[1],n,o);var a=e.getCommentFoldRange(n,o+i[0].length,1);return a&&!a.isMultiLine()&&(r?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(i=s.match(this.foldingStopMarker))?(o=i.index+i[0].length,i[1]?this.closingBracketBlock(e,i[1],n,o):e.getCommentFoldRange(n,o,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length,a=t+=1,l=e.getLength();++tu)break;var c=this.getFoldWidgetRange(e,"all",t);if(c){if(c.start.row<=s)break;if(c.isMultiLine())t=c.end.row;else if(r==u)break}a=t}}return new i(s,o,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\s*$/),s=e.getLength(),o=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++no)return new i(o,r,n,t.length)}}.call(o.prototype)}),ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./c_cpp_highlight_rules").c_cppHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&"comment"==s[s.length-1].type)return r;if("start"==e)(a=t.match(/^.*[\{\(\[]\s*$/))&&(r+=n);else if("doc-start"==e){if("start"==o)return"";var a;(a=t.match(/^\s*(\/?)\*/))&&(a[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/c_cpp"}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/glsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/c_cpp_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp_highlight_rules").c_cppHighlightRules,s=function(){var e=this.createKeywordMapper({"variable.language":"this",keyword:"layout|attribute|const|uniform|varying|break|continue|do|for|while|if|else|in|out|inout|float|int|void|bool|true|false|lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|samplerCube|struct","constant.language":"radians|degrees|sin|cos|tan|asin|acos|atan|pow|exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|normalize|faceforward|reflect|refract|matrixCompMult|lessThan|lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|texture2DProjLod|textureCube|textureCubeLod|gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|gl_DepthRangeParameters|gl_DepthRange|gl_Position|gl_PointSize|gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData"},"identifier");this.$rules=(new i).$rules,this.$rules.start.forEach(function(t){"function"==typeof t.token&&(t.token=e)})};r.inherits(s,i),t.glslHighlightRules=s}),ace.define("ace/mode/glsl",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/glsl_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp").Mode,s=e("./glsl_highlight_rules").glslHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.$id="ace/mode/glsl"}.call(u.prototype),t.Mode=u}),ace.require(["ace/mode/glsl"],function(t){e&&(e.exports=t)})},429(e,t,n){e=n.nmd(e),ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.require(["ace/theme/monokai"],function(t){e&&(e.exports=t)})}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r](s,s.exports,n),s.loaded=!0,s.exports}return n.amdD=function(){throw new Error("define cannot be used indirect")},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.nc=void 0,n(832),n(49),n(429),n(902),n(180),n(878)})()); \ No newline at end of file diff --git a/dist/spector.d.ts b/dist/spector.d.ts index b0a836b..396a0b7 100644 --- a/dist/spector.d.ts +++ b/dist/spector.d.ts @@ -808,13 +808,14 @@ export declare class Spector { log(value: string): void; /** * Explicitly opt in to intercepting new Worker() calls to auto-inject Spector. - * Experimental/best-effort: can change Worker behavior and fails for some - * CORS/CSP policies. Module Workers are not injected. Prefer spyWorker(). + * Experimental/best-effort: only simple same-origin classic scripts with + * string URLs and no options are candidates. Module Workers stay native. + * Blob wrapping can still change behavior or fail under CSP. Prefer spyWorker(). * @param workerBundleUrl URL to spector.worker.bundle.js */ spyWorkers(workerBundleUrl?: string): void; /** - * Stop intercepting Worker construction. + * Stop intercepting Worker construction without replacing later third-party wrappers. */ stopSpyingWorkers(): void; /** @@ -825,8 +826,7 @@ export declare class Spector { spyWorker(worker: Worker): WorkerBridge; /** * Capture a frame from a Worker's WebGL context. - * Uses direct postMessage to bypass the main-thread spy chain, - * which ensures a full frame is captured. + * Uses the Worker's bridge to send the request and publish its result once. */ captureWorker(worker: Worker, commandCount?: number, quickCapture?: boolean, fullCapture?: boolean): void; private captureFrames; diff --git a/documentation/apis.md b/documentation/apis.md index bef7783..aec1c30 100644 --- a/documentation/apis.md +++ b/documentation/apis.md @@ -35,12 +35,16 @@ And the following list of events: - ```onError: IEvent```: triggered when an error occured and return the error message. ### Worker / OffscreenCanvas APIs -- ```spyWorkers(workerBundleUrl?: string)``` : Explicitly opt in to experimental, best-effort interception of `new Worker()` calls. Attempts to inject Spector into classic Workers; module Workers are not injected. Recognizable dynamic imports and nested Worker constructions are also bypassed, but source checks cannot establish safety. Blob wrapping, URL/base changes, and constructor interception can alter behavior; CSP/CORS restrictions can prevent injection. Defaults to `"spector.worker.bundle.js"`. Prefer `spyWorker()` when you control the Worker source. -- ```stopSpyingWorkers()``` : Stop intercepting Worker construction. +- ```spyWorkers(workerBundleUrl?: string)``` : Explicitly opt in to experimental, best-effort interception of `new Worker()` calls. Only primitive string URLs for same-origin HTTP(S) classic Workers without options are candidates. URL objects, options (including module Workers), subclasses, redirects, blob/data/cross-origin URLs, strict scripts, and recognizable URL-sensitive sources (`import`, `importScripts`, nested Workers, `location`, `Request`, `fetch`, XHR) use native construction. Inputs are passed to the original constructor without extra coercion or options inspection. Source checks cannot establish safety. Defaults to `"spector.worker.bundle.js"`, resolved against the caller's base URL. Prefer `spyWorker()` when you control the Worker source. +- ```stopSpyingWorkers()``` : Deactivate this interceptor, including retained references to it. Restore the previous constructor only if it is still installed; preserve wrappers installed later by other libraries. - ```spyWorker(worker: Worker): WorkerBridge``` : Manually bridge a specific Worker for capture. This is the recommended API and does not replace the Worker constructor. The Worker must load `spector.worker.bundle.js` via `importScripts` (classic Workers) or `import` (module Workers). - ```captureWorker(worker: Worker, commandCount?: number, quickCapture?: boolean, fullCapture?: boolean)``` : Capture a frame from a Worker's WebGL context. If the Worker hasn't been bridged yet, `spyWorker` is called automatically. -The browser extension's **Auto-inject Workers (experimental)** checkbox is separate from `spyWorkers()` and defaults **off**, even when offscreen canvas capture was previously enabled. It includes OffscreenCanvas Workers and warns that instrumentation may alter behavior. Changes are persisted in page `sessionStorage` (`SPECTOR_WORKERAUTOINJECT`) for the tab/origin session, like the offscreen capture setting, then reload the tab's loaded frames. The MAIN-world content script reads the exact value `"true"` synchronously at `document_start`; there is no asynchronous storage race. Missing/false values leave `window.Worker` untouched, with no wrapper or preflight fetch. Disabling the checkbox restores that behavior on reload. Main-thread canvas capture and manual Worker APIs remain available. +The browser extension's **Auto-inject Workers (experimental)** checkbox is separate from `spyWorkers()` and defaults **off**, even when offscreen canvas capture was previously enabled. It uses the same conservative eligibility rules, includes simple classic OffscreenCanvas Workers, and warns that instrumentation may alter behavior. Changes are persisted in page `sessionStorage` (`SPECTOR_WORKERAUTOINJECT`) for the tab/origin session, like the offscreen capture setting, then reload the tab's loaded frames. The MAIN-world content script reads the exact value `"true"` synchronously at `document_start`; it does not wait for asynchronous extension storage. Missing/false values leave `window.Worker` untouched, with no wrapper or preflight fetch. Disabling the checkbox restores that behavior on reload. Main-thread canvas capture and manual Worker APIs remain available. + +For OffscreenCanvas capture in the extension, select the instrumented **Worker** entry. A transferred DOM canvas alone does not identify its owning Worker, so selecting its canvas entry reports an error instead of guessing which Worker to capture. + +Opt-in is not a compatibility guarantee: source and instrumentation-bundle preflights add synchronous requests, computed API names can evade checks, and blob wrapping still changes the worker global and script error locations. Application responses with CSP or report-only CSP stay native because a blob cannot carry those response policies. Native constructor and preflight failures, including unavailable or non-JavaScript instrumentation bundles, fall back synchronously without creating a blob Worker. A successful XHR preflight does not prove `importScripts` will succeed: it uses different CSP checks and a separate request. Bundle import/execution exceptions are logged in the Worker so the application can still start, but partially executed instrumentation is not rolled back. CSP blocking the blob Worker itself and other asynchronous startup failures cannot transparently replace an already-returned Worker. Module Workers are always native; explicitly import the worker bundle when module capture is needed. No startup message queue or `postMessage` override is installed. As you notice you could use the capture without displying the UI (this is the orientation we chosed in the browser extension). diff --git a/extensions/background.js b/extensions/background.js index 03cd27b..59167f2 100644 --- a/extensions/background.js +++ b/extensions/background.js @@ -89,7 +89,7 @@ browser.action.onClicked.addListener(function (tab) { listenForMessage(function(request, sender, sendResponse) { var frameId; - if (sender.frameId) { + if (typeof sender.frameId === "number") { frameId = sender.frameId; } else if (request.uniqueId) { diff --git a/extensions/contentScript.js b/extensions/contentScript.js index 6575113..53a812f 100644 --- a/extensions/contentScript.js +++ b/extensions/contentScript.js @@ -134,11 +134,12 @@ window.__SPECTOR_Canvases = []; // ---- Worker Interception ---- if (workerAutoInject && typeof Worker !== 'undefined') { var __SPECTOR_Origin_Worker = Worker; + var __SPECTOR_workerAddEventListener = Worker.prototype.addEventListener; window.__SPECTOR_Workers = []; // When a Worker reports its WebGL context is ready, add it to the canvas list var __SPECTOR_trackWorker = function(w, urlStr) { - w.addEventListener('message', function(e) { + __SPECTOR_workerAddEventListener.call(w, 'message', function(e) { if (e.data && typeof e.data.type === 'string') { if (e.data.type === 'spector:context-ready') { // Add Worker as a virtual canvas entry so the extension can see it @@ -155,7 +156,7 @@ window.__SPECTOR_Canvases = []; } if (e.data.type === 'spector:capture-complete') { var captureEvent = new CustomEvent("SpectorOnCaptureEvent", { - detail: { capture: JSON.stringify(e.data.capture) } + detail: { capture: e.data.capture } }); document.dispatchEvent(captureEvent); } @@ -167,156 +168,92 @@ window.__SPECTOR_Canvases = []; // check: aliases, imported scripts, and other syntax can evade this. // Leaving auto-injection OFF is the compatibility guarantee. var __SPECTOR_shouldInjectWorkerSource = function(source) { - var dynamicImportPattern = /\bimport\s*(?:\/\*[\s\S]*?\*\/\s*)?\(/; - var nestedWorkerPattern = /\bnew\s+(?:(?:self|globalThis)\s*\.\s*)?(?:Worker|SharedWorker)\s*\(/; - return !dynamicImportPattern.test(source) && !nestedWorkerPattern.test(source); + // Reject URL-sensitive APIs rather than trying to emulate them on a + // blob global. Token checks also cover comments between tokens and + // ordinary aliases; computed names remain an experimental limitation. + return !/\b(?:import|importScripts|Worker|SharedWorker|location|fetch|Request|XMLHttpRequest|WebSocket|EventSource|crossOriginIsolated|SharedArrayBuffer|Atomics|WebAssembly|eval|Function)\b|\\u|["']use strict["']|^(?:\uFEFF)?#!/.test(source); }; - window.Worker = function SpectorWorkerProxy(scriptURL, options) { - // Get the Spector worker bundle URL from the hidden element injected - // by contentScriptProxy.js (ISOLATED world -> DOM -> MAIN world). - var workerBundleEl = document.getElementById('TexturesId_SpectorWorkerBundleUrl'); - var bundleUrl = workerBundleEl ? workerBundleEl.value : ''; - if (bundleUrl) { - try { - bundleUrl = new URL(bundleUrl, location.href).href; - } catch (e) { - bundleUrl = ''; - } - } - - // Module Worker injection is only attempted after the explicit - // experimental opt-in. The injector preserves static relative - // imports and falls back to native construction for URL-sensitive - // module sources it cannot safely rewrite. - if (options && options.type === 'module') { - var urlStr = typeof scriptURL === 'string' ? scriptURL : 'module Worker'; - var moduleResult = window.__SPECTOR_ModuleInjector - ? window.__SPECTOR_ModuleInjector.injectModuleWorker( - scriptURL, options, bundleUrl, __SPECTOR_Origin_Worker) - : { worker: new __SPECTOR_Origin_Worker(scriptURL, options), injected: false }; - var w = moduleResult.worker; - window.__SPECTOR_Workers.push({ worker: w, url: urlStr, injected: moduleResult.injected }); - __SPECTOR_trackWorker(w, urlStr); - return w; - } - - var urlStr = scriptURL.toString(); + var __SPECTOR_isJavaScriptResponse = function(xhr, requestedUrl) { + var mime = (xhr.getResponseHeader('Content-Type') || '').split(';')[0].trim(); + return xhr.status === 200 && xhr.responseURL === requestedUrl && + /^(?:text|application)\/(?:x-)?(?:java|ecma)script$/i.test(mime); + }; - // Skip blob URLs — can't XHR them for injection. The blob code may - // already include importScripts for the worker bundle. - if (urlStr.indexOf('blob:') === 0) { - var w = new __SPECTOR_Origin_Worker(scriptURL, options); - window.__SPECTOR_Workers.push({ worker: w, url: urlStr, injected: false }); - __SPECTOR_trackWorker(w, urlStr); - return w; - } + var workerProxy = new Proxy(__SPECTOR_Origin_Worker, { + construct: function(target, args, newTarget) { + var scriptURL = args[0]; + var urlStr = typeof scriptURL === 'string' ? scriptURL : 'Worker'; + var record = function(worker, injected) { + window.__SPECTOR_Workers.push({ worker: worker, url: urlStr, injected: injected }); + __SPECTOR_trackWorker(worker, urlStr); + return worker; + }; + var fallback = function() { + return record(Reflect.construct(target, args, newTarget), false); + }; + + // Never inspect options or coerce objects: WebIDL does that in + // a specified order, and even inspecting a Proxy has side effects. + // Proxy forwards calls without `new`, statics and descriptors; + // Reflect.construct preserves subclassing and original arguments. + if (newTarget !== workerProxy || typeof scriptURL !== 'string' || + args.length > 2 || args[1] !== undefined) { + return fallback(); + } - try { - // Resolve to absolute so we can fetch and use as base URL - // for runtime URL rewriting inside the blob worker. - var absoluteScriptUrl; + // Get the bundle URL bridged from the ISOLATED world via the DOM. + var workerBundleEl = document.getElementById('TexturesId_SpectorWorkerBundleUrl'); + var bundleUrl = workerBundleEl ? workerBundleEl.value : ''; + var blobUrl; try { - absoluteScriptUrl = new URL(urlStr, location.href).href; - } catch (e) { - absoluteScriptUrl = urlStr; + var absoluteScriptUrl = new URL(scriptURL, document.baseURI); + if (bundleUrl && /^https?:$/.test(absoluteScriptUrl.protocol) && + absoluteScriptUrl.origin === location.origin) { + bundleUrl = new URL(bundleUrl, document.baseURI).href; + absoluteScriptUrl.hash = ''; + var xhr = new XMLHttpRequest(); + xhr.open('GET', absoluteScriptUrl.href, false); + xhr.send(); + // Redirects and non-JavaScript responses must retain the + // native loader's URL, MIME, CSP and origin validation. + if (__SPECTOR_isJavaScriptResponse(xhr, absoluteScriptUrl.href) && + !xhr.getResponseHeader('Content-Security-Policy') && + !xhr.getResponseHeader('Content-Security-Policy-Report-Only') && + __SPECTOR_shouldInjectWorkerSource(xhr.responseText)) { + var bundleXhr = new XMLHttpRequest(); + bundleXhr.open('GET', bundleUrl, false); + bundleXhr.send(); + var bundleAvailable = __SPECTOR_isJavaScriptResponse(bundleXhr, bundleUrl); + if (bundleAvailable) { + // Preflight cannot predict script-src checks or + // bundle execution failures inside the Worker. + var importLine = 'try { importScripts(' + JSON.stringify(bundleUrl) + + '); } catch (e) { console.warn("[Spector.js] Worker auto-injection failed:", e); }\n'; + blobUrl = URL.createObjectURL(new Blob([importLine, xhr.responseText], + { type: 'application/javascript' })); + } + } + } + } catch(e) { + console.warn("[Spector.js] Could not auto-inject into Worker (" + urlStr + "):", e); } - var xhr = new XMLHttpRequest(); - xhr.open('GET', absoluteScriptUrl, false); - xhr.send(); - - if (xhr.status === 200 && __SPECTOR_shouldInjectWorkerSource(xhr.responseText)) { - if (bundleUrl) { - // Runtime shim: when a worker is loaded from a blob: - // URL, `self.location.href` is the blob URL — which - // means every relative URL passed to importScripts, - // fetch, XMLHttpRequest, or new Worker resolves against - // it and breaks (root-relative URLs throw "URL is - // invalid"; relative URLs become blob:scheme paths). - // We wrap each of those APIs to resolve URLs against - // the worker's ORIGINAL location before delegating to - // the real implementation. - var runtimeShim = - '(function(){\n' + - ' var __spectorBase = ' + JSON.stringify(absoluteScriptUrl) + ';\n' + - ' self.__SPECTOR_workerBaseUrl = __spectorBase;\n' + - ' function __spectorResolve(u) {\n' + - ' if (u == null) return u;\n' + - ' if (typeof u !== "string") {\n' + - ' if (u instanceof URL) return u;\n' + - ' try { u = String(u); } catch (e) { return u; }\n' + - ' }\n' + - ' if (/^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i.test(u)) return u;\n' + - ' try { return new URL(u, __spectorBase).href; }\n' + - ' catch (e) { return u; }\n' + - ' }\n' + - ' self.__SPECTOR_resolveWorkerUrl = __spectorResolve;\n' + - // importScripts (variadic) - ' var __origImportScripts = self.importScripts;\n' + - ' if (typeof __origImportScripts === "function") {\n' + - ' self.importScripts = function() {\n' + - ' var args = new Array(arguments.length);\n' + - ' for (var i = 0; i < arguments.length; i++) args[i] = __spectorResolve(arguments[i]);\n' + - ' return __origImportScripts.apply(self, args);\n' + - ' };\n' + - ' }\n' + - // fetch - ' var __origFetch = self.fetch;\n' + - ' if (typeof __origFetch === "function") {\n' + - ' self.fetch = function(input, init) {\n' + - ' try {\n' + - ' if (typeof input === "string") {\n' + - ' input = __spectorResolve(input);\n' + - ' } else if (input && typeof input === "object" && "url" in input && typeof Request === "function") {\n' + - ' var r = input;\n' + - ' var resolved = __spectorResolve(r.url);\n' + - ' if (resolved !== r.url) input = new Request(resolved, r);\n' + - ' }\n' + - ' } catch (e) { /* fall through with original input */ }\n' + - ' return __origFetch.call(self, input, init);\n' + - ' };\n' + - ' }\n' + - // XMLHttpRequest.open - ' if (typeof XMLHttpRequest === "function" && XMLHttpRequest.prototype && XMLHttpRequest.prototype.open) {\n' + - ' var __origXhrOpen = XMLHttpRequest.prototype.open;\n' + - ' XMLHttpRequest.prototype.open = function(method, url) {\n' + - ' var args = Array.prototype.slice.call(arguments);\n' + - ' args[1] = __spectorResolve(url);\n' + - ' return __origXhrOpen.apply(this, args);\n' + - ' };\n' + - ' }\n' + - // Nested Worker construction (workers can spawn workers) - ' if (typeof Worker === "function") {\n' + - ' var __OrigWorker = Worker;\n' + - ' self.Worker = function(scriptURL, options) {\n' + - ' var resolved = __spectorResolve(scriptURL);\n' + - ' return new __OrigWorker(resolved, options);\n' + - ' };\n' + - ' self.Worker.prototype = __OrigWorker.prototype;\n' + - ' }\n' + - '})();\n'; - - var importLine = 'importScripts(' + JSON.stringify(bundleUrl) + ');\n'; - var modifiedScript = runtimeShim + importLine + xhr.responseText; - var blob = new Blob([modifiedScript], { type: 'application/javascript' }); - var blobUrl = URL.createObjectURL(blob); - var w = new __SPECTOR_Origin_Worker(blobUrl, options); - window.__SPECTOR_Workers.push({ worker: w, url: urlStr, injected: true }); - __SPECTOR_trackWorker(w, urlStr); - return w; + if (blobUrl) { + var worker; + try { + worker = Reflect.construct(target, [blobUrl], newTarget); + } catch (e) { + URL.revokeObjectURL(blobUrl); + return fallback(); } + setTimeout(function() { URL.revokeObjectURL(blobUrl); }, 5000); + return record(worker, true); } - } catch(e) { - console.warn("[Spector.js] Could not auto-inject into Worker (" + urlStr + "):", e); + return fallback(); } - - var w = new __SPECTOR_Origin_Worker(scriptURL, options); - window.__SPECTOR_Workers.push({ worker: w, url: urlStr, injected: false }); - __SPECTOR_trackWorker(w, urlStr); - return w; - }; - window.Worker.prototype = __SPECTOR_Origin_Worker.prototype; + }); + window.Worker = workerProxy; } HTMLCanvasElement.prototype.getContext = function () { @@ -423,22 +360,12 @@ if (sessionStorage.getItem(spectorLoadedKey)) { } var quickCapture = (document.getElementById(spectorCommunicationQuickCaptureElementId).value === "true"); var fullCapture = (document.getElementById(spectorCommunicationFullCaptureElementId).value === "true"); - var commandCount = 0 + document.getElementById(spectorCommunicationCommandCountElementId).value; + var commandCount = parseInt(document.getElementById(spectorCommunicationCommandCountElementId).value, 10) || 0; // Route Worker proxy entries — send trigger directly to Worker if (canvas && canvas.__spector_worker) { var worker = canvas.__spector_worker; - worker.addEventListener('message', function captureHandler(msg) { - if (msg.data && msg.data.type === 'spector:capture-complete') { - worker.removeEventListener('message', captureHandler); - var captureEvent = new CustomEvent("SpectorOnCaptureEvent", { - detail: { capture: msg.data.capture } - }); - document.dispatchEvent(captureEvent); - } - }); - worker.postMessage({ type: 'spector:trigger-capture', version: 1, @@ -448,50 +375,14 @@ if (sessionStorage.getItem(spectorLoadedKey)) { fullCapture: fullCapture }); } else if (canvas && canvas.__spector_transferred) { - // Transferred canvas without __spector_worker — try to find - // and link a tracked Worker. - var linkedWorker = null; - if (window.__SPECTOR_Workers) { - for (var wi = 0; wi < window.__SPECTOR_Workers.length; wi++) { - var entry = window.__SPECTOR_Workers[wi]; - if (entry.injected) { - linkedWorker = entry.worker; - break; - } - } - } - - if (linkedWorker) { - // Injected Worker found — try capture - canvas.__spector_worker = linkedWorker; - - linkedWorker.addEventListener('message', function captureHandler(msg) { - if (msg.data && msg.data.type === 'spector:capture-complete') { - linkedWorker.removeEventListener('message', captureHandler); - var captureEvent = new CustomEvent("SpectorOnCaptureEvent", { - detail: { capture: msg.data.capture } - }); - document.dispatchEvent(captureEvent); - } - }); - - linkedWorker.postMessage({ - type: 'spector:trigger-capture', - version: 1, - canvasIndex: 0, - commandCount: commandCount, - quickCapture: quickCapture, - fullCapture: fullCapture - }); - } else { - // No injected Worker — capture not possible - var errorEvent = new CustomEvent("SpectorOnErrorEvent", { - detail: { errorString: "Cannot capture: this Worker is not instrumented. " + - "Worker auto-injection is off by default and, when enabled, is experimental and may skip or fail on this Worker. " + - "Use the manual spyWorker() API with spector.worker.bundle.js loaded inside the Worker." } - }); - document.dispatchEvent(errorEvent); - } + // The transferred canvas does not identify its owning Worker. + // Never send a capture request to an unrelated injected Worker. + var errorEvent = new CustomEvent("SpectorOnErrorEvent", { + detail: { errorString: "Cannot capture from this canvas: its Worker is unknown. " + + "Select the instrumented Worker entry instead, or load spector.worker.bundle.js " + + "inside the Worker and use the manual spyWorker() API." } + }); + document.dispatchEvent(errorEvent); } else if (canvas) { spector.captureCanvas(canvas, commandCount, quickCapture, fullCapture); } diff --git a/extensions/contentScriptProxy.js b/extensions/contentScriptProxy.js index 2379c9a..69b8588 100644 --- a/extensions/contentScriptProxy.js +++ b/extensions/contentScriptProxy.js @@ -155,10 +155,10 @@ var refreshCanvases = function() { document.dispatchEvent(myEvent); } else { // Spector not loaded — fall back to DOM scan only. + var canvasesInformation = []; if (document.body) { var canvasElements = document.body.querySelectorAll("canvas"); if (canvasElements.length > 0) { - var canvasesInformation = []; for (var i = 0; i < canvasElements.length; i++) { var canvas = canvasElements[i]; var context = null; @@ -177,13 +177,13 @@ var refreshCanvases = function() { }); } } - if (canvasesInformation.length > 0) { - sendMessage({ canvases: canvasesInformation, captureOffScreen: false, workerAutoInject: workerAutoInject }, function (response) { - frameId = response.frameId; - }); - } } } + // Settings belong to the frame, not its canvases. Always report an + // empty list too, so a canvas-free top frame can clear stale popup state. + sendMessage({ canvases: canvasesInformation, captureOffScreen: false, workerAutoInject: workerAutoInject }, function (response) { + frameId = response.frameId; + }); } } diff --git a/extensions/manifest.json b/extensions/manifest.json index 2b4b719..5edfe8c 100644 --- a/extensions/manifest.json +++ b/extensions/manifest.json @@ -39,7 +39,7 @@ "http://*/*", "https://*/*" ], - "js" : ["spector.bundle.func.js", "moduleWorkerInjector.js", "contentScript.js"], + "js" : ["spector.bundle.func.js", "contentScript.js"], "run_at" : "document_start", "all_frames" : true, "world": "MAIN" diff --git a/extensions/moduleWorkerInjector.js b/extensions/moduleWorkerInjector.js index 062a0d1..4a3d302 100644 --- a/extensions/moduleWorkerInjector.js +++ b/extensions/moduleWorkerInjector.js @@ -1,287 +1,28 @@ /** - * Module Worker Injector for Spector.js + * Compatibility entry point for callers of the experimental module injector. * - * Handles injection of the Spector worker bundle into ES module workers - * (`new Worker(url, { type: 'module' })`). - * - * The core challenge: module workers forbid `importScripts()`, and blob-wrapped - * modules lose their original base URL — breaking all relative `import` paths. - * - * Solution: inspect the original entry point, inline the Spector bundle in a - * loader module, queue messages while dynamically importing the original - * module at its real URL, then replay those messages after its handlers exist. + * A blob loader cannot preserve the worker global's URL, relative Request and + * nested Worker resolution, or native startup messaging while importing the + * application asynchronously. Modules must load Spector explicitly instead. */ - var SpectorModuleInjector = (function () { "use strict"; /** - * Resolves a relative or bare import specifier against a base URL. - * Only rewrites specifiers that start with './' or '../'. - * Leaves absolute URLs and bare specifiers (npm-style) untouched. - * - * @param {string} specifier - The import specifier (e.g. './engine.js') - * @param {string} baseUrl - The base URL of the original script - * @returns {string} The resolved absolute URL, or the original specifier - */ - function resolveSpecifier(specifier, baseUrl) { - if (specifier.startsWith('./') || specifier.startsWith('../')) { - try { - return new URL(specifier, baseUrl).href; - } catch (e) { - return specifier; - } - } - // Absolute URLs and bare specifiers pass through unchanged - return specifier; - } - - /** - * Rewrites all static import/export specifiers in ES module source code - * from relative paths to absolute URLs. - * - * Handles: - * - import { x } from './foo.js' - * - import './side-effect.js' - * - import x from "../bar.js" - * - export { y } from './baz.js' - * - export * from './qux.js' - * - import( './dynamic.js' ) (dynamic imports) - * - import x from './foo.js' assert { type: 'json' } - * - * Does NOT handle: - * - Template literal import specifiers: import(`./dir/${name}.js`) - * - Computed dynamic imports with non-string arguments - * - Import maps (these are handled by the browser after rewriting) - * - * @param {string} source - The original module source code - * @param {string} baseUrl - The base URL for resolving relative specifiers - * @returns {string} The source with relative specifiers replaced by absolute URLs - */ - function rewriteImports(source, baseUrl) { - // Match static imports/exports: from '...' or from "..." - // Captures the specifier in group 1 (single-quoted) or group 2 (double-quoted) - var staticPattern = /((?:import|export)\s+(?:[\s\S]*?\s+)?from\s+)(?:'([^']+)'|"([^"]+)")/g; - - source = source.replace(staticPattern, function (match, prefix, specSingle, specDouble) { - var spec = specSingle || specDouble; - var quote = specSingle ? "'" : '"'; - var resolved = resolveSpecifier(spec, baseUrl); - return prefix + quote + resolved + quote; - }); - - // Match side-effect imports: import './foo.js' or import "./foo.js" - // (import keyword followed directly by a string, no `from`) - var sideEffectPattern = /(import\s+)(?:'([^']+)'|"([^"]+)")/g; - - source = source.replace(sideEffectPattern, function (match, prefix, specSingle, specDouble) { - var spec = specSingle || specDouble; - var quote = specSingle ? "'" : '"'; - var resolved = resolveSpecifier(spec, baseUrl); - return prefix + quote + resolved + quote; - }); - - // Match dynamic imports: import('./foo.js') or import("./foo.js") - // Careful not to match import.meta or other import.xxx - var dynamicPattern = /import\s*\(\s*(?:'([^']+)'|"([^"]+)")\s*\)/g; - - source = source.replace(dynamicPattern, function (match, specSingle, specDouble) { - var spec = specSingle || specDouble; - var quote = specSingle ? "'" : '"'; - var resolved = resolveSpecifier(spec, baseUrl); - return 'import(' + quote + resolved + quote + ')'; - }); - - return source; - } - - /** - * Direct nested Worker construction may resolve relative URLs against the - * loader blob instead of the original module. Leave those entries native. - */ - function canSafelyInject(source) { - var nestedWorkerPattern = /\bnew\s+(?:(?:self|globalThis)\s*\.\s*)?(?:Worker|SharedWorker)\s*\(/; - return !nestedWorkerPattern.test(source); - } - - /** - * Attempts to inject the Spector worker bundle into a module worker. - * - * Strategy: - * 1. Synchronously fetch the original worker script - * 2. Reject direct nested Worker construction that depends on blob-relative URLs - * 3. Synchronously fetch the Spector worker bundle - * 4. Create a blob loader module that: - * a. Initializes Spector - * b. Queues startup messages - * c. Imports the original module from its absolute URL - * d. Signals that application handlers are installed - * e. Replays any Worker-side startup messages - * 5. Create the Worker and queue main-thread postMessage calls until ready - * - * The bundle is fetched in the page and inlined because Chromium can leave - * a blob module Worker pending when it imports a chrome-extension URL. - * - * @param {string} scriptURL - The original worker script URL - * @param {object} options - The original Worker options (includes type: 'module') - * @param {string} bundleUrl - Absolute URL to spector.worker.bundle.js - * @param {function} OriginalWorker - The original Worker constructor - * @returns {{ worker: Worker, injected: boolean }} The created worker and injection status + * Construct a native module Worker without inspecting or converting inputs. + * @param {string|URL} scriptURL - Original Worker URL + * @param {object} options - Original Worker options + * @param {string} bundleUrl - Retained for compatibility; unused + * @param {function} OriginalWorker - Original Worker constructor + * @returns {{ worker: Worker, injected: boolean }} Native Worker and status */ function injectModuleWorker(scriptURL, options, bundleUrl, OriginalWorker) { - var urlStr = scriptURL.toString(); - - // Resolve the script URL to absolute for use as base URL - var absoluteScriptUrl; - try { - absoluteScriptUrl = new URL(urlStr, location.href).href; - } catch (e) { - // Can't resolve — fall back to no injection - return { worker: new OriginalWorker(scriptURL, options), injected: false }; - } - - // Skip blob URLs — their original module URL cannot be recovered. - if (urlStr.indexOf('blob:') === 0) { - return { worker: new OriginalWorker(scriptURL, options), injected: false }; - } - - // Skip data URLs - if (urlStr.indexOf('data:') === 0) { - return { worker: new OriginalWorker(scriptURL, options), injected: false }; - } - - if (!bundleUrl) { - return { worker: new OriginalWorker(scriptURL, options), injected: false }; - } - - if (new URL(absoluteScriptUrl).origin !== location.origin) { - return { worker: new OriginalWorker(scriptURL, options), injected: false }; - } - - try { - // Synchronously fetch the original worker script - var xhr = new XMLHttpRequest(); - xhr.open('GET', absoluteScriptUrl, false); - xhr.send(); - - if (xhr.status !== 200) { - return { worker: new OriginalWorker(scriptURL, options), injected: false }; - } - - var originalSource = xhr.responseText; - if (!canSafelyInject(originalSource)) { - return { worker: new OriginalWorker(scriptURL, options), injected: false }; - } - - var bundleXhr = new XMLHttpRequest(); - bundleXhr.open('GET', bundleUrl, false); - bundleXhr.send(); - if (bundleXhr.status !== 200) { - return { worker: new OriginalWorker(scriptURL, options), injected: false }; - } - - var resolvedScriptUrl = xhr.responseURL || absoluteScriptUrl; - - // Dynamic module import allows the application's relative imports - // and import.meta.url to retain their native URL semantics. Worker - // messages can be dispatched while top-level await is pending, so - // hold and replay them once the application module has evaluated. - var runtimeShim = - '(function(){\n' + - ' var __spectorBase = ' + JSON.stringify(resolvedScriptUrl) + ';\n' + - ' self.__SPECTOR_workerBaseUrl = __spectorBase;\n' + - ' function __spectorResolve(url) {\n' + - ' if (url == null || typeof url !== "string" || /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i.test(url)) return url;\n' + - ' try { return new URL(url, __spectorBase).href; } catch (e) { return url; }\n' + - ' }\n' + - ' self.__SPECTOR_resolveWorkerUrl = __spectorResolve;\n' + - ' var __originalFetch = self.fetch;\n' + - ' if (typeof __originalFetch === "function") {\n' + - ' self.fetch = function(input, init) {\n' + - ' try {\n' + - ' if (typeof input === "string") {\n' + - ' input = __spectorResolve(input);\n' + - ' } else if (input && typeof input === "object" && "url" in input && typeof Request === "function") {\n' + - ' var request = input;\n' + - ' var resolved = __spectorResolve(request.url);\n' + - ' if (resolved !== request.url) input = new Request(resolved, request);\n' + - ' }\n' + - ' } catch (e) { /* use the original input */ }\n' + - ' return __originalFetch.call(self, input, init);\n' + - ' };\n' + - ' }\n' + - ' if (typeof XMLHttpRequest === "function" && XMLHttpRequest.prototype.open) {\n' + - ' var __originalXhrOpen = XMLHttpRequest.prototype.open;\n' + - ' XMLHttpRequest.prototype.open = function(method, url) {\n' + - ' var args = Array.prototype.slice.call(arguments);\n' + - ' args[1] = __spectorResolve(url);\n' + - ' return __originalXhrOpen.apply(this, args);\n' + - ' };\n' + - ' }\n' + - '})();\n'; - var blobContent = - '/* Spector.js module worker injection */\n' + - bundleXhr.responseText + '\n' + - runtimeShim + - 'var __spectorQueuedMessages = [];\n' + - 'var __spectorQueueMessage = function(event) { __spectorQueuedMessages.push(event); };\n' + - 'self.addEventListener("message", __spectorQueueMessage);\n' + - 'try {\n' + - ' await import(' + JSON.stringify(resolvedScriptUrl) + ');\n' + - '} finally {\n' + - ' self.removeEventListener("message", __spectorQueueMessage);\n' + - '}\n' + - 'self.postMessage({ type: "spector:module-ready", version: 1 });\n' + - 'for (var __spectorMessageIndex = 0; __spectorMessageIndex < __spectorQueuedMessages.length; __spectorMessageIndex++) {\n' + - ' self.dispatchEvent(__spectorQueuedMessages[__spectorMessageIndex]);\n' + - '}\n'; - - var blob = new Blob([blobContent], { type: 'application/javascript' }); - var blobUrl = URL.createObjectURL(blob); - - var worker = new OriginalWorker(blobUrl, options); - var originalPostMessage = worker.postMessage; - var queuedPostMessages = []; - var moduleReady = false; - worker.postMessage = function () { - if (moduleReady) { - return originalPostMessage.apply(worker, arguments); - } - queuedPostMessages.push(Array.prototype.slice.call(arguments)); - }; - worker.addEventListener('message', function moduleReadyHandler(event) { - if (!event.data || event.data.type !== 'spector:module-ready') { - return; - } - event.stopImmediatePropagation(); - worker.removeEventListener('message', moduleReadyHandler); - moduleReady = true; - for (var i = 0; i < queuedPostMessages.length; i++) { - originalPostMessage.apply(worker, queuedPostMessages[i]); - } - queuedPostMessages.length = 0; - }); - - // Revoke after a delay — the browser needs time to fetch the blob - setTimeout(function () { URL.revokeObjectURL(blobUrl); }, 5000); - - return { worker: worker, injected: true }; - - } catch (e) { - // CORS, CSP, or other fetch failure — fall back gracefully - return { worker: new OriginalWorker(scriptURL, options), injected: false }; - } + return { worker: new OriginalWorker(scriptURL, options), injected: false }; } - return { - rewriteImports: rewriteImports, - resolveSpecifier: resolveSpecifier, - canSafelyInject: canSafelyInject, - injectModuleWorker: injectModuleWorker, - }; + return { injectModuleWorker: injectModuleWorker }; })(); -// Make available globally for contentScript.js if (typeof window !== 'undefined') { window.__SPECTOR_ModuleInjector = SpectorModuleInjector; } diff --git a/extensions/popup.js b/extensions/popup.js index d5dbf4d..8fe94a9 100644 --- a/extensions/popup.js +++ b/extensions/popup.js @@ -286,7 +286,7 @@ var pause = function(e) { listenForMessage(function(request, sender, sendResponse) { var frameId; - if (sender.frameId) { + if (typeof sender.frameId === "number") { frameId = sender.frameId; } else if (request.uniqueId) { diff --git a/extensions/spector.bundle.func.js b/extensions/spector.bundle.func.js index a24e908..4bb6234 100644 --- a/extensions/spector.bundle.func.js +++ b/extensions/spector.bundle.func.js @@ -1,5 +1,5 @@ var spectorBundleHook = function(){ /*! For license information please see spector.bundle.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("SPECTOR",[],t):"object"==typeof exports?exports.SPECTOR=t():e.SPECTOR=t()}(self,()=>(()=>{var e={377(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.captureMenuComponent{position:absolute;padding:7px;z-index:99999;top:10px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuComponent.active{visibility:visible;display:block}.captureMenuComponent,.captureMenuComponent:after,.captureMenuComponent:before{box-sizing:content-box}.captureMenuLogComponent{position:absolute;padding:7px;z-index:80000;top:66px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuLogComponent.active{visibility:visible;display:block}.captureMenuLogComponent,.captureMenuLogComponent:after,.captureMenuLogComponent:before{box-sizing:content-box}.captureMenuLogComponent span.error{color:red}.canvasListComponent{float:left;width:50%;height:100%}.canvasListComponent [commandName=onCanvasSelection]{vertical-align:center;line-height:40px;white-space:nowrap;text-overflow:ellipsis;width:190px;display:inline-block;overflow:hidden;margin:0px 5px}.canvasListComponent [commandName=onCanvasSelection]:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.canvasListComponent ul{margin:0px;padding:7px;list-style:none;position:absolute;top:54px;left:-2px;width:400px;border:2px solid #222;background-color:#2c2c2c}.canvasListComponent ul li{margin:5px}.canvasListComponent ul li:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.captureMenuActionsComponent{float:left;width:30%;height:100%;margin-top:7.5px}.captureMenuActionsComponent div{float:left}.captureMenuActionsComponent [commandName=onCaptureRequested]{border-radius:50%;background:#2c2c2c;border:2px solid red;width:21px;height:21px}.captureMenuActionsComponent [commandName=onCaptureRequested]:hover{background:red;cursor:pointer;transition:background .3s;-webkit-transition:background .3s;-moz-transition:background .3s}.captureMenuActionsComponent [commandName=onPlayRequested],.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPlayRequested]:before,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{content:"";position:absolute;display:inline-block;margin-top:6px;margin-left:4px;width:7px;height:7px;border-top:2px solid #f9f9f9;border-right:2px solid #f9f9f9;background-color:#f9f9f9;-moz-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg);z-index:-20}.captureMenuActionsComponent [commandName=onPlayRequested]:after,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:after{content:"";position:absolute;display:inline-block;width:8px;height:20px;background-color:#2c2c2c;z-index:-10}.captureMenuActionsComponent [commandName=onPlayRequested]:hover,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPauseRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPauseRequested]:before{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:12px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:after{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:7px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{background-color:#2c2c2c}.fpsCounterComponent{float:left;width:20%;vertical-align:center;line-height:40px;white-space:nowrap}',""]);const a=o},160(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.resultViewComponent{position:absolute;z-index:99999;border:1px solid #000;top:0;left:0;bottom:0;right:0;background-color:#222;opacity:1;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.resultViewComponent.active{visibility:visible;display:block}.resultViewComponent,.resultViewComponent:after,.resultViewComponent:before{box-sizing:content-box}.resultViewMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.resultViewMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.resultViewMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.resultViewMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.resultViewMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.resultViewMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.resultViewMenuComponent a.clearSearch{padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.resultViewMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}@media all and (max-width: 1024px){.resultViewMenuComponent .resultViewMenuOpen{display:block;visibility:visible}.resultViewMenuComponent li:not(.resultViewMenuSmall){display:none;visibility:hidden}.resultViewMenuComponent li{background:#2c2c2c}.resultViewMenuComponent li.searchContainer{background:rgb(69.5,69.5,69.5)}.resultViewMenuComponent{padding:0px;position:absolute;overflow-y:visible;top:0px;left:0px;right:0px;bottom:0px;z-index:999999;display:block}.resultViewMenuComponent a.active{background:#2c2c2c}}.resultViewMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:40px;position:relative;top:-1px;box-sizing:border-box}.resultViewMenuComponent input:focus{border:0;outline:0 none}.resultViewMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.resultViewMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.resultViewMenuComponent ::-webkit-input-placeholder{color:#ccc}.resultViewMenuComponent :-moz-placeholder{color:#ccc}.resultViewMenuComponent ::-moz-placeholder{color:#ccc}.resultViewMenuComponent :-ms-input-placeholder{color:#ccc}.resultViewContentComponent{position:absolute;top:40px;left:0;bottom:0;right:0}.informationColumnLeftComponent{position:absolute;top:0;left:0;bottom:0;right:50%;overflow:auto;overflow-x:hidden;overflow-y:visible}.informationColumnRightComponent{position:absolute;top:0;left:50%;bottom:0;right:0;overflow:auto;overflow-x:hidden;overflow-y:visible}.captureListComponent{position:absolute;top:40px;left:0;bottom:0;right:0;background:#222;z-index:9000;display:none;visibility:hidden;overflow-y:visible;overflow-x:hidden}.captureListComponent.active{display:block;visibility:visible}.captureListComponent .openCaptureFile{border:1px dashed #f9f9f9;display:block;margin:5px;padding:5px;text-align:center;font-style:italic}.captureListComponent .openCaptureFile span{line-height:100%;vertical-align:middle}.captureListComponent ul{margin:0px;padding:0px;list-style:none;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-start}.captureListComponent ul li{margin:5px;border:1px solid #606060}.captureListComponent ul li img{width:295px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;display:block}.captureListComponent ul li span{display:block;text-align:center;border:5px solid #222}.captureListComponent ul li span .captureListItemSave{color:#f9f9f9;font-size:16px;margin-left:10px;position:relative;padding:3px 8px 3px 32px}.captureListComponent ul li span .captureListItemSave:before,.captureListComponent ul li span .captureListItemSave:after{box-sizing:border-box;content:"";position:absolute}.captureListComponent ul li span .captureListItemSave:before{background:#222;border-color:#f9f9f9;border-style:solid;border-width:7px 2px 1px;border-radius:1px;height:16px;left:8px;top:5px;width:16px}.captureListComponent ul li span .captureListItemSave:after{background:#f9f9f9;border-color:#d9d9d9;border-style:solid;border-width:1px 1px 1px 4px;height:5px;left:13px;top:5px;width:7px}.captureListComponent ul li:hover{cursor:pointer}.captureListComponent ul li.active span{background:#f0640d;border:5px solid #f0640d}.captureListComponent ul li.active span .captureListItemSave:before{background:#f0640d}.captureListComponent ul li.active span .captureListItemSave:after{border-color:#f0640d}.visualStateListComponent{position:absolute;top:0;left:0;bottom:0;padding:5px;right:80%;overflow-y:visible;overflow-x:hidden}.visualStateListComponent ul{margin:0px;padding:0px;list-style:none}.visualStateListComponent ul li{margin:20px 15px 0px 15px;border:1px solid #606060}.visualStateListComponent ul li img{display:block;padding:0px;box-sizing:border-box;max-height:600px;width:100%;margin:0 auto;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.visualStateListComponent ul li:hover{cursor:pointer}.visualStateListComponent ul li span{border:5px solid #222;background:#222;box-sizing:border-box;display:inline-block;width:100%;margin:0px;padding:5px;word-wrap:break-word}.visualStateListComponent ul li.active{border:2px solid #f0640d}.commandListComponent{position:absolute;top:0;left:20%;right:40%;bottom:0;color:hsl(0,0%,82.6470588235%)}.commandListComponent ul{margin:0px;padding:0px;list-style:none;overflow-y:visible;overflow-x:hidden;height:100%}.commandListComponent ul li{padding:8px}.commandListComponent ul li span{word-wrap:break-word;line-height:22px}.commandListComponent ul li:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.commandListComponent ul li:nth-child(even){background:#2c2c2c}.commandListComponent ul li:nth-child(odd){background:#222}.commandListComponent ul li .important{font-weight:800}.commandListComponent ul li .important.deprecated{color:red}.commandListComponent ul li .important.unused{color:#ff0}.commandListComponent ul li .important.disabled{color:gray}.commandListComponent ul li .important.redundant{color:orange}.commandListComponent ul li .important.valid{color:#adff2f}.commandListComponent ul li .marker{font-size:16px;font-weight:900;color:#adff2f}.commandListComponent ul li.active{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.commandListComponent ul li.drawCall{background:#5db0d7;color:#222}.commandListComponent ul li a{margin-left:5px;margin-right:5px;color:#5db0d7;background:#222;padding:5px;font-weight:900;display:inline-block}.commandDetailComponent{position:absolute;top:0;left:60%;right:0;bottom:0;overflow-y:visible;overflow-x:hidden}.jsonGroupComponent{display:block;margin:10px;padding:10px;padding-bottom:5px}.jsonGroupComponent .jsonGroupComponentTitle{display:block;font-size:16px;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:5px;margin-bottom:5px;text-transform:capitalize}.jsonGroupComponent ul{margin:0px;padding:0px;list-style:none}.jsonGroupComponent ul li:nth-child(even){background:#222}.jsonGroupComponent ul li:nth-child(odd){background:#222}.jsonItemComponentKey{color:#f0640d}.jsonItemComponentValue{white-space:pre-wrap}.jsonItemImageHolder{width:50%;margin:auto}.jsonItemImageHolder .jsonItemImage{margin:5px;display:block;border:1px solid #606060;width:100%}.jsonItemImageHolder .jsonItemImage img{width:100%;display:block;margin:auto;max-width:256px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.jsonItemImageHolder .jsonItemImage span{margin:0px;padding:5px;word-wrap:break-word;display:inline-block;width:100%;box-sizing:border-box}[commandName=onOpenSourceClicked]:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.jsonVisualStateItemComponent{text-align:center;padding:10px}.jsonVisualStateItemComponent img{background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;border:1px solid #606060;margin:5px;width:100%;max-width:512px;max-height:800px}.jsonVisualStateItemComponent span{display:block}.jsonContentComponent{position:absolute;top:0;left:0;right:0;bottom:0;padding:10px;overflow-y:visible;overflow-x:hidden}.jsonItemComponentValue{word-break:break-all;white-space:normal}.jsonSourceItemComponentOpen{font-weight:bold;color:#5db0d7;text-decoration:underline}.sourceCodeMenuComponentContainer{position:absolute;left:0;top:0;bottom:48px;right:40%}.sourceCodeMenuComponentFooter{position:absolute;left:0;right:40%;bottom:0;padding:0 15px}.sourceCodeFormatError{color:#f0640d;margin-left:15px}.sourceCodeDiagnosticsNotice{color:#5db0d7;margin-left:15px}.sourceCodeDiagnosticsNotice a{color:#c9c9c9;text-decoration:underline}.sourceCodeMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.sourceCodeMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.sourceCodeMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.sourceCodeMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.sourceCodeMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.sourceCodeMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.sourceCodeMenuComponent a.clearSearch{display:inline-block;padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.sourceCodeMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}.sourceCodeMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:100%;position:relative;top:-1px;box-sizing:border-box}.sourceCodeMenuComponent input:focus{border:0;outline:0 none}.sourceCodeMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.sourceCodeMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.sourceCodeMenuComponent ::-webkit-input-placeholder{color:#ccc}.sourceCodeMenuComponent :-moz-placeholder{color:#ccc}.sourceCodeMenuComponent ::-moz-placeholder{color:#ccc}.sourceCodeMenuComponent :-ms-input-placeholder{color:#ccc}.sourceCodeComponent{position:absolute;top:42px;left:0;bottom:48px;right:40%;background:#222;z-index:9000;overflow-x:visible;overflow:auto}.sourceCodeComponent .sourceCodeComponentTitle{font-size:16px;font-weight:800;line-height:50px;color:#f0640d;padding:1em;margin:.5em 0}.compareViewComponent{position:absolute;top:50px;left:0px;right:0px;bottom:0px;overflow:hidden;display:flex;flex-direction:column;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:13px}.compareViewComponent .compareViewEmpty,.compareViewComponent .compareViewEmptyRow,.compareViewComponent .compareDetailEmpty{padding:1em;color:#c9c9c9;text-align:center}.compareViewComponent .compareViewHeader{flex:0 0 auto;display:flex;align-items:center;gap:16px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid rgb(8.5,8.5,8.5);white-space:nowrap}.compareViewComponent .compareViewHeader .compareViewLabel{color:#5db0d7}.compareViewComponent .compareViewHeader .compareViewSummary span{margin-right:8px;font-weight:700}.compareViewComponent .compareViewHeader .compareViewSummary span.added{color:#adff2f}.compareViewComponent .compareViewHeader .compareViewSummary span.removed{color:#ff5a5a}.compareViewComponent .compareViewHeader .compareViewSummary span.changed{color:#f0640d}.compareViewComponent .compareViewHeader .compareViewSummary span.unchanged{color:#c9c9c9}.compareViewComponent .compareViewHeader .compareViewToggle{margin-left:auto;cursor:pointer;user-select:none}.compareViewComponent .compareViewHeader .compareViewToggle input{vertical-align:middle;margin-right:4px}.compareViewComponent .compareViewBody{flex:1 1 auto;display:flex;min-height:0}.compareViewComponent .compareViewLegend{flex:0 0 130px;box-sizing:border-box;padding:10px;background:#2c2c2c;border-right:2px solid #222}.compareViewComponent .compareViewLegend .compareLegendRow{display:flex;align-items:center;gap:8px;margin:8px 0}.compareViewComponent .compareViewLegend .compareLegendRow.unchanged{opacity:.5}.compareViewComponent .compareViewLegend .compareLegendChip{width:12px;height:12px;border-radius:2px;background:#c9c9c9}.compareViewComponent .compareViewLegend .added .compareLegendChip{background:#adff2f}.compareViewComponent .compareViewLegend .removed .compareLegendChip{background:#ff5a5a}.compareViewComponent .compareViewLegend .changed .compareLegendChip{background:#f0640d}.compareViewComponent .compareViewList{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;margin:0;padding:0;list-style:none}.compareViewComponent .compareViewList .compareRow{display:flex;align-items:baseline;padding:3px 10px;line-height:20px;cursor:pointer;white-space:nowrap}.compareViewComponent .compareViewList .compareRow:nth-child(odd){background:#222}.compareViewComponent .compareViewList .compareRow:nth-child(even){background:#2c2c2c}.compareViewComponent .compareViewList .compareRow .compareSign{flex:0 0 14px;font-weight:800}.compareViewComponent .compareViewList .compareRow .compareRowText{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.compareViewComponent .compareViewList .compareRow .compareCmdName{font-weight:700}.compareViewComponent .compareViewList .compareRow.added .compareSign,.compareViewComponent .compareViewList .compareRow.added .compareCmdName{color:#adff2f}.compareViewComponent .compareViewList .compareRow.removed .compareSign,.compareViewComponent .compareViewList .compareRow.removed .compareCmdName{color:#ff5a5a}.compareViewComponent .compareViewList .compareRow.changed .compareSign,.compareViewComponent .compareViewList .compareRow.changed .compareCmdName{color:#f0640d}.compareViewComponent .compareViewList .compareRow.unchanged{opacity:.55}.compareViewComponent .compareViewList .compareRow.selected{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.compareViewComponent .compareViewList .compareRow.selected .compareSign,.compareViewComponent .compareViewList .compareRow.selected .compareCmdName{color:#222}.compareViewComponent .compareViewList .compareViewEmptyRow{cursor:default}.compareViewComponent .compareViewDetail{flex:0 0 42%;box-sizing:border-box;overflow-y:auto;border-left:2px solid #222;padding:4px 12px 12px}.compareViewComponent .compareViewDetail .compareDetailGroup{margin:12px 0}.compareViewComponent .compareViewDetail .compareDetailGroup ul{margin:0;padding:0;list-style:none}.compareViewComponent .compareViewDetail .compareDetailGroup li{padding:2px 0;white-space:pre-wrap;word-break:break-word}.compareViewComponent .compareViewDetail .compareDetailTitle{display:block;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin-bottom:6px;text-transform:capitalize}.compareViewComponent .compareViewDetail .compareDetailKey{color:#f0640d}.compareViewComponent .compareViewDetail .compareCmdName{font-weight:700}.compareViewComponent .compareViewDetail .compareCmdName.added{color:#adff2f}.compareViewComponent .compareViewDetail .compareCmdName.removed{color:#ff5a5a}.compareViewComponent .compareViewDetail .compareCmdName.changed{color:#f0640d}.compareViewComponent .compareViewDetail .compareArrow{color:#c9c9c9}.compareViewComponent .compareViewDetail .compareOld{opacity:.7;text-decoration:line-through}.compareViewComponent .compareViewDetail .compareNew{color:#f9f9f9}.compareViewComponent .compareViewDetail .compareCommandLink{color:#5db0d7;text-decoration:none;cursor:pointer;border-bottom:1px dotted currentColor}.compareViewComponent .compareViewDetail .compareCommandLink:hover{color:#f0640d}.compareViewComponent .compareViewDetail .compareTextureItem{padding-bottom:6px}.compareViewComponent .compareViewDetail .compareImageDiff{display:flex;align-items:center;margin-top:4px}.compareViewComponent .compareViewDetail .compareThumb{width:48px;height:48px;object-fit:contain;margin:2px 6px 2px 0;border:1px solid rgb(8.5,8.5,8.5);background:#222;image-rendering:pixelated}.jsonItemImageClickable{cursor:zoom-in}.textureViewerOverlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:100000;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.6);font-family:Consolas,monaco,monospace;font-size:13px;color:#f9f9f9}.textureViewerOverlay .textureViewerModal{width:min(900px,92vw);height:min(640px,90vh);display:flex;flex-direction:column;overflow:hidden;background:#222;border:1px solid #000;box-shadow:0 10px 40px rgba(0,0,0,.6)}.textureViewerOverlay .textureViewerHeader{flex:0 0 auto;display:flex;align-items:center;gap:12px;height:40px;padding:0 12px;background:#2c2c2c;border-bottom:2px solid #222}.textureViewerOverlay .textureViewerHeader .textureViewerTitle{color:#5db0d7}.textureViewerOverlay .textureViewerHeader .textureViewerMeta{color:#c9c9c9;font-size:12px}.textureViewerOverlay .textureViewerHeader .textureViewerClose{margin-left:auto;width:26px;height:26px;display:flex;align-items:center;justify-content:center;border-radius:3px;color:#c9c9c9;cursor:pointer}.textureViewerOverlay .textureViewerHeader .textureViewerClose:hover{color:#f9f9f9;background:hsla(0,0%,100%,.08)}.textureViewerOverlay .textureViewerToolbar{flex:0 0 auto;display:flex;align-items:center;flex-wrap:wrap;gap:14px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid #000;font-size:12px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup{display:flex;align-items:center;gap:6px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup .lbl{color:#c9c9c9;margin-right:2px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroupEnd{margin-left:auto}.textureViewerOverlay .textureViewerToolbar .channel{width:26px;height:24px;display:flex;align-items:center;justify-content:center;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#777;font-weight:800;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .channel.on.r{background:#e14b4b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.g{background:#4bd44b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.b{background:#4b8fe1;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.a{background:#dedede;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .tvBtn{height:24px;padding:0 10px;display:inline-flex;align-items:center;gap:6px;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#f9f9f9;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .tvBtn:hover{background:#333}.textureViewerOverlay .textureViewerToolbar .tvBtn.active{background:#f0640d;color:#1a1a1a;border-color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary{border-color:#f0640d;color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary:hover{background:#f0640d;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .seg{display:flex}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn{border-radius:0;border-right-width:0}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:first-child{border-radius:3px 0 0 3px}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:last-child{border-radius:0 3px 3px 0;border-right-width:1px}.textureViewerOverlay .textureViewerToolbar .zoomVal{min-width:44px;text-align:center;color:#c9c9c9}.textureViewerOverlay .textureViewerBody{flex:1 1 auto;display:flex;min-height:0}.textureViewerOverlay .textureViewerViewport{flex:1 1 auto;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#141414}.textureViewerOverlay .textureViewerViewport.checker{background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}.textureViewerOverlay .textureViewerCanvas{image-rendering:pixelated;cursor:crosshair;box-shadow:0 0 0 1px #000}.textureViewerOverlay .textureViewerLoupe{position:absolute;display:none;width:120px;height:120px;pointer-events:none;image-rendering:pixelated;border:1px solid #000;box-shadow:0 2px 8px rgba(0,0,0,.6);background:#000;left:16px;top:16px}.textureViewerOverlay .textureViewerRail{flex:0 0 210px;box-sizing:border-box;padding:12px;overflow-y:auto;background:#2c2c2c;border-left:2px solid #222}.textureViewerOverlay .textureViewerRail .railTitle{color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin:0 0 8px;text-transform:capitalize}.textureViewerOverlay .textureViewerRail .kv{display:flex;justify-content:space-between;margin:4px 0}.textureViewerOverlay .textureViewerRail .kv .k{color:#f0640d}.textureViewerOverlay .textureViewerRail .kv .v{color:#f9f9f9}.textureViewerOverlay .textureViewerRail .swatch{width:100%;height:34px;margin:8px 0;border:1px solid #000;background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0}.textureViewerOverlay .textureViewerRail .swatch .swatchInner{width:100%;height:100%}.textureViewerOverlay .textureViewerRail .hint{color:#c9c9c9;margin-top:10px;line-height:1.5}',""]);const a=o},636(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,".ace-monokai {\n color: #f9f9f9;\n font-size: 14px;\n}\n\n.ace-monokai .ace_entity.ace_name.ace_tag,\n.ace-monokai .ace_keyword,\n.ace-monokai .ace_meta.ace_tag,\n.ace-monokai .ace_storage {\n color: #F0640D\n}\n\n.ace-monokai .ace_constant.ace_character,\n.ace-monokai .ace_constant.ace_other {\n color: #5db0d7;\n}\n\n.ace-monokai .ace_marker-layer .ace_selection {\n background: #a6e22e\n}\n\n.ace-monokai .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #a6e22e;\n}\n\n.ace-monokai .ace_marker-layer .ace_active-line {\n background: #2c2c2c\n}\n.ace-monokai .ace_gutter-active-line {\n background-color: #2c2c2c\n}\n.ace-monokai .ace_marker-layer .ace_selected-word {\n border: 1px solid #a6e22e\n}\n\n.ace-monokai .ace_constant.ace_language {\n color: #e6db74\n}\n.ace-monokai .ace_constant.ace_numeric {\n color: #ae81ff\n}\n\n.ace-monokai .ace_gutter {\n background: #222;\n color: #8F908A;\n}",""]);const a=o},314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var a=0;a0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},601(e){"use strict";e.exports=function(e){return e[1]}},832(e,t,n){e=n.nmd(e),function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,n,r){"string"==typeof e?(2==arguments.length&&(r=n),t.modules[e]||(t.payloads[e]=r,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var n,r,i=function(e,t,n){if("string"==typeof t){var r=a(e,t);if(null!=r)return n&&n(),r}else if("[object Array]"===Object.prototype.toString.call(t)){for(var i=[],o=0,l=t.length;o1&&function(e,t,n){if(Array.prototype.indexOf)return e.indexOf("",n);for(var r=0;r-1&&(n=RegExp(this.source,i.replace.call(((r=this).global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),"g","")),i.replace.call(e.slice(a.index),n,function(){for(var e=1;ea.index&&this.lastIndex--}return a},o||(RegExp.prototype.test=function(e){var t=i.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError("Function.prototype.bind called on incompatible "+t);var n=d.call(arguments,1),i=function(){if(this instanceof i){var r=t.apply(this,n.concat(d.call(arguments)));return Object(r)===r?r:this}return t.apply(e,n.concat(d.call(arguments)))};return t.prototype&&(r.prototype=t.prototype,i.prototype=new r,r.prototype=null),i});var i,s,o,a,l,u=Function.prototype.call,c=Array.prototype,h=Object.prototype,d=c.slice,f=u.bind(h.toString),p=u.bind(h.hasOwnProperty);if((l=p(h,"__defineGetter__"))&&(i=u.bind(h.__defineGetter__),s=u.bind(h.__defineSetter__),o=u.bind(h.__lookupGetter__),a=u.bind(h.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,n=[];if(n.splice.apply(n,e(20)),n.splice.apply(n,e(26)),t=n.length,n.splice(5,0,"XXX"),n.length,t+1==n.length)return!0}()){var m=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?m.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(d.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):null==e?e=0:e<0&&(e=Math.max(n+e,0)),e+ta)for(h=u;h--;)this[l+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else for(this.length=c+s,h=0;h>>0;if("[object Function]"!=f(e))throw new TypeError;for(;++i>>0,i=Array(r),s=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var o=0;o>>0,s=[],o=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var a=0;a>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,s=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s++];break}if(++s>=r)throw new TypeError("reduce of empty array with no initial value")}for(;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,s=r-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s--];break}if(--s<0)throw new TypeError("reduceRight of empty array with no initial value")}do{s in this&&(i=e.call(void 0,i,n[s],s,t))}while(s--);return i}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=C&&"[object String]"==f(this)?this.split(""):L(this),n=t.length>>>0;if(!n)return-1;var r=0;for(arguments.length>1&&(r=N(arguments[1])),r=r>=0?r:Math.max(0,n+r);r>>0;if(!n)return-1;var r=n-1;for(arguments.length>1&&(r=Math.min(r,N(arguments[1]))),r=r>=0?r:n-Math.abs(r);r>=0;r--)if(r in t&&e===t[r])return r;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:h)}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(p(e,t)){var n;if(n={enumerable:!0,configurable:!0},l){var r=e.__proto__;e.__proto__=h;var i=o(e,t),s=a(e,t);if(e.__proto__=r,i||s)return i&&(n.get=i),s&&(n.set=s),n}return n.value=e[t],n}}),Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),Object.create||(g=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var n;if(null===e)n=g();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var r=function(){};r.prototype=e,(n=new r).__proto__=e}return void 0!==t&&Object.defineProperties(n,t),n}),Object.defineProperty){var S=D({}),A="undefined"==typeof document||D(document.createElement("div"));if(!S||!A)var _=Object.defineProperty}Object.defineProperty&&!_||(Object.defineProperty=function(e,t,n){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof n&&"function"!=typeof n||null===n)throw new TypeError("Property description must be an object: "+n);if(_)try{return _.call(Object,e,t,n)}catch(e){}if(p(n,"value"))if(l&&(o(e,t)||a(e,t))){var r=e.__proto__;e.__proto__=h,delete e[t],e[t]=n.value,e.__proto__=r}else e[t]=n.value;else{if(!l)throw new TypeError("getters & setters can not be defined on this javascript engine");p(n,"get")&&i(e,t,n.get),p(n,"set")&&s(e,t,n.set)}return e}),Object.defineProperties||(Object.defineProperties=function(e,t){for(var n in t)p(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=(E=Object.freeze,function(e){return"function"==typeof e?e:E(e)})}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";p(e,t);)t+="?";e[t]=!0;var n=p(e,t);return delete e[t],n}),!Object.keys){var y=!0,b=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],T=b.length;for(var R in{toString:null})y=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)p(e,n)&&t.push(n);if(y)for(var r=0,i=T;r0||-1)*Math.floor(Math.abs(e))),e}var L=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,n){"use strict";e("./regexp"),e("./es5-shim"),"undefined"==typeof Element||Element.prototype.remove||Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,n){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var r="object"==typeof navigator?navigator:{},i=(/mac|win|linux/i.exec(r.platform)||["other"])[0].toLowerCase(),s=r.userAgent||"",o=r.appName||"";t.isWin="win"==i,t.isMac="mac"==i,t.isLinux="linux"==i,t.isIE="Microsoft Internet Explorer"==o||o.indexOf("MSAppHost")>=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,t.isAIR=s.indexOf("AdobeAIR")>=0,t.isAndroid=s.indexOf("Android")>=0,t.isChromeOS=s.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./useragent");if(t.buildDom=function e(t,n,r){if("string"==typeof t&&t){var i=document.createTextNode(t);return n&&n.appendChild(i),i}if(!Array.isArray(t))return t;if("string"!=typeof t[0]||!t[0]){for(var s=[],o=0;o=1.5,"undefined"!=typeof document){var i=document.createElement("div");t.HI_DPI&&void 0!==i.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),r.isEdge||void 0===i.style.animationName||(t.HAS_CSS_ANIMATION=!0),i=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./oop"),i=function(){var e,t,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in n.FUNCTION_KEYS)e=n.FUNCTION_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);for(t in n.PRINTABLE_KEYS)e=n.PRINTABLE_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);return r.mixin(n,n.MODIFIER_KEYS),r.mixin(n,n.PRINTABLE_KEYS),r.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)n.KEY_MODS[t]=e.filter(function(e){return t&n.KEY_MODS[e]}).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();r.mixin(t,i),t.keyCodeToString=function(e){var t=i[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./keys"),i=e("./useragent"),s=null,o=0;t.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var r=function(){n.call(e,window.event)};n._wrapper=r,e.attachEvent("on"+t,r)}},t.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,n,r){function i(e){n&&n(e),r&&r(e),t.removeListener(document,"mousemove",n,!0),t.removeListener(document,"mouseup",i,!0),t.removeListener(document,"dragstart",i,!0)}return t.addListener(document,"mousemove",n,!0),t.addListener(document,"mouseup",i,!0),t.addListener(document,"dragstart",i,!0),i},t.addMouseWheelListener=function(e,n){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),n(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}n(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),n(e)})},t.addMultiMouseDownListener=function(e,n,r,s){var o,a,l,u=0,c={2:"dblclick",3:"tripleclick",4:"quadclick"};function h(e){if(0!==t.getButton(e)?u=0:e.detail>1?++u>4&&(u=1):u=1,i.isIE){var h=Math.abs(e.clientX-o)>5||Math.abs(e.clientY-a)>5;l&&!h||(u=1),l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),1==u&&(o=e.clientX,a=e.clientY)}if(e._clicks=u,r[s]("mousedown",e),u>4)u=0;else if(u>1)return r[s](c[u],e)}function d(e){u=2,l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),r[s]("mousedown",e),r[s](c[u],e)}Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",h),i.isOldIE&&t.addListener(e,"dblclick",d)})};var a=i.isMac&&i.isOpera&&!("KeyboardEvent"in window)?function(e){return(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)}:function(e){return(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};function l(e,t,n){var l=a(t);if(!i.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(l|=8),s.altGr){if(!(3&~l))return;s.altGr=0}if(18===n||17===n){var u="location"in t?t.location:t.keyLocation;17===n&&1===u?1==s[n]&&(o=t.timeStamp):18===n&&3===l&&2===u&&t.timeStamp-o<50&&(s.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),l||13!==n||3!==(u="location"in t?t.location:t.keyLocation)||(e(t,l,-n),!t.defaultPrevented)){if(i.isChromeOS&&8&l){if(e(t,l,n),t.defaultPrevented)return;l&=-9}return!!(l||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&e(t,l,n)}}function u(){s=Object.create(null)}if(t.getModifierString=function(e){return r.KEY_MODS[a(e)]},t.addCommandKeyListener=function(e,n){var r=t.addListener;if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var o=null;r(e,"keydown",function(e){o=e.keyCode}),r(e,"keypress",function(e){return l(n,e,o)})}else{var a=null;r(e,"keydown",function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=l(n,e,e.keyCode);return a=e.defaultPrevented,t}),r(e,"keypress",function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),r(e,"keyup",function(e){s[e.keyCode]=null}),s||(u(),r(window,"focus",u))}},"object"==typeof window&&window.postMessage&&!i.isOldIE){var c=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+c++,i=function(s){s.data==r&&(t.stopPropagation(s),t.removeListener(n,"message",i),e())};t.addListener(n,"message",i),n.postMessage(r,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function n(){t.$idleBlocked?setTimeout(n,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,n=e.end,r=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(r.row,r.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(r.row,r.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else this.end.rowt)var i={row:t+1,column:0};else this.start.row0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;nDate.now()-50)||(r=!1)},cancel:function(){r=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("../lib/dom"),o=e("../lib/lang"),a=e("../clipboard"),l=i.isChrome<18,u=i.isIE,c=i.isChrome>63,h=400,d=e("../lib/keys"),f=d.KEY_MODS,p=i.isIOS,m=p?/\s/:/\n/;t.TextInput=function(e,t){var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild);var g=!1,E=!1,v=!1,C=!1,D="";i.isMobile||(n.style.fontSize="1px");var S=!1,A=!1,_="",y=0,b=0,T=0;try{var R=document.activeElement===n}catch(e){}r.addListener(n,"blur",function(e){A||(t.onBlur(e),R=!1)}),r.addListener(n,"focus",function(e){if(!A){if(R=!0,i.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),i.isEdge?setTimeout(x):x()}}),this.$focusScroll=!1,this.focus=function(){if(D||c||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var t=0!=n.getBoundingClientRect().top}catch(e){return}var r=[];if(t)for(var i=n.parentElement;i&&1==i.nodeType;)r.push(i),i.setAttribute("ace_nocontext",!0),i=!i.parentElement&&i.getRootNode?i.getRootNode().host:i.parentElement;n.focus({preventScroll:!0}),t&&r.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="","0px"==n.style.top&&(n.style.top=e)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return R},t.on("beforeEndOperation",function(){t.curOp&&"insertstring"==t.curOp.command.name||(v&&(_=n.value="",U()),x())});var x=p?function(e){if(R&&(!g||e)&&!C){e||(e="");var r="\n ab"+e+"cde fg\n";r!=n.value&&(n.value=_=r);var i=4+(e.length||(t.selection.isEmpty()?0:1));4==y&&b==i||n.setSelectionRange(4,i),y=4,b=i}}:function(){if(!v&&!C&&(R||F)){v=!0;var e=t.selection,r=e.getRange(),i=e.cursor.row,s=r.start.column,o=r.end.column,a=t.session.getLine(i);if(r.start.row!=i){var l=t.session.getLine(i-1);s=r.start.rowi+1?u.length:o,o+=a.length+1,a=a+"\n"+u}a.length>h&&(s0&&_[h]==e[h];)h++,o--;for(l=l.slice(h),h=1;a>0&&_.length-h>y-1&&_[_.length-h]==e[e.length-h];)h++,a--;u-=h-1,c-=h-1;var d=l.length-h+1;return d<0&&(o=-d,d=0),l=l.slice(0,d),r||l||u||o||a||c?(C=!0,l&&!o&&!a&&!u&&!c||S?t.onTextInput(l):t.onTextInput(l,{extendLeft:o,extendRight:a,restoreStart:u,restoreEnd:c}),C=!1,_=e,y=i,b=s,T=c,l):""},L=function(e){if(v)return B();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var r=n.value,i=N(r,!0);(r.length>500||m.test(i))&&x()},O=function(e,t,n){var r=e.clipboardData||window.clipboardData;if(r&&!l){var i=u||n?"Text":"text/plain";try{return t?!1!==r.setData(i,t):r.getData(i)}catch(e){if(!n)return O(e,t,!0)}}},I=function(e,i){var s=t.getCopyText();if(!s)return r.preventDefault(e);O(e,s)?(p&&(x(s),g=s,setTimeout(function(){g=!1},10)),i?t.onCut():t.onCopy(),r.preventDefault(e)):(g=!0,n.value=s,n.select(),setTimeout(function(){g=!1,x(),i?t.onCut():t.onCopy()}))},k=function(e){I(e,!0)},M=function(e){I(e,!1)},P=function(e){var s=O(e);a.pasteCancelled()||("string"==typeof s?(s&&t.onPaste(s,e),i.isIE&&setTimeout(x),r.preventDefault(e)):(n.value="",E=!0))};r.addCommandKeyListener(n,t.onCommandKey.bind(t)),r.addListener(n,"select",function(e){v||(g?g=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=_.length&&e.value===_&&_&&e.selectionEnd!==b}(n)&&(t.selectAll(),x()))}),r.addListener(n,"input",L),r.addListener(n,"cut",k),r.addListener(n,"copy",M),r.addListener(n,"paste",P),"oncut"in n&&"oncopy"in n&&"onpaste"in n||r.addListener(e,"keydown",function(e){if((!i.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:M(e);break;case 86:P(e);break;case 88:k(e)}});var B=function(){if(v&&t.onCompositionUpdate&&!t.$readOnly){if(S)return $();if(v.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;N(e),v.markerRange&&(v.context&&(v.markerRange.start.column=v.selectionStart=v.context.compositionStartOffset),v.markerRange.end.column=v.markerRange.start.column+b-v.selectionStart+T)}}},U=function(e){t.onCompositionEnd&&!t.$readOnly&&(v=!1,t.onCompositionEnd(),t.off("mousedown",$),e&&L())};function $(){A=!0,n.blur(),n.focus(),A=!1}var G,V=o.delayedCall(B,50).schedule.bind(null,null);function W(){clearTimeout(G),G=setTimeout(function(){D&&(n.style.cssText=D,D=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()},0)}r.addListener(n,"compositionstart",function(e){if(!v&&t.onCompositionStart&&!t.$readOnly&&(v={},!S)){setTimeout(B,0),t.on("mousedown",$);var r=t.getSelectionRange();r.end.row=r.start.row,r.end.column=r.start.column,v.markerRange=r,v.selectionStart=y,t.onCompositionStart(v),v.useTextareaForIME?(n.value="",_="",y=0,b=0):(n.msGetInputContext&&(v.context=n.msGetInputContext()),n.getInputContext&&(v.context=n.getInputContext()))}}),r.addListener(n,"compositionupdate",B),r.addListener(n,"keyup",function(e){27==e.keyCode&&n.value.lengthb&&"\n"==_[s]?o=d.end:rb&&_.slice(0,s).split("\n").length>2?o=d.down:s>b&&" "==_[s-1]?(o=d.right,a=f.option):(s>b||s==b&&b!=y&&r==s)&&(o=d.right),r!==s&&(a|=f.shift),o){if(!t.onCommandKey({},a,o)&&t.commands){o=d.keyCodeToString(o);var l=t.commands.findKeyCommand(a,o);l&&t.execCommand(l)}y=r,b=s,x("")}}};document.addEventListener("selectionchange",s),t.on("destroy",function(){document.removeEventListener("selectionchange",s)})}(0,t,n)}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/useragent");function i(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function s(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)n=2*t.row-e.start.row-e.end.row;else n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,s=e.getButton();return 0!==s?((i.getSelectionRange().isEmpty()||1==s)&&i.selection.moveToPosition(n),void(2==s&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||i.isFocused()||(i.focus(),!this.$focusTimeout||this.$clickSelection||i.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(-1==r)e=this.$clickSelection.end;else if(1==r)e=this.$clickSelection.start;else{var i=s(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(i.start),a=this.$clickSelection.comparePoint(i.end);if(-1==o&&a<=0)t=this.$clickSelection.end,i.end.row==r.row&&i.end.column==r.column||(r=i.start);else if(1==a&&o>=0)t=this.$clickSelection.start,i.start.row==r.row&&i.start.column==r.column||(r=i.end);else if(-1==o&&1==a)r=i.end,t=i.start;else{var l=s(this.$clickSelection,r);r=l.cursor,t=l.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e,t,n,r,i=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,n=this.x,r=this.y,Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))),s=Date.now();(i>0||s-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session.getBracketRange(t);r?(r.isEmpty()&&(r.start.column--,r.end.column++),this.setState("select")):(r=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=r,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,s=i?e.wheelX/i:n.vx,o=i?e.wheelY/i:n.vy;i<550&&(s=(s+n.vx)/2,o=(o+n.vy)/2);var a=Math.abs(s/o),l=!1;return a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?n.allowed=r:r-n.allowed<550&&(Math.abs(s)<=1.5*Math.abs(n.vx)&&Math.abs(o)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=r):n.allowed=0),n.t=r,n.vx=s,n.vy=o,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(i.prototype),t.DefaultHandlers=i}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}(function(){this.$init=function(){return this.$element=r.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){r.addCssClass(this.getElement(),e)},this.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(i.prototype),t.Tooltip=i}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/event"),o=e("../tooltip").Tooltip;function a(e){o.call(this,e)}i.inherits(a,o),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),s=this.getHeight();(e+=15)+i>n&&(e-=e+i-n),(t+=15)+s>r&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=function(e){var t,n,i,o=e.editor,l=o.renderer.$gutterLayer,u=new a(o.container);function c(){t&&(t=clearTimeout(t)),i&&(u.hide(),i=null,o._signal("hideGutterTooltip",u),o.removeEventListener("mousewheel",c))}function h(e){u.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",function(t){if(o.isFocused()&&0==t.getButton()&&"foldWidgets"!=l.getRegion(t)){var n=t.getDocumentPosition().row,r=o.session.selection;if(t.getShiftKey())r.selectTo(n,0);else{if(2==t.domEvent.detail)return o.selectAll(),t.preventDefault();e.$clickSelection=o.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}),e.editor.setDefaultHandler("guttermousemove",function(s){var a=s.domEvent.target||s.domEvent.srcElement;if(r.hasCssClass(a,"ace_fold-widget"))return c();i&&e.$tooltipFollowsMouse&&h(s),n=s,t||(t=setTimeout(function(){t=null,n&&!e.isMousePressed?function(){var t=n.getDocumentPosition().row,r=l.$annotations[t];if(!r)return c();if(t==o.session.getLength()){var s=o.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(s>o.session.documentToScreenRow(a.row,a.column))return c()}if(i!=r)if(i=r.text.join("
"),u.setHtml(i),u.show(),o._signal("showGutterTooltip",u),o.on("mousewheel",c),e.$tooltipFollowsMouse)h(n);else{var d=n.domEvent.target.getBoundingClientRect(),f=u.getElement().style;f.left=d.right+"px",f.top=d.bottom+"px"}}():c()},50))}),s.addListener(o.renderer.$gutter,"mouseout",function(e){n=null,i&&!t&&(t=setTimeout(function(){t=null,c()},50))}),o.on("changeSession",c)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent");function o(e){var t=e.editor,n=r.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),t.addEventListener("mousedown",this.onMouseDown.bind(e));var o,l,u,c,h,d,f,p,m,g,E,v=t.container,C=0;function D(){var e=d;(function(e,n){var r=Date.now(),i=!n||e.row!=n.row,s=!n||e.column!=n.column;!g||i||s?(t.moveCursorToPosition(e),g=r,E={x:l,y:u}):a(E.x,E.y,l,u)>5?g=null:r-g>=200&&(t.renderer.scrollCursorIntoView(),g=null)})(d=t.renderer.screenToTextCoordinates(l,u),e),function(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,s=t.renderer.layerConfig.characterWidth,o=t.renderer.scroller.getBoundingClientRect(),a={x:{left:l-o.left,right:o.right-l},y:{top:u-o.top,bottom:o.bottom-u}},c=Math.min(a.x.left,a.x.right),h=Math.min(a.y.top,a.y.bottom),d={row:e.row,column:e.column};c/s<=2&&(d.column+=a.x.left=200&&t.renderer.scrollCursorIntoView(d):m=r:m=null}(d,e)}function S(){h=t.selection.toOrientedRange(),o=t.session.addMarker(h,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(c),D(),c=setInterval(D,20),C=0,i.addListener(document,"mousemove",y)}function A(){clearInterval(c),t.session.removeMarker(o),o=null,t.selection.fromOrientedRange(h),t.isFocused()&&!p&&t.$resetCursorStyle(),h=null,d=null,C=0,m=null,g=null,i.removeListener(document,"mousemove",y)}this.onDragStart=function(e){if(this.cancelDrag||!v.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}h=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?"copy":"copyMove",s.isOpera&&(t.container.appendChild(n),n.scrollTop=0),i.setDragImage&&i.setDragImage(n,0,0),s.isOpera&&t.container.removeChild(n),i.clearData(),i.setData("Text",t.session.getTextRange()),p=!0,this.setState("drag")},this.onDragEnd=function(e){if(v.draggable=!1,p=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;f||"move"!=n||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||S(),C++,e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||(S(),C++),null!==_&&(_=null),e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragLeave=function(e){if(--C<=0&&o)return A(),f=null,i.preventDefault(e)},this.onDrop=function(e){if(d){var n=e.dataTransfer;if(p)switch(f){case"move":h=h.contains(d.row,d.column)?{start:d,end:d}:t.moveText(h,d);break;case"copy":h=t.moveText(h,d,!0)}else{var r=n.getData("Text");h={start:d,end:t.session.insert(d,r)},t.focus(),f=null}return A(),i.preventDefault(e)}},i.addListener(v,"dragstart",this.onDragStart.bind(e)),i.addListener(v,"dragend",this.onDragEnd.bind(e)),i.addListener(v,"dragenter",this.onDragEnter.bind(e)),i.addListener(v,"dragover",this.onDragOver.bind(e)),i.addListener(v,"dragleave",this.onDragLeave.bind(e)),i.addListener(v,"drop",this.onDrop.bind(e));var _=null;function y(){null==_&&(_=setTimeout(function(){null!=_&&o&&A()},20))}function b(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function T(e){var t=["copy","copymove","all","uninitialized"],n=s.isMac?e.altKey:e.ctrlKey,r="uninitialized";try{r=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var i="none";return n&&t.indexOf(r)>=0?i="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(r)>=0?i="move":t.indexOf(r)>=0&&(i="copy"),i}}function a(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=s.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;s.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton();if(1===(e.domEvent.detail||1)&&0===r&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var i=e.domEvent.target||e.domEvent.srcElement;"unselectable"in i&&(i.unselectable="on"),t.getDragDelay()?(s.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(o.prototype),t.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./mouse_event").MouseEvent,i=e("../lib/dom");t.addTouchListeners=function(e,t){var n,s,o,a,l,u,c,h,d,f="scroll",p=0,m=0,g=0,E=0;function v(){var e,n,r;d||(e=window.navigator&&window.navigator.clipboard,n=!1,r=function(r){var s,o,a=r.target.getAttribute("action");if("more"==a||!n)return n=!n,s=t.getCopyText(),o=t.session.getUndoManager().hasUndo(),void d.replaceChild(i.buildDom(n?["span",!s&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],s&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],s&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],o&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),d.firstChild);"paste"==a?e.readText().then(function(e){t.execCommand(a,e)}):a&&("cut"!=a&&"copy"!=a||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(a)),d.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&t.focus()},d=i.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){f="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),r(e)},onclick:r},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container));var s=t.selection.cursor,o=t.renderer.textToScreenCoordinates(s.row,s.column),a=t.container.getBoundingClientRect();d.style.top=o.pageY-a.top-3+"px",d.style.right="10px",d.style.display="",d.firstChild.style.display="none",t.on("input",C)}function C(e){d&&(d.style.display="none"),t.off("input",C)}function D(){l=null,clearTimeout(l);var e=t.selection.getRange(),n=e.contains(c.row,c.column);!e.isEmpty()&&n||(t.selection.moveToPosition(c),t.selection.selectWord()),f="wait",v()}e.addEventListener("contextmenu",function(e){h&&t.textInput.getElement().focus()}),e.addEventListener("touchstart",function(e){var i=e.touches;if(l||i.length>1)return clearTimeout(l),l=null,o=-1,void(f="zoom");h=t.$mouseHandler.isMousePressed=!0;var u=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,v=e.timeStamp;a=v;var C=i[0],S=C.clientX,A=C.clientY;Math.abs(n-S)+Math.abs(s-A)>u&&(o=-1),n=e.clientX=S,s=e.clientY=A,g=E=0;var _=new r(e,t);if(c=_.getDocumentPosition(),v-o<500&&1==i.length&&!p)m++,e.preventDefault(),e.button=0,function(){l=null,clearTimeout(l),t.selection.moveToPosition(c);var e=m>=2?t.selection.getLineRange(c.row):t.session.getBracketRange(c);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),f="wait"}();else{m=0;var y=t.selection.cursor,b=t.selection.isEmpty()?y:t.selection.anchor,T=t.renderer.$cursorLayer.getPixelPosition(y,!0),R=t.renderer.$cursorLayer.getPixelPosition(b,!0),x=t.renderer.scroller.getBoundingClientRect(),w=function(e,t){return(e/=d)*e+(t=t/u-.75)*t};if(e.clientXN?"cursor":"anchor"),f=N<3.5?"anchor":F<3.5?"cursor":"scroll",l=setTimeout(D,450)}o=v}),e.addEventListener("touchend",function(e){h=t.$mouseHandler.isMousePressed=!1,u&&clearInterval(u),"zoom"==f?(f="",p=0):l?(t.selection.moveToPosition(c),p=0,v()):"scroll"==f?(p+=60,u=setInterval(function(){p--<=0&&(clearInterval(u),u=null),Math.abs(g)<.01&&(g=0),Math.abs(E)<.01&&(E=0),p<20&&(g*=.9),p<20&&(E*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*g,10*E),e==t.session.getScrollTop()&&(p=0)},10),e.preventDefault(),C()):v(),clearTimeout(l),l=null}),e.addEventListener("touchmove",function(e){l&&(clearTimeout(l),l=null);var i=e.touches;if(!(i.length>1||"zoom"==f)){var o=i[0],u=n-o.clientX,c=s-o.clientY;if("wait"==f){if(!(u*u+c*c>4))return e.preventDefault();f="cursor"}n=o.clientX,s=o.clientY,e.clientX=o.clientX,e.clientY=o.clientY;var h=e.timeStamp,d=h-a;if(a=h,"scroll"==f){var p=new r(e,t);p.speed=1,p.wheelX=u,p.wheelY=c,10*Math.abs(u)1&&(i=n[n.length-2]);var o=l[t+"Path"];return null==o?o=l.basePath:"/"==r&&(t=r=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+t+r+i+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,r){var i,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{i=e(n)}catch(e){}if(i&&!t.$loading[n])return r&&r(i);if(t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r),!(t.$loading[n].length>1)){var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var r=t.$loading[n];t.$loading[n]=null,r.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,o),a),u()}};var u=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),u=function(){})};function c(i){if(a&&a.document){l.packaged=i||e.packaged||r.packaged||a.define&&n.amdD.packaged;for(var s={},o="",u=document.currentScript||document._currentScript,c=(u&&u.ownerDocument||document).getElementsByTagName("script"),d=0;d=e){for(s=h+1;s=e;)s++;for(a=h,l=s-1;a=t.length||2!=(l=n[i-1])&&3!=l||2!=(u=t[i+1])&&3!=u?4:(s&&(u=3),u==l?u:4);case 10:return 2==(l=i>0?n[i-1]:5)&&i+10&&2==n[i-1])return 2;if(s)return 4;for(f=i+1,d=t.length;f=1425&&m<=2303||64286==m;if(l=t[f],g&&(1==l||7==l))return 1}return i<1||5==(l=t[i-1])?4:n[i-1];case 5:return s=!1,o=!0,r;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:s=!1;case h:return 4}}function g(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?t>191?0:d[t]:5==n?/[\u0591-\u05f4]/.test(e)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?12:/[\u0660-\u0669\u066b-\u066c]/.test(e)?3:1642==t?c:/[\u06f0-\u06f9]/.test(e)?2:7:32==n&&t<=8287?f[255&t]:254==n&&t>=65136?7:4}t.L=0,t.R=1,t.EN=2,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,n,c){if(e.length<2)return{};var d=e.split(""),f=new Array(d.length),E=new Array(d.length),v=[];r=c?1:0,function(e,t,n,c){var h=r?u:l,d=null,f=null,p=null,E=0,v=null,C=-1,D=null,S=null,A=[];if(!c)for(D=0,c=[];D0)if(16==v){for(D=C;D-1){for(D=C;D=0&&8==c[_];_--)t[_]=r}}(d,v,d.length,n);for(var C=0;C7&&n[C]<13||4===n[C]||n[C]===h)?v[C]=t.ON_R:C>0&&"ل"===d[C-1]&&/\u0622|\u0623|\u0625|\u0627/.test(d[C])&&(v[C-1]=v[C]=t.R_H,C++);for(d[d.length-1]===t.DOT&&(v[d.length-1]=t.B),"‫"===d[0]&&(v[0]=t.RLE),C=0;C=0&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,r=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===r;)r=n,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[e];s&&(void 0===t&&(t=this.getSplitIndex()),t>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&s[i]%2!=0&&i++;for(var a=0;at&&s[i]%2==0&&(o+=this.charWidths[s[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(e,t){var n,r=this.bidiMap,i=r.bidiLevels,s=[],o=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,u=!1,c=!1,h=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,f=0;f=a&&dn+s/2;){if(n+=s,r===i.length-1){s=0;break}s=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!=0&&i[r]%2==0?(e0&&i[r-1]%2==0&&i[r]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&0===s&&i[r-1]%2==0||!this.isRtlDir&&0===r&&i[r]%2!=0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!=0&&0!==s&&r--,t=this.bidiMap.logicalFromVisual[r]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(o.prototype),t.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")})};(function(){r.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},this.$setSelection=function(e,t,n,r){var i=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||s)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n,r="number"==typeof e?e:this.lead.row,i=this.session.getFoldLine(r);return i?(r=i.start.row,n=i.end.row):n=r,!0===t?new o(r,0,n,this.session.getLine(n).length):new o(r,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i)this.moveCursorTo(i.end.row,i.end.column);else{if(this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t)),t>=n.length)return this.moveCursorTo(e,n.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(s)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)}},this.$shortWordEndIndex=function(e){var t,n=0,r=/\s/,i=this.session.tokenRe;if(i.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&r.test(t);)n++;if(n<1)for(i.lastIndex=0;(t=e[n])&&!i.test(t);)if(i.lastIndex=0,n++,r.test(t)){if(n>2){n--;break}for(;(t=e[n])&&r.test(t);)n++;if(n>2)break}}return i.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do{e++,r=this.doc.getLine(e)}while(e0&&/^\s*$/.test(r));n=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(t,n-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n,r=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(r.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(r.column),r.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=r.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?r.column=this.$desiredColumn:this.$desiredColumn=r.column);var i=this.session.screenToDocumentPosition(r.row+e,r.column,n);0!==e&&0===t&&i.row===this.lead.row&&i.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[i.row]&&(i.row>0||e>0)&&i.row++,this.moveCursorTo(i.row,i.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch(e){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,n){"use strict";var r=e("./config"),i=2e3,s=function(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],r=[],i=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",a=[],l=0;l1?this.$applyToken:u.token),h>1&&(/\\\d/.test(u.regex)?c=u.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(h=1,c=this.removeCapturingGroups(u.regex)),u.splitRegex||"string"==typeof u.token||a.push(u)),s[i]=l,i+=h,r.push(c),u.onMatch||(u.onMatch=null)}}r.length||(s[0]=0,r.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){i=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var r=[],i=0,s=n.length;ic){var E=e.substring(c,g-m.length);d.type==f?d.value+=E:(d.type&&u.push(d),d={type:f,value:E})}for(var v=0;vi){for(h>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});c1&&n[0]!==r&&n.unshift("#tmp",r),{tokens:u,state:n.length?n:r}},this.reportError=r.reportError}).call(s.prototype),t.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var n in e){for(var r=e[n],i=0;i=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(void 0!==n)return n;for(n=0;t>0;)n+=e[t-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)}}).call(i.prototype),t.TokenIterator=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r,i=e("../../lib/oop"),s=e("../behaviour").Behaviour,o=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],u=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],c={},h={'"':'"',"'":"'"},d=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,c.rangeCount!=e.multiSelect.rangeCount&&(c={rangeCount:e.multiSelect.rangeCount})),c[t])return r=c[t];r=c[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},f=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},p=function(e){this.add("braces","insertion",function(t,n,i,s,o){var l=i.getCursorPosition(),u=s.doc.getLine(l.row);if("{"==o){d(i);var c=i.getSelectionRange(),h=s.doc.getTextRange(c);if(""!==h&&"{"!==h&&i.getWrapBehavioursEnabled())return f(c,h,"{","}");if(p.isSaneInsertion(i,s))return/[\]\}\)]/.test(u[l.column])||i.inMultiSelectMode||e&&e.braces?(p.recordAutoInsert(i,s,"}"),{text:"{}",selection:[1,1]}):(p.recordMaybeInsert(i,s,"{"),{text:"{",selection:[1,1]})}else if("}"==o){if(d(i),"}"==u.substring(l.column,l.column+1)&&null!==s.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&p.isAutoInsertedClosing(l,u,o))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==o||"\r\n"==o){d(i);var m="";if(p.isMaybeInsertedClosing(l,u)&&(m=a.stringRepeat("}",r.maybeInsertedBrackets),p.clearMaybeInsertedClosing()),"}"===u.substring(l.column,l.column+1)){var g=s.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!g)return null;var E=this.$getIndent(s.getLine(g.row))}else{if(!m)return void p.clearMaybeInsertedClosing();E=this.$getIndent(u)}var v=E+s.getTabString();return{text:"\n"+v+"\n"+E+m,selection:[1,v.length,1,v.length]}}p.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,i,s){var o=i.doc.getTextRange(s);if(!s.isMultiLine()&&"{"==o){if(d(n),"}"==i.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s;r.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if("("==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"(",")");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(")"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"("==s&&(d(n),")"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("brackets","insertion",function(e,t,n,r,i){if("["==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"[","]");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if("]"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"["==s&&(d(n),"]"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("string_dquotes","insertion",function(e,t,n,r,i){var s=r.$mode.$quotes||h;if(1==i.length&&s[i]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(i))return;d(n);var o=i,a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(!(""===l||1==l.length&&s[l])&&n.getWrapBehavioursEnabled())return f(a,l,o,o);if(!l){var u=n.getCursorPosition(),c=r.doc.getLine(u.row),p=c.substring(u.column-1,u.column),m=c.substring(u.column,u.column+1),g=r.getTokenAt(u.row,u.column),E=r.getTokenAt(u.row,u.column+1);if("\\"==p&&g&&/escape/.test(g.type))return null;var v,C=g&&/string|escape/.test(g.type),D=!E||/string|escape/.test(E.type);if(m==o)(v=C!==D)&&/string\.end/.test(E.type)&&(v=!1);else{if(C&&!D)return null;if(C&&D)return null;var S=r.$mode.tokenRe;S.lastIndex=0;var A=S.test(p);S.lastIndex=0;var _=S.test(p);if(A||_)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;var y=c[u.column-2];if(p==o&&(y==o||S.test(y)))return null;v=!0}return{text:v?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.$mode.$quotes||h,o=r.doc.getTextRange(i);if(!i.isMultiLine()&&s.hasOwnProperty(o)&&(d(n),r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==o))return i.end.column++,i})};p.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new o(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",l)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var i=new o(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",l))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",u)},p.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},p.recordAutoInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isAutoInsertedClosing(i,s,r.autoInsertedLineEnd[0])||(r.autoInsertedBrackets=0),r.autoInsertedRow=i.row,r.autoInsertedLineEnd=n+s.substr(i.column),r.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isMaybeInsertedClosing(i,s)||(r.maybeInsertedBrackets=0),r.maybeInsertedRow=i.row,r.maybeInsertedLineStart=s.substr(0,i.column)+n,r.maybeInsertedLineEnd=s.substr(i.column),r.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return r.autoInsertedBrackets>0&&e.row===r.autoInsertedRow&&n===r.autoInsertedLineEnd[0]&&t.substr(e.column)===r.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return r.maybeInsertedBrackets>0&&e.row===r.maybeInsertedRow&&t.substr(e.column)===r.maybeInsertedLineEnd&&t.substr(0,e.column)==r.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){r.autoInsertedLineEnd=r.autoInsertedLineEnd.substr(1),r.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){r&&(r.maybeInsertedBrackets=0,r.maybeInsertedRow=-1)},i.inherits(p,s),t.CstyleBehaviour=p}),ace.define("ace/unicode",["require","exports","module"],function(e,t,n){"use strict";for(var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,s=[],o=0;o2?r%u!=u-1:r%u==0})}else{if(!this.blockComment)return!1;var f=this.blockComment.start,p=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+l.escapeRegExp(f)+")"),g=new RegExp("(?:"+l.escapeRegExp(p)+")\\s*$"),E=function(e,t){C(e,t)||s&&!/\S/.test(e)||(i.insertInLine({row:t,column:e.length},p),i.insertInLine({row:t,column:a},f))},v=function(e,t){var n;(n=e.match(g))&&i.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(m))&&i.removeInLine(t,n[1].length,n[0].length)},C=function(e,n){if(m.test(e))return!0;for(var r=t.getTokens(n),i=0;ie.length&&(S=e.length)}),a==1/0&&(a=S,s=!1,o=!1),c&&a%u!=0&&(a=Math.floor(a/u)*u),D(o?v:E)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(i){!i.start&&i[0]&&(i=i[0]);var s,o,a=(m=new u(t,r.row,r.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var h,d;a&&/comment/.test(a.type);){if(-1!=(g=a.value.indexOf(i.start))){var f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g;h=new c(f,p,f,p+i.start.length);break}a=m.stepBackward()}var m;for(a=(m=new u(t,r.row,r.column)).getCurrentToken();a&&/comment/.test(a.type);){var g;if(-1!=(g=a.value.indexOf(i.end))){f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g,d=new c(f,p,f,p+i.end.length);break}a=m.stepForward()}d&&t.remove(d),h&&(t.remove(h),s=h.start.row,o=-i.start.length)}else o=i.start.length,s=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);l.start.row==s&&(l.start.column+=o),l.end.row==s&&(l.end.column+=o),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var n=e[t],i=n.prototype.$id,s=r.$modes[i];s||(r.$modes[i]=s=new n),r.$modes[t]||(r.$modes[t]=s),this.$embeds.push(t),this.$modes[t]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;tthis.row)){var n=function(t,n,r){var i="insert"==t.action,s=(i?1:-1)*(t.end.row-t.start.row),o=(i?1:-1)*(t.end.column-t.start.column),a=t.start,l=i?a:t.end;return e(n,a,r)?{row:n.row,column:n.column}:e(l,n,!r)?{row:n.row+s,column:n.column+(n.row==l.row?o:0)}:{row:a.row,column:a.column}}(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(e,t,n){var r;if(r=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=r.row||this.column!=r.column){var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=e("./anchor").Anchor,l=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new a(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();void 0===e?e=n:e<0?e=0:e>=n&&(e=n-1,t=void 0);var r=this.getLine(e);return null==t&&(t=r.length),{row:e,column:t=Math.min(Math.max(t,0),r.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof o||(e=o.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,r=n.length-t+1,i=e.start.row,s=e.start.column,o=0,a=0;o20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,-1==r&&(r=t),s<=r&&n.fireUpdateEvent(s,r)}}};(function(){r.implement(this,i),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens}}).call(s.prototype),t.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=(e("./lib/oop"),e("./range").Range),s=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,n,s){if(this.regExp)for(var o=s.firstRow,a=s.lastRow,l=o;l<=a;l++){var u=this.cache[l];null==u&&((u=r.getMatchOffsets(n.getLine(l),this.regExp)).length>this.MAX_RANGES&&(u=u.slice(0,this.MAX_RANGES)),u=u.map(function(e){return new i(l,e.offset,l,e.offset+e.length)}),this.cache[l]=u.length?u:"");for(var c=u.length;c--;)t.drawSingleLineMarker(e,u[c].toScreenRange(n),this.clazz,s)}}}).call(s.prototype),t.SearchHighlight=s}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range;function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var r,i,s=0,o=this.folds,a=!0;null==t&&(t=this.end.row,n=this.end.column);for(var l=0;l0)){var l=r(e,o.start);return 0===a?t&&0!==l?-s-2:s:l>0||0===l&&!t?s:-s-1}}return-s-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},this.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],n=this.ranges,i=(n=n.sort(function(e,t){return r(e.start,t.start)}))[0],s=1;s=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=r);o++);if("insert"==e.action){for(var l=i-r,u=-t.column+n.column;or);o++)if(c.start.row==r&&c.start.column>=t.column&&(c.start.column==t.column&&this.$bias<=0||(c.start.column+=u,c.start.row+=l)),c.end.row==r&&c.end.column>=t.column){if(c.end.column==t.column&&this.$bias<0)continue;c.end.column==t.column&&u>0&&oc.start.column&&c.end.column==s[o+1].start.column&&(c.end.column-=u),c.end.column+=u,c.end.row+=l}}else for(l=r-i,u=t.column-n.column;oi);o++)c.end.rowt.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=u,c.end.row+=l):c.end.row>i&&(c.end.row+=l),c.start.rowt.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=u,c.start.row+=l):c.start.row>i&&(c.start.row+=l);if(0!=l&&o=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;for(t&&(r=n.indexOf(t)),-1==r&&(r=0);r=e)return i}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,r=t-e+1,i=0;i=t){a=e?r-=t-a:r=0);break}o>=e&&(r-=a>=e?o-a:o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n,r=this.$foldData,o=!1;e instanceof s?n=e:(n=new s(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,u=n.end.row,c=n.end.column,h=this.getFoldAt(a,l,1),d=this.getFoldAt(u,c,-1);if(h&&d==h)return h.addSubFold(n);h&&!h.range.isStart(a,l)&&this.removeFold(h),d&&!d.range.isEnd(u,c)&&this.removeFold(d);var f=this.getFoldsInRange(n.range);f.length>0&&(this.removeFolds(f),f.forEach(function(e){n.addSubFold(e)}));for(var p=0;p0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;if(null==e?(n=new r(0,0,this.getLength(),0),t=!0):n="number"==typeof e?new r(e,0,e,this.getLine(e).length):"row"in e?r.fromPoints(e,e):e,i=this.getFoldsInRangeList(n),t)this.removeFolds(i);else for(var s=i;s.length;)this.expandFolds(s),s=this.getFoldsInRangeList(n);if(i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){null==r&&(r=e.start.row),null==i&&(i=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var s=this.doc,o="";return e.walk(function(e,t,n,a){if(!(tc)break}while(s&&l.test(s.type));s=i.stepBackward()}else s=i.getCurrentToken();return u.end.row=i.getCurrentTokenRow(),u.end.column=i.getCurrentTokenColumn()+s.value.length-2,u}},this.foldAll=function(e,t,n){null==n&&(n=1e5);var r=this.foldWidgets;if(r){t=t||this.getLength();for(var i=e=e||0;i=e){i=s.end.row;try{var o=this.addFold("...",s);o&&(o.collapseChildren=n)}catch(e){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};for(var r,i=e-1;i>=0;){var s=n[i];if(null==s&&(s=n[i]=this.getFoldWidget(i)),"start"==s){var o=this.getFoldWidgetRange(i);if(r||(r=o),o&&o.end.row>=e)break}i--}return{range:-1!==i&&o,firstRange:r}},this.onFoldWidgetClick=function(e,t){var n={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var r=t.target||t.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),r=this.getLine(e),i="end"===n?-1:1,s=this.getFoldAt(e,-1===i?0:r.length,i);if(s)return t.children||t.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()&&(s=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(s.range))return this.removeFold(s),s;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,u=a.range.end.row;this.foldAll(l,u,t.all?1e4:0)}else t.children?(u=o?o.end.row:this.getLength(),this.foldAll(e+1,u,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var r=this.getParentFoldRangeData(t,!0);if(n=r.range||r.firstRange){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold("...",n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){"use strict";var r=e("../token_iterator").TokenIterator,i=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(""==n)return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t,n=this.getLine(e.row),r=!0,s=n.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(o||(s=n.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),r=!1),!o)return null;if(o[1]){if(!(a=this.$findClosingBracket(o[1],e)))return null;t=i.fromPoints(e,a),r||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a;if(!(a=this.$findOpeningBracket(o[2],e)))return null;t=i.fromPoints(a,e),r||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn()-2,u=a.value;;){for(;l>=0;){var c=u.charAt(l);if(c==i){if(0==(s-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else c==e&&(s+=1);l-=1}do{a=o.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(u=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn();;){for(var u=a.value,c=u.length;ln&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>1,s=e[i];if(t>s)n=i+1;else{if(!(t=t);s++);return(n=r[s])?(n.index=s,n.start=i-n.value.length,n):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe)),r)var i=this.tokenRe;else i=/^\s+$/.test(n.slice(t-1,t+1))?/\s/:this.nonTokenRe;var s=t;if(s>0){do{s--}while(s>=0&&n.charAt(s).match(i));s++}for(var o=t;oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,s=this.$foldData[i],o=s?s.start.row:1/0,a=t.length,l=0;lo){if((l=s.end.row+1)>=a)break;o=(s=this.$foldData[i++])?s.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>r&&(r=n[l])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var r=e[n];"insert"==r.action||"remove"==r.action?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;ne.end.column&&(s.start.column+=u),s.end.row==e.end.row&&s.end.column>e.end.column&&(s.end.column+=u)),o&&s.start.row>=e.end.row&&(s.start.row+=o,s.end.row+=o)}if(s.end=this.insert(s.start,r),i.length){var a=e.start,l=s.start,u=(o=l.row-a.row,l.column-a.column);this.addFolds(i.map(function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=u),e.end.row==a.row&&(e.end.column+=u),e.start.row+=o,e.end.row+=o,e}))}return s},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},this.outdentRows=function(e){for(var t=e.collapseRows(),n=new c(0,0,0,0),r=this.getTabSize(),i=t.start.row;i<=t.end.row;++i){var s=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o0){var i;if((i=this.getRowFoldEnd(t+n))>this.doc.getLength()-1)return 0;r=i-t}else e=this.$clipRowToDocument(e),r=(t=this.$clipRowToDocument(t))-e+1;var s=new c(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(e){return(e=e.clone()).start.row+=r,e.end.row+=r,e}),a=0==n?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+r,a),o.length&&this.addFolds(o),r},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1&&(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,i=e.end,s=r.row,o=i.row,a=o-s,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[t?"$wrapData":"$rowLengthCache"].splice(s,a);var u=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var c=0;if(m=this.getFoldLine(i.row)){m.addRemoveChars(i.row,i.column,r.column-i.column),m.shiftRow(-a);var h=this.getFoldLine(s);h&&h!==m&&(h.merge(m),m=h),c=u.indexOf(m)+1}for(;c=i.row&&m.shiftRow(-a);o=s}else{var d=Array(a);d.unshift(s,0);var f=t?this.$wrapData:this.$rowLengthCache;if(f.splice.apply(f,d),u=this.$foldData,c=0,m=this.getFoldLine(s)){var p=m.range.compareInside(r.row,r.column);0==p?(m=m.split(r.row,r.column))&&(m.shiftRow(a),m.addRemoveChars(o,0,i.column-r.column)):-1==p&&(m.addRemoveChars(s,0,i.column-r.column),m.shiftRow(a)),c=u.indexOf(m)+1}for(;c=s&&m.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===n&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(m=this.getFoldLine(s))&&m.addRemoveChars(s,r.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),l},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(n,r){var i,s,o=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,u=this.$wrapLimit,c=n;for(r=Math.min(r,o.length-1);c<=r;)(s=this.getFoldLine(c,s))?(i=[],s.walk(function(n,r,s,a){var l;if(null!=n){(l=this.$getDisplayTokens(n,i.length))[0]=e;for(var u=1;u=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}this.$computeWrapSplits=function(n,r,i){if(0==n.length)return[];var s=[],o=n.length,a=0,l=0,u=this.$wrapAsCode,c=this.$indentedSoftWrap,h=r<=Math.max(2*i,8)||!1===c?0:Math.floor(r/2);function d(e){for(var t=e-a,r=a;rr-f;){var p=a+r-f;if(n[p-1]>=10&&n[p]>=10)d(p);else if(n[p]!=e&&n[p]!=t){for(var m=Math.max(p-(r-(r>>2)),a-1);p>m&&n[p]m&&n[p]m&&9==n[p];)p--}else for(;p>m&&n[p]<10;)p--;p>m?d(++p):(2==n[p=a+r]&&p--,d(p-f))}else{for(;p!=a-1&&n[p]!=e;p--);if(p>a){d(p);continue}for(p=a+r;p39&&o<48||o>57&&o<64?i.push(9):o>=4352&&n(o)?i.push(1,2):i.push(1)}return i},this.$getStringScreenWidth=function(e,t,r){if(0==t)return[0,0];var i,s;for(null==t&&(t=1/0),r=r||0,s=0;s=4352&&n(i)?r+=2:r+=1,!(r>t));s++);return[r,s]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0){a=u[c],s=this.$docRowCache[c];var d=e>u[h-1]}else d=!h;for(var f=this.getLength()-1,p=this.getNextFoldLine(s),m=p?p.start.row:1/0;a<=e&&!(a+(l=this.getRowLength(s))>e||s>=f);)a+=l,++s>m&&(s=p.end.row+1,m=(p=this.getNextFoldLine(s,p))?p.start.row:1/0),d&&(this.$docRowCache.push(s),this.$screenRowCache.push(a));if(p&&p.start.row<=s)r=this.getFoldDisplayLine(p),s=p.start.row;else{if(a+l<=e||s>f)return{row:f,column:this.getLine(f).length};r=this.getLine(s),p=null}var g=0,E=Math.floor(e-a);if(this.$useWrapMode){var v=this.$wrapData[s];v&&(i=v[E],E>0&&v.length&&(g=v.indent,o=v[E-1]||v[v.length-1],r=r.substring(o)))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+E,s,E)&&(t=this.$bidiHandler.offsetToCol(n)),o+=this.$getStringScreenWidth(r,t-g)[1],this.$useWrapMode&&o>=i&&(o=i-1),p?p.idxToPosition(o):{row:s,column:o}},this.documentToScreenPosition=function(e,t){if(void 0===t)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r,i=0,s=null;(r=this.getFoldAt(e,t,1))&&(e=r.start.row,t=r.start.column);var o,a=0,l=this.$docRowCache,u=this.$getRowCacheIndex(l,e),c=l.length;if(c&&u>=0){a=l[u],i=this.$screenRowCache[u];var h=e>l[c-1]}else h=!c;for(var d=this.getNextFoldLine(a),f=d?d.start.row:1/0;a=f){if((o=d.end.row+1)>e)break;f=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;i+=this.getRowLength(a),a=o,h&&(this.$docRowCache.push(a),this.$screenRowCache.push(i))}var p="";d&&a>=f?(p=this.getFoldDisplayLine(d,e,t),s=d.start.row):(p=this.getLine(e).substring(0,t),s=e);var m=0;if(this.$useWrapMode){var g=this.$wrapData[s];if(g){for(var E=0;p.length>=g[E];)i++,E++;p=p.substring(g[E-1]||0,p.length),m=E>0?g.indent:0}}return{row:i,column:m+this.$getStringScreenWidth(p)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,r=0,i=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);ri&&(r=t.end.row+1,i=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var o=this.$foldData,a=0;an);s++);return[r,s]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=n}.call(p.prototype),e("./edit_session/folding").Folding.call(p.prototype),e("./edit_session/bracket_match").BracketMatch.call(p.prototype),o.defineOptions(p.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=p}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(){this.$options={}};(function(){this.set=function(e){return i.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i,o){return r=new s(e,n,i,o),!(n==o&&t.start&&t.start.start&&0!=t.skipCurrent&&r.isEqual(t.start)&&(r=null,1))}),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],a=t.re;if(t.$isMultiLine){var l,u=a.length,c=i.length-u;e:for(var h=a.offset||0;h<=c;h++){for(var d=0;dm||(o.push(l=new s(h,m,h+u-1,g)),u>2&&(h=h+u-2))}}else for(var E=0;ES&&o[d].end.row==n.end.row;)d--;for(o=o.slice(E,d+1),E=0,d=o.length;E=a;n--)if(h(n,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(n=l,a=o.row;n>=a;n--)if(h(n,Number.MAX_VALUE,e))return}};else u=function(e){var n=o.row;if(!h(n,o.column,e)){for(n+=1;n<=l;n++)if(h(n,0,e))return;if(0!=t.wrap)for(n=a,l=o.row;n<=l;n++)if(h(n,0,e))return}};if(t.$isMultiLine)var c=n.length,h=function(t,i,s){var o=r?t-c+1:t;if(!(o<0)){var a=e.getLine(o),l=a.search(n[0]);if(!(!r&&li))return!!s(o,l,o+c-1,h)||void 0}}};else h=r?function(t,r,i){var s,o=e.getLine(t),a=[],l=0;for(n.lastIndex=0;s=n.exec(o);){var u=s[0].length;if(l=s.index,!u){if(l>=o.length)break;n.lastIndex=l+=1}if(s.index+u>r)break;a.push(s.index,u)}for(var c=a.length-1;c>=0;c-=2){var h=a[c-1];if(i(t,h,t,h+(u=a[c])))return!0}}:function(t,r,i){var s,o,a=e.getLine(t);for(n.lastIndex=r;o=n.exec(a);){var l=o[0].length;if(i(t,s=o.index,t,s+l))return!0;if(!l&&(n.lastIndex=s+=1,s>=a.length))return!1}};return{forEach:u}}}).call(o.prototype),t.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/keys"),i=e("../lib/useragent"),s=r.KEY_MODS;function o(e,t){this.platform=t||(i.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function a(e,t){o.call(this,e,t),this.$singleCommand=!1}a.prototype=o.prototype,function(){function e(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var n=e&&("string"==typeof e?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var s=r[i];if(s==e)delete r[i];else if(Array.isArray(s)){var o=s.indexOf(e);-1!=o&&(s.splice(o,1),1==s.length&&(r[i]=s[0]))}}},this.bindKey=function(e,t,n){if("object"==typeof e&&e&&(null==n&&(n=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach(function(e){var r="";if(-1!=e.indexOf(" ")){var i=e.split(/\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=s[t.hashId]+t.key;r+=(r?" ":"")+n,this._addCommandToBinding(r,"chainKeys")},this),r+=" "}var o=this.parseKeys(e),a=s[o.hashId]+o.key;this._addCommandToBinding(r+a,t,n)},this)},this._addCommandToBinding=function(t,n,r){var i,s=this.commandKeyBinding;if(n)if(!s[t]||this.$singleCommand)s[t]=n;else{Array.isArray(s[t])?-1!=(i=s[t].indexOf(n))&&s[t].splice(i,1):s[t]=[s[t]],"number"!=typeof r&&(r=e(n));var o=s[t];for(i=0;ir);i++);o.splice(i,0,n)}else delete s[t]},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(n){if("string"==typeof n)return this.bindKey(n,t);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=t),this.addCommand(n))}},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),i=r[n];if(r.FUNCTION_KEYS[i])n=r.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:n.toUpperCase(),hashId:-1}}for(var s=0,o=t.length;o--;){var a=r.KEY_MODS[t[o]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[o]+" in "+e),!1;s|=a}return{key:n,hashId:s}},this.findKeyCommand=function(e,t){var n=s[e]+t;return this.commandKeyBinding[n]},this.handleKeyboard=function(e,t,n,r){if(!(r<0)){var i=s[t]+n,o=this.commandKeyBinding[i];return e.$keyChain&&(e.$keyChain+=" "+i,o=this.commandKeyBinding[e.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(e.$keyChain&&(t&&4!=t||1!=n.length?(-1==t||r>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-i.length-1)),{command:o}):(e.$keyChain=e.$keyChain||i,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(o.prototype),t.HashHandler=o,t.MultiHashHandler=a}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){i.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};r.inherits(o,i),function(){r.implement(this,s),this.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var i={editor:t,command:e,args:n};return i.returnValue=this._emit("exec",i),this._signal("afterExec",i),!1!==i.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map(function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=e("../config"),s=e("../range").Range;function o(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(e){i.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,a=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(n.row),u=n.row+1;u<=i.row+1;u++){var c=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(u)));0!==c.length&&(c=" "+c),l+=c}i.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;o=i.lastRow||r.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var i=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&-1!==n.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var n=this;E.loadModule(["keybinding",e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||i.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=t.findMatchingBracket(e.getCursorPosition());if(n)var r=new f(n.row,n.column,n.row,n.column+1);else t.$mode.getMatching&&(r=t.$mode.getMatching(e.session));r&&(t.$bracketHighlight=t.addMarker(r,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=e.getCursorPosition(),r=new v(e.session,n.row,n.column),i=r.getCurrentToken();if(!i||!/\b(?:tag-open|tag-name)/.test(i.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1==i.type.indexOf("tag-open")||(i=r.stepForward())){var s=i.value,o=0,a=r.stepBackward();if("<"==a.value)do{a=i,(i=r.stepForward())&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"=0);else{do{i=a,a=r.stepBackward(),i&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var n=new f(e.row,e.column,e.row,1/0);n.id=t.addMarker(n,"ace_active-line","screenLine"),t.$highlightLineMarker=n}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var n=t.start.column,r=t.end.column,i=e.getLine(t.start.row),s=i.substring(n,r);if(!(s.length>5e3)&&/[\w\d]/.test(s)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),a=i.substring(n-1,r+1);if(o.test(a))return o}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var r=this.selection.getAllRanges(),i=0;ia.search(/\S|$/)){var l=a.substr(i.column).search(/\S|$/);n.doc.removeInLine(i.row,i.column,i.column+l)}}this.clearSelection();var u=i.column,c=n.getState(i.row),h=(a=n.getLine(i.row),r.checkOutdent(c,a,e));if(n.insert(i,e),s&&s.selection&&(2==s.selection.length?this.selection.setSelectionRange(new f(i.row,u+s.selection[0],i.row,u+s.selection[1])):this.selection.setSelectionRange(new f(i.row+s.selection[0],s.selection[1],i.row+s.selection[2],s.selection[3]))),n.getDocument().isNewLine(e)){var d=r.getNextLineIndent(c,a.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},d)}h&&r.autoOutdent(c,n,i.row)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(e,t){var n;(t.extendLeft||t.extendRight)&&((n=this.selection.getRange()).start.column-=t.extendLeft,n.end.column+=t.extendRight,this.selection.setRange(n),e||n.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((n=this.selection.getRange()).start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,"deletion",this,n,t);if(0===t.end.column){var s=n.getTextRange(t);if("\n"==s[s.length-1]){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var n,r,i=this.session.getLine(e.row);tt.toLowerCase()?1:0});var i=new f(0,0,0,0);for(r=e.first;r<=e.last;r++){var s=t.getLine(r);i.start.row=r,i.end.row=r,i.end.column=s.length,t.replace(i,n[r-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var r=this.session.getLine(e);n.lastIndex=t)return{value:i[0],start:i.index,end:i.index+i[0].length}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new f(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var s=this.getNumberAt(t,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,a=s.start+s.value.length-o,l=parseFloat(s.value);l*=Math.pow(10,a),o!==s.end&&n=a&&o<=l&&(n=t,u.selection.clearSelection(),u.moveCursorTo(e,a+r),u.selection.selectTo(e,l+r)),a=l});for(var c,h=this.$toggleWordPairs,d=0;df+1)break;f=p.last}for(c--,a=this.session.$moveLines(d,f,t?0:e),t&&-1==e&&(h=c+1);h<=c;)o[h].moveBy(a,0),h++;t||(a=0),l+=a}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);!0===t?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):!1===t&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,i*r.lineHeight),null!=t&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new v(this.session,n.row,n.column),i=r.getCurrentToken(),s=i||r.stepForward();if(s){var o,a,l=!1,u={},c=n.column-s.start,h={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;c=0;--s)this.$tryReplace(n[s],e)&&r++;return this.selection.setSelectionRange(i),r},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return null!==(t=this.$search.replace(n,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&r.mixin(t,e);var i=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(i)||this.$search.$options.needle)||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var s=this.$search.find(this.session);return t.preventScroll?s:s?(this.revealRange(s,n),s):(t.backwards?i.start=i.end:i.end=i.start,void this.selection.setRange(i))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(e){var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var s=this.on("changeSelection",function(){r=!0}),o=this.renderer.on("beforeRender",function(){r&&(t=n.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,s=e.$cursorLayer.$pixelPos,o=e.layerConfig,a=s.top-o.offset;null!=(r=s.top>=0&&a+t.top<0||!(s.topwindow.innerHeight)&&null)&&(i.style.top=a+"px",i.style.left=s.left+"px",i.style.height=o.lineHeight+"px",i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",o))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,i.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},this.prompt=function(e,t,n){var r=this;E.loadModule("./ext/prompt",function(i){i.prompt(r,e,t,n)})}}.call(D.prototype),E.defineOptions(D.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?S.attach(this):S.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?S.attach(this):S.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.renderer.$composition||this.getValue();if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),i.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!e&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),i.addCssClass(this.container,"ace_hasPlaceholder");var t=i.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var S={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=D}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,n){this.$fromUndo||e!=this.$lastDelta&&(!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,r=n.length;r--;){var i=n[r][0];if(i.id<=e)break;i.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?a(e):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(r.prototype);var i=e("./range").Range,s=i.comparePoints;function o(e){return{row:e.row,column:e.column}}function a(e){if(e=e||this,Array.isArray(e))return e.map(a).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function u(e,t){var n="insert"==e.action,r="insert"==t.action;if(n&&r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}else if(!n&&r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(!n&&!r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}return[t,e]}function c(e,t){for(var n=e.length;n--;)for(var r=0;r=0?d(e,t,-1):(s(e.start,t.start)<=0||d(e,i.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!n&&r)s(t.start,e.end)>=0?d(t,e,-1):(s(t.start,e.start)<=0||d(t,i.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{var o,a;if(!(s(t.end,e.start)<=0))return s(e.start,t.start)<0&&(o=e,e=p(e,t.start)),s(e.end,t.end)>0&&(a=p(e,t.end)),f(t.end,e.start,e.end,-1),a&&!o&&(e.lines=a.lines,e.start=a.start,e.end=a.end,a=e),[t,o,a].filter(Boolean);d(e,t,-1)}return[t,e]}function d(e,t,n){f(e.start,t.start,t.end,n),f(e.end,t.start,t.end,n)}function f(e,t,n,r){e.row==(1==r?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function p(e,t){var n=e.lines,r=e.end;e.end=o(t);var i=e.end.row-e.start.row,s=n.splice(i,n.length),a=i?t.column:t.column-e.start.column;return n.push(s[0].substring(0,a)),s[0]=s[0].substr(a),{start:o(t),end:r,lines:s,action:e.action}}function m(e,t){t=function(e){return{start:o(e.start),end:o(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var n=e.length;n--;){for(var r=e[n],i=0;is&&(l=i.end.row+1,s=(i=t.getNextFoldLine(l,i))?i.start.row:1/0),l>r){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,e,this.session,u),this.$lines.push(o)),this.$renderCell(o,e,i,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,i=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(i=t.getLength()+r-1);var s=n?n.getWidth(t,i,e):i.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();(s+=o.left+o.right)===this.gutterWidth||isNaN(s)||(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(r.row>this.$cursorRow){var i=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&i&&i.start.row==t[n-1].row))break;r=t[n-1]}r.element.className="ace_gutter-active-line "+r.element.className,this.$cursorCell=r;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;if(this.oldLastRow=n,!t||r0;i--)this.$lines.shift();if(r>n)for(i=this.session.getFoldedRowCount(n+1,r);i>0;i--)this.$lines.pop();e.firstRowr&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,n){for(var r=[],i=t,s=this.session.getNextFoldLine(i),o=s?s.start.row:1/0;i>o&&(i=s.end.row+1,o=(s=this.session.getNextFoldLine(i,s))?s.start.row:1/0),!(i>n);){var a=this.$lines.createCell(i,e,this.session,u);this.$renderCell(a,e,s,i),r.push(a),i++}return r},this.$renderCell=function(e,t,n,i){var s=e.element,o=this.session,a=s.childNodes[0],l=s.childNodes[1],u=o.$firstLineNumber,c=o.$breakpoints,h=o.$decorations,d=o.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&o.foldWidgets,p=n?n.start.row:Number.MAX_VALUE,m="ace_gutter-cell ";if(this.$highlightGutterLine&&(i==this.$cursorRow||n&&i=p&&this.$cursorRow<=n.end.row)&&(m+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),c[i]&&(m+=c[i]),h[i]&&(m+=h[i]),this.$annotations[i]&&(m+=this.$annotations[i].className),s.className!=m&&(s.className=m),f){var g=f[i];null==g&&(g=f[i]=o.getFoldWidget(i))}if(g){m="ace_fold-widget ace_"+g,"start"==g&&i==p&&in.right-t.right?"foldWidgets":void 0}}).call(l.prototype),t.Gutter=l}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/dom"),s=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){function e(e,t,n,r){return(e?1:0)|(t?2:0)|(n?4:0)|(r?8:0)}this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},this.update=function(e){if(e){var t;for(var n in this.config=e,this.i=0,this.markers){var r=this.markers[n];if(r.range){var i=r.range.clipRows(e.firstRow,e.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),r.renderer){var s=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,s,e)}else"fullLine"==r.type?this.drawFullLineMarker(t,i,r.clazz,e):"screenLine"==r.type?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?"text"==r.type?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+" ace_start ace_br15",e)}else r.update(t,this,this.session,e)}if(-1!=this.i)for(;this.if,c==u),s,c==u?0:1,o)},this.drawMultiLineMarker=function(e,t,n,r,i){var s=this.$padding,o=r.lineHeight,a=this.$getTop(t.start.row,r),l=s+t.start.column*r.characterWidth;if(i=i||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((u=t.clone()).end.row=u.start.row,u.end.column=this.session.getLine(u.start.row).length,this.drawBidiSingleLineMarker(e,u,n+" ace_br1 ace_start",r,null,i)):this.elt(n+" ace_br1 ace_start","height:"+o+"px;right:0;top:"+a+"px;left:"+l+"px;"+(i||"")),this.session.$bidiHandler.isBidiRow(t.end.row)){var u;(u=t.clone()).start.row=u.end.row,u.start.column=0,this.drawBidiSingleLineMarker(e,u,n+" ace_br12",r,null,i)}else{a=this.$getTop(t.end.row,r);var c=t.end.column*r.characterWidth;this.elt(n+" ace_br12","height:"+o+"px;width:"+c+"px;top:"+a+"px;left:"+s+"px;"+(i||""))}if(!((o=(t.end.row-t.start.row-1)*r.lineHeight)<=0)){a=this.$getTop(t.start.row+1,r);var h=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+o+"px;right:0;top:"+a+"px;left:"+s+"px;"+(i||""))}},this.drawSingleLineMarker=function(e,t,n,r,i,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,i,s);var o=r.lineHeight,a=(t.end.column+(i||0)-t.start.column)*r.characterWidth,l=this.$getTop(t.start.row,r),u=this.$padding+t.start.column*r.characterWidth;this.elt(n,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+u+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(e,t,n,r,i,s){var o=r.lineHeight,a=this.$getTop(t.start.row,r),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(n,"height:"+o+"px;width:"+e.width+(i||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-s),this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))},this.drawScreenLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))}}).call(s.prototype),t.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=function(e){this.dom=i,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){r.implement(this,a),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;nc&&(a=l.end.row+1,c=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(a>i);){var h=s[o++];if(h){this.dom.removeChildren(h),this.$renderLine(h,a,a==c&&l),u&&(h.style.top=this.$lines.computeLineTop(a,e,this.session)+"px");var d=e.lineHeight*this.session.getRowLength(a)+"px";h.style.height!=d&&(u=!0,h.style.height=d)}a++}if(u)for(;o0;i--)this.$lines.shift();if(t.lastRow>e.lastRow)for(i=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);i>0;i--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,n){for(var r=[],s=t,o=this.session.getNextFoldLine(s),a=o?o.start.row:1/0;s>a&&(s=o.end.row+1,a=(o=this.session.getNextFoldLine(s,o))?o.start.row:1/0),!(s>n);){var l=this.$lines.createCell(s,e,this.session),u=l.element;this.dom.removeChildren(u),i.setStyle(u.style,"height",this.$lines.computeLineHeight(s,e,this.session)+"px"),i.setStyle(u.style,"top",this.$lines.computeLineTop(s,e,this.session)+"px"),this.$renderLine(u,s,s==a&&o),this.$useLineGroups()?u.className="ace_line_group":u.className="ace_line",r.push(l),s++}return r},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,n=e.lastRow,r=this.$lines;r.getLength();)r.pop();r.push(this.$renderLinesFragment(e,t,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,r){for(var i,o=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),u=0;i=a.exec(r);){var c=i[1],h=i[2],d=i[3],f=i[4],p=i[5];if(o.showInvisibles||!h){var m=u!=i.index?r.slice(u,i.index):"";if(u=i.index+i[0].length,m&&l.appendChild(this.dom.createTextNode(m,this.element)),c){var g=o.session.getScreenTabSize(t+i.index);l.appendChild(o.$tabStrings[g].cloneNode(!0)),t+=g-1}else h?o.showInvisibles?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",v.textContent=s.stringRepeat(o.SPACE_CHAR,h.length),l.appendChild(v)):l.appendChild(this.com.createTextNode(h,this.element)):d?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",v.textContent=s.stringRepeat(o.SPACE_CHAR,d.length),l.appendChild(v)):f?(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className=o.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",v.textContent=o.showInvisibles?o.SPACE_CHAR:f,l.appendChild(v)):p&&(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className="ace_cjk",v.textContent=p,l.appendChild(v))}}if(l.appendChild(this.dom.createTextNode(u?r.slice(u):r,this.element)),this.$textToken[n.type])e.appendChild(l);else{var E="ace_"+n.type.replace(/\./g," ace_"),v=this.dom.createElement("span");"fold"==n.type&&(v.style.width=n.value.length*this.config.characterWidth+"px"),v.className=E,v.appendChild(l),e.appendChild(v)}return t+r.length},this.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(" "==t[0]){for(var i=(r-=r%this.tabSize)/this.tabSize,s=0;s=o;)a=this.$renderToken(l,a,c,h.substring(0,o-r)),h=h.substring(o-r),r=o,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(s.stringRepeat(" ",n.indent),this.element)),a=0,o=n[++i]||Number.MAX_VALUE;0!=h.length&&(r+=h.length,a=this.$renderToken(l,a,c,h))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(e,t){var n=0,r=t[0],i=r.value;this.displayIndentGuides&&(i=this.renderIndentGuide(e,i)),i&&(n=this.$renderToken(e,n,r,i));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,r,i);n=this.$renderToken(e,n,r,i)}},this.$renderOverflowMessage=function(e,t,n,r,i){n&&this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=i?"":"",e.appendChild(s)},this.$renderLine=function(e,t,n){if(n||0==n||(n=this.session.getFoldLine(t)),n)var r=this.$getFoldLineTokens(t,n);else r=this.session.getTokens(t);var i=e;if(r.length){var s=this.session.getRowSplitData(t);s&&s.length?(this.$renderWrappedLine(e,r,s),i=e.lastChild):(i=e,this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i)),this.$renderSimpleLine(i,r))}else this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i));if(this.showInvisibles&&i){n&&(t=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,i.appendChild(o)}},this.$getFoldLineTokens=function(e,t){var n=this.session,r=[],i=n.getTokens(e);return t.walk(function(e,t,s,o,a){null!=e?r.push({type:"fold",value:e}):(a&&(i=n.getTokens(t)),i.length&&function(e,t,n){for(var i=0,s=0;s+e[i].value.lengthn-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),s=t+o.length,i+=1);sn?r.push({type:e[i].type,value:o.substring(0,n-s)}):r.push(e[i]),s+=o.length,i+=1}}(i,o,s))},t.end.row,this.session.getLine(t.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),t.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)r.setStyle(t[n].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){r.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){r.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&r.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}else this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||o.top<0)&&n>1)){var a=this.cursors[i++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,o,e,t[n],this.session):this.isCursorInView(o,e)?(r.setStyle(l,"display","block"),r.translate(a,o.left,o.top),r.setStyle(l,"width",Math.round(e.characterWidth)+"px"),r.setStyle(l,"height",e.lineHeight+"px")):r.setStyle(l,"display","none")}}for(;this.cursors.length>i;)this.removeCursor();var u=this.session.getOverwrite();this.$setOverwrite(u),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(i.prototype),t.Cursor=i}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,a=32768,l=function(e){this.element=i.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){r.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(l.prototype);var u=function(e,t){l.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=i.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};r.inherits(u,l),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>a?(this.coeff=a/e,e=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(u.prototype);var c=function(e,t){l.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};r.inherits(c,l),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(c.prototype),t.ScrollBar=u,t.ScrollBarV=u,t.ScrollBarH=c,t.VScrollBar=u,t.HScrollBar=c}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){"use strict";var r=e("./lib/event"),i=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(r.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(i.prototype),t.RenderLoop=i}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,u=256,c="function"==typeof ResizeObserver,h=200,d=t.FontMetrics=function(e){this.el=i.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.innerHTML=s.stringRepeat("X",u),this.$characterSize={width:0,height:0},c?this.$addObserver():this.checkForSizeChanges()};(function(){r.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){var n=t[0].contentRect;e.checkForSizeChanges({height:n.height,width:n.width/u})}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/u};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.innerHTML=s.stringRepeat(e,u),this.$main.getBoundingClientRect().width/u},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=i.buildDom([e(0,0),e(h,0),e(0,h),e(h,h)],this.el)},this.transformCoordinates=function(e,t){function n(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function r(e,t){return[e[0]-t[0],e[1]-t[1]]}function i(e,t){return[e[0]+t[0],e[1]+t[1]]}function s(e,t){return[e*t[0],e*t[1]]}function o(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=s(1/this.$getZoom(this.el),e)),this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),u=o(this.els[2]),c=o(this.els[3]),d=n(r(c,l),r(c,u),r(i(l,u),i(c,a))),f=s(1+d[0],r(l,a)),p=s(1+d[1],r(u,a));if(t){var m=t,g=d[0]*m[0]/h+d[1]*m[1]/h+1,E=i(s(m[0],f),s(m[1],p));return i(s(1/g/h,E),a)}var v=r(e,a),C=n(r(f,s(d[0],v)),r(p,s(d[1],v)),v);return s(h,C)}}).call(d.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./config"),o=e("./layer/gutter").Gutter,a=e("./layer/marker").Marker,l=e("./layer/text").Text,u=e("./layer/cursor").Cursor,c=e("./scrollbar").HScrollBar,h=e("./scrollbar").VScrollBar,d=e("./renderloop").RenderLoop,f=e("./layer/font_metrics").FontMetrics,p=e("./lib/event_emitter").EventEmitter,m='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);opacity: 0.7;transform-origin: left;text-indent: 10px;}',g=e("./lib/useragent"),E=g.isIE;i.importCssString(m,"ace_editor.css");var v=function(e,t){var n=this;this.container=e||i.createElement("div"),i.addCssClass(this.container,"ace_editor"),i.HI_DPI&&i.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=i.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=i.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=i.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var r=this.$textLayer=new l(this.content);this.canvas=r.element,this.$markerFront=new a(this.content),this.$cursorLayer=new u(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new f(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!g.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,p),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),i.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,n){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,r){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var i=this.container;r||(r=i.clientHeight||i.scrollHeight),n||(n=i.clientWidth||i.scrollWidth);var s=this.$updateCachedSize(e,t,n,r);if(!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var s=0,o=this.$size,a={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if(r&&(e||o.height!=r)&&(o.height=r,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL),n&&(e||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,i.setStyle(this.scrollBarH.element.style,"left",t+"px"),i.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),i.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";i.setStyle(this.scrollBarH.element.style,"right",l),i.setStyle(this.scroller.style,"right",l),i.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(s|=this.CHANGE_FULL)}return o.$dirty=!n||!r,s&&this._signal("resize",a),s},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=i.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=i.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var n=this.$cursorLayer.$pixelPos;if(n){t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var r=this.layerConfig,s=n.top,o=n.left;s-=r.offset;var a=t&&t.useTextareaForIME?this.lineHeight:E?0:1;if(s<0||s>r.height-a)i.translate(this.textarea,0,0);else{var l=1,u=this.$size.height-a;if(t)if(t.useTextareaForIME){var c=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(c)[0]}else s+=this.lineHeight+2;else s+=this.lineHeight;(o-=this.scrollLeft)>this.$size.scrollerWidth-l&&(o=this.$size.scrollerWidth-l),o+=this.gutterWidth+this.margin.left,i.setStyle(e,"height",a+"px"),i.setStyle(e,"width",l+"px"),i.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-l),Math.min(s,u))}}}else i.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},this.setMargin=function(e,t,n,r){var i=this.margin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),i.translate(this.content,-this.scrollLeft,-n.offset);var s=n.width+2*this.$padding+"px",o=n.minHeight+"px";i.setStyle(this.content.style,"width",s),i.setStyle(this.content.style,"height",o)}if(e&this.CHANGE_H_SCROLL&&(i.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender")}else this.$changes|=e},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=!(n<=2*this.lineHeight)&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||r!=this.$vScroll){r!=this.$vScroll&&(this.$vScroll=r,this.scrollBarV.setVisible(r));var i=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,i,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength()*this.lineHeight,i=this.$getLongestLine(),s=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-i-2*this.$padding<0),o=this.$horizScroll!==s;o&&(this.$horizScroll=s,this.scrollBarH.setVisible(s));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,u=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;r+=u;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,r-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,i+2*this.$padding-t.scrollerWidth+c.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-r+u<0||this.scrollTop>c.top),d=a!==h;d&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var f,p,m=this.scrollTop%this.lineHeight,g=Math.ceil(l/this.lineHeight)-1,E=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),v=E+g,C=this.lineHeight;E=e.screenToDocumentRow(E,0);var D=e.getFoldLine(E);D&&(E=D.start.row),f=e.documentToScreenRow(E,0),p=e.getRowLength(E)*C,v=Math.min(e.screenToDocumentRow(v,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(v)*C+p,m=this.scrollTop-f*C;var S=0;return(this.layerConfig.width!=i||o)&&(S=this.CHANGE_H_SCROLL),(o||d)&&(S|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(i=this.$getLongestLine())),this.layerConfig={width:i,padding:this.$padding,firstRow:E,firstRowScreen:f,lastRow:v,lineHeight:C,characterWidth:this.characterWidth,minHeight:l,maxHeight:r,offset:m,gutterOffset:C?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/C)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(i-this.$padding),S},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1||tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t,n){if(0!==this.$size.scrollerHeight){var r=this.$cursorLayer.getPixelPosition(e),i=r.left,s=r.top,o=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+o>s?(t&&l+o>s+this.lineHeight&&(s-=t*this.$size.scrollerHeight),0===s&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):l+this.$size.scrollerHeight-ai?(i=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:a,side:s-a>0?1:-1,offsetX:i}},this.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),a=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),i)},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),s=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+s-this.scrollTop}},this.visualizeFocus=function(){i.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){i.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),e.useTextareaForIME=this.$useTextareaForIME,this.$useTextareaForIME?(i.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),i.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText,this.$composition=null,this.$cursorLayer.element.style.display="")},this.addToken=function(e,t,n,r){var i=this.session;i.bgTokenizer.lines[n]=null;var s={type:t,value:e},o=i.getTokens(n);if(null==r)o.push(s);else for(var a=0,l=0;l50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,n){var r=null,i=!1,a=Object.create(s),u=[],c=new l({messageBuffer:u,terminate:function(){},postMessage:function(e){u.push(e),r&&(i?setTimeout(h):h())}});c.setEmitSync=function(e){i=e};var h=function(){var e=u.shift();e.command?r[e.command].apply(r,e.args):e.event&&a._signal(e.event,e.data)};return a.postMessage=function(e){c.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},o.loadModule(["worker",t],function(e){for(r=new e[n](a);u.length;)h()}),c},t.WorkerClient=l,t.createWorker=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(e,t,n,r,i,s){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,i),this.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,s=t.start.column-this.pos.column;if(this.updateAnchors(e),i&&(this.length+=n),i&&!this.session.$fromUndo)if("insert"===e.action)for(var o=this.others.length-1;o>=0;o--){var a={row:(l=this.others[o]).row,column:l.column+s};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(o=this.others.length-1;o>=0;o--){var l;a={row:(l=this.others[o]).row,column:l.column+s},this.doc.remove(new r(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,i){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),i,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)}},this.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new r,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{n=this.getRange();var r=this.isBackwards(),s=n.start.row,o=n.end.row;if(s==o){if(r)var a=n.end,l=n.start;else a=n.start,l=n.end;return this.addRange(i.fromPoints(l,l)),void this.addRange(i.fromPoints(a,a))}var u=[],c=this.getLineRange(s,!0);c.start.column=n.start.column,u.push(c);for(var h=s+1;h1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(r,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],s=e.column0;)E--;if(E>0)for(var v=0;r[v].isEmpty();)v++;for(var C=E;C>=v;C--)r[C].isEmpty()&&r.splice(C,1)}return r}}.call(s.prototype);var d=e("./editor").Editor;function f(e,t){return e.row==t.row&&e.column==t.column}function p(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",o),e.commands.addCommands(u.defaultCommands),function(e){if(e.textInput){var t=e.textInput.getElement(),n=!1;a.addListener(t,"keydown",function(t){var i=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&i?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&r()}),a.addListener(t,"keyup",r),a.addListener(t,"blur",r)}function r(t){n&&(e.renderer.setMouseCursor(""),n=!1)}}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var r=e[n];if(r.marker){this.session.removeMarker(r.marker);var i=t.indexOf(r);-1!=i&&t.splice(i,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(u.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(u.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?r=n.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?r=n.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});else{var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return r}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var r,i=n&&n.keepOrder,o=1==n||n&&n.$byLines,a=this.session,l=this.selection,u=l.rangeList,c=(i?l:u).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var h=l._eventRegistry;l._eventRegistry={};var d=new s(a);this.inVirtualSelectionMode=!0;for(var f=c.length;f--;){if(o)for(;f>0&&c[f].start.row==c[f-1].end.row;)f--;d.fromOrientedRange(c[f]),d.index=f,this.selection=a.selection=d;var p=e.exec?e.exec(this,t||{}):e(this,t||{});r||void 0===p||(r=p),d.toOrientedRange(c[f])}d.detach(),this.selection=a.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=h,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),r}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],r=0;ro&&(o=n.column),rc?e.insert(r,l.stringRepeat(" ",s-c)):e.remove(new i(r.row,r.column,r.row,r.column-s+c)),t.start.column=t.end.column=o,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var c=this.selection.getRange(),h=c.start.row,d=c.end.row,f=h==d;if(f){var p,m=this.session.getLength();do{p=this.session.getLine(d)}while(/[=:]/.test(p)&&++d0);h<0&&(h=0),d>=m&&(d=m-1)}var g=this.session.removeFullLines(h,d);g=this.$reAlignText(g,f),this.session.insert({row:h,column:0},g.join("\n")+"\n"),f||(c.start.column=0,c.end.column=g[g.length-1].length),this.selection.setRange(c)}},this.$reAlignText=function(e,t){var n,r,i,s=!0,o=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==n?(n=t[1].length,r=t[2].length,i=t[3].length,t):(n+r+i!=t[1].length+t[2].length+t[3].length&&(o=!1),n!=t[1].length&&(s=!1),n>t[1].length&&(n=t[1].length),rt[3].length&&(i=t[3].length),t):[e]}).map(t?u:s?o?function(e){return e[2]?a(n+r-e[2].length)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:u:function(e){return e[2]?a(n)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function a(e){return l.stringRepeat(" ",e)}function u(e){return e[2]?a(n)+e[2]+a(r-e[2].length+i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=p,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){p(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,s=e.getLine(t),o=s.search(i);if(-1!=o){for(var a=n||s.length,l=e.getLength(),u=t,c=t;++tu){var f=e.getLine(c).length;return new r(u,a,c,f)}}},this.openingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i+1},a=e.$findClosingBracket(t,o,s);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>o.row&&(a.row--,a.column=e.getLine(a.row).length),r.fromPoints(o,a)}},this.closingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i},a=e.$findOpeningBracket(t,o);if(a)return a.column++,o.column--,r.fromPoints(a,o)}}).call(i.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}e("./range").Range,function(){this.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(n&&e.action){for(var r=e.data,i=r.start.row,s=r.end.row,o="add"==e.action,a=i+1;a0&&!r[i];)i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=s;o++){var a=r[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var u=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(u-=t.scrollLeft),a.el.style.left=u+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}.call(i.prototype),t.LineWidgets=i}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,n){"use strict";var r=e("../line_widgets").LineWidgets,i=e("../lib/dom"),s=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var o=e.getCursorPosition(),a=o.row,l=n.widgetManager.getWidgetsAtRow(a).filter(function(e){return"errorMarker"==e.type})[0];l?l.destroy():a-=t;var u,c=function(e,t,n){var r=e.getAnnotations().sort(s.comparePoints);if(r.length){var i=function(e,t,n){for(var r=0,i=e.length-1;r<=i;){var s=r+i>>1,o=n(t,e[s]);if(o>0)r=s+1;else{if(!(o<0))return s;i=s-1}}return-(r+1)}(r,{row:t,column:-1},s.comparePoints);i<0&&(i=-i-1),i>=r.length?i=n>0?0:r.length-1:0===i&&n<0&&(i=r.length-1);var o=r[i];if(o&&n){if(o.row===t){do{o=r[i+=n]}while(o&&o.row===t);if(!o)return r.slice()}var a=[];t=o.row;do{a[n<0?"unshift":"push"](o),o=r[i+=n]}while(o&&o.row==t);return a.length&&a}}}(n,a,t);if(c){var h=c[0];o.column=(h.pos&&"number"!=typeof h.column?h.pos.sc:h.column)||0,o.row=h.row,u=e.renderer.$gutterLayer.$annotations[o.row]}else{if(l)return;u={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(o.row),e.selection.moveToPosition(o);var d={row:o.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},f=d.el.appendChild(i.createElement("div")),p=d.el.appendChild(i.createElement("div"));p.className="error_widget_arrow "+u.className;var m=e.renderer.$cursorLayer.getPixelPosition(o).left;p.style.left=m+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",f.className="error_widget "+u.className,f.innerHTML=u.text.join("
"),f.appendChild(i.createElement("div"));var g=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(g),n.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(g),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t,r){"use strict";e("./lib/fixoldbrowsers");var i=e("./lib/dom"),s=e("./lib/event"),o=e("./range").Range,a=e("./editor").Editor,l=e("./edit_session").EditSession,u=e("./undomanager").UndoManager,c=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,t.define=n.amdD,t.edit=function(e,n){if("string"==typeof e){var r=e;if(!(e=document.getElementById(r)))throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof a)return e.env.editor;var o="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;o=l.value,e=i.createElement("pre"),l.parentNode.replaceChild(e,l)}else e&&(o=e.textContent,e.innerHTML="");var u=t.createEditSession(o),h=new a(new c(e),u,n),d={document:u,editor:h,onResize:h.resize.bind(h,null)};return l&&(d.textarea=l),s.addListener(window,"resize",d.onResize),h.on("destroy",function(){s.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),h.container.env=h.env=d,h},t.createEditSession=function(e,t){var n=new l(e,t);return n.setUndoManager(new u),n},t.Range=o,t.Editor=a,t.EditSession=l,t.UndoManager=u,t.VirtualRenderer=c,t.version=t.config.version}),ace.require(["ace/ace"],function(t){for(var n in t&&(t.config.init(!0),t.define=ace.define),window.ace||(window.ace=t),t)t.hasOwnProperty(n)&&(window.ace[n]=t[n]);window.ace.default=window.ace,e&&(e.exports=window.ace)}),e.exports={ace}},247(e,t,n){"use strict";var r=n(982),i=n(159),s=n(961);function o(e){var t="https://react.dev/errors/"+e;if(1P||(e.current=M[P],M[P]=null,P--)}function $(e,t){P++,M[P]=e.current,e.current=t}var G,V,W=B(null),H=B(null),j=B(null),z=B(null);function X(e,t){switch($(j,t),$(H,e),$(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=Eh(t=gh(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(W),$(W,e)}function K(){U(W),U(H),U(j)}function Y(e){null!==e.memoizedState&&$(z,e);var t=W.current,n=Eh(t,e.type);t!==n&&($(H,e),$(W,n))}function q(e){H.current===e&&(U(W),U(H)),z.current===e&&(U(z),ud._currentValue=k)}function Q(e){if(void 0===G)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);G=t&&t[1]||"",V=-1)":-1--i||l[r]!==u[i]){var c="\n"+l[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}}while(1<=r&&0<=i);break}}}finally{Z=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Q(n):""}function ee(e,t){switch(e.tag){case 26:case 27:case 5:return Q(e.type);case 16:return Q("Lazy");case 13:return e.child!==t&&null!==t?Q("Suspense Fallback"):Q("Suspense");case 19:return Q("SuspenseList");case 0:case 15:return J(e.type,!1);case 11:return J(e.type.render,!1);case 1:return J(e.type,!0);case 31:return Q("Activity");default:return""}}function te(e){try{var t="",n=null;do{t+=ee(e,n),n=e,e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var ne=Object.prototype.hasOwnProperty,re=r.unstable_scheduleCallback,ie=r.unstable_cancelCallback,se=r.unstable_shouldYield,oe=r.unstable_requestPaint,ae=r.unstable_now,le=r.unstable_getCurrentPriorityLevel,ue=r.unstable_ImmediatePriority,ce=r.unstable_UserBlockingPriority,he=r.unstable_NormalPriority,de=r.unstable_LowPriority,fe=r.unstable_IdlePriority,pe=r.log,me=r.unstable_setDisableYieldValue,ge=null,Ee=null;function ve(e){if("function"==typeof pe&&me(e),Ee&&"function"==typeof Ee.setStrictMode)try{Ee.setStrictMode(ge,e)}catch(e){}}var Ce=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(De(e)/Se|0)|0},De=Math.log,Se=Math.LN2,Ae=256,_e=262144,ye=4194304;function be(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Te(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var i=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var a=134217727&r;return 0!==a?0!==(r=a&~s)?i=be(r):0!==(o&=a)?i=be(o):n||0!==(n=a&~e)&&(i=be(n)):0!==(a=r&~s)?i=be(a):0!==o?i=be(o):n||0!==(n=r&~e)&&(i=be(n)),0===i?0:0!==t&&t!==i&&0===(t&s)&&((s=i&-i)>=(n=t&-t)||32===s&&4194048&n)?t:i}function Re(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function we(){var e=ye;return!(62914560&(ye<<=1))&&(ye=4194304),e}function Fe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ne(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Le(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ce(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function Oe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ce(n),i=1<=bn),xn=String.fromCharCode(32),wn=!1;function Fn(e,t){switch(e){case"keyup":return-1!==_n.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Ln=!1,On={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function In(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!On[e.type]:"textarea"===t}function kn(e,t,n,r){It?kt?kt.push(r):kt=[r]:It=r,0<(t=nh(t,"onChange")).length&&(n=new tn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Mn=null,Pn=null;function Bn(e){Kc(e,0)}function Un(e){if(ft(Qe(e)))return e}function $n(e,t){if("change"===e)return t}var Gn=!1;if($t){var Vn;if($t){var Wn="oninput"in document;if(!Wn){var Hn=document.createElement("div");Hn.setAttribute("oninput","return;"),Wn="function"==typeof Hn.oninput}Vn=Wn}else Vn=!1;Gn=Vn&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Jn(r)}}function tr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?tr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function nr(e){for(var t=pt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=pt((e=t.contentWindow).document)}return t}function rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var ir=$t&&"documentMode"in document&&11>=document.documentMode,sr=null,or=null,ar=null,lr=!1;function ur(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;lr||null==sr||sr!==pt(r)||(r="selectionStart"in(r=sr)&&rr(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},ar&&Zn(ar,r)||(ar=r,0<(r=nh(or,"onSelect")).length&&(t=new tn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=sr)))}function cr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var hr={animationend:cr("Animation","AnimationEnd"),animationiteration:cr("Animation","AnimationIteration"),animationstart:cr("Animation","AnimationStart"),transitionrun:cr("Transition","TransitionRun"),transitionstart:cr("Transition","TransitionStart"),transitioncancel:cr("Transition","TransitionCancel"),transitionend:cr("Transition","TransitionEnd")},dr={},fr={};function pr(e){if(dr[e])return dr[e];if(!hr[e])return e;var t,n=hr[e];for(t in n)if(n.hasOwnProperty(t)&&t in fr)return dr[e]=n[t];return e}$t&&(fr=document.createElement("div").style,"AnimationEvent"in window||(delete hr.animationend.animation,delete hr.animationiteration.animation,delete hr.animationstart.animation),"TransitionEvent"in window||delete hr.transitionend.transition);var mr=pr("animationend"),gr=pr("animationiteration"),Er=pr("animationstart"),vr=pr("transitionrun"),Cr=pr("transitionstart"),Dr=pr("transitioncancel"),Sr=pr("transitionend"),Ar=new Map,_r="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function yr(e,t){Ar.set(e,t),nt(t,[e])}_r.push("scrollEnd");var br="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Tr=[],Rr=0,xr=0;function wr(){for(var e=Rr,t=xr=Rr=0;t>=o,i-=o,ti=1<<32-Ce(t)+i|n<p?(m=h,h=null):m=h.sibling;var g=f(i,h,a[p],l);if(null===g){null===h&&(h=m);break}e&&h&&null===g.alternate&&t(i,h),o=s(g,o,p),null===c?u=g:c.sibling=g,c=g,h=m}if(p===a.length)return n(i,h),ci&&ri(i,p),u;if(null===h){for(;pm?(g=p,p=null):g=p.sibling;var C=f(i,p,v.value,u);if(null===C){null===p&&(p=g);break}e&&p&&null===C.alternate&&t(i,p),a=s(C,a,m),null===h?c=C:h.sibling=C,h=C,p=g}if(v.done)return n(i,p),ci&&ri(i,m),c;if(null===p){for(;!v.done;m++,v=l.next())null!==(v=d(i,v.value,u))&&(a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return ci&&ri(i,m),c}for(p=r(p);!v.done;m++,v=l.next())null!==(v=E(p,i,m,v.value,u))&&(e&&null!==v.alternate&&p.delete(null===v.key?m:v.key),a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return e&&p.forEach(function(e){return t(i,e)}),ci&&ri(i,m),c}(l,u,c=C.call(c),h)}if("function"==typeof c.then)return v(l,u,ls(c),h);if(c.$$typeof===D)return v(l,u,Li(l,c),h);cs(l,c)}return"string"==typeof c&&""!==c||"number"==typeof c||"bigint"==typeof c?(c=""+c,null!==u&&6===u.tag?(n(l,u.sibling),(h=i(u,c)).return=l,l=h):(n(l,u),(h=Wr(c,l.mode,h)).return=l,l=h),a(l)):n(l,u)}return function(e,t,n,r){try{as=0;var i=v(e,t,n,r);return os=null,i}catch(t){if(t===qi||t===Zi)throw t;var s=Pr(29,t,null,e.mode);return s.lanes=r,s.return=e,s}}}var ds=hs(!0),fs=hs(!1),ps=!1;function ms(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Es(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vs(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&du){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ir(e),Or(e,null,n),t}return Fr(e,r,t,n),Ir(e)}function Cs(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Oe(e,n)}}function Ds(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===s?i=s=o:s=s.next=o,n=n.next}while(null!==n);null===s?i=s=t:s=s.next=t}else i=s=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ss=!1;function As(){if(Ss&&null!==Wi)throw Wi}function _s(e,t,n,r){Ss=!1;var i=e.updateQueue;ps=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var l=a,u=l.next;l.next=null,null===o?s=u:o.next=u,o=l;var c=e.alternate;null!==c&&(a=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===a?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l)}if(null!==s){var h=i.baseState;for(o=0,c=u=l=null,a=s;;){var f=-536870913&a.lane,p=f!==a.lane;if(p?(mu&f)===f:(r&f)===f){0!==f&&f===Vi&&(Ss=!0),null!==c&&(c=c.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var m=e,g=a;f=t;var E=n;switch(g.tag){case 1:if("function"==typeof(m=g.payload)){h=m.call(E,h,f);break e}h=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(f="function"==typeof(m=g.payload)?m.call(E,h,f):m))break e;h=d({},h,f);break e;case 2:ps=!0}}null!==(f=a.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=i.callbacks)?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===c?(u=c=p,l=h):c=c.next=p,o|=f;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(p=a).next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}null===c&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null===s&&(i.shared.lanes=0),_u|=o,e.lanes=o,e.memoizedState=h}}function ys(e,t){if("function"!=typeof e)throw Error(o(191,e));e.call(t)}function bs(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;es?s:8;var o,a,l,u=O.T,c={};O.T=c,ca(e,!1,t,n);try{var h=i(),d=O.S;null!==d&&d(c,h),null!==h&&"object"==typeof h&&"function"==typeof h.then?ua(e,t,(o=r,a=[],l={status:"pending",value:null,reason:null,then:function(e){a.push(e)}},h.then(function(){l.status="fulfilled",l.value=o;for(var e=0;e<\/script>",s=s.removeChild(s.firstChild);break;case"select":s="string"==typeof r.is?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s="string"==typeof r.is?a.createElement(i,{is:r.is}):a.createElement(i)}}s[$e]=t,s[Ge]=r;e:for(a=t.child;null!==a;){if(5===a.tag||6===a.tag)s.appendChild(a.stateNode);else if(4!==a.tag&&27!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;null===a.sibling;){if(null===a.return||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=s;e:switch(hh(s,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&ol(t)}}return hl(t),al(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&ol(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));if(e=j.current,Ei(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(i=li))switch(i.tag){case 27:case 5:r=i.memoizedProps}e[$e]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||lh(e.nodeValue,n)))||pi(t,!0)}else(e=mh(e).createTextNode(r))[$e]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(r=Ei(t),null!==n){if(null===e){if(!r)throw Error(o(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(o(557));e[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Ps(t),t):(Ps(t),null);if(128&t.flags)throw Error(o(558))}return hl(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=Ei(t),null!==r&&null!==r.dehydrated){if(null===e){if(!i)throw Error(o(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(o(317));i[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),i=!1}else i=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return 256&t.flags?(Ps(t),t):(Ps(t),null)}return Ps(t),128&t.flags?(t.lanes=n,t):(n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(i=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(i=r.alternate.memoizedState.cachePool.pool),s=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(s=r.memoizedState.cachePool.pool),s!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ul(t,t.updateQueue),hl(t),null);case 4:return K(),null===e&&Zc(t.stateNode.containerInfo),hl(t),null;case 10:return bi(t.type),hl(t),null;case 19:if(U(Bs),null===(r=t.memoizedState))return hl(t),null;if(i=!!(128&t.flags),null===(s=r.rendering))if(i)cl(r,!1);else{if(0!==Au||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(s=Us(e))){for(t.flags|=128,cl(r,!1),e=s.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)$r(n,e),n=n.sibling;return $(Bs,1&Bs.current|2),ci&&ri(t,r.treeForkCount),t.child}e=e.sibling}null!==r.tail&&ae()>Ou&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=Us(s))){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),cl(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!ci)return hl(t),null}else 2*ae()-r.renderingStartTime>Ou&&536870912!==n&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=r.last)?e.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ae(),e.sibling=null,n=Bs.current,$(Bs,i?1&n|2:1&n),ci&&ri(t,r.treeForkCount),e):(hl(t),null);case 22:case 23:return Ps(t),Fs(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?!!(536870912&n)&&!(128&t.flags)&&(hl(t),6&t.subtreeFlags&&(t.flags|=8192)):hl(t),null!==(n=t.updateQueue)&&ul(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&U(zi),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),bi(Pi),hl(t),null;case 25:case 30:return null}throw Error(o(156,t.tag))}function fl(e,t){switch(oi(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return bi(Pi),K(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return q(t),null;case 31:if(null!==t.memoizedState){if(Ps(t),null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Ps(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return U(Bs),null;case 4:return K(),null;case 10:return bi(t.type),null;case 22:case 23:return Ps(t),Fs(),null!==e&&U(zi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return bi(Pi),null;default:return null}}function pl(e,t){switch(oi(t),t.tag){case 3:bi(Pi),K();break;case 26:case 27:case 5:q(t);break;case 4:K();break;case 31:null!==t.memoizedState&&Ps(t);break;case 13:Ps(t);break;case 19:U(Bs);break;case 10:bi(t.type);break;case 22:case 23:Ps(t),Fs(),null!==e&&U(zi);break;case 24:bi(Pi)}}function ml(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var s=n.create,o=n.inst;r=s(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ac(t,t.return,e)}}function gl(e,t,n){try{var r=t.updateQueue,i=null!==r?r.lastEffect:null;if(null!==i){var s=i.next;r=s;do{if((r.tag&e)===e){var o=r.inst,a=o.destroy;if(void 0!==a){o.destroy=void 0,i=t;var l=n,u=a;try{u()}catch(e){Ac(i,l,e)}}}r=r.next}while(r!==s)}}catch(e){Ac(t,t.return,e)}}function El(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{bs(t,n)}catch(t){Ac(e,e.return,t)}}}function vl(e,t,n){n.props=Aa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ac(e,t,n)}}function Cl(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(n){Ac(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(n){Ac(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){Ac(e,t,n)}else n.current=null}function Sl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ac(e,e.return,t)}}function Al(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,a=null,l=null,u=null,c=null,h=null;for(p in n){var d=n[p];if(n.hasOwnProperty(p)&&null!=d)switch(p){case"checked":case"value":break;case"defaultValue":u=d;default:r.hasOwnProperty(p)||uh(e,t,p,null,r,d)}}for(var f in r){var p=r[f];if(d=n[f],r.hasOwnProperty(f)&&(null!=p||null!=d))switch(f){case"type":s=p;break;case"name":i=p;break;case"checked":c=p;break;case"defaultChecked":h=p;break;case"value":a=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(o(137,t));break;default:p!==d&&uh(e,t,f,p,r,d)}}return void Et(e,a,l,u,c,h,s,i);case"select":for(s in p=a=l=f=null,n)if(u=n[s],n.hasOwnProperty(s)&&null!=u)switch(s){case"value":break;case"multiple":p=u;default:r.hasOwnProperty(s)||uh(e,t,s,null,r,u)}for(i in r)if(s=r[i],u=n[i],r.hasOwnProperty(i)&&(null!=s||null!=u))switch(i){case"value":f=s;break;case"defaultValue":l=s;break;case"multiple":a=s;default:s!==u&&uh(e,t,i,s,r,u)}return t=l,n=a,r=p,void(null!=f?Dt(e,!!n,f,!1):!!r!=!!n&&(null!=t?Dt(e,!!n,t,!0):Dt(e,!!n,n?[]:"",!1)));case"textarea":for(l in p=f=null,n)if(i=n[l],n.hasOwnProperty(l)&&null!=i&&!r.hasOwnProperty(l))switch(l){case"value":case"children":break;default:uh(e,t,l,null,r,i)}for(a in r)if(i=r[a],s=n[a],r.hasOwnProperty(a)&&(null!=i||null!=s))switch(a){case"value":f=i;break;case"defaultValue":p=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(o(91));break;default:i!==s&&uh(e,t,a,i,r,s)}return void St(e,f,p);case"option":for(var m in n)f=n[m],n.hasOwnProperty(m)&&null!=f&&!r.hasOwnProperty(m)&&("selected"===m?e.selected=!1:uh(e,t,m,null,r,f));for(u in r)f=r[u],p=n[u],!r.hasOwnProperty(u)||f===p||null==f&&null==p||("selected"===u?e.selected=f&&"function"!=typeof f&&"symbol"!=typeof f:uh(e,t,u,f,r,p));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)f=n[g],n.hasOwnProperty(g)&&null!=f&&!r.hasOwnProperty(g)&&uh(e,t,g,null,r,f);for(c in r)if(f=r[c],p=n[c],r.hasOwnProperty(c)&&f!==p&&(null!=f||null!=p))switch(c){case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(o(137,t));break;default:uh(e,t,c,f,r,p)}return;default:if(Rt(t)){for(var E in n)f=n[E],n.hasOwnProperty(E)&&void 0!==f&&!r.hasOwnProperty(E)&&ch(e,t,E,void 0,r,f);for(h in r)f=r[h],p=n[h],!r.hasOwnProperty(h)||f===p||void 0===f&&void 0===p||ch(e,t,h,f,r,p);return}}for(var v in n)f=n[v],n.hasOwnProperty(v)&&null!=f&&!r.hasOwnProperty(v)&&uh(e,t,v,null,r,f);for(d in r)f=r[d],p=n[d],!r.hasOwnProperty(d)||f===p||null==f&&null==p||uh(e,t,d,f,r,p)}(r,e.type,n,t),r[Ge]=t}catch(t){Ac(e,e.return,t)}}function _l(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&bh(e.type)||4===e.tag}function yl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||_l(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&bh(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function bl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Nt));else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(bl(e,t,n),e=e.sibling;null!==e;)bl(e,t,n),e=e.sibling}function Tl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Tl(e,t,n),e=e.sibling;null!==e;)Tl(e,t,n),e=e.sibling}function Rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);hh(t,r,n),t[$e]=e,t[Ge]=n}catch(t){Ac(e,e.return,t)}}var xl=!1,wl=!1,Fl=!1,Nl="function"==typeof WeakSet?WeakSet:Set,Ll=null;function Ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Xl(e,n),4&r&&ml(5,n);break;case 1:if(Xl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){Ac(n,n.return,e)}else{var i=Aa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ac(n,n.return,e)}}64&r&&El(n),512&r&&Cl(n,n.return);break;case 3:if(Xl(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{bs(e,t)}catch(e){Ac(n,n.return,e)}}break;case 27:null===t&&4&r&&Rl(n);case 26:case 5:Xl(e,n),null===t&&4&r&&Sl(n),512&r&&Cl(n,n.return);break;case 12:Xl(e,n);break;case 31:Xl(e,n),4&r&&Ul(e,n);break;case 13:Xl(e,n),4&r&&$l(e,n),64&r&&null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Tc.bind(null,n));break;case 22:if(!(r=null!==n.memoizedState||xl)){t=null!==t&&null!==t.memoizedState||wl,i=xl;var s=wl;xl=r,(wl=t)&&!s?Yl(e,n,!!(8772&n.subtreeFlags)):Xl(e,n),xl=i,wl=s}break;case 30:break;default:Xl(e,n)}}function Il(e){var t=e.alternate;null!==t&&(e.alternate=null,Il(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&Ke(t),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var kl=null,Ml=!1;function Pl(e,t,n){for(n=n.child;null!==n;)Bl(e,t,n),n=n.sibling}function Bl(e,t,n){if(Ee&&"function"==typeof Ee.onCommitFiberUnmount)try{Ee.onCommitFiberUnmount(ge,n)}catch(e){}switch(n.tag){case 26:wl||Dl(n,t),Pl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:wl||Dl(n,t);var r=kl,i=Ml;bh(n.type)&&(kl=n.stateNode,Ml=!1),Pl(e,t,n),Ph(n.stateNode),kl=r,Ml=i;break;case 5:wl||Dl(n,t);case 6:if(r=kl,i=Ml,kl=null,Pl(e,t,n),Ml=i,null!==(kl=r))if(Ml)try{(9===kl.nodeType?kl.body:"HTML"===kl.nodeName?kl.ownerDocument.body:kl).removeChild(n.stateNode)}catch(e){Ac(n,t,e)}else try{kl.removeChild(n.stateNode)}catch(e){Ac(n,t,e)}break;case 18:null!==kl&&(Ml?(Th(9===(e=kl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Gd(e)):Th(kl,n.stateNode));break;case 4:r=kl,i=Ml,kl=n.stateNode.containerInfo,Ml=!0,Pl(e,t,n),kl=r,Ml=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),wl||gl(4,n,t),Pl(e,t,n);break;case 1:wl||(Dl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&vl(n,t,r)),Pl(e,t,n);break;case 21:Pl(e,t,n);break;case 22:wl=(r=wl)||null!==n.memoizedState,Pl(e,t,n),wl=r;break;default:Pl(e,t,n)}}function Ul(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)){e=e.dehydrated;try{Gd(e)}catch(e){Ac(t,t.return,e)}}}function $l(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{Gd(e)}catch(e){Ac(t,t.return,e)}}function Gl(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Nl),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Nl),t;default:throw Error(o(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Rc.bind(null,e,t);t.then(r,r)}})}function Vl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r title"))),hh(s,r,n),s[$e]=e,Je(s),r=s;break e;case"link":var a=td("link","href",i).get(r+(n.href||""));if(a)for(var l=0;la)break;var c=l.transferSize,h=l.initiatorType;c&&dh(h)&&(o+=c*((l=l.responseEnd)id?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}(h,p)))return Uu=s,e.cancelPendingCommit=p(pc.bind(null,e,t,s,n,r,i,o,a,l,c,h,null,d,f)),void Qu(e,s,o,!u)}pc(e,t,s,n,r,i,o,a,l)}function qu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var r=0;rg&&(o=g,g=m,m=o);var E=er(a,m),v=er(a,g);if(E&&v&&(1!==f.rangeCount||f.anchorNode!==E.node||f.anchorOffset!==E.offset||f.focusNode!==v.node||f.focusOffset!==v.offset)){var C=h.createRange();C.setStart(E.node,E.offset),f.removeAllRanges(),m>g?(f.addRange(C),f.extend(v.node,v.offset)):(C.setEnd(v.node,v.offset),f.addRange(C))}}}}for(h=[],f=a;f=f.parentNode;)1===f.nodeType&&h.push({element:f,left:f.scrollLeft,top:f.scrollTop});for("function"==typeof a.focus&&a.focus(),a=0;an?32:n,O.T=null,n=Gu,Gu=null;var s=Pu,a=Uu;if(Mu=0,Bu=Pu=null,Uu=0,6&du)throw Error(o(331));var l=du;if(du|=4,au(s.current),Jl(s,s.current,a,n),du=l,kc(0,!1),Ee&&"function"==typeof Ee.onPostCommitFiberRoot)try{Ee.onPostCommitFiberRoot(ge,s)}catch(e){}return!0}finally{I.p=i,O.T=r,vc(e,t)}}function Sc(e,t,n){t=Xr(n,t),null!==(e=vs(e,t=xa(e.stateNode,t,2),2))&&(Ne(e,2),Ic(e))}function Ac(e,t,n){if(3===e.tag)Sc(e,e,n);else for(;null!==t;){if(3===t.tag){Sc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===ku||!ku.has(r))){e=Xr(n,e),null!==(r=vs(t,n=wa(2),2))&&(Fa(n,r,t,e),Ne(r,2),Ic(r));break}}t=t.return}}function _c(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hu;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(Du=!0,i.add(n),e=yc.bind(null,e,t,n),t.then(e,e))}function yc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,fu===e&&(mu&n)===n&&(4===Au||3===Au&&(62914560&mu)===mu&&300>ae()-Nu?!(2&du)&&ec(e,0):bu|=n,Ru===mu&&(Ru=0)),Ic(e)}function bc(e,t){0===t&&(t=we()),null!==(e=Lr(e,t))&&(Ne(e,t),Ic(e))}function Tc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),bc(e,n)}function Rc(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}null!==r&&r.delete(t),bc(e,n)}var xc=null,wc=null,Fc=!1,Nc=!1,Lc=!1,Oc=0;function Ic(e){e!==wc&&null===e.next&&(null===wc?xc=wc=e:wc=wc.next=e),Nc=!0,Fc||(Fc=!0,_h(function(){6&du?re(ue,Mc):Pc()}))}function kc(e,t){if(!Lc&&Nc){Lc=!0;do{for(var n=!1,r=xc;null!==r;){if(!t)if(0!==e){var i=r.pendingLanes;if(0===i)var s=0;else{var o=r.suspendedLanes,a=r.pingedLanes;s=(1<<31-Ce(42|e)+1)-1,s=201326741&(s&=i&~(o&~a))?201326741&s|1:s?2|s:0}0!==s&&(n=!0,$c(r,s))}else s=mu,!(3&(s=Te(r,r===fu?s:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Re(r,s)||(n=!0,$c(r,s));r=r.next}}while(n);Lc=!1}}function Mc(){Pc()}function Pc(){Nc=Fc=!1;var e,t=0;0!==Oc&&((e=window.event)&&"popstate"===e.type?e!==Ch&&(Ch=e,1):(Ch=null,0))&&(t=Oc);for(var n=ae(),r=null,i=xc;null!==i;){var s=i.next,o=Bc(i,n);0===o?(i.next=null,null===r?xc=s:r.next=s,null===s&&(wc=r)):(r=i,(0!==t||3&o)&&(Nc=!0)),i=s}0!==Mu&&5!==Mu||kc(t,!1),0!==Oc&&(Oc=0)}function Bc(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=-62914561&e.pendingLanes;0 title"):null)}function rd(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var id=0;function sd(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)ad(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var od=null;function ad(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,od=new Map,t.forEach(ld,e),od=null,sd.call(e))}function ld(e,t){if(!(4&t.state.loading)){var n=od.get(e);if(n)var r=n.get(null);else{n=new Map,od.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s>>1,i=e[r];if(!(0>>1;rs(l,n))us(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[a]=n,r=a);else{if(!(us(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var u=[],c=[],h=1,d=null,f=3,p=!1,m=!1,g=!1,E=!1,v="function"==typeof setTimeout?setTimeout:null,C="function"==typeof clearTimeout?clearTimeout:null,D="undefined"!=typeof setImmediate?setImmediate:null;function S(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function A(e){if(g=!1,S(e),!m)if(null!==r(u))m=!0,y||(y=!0,_());else{var t=r(c);null!==t&&L(A,t.startTime-e)}}var _,y=!1,b=-1,T=5,R=-1;function x(){return!(!E&&t.unstable_now()-Re&&x());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var a=o(d.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof a){d.callback=a,S(e),n=!0;break t}d===r(u)&&i(u),S(e)}else i(u);d=r(u)}if(null!==d)n=!0;else{var l=r(c);null!==l&&L(A,l.startTime-e),n=!1}}break e}finally{d=null,f=s,p=!1}n=void 0}}finally{n?_():y=!1}}}if("function"==typeof D)_=function(){D(w)};else if("undefined"!=typeof MessageChannel){var F=new MessageChannel,N=F.port2;F.port1.onmessage=w,_=function(){N.postMessage(null)}}else _=function(){v(w,0)};function L(e,n){b=v(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125o?(e.sortIndex=s,n(c,e),null===r(u)&&e===r(c)&&(g?(C(b),b=-1):g=!0,L(A,s-o))):(e.sortIndex=a,n(u,e),m||p||(m=!0,y||(y=!0,_()))),e},t.unstable_shouldYield=x,t.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}},982(e,t,n){"use strict";e.exports=n(477)},902(e,t,n){"use strict";var r=n(72),i=n.n(r),s=n(825),o=n.n(s),a=n(659),l=n.n(a),u=n(56),c=n.n(u),h=n(540),d=n.n(h),f=n(113),p=n.n(f),m=n(636),g={};g.styleTagTransform=p(),g.setAttributes=c(),g.insert=l().bind(null,"html"),g.domAPI=o(),g.insertStyleElement=d(),i()(m.A,g),m.A&&m.A.locals&&m.A.locals},72(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},878(e,t,n){"use strict";n.r(t),n.d(t,{EmbeddedFrontend:()=>Id,Spector:()=>kd});var r={};n.r(r),n.d(r,{LX:()=>Jo,ll:()=>ea});var i,s={};n.r(s),n.d(s,{SyntaxError:()=>Xc,parse:()=>Yc});class o{static isBuildableProgram(e){return!!e&&!!e[this.rebuildProgramFunctionName]}static rebuildProgram(e,t,n,r,i){this.isBuildableProgram(e)&&e[this.rebuildProgramFunctionName](t,n,r,i)}}o.rebuildProgramFunctionName="__SPECTOR_rebuildProgram",function(e){e[e.noLog=0]="noLog",e[e.error=1]="error",e[e.warning=2]="warning",e[e.info=3]="info"}(i||(i={}));class a{static error(e,...t){this.level>0&&console.error(e,t)}static warn(e,...t){this.level>1&&console.warn(e,t)}static info(e,...t){this.level>2&&console.log(e,t)}}a.level=i.warning;class l{constructor(){this.callbacks=[],this.counter=-1}add(e,t){return this.counter++,t&&(e=e.bind(t)),this.callbacks[this.counter]=e,this.counter}remove(e){delete this.callbacks[e]}clear(){this.callbacks={}}trigger(e){for(const t in this.callbacks)this.callbacks.hasOwnProperty(t)&&this.callbacks[t](e)}}class u{constructor(){if("undefined"!=typeof performance&&performance.now)this.nowFunction=()=>performance.now();else{const e=new Date;this.nowFunction=e.getTime.bind(e)}}static get now(){return u.instance.nowFunction()}}u.instance=new u;class c{constructor(e){this.options=e}appendAnalysis(e){e.analyses=e.analyses||[];const t=this.getAnalysis(e);e.analyses.push(t)}getAnalysis(e){const t={analyserName:this.analyserName};return this.appendToAnalysis(e,t),t}}class h extends c{get analyserName(){return h.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={};for(const t of e.commands)n[t.name]=n[t.name]||0,n[t.name]++;const r=Object.keys(n).map(e=>[e,n[e]]);r.sort((e,t)=>{const n=t[1]-e[1];return 0===n?e[0].localeCompare(t[0]):n});for(const e of r)t[e[0]]=e[1]}}h.analyserName="Commands";const d=["drawArrays","drawElements","drawArraysInstanced","drawArraysInstancedANGLE","drawElementsInstanced","drawElementsInstancedANGLE","drawRangeElements","multiDrawArraysWEBGL","multiDrawElementsWEBGL","multiDrawArraysInstancedWEBGL","multiDrawElementsInstancedWEBGL","multiDrawArraysInstancedBaseInstanceWEBGL","multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL","drawArraysInstancedBaseInstanceWEBGL","drawElementsInstancedBaseVertexBaseInstanceWEBGL"];class f extends c{get analyserName(){return f.analyserName}appendToAnalysis(e,t){if(e.commands){t.total=e.commands.length,t.draw=0,t.clear=0;for(const n of e.commands)"clear"===n.name?t.clear++:d.indexOf(n.name)>-1&&t.draw++}}}f.analyserName="CommandsSummary";class p{static isWebGlConstant(e){return null!==g[e]&&void 0!==g[e]}static stringifyWebGlConstant(e,t){if(null==e)return"";if(0===e){return this.zeroMeaningByCommand[t]||"0"}if(1===e){return this.oneMeaningByCommand[t]||"1"}const n=g[e];return n?n.name:e+""}}p.DEPTH_BUFFER_BIT={name:"DEPTH_BUFFER_BIT",value:256,description:"Passed to clear to clear the current depth buffer."},p.STENCIL_BUFFER_BIT={name:"STENCIL_BUFFER_BIT",value:1024,description:"Passed to clear to clear the current stencil buffer."},p.COLOR_BUFFER_BIT={name:"COLOR_BUFFER_BIT",value:16384,description:"Passed to clear to clear the current color buffer."},p.POINTS={name:"POINTS",value:0,description:"Passed to drawElements or drawArrays to draw single points."},p.LINES={name:"LINES",value:1,description:"Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it."},p.LINE_LOOP={name:"LINE_LOOP",value:2,description:"Passed to drawElements or drawArrays to draw lines. Each set of two vertices is treated as a separate line segment."},p.LINE_STRIP={name:"LINE_STRIP",value:3,description:"Passed to drawElements or drawArrays to draw a connected group of line segments from the first vertex to the last."},p.TRIANGLES={name:"TRIANGLES",value:4,description:"Passed to drawElements or drawArrays to draw triangles. Each set of three vertices creates a separate triangle."},p.TRIANGLE_STRIP={name:"TRIANGLE_STRIP",value:5,description:"Passed to drawElements or drawArrays to draw a connected group of triangles."},p.TRIANGLE_FAN={name:"TRIANGLE_FAN",value:6,description:"Passed to drawElements or drawArrays to draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan."},p.ZERO={name:"ZERO",value:0,description:"Passed to blendFunc or blendFuncSeparate to turn off a component."},p.ONE={name:"ONE",value:1,description:"Passed to blendFunc or blendFuncSeparate to turn on a component."},p.SRC_COLOR={name:"SRC_COLOR",value:768,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source elements color."},p.ONE_MINUS_SRC_COLOR={name:"ONE_MINUS_SRC_COLOR",value:769,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source elements color."},p.SRC_ALPHA={name:"SRC_ALPHA",value:770,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source's alpha."},p.ONE_MINUS_SRC_ALPHA={name:"ONE_MINUS_SRC_ALPHA",value:771,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source's alpha."},p.DST_ALPHA={name:"DST_ALPHA",value:772,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's alpha."},p.ONE_MINUS_DST_ALPHA={name:"ONE_MINUS_DST_ALPHA",value:773,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's alpha."},p.DST_COLOR={name:"DST_COLOR",value:774,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's color."},p.ONE_MINUS_DST_COLOR={name:"ONE_MINUS_DST_COLOR",value:775,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's color."},p.SRC_ALPHA_SATURATE={name:"SRC_ALPHA_SATURATE",value:776,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the minimum of source's alpha or one minus the destination's alpha."},p.CONSTANT_COLOR={name:"CONSTANT_COLOR",value:32769,description:"Passed to blendFunc or blendFuncSeparate to specify a constant color blend function."},p.ONE_MINUS_CONSTANT_COLOR={name:"ONE_MINUS_CONSTANT_COLOR",value:32770,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant color blend function."},p.CONSTANT_ALPHA={name:"CONSTANT_ALPHA",value:32771,description:"Passed to blendFunc or blendFuncSeparate to specify a constant alpha blend function."},p.ONE_MINUS_CONSTANT_ALPHA={name:"ONE_MINUS_CONSTANT_ALPHA",value:32772,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant alpha blend function."},p.FUNC_ADD={name:"FUNC_ADD",value:32774,description:"Passed to blendEquation or blendEquationSeparate to set an addition blend function."},p.FUNC_SUBSTRACT={name:"FUNC_SUBSTRACT",value:32778,description:"Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination)."},p.FUNC_REVERSE_SUBTRACT={name:"FUNC_REVERSE_SUBTRACT",value:32779,description:"Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source)."},p.BLEND_EQUATION={name:"BLEND_EQUATION",value:32777,description:"Passed to getParameter to get the current RGB blend function."},p.BLEND_EQUATION_RGB={name:"BLEND_EQUATION_RGB",value:32777,description:"Passed to getParameter to get the current RGB blend function. Same as BLEND_EQUATION"},p.BLEND_EQUATION_ALPHA={name:"BLEND_EQUATION_ALPHA",value:34877,description:"Passed to getParameter to get the current alpha blend function. Same as BLEND_EQUATION"},p.BLEND_DST_RGB={name:"BLEND_DST_RGB",value:32968,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_SRC_RGB={name:"BLEND_SRC_RGB",value:32969,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_DST_ALPHA={name:"BLEND_DST_ALPHA",value:32970,description:"Passed to getParameter to get the current destination alpha blend function."},p.BLEND_SRC_ALPHA={name:"BLEND_SRC_ALPHA",value:32971,description:"Passed to getParameter to get the current source alpha blend function."},p.BLEND_COLOR={name:"BLEND_COLOR",value:32773,description:"Passed to getParameter to return a the current blend color."},p.ARRAY_BUFFER_BINDING={name:"ARRAY_BUFFER_BINDING",value:34964,description:"Passed to getParameter to get the array buffer binding."},p.ELEMENT_ARRAY_BUFFER_BINDING={name:"ELEMENT_ARRAY_BUFFER_BINDING",value:34965,description:"Passed to getParameter to get the current element array buffer."},p.LINE_WIDTH={name:"LINE_WIDTH",value:2849,description:"Passed to getParameter to get the current lineWidth (set by the lineWidth method)."},p.ALIASED_POINT_SIZE_RANGE={name:"ALIASED_POINT_SIZE_RANGE",value:33901,description:"Passed to getParameter to get the current size of a point drawn with gl.POINTS"},p.ALIASED_LINE_WIDTH_RANGE={name:"ALIASED_LINE_WIDTH_RANGE",value:33902,description:"Passed to getParameter to get the range of available widths for a line. Returns a length-2 array with the lo value at 0, and hight at 1."},p.CULL_FACE_MODE={name:"CULL_FACE_MODE",value:2885,description:"Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK"},p.FRONT_FACE={name:"FRONT_FACE",value:2886,description:"Passed to getParameter to determine the current value of frontFace. Should return CW or CCW."},p.DEPTH_RANGE={name:"DEPTH_RANGE",value:2928,description:"Passed to getParameter to return a length-2 array of floats giving the current depth range."},p.DEPTH_WRITEMASK={name:"DEPTH_WRITEMASK",value:2930,description:"Passed to getParameter to determine if the depth write mask is enabled."},p.DEPTH_CLEAR_VALUE={name:"DEPTH_CLEAR_VALUE",value:2931,description:"Passed to getParameter to determine the current depth clear value."},p.DEPTH_FUNC={name:"DEPTH_FUNC",value:2932,description:"Passed to getParameter to get the current depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_CLEAR_VALUE={name:"STENCIL_CLEAR_VALUE",value:2961,description:"Passed to getParameter to get the value the stencil will be cleared to."},p.STENCIL_FUNC={name:"STENCIL_FUNC",value:2962,description:"Passed to getParameter to get the current stencil function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_FAIL={name:"STENCIL_FAIL",value:2964,description:"Passed to getParameter to get the current stencil fail function. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_FAIL={name:"STENCIL_PASS_DEPTH_FAIL",value:2965,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test fail. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_PASS={name:"STENCIL_PASS_DEPTH_PASS",value:2966,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test pass. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_REF={name:"STENCIL_REF",value:2967,description:"Passed to getParameter to get the reference value used for stencil tests."},p.STENCIL_VALUE_MASK={name:"STENCIL_VALUE_MASK",value:2963,description:" "},p.STENCIL_WRITEMASK={name:"STENCIL_WRITEMASK",value:2968,description:" "},p.STENCIL_BACK_FUNC={name:"STENCIL_BACK_FUNC",value:34816,description:" "},p.STENCIL_BACK_FAIL={name:"STENCIL_BACK_FAIL",value:34817,description:" "},p.STENCIL_BACK_PASS_DEPTH_FAIL={name:"STENCIL_BACK_PASS_DEPTH_FAIL",value:34818,description:" "},p.STENCIL_BACK_PASS_DEPTH_PASS={name:"STENCIL_BACK_PASS_DEPTH_PASS",value:34819,description:" "},p.STENCIL_BACK_REF={name:"STENCIL_BACK_REF",value:36003,description:" "},p.STENCIL_BACK_VALUE_MASK={name:"STENCIL_BACK_VALUE_MASK",value:36004,description:" "},p.STENCIL_BACK_WRITEMASK={name:"STENCIL_BACK_WRITEMASK",value:36005,description:" "},p.VIEWPORT={name:"VIEWPORT",value:2978,description:"Returns an Int32Array with four elements for the current viewport dimensions."},p.SCISSOR_BOX={name:"SCISSOR_BOX",value:3088,description:"Returns an Int32Array with four elements for the current scissor box dimensions."},p.COLOR_CLEAR_VALUE={name:"COLOR_CLEAR_VALUE",value:3106,description:" "},p.COLOR_WRITEMASK={name:"COLOR_WRITEMASK",value:3107,description:" "},p.UNPACK_ALIGNMENT={name:"UNPACK_ALIGNMENT",value:3317,description:" "},p.PACK_ALIGNMENT={name:"PACK_ALIGNMENT",value:3333,description:" "},p.MAX_TEXTURE_SIZE={name:"MAX_TEXTURE_SIZE",value:3379,description:" "},p.MAX_VIEWPORT_DIMS={name:"MAX_VIEWPORT_DIMS",value:3386,description:" "},p.SUBPIXEL_BITS={name:"SUBPIXEL_BITS",value:3408,description:" "},p.RED_BITS={name:"RED_BITS",value:3410,description:" "},p.GREEN_BITS={name:"GREEN_BITS",value:3411,description:" "},p.BLUE_BITS={name:"BLUE_BITS",value:3412,description:" "},p.ALPHA_BITS={name:"ALPHA_BITS",value:3413,description:" "},p.DEPTH_BITS={name:"DEPTH_BITS",value:3414,description:" "},p.STENCIL_BITS={name:"STENCIL_BITS",value:3415,description:" "},p.POLYGON_OFFSET_UNITS={name:"POLYGON_OFFSET_UNITS",value:10752,description:" "},p.POLYGON_OFFSET_FACTOR={name:"POLYGON_OFFSET_FACTOR",value:32824,description:" "},p.TEXTURE_BINDING_2D={name:"TEXTURE_BINDING_2D",value:32873,description:" "},p.SAMPLE_BUFFERS={name:"SAMPLE_BUFFERS",value:32936,description:" "},p.SAMPLES={name:"SAMPLES",value:32937,description:" "},p.SAMPLE_COVERAGE_VALUE={name:"SAMPLE_COVERAGE_VALUE",value:32938,description:" "},p.SAMPLE_COVERAGE_INVERT={name:"SAMPLE_COVERAGE_INVERT",value:32939,description:" "},p.COMPRESSED_TEXTURE_FORMATS={name:"COMPRESSED_TEXTURE_FORMATS",value:34467,description:" "},p.VENDOR={name:"VENDOR",value:7936,description:" "},p.RENDERER={name:"RENDERER",value:7937,description:" "},p.VERSION={name:"VERSION",value:7938,description:" "},p.IMPLEMENTATION_COLOR_READ_TYPE={name:"IMPLEMENTATION_COLOR_READ_TYPE",value:35738,description:" "},p.IMPLEMENTATION_COLOR_READ_FORMAT={name:"IMPLEMENTATION_COLOR_READ_FORMAT",value:35739,description:" "},p.BROWSER_DEFAULT_WEBGL={name:"BROWSER_DEFAULT_WEBGL",value:37444,description:" "},p.STATIC_DRAW={name:"STATIC_DRAW",value:35044,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and not change often."},p.STREAM_DRAW={name:"STREAM_DRAW",value:35040,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to not be used often."},p.DYNAMIC_DRAW={name:"DYNAMIC_DRAW",value:35048,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and change often."},p.ARRAY_BUFFER={name:"ARRAY_BUFFER",value:34962,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.ELEMENT_ARRAY_BUFFER={name:"ELEMENT_ARRAY_BUFFER",value:34963,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.BUFFER_SIZE={name:"BUFFER_SIZE",value:34660,description:"Passed to getBufferParameter to get a buffer's size."},p.BUFFER_USAGE={name:"BUFFER_USAGE",value:34661,description:"Passed to getBufferParameter to get the hint for the buffer passed in when it was created."},p.CURRENT_VERTEX_ATTRIB={name:"CURRENT_VERTEX_ATTRIB",value:34342,description:"Passed to getVertexAttrib to read back the current vertex attribute."},p.VERTEX_ATTRIB_ARRAY_ENABLED={name:"VERTEX_ATTRIB_ARRAY_ENABLED",value:34338,description:" "},p.VERTEX_ATTRIB_ARRAY_SIZE={name:"VERTEX_ATTRIB_ARRAY_SIZE",value:34339,description:" "},p.VERTEX_ATTRIB_ARRAY_STRIDE={name:"VERTEX_ATTRIB_ARRAY_STRIDE",value:34340,description:" "},p.VERTEX_ATTRIB_ARRAY_TYPE={name:"VERTEX_ATTRIB_ARRAY_TYPE",value:34341,description:" "},p.VERTEX_ATTRIB_ARRAY_NORMALIZED={name:"VERTEX_ATTRIB_ARRAY_NORMALIZED",value:34922,description:" "},p.VERTEX_ATTRIB_ARRAY_POINTER={name:"VERTEX_ATTRIB_ARRAY_POINTER",value:34373,description:" "},p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING={name:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",value:34975,description:" "},p.CULL_FACE={name:"CULL_FACE",value:2884,description:"Passed to enable/disable to turn on/off culling. Can also be used with getParameter to find the current culling method."},p.FRONT={name:"FRONT",value:1028,description:"Passed to cullFace to specify that only front faces should be drawn."},p.BACK={name:"BACK",value:1029,description:"Passed to cullFace to specify that only back faces should be drawn."},p.FRONT_AND_BACK={name:"FRONT_AND_BACK",value:1032,description:"Passed to cullFace to specify that front and back faces should be drawn."},p.BLEND={name:"BLEND",value:3042,description:"Passed to enable/disable to turn on/off blending. Can also be used with getParameter to find the current blending method."},p.DEPTH_TEST={name:"DEPTH_TEST",value:2929,description:"Passed to enable/disable to turn on/off the depth test. Can also be used with getParameter to query the depth test."},p.DITHER={name:"DITHER",value:3024,description:"Passed to enable/disable to turn on/off dithering. Can also be used with getParameter to find the current dithering method."},p.POLYGON_OFFSET_FILL={name:"POLYGON_OFFSET_FILL",value:32823,description:"Passed to enable/disable to turn on/off the polygon offset. Useful for rendering hidden-line images, decals, and or solids with highlighted edges. Can also be used with getParameter to query the scissor test."},p.SAMPLE_ALPHA_TO_COVERAGE={name:"SAMPLE_ALPHA_TO_COVERAGE",value:32926,description:"Passed to enable/disable to turn on/off the alpha to coverage. Used in multi-sampling alpha channels."},p.SAMPLE_COVERAGE={name:"SAMPLE_COVERAGE",value:32928,description:"Passed to enable/disable to turn on/off the sample coverage. Used in multi-sampling."},p.SCISSOR_TEST={name:"SCISSOR_TEST",value:3089,description:"Passed to enable/disable to turn on/off the scissor test. Can also be used with getParameter to query the scissor test."},p.STENCIL_TEST={name:"STENCIL_TEST",value:2960,description:"Passed to enable/disable to turn on/off the stencil test. Can also be used with getParameter to query the stencil test."},p.NO_ERROR={name:"NO_ERROR",value:0,description:"Returned from getError."},p.INVALID_ENUM={name:"INVALID_ENUM",value:1280,description:"Returned from getError."},p.INVALID_VALUE={name:"INVALID_VALUE",value:1281,description:"Returned from getError."},p.INVALID_OPERATION={name:"INVALID_OPERATION",value:1282,description:"Returned from getError."},p.OUT_OF_MEMORY={name:"OUT_OF_MEMORY",value:1285,description:"Returned from getError."},p.CONTEXT_LOST_WEBGL={name:"CONTEXT_LOST_WEBGL",value:37442,description:"Returned from getError."},p.CW={name:"CW",value:2304,description:"Passed to frontFace to specify the front face of a polygon is drawn in the clockwise direction"},p.CCW={name:"CCW",value:2305,description:"Passed to frontFace to specify the front face of a polygon is drawn in the counter clockwise direction"},p.DONT_CARE={name:"DONT_CARE",value:4352,description:"There is no preference for this behavior."},p.FASTEST={name:"FASTEST",value:4353,description:"The most efficient behavior should be used."},p.NICEST={name:"NICEST",value:4354,description:"The most correct or the highest quality option should be used."},p.GENERATE_MIPMAP_HINT={name:"GENERATE_MIPMAP_HINT",value:33170,description:"Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap()."},p.BYTE={name:"BYTE",value:5120,description:" "},p.UNSIGNED_BYTE={name:"UNSIGNED_BYTE",value:5121,description:" "},p.SHORT={name:"SHORT",value:5122,description:" "},p.UNSIGNED_SHORT={name:"UNSIGNED_SHORT",value:5123,description:" "},p.INT={name:"INT",value:5124,description:" "},p.UNSIGNED_INT={name:"UNSIGNED_INT",value:5125,description:" "},p.FLOAT={name:"FLOAT",value:5126,description:" "},p.DEPTH_COMPONENT={name:"DEPTH_COMPONENT",value:6402,description:" "},p.ALPHA={name:"ALPHA",value:6406,description:" "},p.RGB={name:"RGB",value:6407,description:" "},p.RGBA={name:"RGBA",value:6408,description:" "},p.LUMINANCE={name:"LUMINANCE",value:6409,description:" "},p.LUMINANCE_ALPHA={name:"LUMINANCE_ALPHA",value:6410,description:" "},p.UNSIGNED_SHORT_4_4_4_4={name:"UNSIGNED_SHORT_4_4_4_4",value:32819,description:" "},p.UNSIGNED_SHORT_5_5_5_1={name:"UNSIGNED_SHORT_5_5_5_1",value:32820,description:" "},p.UNSIGNED_SHORT_5_6_5={name:"UNSIGNED_SHORT_5_6_5",value:33635,description:" "},p.FRAGMENT_SHADER={name:"FRAGMENT_SHADER",value:35632,description:"Passed to createShader to define a fragment shader."},p.VERTEX_SHADER={name:"VERTEX_SHADER",value:35633,description:"Passed to createShader to define a vertex shader"},p.COMPILE_STATUS={name:"COMPILE_STATUS",value:35713,description:"Passed to getShaderParamter to get the status of the compilation. Returns false if the shader was not compiled. You can then query getShaderInfoLog to find the exact error"},p.DELETE_STATUS={name:"DELETE_STATUS",value:35712,description:"Passed to getShaderParamter to determine if a shader was deleted via deleteShader. Returns true if it was, false otherwise."},p.LINK_STATUS={name:"LINK_STATUS",value:35714,description:"Passed to getProgramParameter after calling linkProgram to determine if a program was linked correctly. Returns false if there were errors. Use getProgramInfoLog to find the exact error."},p.VALIDATE_STATUS={name:"VALIDATE_STATUS",value:35715,description:"Passed to getProgramParameter after calling validateProgram to determine if it is valid. Returns false if errors were found."},p.ATTACHED_SHADERS={name:"ATTACHED_SHADERS",value:35717,description:"Passed to getProgramParameter after calling attachShader to determine if the shader was attached correctly. Returns false if errors occurred."},p.COMPLETION_STATUS_KHR={name:"COMPLETION_STATUS_KHR",value:37297,description:"Passed to getProgramParameter (KHR_parallel_shader_compile) to query whether an asynchronous shader/program link has completed. Returns true once the program is ready to use without blocking."},p.ACTIVE_ATTRIBUTES={name:"ACTIVE_ATTRIBUTES",value:35721,description:"Passed to getProgramParameter to get the number of attributes active in a program."},p.ACTIVE_UNIFORMS={name:"ACTIVE_UNIFORMS",value:35718,description:"Passed to getProgramParamter to get the number of uniforms active in a program."},p.MAX_VERTEX_ATTRIBS={name:"MAX_VERTEX_ATTRIBS",value:34921,description:" "},p.MAX_VERTEX_UNIFORM_VECTORS={name:"MAX_VERTEX_UNIFORM_VECTORS",value:36347,description:" "},p.MAX_VARYING_VECTORS={name:"MAX_VARYING_VECTORS",value:36348,description:" "},p.MAX_COMBINED_TEXTURE_IMAGE_UNITS={name:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",value:35661,description:" "},p.MAX_VERTEX_TEXTURE_IMAGE_UNITS={name:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",value:35660,description:" "},p.MAX_TEXTURE_IMAGE_UNITS={name:"MAX_TEXTURE_IMAGE_UNITS",value:34930,description:"Implementation dependent number of maximum texture units. At least 8."},p.MAX_FRAGMENT_UNIFORM_VECTORS={name:"MAX_FRAGMENT_UNIFORM_VECTORS",value:36349,description:" "},p.SHADER_TYPE={name:"SHADER_TYPE",value:35663,description:" "},p.SHADING_LANGUAGE_VERSION={name:"SHADING_LANGUAGE_VERSION",value:35724,description:" "},p.CURRENT_PROGRAM={name:"CURRENT_PROGRAM",value:35725,description:" "},p.NEVER={name:"NEVER",value:512,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn."},p.ALWAYS={name:"ALWAYS",value:519,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn."},p.LESS={name:"LESS",value:513,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value."},p.EQUAL={name:"EQUAL",value:514,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value."},p.LEQUAL={name:"LEQUAL",value:515,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value."},p.GREATER={name:"GREATER",value:516,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value."},p.GEQUAL={name:"GEQUAL",value:518,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value."},p.NOTEQUAL={name:"NOTEQUAL",value:517,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value."},p.KEEP={name:"KEEP",value:7680,description:" "},p.REPLACE={name:"REPLACE",value:7681,description:" "},p.INCR={name:"INCR",value:7682,description:" "},p.DECR={name:"DECR",value:7683,description:" "},p.INVERT={name:"INVERT",value:5386,description:" "},p.INCR_WRAP={name:"INCR_WRAP",value:34055,description:" "},p.DECR_WRAP={name:"DECR_WRAP",value:34056,description:" "},p.NEAREST={name:"NEAREST",value:9728,description:" "},p.LINEAR={name:"LINEAR",value:9729,description:" "},p.NEAREST_MIPMAP_NEAREST={name:"NEAREST_MIPMAP_NEAREST",value:9984,description:" "},p.LINEAR_MIPMAP_NEAREST={name:"LINEAR_MIPMAP_NEAREST",value:9985,description:" "},p.NEAREST_MIPMAP_LINEAR={name:"NEAREST_MIPMAP_LINEAR",value:9986,description:" "},p.LINEAR_MIPMAP_LINEAR={name:"LINEAR_MIPMAP_LINEAR",value:9987,description:" "},p.TEXTURE_MAG_FILTER={name:"TEXTURE_MAG_FILTER",value:10240,description:" "},p.TEXTURE_MIN_FILTER={name:"TEXTURE_MIN_FILTER",value:10241,description:" "},p.TEXTURE_WRAP_S={name:"TEXTURE_WRAP_S",value:10242,description:" "},p.TEXTURE_WRAP_T={name:"TEXTURE_WRAP_T",value:10243,description:" "},p.TEXTURE_2D={name:"TEXTURE_2D",value:3553,description:" "},p.TEXTURE={name:"TEXTURE",value:5890,description:" "},p.TEXTURE_CUBE_MAP={name:"TEXTURE_CUBE_MAP",value:34067,description:" "},p.TEXTURE_BINDING_CUBE_MAP={name:"TEXTURE_BINDING_CUBE_MAP",value:34068,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_X={name:"TEXTURE_CUBE_MAP_POSITIVE_X",value:34069,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_X={name:"TEXTURE_CUBE_MAP_NEGATIVE_X",value:34070,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Y={name:"TEXTURE_CUBE_MAP_POSITIVE_Y",value:34071,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Y={name:"TEXTURE_CUBE_MAP_NEGATIVE_Y",value:34072,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Z={name:"TEXTURE_CUBE_MAP_POSITIVE_Z",value:34073,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Z={name:"TEXTURE_CUBE_MAP_NEGATIVE_Z",value:34074,description:" "},p.MAX_CUBE_MAP_TEXTURE_SIZE={name:"MAX_CUBE_MAP_TEXTURE_SIZE",value:34076,description:" "},p.TEXTURE0={name:"TEXTURE0",value:33984,description:"A texture unit."},p.TEXTURE1={name:"TEXTURE1",value:33985,description:"A texture unit."},p.TEXTURE2={name:"TEXTURE2",value:33986,description:"A texture unit."},p.TEXTURE3={name:"TEXTURE3",value:33987,description:"A texture unit."},p.TEXTURE4={name:"TEXTURE4",value:33988,description:"A texture unit."},p.TEXTURE5={name:"TEXTURE5",value:33989,description:"A texture unit."},p.TEXTURE6={name:"TEXTURE6",value:33990,description:"A texture unit."},p.TEXTURE7={name:"TEXTURE7",value:33991,description:"A texture unit."},p.TEXTURE8={name:"TEXTURE8",value:33992,description:"A texture unit."},p.TEXTURE9={name:"TEXTURE9",value:33993,description:"A texture unit."},p.TEXTURE10={name:"TEXTURE10",value:33994,description:"A texture unit."},p.TEXTURE11={name:"TEXTURE11",value:33995,description:"A texture unit."},p.TEXTURE12={name:"TEXTURE12",value:33996,description:"A texture unit."},p.TEXTURE13={name:"TEXTURE13",value:33997,description:"A texture unit."},p.TEXTURE14={name:"TEXTURE14",value:33998,description:"A texture unit."},p.TEXTURE15={name:"TEXTURE15",value:33999,description:"A texture unit."},p.TEXTURE16={name:"TEXTURE16",value:34e3,description:"A texture unit."},p.TEXTURE17={name:"TEXTURE17",value:34001,description:"A texture unit."},p.TEXTURE18={name:"TEXTURE18",value:34002,description:"A texture unit."},p.TEXTURE19={name:"TEXTURE19",value:34003,description:"A texture unit."},p.TEXTURE20={name:"TEXTURE20",value:34004,description:"A texture unit."},p.TEXTURE21={name:"TEXTURE21",value:34005,description:"A texture unit."},p.TEXTURE22={name:"TEXTURE22",value:34006,description:"A texture unit."},p.TEXTURE23={name:"TEXTURE23",value:34007,description:"A texture unit."},p.TEXTURE24={name:"TEXTURE24",value:34008,description:"A texture unit."},p.TEXTURE25={name:"TEXTURE25",value:34009,description:"A texture unit."},p.TEXTURE26={name:"TEXTURE26",value:34010,description:"A texture unit."},p.TEXTURE27={name:"TEXTURE27",value:34011,description:"A texture unit."},p.TEXTURE28={name:"TEXTURE28",value:34012,description:"A texture unit."},p.TEXTURE29={name:"TEXTURE29",value:34013,description:"A texture unit."},p.TEXTURE30={name:"TEXTURE30",value:34014,description:"A texture unit."},p.TEXTURE31={name:"TEXTURE31",value:34015,description:"A texture unit."},p.ACTIVE_TEXTURE={name:"ACTIVE_TEXTURE",value:34016,description:"The current active texture unit."},p.REPEAT={name:"REPEAT",value:10497,description:" "},p.CLAMP_TO_EDGE={name:"CLAMP_TO_EDGE",value:33071,description:" "},p.MIRRORED_REPEAT={name:"MIRRORED_REPEAT",value:33648,description:" "},p.FLOAT_VEC2={name:"FLOAT_VEC2",value:35664,description:" "},p.FLOAT_VEC3={name:"FLOAT_VEC3",value:35665,description:" "},p.FLOAT_VEC4={name:"FLOAT_VEC4",value:35666,description:" "},p.INT_VEC2={name:"INT_VEC2",value:35667,description:" "},p.INT_VEC3={name:"INT_VEC3",value:35668,description:" "},p.INT_VEC4={name:"INT_VEC4",value:35669,description:" "},p.BOOL={name:"BOOL",value:35670,description:" "},p.BOOL_VEC2={name:"BOOL_VEC2",value:35671,description:" "},p.BOOL_VEC3={name:"BOOL_VEC3",value:35672,description:" "},p.BOOL_VEC4={name:"BOOL_VEC4",value:35673,description:" "},p.FLOAT_MAT2={name:"FLOAT_MAT2",value:35674,description:" "},p.FLOAT_MAT3={name:"FLOAT_MAT3",value:35675,description:" "},p.FLOAT_MAT4={name:"FLOAT_MAT4",value:35676,description:" "},p.SAMPLER_2D={name:"SAMPLER_2D",value:35678,description:" "},p.SAMPLER_CUBE={name:"SAMPLER_CUBE",value:35680,description:" "},p.LOW_FLOAT={name:"LOW_FLOAT",value:36336,description:" "},p.MEDIUM_FLOAT={name:"MEDIUM_FLOAT",value:36337,description:" "},p.HIGH_FLOAT={name:"HIGH_FLOAT",value:36338,description:" "},p.LOW_INT={name:"LOW_INT",value:36339,description:" "},p.MEDIUM_INT={name:"MEDIUM_INT",value:36340,description:" "},p.HIGH_INT={name:"HIGH_INT",value:36341,description:" "},p.FRAMEBUFFER={name:"FRAMEBUFFER",value:36160,description:" "},p.RENDERBUFFER={name:"RENDERBUFFER",value:36161,description:" "},p.RGBA4={name:"RGBA4",value:32854,description:" "},p.RGB5_A1={name:"RGB5_A1",value:32855,description:" "},p.RGB565={name:"RGB565",value:36194,description:" "},p.DEPTH_COMPONENT16={name:"DEPTH_COMPONENT16",value:33189,description:" "},p.STENCIL_INDEX={name:"STENCIL_INDEX",value:6401,description:" "},p.STENCIL_INDEX8={name:"STENCIL_INDEX8",value:36168,description:" "},p.DEPTH_STENCIL={name:"DEPTH_STENCIL",value:34041,description:" "},p.RENDERBUFFER_WIDTH={name:"RENDERBUFFER_WIDTH",value:36162,description:" "},p.RENDERBUFFER_HEIGHT={name:"RENDERBUFFER_HEIGHT",value:36163,description:" "},p.RENDERBUFFER_INTERNAL_FORMAT={name:"RENDERBUFFER_INTERNAL_FORMAT",value:36164,description:" "},p.RENDERBUFFER_RED_SIZE={name:"RENDERBUFFER_RED_SIZE",value:36176,description:" "},p.RENDERBUFFER_GREEN_SIZE={name:"RENDERBUFFER_GREEN_SIZE",value:36177,description:" "},p.RENDERBUFFER_BLUE_SIZE={name:"RENDERBUFFER_BLUE_SIZE",value:36178,description:" "},p.RENDERBUFFER_ALPHA_SIZE={name:"RENDERBUFFER_ALPHA_SIZE",value:36179,description:" "},p.RENDERBUFFER_DEPTH_SIZE={name:"RENDERBUFFER_DEPTH_SIZE",value:36180,description:" "},p.RENDERBUFFER_STENCIL_SIZE={name:"RENDERBUFFER_STENCIL_SIZE",value:36181,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",value:36048,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",value:36049,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",value:36050,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",value:36051,description:" "},p.COLOR_ATTACHMENT0={name:"COLOR_ATTACHMENT0",value:36064,description:" "},p.DEPTH_ATTACHMENT={name:"DEPTH_ATTACHMENT",value:36096,description:" "},p.STENCIL_ATTACHMENT={name:"STENCIL_ATTACHMENT",value:36128,description:" "},p.DEPTH_STENCIL_ATTACHMENT={name:"DEPTH_STENCIL_ATTACHMENT",value:33306,description:" "},p.NONE={name:"NONE",value:0,description:" "},p.FRAMEBUFFER_COMPLETE={name:"FRAMEBUFFER_COMPLETE",value:36053,description:" "},p.FRAMEBUFFER_INCOMPLETE_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",value:36054,description:" "},p.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",value:36055,description:" "},p.FRAMEBUFFER_INCOMPLETE_DIMENSIONS={name:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",value:36057,description:" "},p.FRAMEBUFFER_UNSUPPORTED={name:"FRAMEBUFFER_UNSUPPORTED",value:36061,description:" "},p.FRAMEBUFFER_BINDING={name:"FRAMEBUFFER_BINDING",value:36006,description:" "},p.RENDERBUFFER_BINDING={name:"RENDERBUFFER_BINDING",value:36007,description:" "},p.MAX_RENDERBUFFER_SIZE={name:"MAX_RENDERBUFFER_SIZE",value:34024,description:" "},p.INVALID_FRAMEBUFFER_OPERATION={name:"INVALID_FRAMEBUFFER_OPERATION",value:1286,description:" "},p.UNPACK_FLIP_Y_WEBGL={name:"UNPACK_FLIP_Y_WEBGL",value:37440,description:" "},p.UNPACK_PREMULTIPLY_ALPHA_WEBGL={name:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",value:37441,description:" "},p.UNPACK_COLORSPACE_CONVERSION_WEBGL={name:"UNPACK_COLORSPACE_CONVERSION_WEBGL",value:37443,description:" "},p.READ_BUFFER={name:"READ_BUFFER",value:3074,description:" "},p.UNPACK_ROW_LENGTH={name:"UNPACK_ROW_LENGTH",value:3314,description:" "},p.UNPACK_SKIP_ROWS={name:"UNPACK_SKIP_ROWS",value:3315,description:" "},p.UNPACK_SKIP_PIXELS={name:"UNPACK_SKIP_PIXELS",value:3316,description:" "},p.PACK_ROW_LENGTH={name:"PACK_ROW_LENGTH",value:3330,description:" "},p.PACK_SKIP_ROWS={name:"PACK_SKIP_ROWS",value:3331,description:" "},p.PACK_SKIP_PIXELS={name:"PACK_SKIP_PIXELS",value:3332,description:" "},p.TEXTURE_BINDING_3D={name:"TEXTURE_BINDING_3D",value:32874,description:" "},p.UNPACK_SKIP_IMAGES={name:"UNPACK_SKIP_IMAGES",value:32877,description:" "},p.UNPACK_IMAGE_HEIGHT={name:"UNPACK_IMAGE_HEIGHT",value:32878,description:" "},p.MAX_3D_TEXTURE_SIZE={name:"MAX_3D_TEXTURE_SIZE",value:32883,description:" "},p.MAX_ELEMENTS_VERTICES={name:"MAX_ELEMENTS_VERTICES",value:33e3,description:" "},p.MAX_ELEMENTS_INDICES={name:"MAX_ELEMENTS_INDICES",value:33001,description:" "},p.MAX_TEXTURE_LOD_BIAS={name:"MAX_TEXTURE_LOD_BIAS",value:34045,description:" "},p.MAX_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_FRAGMENT_UNIFORM_COMPONENTS",value:35657,description:" "},p.MAX_VERTEX_UNIFORM_COMPONENTS={name:"MAX_VERTEX_UNIFORM_COMPONENTS",value:35658,description:" "},p.MAX_ARRAY_TEXTURE_LAYERS={name:"MAX_ARRAY_TEXTURE_LAYERS",value:35071,description:" "},p.MIN_PROGRAM_TEXEL_OFFSET={name:"MIN_PROGRAM_TEXEL_OFFSET",value:35076,description:" "},p.MAX_PROGRAM_TEXEL_OFFSET={name:"MAX_PROGRAM_TEXEL_OFFSET",value:35077,description:" "},p.MAX_VARYING_COMPONENTS={name:"MAX_VARYING_COMPONENTS",value:35659,description:" "},p.FRAGMENT_SHADER_DERIVATIVE_HINT={name:"FRAGMENT_SHADER_DERIVATIVE_HINT",value:35723,description:" "},p.RASTERIZER_DISCARD={name:"RASTERIZER_DISCARD",value:35977,description:" "},p.VERTEX_ARRAY_BINDING={name:"VERTEX_ARRAY_BINDING",value:34229,description:" "},p.MAX_VERTEX_OUTPUT_COMPONENTS={name:"MAX_VERTEX_OUTPUT_COMPONENTS",value:37154,description:" "},p.MAX_FRAGMENT_INPUT_COMPONENTS={name:"MAX_FRAGMENT_INPUT_COMPONENTS",value:37157,description:" "},p.MAX_SERVER_WAIT_TIMEOUT={name:"MAX_SERVER_WAIT_TIMEOUT",value:37137,description:" "},p.MAX_ELEMENT_INDEX={name:"MAX_ELEMENT_INDEX",value:36203,description:" "},p.RED={name:"RED",value:6403,description:" "},p.RGB8={name:"RGB8",value:32849,description:" "},p.RGBA8={name:"RGBA8",value:32856,description:" "},p.RGB10_A2={name:"RGB10_A2",value:32857,description:" "},p.TEXTURE_3D={name:"TEXTURE_3D",value:32879,description:" "},p.TEXTURE_WRAP_R={name:"TEXTURE_WRAP_R",value:32882,description:" "},p.TEXTURE_MIN_LOD={name:"TEXTURE_MIN_LOD",value:33082,description:" "},p.TEXTURE_MAX_LOD={name:"TEXTURE_MAX_LOD",value:33083,description:" "},p.TEXTURE_BASE_LEVEL={name:"TEXTURE_BASE_LEVEL",value:33084,description:" "},p.TEXTURE_MAX_LEVEL={name:"TEXTURE_MAX_LEVEL",value:33085,description:" "},p.TEXTURE_COMPARE_MODE={name:"TEXTURE_COMPARE_MODE",value:34892,description:" "},p.TEXTURE_COMPARE_FUNC={name:"TEXTURE_COMPARE_FUNC",value:34893,description:" "},p.SRGB={name:"SRGB",value:35904,description:" "},p.SRGB8={name:"SRGB8",value:35905,description:" "},p.SRGB8_ALPHA8={name:"SRGB8_ALPHA8",value:35907,description:" "},p.COMPARE_REF_TO_TEXTURE={name:"COMPARE_REF_TO_TEXTURE",value:34894,description:" "},p.RGBA32F={name:"RGBA32F",value:34836,description:" "},p.RGB32F={name:"RGB32F",value:34837,description:" "},p.RGBA16F={name:"RGBA16F",value:34842,description:" "},p.RGB16F={name:"RGB16F",value:34843,description:" "},p.TEXTURE_2D_ARRAY={name:"TEXTURE_2D_ARRAY",value:35866,description:" "},p.TEXTURE_BINDING_2D_ARRAY={name:"TEXTURE_BINDING_2D_ARRAY",value:35869,description:" "},p.R11F_G11F_B10F={name:"R11F_G11F_B10F",value:35898,description:" "},p.RGB9_E5={name:"RGB9_E5",value:35901,description:" "},p.RGBA32UI={name:"RGBA32UI",value:36208,description:" "},p.RGB32UI={name:"RGB32UI",value:36209,description:" "},p.RGBA16UI={name:"RGBA16UI",value:36214,description:" "},p.RGB16UI={name:"RGB16UI",value:36215,description:" "},p.RGBA8UI={name:"RGBA8UI",value:36220,description:" "},p.RGB8UI={name:"RGB8UI",value:36221,description:" "},p.RGBA32I={name:"RGBA32I",value:36226,description:" "},p.RGB32I={name:"RGB32I",value:36227,description:" "},p.RGBA16I={name:"RGBA16I",value:36232,description:" "},p.RGB16I={name:"RGB16I",value:36233,description:" "},p.RGBA8I={name:"RGBA8I",value:36238,description:" "},p.RGB8I={name:"RGB8I",value:36239,description:" "},p.RED_INTEGER={name:"RED_INTEGER",value:36244,description:" "},p.RGB_INTEGER={name:"RGB_INTEGER",value:36248,description:" "},p.RGBA_INTEGER={name:"RGBA_INTEGER",value:36249,description:" "},p.R8={name:"R8",value:33321,description:" "},p.RG8={name:"RG8",value:33323,description:" "},p.R16F={name:"R16F",value:33325,description:" "},p.R32F={name:"R32F",value:33326,description:" "},p.RG16F={name:"RG16F",value:33327,description:" "},p.RG32F={name:"RG32F",value:33328,description:" "},p.R8I={name:"R8I",value:33329,description:" "},p.R8UI={name:"R8UI",value:33330,description:" "},p.R16I={name:"R16I",value:33331,description:" "},p.R16UI={name:"R16UI",value:33332,description:" "},p.R32I={name:"R32I",value:33333,description:" "},p.R32UI={name:"R32UI",value:33334,description:" "},p.RG8I={name:"RG8I",value:33335,description:" "},p.RG8UI={name:"RG8UI",value:33336,description:" "},p.RG16I={name:"RG16I",value:33337,description:" "},p.RG16UI={name:"RG16UI",value:33338,description:" "},p.RG32I={name:"RG32I",value:33339,description:" "},p.RG32UI={name:"RG32UI",value:33340,description:" "},p.R8_SNORM={name:"R8_SNORM",value:36756,description:" "},p.RG8_SNORM={name:"RG8_SNORM",value:36757,description:" "},p.RGB8_SNORM={name:"RGB8_SNORM",value:36758,description:" "},p.RGBA8_SNORM={name:"RGBA8_SNORM",value:36759,description:" "},p.RGB10_A2UI={name:"RGB10_A2UI",value:36975,description:" "},p.TEXTURE_IMMUTABLE_FORMAT={name:"TEXTURE_IMMUTABLE_FORMAT",value:37167,description:" "},p.TEXTURE_IMMUTABLE_LEVELS={name:"TEXTURE_IMMUTABLE_LEVELS",value:33503,description:" "},p.UNSIGNED_INT_2_10_10_10_REV={name:"UNSIGNED_INT_2_10_10_10_REV",value:33640,description:" "},p.UNSIGNED_INT_10F_11F_11F_REV={name:"UNSIGNED_INT_10F_11F_11F_REV",value:35899,description:" "},p.UNSIGNED_INT_5_9_9_9_REV={name:"UNSIGNED_INT_5_9_9_9_REV",value:35902,description:" "},p.FLOAT_32_UNSIGNED_INT_24_8_REV={name:"FLOAT_32_UNSIGNED_INT_24_8_REV",value:36269,description:" "},p.UNSIGNED_INT_24_8={name:"UNSIGNED_INT_24_8",value:34042,description:" "},p.HALF_FLOAT={name:"HALF_FLOAT",value:5131,description:" "},p.RG={name:"RG",value:33319,description:" "},p.RG_INTEGER={name:"RG_INTEGER",value:33320,description:" "},p.INT_2_10_10_10_REV={name:"INT_2_10_10_10_REV",value:36255,description:" "},p.CURRENT_QUERY={name:"CURRENT_QUERY",value:34917,description:" "},p.QUERY_RESULT={name:"QUERY_RESULT",value:34918,description:" "},p.QUERY_RESULT_AVAILABLE={name:"QUERY_RESULT_AVAILABLE",value:34919,description:" "},p.ANY_SAMPLES_PASSED={name:"ANY_SAMPLES_PASSED",value:35887,description:" "},p.ANY_SAMPLES_PASSED_CONSERVATIVE={name:"ANY_SAMPLES_PASSED_CONSERVATIVE",value:36202,description:" "},p.MAX_DRAW_BUFFERS={name:"MAX_DRAW_BUFFERS",value:34852,description:" "},p.DRAW_BUFFER0={name:"DRAW_BUFFER0",value:34853,description:" "},p.DRAW_BUFFER1={name:"DRAW_BUFFER1",value:34854,description:" "},p.DRAW_BUFFER2={name:"DRAW_BUFFER2",value:34855,description:" "},p.DRAW_BUFFER3={name:"DRAW_BUFFER3",value:34856,description:" "},p.DRAW_BUFFER4={name:"DRAW_BUFFER4",value:34857,description:" "},p.DRAW_BUFFER5={name:"DRAW_BUFFER5",value:34858,description:" "},p.DRAW_BUFFER6={name:"DRAW_BUFFER6",value:34859,description:" "},p.DRAW_BUFFER7={name:"DRAW_BUFFER7",value:34860,description:" "},p.DRAW_BUFFER8={name:"DRAW_BUFFER8",value:34861,description:" "},p.DRAW_BUFFER9={name:"DRAW_BUFFER9",value:34862,description:" "},p.DRAW_BUFFER10={name:"DRAW_BUFFER10",value:34863,description:" "},p.DRAW_BUFFER11={name:"DRAW_BUFFER11",value:34864,description:" "},p.DRAW_BUFFER12={name:"DRAW_BUFFER12",value:34865,description:" "},p.DRAW_BUFFER13={name:"DRAW_BUFFER13",value:34866,description:" "},p.DRAW_BUFFER14={name:"DRAW_BUFFER14",value:34867,description:" "},p.DRAW_BUFFER15={name:"DRAW_BUFFER15",value:34868,description:" "},p.MAX_COLOR_ATTACHMENTS={name:"MAX_COLOR_ATTACHMENTS",value:36063,description:" "},p.COLOR_ATTACHMENT1={name:"COLOR_ATTACHMENT1",value:36065,description:" "},p.COLOR_ATTACHMENT2={name:"COLOR_ATTACHMENT2",value:36066,description:" "},p.COLOR_ATTACHMENT3={name:"COLOR_ATTACHMENT3",value:36067,description:" "},p.COLOR_ATTACHMENT4={name:"COLOR_ATTACHMENT4",value:36068,description:" "},p.COLOR_ATTACHMENT5={name:"COLOR_ATTACHMENT5",value:36069,description:" "},p.COLOR_ATTACHMENT6={name:"COLOR_ATTACHMENT6",value:36070,description:" "},p.COLOR_ATTACHMENT7={name:"COLOR_ATTACHMENT7",value:36071,description:" "},p.COLOR_ATTACHMENT8={name:"COLOR_ATTACHMENT8",value:36072,description:" "},p.COLOR_ATTACHMENT9={name:"COLOR_ATTACHMENT9",value:36073,description:" "},p.COLOR_ATTACHMENT10={name:"COLOR_ATTACHMENT10",value:36074,description:" "},p.COLOR_ATTACHMENT11={name:"COLOR_ATTACHMENT11",value:36075,description:" "},p.COLOR_ATTACHMENT12={name:"COLOR_ATTACHMENT12",value:36076,description:" "},p.COLOR_ATTACHMENT13={name:"COLOR_ATTACHMENT13",value:36077,description:" "},p.COLOR_ATTACHMENT14={name:"COLOR_ATTACHMENT14",value:36078,description:" "},p.COLOR_ATTACHMENT15={name:"COLOR_ATTACHMENT15",value:36079,description:" "},p.SAMPLER_3D={name:"SAMPLER_3D",value:35679,description:" "},p.SAMPLER_2D_SHADOW={name:"SAMPLER_2D_SHADOW",value:35682,description:" "},p.SAMPLER_2D_ARRAY={name:"SAMPLER_2D_ARRAY",value:36289,description:" "},p.SAMPLER_2D_ARRAY_SHADOW={name:"SAMPLER_2D_ARRAY_SHADOW",value:36292,description:" "},p.SAMPLER_CUBE_SHADOW={name:"SAMPLER_CUBE_SHADOW",value:36293,description:" "},p.INT_SAMPLER_2D={name:"INT_SAMPLER_2D",value:36298,description:" "},p.INT_SAMPLER_3D={name:"INT_SAMPLER_3D",value:36299,description:" "},p.INT_SAMPLER_CUBE={name:"INT_SAMPLER_CUBE",value:36300,description:" "},p.INT_SAMPLER_2D_ARRAY={name:"INT_SAMPLER_2D_ARRAY",value:36303,description:" "},p.UNSIGNED_INT_SAMPLER_2D={name:"UNSIGNED_INT_SAMPLER_2D",value:36306,description:" "},p.UNSIGNED_INT_SAMPLER_3D={name:"UNSIGNED_INT_SAMPLER_3D",value:36307,description:" "},p.UNSIGNED_INT_SAMPLER_CUBE={name:"UNSIGNED_INT_SAMPLER_CUBE",value:36308,description:" "},p.UNSIGNED_INT_SAMPLER_2D_ARRAY={name:"UNSIGNED_INT_SAMPLER_2D_ARRAY",value:36311,description:" "},p.MAX_SAMPLES={name:"MAX_SAMPLES",value:36183,description:" "},p.SAMPLER_BINDING={name:"SAMPLER_BINDING",value:35097,description:" "},p.PIXEL_PACK_BUFFER={name:"PIXEL_PACK_BUFFER",value:35051,description:" "},p.PIXEL_UNPACK_BUFFER={name:"PIXEL_UNPACK_BUFFER",value:35052,description:" "},p.PIXEL_PACK_BUFFER_BINDING={name:"PIXEL_PACK_BUFFER_BINDING",value:35053,description:" "},p.PIXEL_UNPACK_BUFFER_BINDING={name:"PIXEL_UNPACK_BUFFER_BINDING",value:35055,description:" "},p.COPY_READ_BUFFER={name:"COPY_READ_BUFFER",value:36662,description:" "},p.COPY_WRITE_BUFFER={name:"COPY_WRITE_BUFFER",value:36663,description:" "},p.COPY_READ_BUFFER_BINDING={name:"COPY_READ_BUFFER_BINDING",value:36662,description:" "},p.COPY_WRITE_BUFFER_BINDING={name:"COPY_WRITE_BUFFER_BINDING",value:36663,description:" "},p.FLOAT_MAT2x3={name:"FLOAT_MAT2x3",value:35685,description:" "},p.FLOAT_MAT2x4={name:"FLOAT_MAT2x4",value:35686,description:" "},p.FLOAT_MAT3x2={name:"FLOAT_MAT3x2",value:35687,description:" "},p.FLOAT_MAT3x4={name:"FLOAT_MAT3x4",value:35688,description:" "},p.FLOAT_MAT4x2={name:"FLOAT_MAT4x2",value:35689,description:" "},p.FLOAT_MAT4x3={name:"FLOAT_MAT4x3",value:35690,description:" "},p.UNSIGNED_INT_VEC2={name:"UNSIGNED_INT_VEC2",value:36294,description:" "},p.UNSIGNED_INT_VEC3={name:"UNSIGNED_INT_VEC3",value:36295,description:" "},p.UNSIGNED_INT_VEC4={name:"UNSIGNED_INT_VEC4",value:36296,description:" "},p.UNSIGNED_NORMALIZED={name:"UNSIGNED_NORMALIZED",value:35863,description:" "},p.SIGNED_NORMALIZED={name:"SIGNED_NORMALIZED",value:36764,description:" "},p.VERTEX_ATTRIB_ARRAY_INTEGER={name:"VERTEX_ATTRIB_ARRAY_INTEGER",value:35069,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR={name:"VERTEX_ATTRIB_ARRAY_DIVISOR",value:35070,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_MODE={name:"TRANSFORM_FEEDBACK_BUFFER_MODE",value:35967,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",value:35968,description:" "},p.TRANSFORM_FEEDBACK_VARYINGS={name:"TRANSFORM_FEEDBACK_VARYINGS",value:35971,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_START={name:"TRANSFORM_FEEDBACK_BUFFER_START",value:35972,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_SIZE={name:"TRANSFORM_FEEDBACK_BUFFER_SIZE",value:35973,description:" "},p.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN={name:"TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",value:35976,description:" "},p.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",value:35978,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",value:35979,description:" "},p.INTERLEAVED_ATTRIBS={name:"INTERLEAVED_ATTRIBS",value:35980,description:" "},p.SEPARATE_ATTRIBS={name:"SEPARATE_ATTRIBS",value:35981,description:" "},p.TRANSFORM_FEEDBACK_BUFFER={name:"TRANSFORM_FEEDBACK_BUFFER",value:35982,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_BINDING={name:"TRANSFORM_FEEDBACK_BUFFER_BINDING",value:35983,description:" "},p.TRANSFORM_FEEDBACK={name:"TRANSFORM_FEEDBACK",value:36386,description:" "},p.TRANSFORM_FEEDBACK_PAUSED={name:"TRANSFORM_FEEDBACK_PAUSED",value:36387,description:" "},p.TRANSFORM_FEEDBACK_ACTIVE={name:"TRANSFORM_FEEDBACK_ACTIVE",value:36388,description:" "},p.TRANSFORM_FEEDBACK_BINDING={name:"TRANSFORM_FEEDBACK_BINDING",value:36389,description:" "},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",value:33296,description:" "},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",value:33297,description:" "},p.FRAMEBUFFER_ATTACHMENT_RED_SIZE={name:"FRAMEBUFFER_ATTACHMENT_RED_SIZE",value:33298,description:" "},p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE={name:"FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",value:33299,description:" "},p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE={name:"FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",value:33300,description:" "},p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE={name:"FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",value:33301,description:" "},p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE={name:"FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",value:33302,description:" "},p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE={name:"FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",value:33303,description:" "},p.FRAMEBUFFER_DEFAULT={name:"FRAMEBUFFER_DEFAULT",value:33304,description:" "},p.DEPTH24_STENCIL8={name:"DEPTH24_STENCIL8",value:35056,description:" "},p.DRAW_FRAMEBUFFER_BINDING={name:"DRAW_FRAMEBUFFER_BINDING",value:36006,description:" "},p.READ_FRAMEBUFFER={name:"READ_FRAMEBUFFER",value:36008,description:" "},p.DRAW_FRAMEBUFFER={name:"DRAW_FRAMEBUFFER",value:36009,description:" "},p.READ_FRAMEBUFFER_BINDING={name:"READ_FRAMEBUFFER_BINDING",value:36010,description:" "},p.RENDERBUFFER_SAMPLES={name:"RENDERBUFFER_SAMPLES",value:36011,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",value:36052,description:" "},p.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE={name:"FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",value:36182,description:" "},p.UNIFORM_BUFFER={name:"UNIFORM_BUFFER",value:35345,description:" "},p.UNIFORM_BUFFER_BINDING={name:"UNIFORM_BUFFER_BINDING",value:35368,description:" "},p.UNIFORM_BUFFER_START={name:"UNIFORM_BUFFER_START",value:35369,description:" "},p.UNIFORM_BUFFER_SIZE={name:"UNIFORM_BUFFER_SIZE",value:35370,description:" "},p.MAX_VERTEX_UNIFORM_BLOCKS={name:"MAX_VERTEX_UNIFORM_BLOCKS",value:35371,description:" "},p.MAX_FRAGMENT_UNIFORM_BLOCKS={name:"MAX_FRAGMENT_UNIFORM_BLOCKS",value:35373,description:" "},p.MAX_COMBINED_UNIFORM_BLOCKS={name:"MAX_COMBINED_UNIFORM_BLOCKS",value:35374,description:" "},p.MAX_UNIFORM_BUFFER_BINDINGS={name:"MAX_UNIFORM_BUFFER_BINDINGS",value:35375,description:" "},p.MAX_UNIFORM_BLOCK_SIZE={name:"MAX_UNIFORM_BLOCK_SIZE",value:35376,description:" "},p.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS={name:"MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",value:35377,description:" "},p.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",value:35379,description:" "},p.UNIFORM_BUFFER_OFFSET_ALIGNMENT={name:"UNIFORM_BUFFER_OFFSET_ALIGNMENT",value:35380,description:" "},p.ACTIVE_UNIFORM_BLOCKS={name:"ACTIVE_UNIFORM_BLOCKS",value:35382,description:" "},p.UNIFORM_TYPE={name:"UNIFORM_TYPE",value:35383,description:" "},p.UNIFORM_SIZE={name:"UNIFORM_SIZE",value:35384,description:" "},p.UNIFORM_BLOCK_INDEX={name:"UNIFORM_BLOCK_INDEX",value:35386,description:" "},p.UNIFORM_OFFSET={name:"UNIFORM_OFFSET",value:35387,description:" "},p.UNIFORM_ARRAY_STRIDE={name:"UNIFORM_ARRAY_STRIDE",value:35388,description:" "},p.UNIFORM_MATRIX_STRIDE={name:"UNIFORM_MATRIX_STRIDE",value:35389,description:" "},p.UNIFORM_IS_ROW_MAJOR={name:"UNIFORM_IS_ROW_MAJOR",value:35390,description:" "},p.UNIFORM_BLOCK_BINDING={name:"UNIFORM_BLOCK_BINDING",value:35391,description:" "},p.UNIFORM_BLOCK_DATA_SIZE={name:"UNIFORM_BLOCK_DATA_SIZE",value:35392,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORMS={name:"UNIFORM_BLOCK_ACTIVE_UNIFORMS",value:35394,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES={name:"UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",value:35395,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",value:35396,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",value:35398,description:" "},p.OBJECT_TYPE={name:"OBJECT_TYPE",value:37138,description:" "},p.SYNC_CONDITION={name:"SYNC_CONDITION",value:37139,description:" "},p.SYNC_STATUS={name:"SYNC_STATUS",value:37140,description:" "},p.SYNC_FLAGS={name:"SYNC_FLAGS",value:37141,description:" "},p.SYNC_FENCE={name:"SYNC_FENCE",value:37142,description:" "},p.SYNC_GPU_COMMANDS_COMPLETE={name:"SYNC_GPU_COMMANDS_COMPLETE",value:37143,description:" "},p.UNSIGNALED={name:"UNSIGNALED",value:37144,description:" "},p.SIGNALED={name:"SIGNALED",value:37145,description:" "},p.ALREADY_SIGNALED={name:"ALREADY_SIGNALED",value:37146,description:" "},p.TIMEOUT_EXPIRED={name:"TIMEOUT_EXPIRED",value:37147,description:" "},p.CONDITION_SATISFIED={name:"CONDITION_SATISFIED",value:37148,description:" "},p.WAIT_FAILED={name:"WAIT_FAILED",value:37149,description:" "},p.SYNC_FLUSH_COMMANDS_BIT={name:"SYNC_FLUSH_COMMANDS_BIT",value:1,description:" "},p.COLOR={name:"COLOR",value:6144,description:" "},p.DEPTH={name:"DEPTH",value:6145,description:" "},p.STENCIL={name:"STENCIL",value:6146,description:" "},p.MIN={name:"MIN",value:32775,description:" "},p.MAX={name:"MAX",value:32776,description:" "},p.DEPTH_COMPONENT24={name:"DEPTH_COMPONENT24",value:33190,description:" "},p.STREAM_READ={name:"STREAM_READ",value:35041,description:" "},p.STREAM_COPY={name:"STREAM_COPY",value:35042,description:" "},p.STATIC_READ={name:"STATIC_READ",value:35045,description:" "},p.STATIC_COPY={name:"STATIC_COPY",value:35046,description:" "},p.DYNAMIC_READ={name:"DYNAMIC_READ",value:35049,description:" "},p.DYNAMIC_COPY={name:"DYNAMIC_COPY",value:35050,description:" "},p.DEPTH_COMPONENT32F={name:"DEPTH_COMPONENT32F",value:36012,description:" "},p.DEPTH32F_STENCIL8={name:"DEPTH32F_STENCIL8",value:36013,description:" "},p.INVALID_INDEX={name:"INVALID_INDEX",value:4294967295,description:" "},p.TIMEOUT_IGNORED={name:"TIMEOUT_IGNORED",value:-1,description:" "},p.MAX_CLIENT_WAIT_TIMEOUT_WEBGL={name:"MAX_CLIENT_WAIT_TIMEOUT_WEBGL",value:37447,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE={name:"VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",value:35070,description:"Describes the frequency divisor used for instanced rendering.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_VENDOR_WEBGL={name:"UNMASKED_VENDOR_WEBGL",value:37445,description:"Passed to getParameter to get the vendor string of the graphics driver.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_RENDERER_WEBGL={name:"UNMASKED_RENDERER_WEBGL",value:37446,description:"Passed to getParameter to get the renderer string of the graphics driver.",extensionName:"WEBGL_debug_renderer_info"},p.MAX_TEXTURE_MAX_ANISOTROPY_EXT={name:"MAX_TEXTURE_MAX_ANISOTROPY_EXT",value:34047,description:"Returns the maximum available anisotropy.",extensionName:"EXT_texture_filter_anisotropic"},p.TEXTURE_MAX_ANISOTROPY_EXT={name:"TEXTURE_MAX_ANISOTROPY_EXT",value:34046,description:"Passed to texParameter to set the desired maximum anisotropy for a texture.",extensionName:"EXT_texture_filter_anisotropic"},p.COMPRESSED_RGB_S3TC_DXT1_EXT={name:"COMPRESSED_RGB_S3TC_DXT1_EXT",value:33776,description:"A DXT1-compressed image in an RGB image format.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT1_EXT={name:"COMPRESSED_RGBA_S3TC_DXT1_EXT",value:33777,description:"A DXT1-compressed image in an RGB image format with a simple on/off alpha value.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT3_EXT={name:"COMPRESSED_RGBA_S3TC_DXT3_EXT",value:33778,description:"A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT5_EXT={name:"COMPRESSED_RGBA_S3TC_DXT5_EXT",value:33779,description:"A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_R11_EAC={name:"COMPRESSED_R11_EAC",value:37488,description:"One-channel (red) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_R11_EAC={name:"COMPRESSED_SIGNED_R11_EAC",value:37489,description:"One-channel (red) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RG11_EAC={name:"COMPRESSED_RG11_EAC",value:37490,description:"Two-channel (red and green) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_RG11_EAC={name:"COMPRESSED_SIGNED_RG11_EAC",value:37491,description:"Two-channel (red and green) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_ETC2={name:"COMPRESSED_RGB8_ETC2",value:37492,description:"Compresses RBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGBA8_ETC2_EAC={name:"COMPRESSED_RGBA8_ETC2_EAC",value:37493,description:"Compresses RGBA8 data. The RGB part is encoded the same as RGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ETC2={name:"COMPRESSED_SRGB8_ETC2",value:37494,description:"Compresses sRBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC={name:"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",value:37495,description:"Compresses sRGBA8 data. The sRGB part is encoded the same as SRGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37496,description:"Similar to RGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37497,description:"Similar to SRGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_4BPPV1_IMG",value:35840,description:"RGB compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",value:35842,description:"RGBA compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_2BPPV1_IMG",value:35841,description:"RGB compression in 2-bit mode. One block for each 8×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",value:35843,description:"RGBA compression in 2-bit mode. One block for each 8×4 pixe",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_ETC1_WEBGL={name:"COMPRESSED_RGB_ETC1_WEBGL",value:36196,description:"Compresses 24-bit RGB data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc1"},p.COMPRESSED_RGB_ATC_WEBGL={name:"COMPRESSED_RGB_ATC_WEBGL",value:35986,description:"Compresses RGB textures with no alpha channel.",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",value:35986,description:"Compresses RGBA textures using explicit alpha encoding (useful when alpha transitions are sharp).",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",value:34798,description:"Compresses RGBA textures using interpolated alpha encoding (useful when alpha transitions are gradient).",extensionName:"WEBGL_compressed_texture_atc"},p.UNSIGNED_INT_24_8_WEBGL={name:"UNSIGNED_INT_24_8_WEBGL",value:34042,description:"Unsigned integer type for 24-bit depth texture data.",extensionName:"WEBGL_depth_texture"},p.HALF_FLOAT_OES={name:"HALF_FLOAT_OES",value:36193,description:"Half floating-point type (16-bit).",extensionName:"OES_texture_half_float"},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",value:33297,description:" ",extensionName:"WEBGL_color_buffer_float"},p.UNSIGNED_NORMALIZED_EXT={name:"UNSIGNED_NORMALIZED_EXT",value:35863,description:" ",extensionName:"WEBGL_color_buffer_float"},p.MIN_EXT={name:"MIN_EXT",value:32775,description:"Produces the minimum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.MAX_EXT={name:"MAX_EXT",value:32776,description:"Produces the maximum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.SRGB_EXT={name:"SRGB_EXT",value:35904,description:"Unsized sRGB format that leaves the precision up to the driver.",extensionName:"EXT_sRGB"},p.SRGB_ALPHA_EXT={name:"SRGB_ALPHA_EXT",value:35906,description:"Unsized sRGB format with unsized alpha component.",extensionName:"EXT_sRGB"},p.SRGB8_ALPHA8_EXT={name:"SRGB8_ALPHA8_EXT",value:35907,description:"Sized (8-bit) sRGB and alpha formats.",extensionName:"EXT_sRGB"},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",value:33296,description:"Returns the framebuffer color encoding.",extensionName:"EXT_sRGB"},p.FRAGMENT_SHADER_DERIVATIVE_HINT_OES={name:"FRAGMENT_SHADER_DERIVATIVE_HINT_OES",value:35723,description:"Indicates the accuracy of the derivative calculation for the GLSL built-in functions: dFdx, dFdy, and fwidth.",extensionName:"OES_standard_derivatives"},p.COLOR_ATTACHMENT0_WEBGL={name:"COLOR_ATTACHMENT0_WEBGL",value:36064,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT1_WEBGL={name:"COLOR_ATTACHMENT1_WEBGL",value:36065,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT2_WEBGL={name:"COLOR_ATTACHMENT2_WEBGL",value:36066,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT3_WEBGL={name:"COLOR_ATTACHMENT3_WEBGL",value:36067,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT4_WEBGL={name:"COLOR_ATTACHMENT4_WEBGL",value:36068,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT5_WEBGL={name:"COLOR_ATTACHMENT5_WEBGL",value:36069,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT6_WEBGL={name:"COLOR_ATTACHMENT6_WEBGL",value:36070,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT7_WEBGL={name:"COLOR_ATTACHMENT7_WEBGL",value:36071,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT8_WEBGL={name:"COLOR_ATTACHMENT8_WEBGL",value:36072,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT9_WEBGL={name:"COLOR_ATTACHMENT9_WEBGL",value:36073,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT10_WEBGL={name:"COLOR_ATTACHMENT10_WEBGL",value:36074,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT11_WEBGL={name:"COLOR_ATTACHMENT11_WEBGL",value:36075,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT12_WEBGL={name:"COLOR_ATTACHMENT12_WEBGL",value:36076,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT13_WEBGL={name:"COLOR_ATTACHMENT13_WEBGL",value:36077,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT14_WEBGL={name:"COLOR_ATTACHMENT14_WEBGL",value:36078,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT15_WEBGL={name:"COLOR_ATTACHMENT15_WEBGL",value:36079,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER0_WEBGL={name:"DRAW_BUFFER0_WEBGL",value:34853,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER1_WEBGL={name:"DRAW_BUFFER1_WEBGL",value:34854,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER2_WEBGL={name:"DRAW_BUFFER2_WEBGL",value:34855,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER3_WEBGL={name:"DRAW_BUFFER3_WEBGL",value:34856,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER4_WEBGL={name:"DRAW_BUFFER4_WEBGL",value:34857,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER5_WEBGL={name:"DRAW_BUFFER5_WEBGL",value:34858,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER6_WEBGL={name:"DRAW_BUFFER6_WEBGL",value:34859,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER7_WEBGL={name:"DRAW_BUFFER7_WEBGL",value:34860,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER8_WEBGL={name:"DRAW_BUFFER8_WEBGL",value:34861,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER9_WEBGL={name:"DRAW_BUFFER9_WEBGL",value:34862,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER10_WEBGL={name:"DRAW_BUFFER10_WEBGL",value:34863,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER11_WEBGL={name:"DRAW_BUFFER11_WEBGL",value:34864,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER12_WEBGL={name:"DRAW_BUFFER12_WEBGL",value:34865,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER13_WEBGL={name:"DRAW_BUFFER13_WEBGL",value:34866,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER14_WEBGL={name:"DRAW_BUFFER14_WEBGL",value:34867,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER15_WEBGL={name:"DRAW_BUFFER15_WEBGL",value:34868,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.MAX_COLOR_ATTACHMENTS_WEBGL={name:"MAX_COLOR_ATTACHMENTS_WEBGL",value:36063,description:"Maximum number of framebuffer color attachment points",extensionName:"WEBGL_draw_buffers"},p.MAX_DRAW_BUFFERS_WEBGL={name:"MAX_DRAW_BUFFERS_WEBGL",value:34852,description:"Maximum number of draw buffers",extensionName:"WEBGL_draw_buffers"},p.VERTEX_ARRAY_BINDING_OES={name:"VERTEX_ARRAY_BINDING_OES",value:34229,description:"The bound vertex array object (VAO).",extensionName:"VERTEX_ARRAY_BINDING_OES"},p.QUERY_COUNTER_BITS_EXT={name:"QUERY_COUNTER_BITS_EXT",value:34916,description:"The number of bits used to hold the query result for the given target.",extensionName:"EXT_disjoint_timer_query"},p.CURRENT_QUERY_EXT={name:"CURRENT_QUERY_EXT",value:34917,description:"The currently active query.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_EXT={name:"QUERY_RESULT_EXT",value:34918,description:"The query result.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_AVAILABLE_EXT={name:"QUERY_RESULT_AVAILABLE_EXT",value:34919,description:"A Boolean indicating whether or not a query result is available.",extensionName:"EXT_disjoint_timer_query"},p.TIME_ELAPSED_EXT={name:"TIME_ELAPSED_EXT",value:35007,description:"Elapsed time (in nanoseconds).",extensionName:"EXT_disjoint_timer_query"},p.TIMESTAMP_EXT={name:"TIMESTAMP_EXT",value:36392,description:"The current time.",extensionName:"EXT_disjoint_timer_query"},p.GPU_DISJOINT_EXT={name:"GPU_DISJOINT_EXT",value:36795,description:"A Boolean indicating whether or not the GPU performed any disjoint operation.",extensionName:"EXT_disjoint_timer_query"},p.zeroMeaningByCommand={getError:"NO_ERROR",blendFunc:"ZERO",blendFuncSeparate:"ZERO",readBuffer:"NONE",getFramebufferAttachmentParameter:"NONE",texParameterf:"NONE",texParameteri:"NONE",drawArrays:"POINTS",drawElements:"POINTS",drawArraysInstanced:"POINTS",drawArraysInstancedAngle:"POINTS",drawBuffers:"POINTS",drawElementsInstanced:"POINTS",drawRangeElements:"POINTS"},p.oneMeaningByCommand={blendFunc:"ONE",blendFuncSeparate:"ONE",drawArrays:"LINES",drawElements:"LINES",drawArraysInstanced:"LINES",drawArraysInstancedAngle:"LINES",drawBuffers:"LINES",drawElementsInstanced:"LINES",drawRangeElements:"LINES"};const m={},g={};!function(){for(const e in p)if(p.hasOwnProperty(e)){const t=p[e];m[t.name]=t,g[t.value]=t}}();class E extends c{get analyserName(){return E.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={total:0,totalTriangles:0,totalTriangleStrip:0,totalTriangleFan:0,totalLines:0,totalLineStrip:0,totalLineLoop:0,totalPoints:0};for(const t of e.commands)"drawArrays"===t.name&&t.commandArguments.length>=3||"drawArraysInstanced"===t.name&&t.commandArguments.length>=3||"drawArraysInstancedANGLE"===t.name&&t.commandArguments.length>=3?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[2]):"drawElements"===t.name&&t.commandArguments.length>=2||"drawElementsInstanced"===t.name&&t.commandArguments.length>=2||"drawElementsInstancedANGLE"===t.name&&t.commandArguments.length>=2?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[1]):"drawRangeElements"===t.name&&t.commandArguments.length>=4&&this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[3]);t.total=n.total,t.triangles=n.totalTriangles,t.triangleStrip=n.totalTriangleStrip,t.triangleFan=n.totalTriangleFan,t.lines=n.totalLines,t.lineStrip=n.totalLineStrip,t.lineLoop=n.totalLineLoop,t.points=n.totalPoints}appendToPrimitives(e,t,n){t===p.POINTS.value?e.totalPoints+=n:t===p.LINES.value?e.totalLines+=n:t===p.LINE_STRIP.value?e.totalLineStrip+=n:t===p.LINE_LOOP.value?e.totalLineLoop+=n:t===p.TRIANGLES.value?e.totalTriangles+=n:t===p.TRIANGLE_STRIP.value?e.totalTriangleStrip+=n:t===p.TRIANGLE_FAN.value&&(e.totalTriangleFan+=n),e.total+=n}}E.analyserName="Primitives";class v{constructor(e){this.contextInformation=e,this.analysers=[],this.initAnalysers()}appendAnalyses(e){for(const t in this.analysers)this.analysers.hasOwnProperty(t)&&this.analysers[t].appendAnalysis(e)}initAnalysers(){this.analysers.push(new h(this.contextInformation),new f(this.contextInformation),new E(this.contextInformation))}}class C{static getStackTrace(e=0,t=0){const n=[];try{throw new Error("Errorator.")}catch(e){if(e.stack){const t=e.stack.split("\n");for(let e=0,r=t.length;e0;t++)n.shift();for(let e=0;e0;e++)n.pop()}return n}}class D{static getWebGlObjectTag(e){return e[D.SPECTOROBJECTTAGKEY]}static attachWebGlObjectTag(e,t){t.displayText=D.stringifyWebGlObjectTag(t),e[D.SPECTOROBJECTTAGKEY]=t}static stringifyWebGlObjectTag(e){return e?`${e.typeName} - ID: ${e.id}`:"No tag available."}}D.SPECTOROBJECTTAGKEY="__SPECTOR_Object_TAG";class S{get type(){return("undefined"!=typeof globalThis?globalThis:self)[this.typeName]||null}constructor(){this.id=0}tagWebGlObject(e){if(!this.type)return;let t;if(!e)return t;if(t=D.getWebGlObjectTag(e),t)return t;if(e instanceof this.type){const n=this.getNextId();return t={typeName:this.typeName,id:n},D.attachWebGlObjectTag(e,t),t}return t}getNextId(){return this.id++}}class A{constructor(e){this.options=e}createCapture(e,t,n){const r=C.getStackTrace(4,1),i=0===e.name.indexOf("uniform")?this.stringifyUniform(e.arguments):this.stringify(e.arguments,e.result),s={id:t,startTime:e.startTime,commandEndTime:e.endTime,endTime:0,name:e.name,commandArguments:e.arguments,result:e.result,stackTrace:r,status:0,marker:n,text:i};this.transformCapture(s);for(let e=0;e50&&(s.commandArguments[e]="Array Length: "+t.length)}if(s.commandArguments){const e=[];for(let t=0;t0&&(n+=": "+this.stringifyArgs(e).join(", ")),null!=t&&(n+=" -> "+this.stringifyResult(t)),n}stringifyUniform(e){let t=this.spiedCommandName;if(e&&e.length>0){const n=[];n.push(this.stringifyValue(e[0]));for(let t=1;t0&&"number"==typeof s)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");else{const e=this.stringifyValue(s);r.push(e)}}return r}}_.commandName="bufferSubData";class y{static storeOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]||(e[n]=e[t])}static resetOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]&&(e[t]=e[n],delete e[n])}static storePrototypeOriginFunction(e,t){if(!e)return;if(!e.prototype[t])return;const n=this.getOriginFunctionName(t);e.prototype[n]||(e.prototype[n]=e.prototype[t])}static executePrototypeOriginFunction(e,t,n,r){if(!e)return;const i=this.getOriginFunctionName(n);return t.prototype[i]?(e[i]||(e[i]=t.prototype[i]),this.executeFunction(e,i,r)):void 0}static executeOriginFunction(e,t,n){if(!e)return;const r=this.getOriginFunctionName(t);return e[r]?this.executeFunction(e,r,n):void 0}static executeFunction(e,t,n){const r=n;if(void 0===r||0===r.length)return e[t]();switch(r.length){case 1:return e[t](r[0]);case 2:return e[t](r[0],r[1]);case 3:return e[t](r[0],r[1],r[2]);case 4:return e[t](r[0],r[1],r[2],r[3]);case 5:return e[t](r[0],r[1],r[2],r[3],r[4]);case 6:return e[t](r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6]);case 8:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]);case 9:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8]);case 10:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9]);case 11:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10]);case 12:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11]);case 13:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12]);case 14:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13]);case 15:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14]);case 16:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);case 17:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16]);case 18:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17]);case 19:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18]);case 20:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19]);default:return e[t].apply(e,r)}}static getOriginFunctionName(e){return this.originFunctionPrefix+e}}y.originFunctionPrefix="__SPECTOR_Origin_";class b extends A{get spiedCommandName(){return b.commandName}stringifyArgs(e){const t=[];if(e.length>0){const n=e[0],r=this.stringifyValue(n);t.push(r)}if(e.length>1){const n=""+e[1];t.push(n)}return e.length>2&&t.push(e[2]),t}}b.commandName="bindAttribLocation";class T extends A{get spiedCommandName(){return T.commandName}stringifyArgs(e){const t=[],n=this.options.context.getParameter(p.READ_FRAMEBUFFER_BINDING.value),r=this.options.tagWebGlObject(n);t.push("READ FROM: "+this.stringifyValue(r));const i=this.options.context.getParameter(p.DRAW_FRAMEBUFFER_BINDING.value),s=this.options.tagWebGlObject(i);t.push("WRITE TO: "+this.stringifyValue(s));for(let n=0;n<8;n++)t.push(e[n]);return(e[8]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[8]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[8]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t.push(p.stringifyWebGlConstant(e[9],"blitFrameBuffer")),t}}T.commandName="blitFrameBuffer";class R extends A{get spiedCommandName(){return R.commandName}stringifyArgs(e){const t=[];return(e[0]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[0]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[0]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t}}R.commandName="clear";class x{static getProgramData(e,t){const n={LINK_STATUS:e.getProgramParameter(t,p.LINK_STATUS.value),VALIDATE_STATUS:e.getProgramParameter(t,p.VALIDATE_STATUS.value),infoLog:e.getProgramInfoLog(t)||""},r=e.getAttachedShaders(t)||[],i=new Array(2);let s=0;for(const t of r){const n=this.getShaderData(e,t);s+=n.source.length,n.shaderType===p.FRAGMENT_SHADER.name?i[1]=n:i[0]=n}return{programStatus:n,shaders:i,length:s}}static getShaderData(e,t){const n=e.getShaderSource(t)||"",r=e.getExtension("WEBGL_debug_shaders"),i=r?r.getTranslatedShaderSource(t):null,s=e.getShaderParameter(t,p.SHADER_TYPE.value)===p.FRAGMENT_SHADER.value;let o=t&&t.__SPECTOR_Metadata&&t.__SPECTOR_Metadata.name?t.__SPECTOR_Metadata.name:this.readNameFromShaderSource(n);return o||(o=s?"Fragment":"Vertex"),{COMPILE_STATUS:e.getShaderParameter(t,p.COMPILE_STATUS.value),shaderType:s?p.FRAGMENT_SHADER.name:p.VERTEX_SHADER.name,name:o,source:n,translatedSource:i,infoLog:e.getShaderInfoLog(t)||""}}static readNameFromShaderSource(e){try{let t,n="";const r=/#define[\s]+SHADER_NAME[\s]+([\S]+)(\n|$)/gi;if(t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),""===n){const r=/#define[\s]+SHADER_NAME_B64[\s]+([\S]+)(\n|$)/gi;t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),n&&(n=decodeURIComponent(atob(n)))}return n}catch(e){return null}}}class w extends A{constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.shader=x.getShaderData(this.options.context,t)}finally{n&&n(!0)}}getShaderDisplayText(e){return this.stringifyValue(e.commandArguments[0])}}class F extends w{get spiedCommandName(){return F.commandName}transformCapture(e){if(super.transformCapture(e),e.shader){const t=e.shader.COMPILE_STATUS?"compiled":"failed";e.text=`${this.spiedCommandName}: ${this.getShaderDisplayText(e)} -> ${t}`}}}F.commandName="compileShader";const N=["lineWidth"];class L extends A{get spiedCommandName(){return this.internalSpiedCommandName}constructor(e,t){super(e),this.internalSpiedCommandName=t,this.isDeprecated=N.indexOf(this.spiedCommandName)>-1}transformCapture(e){this.isDeprecated&&(e.status=50)}}class O extends A{get spiedCommandName(){return O.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}O.commandName="disableVertexAttribArray";class I extends A{get spiedCommandName(){return I.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(e[1]+" indices"),t.push(e[2]),t}}I.commandName="drawArrays";class k extends A{get spiedCommandName(){return k.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}k.commandName="drawArraysInstanced";class M extends A{get spiedCommandName(){return M.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstancedANGLE")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}M.commandName="drawArraysInstancedANGLE";class P extends A{get spiedCommandName(){return P.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElements")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElements")),t.push(e[3]),t}}P.commandName="drawElements";class B extends A{get spiedCommandName(){return B.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstancedANGLE")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstancedANGLE")),t.push(e[3]),t.push(e[4]),t}}B.commandName="drawElementsInstancedANGLE";class U extends A{get spiedCommandName(){return U.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t}}U.commandName="drawElementsInstanced";class $ extends A{get spiedCommandName(){return $.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawRangeElements")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(p.stringifyWebGlConstant(e[4],"drawRangeElements")),t.push(e[5]),t}}$.commandName="drawRangeElements";class G extends A{get spiedCommandName(){return G.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}G.commandName="getActiveAttrib";class V extends A{get spiedCommandName(){return V.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}V.commandName="getActiveUniform";class W extends A{get spiedCommandName(){return W.commandName}stringifyResult(e){var t;if(null!=e)return null!==(t=null==e?void 0:e.toFixed(0))&&void 0!==t?t:"0"}}W.commandName="getAttribLocation";class H extends A{get spiedCommandName(){return H.commandName}stringifyResult(e){return e?"true":"false"}}H.commandName="getExtension";class j extends A{get spiedCommandName(){return j.commandName}stringifyResult(e){if(!e)return"null";const t=D.getWebGlObjectTag(e);return t?t.displayText:e}}j.commandName="getParameter";class z extends A{get spiedCommandName(){return z.commandName}stringifyResult(e){if(e)return`min: ${e.rangeMin}, max: ${e.rangeMax}, precision: ${e.precision}`}}z.commandName="getShaderPrecisionFormat";class X extends w{get spiedCommandName(){return X.commandName}stringifyResult(e){if("string"!=typeof e||0===e.trim().length)return"No messages";const t=e.split(/\r?\n/).filter(e=>e.trim().length>0).length;return t+(1===t?" message":" messages")}}X.commandName="getShaderInfoLog";class K extends A{get spiedCommandName(){return K.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}K.commandName="getTransformFeedbackVarying";class Y extends A{get spiedCommandName(){return Y.commandName}constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.program=x.getProgramData(this.options.context,t)}finally{n&&n(!0)}const r=e.program.programStatus.LINK_STATUS?"linked":"failed";e.text=`${this.spiedCommandName}: ${this.stringifyValue(t)} -> ${r}`}}Y.commandName="linkProgram";class q extends A{get spiedCommandName(){return q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"multiDrawArraysInstancedBaseInstanceWEBGL")),t.push(`drawCount=${e[9]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t}}q.commandName="multiDrawArraysInstancedBaseInstanceWEBGL";class Q extends A{get spiedCommandName(){return Q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[7]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t}}Q.commandName="multiDrawArraysInstancedWEBGL";class Z extends A{get spiedCommandName(){return Z.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[5]}`),t.push(e[2]),t.push(e[4]),t}}Z.commandName="multiDrawArraysWEBGL";class J extends A{get spiedCommandName(){return J.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[11]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t.push(e[10]),t}}J.commandName="multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL";class ee extends A{get spiedCommandName(){return ee.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[8]}`),t.push(e[2]),t.push(e[5]),t.push(e[7]),t}}ee.commandName="multiDrawElementsInstancedWEBGL";class te extends A{get spiedCommandName(){return te.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[6]}`),t.push(e[2]),t.push(e[5]),t}}te.commandName="multiDrawElementsWEBGL";class ne extends A{get spiedCommandName(){return ne.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(`baseInstance = ${e[4]}`),t}}ne.commandName="drawArraysInstancedBaseInstanceWEBGL";class re extends A{get spiedCommandName(){return re.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t.push(`baseVertex = ${e[5]}`),t.push(`baseInstance = ${e[6]}`),t}}re.commandName="drawElementsInstancedBaseVertexBaseInstanceWEBGL";class ie extends A{get spiedCommandName(){return ie.commandName}stringifyArgs(e){var t,n;const r=[];for(let i=0;i<4;i++)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");return r}}function se(e){return null==e?"":`${e.toFixed(0)} (0b${(e>>>0).toString(2)})`}ie.commandName="scissor";class oe extends A{get spiedCommandName(){return oe.commandName}stringifyArgs(e){const t=[];return t.push(se(e[0])),t}}oe.commandName="stencilMask";class ae extends A{get spiedCommandName(){return ae.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilMaskSeparate")),t.push(se(e[1])),t}}ae.commandName="stencilMaskSeparate";class le extends A{get spiedCommandName(){return le.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFunc")),t.push(se(e[1])),t.push(se(e[2])),t}}le.commandName="stencilFunc";class ue extends A{get spiedCommandName(){return ue.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFuncSeparate")),t.push(p.stringifyWebGlConstant(e[1],"stencilFuncSeparate")),t.push(se(e[2])),t.push(se(e[3])),t}}ue.commandName="stencilFuncSeparate";class ce extends A{get spiedCommandName(){return ce.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t.push(e[1]),t.push(p.stringifyWebGlConstant(e[2],"vertexAttribPointer")),t.push(e[3]),t.push(e[4]),t.push(e[5]),t}}ce.commandName="vertexAttribPointer";class he extends A{get spiedCommandName(){return he.commandName}stringifyArgs(e){const t=[];for(let n=0;n<4;n++)t.push(e[n].toFixed(0));return t}}he.commandName="viewport";class de extends A{get spiedCommandName(){return de.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}de.commandName="enableVertexAttribArray";class fe extends w{get spiedCommandName(){return fe.commandName}stringifyArgs(e){const t="string"==typeof e[1]?e[1]:"";return[this.stringifyValue(e[0]),t.length+" chars"]}transformCapture(e){super.transformCapture(e);const t=e.commandArguments[1];e.shader&&"string"==typeof t&&(e.shader.source=t,e.shader.COMPILE_STATUS=null,e.shader.translatedSource="",e.shader.infoLog="")}}fe.commandName="shaderSource";class pe{constructor(e){this.spiedCommandName=e.spiedCommandName,this.spiedCommandRunningContext=e.spiedCommandRunningContext,this.spiedCommand=this.spiedCommandRunningContext[this.spiedCommandName],y.storeOriginFunction(this.spiedCommandRunningContext,this.spiedCommandName),this.callback=e.callback,this.commandOptions={context:e.context,contextVersion:e.contextVersion,extensions:e.extensions,toggleCapture:e.toggleCapture},this.initCustomCommands(),this.initCommand()}spy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.overloadedCommand}unSpy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.spiedCommand}createCapture(e,t,n){return this.command.createCapture(e,t,n)}initCommand(){pe.customCommandsConstructors[this.spiedCommandName]?this.command=pe.customCommandsConstructors[this.spiedCommandName](this.commandOptions):this.command=new L(this.commandOptions,this.spiedCommandName),this.overloadedCommand=this.getSpy()}getSpy(){const e=this;return function(){const t=u.now,n=y.executeOriginFunction(e.spiedCommandRunningContext,e.spiedCommandName,arguments),r=u.now;try{const i={name:e.spiedCommandName,arguments,result:n,startTime:t,endTime:r};e.callback(e,i)}catch(e){}return n}}initCustomCommands(){pe.customCommandsConstructors||(pe.customCommandsConstructors={[b.commandName]:e=>new b(e),[T.commandName]:e=>new T(e),[_.commandName]:e=>new _(e),[R.commandName]:e=>new R(e),[F.commandName]:e=>new F(e),[O.commandName]:e=>new O(e),[I.commandName]:e=>new I(e),[k.commandName]:e=>new k(e),[M.commandName]:e=>new M(e),[P.commandName]:e=>new P(e),[U.commandName]:e=>new U(e),[B.commandName]:e=>new B(e),[$.commandName]:e=>new $(e),[G.commandName]:e=>new G(e),[V.commandName]:e=>new V(e),[W.commandName]:e=>new W(e),[H.commandName]:e=>new H(e),[j.commandName]:e=>new j(e),[X.commandName]:e=>new X(e),[z.commandName]:e=>new z(e),[K.commandName]:e=>new K(e),[Y.commandName]:e=>new Y(e),[q.commandName]:e=>new q(e),[Q.commandName]:e=>new Q(e),[Z.commandName]:e=>new Z(e),[J.commandName]:e=>new J(e),[ee.commandName]:e=>new ee(e),[te.commandName]:e=>new te(e),[ne.commandName]:e=>new ne(e),[re.commandName]:e=>new re(e),[ie.commandName]:e=>new ie(e),[fe.commandName]:e=>new fe(e),[oe.commandName]:e=>new oe(e),[ae.commandName]:e=>new ae(e),[le.commandName]:e=>new le(e),[ue.commandName]:e=>new ue(e),[ce.commandName]:e=>new ce(e),[he.commandName]:e=>new he(e),[de.commandName]:e=>new de(e)})}}class me{constructor(e){this.options=e,this.context=e.context,this.contextVersion=e.contextVersion,this.extensions=e.extensions,this.toggleCapture=e.toggleCapture,this.consumeCommands=this.getConsumeCommands(),this.changeCommandsByState=this.getChangeCommandsByState(),this.commandNameToStates=this.getCommandNameToStates()}get requireStartAndStopStates(){return!0}startCapture(e,t,n){return this.quickCapture=t,this.fullCapture=n,this.capturedCommandsByState={},e&&this.requireStartAndStopStates&&(this.currentState={},this.readFromContextNoSideEffects()),this.copyCurrentStateToPrevious(),this.currentState={},this.previousState}stopCapture(){return this.requireStartAndStopStates&&this.readFromContextNoSideEffects(),this.analyse(void 0),this.currentState}registerCallbacks(e){for(const t in this.changeCommandsByState)if(this.changeCommandsByState.hasOwnProperty(t))for(const n of this.changeCommandsByState[t])e[n]=e[n]||[],e[n].push(this.onChangeCommand.bind(this));for(const t of this.consumeCommands)e[t]=e[t]||[],e[t].push(this.onConsumeCommand.bind(this))}getStateData(){return this.currentState}getConsumeCommands(){return[]}getChangeCommandsByState(){return{}}copyCurrentStateToPrevious(){this.currentState&&(this.previousState=this.currentState)}onChangeCommand(e){const t=this.commandNameToStates[e.name];for(const n of t){if(!this.isValidChangeCommand(e,n))return;this.capturedCommandsByState[n]=this.capturedCommandsByState[n]||[],this.capturedCommandsByState[n].push(e)}}isValidChangeCommand(e,t){return!0}onConsumeCommand(e){this.isValidConsumeCommand(e)&&(this.readFromContextNoSideEffects(),this.analyse(e),this.storeCommandIds(),e[this.stateName]=this.currentState,this.startCapture(!1,this.quickCapture,this.fullCapture))}isValidConsumeCommand(e){return this.lastCommandName=null==e?void 0:e.name,!0}analyse(e){for(const t in this.capturedCommandsByState)if(this.capturedCommandsByState.hasOwnProperty(t)){const n=this.capturedCommandsByState[t],r=n.length-1;if(r>=0)if(e){for(let t=0;t1&&this.parameters.push(this.getWebgl2Parameters());const e={};for(let t=1;t<=this.contextVersion&&!(t>this.parameters.length);t++)if(this.parameters[t-1])for(const n of this.parameters[t-1])if(n.changeCommands)for(const t of n.changeCommands)e[n.constant.name]=e[n.constant.name]||[],e[n.constant.name].push(t);return e}readFromContext(){for(let e=1;e<=this.contextVersion&&!(e>this.parameters.length);e++)for(const t of this.parameters[e-1]){const e=this.readParameterFromContext(t);if(null==e){const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n;continue}const n=D.getWebGlObjectTag(e);if(n)this.currentState[t.constant.name]=n;else{const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n}}}readParameterFromContext(e){return e.constant.extensionName&&!this.extensions[e.constant.extensionName]?`Extension ${e.constant.extensionName} is unavailable.`:this.context.getParameter(e.constant.value)}stringifyParameterValue(e,t){if(null===e)return"null";if(void 0===e)return"undefined";if(30===t.returnType)return se(e);if("number"==typeof e&&p.isWebGlConstant(e)){if(20===t.returnType){const n=t.changeCommands&&t.changeCommands[0]||"";return p.stringifyWebGlConstant(e,n)}return e}if(e.length&&"string"!=typeof e){const t=[];for(let n=0;n1?r=this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value):this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.value)===p.RENDERBUFFER.value&&(r=e.getRenderbufferParameter(e.RENDERBUFFER,e.RENDERBUFFER_STENCIL_SIZE))):r=this.readParameterFromContext({constant:p.STENCIL_BITS}),this.currentState[p.STENCIL_BITS.name]=""+r}isValidChangeCommand(e,t){return"enable"===e.name||"disable"===e.name?e.commandArguments[0]===p.STENCIL_TEST.value:"stencilOp"===e.name||"stencilOpSeparate"===e.name?xe.stencilOpStates.indexOf(e.commandArguments[0])>0:"stencilFunc"===e.name||"stencilFuncSeparate"===e.name?xe.stencilFuncStates.indexOf(e.commandArguments[0])>0:"stencilMask"!==e.name&&"stencilMaskSeparate"!==e.name||xe.stencilMaskStates.indexOf(e.commandArguments[0])>0}getConsumeCommands(){return d}isStateEnable(e,t){return this.context.isEnabled(p.STENCIL_TEST.value)}}xe.stateName="StencilState",xe.stencilOpStates=[p.STENCIL_BACK_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_PASS.value,p.STENCIL_FAIL.value,p.STENCIL_PASS_DEPTH_FAIL.value,p.STENCIL_PASS_DEPTH_PASS.value],xe.stencilFuncStates=[p.STENCIL_BACK_FUNC.value,p.STENCIL_BACK_REF.value,p.STENCIL_BACK_VALUE_MASK.value,p.STENCIL_FUNC.value,p.STENCIL_REF.value,p.STENCIL_VALUE_MASK.value],xe.stencilMaskStates=[p.STENCIL_BACK_WRITEMASK.value,p.STENCIL_WRITEMASK.value];class we{static isSupportedCombination(e,t,n){return e=e||p.UNSIGNED_BYTE.value,((t=t||p.RGBA.value)===p.RGB.value||t===p.RGBA.value)&&(n===p.RGB.value||n===p.RGBA.value||n===p.RGBA8.value||n===p.RGBA16F.value||n===p.RGBA32F.value||n===p.RGB16F.value||n===p.RGB32F.value||n===p.R11F_G11F_B10F.value||n===p.SRGB8.value||n===p.SRGB8_ALPHA8.value)&&this.isSupportedComponentType(e)}static readPixels(e,t,n,r,i,s){e.getError(),s===p.UNSIGNED_NORMALIZED.value&&(s=p.UNSIGNED_BYTE.value);const o=r*i*4;let a;if(s===p.UNSIGNED_BYTE.value?a=new Uint8Array(o):(s=p.FLOAT.value,a=new Float32Array(o)),e.readPixels(t,n,r,i,e.RGBA,s,a),e.getError())return;if(s===p.UNSIGNED_BYTE.value)return a;const l=new Uint8Array(r*i*4);for(let e=0;e1){const e=this.context.getParameter(p.MAX_DRAW_BUFFERS.value);for(let n=0;n1?this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value):p.UNSIGNED_BYTE.value;l===p.RENDERBUFFER.value?this.readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,c,u):l===p.TEXTURE.value&&this.readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,c,u)}readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,l,u){let c=0,h=0;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,c=e.samples,h=e.internalFormat,!c&&!we.isSupportedCombination(l,p.RGBA.value,h))return}else s+=r,o+=i;if(r=i=0,c){const a=e,u=e.createRenderbuffer(),c=e.getParameter(e.RENDERBUFFER_BINDING);e.bindRenderbuffer(e.RENDERBUFFER,u),e.renderbufferStorage(e.RENDERBUFFER,h,s,o),e.bindRenderbuffer(e.RENDERBUFFER,c),e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u);const d=a.getParameter(a.READ_FRAMEBUFFER_BINDING),f=a.getParameter(a.DRAW_FRAMEBUFFER_BINDING);a.bindFramebuffer(a.READ_FRAMEBUFFER,t),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,this.captureFrameBuffer),a.blitFramebuffer(0,0,s,o,0,0,s,o,e.COLOR_BUFFER_BIT,e.NEAREST),a.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),a.bindFramebuffer(a.READ_FRAMEBUFFER,d),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,f),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t),e.deleteRenderbuffer(u)}else e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,l,u){let c=0;this.contextVersion>1&&(c=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value));const h=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL.value),d=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE.value);d>0?g[d].name:p.TEXTURE_2D.name;let f=!1,m=l;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,void 0!==e.type&&(m=e.type),f=e.target===p.TEXTURE_2D_ARRAY.name,!we.isSupportedCombination(e.type,e.format,e.internalFormat))return}else s+=r,o+=i;r=i=0,e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),c>0||f?e.framebufferTextureLayer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,u,h,c):e.framebufferTexture2D(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,d||p.TEXTURE_2D.value,u,h),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,d,c,m),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}getCapture(e,t,n,r,i,s,o,l,u){i=Math.floor(i),s=Math.floor(s);const c={attachmentName:t,src:null,textureCubeMapFace:o?g[o].name:null,textureLayer:l,raw:null};if(!this.quickCapture)try{const t=we.readPixels(e,n,r,i,s,u);if(t){c.raw=Ne.encode(t,i,s),this.workingCanvas.width=i,this.workingCanvas.height=s;const e=this.workingContext2D.createImageData(i,s);if(e.data.set(t),this.workingContext2D.putImageData(e,0,0),this.fullCapture)this.captureCanvas.width=this.workingCanvas.width,this.captureCanvas.height=this.workingCanvas.height;else{const e=i/s;e<1?(this.captureCanvas.width=Le.captureBaseSize*e,this.captureCanvas.height=Le.captureBaseSize):e>1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this.captureContext2D.drawImage(this.workingCanvas,0,0,i,s,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",c.src=Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D)}}catch(e){a.warn("Spector can not capture the visual state: "+e)}this.currentState.Attachments.push(c)}analyse(e){}}Le.stateName="VisualState",Le.captureBaseSize=256;class Oe{constructor(e){this.context=e.context,this.captureFrameBuffer=e.context.createFramebuffer(),this.workingCanvas=Fe.createCanvas(1,1),this.workingContext2D=Fe.get2DContext(this.workingCanvas),this.captureCanvas=Fe.createCanvas(1,1),this.captureContext2D=Fe.get2DContext(this.captureCanvas),Fe.setImageSmoothing(this.captureContext2D,!0)}appendTextureState(e,t,n=null,r){if(!t)return;const i=t.__SPECTOR_Object_CustomData;if(i&&(this.fullCapture=r,i.type&&(e.textureType=this.getWebGlConstant(i.type)),i.format&&(e.format=this.getWebGlConstant(i.format)),i.internalFormat&&(e.internalFormat=this.getWebGlConstant(i.internalFormat)),e.width=i.width,e.height=i.height,i.depth&&(e.depth=i.depth),n)){const r="NEAREST"===e.samplerMagFilter||"NEAREST"===e.magFilter,s=this.getTextureVisualState(n,t,i,r);if(s){e.visual=s.visual;for(const t in s.visualPixels)if(s.visualPixels.hasOwnProperty(t)){e.visualPixels=s.visualPixels;break}}}}getTextureVisualState(e,t,n,r){try{const i=this.context,s={},o={};if(!we.isSupportedCombination(n.type,n.format,n.internalFormat))return{visual:s,visualPixels:o};const a=this.context.getParameter(p.FRAMEBUFFER_BINDING.value);i.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer);try{const a=0,l=n.width,u=n.height;if(e===p.TEXTURE_3D&&n.depth){const e=i;for(let c=0;c2&&c2&&c1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}return this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this._setSmoothing(!o),this.captureContext2D.drawImage(this.workingCanvas,0,0,r,i,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",{src:Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D),raw:l}}catch(e){}return{src:void 0,raw:null}}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}_setSmoothing(e){Fe.setImageSmoothing(this.captureContext2D,e)}}Oe.captureBaseSize=64,Oe.cubeMapFaces=[p.TEXTURE_CUBE_MAP_POSITIVE_X,p.TEXTURE_CUBE_MAP_POSITIVE_Y,p.TEXTURE_CUBE_MAP_POSITIVE_Z,p.TEXTURE_CUBE_MAP_NEGATIVE_X,p.TEXTURE_CUBE_MAP_NEGATIVE_Y,p.TEXTURE_CUBE_MAP_NEGATIVE_Z];class Ie{constructor(e){this.context=e.context}getUboValue(e,t,n,r){const i=Ie.uboTypes[r];if(!i)return;const s=new i.arrayBufferView(n*i.lengthMultiplier),o=this.context,a=o.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,e);if(a){const n=o.getIndexedParameter(p.UNIFORM_BUFFER_START.value,e),r=o.getParameter(p.UNIFORM_BUFFER_BINDING.value);try{o.bindBuffer(p.UNIFORM_BUFFER.value,a),o.getBufferSubData(p.UNIFORM_BUFFER.value,n+t,s)}catch(e){return}r&&o.bindBuffer(p.UNIFORM_BUFFER.value,r)}return Array.prototype.slice.call(s)}}Ie.uboTypes={[p.BOOL.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.BOOL_VEC2.value]:{arrayBufferView:Uint8Array,lengthMultiplier:2},[p.BOOL_VEC3.value]:{arrayBufferView:Uint8Array,lengthMultiplier:3},[p.BOOL_VEC4.value]:{arrayBufferView:Uint8Array,lengthMultiplier:4},[p.INT.value]:{arrayBufferView:Int32Array,lengthMultiplier:1},[p.INT_VEC2.value]:{arrayBufferView:Int32Array,lengthMultiplier:2},[p.INT_VEC3.value]:{arrayBufferView:Int32Array,lengthMultiplier:3},[p.INT_VEC4.value]:{arrayBufferView:Int32Array,lengthMultiplier:4},[p.UNSIGNED_INT.value]:{arrayBufferView:Uint32Array,lengthMultiplier:1},[p.UNSIGNED_INT_VEC2.value]:{arrayBufferView:Uint32Array,lengthMultiplier:2},[p.UNSIGNED_INT_VEC3.value]:{arrayBufferView:Uint32Array,lengthMultiplier:3},[p.UNSIGNED_INT_VEC4.value]:{arrayBufferView:Uint32Array,lengthMultiplier:4},[p.FLOAT.value]:{arrayBufferView:Float32Array,lengthMultiplier:1},[p.FLOAT_VEC2.value]:{arrayBufferView:Float32Array,lengthMultiplier:2},[p.FLOAT_VEC3.value]:{arrayBufferView:Float32Array,lengthMultiplier:3},[p.FLOAT_VEC4.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT2x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT3.value]:{arrayBufferView:Float32Array,lengthMultiplier:9},[p.FLOAT_MAT3x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT3x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.FLOAT_MAT4.value]:{arrayBufferView:Float32Array,lengthMultiplier:16},[p.FLOAT_MAT4x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT4x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.SAMPLER_2D.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.SAMPLER_CUBE.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1}};class ke extends S{get typeName(){return"WebGLBuffer"}}class Me extends S{get typeName(){return"WebGLFramebuffer"}}class Pe extends S{get typeName(){return"WebGLProgram"}static saveInGlobalStore(e){const t=D.getWebGlObjectTag(e);t&&(this.store[t.id]=e)}static getFromGlobalStore(e){return this.store[e]}static updateInGlobalStore(e,t){if(!t)return;const n=this.getFromGlobalStore(e);if(!n)return;const r=D.getWebGlObjectTag(n);r&&(D.attachWebGlObjectTag(t,r),this.store[r.id]=t)}}Pe.store={};class Be extends S{get typeName(){return"WebGLQuery"}}class Ue extends S{get typeName(){return"WebGLRenderbuffer"}}class $e extends S{get typeName(){return"WebGLSampler"}}class Ge extends S{get typeName(){return"WebGLShader"}}class Ve extends S{get typeName(){return"WebGLSync"}}class We extends S{get typeName(){return"WebGLTexture"}}class He extends S{get typeName(){return"WebGLTransformFeedback"}}class je extends S{get typeName(){return"WebGLUniformLocation"}}class ze extends S{get typeName(){return"WebGLVertexArrayObject"}}class Xe extends me{get stateName(){return Xe.stateName}get requireStartAndStopStates(){return!1}constructor(e){super(e),this.drawCallTextureInputState=new Oe(e),this.drawCallUboInputState=new Ie(e)}getConsumeCommands(){return d}getChangeCommandsByState(){return{}}readFromContext(){var e,t;const n=this.context.getParameter(p.CURRENT_PROGRAM.value);if(!n)return;this.currentState.frameBuffer=this.readFrameBufferFromContext();const r=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData:x.getProgramData(this.context,n);if(this.currentState.programStatus=Object.assign({},r.programStatus),this.currentState.programStatus.program=this.getSpectorData(n),this.currentState.programStatus.RECOMPILABLE=o.isBuildableProgram(n),this.currentState.programStatus.RECOMPILABLE&&Pe.saveInGlobalStore(n),this.currentState.shaders=r.shaders,(null===(e=this.lastCommandName)||void 0===e?void 0:e.indexOf("Elements"))>=0){const e=this.context.getParameter(this.context.ELEMENT_ARRAY_BUFFER_BINDING);e&&(this.currentState.elementArray={},this.currentState.elementArray.arrayBuffer=this.getSpectorData(e))}const i=this.context.getProgramParameter(n,p.ACTIVE_ATTRIBUTES.value);this.currentState.attributes=[];for(let e=0;e1){const e=this.context.getProgramParameter(n,p.ACTIVE_UNIFORM_BLOCKS.value);this.currentState.uniformBlocks=[];for(let t=0;t1){const e=this.context;t.colorAttachments=[];const n=e.getParameter(p.MAX_DRAW_BUFFERS.value);for(let e=0;e1&&(r.alphaSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE.value),r.blueSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE.value),r.encoding=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.value)),r.componentType=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value)),r.depthSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE.value),r.greenSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE.value),r.redSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_RED_SIZE.value),r.stencilSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value),n===p.TEXTURE.value&&(r.textureLayer=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value))),r}readAttributeFromContext(e,t){const n=this.context.getActiveAttrib(e,t),r=this.context.getAttribLocation(e,n.name);if(-1===r)return{name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:-1};const i=this.context.getVertexAttrib(r,p.CURRENT_VERTEX_ATTRIB.value),s=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING.value),o={name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:r,offsetPointer:this.context.getVertexAttribOffset(r,p.VERTEX_ATTRIB_ARRAY_POINTER.value),bufferBinding:this.getSpectorData(s),enabled:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_ENABLED.value),arraySize:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_SIZE.value),stride:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_STRIDE.value),arrayType:this.getWebGlConstant(this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_TYPE.value)),normalized:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_NORMALIZED.value),vertexAttrib:Array.prototype.slice.call(i)};return this.extensions[p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.extensionName]?o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.value):this.contextVersion>1&&(o.integer=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_INTEGER.value),o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR.value)),this.appendBufferCustomData(o,s),o}readUniformFromContext(e,t){const n=this.context.getActiveUniform(e,t),r=this.context.getUniformLocation(e,n.name);if(r){if(n.size>1&&n.name&&n.name.indexOf("[0]")===n.name.length-3){const t=[];for(let r=0;r1){r.baseLevel=this.context.getTexParameter(t.value,p.TEXTURE_BASE_LEVEL.value),r.immutable=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_FORMAT.value),r.immutableLevels=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_LEVELS.value),r.maxLevel=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LEVEL.value);const e=this.context.getParameter(p.SAMPLER_BINDING.value);if(e){r.sampler=this.getSpectorData(e);const t=this.context;r.samplerMaxLod=t.getSamplerParameter(e,p.TEXTURE_MAX_LOD.value),r.samplerMinLod=t.getSamplerParameter(e,p.TEXTURE_MIN_LOD.value),r.samplerCompareFunc=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_FUNC.value)),r.samplerCompareMode=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_MODE.value)),r.samplerWrapS=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_S.value)),r.samplerWrapT=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_T.value)),r.samplerWrapR=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_R.value)),r.samplerMagFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MAG_FILTER.value)),r.samplerMinFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MIN_FILTER.value))}else r.maxLod=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LOD.value),r.minLod=this.context.getTexParameter(t.value,p.TEXTURE_MIN_LOD.value),r.compareFunc=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_FUNC.value)),r.compareMode=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_MODE.value)),r.wrapR=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_WRAP_R.value))}const i=this.getTextureStorage(t);if(i){const e=this.quickCapture?null:t;this.drawCallTextureInputState.appendTextureState(r,i,e,this.fullCapture)}return this.context.activeTexture(n),r}getTextureStorage(e){return e===p.TEXTURE_2D?this.context.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP?this.context.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):e===p.TEXTURE_3D?this.context.getParameter(p.TEXTURE_BINDING_3D.value):e===p.TEXTURE_2D_ARRAY?this.context.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):void 0}readUniformsFromContextIntoState(e,t,n,r){const i=this.context,s=i.getActiveUniforms(e,t,p.UNIFORM_TYPE.value),o=i.getActiveUniforms(e,t,p.UNIFORM_SIZE.value),a=i.getActiveUniforms(e,t,p.UNIFORM_BLOCK_INDEX.value),l=i.getActiveUniforms(e,t,p.UNIFORM_OFFSET.value),u=i.getActiveUniforms(e,t,p.UNIFORM_ARRAY_STRIDE.value),c=i.getActiveUniforms(e,t,p.UNIFORM_MATRIX_STRIDE.value),h=i.getActiveUniforms(e,t,p.UNIFORM_IS_ROW_MAJOR.value);for(let d=0;d-1&&(t.blockName=i.getActiveUniformBlockName(e,t.blockIndice)),t.offset=l[d],t.arrayStride=u[d],t.matrixStride=c[d],t.rowMajor=h[d],t.blockIndice>-1){const e=r[a[d]].bindingPoint;t.value=this.drawCallUboInputState.getUboValue(e,t.offset,t.size,s[d])}}}readTransformFeedbackFromContext(e,t){const n=this.context,r=n.getTransformFeedbackVarying(e,t),i=n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value,t),s={name:r.name,size:r.size,type:this.getWebGlConstant(r.type),buffer:this.getSpectorData(i),bufferSize:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_SIZE.value,t),bufferStart:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_START.value,t)};return this.appendBufferCustomData(s,i),s}readUniformBlockFromContext(e,t){const n=this.context,r=n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_BINDING.value),i=n.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,r),s={name:n.getActiveUniformBlockName(e,t),bindingPoint:r,size:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_DATA_SIZE.value),activeUniformCount:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_ACTIVE_UNIFORMS.value),vertex:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER.value),fragment:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER.value),buffer:this.getSpectorData(i)};return this.appendBufferCustomData(s,i),s}appendBufferCustomData(e,t){if(t){const n=t.__SPECTOR_Object_CustomData;n&&(n.usage&&(e.bufferUsage=this.getWebGlConstant(n.usage)),e.bufferLength=n.length,n.offset&&(e.bufferOffset=n.offset),n.sourceLength&&(e.bufferSourceLength=n.sourceLength))}}getWebGlConstant(e){const t=g[e];return t?t.name:e}}Xe.stateName="DrawCall",Xe.samplerTypes={[p.SAMPLER_2D.value]:p.TEXTURE_2D,[p.SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.SAMPLER_3D.value]:p.TEXTURE_3D,[p.SAMPLER_2D_SHADOW.value]:p.TEXTURE_2D,[p.SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_2D_ARRAY_SHADOW.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_CUBE_SHADOW.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.UNSIGNED_INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.UNSIGNED_INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.UNSIGNED_INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.UNSIGNED_INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY};class Ke{constructor(e){this.contextInformation=e,this.stateTrackers=[],this.onCommandCapturedCallbacks={},this.initStateTrackers()}startCapture(e,t,n){for(const r of this.stateTrackers){const i=r.startCapture(!0,t,n);r.requireStartAndStopStates&&(e.initState[r.stateName]=i)}}stopCapture(e){for(const t of this.stateTrackers){const n=t.stopCapture();t.requireStartAndStopStates&&(e.endState[t.stateName]=n)}}captureState(e){const t=this.onCommandCapturedCallbacks[e.name];if(t)for(const n of t)n(e)}initStateTrackers(){this.stateTrackers.push(new Ee(this.contextInformation),new ve(this.contextInformation),new Ce(this.contextInformation),new De(this.contextInformation),new Se(this.contextInformation),new Ae(this.contextInformation),new _e(this.contextInformation),new ye(this.contextInformation),new be(this.contextInformation),new Te(this.contextInformation),new Re(this.contextInformation),new xe(this.contextInformation),new Le(this.contextInformation),new Xe(this.contextInformation));for(const e of this.stateTrackers)e.registerCallbacks(this.onCommandCapturedCallbacks)}}class Ye{static initializeByteSizeFormat(){this.byteSizePerInternalFormat||(this.byteSizePerInternalFormat={[p.R8.value]:1,[p.R16F.value]:2,[p.R32F.value]:4,[p.R8UI.value]:1,[p.RG8.value]:2,[p.RG16F.value]:4,[p.RG32F.value]:8,[p.ALPHA.value]:1,[p.RGB.value]:3,[p.RGBA.value]:4,[p.LUMINANCE.value]:1,[p.LUMINANCE_ALPHA.value]:2,[p.DEPTH_COMPONENT.value]:1,[p.DEPTH_STENCIL.value]:2,[p.SRGB_EXT.value]:3,[p.SRGB_ALPHA_EXT.value]:4,[p.RGB8.value]:3,[p.SRGB8.value]:3,[p.RGB565.value]:2,[p.R11F_G11F_B10F.value]:4,[p.RGB9_E5.value]:2,[p.RGB16F.value]:6,[p.RGB32F.value]:12,[p.RGB8UI.value]:3,[p.RGBA8.value]:4,[p.RGB5_A1.value]:2,[p.RGBA16F.value]:8,[p.RGBA32F.value]:16,[p.RGBA8UI.value]:4,[p.COMPRESSED_R11_EAC.value]:4,[p.COMPRESSED_SIGNED_R11_EAC.value]:4,[p.COMPRESSED_RG11_EAC.value]:4,[p.COMPRESSED_SIGNED_RG11_EAC.value]:4,[p.COMPRESSED_RGB8_ETC2.value]:4,[p.COMPRESSED_RGBA8_ETC2_EAC.value]:4,[p.COMPRESSED_SRGB8_ETC2.value]:4,[p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC.value]:4,[p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_RGB_S3TC_DXT1_EXT.value]:.5,[p.COMPRESSED_RGBA_S3TC_DXT3_EXT.value]:1,[p.COMPRESSED_RGBA_S3TC_DXT5_EXT.value]:1,[p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGB_ETC1_WEBGL.value]:.5,[p.COMPRESSED_RGB_ATC_WEBGL.value]:.5,[p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL.value]:1,[p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL.value]:1})}constructor(e){this.options=e,this.createCommandNames=this.getCreateCommandNames(),this.updateCommandNames=this.getUpdateCommandNames(),this.deleteCommandNames=this.getDeleteCommandNames(),this.startTime=u.now,this.memoryPerSecond={},this.totalMemory=0,this.frameMemory=0,this.capturing=!1,Ye.initializeByteSizeFormat()}registerCallbacks(e){for(const t of this.createCommandNames)e[t]=e[t]||[],e[t].push(this.createWithoutSideEffects.bind(this));for(const t of this.updateCommandNames)e[t]=e[t]||[],e[t].push(this.updateWithoutSideEffects.bind(this));for(const t of this.deleteCommandNames)e[t]=e[t]||[],e[t].push(this.deleteWithoutSideEffects.bind(this))}startCapture(){this.frameMemory=0,this.capturing=!0}stopCapture(){this.frameMemory=0,this.capturing=!1}appendRecordedInformation(e){e.frameMemory[this.objectName]=this.frameMemory,e.memory[this.objectName]=this.memoryPerSecond}create(e){}createWithoutSideEffects(e){this.options.toggleCapture(!1);try{this.create(e)}finally{this.options.toggleCapture(!0)}}updateWithoutSideEffects(e){if(e&&0!==e.arguments.length){this.options.toggleCapture(!1);try{const t=e.arguments[0],n=this.getBoundInstance(t);if(!n)return;if(!D.getWebGlObjectTag(n))return;const r=this.getWebGlConstant(t),i=this.update(e,r,n);this.changeMemorySize(i)}finally{this.options.toggleCapture(!0)}}}deleteWithoutSideEffects(e){if(!e||!e.arguments||e.arguments.length<1)return;const t=e.arguments[0];if(t){this.options.toggleCapture(!1);try{const e=this.delete(t);this.changeMemorySize(-e)}finally{this.options.toggleCapture(!0)}}}changeMemorySize(e){this.totalMemory+=e,this.capturing&&(this.frameMemory+=e);const t=u.now-this.startTime,n=Math.round(t/1e3);this.memoryPerSecond[n]=this.totalMemory}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}getByteSizeForInternalFormat(e){return Ye.byteSizePerInternalFormat[e]||4}readPixelStoreState(){const e=this.options.context,t={UNPACK_FLIP_Y_WEBGL:e.getParameter(p.UNPACK_FLIP_Y_WEBGL.value),UNPACK_PREMULTIPLY_ALPHA_WEBGL:e.getParameter(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL.value),UNPACK_COLORSPACE_CONVERSION_WEBGL:e.getParameter(p.UNPACK_COLORSPACE_CONVERSION_WEBGL.value),UNPACK_ALIGNMENT:e.getParameter(p.UNPACK_ALIGNMENT.value)};return e instanceof WebGL2RenderingContext&&(t.UNPACK_ROW_LENGTH=e.getParameter(p.UNPACK_ROW_LENGTH.value),t.UNPACK_IMAGE_HEIGHT=e.getParameter(p.UNPACK_IMAGE_HEIGHT.value),t.UNPACK_SKIP_PIXELS=e.getParameter(p.UNPACK_SKIP_PIXELS.value),t.UNPACK_SKIP_ROWS=e.getParameter(p.UNPACK_SKIP_ROWS.value),t.UNPACK_SKIP_IMAGES=e.getParameter(p.UNPACK_SKIP_IMAGES.value)),t}}class qe extends Ye{get objectName(){return"Buffer"}getCreateCommandNames(){return["createBuffer"]}getUpdateCommandNames(){return["bufferData"]}getDeleteCommandNames(){return["deleteBuffer"]}getBoundInstance(e){const t=this.options.context;return e===p.ARRAY_BUFFER.value?t.getParameter(p.ARRAY_BUFFER_BINDING.value):e===p.ELEMENT_ARRAY_BUFFER.value?t.getParameter(p.ELEMENT_ARRAY_BUFFER_BINDING.value):e===p.COPY_READ_BUFFER.value?t.getParameter(p.COPY_READ_BUFFER_BINDING.value):e===p.COPY_WRITE_BUFFER.value?t.getParameter(p.COPY_WRITE_BUFFER_BINDING.value):e===p.TRANSFORM_FEEDBACK_BUFFER.value?t.getParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value):e===p.UNIFORM_BUFFER.value?t.getParameter(p.UNIFORM_BUFFER_BINDING.value):e===p.PIXEL_PACK_BUFFER.value?t.getParameter(p.PIXEL_PACK_BUFFER_BINDING.value):e===p.PIXEL_UNPACK_BUFFER.value?t.getParameter(p.PIXEL_UNPACK_BUFFER_BINDING.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(t,e);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){const n=this.getLength(t);return t.arguments.length>=4?{target:e,length:n,usage:t.arguments[2],offset:t.arguments[3],sourceLength:t.arguments[1]?t.arguments[1].length:-1}:3===t.arguments.length?{target:e,length:n,usage:t.arguments[2]}:void 0}getLength(e){const t=e.arguments[1],n=e.arguments[3],r=e.arguments[4];if("number"==typeof t)return t;if("number"==typeof r&&r>0)return r;const i=t.byteLength||t.length||0;return"number"==typeof n&&n>0?i-n:i}}class Qe extends Ye{get objectName(){return"Renderbuffer"}getCreateCommandNames(){return["createRenderbuffer"]}getUpdateCommandNames(){return["renderbufferStorage","renderbufferStorageMultisample"]}getDeleteCommandNames(){return["deleteRenderbuffer"]}getBoundInstance(e){const t=this.options.context;if(e===p.RENDERBUFFER.value)return t.getParameter(p.RENDERBUFFER_BINDING.value)}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(e,t);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return r.length=r.width*r.height*this.getByteSizeForInternalFormat(r.internalFormat),n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){return 4===e.arguments.length?{target:t,internalFormat:e.arguments[1],width:e.arguments[2],height:e.arguments[3],length:0,samples:0}:{target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,samples:e.arguments[1]}}}class Ze extends Ye{get objectName(){return"Texture2d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage2D","compressedTexImage2D","texStorage2D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D.value?t.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP_POSITIVE_X.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Y.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Z.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_X.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Y.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Z.value?t.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target===p.TEXTURE_2D_ARRAY.name||t.target===p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else{const e="TEXTURE_2D"===t?1:6;let n=r.internalFormat;n===p.RGBA.value&&(r.type===p.FLOAT.value&&(n=p.RGBA32F.value),r.type===p.HALF_FLOAT_OES.value&&(n=p.RGBA16F.value)),r.length=r.width*r.height*e*this.getByteSizeForInternalFormat(n)}return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage2D"===e.name?this.getTexImage2DCustomData(e,t,n):"compressedTexImage2D"===e.name?this.getCompressedTexImage2DCustomData(e,t,n):"texStorage2D"===e.name?this.getTexStorage2DCustomData(e,t,n):void 0}getTexStorage2DCustomData(e,t,n){let r;return 5===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!1}),r}getCompressedTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=7&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!0}),r}getTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8?r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],format:e.arguments[6],type:e.arguments[7],length:0,isCompressed:!1}:6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[5].width,height:e.arguments[5].height,format:e.arguments[3],type:e.arguments[4],length:0,isCompressed:!1}),r}}class Je extends Ye{get objectName(){return"Texture3d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage3D","compressedTexImage3D","texStorage3D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D_ARRAY.value?t.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):e===p.TEXTURE_3D.value?t.getParameter(p.TEXTURE_BINDING_3D.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target!==p.TEXTURE_2D_ARRAY.name&&t.target!==p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){if(e.arguments.length>=2&&0!==e.arguments[1])return 0;const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else r.length=r.width*r.height*r.depth*this.getByteSizeForInternalFormat(r.internalFormat);return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage3D"===e.name?this.getTexImage3DCustomData(e,t,n):"compressedTexImage3D"===e.name?this.getCompressedTexImage3DCustomData(e,t,n):"texStorage3D"===e.name?this.getTexStorage3DCustomData(e,t,n):void 0}getTexStorage3DCustomData(e,t,n){let r;return 6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!1}),r}getCompressedTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!0}),r}getTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=9&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],format:e.arguments[7],type:e.arguments[8],length:0,isCompressed:!1}),r}}class et extends Ye{get objectName(){return"Program"}getCreateCommandNames(){return["createProgram"]}getUpdateCommandNames(){return["linkProgram"]}getDeleteCommandNames(){return["deleteProgram"]}getBoundInstance(e){return e}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){if(e.arguments.length>=1&&!e.arguments[0])return 0;const r=this.getCustomData(n);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e){const t=this.options.context;return x.getProgramData(t,e)}}class tt{constructor(e){this.contextInformation=e,this.onCommandCallbacks={},this.recorders=[],this.initRecorders()}recordCommand(e){const t=this.onCommandCallbacks[e.name];if(t)for(const n of t)n(e)}startCapture(){for(const e of this.recorders)e.startCapture()}stopCapture(){for(const e of this.recorders)e.stopCapture()}appendRecordedInformation(e){for(const t of this.recorders)t.appendRecordedInformation(e)}initRecorders(){this.recorders.push(new qe(this.contextInformation),new Qe(this.contextInformation),new Ze(this.contextInformation),new Je(this.contextInformation),new et(this.contextInformation));for(const e of this.recorders)e.registerCallbacks(this.onCommandCallbacks)}}class nt{constructor(e){this.contextInformation=e,this.webGlObjects=[],this.initWebglObjects()}tagWebGlObjects(e){for(const t of this.webGlObjects){for(let n=0;n0&&this.currentCapture.commands.length===this.maxCommands&&this.onMaxCommand.trigger(this)}}}spyContext(e){const t=[];for(const n in e)n&&t.push(n);for(let n=0;n{this.spyRequestAnimationFrame("requestAnimationFrame",e.display)})}spyRequestAnimationFrame(e,t){const n=this;y.storeOriginFunction(t,e),t[e]=function(){const r=arguments[0],i=n.getCallback(n,r,()=>{n.spiedScope[e](r)});return y.executeOriginFunction(t,e,[i])}}spySetTimer(e){const t=this,n=this.spiedScope,r="setTimeout"===e;y.storeOriginFunction(n,e),n[e]=function(){const i=arguments[0],s=arguments[1],o=Array.prototype.slice.call(arguments);return at.setTimerCommonValues.indexOf(s)>-1&&(o[0]=t.getCallback(t,i,r?()=>{n[e](i)}:null)),y.executeOriginFunction(n,e,o)}}getCallback(e,t,n=null){return function(){const r=u.now;if(e.lastFrame=++e.lastFrame%e.speedRatio,e.willPlayNextFrame||e.speedRatio&&!e.lastFrame){try{e.onFrameStart.trigger(e)}catch(t){e.onError.trigger(t)}try{t.apply(e.spiedScope,arguments)}catch(t){e.onError.trigger(t)}e.lastSixtyFramesCurrentIndex=(e.lastSixtyFramesCurrentIndex+1)%at.fpsWindowSize,e.lastSixtyFramesDuration[e.lastSixtyFramesCurrentIndex]=r-e.lastSixtyFramesPreviousStart;try{e.onFrameEnd.trigger(e)}catch(t){e.onError.trigger(t)}e.willPlayNextFrame=!1}else n&&n();e.lastSixtyFramesPreviousStart=r}}}at.requestAnimationFrameFunctions=["requestAnimationFrame","msRequestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame"],at.setTimerFunctions=["setTimeout","setInterval"],at.setTimerCommonValues=[0,15,16,33,32,40],at.fpsWindowSize=60;class lt{constructor(e){this.canvas=e,this.onContextRequested=new l,this.init()}init(){const e=this,t=function(){const t="undefined"!=typeof HTMLCanvasElement&&this instanceof HTMLCanvasElement?HTMLCanvasElement:OffscreenCanvas,n=e.canvas?y.executeOriginFunction(this,"getContext",arguments):y.executePrototypeOriginFunction(this,t,"getContext",arguments);if(arguments.length>0){const e=arguments[0];if("webgl"!==e&&"experimental-webgl"!==e&&"webgl2"!==e&&"experimental-webgl2"!==e)return n}if(n){const t=Array.prototype.slice.call(arguments),r="webgl2"===t[0]||"experimental-webgl2"===t[0]?2:1;e.onContextRequested.trigger({context:n,contextVersion:r})}return n};this.canvas?(y.storeOriginFunction(this.canvas,"getContext"),this.canvas.getContext=t):("undefined"!=typeof HTMLCanvasElement&&(y.storePrototypeOriginFunction(HTMLCanvasElement,"getContext"),HTMLCanvasElement.prototype.getContext=t),"undefined"!=typeof OffscreenCanvas&&(y.storePrototypeOriginFunction(OffscreenCanvas,"getContext"),OffscreenCanvas.prototype.getContext=t))}}class ut{static startIntercepting(e){if(ut.intercepting)return;if("undefined"==typeof Worker)return;ut.workerBundleUrl=e,ut.originalWorkerConstructor=Worker,ut.intercepting=!0;const t=Worker;globalThis.Worker=function(e,n){if(n&&"module"===n.type)return new t(e,n);const r=e.toString();try{let i;try{i=new URL(r,location.href).href}catch(r){return new t(e,n)}const s=new XMLHttpRequest;if(s.open("GET",i,!1),s.send(),200===s.status&&ut.shouldInjectSource(s.responseText)){const e=ut.rewriteImportScripts(s.responseText,i),o="(function(){\n var __spectorBase = "+JSON.stringify(i)+';\n self.__SPECTOR_workerBaseUrl = __spectorBase;\n function __spectorResolve(u) {\n if (u == null) return u;\n if (typeof u !== "string") {\n if (u instanceof URL) return u;\n try { u = String(u); } catch (e) { return u; }\n }\n if (/^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i.test(u)) return u;\n try { return new URL(u, __spectorBase).href; }\n catch (e) { return u; }\n }\n self.__SPECTOR_resolveWorkerUrl = __spectorResolve;\n var __origImportScripts = self.importScripts;\n if (typeof __origImportScripts === "function") {\n self.importScripts = function() {\n var args = new Array(arguments.length);\n for (var i = 0; i < arguments.length; i++) args[i] = __spectorResolve(arguments[i]);\n return __origImportScripts.apply(self, args);\n };\n }\n var __origFetch = self.fetch;\n if (typeof __origFetch === "function") {\n self.fetch = function(input, init) {\n try {\n if (typeof input === "string") {\n input = __spectorResolve(input);\n } else if (input && typeof input === "object" && "url" in input && typeof Request === "function") {\n var r = input;\n var resolved = __spectorResolve(r.url);\n if (resolved !== r.url) input = new Request(resolved, r);\n }\n } catch (e) { /* fall through with original input */ }\n return __origFetch.call(self, input, init);\n };\n }\n if (typeof XMLHttpRequest === "function" && XMLHttpRequest.prototype && XMLHttpRequest.prototype.open) {\n var __origXhrOpen = XMLHttpRequest.prototype.open;\n XMLHttpRequest.prototype.open = function(method, url) {\n var args = Array.prototype.slice.call(arguments);\n args[1] = __spectorResolve(url);\n return __origXhrOpen.apply(this, args);\n };\n }\n if (typeof Worker === "function") {\n var __OrigWorker = Worker;\n self.Worker = function(scriptURL, options) {\n var resolved = __spectorResolve(scriptURL);\n return new __OrigWorker(resolved, options);\n };\n self.Worker.prototype = __OrigWorker.prototype;\n }\n})();\n',a="importScripts("+JSON.stringify(ut.workerBundleUrl)+");\n",l=new Blob([o+a+e],{type:"application/javascript"}),u=URL.createObjectURL(l),c=new t(u,n);return ut.spiedWorkers.push({worker:c,originalUrl:r}),c}}catch(e){console.warn("[Spector.js] Could not inject into Worker ("+r+"):",e)}const i=new t(e,n);return ut.spiedWorkers.push({worker:i,originalUrl:r}),i},globalThis.Worker.prototype=t.prototype}static stopIntercepting(){ut.intercepting&&(globalThis.Worker=ut.originalWorkerConstructor,ut.intercepting=!1)}static rewriteImportScripts(e,t){const n=/(['"`])((?:\\.|(?!\1).)*)\1/g;return e.replace(/importScripts\s*\(([^)]*)\)/g,(e,r)=>"importScripts("+r.replace(n,(e,n,r)=>{if("`"===n&&-1!==r.indexOf("${"))return e;let i;try{i=new URL(r,t).href}catch(t){return e}return n+i+n})+")")}static shouldInjectSource(e){return!/\bimport\s*(?:\/\*[\s\S]*?\*\/\s*)?\(/.test(e)&&!/\bnew\s+(?:(?:self|globalThis)\s*\.\s*)?(?:Worker|SharedWorker)\s*\(/.test(e)}static getSpiedWorkers(){return ut.spiedWorkers}static isIntercepting(){return ut.intercepting}}ut.spiedWorkers=[],ut.intercepting=!1;class ct{static getDelay(){return ct.delayMs}static setDelay(e){ct.delayMs="number"==typeof e&&e>0?e:0}static shouldForceIncomplete(e,t,n,r){return!(r<=0)&&e===p.COMPLETION_STATUS_KHR.value&&void 0!==t&&n-tthis._state,this.subscribe=e=>(this._listeners.add(e),()=>{this._listeners.delete(e)}),this._state=e}setState(e){this._state=e(this._state),this._emitChange()}setSnapshot(e){this._state=e,this._emitChange()}_emitChange(){for(const e of this._listeners)e()}}function pt(e){return(0,dt.useSyncExternalStore)(e.subscribe,e.getSnapshot)}var mt=n(848);const gt=(0,dt.createContext)(null);function Et(){const e=(0,dt.useContext)(gt);if(!e)throw new Error("CaptureMenuContext not provided — CaptureMenuRoot must be rendered inside CaptureMenuContext.Provider");return e}function vt({canvas:e}){const t=Et();return(0,mt.jsx)("li",{onClick:()=>t.handleCanvasSelected(e),children:(0,mt.jsx)("span",{children:`Id: ${e.id} - Size: ${e.width}*${e.height}`})})}function Ct(){const e=Et(),t=pt(e.store),n=t.selectedCanvas?`${t.selectedCanvas.id} (${t.selectedCanvas.width}*${t.selectedCanvas.height})`:"Choose Canvas...";return(0,mt.jsxs)("div",{className:"canvasListComponent",children:[(0,mt.jsx)("span",{commandName:"onCanvasSelection",onClick:e.handleCanvasListToggle,children:n}),(0,mt.jsx)("ul",{style:{display:t.showCanvasList?"block":"none",visibility:t.showCanvasList?"visible":"hidden"},children:t.canvases.map((e,t)=>(0,mt.jsx)(vt,{canvas:e},e.id||t))})]})}function Dt(){const e=Et(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"captureMenuActionsComponent",children:[(0,mt.jsx)("div",{commandName:"onCaptureRequested",onClick:e.handleCaptureRequested}),t.isPlaying?(0,mt.jsx)("div",{commandName:"onPauseRequested",onClick:e.handlePauseRequested}):(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("div",{commandName:"onPlayRequested",onClick:e.handlePlayRequested}),(0,mt.jsx)("div",{commandName:"onPlayNextFrameRequested",onClick:e.handlePlayNextFrameRequested})]})]})}function St(){const e=pt(Et().store);return(0,mt.jsxs)("span",{className:"fpsCounterComponent",children:[e.fps.toFixed(2)," Fps"]})}function At(){const e=pt(Et().store);return(0,mt.jsxs)("div",{children:[(0,mt.jsxs)("div",{className:"captureMenuComponent "+(e.visible?"active":""),children:[(0,mt.jsx)(Ct,{}),(0,mt.jsx)(Dt,{}),(0,mt.jsx)(St,{})]}),(0,mt.jsx)("div",{className:"captureMenuLogComponent "+(e.logVisible?"active":""),children:(0,mt.jsx)("span",{className:e.logLevel===i.error?"error":"",children:e.logText})})]})}class _t{constructor(e={}){this.options=e,this.handleCanvasListToggle=()=>{this.store.getSnapshot(),this.store.setState(e=>Object.assign(Object.assign({},e),{selectedCanvas:null,showCanvasList:!e.showCanvasList,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!e.showCanvasList&&!this._hideLog})),this.onCanvasSelected.trigger(null),this._isTrackingCanvas&&this.trackPageCanvases()},this.handleCanvasSelected=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{selectedCanvas:e,showCanvasList:!1,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)},this.handleCaptureRequested=()=>{const e=this.getSelectedCanvasInformation();e&&this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.PleaseWaitHelpText,logVisible:!this._hideLog})),setTimeout(()=>{this.onCaptureRequested.trigger(e)},200)},this.handlePauseRequested=()=>{this.onPauseRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!1}))},this.handlePlayRequested=()=>{this.onPlayRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!0}))},this.handlePlayNextFrameRequested=()=>{this.onPlayNextFrameRequested.trigger(this.getSelectedCanvasInformation())},this._rootPlaceHolder=e.rootPlaceHolder||document.body,this._hideLog=!!e.hideLog,this._isTrackingCanvas=!1,this._extraCanvasEntries=[],this.onCanvasSelected=new l,this.onCaptureRequested=new l,this.onPauseRequested=new l,this.onPlayRequested=new l,this.onPlayNextFrameRequested=new l,this.store=new ft({visible:!0,logText:_t.SelectCanvasHelpText,logLevel:i.info,logVisible:!this._hideLog,canvases:[],selectedCanvas:null,showCanvasList:!1,isPlaying:!0,fps:0}),this._container=document.createElement("div"),this._container.className="spector-react-capture-menu",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(gt.Provider,{value:this},(0,dt.createElement)(At)))}getSelectedCanvasInformation(){return this.store.getSnapshot().selectedCanvas}trackPageCanvases(){if(this._isTrackingCanvas=!0,document.body){const e=document.body.querySelectorAll("canvas");this.updateCanvasesList(e)}}updateCanvasesList(e){const t=[];for(let n=0;nObject.assign(Object.assign({},n),{canvases:t,selectedCanvas:e,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}captureComplete(e){e?this.store.setState(t=>Object.assign(Object.assign({},t),{logLevel:i.error,logText:e,logVisible:!this._hideLog})):this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog}))}setFPS(e){this.store.setState(t=>Object.assign(Object.assign({},t),{fps:e}))}_updateCanvasesInternal(e){for(const t of this._extraCanvasEntries)e.push(t);this.store.getSnapshot().showCanvasList?this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e})):1===e.length?(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:e[0],logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e[0])):(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:null,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(null))}}_t.SelectCanvasHelpText="Please, select a canvas in the list above.",_t.ActionsHelpText="Record with the red button, you can also pause or continue playing the current scene.",_t.PleaseWaitHelpText="Capturing, be patient (this can take up to 3 minutes)...";const yt=(0,dt.createContext)(null);function bt(){const e=(0,dt.useContext)(yt);if(!e)throw new Error("ResultViewContext not provided — ResultViewRoot must be rendered inside ResultViewContext.Provider");return e}function Tt(){const e=bt(),t=pt(e.store),n=(0,dt.useRef)(null),r=(0,dt.useCallback)(e=>{e.preventDefault();const t=e.currentTarget.parentElement,n=t.parentElement;if(!n)return;const r=n.querySelectorAll("li:not(.resultViewMenuSmall)");if("true"===t.getAttribute("open")){t.setAttribute("open","false");for(let e=0;e{e.handleSearchTextChange(t.target.value)},[e]),s=(0,dt.useCallback)(t=>{t.stopPropagation(),e.handleSearchTextChange("")},[e]),o=(0,dt.useCallback)(t=>n=>{n.preventDefault(),e.handleMenuStatusChange(t)},[e]),a=(0,dt.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),e.handleClose()},[e]);return(0,mt.jsxs)("ul",{className:"resultViewMenuComponent",ref:n,children:[(0,mt.jsx)("li",{className:"resultViewMenuOpen resultViewMenuSmall",children:(0,mt.jsx)("a",{href:"#",role:"button",onClick:r,children:"Menu"})}),(0,mt.jsxs)("li",{className:"searchContainer",children:[(0,mt.jsx)("input",{type:"text",placeholder:"Search...",value:t.searchText,commandName:"onSearchTextChanged",commandEventBinding:"change",onChange:i}),(0,mt.jsx)("a",{className:"clearSearch",commandName:"onSearchTextCleared",onClick:s,children:"X"})]}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:0===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCapturesClicked",onClick:o(0),children:"Captures"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:10===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInformationClicked",onClick:o(10),children:"Information"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:20===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInitStateClicked",onClick:o(20),children:"Init State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:40===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCommandsClicked",onClick:o(40),children:"Commands"+(t.commandCount>0?" ("+t.commandCount+")":"")})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:60===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCompareClicked",onClick:o(60),children:"Compare"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:30===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onEndStateClicked",onClick:o(30),children:"End State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{role:"button",commandName:"onCloseClicked",onClick:a,children:"Close"})})]})}function Rt({children:e}){return(0,mt.jsx)("div",{className:"resultViewContentComponent",children:e})}function xt({capture:e,active:t,onCaptureSelected:n,onSaveRequested:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),r()},[r]),s=(0,dt.useCallback)(()=>{n()},[n]),o=new Date(e.startTime).toTimeString().split(" ")[0];return(0,mt.jsxs)("li",{className:t?"active":"",onClick:s,children:[e.endState.VisualState.Attachments?e.endState.VisualState.Attachments.map((e,t)=>(0,mt.jsx)("img",{src:encodeURI(e.src)},t)):(0,mt.jsx)("span",{children:e.endState.VisualState.FrameBufferStatus}),(0,mt.jsxs)("span",{children:[o,(0,mt.jsx)("a",{href:"#",className:"captureListItemSave",commandName:"onSaveRequested",onClick:i})]})]})}function wt({active:e,captures:t,onCaptureSelected:n,onSaveRequested:r,onCaptureLoaded:i}){const s=(0,dt.useRef)(null),o=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault()},[]),l=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),function(e,t){let n=null;if(e&&e.dataTransfer&&e.dataTransfer.files&&(n=e.dataTransfer.files),e&&e.target&&e.target.files&&(n=e.target.files),n&&n.length>0)for(let e=0;e{a.error("Error while reading file: "+r.name+e)},i.onload=e=>{try{const n=JSON.parse(e.target.result);t(n)}catch(e){a.error("Error while reading file: "+r.name+e)}},i.readAsText(r)}}(e.nativeEvent,i)},[i]);return(0,mt.jsxs)("div",{className:"captureListComponent "+(e?"active":""),children:[(0,mt.jsx)("div",{className:"openCaptureFile",ref:s,onDragEnter:o,onDragOver:o,onDrop:l,children:(0,mt.jsx)("span",{children:"Drag files here to open a previously saved capture."})}),(0,mt.jsx)("ul",{children:t.map((e,t)=>(0,mt.jsx)(xt,{capture:e.capture,active:e.active,onCaptureSelected:()=>n(t),onSaveRequested:()=>r(e.capture)},t))})]})}function Ft({children:e}){return(0,mt.jsx)("div",{className:"visualStateListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Nt({item:e,onVisualStateSelected:t}){const n=(0,dt.useRef)(null);(0,dt.useEffect)(()=>{e.active&&n.current&&setTimeout(()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const r=(0,dt.useCallback)(()=>{t()},[t]),i=e.VisualState;return(0,mt.jsxs)("li",{ref:n,className:e.active?"active":"",onClick:r,commandName:"onVisualStateSelected",children:[i.Attachments?i.Attachments.map((e,t)=>e.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{src:encodeURI(e.src)}),i.Attachments.length>1&&(0,mt.jsx)("span",{children:e.attachmentName}),!!e.textureLayer&&(0,mt.jsx)("span",{children:"Layer: "+e.textureLayer}),!!e.textureCubeMapFace&&(0,mt.jsx)("span",{children:e.textureCubeMapFace})]},t):null):(0,mt.jsx)("span",{children:i.FrameBufferStatus}),(0,mt.jsx)("span",{children:i.FrameBuffer?"Frame buffer: "+i.FrameBuffer.__SPECTOR_Object_TAG.id:"Canvas frame buffer"})]})}function Lt({children:e}){return(0,mt.jsx)("div",{className:"commandListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Ot({command:e,onCommandSelected:t,onVertexSelected:n,onFragmentSelected:r,onShaderSelected:i}){var s;const o=(0,dt.useRef)(null),a=e.capture,l=function(e){switch(e){case 50:return"deprecated";case 10:return"unused";case 20:return"disabled";case 30:return"redundant";case 40:return"valid";default:return"unknown"}}(a.status),u=!!a.VisualState;let c="";u&&(c=" drawCall"),e.active&&(c=" active"),(0,dt.useEffect)(()=>{e.active&&o.current&&setTimeout(()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const h=(0,dt.useCallback)(e=>{t()},[t]),d=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==n||n()},[n]),f=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==r||r()},[r]),p=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==i||i()},[i]);let m=null;if(u&&"clear"!==a.name)try{const e=a.DrawCall.shaders[0],t=a.DrawCall.shaders[1];m=(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("a",{href:"#",onClick:d,children:e.name}),(0,mt.jsx)("a",{href:"#",onClick:f,children:t.name})]})}catch(e){}const g=(null===(s=a.shader)||void 0===s?void 0:s.source)?(0,mt.jsx)("a",{href:"#",commandName:"onShaderSourceSelected",onClick:p,children:"Source"}):null;return(0,mt.jsxs)("li",{ref:o,className:c,onClick:h,commandName:"onCommandSelected",children:[a.marker&&(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.marker+" "}),"LOG"===a.name?(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.text+" "}):(0,mt.jsx)("span",{dangerouslySetInnerHTML:{__html:a.text.replace(a.name,`${a.name}`)}}),g,m]})}function It({children:e}){return(0,mt.jsx)("div",{className:"commandDetailComponent",children:e})}function kt({left:e,children:t}){return(0,mt.jsx)("div",{className:e?"informationColumnLeftComponent":"informationColumnRightComponent",children:t})}function Mt({children:e}){return(0,mt.jsx)("div",{className:"jsonContentComponent",children:e})}function Pt(e,t,n,r){return{row:Math.max(0,parseInt(t,10)-1),column:n?Math.max(0,parseInt(n,10)-1):0,text:r.trim()||e,type:e.toLowerCase()}}var Bt,Ut,$t=Object.create,Gt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor,Wt=Object.getOwnPropertyNames,Ht=Object.getPrototypeOf,jt=Object.prototype.hasOwnProperty,zt=e=>{throw TypeError(e)},Xt=(e,t)=>{for(var n in t)Gt(e,n,{get:t[n],enumerable:!0})},Kt=(e,t,n)=>(((e,t)=>{t.has(e)||zt("Cannot access private method")})(e,t),n),Yt=(Bt=e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=/\r\n|[\n\r\u2028\u2029]/;e.codeFrameColumns=function(e,n,r={}){let i=new Proxy({},{get:()=>e=>e}),s=e.split(t),{start:o,end:a,markerLines:l}=function(e,t,n){let r=Object.assign({column:0,line:-1},e.start),i=Object.assign({},r,e.end),{linesAbove:s=2,linesBelow:o=3}=n||{},a=r.line,l=r.column,u=i.line,c=i.column,h=Math.max(a-(s+1),0),d=Math.min(t.length,u+o);-1===a&&(h=0),-1===u&&(d=t.length);let f=u-a,p={};if(f)for(let e=0;e<=f;e++){let n=e+a;if(l)if(0===e){let e=t[n-1].length;p[n]=[l,e-l+1]}else if(e===f)p[n]=[0,c];else{let r=t[n-e].length;p[n]=[0,r]}else p[n]=!0}else p[a]=l===c?!l||[l,0]:[l,c-l];return{start:h,end:d,markerLines:p}}(n,s,r),u=n.start&&"number"==typeof n.start.column,c=String(a).length,h=e.split(t,a).slice(o,a).map((e,t)=>{let n=o+1+t,s=` ${` ${n}`.slice(-c)} |`,a=l[n],u=!l[n+1];if(a){let t="";if(Array.isArray(a)){let n=e.slice(0,Math.max(a[0]-1,0)).replace(/[^\t]/g," "),o=a[1]||1;t=["\n ",i.gutter(s.replace(/\d/g," "))," ",n,i.marker("^").repeat(o)].join(""),u&&r.message&&(t+=" "+i.message(r.message))}return[i.marker(">"),i.gutter(s),e.length>0?` ${e}`:"",t].join("")}return` ${i.gutter(s)}${e.length>0?` ${e}`:""}`}).join("\n");return r.message&&!u&&(h=`${" ".repeat(c+1)}${r.message}\n${h}`),h}},()=>(Ut||Bt((Ut={exports:{}}).exports),Ut.exports));Xt({},{__debug:()=>Hs,check:()=>Vs,doc:()=>vs,format:()=>Gs,formatWithCursor:()=>$s,getSupportInfo:()=>Ws,util:()=>_s,version:()=>As});var qt=(e,t,n,r)=>{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Qt=class{diff(e,t,n={}){let r;"function"==typeof n?(r=n,n={}):"callback"in n&&(r=n.callback);let i=this.castInput(e,n),s=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),a=this.removeEmpty(this.tokenize(s,n));return this.diffWithOptionsObj(o,a,n,r)}diffWithOptionsObj(e,t,n,r){var i;let s=e=>(e=this.postProcess(e,n),r?void setTimeout(function(){r(e)},0):e),o=t.length,a=e.length,l=1,u=o+a;null!=n.maxEditLength&&(u=Math.min(u,n.maxEditLength));let c=null!==(i=n.timeout)&&void 0!==i?i:1/0,h=Date.now()+c,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=a&&f+1>=o)return s(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,g=()=>{for(let r=Math.max(p,-l);r<=Math.min(m,l);r+=2){let i,l=d[r-1],u=d[r+1];l&&(d[r-1]=void 0);let c=!1;if(u){let e=u.oldPos-r;c=u&&0<=e&&e=a&&f+1>=o)return s(this.buildValues(i.lastComponent,t,e))||!0;d[r]=i,i.oldPos+1>=a&&(m=Math.min(m,r-1)),f+1>=o&&(p=Math.max(p,r+1))}else d[r]=void 0}l++};if(r)!function e(){setTimeout(function(){if(l>u||Date.now()>h)return r(void 0);g()||e()},0)}();else for(;l<=u&&Date.now()<=h;){let e=g();if(e)return e}}addToPath(e,t,n,r,i){let s=e.lastComponent;return s&&!i.oneChangePerToken&&s.added===t&&s.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:s.count+1,added:t,removed:n,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:s}}}extractCommon(e,t,n,r,i){let s=t.length,o=n.length,a=e.oldPos,l=a-r,u=0;for(;l+1e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(a,a+e.count));a+=e.count,e.added||(l+=e.count)}}return i}},Zt=new class extends Qt{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Jt(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}function en(e,t){let n;switch(t){case"\n":n=/\n/gu;break;case"\r":n=/\r/gu;break;case"\r\n":n=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let r=e.match(n);return r?r.length:0}var tn="string",nn="array",rn="cursor",sn="indent",on="align",an="trim",ln="group",un="fill",cn="if-break",hn="indent-if-break",dn="line-suffix",fn="line-suffix-boundary",pn="line",mn="label",gn="break-parent",En=new Set([rn,sn,on,an,ln,un,cn,hn,dn,fn,pn,mn,gn]),vn=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},Cn=function(e){if("string"==typeof e)return tn;if(Array.isArray(e))return nn;if(!e)return;let{type:t}=e;return En.has(t)?t:void 0};var Dn=class extends Error{name="InvalidDocError";constructor(e){super(function(e){let t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(Cn(e))throw new Error("doc is valid.");let n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;let r=(e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e))([...En].map(e=>`'${e}'`));return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},Sn=Dn,An={},_n=function(e,t,n,r){let i=[e];for(;i.length>0;){let e=i.pop();if(e===An){n(i.pop());continue}n&&i.push(e,An);let s=Cn(e);if(!s)throw new Sn(e);if(!1!==(null==t?void 0:t(e)))switch(s){case nn:case un:{let t=s===nn?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case cn:i.push(e.flatContents,e.breakContents);break;case ln:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case on:case sn:case hn:case mn:case dn:i.push(e.contents);break;case tn:case rn:case an:case fn:case pn:case gn:break;default:throw new Sn(e)}}};function yn(e,t){if("string"==typeof e)return t(e);let n=new Map;return function e(r){if(n.has(r))return n.get(r);let i=function(n){switch(Cn(n)){case nn:return t(n.map(e));case un:return t({...n,parts:n.parts.map(e)});case cn:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case ln:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case on:case sn:case hn:case mn:case dn:return t({...n,contents:e(n.contents)});case tn:case rn:case an:case fn:case pn:case gn:return t(n);default:throw new Sn(n)}}(r);return n.set(r,i),i}(e)}function bn(e,t,n){let r=n,i=!1;return _n(e,function(e){if(i)return!1;let n=t(e);void 0!==n&&(i=!0,r=n)}),r}function Tn(e){if(e.type===ln&&e.break||e.type===pn&&e.hard||e.type===gn)return!0}function Rn(e){if(e.length>0){let t=vn(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function xn(e){return e.type!==pn||e.hard?e.type===cn?e.flatContents:e:e.soft?"":" "}function wn(e){for(e=[...e];e.length>=2&&vn(!1,e,-2).type===pn&&vn(!1,e,-1).type===gn;)e.length-=2;if(e.length>0){let t=Fn(vn(!1,e,-1));e[e.length-1]=t}return e}function Fn(e){switch(Cn(e)){case sn:case hn:case ln:case dn:case mn:{let t=Fn(e.contents);return{...e,contents:t}}case cn:return{...e,breakContents:Fn(e.breakContents),flatContents:Fn(e.flatContents)};case un:return{...e,parts:wn(e.parts)};case nn:return wn(e);case tn:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return tfunction(e){switch(Cn(e)){case un:if(e.parts.every(e=>""===e))return"";break;case ln:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===ln&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case on:case sn:case hn:case dn:if(!e.contents)return"";break;case cn:if(!e.flatContents&&!e.breakContents)return"";break;case nn:{let t=[];for(let n of e){if(!n)continue;let[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof vn(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case tn:case rn:case an:case fn:case pn:case mn:case gn:break;default:throw new Sn(e)}return e}(e))}(e))}function Ln(e){if(e.type===pn)return!0}function On(e,t){return e.type===mn?{...e,contents:t(e.contents)}:t(e)}var In=()=>{},kn=In,Mn=In,Pn=In;function Bn(e){return kn(e),{type:sn,contents:e}}function Un(e,t){return kn(t),{type:on,contents:t,n:e}}function $n(e,t={}){return kn(e),Mn(t.expandedStates,!0),{type:ln,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Gn(e){return kn(e),{type:dn,contents:e}}var Vn={type:fn},Wn={type:gn},Hn={type:an},jn={type:pn,hard:!0},zn={type:pn,hard:!0,literal:!0},Xn={type:pn},Kn={type:pn,soft:!0},Yn=[jn,Wn],qn=[zn,Wn],Qn={type:rn};function Zn(e,t){kn(e),Mn(t);let n=[];for(let r=0;r0){for(let e=0;e!(function(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}(e)||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e)),nr=/[^\x20-\x7F]/u,rr=function(e){if(!e)return 0;if(!nr.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(let n of e){let e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=tr(e)?1:2)}return t},ir=Symbol("MODE_BREAK"),sr=Symbol("MODE_FLAT"),or=Symbol("cursor"),ar=Symbol("DOC_FILL_PRINTED_LENGTH");function lr(e,t){return cr(e,{type:"indent"},t)}function ur(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?cr(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:cr(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function cr(e,t,n){let r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t],i="",s=0,o=0,a=0;for(let e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function hr(e){let t=0,n=0,r=e.length;e:for(;r--;){let i=e[r];if(i!==or)for(let n=i.length-1;n>=0;n--){let s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(or);return t}function dr(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length,a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}let{mode:e,doc:u}=a.pop(),c=Cn(u);switch(c){case tn:l.push(u),n-=rr(u);break;case nn:case un:{let t=c===nn?u:u.parts,n=u[ar]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case sn:case on:case hn:case mn:a.push({mode:e,doc:u.contents});break;case an:n+=hr(l);break;case ln:{if(s&&u.break)return!1;let t=u.break?ir:e,n=u.expandedStates&&t===ir?vn(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case cn:{let t=(u.groupId?i[u.groupId]||sr:e)===ir?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case pn:if(e===ir||u.hard)return!0;u.soft||(l.push(" "),n--);break;case dn:r=!0;break;case fn:if(r)return!1}}return!1}function fr(e,t){let n={},r=t.printWidth,i=Jt(t.endOfLine),s=0,o=[{ind:{value:"",length:0,queue:[]},mode:ir,doc:e}],a=[],l=!1,u=[],c=0;for(function(e){let t=new Set,n=[];_n(e,function(e){if(e.type===gn&&Rn(n),e.type===ln){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===ln&&n.pop().break&&Rn(n)},!0)}(e);o.length>0;){let{ind:e,mode:h,doc:d}=o.pop();switch(Cn(d)){case tn:{let e="\n"!==i?qt(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=rr(e));break}case nn:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case rn:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(or),c++;break;case sn:o.push({ind:lr(e,t),mode:h,doc:d.contents});break;case on:o.push({ind:ur(e,d.n,t),mode:h,doc:d.contents});break;case an:s-=hr(a);break;case ln:switch(h){case sr:if(!l){o.push({ind:e,mode:d.break?ir:sr,doc:d.contents});break}case ir:{l=!1;let t={ind:e,mode:sr,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&dr(t,o,i,a,n))o.push(t);else if(d.expandedStates){let t=vn(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:ir,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:ir,doc:t});break}{let t=d.expandedStates[r],s={ind:e,mode:sr,doc:t};if(dr(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:ir,doc:d.contents});break}}d.id&&(n[d.id]=vn(!1,o,-1).mode);break;case un:{let t=r-s,i=d[ar]??0,{parts:a}=d,l=a.length-i;if(0===l)break;let c=a[i+0],f=a[i+1],p={ind:e,mode:sr,doc:c},m={ind:e,mode:ir,doc:c},g=dr(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}let E={ind:e,mode:sr,doc:f},v={ind:e,mode:ir,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}let C=a[i+2],D={ind:e,mode:h,doc:{...d,[ar]:i+2}};dr({ind:e,mode:sr,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case cn:case hn:{let t=d.groupId?n[d.groupId]:h;if(t===ir){let t=d.type===cn?d.breakContents:d.negate?d.contents:Bn(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===sr){let t=d.type===cn?d.flatContents:d.negate?Bn(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case dn:u.push({ind:e,mode:h,doc:d.contents});break;case fn:u.length>0&&o.push({ind:e,mode:h,doc:jn});break;case pn:switch(h){case sr:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case ir:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=hr(a),a.push(i+e.value),s=e.length)}break;case mn:o.push({ind:e,mode:h,doc:d.contents});break;case gn:break;default:throw new Sn(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}let h=a.indexOf(or);if(-1!==h){let e=a.indexOf(or,h+1);if(-1===e)return{formatted:a.filter(e=>e!==or).join("")};let t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}var pr,mr,gr,Er=function(e,t,n=0){let r=0;for(let i=n;i=0;n-=2)if(!Array.isArray(t[n])&&--e<0)return n;return-1},gr=function*(){let{stack:e}=this;for(let t=e.length-3;t>=0;t-=2){let n=e[t];Array.isArray(n)||(yield n)}};var vr=class{constructor(e){((e,t)=>{t.has(e)?zt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,void 0)})(this,pr),this.stack=[e]}get key(){let{stack:e,siblings:t}=this;return vn(!1,e,null===t?-2:-4)??null}get index(){return null===this.siblings?null:vn(!1,this.stack,-2)}get node(){return vn(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return null!==this.siblings}get siblings(){let{stack:e}=this,t=vn(!1,e,-3);return Array.isArray(t)?t:null}get next(){let{siblings:e}=this;return null===e?null:e[this.index+1]}get previous(){let{siblings:e}=this;return null===e?null:e[this.index-1]}get isFirst(){return 0===this.index}get isLast(){let{siblings:e,index:t}=this;return null!==e&&t===e.length-1}get isRoot(){return 1===this.stack.length}get root(){return this.stack[0]}get ancestors(){return[...Kt(this,pr,gr).call(this)]}getName(){let{stack:e}=this,{length:t}=e;return t>1?vn(!1,e,-2):null}getValue(){return vn(!1,this.stack,-1)}getNode(e=0){let t=Kt(this,pr,mr).call(this,e);return-1===t?null:this.stack[t]}getParentNode(e=0){return this.getNode(e+1)}call(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{return e(this)}finally{n.length=r}}callParent(e,t=0){let n=Kt(this,pr,mr).call(this,t+1),r=this.stack.splice(n+1);try{return e(this)}finally{this.stack.push(...r)}}each(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{for(let t=0;t{n[r]=e(t,r,i)},...t),n}match(...e){let t=this.stack.length-1,n=null,r=this.stack[t--];for(let i of e){if(void 0===r)return!1;let e=null;if("number"==typeof n&&(e=n,n=this.stack[t--],r=this.stack[t--]),i&&!i(r,n,e))return!1;n=this.stack[t--],r=this.stack[t--]}return!0}findAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return t}hasAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return!0;return!1}},Cr=new Proxy(()=>{},{get:()=>Cr}),Dr=Cr;function*Sr(e,t){let{getVisitorKeys:n,filter:r=()=>!0}=t,i=e=>function(e){return null!==e&&"object"==typeof e}(e)&&r(e);for(let t of n(e)){let n=e[t];if(Array.isArray(n))for(let e of n)i(e)&&(yield e);else i(n)&&(yield n)}}function Ar(e){return(t,n,r)=>{let i=!(null==r||!r.backwards);if(!1===n)return!1;let{length:s}=t,o=n;for(;o>=0&&oObject.keys(e).filter(e=>!wr.has(e)),Nr=function(e){return e?t=>e(t,wr):Fr};function Lr(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=function(e){let t=e.type||e.kind||"(unknown type)",n=String(e.name||e.id&&("object"==typeof e.id?e.id.name:e.id)||e.key&&("object"==typeof e.key?e.key.name:e.key)||e.value&&("object"==typeof e.value?"":String(e.value))||e.operator||"");return n.length>20&&(n=n.slice(0,19)+"…"),t+(n?" "+n:"")}(e)}function Or(e,t){t.leading=!0,t.trailing=!1,Lr(e,t)}function Ir(e,t,n){t.leading=!1,t.trailing=!1,n&&(t.marker=n),Lr(e,t)}function kr(e,t){t.leading=!1,t.trailing=!0,Lr(e,t)}var Mr=new WeakMap;function Pr(e,t){if(Mr.has(e))return Mr.get(e);let{printer:{getCommentChildNodes:n,canAttachComment:r,getVisitorKeys:i},locStart:s,locEnd:o}=t;if(!r)return[];let a=((null==n?void 0:n(e,t))??[...Sr(e,{getVisitorKeys:Nr(i)})]).flatMap(e=>r(e)?[e]:Pr(e,t));return a.sort((e,t)=>s(e)-s(t)||o(e)-o(t)),Mr.set(e,a),a}function Br(e,t,n,r){let i,s,{locStart:o,locEnd:a}=n,l=o(t),u=a(t),c=Pr(e,n),h=0,d=c.length;for(;h>1,r=c[e],f=o(r),p=a(r);if(f<=l&&u<=p)return Br(r,t,n,r);if(p<=l)i=r,h=e+1;else{if(!(u<=f))throw new Error("Comment location overlaps with node location");s=r,d=e}}if("TemplateLiteral"===(null==r?void 0:r.type)){let{quasis:e}=r,o=Hr(e,t,n);i&&Hr(e,i,n)!==o&&(i=null),s&&Hr(e,s,n)!==o&&(s=null)}return{enclosingNode:r,precedingNode:i,followingNode:s}}var Ur=()=>!1,$r=e=>!/[\S\n\u2028\u2029]/u.test(e);function Gr(e,t,n,r){let{comment:i,precedingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=o(i);if(s)for(let t=r-1;t>=0;t--){let{comment:r,precedingNode:i}=n[t];if(i!==s||!$r(e.slice(a(r),l)))break;l=o(r)}return xr(e,l,{backwards:!0})}function Vr(e,t,n,r){let{comment:i,followingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=a(i);if(s)for(let t=r+1;t0;--s){let{comment:i,precedingNode:u,followingNode:c}=e[s-1];Dr.strictEqual(u,o),Dr.strictEqual(c,a);let h=t.originalText.slice(t.locEnd(i),l);if(!((null==(r=(n=t.printer).isGap)?void 0:r.call(n,h,t))??/^[\s(]*$/u.test(h)))break;l=t.locStart(i)}for(let[t,{comment:n}]of e.entries())t1&&e.comments.sort((e,n)=>t.locStart(e)-t.locStart(n));e.length=0}function Hr(e,t,n){let r=n.locStart(t)-1;for(let t=1;t"string"==typeof e||"function"==typeof e,choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>"string"==typeof e||"object"==typeof e,cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:"Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.",cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:"Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.",cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function qr({plugins:e=[],showDeprecated:t=!1}={}){let n=e.flatMap(e=>e.languages??[]),r=[];for(let i of function(e){let t=[];for(let[n,r]of Object.entries(e)){let e={name:n,...r};Array.isArray(e.default)&&(e.default=vn(!1,e.default,-1).value),t.push(e)}return t}(Object.assign({},...e.map(({options:e})=>e),Yr)))!t&&i.deprecated||(Array.isArray(i.choices)&&(t||(i.choices=i.choices.filter(e=>!e.deprecated)),"parser"===i.name&&(i.choices=[...i.choices,...Qr(i.choices,n,e)])),i.pluginDefaults=Object.fromEntries(e.filter(e=>{var t;return void 0!==(null==(t=e.defaultOptions)?void 0:t[i.name])}).map(e=>[e.name,e.defaultOptions[i.name]])),r.push(i));return{languages:n,options:r}}function*Qr(e,t,n){let r=new Set(e.map(e=>e.value));for(let e of t)if(e.parsers)for(let t of e.parsers)if(!r.has(t)){r.add(t);let i=n.find(e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t)),s=e.name;null!=i&&i.name&&(s+=` (plugin: ${i.name})`),yield{value:t,description:s}}}var Zr,Jr,ei,ti,ni,ri="windows"===(null==(Zr=globalThis.Deno)?void 0:Zr.build.os)||(null==(ei=null==(Jr=globalThis.navigator)?void 0:Jr.platform)?void 0:ei.startsWith("Win"))||(null==(ni=null==(ti=globalThis.process)?void 0:ti.platform)?void 0:ni.startsWith("win"))||!1;function ii(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function si(e,t){if(!t)return;let n=(e=>String(e).split(/[/\\]/u).pop())(t).toLowerCase();return e.find(({filenames:e})=>null==e?void 0:e.some(e=>e.toLowerCase()===n))??e.find(({extensions:e})=>null==e?void 0:e.some(e=>n.endsWith(e)))}function oi(e,t){if(t){if(String(t).startsWith("file:"))try{t=function(e){return ri?function(e){e=ii(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return""!==e.hostname&&(t=`\\\\${e.hostname}${t}`),t}(e):function(e){return e=ii(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}(e)}(t)}catch{return}if("string"==typeof t)return e.find(({isSupported:e})=>null==e?void 0:e({filepath:t}))}}var ai=function(e,t){let n=((e,t)=>{if(!e||null!=t)return t.toReversed||!Array.isArray(t)?t.toReversed():[...t].reverse()})(!1,e.plugins).flatMap(e=>e.languages??[]),r=function(e,t){if(t)return e.find(({name:e})=>e.toLowerCase()===t)??e.find(({aliases:e})=>null==e?void 0:e.includes(t))??e.find(({extensions:e})=>null==e?void 0:e.includes(`.${t}`))}(n,t.language)??si(n,t.physicalFile)??si(n,t.file)??oi(n,t.physicalFile)??oi(n,t.file)??void t.physicalFile;return null==r?void 0:r.parsers[0]},li={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(e=>li.value(e)).join(", ")}]`;let t=Object.keys(e);return 0===t.length?"{}":`{ ${t.map(t=>`${li.key(t)}: ${li.value(e[t])}`).join(", ")} }`},pair:({key:e,value:t})=>li.value({[e]:t})},ui=new Proxy(String,{get:()=>ui}),ci=ui,hi=Symbol.for("vnopts.VALUE_NOT_EXIST"),di=Symbol.for("vnopts.VALUE_UNCHANGED"),fi=" ".repeat(2);function pi(e,t,n,r){return[`Invalid ${ci.red(r.key(e))} value.`,`Expected ${ci.blue(n)},`,`but received ${t===hi?ci.gray("nothing"):ci.red(r.value(t))}.`].join(" ")}function mi({text:e,list:t},n){let r=[];return e&&r.push(`- ${ci.blue(e)}`),t&&r.push([`- ${ci.blue(t.title)}:`].concat(t.values.map(e=>mi(e,n-fi.length).replace(/^|\n/g,`$&${fi}`))).join("\n")),gi(r,n)}function gi(e,t){if(1===e.length)return e[0];let[n,r]=e,[i,s]=e.map(e=>e.split("\n",1)[0].length);return i>t&&i>s?r:n}var Ei=[],vi=[],Ci=(e,t,{descriptor:n,logger:r,schemas:i})=>{let s=[`Ignored unknown option ${ci.yellow(n.pair({key:e,value:t}))}.`],o=Object.keys(i).sort().find(t=>function(e,t){if(e===t)return 0;let n=e;e.length>t.length&&(e=t,t=n);let r=e.length,i=t.length;for(;r>0&&e.charCodeAt(~-r)===t.charCodeAt(~-i);)r--,i--;let s=0;for(;sa?u>a?a+1:u:u>l?l+1:u;return a}(e,t)<3);o&&s.push(`Did you mean ${ci.blue(n.key(o))}?`),r.warn(s.join(" "))},Di=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"],Si=class{static create(e){return function(e,t){let n=new e(t),r=Object.create(n);for(let e of Di)e in t&&(r[e]=Ai(t[e],n,Si.prototype[e].length));return r}(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,t){return!1}deprecated(e,t){return!1}forward(e,t){}redirect(e,t){}overlap(e,t,n){return e}preprocess(e,t){return e}postprocess(e,t){return di}};function Ai(e,t,n){return"function"==typeof e?(...r)=>e(...r.slice(0,n-1),t,...r.slice(n-1)):()=>e}var _i=class extends Si{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},yi=class extends Si{expected(){return"anything"}validate(){return!0}},bi=class extends Si{constructor({valueSchema:e,name:t=e.name,...n}){super({...n,name:t}),this._valueSchema=e}expected(e){let{text:t,list:n}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:t&&`an array of ${t}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(e,t){if(!Array.isArray(e))return!1;let n=[];for(let r of e){let e=t.normalizeValidateResult(this._valueSchema.validate(r,t),r);!0!==e&&n.push(e.value)}return 0===n.length||{value:n}}deprecated(e,t){let n=[];for(let r of e){let e=t.normalizeDeprecatedResult(this._valueSchema.deprecated(r,t),r);!1!==e&&n.push(...e.map(({value:e})=>({value:[e]})))}return n}forward(e,t){let n=[];for(let r of e){let e=t.normalizeForwardResult(this._valueSchema.forward(r,t),r);n.push(...e.map(Ti))}return n}redirect(e,t){let n=[],r=[];for(let i of e){let e=t.normalizeRedirectResult(this._valueSchema.redirect(i,t),i);"remain"in e&&n.push(e.remain),r.push(...e.redirect.map(Ti))}return 0===n.length?{redirect:r}:{redirect:r,remain:n}}overlap(e,t){return e.concat(t)}};function Ti({from:e,to:t}){return{from:[e],to:t}}var Ri=class extends Si{expected(){return"true or false"}validate(e){return"boolean"==typeof e}};function xi(e,t){let n=Object.create(null);for(let r of e){let e=r[t];if(n[e])throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n[e]=r}return n}function wi(e,t){if(e===t)return 0;let n=typeof e,r=typeof t,i=["undefined","object","boolean","number","string"];return n!==r?i.indexOf(n)-i.indexOf(r):"string"!==n?Number(e)-Number(t):e.localeCompare(t)}function Fi(e){return void 0===e?{}:e}function Ni(e){if("string"==typeof e)return{text:e};let{text:t,list:n}=e;return function(e){if(!e)throw new Error("Unexpected `expected` result, there should be at least one field.")}(void 0!==(t||n)),n?{text:t,list:{title:n.title,values:n.values.map(Ni)}}:{text:t}}function Li(e,t){return!0===e||(!1===e?{value:t}:e)}function Oi(e,t,n=!1){return!1!==e&&(!0===e?!!n||[{value:t}]:"value"in e?[e]:0!==e.length&&e)}function Ii(e,t){return"string"==typeof e||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function ki(e,t){return void 0===e?[]:Array.isArray(e)?e.map(e=>Ii(e,t)):[Ii(e,t)]}function Mi(e,t){let n=ki("object"==typeof e&&"redirect"in e?e.redirect:e,t);return 0===n.length?{remain:t,redirect:n}:"object"==typeof e&&"remain"in e?{remain:e.remain,redirect:n}:{redirect:n}}var Pi,Bi=class extends Si{constructor(e){super(e),this._choices=function(e,t){let n=new Map;for(let r of e){let e=r[t];if(n.has(e))throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n.set(e,r)}return n}(e.choices.map(e=>e&&"object"==typeof e?e:{value:e}),"value")}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(e=>this._choices.get(e)).filter(({hidden:e})=>!e).map(e=>e.value).sort(wi).map(e.value),n=t.slice(0,-2),r=t.slice(-2);return{text:n.concat(r.join(" or ")).join(", "),list:{title:"one of the following values",values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return!(!t||!t.deprecated)&&{value:e}}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},Ui=class extends Si{expected(){return"a number"}validate(e,t){return"number"==typeof e}},$i=class extends Ui{expected(){return"an integer"}validate(e,t){return!0===t.normalizeValidateResult(super.validate(e,t),e)&&function(e){return e===Math.floor(e)}(e)}},Gi=class extends Si{expected(){return"a string"}validate(e){return"string"==typeof e}},Vi=li,Wi=Ci,Hi=(e,t,n)=>{let{text:r,list:i}=n.normalizeExpectedResult(n.schemas[e].expected(n)),s=[];return r&&s.push(pi(e,t,r,n.descriptor)),i&&s.push([pi(e,t,i.title,n.descriptor)].concat(i.values.map(e=>mi(e,n.loggerPrintWidth))).join("\n")),gi(s,n.loggerPrintWidth)},ji=(e,t,{descriptor:n})=>{let r=[`${ci.yellow("string"==typeof e?n.key(e):n.pair(e))} is deprecated`];return t&&r.push(`we now treat it as ${ci.blue("string"==typeof t?n.key(t):n.pair(t))}`),r.join("; ")+"."},zi=class{constructor(e,t){let{logger:n=console,loggerPrintWidth:r=80,descriptor:i=Vi,unknown:s=Wi,invalid:o=Hi,deprecated:a=ji,missing:l=()=>!1,required:u=()=>!1,preprocess:c=e=>e,postprocess:h=()=>di}=t||{};this._utils={descriptor:i,logger:n||{warn:()=>{}},loggerPrintWidth:r,schemas:xi(e,"name"),normalizeDefaultResult:Fi,normalizeExpectedResult:Ni,normalizeDeprecatedResult:Oi,normalizeForwardResult:ki,normalizeRedirectResult:Mi,normalizeValidateResult:Li},this._unknownHandler=s,this._invalidHandler=function(e){return(...t)=>{let n=e(...t);return"string"==typeof n?new Error(n):n}}(o),this._deprecatedHandler=a,this._identifyMissing=(e,t)=>!(e in t)||l(e,t),this._identifyRequired=u,this._preprocess=c,this._postprocess=h,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=function(){let e=Object.create(null);return t=>{let n=JSON.stringify(t);return!!e[n]||(e[n]=!0,!1)}}()}normalize(e){let t={},n=[this._preprocess(e,this._utils)],r=()=>{for(;0!==n.length;){let e=n.shift(),r=this._applyNormalization(e,t);n.push(...r)}};r();for(let e of Object.keys(this._utils.schemas)){let r=this._utils.schemas[e];if(!(e in t)){let t=Fi(r.default(this._utils));"value"in t&&n.push({[e]:t.value})}}r();for(let e of Object.keys(this._utils.schemas)){if(!(e in t))continue;let n=this._utils.schemas[e],r=t[e],i=n.postprocess(r,this._utils);i!==di&&(this._applyValidation(i,e,n),t[e]=i)}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let n=[],{knownKeys:r,unknownKeys:i}=this._partitionOptionKeys(e);for(let i of r){let r=this._utils.schemas[i],s=r.preprocess(e[i],this._utils);this._applyValidation(s,i,r);let o=({from:e,to:t})=>{n.push("string"==typeof t?{[t]:e}:{[t.key]:t.value})},a=({value:e,redirectTo:t})=>{let n=Oi(r.deprecated(e,this._utils),s,!0);if(!1!==n)if(!0===n)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,t,this._utils));else for(let{value:e}of n){let n={key:i,value:e};if(!this._hasDeprecationWarned(n)){let r="string"==typeof t?{key:t,value:e}:t;this._utils.logger.warn(this._deprecatedHandler(n,r,this._utils))}}};ki(r.forward(s,this._utils),s).forEach(o);let l=Mi(r.redirect(s,this._utils),s);if(l.redirect.forEach(o),"remain"in l){let e=l.remain;t[i]=i in t?r.overlap(t[i],e,this._utils):e,a({value:e})}for(let{from:e,to:t}of l.redirect)a({value:e,redirectTo:t})}for(let r of i){let i=e[r];this._applyUnknownHandler(r,i,t,(e,t)=>{n.push({[e]:t})})}return n}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,hi,this._utils)}_partitionOptionKeys(e){let[t,n]=function(e,t){let n=[],r=[];for(let i of e)t(i)?n.push(i):r.push(i);return[n,r]}(Object.keys(e).filter(t=>!this._identifyMissing(t,e)),e=>e in this._utils.schemas);return{knownKeys:t,unknownKeys:n}}_applyValidation(e,t,n){let r=Li(n.validate(e,this._utils),e);if(!0!==r)throw this._invalidHandler(t,r.value,this._utils)}_applyUnknownHandler(e,t,n,r){let i=this._unknownHandler(e,t,this._utils);if(i)for(let e of Object.keys(i)){if(this._identifyMissing(e,i))continue;let t=i[e];e in this._utils.schemas?r(e,t):n[e]=t}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==di){if(t.delete)for(let n of t.delete)delete e[n];if(t.override){let{knownKeys:n,unknownKeys:r}=this._partitionOptionKeys(t.override);for(let r of n){let n=t.override[r];this._applyValidation(n,r,this._utils.schemas[r]),e[r]=n}for(let n of r){let r=t.override[n];this._applyUnknownHandler(n,r,e,(t,n)=>{let r=this._utils.schemas[t];this._applyValidation(n,t,r),e[t]=n})}}}}};function Xi(e,{isCLI:t,optionInfos:n,FlagSchema:r}){let i,{name:s}=e,o={name:s},a={};switch(e.type){case"int":i=$i,t&&(o.preprocess=Number);break;case"string":case"path":i=Gi;break;case"choice":i=Bi,o.choices=e.choices.map(t=>null!=t&&t.redirect?{...t,redirect:{to:{key:e.name,value:t.redirect}}}:t);break;case"boolean":i=Ri;break;case"flag":i=r,o.flags=n.flatMap(e=>[e.alias,e.description&&e.name,e.oppositeDescription&&`no-${e.name}`].filter(Boolean));break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?o.validate=(t,n,r)=>e.exception(t)||n.validate(t,r):o.validate=(e,t,n)=>void 0===e||t.validate(e,n),e.redirect&&(a.redirect=t=>t?{to:"string"==typeof e.redirect?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(a.deprecated=!0),t&&!e.array){let e=o.preprocess||(e=>e);o.preprocess=(t,n,r)=>n.preprocess(e(Array.isArray(t)?vn(!1,t,-1):t),r)}return e.array?bi.create({...t?{preprocess:e=>Array.isArray(e)?e:[e]}:{},...a,valueSchema:i.create(o)}):i.create({...o,...a})}var Ki=(e,t,n)=>{if(!e||null!=t){if(t.findLast)return t.findLast(n);for(let e=t.length-1;e>=0;e--){let r=t[e];if(n(r,e,t))return r}}};function Yi(e,t){if(!t)throw new Error("parserName is required.");let n=Ki(!1,e,e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t));if(n)return n;let r=`Couldn't resolve parser "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}function qi({plugins:e,parser:t}){return Qi(Yi(e,t),t)}function Qi(e,t){let n=e.parsers[t];return"function"==typeof n?n():n}var Zi={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null},Ji=async function(e,t={}){var n;let r={...e};if(!r.parser){if(!r.filepath)throw new Kr("No parser and no file path given, couldn't infer a parser.");if(r.parser=ai(r,{physicalFile:r.filepath}),!r.parser)throw new Kr(`No parser could be inferred for file "${r.filepath}".`)}let i=qr({plugins:e.plugins,showDeprecated:!0}).options,s={...Zi,...Object.fromEntries(i.filter(e=>void 0!==e.default).map(e=>[e.name,e.default]))},o=Yi(r.plugins,r.parser),a=await Qi(o,r.parser);r.astFormat=a.astFormat,r.locEnd=a.locEnd,r.locStart=a.locStart;let l=null!=(n=o.printers)&&n[a.astFormat]?o:function(e,t){if(!t)throw new Error("astFormat is required.");let n=Ki(!1,e,e=>e.printers&&Object.prototype.hasOwnProperty.call(e.printers,t));if(n)return n;let r=`Couldn't find plugin for AST format "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}(r.plugins,a.astFormat),u=await function(e,t){let n=e.printers[t];return"function"==typeof n?n():n}(l,a.astFormat);r.printer=u;let c={...s,...l.defaultOptions?Object.fromEntries(Object.entries(l.defaultOptions).filter(([,e])=>void 0!==e)):{}};for(let[e,t]of Object.entries(c))(null===r[e]||void 0===r[e])&&(r[e]=t);return"json"===r.parser&&(r.trailingComma="none"),function(e,t,{logger:n=!1,isCLI:r=!1,passThrough:i=!1,FlagSchema:s,descriptor:o}={}){if(r){if(!s)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=li;let a=i?Array.isArray(i)?(e,t)=>i.includes(e)?{[e]:t}:void 0:(e,t)=>({[e]:t}):(e,t,n)=>{let{_:r,...i}=n.schemas;return Ci(e,t,{...n,schemas:i})},l=function(e,{isCLI:t,FlagSchema:n}){let r=[];t&&r.push(yi.create({name:"_"}));for(let i of e)r.push(Xi(i,{isCLI:t,optionInfos:e,FlagSchema:n})),i.alias&&t&&r.push(_i.create({name:i.alias,sourceName:i.name}));return r}(t,{isCLI:r,FlagSchema:s}),u=new zi(l,{logger:n,unknown:a,descriptor:o}),c=!1!==n;c&&Pi&&(u._hasDeprecationWarned=Pi);let h=u.normalize(e);return c&&(Pi=u._hasDeprecationWarned),h}(r,i,{passThrough:Object.keys(Zi),...t})},es=((e,t,n)=>(n=null!=e?$t(Ht(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of Wt(t))!jt.call(e,n)&&void 0!==n&&Gt(e,n,{get:()=>t[n],enumerable:!(r=Vt(t,n))||r.enumerable});return e})(Gt(n,"default",{value:e,enumerable:!0}),e)))(Yt()),ts=async function(e,t){let n,r=await qi(t),i=r.preprocess?r.preprocess(e,t):e;t.originalText=i;try{n=await r.parse(i,t,t)}catch(t){!function(e,t){let{loc:n}=e;if(n){let r=(0,es.codeFrameColumns)(t,n,{highlightCode:!0});throw e.message+="\n"+r,e.codeFrame=r,e}throw e}(t,e)}return{text:i,ast:n}};async function ns(e,t){({ast:e}=await is(e,t));let n=new Map,r=new vr(e),i=()=>{},s=new Map;await async function(e,t,n,r,i){let{embeddedLanguageFormatting:s,printer:{embed:o,hasPrettierIgnore:a=()=>!1,getVisitorKeys:l}}=n;if(!o||"auto"!==s)return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let u=Nr(o.getVisitorKeys??l),c=[];!function t(){let{node:r}=e;if(null===r||"object"!=typeof r||a(e))return;for(let n of u(r))Array.isArray(r[n])?e.each(t,n):e.call(t,n);let s=o(e,n);if(s){if("function"==typeof s)return void c.push({print:s,node:r,pathStack:[...e.stack]});i.set(r,s)}}();let h=e.stack;for(let{print:r,node:s,pathStack:o}of c)try{e.stack=o;let a=await r(d,t,e,n);a&&i.set(s,a)}catch(e){if(globalThis.PRETTIER_DEBUG)throw e}function d(e,t){return async function(e,t,n,r){let i=await Ji({...n,...t,parentParser:n.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:s}=await ts(e,i);return Nn(await r(s,i))}(e,t,n,r)}e.stack=h}(r,a,t,ns,s);let o=await rs(r,t,a,void 0,s);if(function(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:n}=e;for(let e of t){if(!e.printed&&!n.has(e))throw new Error('Comment "'+e.value.trim()+'" was not printed. Please report this error!');delete e.printed}}(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return[Qn,o];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[o,Qn]}return o;function a(e,t){return void 0===e||e===r?l(t):Array.isArray(e)?r.call(()=>l(t),...e):r.call(()=>l(t),e)}function l(e){i(r);let o=r.node;if(null==o)return"";let l=o&&"object"==typeof o&&void 0===e;if(l&&n.has(o))return n.get(o);let u=rs(r,t,a,e,s);return l&&n.set(o,u),u}}function rs(e,t,n,r,i){var s;let o,{node:a}=e,{printer:l}=t;switch(o=null!=(s=l.hasPrettierIgnore)&&s.call(l,e)?function(e,t){let{originalText:n,[Symbol.for("comments")]:r,locStart:i,locEnd:s,[Symbol.for("printedComments")]:o}=t,{node:a}=e,l=i(a),u=s(a);for(let e of r)i(e)>=l&&s(e)<=u&&o.add(e);return n.slice(l,u)}(e,t):i.has(a)?i.get(a):l.print(e,t,n,r),a){case t.cursorNode:o=On(o,e=>[Qn,e,Qn]);break;case t.nodeBeforeCursor:o=On(o,e=>[e,Qn]);break;case t.nodeAfterCursor:o=On(o,e=>[Qn,e])}return l.printComment&&(!l.willPrintOwnComments||!l.willPrintOwnComments(e,t))&&(o=function(e,t,n){let{leading:r,trailing:i}=function(e,t){let n=e.node;if(!n)return{};let r=t[Symbol.for("printedComments")];if(0===(n.comments||[]).filter(e=>!r.has(e)).length)return{leading:"",trailing:""};let i,s=[],o=[];return e.each(()=>{let n=e.node;if(null!=r&&r.has(n))return;let{leading:a,trailing:l}=n;a?s.push(function(e,t){var n;let r=e.node,i=[zr(e,t)],{printer:s,originalText:o,locStart:a,locEnd:l}=t;if(null==(n=s.isBlockComment)?void 0:n.call(s,r)){let e=xr(o,l(r))?xr(o,a(r),{backwards:!0})?Yn:Xn:" ";i.push(e)}else i.push(Yn);let u=Rr(o,yr(o,l(r)));return!1!==u&&xr(o,u)&&i.push(Yn),i}(e,t)):l&&(i=function(e,t,n){var r;let i=e.node,s=zr(e,t),{printer:o,originalText:a,locStart:l}=t,u=null==(r=o.isBlockComment)?void 0:r.call(o,i);if(null!=n&&n.hasLineSuffix&&(null==n||!n.isBlock)||xr(a,l(i),{backwards:!0})){let e=jr(a,l(i));return{doc:Gn([Yn,e?Yn:"",s]),isBlock:u,hasLineSuffix:!0}}return!u||null!=n&&n.hasLineSuffix?{doc:[Gn([" ",s]),Wn],isBlock:u,hasLineSuffix:!0}:{doc:[" ",s],isBlock:u,hasLineSuffix:!1}}(e,t,i),o.push(i.doc))},"comments"),{leading:s,trailing:o}}(e,n);return r||i?On(t,e=>[r,e,i]):t}(e,o,t)),o}async function is(e,t){let n=e.comments??[];t[Symbol.for("comments")]=n,t[Symbol.for("printedComments")]=new Set,function(e,t){let{comments:n}=e;if(delete e.comments,!function(e){return Array.isArray(e)&&e.length>0}(n)||!t.printer.canAttachComment)return;let r=[],{printer:{experimentalFeatures:{avoidAstMutation:i=!1}={},handleComments:s={}},originalText:o}=t,{ownLine:a=Ur,endOfLine:l=Ur,remaining:u=Ur}=s,c=n.map((r,i)=>({...Br(e,r,t),comment:r,text:o,options:t,ast:e,isLastComment:n.length-1===i}));for(let[e,t]of c.entries()){let n,{comment:s,precedingNode:o,enclosingNode:h,followingNode:d,text:f,options:p,ast:m,isLastComment:g}=t;if(i?n=[t]:(s.enclosingNode=h,s.precedingNode=o,s.followingNode=d,n=[s,f,p,m,g]),Gr(f,p,c,e))s.placement="ownLine",a(...n)||(d?Or(d,s):o?kr(o,s):Ir(h||m,s));else if(Vr(f,p,c,e))s.placement="endOfLine",l(...n)||(o?kr(o,s):d?Or(d,s):Ir(h||m,s));else if(s.placement="remaining",!u(...n))if(o&&d){let e=r.length;e>0&&r[e-1].followingNode!==d&&Wr(r,p),r.push(t)}else o?kr(o,s):d?Or(d,s):Ir(h||m,s)}if(Wr(r,t),!i)for(let e of n)delete e.precedingNode,delete e.enclosingNode,delete e.followingNode}(e,t);let{printer:{preprocess:r}}=t;return{ast:e=r?await r(e,t):e,comments:n}}var ss=function(e,t){let{cursorOffset:n,locStart:r,locEnd:i}=t,s=Nr(t.printer.getVisitorKeys),o=e=>r(e)<=n&&i(e)>=n,a=e,l=[e];for(let t of function*(e,t){let n=[e];for(let e=0;e0&&(void 0===u||void 0===c);){a=l.pop();let e=void 0!==u,t=void 0!==c;for(let o of Sr(a,{getVisitorKeys:s})){if(!e){let e=i(o);e<=n&&e>h&&(u=o,h=e)}if(!t){let e=r(o);e>=n&&e{if(!e||null!=t){if(t.findLastIndex)return t.findLastIndex(n);for(let e=t.length-1;e>=0;e--)if(n(t[e],e,t))return e;return-1}})(!1,e,e=>"Program"!==e.type&&"File"!==e.type);return-1===t?e:e.slice(0,t+1)}function as(e,t,n,r,i=[],s){let{locStart:o,locEnd:a}=n,l=o(e),u=a(e);if(!(t>u||t=0&&(t={...t,...ss(r,t)});let s=await ns(r,t);n>0&&(s=Jn([Yn,s],n,t.tabWidth));let o=fr(s,t);if(n>0){let e=o.formatted.trim();void 0!==o.cursorNodeStart&&(o.cursorNodeStart-=o.formatted.indexOf(e),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>e.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=e+Jt(t.endOfLine)}let a=t[Symbol.for("comments")];if(t.cursorOffset>=0){let e,n,r,s;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&o.cursorNodeText)if(r=o.cursorNodeStart,s=o.cursorNodeText,t.cursorNode)e=t.locStart(t.cursorNode),n=i.slice(e,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");e=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let r=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):i.length;n=i.slice(e,r)}else e=0,n=i,r=0,s=o.formatted;let l=t.cursorOffset-e;if(n===s)return{formatted:o.formatted,cursorOffset:r+l,comments:a};let u=n.split("");u.splice(l,0,hs);let c=function(e,t){return Zt.diff(e,t,void 0)}(u,s.split("")),h=r;for(let e of c)if(e.removed){if(e.value.includes(hs))break}else h+=e.count;return{formatted:o.formatted,cursorOffset:h,comments:a}}return{formatted:o.formatted,cursorOffset:-1,comments:a}}function fs(e,t,n){return"number"!=typeof t||Number.isNaN(t)||t<0||t>e.length?n:t}function ps(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i}=t;return n=fs(e,n,-1),r=fs(e,r,0),i=fs(e,i,e.length),{...t,cursorOffset:n,rangeStart:r,rangeEnd:i}}function ms(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s}=ps(e,t),o="\ufeff"===e.charAt(0);if(o&&(e=e.slice(1),n--,r--,i--),"auto"===s&&(s=function(e){let t=e.indexOf("\r");return-1!==t?"\n"===e.charAt(t+1)?"crlf":"cr":"lf"}(e)),e.includes("\r")){let t=t=>en(e.slice(0,Math.max(t,0)),"\r\n");n-=t(n),r-=t(r),i-=t(i),e=function(e){return qt(!1,e,/\r\n?/gu,"\n")}(e)}return{hasBOM:o,text:e,options:ps(e,{...t,cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s})}}async function gs(e,t){let n=await qi(t);return!n.hasPragma||n.hasPragma(e)}async function Es(e,t){let n,{hasBOM:r,text:i,options:s}=ms(e,await Ji(t));return s.rangeStart>=s.rangeEnd&&""!==i||s.requirePragma&&!await gs(i,s)||s.checkIgnorePragma&&await async function(e,t){var n;let r=await qi(t);return null==(n=r.hasIgnorePragma)?void 0:n.call(r,e)}(i,s)?{formatted:e,cursorOffset:t.cursorOffset,comments:[]}:(s.rangeStart>0||s.rangeEndr);let a=e.slice(r,i).search(/\S/u),l=-1===a;if(!l)for(r+=a;i>r&&!/\S/u.test(e[i-1]);--i);let u,c,h=as(n,r,t,(e,n)=>cs(t,e,n),[],"rangeStart"),d=l?h:as(n,i,t,e=>cs(t,e),[],"rangeEnd");if(!h||!d)return{rangeStart:0,rangeEnd:0};if((({parser:e})=>"json"===e||"json5"===e||"jsonc"===e||"json-stringify"===e)(t)){let e=function(e,t){let n=[e.node,...e.parentNodes],r=new Set([t.node,...t.parentNodes]);return n.find(e=>ls.has(e.type)&&r.has(e))}(h,d);u=e,c=e}else({startNode:u,endNode:c}=function(e,t,{locStart:n,locEnd:r}){let i=e.node,s=t.node;if(i===s)return{startNode:i,endNode:s};let o=n(e.node);for(let e of os(t.parentNodes)){if(!(n(e)>=o))break;s=e}let a=r(t.node);for(let t of os(e.parentNodes)){if(!(r(t)<=a))break;if(i=t,i===s)break}return{startNode:i,endNode:s}}(h,d,t));return{rangeStart:Math.min(s(u),s(c)),rangeEnd:Math.max(o(u),o(c))}}(r,t,n),o=r.slice(i,s),a=Math.min(i,r.lastIndexOf("\n",i)+1),l=r.slice(a,i).match(/^\s*/u)[0],u=Er(l,t.tabWidth),c=await ds(o,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>i&&t.cursorOffset<=s?t.cursorOffset-i:-1,endOfLine:"lf"},u),h=c.formatted.trimEnd(),{cursorOffset:d}=t;d>s?d+=h.length-o.length:c.cursorOffset>=0&&(d=c.cursorOffset+i);let f=r.slice(0,i)+h+r.slice(s);if("lf"!==t.endOfLine){let e=Jt(t.endOfLine);d>=0&&"\r\n"===e&&(d+=en(f.slice(0,d),"\n")),f=qt(!1,f,"\n",e)}return{formatted:f,cursorOffset:d,comments:c.comments}}(i,s):(!s.requirePragma&&s.insertPragma&&s.printer.insertPragma&&!await gs(i,s)&&(i=s.printer.insertPragma(i)),n=await ds(i,s)),r&&(n.formatted="\ufeff"+n.formatted,n.cursorOffset>=0&&n.cursorOffset++),n)}var vs={};Xt(vs,{builders:()=>Cs,printer:()=>Ds,utils:()=>Ss});var Cs={join:Zn,line:Xn,softline:Kn,hardline:Yn,literalline:qn,group:$n,conditionalGroup:function(e,t){return $n(e[0],{...t,expandedStates:e})},fill:function(e){return Pn(e),{type:un,parts:e}},lineSuffix:Gn,lineSuffixBoundary:Vn,cursor:Qn,breakParent:Wn,ifBreak:function(e,t="",n={}){return kn(e),""!==t&&kn(t),{type:cn,breakContents:e,flatContents:t,groupId:n.groupId}},trim:Hn,indent:Bn,indentIfBreak:function(e,t){return kn(e),{type:hn,contents:e,groupId:t.groupId,negate:t.negate}},align:Un,addAlignmentToDoc:Jn,markAsRoot:function(e){return Un({type:"root"},e)},dedentToRoot:function(e){return Un(Number.NEGATIVE_INFINITY,e)},dedent:function(e){return Un(-1,e)},hardlineWithoutBreakParent:jn,literallineWithoutBreakParent:zn,label:function(e,t){return kn(t),e?{type:mn,label:e,contents:t}:t},concat:e=>e},Ds={printDocToString:fr},Ss={willBreak:function(e){return bn(e,Tn,!1)},traverseDoc:_n,findInDoc:bn,mapDoc:yn,removeLines:function(e){return yn(e,xn)},stripTrailingHardline:Nn,replaceEndOfLine:function(e,t=qn){return yn(e,e=>"string"==typeof e?Zn(t,e.split("\n")):e)},canBreak:function(e){return bn(e,Ln,!1)}},As="3.6.2",_s={};Xt(_s,{addDanglingComment:()=>Ir,addLeadingComment:()=>Or,addTrailingComment:()=>kr,getAlignmentSize:()=>Er,getIndentSize:()=>xs,getMaxContinuousCount:()=>ws,getNextNonSpaceNonCommentCharacter:()=>Fs,getNextNonSpaceNonCommentCharacterIndex:()=>Ms,getPreferredQuote:()=>Ls,getStringWidth:()=>rr,hasNewline:()=>xr,hasNewlineInRange:()=>Os,hasSpaces:()=>Is,isNextLineEmpty:()=>Bs,isNextLineEmptyAfterIndex:()=>Rs,isPreviousLineEmpty:()=>Ps,makeString:()=>ks,skip:()=>Ar,skipEverythingButNewLine:()=>Tr,skipInlineComment:()=>ys,skipNewline:()=>Rr,skipSpaces:()=>yr,skipToLineEnd:()=>br,skipTrailingComment:()=>bs,skipWhitespace:()=>_r});var ys=function(e,t){if(!1===t)return!1;if("/"===e.charAt(t)&&"*"===e.charAt(t+1))for(let n=t+2;nMath.max(e,n.length/t.length),0)},Fs=function(e,t){let n=Ts(e,t);return!1===n?"":e.charAt(n)},Ns="'",Ls=function(e,t){let n=!0===t||t===Ns?Ns:'"',r=n===Ns?'"':Ns,i=0,s=0;for(let t of e)t===n?i++:t===r&&s++;return i>s?r:n},Os=function(e,t,n){for(let r=t;ri===r?i:s===t?"\\"+s:s||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(i)?i:"\\"+i));return t+i+t};function Ms(e,t){return 2===arguments.length||"number"==typeof t?Ts(e,t):function(e,t,n){return Ts(e,n(t))}(...arguments)}function Ps(e,t){return 2===arguments.length||"number"==typeof t?jr(e,t):function(e,t,n){return jr(e,n(t))}(...arguments)}function Bs(e,t){return 2===arguments.length||"number"==typeof t?Rs(e,t):function(e,t,n){return Rs(e,n(t))}(...arguments)}function Us(e,t=1){return async(...n)=>{let r=n[t]??{},i=r.plugins??[];return n[t]={...r,plugins:Array.isArray(i)?i:Object.values(i)},e(...n)}}var $s=Us(Es);async function Gs(e,t){let{formatted:n}=await $s(e,{...t,cursorOffset:-1});return n}async function Vs(e,t){return await Gs(e,t)===e}var Ws=Us(qr,0),Hs={parse:Us(async function(e,t,n){let{text:r,options:i}=ms(e,await Ji(t)),s=await ts(r,i);return n&&(n.preprocessForPrint&&(s.ast=await is(s.ast,i)),n.massage&&(s.ast=function(e,t){let{printer:{massageAstNode:n,getVisitorKeys:r}}=t;if(!n)return e;let i=Nr(r),s=n.ignoredProperties??new Set;return function e(t,r){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>e(t,r)).filter(Boolean);let o={},a=new Set(i(t));for(let n in t)!Object.prototype.hasOwnProperty.call(t,n)||s.has(n)||(a.has(n)?o[n]=e(t[n],t):o[n]=t[n]);let l=n(t,o,r);return null!==l?l??o:void 0}(e)}(s.ast,i))),s}),formatAST:Us(async function(e,t){return t=await Ji(t),fr(await ns(e,t),t)}),formatDoc:Us(async function(e,t){let n=function(e){let t=Object.create(null),n=new Set;return function e(t,n,i){var s,o;if("string"==typeof t)return JSON.stringify(t);if(Array.isArray(t)){let n=t.map(e).filter(Boolean);return 1===n.length?n[0]:`[${n.join(", ")}]`}if(t.type===pn){let e=(null==(s=null==i?void 0:i[n+1])?void 0:s.type)===gn;return t.literal?e?"literalline":"literallineWithoutBreakParent":t.hard?e?"hardline":"hardlineWithoutBreakParent":t.soft?"softline":"line"}if(t.type===gn)return(null==(o=null==i?void 0:i[n-1])?void 0:o.type)===pn&&i[n-1].hard?void 0:"breakParent";if(t.type===an)return"trim";if(t.type===sn)return"indent("+e(t.contents)+")";if(t.type===on)return t.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+e(t.contents)+")":t.n<0?"dedent("+e(t.contents)+")":"root"===t.n.type?"markAsRoot("+e(t.contents)+")":"align("+JSON.stringify(t.n)+", "+e(t.contents)+")";if(t.type===cn)return"ifBreak("+e(t.breakContents)+(t.flatContents?", "+e(t.flatContents):"")+(t.groupId?(t.flatContents?"":', ""')+`, { groupId: ${r(t.groupId)} }`:"")+")";if(t.type===hn){let n=[];t.negate&&n.push("negate: true"),t.groupId&&n.push(`groupId: ${r(t.groupId)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return`indentIfBreak(${e(t.contents)}${i})`}if(t.type===ln){let n=[];t.break&&"propagated"!==t.break&&n.push("shouldBreak: true"),t.id&&n.push(`id: ${r(t.id)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return t.expandedStates?`conditionalGroup([${t.expandedStates.map(t=>e(t)).join(",")}]${i})`:`group(${e(t.contents)}${i})`}if(t.type===un)return`fill([${t.parts.map(t=>e(t)).join(", ")}])`;if(t.type===dn)return"lineSuffix("+e(t.contents)+")";if(t.type===fn)return"lineSuffixBoundary";if(t.type===mn)return`label(${JSON.stringify(t.label)}, ${e(t.contents)})`;if(t.type===rn)return"cursor";throw new Error("Unknown doc type "+t.type)}(er(e));function r(e){if("symbol"!=typeof e)return JSON.stringify(String(e));if(e in t)return t[e];let r=e.description||"symbol";for(let i=0;;i++){let s=r+(i>0?` #${i}`:"");if(!n.has(s))return n.add(s),t[e]=`Symbol.for(${JSON.stringify(s)})`}}}(e),{formatted:r}=await Es(n,{...t,parser:"__js_expression"});return r}),printToDoc:Us(async function(e,t){t=await Ji(t);let{ast:n}=await ts(e,t);return t.cursorOffset>=0&&(t={...t,...ss(n,t)}),ns(n,t)}),printDocToString:Us(async function(e,t){return fr(e,await Ji(t))})},js=Object.defineProperty;((e,t)=>{for(var n in t)js(e,n,{get:t[n],enumerable:!0})})({},{builders:()=>Jo,printer:()=>ea,utils:()=>ta});var zs="string",Xs="array",Ks="cursor",Ys="indent",qs="align",Qs="trim",Zs="group",Js="fill",eo="if-break",to="indent-if-break",no="line-suffix",ro="line-suffix-boundary",io="line",so="label",oo="break-parent",ao=new Set([Ks,Ys,qs,Qs,Zs,Js,eo,to,no,ro,io,so,oo]),lo=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},uo=function(e){if("string"==typeof e)return zs;if(Array.isArray(e))return Xs;if(!e)return;const{type:t}=e;return ao.has(t)?t:void 0};var co=class extends Error{name="InvalidDocError";constructor(e){super(function(e){const t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(uo(e))throw new Error("doc is valid.");const n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;const r=(i=[...ao].map(e=>`'${e}'`),new Intl.ListFormat("en-US",{type:"disjunction"}).format(i));var i;return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},ho={},fo=function(e,t,n,r){const i=[e];for(;i.length>0;){const e=i.pop();if(e===ho){n(i.pop());continue}n&&i.push(e,ho);const s=uo(e);if(!s)throw new co(e);if(!1!==(null==t?void 0:t(e)))switch(s){case Xs:case Js:{const t=s===Xs?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case eo:i.push(e.flatContents,e.breakContents);break;case Zs:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case qs:case Ys:case to:case so:case no:i.push(e.contents);break;case zs:case Ks:case Qs:case ro:case io:case oo:break;default:throw new co(e)}}};function po(e,t){if("string"==typeof e)return t(e);const n=new Map;return function e(r){if(n.has(r))return n.get(r);const i=function(n){switch(uo(n)){case Xs:return t(n.map(e));case Js:return t({...n,parts:n.parts.map(e)});case eo:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case Zs:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case qs:case Ys:case to:case so:case no:return t({...n,contents:e(n.contents)});case zs:case Ks:case Qs:case ro:case io:case oo:return t(n);default:throw new co(n)}}(r);return n.set(r,i),i}(e)}function mo(e,t,n){let r=n,i=!1;return fo(e,function(e){if(i)return!1;const n=t(e);void 0!==n&&(i=!0,r=n)}),r}function go(e){return!(e.type!==Zs||!e.break)||!(e.type!==io||!e.hard)||e.type===oo||void 0}function Eo(e){if(e.length>0){const t=lo(!1,e,-1);t.expandedStates||t.break||(t.break="propagated")}return null}function vo(e){return e.type!==io||e.hard?e.type===eo?e.flatContents:e:e.soft?"":" "}function Co(e){for(e=[...e];e.length>=2&&lo(!1,e,-2).type===io&&lo(!1,e,-1).type===oo;)e.length-=2;if(e.length>0){const t=Do(lo(!1,e,-1));e[e.length-1]=t}return e}function Do(e){switch(uo(e)){case Ys:case to:case Zs:case no:case so:{const t=Do(e.contents);return{...e,contents:t}}case eo:return{...e,breakContents:Do(e.breakContents),flatContents:Do(e.flatContents)};case Js:return{...e,parts:Co(e.parts)};case Xs:return Co(e);case zs:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return t{},_o=Ao,yo=Ao,bo=Ao;function To(e){return _o(e),{type:Ys,contents:e}}function Ro(e,t){return _o(t),{type:qs,contents:t,n:e}}function xo(e,t={}){return _o(e),yo(t.expandedStates,!0),{type:Zs,id:t.id,contents:e,break:Boolean(t.shouldBreak),expandedStates:t.expandedStates}}var wo={type:ro},Fo={type:oo},No={type:Qs},Lo={type:io,hard:!0},Oo={type:io,hard:!0,literal:!0},Io={type:io},ko={type:io,soft:!0},Mo=[Lo,Fo],Po=[Oo,Fo],Bo={type:Ks};function Uo(e,t){_o(e),yo(t);const n=[];for(let r=0;r{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Go=e=>{return!(12288===(t=e)||t>=65281&&t<=65376||t>=65504&&t<=65510||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e));var t},Vo=/[^\x20-\x7F]/u,Wo=function(e){if(!e)return 0;if(!Vo.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(const n of e){const e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=Go(e)?1:2)}return t},Ho=Symbol("MODE_BREAK"),jo=Symbol("MODE_FLAT"),zo=Symbol("cursor"),Xo=Symbol("DOC_FILL_PRINTED_LENGTH");function Ko(e,t){return qo(e,{type:"indent"},t)}function Yo(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?qo(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:qo(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function qo(e,t,n){const r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t];let i="",s=0,o=0,a=0;for(const e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function Qo(e){let t=0,n=0,r=e.length;e:for(;r--;){const i=e[r];if(i!==zo)for(let n=i.length-1;n>=0;n--){const s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(zo);return t}function Zo(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length;const a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}const{mode:e,doc:u}=a.pop(),c=uo(u);switch(c){case zs:l.push(u),n-=Wo(u);break;case Xs:case Js:{const t=c===Xs?u:u.parts,n=u[Xo]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case Ys:case qs:case to:case so:a.push({mode:e,doc:u.contents});break;case Qs:n+=Qo(l);break;case Zs:{if(s&&u.break)return!1;const t=u.break?Ho:e,n=u.expandedStates&&t===Ho?lo(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case eo:{const t=(u.groupId?i[u.groupId]||jo:e)===Ho?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case io:if(e===Ho||u.hard)return!0;u.soft||(l.push(" "),n--);break;case no:r=!0;break;case ro:if(r)return!1}}return!1}var Jo={join:Uo,line:Io,softline:ko,hardline:Mo,literalline:Po,group:xo,conditionalGroup:function(e,t){return xo(e[0],{...t,expandedStates:e})},fill:function(e){return bo(e),{type:Js,parts:e}},lineSuffix:function(e){return _o(e),{type:no,contents:e}},lineSuffixBoundary:wo,cursor:Bo,breakParent:Fo,ifBreak:function(e,t="",n={}){return _o(e),""!==t&&_o(t),{type:eo,breakContents:e,flatContents:t,groupId:n.groupId}},trim:No,indent:To,indentIfBreak:function(e,t){return _o(e),{type:to,contents:e,groupId:t.groupId,negate:t.negate}},align:Ro,addAlignmentToDoc:function(e,t,n){_o(e);let r=e;if(t>0){for(let e=0;ee},ea={printDocToString:function(e,t){const n={},r=t.printWidth,i=function(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}(t.endOfLine);let s=0;const o=[{ind:{value:"",length:0,queue:[]},mode:Ho,doc:e}],a=[];let l=!1;const u=[];let c=0;for(function(e){const t=new Set,n=[];fo(e,function(e){if(e.type===oo&&Eo(n),e.type===Zs){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===Zs&&n.pop().break&&Eo(n)},!0)}(e);o.length>0;){const{ind:e,mode:h,doc:d}=o.pop();switch(uo(d)){case zs:{const e="\n"!==i?$o(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=Wo(e));break}case Xs:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case Ks:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(zo),c++;break;case Ys:o.push({ind:Ko(e,t),mode:h,doc:d.contents});break;case qs:o.push({ind:Yo(e,d.n,t),mode:h,doc:d.contents});break;case Qs:s-=Qo(a);break;case Zs:switch(h){case jo:if(!l){o.push({ind:e,mode:d.break?Ho:jo,doc:d.contents});break}case Ho:{l=!1;const t={ind:e,mode:jo,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&Zo(t,o,i,a,n))o.push(t);else if(d.expandedStates){const t=lo(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:Ho,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:Ho,doc:t});break}{const t=d.expandedStates[r],s={ind:e,mode:jo,doc:t};if(Zo(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:Ho,doc:d.contents});break}}d.id&&(n[d.id]=lo(!1,o,-1).mode);break;case Js:{const t=r-s,i=d[Xo]??0,{parts:a}=d,l=a.length-i;if(0===l)break;const c=a[i+0],f=a[i+1],p={ind:e,mode:jo,doc:c},m={ind:e,mode:Ho,doc:c},g=Zo(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}const E={ind:e,mode:jo,doc:f},v={ind:e,mode:Ho,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}const C=a[i+2],D={ind:e,mode:h,doc:{...d,[Xo]:i+2}};Zo({ind:e,mode:jo,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case eo:case to:{const t=d.groupId?n[d.groupId]:h;if(t===Ho){const t=d.type===eo?d.breakContents:d.negate?d.contents:To(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===jo){const t=d.type===eo?d.flatContents:d.negate?To(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case no:u.push({ind:e,mode:h,doc:d.contents});break;case ro:u.length>0&&o.push({ind:e,mode:h,doc:Lo});break;case io:switch(h){case jo:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case Ho:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=Qo(a),a.push(i+e.value),s=e.length)}break;case so:o.push({ind:e,mode:h,doc:d.contents});break;case oo:break;default:throw new co(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}const h=a.indexOf(zo);if(-1!==h){const e=a.indexOf(zo,h+1);if(-1===e)return{formatted:a.filter(e=>e!==zo).join("")};const t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}},ta={willBreak:function(e){return mo(e,go,!1)},traverseDoc:fo,findInDoc:mo,mapDoc:po,removeLines:function(e){return po(e,vo)},stripTrailingHardline:function(e){return Do(function(e){return po(e,e=>function(e){switch(uo(e)){case Js:if(e.parts.every(e=>""===e))return"";break;case Zs:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===Zs&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case qs:case Ys:case to:case no:if(!e.contents)return"";break;case eo:if(!e.flatContents&&!e.breakContents)return"";break;case Xs:{const t=[];for(const n of e){if(!n)continue;const[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof lo(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case zs:case Ks:case Qs:case ro:case io:case so:case oo:break;default:throw new co(e)}return e}(e))}(e))},replaceEndOfLine:function(e,t=Po){return po(e,e=>"string"==typeof e?Uo(t,e.split("\n")):e)},canBreak:function(e){return mo(e,So,!1)}};function na(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}class ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class ia extends ra{constructor(e){super([]),this.idx=1,Object.assign(this,ma(e))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class sa extends ra{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ma(e))}}class oa extends ra{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ma(e))}}class aa extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class la extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ua extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ca extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ha extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class da extends ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ma(e))}}class fa{constructor(e){this.idx=1,Object.assign(this,ma(e))}accept(e){e.visit(this)}}function pa(e){function t(e){return e.map(pa)}if(e instanceof ia){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return"string"==typeof e.label&&(t.label=e.label),t}if(e instanceof oa)return{type:"Alternative",definition:t(e.definition)};if(e instanceof aa)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof la)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof ua)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ha)return{type:"RepetitionWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ca)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof da)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof fa){const t={type:"Terminal",name:e.terminalType.name,label:(n=e.terminalType,"string"==typeof(r=n).LABEL&&""!==r.LABEL?n.LABEL:n.name),idx:e.idx};"string"==typeof e.label&&(t.terminalLabel=e.label);const i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=i instanceof RegExp?i.source:i),t}if(e instanceof sa)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match");var n,r}function ma(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}class ga{visit(e){const t=e;switch(t.constructor){case ia:return this.visitNonTerminal(t);case oa:return this.visitAlternative(t);case aa:return this.visitOption(t);case la:return this.visitRepetitionMandatory(t);case ua:return this.visitRepetitionMandatoryWithSeparator(t);case ha:return this.visitRepetitionWithSeparator(t);case ca:return this.visitRepetition(t);case da:return this.visitAlternation(t);case fa:return this.visitTerminal(t);case sa:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Ea(e,t=[]){return!!(e instanceof aa||e instanceof ca||e instanceof ha)||(e instanceof da?e.definition.some(e=>Ea(e,t)):!(e instanceof ia&&t.includes(e))&&e instanceof ra&&(e instanceof ia&&t.push(e),e.definition.every(e=>Ea(e,t))))}function va(e){if(e instanceof ia)return"SUBRULE";if(e instanceof aa)return"OPTION";if(e instanceof da)return"OR";if(e instanceof la)return"AT_LEAST_ONE";if(e instanceof ua)return"AT_LEAST_ONE_SEP";if(e instanceof ha)return"MANY_SEP";if(e instanceof ca)return"MANY";if(e instanceof fa)return"CONSUME";throw Error("non exhaustive match")}class Ca{walk(e,t=[]){e.definition.forEach((n,r)=>{const i=e.definition.slice(r+1);if(n instanceof ia)this.walkProdRef(n,i,t);else if(n instanceof fa)this.walkTerminal(n,i,t);else if(n instanceof oa)this.walkFlat(n,i,t);else if(n instanceof aa)this.walkOption(n,i,t);else if(n instanceof la)this.walkAtLeastOne(n,i,t);else if(n instanceof ua)this.walkAtLeastOneSep(n,i,t);else if(n instanceof ha)this.walkManySep(n,i,t);else if(n instanceof ca)this.walkMany(n,i,t);else{if(!(n instanceof da))throw Error("non exhaustive match");this.walkOr(n,i,t)}})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);e.definition.forEach(e=>{const t=new oa({definition:[e]});this.walk(t,r)})}}function Da(e,t,n){return[new aa({definition:[new fa({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Sa(e){if(e instanceof ia)return Sa(e.referencedRule);if(e instanceof fa)return[e.terminalType];if(function(e){return e instanceof oa||e instanceof aa||e instanceof ca||e instanceof la||e instanceof ua||e instanceof ha||e instanceof fa||e instanceof sa}(e))return function(e){let t=[];const n=e.definition;let r,i=0,s=n.length>i,o=!0;for(;s&&o;)r=n[i],o=Ea(r),t=t.concat(Sa(r)),i+=1,s=n.length>i;return[...new Set(t)]}(e);if(function(e){return e instanceof da}(e))return function(e){const t=e.definition.map(e=>Sa(e));return[...new Set(t.flat())]}(e);throw Error("non exhaustive match")}const Aa="_~IN~_";class _a extends Ca{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=(i=e.referencedRule,s=e.idx,i.name+s+Aa+this.topProd.name);var i,s;const o=t.concat(n),a=Sa(new oa({definition:o}));this.follows[r]=a}}function ya(e){return e.charCodeAt(0)}function ba(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function Ta(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t],e[t]=!0}function Ra(e){if(void 0===e)throw Error("Internal Error - Should never get here!");return!0}function xa(){throw Error("Internal Error - Should never get here!")}function wa(e){return"Character"===e.type}const Fa=[];for(let e=ya("0");e<=ya("9");e++)Fa.push(e);const Na=[ya("_")].concat(Fa);for(let e=ya("a");e<=ya("z");e++)Na.push(e);for(let e=ya("A");e<=ya("Z");e++)Na.push(e);const La=[ya(" "),ya("\f"),ya("\n"),ya("\r"),ya("\t"),ya("\v"),ya("\t"),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya("\u2028"),ya("\u2029"),ya(" "),ya(" "),ya(" "),ya("\ufeff")],Oa=/[0-9a-fA-F]/,Ia=/[0-9]/,ka=/[1-9]/;class Ma{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}function Pa(e){console&&console.error&&console.error(`Error: ${e}`)}function Ba(e){console&&console.warn&&console.warn(`Warning: ${e}`)}let Ua={};const $a=new class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Ta(n,"global");break;case"i":Ta(n,"ignoreCase");break;case"m":Ta(n,"multiLine");break;case"u":Ta(n,"unicode");break;case"y":Ta(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":let t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}}Ra(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return xa()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;Ra(t)}if(!0!==e||void 0!==t)return Ra(t)?("?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t):void 0}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),Ra(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):xa()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ya("\n"),ya("\r"),ya("\u2028"),ya("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=Fa;break;case"D":e=Fa,t=!0;break;case"s":e=La;break;case"S":e=La,t=!0;break;case"w":e=Na;break;case"W":e=Na,t=!0}return Ra(e)?{type:"Set",value:e,complement:t}:xa()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ya("\f");break;case"n":e=ya("\n");break;case"r":e=ya("\r");break;case"t":e=ya("\t");break;case"v":e=ya("\v")}return Ra(e)?{type:"Character",value:e}:xa()}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:ya("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:ya(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:ya(this.popChar())}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const t=this.classAtom();if(t.type,wa(t)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,wa(n)){if(n.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};function Ga(e){const t=e.toString();if(Ua.hasOwnProperty(t))return Ua[t];{const e=$a.pattern(t);return Ua[t]=e,e}}const Va="Complement Sets are not supported for first char optimization",Wa='Unable to use "first char" lexer optimizations:\n';function Ha(e,t=!1){try{const t=Ga(e);return ja(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===Va)t&&Ba(`${Wa}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),Pa(`${Wa}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function ja(e,t,n){switch(e.type){case"Disjunction":for(let r=0;r{if("number"==typeof e)za(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)za(e,t,n);else{for(let e=r.from;e<=r.to&&e=ul){const e=r.from>=ul?r.from:ul,n=r.to,i=hl(e),s=hl(n);for(let e=i;e<=s;e++)t[e]=e}}}});break;case"Group":ja(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}const o=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===Ka(s)||"Group"!==s.type&&!1===o)break}break;default:throw Error("non exhaustive match!")}return Object.values(t)}function za(e,t,n){const r=hl(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=hl(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=hl(e.charCodeAt(0));t[n]=n}}}(e,t)}function Xa(e,t){return e.value.find(e=>{if("number"==typeof e)return t.includes(e);{const n=e;return void 0!==t.find(e=>n.from<=e&&e<=n.to)}})}function Ka(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(Array.isArray(e.value)?e.value.every(Ka):Ka(e.value))}class Ya extends Ma{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e);case"Lookbehind":return void this.visitLookbehind(e);case"NegativeLookbehind":return void this.visitNegativeLookbehind(e)}super.visitChildren(e)}}visitCharacter(e){this.targetCharCodes.includes(e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===Xa(e,this.targetCharCodes)&&(this.found=!0):void 0!==Xa(e,this.targetCharCodes)&&(this.found=!0)}}function qa(e,t){if(t instanceof RegExp){const n=Ga(t),r=new Ya(e);return r.visit(n),r.found}for(const n of t){const t=n.charCodeAt(0);if(e.includes(t))return!0}return!1}const Qa="PATTERN",Za="defaultMode",Ja="modes";const el=/[^\\][$]/,tl=/[^\\[][\^]|^\^/;function nl(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function rl(e){const t=e.PATTERN;if(t instanceof RegExp)return!1;if("function"==typeof t)return!0;if(Object.hasOwn(t,"exec"))return!0;if("string"==typeof t)return!1;throw Error("non exhaustive match")}function il(e){return"string"==typeof e&&1===e.length&&e.charCodeAt(0)}const sl={test:function(e){const t=e.length;for(let n=this.lastIndex;n"string"==typeof e?e.charCodeAt(0):e)}function ll(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const ul=256;let cl=[];function hl(e){return ee.CATEGORIES).flat().filter(Boolean);const e=n.filter(e=>!t.includes(e));t=t.concat(e),0===e.length?r=!1:n=e}return t}(e);!function(e){e.forEach(e=>{var t;Cl(e)||(gl[ml]=e,e.tokenTypeIdx=ml++),Dl(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Dl(e)||(e.CATEGORIES=[]),t=e,Object.hasOwn(null!=t?t:{},"categoryMatches")||(e.categoryMatches=[]),function(e){return Object.hasOwn(null!=e?e:{},"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})})}(t),function(e){e.forEach(e=>{vl([],e)})}(t),function(e){e.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(t=>{e.categoryMatches.push(gl[t].tokenTypeIdx)})})}(t),t.forEach(e=>{e.isParent=e.categoryMatches.length>0})}function vl(e,t){e.forEach(e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),t.CATEGORIES.forEach(n=>{const r=e.concat(t);r.includes(n)||vl(r,n)})}function Cl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}function Dl(e){return Object.hasOwn(null!=e?e:{},"CATEGORIES")}function Sl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}var Al;!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"}(Al||(Al={}));const _l={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:{buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i,s)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`},traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(_l);class yl{constructor(e,t=_l){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=Object.assign({},_l,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===_l.lineTerminatorsPattern)this.config.lineTerminatorsPattern=sl;else if(this.config.lineTerminatorCharacters===_l.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Array.isArray(e)?n={modes:{defaultMode:[...e]},defaultMode:Za}:(r=!1,n=Object.assign({},e))}),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){const t=[];return Object.hasOwn(e,Za)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+Za+"> property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(e,Ja)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(e,Ja)&&Object.hasOwn(e,Za)&&!Object.hasOwn(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${Za}: <${e.defaultMode}>which does not exist\n`,type:Al.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(e,Ja)&&Object.keys(e.modes).forEach(n=>{const r=e.modes[n];r.forEach((e,i)=>{void 0===e?t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:Al.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(e,"LONGER_ALT")&&(Array.isArray(e.LONGER_ALT)?e.LONGER_ALT:[e.LONGER_ALT]).forEach(i=>{void 0===i||r.includes(i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${e.name}> outside of mode <${n}>\n`,type:Al.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(function(e,t,n){const r=[];let i=!1;const s=Object.values(e.modes||{}).flat().filter(Boolean).filter(e=>e[Qa]!==yl.NA),o=al(n);return t&&s.forEach(e=>{const t=ol(e,o);if(!1!==t){const n=function(e,t){if(t.issue===Al.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Al.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else Object.hasOwn(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):qa(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:Al.NO_LINE_BREAKS_FLAGS}),r}(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},Object.entries(n.modes).forEach(([e,t])=>{n.modes[e]=t.filter(e=>void 0!==e)});const i=Object.keys(n.modes);if(Object.entries(n.modes).forEach(([e,n])=>{this.TRACE_INIT(`Mode: <${e}> processing`,()=>{if(this.modes.push(e),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e,t){let n=[];const r=function(e){const t=e.filter(e=>!Object.hasOwn(e,Qa));return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:Al.MISSING_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(e);n=n.concat(r.errors);const i=function(e){const t=e.filter(e=>{const t=e[Qa];return!(t instanceof RegExp||"function"==typeof t||Object.hasOwn(t,"exec")||"string"==typeof t)});return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Al.INVALID_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=e.filter(e=>e[Qa]instanceof RegExp);return t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return el.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return tl.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){return e.filter(e=>{const t=e[Qa];return t instanceof RegExp&&(t.multiline||t.global)}).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Al.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){const t=[];let n=e.map(n=>e.reduce((e,r)=>(n.PATTERN.source!==r.PATTERN.source||t.includes(r)||r.PATTERN===yl.NA||(t.push(r),e.push(r)),e),[]));return n=n.filter(Boolean),n.filter(e=>e.length>1).map(e=>{const t=e.map(e=>e.name);return{message:`The same RegExp pattern ->${e[0].PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:Al.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}(n)),t=t.concat(function(e){return e.filter(e=>e.PATTERN.test("")).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:Al.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}(n)),t}(s)),n=n.concat(function(e){const t=e.filter(e=>{if(!Object.hasOwn(e,"GROUP"))return!1;const t=e.GROUP;return t!==yl.SKIPPED&&t!==yl.NA&&!("string"==typeof t)});return t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Al.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}(s)),n=n.concat(function(e,t){return e.filter(e=>void 0!==e.PUSH_MODE&&!t.includes(e.PUSH_MODE)).map(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:Al.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}(s,t)),n=n.concat(function(e){const t=[],n=e.reduce((e,t,n)=>{const r=t.PATTERN;return r===yl.NA||("string"==typeof r?e.push({str:r,idx:n,tokenType:t}):r instanceof RegExp&&(i=r,void 0===[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(e=>-1!==i.source.indexOf(e)))&&e.push({str:r.source,idx:n,tokenType:t})),e;var i},[]);return e.forEach((e,r)=>{n.forEach(({str:n,idx:i,tokenType:s})=>{if(r${s.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:Al.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}})}),t}(s)),n}(n,i))}),0===this.lexerDefinitionErrors.length){let r;El(n),this.TRACE_INIT("analyzeTokenTypes",()=>{r=function(e,t){const n=(t=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()},t)).tracer;let r;n("initCharCodeToOptimizedIndexMap",()=>{!function(){if(0===cl.length){cl=new Array(65536);for(let e=0;e<65536;e++)cl[e]=e>255?255+~~(e/255):e}}()}),n("Reject Lexer.NA",()=>{r=e.filter(e=>e[Qa]!==yl.NA)});let i,s,o,a,l,u,c,h,d,f,p,m=!1;n("Transform Patterns",()=>{m=!1,i=r.map(e=>{const t=e[Qa];if(t instanceof RegExp){const e=t.source;return 1!==e.length||"^"===e||"$"===e||"."===e||t.ignoreCase?2!==e.length||"\\"!==e[0]||["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(e[1])?nl(t):e[1]:e}if("function"==typeof t)return m=!0,{exec:t};if("object"==typeof t)return m=!0,t;if("string"==typeof t){if(1===t.length)return t;{const e=t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return nl(new RegExp(e))}}throw Error("non exhaustive match")})}),n("misc mapping",()=>{s=r.map(e=>e.tokenTypeIdx),o=r.map(e=>{const t=e.GROUP;if(t!==yl.SKIPPED){if("string"==typeof t)return t;if(void 0===t)return!1;throw Error("non exhaustive match")}}),a=r.map(e=>{const t=e.LONGER_ALT;if(t)return Array.isArray(t)?t.map(e=>r.indexOf(e)):[r.indexOf(t)]}),l=r.map(e=>e.PUSH_MODE),u=r.map(e=>Object.hasOwn(e,"POP_MODE"))}),n("Line Terminator Handling",()=>{const e=al(t.lineTerminatorCharacters);c=r.map(e=>!1),"onlyOffset"!==t.positionTracking&&(c=r.map(t=>Object.hasOwn(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===ol(t,e)&&qa(e,t.PATTERN)))}),n("Misc Mapping #2",()=>{h=r.map(rl),d=i.map(il),f=r.reduce((e,t)=>{const n=t.GROUP;return"string"==typeof n&&n!==yl.SKIPPED&&(e[n]=[]),e},{}),p=i.map((e,t)=>({pattern:i[t],longerAlt:a[t],canLineTerminator:c[t],isCustom:h[t],short:d[t],group:o[t],push:l[t],pop:u[t],tokenTypeIdx:s[t],tokenType:r[t]}))});let g=!0,E=[];return t.safeMode||n("First Char Optimization",()=>{E=r.reduce((e,n,r)=>{if("string"==typeof n.PATTERN){const t=hl(n.PATTERN.charCodeAt(0));ll(e,t,p[r])}else if(Array.isArray(n.START_CHARS_HINT)){let t;n.START_CHARS_HINT.forEach(n=>{const i=hl("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,ll(e,i,p[r]))})}else if(n.PATTERN instanceof RegExp)if(n.PATTERN.unicode)g=!1,t.ensureOptimizations&&Pa(`${Wa}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=Ha(n.PATTERN,t.ensureOptimizations);0===i.length&&(g=!1),i.forEach(t=>{ll(e,t,p[r])})}else t.ensureOptimizations&&Pa(`${Wa}\tTokenType: <${n.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return e},[])}),{emptyGroups:f,patternIdxToConfig:p,charCodeToPatternIdxToConfig:E,hasCustom:m,canBeOptimized:g}}(n,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[e]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[e]=r.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[e]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}this.lexerDefinitionWarning.forEach(e=>{Ba(e.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(r&&(this.handleModes=()=>{}),!1===this.trackStartLines&&(this.computeNewColumn=e=>e),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=()=>{}),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const e=Object.entries(this.canModeBeOptimized).reduce((e,[t,n])=>(!1===n&&e.push(t),e),[]);if(t.ensureOptimizations&&e.length>0)throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Ua={}}),this.TRACE_INIT("toFastProperties",()=>{na(this)})})}tokenize(e,t=this.defaultMode){if(this.lexerDefinitionErrors.length>0){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,s,o,a,l,u,c,h,d,f,p,m,g;const E=e,v=E.length;let C=0,D=0;const S=this.hasCustom?0:Math.floor(e.length/10),A=new Array(S),_=[];let y=this.trackStartLines?1:void 0,b=this.trackStartLines?1:void 0;const T=function(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(!Array.isArray(r))throw Error("non exhaustive match");t[n]=[]}),t}(this.emptyGroups),R=this.trackStartLines,x=this.config.lineTerminatorsPattern;let w=0,F=[],N=[];const L=[],O=[];Object.freeze(O);let I=!1;const k=e=>{if(1===L.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);_.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{L.pop();const e=L.at(-1);F=this.patternIdxToConfig[e],N=this.charCodeToPatternIdxToConfig[e],w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}};function M(e){L.push(e),N=this.charCodeToPatternIdxToConfig[e],F=this.patternIdxToConfig[e],w=F.length,w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}let P;M.call(this,t);const B=this.config.recoveryEnabled;for(;Ca.length){a=s,c=s.length,l=u,P=t;break}}}break}}if(-1!==c){if(h=P.group,void 0!==h&&(a=null!==a?a:e.substring(C,C+c),d=P.tokenTypeIdx,f=this.createTokenInstance(a,C,d,P.tokenType,y,b,c),this.handlePayload(f,l),!1===h?D=this.addToken(A,D,f):T[h].push(f)),!0===R&&!0===P.canLineTerminator){let t,n,r=0;x.lastIndex=0;do{a=null!==a?a:e.substring(C,C+c),t=x.test(a),!0===t&&(n=x.lastIndex-1,r++)}while(!0===t);0!==r?(y+=r,b=c-n,this.updateTokenEndLineColumnLocation(f,h,n,r,y,b,c)):b=this.computeNewColumn(b,c)}else b=this.computeNewColumn(b,c);C+=c,this.handleModes(P,k,M,f)}else{const t=C,n=y,i=b;let s=!1===B;for(;!1===s&&C`Expecting ${Tl(e)?`--\x3e ${bl(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o="\nbut found: '"+t[0].image+"'";return r?s+r+o:s+`one of these possible Token sequences:\n${e.reduce((e,t)=>e.concat(t),[]).map(e=>`[${e.map(e=>bl(e)).join(", ")}]`).map((e,t)=>` ${t+1}. ${e}`).join("\n")}`+o},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",s="\nbut found: '"+t[0].image+"'";return n?i+n+s:i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map(e=>`[${e.map(e=>bl(e)).join(",")}]`).join(" ,")}>`+s}};Object.freeze(Bl);const Ul={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},$l={buildDuplicateFoundError(e,t){const n=e.name,r=t[0],i=r.idx,s=va(r),o=(a=r)instanceof fa?a.terminalType.name:a instanceof ia?a.nonTerminalName:"";var a;let l=`->${s}${i>0?i:""}<- ${o?`with argument: ->${o}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,"\n"),l},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=e.prefixPath.map(e=>bl(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=0===e.alternation.idx?"":e.alternation.idx,n=0===e.prefixPath.length;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule,\n`;return r+=n?"These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n":`<${e.prefixPath.map(e=>bl(e)).join(", ")}> may appears as a prefix path in all these alternatives.\n`,r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=va(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${t} --\x3e ${e.leftRecursionPath.map(e=>e.name).concat([t]).join(" --\x3e ")}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof sa?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class Gl extends ga{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:rc.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Vl extends Ca{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){0===this.ruleStack.length?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Wl extends Vl{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const e=t.concat(n),r=new oa({definition:e});this.possibleTokTypes=Sa(r),this.found=!0}}}class Hl extends Ca{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class jl extends Hl{walkMany(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}}class zl extends Hl{walkManySep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}}class Xl extends Hl{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}}class Kl extends Hl{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}}function Yl(e,t,n=[]){n=[...n];let r=[],i=0;function s(s){const o=Yl(s.concat(e.slice(i+1)),t,n);return r.concat(o)}for(;n.length{0!==e.definition.length&&(r=s(e.definition))}),r;if(!(t instanceof fa))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:e.slice(i)}),r}function ql(e,t,n,r){const i=[...n];i.push(e.name);const s=[...r];return s.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:s}}var Ql;function Zl(e){if(e instanceof aa||"Option"===e)return Ql.OPTION;if(e instanceof ca||"Repetition"===e)return Ql.REPETITION;if(e instanceof la||"RepetitionMandatory"===e)return Ql.REPETITION_MANDATORY;if(e instanceof ua||"RepetitionMandatoryWithSeparator"===e)return Ql.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ha||"RepetitionWithSeparator"===e)return Ql.REPETITION_WITH_SEPARATOR;if(e instanceof da||"Alternation"===e)return Ql.ALTERNATION;throw Error("non exhaustive match")}function Jl(e,t,n,r){const i=e.length,s=e.every(e=>e.every(e=>1===e.length));if(t)return function(t){const r=t.map(e=>e.GATE);for(let t=0;te.flat()).reduce((e,t,n)=>(t.forEach(t=>{t.tokenTypeIdx in e||(e[t.tokenTypeIdx]=n),t.categoryMatches.forEach(t=>{Object.hasOwn(e,t)||(e[t]=n)})}),e),{});return function(){const e=this.LA_FAST(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t1===e.length),i=e.length;if(r&&!n){const t=e.flat();if(1===t.length&&0===t[0].categoryMatches.length){const e=t[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===e}}{const e=t.reduce((e,t,n)=>(e[t.tokenTypeIdx]=!0,t.categoryMatches.forEach(t=>{e[t]=!0}),e),[]);return function(){const t=this.LA_FAST(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;nYl([e],1)),r=ru(n.length),i=n.map(e=>{const t={};return e.forEach(e=>{iu(e.partialPath).forEach(e=>{t[e]=!0})}),t});let s=n;for(let e=1;e<=t;e++){const n=s;s=ru(n.length);for(let o=0;o{iu(e.partialPath).forEach(e=>{i[o][e]=!0})})}}}}return r}function au(e,t,n,r){const i=new nu(e,Ql.ALTERNATION,r);return t.accept(i),ou(i.result,n)}function lu(e,t,n,r){const i=new nu(e,n);t.accept(i);const s=i.result,o=new tu(t,e,n).startWalking();return ou([new oa({definition:s}),new oa({definition:o})],r)}function uu(e,t){e:for(let n=0;ne.every(e=>e.every(e=>0===e.categoryMatches.length)))}function hu(e){return`${va(e)}_#_${e.idx}_#_${du(e)}`}function du(e){return e instanceof fa?e.terminalType.name:e instanceof ia?e.nonTerminalName:""}class fu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function pu(e,t,n,r=[]){const i=[],s=mu(t.definition);if(0===s.length)return[];{const t=e.name;s.includes(e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:rc.LEFT_RECURSION,ruleName:t});const o=r.concat([e]),a=s.filter(e=>!o.includes(e)).flatMap(t=>{const i=[...r];return i.push(t),pu(e,t,n,i)});return i.concat(a)}}function mu(e){let t=[];if(0===e.length)return t;const n=e[0];if(n instanceof ia)t.push(n.referencedRule);else if(n instanceof oa||n instanceof aa||n instanceof la||n instanceof ua||n instanceof ha||n instanceof ca)t=t.concat(mu(n.definition));else if(n instanceof da)t=n.definition.map(e=>mu(e.definition)).flat();else if(!(n instanceof fa))throw Error("non exhaustive match");const r=Ea(n),i=e.length>1;if(r&&i){const n=e.slice(1);return t.concat(mu(n))}return t}class gu extends ga{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}class Eu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}const vu="MismatchedTokenException",Cu="NoViableAltException",Du="EarlyExitException",Su="NotAllInputParsedException",Au=[vu,Cu,Du,Su];function _u(e){return Au.includes(e.name)}Object.freeze(Au);class yu extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class bu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=vu}}class Tu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Cu}}class Ru extends yu{constructor(e,t){super(e,t),this.name=Su}}class xu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Du}}const wu={},Fu="InRuleRecoveryException";class Nu extends Error{constructor(e){super(e),this.name=Fu}}function Lu(e,t,n,r,i,s,o){const a=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[a];if(void 0===l){const e=this.getCurrRuleFullName();l=new s(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[a]=l}let u=l.token,c=l.occurrence;const h=l.isEndOfRule;0===this.RULE_STACK_IDX&&h&&void 0===u&&(u=Ml,c=1),void 0!==u&&void 0!==c&&this.shouldInRepetitionRecoveryBeTried(u,c,o)&&this.tryInRepetitionRecovery(e,t,n,u)}const Ou=1024,Iu=1280,ku=1536;function Mu(e,t,n){return n|t|e}class Pu{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:tc.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(0===t.length){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return e.flatMap(e=>pu(e,e,$l))}validateEmptyOrAlternatives(e){return e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.slice(0,-1).flatMap((r,i)=>0===function(e,t,n){const r="EXIT_NONE_TERMINAL",i=[r],s="EXIT_ALTERNATIVE";let o=!1;const a=t.length,l=a-1-1,u=[],c=[];for(c.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});0!==c.length;){const e=c.pop();if(e===s){o&&c.at(-1).idx<=l&&c.pop();continue}const h=e.def,d=e.idx,f=e.ruleStack,p=e.occurrenceStack;if(0===h.length)continue;const m=h[0];if(m===r){const e={idx:d,def:h.slice(1),ruleStack:f.slice(0,-1),occurrenceStack:p.slice(0,-1)};c.push(e)}else if(m instanceof fa)if(d=0;e--){const t={idx:d,def:m.definition[e].definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p};c.push(t),c.push(s)}else if(m instanceof oa)c.push({idx:d,def:m.definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p});else{if(!(m instanceof sa))throw Error("non exhaustive match");c.push(ql(m,d,f,p))}}return u}([r],[],fl).length?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:rc.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}(e,$l))}validateAmbiguousAlternationAlternatives(e,t){return e.flatMap(e=>function(e,t,n){const r=new gu;e.accept(r);let i=r.alternations;i=i.filter(e=>!0!==e.ignoreAmbiguities);return i.flatMap(r=>{const i=r.idx,s=r.maxLookahead||t,o=au(i,e,s,r),a=function(e,t,n,r){const i=[];return e.reduce((n,r,s)=>(!0===t.definition[s].ignoreAmbiguities||r.forEach(r=>{const o=[s];e.forEach((e,n)=>{s!==n&&uu(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&o.push(n)}),o.length>1&&!uu(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]).map(e=>{const i=e.alts.map(e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}(o,r,e,n),l=function(e,t,n,r){const i=e.reduce((e,t,n)=>{const r=t.map(e=>({idx:n,path:e}));return e.concat(r)},[]);return i.flatMap(e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const s=e.idx,o=e.path;return i.filter(e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx{const n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}));var n,r}).map(e=>{const i=[e.idx+1,s+1],o=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})})}(o,r,e,n);return a.concat(l)})}(e,t,$l))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return e.forEach(e=>{const i=new Eu;e.accept(i),i.allProductions.forEach(i=>{const s=Zl(i),o=i.maxLookahead||t;if(0===lu(i.idx,e,s,o)[0].flat().length){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:rc.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}(e,t,$l)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,s){const o=au(e,t,n);return s(o,r,cu(o)?pl:fl,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Jl)}buildLookaheadForOptional(e){return function(e,t,n,r,i,s){const o=lu(e,t,i,n),a=cu(o)?pl:fl;return s(o[0],a,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Zl(e.prodType),eu)}}const Bu=new class extends ga{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function Uu(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset"function"==typeof e.GATE);return s.hasPredicates=o,n.definition.push(s),i.forEach(e=>{const t=new oa({definition:[]});s.definition.push(t),Object.hasOwn(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Object.hasOwn(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),Hu}function Zu(e){return 0===e?"":`${e}`}function Ju(e){if(e<0||e>zu){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${zu+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const ec=Pl(Ml,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ec);const tc=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Bl,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),nc=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var rc,ic,sc;!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(rc||(rc={}));class oc{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",()=>{na(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=function(e){const t=Object.assign({errMsgProvider:Ul},e),n={};return e.rules.forEach(e=>{n[e.name]=e}),function(e,t){const n=new Gl(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(0===n.length&&!1===this.skipValidations){const e=function(e){var t;const n=null!==(t=e.errMsgProvider)&&void 0!==t?t:$l;return function(e,t,n,r){const i=e.flatMap(e=>function(e,t){const n=new fu;e.accept(n);const r=n.allProductions,i=Object.groupBy(r,hu),s=Object.fromEntries(Object.entries(i).filter(([e,t])=>t.length>1));return Object.values(s).map(n=>{const r=n[0],i=t.buildDuplicateFoundError(e,n),s=va(r),o={message:i,type:rc.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:s,occurrence:r.idx},a=du(r);return a&&(o.parameter=a),o})}(e,n)),s=function(e,t,n){const r=[],i=t.map(e=>e.name);return e.forEach(e=>{const t=e.name;if(i.includes(t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:rc.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}(e,t,n),o=e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:rc.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}(e,n)),a=e.flatMap(t=>function(e,t,n,r){const i=[],s=t.reduce((t,n)=>n.name===e.name?t+1:t,0);if(s>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:rc.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n));return i.concat(s,o,a)}(e.rules,e.tokenTypes,n,e.grammarName)}({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:$l,grammarName:t}),n=function(e){return e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}).map(e=>Object.assign({type:rc.CUSTOM_LOOKAHEAD_VALIDATION},e))}({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(e,n)}}),0===this.definitionErrors.length&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const e=function(e){const t={};return e.forEach(e=>{const n=new _a(e).startWalking();Object.assign(t,n)}),t}(Object.values(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!oc.DEFER_DEFINITION_ERRORS_HANDLING&&0!==this.definitionErrors.length)throw e=this.definitionErrors.map(e=>e.message),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initGastRecorder(t),n.initPerformanceTracer(t),Object.hasOwn(t,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=Object.hasOwn(t,"skipValidations")?t.skipValidations:tc.skipValidations}}oc.DEFER_DEFINITION_ERRORS_HANDLING=!1,ic=oc,sc=[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:tc.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Lu)}getTokenToInsert(e){const t=Pl(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let a=!1;const l=this.LA_FAST(1);let u=this.LA_FAST(1);const c=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),n=new bu(t,l,this.LA(0));n.resyncedTokens=o.slice(0,-1),this.SAVE_ERROR(n)};for(;!a;){if(this.tokenMatcher(u,r))return void c();if(n.call(this))return c(),void e.apply(this,t);this.tokenMatcher(u,i)?a=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o))}this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA_FAST(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getNextPossibleTokenTypes(e){const t=e.ruleStack[0],n=this.getGAstProductions()[t];return new Wl(n,e).startWalking()}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new Nu("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(0===t.length)return!1;const n=this.LA_FAST(1);return void 0!==t.find(e=>this.tokenMatcher(n,e))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(t).includes(e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA_FAST(1),n=2;for(;;){const r=e.find(e=>fl(t,e));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(0===this.RULE_STACK_IDX)return wu;const e=this.currRuleShortName,t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK,n=this.RULE_STACK_IDX+1,r=new Array(n);for(let i=0;ithis.getFollowSetFromFollowKey(e)).flat()}getFollowSetFromFollowKey(e){if(e===wu)return[Ml];const t=e.ruleName+e.idxInCallingRule+Aa+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Ml)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA_FAST(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return t.slice(0,-1)}attemptInRepetitionRecovery(e,t,n,r,i,s,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){const e=this.RULE_STACK_IDX+1,t=new Array(e);for(let n=0;n{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:o}=function(e){Bu.reset(),e.accept(Bu);const t=Bu.dslMethods;return Bu.reset(),t}(e);t.forEach(t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${va(t)}${n}`,()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=Mu(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),n.forEach(t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,va(t))}),r.forEach(t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,va(t))}),i.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Ou,"RepetitionMandatory",t.maxLookahead,va(t))}),s.forEach(t=>{this.computeLookaheadFunc(e,t.idx,ku,"RepetitionMandatoryWithSeparator",t.maxLookahead,va(t))}),o.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Iu,"RepetitionWithSeparator",t.maxLookahead,va(t))})})})}computeLookaheadFunc(e,t,n,r,i,s){this.TRACE_INIT(`${s}${0===t?"":t}`,()=>{const s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=Mu(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,s)})}getKeyForAutomaticLookahead(e,t){return Mu(this.currRuleShortName,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:tc.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=$u,this.setNodeLocationFromNode=$u,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Uu,this.setNodeLocationFromNode=Uu,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{}}else this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{}}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA_FAST(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];var r,i,s;i=t,s=e,void 0===(r=n).children[s]?r.children[s]=[i]:r.children[s].push(i),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(void 0===this.baseCstVisitorConstructor){const e=function(e,t){const n=function(){};Gu(n,e+"BaseSemantics");const r={visit:function(e,t){if(Array.isArray(e)&&(e=e[0]),void 0!==e)return this[e.name](e.children,t)},validateVisitor:function(){const e=function(e,t){const n=function(e,t){return t.filter(t=>"function"==typeof e[t]==0).map(t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Wu.MISSING_METHOD,methodName:t})).filter(Boolean)}(e,t);return n}(this,t);if(0!==e.length){const t=e.map(e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(void 0===this.baseCstVisitorWithDefaultsConstructor){const e=function(e,t,n){const r=function(){};Gu(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return t.forEach(e=>{i[e]=Vu}),(r.prototype=i).constructor=r,r}(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):ec}LA_FAST(e){const t=this.currIdx+e;return this.tokVector[t]}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?ec:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=pl,this.subruleIdx=0,this.currRuleShortName=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(Array.isArray(e)){if(0===e.length)throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(Array.isArray(e))this.tokensMap=e.reduce((e,t)=>(e[t.name]=t,e),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(Sl)){const t=Object.values(e.modes).flat(),n=[...new Set(t)];this.tokensMap=n.reduce((e,t)=>(e[t.name]=t,e),{})}else{if("object"!=typeof e||null===e)throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=Object.assign({},e)}this.tokensMap.EOF=Ml;const n=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every(e=>{var t;return 0==(null===(t=e.categoryMatches)||void 0===t?void 0:t.length)});this.tokenMatcher=n?pl:fl,El(Object.values(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:nc.resyncEnabled,i=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:nc.recoveryValueFunc,s=this.ruleShortNameIdx<<12;let o;return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,o=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...t){this.onBeforeParse(e);try{return o.apply(this,t)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:t,coreRule:o})}invokeRuleCatch(e,t,n){const r=0===this.RULE_STACK_IDX,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(_u(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(Ou,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,Ou,e,Xl)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(ku,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Kl],t,ku,e,Kl)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let s=!0;for(;!0===i.call(this)&&!0===s;)s=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,jl,s)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(Iu,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,zl],t,Iu,e,zl)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,ku,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=Array.isArray(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX]),this.cstFinallyStateUpdate()}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.coreRule.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw _u(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA_FAST(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new bu(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===Fu?n:e}}}saveRecogState(){const e=this.errors,t=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);const t=e.RULE_STACK;for(let e=0;e=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX])}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=n,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ml)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let e=0;e${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:rc.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){var n;const r=null!==(n=e.coreRule)&&void 0!==n?n:e;return function(){this.isBackTrackingStack.push(1);const e=this.saveRecogState();try{return r.apply(this,t),!0}catch(e){if(_u(e))return!1;throw e}finally{this.reloadRecogState(e),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Object.values(this.gastProductionsCache).map(pa)}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:tc.errorMessageProvider}SAVE_ERROR(e){if(_u(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=lu(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],s=[];for(let e=1;e<=this.maxLookahead;e++)s.push(this.LA(e));const o=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:s,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new xu(o,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=au(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));const s=this.LA(0),o=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:s,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Tu(o,this.LA(1),s))}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const n=t>0?t:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return ec}topLevelRuleRecord(e,t){try{const n=new sa({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}}optionInternalRecord(e,t){return qu.call(this,aa,e,t)}atLeastOneInternalRecord(e,t){qu.call(this,la,t,e)}atLeastOneSepFirstInternalRecord(e,t){qu.call(this,ua,t,e,ju)}manyInternalRecord(e,t){qu.call(this,ca,t,e)}manySepFirstInternalRecord(e,t){qu.call(this,ha,t,e,ju)}orInternalRecord(e,t){return Qu.call(this,e,t)}subruleInternalRecord(e,t,n){if(Ju(t),!e||!Object.hasOwn(e,"ruleName")){const n=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=e.ruleName,s=new ia({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(s),this.outputCst?Yu:Hu}consumeInternalRecord(e,t,n){if(Ju(t),!Cl(e)){const n=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=new fa({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),Ku}},class{initPerformanceTracer(e){if(Object.hasOwn(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=tc.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()}}],sc.forEach(e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach(n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(ic.prototype,n,r):ic.prototype[n]=e.prototype[n]})});class ac extends oc{constructor(e,t=tc){const n=Object.assign({},t);n.outputCst=!1,super(e,n)}}function lc(e){return void 0!==e.lineNoCont?e.lineNoCont:e.startLine}class uc{visit(e){return e&&this[e.kind](e)}arraySpecifier(e){this.visit(e.size)}binaryExpression(e){this.visit(e.lhs),this.visit(e.rhs)}methodCall(e){this.visit(e.on),this.visit(e.functionCall)}functionCall(e){this.visit(e.callee);for(const t of e.args)this.visit(t)}arrayAccess(e){this.visit(e.on),this.visit(e.index)}translationUnit(e){for(const t of e.declarations)this.visit(t)}assignmentExpression(e){this.visit(e.lhs),this.visit(e.rhs)}fieldAccess(e){this.visit(e.on)}conditionalExpression(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}postfixExpression(e){this.visit(e.on)}commaExpression(e){this.visit(e.lhs),this.visit(e.rhs)}unaryExpression(e){this.visit(e.on)}functionDefinition(e){this.visit(e.returnType);for(const t of e.params)this.visit(t);this.visit(e.body)}functionPrototype(e){this.visit(e.returnType);for(const t of e.params)this.visit(t)}parameterDeclaration(e){this.visit(e.arraySpecifier),this.visit(e.typeSpecifier)}typeSpecifier(e){hc(e.typeSpecifierNonArray)&&this.visit(e.typeSpecifierNonArray),this.visit(e.arraySpecifier)}compoundStatement(e){for(const t of e.statements)this.visit(t)}returnStatement(e){this.visit(e.what)}continueStatement(e){}breakStatement(e){}discardStatement(e){}declarator(e){this.visit(e.arraySpecifier),this.visit(e.init)}doWhileStatement(e){this.visit(e.statement),this.visit(e.conditionExpression)}whileStatement(e){this.visit(e.conditionExpression),this.visit(e.statement)}forStatement(e){this.visit(e.initExpression),this.visit(e.conditionExpression),this.visit(e.loopExpression),this.visit(e.statement)}expressionStatement(e){this.visit(e.expression)}initDeclaratorListDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}precisionDeclaration(e){this.visit(e.typeSpecifierNoPrec)}selectionStatement(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}storageQualifier(e){}switchStatement(e){this.visit(e.initExpression);for(const t of e.cases)this.visit(t)}caseLabel(e){this.visit(e.case_)}caseBlock(e){this.visit(e.caseLabel);for(const t of e.statements)this.visit(t)}fullySpecifiedType(e){this.visit(e.typeQualifier),this.visit(e.typeSpecifier)}typeQualifier(e){this.visit(e.storageQualifier),this.visit(e.layoutQualifier)}structSpecifier(e){for(const t of e.declarations)this.visit(t)}layoutQualifier(e){}invariantDeclaration(e){}structDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}variableExpression(e){}constantExpression(e){}uniformBlock(e){this.visit(e.typeQualifier);for(const t of e.declarations)this.visit(t);this.visit(e.arraySpecifier)}ppDefine(e){this.visit(e.node)}ppDir(e){}ppExtension(e){}ppCall(e){}ppPragma(e){}}function cc(e){return"tokenType"in e}function hc(e){return"kind"in e}function dc(e,t){const n=e.split("\n"),r=t.startLine,i=t.endLine;return"./src/compiler.lambda:"+r+":"+(t.startColumn-1)+"\n"+n.map((e,t)=>[t+1,e]).slice(r-2,i+2).map(([e,n])=>{var s,o,a;return e>=r&&e<=i&&(s=n,o=6+(r===e?t.startColumn-1:0),a=6+(i===e?t.endColumn:n.length),n=s+"\n"+"-".repeat(o)+"^".repeat(a-o)),(""+e).padStart(5)+" "+n}).join("\n")}const fc=["active","asm","atomic_uint","attribute","cast","class","coherent","common","double","dvec2","dvec3","dvec4","enum","extern","external","filter","fixed","fvec2","fvec3","fvec4","goto","half","hvec2","hvec3","hvec4","iimage1D","iimage1DArray","iimage2D","iimage2DArray","iimage3D","iimageBuffer","iimageCube","image1D","image1DArray","image2D","image2DArray","image3D","imageBuffer","imageCube","inline","input","interface","isampler1D","isampler1DArray","isampler2DMS","isampler2DMSArray","isampler2DRect","isamplerBuffer","long","namespace","noinline","noperspective","output","partition","patch","public","readonly","resource","restrict","sample","sampler1D","sampler1DArray","sampler1DArrayShadow","sampler1DShadow","sampler2DMS","sampler2DMSArray","sampler2DRect","sampler2DRectShadow","sampler3DRect","samplerBuffer","short","sizeof","static","subroutine","superp","template","this","typedef","uimage1D","uimage1DArray","uimage2D","uimage2DArray","uimage3D","uimageBuffer","uimageCube","union","unsigned","usampler1D","usampler1DArray","usampler2DMS","usampler2DMSArray","usampler2DRect","usamplerBuffer","using","volatile","volatile","writeonly"];var pc;!function(e){e.ASSIGN_OP=kl({name:"ASSIGN_OP",pattern:yl.NA}),e.UNARY_OP=kl({name:"UNARY_OP",pattern:yl.NA}),e.POSTFIX_OP=kl({name:"POSTFIX_OP",pattern:yl.NA}),e.PRECISION_QUALIFIER=kl({name:"PRECISION_QUALIFIER",pattern:yl.NA}),e.INTERPOLATION_QUALIFIER=kl({name:"INTERPOLATION_QUALIFIER",pattern:yl.NA}),e.MULTIPLICATIVE_OP=kl({name:"MULTIPLICATIVE_OP",pattern:yl.NA}),e.ADDITIVE_OP=kl({name:"ADDITIVE_OP",pattern:yl.NA}),e.SHIFT_OP=kl({name:"SHIFT_OP",pattern:yl.NA}),e.RELATIONAL_OP=kl({name:"RELATIONAL_OP",pattern:yl.NA}),e.EQUALITY_OP=kl({name:"EQUALITY_OP",pattern:yl.NA}),e.PARAMETER_QUALIFIER=kl({name:"PARAMETER_QUALIFIER",pattern:yl.NA}),e.WHITESPACE=kl({name:"WHITESPACE",pattern:/\s+/,group:yl.SKIPPED}),e.LINE_COMMENT=kl({name:"LINE_COMMENT",pattern:/\/\/[^\r\n]*/,group:"COMMENTS"}),e.MULTILINE_COMMENT=kl({name:"MULTILINE_COMMENT",pattern:/\/\*[\s\S]*?\*\//,group:"COMMENTS"}),e.MULASSIGN=kl({name:"MULASSIGN",pattern:"*=",label:"'*='",categories:e.ASSIGN_OP}),e.DIVASSIGN=kl({name:"DIVASSIGN",pattern:"/=",label:"'/='",categories:e.ASSIGN_OP}),e.MODASSIGN=kl({name:"MODASSIGN",pattern:"%=",label:"'%='",categories:e.ASSIGN_OP}),e.ADDASSIGN=kl({name:"ADDASSIGN",pattern:"+=",label:"'+='",categories:e.ASSIGN_OP}),e.SUBASSIGN=kl({name:"SUBASSIGN",pattern:"-=",label:"'-='",categories:e.ASSIGN_OP}),e.LEFTASSIGN=kl({name:"LEFTASSIGN",pattern:"<<=",label:"'<<='",categories:e.ASSIGN_OP}),e.RIGHTASSIGN=kl({name:"RIGHTASSIGN",pattern:">>=",label:"'>>='",categories:e.ASSIGN_OP}),e.ANDASSIGN=kl({name:"ANDASSIGN",pattern:"&=",label:"'&='",categories:e.ASSIGN_OP}),e.XORASSIGN=kl({name:"XORASSIGN",pattern:"^=",label:"'^='",categories:e.ASSIGN_OP}),e.ORASSIGN=kl({name:"ORASSIGN",pattern:"|=",label:"'|='",categories:e.ASSIGN_OP}),e.INC_OP=kl({name:"INC_OP",pattern:"++",label:"'++'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.QUESTION=kl({name:"QUESTION",pattern:"?",label:"'?'"}),e.COLON=kl({name:"COLON",pattern:":",label:"':'"}),e.DEC_OP=kl({name:"DEC_OP",pattern:"--",label:"'--'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.AND_OP=kl({name:"AND_OP",pattern:"&&",label:"'&&'"}),e.XOR_OP=kl({name:"XOR_OP",pattern:"^^",label:"'^^'"}),e.OR_OP=kl({name:"OR_OP",pattern:"||",label:"'||'"}),e.LEFT_OP=kl({name:"LEFT_OP",pattern:"<<",label:"'<<'",categories:e.SHIFT_OP}),e.RIGHT_OP=kl({name:"RIGHT_OP",pattern:">>",label:"'>>'",categories:e.SHIFT_OP}),e.EQ_OP=kl({name:"EQ_OP",pattern:"==",label:"'=='",categories:e.EQUALITY_OP}),e.NE_OP=kl({name:"NE_OP",pattern:"!=",label:"'!='",categories:e.EQUALITY_OP}),e.LE_OP=kl({name:"LE_OP",pattern:"<=",label:"'<='",categories:e.RELATIONAL_OP}),e.GE_OP=kl({name:"GE_OP",pattern:">=",label:"'>='",categories:e.RELATIONAL_OP}),e.LEFT_ANGLE=kl({name:"LEFT_ANGLE",pattern:"<",label:"'<'",categories:e.RELATIONAL_OP}),e.RIGHT_ANGLE=kl({name:"RIGHT_ANGLE",pattern:">",label:"'>'",categories:e.RELATIONAL_OP}),e.PLUS=kl({name:"PLUS",pattern:"+",label:"'+'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.TILDE=kl({name:"TILDE",pattern:"~",label:"'~'",categories:e.UNARY_OP}),e.BANG=kl({name:"BANG",pattern:"!",label:"'!'",categories:e.UNARY_OP}),e.CARET=kl({name:"CARET",pattern:"^",label:"'^'"}),e.AMPERSAND=kl({name:"AND",pattern:"&",label:"'&'"}),e.VERTICAL_BAR=kl({name:"VERTICAL_BAR",pattern:"|",label:"'|'"}),e.SLASH=kl({name:"SLASH",pattern:"/",label:"'/'",categories:e.MULTIPLICATIVE_OP}),e.PERCENT=kl({name:"PERCENT",pattern:"%",label:"'%'",categories:e.MULTIPLICATIVE_OP}),e.STAR=kl({name:"STAR",pattern:"*",label:"'*'",categories:e.MULTIPLICATIVE_OP}),e.DASH=kl({name:"DASH",pattern:"-",label:"'-'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.COMMA=kl({name:"COMMA",pattern:",",label:"','"}),e.EQUAL=kl({name:"EQUAL",pattern:"=",label:"'='",categories:e.ASSIGN_OP}),e.LEFT_PAREN=kl({name:"LEFT_PAREN",pattern:"(",label:"'('"}),e.RIGHT_PAREN=kl({name:"RIGHT_PAREN",pattern:")",label:"')'"}),e.LEFT_BRACKET=kl({name:"LEFT_BRACKET",pattern:"[",label:"'['"}),e.RIGHT_BRACKET=kl({name:"RIGHT_BRACKET",pattern:"]",label:"']'"}),e.LEFT_BRACE=kl({name:"LEFT_BRACE",pattern:"{",label:"'{'"}),e.RIGHT_BRACE=kl({name:"RIGHT_BRACE",pattern:"}",label:"'}'"}),e.SEMICOLON=kl({name:"SEMICOLON",pattern:";",label:"';'"}),e.IDENTIFIER=kl({name:"IDENTIFIER",pattern:yl.NA}),e.NON_PP_IDENTIFIER=kl({name:"NON_PP_IDENTIFIER",pattern:/[a-z_]\w*/i,categories:e.IDENTIFIER}),e.PP=kl({name:"PP",pattern:yl.NA,categories:e.IDENTIFIER});const t=(t,n)=>kl({name:t,pattern:n,categories:e.PP,longer_alt:e.NON_PP_IDENTIFIER});e.DEFINE=t("DEFINE","define"),e.UNDEF=t("UNDEF","undef"),e.ENDIF=t("ENDIF","endif"),e.IFDEF=t("IFDEF","ifdef"),e.IFNDEF=t("IFNDEF","ifndef"),e.ELIF=t("ELIF","elif"),e.ERROR=t("ERROR","error"),e.VERSION=t("VERSION","version"),e.PRAGMA_DIRECTIVE=kl({name:"PRAGMA_DIRECTIVE",pattern:/#\s*pragma\s+[^\r\n]*/}),e.LINE=t("LINE","line"),e.EXTENSION=t("EXTENSION","extension"),e.INCLUDE=t("INCLUDE","include"),e.HASH_INCLUDE_MODULE=kl({name:"HASH_INCLUDE_MODULE",pattern:/#\s*include\s*<[\w\-./\\$@ ]+>/}),e.HASH=kl({name:"HASH",pattern:"#"}),e.KEYWORD=kl({name:"KEYWORD",pattern:yl.NA});const n=(t,n)=>kl({name:t,pattern:t.toLowerCase(),label:"'"+t.toLowerCase()+"'",longer_alt:e.NON_PP_IDENTIFIER,categories:n?[e.KEYWORD,n]:e.KEYWORD});e.CONST=n("CONST"),e.UNIFORM=n("UNIFORM"),e.LAYOUT=n("LAYOUT"),e.CENTROID=n("CENTROID"),e.FLAT=n("FLAT",e.INTERPOLATION_QUALIFIER),e.SMOOTH=n("SMOOTH",e.INTERPOLATION_QUALIFIER),e.BREAK=n("BREAK"),e.CONTINUE=n("CONTINUE"),e.DO=n("DO"),e.PRECISION=n("PRECISION"),e.FOR=n("FOR"),e.WHILE=n("WHILE"),e.SWITCH=n("SWITCH"),e.CASE=n("CASE"),e.DEFAULT=n("DEFAULT"),e.IF=n("IF"),e.ELSE=n("ELSE"),e.INVARIANT=n("INVARIANT"),e.INOUT=n("INOUT",e.PARAMETER_QUALIFIER),e.OUT=n("OUT",e.PARAMETER_QUALIFIER),e.VOID=n("VOID"),e.STRUCT=n("STRUCT"),e.DISCARD=n("DISCARD"),e.RETURN=n("RETURN"),e.LOWP=n("LOWP",e.PRECISION_QUALIFIER),e.MEDIUMP=n("MEDIUMP",e.PRECISION_QUALIFIER),e.HIGHP=n("HIGHP",e.PRECISION_QUALIFIER),e.CONSTANT=kl({name:"CONSTANT",pattern:yl.NA}),e.BASIC_TYPE=kl({name:"BASIC_TYPE",pattern:yl.NA});const r=t=>kl({name:t.toUpperCase(),pattern:t,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE});e.BOOL=r("bool"),e.INT=r("int"),e.FLOAT=r("float"),e.MAT2X3=r("mat2x3"),e.MAT2X4=r("mat2x4"),e.MAT2X2=kl({name:"mat2x2".toUpperCase(),pattern:/mat2(?:x2)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat2"}),e.MAT3X2=r("mat3x2"),e.MAT3X4=r("mat3x4"),e.MAT3X3=kl({name:"mat3x3".toUpperCase(),pattern:/mat3(?:x3)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat3"}),e.MAT4X2=r("mat4x2"),e.MAT4X3=r("mat4x3"),e.MAT4X4=kl({name:"MAT4X4",pattern:/mat4(?:x4)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat4"}),e.VEC2=r("vec2"),e.VEC3=r("vec3"),e.VEC4=r("vec4"),e.IVEC2=r("ivec2"),e.IVEC3=r("ivec3"),e.IVEC4=r("ivec4"),e.BVEC2=r("bvec2"),e.BVEC3=r("bvec3"),e.BVEC4=r("bvec4"),e.UINT=r("uint"),e.UVEC2=r("uvec2"),e.UVEC3=r("uvec3"),e.UVEC4=r("uvec4"),e.USAMPLERCUBE=r("usamplerCube"),e.USAMPLER3D=r("usampler3D"),e.USAMPLER2DARRAY=r("usampler2DArray"),e.USAMPLER2D=r("usampler2D"),e.SAMPLERCUBESHADOW=r("samplerCubeShadow"),e.SAMPLERCUBE=r("samplerCube"),e.SAMPLER3D=r("sampler3D"),e.SAMPLER2DSHADOW=r("sampler2DShadow"),e.SAMPLER2DARRAYSHADOW=r("sampler2DArrayShadow"),e.SAMPLER2DARRAY=r("sampler2DArray"),e.SAMPLER2D=r("sampler2D"),e.ISAMPLERCUBE=r("isamplerCube"),e.ISAMPLER3D=r("isampler3D"),e.ISAMPLER2DARRAY=r("isampler2DArray"),e.ISAMPLER2D=r("isampler2D"),e.IN=n("IN",e.PARAMETER_QUALIFIER),e.VARYING=n("VARYING"),e.ATTRIBUTE=n("ATTRIBUTE"),e.BOOLCONSTANT=kl({name:"BOOLCONSTANT",pattern:/true|false/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.CONSTANT}),e.FLOATCONSTANT=kl({name:"FLOATCONSTANT",pattern:/((\d+\.\d*|\.\d+)(e[+-]?\d+)?|\d+e[+-]?\d+)f?/i,categories:e.CONSTANT}),e.DOT=kl({name:"DOT",pattern:".",label:"'.'"}),e.UINTCONSTANT=kl({name:"UINTCONSTANT",pattern:/0x[\da-f]+u|\d+u/i,categories:e.CONSTANT}),e.INTCONSTANT=kl({name:"INTCONSTANT",pattern:/0x[\da-f]+|\d+/i,categories:e.CONSTANT}),e.STRING=kl({name:"STRING",pattern:/"([^"\\]+|\\")+"/})}(pc||(pc={}));const mc=Object.values(pc).filter(e=>e!==pc.NON_PP_IDENTIFIER).flatMap(e=>Array.isArray(e)?e:[e]);mc.push(pc.NON_PP_IDENTIFIER);const gc=new yl(mc,{ensureOptimizations:!1});new class extends uc{constructor(){super(...arguments),this.markError=()=>{}}eval(e,t,n){return this.isDefined=t,this.markError=n,super.visit(e)}constantExpression(e){if(e.const_.tokenType!==pc.INTCONSTANT)throw new Error("XX");return+e.const_.image}unaryExpression(e){switch(e.op.tokenType){case pc.NON_PP_IDENTIFIER:return+this.isDefined(e.on.var.image);case pc.DASH:return-this.visit(e.on);case pc.TILDE:return~this.visit(e.on);case pc.BANG:return+!this.visit(e.on);case pc.PLUS:return this.visit(e.on);default:throw new Error(e.op.tokenType.name)}}binaryExpression(e){const t=this.visit(e.lhs);switch(e.op.tokenType){case pc.AND_OP:return t&&this.visit(e.rhs);case pc.OR_OP:return t||this.visit(e.rhs);default:{const n=this.visit(e.rhs);return 0|function(e,t,n){switch(e){case pc.PLUS:return t+n;case pc.DASH:return t-n;case pc.STAR:return t*n;case pc.PERCENT:return t%n;case pc.SLASH:return t/n;case pc.LEFT_OP:return t<>n;case pc.EQ_OP:return t===n;case pc.NE_OP:return t!==n;case pc.LE_OP:return t<=n;case pc.GE_OP:return t>=n;case pc.LEFT_ANGLE:return tn;case pc.XOR_OP:return t!==n;case pc.AND_OP:return t&&n;case pc.OR_OP:return t||n;case pc.AMPERSAND:return t&n;case pc.CARET:return t^n;case pc.VERTICAL_BAR:return t|n;default:throw new Error}}(e.op.tokenType,t,n)}}}variableExpression(e){return this.markError("P0001",e.var,"undefined identifier "+e.var.image),0}};const Ec=new class extends ac{getTokensOnLine(){const e=[],t=lc(this.LA(0));let n;for(;lc(n=this.LA(1))===t;)e.push(n),this.SKIP_TOKEN();return e}constructor(){super(mc,{skipValidations:!0}),this.multiplicativeExpression=this.RR("multiplicativeExpression",()=>this.LEFT_ASSOC(this.preprocessing?this.ppUnaryExpression:this.unaryExpression,pc.MULTIPLICATIVE_OP)),this.additiveExpression=this.RR("additiveExpression",()=>this.LEFT_ASSOC(this.multiplicativeExpression,pc.ADDITIVE_OP)),this.shiftExpression=this.RR("shiftExpression",()=>this.LEFT_ASSOC(this.additiveExpression,pc.SHIFT_OP)),this.relationalExpression=this.RR("relationalExpression",()=>this.LEFT_ASSOC(this.shiftExpression,pc.RELATIONAL_OP)),this.equalityExpression=this.RR("equalityExpression",()=>this.LEFT_ASSOC(this.relationalExpression,pc.EQUALITY_OP)),this.andExpression=this.RR("andExpression",()=>this.LEFT_ASSOC(this.equalityExpression,pc.AMPERSAND)),this.exclusiveOrExpression=this.RR("exclusiveOrExpression",()=>this.LEFT_ASSOC(this.andExpression,pc.CARET)),this.inclusiveOrExpression=this.RR("inclusiveOrExpression",()=>this.LEFT_ASSOC(this.exclusiveOrExpression,pc.VERTICAL_BAR)),this.logicalAndExpression=this.RR("logicalAndExpression",()=>this.LEFT_ASSOC(this.inclusiveOrExpression,pc.AND_OP)),this.logicalXorExpression=this.RR("logicalXorExpression",()=>this.LEFT_ASSOC(this.logicalAndExpression,pc.XOR_OP)),this.logicalOrExpression=this.RR("logicalOrExpression",()=>this.LEFT_ASSOC(this.logicalXorExpression,pc.OR_OP)),this.assignmentExpression=this.RR("assignmentExpression",()=>{const e=this.SUBRULE(this.conditionalExpression);return this.OPTION(()=>{const t=this.CONSUME(pc.ASSIGN_OP),n=this.SUBRULE1(this.assignmentExpression);return{kind:"assignmentExpression",lhs:e,op:t,rhs:n}})??e}),this.expression=this.RR("expression",()=>{let e;return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.SUBRULE(this.assignmentExpression);return e=e?{kind:"commaExpression",lhs:e,rhs:t}:t}}),e}),this.conditionalExpression=this.RR("conditionalExpression",()=>{const e=this.SUBRULE1(this.logicalOrExpression);return this.OPTION(()=>({kind:"conditionalExpression",condition:e,QUESTION:this.CONSUME(pc.QUESTION),yes:this.SUBRULE2(this.expression),COLON:this.CONSUME(pc.COLON),no:this.SUBRULE3(this.assignmentExpression)}))??e}),this.switchStatement=this.RR("switchStatement",()=>{this.CONSUME(pc.SWITCH),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);this.CONSUME(pc.RIGHT_PAREN),this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.caseBlock))),this.CONSUME(pc.RIGHT_BRACE),{kind:"switchStatement",initExpression:e,cases:t}}),this.caseBlock=this.RR("caseBlock",()=>{const e=this.SUBRULE(this.caseLabel),t=[];return this.MANY1(()=>t.push(this.SUBRULE(this.statement))),{kind:"caseBlock",caseLabel:e,statements:t}}),this.jumpStatement=this.RR("jumpStatement",()=>{const e=this.OR([{ALT:()=>(this.CONSUME(pc.CONTINUE),{kind:"continueStatement"})},{ALT:()=>(this.CONSUME(pc.BREAK),{kind:"breakStatement"})},{ALT:()=>(this.CONSUME(pc.DISCARD),{kind:"discardStatement"})},{ALT:()=>(this.CONSUME(pc.RETURN),{kind:"returnStatement",what:this.OPTION(()=>this.SUBRULE(this.expression))})}]);return this.CONSUME(pc.SEMICOLON),e}),this.primaryExpression=this.RR("primaryExpression",()=>this.OR([{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),e}},{ALT:()=>({kind:"variableExpression",var:this.CONSUME(pc.IDENTIFIER)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.CONSTANT)})}])),this.constantExpression=this.RR("constantExpression",()=>this.SUBRULE(this.conditionalExpression)),this.layoutQualifier=this.RR("layoutQualifier",()=>{this.CONSUME(pc.LAYOUT),this.CONSUME(pc.LEFT_PAREN);const e=[];return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.CONSUME(pc.IDENTIFIER);let n;this.OPTION(()=>{this.CONSUME(pc.EQUAL),n=this.OR([{ALT:()=>this.CONSUME(pc.INTCONSTANT)},{ALT:()=>this.CONSUME(pc.UINTCONSTANT)}])}),e.push({IDENTIFIER:t,init:n})}}),this.CONSUME(pc.RIGHT_PAREN),{kind:"layoutQualifier",layoutQualifierIds:e}}),this.storageQualifier=this.RR("storageQualifier",()=>{let e,t,n,r,i,s,o;return this.OR([{ALT:()=>e=this.CONSUME(pc.CONST)},{ALT:()=>{t=this.OPTION(()=>this.CONSUME(pc.CENTROID)),this.OR9([{ALT:()=>n=this.CONSUME(pc.IN)},{ALT:()=>r=this.CONSUME(pc.OUT)},{ALT:()=>s=this.CONSUME(pc.VARYING)},{ALT:()=>o=this.CONSUME(pc.ATTRIBUTE)}])}},{ALT:()=>i=this.CONSUME(pc.UNIFORM)}]),{kind:"storageQualifier",CONST:e,CENTROID:t,IN:n,OUT:r,VARYING:s,ATTRIBUTE:o,UNIFORM:i}}),this.typeQualifier=this.RR("typeQualifier",()=>{let e,t,n,r;return this.OR([{ALT:()=>e=this.SUBRULE(this.storageQualifier)},{ALT:()=>{t=this.SUBRULE1(this.layoutQualifier),e=this.OPTION1(()=>this.SUBRULE2(this.storageQualifier))}},{ALT:()=>{n=this.CONSUME(pc.INTERPOLATION_QUALIFIER),e=this.OPTION2(()=>this.SUBRULE3(this.storageQualifier))}},{ALT:()=>{r=this.CONSUME(pc.INVARIANT),n=this.OPTION3(()=>this.CONSUME1(pc.INTERPOLATION_QUALIFIER)),e=this.SUBRULE7(this.storageQualifier)}}]),{kind:"typeQualifier",storageQualifier:e,layoutQualifier:t,interpolationQualifier:n,invariantQualifier:r}}),this.precisionQualifier=this.RR("precisionQualifier",()=>this.CONSUME(pc.PRECISION_QUALIFIER)),this.arraySpecifier=this.RR("arraySpecifier",()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.OPTION3(()=>this.SUBRULE(this.constantExpression));return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arraySpecifier",size:e}}),this.typeSpecifierNonArray=this.RR("typeSpecifierNonArray",()=>this.OR([{ALT:()=>this.CONSUME(pc.BASIC_TYPE)},{ALT:()=>this.CONSUME(pc.VOID)},{ALT:()=>this.SUBRULE(this.structSpecifier)},{ALT:()=>this.CONSUME(pc.IDENTIFIER)}])),this.typeSpecifierNoPrec=this.RR("typeSpecifierNoPrec",()=>{const e=this.SUBRULE(this.typeSpecifierNonArray);return{kind:"typeSpecifier",precisionQualifier:void 0,arraySpecifier:this.OPTION1(()=>this.SUBRULE(this.arraySpecifier)),typeSpecifierNonArray:e}}),this.functionCall=this.RR("functionCall",()=>{const e=this.SUBRULE(this.typeSpecifierNoPrec);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({DEF:()=>t.push(this.SUBRULE(this.assignmentExpression)),SEP:pc.COMMA}),this.CONSUME(pc.RIGHT_PAREN),{kind:"functionCall",callee:e,args:t}}),this.functionCallHeader=this.RULE("functionCallHeader",()=>{this.SUBRULE(this.typeSpecifierNoPrec),this.CONSUME(pc.LEFT_PAREN)}),this.postfixExpression=this.RR("postfixExpression",()=>{const e=this.LA(1);let t=this.OR1([{GATE:this.BACKTRACK(this.functionCallHeader),ALT:()=>this.SUBRULE1(this.functionCall)},{ALT:()=>this.SUBRULE(this.primaryExpression)}]);return this.MANY(()=>{t=this.OR2([{ALT:()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arrayAccess",on:t,index:e}}},{ALT:()=>{this.CONSUME1(pc.DOT);const e=this.SUBRULE2(this.functionCall);return{kind:"methodCall",on:t,functionCall:e}}},{ALT:()=>{this.CONSUME2(pc.DOT);const e=this.CONSUME(pc.IDENTIFIER);return{kind:"fieldAccess",on:t,field:e}}},{ALT:()=>{const e=this.CONSUME(pc.POSTFIX_OP);return{kind:"postfixExpression",on:t,op:e}}}]),this.FINALIZE(t,e)}),t}),this.unaryExpression=this.RR("unaryExpression",()=>this.OR([{ALT:()=>this.SUBRULE1(this.postfixExpression)},{ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.UNARY_OP),on:this.SUBRULE2(this.unaryExpression)})}])),this.ppUnaryExpression=this.RR("ppUnaryExpression",()=>this.OR([{GATE:()=>this.LA(1).tokenType===pc.NON_PP_IDENTIFIER&&"defined"===this.LA(1).image,ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.IDENTIFIER),on:{kind:"variableExpression",var:this.OR1([{ALT:()=>this.SUBRULE(this.ppIdentifier)},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE1(this.ppIdentifier);return this.CONSUME(pc.RIGHT_PAREN),e}}])}})},{ALT:()=>({kind:"unaryExpression",op:this.OR2([{ALT:()=>this.CONSUME(pc.PLUS)},{ALT:()=>this.CONSUME(pc.DASH)},{ALT:()=>this.CONSUME(pc.TILDE)},{ALT:()=>this.CONSUME(pc.BANG)}]),on:this.SUBRULE2(this.ppUnaryExpression)})},{ALT:()=>this.SUBRULE(this.ppPrimaryExpression)}])),this.ppPrimaryExpression=this.RR("ppPrimaryExpression",()=>this.OR([{ALT:()=>({kind:"variableExpression",var:this.SUBRULE(this.ppIdentifier)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.INTCONSTANT)})},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.ppConstantExpression);return this.CONSUME(pc.RIGHT_PAREN),e}}])),this.ppConstantExpression=this.RR("ppConstantExpression",()=>{try{return this.preprocessing=!0,this.LEFT_ASSOC(this.logicalAndExpression,pc.OR_OP)}finally{this.preprocessing=!1}}),this.typeSpecifier=this.RR("typeSpecifier",()=>{const e=this.OPTION(()=>this.SUBRULE(this.precisionQualifier)),t=this.SUBRULE(this.typeSpecifierNoPrec);return Object.assign({},t,{precisionQualifier:e})}),this.parameterDeclaration=this.RR("parameterDeclaration",()=>{const e=this.OPTION(()=>this.CONSUME(pc.CONST)),t=this.OPTION1(()=>this.CONSUME(pc.PARAMETER_QUALIFIER)),n=this.SUBRULE(this.typeSpecifier);let r,i;return this.OPTION2(()=>{r=this.CONSUME2(pc.IDENTIFIER),i=this.OPTION3(()=>this.SUBRULE(this.arraySpecifier))}),{kind:"parameterDeclaration",parameterTypeQualifier:e,pName:r,arraySpecifier:i,parameterQualifier:t,typeSpecifier:n}}),this.fullySpecifiedType=this.RR("fullySpecifiedType",()=>({kind:"fullySpecifiedType",typeQualifier:this.OPTION(()=>this.SUBRULE(this.typeQualifier)),typeSpecifier:this.SUBRULE(this.typeSpecifier)})),this.structDeclaration=this.RR("structDeclaration",()=>{const e=this.SUBRULE(this.fullySpecifiedType),t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME(pc.IDENTIFIER),arraySpecifier:this.OPTION(()=>this.SUBRULE(this.arraySpecifier)),init:void 0};return t.push(e),e})}),this.CONSUME(pc.SEMICOLON),{kind:"structDeclaration",fsType:e,declarators:t}}),this.structSpecifier=this.RR("structSpecifier",()=>{this.CONSUME(pc.STRUCT);const e=this.OPTION2(()=>this.CONSUME(pc.IDENTIFIER));this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),{kind:"structSpecifier",name:e,declarations:t}}),this.initializer=this.RR("initializer",()=>this.SUBRULE(this.assignmentExpression)),this.singleDeclaration=this.RULE("singleDeclaration",()=>this.OR([{ALT:()=>{this.SUBRULE(this.fullySpecifiedType),this.OPTION1(()=>{this.CONSUME1(pc.IDENTIFIER),this.OPTION2(()=>{this.CONSUME(pc.LEFT_BRACKET),this.OPTION3(()=>this.SUBRULE(this.constantExpression)),this.CONSUME(pc.RIGHT_BRACKET)}),this.OPTION4(()=>{this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)})})}},{ALT:()=>({kind:"invariantDeclaration",INVARIANT:this.CONSUME(pc.INVARIANT),IDENTIFIER:this.CONSUME2(pc.IDENTIFIER)})}])),this.initDeclaratorList=this.RR("initDeclaratorList",()=>this.SUBRULE(this.externalDeclaration,{ARGS:[!1,!1]})),this.expressionStatement=this.RR("expressionStatement",()=>{const e=this.OPTION(()=>this.SUBRULE(this.expression));return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:e}}),this.condition=this.RR("condition",()=>this.OR({MAX_LOOKAHEAD:4,DEF:[{GATE:this.BACKTRACK(this.singleDeclaration),ALT:()=>{const e=this.SUBRULE2(this.fullySpecifiedType),t=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.EQUAL),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:[{kind:"declarator",name:t,init:this.SUBRULE3(this.initializer),arraySpecifier:void 0}]}}},{ALT:()=>this.SUBRULE(this.expression)}]})),this.caseLabel=this.RR("caseLabel",()=>this.OR([{ALT:()=>{this.CONSUME(pc.CASE);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.COLON),{kind:"caseLabel",case_:e}}},{ALT:()=>(this.CONSUME2(pc.DEFAULT),this.CONSUME2(pc.COLON),{kind:"caseLabel",case_:void 0})}])),this.selectionStatement=this.RR("selectionStatement",()=>{this.CONSUME(pc.IF),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),{kind:"selectionStatement",condition:e,yes:this.SUBRULE2(this.statement,{ARGS:[!0]}),no:this.OPTION(()=>(this.CONSUME(pc.ELSE),this.SUBRULE3(this.statement,{ARGS:[!0]})))}}),this.statement=this.RR("statement",e=>this.OR([{ALT:()=>this.SUBRULE(this.ppDirective),IGNORE_AMBIGUITIES:!0},{ALT:()=>{const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:{kind:"variableExpression",var:e}}},IGNORE_AMBIGUITIES:!0},{GATE:this.BACKTRACK(this.expressionStatement),ALT:()=>this.SUBRULE(this.expressionStatement)},{ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.selectionStatement)},{ALT:()=>this.SUBRULE(this.switchStatement)},{ALT:()=>this.SUBRULE(this.iterationStatement)},{ALT:()=>this.SUBRULE(this.jumpStatement)},{ALT:()=>this.SUBRULE(this.compoundStatement,{ARGS:[!!e]})}])),this.compoundStatement=this.RR("compoundStatement",e=>{if("object"==typeof e)throw new Error;this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.statement))),this.CONSUME(pc.RIGHT_BRACE),{kind:"compoundStatement",statements:t,newScope:!!e}}),this.iterationStatement=this.RR("iterationStatement",()=>this.OR([{ALT:()=>{this.CONSUME(pc.WHILE),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.condition);return this.CONSUME(pc.RIGHT_PAREN),{kind:"whileStatement",conditionExpression:e,statement:this.SUBRULE(this.statement)}}},{ALT:()=>{this.CONSUME2(pc.DO);const e=this.SUBRULE2(this.statement,{ARGS:[!0]});this.CONSUME2(pc.WHILE),this.CONSUME2(pc.LEFT_PAREN);const t=this.SUBRULE2(this.expression);return this.CONSUME2(pc.RIGHT_PAREN),this.CONSUME2(pc.SEMICOLON),{kind:"doWhileStatement",statement:e,conditionExpression:t}}},{ALT:()=>{this.CONSUME3(pc.FOR),this.CONSUME3(pc.LEFT_PAREN);const e=this.OR3([{GATE:this.BACKTRACK(this.initDeclaratorList),ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.expressionStatement)}]),t=this.OPTION3(()=>this.SUBRULE3(this.condition));this.CONSUME4(pc.SEMICOLON);const n=this.OPTION4(()=>this.SUBRULE4(this.expression));return this.CONSUME3(pc.RIGHT_PAREN),{kind:"forStatement",initExpression:e,conditionExpression:t,loopExpression:n,statement:this.SUBRULE3(this.statement)}}}])),this.translationUnit=this.RR("translationUnit",()=>{const e=[];return this.AT_LEAST_ONE(()=>e.push(this.SUBRULE(this.externalDeclaration,{ARGS:[!0,!0]}))),{kind:"translationUnit",declarations:e}}),this.uniformBlock=this.RR("uniformBlock",()=>{const e=this.SUBRULE(this.typeQualifier),t=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_BRACE);const n=[];let r,i;return this.MANY(()=>n.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),this.OPTION(()=>{r=this.CONSUME1(pc.IDENTIFIER),i=this.OPTION1(()=>this.SUBRULE(this.arraySpecifier))}),this.CONSUME(pc.SEMICOLON),{kind:"uniformBlock",typeQualifier:e,blockName:t,declarations:n,namespace:r,arraySpecifier:i}}),this.uniformBlockHeader=this.RULE("uniformBlockHeader",()=>{this.OPTION(()=>this.SUBRULE(this.layoutQualifier)),this.CONSUME(pc.UNIFORM),this.CONSUME(pc.IDENTIFIER),this.CONSUME(pc.LEFT_BRACE)}),this.typeQualifierDeclaration=this.RR("typeQualifierDeclaration",()=>{const e=this.SUBRULE(this.typeQualifier);return this.CONSUME(pc.SEMICOLON),{kind:"typeQualifierDeclaration",typeQualifier:e}}),this.externalDeclaration=this.RR("externalDeclaration",(e,t)=>this.OR([{ALT:()=>this.SUBRULE(this.ppCall)},{ALT:()=>this.SUBRULE(this.ppDirective)},{GATE:this.BACKTRACK(this.typeQualifierDeclaration),ALT:()=>this.SUBRULE(this.typeQualifierDeclaration)},{GATE:e?this.BACKTRACK(this.uniformBlockHeader):()=>!1,ALT:()=>this.SUBRULE(this.uniformBlock)},{ALT:()=>{const e=this.SUBRULE(this.fullySpecifiedType);return this.OR2([{GATE:t?void 0:()=>!1,ALT:()=>{const t=this.CONSUME1(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const n=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>n.push(this.SUBRULE(this.parameterDeclaration))}),this.CONSUME(pc.RIGHT_PAREN),this.OR3([{ALT:()=>(this.CONSUME(pc.SEMICOLON),{kind:"functionPrototype",name:t,returnType:e,params:n})},{ALT:()=>{const r=this.SUBRULE(this.compoundStatement);return{kind:"functionDefinition",name:t,returnType:e,params:n,body:r}},IGNORE_AMBIGUITIES:!1}])}},{ALT:()=>{const t=[];return this.MANY_SEP2({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME3(pc.IDENTIFIER),arraySpecifier:this.OPTION5(()=>this.SUBRULE(this.arraySpecifier)),init:this.OPTION7(()=>(this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)))};return t.push(e),e})}),this.CONSUME2(pc.SEMICOLON),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:t}}}])}},{ALT:()=>{this.CONSUME(pc.PRECISION);const e=this.CONSUME(pc.PRECISION_QUALIFIER),t=this.SUBRULE(this.typeSpecifierNoPrec);return this.CONSUME3(pc.SEMICOLON),{kind:"precisionDeclaration",precisionQualifier:e,typeSpecifierNoPrec:t}}}])),this.ppDefine=this.RR("ppDefine",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.DEFINE);const e=this.CONSUME(pc.IDENTIFIER),t=this.LA(1).tokenType===pc.LEFT_PAREN&&e.endOffset+1===this.LA(1).startOffset,n={kind:"ppDefine",what:e,params:this.OPTION({GATE:()=>t,DEF:()=>{this.CONSUME(pc.LEFT_PAREN);const e=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>e.push(this.SUBRULE(this.ppIdentifier))}),this.CONSUME(pc.RIGHT_PAREN),e}}),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(n),n}),this.ppInclude=this.RR("ppInclude",()=>{let e="";return this.OR([{ALT:()=>{const t=this.CONSUME(pc.HASH_INCLUDE_MODULE);e=t.image.substring(t.image.indexOf("<"))}},{ALT:()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.INCLUDE),e=this.CONSUME(pc.STRING).image}}]),{kind:"ppInclude",what:e}}),this.ppCall=this.RR("ppCall",()=>{const e=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>{const e=[];this.MANY(()=>this.OR({DEF:[{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>e.push(this.CONSUME(pc.BASIC_TYPE))},{ALT:()=>e.push(this.CONSUME(pc.ASSIGN_OP))},{ALT:()=>e.push(this.CONSUME(pc.SHIFT_OP))},{ALT:()=>e.push(this.CONSUME(pc.CONSTANT))},{ALT:()=>e.push(this.CONSUME(pc.KEYWORD))},{ALT:()=>e.push(this.CONSUME2(pc.IDENTIFIER))}]})),t.push({tokens:e,node:void 0})},MAX_LOOKAHEAD:1}),this.CONSUME(pc.RIGHT_PAREN),{kind:"ppCall",callee:e,args:t}}),this.ppCallArg=this.RULE("ppCallArg",()=>{const e=[];return e.push(this.CONSUME(pc.LEFT_PAREN)),this.MANY(()=>this.OR([{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>(e.push(this.LA(1)),this.SKIP_TOKEN())}])),e.push(this.CONSUME(pc.RIGHT_PAREN)),e}),this.ppNone=this.RR("ppNone",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.ELSE)},{ALT:()=>this.CONSUME(pc.ENDIF)}]),tokens:[],node:void 0};return this.ppDefs.push(e),e}),this.ppMulti=this.RR("ppMulti",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IF)},{ALT:()=>this.CONSUME(pc.ELIF)},{ALT:()=>this.CONSUME(pc.ERROR)},{ALT:()=>this.CONSUME(pc.VERSION)},{ALT:()=>this.CONSUME(pc.LINE)}]),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(e),e}),this.ppPragma=this.RR("ppPragma",()=>({kind:"ppPragma",dir:this.CONSUME(pc.PRAGMA_DIRECTIVE)})),this.ppSingle=this.RR("ppSingle",()=>(this.CONSUME(pc.HASH),{kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IFDEF)},{ALT:()=>this.CONSUME(pc.IFNDEF)}]),tokens:[this.CONSUME(pc.IDENTIFIER)],node:void 0})),this.ppExtension=this.RR("ppExtension",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.EXTENSION);const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.COLON),{kind:"ppExtension",extension:e,behavior:this.CONSUME1(pc.IDENTIFIER)}}),this.ppDirective=this.RR("ppDirective",()=>this.OR([{ALT:()=>this.SUBRULE(this.ppDefine)},{ALT:()=>this.SUBRULE(this.ppExtension)},{ALT:()=>this.SUBRULE(this.ppNone)},{ALT:()=>this.SUBRULE(this.ppSingle)},{ALT:()=>this.SUBRULE(this.ppMulti)},{ALT:()=>this.SUBRULE(this.ppPragma)},{ALT:()=>this.SUBRULE(this.ppInclude)}])),this.ppIdentifier=this.RR("ppIdentifier",()=>this.OR([{ALT:()=>this.CONSUME(pc.IDENTIFIER)},{ALT:()=>this.CONSUME(pc.KEYWORD)},{ALT:()=>this.CONSUME(pc.BASIC_TYPE)}])),this.ppDefs=[],this.performSelfAnalysis()}reset(){super.reset(),this.ppDefs=[],this.backtracking=!1,this.preprocessing=!1}LEFT_ASSOC(e,t){const n=this.LA(1);let r=this.SUBRULE1(e);return this.MANY(()=>{const i=this.CONSUME(t),s=this.SUBRULE2(e);return r={kind:"binaryExpression",lhs:r,rhs:s,op:i,firstToken:n,lastToken:this.LA(0)},r}),r}ANNOTATE(e){return(...t)=>{const n=this.LA(1),r=e(...t);return r&&hc(r)&&!r.firstToken&&this.FINALIZE(r,n),r}}BACKTRACK(e,t){const n=super.BACKTRACK(e,t);return function(){try{return this.backtracking=!0,n.call(this)}finally{this.backtracking=!1}}}RR(e,t,n){return super.RULE(e,this.ANNOTATE(t),n)}FINALIZE(e,t){this.RECORDING_PHASE||this.backtracking||(e.firstToken=t,e.lastToken=this.LA(0))}isAtEof(){return this.LA(1).tokenType===Ml}};const{ll:{printDocToString:vc},LX:{indentIfBreak:Cc,group:Dc,indent:Sc,join:Ac,line:_c,softline:yc,hardline:bc,fill:Tc,lineSuffixBoundary:Rc}}=r,xc=new class extends uc{constructor(){super(...arguments),this.result=void 0}visit(e){if(!this.result){const t=this.result=[];return super.visit(e),this.result=void 0,t}e&&this.result.push(e)}};function wc(e){return(cc(e)?e:e.lastToken).endOffset+1}const Fc={"glsl-parser":{parse(e,t){const n=function(e){const t=function(e){const t=[];let n="",r=0,i=0;return{result:e.replace(/\\(\r\n|\n\r|\r|\n)(.*?)(?:(?=\\?[\r\n])|$)/g,(s,o,a,l)=>{r++,i+=function(e,t){let n=t;for(;n>=0&&"\r"!==e[n]&&"\n"!==e[n];)n--;return t-n-1}(e,l),t.push({originalOffset:l+1+o.length,newOffset:l-n.length,length:a.length,lineDiff:-r,columnDiff:i}),n+=" "+o;let u="";return e.length>l+s.length&&"\\"===e[l+s.length]||(u=n,n="",r=0,i=0),a+u}),changes:t}}(e),n=gc.tokenize(t.result);!function(e,t){if(t.errors.length)throw new Error("LEXER ERROR: "+t.errors.map(t=>t.message+":\n"+dc(e,{startLine:t.line,startColumn:t.column,endLine:t.line,endColumn:t.column+t.length})).join())}(t.result,n),function(e,t){let n=0;function r(e,t){const n=t.originalOffset-t.newOffset;e.startOffset>=t.newOffset&&(e.lineNoCont=e.startLine,e.startOffset+=n,e.startLine-=t.lineDiff,e.startColumn-=t.columnDiff),e.endOffset+=n,e.endLine-=t.lineDiff,e.endColumn-=t.columnDiff}for(const i of t){for(;e[n]&&e[n].endOffset0)throw new Error("PARSE ERROR: "+t.map(t=>t.message+"\n"+t.context.ruleStack.join(" > ")+"\n"+dc(e,t.token)).join("\n"))}(t.result,Ec.errors);const i=Ec.ppDefs;function s(e,t){Ec.input=e;const n=t(Ec);return Ec.isAtEof()&&0===Ec.errors.length?n:void 0}for(const e of i)e.node=s(e.tokens,e=>e.externalDeclaration(!0,!0))??s(e.tokens,e=>e.statement())??s(e.tokens,e=>e.expression());return r.comments=n.groups.COMMENTS,r}(e);return n.comments?.forEach(e=>e.value=JSON.stringify(e)),n},astFormat:"glsl-ast",locStart:function(e){return(cc(e)?e:e.firstToken).startOffset},locEnd:wc}};function Nc(e){switch(e){case pc.STAR:case pc.SLASH:case pc.PERCENT:return 4;case pc.PLUS:case pc.DASH:return 5;case pc.LEFT_OP:case pc.RIGHT_OP:return 6;case pc.LEFT_ANGLE:case pc.RIGHT_ANGLE:case pc.LE_OP:case pc.GE_OP:return 7;case pc.EQ_OP:case pc.NE_OP:return 8;case pc.AMPERSAND:return 9;case pc.CARET:return 10;case pc.VERTICAL_BAR:return 11;case pc.AND_OP:case pc.XOR_OP:return 12;case pc.OR_OP:return 13;case pc.COMMA:return 17;default:throw new Error}}function Lc(e,t){switch(e.kind){default:return 1;case"variableExpression":return t?.find(t=>t.image===e.var.image)?18:1;case"arrayAccess":case"functionCall":case"fieldAccess":case"postfixExpression":return 2;case"unaryExpression":return 3;case"binaryExpression":return Nc(e.op.tokenType);case"conditionalExpression":return 15;case"assignmentExpression":return 16;case"commaExpression":return 17}}function Oc(e,t){return t?["(",e,")"]:e}function Ic(e,t,n,r){const i="binaryExpression"===n.kind&&"binaryExpression"===n.lhs.kind&&Nc(n.lhs.op.tokenType)===Nc(n.op.tokenType)||"commaExpression"===n.kind&&"commaExpression"===n.lhs.kind,s="binaryExpression"===n.kind?n.op.tokenType:pc.COMMA;let o;return i?(o=e.call(e=>Ic(e,t,e.getValue(),r),"lhs"),o.push("commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))),o):[Oc(e.call(t,"lhs"),Lc(n.lhs,r)>Nc(s)),"commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))]}function kc(e,t,n){return"expressionStatement"!==e.kind||e.expression?"compoundStatement"===e.kind||n?[" ",t]:Sc([_c,t]):";"}function Mc(e,t){return vc(e,Object.assign({},t,{printWidth:t.printWidth-2})).formatted.trim().replace(/^.*(?=[\r\n])/gm,e=>e+" ".repeat(t.printWidth-2-e.length+1)+"\\")}function Pc(e){return"assignmentExpression"===e.kind}function Bc(e){return"assignmentExpression"===e.kind||"declarator"===e.kind}function Uc(e,t,n,r,i,s){const o=function(e,t,n){if(!n)return"only-left";const r=!Pc(n);return e.match(Pc,Bc,e=>!r||"expressionStatement"!==e.kind&&"initDeclaratorListDeclaration"!==e.kind)?r?"chain-tail":"chain":!r&&Pc(n.rhs)||(t.originalText,0)||"binaryExpression"===n.kind||"commaExpression"===n.kind||"conditionalExpression"===n.kind&&"binaryExpression"===n.condition.kind?"break-after-operator":"constantExpression"===n.kind?"never-break-after-operator":"fluid"}(e,t,s);switch(o){case"break-after-operator":return Dc([Dc(n),r,Dc(Sc([_c,i]))]);case"never-break-after-operator":return Dc([Dc(n),r," ",i]);case"fluid":{const e=Symbol("assignment");return Dc([Dc(n),r,Dc(Sc(_c),{id:e}),Rc,Cc(i,{groupId:e})])}case"chain":return[Dc(n),r,_c,i];case"chain-tail":return[Dc(n),r,Sc([_c,i])];case"only-left":return n;default:throw new Error}}const $c={"glsl-ast":{print(e,t,n){const r=t.inMacro,i=e.getValue();if(!i)return[];if(cc(i))return i.image;const s=t=>e.call(n,t);try{switch(i.kind){case"translationUnit":{const r=[];return e.each((e,i)=>{const s=e.getValue();r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc),r.push(bc)},"declarations"),r}case"precisionDeclaration":return["precision ",i.precisionQualifier.image," ",e.call(n,"typeSpecifierNoPrec"),";"];case"fullySpecifiedType":{const e=[];return i.typeQualifier&&e.push(s("typeQualifier")," "),e.push(s("typeSpecifier")),e}case"typeSpecifier":{const e=[];return i.precisionQualifier&&e.push(i.precisionQualifier.image," "),e.push(s("typeSpecifierNonArray")),i.arraySpecifier&&e.push(s("arraySpecifier")),e}case"typeQualifier":{const e=[];return i.invariantQualifier&&e.push("invariant"),i.interpolationQualifier&&e.push(i.interpolationQualifier.image),i.layoutQualifier&&e.push(s("layoutQualifier")),i.storageQualifier&&e.push(s("storageQualifier")),Ac(" ",e)}case"storageQualifier":{const t=[];return i.CONST&&t.push("const"),i.CENTROID&&e.getParentNode().interpolationQualifier?.tokenType!==pc.FLAT&&t.push("centroid"),i.IN&&t.push("in"),i.OUT&&t.push("out"),i.VARYING&&t.push("varying"),i.ATTRIBUTE&&t.push("attribute"),i.UNIFORM&&t.push("uniform"),Ac(" ",t)}case"functionPrototype":case"functionDefinition":return[Dc([s("returnType")," ",s("name"),"(",Sc([yc,Ac([",",_c],e.map(n,"params"))]),yc,")"]),"functionPrototype"===i.kind?";":[" ",s("body")]];case"parameterDeclaration":return[i.parameterTypeQualifier?[s("parameterTypeQualifier")," "]:"",i.parameterQualifier?.tokenType===pc.OUT||i.parameterQualifier?.tokenType===pc.INOUT?i.parameterQualifier?.image+" ":"",s("typeSpecifier")," ",s("pName"),s("arraySpecifier")];case"initDeclaratorListDeclaration":case"structDeclaration":{const t=e.map(n,"declarators"),r="forStatement"===e.getParentNode().kind,o=i.declarators.some(e=>e.init);return Dc([s("fsType"),0===t.length?"":" ",1===t.length?t:Dc(Sc(Ac([",",o&&!r?bc:_c],t))),";"])}case"declarator":{const n=s("arraySpecifier"),r=[i.name.image,n];return Uc(e,t,r," =",s("init"),i.init)}case"arraySpecifier":return Dc(["[",Sc([yc,s("size")]),yc,"]"]);case"arrayAccess":return[Oc(s("on"),Lc(i.on,r)>2),"[",s("index"),"]"];case"structSpecifier":{const r=[];return e.each((e,i,s)=>{const o=e.getValue();r.push(bc),r.push(n(e)),i!==s.length-1&&_s.isNextLineEmpty(t.originalText,o,wc)&&r.push(bc)},"declarations"),Dc(["struct",i.name?" "+i.name.image:""," {",Sc(r),bc,"}"])}case"compoundStatement":{const r=[],s=!!i.comments?.some(e=>!e.leading&&!e.trailing&&!e.printed);return e.each((e,i)=>{const s=e.getValue();0!==i&&r.push(bc),r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc)},"statements"),s&&e.each(e=>{const t=e.getValue();t.leading||t.trailing||(r.push(n(e)),t.printed=!0)},"comments"),Dc(["{",r.length?[Sc([bc,r]),bc]:"","}"])}case"returnStatement":return i.what?["return"," ",s("what"),";"]:"return;";case"breakStatement":return"break;";case"continueStatement":return"continue;";case"discardStatement":return"discard;";case"selectionStatement":{const e=[],t=kc(i.yes,s("yes"),!1),n=Dc(["if (",Dc([Sc([yc,s("condition")]),yc]),")",t]);if(e.push(n),i.no){const t=i.yes.comments?.some(e=>e.trailing&&e.tokenType===pc.LINE_COMMENT)||i.yes.comments?.findLast(e=>!e.leading&&!e.trailing)?.tokenType===pc.LINE_COMMENT,n="compoundStatement"===i.yes.kind&&!t;e.push(n?" ":bc),e.push("else",Dc(kc(i.no,s("no"),"selectionStatement"===i.no.kind)))}return e}case"forStatement":{const e=kc(i.statement,s("statement"),!1),t=!1,n=t?[t,yc]:"";return"expressionStatement"!==i.initExpression.kind||i.initExpression.expression||i.conditionExpression||i.loopExpression?[n,Dc(["for (",Dc([Sc([yc,s("initExpression"),_c,s("conditionExpression"),";",_c,s("loopExpression")]),yc]),")",e])]:[n,Dc(["for (;;)",e])]}case"whileStatement":{const e=kc(i.statement,s("statement"),!1);return["while (",Dc(s("conditionExpression")),")",e]}case"doWhileStatement":return["do ",s("statement")," while (",Dc(s("conditionExpression")),");"];case"functionCall":return function(t){const r=e.map(n,"args");let i,o;if(void 0===t.callee.arraySpecifier&&cc(t.callee.typeSpecifierNonArray)&&void 0!==(i=function(e){switch(e){case pc.MAT2X2:return[2,2];case pc.MAT2X3:return[2,3];case pc.MAT2X4:return[2,4];case pc.MAT3X2:return[3,2];case pc.MAT3X3:return[3,3];case pc.MAT3X4:return[3,4];case pc.MAT4X2:return[4,2];case pc.MAT4X3:return[4,3];case pc.MAT4X4:return[4,4];default:return}}(t.callee.typeSpecifierNonArray.tokenType))&&i[0]*i[1]===t.args.length){const e=t.args.every(e=>"constantExpression"===e.kind&&(e.const_.tokenType===pc.FLOATCONSTANT||e.const_.tokenType===pc.INTCONSTANT)||"unaryExpression"===e.kind&&(e.op.tokenType===pc.PLUS||e.op.tokenType===pc.DASH)&&"constantExpression"===e.on.kind&&(e.on.const_.tokenType===pc.FLOATCONSTANT||e.on.const_.tokenType===pc.INTCONSTANT));if(e){const e=[],n=[];let s=0,a=0;for(let i=0;i2),".",s("functionCall")];case"postfixExpression":return[Oc(s("on"),Lc(i.on,r)>2),s("op")];case"unaryExpression":return[s("op"),Oc(s("on"),Lc(i.on,r)>3)];case"assignmentExpression":{const n=s("lhs");return Uc(e,t,n," "+i.op.image,s("rhs"),i.rhs)}case"conditionalExpression":return[Oc(s("condition"),Lc(i.condition,r)>=15),Sc([_c,"? ",s("yes"),_c,": ",s("no")])];case"commaExpression":case"binaryExpression":{const t=Ic(e,n,i,r),s=e.getParentNode();if("selectionStatement"===s.kind||"whileStatement"===s.kind||"switchStatement"===s.kind||"doWhileStatement"===s.kind)return t;const o=()=>{const t=e.getParentNode();return!!t&&("functionCall"===t.kind&&"commaExpression"===i.kind||"binaryExpression"===t.kind&&((n=t.op.tokenType)===pc.CARET||n===pc.VERTICAL_BAR||n===pc.AMPERSAND));var n},a=e.getParentNode(1);if("returnStatement"===s.kind||"forStatement"===s.kind||"conditionalExpression"===s.kind&&"returnStatement"!==a.kind&&"functionCall"!==a.kind||"assignmentExpression"===s.kind||"declarator"===s.kind)return Dc(t);{const e=t.slice(0,1),n=t.slice(e.length);return Dc(Oc([...e,Sc(n)],o()))}}case"expressionStatement":return[s("expression"),";"];case"fieldAccess":return[Oc(s("on"),Lc(i.on,r)>2),".",s("field")];case"constantExpression":{const e=i.const_;return e.tokenType===pc.FLOATCONSTANT?function(e){const t=e.indexOf(".");return 0===t&&(e="0"+e),e=e.replace("E","e"),-1!==t&&(e=(e=(e=(e=e.replace(".e","e")).replace(/(?=4):Tc(Ac(_c,e.map(n,"tokens")))])]);return t.inMacro=void 0,Mc(r,t)}case"ppDir":return Mc(Dc(["#",i.dir.image," ",Sc(i.node?s("node"):Tc(Ac(_c,e.map(n,"tokens"))))]),t);case"ppPragma":return i.dir.image.replace(/^#\s+/,"#").replace(/^#pragma\s{2,}/,"#pragma ");case"ppCall":return Dc([i.callee.image,"(",Ac([",",_c],e.map((e,t,n)=>n[t].tokens.map(e=>e.image),"args")),")"]);case"ppInclude":return["#include ",i.what];case"ppExtension":return["#extension ",i.extension.image," : ",i.behavior.image];case"switchStatement":return["switch (",Dc([Sc([yc,s("initExpression")]),yc]),") {",i.cases.length?Sc([bc,Ac(bc,e.map(n,"cases"))]):"",bc,"}"];case"caseBlock":{const r=s("caseLabel"),i=[];return e.each((e,r)=>{const s=e.getValue();i.push(bc),i.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&i.push(bc)},"statements"),[r,Sc(i)]}case"caseLabel":return void 0===i.case_?"default:":["case ",s("case_"),":"];case"layoutQualifier":return["layout(",Ac(", ",i.layoutQualifierIds.map(e=>void 0===e.init?e.IDENTIFIER.image:[e.IDENTIFIER.image," = ",e.init.image])),")"];case"uniformBlock":return[s("typeQualifier")," ",i.blockName.image," {",Sc([bc,Ac(bc,e.map(n,"declarations"))]),bc,"};"];case"typeQualifierDeclaration":return[s("typeQualifier"),";"];default:throw new Error("unexpected n type "+i.kind+"\n"+JSON.stringify(i).substring(0,100))}}catch(e){throw console.error("error printing "+JSON.stringify(i).substring(0,100)+"\n"),e}},embed(e,t){const n=e.getValue();return!cc(n)||n.tokenType!==pc.LINE_COMMENT&&n.tokenType!==pc.MULTILINE_COMMENT?null:(e,t,n,r)=>{}},getVisitorKeys:(e,t)=>cc(e)?[]:Object.keys(e).filter(e=>!t.has(e)),getCommentChildNodes:e=>cc(e)?[]:xc.visit(e),canAttachComment:e=>!0,printComment:function(e,t){const n=e.getValue();return n.tokenType===pc.MULTILINE_COMMENT&&"*"===n.image[2]?"/**\n"+n.image.substring(3,n.image.length-2).split("\n").map(e=>" *"===e?"":e.startsWith(" * ")?e.substring(3):e).join("\n").trim().split("\n").map(e=>""===e?" *":" * "+e).join("\n")+"\n */":n.image},hasPrettierIgnore(e){const t=e.getValue();return(t&&hc(t)&&t.comments?.some(e=>/\/\/\s*prettier-ignore\b.*/.test(e.image)))??!1}}},Gc={parsers:Fc,printers:$c};function Vc(e){return e.replace(/^([^\n]*;)\n(?=(?:[A-Za-z_]\w*\s+)+[A-Za-z_]\w*\s*\()/gm,"$1\n\n").replace(/^}\n(?=\S)/gm,"}\n\n")}var Wc,Hc,jc=(Wc={program:function(e){return jc(e.program)+jc(e.wsEnd)},segment:function(e){return jc(e.blocks)},text:function(e){return jc(e.text)},literal:function(e){return jc(e.wsStart)+jc(e.literal)+jc(e.wsEnd)},identifier:function(e){return jc(e.identifier)+jc(e.wsEnd)},binary:function(e){return jc(e.left)+jc(e.operator)+jc(e.right)},group:function(e){return jc(e.lp)+jc(e.expression)+jc(e.rp)},unary:function(e){return jc(e.operator)+jc(e.expression)},unary_defined:function(e){return jc(e.operator)+jc(e.lp)+jc(e.identifier)+jc(e.rp)},int_constant:function(e){return jc(e.token)+jc(e.wsEnd)},elseif:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},if:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},ifdef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},ifndef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},else:function(e){return jc(e.token)+jc(e.wsEnd)+jc(e.body)},error:function(e){return jc(e.error)+jc(e.message)+jc(e.wsEnd)},undef:function(e){return jc(e.undef)+jc(e.identifier)+jc(e.wsEnd)},define:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.body)+jc(e.wsEnd)},define_arguments:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.lp)+jc(e.args)+jc(e.rp)+jc(e.body)+jc(e.wsEnd)},conditional:function(e){return jc(e.wsStart)+jc(e.ifPart)+jc(e.elseIfParts)+jc(e.elsePart)+jc(e.endif)+jc(e.wsEnd)},version:function(e){return jc(e.version)+jc(e.value)+jc(e.profile)+jc(e.wsEnd)},pragma:function(e){return jc(e.pragma)+jc(e.body)+jc(e.wsEnd)},line:function(e){return jc(e.line)+jc(e.value)+jc(e.wsEnd)},extension:function(e){return jc(e.extension)+jc(e.name)+jc(e.colon)+jc(e.behavior)+jc(e.wsEnd)}},Hc=function(e){return"string"==typeof e?e:null==e?"":Array.isArray(e)?e.map(Hc).join(""):e.type in Wc?Wc[e.type](e):"NO GENERATOR FOR ".concat(e.type)+e});const zc=jc;function Xc(e,t,n,r){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Xc.prototype),i.expected=t,i.found=n,i.location=r,i.name="SyntaxError",i}function Kc(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}function Yc(e,t){var n,r={},i=(t=void 0!==t?t:{}).grammarSource,s={program:An,constant_expression:hr},o=An,a="<<",l=">>",u="<=",c=">=",h="==",d="!=",f="&&",p="||",m="(",g=")",E=",",v="!",C="-",D="~",S="+",A="*",_="/",y="%",b="<",T=">",R="|",x="^",w="&",F=":",N="#",L="define",O="line",I="undef",k="error",M="pragma",P="defined",B="if",U="ifdef",$="ifndef",G="elif",V="else",W="endif",H="version",j="extension",z="0",X="//",K="/*",Y="*/",q=/^[A-Za-z_]/,Q=/^[A-Za-z_0-9]/,Z=/^[uU]/,J=/^[1-9]/,ee=/^[0-7]/,te=/^[xX]/,ne=/^[0-9a-fA-F]/,re=/^[0-9]/,ie=/^[\n\r]/,se=/^[^\n\r]/,oe=/^[ \t]/,ae=gn("<<",!1),le=gn(">>",!1),ue=gn("<=",!1),ce=gn(">=",!1),he=gn("==",!1),de=gn("!=",!1),fe=gn("&&",!1),pe=gn("||",!1),me=gn("(",!1),ge=gn(")",!1),Ee=gn(",",!1),ve=gn("!",!1),Ce=gn("-",!1),De=gn("~",!1),Se=gn("+",!1),Ae=gn("*",!1),_e=gn("/",!1),ye=gn("%",!1),be=gn("<",!1),Te=gn(">",!1),Re=gn("|",!1),xe=gn("^",!1),we=gn("&",!1),Fe=gn(":",!1),Ne=gn("#",!1),Le=gn("define",!1),Oe=(gn("include",!1),gn("line",!1)),Ie=gn("undef",!1),ke=gn("error",!1),Me=gn("pragma",!1),Pe=gn("defined",!1),Be=gn("if",!1),Ue=gn("ifdef",!1),$e=gn("ifndef",!1),Ge=gn("elif",!1),Ve=gn("else",!1),We=gn("endif",!1),He=gn("version",!1),je=gn("extension",!1),ze=En([["A","Z"],["a","z"],"_"],!1,!1),Xe=En([["A","Z"],["a","z"],"_",["0","9"]],!1,!1),Ke=vn("number"),Ye=En(["u","U"],!1,!1),qe=En([["1","9"]],!1,!1),Qe=gn("0",!1),Ze=En([["0","7"]],!1,!1),Je=En(["x","X"],!1,!1),et=En([["0","9"],["a","f"],["A","F"]],!1,!1),tt=En([["0","9"]],!1,!1),nt=vn("control line"),rt=En(["\n","\r"],!1,!1),it=vn("token string"),st=En(["\n","\r"],!0,!1),ot=vn("text"),at=vn("if"),lt=vn("primary expression"),ut=vn("unary expression"),ct=vn("multiplicative expression"),ht=vn("additive expression"),dt=vn("shift expression"),ft=vn("relational expression"),pt=vn("equality expression"),mt=vn("and expression"),gt=vn("exclusive or expression"),Et=vn("inclusive or expression"),vt=vn("logical and expression"),Ct=vn("logical or expression"),Dt=vn("constant expression"),St=vn("whitespace or comment"),At=gn("//",!1),_t=gn("/*",!1),yt=gn("*/",!1),bt={type:"any"},Tt=vn("whitespace"),Rt=En([" ","\t"],!1,!1),xt=function(e,t){return gr("program",{program:e.blocks,wsEnd:t})},wt=function(e,t){return gr("int_constant",{token:e,wsEnd:t})},Ft=function(e,t){return gr("literal",{literal:e,wsEnd:t})},Nt=function(e){return"#"},Lt=function(e,t,n){return gr("literal",{literal:t,wsStart:e,wsEnd:n})},Ot=function(e,t){return gr("identifier",{identifier:e,wsEnd:t})},It=function(e){return gr("identifier",{identifier:e})},kt=function(e){return gr("text",{text:e.join("")})},Mt=function(e){return gr("segment",{blocks:e})},Pt=function(e,t,n,r,i){return[r,...i.flat()]},Bt=function(e,t,n,r,i,s){return gr("define_arguments",{define:e,identifier:t,lp:n,args:r||[],rp:i,body:s})},Ut=function(e,t,n){return gr("define",{define:e,identifier:t,body:n})},$t=function(e,t){return gr("line",{line:e,value:t})},Gt=function(e,t){return gr("undef",{undef:e,identifier:t})},Vt=function(e,t){return gr("error",{error:e,message:t})},Wt=function(e,t){return gr("pragma",{pragma:e,body:t})},Ht=function(e,t,n){return gr("version",{version:e,value:t,profile:n})},jt=function(e,t,n,r){return gr("extension",{extension:e,name:t,colon:n,behavior:r})},zt=function(e,t){return{...e,wsEnd:t}},Xt=function(e,t,n){return{...e,body:n,wsEnd:t}},Kt=function(e,t,n,r,i){return gr("elseif",{token:t,expression:n,wsEnd:r,body:i})},Yt=function(e,t,n,r,i){return gr("else",{token:n,wsEnd:r,body:i})},qt=function(e,t,n,r,i){return gr("conditional",{ifPart:e,elseIfParts:t,elsePart:n,endif:r,wsEnd:i})},Qt=function(e,t){return gr("ifdef",{token:e,identifier:t})},Zt=function(e,t){return gr("ifndef",{token:e,identifier:t})},Jt=function(e,t){return gr("if",{token:e,expression:t})},en=function(e,t,n){return gr("group",{lp:e,expression:t,rp:n})},tn=function(e,t,n,r){return gr("unary_defined",{operator:e,lp:t,identifier:n,rp:r})},nn=function(e,t){return gr("unary",{operator:e,expression:t})},rn=function(e,t){return Cr(e,t)},sn=function(e,t){return vr(e,t)},on=function(e,t,n){return Er(t,n)},an=function(e,t){return Er(e,t.flat())},ln=function(e){return e},un=function(e){return e},cn=0,hn=[{line:1,column:1}],dn=0,fn=[],pn=0,mn={};if("startRule"in t){if(!(t.startRule in s))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=s[t.startRule]}function gn(e,t){return{type:"literal",text:e,ignoreCase:t}}function En(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function vn(e){return{type:"other",description:e}}function Cn(t){var n,r=hn[t];if(r)return r;for(n=t-1;!hn[n];)n--;for(r={line:(r=hn[n]).line,column:r.column};ndn&&(dn=cn,fn=[]),fn.push(e))}function An(){var e,t,n,i=75*cn+0,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Qn())!==r?(n=dr(),e=xt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}function _n(){var t,n,i,s=75*cn+2,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===a?(n=a,cn+=2):(n=r,0===pn&&Sn(ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function yn(){var t,n,i,s=75*cn+3,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===l?(n=l,cn+=2):(n=r,0===pn&&Sn(le)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function bn(){var t,n,i,s=75*cn+4,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===u?(n=u,cn+=2):(n=r,0===pn&&Sn(ue)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Tn(){var t,n,i,s=75*cn+5,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===c?(n=c,cn+=2):(n=r,0===pn&&Sn(ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Rn(){var t,n,i,s=75*cn+6,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===h?(n=h,cn+=2):(n=r,0===pn&&Sn(he)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function xn(){var t,n,i,s=75*cn+7,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===d?(n=d,cn+=2):(n=r,0===pn&&Sn(de)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function wn(){var t,n,i,s=75*cn+8,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===f?(n=f,cn+=2):(n=r,0===pn&&Sn(fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Fn(){var t,n,i,s=75*cn+9,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===p?(n=p,cn+=2):(n=r,0===pn&&Sn(pe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Nn(){var t,n,i,s=75*cn+10,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,40===e.charCodeAt(cn)?(n=m,cn++):(n=r,0===pn&&Sn(me)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Ln(){var t,n,i,s=75*cn+11,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,41===e.charCodeAt(cn)?(n=g,cn++):(n=r,0===pn&&Sn(ge)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function On(){var t,n,i,s=75*cn+12,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,44===e.charCodeAt(cn)?(n=E,cn++):(n=r,0===pn&&Sn(Ee)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function In(){var t,n,i,s=75*cn+14,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,45===e.charCodeAt(cn)?(n=C,cn++):(n=r,0===pn&&Sn(Ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function kn(){var t,n,i,s=75*cn+16,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,43===e.charCodeAt(cn)?(n=S,cn++):(n=r,0===pn&&Sn(Se)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Mn(){var t,n,i,s=75*cn+17,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,42===e.charCodeAt(cn)?(n=A,cn++):(n=r,0===pn&&Sn(Ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Pn(){var t,n,i,s=75*cn+18,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,47===e.charCodeAt(cn)?(n=_,cn++):(n=r,0===pn&&Sn(_e)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Bn(){var t,n,i,s=75*cn+19,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,37===e.charCodeAt(cn)?(n=y,cn++):(n=r,0===pn&&Sn(ye)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Un(){var t,n,i,s=75*cn+20,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,60===e.charCodeAt(cn)?(n=b,cn++):(n=r,0===pn&&Sn(be)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function $n(){var t,n,i,s=75*cn+21,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,62===e.charCodeAt(cn)?(n=T,cn++):(n=r,0===pn&&Sn(Te)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Gn(){var t,n,i,s=75*cn+22,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,124===e.charCodeAt(cn)?(n=R,cn++):(n=r,0===pn&&Sn(Re)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Vn(){var t,n,i,s=75*cn+23,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,94===e.charCodeAt(cn)?(n=x,cn++):(n=r,0===pn&&Sn(xe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Wn(){var t,n,i,s=75*cn+24,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,38===e.charCodeAt(cn)?(n=w,cn++):(n=r,0===pn&&Sn(we)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Hn(){var t,n,i,s=75*cn+26,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,35===e.charCodeAt(cn)?(i=N,cn++):(i=r,0===pn&&Sn(Ne)),(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Nt(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function jn(){var t,n,i,s,o,a,l=75*cn+27,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===L?(a=L,cn+=6):(a=r,0===pn&&Sn(Le)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function zn(){var t,n,i,s,o,a,l=75*cn+37,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===G?(a=G,cn+=4):(a=r,0===pn&&Sn(Ge)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function Xn(){var t,n,i,s,o,a,l=75*cn+42,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Ot(n,i)):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t}function Kn(){var t,n,i,s,o=75*cn+44,a=mn[o];return a?(cn=a.nextPos,a.result):(pn++,t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+46,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,J.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(qe)),i!==r){for(s=[],o=qn();o!==r;)s.push(o),o=qn();n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o=75*cn+47,a=mn[o];if(a)return cn=a.nextPos,a.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r){for(i=[],ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));s!==r;)i.push(s),ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));t=n=[n,i]}else cn=t,t=r;return mn[o]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+48,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r)if(te.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Je)),i!==r){for(s=[],ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));o!==r;)s.push(o),ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));t=n=[n,i,s]}else cn=t,t=r;else cn=t,t=r;return mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),t=n!==r?e.substring(t,cn):n)),pn--,t===r&&(n=r,0===pn&&Sn(Ke)),mn[o]={nextPos:cn,result:t},t)}function Yn(){var t,n=75*cn+45,i=mn[n];return i?(cn=i.nextPos,i.result):(Z.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(Ye)),mn[n]={nextPos:cn,result:t},t)}function qn(){var t,n=75*cn+49,i=mn[n];return i?(cn=i.nextPos,i.result):(re.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(tt)),mn[n]={nextPos:cn,result:t},t)}function Qn(){var e,t,n,i,s,o=75*cn+50,a=mn[o];if(a)return cn=a.nextPos,a.result;if(cn,t=[],(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}if(n!==r){for(;n!==r;)if(t.push(n),(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}}else t=r;return t!==r&&(t=Mt(t)),e=t,mn[o]={nextPos:cn,result:e},e}function Zn(){var t,n,i,s,o,a,l,u,c,h,d,f=75*cn+51,p=mn[f];if(p)return cn=p.nextPos,p.result;if(pn++,t=function(){var t,n,i,s,o,a,l,u,c=75*cn+54,h=mn[c];if(h)return cn=h.nextPos,h.result;if(t=cn,n=cn,i=function(){var t,n,i,s=75*cn+55,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+35,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===U?(a=U,cn+=5):(a=r,0===pn&&Sn(Ue)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Qt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+36,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===$?(a=$,cn+=6):(a=r,0===pn&&Sn($e)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Zt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+34,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,2)===B?(a=B,cn+=2):(a=r,0===pn&&Sn(Be)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r?((i=Jn())===r&&(i=null),t=Jt(n,i)):(cn=t,t=r))),pn--,t===r&&(n=r,0===pn&&Sn(at)),mn[s]={nextPos:cn,result:t},t)}(),i!==r?(ie.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(rt)),s!==r?((o=Qn())===r&&(o=null),n=Xt(i,s,o)):(cn=n,n=r)):(cn=n,n=r),n!==r){for(i=[],s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s=cn,o=function(){var t,n,i,s,o,a,l=75*cn+38,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===V?(a=V,cn+=4):(a=r,0===pn&&Sn(Ve)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a!==r?((l=Qn())===r&&(l=null),s=Yt(n,i,o,a,l)):(cn=s,s=r)):(cn=s,s=r),s===r&&(s=null),o=function(){var t,n,i,s,o,a,l=75*cn+39,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===W?(a=W,cn+=5):(a=r,0===pn&&Sn(We)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a===r&&(a=null),t=qt(n,i,s,o,a)):(cn=t,t=r)}else cn=t,t=r;return mn[c]={nextPos:cn,result:t},t}(),t===r){if(t=cn,n=cn,(i=jn())!==r)if(s=function(){var t,n,i,s,o,a,l=75*cn+43,u=mn[l];if(u)return cn=u.nextPos,u.result;if(cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r&&(n=It(n)),t=n,mn[l]={nextPos:cn,result:t},t}(),s!==r)if((o=Nn())!==r){if(a=cn,(l=Xn())!==r){for(u=[],c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);c!==r;)u.push(c),c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);a=Pt(i,s,o,l,u)}else cn=a,a=r;a===r&&(a=null),(l=Ln())!==r?((u=Jn())===r&&(u=null),n=Bt(i,s,o,a,l,u)):(cn=n,n=r)}else cn=n,n=r;else cn=n,n=r;else cn=n,n=r;if(n===r&&(n=cn,(i=jn())!==r&&(s=Xn())!==r?((o=Jn())===r&&(o=null),n=Ut(i,s,o)):(cn=n,n=r),n===r)){if(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+29,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===O?(a=O,cn+=4):(a=r,0===pn&&Sn(Oe)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r){if(s=cn,o=[],(a=qn())!==r)for(;a!==r;)o.push(a),a=qn();else o=r;(s=o!==r?e.substring(s,cn):o)!==r?n=$t(i,s):(cn=n,n=r)}else cn=n,n=r;n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+30,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===I?(a=I,cn+=5):(a=r,0===pn&&Sn(Ie)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?n=Gt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+31,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===k?(a=k,cn+=5):(a=r,0===pn&&Sn(ke)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Vt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+32,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===M?(a=M,cn+=6):(a=r,0===pn&&Sn(Me)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Wt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+40,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,7)===H?(a=H,cn+=7):(a=r,0===pn&&Sn(He)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Kn())!==r?((o=Jn())===r&&(o=null),n=Ht(i,s,o)):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+41,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,9)===j?(a=j,cn+=9):(a=r,0===pn&&Sn(je)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?(o=function(){var t,n,i,s=75*cn+25,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,58===e.charCodeAt(cn)?(n=F,cn++):(n=r,0===pn&&Sn(Fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),o!==r&&(a=Jn())!==r?n=jt(i,s,o,a):(cn=n,n=r)):(cn=n,n=r))))))}n!==r?(ie.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(rt)),i===r&&(i=null),t=zt(n,i)):(cn=t,t=r)}return pn--,t===r&&(n=r,0===pn&&Sn(nt)),mn[f]={nextPos:cn,result:t},t}function Jn(){var t,n,i,s=75*cn+52,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st)),i!==r)for(;i!==r;)n.push(i),se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(it)),mn[s]={nextPos:cn,result:t},t}function er(){var t,n,i,s,o,a,l=75*cn+53,u=mn[l];if(u)return cn=u.nextPos,u.result;if(pn++,t=cn,n=cn,i=cn,pn++,s=cn,(o=pr())===r&&(o=null),35===e.charCodeAt(cn)?(a=N,cn++):(a=r,0===pn&&Sn(Ne)),a!==r?s=o=[o,a]:(cn=s,s=r),pn--,s===r?i=void 0:(cn=i,i=r),i!==r){if(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st)),o!==r)for(;o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));else s=r;s!==r?(ie.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(rt)),o===r&&(o=null),n=i=[i,s,o]):(cn=n,n=r)}else cn=n,n=r;return n===r&&(ie.test(e.charAt(cn))?(n=e.charAt(cn),cn++):(n=r,0===pn&&Sn(rt))),t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(ot)),mn[l]={nextPos:cn,result:t},t}function tr(){var t,n,i,s,o,a=75*cn+57,l=mn[a];return l?(cn=l.nextPos,l.result):(pn++,t=cn,n=function(){var t,n,i,s,o=75*cn+33,a=mn[o];return a?(cn=a.nextPos,a.result):(t=cn,n=dr(),e.substr(cn,7)===P?(i=P,cn+=7):(i=r,0===pn&&Sn(Pe)),i!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[o]={nextPos:cn,result:t},t)}(),n!==r?((i=Nn())===r&&(i=null),(s=Xn())!==r?((o=Ln())===r&&(o=null),t=tn(n,i,s,o)):(cn=t,t=r)):(cn=t,t=r),t===r&&(t=cn,(n=kn())===r&&(n=In())===r&&(n=function(){var t,n,i,s=75*cn+13,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,33===e.charCodeAt(cn)?(n=v,cn++):(n=r,0===pn&&Sn(ve)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),n===r&&(n=function(){var t,n,i,s=75*cn+15,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,126===e.charCodeAt(cn)?(n=D,cn++):(n=r,0===pn&&Sn(De)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}())),n!==r&&(i=tr())!==r?t=nn(n,i):(cn=t,t=r),t===r&&(t=function(){var e,t,n,i,s=75*cn+56,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,e=function(){var e,t,n,i=75*cn+1,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Kn())!==r?(n=dr(),e=wt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}(),e===r&&(e=cn,(t=Nn())!==r&&(n=hr())!==r&&(i=Ln())!==r?e=en(t,n,i):(cn=e,e=r),e===r&&(e=Xn())),pn--,e===r&&(t=r,0===pn&&Sn(lt)),mn[s]={nextPos:cn,result:e},e)}())),pn--,t===r&&(n=r,0===pn&&Sn(ut)),mn[a]={nextPos:cn,result:t},t)}function nr(){var e,t,n,i,s,o,a=75*cn+58,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=tr())!==r){for(n=[],i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ct)),mn[a]={nextPos:cn,result:e},e}function rr(){var e,t,n,i,s,o,a=75*cn+59,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=nr())!==r){for(n=[],i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ht)),mn[a]={nextPos:cn,result:e},e}function ir(){var e,t,n,i,s,o,a=75*cn+60,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=rr())!==r){for(n=[],i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(dt)),mn[a]={nextPos:cn,result:e},e}function sr(){var e,t,n,i,s,o,a=75*cn+61,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ir())!==r){for(n=[],i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ft)),mn[a]={nextPos:cn,result:e},e}function or(){var e,t,n,i,s,o,a=75*cn+62,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=sr())!==r){for(n=[],i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(pt)),mn[a]={nextPos:cn,result:e},e}function ar(){var e,t,n,i,s,o,a=75*cn+63,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=or())!==r){for(n=[],i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(mt)),mn[a]={nextPos:cn,result:e},e}function lr(){var e,t,n,i,s,o,a=75*cn+64,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ar())!==r){for(n=[],i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(gt)),mn[a]={nextPos:cn,result:e},e}function ur(){var e,t,n,i,s,o,a=75*cn+65,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=lr())!==r){for(n=[],i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Et)),mn[a]={nextPos:cn,result:e},e}function cr(){var e,t,n,i,s,o,a=75*cn+66,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ur())!==r){for(n=[],i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(vt)),mn[a]={nextPos:cn,result:e},e}function hr(){var e,t=75*cn+68,n=mn[t];return n?(cn=n.nextPos,n.result):(pn++,e=function(){var e,t,n,i,s,o,a=75*cn+67,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=cr())!==r){for(n=[],i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Ct)),mn[a]={nextPos:cn,result:e},e}(),pn--,e===r&&0===pn&&Sn(Dt),mn[t]={nextPos:cn,result:e},e)}function dr(){var e,t,n,i,s,o,a=75*cn+69,l=mn[a];if(l)return cn=l.nextPos,l.result;for(pn++,cn,(t=pr())===r&&(t=null),n=[],i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);return e=sn(t,n),pn--,t=r,0===pn&&Sn(St),mn[a]={nextPos:cn,result:e},e}function fr(){var t,n,i,s,o,a,l=75*cn+70,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=function(){var t,n,i,s,o,a=75*cn+71,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,e.substr(cn,2)===X?(i=X,cn+=2):(i=r,0===pn&&Sn(At)),i!==r){for(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),t===r)if(t=cn,n=function(){var t,n,i,s,o,a,l,u=75*cn+72,c=mn[u];if(c)return cn=c.nextPos,c.result;if(t=cn,n=cn,e.substr(cn,2)===K?(i=K,cn+=2):(i=r,0===pn&&Sn(_t)),i!==r){for(s=[],o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);o!==r;)s.push(o),o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);e.substr(cn,2)===Y?(o=Y,cn+=2):(o=r,0===pn&&Sn(yt)),o!==r?n=i=[i,s,o]:(cn=n,n=r)}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[u]={nextPos:cn,result:t},t}(),n!==r){for(i=[],s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);t=an(n,i)}else cn=t,t=r;return mn[l]={nextPos:cn,result:t},t}function pr(){var t,n,i,s=75*cn+73,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt)),i!==r)for(;i!==r;)n.push(i),oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(Tt)),mn[s]={nextPos:cn,result:t},t}function mr(){var t,n,i,s=75*cn+74,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,pn++,Q.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Xe)),pn--,i===r?n=void 0:(cn=n,n=r),n!==r?(i=dr(),t=un(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}e=lh(e);const gr=(e,t)=>({type:e,...t}),Er=(...e)=>e.flat().filter(e=>null!=e&&""!==e&&0!==e.length),vr=(...e)=>{return(t=Er(e.flat())).length>1?t:t[0];var t},Cr=(...e)=>e.flat().reduce((e,[t,n])=>({type:"binary",operator:t,left:e,right:n}));if((n=o())!==r&&cn===e.length)return n;throw n!==r&&cn0){for(t=1,n=1;ts.length)throw new Error("'".concat(t,"': Too many arguments for macro"));if(u.length>":return t(n)>>t(r);case"<":return t(n)":return t(n)>t(r);case"<=":return t(n)<=t(r);case">=":return t(n)>=t(r);case"==":return t(n)==t(r);case"!=":return t(n)!=t(r);case"&":return t(n)&t(r);case"^":return t(n)^t(r);case"|":return t(n)|t(r);case"&&":return t(n)&&t(r);case"||":return t(n)||t(r);default:throw new Error("Preprocessing error: Unknown binary operator ".concat(i))}},unary:function(e,t){switch(e.operator.literal){case"+":return t(e.expression);case"-":return-1*t(e.expression);case"!":return!t(e.expression);case"~":return~t(e.expression);default:throw new Error("Preprocessing error: Unknown unary operator ".concat(e.operator.literal))}}},(r=function(e){var t=n[e.type];if(!t)throw new Error("No evaluate() evaluator for ".concat(e.type));return t(e,r)})(e);var n,r}((n=sh(r,t).trim(),eh(s)(n,{grammarSource:"expression",startRule:"constant_expression"})),t)},lh=function(e,t){return void 0===t&&(t={}),e.replace(/\\[\n\r]/g,"")},uh=function(e,t){void 0===t&&(t={});var n,r,i,s,o=Object.entries(t.defines||{}).reduce(function(e,t){var n,r=t[0],i=t[1];return th(th({},e),((n={})[r]={body:i},n))},{}),a=(void 0===(n=t.preserve)&&(n={}),function(e){var t=null==n?void 0:n[e.node.type];return"function"==typeof t?t(e):t});return r={conditional:{enter:function(e){var t=e,n=t.node;a(t)||(function(e,t){return"if"===t.type?!!t.expression&&oh(ah(t.expression,e)):"ifdef"===t.type?t.identifier.identifier in e:"ifndef"===t.type?!(t.identifier.identifier in e):void 0}(o,n.ifPart)?t.replaceWith(n.ifPart.body):n.elseIfParts.reduce(function(e,n){return e||oh(ah(n.expression,o))&&(t.replaceWith(n.body),!0)},!1)||(n.elsePart?t.replaceWith(n.elsePart.body):t.remove()))}},text:{enter:function(e){var t=e;t.node.text=sh(t.node.text,o)}},define_arguments:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body,s=n.args;o[r]={args:s,body:i},!a(t)&&t.remove()}},define:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body;o[r]={body:i},!a(t)&&t.remove()}},undef:{enter:function(e){var t=e;delete o[t.node.identifier.identifier],!a(t)&&t.remove()}},error:{enter:function(e){var n=e;if(t.stopOnError)throw new Error(n.node.message);!a(n)&&n.remove()}},pragma:{enter:function(e){var t=e;!a(t)&&t.remove()}},version:{enter:function(e){var t=e;!a(t)&&t.remove()}},extension:{enter:function(e){var t=e;!a(t)&&t.remove()}},line:{enter:function(e){var t=e;!a(t)&&t.remove()}}},i=!1,(s=function(e,t,n,o,a){var l;if(!i){var u=r[e.type],c=function(e,t,n,r,i){return{node:e,parent:t,parentPath:n,key:r,index:i,stop:function(){this.stopped=!0},skip:function(){this.skipped=!0},remove:function(){this.removed=!0},replaceWith:function(e){this.replaced=e},findParent:function(e){return n?e(n)?n:n.findParent(e):n}}}(e,t,n,o,a),h=t;if(null==u?void 0:u.enter){if(u.enter(c),c.removed){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));return"number"==typeof a?h[o].splice(a,1):h[o]=null,c}if(c.replaced){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));"number"==typeof a?h[o].splice(a,1,c.replaced):h[o]=c.replaced}if(c.skipped)return c}if(c.stopped)i=!0;else if(c.replaced){var d=c.replaced;s(d,t,n,o,a)}else Object.entries(e).filter(function(e){return e[0],function(e){return function(e){return!!(null==e?void 0:e.type)}(e)||Array.isArray(e)}(e[1])}).forEach(function(t){var n=t[0],r=t[1];if(Array.isArray(r))for(var o=0,a=0;o-a{let e=!0;return n?(i({source:o,formatted:null,error:""}),function(e){return Gs(e,{parser:"glsl-parser",plugins:[Gc],printWidth:80,tabWidth:4,useTabs:!1}).then(Vc)}(o).then(t=>{e&&i({source:o,formatted:t,error:""})}).catch(t=>{if(!e)return;const n=dh(t);a.error("shader formatting failed: "+n),i({source:o,formatted:null,error:n})}),()=>{e=!1}):(i({source:o,formatted:null,error:""}),()=>{e=!1})},[n,o]);const c=n&&r.source===o?r.formatted:null;return{source:c||o,formatted:!!c,preprocessed:u,error:(r.source===o?r.error:"")||l}}(C.source,C.preprocessed,e.beautify),S=D.source,A=C.edited,_=[e.fragment?e.sourceFragmentLog:e.sourceVertexLog,e.programLog].filter(e=>!!e).join("\n"),y=!e.translated&&!D.preprocessed&&!D.formatted,b=function(e,t,n,r){return!(e||t||!n||r)}(t,A,_,y);(0,dt.useLayoutEffect)(()=>{g.current={programId:e.programId,sourceVertex:e.sourceVertex,sourceFragment:e.sourceFragment}},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!d.current)return;if(!f.current){const e=ace.edit(d.current);e.setTheme("ace/theme/monokai"),e.getSession().setMode("ace/mode/glsl"),e.setShowPrintMargin(!1),f.current=e}const t=f.current;t.setReadOnly(!e.editable||e.translated),t.getValue()!==S&&t.setValue(S,-1);const n=()=>{const n=t.getValue();e.fragment?m.current.fragment=n:m.current.vertex=n,v(t=>e.fragment?t.fragment?t:Object.assign(Object.assign({},t),{fragment:!0}):t.vertex?t:Object.assign(Object.assign({},t),{vertex:!0})),function(e,t,n,r){e&&n(!1),t&&r(!1)}(e.beautify,e.preprocessed,c,h),-1!==p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{if(p.current=-1,!function(e,t){return e.programId===t.programId&&e.sourceVertex===t.sourceVertex&&e.sourceFragment===t.sourceFragment}(g.current,e))return;const t={sourceVertex:m.current.vertex,sourceFragment:m.current.fragment,translatedSourceVertex:e.translatedSourceVertex,translatedSourceFragment:e.translatedSourceFragment,programId:e.programId};u(t)},1500)},r=e.editable&&!e.translated;return r&&t.getSession().on("change",n),()=>{r&&t.getSession().off("change",n)}},[S,e.editable,e.translated,e.fragment,e.beautify,e.preprocessed,e.sourceVertex,e.sourceFragment,e.translatedSourceVertex,e.translatedSourceFragment,e.programId,c,h,u]),(0,dt.useEffect)(()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),m.current={baseProgramId:e.programId,baseVertex:e.sourceVertex,baseFragment:e.sourceFragment,vertex:e.sourceVertex,fragment:e.sourceFragment},v({vertex:!1,fragment:!1})},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!f.current)return;const e=t||(y&&!A?_:"");f.current.getSession().setAnnotations(function(e){if(!e)return[];const t=[],n=e.split(/\r?\n/);for(const e of n){const n=e.replace(/\0/g,"").trim();if(!n)continue;let r=/^(error|warning|info)\s*:\s*\d+\s*:\s*(\d+)(?:\s*:\s*(\d+))?\s*:\s*(.*)$/i.exec(n);if(r){t.push(Pt(r[1],r[2],r[3],r[4]));continue}if(r=/^\d+\s*\(\s*(\d+)\s*\)\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[2],r[1],"",r[3]));continue}if(r=/^\d+\s*:\s*(\d+)(?:\s*\(\s*(\d+)\s*\))?\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[3],r[1],r[2],r[4]));continue}const i=/\b(error|warning|info)\b/i.exec(n);t.push({row:0,column:0,text:n,type:i?i[1].toLowerCase():"info"})}return t}(e))},[_,y,t,D.formatted,D.preprocessed,A,e.beautify,e.fragment,e.programLog,e.sourceFragmentLog,e.sourceVertexLog,e.translated]),(0,dt.useEffect)(()=>()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),f.current&&(f.current.destroy(),f.current=null)},[]);const T=(0,dt.useCallback)(e=>{e.preventDefault(),n()},[n]),R=(0,dt.useCallback)(e=>{e.preventDefault(),r()},[r]),x=(0,dt.useCallback)(e=>{e.preventDefault(),null==i||i()},[i]),w=(0,dt.useCallback)(e=>{e.preventDefault(),null==o||o()},[o]),F=(0,dt.useCallback)(e=>{e.preventDefault(),l()},[l]),N=!e.singleShader||!e.fragment,L=!e.singleShader||e.fragment,O=D.error;return(0,mt.jsxs)("div",{className:"sourceCodeComponentContainer",children:[(0,mt.jsx)("div",{className:"sourceCodeMenuComponentContainer",children:(0,mt.jsxs)("ul",{className:"sourceCodeMenuComponent",children:[N&&e.translatedSourceVertex&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:!e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedVertexSourceClicked",onClick:x,children:"Translated Vertex"})}),L&&e.translatedSourceFragment&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedFragmentSourceClicked",onClick:w,children:"Translated Fragment"})}),N&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment||e.translated?"":"active",href:"#",role:"button",commandName:"onVertexSourceClicked",onClick:T,children:"Vertex"})}),L&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&!e.translated?"active":"",href:"#",role:"button",commandName:"onFragmentSourceClicked",onClick:R,children:"Fragment"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onSourceCodeCloseClicked",onClick:F,children:"Close"})})]})}),(0,mt.jsx)("div",{className:"sourceCodeComponent",ref:d}),(0,mt.jsx)(hh,{beautify:e.beautify,capturedDiagnosticsHidden:b,fragment:e.fragment,preprocessed:e.preprocessed,processingError:O,onBeautifyChanged:c,onFragmentSourceClicked:r,onPreprocessChanged:h,onVertexSourceClicked:n})]})}function hh({beautify:e,capturedDiagnosticsHidden:t,fragment:n,preprocessed:r,processingError:i,onBeautifyChanged:s,onFragmentSourceClicked:o,onPreprocessChanged:a,onVertexSourceClicked:l}){const u=(0,dt.useCallback)(e=>{s(e.target.checked)},[s]),c=(0,dt.useCallback)(e=>{a(e.target.checked)},[a]),h=(0,dt.useCallback)(e=>{e.preventDefault(),(n?o:l)(),s(!1),a(!1)},[n,s,o,a,l]);return(0,mt.jsx)("div",{className:"sourceCodeMenuComponentFooter",children:(0,mt.jsxs)("p",{children:[(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onBeautifyChanged",checked:e,onChange:u})," Beautify"]}),(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onPreprocessChanged",checked:r,onChange:c})," Preprocess"]}),i&&(0,mt.jsx)("span",{className:"sourceCodeFormatError",role:"alert",title:i,children:"Shader processing failed"}),t&&(0,mt.jsxs)("span",{className:"sourceCodeDiagnosticsNotice",role:"status",children:["Captured diagnostics hidden."," ",(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onShowCapturedDiagnostics",onClick:h,children:"Show original with diagnostics"})]})]})})}function dh(e){return e instanceof Error?e.message:String(e)}function fh({title:e,children:t}){const n=e?e.replace(/([A-Z])/g," $1").trim():"";return(0,mt.jsxs)("div",{className:"jsonGroupComponent",children:[(0,mt.jsx)("div",{className:"jsonGroupComponentTitle",children:n}),(0,mt.jsx)("ul",{children:t})]})}function ph({itemKey:e,value:t}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsx)("span",{className:"jsonItemComponentValue",children:t})]})}function mh({itemKey:e,value:t,pixelated:n,raw:r}){const i=bt();return(0,mt.jsx)("li",{className:"jsonItemImageHolder",children:(0,mt.jsxs)("div",{className:"jsonItemImage jsonItemImageClickable",children:[(0,mt.jsx)("img",{src:t,style:n?{imageRendering:"pixelated"}:void 0,title:"Open in texture viewer",onClick:()=>i.openTextureViewer({src:t,label:e,pixelated:n,raw:r||null})}),(0,mt.jsx)("span",{children:e})]})})}function gh({itemKey:e,value:t,help:n}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("span",{className:"jsonItemComponentValue",children:[t+" (",(0,mt.jsx)("a",{href:n,target:"_blank",className:"jsonSourceItemComponentOpen",children:"Open help page"}),")"]})]})}function Eh({visualState:e}){const t=bt();return(0,mt.jsxs)("div",{className:"jsonVisualStateItemComponent",children:[e.Attachments?e.Attachments.map((n,r)=>n.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{className:"jsonItemImageClickable",src:encodeURI(n.src),title:"Open in texture viewer",onClick:()=>t.openTextureViewer({src:n.src,label:n.attachmentName||"Attachment",pixelated:!1,raw:n.raw||null})}),e.Attachments.length>1&&(0,mt.jsx)("span",{children:n.attachmentName})]},r):null):(0,mt.jsx)("span",{children:e.FrameBufferStatus}),(0,mt.jsx)("span",{children:e.FrameBuffer?e.FrameBuffer.__SPECTOR_Object_TAG.displayText:"Canvas frame buffer"})]})}function vh({itemKey:e,shader:t,programLog:n,onOpen:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),null==r||r(t,n)},[r,n,t]),s=t.source?t.source.length:0,o=`${t.name||"Shader"} (${s} chars)`;return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("a",{href:"#",role:"button",className:"jsonSourceItemComponentOpen",commandName:"onShaderSourceOpen",onClick:i,children:["Open ",o]})]})}function Ch({items:e,onShaderSourceOpen:t}){return e&&0!==e.length?(0,mt.jsx)(mt.Fragment,{children:e.map((e,n)=>{switch(e.type){case"group":return(0,mt.jsx)(fh,{title:e.title,children:(0,mt.jsx)(Ch,{items:e.children,onShaderSourceOpen:t})},n);case"item":return(0,mt.jsx)(ph,{itemKey:e.key,value:e.value},n);case"image":return(0,mt.jsx)(mh,{itemKey:e.key,value:e.value,pixelated:e.pixelated,raw:e.raw},n);case"help":return(0,mt.jsx)(gh,{itemKey:e.key,value:e.value,help:e.help},n);case"shaderSource":return(0,mt.jsx)(vh,{itemKey:e.key,shader:e.shader,programLog:e.programLog,onOpen:t},n);case"visualState":return(0,mt.jsx)(Eh,{visualState:e.visualState},n);default:return null}})}):null}const Dh={added:"+",removed:"-",changed:"~",unchanged:" "};function Sh(e){const t=void 0===e.indexA?"_":String(e.indexA),n=void 0===e.indexB?"_":String(e.indexB);return e.type+"#"+t+"#"+n}function Ah(e){return!(!e.previousImage&&!e.currentImage)}function _h(){const e=bt(),t=pt(e.store),[n,r]=(0,dt.useState)(null);if((0,dt.useEffect)(()=>{r(null)},[t.compareRows]),!t.canCompare)return(0,mt.jsx)("div",{className:"compareViewComponent",children:(0,mt.jsx)("div",{className:"compareViewEmpty",children:"Capture the same page at least twice, then select a capture to compare it against the previous one."})});const{added:i,removed:s,changed:o,unchanged:a}=t.compareSummary,l=t.compareOnlyDifferences?t.compareRows.filter(e=>"unchanged"!==e.type):t.compareRows,u=l.find(e=>Sh(e)===n)||(l.length>0?l[0]:null),c=u?Sh(u):"";return(0,mt.jsxs)("div",{className:"compareViewComponent",children:[(0,mt.jsxs)("div",{className:"compareViewHeader",children:[(0,mt.jsx)("span",{className:"compareViewLabel",children:t.compareLabel}),(0,mt.jsxs)("span",{className:"compareViewSummary",children:[(0,mt.jsxs)("span",{className:"added",children:["+",i]}),(0,mt.jsxs)("span",{className:"removed",children:["-",s]}),(0,mt.jsxs)("span",{className:"changed",children:["~",o]}),(0,mt.jsxs)("span",{className:"unchanged",children:["=",a]})]}),(0,mt.jsxs)("label",{className:"compareViewToggle",children:[(0,mt.jsx)("input",{type:"checkbox",checked:t.compareOnlyDifferences,onChange:t=>e.handleCompareOnlyDifferencesChange(t.target.checked)}),"Differences only"]})]}),(0,mt.jsxs)("div",{className:"compareViewBody",children:[(0,mt.jsx)(yh,{}),(0,mt.jsx)("ul",{className:"compareViewList",children:0===l.length?(0,mt.jsx)("li",{className:"compareViewEmptyRow",children:"No differences between these two captures."}):l.map(e=>{const t=Sh(e);return(0,mt.jsx)(bh,{row:e,selected:t===c,onSelect:()=>r(t)},t)})}),(0,mt.jsx)("div",{className:"compareViewDetail",children:u?(0,mt.jsx)(Th,{row:u,onSelectCommand:e.handleCompareCommandSelected,onOpenTexture:(t,n)=>e.openTextureViewer({src:t,label:n,pixelated:!1,raw:null})}):(0,mt.jsx)("div",{className:"compareDetailEmpty",children:"Select a call to see its details."})})]})]})}function yh(){return(0,mt.jsxs)("div",{className:"compareViewLegend",children:[(0,mt.jsxs)("div",{className:"compareLegendRow added",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Added"]}),(0,mt.jsxs)("div",{className:"compareLegendRow removed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Removed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow changed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Changed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow unchanged",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Unchanged"]})]})}function bh(e){const{row:t,selected:n,onSelect:r}=e,i="removed"===t.type?t.previousText:t.currentText,s=i&&0===i.indexOf(t.name)?i.slice(t.name.length):"",o="compareRow "+t.type+(n?" selected":"");return(0,mt.jsxs)("li",{className:o,onClick:r,title:i,children:[(0,mt.jsx)("span",{className:"compareSign",children:Dh[t.type]}),(0,mt.jsxs)("span",{className:"compareRowText",children:[(0,mt.jsx)("span",{className:"compareCmdName",children:t.name}),s]})]})}function Th(e){const{row:t,onSelectCommand:n,onOpenTexture:r}=e,i=t.fieldDiffs||[],s=i.filter(e=>!Ah(e)),o=i.filter(Ah),a="changed"===t.type&&t.previousText!==t.currentText,l="removed"===t.type?t.previousText:t.currentText;return(0,mt.jsxs)("div",{className:"compareDetail",children:[(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Command"}),(0,mt.jsxs)("ul",{children:[(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"name"}),":"," ",(0,mt.jsx)("span",{className:"compareCmdName "+t.type,children:t.name})]}),(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"call"}),":"," ",a?(0,mt.jsxs)("span",{className:"compareTextChange",children:[(0,mt.jsx)("span",{className:"compareOld",children:t.previousText}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:t.currentText})]}):(0,mt.jsx)("span",{className:"compareNew",children:l})]}),void 0!==t.commandId&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",className:"compareCommandLink",title:"Show this command in the Commands view",onClick:e=>{e.preventDefault(),n(t.commandId)},children:"Show in Commands view →"})})]})]}),s.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Uniform & state changes"}),(0,mt.jsx)("ul",{children:s.map((e,t)=>(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),":"," ",(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:e.current})]},t))})]}),o.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Texture changes"}),(0,mt.jsx)("ul",{children:o.map((e,t)=>(0,mt.jsxs)("li",{className:"compareTextureItem",children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),(0,mt.jsxs)("div",{className:"compareImageDiff",children:[e.previousImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.previousImage,title:"Open in texture viewer",onClick:()=>r(e.previousImage,e.path+" (previous)")}):(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),e.currentImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.currentImage,title:"Open in texture viewer",onClick:()=>r(e.currentImage,e.path+" (current)")}):(0,mt.jsx)("span",{className:"compareNew",children:e.current})]})]},t))})]})]})}function Rh(e){const t=(255&e).toString(16);return 1===t.length?"0"+t:t}function xh(e,t,n,r){return"#"+Rh(e)+Rh(t)+Rh(n)+Rh(r)}function wh(e,t,n,r){const i=e=>(e/255).toFixed(2);return i(e)+", "+i(t)+", "+i(n)+", "+i(r)}function Fh(){const e=bt(),t=pt(e.store).textureViewer;return t.open?(0,mt.jsx)(Lh,{viewer:t,onClose:e.closeTextureViewer}):null}const Nh=120;function Lh(e){const{viewer:t,onClose:n}=e,r=(0,dt.useRef)(null),i=(0,dt.useRef)(null),s=(0,dt.useRef)(null),o=(0,dt.useRef)(null),[a,l]=(0,dt.useState)({r:!0,g:!0,b:!0,a:!0}),[u,c]=(0,dt.useState)(1),[h,d]=(0,dt.useState)("checker"),[f,p]=(0,dt.useState)(null),[m,g]=(0,dt.useState)(null),[E,v]=(0,dt.useState)(!1);(0,dt.useEffect)(()=>{let e=!1;const n=t=>{e||(o.current=t,p({width:t.width,height:t.height}),c(kh(t.width,t.height)),v(!0))};if(t.raw){const r=function(e){try{if(!e.data||e.width<=0||e.height<=0)return null;const t=function(e){const t=atob(e),n=new Uint8ClampedArray(t.length);for(let e=0;e{e=!0}}const r=new Image;return r.onload=()=>{const e=document.createElement("canvas");e.width=r.naturalWidth||1,e.height=r.naturalHeight||1;const t=e.getContext("2d");if(!t)return;t.drawImage(r,0,0);const i=t.getImageData(0,0,e.width,e.height);n({data:new Uint8ClampedArray(i.data),width:e.width,height:e.height})},r.src=t.src,()=>{e=!0}},[t.src,t.raw]),(0,dt.useEffect)(()=>{const e=o.current,t=r.current;if(!E||!e||!t)return;const n=function(e,t,n){let r=e.current;return r||(r=document.createElement("canvas"),e.current=r),r.width!==t&&(r.width=t),r.height!==n&&(r.height=n),r}(s,e.width,e.height),i=n.getContext("2d"),l=t.getContext("2d");if(!i||!l)return;const c=function(e,t){const n=new Uint8ClampedArray(e.length),r=t.a&&!t.r&&!t.g&&!t.b;for(let i=0;i{const e=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]);const C="textureViewerViewport"+("checker"===h?" checker":""),D="black"===h?{background:"#000"}:"white"===h?{background:"#fff"}:void 0;return(0,mt.jsx)("div",{className:"textureViewerOverlay",onClick:n,children:(0,mt.jsxs)("div",{className:"textureViewerModal",onClick:e=>e.stopPropagation(),children:[(0,mt.jsxs)("div",{className:"textureViewerHeader",children:[(0,mt.jsx)("span",{className:"textureViewerTitle",children:t.label}),(0,mt.jsxs)("span",{className:"textureViewerMeta",children:[f?f.width+" × "+f.height:"",!t.raw&&f?" · thumbnail":""]}),(0,mt.jsx)("span",{className:"textureViewerClose",title:"Close (Esc)",onClick:n,children:"✕"})]}),(0,mt.jsxs)("div",{className:"textureViewerToolbar",children:[(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Channels"}),(0,mt.jsx)(Oh,{channel:"r",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"g",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"b",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"a",mask:a,setMask:l})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"tvBtn",title:"Force alpha = 1 to reveal RGB hidden behind transparency",onClick:()=>l({r:!0,g:!0,b:!0,a:!1}),children:"Opaque"}),(0,mt.jsx)("span",{className:"tvBtn",title:"Show the alpha channel as grayscale",onClick:()=>l({r:!1,g:!1,b:!1,a:!0}),children:"Alpha → gray"})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"BG"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)(Ih,{value:"checker",glyph:"▦",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"black",glyph:"■",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"white",glyph:"□",background:h,setBackground:d})]})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Zoom"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.max(1,e/2)),children:"−"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(f?kh(f.width,f.height):1),children:"Fit"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.min(32,2*e)),children:"+"})]}),(0,mt.jsxs)("span",{className:"zoomVal",children:[Math.round(100*u),"%"]})]}),(0,mt.jsx)("div",{className:"textureViewerGroup textureViewerGroupEnd",children:(0,mt.jsx)("span",{className:"tvBtn primary",onClick:()=>{const e=s.current;e&&e.toBlob(e=>{if(!e)return;const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=((t.label||"texture").replace(/[^a-z0-9_\-]+/gi,"_").replace(/^_+|_+$/g,"")||"texture")+".png",r.click(),setTimeout(()=>URL.revokeObjectURL(n),0)})},children:"⭳ Save PNG"})})]}),(0,mt.jsxs)("div",{className:"textureViewerBody",children:[(0,mt.jsxs)("div",{className:C,style:D,children:[(0,mt.jsx)("canvas",{ref:r,className:"textureViewerCanvas",onMouseMove:e=>{const t=o.current,n=r.current,a=i.current,l=s.current;if(!t||!n)return;const c=n.getBoundingClientRect(),h=Math.floor((e.clientX-c.left)/u),d=Math.floor((e.clientY-c.top)/u);if(h<0||d<0||h>=t.width||d>=t.height)return g(null),void(a&&(a.style.display="none"));const f=4*(d*t.width+h);g({x:h,y:d,r:t.data[f],g:t.data[f+1],b:t.data[f+2],a:t.data[f+3]}),function(e,t,n,r){if(!e||!t)return;const i=e.getContext("2d");if(!i)return;i.imageSmoothingEnabled=!1,i.clearRect(0,0,Nh,Nh),i.drawImage(t,n-7,r-7,15,15,0,0,Nh,Nh),i.strokeStyle="#F0640D",i.lineWidth=2,i.strokeRect(56,56,8,8),e.style.display="block"}(a,l,h,d)},onMouseLeave:()=>{g(null),i.current&&(i.current.style.display="none")}}),(0,mt.jsx)("canvas",{ref:i,className:"textureViewerLoupe",width:Nh,height:Nh})]}),(0,mt.jsxs)("div",{className:"textureViewerRail",children:[(0,mt.jsx)("div",{className:"railTitle",children:"Pixel inspector"}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"position"}),(0,mt.jsx)("span",{className:"v",children:m?m.x+", "+m.y:"—"})]}),(0,mt.jsx)("div",{className:"swatch",children:(0,mt.jsx)("div",{className:"swatchInner",style:m?{background:"rgba("+m.r+","+m.g+","+m.b+","+m.a/255+")"}:void 0})}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"R"}),(0,mt.jsx)("span",{className:"v",children:m?m.r:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"G"}),(0,mt.jsx)("span",{className:"v",children:m?m.g:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"B"}),(0,mt.jsx)("span",{className:"v",children:m?m.b:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"A"}),(0,mt.jsx)("span",{className:"v",children:m?m.a:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"hex"}),(0,mt.jsx)("span",{className:"v",children:m?xh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"norm"}),(0,mt.jsx)("span",{className:"v",children:m?wh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"hint",children:["Move over the texture to sample pixels. Toggle channels to isolate RGB / alpha.",(0,mt.jsx)("b",{children:" Opaque"})," reveals colour hidden behind transparency (#183)."]})]})]})]})})}function Oh(e){const{channel:t,mask:n,setMask:r}=e,i=n[t],s="channel "+t+(i?" on":"");return(0,mt.jsx)("span",{className:s,onClick:()=>r(Object.assign(Object.assign({},n),{[t]:!i})),children:t.toUpperCase()})}function Ih(e){const{value:t,glyph:n,background:r,setBackground:i}=e;return(0,mt.jsx)("span",{className:"tvBtn"+(r===t?" active":""),onClick:()=>i(t),children:n})}function kh(e,t){return Math.max(1,Math.min(16,Math.floor(480/Math.max(e,t))||1))}function Mh(){const e=bt(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"resultViewComponent "+(t.visible?"active":""),children:[(0,mt.jsx)(Tt,{}),(0,mt.jsxs)(Rt,{children:[0===t.menuStatus&&(0,mt.jsx)(wt,{active:!0,captures:t.captures,onCaptureSelected:t=>{e.selectCapture(t),e.handleMenuStatusChange(40)},onSaveRequested:e.handleSaveRequested,onCaptureLoaded:e.handleCaptureLoaded}),40===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(Ft,{children:t.visualStates.map((t,n)=>(0,mt.jsx)(Nt,{item:t,onVisualStateSelected:()=>e.handleVisualStateSelected(n)},n))}),(0,mt.jsx)(Lt,{children:t.commands.map((t,n)=>(0,mt.jsx)(Ot,{command:t,onCommandSelected:()=>e.handleCommandSelected(n),onVertexSelected:()=>e.handleVertexSelected(n),onFragmentSelected:()=>e.handleFragmentSelected(n),onShaderSelected:()=>e.handleShaderSelected(n)},n))}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]}),10===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(kt,{left:!0,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationLeft})})}),(0,mt.jsx)(kt,{left:!1,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationRight})})})]}),20===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.initStateData})}),30===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.endStateData})}),60===t.menuStatus&&(0,mt.jsx)(_h,{}),50===t.menuStatus&&t.sourceCodeState&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(ch,{state:t.sourceCodeState,errorMessage:t.sourceCodeError,onVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!1),onFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!1),onTranslatedVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!0),onTranslatedFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!0),onCloseClicked:e.handleSourceCodeClose,onSourceCodeChanged:e.handleSourceCodeChanged,onBeautifyChanged:e.handleBeautifyChanged,onPreprocessChanged:e.handlePreprocessChanged}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]})]}),(0,mt.jsx)(Fh,{})]})}class Ph{static getMDNLink(e){const t=Ph.WebGL2Functions[e];if(t)return Ph.WebGL2RootUrl+t;const n=Ph.WebGLFunctions[e];if(n)return Ph.WebGLRootUrl+n;const r=Ph.AngleInstancedArraysExtFunctions[e];return r?Ph.AngleInstancedArraysExtRootUrl+r:Ph.WebGLRootUrl+e}}Ph.WebGL2RootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/",Ph.WebGLRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/",Ph.AngleInstancedArraysExtRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/",Ph.WebGL2Functions={beginQuery:"beginQuery",beginTransformFeedback:"beginTransformFeedback",bindBufferBase:"bindBufferBase",bindBufferRange:"bindBufferRange",bindSampler:"bindSampler",bindTransformFeedback:"bindTransformFeedback",bindVertexArray:"bindVertexArray",blitFramebuffer:"blitFramebuffer",clearBufferfv:"clearBuffer",clearBufferiv:"clearBuffer",clearBufferuiv:"clearBuffer",clearBufferfi:"clearBuffer",clientWaitSync:"clientWaitSync",compressedTexImage3D:"compressedTexImage3D",compressedTexSubImage3D:"compressedTexSubImage3D",copyBufferSubData:"copyBufferSubData",copyTexSubImage3D:"copyTexSubImage3D",createQuery:"createQuery",createSampler:"createSampler",createTransformFeedback:"createTransformFeedback",createVertexArray:"createVertexArray",deleteQuery:"deleteQuery",deleteSampler:"deleteSampler",deleteSync:"deleteSync",deleteTransformFeedback:"deleteTransformFeedback",deleteVertexArray:"deleteVertexArray",drawArraysInstanced:"drawArraysInstanced",drawBuffers:"drawBuffers",drawElementsInstanced:"drawElementsInstanced",drawRangeElements:"drawRangeElements",endQuery:"endQuery",endTransformFeedback:"endTransformFeedback",fenceSync:"fenceSync",framebufferTextureLayer:"framebufferTextureLayer",getActiveUniformBlockName:"getActiveUniformBlockName",getActiveUniformBlockParameter:"getActiveUniformBlockParameter",getActiveUniforms:"getActiveUniforms",getBufferSubData:"getBufferSubData",getFragDataLocation:"getFragDataLocation",getIndexedParameter:"getIndexedParameter",getInternalformatParameter:"getInternalformatParameter",getQuery:"getQuery",getQueryParameter:"getQueryParameter",getSamplerParameter:"getSamplerParameter",getSyncParameter:"getSyncParameter",getTransformFeedbackVarying:"getTransformFeedbackVarying",getUniformBlockIndex:"getUniformBlockIndex",getUniformIndices:"getUniformIndices",invalidateFramebuffer:"invalidateFramebuffer",invalidateSubFramebuffer:"invalidateSubFramebuffer",isQuery:"isQuery",isSampler:"isSampler",isSync:"isSync",isTransformFeedback:"isTransformFeedback",isVertexArray:"isVertexArray",pauseTransformFeedback:"pauseTransformFeedback",readBuffer:"readBuffer",renderbufferStorageMultisample:"renderbufferStorageMultisample",resumeTransformFeedback:"resumeTransformFeedback",samplerParameteri:"samplerParameter",samplerParameterf:"samplerParameter",texImage3D:"texImage3D",texStorage2D:"texStorage2D",texStorage3D:"texStorage3D",texSubImage3D:"texSubImage3D",transformFeedbackVaryings:"transformFeedbackVaryings",uniform1ui:"uniform",uniform2ui:"uniform",uniform3ui:"uniform",uniform4ui:"uniform",uniform1fv:"uniform",uniform2fv:"uniform",uniform3fv:"uniform",uniform4fv:"uniform",uniform1iv:"uniform",uniform2iv:"uniform",uniform3iv:"uniform",uniform4iv:"uniform",uniform1uiv:"uniform",uniform2uiv:"uniform",uniform3uiv:"uniform",uniform4uiv:"uniform",uniformBlockBinding:"uniformBlockBinding",uniformMatrix2fv:"uniformMatrix",uniformMatrix3x2fv:"uniformMatrix",uniformMatrix4x2fv:"uniformMatrix",uniformMatrix2x3fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4x3fv:"uniformMatrix",uniformMatrix2x4fv:"uniformMatrix",uniformMatrix3x4fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttribDivisor:"vertexAttribDivisor",vertexAttribI4i:"vertexAttribI",vertexAttribI4ui:"vertexAttribI",vertexAttribI4iv:"vertexAttribI",vertexAttribI4uiv:"vertexAttribI",vertexAttribIPointer:"vertexAttribIPointer",waitSync:"waitSync"},Ph.WebGLFunctions={uniform1f:"uniform",uniform1fv:"uniform",uniform1i:"uniform",uniform1iv:"uniform",uniform2f:"uniform",uniform2fv:"uniform",uniform2i:"uniform",uniform2iv:"uniform",uniform3f:"uniform",uniform3i:"uniform",uniform3iv:"uniform",uniform4f:"uniform",uniform4fv:"uniform",uniform4i:"uniform",uniform4iv:"uniform",uniformMatrix2fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttrib1f:"vertexAttrib",vertexAttrib2f:"vertexAttrib",vertexAttrib3f:"vertexAttrib",vertexAttrib4f:"vertexAttrib",vertexAttrib1fv:"vertexAttrib",vertexAttrib2fv:"vertexAttrib",vertexAttrib3fv:"vertexAttrib",vertexAttrib4fv:"vertexAttrib"},Ph.AngleInstancedArraysExtFunctions={drawArraysInstancedANGLE:"drawArraysInstancedANGLE",drawElementsInstancedANGLE:"drawElementsInstancedANGLE",vertexAttribDivisorANGLE:"vertexAttribDivisorANGLE"};const Bh={activeTexture:[["texture"]],attachShader:[["program","shader"]],beginQuery:[["target","query"]],beginTransformFeedback:[["primitiveMode"]],bindAttribLocation:[["program","index","name"]],bindBuffer:[["target","buffer"]],bindBufferBase:[["target","index","buffer"]],bindBufferRange:[["target","index","buffer","offset","size"]],bindFramebuffer:[["target","framebuffer"]],bindRenderbuffer:[["target","renderbuffer"]],bindSampler:[["unit","sampler"]],bindTexture:[["target","texture"]],bindTransformFeedback:[["target","tf"]],bindVertexArray:[["array"]],blendColor:[["red","green","blue","alpha"]],blendEquation:[["mode"]],blendEquationSeparate:[["modeRGB","modeAlpha"]],blendFunc:[["sfactor","dfactor"]],blendFuncSeparate:[["srcRGB","dstRGB","srcAlpha","dstAlpha"]],blitFramebuffer:[["srcX0","srcY0","srcX1","srcY1","dstX0","dstY0","dstX1","dstY1","mask","filter"]],bufferData:[["target","data","usage"],["target","size","usage"],["target","srcData","usage"],["target","srcData","usage","srcOffset","length"]],bufferSubData:[["target","dstByteOffset","srcData"],["target","offset","data"],["target","dstByteOffset","srcData","srcOffset","length"]],checkFramebufferStatus:[["target"]],clear:[["mask"]],clearBufferfi:[["buffer","drawbuffer","depth","stencil"]],clearBufferfv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferiv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferuiv:[["buffer","drawbuffer","values","srcOffset"]],clearColor:[["red","green","blue","alpha"]],clearDepth:[["depth"]],clearStencil:[["s"]],clientWaitSync:[["sync","flags","timeout"]],colorMask:[["red","green","blue","alpha"]],compileShader:[["shader"]],compressedTexImage2D:[["target","level","internalformat","width","height","border","data"],["target","level","internalformat","width","height","border","imageSize","offset"],["target","level","internalformat","width","height","border","srcData","srcOffset","srcLengthOverride"]],compressedTexImage3D:[["target","level","internalformat","width","height","depth","border","imageSize","offset"],["target","level","internalformat","width","height","depth","border","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage2D:[["target","level","xoffset","yoffset","width","height","format","data"],["target","level","xoffset","yoffset","width","height","format","imageSize","offset"],["target","level","xoffset","yoffset","width","height","format","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","imageSize","offset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","srcData","srcOffset","srcLengthOverride"]],copyBufferSubData:[["readTarget","writeTarget","readOffset","writeOffset","size"]],copyTexImage2D:[["target","level","internalformat","x","y","width","height","border"]],copyTexSubImage2D:[["target","level","xoffset","yoffset","x","y","width","height"]],copyTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","x","y","width","height"]],createBuffer:[[]],createFramebuffer:[[]],createProgram:[[]],createQuery:[[]],createRenderbuffer:[[]],createSampler:[[]],createShader:[["type"]],createTexture:[[]],createTransformFeedback:[[]],createVertexArray:[[]],cullFace:[["mode"]],deleteBuffer:[["buffer"]],deleteFramebuffer:[["framebuffer"]],deleteProgram:[["program"]],deleteQuery:[["query"]],deleteRenderbuffer:[["renderbuffer"]],deleteSampler:[["sampler"]],deleteShader:[["shader"]],deleteSync:[["sync"]],deleteTexture:[["texture"]],deleteTransformFeedback:[["tf"]],deleteVertexArray:[["vertexArray"]],depthFunc:[["func"]],depthMask:[["flag"]],depthRange:[["zNear","zFar"]],detachShader:[["program","shader"]],disable:[["cap"]],disableVertexAttribArray:[["index"]],drawArrays:[["mode","first","count"]],drawArraysInstanced:[["mode","first","count","instanceCount"]],drawBuffers:[["buffers"]],drawElements:[["mode","count","type","offset"]],drawElementsInstanced:[["mode","count","type","offset","instanceCount"]],drawRangeElements:[["mode","start","end","count","type","offset"]],enable:[["cap"]],enableVertexAttribArray:[["index"]],endQuery:[["target"]],endTransformFeedback:[[]],fenceSync:[["condition","flags"]],finish:[[]],flush:[[]],framebufferRenderbuffer:[["target","attachment","renderbuffertarget","renderbuffer"]],framebufferTexture2D:[["target","attachment","textarget","texture","level"]],framebufferTextureLayer:[["target","attachment","texture","level","layer"]],frontFace:[["mode"]],generateMipmap:[["target"]],getActiveAttrib:[["program","index"]],getActiveUniform:[["program","index"]],getActiveUniformBlockName:[["program","uniformBlockIndex"]],getActiveUniformBlockParameter:[["program","uniformBlockIndex","pname"]],getActiveUniforms:[["program","uniformIndices","pname"]],getAttachedShaders:[["program"]],getAttribLocation:[["program","name"]],getBufferParameter:[["target","pname"]],getBufferSubData:[["target","srcByteOffset","dstBuffer","dstOffset","length"]],getContextAttributes:[[]],getError:[[]],getExtension:[["extensionName"],["name"]],getFragDataLocation:[["program","name"]],getFramebufferAttachmentParameter:[["target","attachment","pname"]],getIndexedParameter:[["target","index"]],getInternalformatParameter:[["target","internalformat","pname"]],getParameter:[["pname"]],getProgramInfoLog:[["program"]],getProgramParameter:[["program","pname"]],getQuery:[["target","pname"]],getQueryParameter:[["query","pname"]],getRenderbufferParameter:[["target","pname"]],getSamplerParameter:[["sampler","pname"]],getShaderInfoLog:[["shader"]],getShaderParameter:[["shader","pname"]],getShaderPrecisionFormat:[["shadertype","precisiontype"]],getShaderSource:[["shader"]],getSupportedExtensions:[[]],getSyncParameter:[["sync","pname"]],getTexParameter:[["target","pname"]],getTransformFeedbackVarying:[["program","index"]],getUniform:[["program","location"]],getUniformBlockIndex:[["program","uniformBlockName"]],getUniformIndices:[["program","uniformNames"]],getUniformLocation:[["program","name"]],getVertexAttrib:[["index","pname"]],getVertexAttribOffset:[["index","pname"]],hint:[["target","mode"]],invalidateFramebuffer:[["target","attachments"]],invalidateSubFramebuffer:[["target","attachments","x","y","width","height"]],isBuffer:[["buffer"]],isContextLost:[[]],isEnabled:[["cap"]],isFramebuffer:[["framebuffer"]],isProgram:[["program"]],isQuery:[["query"]],isRenderbuffer:[["renderbuffer"]],isSampler:[["sampler"]],isShader:[["shader"]],isSync:[["sync"]],isTexture:[["texture"]],isTransformFeedback:[["tf"]],isVertexArray:[["vertexArray"]],lineWidth:[["width"]],linkProgram:[["program"]],pauseTransformFeedback:[[]],pixelStorei:[["pname","param"]],polygonOffset:[["factor","units"]],readBuffer:[["src"]],readPixels:[["x","y","width","height","format","type","dstData"],["x","y","width","height","format","type","offset"],["x","y","width","height","format","type","pixels"],["x","y","width","height","format","type","dstData","dstOffset"]],renderbufferStorage:[["target","internalformat","width","height"]],renderbufferStorageMultisample:[["target","samples","internalformat","width","height"]],resumeTransformFeedback:[[]],sampleCoverage:[["value","invert"]],samplerParameterf:[["sampler","pname","param"]],samplerParameteri:[["sampler","pname","param"]],scissor:[["x","y","width","height"]],shaderSource:[["shader","source"]],stencilFunc:[["func","ref","mask"]],stencilFuncSeparate:[["face","func","ref","mask"]],stencilMask:[["mask"]],stencilMaskSeparate:[["face","mask"]],stencilOp:[["fail","zfail","zpass"]],stencilOpSeparate:[["face","fail","zfail","zpass"]],texImage2D:[["target","level","internalformat","format","type","source"],["target","level","internalformat","width","height","border","format","type","pboOffset"],["target","level","internalformat","width","height","border","format","type","pixels"],["target","level","internalformat","width","height","border","format","type","source"],["target","level","internalformat","width","height","border","format","type","srcData","srcOffset"]],texImage3D:[["target","level","internalformat","width","height","depth","border","format","type","pboOffset"],["target","level","internalformat","width","height","depth","border","format","type","source"],["target","level","internalformat","width","height","depth","border","format","type","srcData"],["target","level","internalformat","width","height","depth","border","format","type","srcData","srcOffset"]],texParameterf:[["target","pname","param"]],texParameteri:[["target","pname","param"]],texStorage2D:[["target","levels","internalformat","width","height"]],texStorage3D:[["target","levels","internalformat","width","height","depth"]],texSubImage2D:[["target","level","xoffset","yoffset","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","pboOffset"],["target","level","xoffset","yoffset","width","height","format","type","pixels"],["target","level","xoffset","yoffset","width","height","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","srcData","srcOffset"]],texSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","pboOffset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","source"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","srcData","srcOffset"]],transformFeedbackVaryings:[["program","varyings","bufferMode"]],uniform1f:[["location","x"]],uniform1fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1i:[["location","x"]],uniform1iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1ui:[["location","v0"]],uniform1uiv:[["location","data","srcOffset","srcLength"]],uniform2f:[["location","x","y"]],uniform2fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2i:[["location","x","y"]],uniform2iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2ui:[["location","v0","v1"]],uniform2uiv:[["location","data","srcOffset","srcLength"]],uniform3f:[["location","x","y","z"]],uniform3fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3i:[["location","x","y","z"]],uniform3iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3ui:[["location","v0","v1","v2"]],uniform3uiv:[["location","data","srcOffset","srcLength"]],uniform4f:[["location","x","y","z","w"]],uniform4fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4i:[["location","x","y","z","w"]],uniform4iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4ui:[["location","v0","v1","v2","v3"]],uniform4uiv:[["location","data","srcOffset","srcLength"]],uniformBlockBinding:[["program","uniformBlockIndex","uniformBlockBinding"]],uniformMatrix2fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x3fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x3fv:[["location","transpose","data","srcOffset","srcLength"]],useProgram:[["program"]],validateProgram:[["program"]],vertexAttrib1f:[["index","x"]],vertexAttrib1fv:[["index","values"]],vertexAttrib2f:[["index","x","y"]],vertexAttrib2fv:[["index","values"]],vertexAttrib3f:[["index","x","y","z"]],vertexAttrib3fv:[["index","values"]],vertexAttrib4f:[["index","x","y","z","w"]],vertexAttrib4fv:[["index","values"]],vertexAttribDivisor:[["index","divisor"]],vertexAttribI4i:[["index","x","y","z","w"]],vertexAttribI4iv:[["index","values"]],vertexAttribI4ui:[["index","x","y","z","w"]],vertexAttribI4uiv:[["index","values"]],vertexAttribIPointer:[["index","size","type","stride","offset"]],vertexAttribPointer:[["index","size","type","normalized","stride","offset"]],viewport:[["x","y","width","height"]],waitSync:[["sync","flags","timeout"]]};class Uh{static getNames(e,t){const n=Bh[e];if(!n||0===n.length)return null;for(const e of n)if(e.length===t)return e;let r=null;for(const e of n)e.length>=t&&(null===r||e.lengthi.length&&(i=e);return i}static getName(e,t,n){const r=Uh.getNames(e,n);return r&&t>=0&&t{const e={};for(let t=0;t<64;t++)e["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;return e})();class qh{constructor(e){this.sources=e.sources||[],this.names=e.names||[],this.sourceRoot=e.sourceRoot||"",this.lines=qh.parseMappings(e.mappings||"")}originalPositionFor(e,t){const n={source:null,line:null,column:null,name:null},r=e-1;if(r<0||r>=this.lines.length)return n;const i=this.lines[r];if(!i||0===i.length)return n;const s=this.findSegment(i,t);if(!s)return n;const o=s.sourceIndex>=0&&s.sourceIndex=0&&s.nameIndex>1,o=e[s];o.generatedColumn<=t?(i=o,n=s+1):r=s-1}return i}static parseMappings(e){const t=[];let n=0,r=0,i=0,s=0;const o=e.split(";");for(let e=0;e0){const e=a.split(",");for(let t=0;t=4&&(n+=o[1],r+=o[2],i+=o[3],a.sourceIndex=n,a.originalLine=r,a.originalColumn=i,o.length>=5&&(s+=o[4],a.nameIndex=s)),l.push(a)}}l.sort((e,t)=>e.generatedColumn-t.generatedColumn),t.push(l)}return t}static decodeSegment(e){const t=[];let n=0;for(;n>>=1,t.push(o?-r:r)}return t}}var Qh=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})};class Zh{constructor(e){this.cache=new Map,this.inflight=new Map,this.fetchFn=e||("undefined"!=typeof fetch?fetch.bind(globalThis):void 0)}resolveFrames(e){return Qh(this,void 0,void 0,function*(){return e&&0!==e.length?Promise.all(e.map(e=>this.resolveFrame(e))):e||[]})}resolveFrame(e){return Qh(this,void 0,void 0,function*(){const t=Zh.parseFrame(e);if(!t)return e;let n;try{n=yield this.getConsumer(t.url)}catch(t){return e}if(!n)return e;const r=n.originalPositionFor(t.line,t.column);return r.source&&null!==r.line?Zh.formatFrame(t.functionName,r.name,r.source,r.line,r.column||0):e})}static parseFrame(e){if(!e)return null;let t=e.match(/^(.*?)\s*\((.+):(\d+):(\d+)\)\s*$/);return t?{functionName:t[1].trim(),url:t[2],line:parseInt(t[3],10),column:parseInt(t[4],10)}:(t=e.match(/^\s*(.+):(\d+):(\d+)\s*$/),t?{functionName:"",url:t[1].trim(),line:parseInt(t[2],10),column:parseInt(t[3],10)}:null)}static formatFrame(e,t,n,r,i){const s=t||e,o=n+":"+r+":"+i;return s?s+" ("+o+")":o}getConsumer(e){return Qh(this,void 0,void 0,function*(){if(this.cache.has(e))return this.cache.get(e);const t=this.inflight.get(e);if(t)return t;const n=this.loadConsumer(e).then(t=>(this.cache.set(e,t),this.inflight.delete(e),t)).catch(()=>(this.cache.set(e,null),this.inflight.delete(e),null));return this.inflight.set(e,n),n})}loadConsumer(e){return Qh(this,void 0,void 0,function*(){if(!this.fetchFn)return null;const t=yield this.fetchFn(e);if(!t.ok)return null;const n=yield t.text(),r=Zh.extractSourceMappingURL(n);if(!r)return null;let i;if(0===r.indexOf("data:"))i=Zh.parseDataUri(r);else{const t=Zh.resolveUrl(r,e),n=yield this.fetchFn(t);if(!n.ok)return null;i=yield n.json()}return i&&"string"==typeof i.mappings?new qh(i):null})}static extractSourceMappingURL(e){const t=/\/\/[#@]\s*sourceMappingURL=(\S+)\s*$/gm;let n,r=null;for(;null!==(n=t.exec(e));)r=n[1];return r}static parseDataUri(e){const t=e.indexOf(",");if(-1===t)return null;const n=e.substring(0,t),r=e.substring(t+1);try{const e=/;base64/i.test(n)?Zh.decodeBase64(r):decodeURIComponent(r);return JSON.parse(e)}catch(e){return null}}static decodeBase64(e){if("function"==typeof atob)return atob(e);const t=globalThis.Buffer;if(t)return t.from(e,"base64").toString("utf-8");throw new Error("No base64 decoder available.")}static resolveUrl(e,t){try{return new URL(e,t).href}catch(t){return e}}}function Jh(e){return e&&(e.text||e.name)||""}function ed(e,t){const n=[];if(!e||!t)return n;const r=e.DrawCall,i=t.DrawCall;ad("uniform",r&&r.uniforms,i&&i.uniforms,n),ad("uniformBlock",r&&r.uniformBlocks,i&&i.uniformBlocks,n);const s=sd(e,t);for(const r of s){if(td[r])continue;const i=e[r],s=t[r];(rd(i)||rd(s))&&od(i,s,r,n)}return n}const td={id:!0,name:!0,commandArguments:!0,result:!0,status:!0,marker:!0,text:!0,startTime:!0,commandEndTime:!0,endTime:!0,stackTrace:!0,consumeCommandId:!0,VisualState:!0},nd={__SPECTOR_Object_TAG:!0,__SPECTOR_Object_CustomData:!0,__SPECTOR_Metadata:!0,customData:!0,visual:!0,visualPixels:!0,VisualState:!0,texture:!0,sampler:!0,location:!0,source:!0,translatedSource:!0,analyserName:!0,uniforms:!0,uniformBlocks:!0,length:!0};function rd(e){return null!==e&&"object"==typeof e}function id(e){if(!rd(e))return null;const t=e.__SPECTOR_Object_TAG||("string"==typeof e.typeName&&"id"in e?e:null);return t&&"string"==typeof t.typeName?t.typeName:null}function sd(e,t){const n=[],r={},i=e=>{if(rd(e))for(const t in e)e.hasOwnProperty(t)&&!r[t]&&(r[t]=!0,n.push(t))};return i(e),i(t),n}function od(e,t,n,r,i=0){const s=id(e),o=id(t);if(null!==s||null!==o){const e=null!==s?s:"(absent)",t=null!==o?o:"(absent)";return void(e!==t&&r.push({path:n,previous:e,current:t}))}const a=rd(e),l=rd(t);if(!a&&!l){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}if(a!==l||i>=8){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}for(const s of sd(e,t))nd[s]||od(e?e[s]:void 0,t?t[s]:void 0,n+"."+s,r,i+1)}function ad(e,t,n,r){const i=hd(t),s=hd(n),o=[],a={};for(const e in i)i.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const e in s)s.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const t of o){const n=i.hasOwnProperty(t)?i[t]:void 0,o=s.hasOwnProperty(t)?s[t]:void 0,a=n?dd(n.value):"(absent)",l=o?dd(o.value):"(absent)";a!==l&&r.push({path:e+" "+t,previous:a,current:l}),ld(e+" "+t,n,o,r)}}function ld(e,t,n,r){const i=t&&t.texture,s=n&&n.texture;(rd(i)||rd(s))&&cd(e+" texture",i,s,r);const o=t&&t.textures,a=n&&n.textures,l=Array.isArray(o)?o.length:0,u=Array.isArray(a)?a.length:0,c=Math.max(l,u);for(let t=0;t0?o[t]:void 0,u>0?a[t]:void 0,r)}const ud=["width","height","depth","format","internalFormat","textureType"];function cd(e,t,n,r){(rd(t)||rd(n))&&(function(e,t,n,r){for(const i of ud){const s=t?t[i]:void 0,o=n?n[i]:void 0;if(void 0===s&&void 0===o)continue;const a=dd(s),l=dd(o);a!==l&&r.push({path:e+" "+i,previous:a,current:l})}}(e,t,n,r),function(e,t,n,r){if(rd(t)||rd(n))for(const i of sd(t,n)){const s=t?t[i]:void 0,o=n?n[i]:void 0,a="string"==typeof s,l="string"==typeof o;(a||l)&&s!==o&&r.push({path:e+" ("+i+")",previous:a?"(image)":"(absent)",current:l?"(image)":"(absent)",previousImage:a?s:void 0,currentImage:l?o:void 0})}}(e,t&&t.visual,n&&n.visual,r))}function hd(e){const t={};if(Array.isArray(e))for(const n of e)n&&"string"==typeof n.name&&(t[n.name]=n);return t}function dd(e){if(void 0===e)return"(absent)";if(null===e)return"null";try{return JSON.stringify(e)}catch(t){return String(e)}}function fd(e,t){for(let n=0;n{if(this.store.getSnapshot().currentCapture)switch(e){case 0:this._displayCaptures();break;case 40:this._displayCurrentCapture();break;case 10:this._displayInformation();break;case 20:this._displayInitState();break;case 30:this._displayEndState();break;case 60:this._displayCompare()}else this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))},this.handleSearchTextChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{searchText:e})),this._search(e)},this.handleCompareOnlyDifferencesChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{compareOnlyDifferences:e}))},this.handleCompareCommandSelected=e=>{null!=e&&(this._currentCommandId=e,this._displayCurrentCapture())},this.handleCommandSelected=e=>{this.selectCommand(e)},this.openTextureViewer=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{textureViewer:{open:!0,src:e.src,label:e.label,pixelated:e.pixelated,raw:e.raw||null}}))},this.closeTextureViewer=()=>{this.store.setState(e=>Object.assign(Object.assign({},e),{textureViewer:Object.assign(Object.assign({},e.textureViewer),{open:!1})}))},this.handleVisualStateSelected=e=>{this.selectVisualState(e)},this.handleVertexSelected=e=>{this.selectCommand(e),this._openShader(!1)},this.handleFragmentSelected=e=>{this.selectCommand(e),this._openShader(!0)},this.handleShaderSelected=e=>{var t;const n=null===(t=this.store.getSnapshot().commands[e])||void 0===t?void 0:t.capture.shader;n&&(this.selectCommand(e),this._openCapturedShader(n))},this.handleShaderSourceOpen=(e,t)=>{this._openCapturedShader(e,t)},this.handleSourceCodeChanged=e=>{this.onSourceCodeChanged.trigger(e)},this.handleSourceCodeClose=()=>{this._displayCurrentCapture()},this.handleSourceCodeTabChange=(e,t)=>{this.store.setState(n=>n.sourceCodeState?Object.assign(Object.assign({},n),{sourceCodeState:Object.assign(Object.assign({},n.sourceCodeState),{fragment:e,translated:t})}):n)},this.handleBeautifyChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{beautify:e})}):t)},this.handlePreprocessChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{preprocessed:e})}):t)},this.handleSaveRequested=e=>{this.saveCapture(e)},this.handleCaptureLoaded=e=>{this.addCapture(e)},this.handleClose=()=>{this.hide()},this._rootPlaceHolder=e||document.body,this.onSourceCodeChanged=new l,this.store=new ft(Object.assign({},pd)),this._container=document.createElement("div"),this._container.className="spector-react-result-view",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(yt.Provider,{value:this},(0,dt.createElement)(Mh))),this._rootPlaceHolder.addEventListener("keydown",e=>{if(40!==this.store.getSnapshot().menuStatus)return;const t=e.keyCode;38===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousCommand()):40===t?(e.preventDefault(),e.stopPropagation(),this._selectNextCommand()):33===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousVisualState()):34===t&&(e.preventDefault(),e.stopPropagation(),this._selectNextVisualState())})}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}addCapture(e){return this.store.setState(t=>{const n=t.captures.map(e=>({capture:e.capture,active:!1}));return Object.assign(Object.assign({},t),{captures:[{capture:e,active:!0},...n],currentCapture:e})}),this._currentCommandId=-1,this._displayCurrentCapture(),0}selectCapture(e){this._currentCommandId=-1,this.store.setState(t=>{var n,r;const i=t.captures.map((t,n)=>({capture:t.capture,active:n===e}));return Object.assign(Object.assign({},t),{captures:i,currentCapture:null!==(r=null===(n=i[e])||void 0===n?void 0:n.capture)&&void 0!==r?r:null})}),this._displayCurrentCapture()}selectCommand(e){const t=this.store.getSnapshot();if(e<0||e>=t.commands.length)return;const n=t.commands[e];this._currentCommandId=n.capture.id;const r=n.visualStateIndex,i=this._buildCommandDetail(e,t.commands,t.visualStates);this.store.setState(t=>Object.assign(Object.assign({},t),{commands:t.commands.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentCommandIndex:e,visualStates:t.visualStates.map((e,t)=>e.active!==(t===r)?Object.assign(Object.assign({},e),{active:t===r}):e),currentVisualStateIndex:r,commandDetailData:i}))}selectVisualState(e){const t=this.store.getSnapshot();if(e<0||e>=t.visualStates.length)return;const n=t.visualStates[e].commandIndex;if(n===Number.MIN_VALUE)return void this._displayInitState();if(n===Number.MAX_VALUE)return void this._displayEndState();n>=0&&(this._currentCommandId=t.commands[n].capture.id);const r=n>=0?this._buildCommandDetail(n,t.commands,t.visualStates):t.commandDetailData;this.store.setState(t=>Object.assign(Object.assign({},t),{visualStates:t.visualStates.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentVisualStateIndex:e,commands:n>=0?t.commands.map((e,t)=>e.active!==(t===n)?Object.assign(Object.assign({},e),{active:t===n}):e):t.commands,currentCommandIndex:n>=0?n:t.currentCommandIndex,commandDetailData:r}))}showSourceCodeError(e){this.store.setState(t=>Object.assign(Object.assign({},t),{sourceCodeError:e}))}saveCapture(e){const t=JSON.stringify(e,null,4),n=new Blob([t],{type:"octet/stream"}),r="capture "+new Date(e.startTime).toTimeString().split(" ")[0]+".json",i=document.createElement("a"),s=window.URL.createObjectURL(n);i.setAttribute("href",s),i.setAttribute("download",r),i.click()}_displayCaptures(){this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))}_displayCompare(){const e=this.store.getSnapshot(),t=e.captures.findIndex(e=>e.active),n=t>=0?e.captures[t]:null,r=n?e.captures[t+1]:null;if(!n||!r)return void this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:60,canCompare:!1,compareRows:[],compareSummary:{added:0,removed:0,changed:0,unchanged:0},compareLabel:""}));const i=function(e,t){const n=function(e,t){const n=e.length,r=t.length,i=e.map(Jh),s=t.map(Jh),o=[];for(let e=0;e<=n;e++)o.push(new Array(r+1).fill(0));for(let e=n-1;e>=0;e--)for(let t=r-1;t>=0;t--)o[e][t]=i[e]===s[t]?o[e+1][t+1]+1:Math.max(o[e+1][t],o[e][t+1]);const a=[];let l=[];const u=()=>{for(const e of l)a.push(e);l=[]};let c=0,h=0;for(;c0?a.push({type:"changed",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id,fieldDiffs:n}):a.push({type:"unchanged",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id}),c++,h++}else if(o[c+1][h]>=o[c][h+1])l.push({type:"removed",name:e[c].name,previousText:e[c].text,indexA:c}),c++;else{const n=fd(l,t[h].name);n?a.push({type:"changed",name:t[h].name,previousText:n.previousText,currentText:t[h].text,indexA:n.indexA,indexB:h,commandId:t[h].id,fieldDiffs:ed(e[n.indexA],t[h])}):(u(),a.push({type:"added",name:t[h].name,currentText:t[h].text,indexB:h,commandId:t[h].id})),h++}for(;cObject.assign(Object.assign({},e),{menuStatus:60,canCompare:!0,compareRows:i.rows,compareSummary:i.summary,compareLabel:s}))}static _captureLabel(e){try{return new Date(e.startTime).toTimeString().split(" ")[0]}catch(e){return"capture"}}_displayInformation(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];zh(n,"Canvas",t.canvas,e.searchText),zh(n,"Context",t.context,e.searchText);const r=[];for(const n of t.analyses){const t="Primitives"===n.analyserName?"Vertices count":n.analyserName;zh(r,t,n,e.searchText)}zh(r,"Frame Memory Changes",t.frameMemory,e.searchText),zh(r,"Total Memory (seconds since application start: bytes)",t.memory,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:10,commandCount:t.commands.length,informationLeft:n,informationRight:r}))}_displayInitState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.initState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:20,commandCount:t.commands.length,initStateData:n}))}_displayEndState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.endState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:30,commandCount:t.commands.length,endStateData:n}))}_displayCurrentCapture(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=e.searchText,r=e.captures.map(e=>({capture:e.capture,active:e.capture===t})),i=[];i.push({VisualState:t.initState.VisualState,time:t.startTime,commandIndex:Number.MIN_VALUE,active:!1,previousVisualStateIndex:-1,nextVisualStateIndex:-1});const s=[];let o=0,a=!1,l=-1,u=-1;for(let e=0;e0?c-1:-1,nextCommandIndex:-1,visualStateIndex:o,active:!1};if(c>0&&(s[c-1].nextCommandIndex=c),r.VisualState){const e=i.length,t=i.length-1,n={VisualState:r.VisualState,time:r.endTime,commandIndex:c,active:!1,previousVisualStateIndex:t,nextVisualStateIndex:-1};i[t].nextVisualStateIndex=e,i.push(n),o=e,a=!0}else a||(i[0].commandIndex=c,a=!0);h.visualStateIndex=o,s.push(h),(-1===this._currentCommandId&&0===c||this._currentCommandId===r.id)&&(l=c,u=o)}l>=0&&(s[l].active=!0,this._currentCommandId=s[l].capture.id),u>=0&&(i[u].active=!0);let c=[];l>=0&&(c=this._buildCommandDetail(l,s,i)),this.store.setState(e=>Object.assign(Object.assign({},e),{captures:r,menuStatus:40,commandCount:t.commands.length,commands:s,currentCommandIndex:l,visualStates:i,currentVisualStateIndex:u,sourceCodeState:null,sourceCodeError:"",commandDetailData:c}))}_openShader(e){const t=this.store.getSnapshot();if(t.currentCommandIndex<0||t.currentCommandIndex>=t.commands.length)return;const n=t.commands[t.currentCommandIndex].capture.DrawCall;if(!n||!n.shaders||n.shaders.length<2)return;const r={programId:n.programStatus.program.__SPECTOR_Object_TAG.id,nameVertex:n.shaders[0].name,nameFragment:n.shaders[1].name,sourceVertex:n.shaders[0].source,sourceFragment:n.shaders[1].source,translatedSourceVertex:n.shaders[0].translatedSource,translatedSourceFragment:n.shaders[1].translatedSource,fragment:e,translated:!1,editable:n.programStatus.RECOMPILABLE,beautify:!0,preprocessed:!1,singleShader:!1,sourceVertexLog:n.shaders[0].infoLog||"",sourceFragmentLog:n.shaders[1].infoLog||"",programLog:n.programStatus.infoLog||""},i=this._buildCommandDetail(t.currentCommandIndex,t.commands,t.visualStates);this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:"",commandDetailData:i}))}_openCapturedShader(e,t=""){if(!e||"string"!=typeof e.source)return;const n="FRAGMENT_SHADER"===e.shaderType,r={programId:-1,nameVertex:n?"":e.name,nameFragment:n?e.name:"",sourceVertex:n?"":e.source,sourceFragment:n?e.source:"",translatedSourceVertex:n?"":e.translatedSource||"",translatedSourceFragment:n&&e.translatedSource||"",fragment:n,translated:!1,editable:!1,beautify:!0,preprocessed:!1,singleShader:!0,sourceVertexLog:n?"":e.infoLog||"",sourceFragmentLog:n&&e.infoLog||"",programLog:t};this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:""}))}_buildCommandDetail(e,t,n){if(e<0||e>=t.length)return[];const r=t[e],i=n[r.visualStateIndex],s=this._resolvedStackTraces.get(r.capture.id),o=function(e,t,n){const r=[];t&&r.push({type:"visualState",visualState:t});let i="Unknown";switch(e.status){case 50:i="Deprecated";break;case 10:i="Unused";break;case 20:i="Disabled";break;case 30:i="Redundant";break;case 40:i="Valid"}const s=Ph.getMDNLink(e.name);e.result?zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,result:e.result,status:i},""):"LOG"!==e.name&&zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,status:i},"");for(const t in e)"VisualState"!==t&&"result"!==t&&("commandArguments"===t&&Array.isArray(e.commandArguments)?Kh(r,e.name,e.commandArguments):Xh(r,t,e)||("stackTrace"===t&&Array.isArray(e.stackTrace)?zh(r,"stackTrace",n||e.stackTrace,""):"object"==typeof e[t]&&zh(r,t,e[t],"")));return r}(r.capture,null==i?void 0:i.VisualState,s);return s||this._resolveStackTraceAsync(r.capture),o}_resolveStackTraceAsync(e){const t=e.id;this._resolvedStackTraces.has(t)||this._resolvingStackTraces.has(t)||e.stackTrace&&0!==e.stackTrace.length&&(this._resolvingStackTraces.add(t),this._sourceMapResolver.resolveFrames(e.stackTrace).then(n=>{this._resolvingStackTraces.delete(t),this._resolvedStackTraces.set(t,n);let r=!1;for(let t=0;tObject.assign(Object.assign({},t),{commandDetailData:e}))}}).catch(()=>{this._resolvingStackTraces.delete(t)}))}_selectPreviousCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.previousCommandIndex<0||this.selectCommand(t.previousCommandIndex)}_selectNextCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.nextCommandIndex<0||this.selectCommand(t.nextCommandIndex)}_selectPreviousVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.previousVisualStateIndex<0||this.selectVisualState(t.previousVisualStateIndex)}_selectNextVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.nextVisualStateIndex<0||this.selectVisualState(t.nextVisualStateIndex)}_search(e){switch(this.store.getSnapshot().menuStatus){case 0:case 40:this._displayCurrentCapture();break;case 30:this._displayEndState();break;case 10:this._displayInformation();break;case 20:this._displayInitState()}this.store.setState(e=>Object.assign(Object.assign({},e),{searchText:""}))}}class gd{constructor(e,t={}){this.worker=e,this.captureTimeout=t.captureTimeout||1e4,this.disposed=!1,this.captureTimer=null,this.onCapture=new l,this.onCaptureStarted=new l,this.onError=new l,this.onFps=new l,this.onContextReady=new l,this.messageHandler=this.handleMessage.bind(this),this.worker.addEventListener("message",this.messageHandler)}triggerCapture(e=0,t=0,n=!1,r=!1){if(this.disposed)return;this.clearCaptureTimer();const i={type:"spector:trigger-capture",version:1,canvasIndex:e,commandCount:t,quickCapture:n,fullCapture:r};this.worker.postMessage(i),this.captureTimer=setTimeout(()=>{this.onError.trigger("Capture timed out after "+this.captureTimeout+"ms"),this.captureTimer=null},this.captureTimeout)}dispose(){this.disposed||(this.disposed=!0,this.clearCaptureTimer(),this.worker.removeEventListener("message",this.messageHandler),this.onCapture.clear(),this.onCaptureStarted.clear(),this.onError.clear(),this.onFps.clear(),this.onContextReady.clear())}handleMessage(e){const t=e.data;if(!function(e){return null!=e&&"object"==typeof e&&"string"==typeof e.type&&0===e.type.indexOf("spector:")}(t))return;const n=t;switch(n.type){case"spector:context-ready":this.onContextReady.trigger({canvasCount:n.canvasCount,canvasWidth:n.canvasWidth,canvasHeight:n.canvasHeight});break;case"spector:capture-started":this.onCaptureStarted.trigger(void 0);break;case"spector:capture-complete":this.clearCaptureTimer(),this.onCapture.trigger(n.capture);break;case"spector:error":this.clearCaptureTimer(),this.onError.trigger(n.error);break;case"spector:fps":this.onFps.trigger(n.fps)}}clearCaptureTimer(){null!=this.captureTimer&&(clearTimeout(this.captureTimer),this.captureTimer=null)}}var Ed=n(72),vd=n.n(Ed),Cd=n(825),Dd=n.n(Cd),Sd=n(659),Ad=n.n(Sd),_d=n(56),yd=n.n(_d),bd=n(540),Td=n.n(bd),Rd=n(113),xd=n.n(Rd),wd=n(377),Fd={};Fd.styleTagTransform=xd(),Fd.setAttributes=yd(),Fd.insert=Ad().bind(null,"html"),Fd.domAPI=Dd(),Fd.insertStyleElement=Td(),vd()(wd.A,Fd),wd.A&&wd.A.locals&&wd.A.locals;var Nd=n(160),Ld={};Ld.styleTagTransform=xd(),Ld.setAttributes=yd(),Ld.insert=Ad().bind(null,"html"),Ld.domAPI=Dd(),Ld.insertStyleElement=Td(),vd()(Nd.A,Ld),Nd.A&&Nd.A.locals&&Nd.A.locals;class Od{constructor(e){this.timeSpy=e,this.init()}spyXRSession(e){this.currentXRSession&&this.unspyXRSession();for(const e of at.getRequestAnimationFrameFunctionNames())y.resetOriginFunction(this.timeSpy.getSpiedScope(),e);this.timeSpy.spyRequestAnimationFrame("requestAnimationFrame",e),this.currentXRSession=e}unspyXRSession(){if(this.currentXRSession){y.resetOriginFunction(this.currentXRSession,"requestAnimationFrame"),this.currentXRSession=void 0;for(const e of at.getRequestAnimationFrameFunctionNames())this.timeSpy.spyRequestAnimationFrame(e,this.timeSpy.getSpiedScope())}}init(){if(!navigator.xr)return;class e extends XRWebGLLayer{constructor(e,t,n){super(e,t,n),this.glContext=t}getContext(){return this.glContext}}class t extends XRWebGLBinding{constructor(e,t){super(e,t),this.glContext=t}createProjectionLayer(e){const t=super.createProjectionLayer(e);return t.glContext=this.glContext,t}}window.XRWebGLLayer=e,window.XRWebGLBinding=t;const n=navigator.xr.requestSession;Object.defineProperty(navigator.xr,"requestSessionInternal",{writable:!0}),navigator.xr.requestSessionInternal=n,Object.defineProperty(navigator.xr,"requestSession",{writable:!0}),navigator.xr.requestSession=(e,t)=>((e,t)=>navigator.xr.requestSessionInternal(e,t).then(e=>{const t=e;return t._updateRenderState=e.updateRenderState,t.updateRenderState=e=>function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){if(e.baseLayer){const n=e.baseLayer;t.glContext=n.getContext()}if(e.layers)for(const n of e.layers){const e=n;e.glContext&&(t.glContext=e.glContext)}return t._updateRenderState(e)}),this.spyXRSession(t),e.addEventListener("end",()=>{this.unspyXRSession()}),Promise.resolve(e)}))(e,t)}}const Id={CaptureMenu:_t,ResultView:md};class kd{static getFirstAvailable3dContext(e){return this.tryGetContextFromHelperField(e)||this.tryGetContextFromCanvas(e,"webgl")||this.tryGetContextFromCanvas(e,"experimental-webgl")||this.tryGetContextFromCanvas(e,"webgl2")||this.tryGetContextFromCanvas(e,"experimental-webgl2")}static tryGetContextFromHelperField(e){const t=e instanceof HTMLCanvasElement?e.getAttribute("__spector_context_type"):e.__spector_context_type;if(t)return this.tryGetContextFromCanvas(e,t)}static tryGetContextFromCanvas(e,t){let n;try{n=e.getContext(t)}catch(e){}return n}constructor(e={}){this.noFrameTimeout=-1,this.options=Object.assign({enableXRCapture:!1},e),this.captureNextFrames=0,this.captureNextCommands=0,this.quickCapture=!1,this.fullCapture=!1,this.retry=0,this.contexts=[],this.workerBridges=new Map,this.timeSpy=new at,this.onCaptureStarted=new l,this.onCapture=new l,this.onError=new l,this.timeSpy.onFrameStart.add(this.onFrameStart,this),this.timeSpy.onFrameEnd.add(this.onFrameEnd,this),this.timeSpy.onError.add(this.onErrorInternal,this),ct.install(),this.options.enableXRCapture&&(this.xrSpy=new Od(this.timeSpy))}displayUI(e=!1){this.captureMenu||(this.getCaptureUI(),this.captureMenu.onPauseRequested.add(this.pause,this),this.captureMenu.onPlayRequested.add(this.play,this),this.captureMenu.onPlayNextFrameRequested.add(this.playNextFrame,this),this.captureMenu.onCaptureRequested.add(e=>{e&&(e.ref instanceof Worker?this.captureWorker(e.ref):this.captureCanvas(e.ref))},this),setInterval(()=>{this.captureMenu.setFPS(this.getFps())},1e3),e||this.captureMenu.trackPageCanvases(),this.captureMenu.display()),this.resultView||(this.getResultUI(),this.onCapture.add(e=>{this.resultView.display(),this.resultView.addCapture(e)}))}getResultUI(){return this.resultView||(this.resultView=new md,this.resultView.onSourceCodeChanged.add(e=>{this.rebuildProgramFromProgramId(e.programId,e.sourceVertex,e.sourceFragment,t=>{this.referenceNewProgram(e.programId,t),this.resultView.showSourceCodeError(null)},e=>{this.resultView.showSourceCodeError(e)})})),this.resultView}getCaptureUI(){return this.captureMenu||(this.captureMenu=new _t),this.captureMenu}rebuildProgramFromProgramId(e,t,n,r,i){const s=Pe.getFromGlobalStore(e);this.rebuildProgram(s,t,n,r,i)}rebuildProgram(e,t,n,r,i){o.rebuildProgram(e,t,n,r,i)}referenceNewProgram(e,t){Pe.updateInGlobalStore(e,t)}pause(){this.timeSpy.changeSpeedRatio(0)}play(){this.timeSpy.changeSpeedRatio(1)}playNextFrame(){this.timeSpy.playNextFrame()}drawOnlyEveryXFrame(e){this.timeSpy.changeSpeedRatio(e)}getFps(){return this.timeSpy.getFps()}spyCanvases(){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt,this.canvasSpy.onContextRequested.add(this.spyContext,this))}spyCanvas(e){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt(e),this.canvasSpy.onContextRequested.add(this.spyContext,this))}getAvailableContexts(){return this.contexts}setShaderCompileDelay(e){ct.install(),ct.setDelay(e)}clearShaderCompileDelay(){ct.setDelay(0)}getShaderCompileDelay(){return ct.getDelay()}captureCanvas(e,t=0,n=!1,r=!1){const i=this.getAvailableContextSpyByCanvas(e);if(i)this.captureContextSpy(i,t,n,r);else{const i=kd.getFirstAvailable3dContext(e);i?this.captureContext(i,t,n,r):a.error("No webgl context available on the chosen canvas.")}}captureContext(e,t=0,n=!1,r=!1){let i=this.getAvailableContextSpyByCanvas(e.canvas);i||(i=e.getIndexedParameter?new ot({context:e,version:2,recordAlways:!1}):new ot({context:e,version:1,recordAlways:!1}),i.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:i.context.canvas,contextSpy:i})),i&&this.captureContextSpy(i,t,n,r)}captureXRContext(e=0,t=!1,n=!1){this.captureContext(this.getXRContext(),e,t,n)}captureContextSpy(e,t=0,n=!1,r=!1){this.quickCapture=n,this.fullCapture=r,this.capturingContext?this.onErrorInternal("Already capturing a context."):(this.retry=0,this.capturingContext=e,this.capturingContext.setMarker(this.marker),(t=Math.min(t,1e4))>0?this.captureCommands(t):this.captureFrames(1),this.noFrameTimeout=setTimeout(()=>{t>0?this.stopCapture():this.capturingContext&&this.retry>1?this.onErrorInternal("No frames with gl commands detected. Try moving the camera."):this.onErrorInternal("No frames detected. Try moving the camera or implementing requestAnimationFrame.")},1e4))}captureNextFrame(e,t=!1,n=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,0,t,n):this.captureContext(e,0,t,n)}startCapture(e,t,n=!1,r=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,t,n,r):this.captureContext(e,t,n,r)}stopCapture(){if(this.capturingContext){const e=this.capturingContext.stopCapture();if(e.commands.length>0)return this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),this.triggerCapture(e),this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,e;0===this.captureNextCommands&&(this.retry++,this.captureFrames(1))}}setMarker(e){this.marker=e,this.capturingContext&&this.capturingContext.setMarker(e)}clearMarker(){this.marker=null,this.capturingContext&&this.capturingContext.clearMarker()}addRequestAnimationFrameFunctionName(e){this.timeSpy.addRequestAnimationFrameFunctionName(e)}setSpiedScope(e){this.timeSpy.setSpiedScope(e)}log(e){this.capturingContext&&this.capturingContext.log(e)}spyWorkers(e="spector.worker.bundle.js"){ut.startIntercepting(e)}stopSpyingWorkers(){ut.stopIntercepting()}spyWorker(e){let t=this.workerBridges.get(e);return t||(t=new gd(e),t.onCapture.add(e=>{this.triggerCapture(e)},this),t.onError.add(e=>{this.onErrorInternal(e)},this),t.onContextReady.add(t=>{if(this.captureMenu){const n=this.workerBridges.size;this.captureMenu.addCanvasInformation({id:"Worker "+n,width:t.canvasWidth,height:t.canvasHeight,ref:e})}},this),t.onFps.add(e=>{this.captureMenu&&this.captureMenu.setFPS(e)},this),this.workerBridges.set(e,t),t)}captureWorker(e,t=0,n=!1,r=!1){this.workerBridges.has(e)||this.spyWorker(e);const i=this;e.addEventListener("message",function t(n){n.data&&"spector:capture-complete"===n.data.type&&(e.removeEventListener("message",t),i.triggerCapture(n.data.capture))}),e.postMessage({type:"spector:trigger-capture",version:1,canvasIndex:0,commandCount:t,quickCapture:n,fullCapture:r})}captureFrames(e){this.captureNextFrames=e,this.captureNextCommands=0,this.playNextFrame()}captureCommands(e){this.captureNextFrames=0,this.captureNextCommands=e,this.play(),this.capturingContext?(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(e,this.quickCapture,this.fullCapture)):(this.onErrorInternal("No context to capture from."),this.captureNextCommands=0)}spyContext(e){let t=this.getAvailableContextSpyByCanvas(e.context.canvas);t||(t=new ot({context:e.context,version:e.contextVersion,recordAlways:!0}),t.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:t.context.canvas,contextSpy:t})),t.spy()}getAvailableContextSpyByCanvas(e){for(const t of this.contexts)if(t.canvas===e)return t.contextSpy}getXRContext(){return this.options.enableXRCapture||a.error("Cannot retrieve WebXR context if capturing WebXR is disabled."),this.xrSpy.currentXRSession||a.error("No currently active WebXR session."),this.xrSpy.currentXRSession.glContext}onFrameStart(){this.captureNextCommands>0||(this.captureNextFrames>0?(this.capturingContext&&(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(0,this.quickCapture,this.fullCapture)),this.captureNextFrames--):this.capturingContext=void 0)}onFrameEnd(){this.captureNextCommands>0||0===this.captureNextFrames&&this.stopCapture()}triggerCapture(e){this.captureMenu&&this.captureMenu.captureComplete(null),this.onCapture.trigger(e)}onErrorInternal(e){if(a.error(e),this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),!this.capturingContext)throw e;this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,this.retry=0,this.captureMenu&&this.captureMenu.captureComplete(e),this.onError.trigger(e)}}},180(e,t,n){e=n.nmd(e),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/lang"),s=e("../lib/event"),o='.ace_search {background-color: #ddd;color: #666;border: 1px solid #cbcbcb;border-top: 0 none;overflow: hidden;margin: 0;padding: 4px 6px 0 4px;position: absolute;top: 0;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {margin: 0 20px 4px 0;overflow: hidden;line-height: 1.9;}.ace_replace_form {margin-right: 0;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {border-radius: 3px 0 0 3px;background-color: white;color: black;border: 1px solid #cbcbcb;border-right: 0 none;outline: 0;padding: 0;font-size: inherit;margin: 0;line-height: inherit;padding: 0 6px;min-width: 17em;vertical-align: top;min-height: 1.8em;box-sizing: content-box;}.ace_searchbtn {border: 1px solid #cbcbcb;line-height: inherit;display: inline-block;padding: 0 6px;background: #fff;border-right: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;margin: 0;position: relative;color: #666;}.ace_searchbtn:last-child {border-radius: 0 3px 3px 0;border-right: 1px solid #cbcbcb;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn:hover {background-color: #eef1f6;}.ace_searchbtn.prev, .ace_searchbtn.next {padding: 0px 0.7em}.ace_searchbtn.prev:after, .ace_searchbtn.next:after {content: "";border: solid 2px #888;width: 0.5em;height: 0.5em;border-width: 2px 0 0 2px;display:inline-block;transform: rotate(-45deg);}.ace_searchbtn.next:after {border-width: 0 2px 2px 0 ;}.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;font: 16px/16px Arial;padding: 0;height: 14px;width: 14px;top: 9px;right: 7px;position: absolute;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;box-sizing: border-box!important;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;clear: both;}.ace_search_counter {float: left;font-family: arial;padding: 0 8px;}',a=e("../keyboard/hash_handler").HashHandler,l=e("../lib/keys");r.importCssString(o,"ace_searchbox");var u=function(e,t,n){var i=r.createElement("div");r.buildDom(["div",{class:"ace_search right"},["span",{action:"hide",class:"ace_searchbtn_close"}],["div",{class:"ace_search_form"},["input",{class:"ace_search_field",placeholder:"Search for",spellcheck:"false"}],["span",{action:"findPrev",class:"ace_searchbtn prev"},"​"],["span",{action:"findNext",class:"ace_searchbtn next"},"​"],["span",{action:"findAll",class:"ace_searchbtn",title:"Alt-Enter"},"All"]],["div",{class:"ace_replace_form"},["input",{class:"ace_search_field",placeholder:"Replace with",spellcheck:"false"}],["span",{action:"replaceAndFindNext",class:"ace_searchbtn"},"Replace"],["span",{action:"replaceAll",class:"ace_searchbtn"},"All"]],["div",{class:"ace_search_options"},["span",{action:"toggleReplace",class:"ace_button",title:"Toggle Replace mode",style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{class:"ace_search_counter"}],["span",{action:"toggleRegexpMode",class:"ace_button",title:"RegExp Search"},".*"],["span",{action:"toggleCaseSensitive",class:"ace_button",title:"CaseSensitive Search"},"Aa"],["span",{action:"toggleWholeWords",class:"ace_button",title:"Whole Word Search"},"\\b"],["span",{action:"searchInSelection",class:"ace_button",title:"Search In Selection"},"S"]]],i),this.element=i.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),r.importCssString(o,"ace_searchbox",e.container)};(function(){this.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},this.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;s.addListener(e,"mousedown",function(e){setTimeout(function(){t.activeInput.focus()},0),s.stopPropagation(e)}),s.addListener(e,"click",function(e){var n=(e.target||e.srcElement).getAttribute("action");n&&t[n]?t[n]():t.$searchBarKb.commands[n]&&t.$searchBarKb.commands[n].exec(t),s.stopPropagation(e)}),s.addCommandKeyListener(e,function(e,n,r){var i=l.keyCodeToString(r),o=t.$searchBarKb.findKeyCommand(n,i);o&&o.exec&&(o.exec(t),s.stopEvent(e))}),this.$onChange=i.delayedCall(function(){t.find(!1,!1)}),s.addListener(this.searchInput,"input",function(){t.$onChange.schedule(20)}),s.addListener(this.searchInput,"focus",function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()}),s.addListener(this.replaceInput,"focus",function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()})},this.$closeSearchBarKb=new a([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new a,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.editor.getReadOnly()||(e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus())},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),this.setSearchRange=function(e){this.searchRange=e,e?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(e){r.setCssClass(this.replaceOption,"checked",this.searchRange),r.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var t=this.editor.getReadOnly();this.replaceOption.style.display=t?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!t?"":"none",this.find(!1,!1,e)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,n){var i=!this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n,range:this.searchRange})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",i),this.editor._emit("findSearchBox",{match:!i}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,n=0,r=0;if(t){var i=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),s=e.session.doc.positionToIndex(e.selection.anchor);this.searchRange&&(s-=e.session.doc.positionToIndex(this.searchRange.start));for(var o,a=t.lastIndex=0;(o=t.exec(i))&&(n++,(a=o.index)<=s&&r++,!(n>999))&&(o[0]||(t.lastIndex=a+=1,!(a>=i.length))););}this.searchCounter.textContent=r+" of "+(n>999?"999+":n)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(u.prototype),t.SearchBox=u,t.Search=function(e,t){(e.searchBox||new u(e)).show(e.session.getTextRange(),t)}}),ace.require(["ace/ext/searchbox"],function(t){e&&(e.exports=t)})},49(e,t,n){e=n.nmd(e),ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=t.cFunctions="\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b",a=function(){var e=this.$keywords=this.createKeywordMapper({"keyword.control":"break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while|catch|operator|try|throw|using","storage.type":"asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|class|wchar_t|template|char16_t|char32_t","storage.modifier":"const|extern|register|restrict|static|volatile|inline|private|protected|public|friend|explicit|virtual|export|mutable|typename|constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local","keyword.operator":"and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace","variable.language":"this","constant.language":"NULL|true|false|TRUE|FALSE|nullptr"},"identifier"),t=/\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source,n="%"+/(\d+\$)?/.source+/[#0\- +']*/.source+/[,;:_]?/.source+/((-?\d+)|\*(-?\d+\$)?)?/.source+/(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source+/(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source+/(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source;this.$rules={start:[{token:"comment",regex:"//$",next:"start"},{token:"comment",regex:"//",next:"singleLineComment"},i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string",regex:"'(?:"+t+"|.)?'"},{token:"string.start",regex:'"',stateName:"qqstring",next:[{token:"string",regex:/\\\s*$/,next:"qqstring"},{token:"constant.language.escape",regex:t},{token:"constant.language.escape",regex:n},{token:"string.end",regex:'"|$',next:"start"},{defaultToken:"string"}]},{token:"string.start",regex:'R"\\(',stateName:"rawString",next:[{token:"string.end",regex:'\\)"',next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"keyword",regex:"#\\s*(?:include|import|pragma|line|define|undef|version)\\b",next:"directive"},{token:"keyword",regex:"#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b"},{token:"support.function.C99.c",regex:o},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*"},{token:"keyword.operator",regex:/--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],singleLineComment:[{token:"comment",regex:/\\$/,next:"singleLineComment"},{token:"comment",regex:/$/,next:"start"},{defaultToken:"comment"}],directive:[{token:"constant.other.multiline",regex:/\\/},{token:"constant.other.multiline",regex:/.*\\/},{token:"constant.other",regex:"\\s*<.+?>",next:"start"},{token:"constant.other",regex:'\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',next:"start"},{token:"constant.other",regex:"\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",next:"start"},{token:"constant.other",regex:/[^\\\/]+/,next:"start"}]},this.embedRules(i,"doc-",[i.getEndRule("start")]),this.normalizeRules()};r.inherits(a,s),t.c_cppHighlightRules=a}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var i=n[1].length,s=e.findMatchingBracket({row:t,column:i});if(!s||s.row==t)return 0;var o=this.$getIndent(e.getLine(s.row));e.replace(new r(t,0,t,i-1),o)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i,s=e.getLine(n);if(this.startRegionRe.test(s))return this.getCommentRegionBlock(e,s,n);if(i=s.match(this.foldingStartMarker)){var o=i.index;if(i[1])return this.openingBracketBlock(e,i[1],n,o);var a=e.getCommentFoldRange(n,o+i[0].length,1);return a&&!a.isMultiLine()&&(r?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(i=s.match(this.foldingStopMarker))?(o=i.index+i[0].length,i[1]?this.closingBracketBlock(e,i[1],n,o):e.getCommentFoldRange(n,o,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length,a=t+=1,l=e.getLength();++tu)break;var c=this.getFoldWidgetRange(e,"all",t);if(c){if(c.start.row<=s)break;if(c.isMultiLine())t=c.end.row;else if(r==u)break}a=t}}return new i(s,o,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\s*$/),s=e.getLength(),o=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++no)return new i(o,r,n,t.length)}}.call(o.prototype)}),ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./c_cpp_highlight_rules").c_cppHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&"comment"==s[s.length-1].type)return r;if("start"==e)(a=t.match(/^.*[\{\(\[]\s*$/))&&(r+=n);else if("doc-start"==e){if("start"==o)return"";var a;(a=t.match(/^\s*(\/?)\*/))&&(a[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/c_cpp"}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/glsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/c_cpp_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp_highlight_rules").c_cppHighlightRules,s=function(){var e=this.createKeywordMapper({"variable.language":"this",keyword:"layout|attribute|const|uniform|varying|break|continue|do|for|while|if|else|in|out|inout|float|int|void|bool|true|false|lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|samplerCube|struct","constant.language":"radians|degrees|sin|cos|tan|asin|acos|atan|pow|exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|normalize|faceforward|reflect|refract|matrixCompMult|lessThan|lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|texture2DProjLod|textureCube|textureCubeLod|gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|gl_DepthRangeParameters|gl_DepthRange|gl_Position|gl_PointSize|gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData"},"identifier");this.$rules=(new i).$rules,this.$rules.start.forEach(function(t){"function"==typeof t.token&&(t.token=e)})};r.inherits(s,i),t.glslHighlightRules=s}),ace.define("ace/mode/glsl",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/glsl_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp").Mode,s=e("./glsl_highlight_rules").glslHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.$id="ace/mode/glsl"}.call(u.prototype),t.Mode=u}),ace.require(["ace/mode/glsl"],function(t){e&&(e.exports=t)})},429(e,t,n){e=n.nmd(e),ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.require(["ace/theme/monokai"],function(t){e&&(e.exports=t)})}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r](s,s.exports,n),s.loaded=!0,s.exports}return n.amdD=function(){throw new Error("define cannot be used indirect")},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.nc=void 0,n(832),n(49),n(429),n(902),n(180),n(878)})()); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("SPECTOR",[],t):"object"==typeof exports?exports.SPECTOR=t():e.SPECTOR=t()}(self,()=>(()=>{var e={377(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.captureMenuComponent{position:absolute;padding:7px;z-index:99999;top:10px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuComponent.active{visibility:visible;display:block}.captureMenuComponent,.captureMenuComponent:after,.captureMenuComponent:before{box-sizing:content-box}.captureMenuLogComponent{position:absolute;padding:7px;z-index:80000;top:66px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuLogComponent.active{visibility:visible;display:block}.captureMenuLogComponent,.captureMenuLogComponent:after,.captureMenuLogComponent:before{box-sizing:content-box}.captureMenuLogComponent span.error{color:red}.canvasListComponent{float:left;width:50%;height:100%}.canvasListComponent [commandName=onCanvasSelection]{vertical-align:center;line-height:40px;white-space:nowrap;text-overflow:ellipsis;width:190px;display:inline-block;overflow:hidden;margin:0px 5px}.canvasListComponent [commandName=onCanvasSelection]:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.canvasListComponent ul{margin:0px;padding:7px;list-style:none;position:absolute;top:54px;left:-2px;width:400px;border:2px solid #222;background-color:#2c2c2c}.canvasListComponent ul li{margin:5px}.canvasListComponent ul li:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.captureMenuActionsComponent{float:left;width:30%;height:100%;margin-top:7.5px}.captureMenuActionsComponent div{float:left}.captureMenuActionsComponent [commandName=onCaptureRequested]{border-radius:50%;background:#2c2c2c;border:2px solid red;width:21px;height:21px}.captureMenuActionsComponent [commandName=onCaptureRequested]:hover{background:red;cursor:pointer;transition:background .3s;-webkit-transition:background .3s;-moz-transition:background .3s}.captureMenuActionsComponent [commandName=onPlayRequested],.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPlayRequested]:before,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{content:"";position:absolute;display:inline-block;margin-top:6px;margin-left:4px;width:7px;height:7px;border-top:2px solid #f9f9f9;border-right:2px solid #f9f9f9;background-color:#f9f9f9;-moz-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg);z-index:-20}.captureMenuActionsComponent [commandName=onPlayRequested]:after,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:after{content:"";position:absolute;display:inline-block;width:8px;height:20px;background-color:#2c2c2c;z-index:-10}.captureMenuActionsComponent [commandName=onPlayRequested]:hover,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPauseRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPauseRequested]:before{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:12px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:after{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:7px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{background-color:#2c2c2c}.fpsCounterComponent{float:left;width:20%;vertical-align:center;line-height:40px;white-space:nowrap}',""]);const a=o},160(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.resultViewComponent{position:absolute;z-index:99999;border:1px solid #000;top:0;left:0;bottom:0;right:0;background-color:#222;opacity:1;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.resultViewComponent.active{visibility:visible;display:block}.resultViewComponent,.resultViewComponent:after,.resultViewComponent:before{box-sizing:content-box}.resultViewMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.resultViewMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.resultViewMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.resultViewMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.resultViewMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.resultViewMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.resultViewMenuComponent a.clearSearch{padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.resultViewMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}@media all and (max-width: 1024px){.resultViewMenuComponent .resultViewMenuOpen{display:block;visibility:visible}.resultViewMenuComponent li:not(.resultViewMenuSmall){display:none;visibility:hidden}.resultViewMenuComponent li{background:#2c2c2c}.resultViewMenuComponent li.searchContainer{background:rgb(69.5,69.5,69.5)}.resultViewMenuComponent{padding:0px;position:absolute;overflow-y:visible;top:0px;left:0px;right:0px;bottom:0px;z-index:999999;display:block}.resultViewMenuComponent a.active{background:#2c2c2c}}.resultViewMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:40px;position:relative;top:-1px;box-sizing:border-box}.resultViewMenuComponent input:focus{border:0;outline:0 none}.resultViewMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.resultViewMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.resultViewMenuComponent ::-webkit-input-placeholder{color:#ccc}.resultViewMenuComponent :-moz-placeholder{color:#ccc}.resultViewMenuComponent ::-moz-placeholder{color:#ccc}.resultViewMenuComponent :-ms-input-placeholder{color:#ccc}.resultViewContentComponent{position:absolute;top:40px;left:0;bottom:0;right:0}.informationColumnLeftComponent{position:absolute;top:0;left:0;bottom:0;right:50%;overflow:auto;overflow-x:hidden;overflow-y:visible}.informationColumnRightComponent{position:absolute;top:0;left:50%;bottom:0;right:0;overflow:auto;overflow-x:hidden;overflow-y:visible}.captureListComponent{position:absolute;top:40px;left:0;bottom:0;right:0;background:#222;z-index:9000;display:none;visibility:hidden;overflow-y:visible;overflow-x:hidden}.captureListComponent.active{display:block;visibility:visible}.captureListComponent .openCaptureFile{border:1px dashed #f9f9f9;display:block;margin:5px;padding:5px;text-align:center;font-style:italic}.captureListComponent .openCaptureFile span{line-height:100%;vertical-align:middle}.captureListComponent ul{margin:0px;padding:0px;list-style:none;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-start}.captureListComponent ul li{margin:5px;border:1px solid #606060}.captureListComponent ul li img{width:295px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;display:block}.captureListComponent ul li span{display:block;text-align:center;border:5px solid #222}.captureListComponent ul li span .captureListItemSave{color:#f9f9f9;font-size:16px;margin-left:10px;position:relative;padding:3px 8px 3px 32px}.captureListComponent ul li span .captureListItemSave:before,.captureListComponent ul li span .captureListItemSave:after{box-sizing:border-box;content:"";position:absolute}.captureListComponent ul li span .captureListItemSave:before{background:#222;border-color:#f9f9f9;border-style:solid;border-width:7px 2px 1px;border-radius:1px;height:16px;left:8px;top:5px;width:16px}.captureListComponent ul li span .captureListItemSave:after{background:#f9f9f9;border-color:#d9d9d9;border-style:solid;border-width:1px 1px 1px 4px;height:5px;left:13px;top:5px;width:7px}.captureListComponent ul li:hover{cursor:pointer}.captureListComponent ul li.active span{background:#f0640d;border:5px solid #f0640d}.captureListComponent ul li.active span .captureListItemSave:before{background:#f0640d}.captureListComponent ul li.active span .captureListItemSave:after{border-color:#f0640d}.visualStateListComponent{position:absolute;top:0;left:0;bottom:0;padding:5px;right:80%;overflow-y:visible;overflow-x:hidden}.visualStateListComponent ul{margin:0px;padding:0px;list-style:none}.visualStateListComponent ul li{margin:20px 15px 0px 15px;border:1px solid #606060}.visualStateListComponent ul li img{display:block;padding:0px;box-sizing:border-box;max-height:600px;width:100%;margin:0 auto;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.visualStateListComponent ul li:hover{cursor:pointer}.visualStateListComponent ul li span{border:5px solid #222;background:#222;box-sizing:border-box;display:inline-block;width:100%;margin:0px;padding:5px;word-wrap:break-word}.visualStateListComponent ul li.active{border:2px solid #f0640d}.commandListComponent{position:absolute;top:0;left:20%;right:40%;bottom:0;color:hsl(0,0%,82.6470588235%)}.commandListComponent ul{margin:0px;padding:0px;list-style:none;overflow-y:visible;overflow-x:hidden;height:100%}.commandListComponent ul li{padding:8px}.commandListComponent ul li span{word-wrap:break-word;line-height:22px}.commandListComponent ul li:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.commandListComponent ul li:nth-child(even){background:#2c2c2c}.commandListComponent ul li:nth-child(odd){background:#222}.commandListComponent ul li .important{font-weight:800}.commandListComponent ul li .important.deprecated{color:red}.commandListComponent ul li .important.unused{color:#ff0}.commandListComponent ul li .important.disabled{color:gray}.commandListComponent ul li .important.redundant{color:orange}.commandListComponent ul li .important.valid{color:#adff2f}.commandListComponent ul li .marker{font-size:16px;font-weight:900;color:#adff2f}.commandListComponent ul li.active{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.commandListComponent ul li.drawCall{background:#5db0d7;color:#222}.commandListComponent ul li a{margin-left:5px;margin-right:5px;color:#5db0d7;background:#222;padding:5px;font-weight:900;display:inline-block}.commandDetailComponent{position:absolute;top:0;left:60%;right:0;bottom:0;overflow-y:visible;overflow-x:hidden}.jsonGroupComponent{display:block;margin:10px;padding:10px;padding-bottom:5px}.jsonGroupComponent .jsonGroupComponentTitle{display:block;font-size:16px;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:5px;margin-bottom:5px;text-transform:capitalize}.jsonGroupComponent ul{margin:0px;padding:0px;list-style:none}.jsonGroupComponent ul li:nth-child(even){background:#222}.jsonGroupComponent ul li:nth-child(odd){background:#222}.jsonItemComponentKey{color:#f0640d}.jsonItemComponentValue{white-space:pre-wrap}.jsonItemImageHolder{width:50%;margin:auto}.jsonItemImageHolder .jsonItemImage{margin:5px;display:block;border:1px solid #606060;width:100%}.jsonItemImageHolder .jsonItemImage img{width:100%;display:block;margin:auto;max-width:256px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.jsonItemImageHolder .jsonItemImage span{margin:0px;padding:5px;word-wrap:break-word;display:inline-block;width:100%;box-sizing:border-box}[commandName=onOpenSourceClicked]:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.jsonVisualStateItemComponent{text-align:center;padding:10px}.jsonVisualStateItemComponent img{background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;border:1px solid #606060;margin:5px;width:100%;max-width:512px;max-height:800px}.jsonVisualStateItemComponent span{display:block}.jsonContentComponent{position:absolute;top:0;left:0;right:0;bottom:0;padding:10px;overflow-y:visible;overflow-x:hidden}.jsonItemComponentValue{word-break:break-all;white-space:normal}.jsonSourceItemComponentOpen{font-weight:bold;color:#5db0d7;text-decoration:underline}.sourceCodeMenuComponentContainer{position:absolute;left:0;top:0;bottom:48px;right:40%}.sourceCodeMenuComponentFooter{position:absolute;left:0;right:40%;bottom:0;padding:0 15px}.sourceCodeFormatError{color:#f0640d;margin-left:15px}.sourceCodeDiagnosticsNotice{color:#5db0d7;margin-left:15px}.sourceCodeDiagnosticsNotice a{color:#c9c9c9;text-decoration:underline}.sourceCodeMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.sourceCodeMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.sourceCodeMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.sourceCodeMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.sourceCodeMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.sourceCodeMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.sourceCodeMenuComponent a.clearSearch{display:inline-block;padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.sourceCodeMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}.sourceCodeMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:100%;position:relative;top:-1px;box-sizing:border-box}.sourceCodeMenuComponent input:focus{border:0;outline:0 none}.sourceCodeMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.sourceCodeMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.sourceCodeMenuComponent ::-webkit-input-placeholder{color:#ccc}.sourceCodeMenuComponent :-moz-placeholder{color:#ccc}.sourceCodeMenuComponent ::-moz-placeholder{color:#ccc}.sourceCodeMenuComponent :-ms-input-placeholder{color:#ccc}.sourceCodeComponent{position:absolute;top:42px;left:0;bottom:48px;right:40%;background:#222;z-index:9000;overflow-x:visible;overflow:auto}.sourceCodeComponent .sourceCodeComponentTitle{font-size:16px;font-weight:800;line-height:50px;color:#f0640d;padding:1em;margin:.5em 0}.compareViewComponent{position:absolute;top:50px;left:0px;right:0px;bottom:0px;overflow:hidden;display:flex;flex-direction:column;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:13px}.compareViewComponent .compareViewEmpty,.compareViewComponent .compareViewEmptyRow,.compareViewComponent .compareDetailEmpty{padding:1em;color:#c9c9c9;text-align:center}.compareViewComponent .compareViewHeader{flex:0 0 auto;display:flex;align-items:center;gap:16px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid rgb(8.5,8.5,8.5);white-space:nowrap}.compareViewComponent .compareViewHeader .compareViewLabel{color:#5db0d7}.compareViewComponent .compareViewHeader .compareViewSummary span{margin-right:8px;font-weight:700}.compareViewComponent .compareViewHeader .compareViewSummary span.added{color:#adff2f}.compareViewComponent .compareViewHeader .compareViewSummary span.removed{color:#ff5a5a}.compareViewComponent .compareViewHeader .compareViewSummary span.changed{color:#f0640d}.compareViewComponent .compareViewHeader .compareViewSummary span.unchanged{color:#c9c9c9}.compareViewComponent .compareViewHeader .compareViewToggle{margin-left:auto;cursor:pointer;user-select:none}.compareViewComponent .compareViewHeader .compareViewToggle input{vertical-align:middle;margin-right:4px}.compareViewComponent .compareViewBody{flex:1 1 auto;display:flex;min-height:0}.compareViewComponent .compareViewLegend{flex:0 0 130px;box-sizing:border-box;padding:10px;background:#2c2c2c;border-right:2px solid #222}.compareViewComponent .compareViewLegend .compareLegendRow{display:flex;align-items:center;gap:8px;margin:8px 0}.compareViewComponent .compareViewLegend .compareLegendRow.unchanged{opacity:.5}.compareViewComponent .compareViewLegend .compareLegendChip{width:12px;height:12px;border-radius:2px;background:#c9c9c9}.compareViewComponent .compareViewLegend .added .compareLegendChip{background:#adff2f}.compareViewComponent .compareViewLegend .removed .compareLegendChip{background:#ff5a5a}.compareViewComponent .compareViewLegend .changed .compareLegendChip{background:#f0640d}.compareViewComponent .compareViewList{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;margin:0;padding:0;list-style:none}.compareViewComponent .compareViewList .compareRow{display:flex;align-items:baseline;padding:3px 10px;line-height:20px;cursor:pointer;white-space:nowrap}.compareViewComponent .compareViewList .compareRow:nth-child(odd){background:#222}.compareViewComponent .compareViewList .compareRow:nth-child(even){background:#2c2c2c}.compareViewComponent .compareViewList .compareRow .compareSign{flex:0 0 14px;font-weight:800}.compareViewComponent .compareViewList .compareRow .compareRowText{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.compareViewComponent .compareViewList .compareRow .compareCmdName{font-weight:700}.compareViewComponent .compareViewList .compareRow.added .compareSign,.compareViewComponent .compareViewList .compareRow.added .compareCmdName{color:#adff2f}.compareViewComponent .compareViewList .compareRow.removed .compareSign,.compareViewComponent .compareViewList .compareRow.removed .compareCmdName{color:#ff5a5a}.compareViewComponent .compareViewList .compareRow.changed .compareSign,.compareViewComponent .compareViewList .compareRow.changed .compareCmdName{color:#f0640d}.compareViewComponent .compareViewList .compareRow.unchanged{opacity:.55}.compareViewComponent .compareViewList .compareRow.selected{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.compareViewComponent .compareViewList .compareRow.selected .compareSign,.compareViewComponent .compareViewList .compareRow.selected .compareCmdName{color:#222}.compareViewComponent .compareViewList .compareViewEmptyRow{cursor:default}.compareViewComponent .compareViewDetail{flex:0 0 42%;box-sizing:border-box;overflow-y:auto;border-left:2px solid #222;padding:4px 12px 12px}.compareViewComponent .compareViewDetail .compareDetailGroup{margin:12px 0}.compareViewComponent .compareViewDetail .compareDetailGroup ul{margin:0;padding:0;list-style:none}.compareViewComponent .compareViewDetail .compareDetailGroup li{padding:2px 0;white-space:pre-wrap;word-break:break-word}.compareViewComponent .compareViewDetail .compareDetailTitle{display:block;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin-bottom:6px;text-transform:capitalize}.compareViewComponent .compareViewDetail .compareDetailKey{color:#f0640d}.compareViewComponent .compareViewDetail .compareCmdName{font-weight:700}.compareViewComponent .compareViewDetail .compareCmdName.added{color:#adff2f}.compareViewComponent .compareViewDetail .compareCmdName.removed{color:#ff5a5a}.compareViewComponent .compareViewDetail .compareCmdName.changed{color:#f0640d}.compareViewComponent .compareViewDetail .compareArrow{color:#c9c9c9}.compareViewComponent .compareViewDetail .compareOld{opacity:.7;text-decoration:line-through}.compareViewComponent .compareViewDetail .compareNew{color:#f9f9f9}.compareViewComponent .compareViewDetail .compareCommandLink{color:#5db0d7;text-decoration:none;cursor:pointer;border-bottom:1px dotted currentColor}.compareViewComponent .compareViewDetail .compareCommandLink:hover{color:#f0640d}.compareViewComponent .compareViewDetail .compareTextureItem{padding-bottom:6px}.compareViewComponent .compareViewDetail .compareImageDiff{display:flex;align-items:center;margin-top:4px}.compareViewComponent .compareViewDetail .compareThumb{width:48px;height:48px;object-fit:contain;margin:2px 6px 2px 0;border:1px solid rgb(8.5,8.5,8.5);background:#222;image-rendering:pixelated}.jsonItemImageClickable{cursor:zoom-in}.textureViewerOverlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:100000;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.6);font-family:Consolas,monaco,monospace;font-size:13px;color:#f9f9f9}.textureViewerOverlay .textureViewerModal{width:min(900px,92vw);height:min(640px,90vh);display:flex;flex-direction:column;overflow:hidden;background:#222;border:1px solid #000;box-shadow:0 10px 40px rgba(0,0,0,.6)}.textureViewerOverlay .textureViewerHeader{flex:0 0 auto;display:flex;align-items:center;gap:12px;height:40px;padding:0 12px;background:#2c2c2c;border-bottom:2px solid #222}.textureViewerOverlay .textureViewerHeader .textureViewerTitle{color:#5db0d7}.textureViewerOverlay .textureViewerHeader .textureViewerMeta{color:#c9c9c9;font-size:12px}.textureViewerOverlay .textureViewerHeader .textureViewerClose{margin-left:auto;width:26px;height:26px;display:flex;align-items:center;justify-content:center;border-radius:3px;color:#c9c9c9;cursor:pointer}.textureViewerOverlay .textureViewerHeader .textureViewerClose:hover{color:#f9f9f9;background:hsla(0,0%,100%,.08)}.textureViewerOverlay .textureViewerToolbar{flex:0 0 auto;display:flex;align-items:center;flex-wrap:wrap;gap:14px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid #000;font-size:12px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup{display:flex;align-items:center;gap:6px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup .lbl{color:#c9c9c9;margin-right:2px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroupEnd{margin-left:auto}.textureViewerOverlay .textureViewerToolbar .channel{width:26px;height:24px;display:flex;align-items:center;justify-content:center;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#777;font-weight:800;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .channel.on.r{background:#e14b4b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.g{background:#4bd44b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.b{background:#4b8fe1;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.a{background:#dedede;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .tvBtn{height:24px;padding:0 10px;display:inline-flex;align-items:center;gap:6px;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#f9f9f9;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .tvBtn:hover{background:#333}.textureViewerOverlay .textureViewerToolbar .tvBtn.active{background:#f0640d;color:#1a1a1a;border-color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary{border-color:#f0640d;color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary:hover{background:#f0640d;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .seg{display:flex}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn{border-radius:0;border-right-width:0}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:first-child{border-radius:3px 0 0 3px}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:last-child{border-radius:0 3px 3px 0;border-right-width:1px}.textureViewerOverlay .textureViewerToolbar .zoomVal{min-width:44px;text-align:center;color:#c9c9c9}.textureViewerOverlay .textureViewerBody{flex:1 1 auto;display:flex;min-height:0}.textureViewerOverlay .textureViewerViewport{flex:1 1 auto;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#141414}.textureViewerOverlay .textureViewerViewport.checker{background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}.textureViewerOverlay .textureViewerCanvas{image-rendering:pixelated;cursor:crosshair;box-shadow:0 0 0 1px #000}.textureViewerOverlay .textureViewerLoupe{position:absolute;display:none;width:120px;height:120px;pointer-events:none;image-rendering:pixelated;border:1px solid #000;box-shadow:0 2px 8px rgba(0,0,0,.6);background:#000;left:16px;top:16px}.textureViewerOverlay .textureViewerRail{flex:0 0 210px;box-sizing:border-box;padding:12px;overflow-y:auto;background:#2c2c2c;border-left:2px solid #222}.textureViewerOverlay .textureViewerRail .railTitle{color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin:0 0 8px;text-transform:capitalize}.textureViewerOverlay .textureViewerRail .kv{display:flex;justify-content:space-between;margin:4px 0}.textureViewerOverlay .textureViewerRail .kv .k{color:#f0640d}.textureViewerOverlay .textureViewerRail .kv .v{color:#f9f9f9}.textureViewerOverlay .textureViewerRail .swatch{width:100%;height:34px;margin:8px 0;border:1px solid #000;background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0}.textureViewerOverlay .textureViewerRail .swatch .swatchInner{width:100%;height:100%}.textureViewerOverlay .textureViewerRail .hint{color:#c9c9c9;margin-top:10px;line-height:1.5}',""]);const a=o},636(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,".ace-monokai {\n color: #f9f9f9;\n font-size: 14px;\n}\n\n.ace-monokai .ace_entity.ace_name.ace_tag,\n.ace-monokai .ace_keyword,\n.ace-monokai .ace_meta.ace_tag,\n.ace-monokai .ace_storage {\n color: #F0640D\n}\n\n.ace-monokai .ace_constant.ace_character,\n.ace-monokai .ace_constant.ace_other {\n color: #5db0d7;\n}\n\n.ace-monokai .ace_marker-layer .ace_selection {\n background: #a6e22e\n}\n\n.ace-monokai .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #a6e22e;\n}\n\n.ace-monokai .ace_marker-layer .ace_active-line {\n background: #2c2c2c\n}\n.ace-monokai .ace_gutter-active-line {\n background-color: #2c2c2c\n}\n.ace-monokai .ace_marker-layer .ace_selected-word {\n border: 1px solid #a6e22e\n}\n\n.ace-monokai .ace_constant.ace_language {\n color: #e6db74\n}\n.ace-monokai .ace_constant.ace_numeric {\n color: #ae81ff\n}\n\n.ace-monokai .ace_gutter {\n background: #222;\n color: #8F908A;\n}",""]);const a=o},314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var a=0;a0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},601(e){"use strict";e.exports=function(e){return e[1]}},832(e,t,n){e=n.nmd(e),function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,n,r){"string"==typeof e?(2==arguments.length&&(r=n),t.modules[e]||(t.payloads[e]=r,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var n,r,i=function(e,t,n){if("string"==typeof t){var r=a(e,t);if(null!=r)return n&&n(),r}else if("[object Array]"===Object.prototype.toString.call(t)){for(var i=[],o=0,l=t.length;o1&&function(e,t,n){if(Array.prototype.indexOf)return e.indexOf("",n);for(var r=0;r-1&&(n=RegExp(this.source,i.replace.call(((r=this).global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),"g","")),i.replace.call(e.slice(a.index),n,function(){for(var e=1;ea.index&&this.lastIndex--}return a},o||(RegExp.prototype.test=function(e){var t=i.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError("Function.prototype.bind called on incompatible "+t);var n=d.call(arguments,1),i=function(){if(this instanceof i){var r=t.apply(this,n.concat(d.call(arguments)));return Object(r)===r?r:this}return t.apply(e,n.concat(d.call(arguments)))};return t.prototype&&(r.prototype=t.prototype,i.prototype=new r,r.prototype=null),i});var i,s,o,a,l,u=Function.prototype.call,c=Array.prototype,h=Object.prototype,d=c.slice,f=u.bind(h.toString),p=u.bind(h.hasOwnProperty);if((l=p(h,"__defineGetter__"))&&(i=u.bind(h.__defineGetter__),s=u.bind(h.__defineSetter__),o=u.bind(h.__lookupGetter__),a=u.bind(h.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,n=[];if(n.splice.apply(n,e(20)),n.splice.apply(n,e(26)),t=n.length,n.splice(5,0,"XXX"),n.length,t+1==n.length)return!0}()){var m=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?m.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(d.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):null==e?e=0:e<0&&(e=Math.max(n+e,0)),e+ta)for(h=u;h--;)this[l+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else for(this.length=c+s,h=0;h>>0;if("[object Function]"!=f(e))throw new TypeError;for(;++i>>0,i=Array(r),s=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var o=0;o>>0,s=[],o=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var a=0;a>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,s=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s++];break}if(++s>=r)throw new TypeError("reduce of empty array with no initial value")}for(;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,s=r-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s--];break}if(--s<0)throw new TypeError("reduceRight of empty array with no initial value")}do{s in this&&(i=e.call(void 0,i,n[s],s,t))}while(s--);return i}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=C&&"[object String]"==f(this)?this.split(""):L(this),n=t.length>>>0;if(!n)return-1;var r=0;for(arguments.length>1&&(r=N(arguments[1])),r=r>=0?r:Math.max(0,n+r);r>>0;if(!n)return-1;var r=n-1;for(arguments.length>1&&(r=Math.min(r,N(arguments[1]))),r=r>=0?r:n-Math.abs(r);r>=0;r--)if(r in t&&e===t[r])return r;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:h)}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(p(e,t)){var n;if(n={enumerable:!0,configurable:!0},l){var r=e.__proto__;e.__proto__=h;var i=o(e,t),s=a(e,t);if(e.__proto__=r,i||s)return i&&(n.get=i),s&&(n.set=s),n}return n.value=e[t],n}}),Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),Object.create||(g=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var n;if(null===e)n=g();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var r=function(){};r.prototype=e,(n=new r).__proto__=e}return void 0!==t&&Object.defineProperties(n,t),n}),Object.defineProperty){var S=D({}),A="undefined"==typeof document||D(document.createElement("div"));if(!S||!A)var _=Object.defineProperty}Object.defineProperty&&!_||(Object.defineProperty=function(e,t,n){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof n&&"function"!=typeof n||null===n)throw new TypeError("Property description must be an object: "+n);if(_)try{return _.call(Object,e,t,n)}catch(e){}if(p(n,"value"))if(l&&(o(e,t)||a(e,t))){var r=e.__proto__;e.__proto__=h,delete e[t],e[t]=n.value,e.__proto__=r}else e[t]=n.value;else{if(!l)throw new TypeError("getters & setters can not be defined on this javascript engine");p(n,"get")&&i(e,t,n.get),p(n,"set")&&s(e,t,n.set)}return e}),Object.defineProperties||(Object.defineProperties=function(e,t){for(var n in t)p(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=(E=Object.freeze,function(e){return"function"==typeof e?e:E(e)})}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";p(e,t);)t+="?";e[t]=!0;var n=p(e,t);return delete e[t],n}),!Object.keys){var y=!0,b=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],T=b.length;for(var R in{toString:null})y=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)p(e,n)&&t.push(n);if(y)for(var r=0,i=T;r0||-1)*Math.floor(Math.abs(e))),e}var L=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,n){"use strict";e("./regexp"),e("./es5-shim"),"undefined"==typeof Element||Element.prototype.remove||Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,n){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var r="object"==typeof navigator?navigator:{},i=(/mac|win|linux/i.exec(r.platform)||["other"])[0].toLowerCase(),s=r.userAgent||"",o=r.appName||"";t.isWin="win"==i,t.isMac="mac"==i,t.isLinux="linux"==i,t.isIE="Microsoft Internet Explorer"==o||o.indexOf("MSAppHost")>=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,t.isAIR=s.indexOf("AdobeAIR")>=0,t.isAndroid=s.indexOf("Android")>=0,t.isChromeOS=s.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./useragent");if(t.buildDom=function e(t,n,r){if("string"==typeof t&&t){var i=document.createTextNode(t);return n&&n.appendChild(i),i}if(!Array.isArray(t))return t;if("string"!=typeof t[0]||!t[0]){for(var s=[],o=0;o=1.5,"undefined"!=typeof document){var i=document.createElement("div");t.HI_DPI&&void 0!==i.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),r.isEdge||void 0===i.style.animationName||(t.HAS_CSS_ANIMATION=!0),i=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./oop"),i=function(){var e,t,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in n.FUNCTION_KEYS)e=n.FUNCTION_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);for(t in n.PRINTABLE_KEYS)e=n.PRINTABLE_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);return r.mixin(n,n.MODIFIER_KEYS),r.mixin(n,n.PRINTABLE_KEYS),r.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)n.KEY_MODS[t]=e.filter(function(e){return t&n.KEY_MODS[e]}).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();r.mixin(t,i),t.keyCodeToString=function(e){var t=i[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./keys"),i=e("./useragent"),s=null,o=0;t.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var r=function(){n.call(e,window.event)};n._wrapper=r,e.attachEvent("on"+t,r)}},t.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,n,r){function i(e){n&&n(e),r&&r(e),t.removeListener(document,"mousemove",n,!0),t.removeListener(document,"mouseup",i,!0),t.removeListener(document,"dragstart",i,!0)}return t.addListener(document,"mousemove",n,!0),t.addListener(document,"mouseup",i,!0),t.addListener(document,"dragstart",i,!0),i},t.addMouseWheelListener=function(e,n){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),n(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}n(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),n(e)})},t.addMultiMouseDownListener=function(e,n,r,s){var o,a,l,u=0,c={2:"dblclick",3:"tripleclick",4:"quadclick"};function h(e){if(0!==t.getButton(e)?u=0:e.detail>1?++u>4&&(u=1):u=1,i.isIE){var h=Math.abs(e.clientX-o)>5||Math.abs(e.clientY-a)>5;l&&!h||(u=1),l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),1==u&&(o=e.clientX,a=e.clientY)}if(e._clicks=u,r[s]("mousedown",e),u>4)u=0;else if(u>1)return r[s](c[u],e)}function d(e){u=2,l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),r[s]("mousedown",e),r[s](c[u],e)}Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",h),i.isOldIE&&t.addListener(e,"dblclick",d)})};var a=i.isMac&&i.isOpera&&!("KeyboardEvent"in window)?function(e){return(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)}:function(e){return(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};function l(e,t,n){var l=a(t);if(!i.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(l|=8),s.altGr){if(!(3&~l))return;s.altGr=0}if(18===n||17===n){var u="location"in t?t.location:t.keyLocation;17===n&&1===u?1==s[n]&&(o=t.timeStamp):18===n&&3===l&&2===u&&t.timeStamp-o<50&&(s.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),l||13!==n||3!==(u="location"in t?t.location:t.keyLocation)||(e(t,l,-n),!t.defaultPrevented)){if(i.isChromeOS&&8&l){if(e(t,l,n),t.defaultPrevented)return;l&=-9}return!!(l||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&e(t,l,n)}}function u(){s=Object.create(null)}if(t.getModifierString=function(e){return r.KEY_MODS[a(e)]},t.addCommandKeyListener=function(e,n){var r=t.addListener;if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var o=null;r(e,"keydown",function(e){o=e.keyCode}),r(e,"keypress",function(e){return l(n,e,o)})}else{var a=null;r(e,"keydown",function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=l(n,e,e.keyCode);return a=e.defaultPrevented,t}),r(e,"keypress",function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),r(e,"keyup",function(e){s[e.keyCode]=null}),s||(u(),r(window,"focus",u))}},"object"==typeof window&&window.postMessage&&!i.isOldIE){var c=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+c++,i=function(s){s.data==r&&(t.stopPropagation(s),t.removeListener(n,"message",i),e())};t.addListener(n,"message",i),n.postMessage(r,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function n(){t.$idleBlocked?setTimeout(n,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,n=e.end,r=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(r.row,r.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(r.row,r.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else this.end.rowt)var i={row:t+1,column:0};else this.start.row0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;nDate.now()-50)||(r=!1)},cancel:function(){r=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("../lib/dom"),o=e("../lib/lang"),a=e("../clipboard"),l=i.isChrome<18,u=i.isIE,c=i.isChrome>63,h=400,d=e("../lib/keys"),f=d.KEY_MODS,p=i.isIOS,m=p?/\s/:/\n/;t.TextInput=function(e,t){var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild);var g=!1,E=!1,v=!1,C=!1,D="";i.isMobile||(n.style.fontSize="1px");var S=!1,A=!1,_="",y=0,b=0,T=0;try{var R=document.activeElement===n}catch(e){}r.addListener(n,"blur",function(e){A||(t.onBlur(e),R=!1)}),r.addListener(n,"focus",function(e){if(!A){if(R=!0,i.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),i.isEdge?setTimeout(x):x()}}),this.$focusScroll=!1,this.focus=function(){if(D||c||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var t=0!=n.getBoundingClientRect().top}catch(e){return}var r=[];if(t)for(var i=n.parentElement;i&&1==i.nodeType;)r.push(i),i.setAttribute("ace_nocontext",!0),i=!i.parentElement&&i.getRootNode?i.getRootNode().host:i.parentElement;n.focus({preventScroll:!0}),t&&r.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="","0px"==n.style.top&&(n.style.top=e)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return R},t.on("beforeEndOperation",function(){t.curOp&&"insertstring"==t.curOp.command.name||(v&&(_=n.value="",U()),x())});var x=p?function(e){if(R&&(!g||e)&&!C){e||(e="");var r="\n ab"+e+"cde fg\n";r!=n.value&&(n.value=_=r);var i=4+(e.length||(t.selection.isEmpty()?0:1));4==y&&b==i||n.setSelectionRange(4,i),y=4,b=i}}:function(){if(!v&&!C&&(R||F)){v=!0;var e=t.selection,r=e.getRange(),i=e.cursor.row,s=r.start.column,o=r.end.column,a=t.session.getLine(i);if(r.start.row!=i){var l=t.session.getLine(i-1);s=r.start.rowi+1?u.length:o,o+=a.length+1,a=a+"\n"+u}a.length>h&&(s0&&_[h]==e[h];)h++,o--;for(l=l.slice(h),h=1;a>0&&_.length-h>y-1&&_[_.length-h]==e[e.length-h];)h++,a--;u-=h-1,c-=h-1;var d=l.length-h+1;return d<0&&(o=-d,d=0),l=l.slice(0,d),r||l||u||o||a||c?(C=!0,l&&!o&&!a&&!u&&!c||S?t.onTextInput(l):t.onTextInput(l,{extendLeft:o,extendRight:a,restoreStart:u,restoreEnd:c}),C=!1,_=e,y=i,b=s,T=c,l):""},L=function(e){if(v)return B();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var r=n.value,i=N(r,!0);(r.length>500||m.test(i))&&x()},O=function(e,t,n){var r=e.clipboardData||window.clipboardData;if(r&&!l){var i=u||n?"Text":"text/plain";try{return t?!1!==r.setData(i,t):r.getData(i)}catch(e){if(!n)return O(e,t,!0)}}},I=function(e,i){var s=t.getCopyText();if(!s)return r.preventDefault(e);O(e,s)?(p&&(x(s),g=s,setTimeout(function(){g=!1},10)),i?t.onCut():t.onCopy(),r.preventDefault(e)):(g=!0,n.value=s,n.select(),setTimeout(function(){g=!1,x(),i?t.onCut():t.onCopy()}))},k=function(e){I(e,!0)},M=function(e){I(e,!1)},P=function(e){var s=O(e);a.pasteCancelled()||("string"==typeof s?(s&&t.onPaste(s,e),i.isIE&&setTimeout(x),r.preventDefault(e)):(n.value="",E=!0))};r.addCommandKeyListener(n,t.onCommandKey.bind(t)),r.addListener(n,"select",function(e){v||(g?g=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=_.length&&e.value===_&&_&&e.selectionEnd!==b}(n)&&(t.selectAll(),x()))}),r.addListener(n,"input",L),r.addListener(n,"cut",k),r.addListener(n,"copy",M),r.addListener(n,"paste",P),"oncut"in n&&"oncopy"in n&&"onpaste"in n||r.addListener(e,"keydown",function(e){if((!i.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:M(e);break;case 86:P(e);break;case 88:k(e)}});var B=function(){if(v&&t.onCompositionUpdate&&!t.$readOnly){if(S)return $();if(v.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;N(e),v.markerRange&&(v.context&&(v.markerRange.start.column=v.selectionStart=v.context.compositionStartOffset),v.markerRange.end.column=v.markerRange.start.column+b-v.selectionStart+T)}}},U=function(e){t.onCompositionEnd&&!t.$readOnly&&(v=!1,t.onCompositionEnd(),t.off("mousedown",$),e&&L())};function $(){A=!0,n.blur(),n.focus(),A=!1}var G,V=o.delayedCall(B,50).schedule.bind(null,null);function W(){clearTimeout(G),G=setTimeout(function(){D&&(n.style.cssText=D,D=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()},0)}r.addListener(n,"compositionstart",function(e){if(!v&&t.onCompositionStart&&!t.$readOnly&&(v={},!S)){setTimeout(B,0),t.on("mousedown",$);var r=t.getSelectionRange();r.end.row=r.start.row,r.end.column=r.start.column,v.markerRange=r,v.selectionStart=y,t.onCompositionStart(v),v.useTextareaForIME?(n.value="",_="",y=0,b=0):(n.msGetInputContext&&(v.context=n.msGetInputContext()),n.getInputContext&&(v.context=n.getInputContext()))}}),r.addListener(n,"compositionupdate",B),r.addListener(n,"keyup",function(e){27==e.keyCode&&n.value.lengthb&&"\n"==_[s]?o=d.end:rb&&_.slice(0,s).split("\n").length>2?o=d.down:s>b&&" "==_[s-1]?(o=d.right,a=f.option):(s>b||s==b&&b!=y&&r==s)&&(o=d.right),r!==s&&(a|=f.shift),o){if(!t.onCommandKey({},a,o)&&t.commands){o=d.keyCodeToString(o);var l=t.commands.findKeyCommand(a,o);l&&t.execCommand(l)}y=r,b=s,x("")}}};document.addEventListener("selectionchange",s),t.on("destroy",function(){document.removeEventListener("selectionchange",s)})}(0,t,n)}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/useragent");function i(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function s(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)n=2*t.row-e.start.row-e.end.row;else n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,s=e.getButton();return 0!==s?((i.getSelectionRange().isEmpty()||1==s)&&i.selection.moveToPosition(n),void(2==s&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||i.isFocused()||(i.focus(),!this.$focusTimeout||this.$clickSelection||i.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(-1==r)e=this.$clickSelection.end;else if(1==r)e=this.$clickSelection.start;else{var i=s(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(i.start),a=this.$clickSelection.comparePoint(i.end);if(-1==o&&a<=0)t=this.$clickSelection.end,i.end.row==r.row&&i.end.column==r.column||(r=i.start);else if(1==a&&o>=0)t=this.$clickSelection.start,i.start.row==r.row&&i.start.column==r.column||(r=i.end);else if(-1==o&&1==a)r=i.end,t=i.start;else{var l=s(this.$clickSelection,r);r=l.cursor,t=l.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e,t,n,r,i=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,n=this.x,r=this.y,Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))),s=Date.now();(i>0||s-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session.getBracketRange(t);r?(r.isEmpty()&&(r.start.column--,r.end.column++),this.setState("select")):(r=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=r,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,s=i?e.wheelX/i:n.vx,o=i?e.wheelY/i:n.vy;i<550&&(s=(s+n.vx)/2,o=(o+n.vy)/2);var a=Math.abs(s/o),l=!1;return a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?n.allowed=r:r-n.allowed<550&&(Math.abs(s)<=1.5*Math.abs(n.vx)&&Math.abs(o)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=r):n.allowed=0),n.t=r,n.vx=s,n.vy=o,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(i.prototype),t.DefaultHandlers=i}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}(function(){this.$init=function(){return this.$element=r.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){r.addCssClass(this.getElement(),e)},this.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(i.prototype),t.Tooltip=i}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/event"),o=e("../tooltip").Tooltip;function a(e){o.call(this,e)}i.inherits(a,o),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),s=this.getHeight();(e+=15)+i>n&&(e-=e+i-n),(t+=15)+s>r&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=function(e){var t,n,i,o=e.editor,l=o.renderer.$gutterLayer,u=new a(o.container);function c(){t&&(t=clearTimeout(t)),i&&(u.hide(),i=null,o._signal("hideGutterTooltip",u),o.removeEventListener("mousewheel",c))}function h(e){u.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",function(t){if(o.isFocused()&&0==t.getButton()&&"foldWidgets"!=l.getRegion(t)){var n=t.getDocumentPosition().row,r=o.session.selection;if(t.getShiftKey())r.selectTo(n,0);else{if(2==t.domEvent.detail)return o.selectAll(),t.preventDefault();e.$clickSelection=o.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}),e.editor.setDefaultHandler("guttermousemove",function(s){var a=s.domEvent.target||s.domEvent.srcElement;if(r.hasCssClass(a,"ace_fold-widget"))return c();i&&e.$tooltipFollowsMouse&&h(s),n=s,t||(t=setTimeout(function(){t=null,n&&!e.isMousePressed?function(){var t=n.getDocumentPosition().row,r=l.$annotations[t];if(!r)return c();if(t==o.session.getLength()){var s=o.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(s>o.session.documentToScreenRow(a.row,a.column))return c()}if(i!=r)if(i=r.text.join("
"),u.setHtml(i),u.show(),o._signal("showGutterTooltip",u),o.on("mousewheel",c),e.$tooltipFollowsMouse)h(n);else{var d=n.domEvent.target.getBoundingClientRect(),f=u.getElement().style;f.left=d.right+"px",f.top=d.bottom+"px"}}():c()},50))}),s.addListener(o.renderer.$gutter,"mouseout",function(e){n=null,i&&!t&&(t=setTimeout(function(){t=null,c()},50))}),o.on("changeSession",c)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent");function o(e){var t=e.editor,n=r.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),t.addEventListener("mousedown",this.onMouseDown.bind(e));var o,l,u,c,h,d,f,p,m,g,E,v=t.container,C=0;function D(){var e=d;(function(e,n){var r=Date.now(),i=!n||e.row!=n.row,s=!n||e.column!=n.column;!g||i||s?(t.moveCursorToPosition(e),g=r,E={x:l,y:u}):a(E.x,E.y,l,u)>5?g=null:r-g>=200&&(t.renderer.scrollCursorIntoView(),g=null)})(d=t.renderer.screenToTextCoordinates(l,u),e),function(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,s=t.renderer.layerConfig.characterWidth,o=t.renderer.scroller.getBoundingClientRect(),a={x:{left:l-o.left,right:o.right-l},y:{top:u-o.top,bottom:o.bottom-u}},c=Math.min(a.x.left,a.x.right),h=Math.min(a.y.top,a.y.bottom),d={row:e.row,column:e.column};c/s<=2&&(d.column+=a.x.left=200&&t.renderer.scrollCursorIntoView(d):m=r:m=null}(d,e)}function S(){h=t.selection.toOrientedRange(),o=t.session.addMarker(h,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(c),D(),c=setInterval(D,20),C=0,i.addListener(document,"mousemove",y)}function A(){clearInterval(c),t.session.removeMarker(o),o=null,t.selection.fromOrientedRange(h),t.isFocused()&&!p&&t.$resetCursorStyle(),h=null,d=null,C=0,m=null,g=null,i.removeListener(document,"mousemove",y)}this.onDragStart=function(e){if(this.cancelDrag||!v.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}h=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?"copy":"copyMove",s.isOpera&&(t.container.appendChild(n),n.scrollTop=0),i.setDragImage&&i.setDragImage(n,0,0),s.isOpera&&t.container.removeChild(n),i.clearData(),i.setData("Text",t.session.getTextRange()),p=!0,this.setState("drag")},this.onDragEnd=function(e){if(v.draggable=!1,p=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;f||"move"!=n||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||S(),C++,e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||(S(),C++),null!==_&&(_=null),e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragLeave=function(e){if(--C<=0&&o)return A(),f=null,i.preventDefault(e)},this.onDrop=function(e){if(d){var n=e.dataTransfer;if(p)switch(f){case"move":h=h.contains(d.row,d.column)?{start:d,end:d}:t.moveText(h,d);break;case"copy":h=t.moveText(h,d,!0)}else{var r=n.getData("Text");h={start:d,end:t.session.insert(d,r)},t.focus(),f=null}return A(),i.preventDefault(e)}},i.addListener(v,"dragstart",this.onDragStart.bind(e)),i.addListener(v,"dragend",this.onDragEnd.bind(e)),i.addListener(v,"dragenter",this.onDragEnter.bind(e)),i.addListener(v,"dragover",this.onDragOver.bind(e)),i.addListener(v,"dragleave",this.onDragLeave.bind(e)),i.addListener(v,"drop",this.onDrop.bind(e));var _=null;function y(){null==_&&(_=setTimeout(function(){null!=_&&o&&A()},20))}function b(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function T(e){var t=["copy","copymove","all","uninitialized"],n=s.isMac?e.altKey:e.ctrlKey,r="uninitialized";try{r=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var i="none";return n&&t.indexOf(r)>=0?i="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(r)>=0?i="move":t.indexOf(r)>=0&&(i="copy"),i}}function a(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=s.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;s.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton();if(1===(e.domEvent.detail||1)&&0===r&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var i=e.domEvent.target||e.domEvent.srcElement;"unselectable"in i&&(i.unselectable="on"),t.getDragDelay()?(s.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(o.prototype),t.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./mouse_event").MouseEvent,i=e("../lib/dom");t.addTouchListeners=function(e,t){var n,s,o,a,l,u,c,h,d,f="scroll",p=0,m=0,g=0,E=0;function v(){var e,n,r;d||(e=window.navigator&&window.navigator.clipboard,n=!1,r=function(r){var s,o,a=r.target.getAttribute("action");if("more"==a||!n)return n=!n,s=t.getCopyText(),o=t.session.getUndoManager().hasUndo(),void d.replaceChild(i.buildDom(n?["span",!s&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],s&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],s&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],o&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),d.firstChild);"paste"==a?e.readText().then(function(e){t.execCommand(a,e)}):a&&("cut"!=a&&"copy"!=a||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(a)),d.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&t.focus()},d=i.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){f="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),r(e)},onclick:r},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container));var s=t.selection.cursor,o=t.renderer.textToScreenCoordinates(s.row,s.column),a=t.container.getBoundingClientRect();d.style.top=o.pageY-a.top-3+"px",d.style.right="10px",d.style.display="",d.firstChild.style.display="none",t.on("input",C)}function C(e){d&&(d.style.display="none"),t.off("input",C)}function D(){l=null,clearTimeout(l);var e=t.selection.getRange(),n=e.contains(c.row,c.column);!e.isEmpty()&&n||(t.selection.moveToPosition(c),t.selection.selectWord()),f="wait",v()}e.addEventListener("contextmenu",function(e){h&&t.textInput.getElement().focus()}),e.addEventListener("touchstart",function(e){var i=e.touches;if(l||i.length>1)return clearTimeout(l),l=null,o=-1,void(f="zoom");h=t.$mouseHandler.isMousePressed=!0;var u=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,v=e.timeStamp;a=v;var C=i[0],S=C.clientX,A=C.clientY;Math.abs(n-S)+Math.abs(s-A)>u&&(o=-1),n=e.clientX=S,s=e.clientY=A,g=E=0;var _=new r(e,t);if(c=_.getDocumentPosition(),v-o<500&&1==i.length&&!p)m++,e.preventDefault(),e.button=0,function(){l=null,clearTimeout(l),t.selection.moveToPosition(c);var e=m>=2?t.selection.getLineRange(c.row):t.session.getBracketRange(c);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),f="wait"}();else{m=0;var y=t.selection.cursor,b=t.selection.isEmpty()?y:t.selection.anchor,T=t.renderer.$cursorLayer.getPixelPosition(y,!0),R=t.renderer.$cursorLayer.getPixelPosition(b,!0),x=t.renderer.scroller.getBoundingClientRect(),w=function(e,t){return(e/=d)*e+(t=t/u-.75)*t};if(e.clientXN?"cursor":"anchor"),f=N<3.5?"anchor":F<3.5?"cursor":"scroll",l=setTimeout(D,450)}o=v}),e.addEventListener("touchend",function(e){h=t.$mouseHandler.isMousePressed=!1,u&&clearInterval(u),"zoom"==f?(f="",p=0):l?(t.selection.moveToPosition(c),p=0,v()):"scroll"==f?(p+=60,u=setInterval(function(){p--<=0&&(clearInterval(u),u=null),Math.abs(g)<.01&&(g=0),Math.abs(E)<.01&&(E=0),p<20&&(g*=.9),p<20&&(E*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*g,10*E),e==t.session.getScrollTop()&&(p=0)},10),e.preventDefault(),C()):v(),clearTimeout(l),l=null}),e.addEventListener("touchmove",function(e){l&&(clearTimeout(l),l=null);var i=e.touches;if(!(i.length>1||"zoom"==f)){var o=i[0],u=n-o.clientX,c=s-o.clientY;if("wait"==f){if(!(u*u+c*c>4))return e.preventDefault();f="cursor"}n=o.clientX,s=o.clientY,e.clientX=o.clientX,e.clientY=o.clientY;var h=e.timeStamp,d=h-a;if(a=h,"scroll"==f){var p=new r(e,t);p.speed=1,p.wheelX=u,p.wheelY=c,10*Math.abs(u)1&&(i=n[n.length-2]);var o=l[t+"Path"];return null==o?o=l.basePath:"/"==r&&(t=r=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+t+r+i+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,r){var i,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{i=e(n)}catch(e){}if(i&&!t.$loading[n])return r&&r(i);if(t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r),!(t.$loading[n].length>1)){var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var r=t.$loading[n];t.$loading[n]=null,r.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,o),a),u()}};var u=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),u=function(){})};function c(i){if(a&&a.document){l.packaged=i||e.packaged||r.packaged||a.define&&n.amdD.packaged;for(var s={},o="",u=document.currentScript||document._currentScript,c=(u&&u.ownerDocument||document).getElementsByTagName("script"),d=0;d=e){for(s=h+1;s=e;)s++;for(a=h,l=s-1;a=t.length||2!=(l=n[i-1])&&3!=l||2!=(u=t[i+1])&&3!=u?4:(s&&(u=3),u==l?u:4);case 10:return 2==(l=i>0?n[i-1]:5)&&i+10&&2==n[i-1])return 2;if(s)return 4;for(f=i+1,d=t.length;f=1425&&m<=2303||64286==m;if(l=t[f],g&&(1==l||7==l))return 1}return i<1||5==(l=t[i-1])?4:n[i-1];case 5:return s=!1,o=!0,r;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:s=!1;case h:return 4}}function g(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?t>191?0:d[t]:5==n?/[\u0591-\u05f4]/.test(e)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?12:/[\u0660-\u0669\u066b-\u066c]/.test(e)?3:1642==t?c:/[\u06f0-\u06f9]/.test(e)?2:7:32==n&&t<=8287?f[255&t]:254==n&&t>=65136?7:4}t.L=0,t.R=1,t.EN=2,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,n,c){if(e.length<2)return{};var d=e.split(""),f=new Array(d.length),E=new Array(d.length),v=[];r=c?1:0,function(e,t,n,c){var h=r?u:l,d=null,f=null,p=null,E=0,v=null,C=-1,D=null,S=null,A=[];if(!c)for(D=0,c=[];D0)if(16==v){for(D=C;D-1){for(D=C;D=0&&8==c[_];_--)t[_]=r}}(d,v,d.length,n);for(var C=0;C7&&n[C]<13||4===n[C]||n[C]===h)?v[C]=t.ON_R:C>0&&"ل"===d[C-1]&&/\u0622|\u0623|\u0625|\u0627/.test(d[C])&&(v[C-1]=v[C]=t.R_H,C++);for(d[d.length-1]===t.DOT&&(v[d.length-1]=t.B),"‫"===d[0]&&(v[0]=t.RLE),C=0;C=0&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,r=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===r;)r=n,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[e];s&&(void 0===t&&(t=this.getSplitIndex()),t>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&s[i]%2!=0&&i++;for(var a=0;at&&s[i]%2==0&&(o+=this.charWidths[s[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(e,t){var n,r=this.bidiMap,i=r.bidiLevels,s=[],o=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,u=!1,c=!1,h=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,f=0;f=a&&dn+s/2;){if(n+=s,r===i.length-1){s=0;break}s=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!=0&&i[r]%2==0?(e0&&i[r-1]%2==0&&i[r]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&0===s&&i[r-1]%2==0||!this.isRtlDir&&0===r&&i[r]%2!=0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!=0&&0!==s&&r--,t=this.bidiMap.logicalFromVisual[r]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(o.prototype),t.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")})};(function(){r.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},this.$setSelection=function(e,t,n,r){var i=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||s)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n,r="number"==typeof e?e:this.lead.row,i=this.session.getFoldLine(r);return i?(r=i.start.row,n=i.end.row):n=r,!0===t?new o(r,0,n,this.session.getLine(n).length):new o(r,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i)this.moveCursorTo(i.end.row,i.end.column);else{if(this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t)),t>=n.length)return this.moveCursorTo(e,n.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(s)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)}},this.$shortWordEndIndex=function(e){var t,n=0,r=/\s/,i=this.session.tokenRe;if(i.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&r.test(t);)n++;if(n<1)for(i.lastIndex=0;(t=e[n])&&!i.test(t);)if(i.lastIndex=0,n++,r.test(t)){if(n>2){n--;break}for(;(t=e[n])&&r.test(t);)n++;if(n>2)break}}return i.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do{e++,r=this.doc.getLine(e)}while(e0&&/^\s*$/.test(r));n=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(t,n-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n,r=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(r.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(r.column),r.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=r.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?r.column=this.$desiredColumn:this.$desiredColumn=r.column);var i=this.session.screenToDocumentPosition(r.row+e,r.column,n);0!==e&&0===t&&i.row===this.lead.row&&i.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[i.row]&&(i.row>0||e>0)&&i.row++,this.moveCursorTo(i.row,i.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch(e){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,n){"use strict";var r=e("./config"),i=2e3,s=function(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],r=[],i=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",a=[],l=0;l1?this.$applyToken:u.token),h>1&&(/\\\d/.test(u.regex)?c=u.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(h=1,c=this.removeCapturingGroups(u.regex)),u.splitRegex||"string"==typeof u.token||a.push(u)),s[i]=l,i+=h,r.push(c),u.onMatch||(u.onMatch=null)}}r.length||(s[0]=0,r.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){i=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var r=[],i=0,s=n.length;ic){var E=e.substring(c,g-m.length);d.type==f?d.value+=E:(d.type&&u.push(d),d={type:f,value:E})}for(var v=0;vi){for(h>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});c1&&n[0]!==r&&n.unshift("#tmp",r),{tokens:u,state:n.length?n:r}},this.reportError=r.reportError}).call(s.prototype),t.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var n in e){for(var r=e[n],i=0;i=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(void 0!==n)return n;for(n=0;t>0;)n+=e[t-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)}}).call(i.prototype),t.TokenIterator=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r,i=e("../../lib/oop"),s=e("../behaviour").Behaviour,o=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],u=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],c={},h={'"':'"',"'":"'"},d=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,c.rangeCount!=e.multiSelect.rangeCount&&(c={rangeCount:e.multiSelect.rangeCount})),c[t])return r=c[t];r=c[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},f=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},p=function(e){this.add("braces","insertion",function(t,n,i,s,o){var l=i.getCursorPosition(),u=s.doc.getLine(l.row);if("{"==o){d(i);var c=i.getSelectionRange(),h=s.doc.getTextRange(c);if(""!==h&&"{"!==h&&i.getWrapBehavioursEnabled())return f(c,h,"{","}");if(p.isSaneInsertion(i,s))return/[\]\}\)]/.test(u[l.column])||i.inMultiSelectMode||e&&e.braces?(p.recordAutoInsert(i,s,"}"),{text:"{}",selection:[1,1]}):(p.recordMaybeInsert(i,s,"{"),{text:"{",selection:[1,1]})}else if("}"==o){if(d(i),"}"==u.substring(l.column,l.column+1)&&null!==s.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&p.isAutoInsertedClosing(l,u,o))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==o||"\r\n"==o){d(i);var m="";if(p.isMaybeInsertedClosing(l,u)&&(m=a.stringRepeat("}",r.maybeInsertedBrackets),p.clearMaybeInsertedClosing()),"}"===u.substring(l.column,l.column+1)){var g=s.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!g)return null;var E=this.$getIndent(s.getLine(g.row))}else{if(!m)return void p.clearMaybeInsertedClosing();E=this.$getIndent(u)}var v=E+s.getTabString();return{text:"\n"+v+"\n"+E+m,selection:[1,v.length,1,v.length]}}p.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,i,s){var o=i.doc.getTextRange(s);if(!s.isMultiLine()&&"{"==o){if(d(n),"}"==i.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s;r.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if("("==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"(",")");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(")"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"("==s&&(d(n),")"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("brackets","insertion",function(e,t,n,r,i){if("["==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"[","]");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if("]"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"["==s&&(d(n),"]"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("string_dquotes","insertion",function(e,t,n,r,i){var s=r.$mode.$quotes||h;if(1==i.length&&s[i]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(i))return;d(n);var o=i,a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(!(""===l||1==l.length&&s[l])&&n.getWrapBehavioursEnabled())return f(a,l,o,o);if(!l){var u=n.getCursorPosition(),c=r.doc.getLine(u.row),p=c.substring(u.column-1,u.column),m=c.substring(u.column,u.column+1),g=r.getTokenAt(u.row,u.column),E=r.getTokenAt(u.row,u.column+1);if("\\"==p&&g&&/escape/.test(g.type))return null;var v,C=g&&/string|escape/.test(g.type),D=!E||/string|escape/.test(E.type);if(m==o)(v=C!==D)&&/string\.end/.test(E.type)&&(v=!1);else{if(C&&!D)return null;if(C&&D)return null;var S=r.$mode.tokenRe;S.lastIndex=0;var A=S.test(p);S.lastIndex=0;var _=S.test(p);if(A||_)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;var y=c[u.column-2];if(p==o&&(y==o||S.test(y)))return null;v=!0}return{text:v?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.$mode.$quotes||h,o=r.doc.getTextRange(i);if(!i.isMultiLine()&&s.hasOwnProperty(o)&&(d(n),r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==o))return i.end.column++,i})};p.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new o(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",l)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var i=new o(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",l))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",u)},p.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},p.recordAutoInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isAutoInsertedClosing(i,s,r.autoInsertedLineEnd[0])||(r.autoInsertedBrackets=0),r.autoInsertedRow=i.row,r.autoInsertedLineEnd=n+s.substr(i.column),r.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isMaybeInsertedClosing(i,s)||(r.maybeInsertedBrackets=0),r.maybeInsertedRow=i.row,r.maybeInsertedLineStart=s.substr(0,i.column)+n,r.maybeInsertedLineEnd=s.substr(i.column),r.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return r.autoInsertedBrackets>0&&e.row===r.autoInsertedRow&&n===r.autoInsertedLineEnd[0]&&t.substr(e.column)===r.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return r.maybeInsertedBrackets>0&&e.row===r.maybeInsertedRow&&t.substr(e.column)===r.maybeInsertedLineEnd&&t.substr(0,e.column)==r.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){r.autoInsertedLineEnd=r.autoInsertedLineEnd.substr(1),r.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){r&&(r.maybeInsertedBrackets=0,r.maybeInsertedRow=-1)},i.inherits(p,s),t.CstyleBehaviour=p}),ace.define("ace/unicode",["require","exports","module"],function(e,t,n){"use strict";for(var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,s=[],o=0;o2?r%u!=u-1:r%u==0})}else{if(!this.blockComment)return!1;var f=this.blockComment.start,p=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+l.escapeRegExp(f)+")"),g=new RegExp("(?:"+l.escapeRegExp(p)+")\\s*$"),E=function(e,t){C(e,t)||s&&!/\S/.test(e)||(i.insertInLine({row:t,column:e.length},p),i.insertInLine({row:t,column:a},f))},v=function(e,t){var n;(n=e.match(g))&&i.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(m))&&i.removeInLine(t,n[1].length,n[0].length)},C=function(e,n){if(m.test(e))return!0;for(var r=t.getTokens(n),i=0;ie.length&&(S=e.length)}),a==1/0&&(a=S,s=!1,o=!1),c&&a%u!=0&&(a=Math.floor(a/u)*u),D(o?v:E)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(i){!i.start&&i[0]&&(i=i[0]);var s,o,a=(m=new u(t,r.row,r.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var h,d;a&&/comment/.test(a.type);){if(-1!=(g=a.value.indexOf(i.start))){var f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g;h=new c(f,p,f,p+i.start.length);break}a=m.stepBackward()}var m;for(a=(m=new u(t,r.row,r.column)).getCurrentToken();a&&/comment/.test(a.type);){var g;if(-1!=(g=a.value.indexOf(i.end))){f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g,d=new c(f,p,f,p+i.end.length);break}a=m.stepForward()}d&&t.remove(d),h&&(t.remove(h),s=h.start.row,o=-i.start.length)}else o=i.start.length,s=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);l.start.row==s&&(l.start.column+=o),l.end.row==s&&(l.end.column+=o),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var n=e[t],i=n.prototype.$id,s=r.$modes[i];s||(r.$modes[i]=s=new n),r.$modes[t]||(r.$modes[t]=s),this.$embeds.push(t),this.$modes[t]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;tthis.row)){var n=function(t,n,r){var i="insert"==t.action,s=(i?1:-1)*(t.end.row-t.start.row),o=(i?1:-1)*(t.end.column-t.start.column),a=t.start,l=i?a:t.end;return e(n,a,r)?{row:n.row,column:n.column}:e(l,n,!r)?{row:n.row+s,column:n.column+(n.row==l.row?o:0)}:{row:a.row,column:a.column}}(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(e,t,n){var r;if(r=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=r.row||this.column!=r.column){var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=e("./anchor").Anchor,l=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new a(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();void 0===e?e=n:e<0?e=0:e>=n&&(e=n-1,t=void 0);var r=this.getLine(e);return null==t&&(t=r.length),{row:e,column:t=Math.min(Math.max(t,0),r.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof o||(e=o.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,r=n.length-t+1,i=e.start.row,s=e.start.column,o=0,a=0;o20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,-1==r&&(r=t),s<=r&&n.fireUpdateEvent(s,r)}}};(function(){r.implement(this,i),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens}}).call(s.prototype),t.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=(e("./lib/oop"),e("./range").Range),s=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,n,s){if(this.regExp)for(var o=s.firstRow,a=s.lastRow,l=o;l<=a;l++){var u=this.cache[l];null==u&&((u=r.getMatchOffsets(n.getLine(l),this.regExp)).length>this.MAX_RANGES&&(u=u.slice(0,this.MAX_RANGES)),u=u.map(function(e){return new i(l,e.offset,l,e.offset+e.length)}),this.cache[l]=u.length?u:"");for(var c=u.length;c--;)t.drawSingleLineMarker(e,u[c].toScreenRange(n),this.clazz,s)}}}).call(s.prototype),t.SearchHighlight=s}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range;function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var r,i,s=0,o=this.folds,a=!0;null==t&&(t=this.end.row,n=this.end.column);for(var l=0;l0)){var l=r(e,o.start);return 0===a?t&&0!==l?-s-2:s:l>0||0===l&&!t?s:-s-1}}return-s-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},this.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],n=this.ranges,i=(n=n.sort(function(e,t){return r(e.start,t.start)}))[0],s=1;s=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=r);o++);if("insert"==e.action){for(var l=i-r,u=-t.column+n.column;or);o++)if(c.start.row==r&&c.start.column>=t.column&&(c.start.column==t.column&&this.$bias<=0||(c.start.column+=u,c.start.row+=l)),c.end.row==r&&c.end.column>=t.column){if(c.end.column==t.column&&this.$bias<0)continue;c.end.column==t.column&&u>0&&oc.start.column&&c.end.column==s[o+1].start.column&&(c.end.column-=u),c.end.column+=u,c.end.row+=l}}else for(l=r-i,u=t.column-n.column;oi);o++)c.end.rowt.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=u,c.end.row+=l):c.end.row>i&&(c.end.row+=l),c.start.rowt.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=u,c.start.row+=l):c.start.row>i&&(c.start.row+=l);if(0!=l&&o=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;for(t&&(r=n.indexOf(t)),-1==r&&(r=0);r=e)return i}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,r=t-e+1,i=0;i=t){a=e?r-=t-a:r=0);break}o>=e&&(r-=a>=e?o-a:o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n,r=this.$foldData,o=!1;e instanceof s?n=e:(n=new s(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,u=n.end.row,c=n.end.column,h=this.getFoldAt(a,l,1),d=this.getFoldAt(u,c,-1);if(h&&d==h)return h.addSubFold(n);h&&!h.range.isStart(a,l)&&this.removeFold(h),d&&!d.range.isEnd(u,c)&&this.removeFold(d);var f=this.getFoldsInRange(n.range);f.length>0&&(this.removeFolds(f),f.forEach(function(e){n.addSubFold(e)}));for(var p=0;p0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;if(null==e?(n=new r(0,0,this.getLength(),0),t=!0):n="number"==typeof e?new r(e,0,e,this.getLine(e).length):"row"in e?r.fromPoints(e,e):e,i=this.getFoldsInRangeList(n),t)this.removeFolds(i);else for(var s=i;s.length;)this.expandFolds(s),s=this.getFoldsInRangeList(n);if(i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){null==r&&(r=e.start.row),null==i&&(i=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var s=this.doc,o="";return e.walk(function(e,t,n,a){if(!(tc)break}while(s&&l.test(s.type));s=i.stepBackward()}else s=i.getCurrentToken();return u.end.row=i.getCurrentTokenRow(),u.end.column=i.getCurrentTokenColumn()+s.value.length-2,u}},this.foldAll=function(e,t,n){null==n&&(n=1e5);var r=this.foldWidgets;if(r){t=t||this.getLength();for(var i=e=e||0;i=e){i=s.end.row;try{var o=this.addFold("...",s);o&&(o.collapseChildren=n)}catch(e){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};for(var r,i=e-1;i>=0;){var s=n[i];if(null==s&&(s=n[i]=this.getFoldWidget(i)),"start"==s){var o=this.getFoldWidgetRange(i);if(r||(r=o),o&&o.end.row>=e)break}i--}return{range:-1!==i&&o,firstRange:r}},this.onFoldWidgetClick=function(e,t){var n={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var r=t.target||t.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),r=this.getLine(e),i="end"===n?-1:1,s=this.getFoldAt(e,-1===i?0:r.length,i);if(s)return t.children||t.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()&&(s=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(s.range))return this.removeFold(s),s;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,u=a.range.end.row;this.foldAll(l,u,t.all?1e4:0)}else t.children?(u=o?o.end.row:this.getLength(),this.foldAll(e+1,u,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var r=this.getParentFoldRangeData(t,!0);if(n=r.range||r.firstRange){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold("...",n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){"use strict";var r=e("../token_iterator").TokenIterator,i=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(""==n)return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t,n=this.getLine(e.row),r=!0,s=n.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(o||(s=n.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),r=!1),!o)return null;if(o[1]){if(!(a=this.$findClosingBracket(o[1],e)))return null;t=i.fromPoints(e,a),r||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a;if(!(a=this.$findOpeningBracket(o[2],e)))return null;t=i.fromPoints(a,e),r||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn()-2,u=a.value;;){for(;l>=0;){var c=u.charAt(l);if(c==i){if(0==(s-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else c==e&&(s+=1);l-=1}do{a=o.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(u=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn();;){for(var u=a.value,c=u.length;ln&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>1,s=e[i];if(t>s)n=i+1;else{if(!(t=t);s++);return(n=r[s])?(n.index=s,n.start=i-n.value.length,n):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe)),r)var i=this.tokenRe;else i=/^\s+$/.test(n.slice(t-1,t+1))?/\s/:this.nonTokenRe;var s=t;if(s>0){do{s--}while(s>=0&&n.charAt(s).match(i));s++}for(var o=t;oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,s=this.$foldData[i],o=s?s.start.row:1/0,a=t.length,l=0;lo){if((l=s.end.row+1)>=a)break;o=(s=this.$foldData[i++])?s.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>r&&(r=n[l])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var r=e[n];"insert"==r.action||"remove"==r.action?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;ne.end.column&&(s.start.column+=u),s.end.row==e.end.row&&s.end.column>e.end.column&&(s.end.column+=u)),o&&s.start.row>=e.end.row&&(s.start.row+=o,s.end.row+=o)}if(s.end=this.insert(s.start,r),i.length){var a=e.start,l=s.start,u=(o=l.row-a.row,l.column-a.column);this.addFolds(i.map(function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=u),e.end.row==a.row&&(e.end.column+=u),e.start.row+=o,e.end.row+=o,e}))}return s},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},this.outdentRows=function(e){for(var t=e.collapseRows(),n=new c(0,0,0,0),r=this.getTabSize(),i=t.start.row;i<=t.end.row;++i){var s=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o0){var i;if((i=this.getRowFoldEnd(t+n))>this.doc.getLength()-1)return 0;r=i-t}else e=this.$clipRowToDocument(e),r=(t=this.$clipRowToDocument(t))-e+1;var s=new c(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(e){return(e=e.clone()).start.row+=r,e.end.row+=r,e}),a=0==n?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+r,a),o.length&&this.addFolds(o),r},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1&&(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,i=e.end,s=r.row,o=i.row,a=o-s,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[t?"$wrapData":"$rowLengthCache"].splice(s,a);var u=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var c=0;if(m=this.getFoldLine(i.row)){m.addRemoveChars(i.row,i.column,r.column-i.column),m.shiftRow(-a);var h=this.getFoldLine(s);h&&h!==m&&(h.merge(m),m=h),c=u.indexOf(m)+1}for(;c=i.row&&m.shiftRow(-a);o=s}else{var d=Array(a);d.unshift(s,0);var f=t?this.$wrapData:this.$rowLengthCache;if(f.splice.apply(f,d),u=this.$foldData,c=0,m=this.getFoldLine(s)){var p=m.range.compareInside(r.row,r.column);0==p?(m=m.split(r.row,r.column))&&(m.shiftRow(a),m.addRemoveChars(o,0,i.column-r.column)):-1==p&&(m.addRemoveChars(s,0,i.column-r.column),m.shiftRow(a)),c=u.indexOf(m)+1}for(;c=s&&m.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===n&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(m=this.getFoldLine(s))&&m.addRemoveChars(s,r.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),l},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(n,r){var i,s,o=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,u=this.$wrapLimit,c=n;for(r=Math.min(r,o.length-1);c<=r;)(s=this.getFoldLine(c,s))?(i=[],s.walk(function(n,r,s,a){var l;if(null!=n){(l=this.$getDisplayTokens(n,i.length))[0]=e;for(var u=1;u=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}this.$computeWrapSplits=function(n,r,i){if(0==n.length)return[];var s=[],o=n.length,a=0,l=0,u=this.$wrapAsCode,c=this.$indentedSoftWrap,h=r<=Math.max(2*i,8)||!1===c?0:Math.floor(r/2);function d(e){for(var t=e-a,r=a;rr-f;){var p=a+r-f;if(n[p-1]>=10&&n[p]>=10)d(p);else if(n[p]!=e&&n[p]!=t){for(var m=Math.max(p-(r-(r>>2)),a-1);p>m&&n[p]m&&n[p]m&&9==n[p];)p--}else for(;p>m&&n[p]<10;)p--;p>m?d(++p):(2==n[p=a+r]&&p--,d(p-f))}else{for(;p!=a-1&&n[p]!=e;p--);if(p>a){d(p);continue}for(p=a+r;p39&&o<48||o>57&&o<64?i.push(9):o>=4352&&n(o)?i.push(1,2):i.push(1)}return i},this.$getStringScreenWidth=function(e,t,r){if(0==t)return[0,0];var i,s;for(null==t&&(t=1/0),r=r||0,s=0;s=4352&&n(i)?r+=2:r+=1,!(r>t));s++);return[r,s]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0){a=u[c],s=this.$docRowCache[c];var d=e>u[h-1]}else d=!h;for(var f=this.getLength()-1,p=this.getNextFoldLine(s),m=p?p.start.row:1/0;a<=e&&!(a+(l=this.getRowLength(s))>e||s>=f);)a+=l,++s>m&&(s=p.end.row+1,m=(p=this.getNextFoldLine(s,p))?p.start.row:1/0),d&&(this.$docRowCache.push(s),this.$screenRowCache.push(a));if(p&&p.start.row<=s)r=this.getFoldDisplayLine(p),s=p.start.row;else{if(a+l<=e||s>f)return{row:f,column:this.getLine(f).length};r=this.getLine(s),p=null}var g=0,E=Math.floor(e-a);if(this.$useWrapMode){var v=this.$wrapData[s];v&&(i=v[E],E>0&&v.length&&(g=v.indent,o=v[E-1]||v[v.length-1],r=r.substring(o)))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+E,s,E)&&(t=this.$bidiHandler.offsetToCol(n)),o+=this.$getStringScreenWidth(r,t-g)[1],this.$useWrapMode&&o>=i&&(o=i-1),p?p.idxToPosition(o):{row:s,column:o}},this.documentToScreenPosition=function(e,t){if(void 0===t)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r,i=0,s=null;(r=this.getFoldAt(e,t,1))&&(e=r.start.row,t=r.start.column);var o,a=0,l=this.$docRowCache,u=this.$getRowCacheIndex(l,e),c=l.length;if(c&&u>=0){a=l[u],i=this.$screenRowCache[u];var h=e>l[c-1]}else h=!c;for(var d=this.getNextFoldLine(a),f=d?d.start.row:1/0;a=f){if((o=d.end.row+1)>e)break;f=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;i+=this.getRowLength(a),a=o,h&&(this.$docRowCache.push(a),this.$screenRowCache.push(i))}var p="";d&&a>=f?(p=this.getFoldDisplayLine(d,e,t),s=d.start.row):(p=this.getLine(e).substring(0,t),s=e);var m=0;if(this.$useWrapMode){var g=this.$wrapData[s];if(g){for(var E=0;p.length>=g[E];)i++,E++;p=p.substring(g[E-1]||0,p.length),m=E>0?g.indent:0}}return{row:i,column:m+this.$getStringScreenWidth(p)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,r=0,i=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);ri&&(r=t.end.row+1,i=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var o=this.$foldData,a=0;an);s++);return[r,s]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=n}.call(p.prototype),e("./edit_session/folding").Folding.call(p.prototype),e("./edit_session/bracket_match").BracketMatch.call(p.prototype),o.defineOptions(p.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=p}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(){this.$options={}};(function(){this.set=function(e){return i.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i,o){return r=new s(e,n,i,o),!(n==o&&t.start&&t.start.start&&0!=t.skipCurrent&&r.isEqual(t.start)&&(r=null,1))}),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],a=t.re;if(t.$isMultiLine){var l,u=a.length,c=i.length-u;e:for(var h=a.offset||0;h<=c;h++){for(var d=0;dm||(o.push(l=new s(h,m,h+u-1,g)),u>2&&(h=h+u-2))}}else for(var E=0;ES&&o[d].end.row==n.end.row;)d--;for(o=o.slice(E,d+1),E=0,d=o.length;E=a;n--)if(h(n,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(n=l,a=o.row;n>=a;n--)if(h(n,Number.MAX_VALUE,e))return}};else u=function(e){var n=o.row;if(!h(n,o.column,e)){for(n+=1;n<=l;n++)if(h(n,0,e))return;if(0!=t.wrap)for(n=a,l=o.row;n<=l;n++)if(h(n,0,e))return}};if(t.$isMultiLine)var c=n.length,h=function(t,i,s){var o=r?t-c+1:t;if(!(o<0)){var a=e.getLine(o),l=a.search(n[0]);if(!(!r&&li))return!!s(o,l,o+c-1,h)||void 0}}};else h=r?function(t,r,i){var s,o=e.getLine(t),a=[],l=0;for(n.lastIndex=0;s=n.exec(o);){var u=s[0].length;if(l=s.index,!u){if(l>=o.length)break;n.lastIndex=l+=1}if(s.index+u>r)break;a.push(s.index,u)}for(var c=a.length-1;c>=0;c-=2){var h=a[c-1];if(i(t,h,t,h+(u=a[c])))return!0}}:function(t,r,i){var s,o,a=e.getLine(t);for(n.lastIndex=r;o=n.exec(a);){var l=o[0].length;if(i(t,s=o.index,t,s+l))return!0;if(!l&&(n.lastIndex=s+=1,s>=a.length))return!1}};return{forEach:u}}}).call(o.prototype),t.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/keys"),i=e("../lib/useragent"),s=r.KEY_MODS;function o(e,t){this.platform=t||(i.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function a(e,t){o.call(this,e,t),this.$singleCommand=!1}a.prototype=o.prototype,function(){function e(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var n=e&&("string"==typeof e?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var s=r[i];if(s==e)delete r[i];else if(Array.isArray(s)){var o=s.indexOf(e);-1!=o&&(s.splice(o,1),1==s.length&&(r[i]=s[0]))}}},this.bindKey=function(e,t,n){if("object"==typeof e&&e&&(null==n&&(n=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach(function(e){var r="";if(-1!=e.indexOf(" ")){var i=e.split(/\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=s[t.hashId]+t.key;r+=(r?" ":"")+n,this._addCommandToBinding(r,"chainKeys")},this),r+=" "}var o=this.parseKeys(e),a=s[o.hashId]+o.key;this._addCommandToBinding(r+a,t,n)},this)},this._addCommandToBinding=function(t,n,r){var i,s=this.commandKeyBinding;if(n)if(!s[t]||this.$singleCommand)s[t]=n;else{Array.isArray(s[t])?-1!=(i=s[t].indexOf(n))&&s[t].splice(i,1):s[t]=[s[t]],"number"!=typeof r&&(r=e(n));var o=s[t];for(i=0;ir);i++);o.splice(i,0,n)}else delete s[t]},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(n){if("string"==typeof n)return this.bindKey(n,t);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=t),this.addCommand(n))}},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),i=r[n];if(r.FUNCTION_KEYS[i])n=r.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:n.toUpperCase(),hashId:-1}}for(var s=0,o=t.length;o--;){var a=r.KEY_MODS[t[o]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[o]+" in "+e),!1;s|=a}return{key:n,hashId:s}},this.findKeyCommand=function(e,t){var n=s[e]+t;return this.commandKeyBinding[n]},this.handleKeyboard=function(e,t,n,r){if(!(r<0)){var i=s[t]+n,o=this.commandKeyBinding[i];return e.$keyChain&&(e.$keyChain+=" "+i,o=this.commandKeyBinding[e.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(e.$keyChain&&(t&&4!=t||1!=n.length?(-1==t||r>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-i.length-1)),{command:o}):(e.$keyChain=e.$keyChain||i,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(o.prototype),t.HashHandler=o,t.MultiHashHandler=a}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){i.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};r.inherits(o,i),function(){r.implement(this,s),this.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var i={editor:t,command:e,args:n};return i.returnValue=this._emit("exec",i),this._signal("afterExec",i),!1!==i.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map(function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=e("../config"),s=e("../range").Range;function o(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(e){i.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,a=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(n.row),u=n.row+1;u<=i.row+1;u++){var c=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(u)));0!==c.length&&(c=" "+c),l+=c}i.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;o=i.lastRow||r.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var i=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&-1!==n.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var n=this;E.loadModule(["keybinding",e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||i.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=t.findMatchingBracket(e.getCursorPosition());if(n)var r=new f(n.row,n.column,n.row,n.column+1);else t.$mode.getMatching&&(r=t.$mode.getMatching(e.session));r&&(t.$bracketHighlight=t.addMarker(r,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=e.getCursorPosition(),r=new v(e.session,n.row,n.column),i=r.getCurrentToken();if(!i||!/\b(?:tag-open|tag-name)/.test(i.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1==i.type.indexOf("tag-open")||(i=r.stepForward())){var s=i.value,o=0,a=r.stepBackward();if("<"==a.value)do{a=i,(i=r.stepForward())&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"=0);else{do{i=a,a=r.stepBackward(),i&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var n=new f(e.row,e.column,e.row,1/0);n.id=t.addMarker(n,"ace_active-line","screenLine"),t.$highlightLineMarker=n}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var n=t.start.column,r=t.end.column,i=e.getLine(t.start.row),s=i.substring(n,r);if(!(s.length>5e3)&&/[\w\d]/.test(s)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),a=i.substring(n-1,r+1);if(o.test(a))return o}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var r=this.selection.getAllRanges(),i=0;ia.search(/\S|$/)){var l=a.substr(i.column).search(/\S|$/);n.doc.removeInLine(i.row,i.column,i.column+l)}}this.clearSelection();var u=i.column,c=n.getState(i.row),h=(a=n.getLine(i.row),r.checkOutdent(c,a,e));if(n.insert(i,e),s&&s.selection&&(2==s.selection.length?this.selection.setSelectionRange(new f(i.row,u+s.selection[0],i.row,u+s.selection[1])):this.selection.setSelectionRange(new f(i.row+s.selection[0],s.selection[1],i.row+s.selection[2],s.selection[3]))),n.getDocument().isNewLine(e)){var d=r.getNextLineIndent(c,a.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},d)}h&&r.autoOutdent(c,n,i.row)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(e,t){var n;(t.extendLeft||t.extendRight)&&((n=this.selection.getRange()).start.column-=t.extendLeft,n.end.column+=t.extendRight,this.selection.setRange(n),e||n.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((n=this.selection.getRange()).start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,"deletion",this,n,t);if(0===t.end.column){var s=n.getTextRange(t);if("\n"==s[s.length-1]){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var n,r,i=this.session.getLine(e.row);tt.toLowerCase()?1:0});var i=new f(0,0,0,0);for(r=e.first;r<=e.last;r++){var s=t.getLine(r);i.start.row=r,i.end.row=r,i.end.column=s.length,t.replace(i,n[r-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var r=this.session.getLine(e);n.lastIndex=t)return{value:i[0],start:i.index,end:i.index+i[0].length}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new f(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var s=this.getNumberAt(t,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,a=s.start+s.value.length-o,l=parseFloat(s.value);l*=Math.pow(10,a),o!==s.end&&n=a&&o<=l&&(n=t,u.selection.clearSelection(),u.moveCursorTo(e,a+r),u.selection.selectTo(e,l+r)),a=l});for(var c,h=this.$toggleWordPairs,d=0;df+1)break;f=p.last}for(c--,a=this.session.$moveLines(d,f,t?0:e),t&&-1==e&&(h=c+1);h<=c;)o[h].moveBy(a,0),h++;t||(a=0),l+=a}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);!0===t?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):!1===t&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,i*r.lineHeight),null!=t&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new v(this.session,n.row,n.column),i=r.getCurrentToken(),s=i||r.stepForward();if(s){var o,a,l=!1,u={},c=n.column-s.start,h={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;c=0;--s)this.$tryReplace(n[s],e)&&r++;return this.selection.setSelectionRange(i),r},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return null!==(t=this.$search.replace(n,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&r.mixin(t,e);var i=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(i)||this.$search.$options.needle)||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var s=this.$search.find(this.session);return t.preventScroll?s:s?(this.revealRange(s,n),s):(t.backwards?i.start=i.end:i.end=i.start,void this.selection.setRange(i))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(e){var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var s=this.on("changeSelection",function(){r=!0}),o=this.renderer.on("beforeRender",function(){r&&(t=n.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,s=e.$cursorLayer.$pixelPos,o=e.layerConfig,a=s.top-o.offset;null!=(r=s.top>=0&&a+t.top<0||!(s.topwindow.innerHeight)&&null)&&(i.style.top=a+"px",i.style.left=s.left+"px",i.style.height=o.lineHeight+"px",i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",o))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,i.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},this.prompt=function(e,t,n){var r=this;E.loadModule("./ext/prompt",function(i){i.prompt(r,e,t,n)})}}.call(D.prototype),E.defineOptions(D.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?S.attach(this):S.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?S.attach(this):S.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.renderer.$composition||this.getValue();if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),i.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!e&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),i.addCssClass(this.container,"ace_hasPlaceholder");var t=i.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var S={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=D}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,n){this.$fromUndo||e!=this.$lastDelta&&(!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,r=n.length;r--;){var i=n[r][0];if(i.id<=e)break;i.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?a(e):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(r.prototype);var i=e("./range").Range,s=i.comparePoints;function o(e){return{row:e.row,column:e.column}}function a(e){if(e=e||this,Array.isArray(e))return e.map(a).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function u(e,t){var n="insert"==e.action,r="insert"==t.action;if(n&&r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}else if(!n&&r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(!n&&!r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}return[t,e]}function c(e,t){for(var n=e.length;n--;)for(var r=0;r=0?d(e,t,-1):(s(e.start,t.start)<=0||d(e,i.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!n&&r)s(t.start,e.end)>=0?d(t,e,-1):(s(t.start,e.start)<=0||d(t,i.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{var o,a;if(!(s(t.end,e.start)<=0))return s(e.start,t.start)<0&&(o=e,e=p(e,t.start)),s(e.end,t.end)>0&&(a=p(e,t.end)),f(t.end,e.start,e.end,-1),a&&!o&&(e.lines=a.lines,e.start=a.start,e.end=a.end,a=e),[t,o,a].filter(Boolean);d(e,t,-1)}return[t,e]}function d(e,t,n){f(e.start,t.start,t.end,n),f(e.end,t.start,t.end,n)}function f(e,t,n,r){e.row==(1==r?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function p(e,t){var n=e.lines,r=e.end;e.end=o(t);var i=e.end.row-e.start.row,s=n.splice(i,n.length),a=i?t.column:t.column-e.start.column;return n.push(s[0].substring(0,a)),s[0]=s[0].substr(a),{start:o(t),end:r,lines:s,action:e.action}}function m(e,t){t=function(e){return{start:o(e.start),end:o(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var n=e.length;n--;){for(var r=e[n],i=0;is&&(l=i.end.row+1,s=(i=t.getNextFoldLine(l,i))?i.start.row:1/0),l>r){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,e,this.session,u),this.$lines.push(o)),this.$renderCell(o,e,i,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,i=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(i=t.getLength()+r-1);var s=n?n.getWidth(t,i,e):i.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();(s+=o.left+o.right)===this.gutterWidth||isNaN(s)||(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(r.row>this.$cursorRow){var i=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&i&&i.start.row==t[n-1].row))break;r=t[n-1]}r.element.className="ace_gutter-active-line "+r.element.className,this.$cursorCell=r;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;if(this.oldLastRow=n,!t||r0;i--)this.$lines.shift();if(r>n)for(i=this.session.getFoldedRowCount(n+1,r);i>0;i--)this.$lines.pop();e.firstRowr&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,n){for(var r=[],i=t,s=this.session.getNextFoldLine(i),o=s?s.start.row:1/0;i>o&&(i=s.end.row+1,o=(s=this.session.getNextFoldLine(i,s))?s.start.row:1/0),!(i>n);){var a=this.$lines.createCell(i,e,this.session,u);this.$renderCell(a,e,s,i),r.push(a),i++}return r},this.$renderCell=function(e,t,n,i){var s=e.element,o=this.session,a=s.childNodes[0],l=s.childNodes[1],u=o.$firstLineNumber,c=o.$breakpoints,h=o.$decorations,d=o.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&o.foldWidgets,p=n?n.start.row:Number.MAX_VALUE,m="ace_gutter-cell ";if(this.$highlightGutterLine&&(i==this.$cursorRow||n&&i=p&&this.$cursorRow<=n.end.row)&&(m+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),c[i]&&(m+=c[i]),h[i]&&(m+=h[i]),this.$annotations[i]&&(m+=this.$annotations[i].className),s.className!=m&&(s.className=m),f){var g=f[i];null==g&&(g=f[i]=o.getFoldWidget(i))}if(g){m="ace_fold-widget ace_"+g,"start"==g&&i==p&&in.right-t.right?"foldWidgets":void 0}}).call(l.prototype),t.Gutter=l}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/dom"),s=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){function e(e,t,n,r){return(e?1:0)|(t?2:0)|(n?4:0)|(r?8:0)}this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},this.update=function(e){if(e){var t;for(var n in this.config=e,this.i=0,this.markers){var r=this.markers[n];if(r.range){var i=r.range.clipRows(e.firstRow,e.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),r.renderer){var s=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,s,e)}else"fullLine"==r.type?this.drawFullLineMarker(t,i,r.clazz,e):"screenLine"==r.type?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?"text"==r.type?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+" ace_start ace_br15",e)}else r.update(t,this,this.session,e)}if(-1!=this.i)for(;this.if,c==u),s,c==u?0:1,o)},this.drawMultiLineMarker=function(e,t,n,r,i){var s=this.$padding,o=r.lineHeight,a=this.$getTop(t.start.row,r),l=s+t.start.column*r.characterWidth;if(i=i||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((u=t.clone()).end.row=u.start.row,u.end.column=this.session.getLine(u.start.row).length,this.drawBidiSingleLineMarker(e,u,n+" ace_br1 ace_start",r,null,i)):this.elt(n+" ace_br1 ace_start","height:"+o+"px;right:0;top:"+a+"px;left:"+l+"px;"+(i||"")),this.session.$bidiHandler.isBidiRow(t.end.row)){var u;(u=t.clone()).start.row=u.end.row,u.start.column=0,this.drawBidiSingleLineMarker(e,u,n+" ace_br12",r,null,i)}else{a=this.$getTop(t.end.row,r);var c=t.end.column*r.characterWidth;this.elt(n+" ace_br12","height:"+o+"px;width:"+c+"px;top:"+a+"px;left:"+s+"px;"+(i||""))}if(!((o=(t.end.row-t.start.row-1)*r.lineHeight)<=0)){a=this.$getTop(t.start.row+1,r);var h=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+o+"px;right:0;top:"+a+"px;left:"+s+"px;"+(i||""))}},this.drawSingleLineMarker=function(e,t,n,r,i,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,i,s);var o=r.lineHeight,a=(t.end.column+(i||0)-t.start.column)*r.characterWidth,l=this.$getTop(t.start.row,r),u=this.$padding+t.start.column*r.characterWidth;this.elt(n,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+u+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(e,t,n,r,i,s){var o=r.lineHeight,a=this.$getTop(t.start.row,r),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(n,"height:"+o+"px;width:"+e.width+(i||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-s),this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))},this.drawScreenLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))}}).call(s.prototype),t.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=function(e){this.dom=i,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){r.implement(this,a),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;nc&&(a=l.end.row+1,c=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(a>i);){var h=s[o++];if(h){this.dom.removeChildren(h),this.$renderLine(h,a,a==c&&l),u&&(h.style.top=this.$lines.computeLineTop(a,e,this.session)+"px");var d=e.lineHeight*this.session.getRowLength(a)+"px";h.style.height!=d&&(u=!0,h.style.height=d)}a++}if(u)for(;o0;i--)this.$lines.shift();if(t.lastRow>e.lastRow)for(i=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);i>0;i--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,n){for(var r=[],s=t,o=this.session.getNextFoldLine(s),a=o?o.start.row:1/0;s>a&&(s=o.end.row+1,a=(o=this.session.getNextFoldLine(s,o))?o.start.row:1/0),!(s>n);){var l=this.$lines.createCell(s,e,this.session),u=l.element;this.dom.removeChildren(u),i.setStyle(u.style,"height",this.$lines.computeLineHeight(s,e,this.session)+"px"),i.setStyle(u.style,"top",this.$lines.computeLineTop(s,e,this.session)+"px"),this.$renderLine(u,s,s==a&&o),this.$useLineGroups()?u.className="ace_line_group":u.className="ace_line",r.push(l),s++}return r},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,n=e.lastRow,r=this.$lines;r.getLength();)r.pop();r.push(this.$renderLinesFragment(e,t,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,r){for(var i,o=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),u=0;i=a.exec(r);){var c=i[1],h=i[2],d=i[3],f=i[4],p=i[5];if(o.showInvisibles||!h){var m=u!=i.index?r.slice(u,i.index):"";if(u=i.index+i[0].length,m&&l.appendChild(this.dom.createTextNode(m,this.element)),c){var g=o.session.getScreenTabSize(t+i.index);l.appendChild(o.$tabStrings[g].cloneNode(!0)),t+=g-1}else h?o.showInvisibles?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",v.textContent=s.stringRepeat(o.SPACE_CHAR,h.length),l.appendChild(v)):l.appendChild(this.com.createTextNode(h,this.element)):d?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",v.textContent=s.stringRepeat(o.SPACE_CHAR,d.length),l.appendChild(v)):f?(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className=o.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",v.textContent=o.showInvisibles?o.SPACE_CHAR:f,l.appendChild(v)):p&&(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className="ace_cjk",v.textContent=p,l.appendChild(v))}}if(l.appendChild(this.dom.createTextNode(u?r.slice(u):r,this.element)),this.$textToken[n.type])e.appendChild(l);else{var E="ace_"+n.type.replace(/\./g," ace_"),v=this.dom.createElement("span");"fold"==n.type&&(v.style.width=n.value.length*this.config.characterWidth+"px"),v.className=E,v.appendChild(l),e.appendChild(v)}return t+r.length},this.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(" "==t[0]){for(var i=(r-=r%this.tabSize)/this.tabSize,s=0;s=o;)a=this.$renderToken(l,a,c,h.substring(0,o-r)),h=h.substring(o-r),r=o,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(s.stringRepeat(" ",n.indent),this.element)),a=0,o=n[++i]||Number.MAX_VALUE;0!=h.length&&(r+=h.length,a=this.$renderToken(l,a,c,h))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(e,t){var n=0,r=t[0],i=r.value;this.displayIndentGuides&&(i=this.renderIndentGuide(e,i)),i&&(n=this.$renderToken(e,n,r,i));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,r,i);n=this.$renderToken(e,n,r,i)}},this.$renderOverflowMessage=function(e,t,n,r,i){n&&this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=i?"":"",e.appendChild(s)},this.$renderLine=function(e,t,n){if(n||0==n||(n=this.session.getFoldLine(t)),n)var r=this.$getFoldLineTokens(t,n);else r=this.session.getTokens(t);var i=e;if(r.length){var s=this.session.getRowSplitData(t);s&&s.length?(this.$renderWrappedLine(e,r,s),i=e.lastChild):(i=e,this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i)),this.$renderSimpleLine(i,r))}else this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i));if(this.showInvisibles&&i){n&&(t=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,i.appendChild(o)}},this.$getFoldLineTokens=function(e,t){var n=this.session,r=[],i=n.getTokens(e);return t.walk(function(e,t,s,o,a){null!=e?r.push({type:"fold",value:e}):(a&&(i=n.getTokens(t)),i.length&&function(e,t,n){for(var i=0,s=0;s+e[i].value.lengthn-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),s=t+o.length,i+=1);sn?r.push({type:e[i].type,value:o.substring(0,n-s)}):r.push(e[i]),s+=o.length,i+=1}}(i,o,s))},t.end.row,this.session.getLine(t.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),t.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)r.setStyle(t[n].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){r.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){r.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&r.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}else this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||o.top<0)&&n>1)){var a=this.cursors[i++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,o,e,t[n],this.session):this.isCursorInView(o,e)?(r.setStyle(l,"display","block"),r.translate(a,o.left,o.top),r.setStyle(l,"width",Math.round(e.characterWidth)+"px"),r.setStyle(l,"height",e.lineHeight+"px")):r.setStyle(l,"display","none")}}for(;this.cursors.length>i;)this.removeCursor();var u=this.session.getOverwrite();this.$setOverwrite(u),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(i.prototype),t.Cursor=i}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,a=32768,l=function(e){this.element=i.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){r.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(l.prototype);var u=function(e,t){l.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=i.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};r.inherits(u,l),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>a?(this.coeff=a/e,e=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(u.prototype);var c=function(e,t){l.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};r.inherits(c,l),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(c.prototype),t.ScrollBar=u,t.ScrollBarV=u,t.ScrollBarH=c,t.VScrollBar=u,t.HScrollBar=c}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){"use strict";var r=e("./lib/event"),i=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(r.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(i.prototype),t.RenderLoop=i}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,u=256,c="function"==typeof ResizeObserver,h=200,d=t.FontMetrics=function(e){this.el=i.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.innerHTML=s.stringRepeat("X",u),this.$characterSize={width:0,height:0},c?this.$addObserver():this.checkForSizeChanges()};(function(){r.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){var n=t[0].contentRect;e.checkForSizeChanges({height:n.height,width:n.width/u})}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/u};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.innerHTML=s.stringRepeat(e,u),this.$main.getBoundingClientRect().width/u},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=i.buildDom([e(0,0),e(h,0),e(0,h),e(h,h)],this.el)},this.transformCoordinates=function(e,t){function n(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function r(e,t){return[e[0]-t[0],e[1]-t[1]]}function i(e,t){return[e[0]+t[0],e[1]+t[1]]}function s(e,t){return[e*t[0],e*t[1]]}function o(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=s(1/this.$getZoom(this.el),e)),this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),u=o(this.els[2]),c=o(this.els[3]),d=n(r(c,l),r(c,u),r(i(l,u),i(c,a))),f=s(1+d[0],r(l,a)),p=s(1+d[1],r(u,a));if(t){var m=t,g=d[0]*m[0]/h+d[1]*m[1]/h+1,E=i(s(m[0],f),s(m[1],p));return i(s(1/g/h,E),a)}var v=r(e,a),C=n(r(f,s(d[0],v)),r(p,s(d[1],v)),v);return s(h,C)}}).call(d.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./config"),o=e("./layer/gutter").Gutter,a=e("./layer/marker").Marker,l=e("./layer/text").Text,u=e("./layer/cursor").Cursor,c=e("./scrollbar").HScrollBar,h=e("./scrollbar").VScrollBar,d=e("./renderloop").RenderLoop,f=e("./layer/font_metrics").FontMetrics,p=e("./lib/event_emitter").EventEmitter,m='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);opacity: 0.7;transform-origin: left;text-indent: 10px;}',g=e("./lib/useragent"),E=g.isIE;i.importCssString(m,"ace_editor.css");var v=function(e,t){var n=this;this.container=e||i.createElement("div"),i.addCssClass(this.container,"ace_editor"),i.HI_DPI&&i.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=i.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=i.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=i.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var r=this.$textLayer=new l(this.content);this.canvas=r.element,this.$markerFront=new a(this.content),this.$cursorLayer=new u(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new f(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!g.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,p),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),i.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,n){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,r){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var i=this.container;r||(r=i.clientHeight||i.scrollHeight),n||(n=i.clientWidth||i.scrollWidth);var s=this.$updateCachedSize(e,t,n,r);if(!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var s=0,o=this.$size,a={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if(r&&(e||o.height!=r)&&(o.height=r,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL),n&&(e||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,i.setStyle(this.scrollBarH.element.style,"left",t+"px"),i.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),i.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";i.setStyle(this.scrollBarH.element.style,"right",l),i.setStyle(this.scroller.style,"right",l),i.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(s|=this.CHANGE_FULL)}return o.$dirty=!n||!r,s&&this._signal("resize",a),s},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=i.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=i.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var n=this.$cursorLayer.$pixelPos;if(n){t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var r=this.layerConfig,s=n.top,o=n.left;s-=r.offset;var a=t&&t.useTextareaForIME?this.lineHeight:E?0:1;if(s<0||s>r.height-a)i.translate(this.textarea,0,0);else{var l=1,u=this.$size.height-a;if(t)if(t.useTextareaForIME){var c=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(c)[0]}else s+=this.lineHeight+2;else s+=this.lineHeight;(o-=this.scrollLeft)>this.$size.scrollerWidth-l&&(o=this.$size.scrollerWidth-l),o+=this.gutterWidth+this.margin.left,i.setStyle(e,"height",a+"px"),i.setStyle(e,"width",l+"px"),i.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-l),Math.min(s,u))}}}else i.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},this.setMargin=function(e,t,n,r){var i=this.margin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),i.translate(this.content,-this.scrollLeft,-n.offset);var s=n.width+2*this.$padding+"px",o=n.minHeight+"px";i.setStyle(this.content.style,"width",s),i.setStyle(this.content.style,"height",o)}if(e&this.CHANGE_H_SCROLL&&(i.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender")}else this.$changes|=e},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=!(n<=2*this.lineHeight)&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||r!=this.$vScroll){r!=this.$vScroll&&(this.$vScroll=r,this.scrollBarV.setVisible(r));var i=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,i,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength()*this.lineHeight,i=this.$getLongestLine(),s=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-i-2*this.$padding<0),o=this.$horizScroll!==s;o&&(this.$horizScroll=s,this.scrollBarH.setVisible(s));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,u=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;r+=u;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,r-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,i+2*this.$padding-t.scrollerWidth+c.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-r+u<0||this.scrollTop>c.top),d=a!==h;d&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var f,p,m=this.scrollTop%this.lineHeight,g=Math.ceil(l/this.lineHeight)-1,E=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),v=E+g,C=this.lineHeight;E=e.screenToDocumentRow(E,0);var D=e.getFoldLine(E);D&&(E=D.start.row),f=e.documentToScreenRow(E,0),p=e.getRowLength(E)*C,v=Math.min(e.screenToDocumentRow(v,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(v)*C+p,m=this.scrollTop-f*C;var S=0;return(this.layerConfig.width!=i||o)&&(S=this.CHANGE_H_SCROLL),(o||d)&&(S|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(i=this.$getLongestLine())),this.layerConfig={width:i,padding:this.$padding,firstRow:E,firstRowScreen:f,lastRow:v,lineHeight:C,characterWidth:this.characterWidth,minHeight:l,maxHeight:r,offset:m,gutterOffset:C?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/C)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(i-this.$padding),S},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1||tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t,n){if(0!==this.$size.scrollerHeight){var r=this.$cursorLayer.getPixelPosition(e),i=r.left,s=r.top,o=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+o>s?(t&&l+o>s+this.lineHeight&&(s-=t*this.$size.scrollerHeight),0===s&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):l+this.$size.scrollerHeight-ai?(i=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:a,side:s-a>0?1:-1,offsetX:i}},this.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),a=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),i)},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),s=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+s-this.scrollTop}},this.visualizeFocus=function(){i.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){i.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),e.useTextareaForIME=this.$useTextareaForIME,this.$useTextareaForIME?(i.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),i.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText,this.$composition=null,this.$cursorLayer.element.style.display="")},this.addToken=function(e,t,n,r){var i=this.session;i.bgTokenizer.lines[n]=null;var s={type:t,value:e},o=i.getTokens(n);if(null==r)o.push(s);else for(var a=0,l=0;l50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,n){var r=null,i=!1,a=Object.create(s),u=[],c=new l({messageBuffer:u,terminate:function(){},postMessage:function(e){u.push(e),r&&(i?setTimeout(h):h())}});c.setEmitSync=function(e){i=e};var h=function(){var e=u.shift();e.command?r[e.command].apply(r,e.args):e.event&&a._signal(e.event,e.data)};return a.postMessage=function(e){c.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},o.loadModule(["worker",t],function(e){for(r=new e[n](a);u.length;)h()}),c},t.WorkerClient=l,t.createWorker=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(e,t,n,r,i,s){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,i),this.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,s=t.start.column-this.pos.column;if(this.updateAnchors(e),i&&(this.length+=n),i&&!this.session.$fromUndo)if("insert"===e.action)for(var o=this.others.length-1;o>=0;o--){var a={row:(l=this.others[o]).row,column:l.column+s};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(o=this.others.length-1;o>=0;o--){var l;a={row:(l=this.others[o]).row,column:l.column+s},this.doc.remove(new r(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,i){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),i,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)}},this.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new r,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{n=this.getRange();var r=this.isBackwards(),s=n.start.row,o=n.end.row;if(s==o){if(r)var a=n.end,l=n.start;else a=n.start,l=n.end;return this.addRange(i.fromPoints(l,l)),void this.addRange(i.fromPoints(a,a))}var u=[],c=this.getLineRange(s,!0);c.start.column=n.start.column,u.push(c);for(var h=s+1;h1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(r,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],s=e.column0;)E--;if(E>0)for(var v=0;r[v].isEmpty();)v++;for(var C=E;C>=v;C--)r[C].isEmpty()&&r.splice(C,1)}return r}}.call(s.prototype);var d=e("./editor").Editor;function f(e,t){return e.row==t.row&&e.column==t.column}function p(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",o),e.commands.addCommands(u.defaultCommands),function(e){if(e.textInput){var t=e.textInput.getElement(),n=!1;a.addListener(t,"keydown",function(t){var i=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&i?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&r()}),a.addListener(t,"keyup",r),a.addListener(t,"blur",r)}function r(t){n&&(e.renderer.setMouseCursor(""),n=!1)}}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var r=e[n];if(r.marker){this.session.removeMarker(r.marker);var i=t.indexOf(r);-1!=i&&t.splice(i,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(u.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(u.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?r=n.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?r=n.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});else{var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return r}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var r,i=n&&n.keepOrder,o=1==n||n&&n.$byLines,a=this.session,l=this.selection,u=l.rangeList,c=(i?l:u).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var h=l._eventRegistry;l._eventRegistry={};var d=new s(a);this.inVirtualSelectionMode=!0;for(var f=c.length;f--;){if(o)for(;f>0&&c[f].start.row==c[f-1].end.row;)f--;d.fromOrientedRange(c[f]),d.index=f,this.selection=a.selection=d;var p=e.exec?e.exec(this,t||{}):e(this,t||{});r||void 0===p||(r=p),d.toOrientedRange(c[f])}d.detach(),this.selection=a.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=h,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),r}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],r=0;ro&&(o=n.column),rc?e.insert(r,l.stringRepeat(" ",s-c)):e.remove(new i(r.row,r.column,r.row,r.column-s+c)),t.start.column=t.end.column=o,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var c=this.selection.getRange(),h=c.start.row,d=c.end.row,f=h==d;if(f){var p,m=this.session.getLength();do{p=this.session.getLine(d)}while(/[=:]/.test(p)&&++d0);h<0&&(h=0),d>=m&&(d=m-1)}var g=this.session.removeFullLines(h,d);g=this.$reAlignText(g,f),this.session.insert({row:h,column:0},g.join("\n")+"\n"),f||(c.start.column=0,c.end.column=g[g.length-1].length),this.selection.setRange(c)}},this.$reAlignText=function(e,t){var n,r,i,s=!0,o=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==n?(n=t[1].length,r=t[2].length,i=t[3].length,t):(n+r+i!=t[1].length+t[2].length+t[3].length&&(o=!1),n!=t[1].length&&(s=!1),n>t[1].length&&(n=t[1].length),rt[3].length&&(i=t[3].length),t):[e]}).map(t?u:s?o?function(e){return e[2]?a(n+r-e[2].length)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:u:function(e){return e[2]?a(n)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function a(e){return l.stringRepeat(" ",e)}function u(e){return e[2]?a(n)+e[2]+a(r-e[2].length+i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=p,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){p(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,s=e.getLine(t),o=s.search(i);if(-1!=o){for(var a=n||s.length,l=e.getLength(),u=t,c=t;++tu){var f=e.getLine(c).length;return new r(u,a,c,f)}}},this.openingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i+1},a=e.$findClosingBracket(t,o,s);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>o.row&&(a.row--,a.column=e.getLine(a.row).length),r.fromPoints(o,a)}},this.closingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i},a=e.$findOpeningBracket(t,o);if(a)return a.column++,o.column--,r.fromPoints(a,o)}}).call(i.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}e("./range").Range,function(){this.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(n&&e.action){for(var r=e.data,i=r.start.row,s=r.end.row,o="add"==e.action,a=i+1;a0&&!r[i];)i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=s;o++){var a=r[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var u=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(u-=t.scrollLeft),a.el.style.left=u+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}.call(i.prototype),t.LineWidgets=i}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,n){"use strict";var r=e("../line_widgets").LineWidgets,i=e("../lib/dom"),s=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var o=e.getCursorPosition(),a=o.row,l=n.widgetManager.getWidgetsAtRow(a).filter(function(e){return"errorMarker"==e.type})[0];l?l.destroy():a-=t;var u,c=function(e,t,n){var r=e.getAnnotations().sort(s.comparePoints);if(r.length){var i=function(e,t,n){for(var r=0,i=e.length-1;r<=i;){var s=r+i>>1,o=n(t,e[s]);if(o>0)r=s+1;else{if(!(o<0))return s;i=s-1}}return-(r+1)}(r,{row:t,column:-1},s.comparePoints);i<0&&(i=-i-1),i>=r.length?i=n>0?0:r.length-1:0===i&&n<0&&(i=r.length-1);var o=r[i];if(o&&n){if(o.row===t){do{o=r[i+=n]}while(o&&o.row===t);if(!o)return r.slice()}var a=[];t=o.row;do{a[n<0?"unshift":"push"](o),o=r[i+=n]}while(o&&o.row==t);return a.length&&a}}}(n,a,t);if(c){var h=c[0];o.column=(h.pos&&"number"!=typeof h.column?h.pos.sc:h.column)||0,o.row=h.row,u=e.renderer.$gutterLayer.$annotations[o.row]}else{if(l)return;u={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(o.row),e.selection.moveToPosition(o);var d={row:o.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},f=d.el.appendChild(i.createElement("div")),p=d.el.appendChild(i.createElement("div"));p.className="error_widget_arrow "+u.className;var m=e.renderer.$cursorLayer.getPixelPosition(o).left;p.style.left=m+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",f.className="error_widget "+u.className,f.innerHTML=u.text.join("
"),f.appendChild(i.createElement("div"));var g=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(g),n.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(g),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t,r){"use strict";e("./lib/fixoldbrowsers");var i=e("./lib/dom"),s=e("./lib/event"),o=e("./range").Range,a=e("./editor").Editor,l=e("./edit_session").EditSession,u=e("./undomanager").UndoManager,c=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,t.define=n.amdD,t.edit=function(e,n){if("string"==typeof e){var r=e;if(!(e=document.getElementById(r)))throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof a)return e.env.editor;var o="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;o=l.value,e=i.createElement("pre"),l.parentNode.replaceChild(e,l)}else e&&(o=e.textContent,e.innerHTML="");var u=t.createEditSession(o),h=new a(new c(e),u,n),d={document:u,editor:h,onResize:h.resize.bind(h,null)};return l&&(d.textarea=l),s.addListener(window,"resize",d.onResize),h.on("destroy",function(){s.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),h.container.env=h.env=d,h},t.createEditSession=function(e,t){var n=new l(e,t);return n.setUndoManager(new u),n},t.Range=o,t.Editor=a,t.EditSession=l,t.UndoManager=u,t.VirtualRenderer=c,t.version=t.config.version}),ace.require(["ace/ace"],function(t){for(var n in t&&(t.config.init(!0),t.define=ace.define),window.ace||(window.ace=t),t)t.hasOwnProperty(n)&&(window.ace[n]=t[n]);window.ace.default=window.ace,e&&(e.exports=window.ace)}),e.exports={ace}},247(e,t,n){"use strict";var r=n(982),i=n(159),s=n(961);function o(e){var t="https://react.dev/errors/"+e;if(1P||(e.current=M[P],M[P]=null,P--)}function $(e,t){P++,M[P]=e.current,e.current=t}var G,V,W=B(null),H=B(null),j=B(null),z=B(null);function X(e,t){switch($(j,t),$(H,e),$(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=Eh(t=gh(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(W),$(W,e)}function K(){U(W),U(H),U(j)}function Y(e){null!==e.memoizedState&&$(z,e);var t=W.current,n=Eh(t,e.type);t!==n&&($(H,e),$(W,n))}function q(e){H.current===e&&(U(W),U(H)),z.current===e&&(U(z),ud._currentValue=k)}function Q(e){if(void 0===G)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);G=t&&t[1]||"",V=-1)":-1--i||l[r]!==u[i]){var c="\n"+l[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}}while(1<=r&&0<=i);break}}}finally{Z=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Q(n):""}function ee(e,t){switch(e.tag){case 26:case 27:case 5:return Q(e.type);case 16:return Q("Lazy");case 13:return e.child!==t&&null!==t?Q("Suspense Fallback"):Q("Suspense");case 19:return Q("SuspenseList");case 0:case 15:return J(e.type,!1);case 11:return J(e.type.render,!1);case 1:return J(e.type,!0);case 31:return Q("Activity");default:return""}}function te(e){try{var t="",n=null;do{t+=ee(e,n),n=e,e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var ne=Object.prototype.hasOwnProperty,re=r.unstable_scheduleCallback,ie=r.unstable_cancelCallback,se=r.unstable_shouldYield,oe=r.unstable_requestPaint,ae=r.unstable_now,le=r.unstable_getCurrentPriorityLevel,ue=r.unstable_ImmediatePriority,ce=r.unstable_UserBlockingPriority,he=r.unstable_NormalPriority,de=r.unstable_LowPriority,fe=r.unstable_IdlePriority,pe=r.log,me=r.unstable_setDisableYieldValue,ge=null,Ee=null;function ve(e){if("function"==typeof pe&&me(e),Ee&&"function"==typeof Ee.setStrictMode)try{Ee.setStrictMode(ge,e)}catch(e){}}var Ce=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(De(e)/Se|0)|0},De=Math.log,Se=Math.LN2,Ae=256,_e=262144,ye=4194304;function be(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Te(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var i=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var a=134217727&r;return 0!==a?0!==(r=a&~s)?i=be(r):0!==(o&=a)?i=be(o):n||0!==(n=a&~e)&&(i=be(n)):0!==(a=r&~s)?i=be(a):0!==o?i=be(o):n||0!==(n=r&~e)&&(i=be(n)),0===i?0:0!==t&&t!==i&&0===(t&s)&&((s=i&-i)>=(n=t&-t)||32===s&&4194048&n)?t:i}function Re(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function we(){var e=ye;return!(62914560&(ye<<=1))&&(ye=4194304),e}function Fe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ne(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Le(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ce(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function Oe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ce(n),i=1<=bn),xn=String.fromCharCode(32),wn=!1;function Fn(e,t){switch(e){case"keyup":return-1!==_n.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Ln=!1,On={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function In(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!On[e.type]:"textarea"===t}function kn(e,t,n,r){It?kt?kt.push(r):kt=[r]:It=r,0<(t=nh(t,"onChange")).length&&(n=new tn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Mn=null,Pn=null;function Bn(e){Kc(e,0)}function Un(e){if(ft(Qe(e)))return e}function $n(e,t){if("change"===e)return t}var Gn=!1;if($t){var Vn;if($t){var Wn="oninput"in document;if(!Wn){var Hn=document.createElement("div");Hn.setAttribute("oninput","return;"),Wn="function"==typeof Hn.oninput}Vn=Wn}else Vn=!1;Gn=Vn&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Jn(r)}}function tr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?tr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function nr(e){for(var t=pt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=pt((e=t.contentWindow).document)}return t}function rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var ir=$t&&"documentMode"in document&&11>=document.documentMode,sr=null,or=null,ar=null,lr=!1;function ur(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;lr||null==sr||sr!==pt(r)||(r="selectionStart"in(r=sr)&&rr(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},ar&&Zn(ar,r)||(ar=r,0<(r=nh(or,"onSelect")).length&&(t=new tn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=sr)))}function cr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var hr={animationend:cr("Animation","AnimationEnd"),animationiteration:cr("Animation","AnimationIteration"),animationstart:cr("Animation","AnimationStart"),transitionrun:cr("Transition","TransitionRun"),transitionstart:cr("Transition","TransitionStart"),transitioncancel:cr("Transition","TransitionCancel"),transitionend:cr("Transition","TransitionEnd")},dr={},fr={};function pr(e){if(dr[e])return dr[e];if(!hr[e])return e;var t,n=hr[e];for(t in n)if(n.hasOwnProperty(t)&&t in fr)return dr[e]=n[t];return e}$t&&(fr=document.createElement("div").style,"AnimationEvent"in window||(delete hr.animationend.animation,delete hr.animationiteration.animation,delete hr.animationstart.animation),"TransitionEvent"in window||delete hr.transitionend.transition);var mr=pr("animationend"),gr=pr("animationiteration"),Er=pr("animationstart"),vr=pr("transitionrun"),Cr=pr("transitionstart"),Dr=pr("transitioncancel"),Sr=pr("transitionend"),Ar=new Map,_r="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function yr(e,t){Ar.set(e,t),nt(t,[e])}_r.push("scrollEnd");var br="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Tr=[],Rr=0,xr=0;function wr(){for(var e=Rr,t=xr=Rr=0;t>=o,i-=o,ti=1<<32-Ce(t)+i|n<p?(m=h,h=null):m=h.sibling;var g=f(i,h,a[p],l);if(null===g){null===h&&(h=m);break}e&&h&&null===g.alternate&&t(i,h),o=s(g,o,p),null===c?u=g:c.sibling=g,c=g,h=m}if(p===a.length)return n(i,h),ci&&ri(i,p),u;if(null===h){for(;pm?(g=p,p=null):g=p.sibling;var C=f(i,p,v.value,u);if(null===C){null===p&&(p=g);break}e&&p&&null===C.alternate&&t(i,p),a=s(C,a,m),null===h?c=C:h.sibling=C,h=C,p=g}if(v.done)return n(i,p),ci&&ri(i,m),c;if(null===p){for(;!v.done;m++,v=l.next())null!==(v=d(i,v.value,u))&&(a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return ci&&ri(i,m),c}for(p=r(p);!v.done;m++,v=l.next())null!==(v=E(p,i,m,v.value,u))&&(e&&null!==v.alternate&&p.delete(null===v.key?m:v.key),a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return e&&p.forEach(function(e){return t(i,e)}),ci&&ri(i,m),c}(l,u,c=C.call(c),h)}if("function"==typeof c.then)return v(l,u,ls(c),h);if(c.$$typeof===D)return v(l,u,Li(l,c),h);cs(l,c)}return"string"==typeof c&&""!==c||"number"==typeof c||"bigint"==typeof c?(c=""+c,null!==u&&6===u.tag?(n(l,u.sibling),(h=i(u,c)).return=l,l=h):(n(l,u),(h=Wr(c,l.mode,h)).return=l,l=h),a(l)):n(l,u)}return function(e,t,n,r){try{as=0;var i=v(e,t,n,r);return os=null,i}catch(t){if(t===qi||t===Zi)throw t;var s=Pr(29,t,null,e.mode);return s.lanes=r,s.return=e,s}}}var ds=hs(!0),fs=hs(!1),ps=!1;function ms(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Es(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vs(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&du){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ir(e),Or(e,null,n),t}return Fr(e,r,t,n),Ir(e)}function Cs(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Oe(e,n)}}function Ds(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===s?i=s=o:s=s.next=o,n=n.next}while(null!==n);null===s?i=s=t:s=s.next=t}else i=s=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ss=!1;function As(){if(Ss&&null!==Wi)throw Wi}function _s(e,t,n,r){Ss=!1;var i=e.updateQueue;ps=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var l=a,u=l.next;l.next=null,null===o?s=u:o.next=u,o=l;var c=e.alternate;null!==c&&(a=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===a?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l)}if(null!==s){var h=i.baseState;for(o=0,c=u=l=null,a=s;;){var f=-536870913&a.lane,p=f!==a.lane;if(p?(mu&f)===f:(r&f)===f){0!==f&&f===Vi&&(Ss=!0),null!==c&&(c=c.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var m=e,g=a;f=t;var E=n;switch(g.tag){case 1:if("function"==typeof(m=g.payload)){h=m.call(E,h,f);break e}h=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(f="function"==typeof(m=g.payload)?m.call(E,h,f):m))break e;h=d({},h,f);break e;case 2:ps=!0}}null!==(f=a.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=i.callbacks)?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===c?(u=c=p,l=h):c=c.next=p,o|=f;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(p=a).next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}null===c&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null===s&&(i.shared.lanes=0),_u|=o,e.lanes=o,e.memoizedState=h}}function ys(e,t){if("function"!=typeof e)throw Error(o(191,e));e.call(t)}function bs(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;es?s:8;var o,a,l,u=O.T,c={};O.T=c,ca(e,!1,t,n);try{var h=i(),d=O.S;null!==d&&d(c,h),null!==h&&"object"==typeof h&&"function"==typeof h.then?ua(e,t,(o=r,a=[],l={status:"pending",value:null,reason:null,then:function(e){a.push(e)}},h.then(function(){l.status="fulfilled",l.value=o;for(var e=0;e<\/script>",s=s.removeChild(s.firstChild);break;case"select":s="string"==typeof r.is?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s="string"==typeof r.is?a.createElement(i,{is:r.is}):a.createElement(i)}}s[$e]=t,s[Ge]=r;e:for(a=t.child;null!==a;){if(5===a.tag||6===a.tag)s.appendChild(a.stateNode);else if(4!==a.tag&&27!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;null===a.sibling;){if(null===a.return||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=s;e:switch(hh(s,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&ol(t)}}return hl(t),al(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&ol(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));if(e=j.current,Ei(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(i=li))switch(i.tag){case 27:case 5:r=i.memoizedProps}e[$e]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||lh(e.nodeValue,n)))||pi(t,!0)}else(e=mh(e).createTextNode(r))[$e]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(r=Ei(t),null!==n){if(null===e){if(!r)throw Error(o(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(o(557));e[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Ps(t),t):(Ps(t),null);if(128&t.flags)throw Error(o(558))}return hl(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=Ei(t),null!==r&&null!==r.dehydrated){if(null===e){if(!i)throw Error(o(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(o(317));i[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),i=!1}else i=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return 256&t.flags?(Ps(t),t):(Ps(t),null)}return Ps(t),128&t.flags?(t.lanes=n,t):(n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(i=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(i=r.alternate.memoizedState.cachePool.pool),s=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(s=r.memoizedState.cachePool.pool),s!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ul(t,t.updateQueue),hl(t),null);case 4:return K(),null===e&&Zc(t.stateNode.containerInfo),hl(t),null;case 10:return bi(t.type),hl(t),null;case 19:if(U(Bs),null===(r=t.memoizedState))return hl(t),null;if(i=!!(128&t.flags),null===(s=r.rendering))if(i)cl(r,!1);else{if(0!==Au||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(s=Us(e))){for(t.flags|=128,cl(r,!1),e=s.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)$r(n,e),n=n.sibling;return $(Bs,1&Bs.current|2),ci&&ri(t,r.treeForkCount),t.child}e=e.sibling}null!==r.tail&&ae()>Ou&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=Us(s))){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),cl(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!ci)return hl(t),null}else 2*ae()-r.renderingStartTime>Ou&&536870912!==n&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=r.last)?e.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ae(),e.sibling=null,n=Bs.current,$(Bs,i?1&n|2:1&n),ci&&ri(t,r.treeForkCount),e):(hl(t),null);case 22:case 23:return Ps(t),Fs(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?!!(536870912&n)&&!(128&t.flags)&&(hl(t),6&t.subtreeFlags&&(t.flags|=8192)):hl(t),null!==(n=t.updateQueue)&&ul(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&U(zi),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),bi(Pi),hl(t),null;case 25:case 30:return null}throw Error(o(156,t.tag))}function fl(e,t){switch(oi(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return bi(Pi),K(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return q(t),null;case 31:if(null!==t.memoizedState){if(Ps(t),null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Ps(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return U(Bs),null;case 4:return K(),null;case 10:return bi(t.type),null;case 22:case 23:return Ps(t),Fs(),null!==e&&U(zi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return bi(Pi),null;default:return null}}function pl(e,t){switch(oi(t),t.tag){case 3:bi(Pi),K();break;case 26:case 27:case 5:q(t);break;case 4:K();break;case 31:null!==t.memoizedState&&Ps(t);break;case 13:Ps(t);break;case 19:U(Bs);break;case 10:bi(t.type);break;case 22:case 23:Ps(t),Fs(),null!==e&&U(zi);break;case 24:bi(Pi)}}function ml(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var s=n.create,o=n.inst;r=s(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ac(t,t.return,e)}}function gl(e,t,n){try{var r=t.updateQueue,i=null!==r?r.lastEffect:null;if(null!==i){var s=i.next;r=s;do{if((r.tag&e)===e){var o=r.inst,a=o.destroy;if(void 0!==a){o.destroy=void 0,i=t;var l=n,u=a;try{u()}catch(e){Ac(i,l,e)}}}r=r.next}while(r!==s)}}catch(e){Ac(t,t.return,e)}}function El(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{bs(t,n)}catch(t){Ac(e,e.return,t)}}}function vl(e,t,n){n.props=Aa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ac(e,t,n)}}function Cl(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(n){Ac(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(n){Ac(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){Ac(e,t,n)}else n.current=null}function Sl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ac(e,e.return,t)}}function Al(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,a=null,l=null,u=null,c=null,h=null;for(p in n){var d=n[p];if(n.hasOwnProperty(p)&&null!=d)switch(p){case"checked":case"value":break;case"defaultValue":u=d;default:r.hasOwnProperty(p)||uh(e,t,p,null,r,d)}}for(var f in r){var p=r[f];if(d=n[f],r.hasOwnProperty(f)&&(null!=p||null!=d))switch(f){case"type":s=p;break;case"name":i=p;break;case"checked":c=p;break;case"defaultChecked":h=p;break;case"value":a=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(o(137,t));break;default:p!==d&&uh(e,t,f,p,r,d)}}return void Et(e,a,l,u,c,h,s,i);case"select":for(s in p=a=l=f=null,n)if(u=n[s],n.hasOwnProperty(s)&&null!=u)switch(s){case"value":break;case"multiple":p=u;default:r.hasOwnProperty(s)||uh(e,t,s,null,r,u)}for(i in r)if(s=r[i],u=n[i],r.hasOwnProperty(i)&&(null!=s||null!=u))switch(i){case"value":f=s;break;case"defaultValue":l=s;break;case"multiple":a=s;default:s!==u&&uh(e,t,i,s,r,u)}return t=l,n=a,r=p,void(null!=f?Dt(e,!!n,f,!1):!!r!=!!n&&(null!=t?Dt(e,!!n,t,!0):Dt(e,!!n,n?[]:"",!1)));case"textarea":for(l in p=f=null,n)if(i=n[l],n.hasOwnProperty(l)&&null!=i&&!r.hasOwnProperty(l))switch(l){case"value":case"children":break;default:uh(e,t,l,null,r,i)}for(a in r)if(i=r[a],s=n[a],r.hasOwnProperty(a)&&(null!=i||null!=s))switch(a){case"value":f=i;break;case"defaultValue":p=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(o(91));break;default:i!==s&&uh(e,t,a,i,r,s)}return void St(e,f,p);case"option":for(var m in n)f=n[m],n.hasOwnProperty(m)&&null!=f&&!r.hasOwnProperty(m)&&("selected"===m?e.selected=!1:uh(e,t,m,null,r,f));for(u in r)f=r[u],p=n[u],!r.hasOwnProperty(u)||f===p||null==f&&null==p||("selected"===u?e.selected=f&&"function"!=typeof f&&"symbol"!=typeof f:uh(e,t,u,f,r,p));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)f=n[g],n.hasOwnProperty(g)&&null!=f&&!r.hasOwnProperty(g)&&uh(e,t,g,null,r,f);for(c in r)if(f=r[c],p=n[c],r.hasOwnProperty(c)&&f!==p&&(null!=f||null!=p))switch(c){case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(o(137,t));break;default:uh(e,t,c,f,r,p)}return;default:if(Rt(t)){for(var E in n)f=n[E],n.hasOwnProperty(E)&&void 0!==f&&!r.hasOwnProperty(E)&&ch(e,t,E,void 0,r,f);for(h in r)f=r[h],p=n[h],!r.hasOwnProperty(h)||f===p||void 0===f&&void 0===p||ch(e,t,h,f,r,p);return}}for(var v in n)f=n[v],n.hasOwnProperty(v)&&null!=f&&!r.hasOwnProperty(v)&&uh(e,t,v,null,r,f);for(d in r)f=r[d],p=n[d],!r.hasOwnProperty(d)||f===p||null==f&&null==p||uh(e,t,d,f,r,p)}(r,e.type,n,t),r[Ge]=t}catch(t){Ac(e,e.return,t)}}function _l(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&bh(e.type)||4===e.tag}function yl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||_l(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&bh(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function bl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Nt));else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(bl(e,t,n),e=e.sibling;null!==e;)bl(e,t,n),e=e.sibling}function Tl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Tl(e,t,n),e=e.sibling;null!==e;)Tl(e,t,n),e=e.sibling}function Rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);hh(t,r,n),t[$e]=e,t[Ge]=n}catch(t){Ac(e,e.return,t)}}var xl=!1,wl=!1,Fl=!1,Nl="function"==typeof WeakSet?WeakSet:Set,Ll=null;function Ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Xl(e,n),4&r&&ml(5,n);break;case 1:if(Xl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){Ac(n,n.return,e)}else{var i=Aa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ac(n,n.return,e)}}64&r&&El(n),512&r&&Cl(n,n.return);break;case 3:if(Xl(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{bs(e,t)}catch(e){Ac(n,n.return,e)}}break;case 27:null===t&&4&r&&Rl(n);case 26:case 5:Xl(e,n),null===t&&4&r&&Sl(n),512&r&&Cl(n,n.return);break;case 12:Xl(e,n);break;case 31:Xl(e,n),4&r&&Ul(e,n);break;case 13:Xl(e,n),4&r&&$l(e,n),64&r&&null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Tc.bind(null,n));break;case 22:if(!(r=null!==n.memoizedState||xl)){t=null!==t&&null!==t.memoizedState||wl,i=xl;var s=wl;xl=r,(wl=t)&&!s?Yl(e,n,!!(8772&n.subtreeFlags)):Xl(e,n),xl=i,wl=s}break;case 30:break;default:Xl(e,n)}}function Il(e){var t=e.alternate;null!==t&&(e.alternate=null,Il(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&Ke(t),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var kl=null,Ml=!1;function Pl(e,t,n){for(n=n.child;null!==n;)Bl(e,t,n),n=n.sibling}function Bl(e,t,n){if(Ee&&"function"==typeof Ee.onCommitFiberUnmount)try{Ee.onCommitFiberUnmount(ge,n)}catch(e){}switch(n.tag){case 26:wl||Dl(n,t),Pl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:wl||Dl(n,t);var r=kl,i=Ml;bh(n.type)&&(kl=n.stateNode,Ml=!1),Pl(e,t,n),Ph(n.stateNode),kl=r,Ml=i;break;case 5:wl||Dl(n,t);case 6:if(r=kl,i=Ml,kl=null,Pl(e,t,n),Ml=i,null!==(kl=r))if(Ml)try{(9===kl.nodeType?kl.body:"HTML"===kl.nodeName?kl.ownerDocument.body:kl).removeChild(n.stateNode)}catch(e){Ac(n,t,e)}else try{kl.removeChild(n.stateNode)}catch(e){Ac(n,t,e)}break;case 18:null!==kl&&(Ml?(Th(9===(e=kl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Gd(e)):Th(kl,n.stateNode));break;case 4:r=kl,i=Ml,kl=n.stateNode.containerInfo,Ml=!0,Pl(e,t,n),kl=r,Ml=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),wl||gl(4,n,t),Pl(e,t,n);break;case 1:wl||(Dl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&vl(n,t,r)),Pl(e,t,n);break;case 21:Pl(e,t,n);break;case 22:wl=(r=wl)||null!==n.memoizedState,Pl(e,t,n),wl=r;break;default:Pl(e,t,n)}}function Ul(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)){e=e.dehydrated;try{Gd(e)}catch(e){Ac(t,t.return,e)}}}function $l(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{Gd(e)}catch(e){Ac(t,t.return,e)}}function Gl(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Nl),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Nl),t;default:throw Error(o(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Rc.bind(null,e,t);t.then(r,r)}})}function Vl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r title"))),hh(s,r,n),s[$e]=e,Je(s),r=s;break e;case"link":var a=td("link","href",i).get(r+(n.href||""));if(a)for(var l=0;la)break;var c=l.transferSize,h=l.initiatorType;c&&dh(h)&&(o+=c*((l=l.responseEnd)id?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}(h,p)))return Uu=s,e.cancelPendingCommit=p(pc.bind(null,e,t,s,n,r,i,o,a,l,c,h,null,d,f)),void Qu(e,s,o,!u)}pc(e,t,s,n,r,i,o,a,l)}function qu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var r=0;rg&&(o=g,g=m,m=o);var E=er(a,m),v=er(a,g);if(E&&v&&(1!==f.rangeCount||f.anchorNode!==E.node||f.anchorOffset!==E.offset||f.focusNode!==v.node||f.focusOffset!==v.offset)){var C=h.createRange();C.setStart(E.node,E.offset),f.removeAllRanges(),m>g?(f.addRange(C),f.extend(v.node,v.offset)):(C.setEnd(v.node,v.offset),f.addRange(C))}}}}for(h=[],f=a;f=f.parentNode;)1===f.nodeType&&h.push({element:f,left:f.scrollLeft,top:f.scrollTop});for("function"==typeof a.focus&&a.focus(),a=0;an?32:n,O.T=null,n=Gu,Gu=null;var s=Pu,a=Uu;if(Mu=0,Bu=Pu=null,Uu=0,6&du)throw Error(o(331));var l=du;if(du|=4,au(s.current),Jl(s,s.current,a,n),du=l,kc(0,!1),Ee&&"function"==typeof Ee.onPostCommitFiberRoot)try{Ee.onPostCommitFiberRoot(ge,s)}catch(e){}return!0}finally{I.p=i,O.T=r,vc(e,t)}}function Sc(e,t,n){t=Xr(n,t),null!==(e=vs(e,t=xa(e.stateNode,t,2),2))&&(Ne(e,2),Ic(e))}function Ac(e,t,n){if(3===e.tag)Sc(e,e,n);else for(;null!==t;){if(3===t.tag){Sc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===ku||!ku.has(r))){e=Xr(n,e),null!==(r=vs(t,n=wa(2),2))&&(Fa(n,r,t,e),Ne(r,2),Ic(r));break}}t=t.return}}function _c(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hu;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(Du=!0,i.add(n),e=yc.bind(null,e,t,n),t.then(e,e))}function yc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,fu===e&&(mu&n)===n&&(4===Au||3===Au&&(62914560&mu)===mu&&300>ae()-Nu?!(2&du)&&ec(e,0):bu|=n,Ru===mu&&(Ru=0)),Ic(e)}function bc(e,t){0===t&&(t=we()),null!==(e=Lr(e,t))&&(Ne(e,t),Ic(e))}function Tc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),bc(e,n)}function Rc(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}null!==r&&r.delete(t),bc(e,n)}var xc=null,wc=null,Fc=!1,Nc=!1,Lc=!1,Oc=0;function Ic(e){e!==wc&&null===e.next&&(null===wc?xc=wc=e:wc=wc.next=e),Nc=!0,Fc||(Fc=!0,_h(function(){6&du?re(ue,Mc):Pc()}))}function kc(e,t){if(!Lc&&Nc){Lc=!0;do{for(var n=!1,r=xc;null!==r;){if(!t)if(0!==e){var i=r.pendingLanes;if(0===i)var s=0;else{var o=r.suspendedLanes,a=r.pingedLanes;s=(1<<31-Ce(42|e)+1)-1,s=201326741&(s&=i&~(o&~a))?201326741&s|1:s?2|s:0}0!==s&&(n=!0,$c(r,s))}else s=mu,!(3&(s=Te(r,r===fu?s:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Re(r,s)||(n=!0,$c(r,s));r=r.next}}while(n);Lc=!1}}function Mc(){Pc()}function Pc(){Nc=Fc=!1;var e,t=0;0!==Oc&&((e=window.event)&&"popstate"===e.type?e!==Ch&&(Ch=e,1):(Ch=null,0))&&(t=Oc);for(var n=ae(),r=null,i=xc;null!==i;){var s=i.next,o=Bc(i,n);0===o?(i.next=null,null===r?xc=s:r.next=s,null===s&&(wc=r)):(r=i,(0!==t||3&o)&&(Nc=!0)),i=s}0!==Mu&&5!==Mu||kc(t,!1),0!==Oc&&(Oc=0)}function Bc(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=-62914561&e.pendingLanes;0 title"):null)}function rd(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var id=0;function sd(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)ad(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var od=null;function ad(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,od=new Map,t.forEach(ld,e),od=null,sd.call(e))}function ld(e,t){if(!(4&t.state.loading)){var n=od.get(e);if(n)var r=n.get(null);else{n=new Map,od.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s>>1,i=e[r];if(!(0>>1;rs(l,n))us(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[a]=n,r=a);else{if(!(us(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var u=[],c=[],h=1,d=null,f=3,p=!1,m=!1,g=!1,E=!1,v="function"==typeof setTimeout?setTimeout:null,C="function"==typeof clearTimeout?clearTimeout:null,D="undefined"!=typeof setImmediate?setImmediate:null;function S(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function A(e){if(g=!1,S(e),!m)if(null!==r(u))m=!0,y||(y=!0,_());else{var t=r(c);null!==t&&L(A,t.startTime-e)}}var _,y=!1,b=-1,T=5,R=-1;function x(){return!(!E&&t.unstable_now()-Re&&x());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var a=o(d.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof a){d.callback=a,S(e),n=!0;break t}d===r(u)&&i(u),S(e)}else i(u);d=r(u)}if(null!==d)n=!0;else{var l=r(c);null!==l&&L(A,l.startTime-e),n=!1}}break e}finally{d=null,f=s,p=!1}n=void 0}}finally{n?_():y=!1}}}if("function"==typeof D)_=function(){D(w)};else if("undefined"!=typeof MessageChannel){var F=new MessageChannel,N=F.port2;F.port1.onmessage=w,_=function(){N.postMessage(null)}}else _=function(){v(w,0)};function L(e,n){b=v(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125o?(e.sortIndex=s,n(c,e),null===r(u)&&e===r(c)&&(g?(C(b),b=-1):g=!0,L(A,s-o))):(e.sortIndex=a,n(u,e),m||p||(m=!0,y||(y=!0,_()))),e},t.unstable_shouldYield=x,t.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}},982(e,t,n){"use strict";e.exports=n(477)},902(e,t,n){"use strict";var r=n(72),i=n.n(r),s=n(825),o=n.n(s),a=n(659),l=n.n(a),u=n(56),c=n.n(u),h=n(540),d=n.n(h),f=n(113),p=n.n(f),m=n(636),g={};g.styleTagTransform=p(),g.setAttributes=c(),g.insert=l().bind(null,"html"),g.domAPI=o(),g.insertStyleElement=d(),i()(m.A,g),m.A&&m.A.locals&&m.A.locals},72(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},878(e,t,n){"use strict";n.r(t),n.d(t,{EmbeddedFrontend:()=>Id,Spector:()=>kd});var r={};n.r(r),n.d(r,{LX:()=>Jo,ll:()=>ea});var i,s={};n.r(s),n.d(s,{SyntaxError:()=>Xc,parse:()=>Yc});class o{static isBuildableProgram(e){return!!e&&!!e[this.rebuildProgramFunctionName]}static rebuildProgram(e,t,n,r,i){this.isBuildableProgram(e)&&e[this.rebuildProgramFunctionName](t,n,r,i)}}o.rebuildProgramFunctionName="__SPECTOR_rebuildProgram",function(e){e[e.noLog=0]="noLog",e[e.error=1]="error",e[e.warning=2]="warning",e[e.info=3]="info"}(i||(i={}));class a{static error(e,...t){this.level>0&&console.error(e,t)}static warn(e,...t){this.level>1&&console.warn(e,t)}static info(e,...t){this.level>2&&console.log(e,t)}}a.level=i.warning;class l{constructor(){this.callbacks=[],this.counter=-1}add(e,t){return this.counter++,t&&(e=e.bind(t)),this.callbacks[this.counter]=e,this.counter}remove(e){delete this.callbacks[e]}clear(){this.callbacks={}}trigger(e){for(const t in this.callbacks)this.callbacks.hasOwnProperty(t)&&this.callbacks[t](e)}}class u{constructor(){if("undefined"!=typeof performance&&performance.now)this.nowFunction=()=>performance.now();else{const e=new Date;this.nowFunction=e.getTime.bind(e)}}static get now(){return u.instance.nowFunction()}}u.instance=new u;class c{constructor(e){this.options=e}appendAnalysis(e){e.analyses=e.analyses||[];const t=this.getAnalysis(e);e.analyses.push(t)}getAnalysis(e){const t={analyserName:this.analyserName};return this.appendToAnalysis(e,t),t}}class h extends c{get analyserName(){return h.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={};for(const t of e.commands)n[t.name]=n[t.name]||0,n[t.name]++;const r=Object.keys(n).map(e=>[e,n[e]]);r.sort((e,t)=>{const n=t[1]-e[1];return 0===n?e[0].localeCompare(t[0]):n});for(const e of r)t[e[0]]=e[1]}}h.analyserName="Commands";const d=["drawArrays","drawElements","drawArraysInstanced","drawArraysInstancedANGLE","drawElementsInstanced","drawElementsInstancedANGLE","drawRangeElements","multiDrawArraysWEBGL","multiDrawElementsWEBGL","multiDrawArraysInstancedWEBGL","multiDrawElementsInstancedWEBGL","multiDrawArraysInstancedBaseInstanceWEBGL","multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL","drawArraysInstancedBaseInstanceWEBGL","drawElementsInstancedBaseVertexBaseInstanceWEBGL"];class f extends c{get analyserName(){return f.analyserName}appendToAnalysis(e,t){if(e.commands){t.total=e.commands.length,t.draw=0,t.clear=0;for(const n of e.commands)"clear"===n.name?t.clear++:d.indexOf(n.name)>-1&&t.draw++}}}f.analyserName="CommandsSummary";class p{static isWebGlConstant(e){return null!==g[e]&&void 0!==g[e]}static stringifyWebGlConstant(e,t){if(null==e)return"";if(0===e){return this.zeroMeaningByCommand[t]||"0"}if(1===e){return this.oneMeaningByCommand[t]||"1"}const n=g[e];return n?n.name:e+""}}p.DEPTH_BUFFER_BIT={name:"DEPTH_BUFFER_BIT",value:256,description:"Passed to clear to clear the current depth buffer."},p.STENCIL_BUFFER_BIT={name:"STENCIL_BUFFER_BIT",value:1024,description:"Passed to clear to clear the current stencil buffer."},p.COLOR_BUFFER_BIT={name:"COLOR_BUFFER_BIT",value:16384,description:"Passed to clear to clear the current color buffer."},p.POINTS={name:"POINTS",value:0,description:"Passed to drawElements or drawArrays to draw single points."},p.LINES={name:"LINES",value:1,description:"Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it."},p.LINE_LOOP={name:"LINE_LOOP",value:2,description:"Passed to drawElements or drawArrays to draw lines. Each set of two vertices is treated as a separate line segment."},p.LINE_STRIP={name:"LINE_STRIP",value:3,description:"Passed to drawElements or drawArrays to draw a connected group of line segments from the first vertex to the last."},p.TRIANGLES={name:"TRIANGLES",value:4,description:"Passed to drawElements or drawArrays to draw triangles. Each set of three vertices creates a separate triangle."},p.TRIANGLE_STRIP={name:"TRIANGLE_STRIP",value:5,description:"Passed to drawElements or drawArrays to draw a connected group of triangles."},p.TRIANGLE_FAN={name:"TRIANGLE_FAN",value:6,description:"Passed to drawElements or drawArrays to draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan."},p.ZERO={name:"ZERO",value:0,description:"Passed to blendFunc or blendFuncSeparate to turn off a component."},p.ONE={name:"ONE",value:1,description:"Passed to blendFunc or blendFuncSeparate to turn on a component."},p.SRC_COLOR={name:"SRC_COLOR",value:768,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source elements color."},p.ONE_MINUS_SRC_COLOR={name:"ONE_MINUS_SRC_COLOR",value:769,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source elements color."},p.SRC_ALPHA={name:"SRC_ALPHA",value:770,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source's alpha."},p.ONE_MINUS_SRC_ALPHA={name:"ONE_MINUS_SRC_ALPHA",value:771,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source's alpha."},p.DST_ALPHA={name:"DST_ALPHA",value:772,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's alpha."},p.ONE_MINUS_DST_ALPHA={name:"ONE_MINUS_DST_ALPHA",value:773,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's alpha."},p.DST_COLOR={name:"DST_COLOR",value:774,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's color."},p.ONE_MINUS_DST_COLOR={name:"ONE_MINUS_DST_COLOR",value:775,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's color."},p.SRC_ALPHA_SATURATE={name:"SRC_ALPHA_SATURATE",value:776,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the minimum of source's alpha or one minus the destination's alpha."},p.CONSTANT_COLOR={name:"CONSTANT_COLOR",value:32769,description:"Passed to blendFunc or blendFuncSeparate to specify a constant color blend function."},p.ONE_MINUS_CONSTANT_COLOR={name:"ONE_MINUS_CONSTANT_COLOR",value:32770,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant color blend function."},p.CONSTANT_ALPHA={name:"CONSTANT_ALPHA",value:32771,description:"Passed to blendFunc or blendFuncSeparate to specify a constant alpha blend function."},p.ONE_MINUS_CONSTANT_ALPHA={name:"ONE_MINUS_CONSTANT_ALPHA",value:32772,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant alpha blend function."},p.FUNC_ADD={name:"FUNC_ADD",value:32774,description:"Passed to blendEquation or blendEquationSeparate to set an addition blend function."},p.FUNC_SUBSTRACT={name:"FUNC_SUBSTRACT",value:32778,description:"Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination)."},p.FUNC_REVERSE_SUBTRACT={name:"FUNC_REVERSE_SUBTRACT",value:32779,description:"Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source)."},p.BLEND_EQUATION={name:"BLEND_EQUATION",value:32777,description:"Passed to getParameter to get the current RGB blend function."},p.BLEND_EQUATION_RGB={name:"BLEND_EQUATION_RGB",value:32777,description:"Passed to getParameter to get the current RGB blend function. Same as BLEND_EQUATION"},p.BLEND_EQUATION_ALPHA={name:"BLEND_EQUATION_ALPHA",value:34877,description:"Passed to getParameter to get the current alpha blend function. Same as BLEND_EQUATION"},p.BLEND_DST_RGB={name:"BLEND_DST_RGB",value:32968,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_SRC_RGB={name:"BLEND_SRC_RGB",value:32969,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_DST_ALPHA={name:"BLEND_DST_ALPHA",value:32970,description:"Passed to getParameter to get the current destination alpha blend function."},p.BLEND_SRC_ALPHA={name:"BLEND_SRC_ALPHA",value:32971,description:"Passed to getParameter to get the current source alpha blend function."},p.BLEND_COLOR={name:"BLEND_COLOR",value:32773,description:"Passed to getParameter to return a the current blend color."},p.ARRAY_BUFFER_BINDING={name:"ARRAY_BUFFER_BINDING",value:34964,description:"Passed to getParameter to get the array buffer binding."},p.ELEMENT_ARRAY_BUFFER_BINDING={name:"ELEMENT_ARRAY_BUFFER_BINDING",value:34965,description:"Passed to getParameter to get the current element array buffer."},p.LINE_WIDTH={name:"LINE_WIDTH",value:2849,description:"Passed to getParameter to get the current lineWidth (set by the lineWidth method)."},p.ALIASED_POINT_SIZE_RANGE={name:"ALIASED_POINT_SIZE_RANGE",value:33901,description:"Passed to getParameter to get the current size of a point drawn with gl.POINTS"},p.ALIASED_LINE_WIDTH_RANGE={name:"ALIASED_LINE_WIDTH_RANGE",value:33902,description:"Passed to getParameter to get the range of available widths for a line. Returns a length-2 array with the lo value at 0, and hight at 1."},p.CULL_FACE_MODE={name:"CULL_FACE_MODE",value:2885,description:"Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK"},p.FRONT_FACE={name:"FRONT_FACE",value:2886,description:"Passed to getParameter to determine the current value of frontFace. Should return CW or CCW."},p.DEPTH_RANGE={name:"DEPTH_RANGE",value:2928,description:"Passed to getParameter to return a length-2 array of floats giving the current depth range."},p.DEPTH_WRITEMASK={name:"DEPTH_WRITEMASK",value:2930,description:"Passed to getParameter to determine if the depth write mask is enabled."},p.DEPTH_CLEAR_VALUE={name:"DEPTH_CLEAR_VALUE",value:2931,description:"Passed to getParameter to determine the current depth clear value."},p.DEPTH_FUNC={name:"DEPTH_FUNC",value:2932,description:"Passed to getParameter to get the current depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_CLEAR_VALUE={name:"STENCIL_CLEAR_VALUE",value:2961,description:"Passed to getParameter to get the value the stencil will be cleared to."},p.STENCIL_FUNC={name:"STENCIL_FUNC",value:2962,description:"Passed to getParameter to get the current stencil function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_FAIL={name:"STENCIL_FAIL",value:2964,description:"Passed to getParameter to get the current stencil fail function. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_FAIL={name:"STENCIL_PASS_DEPTH_FAIL",value:2965,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test fail. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_PASS={name:"STENCIL_PASS_DEPTH_PASS",value:2966,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test pass. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_REF={name:"STENCIL_REF",value:2967,description:"Passed to getParameter to get the reference value used for stencil tests."},p.STENCIL_VALUE_MASK={name:"STENCIL_VALUE_MASK",value:2963,description:" "},p.STENCIL_WRITEMASK={name:"STENCIL_WRITEMASK",value:2968,description:" "},p.STENCIL_BACK_FUNC={name:"STENCIL_BACK_FUNC",value:34816,description:" "},p.STENCIL_BACK_FAIL={name:"STENCIL_BACK_FAIL",value:34817,description:" "},p.STENCIL_BACK_PASS_DEPTH_FAIL={name:"STENCIL_BACK_PASS_DEPTH_FAIL",value:34818,description:" "},p.STENCIL_BACK_PASS_DEPTH_PASS={name:"STENCIL_BACK_PASS_DEPTH_PASS",value:34819,description:" "},p.STENCIL_BACK_REF={name:"STENCIL_BACK_REF",value:36003,description:" "},p.STENCIL_BACK_VALUE_MASK={name:"STENCIL_BACK_VALUE_MASK",value:36004,description:" "},p.STENCIL_BACK_WRITEMASK={name:"STENCIL_BACK_WRITEMASK",value:36005,description:" "},p.VIEWPORT={name:"VIEWPORT",value:2978,description:"Returns an Int32Array with four elements for the current viewport dimensions."},p.SCISSOR_BOX={name:"SCISSOR_BOX",value:3088,description:"Returns an Int32Array with four elements for the current scissor box dimensions."},p.COLOR_CLEAR_VALUE={name:"COLOR_CLEAR_VALUE",value:3106,description:" "},p.COLOR_WRITEMASK={name:"COLOR_WRITEMASK",value:3107,description:" "},p.UNPACK_ALIGNMENT={name:"UNPACK_ALIGNMENT",value:3317,description:" "},p.PACK_ALIGNMENT={name:"PACK_ALIGNMENT",value:3333,description:" "},p.MAX_TEXTURE_SIZE={name:"MAX_TEXTURE_SIZE",value:3379,description:" "},p.MAX_VIEWPORT_DIMS={name:"MAX_VIEWPORT_DIMS",value:3386,description:" "},p.SUBPIXEL_BITS={name:"SUBPIXEL_BITS",value:3408,description:" "},p.RED_BITS={name:"RED_BITS",value:3410,description:" "},p.GREEN_BITS={name:"GREEN_BITS",value:3411,description:" "},p.BLUE_BITS={name:"BLUE_BITS",value:3412,description:" "},p.ALPHA_BITS={name:"ALPHA_BITS",value:3413,description:" "},p.DEPTH_BITS={name:"DEPTH_BITS",value:3414,description:" "},p.STENCIL_BITS={name:"STENCIL_BITS",value:3415,description:" "},p.POLYGON_OFFSET_UNITS={name:"POLYGON_OFFSET_UNITS",value:10752,description:" "},p.POLYGON_OFFSET_FACTOR={name:"POLYGON_OFFSET_FACTOR",value:32824,description:" "},p.TEXTURE_BINDING_2D={name:"TEXTURE_BINDING_2D",value:32873,description:" "},p.SAMPLE_BUFFERS={name:"SAMPLE_BUFFERS",value:32936,description:" "},p.SAMPLES={name:"SAMPLES",value:32937,description:" "},p.SAMPLE_COVERAGE_VALUE={name:"SAMPLE_COVERAGE_VALUE",value:32938,description:" "},p.SAMPLE_COVERAGE_INVERT={name:"SAMPLE_COVERAGE_INVERT",value:32939,description:" "},p.COMPRESSED_TEXTURE_FORMATS={name:"COMPRESSED_TEXTURE_FORMATS",value:34467,description:" "},p.VENDOR={name:"VENDOR",value:7936,description:" "},p.RENDERER={name:"RENDERER",value:7937,description:" "},p.VERSION={name:"VERSION",value:7938,description:" "},p.IMPLEMENTATION_COLOR_READ_TYPE={name:"IMPLEMENTATION_COLOR_READ_TYPE",value:35738,description:" "},p.IMPLEMENTATION_COLOR_READ_FORMAT={name:"IMPLEMENTATION_COLOR_READ_FORMAT",value:35739,description:" "},p.BROWSER_DEFAULT_WEBGL={name:"BROWSER_DEFAULT_WEBGL",value:37444,description:" "},p.STATIC_DRAW={name:"STATIC_DRAW",value:35044,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and not change often."},p.STREAM_DRAW={name:"STREAM_DRAW",value:35040,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to not be used often."},p.DYNAMIC_DRAW={name:"DYNAMIC_DRAW",value:35048,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and change often."},p.ARRAY_BUFFER={name:"ARRAY_BUFFER",value:34962,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.ELEMENT_ARRAY_BUFFER={name:"ELEMENT_ARRAY_BUFFER",value:34963,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.BUFFER_SIZE={name:"BUFFER_SIZE",value:34660,description:"Passed to getBufferParameter to get a buffer's size."},p.BUFFER_USAGE={name:"BUFFER_USAGE",value:34661,description:"Passed to getBufferParameter to get the hint for the buffer passed in when it was created."},p.CURRENT_VERTEX_ATTRIB={name:"CURRENT_VERTEX_ATTRIB",value:34342,description:"Passed to getVertexAttrib to read back the current vertex attribute."},p.VERTEX_ATTRIB_ARRAY_ENABLED={name:"VERTEX_ATTRIB_ARRAY_ENABLED",value:34338,description:" "},p.VERTEX_ATTRIB_ARRAY_SIZE={name:"VERTEX_ATTRIB_ARRAY_SIZE",value:34339,description:" "},p.VERTEX_ATTRIB_ARRAY_STRIDE={name:"VERTEX_ATTRIB_ARRAY_STRIDE",value:34340,description:" "},p.VERTEX_ATTRIB_ARRAY_TYPE={name:"VERTEX_ATTRIB_ARRAY_TYPE",value:34341,description:" "},p.VERTEX_ATTRIB_ARRAY_NORMALIZED={name:"VERTEX_ATTRIB_ARRAY_NORMALIZED",value:34922,description:" "},p.VERTEX_ATTRIB_ARRAY_POINTER={name:"VERTEX_ATTRIB_ARRAY_POINTER",value:34373,description:" "},p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING={name:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",value:34975,description:" "},p.CULL_FACE={name:"CULL_FACE",value:2884,description:"Passed to enable/disable to turn on/off culling. Can also be used with getParameter to find the current culling method."},p.FRONT={name:"FRONT",value:1028,description:"Passed to cullFace to specify that only front faces should be drawn."},p.BACK={name:"BACK",value:1029,description:"Passed to cullFace to specify that only back faces should be drawn."},p.FRONT_AND_BACK={name:"FRONT_AND_BACK",value:1032,description:"Passed to cullFace to specify that front and back faces should be drawn."},p.BLEND={name:"BLEND",value:3042,description:"Passed to enable/disable to turn on/off blending. Can also be used with getParameter to find the current blending method."},p.DEPTH_TEST={name:"DEPTH_TEST",value:2929,description:"Passed to enable/disable to turn on/off the depth test. Can also be used with getParameter to query the depth test."},p.DITHER={name:"DITHER",value:3024,description:"Passed to enable/disable to turn on/off dithering. Can also be used with getParameter to find the current dithering method."},p.POLYGON_OFFSET_FILL={name:"POLYGON_OFFSET_FILL",value:32823,description:"Passed to enable/disable to turn on/off the polygon offset. Useful for rendering hidden-line images, decals, and or solids with highlighted edges. Can also be used with getParameter to query the scissor test."},p.SAMPLE_ALPHA_TO_COVERAGE={name:"SAMPLE_ALPHA_TO_COVERAGE",value:32926,description:"Passed to enable/disable to turn on/off the alpha to coverage. Used in multi-sampling alpha channels."},p.SAMPLE_COVERAGE={name:"SAMPLE_COVERAGE",value:32928,description:"Passed to enable/disable to turn on/off the sample coverage. Used in multi-sampling."},p.SCISSOR_TEST={name:"SCISSOR_TEST",value:3089,description:"Passed to enable/disable to turn on/off the scissor test. Can also be used with getParameter to query the scissor test."},p.STENCIL_TEST={name:"STENCIL_TEST",value:2960,description:"Passed to enable/disable to turn on/off the stencil test. Can also be used with getParameter to query the stencil test."},p.NO_ERROR={name:"NO_ERROR",value:0,description:"Returned from getError."},p.INVALID_ENUM={name:"INVALID_ENUM",value:1280,description:"Returned from getError."},p.INVALID_VALUE={name:"INVALID_VALUE",value:1281,description:"Returned from getError."},p.INVALID_OPERATION={name:"INVALID_OPERATION",value:1282,description:"Returned from getError."},p.OUT_OF_MEMORY={name:"OUT_OF_MEMORY",value:1285,description:"Returned from getError."},p.CONTEXT_LOST_WEBGL={name:"CONTEXT_LOST_WEBGL",value:37442,description:"Returned from getError."},p.CW={name:"CW",value:2304,description:"Passed to frontFace to specify the front face of a polygon is drawn in the clockwise direction"},p.CCW={name:"CCW",value:2305,description:"Passed to frontFace to specify the front face of a polygon is drawn in the counter clockwise direction"},p.DONT_CARE={name:"DONT_CARE",value:4352,description:"There is no preference for this behavior."},p.FASTEST={name:"FASTEST",value:4353,description:"The most efficient behavior should be used."},p.NICEST={name:"NICEST",value:4354,description:"The most correct or the highest quality option should be used."},p.GENERATE_MIPMAP_HINT={name:"GENERATE_MIPMAP_HINT",value:33170,description:"Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap()."},p.BYTE={name:"BYTE",value:5120,description:" "},p.UNSIGNED_BYTE={name:"UNSIGNED_BYTE",value:5121,description:" "},p.SHORT={name:"SHORT",value:5122,description:" "},p.UNSIGNED_SHORT={name:"UNSIGNED_SHORT",value:5123,description:" "},p.INT={name:"INT",value:5124,description:" "},p.UNSIGNED_INT={name:"UNSIGNED_INT",value:5125,description:" "},p.FLOAT={name:"FLOAT",value:5126,description:" "},p.DEPTH_COMPONENT={name:"DEPTH_COMPONENT",value:6402,description:" "},p.ALPHA={name:"ALPHA",value:6406,description:" "},p.RGB={name:"RGB",value:6407,description:" "},p.RGBA={name:"RGBA",value:6408,description:" "},p.LUMINANCE={name:"LUMINANCE",value:6409,description:" "},p.LUMINANCE_ALPHA={name:"LUMINANCE_ALPHA",value:6410,description:" "},p.UNSIGNED_SHORT_4_4_4_4={name:"UNSIGNED_SHORT_4_4_4_4",value:32819,description:" "},p.UNSIGNED_SHORT_5_5_5_1={name:"UNSIGNED_SHORT_5_5_5_1",value:32820,description:" "},p.UNSIGNED_SHORT_5_6_5={name:"UNSIGNED_SHORT_5_6_5",value:33635,description:" "},p.FRAGMENT_SHADER={name:"FRAGMENT_SHADER",value:35632,description:"Passed to createShader to define a fragment shader."},p.VERTEX_SHADER={name:"VERTEX_SHADER",value:35633,description:"Passed to createShader to define a vertex shader"},p.COMPILE_STATUS={name:"COMPILE_STATUS",value:35713,description:"Passed to getShaderParamter to get the status of the compilation. Returns false if the shader was not compiled. You can then query getShaderInfoLog to find the exact error"},p.DELETE_STATUS={name:"DELETE_STATUS",value:35712,description:"Passed to getShaderParamter to determine if a shader was deleted via deleteShader. Returns true if it was, false otherwise."},p.LINK_STATUS={name:"LINK_STATUS",value:35714,description:"Passed to getProgramParameter after calling linkProgram to determine if a program was linked correctly. Returns false if there were errors. Use getProgramInfoLog to find the exact error."},p.VALIDATE_STATUS={name:"VALIDATE_STATUS",value:35715,description:"Passed to getProgramParameter after calling validateProgram to determine if it is valid. Returns false if errors were found."},p.ATTACHED_SHADERS={name:"ATTACHED_SHADERS",value:35717,description:"Passed to getProgramParameter after calling attachShader to determine if the shader was attached correctly. Returns false if errors occurred."},p.COMPLETION_STATUS_KHR={name:"COMPLETION_STATUS_KHR",value:37297,description:"Passed to getProgramParameter (KHR_parallel_shader_compile) to query whether an asynchronous shader/program link has completed. Returns true once the program is ready to use without blocking."},p.ACTIVE_ATTRIBUTES={name:"ACTIVE_ATTRIBUTES",value:35721,description:"Passed to getProgramParameter to get the number of attributes active in a program."},p.ACTIVE_UNIFORMS={name:"ACTIVE_UNIFORMS",value:35718,description:"Passed to getProgramParamter to get the number of uniforms active in a program."},p.MAX_VERTEX_ATTRIBS={name:"MAX_VERTEX_ATTRIBS",value:34921,description:" "},p.MAX_VERTEX_UNIFORM_VECTORS={name:"MAX_VERTEX_UNIFORM_VECTORS",value:36347,description:" "},p.MAX_VARYING_VECTORS={name:"MAX_VARYING_VECTORS",value:36348,description:" "},p.MAX_COMBINED_TEXTURE_IMAGE_UNITS={name:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",value:35661,description:" "},p.MAX_VERTEX_TEXTURE_IMAGE_UNITS={name:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",value:35660,description:" "},p.MAX_TEXTURE_IMAGE_UNITS={name:"MAX_TEXTURE_IMAGE_UNITS",value:34930,description:"Implementation dependent number of maximum texture units. At least 8."},p.MAX_FRAGMENT_UNIFORM_VECTORS={name:"MAX_FRAGMENT_UNIFORM_VECTORS",value:36349,description:" "},p.SHADER_TYPE={name:"SHADER_TYPE",value:35663,description:" "},p.SHADING_LANGUAGE_VERSION={name:"SHADING_LANGUAGE_VERSION",value:35724,description:" "},p.CURRENT_PROGRAM={name:"CURRENT_PROGRAM",value:35725,description:" "},p.NEVER={name:"NEVER",value:512,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn."},p.ALWAYS={name:"ALWAYS",value:519,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn."},p.LESS={name:"LESS",value:513,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value."},p.EQUAL={name:"EQUAL",value:514,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value."},p.LEQUAL={name:"LEQUAL",value:515,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value."},p.GREATER={name:"GREATER",value:516,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value."},p.GEQUAL={name:"GEQUAL",value:518,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value."},p.NOTEQUAL={name:"NOTEQUAL",value:517,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value."},p.KEEP={name:"KEEP",value:7680,description:" "},p.REPLACE={name:"REPLACE",value:7681,description:" "},p.INCR={name:"INCR",value:7682,description:" "},p.DECR={name:"DECR",value:7683,description:" "},p.INVERT={name:"INVERT",value:5386,description:" "},p.INCR_WRAP={name:"INCR_WRAP",value:34055,description:" "},p.DECR_WRAP={name:"DECR_WRAP",value:34056,description:" "},p.NEAREST={name:"NEAREST",value:9728,description:" "},p.LINEAR={name:"LINEAR",value:9729,description:" "},p.NEAREST_MIPMAP_NEAREST={name:"NEAREST_MIPMAP_NEAREST",value:9984,description:" "},p.LINEAR_MIPMAP_NEAREST={name:"LINEAR_MIPMAP_NEAREST",value:9985,description:" "},p.NEAREST_MIPMAP_LINEAR={name:"NEAREST_MIPMAP_LINEAR",value:9986,description:" "},p.LINEAR_MIPMAP_LINEAR={name:"LINEAR_MIPMAP_LINEAR",value:9987,description:" "},p.TEXTURE_MAG_FILTER={name:"TEXTURE_MAG_FILTER",value:10240,description:" "},p.TEXTURE_MIN_FILTER={name:"TEXTURE_MIN_FILTER",value:10241,description:" "},p.TEXTURE_WRAP_S={name:"TEXTURE_WRAP_S",value:10242,description:" "},p.TEXTURE_WRAP_T={name:"TEXTURE_WRAP_T",value:10243,description:" "},p.TEXTURE_2D={name:"TEXTURE_2D",value:3553,description:" "},p.TEXTURE={name:"TEXTURE",value:5890,description:" "},p.TEXTURE_CUBE_MAP={name:"TEXTURE_CUBE_MAP",value:34067,description:" "},p.TEXTURE_BINDING_CUBE_MAP={name:"TEXTURE_BINDING_CUBE_MAP",value:34068,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_X={name:"TEXTURE_CUBE_MAP_POSITIVE_X",value:34069,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_X={name:"TEXTURE_CUBE_MAP_NEGATIVE_X",value:34070,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Y={name:"TEXTURE_CUBE_MAP_POSITIVE_Y",value:34071,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Y={name:"TEXTURE_CUBE_MAP_NEGATIVE_Y",value:34072,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Z={name:"TEXTURE_CUBE_MAP_POSITIVE_Z",value:34073,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Z={name:"TEXTURE_CUBE_MAP_NEGATIVE_Z",value:34074,description:" "},p.MAX_CUBE_MAP_TEXTURE_SIZE={name:"MAX_CUBE_MAP_TEXTURE_SIZE",value:34076,description:" "},p.TEXTURE0={name:"TEXTURE0",value:33984,description:"A texture unit."},p.TEXTURE1={name:"TEXTURE1",value:33985,description:"A texture unit."},p.TEXTURE2={name:"TEXTURE2",value:33986,description:"A texture unit."},p.TEXTURE3={name:"TEXTURE3",value:33987,description:"A texture unit."},p.TEXTURE4={name:"TEXTURE4",value:33988,description:"A texture unit."},p.TEXTURE5={name:"TEXTURE5",value:33989,description:"A texture unit."},p.TEXTURE6={name:"TEXTURE6",value:33990,description:"A texture unit."},p.TEXTURE7={name:"TEXTURE7",value:33991,description:"A texture unit."},p.TEXTURE8={name:"TEXTURE8",value:33992,description:"A texture unit."},p.TEXTURE9={name:"TEXTURE9",value:33993,description:"A texture unit."},p.TEXTURE10={name:"TEXTURE10",value:33994,description:"A texture unit."},p.TEXTURE11={name:"TEXTURE11",value:33995,description:"A texture unit."},p.TEXTURE12={name:"TEXTURE12",value:33996,description:"A texture unit."},p.TEXTURE13={name:"TEXTURE13",value:33997,description:"A texture unit."},p.TEXTURE14={name:"TEXTURE14",value:33998,description:"A texture unit."},p.TEXTURE15={name:"TEXTURE15",value:33999,description:"A texture unit."},p.TEXTURE16={name:"TEXTURE16",value:34e3,description:"A texture unit."},p.TEXTURE17={name:"TEXTURE17",value:34001,description:"A texture unit."},p.TEXTURE18={name:"TEXTURE18",value:34002,description:"A texture unit."},p.TEXTURE19={name:"TEXTURE19",value:34003,description:"A texture unit."},p.TEXTURE20={name:"TEXTURE20",value:34004,description:"A texture unit."},p.TEXTURE21={name:"TEXTURE21",value:34005,description:"A texture unit."},p.TEXTURE22={name:"TEXTURE22",value:34006,description:"A texture unit."},p.TEXTURE23={name:"TEXTURE23",value:34007,description:"A texture unit."},p.TEXTURE24={name:"TEXTURE24",value:34008,description:"A texture unit."},p.TEXTURE25={name:"TEXTURE25",value:34009,description:"A texture unit."},p.TEXTURE26={name:"TEXTURE26",value:34010,description:"A texture unit."},p.TEXTURE27={name:"TEXTURE27",value:34011,description:"A texture unit."},p.TEXTURE28={name:"TEXTURE28",value:34012,description:"A texture unit."},p.TEXTURE29={name:"TEXTURE29",value:34013,description:"A texture unit."},p.TEXTURE30={name:"TEXTURE30",value:34014,description:"A texture unit."},p.TEXTURE31={name:"TEXTURE31",value:34015,description:"A texture unit."},p.ACTIVE_TEXTURE={name:"ACTIVE_TEXTURE",value:34016,description:"The current active texture unit."},p.REPEAT={name:"REPEAT",value:10497,description:" "},p.CLAMP_TO_EDGE={name:"CLAMP_TO_EDGE",value:33071,description:" "},p.MIRRORED_REPEAT={name:"MIRRORED_REPEAT",value:33648,description:" "},p.FLOAT_VEC2={name:"FLOAT_VEC2",value:35664,description:" "},p.FLOAT_VEC3={name:"FLOAT_VEC3",value:35665,description:" "},p.FLOAT_VEC4={name:"FLOAT_VEC4",value:35666,description:" "},p.INT_VEC2={name:"INT_VEC2",value:35667,description:" "},p.INT_VEC3={name:"INT_VEC3",value:35668,description:" "},p.INT_VEC4={name:"INT_VEC4",value:35669,description:" "},p.BOOL={name:"BOOL",value:35670,description:" "},p.BOOL_VEC2={name:"BOOL_VEC2",value:35671,description:" "},p.BOOL_VEC3={name:"BOOL_VEC3",value:35672,description:" "},p.BOOL_VEC4={name:"BOOL_VEC4",value:35673,description:" "},p.FLOAT_MAT2={name:"FLOAT_MAT2",value:35674,description:" "},p.FLOAT_MAT3={name:"FLOAT_MAT3",value:35675,description:" "},p.FLOAT_MAT4={name:"FLOAT_MAT4",value:35676,description:" "},p.SAMPLER_2D={name:"SAMPLER_2D",value:35678,description:" "},p.SAMPLER_CUBE={name:"SAMPLER_CUBE",value:35680,description:" "},p.LOW_FLOAT={name:"LOW_FLOAT",value:36336,description:" "},p.MEDIUM_FLOAT={name:"MEDIUM_FLOAT",value:36337,description:" "},p.HIGH_FLOAT={name:"HIGH_FLOAT",value:36338,description:" "},p.LOW_INT={name:"LOW_INT",value:36339,description:" "},p.MEDIUM_INT={name:"MEDIUM_INT",value:36340,description:" "},p.HIGH_INT={name:"HIGH_INT",value:36341,description:" "},p.FRAMEBUFFER={name:"FRAMEBUFFER",value:36160,description:" "},p.RENDERBUFFER={name:"RENDERBUFFER",value:36161,description:" "},p.RGBA4={name:"RGBA4",value:32854,description:" "},p.RGB5_A1={name:"RGB5_A1",value:32855,description:" "},p.RGB565={name:"RGB565",value:36194,description:" "},p.DEPTH_COMPONENT16={name:"DEPTH_COMPONENT16",value:33189,description:" "},p.STENCIL_INDEX={name:"STENCIL_INDEX",value:6401,description:" "},p.STENCIL_INDEX8={name:"STENCIL_INDEX8",value:36168,description:" "},p.DEPTH_STENCIL={name:"DEPTH_STENCIL",value:34041,description:" "},p.RENDERBUFFER_WIDTH={name:"RENDERBUFFER_WIDTH",value:36162,description:" "},p.RENDERBUFFER_HEIGHT={name:"RENDERBUFFER_HEIGHT",value:36163,description:" "},p.RENDERBUFFER_INTERNAL_FORMAT={name:"RENDERBUFFER_INTERNAL_FORMAT",value:36164,description:" "},p.RENDERBUFFER_RED_SIZE={name:"RENDERBUFFER_RED_SIZE",value:36176,description:" "},p.RENDERBUFFER_GREEN_SIZE={name:"RENDERBUFFER_GREEN_SIZE",value:36177,description:" "},p.RENDERBUFFER_BLUE_SIZE={name:"RENDERBUFFER_BLUE_SIZE",value:36178,description:" "},p.RENDERBUFFER_ALPHA_SIZE={name:"RENDERBUFFER_ALPHA_SIZE",value:36179,description:" "},p.RENDERBUFFER_DEPTH_SIZE={name:"RENDERBUFFER_DEPTH_SIZE",value:36180,description:" "},p.RENDERBUFFER_STENCIL_SIZE={name:"RENDERBUFFER_STENCIL_SIZE",value:36181,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",value:36048,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",value:36049,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",value:36050,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",value:36051,description:" "},p.COLOR_ATTACHMENT0={name:"COLOR_ATTACHMENT0",value:36064,description:" "},p.DEPTH_ATTACHMENT={name:"DEPTH_ATTACHMENT",value:36096,description:" "},p.STENCIL_ATTACHMENT={name:"STENCIL_ATTACHMENT",value:36128,description:" "},p.DEPTH_STENCIL_ATTACHMENT={name:"DEPTH_STENCIL_ATTACHMENT",value:33306,description:" "},p.NONE={name:"NONE",value:0,description:" "},p.FRAMEBUFFER_COMPLETE={name:"FRAMEBUFFER_COMPLETE",value:36053,description:" "},p.FRAMEBUFFER_INCOMPLETE_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",value:36054,description:" "},p.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",value:36055,description:" "},p.FRAMEBUFFER_INCOMPLETE_DIMENSIONS={name:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",value:36057,description:" "},p.FRAMEBUFFER_UNSUPPORTED={name:"FRAMEBUFFER_UNSUPPORTED",value:36061,description:" "},p.FRAMEBUFFER_BINDING={name:"FRAMEBUFFER_BINDING",value:36006,description:" "},p.RENDERBUFFER_BINDING={name:"RENDERBUFFER_BINDING",value:36007,description:" "},p.MAX_RENDERBUFFER_SIZE={name:"MAX_RENDERBUFFER_SIZE",value:34024,description:" "},p.INVALID_FRAMEBUFFER_OPERATION={name:"INVALID_FRAMEBUFFER_OPERATION",value:1286,description:" "},p.UNPACK_FLIP_Y_WEBGL={name:"UNPACK_FLIP_Y_WEBGL",value:37440,description:" "},p.UNPACK_PREMULTIPLY_ALPHA_WEBGL={name:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",value:37441,description:" "},p.UNPACK_COLORSPACE_CONVERSION_WEBGL={name:"UNPACK_COLORSPACE_CONVERSION_WEBGL",value:37443,description:" "},p.READ_BUFFER={name:"READ_BUFFER",value:3074,description:" "},p.UNPACK_ROW_LENGTH={name:"UNPACK_ROW_LENGTH",value:3314,description:" "},p.UNPACK_SKIP_ROWS={name:"UNPACK_SKIP_ROWS",value:3315,description:" "},p.UNPACK_SKIP_PIXELS={name:"UNPACK_SKIP_PIXELS",value:3316,description:" "},p.PACK_ROW_LENGTH={name:"PACK_ROW_LENGTH",value:3330,description:" "},p.PACK_SKIP_ROWS={name:"PACK_SKIP_ROWS",value:3331,description:" "},p.PACK_SKIP_PIXELS={name:"PACK_SKIP_PIXELS",value:3332,description:" "},p.TEXTURE_BINDING_3D={name:"TEXTURE_BINDING_3D",value:32874,description:" "},p.UNPACK_SKIP_IMAGES={name:"UNPACK_SKIP_IMAGES",value:32877,description:" "},p.UNPACK_IMAGE_HEIGHT={name:"UNPACK_IMAGE_HEIGHT",value:32878,description:" "},p.MAX_3D_TEXTURE_SIZE={name:"MAX_3D_TEXTURE_SIZE",value:32883,description:" "},p.MAX_ELEMENTS_VERTICES={name:"MAX_ELEMENTS_VERTICES",value:33e3,description:" "},p.MAX_ELEMENTS_INDICES={name:"MAX_ELEMENTS_INDICES",value:33001,description:" "},p.MAX_TEXTURE_LOD_BIAS={name:"MAX_TEXTURE_LOD_BIAS",value:34045,description:" "},p.MAX_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_FRAGMENT_UNIFORM_COMPONENTS",value:35657,description:" "},p.MAX_VERTEX_UNIFORM_COMPONENTS={name:"MAX_VERTEX_UNIFORM_COMPONENTS",value:35658,description:" "},p.MAX_ARRAY_TEXTURE_LAYERS={name:"MAX_ARRAY_TEXTURE_LAYERS",value:35071,description:" "},p.MIN_PROGRAM_TEXEL_OFFSET={name:"MIN_PROGRAM_TEXEL_OFFSET",value:35076,description:" "},p.MAX_PROGRAM_TEXEL_OFFSET={name:"MAX_PROGRAM_TEXEL_OFFSET",value:35077,description:" "},p.MAX_VARYING_COMPONENTS={name:"MAX_VARYING_COMPONENTS",value:35659,description:" "},p.FRAGMENT_SHADER_DERIVATIVE_HINT={name:"FRAGMENT_SHADER_DERIVATIVE_HINT",value:35723,description:" "},p.RASTERIZER_DISCARD={name:"RASTERIZER_DISCARD",value:35977,description:" "},p.VERTEX_ARRAY_BINDING={name:"VERTEX_ARRAY_BINDING",value:34229,description:" "},p.MAX_VERTEX_OUTPUT_COMPONENTS={name:"MAX_VERTEX_OUTPUT_COMPONENTS",value:37154,description:" "},p.MAX_FRAGMENT_INPUT_COMPONENTS={name:"MAX_FRAGMENT_INPUT_COMPONENTS",value:37157,description:" "},p.MAX_SERVER_WAIT_TIMEOUT={name:"MAX_SERVER_WAIT_TIMEOUT",value:37137,description:" "},p.MAX_ELEMENT_INDEX={name:"MAX_ELEMENT_INDEX",value:36203,description:" "},p.RED={name:"RED",value:6403,description:" "},p.RGB8={name:"RGB8",value:32849,description:" "},p.RGBA8={name:"RGBA8",value:32856,description:" "},p.RGB10_A2={name:"RGB10_A2",value:32857,description:" "},p.TEXTURE_3D={name:"TEXTURE_3D",value:32879,description:" "},p.TEXTURE_WRAP_R={name:"TEXTURE_WRAP_R",value:32882,description:" "},p.TEXTURE_MIN_LOD={name:"TEXTURE_MIN_LOD",value:33082,description:" "},p.TEXTURE_MAX_LOD={name:"TEXTURE_MAX_LOD",value:33083,description:" "},p.TEXTURE_BASE_LEVEL={name:"TEXTURE_BASE_LEVEL",value:33084,description:" "},p.TEXTURE_MAX_LEVEL={name:"TEXTURE_MAX_LEVEL",value:33085,description:" "},p.TEXTURE_COMPARE_MODE={name:"TEXTURE_COMPARE_MODE",value:34892,description:" "},p.TEXTURE_COMPARE_FUNC={name:"TEXTURE_COMPARE_FUNC",value:34893,description:" "},p.SRGB={name:"SRGB",value:35904,description:" "},p.SRGB8={name:"SRGB8",value:35905,description:" "},p.SRGB8_ALPHA8={name:"SRGB8_ALPHA8",value:35907,description:" "},p.COMPARE_REF_TO_TEXTURE={name:"COMPARE_REF_TO_TEXTURE",value:34894,description:" "},p.RGBA32F={name:"RGBA32F",value:34836,description:" "},p.RGB32F={name:"RGB32F",value:34837,description:" "},p.RGBA16F={name:"RGBA16F",value:34842,description:" "},p.RGB16F={name:"RGB16F",value:34843,description:" "},p.TEXTURE_2D_ARRAY={name:"TEXTURE_2D_ARRAY",value:35866,description:" "},p.TEXTURE_BINDING_2D_ARRAY={name:"TEXTURE_BINDING_2D_ARRAY",value:35869,description:" "},p.R11F_G11F_B10F={name:"R11F_G11F_B10F",value:35898,description:" "},p.RGB9_E5={name:"RGB9_E5",value:35901,description:" "},p.RGBA32UI={name:"RGBA32UI",value:36208,description:" "},p.RGB32UI={name:"RGB32UI",value:36209,description:" "},p.RGBA16UI={name:"RGBA16UI",value:36214,description:" "},p.RGB16UI={name:"RGB16UI",value:36215,description:" "},p.RGBA8UI={name:"RGBA8UI",value:36220,description:" "},p.RGB8UI={name:"RGB8UI",value:36221,description:" "},p.RGBA32I={name:"RGBA32I",value:36226,description:" "},p.RGB32I={name:"RGB32I",value:36227,description:" "},p.RGBA16I={name:"RGBA16I",value:36232,description:" "},p.RGB16I={name:"RGB16I",value:36233,description:" "},p.RGBA8I={name:"RGBA8I",value:36238,description:" "},p.RGB8I={name:"RGB8I",value:36239,description:" "},p.RED_INTEGER={name:"RED_INTEGER",value:36244,description:" "},p.RGB_INTEGER={name:"RGB_INTEGER",value:36248,description:" "},p.RGBA_INTEGER={name:"RGBA_INTEGER",value:36249,description:" "},p.R8={name:"R8",value:33321,description:" "},p.RG8={name:"RG8",value:33323,description:" "},p.R16F={name:"R16F",value:33325,description:" "},p.R32F={name:"R32F",value:33326,description:" "},p.RG16F={name:"RG16F",value:33327,description:" "},p.RG32F={name:"RG32F",value:33328,description:" "},p.R8I={name:"R8I",value:33329,description:" "},p.R8UI={name:"R8UI",value:33330,description:" "},p.R16I={name:"R16I",value:33331,description:" "},p.R16UI={name:"R16UI",value:33332,description:" "},p.R32I={name:"R32I",value:33333,description:" "},p.R32UI={name:"R32UI",value:33334,description:" "},p.RG8I={name:"RG8I",value:33335,description:" "},p.RG8UI={name:"RG8UI",value:33336,description:" "},p.RG16I={name:"RG16I",value:33337,description:" "},p.RG16UI={name:"RG16UI",value:33338,description:" "},p.RG32I={name:"RG32I",value:33339,description:" "},p.RG32UI={name:"RG32UI",value:33340,description:" "},p.R8_SNORM={name:"R8_SNORM",value:36756,description:" "},p.RG8_SNORM={name:"RG8_SNORM",value:36757,description:" "},p.RGB8_SNORM={name:"RGB8_SNORM",value:36758,description:" "},p.RGBA8_SNORM={name:"RGBA8_SNORM",value:36759,description:" "},p.RGB10_A2UI={name:"RGB10_A2UI",value:36975,description:" "},p.TEXTURE_IMMUTABLE_FORMAT={name:"TEXTURE_IMMUTABLE_FORMAT",value:37167,description:" "},p.TEXTURE_IMMUTABLE_LEVELS={name:"TEXTURE_IMMUTABLE_LEVELS",value:33503,description:" "},p.UNSIGNED_INT_2_10_10_10_REV={name:"UNSIGNED_INT_2_10_10_10_REV",value:33640,description:" "},p.UNSIGNED_INT_10F_11F_11F_REV={name:"UNSIGNED_INT_10F_11F_11F_REV",value:35899,description:" "},p.UNSIGNED_INT_5_9_9_9_REV={name:"UNSIGNED_INT_5_9_9_9_REV",value:35902,description:" "},p.FLOAT_32_UNSIGNED_INT_24_8_REV={name:"FLOAT_32_UNSIGNED_INT_24_8_REV",value:36269,description:" "},p.UNSIGNED_INT_24_8={name:"UNSIGNED_INT_24_8",value:34042,description:" "},p.HALF_FLOAT={name:"HALF_FLOAT",value:5131,description:" "},p.RG={name:"RG",value:33319,description:" "},p.RG_INTEGER={name:"RG_INTEGER",value:33320,description:" "},p.INT_2_10_10_10_REV={name:"INT_2_10_10_10_REV",value:36255,description:" "},p.CURRENT_QUERY={name:"CURRENT_QUERY",value:34917,description:" "},p.QUERY_RESULT={name:"QUERY_RESULT",value:34918,description:" "},p.QUERY_RESULT_AVAILABLE={name:"QUERY_RESULT_AVAILABLE",value:34919,description:" "},p.ANY_SAMPLES_PASSED={name:"ANY_SAMPLES_PASSED",value:35887,description:" "},p.ANY_SAMPLES_PASSED_CONSERVATIVE={name:"ANY_SAMPLES_PASSED_CONSERVATIVE",value:36202,description:" "},p.MAX_DRAW_BUFFERS={name:"MAX_DRAW_BUFFERS",value:34852,description:" "},p.DRAW_BUFFER0={name:"DRAW_BUFFER0",value:34853,description:" "},p.DRAW_BUFFER1={name:"DRAW_BUFFER1",value:34854,description:" "},p.DRAW_BUFFER2={name:"DRAW_BUFFER2",value:34855,description:" "},p.DRAW_BUFFER3={name:"DRAW_BUFFER3",value:34856,description:" "},p.DRAW_BUFFER4={name:"DRAW_BUFFER4",value:34857,description:" "},p.DRAW_BUFFER5={name:"DRAW_BUFFER5",value:34858,description:" "},p.DRAW_BUFFER6={name:"DRAW_BUFFER6",value:34859,description:" "},p.DRAW_BUFFER7={name:"DRAW_BUFFER7",value:34860,description:" "},p.DRAW_BUFFER8={name:"DRAW_BUFFER8",value:34861,description:" "},p.DRAW_BUFFER9={name:"DRAW_BUFFER9",value:34862,description:" "},p.DRAW_BUFFER10={name:"DRAW_BUFFER10",value:34863,description:" "},p.DRAW_BUFFER11={name:"DRAW_BUFFER11",value:34864,description:" "},p.DRAW_BUFFER12={name:"DRAW_BUFFER12",value:34865,description:" "},p.DRAW_BUFFER13={name:"DRAW_BUFFER13",value:34866,description:" "},p.DRAW_BUFFER14={name:"DRAW_BUFFER14",value:34867,description:" "},p.DRAW_BUFFER15={name:"DRAW_BUFFER15",value:34868,description:" "},p.MAX_COLOR_ATTACHMENTS={name:"MAX_COLOR_ATTACHMENTS",value:36063,description:" "},p.COLOR_ATTACHMENT1={name:"COLOR_ATTACHMENT1",value:36065,description:" "},p.COLOR_ATTACHMENT2={name:"COLOR_ATTACHMENT2",value:36066,description:" "},p.COLOR_ATTACHMENT3={name:"COLOR_ATTACHMENT3",value:36067,description:" "},p.COLOR_ATTACHMENT4={name:"COLOR_ATTACHMENT4",value:36068,description:" "},p.COLOR_ATTACHMENT5={name:"COLOR_ATTACHMENT5",value:36069,description:" "},p.COLOR_ATTACHMENT6={name:"COLOR_ATTACHMENT6",value:36070,description:" "},p.COLOR_ATTACHMENT7={name:"COLOR_ATTACHMENT7",value:36071,description:" "},p.COLOR_ATTACHMENT8={name:"COLOR_ATTACHMENT8",value:36072,description:" "},p.COLOR_ATTACHMENT9={name:"COLOR_ATTACHMENT9",value:36073,description:" "},p.COLOR_ATTACHMENT10={name:"COLOR_ATTACHMENT10",value:36074,description:" "},p.COLOR_ATTACHMENT11={name:"COLOR_ATTACHMENT11",value:36075,description:" "},p.COLOR_ATTACHMENT12={name:"COLOR_ATTACHMENT12",value:36076,description:" "},p.COLOR_ATTACHMENT13={name:"COLOR_ATTACHMENT13",value:36077,description:" "},p.COLOR_ATTACHMENT14={name:"COLOR_ATTACHMENT14",value:36078,description:" "},p.COLOR_ATTACHMENT15={name:"COLOR_ATTACHMENT15",value:36079,description:" "},p.SAMPLER_3D={name:"SAMPLER_3D",value:35679,description:" "},p.SAMPLER_2D_SHADOW={name:"SAMPLER_2D_SHADOW",value:35682,description:" "},p.SAMPLER_2D_ARRAY={name:"SAMPLER_2D_ARRAY",value:36289,description:" "},p.SAMPLER_2D_ARRAY_SHADOW={name:"SAMPLER_2D_ARRAY_SHADOW",value:36292,description:" "},p.SAMPLER_CUBE_SHADOW={name:"SAMPLER_CUBE_SHADOW",value:36293,description:" "},p.INT_SAMPLER_2D={name:"INT_SAMPLER_2D",value:36298,description:" "},p.INT_SAMPLER_3D={name:"INT_SAMPLER_3D",value:36299,description:" "},p.INT_SAMPLER_CUBE={name:"INT_SAMPLER_CUBE",value:36300,description:" "},p.INT_SAMPLER_2D_ARRAY={name:"INT_SAMPLER_2D_ARRAY",value:36303,description:" "},p.UNSIGNED_INT_SAMPLER_2D={name:"UNSIGNED_INT_SAMPLER_2D",value:36306,description:" "},p.UNSIGNED_INT_SAMPLER_3D={name:"UNSIGNED_INT_SAMPLER_3D",value:36307,description:" "},p.UNSIGNED_INT_SAMPLER_CUBE={name:"UNSIGNED_INT_SAMPLER_CUBE",value:36308,description:" "},p.UNSIGNED_INT_SAMPLER_2D_ARRAY={name:"UNSIGNED_INT_SAMPLER_2D_ARRAY",value:36311,description:" "},p.MAX_SAMPLES={name:"MAX_SAMPLES",value:36183,description:" "},p.SAMPLER_BINDING={name:"SAMPLER_BINDING",value:35097,description:" "},p.PIXEL_PACK_BUFFER={name:"PIXEL_PACK_BUFFER",value:35051,description:" "},p.PIXEL_UNPACK_BUFFER={name:"PIXEL_UNPACK_BUFFER",value:35052,description:" "},p.PIXEL_PACK_BUFFER_BINDING={name:"PIXEL_PACK_BUFFER_BINDING",value:35053,description:" "},p.PIXEL_UNPACK_BUFFER_BINDING={name:"PIXEL_UNPACK_BUFFER_BINDING",value:35055,description:" "},p.COPY_READ_BUFFER={name:"COPY_READ_BUFFER",value:36662,description:" "},p.COPY_WRITE_BUFFER={name:"COPY_WRITE_BUFFER",value:36663,description:" "},p.COPY_READ_BUFFER_BINDING={name:"COPY_READ_BUFFER_BINDING",value:36662,description:" "},p.COPY_WRITE_BUFFER_BINDING={name:"COPY_WRITE_BUFFER_BINDING",value:36663,description:" "},p.FLOAT_MAT2x3={name:"FLOAT_MAT2x3",value:35685,description:" "},p.FLOAT_MAT2x4={name:"FLOAT_MAT2x4",value:35686,description:" "},p.FLOAT_MAT3x2={name:"FLOAT_MAT3x2",value:35687,description:" "},p.FLOAT_MAT3x4={name:"FLOAT_MAT3x4",value:35688,description:" "},p.FLOAT_MAT4x2={name:"FLOAT_MAT4x2",value:35689,description:" "},p.FLOAT_MAT4x3={name:"FLOAT_MAT4x3",value:35690,description:" "},p.UNSIGNED_INT_VEC2={name:"UNSIGNED_INT_VEC2",value:36294,description:" "},p.UNSIGNED_INT_VEC3={name:"UNSIGNED_INT_VEC3",value:36295,description:" "},p.UNSIGNED_INT_VEC4={name:"UNSIGNED_INT_VEC4",value:36296,description:" "},p.UNSIGNED_NORMALIZED={name:"UNSIGNED_NORMALIZED",value:35863,description:" "},p.SIGNED_NORMALIZED={name:"SIGNED_NORMALIZED",value:36764,description:" "},p.VERTEX_ATTRIB_ARRAY_INTEGER={name:"VERTEX_ATTRIB_ARRAY_INTEGER",value:35069,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR={name:"VERTEX_ATTRIB_ARRAY_DIVISOR",value:35070,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_MODE={name:"TRANSFORM_FEEDBACK_BUFFER_MODE",value:35967,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",value:35968,description:" "},p.TRANSFORM_FEEDBACK_VARYINGS={name:"TRANSFORM_FEEDBACK_VARYINGS",value:35971,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_START={name:"TRANSFORM_FEEDBACK_BUFFER_START",value:35972,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_SIZE={name:"TRANSFORM_FEEDBACK_BUFFER_SIZE",value:35973,description:" "},p.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN={name:"TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",value:35976,description:" "},p.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",value:35978,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",value:35979,description:" "},p.INTERLEAVED_ATTRIBS={name:"INTERLEAVED_ATTRIBS",value:35980,description:" "},p.SEPARATE_ATTRIBS={name:"SEPARATE_ATTRIBS",value:35981,description:" "},p.TRANSFORM_FEEDBACK_BUFFER={name:"TRANSFORM_FEEDBACK_BUFFER",value:35982,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_BINDING={name:"TRANSFORM_FEEDBACK_BUFFER_BINDING",value:35983,description:" "},p.TRANSFORM_FEEDBACK={name:"TRANSFORM_FEEDBACK",value:36386,description:" "},p.TRANSFORM_FEEDBACK_PAUSED={name:"TRANSFORM_FEEDBACK_PAUSED",value:36387,description:" "},p.TRANSFORM_FEEDBACK_ACTIVE={name:"TRANSFORM_FEEDBACK_ACTIVE",value:36388,description:" "},p.TRANSFORM_FEEDBACK_BINDING={name:"TRANSFORM_FEEDBACK_BINDING",value:36389,description:" "},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",value:33296,description:" "},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",value:33297,description:" "},p.FRAMEBUFFER_ATTACHMENT_RED_SIZE={name:"FRAMEBUFFER_ATTACHMENT_RED_SIZE",value:33298,description:" "},p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE={name:"FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",value:33299,description:" "},p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE={name:"FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",value:33300,description:" "},p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE={name:"FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",value:33301,description:" "},p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE={name:"FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",value:33302,description:" "},p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE={name:"FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",value:33303,description:" "},p.FRAMEBUFFER_DEFAULT={name:"FRAMEBUFFER_DEFAULT",value:33304,description:" "},p.DEPTH24_STENCIL8={name:"DEPTH24_STENCIL8",value:35056,description:" "},p.DRAW_FRAMEBUFFER_BINDING={name:"DRAW_FRAMEBUFFER_BINDING",value:36006,description:" "},p.READ_FRAMEBUFFER={name:"READ_FRAMEBUFFER",value:36008,description:" "},p.DRAW_FRAMEBUFFER={name:"DRAW_FRAMEBUFFER",value:36009,description:" "},p.READ_FRAMEBUFFER_BINDING={name:"READ_FRAMEBUFFER_BINDING",value:36010,description:" "},p.RENDERBUFFER_SAMPLES={name:"RENDERBUFFER_SAMPLES",value:36011,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",value:36052,description:" "},p.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE={name:"FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",value:36182,description:" "},p.UNIFORM_BUFFER={name:"UNIFORM_BUFFER",value:35345,description:" "},p.UNIFORM_BUFFER_BINDING={name:"UNIFORM_BUFFER_BINDING",value:35368,description:" "},p.UNIFORM_BUFFER_START={name:"UNIFORM_BUFFER_START",value:35369,description:" "},p.UNIFORM_BUFFER_SIZE={name:"UNIFORM_BUFFER_SIZE",value:35370,description:" "},p.MAX_VERTEX_UNIFORM_BLOCKS={name:"MAX_VERTEX_UNIFORM_BLOCKS",value:35371,description:" "},p.MAX_FRAGMENT_UNIFORM_BLOCKS={name:"MAX_FRAGMENT_UNIFORM_BLOCKS",value:35373,description:" "},p.MAX_COMBINED_UNIFORM_BLOCKS={name:"MAX_COMBINED_UNIFORM_BLOCKS",value:35374,description:" "},p.MAX_UNIFORM_BUFFER_BINDINGS={name:"MAX_UNIFORM_BUFFER_BINDINGS",value:35375,description:" "},p.MAX_UNIFORM_BLOCK_SIZE={name:"MAX_UNIFORM_BLOCK_SIZE",value:35376,description:" "},p.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS={name:"MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",value:35377,description:" "},p.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",value:35379,description:" "},p.UNIFORM_BUFFER_OFFSET_ALIGNMENT={name:"UNIFORM_BUFFER_OFFSET_ALIGNMENT",value:35380,description:" "},p.ACTIVE_UNIFORM_BLOCKS={name:"ACTIVE_UNIFORM_BLOCKS",value:35382,description:" "},p.UNIFORM_TYPE={name:"UNIFORM_TYPE",value:35383,description:" "},p.UNIFORM_SIZE={name:"UNIFORM_SIZE",value:35384,description:" "},p.UNIFORM_BLOCK_INDEX={name:"UNIFORM_BLOCK_INDEX",value:35386,description:" "},p.UNIFORM_OFFSET={name:"UNIFORM_OFFSET",value:35387,description:" "},p.UNIFORM_ARRAY_STRIDE={name:"UNIFORM_ARRAY_STRIDE",value:35388,description:" "},p.UNIFORM_MATRIX_STRIDE={name:"UNIFORM_MATRIX_STRIDE",value:35389,description:" "},p.UNIFORM_IS_ROW_MAJOR={name:"UNIFORM_IS_ROW_MAJOR",value:35390,description:" "},p.UNIFORM_BLOCK_BINDING={name:"UNIFORM_BLOCK_BINDING",value:35391,description:" "},p.UNIFORM_BLOCK_DATA_SIZE={name:"UNIFORM_BLOCK_DATA_SIZE",value:35392,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORMS={name:"UNIFORM_BLOCK_ACTIVE_UNIFORMS",value:35394,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES={name:"UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",value:35395,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",value:35396,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",value:35398,description:" "},p.OBJECT_TYPE={name:"OBJECT_TYPE",value:37138,description:" "},p.SYNC_CONDITION={name:"SYNC_CONDITION",value:37139,description:" "},p.SYNC_STATUS={name:"SYNC_STATUS",value:37140,description:" "},p.SYNC_FLAGS={name:"SYNC_FLAGS",value:37141,description:" "},p.SYNC_FENCE={name:"SYNC_FENCE",value:37142,description:" "},p.SYNC_GPU_COMMANDS_COMPLETE={name:"SYNC_GPU_COMMANDS_COMPLETE",value:37143,description:" "},p.UNSIGNALED={name:"UNSIGNALED",value:37144,description:" "},p.SIGNALED={name:"SIGNALED",value:37145,description:" "},p.ALREADY_SIGNALED={name:"ALREADY_SIGNALED",value:37146,description:" "},p.TIMEOUT_EXPIRED={name:"TIMEOUT_EXPIRED",value:37147,description:" "},p.CONDITION_SATISFIED={name:"CONDITION_SATISFIED",value:37148,description:" "},p.WAIT_FAILED={name:"WAIT_FAILED",value:37149,description:" "},p.SYNC_FLUSH_COMMANDS_BIT={name:"SYNC_FLUSH_COMMANDS_BIT",value:1,description:" "},p.COLOR={name:"COLOR",value:6144,description:" "},p.DEPTH={name:"DEPTH",value:6145,description:" "},p.STENCIL={name:"STENCIL",value:6146,description:" "},p.MIN={name:"MIN",value:32775,description:" "},p.MAX={name:"MAX",value:32776,description:" "},p.DEPTH_COMPONENT24={name:"DEPTH_COMPONENT24",value:33190,description:" "},p.STREAM_READ={name:"STREAM_READ",value:35041,description:" "},p.STREAM_COPY={name:"STREAM_COPY",value:35042,description:" "},p.STATIC_READ={name:"STATIC_READ",value:35045,description:" "},p.STATIC_COPY={name:"STATIC_COPY",value:35046,description:" "},p.DYNAMIC_READ={name:"DYNAMIC_READ",value:35049,description:" "},p.DYNAMIC_COPY={name:"DYNAMIC_COPY",value:35050,description:" "},p.DEPTH_COMPONENT32F={name:"DEPTH_COMPONENT32F",value:36012,description:" "},p.DEPTH32F_STENCIL8={name:"DEPTH32F_STENCIL8",value:36013,description:" "},p.INVALID_INDEX={name:"INVALID_INDEX",value:4294967295,description:" "},p.TIMEOUT_IGNORED={name:"TIMEOUT_IGNORED",value:-1,description:" "},p.MAX_CLIENT_WAIT_TIMEOUT_WEBGL={name:"MAX_CLIENT_WAIT_TIMEOUT_WEBGL",value:37447,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE={name:"VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",value:35070,description:"Describes the frequency divisor used for instanced rendering.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_VENDOR_WEBGL={name:"UNMASKED_VENDOR_WEBGL",value:37445,description:"Passed to getParameter to get the vendor string of the graphics driver.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_RENDERER_WEBGL={name:"UNMASKED_RENDERER_WEBGL",value:37446,description:"Passed to getParameter to get the renderer string of the graphics driver.",extensionName:"WEBGL_debug_renderer_info"},p.MAX_TEXTURE_MAX_ANISOTROPY_EXT={name:"MAX_TEXTURE_MAX_ANISOTROPY_EXT",value:34047,description:"Returns the maximum available anisotropy.",extensionName:"EXT_texture_filter_anisotropic"},p.TEXTURE_MAX_ANISOTROPY_EXT={name:"TEXTURE_MAX_ANISOTROPY_EXT",value:34046,description:"Passed to texParameter to set the desired maximum anisotropy for a texture.",extensionName:"EXT_texture_filter_anisotropic"},p.COMPRESSED_RGB_S3TC_DXT1_EXT={name:"COMPRESSED_RGB_S3TC_DXT1_EXT",value:33776,description:"A DXT1-compressed image in an RGB image format.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT1_EXT={name:"COMPRESSED_RGBA_S3TC_DXT1_EXT",value:33777,description:"A DXT1-compressed image in an RGB image format with a simple on/off alpha value.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT3_EXT={name:"COMPRESSED_RGBA_S3TC_DXT3_EXT",value:33778,description:"A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT5_EXT={name:"COMPRESSED_RGBA_S3TC_DXT5_EXT",value:33779,description:"A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_R11_EAC={name:"COMPRESSED_R11_EAC",value:37488,description:"One-channel (red) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_R11_EAC={name:"COMPRESSED_SIGNED_R11_EAC",value:37489,description:"One-channel (red) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RG11_EAC={name:"COMPRESSED_RG11_EAC",value:37490,description:"Two-channel (red and green) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_RG11_EAC={name:"COMPRESSED_SIGNED_RG11_EAC",value:37491,description:"Two-channel (red and green) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_ETC2={name:"COMPRESSED_RGB8_ETC2",value:37492,description:"Compresses RBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGBA8_ETC2_EAC={name:"COMPRESSED_RGBA8_ETC2_EAC",value:37493,description:"Compresses RGBA8 data. The RGB part is encoded the same as RGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ETC2={name:"COMPRESSED_SRGB8_ETC2",value:37494,description:"Compresses sRBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC={name:"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",value:37495,description:"Compresses sRGBA8 data. The sRGB part is encoded the same as SRGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37496,description:"Similar to RGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37497,description:"Similar to SRGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_4BPPV1_IMG",value:35840,description:"RGB compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",value:35842,description:"RGBA compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_2BPPV1_IMG",value:35841,description:"RGB compression in 2-bit mode. One block for each 8×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",value:35843,description:"RGBA compression in 2-bit mode. One block for each 8×4 pixe",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_ETC1_WEBGL={name:"COMPRESSED_RGB_ETC1_WEBGL",value:36196,description:"Compresses 24-bit RGB data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc1"},p.COMPRESSED_RGB_ATC_WEBGL={name:"COMPRESSED_RGB_ATC_WEBGL",value:35986,description:"Compresses RGB textures with no alpha channel.",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",value:35986,description:"Compresses RGBA textures using explicit alpha encoding (useful when alpha transitions are sharp).",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",value:34798,description:"Compresses RGBA textures using interpolated alpha encoding (useful when alpha transitions are gradient).",extensionName:"WEBGL_compressed_texture_atc"},p.UNSIGNED_INT_24_8_WEBGL={name:"UNSIGNED_INT_24_8_WEBGL",value:34042,description:"Unsigned integer type for 24-bit depth texture data.",extensionName:"WEBGL_depth_texture"},p.HALF_FLOAT_OES={name:"HALF_FLOAT_OES",value:36193,description:"Half floating-point type (16-bit).",extensionName:"OES_texture_half_float"},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",value:33297,description:" ",extensionName:"WEBGL_color_buffer_float"},p.UNSIGNED_NORMALIZED_EXT={name:"UNSIGNED_NORMALIZED_EXT",value:35863,description:" ",extensionName:"WEBGL_color_buffer_float"},p.MIN_EXT={name:"MIN_EXT",value:32775,description:"Produces the minimum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.MAX_EXT={name:"MAX_EXT",value:32776,description:"Produces the maximum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.SRGB_EXT={name:"SRGB_EXT",value:35904,description:"Unsized sRGB format that leaves the precision up to the driver.",extensionName:"EXT_sRGB"},p.SRGB_ALPHA_EXT={name:"SRGB_ALPHA_EXT",value:35906,description:"Unsized sRGB format with unsized alpha component.",extensionName:"EXT_sRGB"},p.SRGB8_ALPHA8_EXT={name:"SRGB8_ALPHA8_EXT",value:35907,description:"Sized (8-bit) sRGB and alpha formats.",extensionName:"EXT_sRGB"},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",value:33296,description:"Returns the framebuffer color encoding.",extensionName:"EXT_sRGB"},p.FRAGMENT_SHADER_DERIVATIVE_HINT_OES={name:"FRAGMENT_SHADER_DERIVATIVE_HINT_OES",value:35723,description:"Indicates the accuracy of the derivative calculation for the GLSL built-in functions: dFdx, dFdy, and fwidth.",extensionName:"OES_standard_derivatives"},p.COLOR_ATTACHMENT0_WEBGL={name:"COLOR_ATTACHMENT0_WEBGL",value:36064,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT1_WEBGL={name:"COLOR_ATTACHMENT1_WEBGL",value:36065,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT2_WEBGL={name:"COLOR_ATTACHMENT2_WEBGL",value:36066,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT3_WEBGL={name:"COLOR_ATTACHMENT3_WEBGL",value:36067,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT4_WEBGL={name:"COLOR_ATTACHMENT4_WEBGL",value:36068,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT5_WEBGL={name:"COLOR_ATTACHMENT5_WEBGL",value:36069,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT6_WEBGL={name:"COLOR_ATTACHMENT6_WEBGL",value:36070,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT7_WEBGL={name:"COLOR_ATTACHMENT7_WEBGL",value:36071,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT8_WEBGL={name:"COLOR_ATTACHMENT8_WEBGL",value:36072,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT9_WEBGL={name:"COLOR_ATTACHMENT9_WEBGL",value:36073,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT10_WEBGL={name:"COLOR_ATTACHMENT10_WEBGL",value:36074,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT11_WEBGL={name:"COLOR_ATTACHMENT11_WEBGL",value:36075,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT12_WEBGL={name:"COLOR_ATTACHMENT12_WEBGL",value:36076,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT13_WEBGL={name:"COLOR_ATTACHMENT13_WEBGL",value:36077,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT14_WEBGL={name:"COLOR_ATTACHMENT14_WEBGL",value:36078,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT15_WEBGL={name:"COLOR_ATTACHMENT15_WEBGL",value:36079,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER0_WEBGL={name:"DRAW_BUFFER0_WEBGL",value:34853,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER1_WEBGL={name:"DRAW_BUFFER1_WEBGL",value:34854,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER2_WEBGL={name:"DRAW_BUFFER2_WEBGL",value:34855,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER3_WEBGL={name:"DRAW_BUFFER3_WEBGL",value:34856,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER4_WEBGL={name:"DRAW_BUFFER4_WEBGL",value:34857,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER5_WEBGL={name:"DRAW_BUFFER5_WEBGL",value:34858,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER6_WEBGL={name:"DRAW_BUFFER6_WEBGL",value:34859,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER7_WEBGL={name:"DRAW_BUFFER7_WEBGL",value:34860,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER8_WEBGL={name:"DRAW_BUFFER8_WEBGL",value:34861,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER9_WEBGL={name:"DRAW_BUFFER9_WEBGL",value:34862,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER10_WEBGL={name:"DRAW_BUFFER10_WEBGL",value:34863,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER11_WEBGL={name:"DRAW_BUFFER11_WEBGL",value:34864,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER12_WEBGL={name:"DRAW_BUFFER12_WEBGL",value:34865,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER13_WEBGL={name:"DRAW_BUFFER13_WEBGL",value:34866,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER14_WEBGL={name:"DRAW_BUFFER14_WEBGL",value:34867,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER15_WEBGL={name:"DRAW_BUFFER15_WEBGL",value:34868,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.MAX_COLOR_ATTACHMENTS_WEBGL={name:"MAX_COLOR_ATTACHMENTS_WEBGL",value:36063,description:"Maximum number of framebuffer color attachment points",extensionName:"WEBGL_draw_buffers"},p.MAX_DRAW_BUFFERS_WEBGL={name:"MAX_DRAW_BUFFERS_WEBGL",value:34852,description:"Maximum number of draw buffers",extensionName:"WEBGL_draw_buffers"},p.VERTEX_ARRAY_BINDING_OES={name:"VERTEX_ARRAY_BINDING_OES",value:34229,description:"The bound vertex array object (VAO).",extensionName:"VERTEX_ARRAY_BINDING_OES"},p.QUERY_COUNTER_BITS_EXT={name:"QUERY_COUNTER_BITS_EXT",value:34916,description:"The number of bits used to hold the query result for the given target.",extensionName:"EXT_disjoint_timer_query"},p.CURRENT_QUERY_EXT={name:"CURRENT_QUERY_EXT",value:34917,description:"The currently active query.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_EXT={name:"QUERY_RESULT_EXT",value:34918,description:"The query result.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_AVAILABLE_EXT={name:"QUERY_RESULT_AVAILABLE_EXT",value:34919,description:"A Boolean indicating whether or not a query result is available.",extensionName:"EXT_disjoint_timer_query"},p.TIME_ELAPSED_EXT={name:"TIME_ELAPSED_EXT",value:35007,description:"Elapsed time (in nanoseconds).",extensionName:"EXT_disjoint_timer_query"},p.TIMESTAMP_EXT={name:"TIMESTAMP_EXT",value:36392,description:"The current time.",extensionName:"EXT_disjoint_timer_query"},p.GPU_DISJOINT_EXT={name:"GPU_DISJOINT_EXT",value:36795,description:"A Boolean indicating whether or not the GPU performed any disjoint operation.",extensionName:"EXT_disjoint_timer_query"},p.zeroMeaningByCommand={getError:"NO_ERROR",blendFunc:"ZERO",blendFuncSeparate:"ZERO",readBuffer:"NONE",getFramebufferAttachmentParameter:"NONE",texParameterf:"NONE",texParameteri:"NONE",drawArrays:"POINTS",drawElements:"POINTS",drawArraysInstanced:"POINTS",drawArraysInstancedAngle:"POINTS",drawBuffers:"POINTS",drawElementsInstanced:"POINTS",drawRangeElements:"POINTS"},p.oneMeaningByCommand={blendFunc:"ONE",blendFuncSeparate:"ONE",drawArrays:"LINES",drawElements:"LINES",drawArraysInstanced:"LINES",drawArraysInstancedAngle:"LINES",drawBuffers:"LINES",drawElementsInstanced:"LINES",drawRangeElements:"LINES"};const m={},g={};!function(){for(const e in p)if(p.hasOwnProperty(e)){const t=p[e];m[t.name]=t,g[t.value]=t}}();class E extends c{get analyserName(){return E.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={total:0,totalTriangles:0,totalTriangleStrip:0,totalTriangleFan:0,totalLines:0,totalLineStrip:0,totalLineLoop:0,totalPoints:0};for(const t of e.commands)"drawArrays"===t.name&&t.commandArguments.length>=3||"drawArraysInstanced"===t.name&&t.commandArguments.length>=3||"drawArraysInstancedANGLE"===t.name&&t.commandArguments.length>=3?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[2]):"drawElements"===t.name&&t.commandArguments.length>=2||"drawElementsInstanced"===t.name&&t.commandArguments.length>=2||"drawElementsInstancedANGLE"===t.name&&t.commandArguments.length>=2?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[1]):"drawRangeElements"===t.name&&t.commandArguments.length>=4&&this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[3]);t.total=n.total,t.triangles=n.totalTriangles,t.triangleStrip=n.totalTriangleStrip,t.triangleFan=n.totalTriangleFan,t.lines=n.totalLines,t.lineStrip=n.totalLineStrip,t.lineLoop=n.totalLineLoop,t.points=n.totalPoints}appendToPrimitives(e,t,n){t===p.POINTS.value?e.totalPoints+=n:t===p.LINES.value?e.totalLines+=n:t===p.LINE_STRIP.value?e.totalLineStrip+=n:t===p.LINE_LOOP.value?e.totalLineLoop+=n:t===p.TRIANGLES.value?e.totalTriangles+=n:t===p.TRIANGLE_STRIP.value?e.totalTriangleStrip+=n:t===p.TRIANGLE_FAN.value&&(e.totalTriangleFan+=n),e.total+=n}}E.analyserName="Primitives";class v{constructor(e){this.contextInformation=e,this.analysers=[],this.initAnalysers()}appendAnalyses(e){for(const t in this.analysers)this.analysers.hasOwnProperty(t)&&this.analysers[t].appendAnalysis(e)}initAnalysers(){this.analysers.push(new h(this.contextInformation),new f(this.contextInformation),new E(this.contextInformation))}}class C{static getStackTrace(e=0,t=0){const n=[];try{throw new Error("Errorator.")}catch(e){if(e.stack){const t=e.stack.split("\n");for(let e=0,r=t.length;e0;t++)n.shift();for(let e=0;e0;e++)n.pop()}return n}}class D{static getWebGlObjectTag(e){return e[D.SPECTOROBJECTTAGKEY]}static attachWebGlObjectTag(e,t){t.displayText=D.stringifyWebGlObjectTag(t),e[D.SPECTOROBJECTTAGKEY]=t}static stringifyWebGlObjectTag(e){return e?`${e.typeName} - ID: ${e.id}`:"No tag available."}}D.SPECTOROBJECTTAGKEY="__SPECTOR_Object_TAG";class S{get type(){return("undefined"!=typeof globalThis?globalThis:self)[this.typeName]||null}constructor(){this.id=0}tagWebGlObject(e){if(!this.type)return;let t;if(!e)return t;if(t=D.getWebGlObjectTag(e),t)return t;if(e instanceof this.type){const n=this.getNextId();return t={typeName:this.typeName,id:n},D.attachWebGlObjectTag(e,t),t}return t}getNextId(){return this.id++}}class A{constructor(e){this.options=e}createCapture(e,t,n){const r=C.getStackTrace(4,1),i=0===e.name.indexOf("uniform")?this.stringifyUniform(e.arguments):this.stringify(e.arguments,e.result),s={id:t,startTime:e.startTime,commandEndTime:e.endTime,endTime:0,name:e.name,commandArguments:e.arguments,result:e.result,stackTrace:r,status:0,marker:n,text:i};this.transformCapture(s);for(let e=0;e50&&(s.commandArguments[e]="Array Length: "+t.length)}if(s.commandArguments){const e=[];for(let t=0;t0&&(n+=": "+this.stringifyArgs(e).join(", ")),null!=t&&(n+=" -> "+this.stringifyResult(t)),n}stringifyUniform(e){let t=this.spiedCommandName;if(e&&e.length>0){const n=[];n.push(this.stringifyValue(e[0]));for(let t=1;t0&&"number"==typeof s)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");else{const e=this.stringifyValue(s);r.push(e)}}return r}}_.commandName="bufferSubData";class y{static storeOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]||(e[n]=e[t])}static resetOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]&&(e[t]=e[n],delete e[n])}static storePrototypeOriginFunction(e,t){if(!e)return;if(!e.prototype[t])return;const n=this.getOriginFunctionName(t);e.prototype[n]||(e.prototype[n]=e.prototype[t])}static executePrototypeOriginFunction(e,t,n,r){if(!e)return;const i=this.getOriginFunctionName(n);return t.prototype[i]?(e[i]||(e[i]=t.prototype[i]),this.executeFunction(e,i,r)):void 0}static executeOriginFunction(e,t,n){if(!e)return;const r=this.getOriginFunctionName(t);return e[r]?this.executeFunction(e,r,n):void 0}static executeFunction(e,t,n){const r=n;if(void 0===r||0===r.length)return e[t]();switch(r.length){case 1:return e[t](r[0]);case 2:return e[t](r[0],r[1]);case 3:return e[t](r[0],r[1],r[2]);case 4:return e[t](r[0],r[1],r[2],r[3]);case 5:return e[t](r[0],r[1],r[2],r[3],r[4]);case 6:return e[t](r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6]);case 8:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]);case 9:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8]);case 10:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9]);case 11:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10]);case 12:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11]);case 13:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12]);case 14:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13]);case 15:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14]);case 16:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);case 17:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16]);case 18:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17]);case 19:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18]);case 20:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19]);default:return e[t].apply(e,r)}}static getOriginFunctionName(e){return this.originFunctionPrefix+e}}y.originFunctionPrefix="__SPECTOR_Origin_";class b extends A{get spiedCommandName(){return b.commandName}stringifyArgs(e){const t=[];if(e.length>0){const n=e[0],r=this.stringifyValue(n);t.push(r)}if(e.length>1){const n=""+e[1];t.push(n)}return e.length>2&&t.push(e[2]),t}}b.commandName="bindAttribLocation";class T extends A{get spiedCommandName(){return T.commandName}stringifyArgs(e){const t=[],n=this.options.context.getParameter(p.READ_FRAMEBUFFER_BINDING.value),r=this.options.tagWebGlObject(n);t.push("READ FROM: "+this.stringifyValue(r));const i=this.options.context.getParameter(p.DRAW_FRAMEBUFFER_BINDING.value),s=this.options.tagWebGlObject(i);t.push("WRITE TO: "+this.stringifyValue(s));for(let n=0;n<8;n++)t.push(e[n]);return(e[8]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[8]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[8]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t.push(p.stringifyWebGlConstant(e[9],"blitFrameBuffer")),t}}T.commandName="blitFrameBuffer";class R extends A{get spiedCommandName(){return R.commandName}stringifyArgs(e){const t=[];return(e[0]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[0]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[0]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t}}R.commandName="clear";class x{static getProgramData(e,t){const n={LINK_STATUS:e.getProgramParameter(t,p.LINK_STATUS.value),VALIDATE_STATUS:e.getProgramParameter(t,p.VALIDATE_STATUS.value),infoLog:e.getProgramInfoLog(t)||""},r=e.getAttachedShaders(t)||[],i=new Array(2);let s=0;for(const t of r){const n=this.getShaderData(e,t);s+=n.source.length,n.shaderType===p.FRAGMENT_SHADER.name?i[1]=n:i[0]=n}return{programStatus:n,shaders:i,length:s}}static getShaderData(e,t){const n=e.getShaderSource(t)||"",r=e.getExtension("WEBGL_debug_shaders"),i=r?r.getTranslatedShaderSource(t):null,s=e.getShaderParameter(t,p.SHADER_TYPE.value)===p.FRAGMENT_SHADER.value;let o=t&&t.__SPECTOR_Metadata&&t.__SPECTOR_Metadata.name?t.__SPECTOR_Metadata.name:this.readNameFromShaderSource(n);return o||(o=s?"Fragment":"Vertex"),{COMPILE_STATUS:e.getShaderParameter(t,p.COMPILE_STATUS.value),shaderType:s?p.FRAGMENT_SHADER.name:p.VERTEX_SHADER.name,name:o,source:n,translatedSource:i,infoLog:e.getShaderInfoLog(t)||""}}static readNameFromShaderSource(e){try{let t,n="";const r=/#define[\s]+SHADER_NAME[\s]+([\S]+)(\n|$)/gi;if(t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),""===n){const r=/#define[\s]+SHADER_NAME_B64[\s]+([\S]+)(\n|$)/gi;t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),n&&(n=decodeURIComponent(atob(n)))}return n}catch(e){return null}}}class w extends A{constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.shader=x.getShaderData(this.options.context,t)}finally{n&&n(!0)}}getShaderDisplayText(e){return this.stringifyValue(e.commandArguments[0])}}class F extends w{get spiedCommandName(){return F.commandName}transformCapture(e){if(super.transformCapture(e),e.shader){const t=e.shader.COMPILE_STATUS?"compiled":"failed";e.text=`${this.spiedCommandName}: ${this.getShaderDisplayText(e)} -> ${t}`}}}F.commandName="compileShader";const N=["lineWidth"];class L extends A{get spiedCommandName(){return this.internalSpiedCommandName}constructor(e,t){super(e),this.internalSpiedCommandName=t,this.isDeprecated=N.indexOf(this.spiedCommandName)>-1}transformCapture(e){this.isDeprecated&&(e.status=50)}}class O extends A{get spiedCommandName(){return O.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}O.commandName="disableVertexAttribArray";class I extends A{get spiedCommandName(){return I.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(e[1]+" indices"),t.push(e[2]),t}}I.commandName="drawArrays";class k extends A{get spiedCommandName(){return k.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}k.commandName="drawArraysInstanced";class M extends A{get spiedCommandName(){return M.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstancedANGLE")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}M.commandName="drawArraysInstancedANGLE";class P extends A{get spiedCommandName(){return P.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElements")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElements")),t.push(e[3]),t}}P.commandName="drawElements";class B extends A{get spiedCommandName(){return B.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstancedANGLE")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstancedANGLE")),t.push(e[3]),t.push(e[4]),t}}B.commandName="drawElementsInstancedANGLE";class U extends A{get spiedCommandName(){return U.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t}}U.commandName="drawElementsInstanced";class $ extends A{get spiedCommandName(){return $.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawRangeElements")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(p.stringifyWebGlConstant(e[4],"drawRangeElements")),t.push(e[5]),t}}$.commandName="drawRangeElements";class G extends A{get spiedCommandName(){return G.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}G.commandName="getActiveAttrib";class V extends A{get spiedCommandName(){return V.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}V.commandName="getActiveUniform";class W extends A{get spiedCommandName(){return W.commandName}stringifyResult(e){var t;if(null!=e)return null!==(t=null==e?void 0:e.toFixed(0))&&void 0!==t?t:"0"}}W.commandName="getAttribLocation";class H extends A{get spiedCommandName(){return H.commandName}stringifyResult(e){return e?"true":"false"}}H.commandName="getExtension";class j extends A{get spiedCommandName(){return j.commandName}stringifyResult(e){if(!e)return"null";const t=D.getWebGlObjectTag(e);return t?t.displayText:e}}j.commandName="getParameter";class z extends A{get spiedCommandName(){return z.commandName}stringifyResult(e){if(e)return`min: ${e.rangeMin}, max: ${e.rangeMax}, precision: ${e.precision}`}}z.commandName="getShaderPrecisionFormat";class X extends w{get spiedCommandName(){return X.commandName}stringifyResult(e){if("string"!=typeof e||0===e.trim().length)return"No messages";const t=e.split(/\r?\n/).filter(e=>e.trim().length>0).length;return t+(1===t?" message":" messages")}}X.commandName="getShaderInfoLog";class K extends A{get spiedCommandName(){return K.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}K.commandName="getTransformFeedbackVarying";class Y extends A{get spiedCommandName(){return Y.commandName}constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.program=x.getProgramData(this.options.context,t)}finally{n&&n(!0)}const r=e.program.programStatus.LINK_STATUS?"linked":"failed";e.text=`${this.spiedCommandName}: ${this.stringifyValue(t)} -> ${r}`}}Y.commandName="linkProgram";class q extends A{get spiedCommandName(){return q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"multiDrawArraysInstancedBaseInstanceWEBGL")),t.push(`drawCount=${e[9]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t}}q.commandName="multiDrawArraysInstancedBaseInstanceWEBGL";class Q extends A{get spiedCommandName(){return Q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[7]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t}}Q.commandName="multiDrawArraysInstancedWEBGL";class Z extends A{get spiedCommandName(){return Z.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[5]}`),t.push(e[2]),t.push(e[4]),t}}Z.commandName="multiDrawArraysWEBGL";class J extends A{get spiedCommandName(){return J.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[11]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t.push(e[10]),t}}J.commandName="multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL";class ee extends A{get spiedCommandName(){return ee.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[8]}`),t.push(e[2]),t.push(e[5]),t.push(e[7]),t}}ee.commandName="multiDrawElementsInstancedWEBGL";class te extends A{get spiedCommandName(){return te.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[6]}`),t.push(e[2]),t.push(e[5]),t}}te.commandName="multiDrawElementsWEBGL";class ne extends A{get spiedCommandName(){return ne.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(`baseInstance = ${e[4]}`),t}}ne.commandName="drawArraysInstancedBaseInstanceWEBGL";class re extends A{get spiedCommandName(){return re.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t.push(`baseVertex = ${e[5]}`),t.push(`baseInstance = ${e[6]}`),t}}re.commandName="drawElementsInstancedBaseVertexBaseInstanceWEBGL";class ie extends A{get spiedCommandName(){return ie.commandName}stringifyArgs(e){var t,n;const r=[];for(let i=0;i<4;i++)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");return r}}function se(e){return null==e?"":`${e.toFixed(0)} (0b${(e>>>0).toString(2)})`}ie.commandName="scissor";class oe extends A{get spiedCommandName(){return oe.commandName}stringifyArgs(e){const t=[];return t.push(se(e[0])),t}}oe.commandName="stencilMask";class ae extends A{get spiedCommandName(){return ae.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilMaskSeparate")),t.push(se(e[1])),t}}ae.commandName="stencilMaskSeparate";class le extends A{get spiedCommandName(){return le.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFunc")),t.push(se(e[1])),t.push(se(e[2])),t}}le.commandName="stencilFunc";class ue extends A{get spiedCommandName(){return ue.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFuncSeparate")),t.push(p.stringifyWebGlConstant(e[1],"stencilFuncSeparate")),t.push(se(e[2])),t.push(se(e[3])),t}}ue.commandName="stencilFuncSeparate";class ce extends A{get spiedCommandName(){return ce.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t.push(e[1]),t.push(p.stringifyWebGlConstant(e[2],"vertexAttribPointer")),t.push(e[3]),t.push(e[4]),t.push(e[5]),t}}ce.commandName="vertexAttribPointer";class he extends A{get spiedCommandName(){return he.commandName}stringifyArgs(e){const t=[];for(let n=0;n<4;n++)t.push(e[n].toFixed(0));return t}}he.commandName="viewport";class de extends A{get spiedCommandName(){return de.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}de.commandName="enableVertexAttribArray";class fe extends w{get spiedCommandName(){return fe.commandName}stringifyArgs(e){const t="string"==typeof e[1]?e[1]:"";return[this.stringifyValue(e[0]),t.length+" chars"]}transformCapture(e){super.transformCapture(e);const t=e.commandArguments[1];e.shader&&"string"==typeof t&&(e.shader.source=t,e.shader.COMPILE_STATUS=null,e.shader.translatedSource="",e.shader.infoLog="")}}fe.commandName="shaderSource";class pe{constructor(e){this.spiedCommandName=e.spiedCommandName,this.spiedCommandRunningContext=e.spiedCommandRunningContext,this.spiedCommand=this.spiedCommandRunningContext[this.spiedCommandName],y.storeOriginFunction(this.spiedCommandRunningContext,this.spiedCommandName),this.callback=e.callback,this.commandOptions={context:e.context,contextVersion:e.contextVersion,extensions:e.extensions,toggleCapture:e.toggleCapture},this.initCustomCommands(),this.initCommand()}spy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.overloadedCommand}unSpy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.spiedCommand}createCapture(e,t,n){return this.command.createCapture(e,t,n)}initCommand(){pe.customCommandsConstructors[this.spiedCommandName]?this.command=pe.customCommandsConstructors[this.spiedCommandName](this.commandOptions):this.command=new L(this.commandOptions,this.spiedCommandName),this.overloadedCommand=this.getSpy()}getSpy(){const e=this;return function(){const t=u.now,n=y.executeOriginFunction(e.spiedCommandRunningContext,e.spiedCommandName,arguments),r=u.now;try{const i={name:e.spiedCommandName,arguments,result:n,startTime:t,endTime:r};e.callback(e,i)}catch(e){}return n}}initCustomCommands(){pe.customCommandsConstructors||(pe.customCommandsConstructors={[b.commandName]:e=>new b(e),[T.commandName]:e=>new T(e),[_.commandName]:e=>new _(e),[R.commandName]:e=>new R(e),[F.commandName]:e=>new F(e),[O.commandName]:e=>new O(e),[I.commandName]:e=>new I(e),[k.commandName]:e=>new k(e),[M.commandName]:e=>new M(e),[P.commandName]:e=>new P(e),[U.commandName]:e=>new U(e),[B.commandName]:e=>new B(e),[$.commandName]:e=>new $(e),[G.commandName]:e=>new G(e),[V.commandName]:e=>new V(e),[W.commandName]:e=>new W(e),[H.commandName]:e=>new H(e),[j.commandName]:e=>new j(e),[X.commandName]:e=>new X(e),[z.commandName]:e=>new z(e),[K.commandName]:e=>new K(e),[Y.commandName]:e=>new Y(e),[q.commandName]:e=>new q(e),[Q.commandName]:e=>new Q(e),[Z.commandName]:e=>new Z(e),[J.commandName]:e=>new J(e),[ee.commandName]:e=>new ee(e),[te.commandName]:e=>new te(e),[ne.commandName]:e=>new ne(e),[re.commandName]:e=>new re(e),[ie.commandName]:e=>new ie(e),[fe.commandName]:e=>new fe(e),[oe.commandName]:e=>new oe(e),[ae.commandName]:e=>new ae(e),[le.commandName]:e=>new le(e),[ue.commandName]:e=>new ue(e),[ce.commandName]:e=>new ce(e),[he.commandName]:e=>new he(e),[de.commandName]:e=>new de(e)})}}class me{constructor(e){this.options=e,this.context=e.context,this.contextVersion=e.contextVersion,this.extensions=e.extensions,this.toggleCapture=e.toggleCapture,this.consumeCommands=this.getConsumeCommands(),this.changeCommandsByState=this.getChangeCommandsByState(),this.commandNameToStates=this.getCommandNameToStates()}get requireStartAndStopStates(){return!0}startCapture(e,t,n){return this.quickCapture=t,this.fullCapture=n,this.capturedCommandsByState={},e&&this.requireStartAndStopStates&&(this.currentState={},this.readFromContextNoSideEffects()),this.copyCurrentStateToPrevious(),this.currentState={},this.previousState}stopCapture(){return this.requireStartAndStopStates&&this.readFromContextNoSideEffects(),this.analyse(void 0),this.currentState}registerCallbacks(e){for(const t in this.changeCommandsByState)if(this.changeCommandsByState.hasOwnProperty(t))for(const n of this.changeCommandsByState[t])e[n]=e[n]||[],e[n].push(this.onChangeCommand.bind(this));for(const t of this.consumeCommands)e[t]=e[t]||[],e[t].push(this.onConsumeCommand.bind(this))}getStateData(){return this.currentState}getConsumeCommands(){return[]}getChangeCommandsByState(){return{}}copyCurrentStateToPrevious(){this.currentState&&(this.previousState=this.currentState)}onChangeCommand(e){const t=this.commandNameToStates[e.name];for(const n of t){if(!this.isValidChangeCommand(e,n))return;this.capturedCommandsByState[n]=this.capturedCommandsByState[n]||[],this.capturedCommandsByState[n].push(e)}}isValidChangeCommand(e,t){return!0}onConsumeCommand(e){this.isValidConsumeCommand(e)&&(this.readFromContextNoSideEffects(),this.analyse(e),this.storeCommandIds(),e[this.stateName]=this.currentState,this.startCapture(!1,this.quickCapture,this.fullCapture))}isValidConsumeCommand(e){return this.lastCommandName=null==e?void 0:e.name,!0}analyse(e){for(const t in this.capturedCommandsByState)if(this.capturedCommandsByState.hasOwnProperty(t)){const n=this.capturedCommandsByState[t],r=n.length-1;if(r>=0)if(e){for(let t=0;t1&&this.parameters.push(this.getWebgl2Parameters());const e={};for(let t=1;t<=this.contextVersion&&!(t>this.parameters.length);t++)if(this.parameters[t-1])for(const n of this.parameters[t-1])if(n.changeCommands)for(const t of n.changeCommands)e[n.constant.name]=e[n.constant.name]||[],e[n.constant.name].push(t);return e}readFromContext(){for(let e=1;e<=this.contextVersion&&!(e>this.parameters.length);e++)for(const t of this.parameters[e-1]){const e=this.readParameterFromContext(t);if(null==e){const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n;continue}const n=D.getWebGlObjectTag(e);if(n)this.currentState[t.constant.name]=n;else{const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n}}}readParameterFromContext(e){return e.constant.extensionName&&!this.extensions[e.constant.extensionName]?`Extension ${e.constant.extensionName} is unavailable.`:this.context.getParameter(e.constant.value)}stringifyParameterValue(e,t){if(null===e)return"null";if(void 0===e)return"undefined";if(30===t.returnType)return se(e);if("number"==typeof e&&p.isWebGlConstant(e)){if(20===t.returnType){const n=t.changeCommands&&t.changeCommands[0]||"";return p.stringifyWebGlConstant(e,n)}return e}if(e.length&&"string"!=typeof e){const t=[];for(let n=0;n1?r=this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value):this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.value)===p.RENDERBUFFER.value&&(r=e.getRenderbufferParameter(e.RENDERBUFFER,e.RENDERBUFFER_STENCIL_SIZE))):r=this.readParameterFromContext({constant:p.STENCIL_BITS}),this.currentState[p.STENCIL_BITS.name]=""+r}isValidChangeCommand(e,t){return"enable"===e.name||"disable"===e.name?e.commandArguments[0]===p.STENCIL_TEST.value:"stencilOp"===e.name||"stencilOpSeparate"===e.name?xe.stencilOpStates.indexOf(e.commandArguments[0])>0:"stencilFunc"===e.name||"stencilFuncSeparate"===e.name?xe.stencilFuncStates.indexOf(e.commandArguments[0])>0:"stencilMask"!==e.name&&"stencilMaskSeparate"!==e.name||xe.stencilMaskStates.indexOf(e.commandArguments[0])>0}getConsumeCommands(){return d}isStateEnable(e,t){return this.context.isEnabled(p.STENCIL_TEST.value)}}xe.stateName="StencilState",xe.stencilOpStates=[p.STENCIL_BACK_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_PASS.value,p.STENCIL_FAIL.value,p.STENCIL_PASS_DEPTH_FAIL.value,p.STENCIL_PASS_DEPTH_PASS.value],xe.stencilFuncStates=[p.STENCIL_BACK_FUNC.value,p.STENCIL_BACK_REF.value,p.STENCIL_BACK_VALUE_MASK.value,p.STENCIL_FUNC.value,p.STENCIL_REF.value,p.STENCIL_VALUE_MASK.value],xe.stencilMaskStates=[p.STENCIL_BACK_WRITEMASK.value,p.STENCIL_WRITEMASK.value];class we{static isSupportedCombination(e,t,n){return e=e||p.UNSIGNED_BYTE.value,((t=t||p.RGBA.value)===p.RGB.value||t===p.RGBA.value)&&(n===p.RGB.value||n===p.RGBA.value||n===p.RGBA8.value||n===p.RGBA16F.value||n===p.RGBA32F.value||n===p.RGB16F.value||n===p.RGB32F.value||n===p.R11F_G11F_B10F.value||n===p.SRGB8.value||n===p.SRGB8_ALPHA8.value)&&this.isSupportedComponentType(e)}static readPixels(e,t,n,r,i,s){e.getError(),s===p.UNSIGNED_NORMALIZED.value&&(s=p.UNSIGNED_BYTE.value);const o=r*i*4;let a;if(s===p.UNSIGNED_BYTE.value?a=new Uint8Array(o):(s=p.FLOAT.value,a=new Float32Array(o)),e.readPixels(t,n,r,i,e.RGBA,s,a),e.getError())return;if(s===p.UNSIGNED_BYTE.value)return a;const l=new Uint8Array(r*i*4);for(let e=0;e1){const e=this.context.getParameter(p.MAX_DRAW_BUFFERS.value);for(let n=0;n1?this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value):p.UNSIGNED_BYTE.value;l===p.RENDERBUFFER.value?this.readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,c,u):l===p.TEXTURE.value&&this.readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,c,u)}readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,l,u){let c=0,h=0;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,c=e.samples,h=e.internalFormat,!c&&!we.isSupportedCombination(l,p.RGBA.value,h))return}else s+=r,o+=i;if(r=i=0,c){const a=e,u=e.createRenderbuffer(),c=e.getParameter(e.RENDERBUFFER_BINDING);e.bindRenderbuffer(e.RENDERBUFFER,u),e.renderbufferStorage(e.RENDERBUFFER,h,s,o),e.bindRenderbuffer(e.RENDERBUFFER,c),e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u);const d=a.getParameter(a.READ_FRAMEBUFFER_BINDING),f=a.getParameter(a.DRAW_FRAMEBUFFER_BINDING);a.bindFramebuffer(a.READ_FRAMEBUFFER,t),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,this.captureFrameBuffer),a.blitFramebuffer(0,0,s,o,0,0,s,o,e.COLOR_BUFFER_BIT,e.NEAREST),a.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),a.bindFramebuffer(a.READ_FRAMEBUFFER,d),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,f),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t),e.deleteRenderbuffer(u)}else e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,l,u){let c=0;this.contextVersion>1&&(c=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value));const h=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL.value),d=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE.value);d>0?g[d].name:p.TEXTURE_2D.name;let f=!1,m=l;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,void 0!==e.type&&(m=e.type),f=e.target===p.TEXTURE_2D_ARRAY.name,!we.isSupportedCombination(e.type,e.format,e.internalFormat))return}else s+=r,o+=i;r=i=0,e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),c>0||f?e.framebufferTextureLayer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,u,h,c):e.framebufferTexture2D(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,d||p.TEXTURE_2D.value,u,h),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,d,c,m),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}getCapture(e,t,n,r,i,s,o,l,u){i=Math.floor(i),s=Math.floor(s);const c={attachmentName:t,src:null,textureCubeMapFace:o?g[o].name:null,textureLayer:l,raw:null};if(!this.quickCapture)try{const t=we.readPixels(e,n,r,i,s,u);if(t){c.raw=Ne.encode(t,i,s),this.workingCanvas.width=i,this.workingCanvas.height=s;const e=this.workingContext2D.createImageData(i,s);if(e.data.set(t),this.workingContext2D.putImageData(e,0,0),this.fullCapture)this.captureCanvas.width=this.workingCanvas.width,this.captureCanvas.height=this.workingCanvas.height;else{const e=i/s;e<1?(this.captureCanvas.width=Le.captureBaseSize*e,this.captureCanvas.height=Le.captureBaseSize):e>1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this.captureContext2D.drawImage(this.workingCanvas,0,0,i,s,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",c.src=Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D)}}catch(e){a.warn("Spector can not capture the visual state: "+e)}this.currentState.Attachments.push(c)}analyse(e){}}Le.stateName="VisualState",Le.captureBaseSize=256;class Oe{constructor(e){this.context=e.context,this.captureFrameBuffer=e.context.createFramebuffer(),this.workingCanvas=Fe.createCanvas(1,1),this.workingContext2D=Fe.get2DContext(this.workingCanvas),this.captureCanvas=Fe.createCanvas(1,1),this.captureContext2D=Fe.get2DContext(this.captureCanvas),Fe.setImageSmoothing(this.captureContext2D,!0)}appendTextureState(e,t,n=null,r){if(!t)return;const i=t.__SPECTOR_Object_CustomData;if(i&&(this.fullCapture=r,i.type&&(e.textureType=this.getWebGlConstant(i.type)),i.format&&(e.format=this.getWebGlConstant(i.format)),i.internalFormat&&(e.internalFormat=this.getWebGlConstant(i.internalFormat)),e.width=i.width,e.height=i.height,i.depth&&(e.depth=i.depth),n)){const r="NEAREST"===e.samplerMagFilter||"NEAREST"===e.magFilter,s=this.getTextureVisualState(n,t,i,r);if(s){e.visual=s.visual;for(const t in s.visualPixels)if(s.visualPixels.hasOwnProperty(t)){e.visualPixels=s.visualPixels;break}}}}getTextureVisualState(e,t,n,r){try{const i=this.context,s={},o={};if(!we.isSupportedCombination(n.type,n.format,n.internalFormat))return{visual:s,visualPixels:o};const a=this.context.getParameter(p.FRAMEBUFFER_BINDING.value);i.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer);try{const a=0,l=n.width,u=n.height;if(e===p.TEXTURE_3D&&n.depth){const e=i;for(let c=0;c2&&c2&&c1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}return this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this._setSmoothing(!o),this.captureContext2D.drawImage(this.workingCanvas,0,0,r,i,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",{src:Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D),raw:l}}catch(e){}return{src:void 0,raw:null}}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}_setSmoothing(e){Fe.setImageSmoothing(this.captureContext2D,e)}}Oe.captureBaseSize=64,Oe.cubeMapFaces=[p.TEXTURE_CUBE_MAP_POSITIVE_X,p.TEXTURE_CUBE_MAP_POSITIVE_Y,p.TEXTURE_CUBE_MAP_POSITIVE_Z,p.TEXTURE_CUBE_MAP_NEGATIVE_X,p.TEXTURE_CUBE_MAP_NEGATIVE_Y,p.TEXTURE_CUBE_MAP_NEGATIVE_Z];class Ie{constructor(e){this.context=e.context}getUboValue(e,t,n,r){const i=Ie.uboTypes[r];if(!i)return;const s=new i.arrayBufferView(n*i.lengthMultiplier),o=this.context,a=o.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,e);if(a){const n=o.getIndexedParameter(p.UNIFORM_BUFFER_START.value,e),r=o.getParameter(p.UNIFORM_BUFFER_BINDING.value);try{o.bindBuffer(p.UNIFORM_BUFFER.value,a),o.getBufferSubData(p.UNIFORM_BUFFER.value,n+t,s)}catch(e){return}r&&o.bindBuffer(p.UNIFORM_BUFFER.value,r)}return Array.prototype.slice.call(s)}}Ie.uboTypes={[p.BOOL.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.BOOL_VEC2.value]:{arrayBufferView:Uint8Array,lengthMultiplier:2},[p.BOOL_VEC3.value]:{arrayBufferView:Uint8Array,lengthMultiplier:3},[p.BOOL_VEC4.value]:{arrayBufferView:Uint8Array,lengthMultiplier:4},[p.INT.value]:{arrayBufferView:Int32Array,lengthMultiplier:1},[p.INT_VEC2.value]:{arrayBufferView:Int32Array,lengthMultiplier:2},[p.INT_VEC3.value]:{arrayBufferView:Int32Array,lengthMultiplier:3},[p.INT_VEC4.value]:{arrayBufferView:Int32Array,lengthMultiplier:4},[p.UNSIGNED_INT.value]:{arrayBufferView:Uint32Array,lengthMultiplier:1},[p.UNSIGNED_INT_VEC2.value]:{arrayBufferView:Uint32Array,lengthMultiplier:2},[p.UNSIGNED_INT_VEC3.value]:{arrayBufferView:Uint32Array,lengthMultiplier:3},[p.UNSIGNED_INT_VEC4.value]:{arrayBufferView:Uint32Array,lengthMultiplier:4},[p.FLOAT.value]:{arrayBufferView:Float32Array,lengthMultiplier:1},[p.FLOAT_VEC2.value]:{arrayBufferView:Float32Array,lengthMultiplier:2},[p.FLOAT_VEC3.value]:{arrayBufferView:Float32Array,lengthMultiplier:3},[p.FLOAT_VEC4.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT2x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT3.value]:{arrayBufferView:Float32Array,lengthMultiplier:9},[p.FLOAT_MAT3x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT3x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.FLOAT_MAT4.value]:{arrayBufferView:Float32Array,lengthMultiplier:16},[p.FLOAT_MAT4x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT4x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.SAMPLER_2D.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.SAMPLER_CUBE.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1}};class ke extends S{get typeName(){return"WebGLBuffer"}}class Me extends S{get typeName(){return"WebGLFramebuffer"}}class Pe extends S{get typeName(){return"WebGLProgram"}static saveInGlobalStore(e){const t=D.getWebGlObjectTag(e);t&&(this.store[t.id]=e)}static getFromGlobalStore(e){return this.store[e]}static updateInGlobalStore(e,t){if(!t)return;const n=this.getFromGlobalStore(e);if(!n)return;const r=D.getWebGlObjectTag(n);r&&(D.attachWebGlObjectTag(t,r),this.store[r.id]=t)}}Pe.store={};class Be extends S{get typeName(){return"WebGLQuery"}}class Ue extends S{get typeName(){return"WebGLRenderbuffer"}}class $e extends S{get typeName(){return"WebGLSampler"}}class Ge extends S{get typeName(){return"WebGLShader"}}class Ve extends S{get typeName(){return"WebGLSync"}}class We extends S{get typeName(){return"WebGLTexture"}}class He extends S{get typeName(){return"WebGLTransformFeedback"}}class je extends S{get typeName(){return"WebGLUniformLocation"}}class ze extends S{get typeName(){return"WebGLVertexArrayObject"}}class Xe extends me{get stateName(){return Xe.stateName}get requireStartAndStopStates(){return!1}constructor(e){super(e),this.drawCallTextureInputState=new Oe(e),this.drawCallUboInputState=new Ie(e)}getConsumeCommands(){return d}getChangeCommandsByState(){return{}}readFromContext(){var e,t;const n=this.context.getParameter(p.CURRENT_PROGRAM.value);if(!n)return;this.currentState.frameBuffer=this.readFrameBufferFromContext();const r=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData:x.getProgramData(this.context,n);if(this.currentState.programStatus=Object.assign({},r.programStatus),this.currentState.programStatus.program=this.getSpectorData(n),this.currentState.programStatus.RECOMPILABLE=o.isBuildableProgram(n),this.currentState.programStatus.RECOMPILABLE&&Pe.saveInGlobalStore(n),this.currentState.shaders=r.shaders,(null===(e=this.lastCommandName)||void 0===e?void 0:e.indexOf("Elements"))>=0){const e=this.context.getParameter(this.context.ELEMENT_ARRAY_BUFFER_BINDING);e&&(this.currentState.elementArray={},this.currentState.elementArray.arrayBuffer=this.getSpectorData(e))}const i=this.context.getProgramParameter(n,p.ACTIVE_ATTRIBUTES.value);this.currentState.attributes=[];for(let e=0;e1){const e=this.context.getProgramParameter(n,p.ACTIVE_UNIFORM_BLOCKS.value);this.currentState.uniformBlocks=[];for(let t=0;t1){const e=this.context;t.colorAttachments=[];const n=e.getParameter(p.MAX_DRAW_BUFFERS.value);for(let e=0;e1&&(r.alphaSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE.value),r.blueSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE.value),r.encoding=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.value)),r.componentType=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value)),r.depthSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE.value),r.greenSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE.value),r.redSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_RED_SIZE.value),r.stencilSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value),n===p.TEXTURE.value&&(r.textureLayer=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value))),r}readAttributeFromContext(e,t){const n=this.context.getActiveAttrib(e,t),r=this.context.getAttribLocation(e,n.name);if(-1===r)return{name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:-1};const i=this.context.getVertexAttrib(r,p.CURRENT_VERTEX_ATTRIB.value),s=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING.value),o={name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:r,offsetPointer:this.context.getVertexAttribOffset(r,p.VERTEX_ATTRIB_ARRAY_POINTER.value),bufferBinding:this.getSpectorData(s),enabled:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_ENABLED.value),arraySize:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_SIZE.value),stride:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_STRIDE.value),arrayType:this.getWebGlConstant(this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_TYPE.value)),normalized:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_NORMALIZED.value),vertexAttrib:Array.prototype.slice.call(i)};return this.extensions[p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.extensionName]?o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.value):this.contextVersion>1&&(o.integer=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_INTEGER.value),o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR.value)),this.appendBufferCustomData(o,s),o}readUniformFromContext(e,t){const n=this.context.getActiveUniform(e,t),r=this.context.getUniformLocation(e,n.name);if(r){if(n.size>1&&n.name&&n.name.indexOf("[0]")===n.name.length-3){const t=[];for(let r=0;r1){r.baseLevel=this.context.getTexParameter(t.value,p.TEXTURE_BASE_LEVEL.value),r.immutable=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_FORMAT.value),r.immutableLevels=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_LEVELS.value),r.maxLevel=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LEVEL.value);const e=this.context.getParameter(p.SAMPLER_BINDING.value);if(e){r.sampler=this.getSpectorData(e);const t=this.context;r.samplerMaxLod=t.getSamplerParameter(e,p.TEXTURE_MAX_LOD.value),r.samplerMinLod=t.getSamplerParameter(e,p.TEXTURE_MIN_LOD.value),r.samplerCompareFunc=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_FUNC.value)),r.samplerCompareMode=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_MODE.value)),r.samplerWrapS=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_S.value)),r.samplerWrapT=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_T.value)),r.samplerWrapR=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_R.value)),r.samplerMagFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MAG_FILTER.value)),r.samplerMinFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MIN_FILTER.value))}else r.maxLod=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LOD.value),r.minLod=this.context.getTexParameter(t.value,p.TEXTURE_MIN_LOD.value),r.compareFunc=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_FUNC.value)),r.compareMode=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_MODE.value)),r.wrapR=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_WRAP_R.value))}const i=this.getTextureStorage(t);if(i){const e=this.quickCapture?null:t;this.drawCallTextureInputState.appendTextureState(r,i,e,this.fullCapture)}return this.context.activeTexture(n),r}getTextureStorage(e){return e===p.TEXTURE_2D?this.context.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP?this.context.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):e===p.TEXTURE_3D?this.context.getParameter(p.TEXTURE_BINDING_3D.value):e===p.TEXTURE_2D_ARRAY?this.context.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):void 0}readUniformsFromContextIntoState(e,t,n,r){const i=this.context,s=i.getActiveUniforms(e,t,p.UNIFORM_TYPE.value),o=i.getActiveUniforms(e,t,p.UNIFORM_SIZE.value),a=i.getActiveUniforms(e,t,p.UNIFORM_BLOCK_INDEX.value),l=i.getActiveUniforms(e,t,p.UNIFORM_OFFSET.value),u=i.getActiveUniforms(e,t,p.UNIFORM_ARRAY_STRIDE.value),c=i.getActiveUniforms(e,t,p.UNIFORM_MATRIX_STRIDE.value),h=i.getActiveUniforms(e,t,p.UNIFORM_IS_ROW_MAJOR.value);for(let d=0;d-1&&(t.blockName=i.getActiveUniformBlockName(e,t.blockIndice)),t.offset=l[d],t.arrayStride=u[d],t.matrixStride=c[d],t.rowMajor=h[d],t.blockIndice>-1){const e=r[a[d]].bindingPoint;t.value=this.drawCallUboInputState.getUboValue(e,t.offset,t.size,s[d])}}}readTransformFeedbackFromContext(e,t){const n=this.context,r=n.getTransformFeedbackVarying(e,t),i=n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value,t),s={name:r.name,size:r.size,type:this.getWebGlConstant(r.type),buffer:this.getSpectorData(i),bufferSize:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_SIZE.value,t),bufferStart:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_START.value,t)};return this.appendBufferCustomData(s,i),s}readUniformBlockFromContext(e,t){const n=this.context,r=n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_BINDING.value),i=n.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,r),s={name:n.getActiveUniformBlockName(e,t),bindingPoint:r,size:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_DATA_SIZE.value),activeUniformCount:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_ACTIVE_UNIFORMS.value),vertex:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER.value),fragment:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER.value),buffer:this.getSpectorData(i)};return this.appendBufferCustomData(s,i),s}appendBufferCustomData(e,t){if(t){const n=t.__SPECTOR_Object_CustomData;n&&(n.usage&&(e.bufferUsage=this.getWebGlConstant(n.usage)),e.bufferLength=n.length,n.offset&&(e.bufferOffset=n.offset),n.sourceLength&&(e.bufferSourceLength=n.sourceLength))}}getWebGlConstant(e){const t=g[e];return t?t.name:e}}Xe.stateName="DrawCall",Xe.samplerTypes={[p.SAMPLER_2D.value]:p.TEXTURE_2D,[p.SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.SAMPLER_3D.value]:p.TEXTURE_3D,[p.SAMPLER_2D_SHADOW.value]:p.TEXTURE_2D,[p.SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_2D_ARRAY_SHADOW.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_CUBE_SHADOW.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.UNSIGNED_INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.UNSIGNED_INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.UNSIGNED_INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.UNSIGNED_INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY};class Ke{constructor(e){this.contextInformation=e,this.stateTrackers=[],this.onCommandCapturedCallbacks={},this.initStateTrackers()}startCapture(e,t,n){for(const r of this.stateTrackers){const i=r.startCapture(!0,t,n);r.requireStartAndStopStates&&(e.initState[r.stateName]=i)}}stopCapture(e){for(const t of this.stateTrackers){const n=t.stopCapture();t.requireStartAndStopStates&&(e.endState[t.stateName]=n)}}captureState(e){const t=this.onCommandCapturedCallbacks[e.name];if(t)for(const n of t)n(e)}initStateTrackers(){this.stateTrackers.push(new Ee(this.contextInformation),new ve(this.contextInformation),new Ce(this.contextInformation),new De(this.contextInformation),new Se(this.contextInformation),new Ae(this.contextInformation),new _e(this.contextInformation),new ye(this.contextInformation),new be(this.contextInformation),new Te(this.contextInformation),new Re(this.contextInformation),new xe(this.contextInformation),new Le(this.contextInformation),new Xe(this.contextInformation));for(const e of this.stateTrackers)e.registerCallbacks(this.onCommandCapturedCallbacks)}}class Ye{static initializeByteSizeFormat(){this.byteSizePerInternalFormat||(this.byteSizePerInternalFormat={[p.R8.value]:1,[p.R16F.value]:2,[p.R32F.value]:4,[p.R8UI.value]:1,[p.RG8.value]:2,[p.RG16F.value]:4,[p.RG32F.value]:8,[p.ALPHA.value]:1,[p.RGB.value]:3,[p.RGBA.value]:4,[p.LUMINANCE.value]:1,[p.LUMINANCE_ALPHA.value]:2,[p.DEPTH_COMPONENT.value]:1,[p.DEPTH_STENCIL.value]:2,[p.SRGB_EXT.value]:3,[p.SRGB_ALPHA_EXT.value]:4,[p.RGB8.value]:3,[p.SRGB8.value]:3,[p.RGB565.value]:2,[p.R11F_G11F_B10F.value]:4,[p.RGB9_E5.value]:2,[p.RGB16F.value]:6,[p.RGB32F.value]:12,[p.RGB8UI.value]:3,[p.RGBA8.value]:4,[p.RGB5_A1.value]:2,[p.RGBA16F.value]:8,[p.RGBA32F.value]:16,[p.RGBA8UI.value]:4,[p.COMPRESSED_R11_EAC.value]:4,[p.COMPRESSED_SIGNED_R11_EAC.value]:4,[p.COMPRESSED_RG11_EAC.value]:4,[p.COMPRESSED_SIGNED_RG11_EAC.value]:4,[p.COMPRESSED_RGB8_ETC2.value]:4,[p.COMPRESSED_RGBA8_ETC2_EAC.value]:4,[p.COMPRESSED_SRGB8_ETC2.value]:4,[p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC.value]:4,[p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_RGB_S3TC_DXT1_EXT.value]:.5,[p.COMPRESSED_RGBA_S3TC_DXT3_EXT.value]:1,[p.COMPRESSED_RGBA_S3TC_DXT5_EXT.value]:1,[p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGB_ETC1_WEBGL.value]:.5,[p.COMPRESSED_RGB_ATC_WEBGL.value]:.5,[p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL.value]:1,[p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL.value]:1})}constructor(e){this.options=e,this.createCommandNames=this.getCreateCommandNames(),this.updateCommandNames=this.getUpdateCommandNames(),this.deleteCommandNames=this.getDeleteCommandNames(),this.startTime=u.now,this.memoryPerSecond={},this.totalMemory=0,this.frameMemory=0,this.capturing=!1,Ye.initializeByteSizeFormat()}registerCallbacks(e){for(const t of this.createCommandNames)e[t]=e[t]||[],e[t].push(this.createWithoutSideEffects.bind(this));for(const t of this.updateCommandNames)e[t]=e[t]||[],e[t].push(this.updateWithoutSideEffects.bind(this));for(const t of this.deleteCommandNames)e[t]=e[t]||[],e[t].push(this.deleteWithoutSideEffects.bind(this))}startCapture(){this.frameMemory=0,this.capturing=!0}stopCapture(){this.frameMemory=0,this.capturing=!1}appendRecordedInformation(e){e.frameMemory[this.objectName]=this.frameMemory,e.memory[this.objectName]=this.memoryPerSecond}create(e){}createWithoutSideEffects(e){this.options.toggleCapture(!1);try{this.create(e)}finally{this.options.toggleCapture(!0)}}updateWithoutSideEffects(e){if(e&&0!==e.arguments.length){this.options.toggleCapture(!1);try{const t=e.arguments[0],n=this.getBoundInstance(t);if(!n)return;if(!D.getWebGlObjectTag(n))return;const r=this.getWebGlConstant(t),i=this.update(e,r,n);this.changeMemorySize(i)}finally{this.options.toggleCapture(!0)}}}deleteWithoutSideEffects(e){if(!e||!e.arguments||e.arguments.length<1)return;const t=e.arguments[0];if(t){this.options.toggleCapture(!1);try{const e=this.delete(t);this.changeMemorySize(-e)}finally{this.options.toggleCapture(!0)}}}changeMemorySize(e){this.totalMemory+=e,this.capturing&&(this.frameMemory+=e);const t=u.now-this.startTime,n=Math.round(t/1e3);this.memoryPerSecond[n]=this.totalMemory}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}getByteSizeForInternalFormat(e){return Ye.byteSizePerInternalFormat[e]||4}readPixelStoreState(){const e=this.options.context,t={UNPACK_FLIP_Y_WEBGL:e.getParameter(p.UNPACK_FLIP_Y_WEBGL.value),UNPACK_PREMULTIPLY_ALPHA_WEBGL:e.getParameter(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL.value),UNPACK_COLORSPACE_CONVERSION_WEBGL:e.getParameter(p.UNPACK_COLORSPACE_CONVERSION_WEBGL.value),UNPACK_ALIGNMENT:e.getParameter(p.UNPACK_ALIGNMENT.value)};return e instanceof WebGL2RenderingContext&&(t.UNPACK_ROW_LENGTH=e.getParameter(p.UNPACK_ROW_LENGTH.value),t.UNPACK_IMAGE_HEIGHT=e.getParameter(p.UNPACK_IMAGE_HEIGHT.value),t.UNPACK_SKIP_PIXELS=e.getParameter(p.UNPACK_SKIP_PIXELS.value),t.UNPACK_SKIP_ROWS=e.getParameter(p.UNPACK_SKIP_ROWS.value),t.UNPACK_SKIP_IMAGES=e.getParameter(p.UNPACK_SKIP_IMAGES.value)),t}}class qe extends Ye{get objectName(){return"Buffer"}getCreateCommandNames(){return["createBuffer"]}getUpdateCommandNames(){return["bufferData"]}getDeleteCommandNames(){return["deleteBuffer"]}getBoundInstance(e){const t=this.options.context;return e===p.ARRAY_BUFFER.value?t.getParameter(p.ARRAY_BUFFER_BINDING.value):e===p.ELEMENT_ARRAY_BUFFER.value?t.getParameter(p.ELEMENT_ARRAY_BUFFER_BINDING.value):e===p.COPY_READ_BUFFER.value?t.getParameter(p.COPY_READ_BUFFER_BINDING.value):e===p.COPY_WRITE_BUFFER.value?t.getParameter(p.COPY_WRITE_BUFFER_BINDING.value):e===p.TRANSFORM_FEEDBACK_BUFFER.value?t.getParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value):e===p.UNIFORM_BUFFER.value?t.getParameter(p.UNIFORM_BUFFER_BINDING.value):e===p.PIXEL_PACK_BUFFER.value?t.getParameter(p.PIXEL_PACK_BUFFER_BINDING.value):e===p.PIXEL_UNPACK_BUFFER.value?t.getParameter(p.PIXEL_UNPACK_BUFFER_BINDING.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(t,e);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){const n=this.getLength(t);return t.arguments.length>=4?{target:e,length:n,usage:t.arguments[2],offset:t.arguments[3],sourceLength:t.arguments[1]?t.arguments[1].length:-1}:3===t.arguments.length?{target:e,length:n,usage:t.arguments[2]}:void 0}getLength(e){const t=e.arguments[1],n=e.arguments[3],r=e.arguments[4];if("number"==typeof t)return t;if("number"==typeof r&&r>0)return r;const i=t.byteLength||t.length||0;return"number"==typeof n&&n>0?i-n:i}}class Qe extends Ye{get objectName(){return"Renderbuffer"}getCreateCommandNames(){return["createRenderbuffer"]}getUpdateCommandNames(){return["renderbufferStorage","renderbufferStorageMultisample"]}getDeleteCommandNames(){return["deleteRenderbuffer"]}getBoundInstance(e){const t=this.options.context;if(e===p.RENDERBUFFER.value)return t.getParameter(p.RENDERBUFFER_BINDING.value)}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(e,t);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return r.length=r.width*r.height*this.getByteSizeForInternalFormat(r.internalFormat),n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){return 4===e.arguments.length?{target:t,internalFormat:e.arguments[1],width:e.arguments[2],height:e.arguments[3],length:0,samples:0}:{target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,samples:e.arguments[1]}}}class Ze extends Ye{get objectName(){return"Texture2d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage2D","compressedTexImage2D","texStorage2D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D.value?t.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP_POSITIVE_X.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Y.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Z.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_X.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Y.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Z.value?t.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target===p.TEXTURE_2D_ARRAY.name||t.target===p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else{const e="TEXTURE_2D"===t?1:6;let n=r.internalFormat;n===p.RGBA.value&&(r.type===p.FLOAT.value&&(n=p.RGBA32F.value),r.type===p.HALF_FLOAT_OES.value&&(n=p.RGBA16F.value)),r.length=r.width*r.height*e*this.getByteSizeForInternalFormat(n)}return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage2D"===e.name?this.getTexImage2DCustomData(e,t,n):"compressedTexImage2D"===e.name?this.getCompressedTexImage2DCustomData(e,t,n):"texStorage2D"===e.name?this.getTexStorage2DCustomData(e,t,n):void 0}getTexStorage2DCustomData(e,t,n){let r;return 5===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!1}),r}getCompressedTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=7&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!0}),r}getTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8?r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],format:e.arguments[6],type:e.arguments[7],length:0,isCompressed:!1}:6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[5].width,height:e.arguments[5].height,format:e.arguments[3],type:e.arguments[4],length:0,isCompressed:!1}),r}}class Je extends Ye{get objectName(){return"Texture3d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage3D","compressedTexImage3D","texStorage3D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D_ARRAY.value?t.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):e===p.TEXTURE_3D.value?t.getParameter(p.TEXTURE_BINDING_3D.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target!==p.TEXTURE_2D_ARRAY.name&&t.target!==p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){if(e.arguments.length>=2&&0!==e.arguments[1])return 0;const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else r.length=r.width*r.height*r.depth*this.getByteSizeForInternalFormat(r.internalFormat);return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage3D"===e.name?this.getTexImage3DCustomData(e,t,n):"compressedTexImage3D"===e.name?this.getCompressedTexImage3DCustomData(e,t,n):"texStorage3D"===e.name?this.getTexStorage3DCustomData(e,t,n):void 0}getTexStorage3DCustomData(e,t,n){let r;return 6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!1}),r}getCompressedTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!0}),r}getTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=9&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],format:e.arguments[7],type:e.arguments[8],length:0,isCompressed:!1}),r}}class et extends Ye{get objectName(){return"Program"}getCreateCommandNames(){return["createProgram"]}getUpdateCommandNames(){return["linkProgram"]}getDeleteCommandNames(){return["deleteProgram"]}getBoundInstance(e){return e}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){if(e.arguments.length>=1&&!e.arguments[0])return 0;const r=this.getCustomData(n);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e){const t=this.options.context;return x.getProgramData(t,e)}}class tt{constructor(e){this.contextInformation=e,this.onCommandCallbacks={},this.recorders=[],this.initRecorders()}recordCommand(e){const t=this.onCommandCallbacks[e.name];if(t)for(const n of t)n(e)}startCapture(){for(const e of this.recorders)e.startCapture()}stopCapture(){for(const e of this.recorders)e.stopCapture()}appendRecordedInformation(e){for(const t of this.recorders)t.appendRecordedInformation(e)}initRecorders(){this.recorders.push(new qe(this.contextInformation),new Qe(this.contextInformation),new Ze(this.contextInformation),new Je(this.contextInformation),new et(this.contextInformation));for(const e of this.recorders)e.registerCallbacks(this.onCommandCallbacks)}}class nt{constructor(e){this.contextInformation=e,this.webGlObjects=[],this.initWebglObjects()}tagWebGlObjects(e){for(const t of this.webGlObjects){for(let n=0;n0&&this.currentCapture.commands.length===this.maxCommands&&this.onMaxCommand.trigger(this)}}}spyContext(e){const t=[];for(const n in e)n&&t.push(n);for(let n=0;n{this.spyRequestAnimationFrame("requestAnimationFrame",e.display)})}spyRequestAnimationFrame(e,t){const n=this;y.storeOriginFunction(t,e),t[e]=function(){const r=arguments[0],i=n.getCallback(n,r,()=>{n.spiedScope[e](r)});return y.executeOriginFunction(t,e,[i])}}spySetTimer(e){const t=this,n=this.spiedScope,r="setTimeout"===e;y.storeOriginFunction(n,e),n[e]=function(){const i=arguments[0],s=arguments[1],o=Array.prototype.slice.call(arguments);return at.setTimerCommonValues.indexOf(s)>-1&&(o[0]=t.getCallback(t,i,r?()=>{n[e](i)}:null)),y.executeOriginFunction(n,e,o)}}getCallback(e,t,n=null){return function(){const r=u.now;if(e.lastFrame=++e.lastFrame%e.speedRatio,e.willPlayNextFrame||e.speedRatio&&!e.lastFrame){try{e.onFrameStart.trigger(e)}catch(t){e.onError.trigger(t)}try{t.apply(e.spiedScope,arguments)}catch(t){e.onError.trigger(t)}e.lastSixtyFramesCurrentIndex=(e.lastSixtyFramesCurrentIndex+1)%at.fpsWindowSize,e.lastSixtyFramesDuration[e.lastSixtyFramesCurrentIndex]=r-e.lastSixtyFramesPreviousStart;try{e.onFrameEnd.trigger(e)}catch(t){e.onError.trigger(t)}e.willPlayNextFrame=!1}else n&&n();e.lastSixtyFramesPreviousStart=r}}}at.requestAnimationFrameFunctions=["requestAnimationFrame","msRequestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame"],at.setTimerFunctions=["setTimeout","setInterval"],at.setTimerCommonValues=[0,15,16,33,32,40],at.fpsWindowSize=60;class lt{constructor(e){this.canvas=e,this.onContextRequested=new l,this.init()}init(){const e=this,t=function(){const t="undefined"!=typeof HTMLCanvasElement&&this instanceof HTMLCanvasElement?HTMLCanvasElement:OffscreenCanvas,n=e.canvas?y.executeOriginFunction(this,"getContext",arguments):y.executePrototypeOriginFunction(this,t,"getContext",arguments);if(arguments.length>0){const e=arguments[0];if("webgl"!==e&&"experimental-webgl"!==e&&"webgl2"!==e&&"experimental-webgl2"!==e)return n}if(n){const t=Array.prototype.slice.call(arguments),r="webgl2"===t[0]||"experimental-webgl2"===t[0]?2:1;e.onContextRequested.trigger({context:n,contextVersion:r})}return n};this.canvas?(y.storeOriginFunction(this.canvas,"getContext"),this.canvas.getContext=t):("undefined"!=typeof HTMLCanvasElement&&(y.storePrototypeOriginFunction(HTMLCanvasElement,"getContext"),HTMLCanvasElement.prototype.getContext=t),"undefined"!=typeof OffscreenCanvas&&(y.storePrototypeOriginFunction(OffscreenCanvas,"getContext"),OffscreenCanvas.prototype.getContext=t))}}class ut{static startIntercepting(e){if(ut.intercepting||"undefined"==typeof Worker)return;const t=Worker,n=new Proxy(t,{construct(t,r,i){if(ut.workerProxy!==n)return Reflect.construct(t,r,i);const s=r[0],o="string"==typeof s?s:"Worker",a=e=>(ut.spiedWorkers.push({worker:e,originalUrl:o}),e),l=()=>a(Reflect.construct(t,r,i));if(i!==n||"string"!=typeof s||r.length>2||void 0!==r[1])return l();let u;try{const t="undefined"==typeof document?location.href:document.baseURI,n=new URL(s,t);if(e&&/^https?:$/.test(n.protocol)&&n.origin===location.origin){const r=new URL(e,t).href;n.hash="";const i=new XMLHttpRequest;if(i.open("GET",n.href,!1),i.send(),ut.isJavaScriptResponse(i,n.href)&&!i.getResponseHeader("Content-Security-Policy")&&!i.getResponseHeader("Content-Security-Policy-Report-Only")&&ut.shouldInjectSource(i.responseText)){const e=new XMLHttpRequest;if(e.open("GET",r,!1),e.send(),ut.isJavaScriptResponse(e,r)){const e="try { importScripts("+JSON.stringify(r)+'); } catch (e) { console.warn("[Spector.js] Worker auto-injection failed:", e); }\n';u=URL.createObjectURL(new Blob([e,i.responseText],{type:"application/javascript"}))}}}}catch(e){console.warn("[Spector.js] Could not inject into Worker ("+o+"):",e)}if(u){let e;try{e=Reflect.construct(t,[u],i)}catch(e){return URL.revokeObjectURL(u),l()}return setTimeout(()=>URL.revokeObjectURL(u),5e3),a(e)}return l()}});globalThis.Worker=n,ut.originalWorkerConstructor=t,ut.workerProxy=n,ut.intercepting=!0}static stopIntercepting(){if(!ut.intercepting)return;const e=ut.workerProxy;if(ut.workerProxy=void 0,ut.intercepting=!1,globalThis.Worker===e)try{globalThis.Worker=ut.originalWorkerConstructor}catch(e){}}static isJavaScriptResponse(e,t){const n=(e.getResponseHeader("Content-Type")||"").split(";")[0].trim();return 200===e.status&&e.responseURL===t&&/^(?:text|application)\/(?:x-)?(?:java|ecma)script$/i.test(n)}static shouldInjectSource(e){return!/\b(?:import|importScripts|Worker|SharedWorker|location|fetch|Request|XMLHttpRequest|WebSocket|EventSource|crossOriginIsolated|SharedArrayBuffer|Atomics|WebAssembly|eval|Function)\b|\\u|["']use strict["']|^(?:\uFEFF)?#!/.test(e)}static getSpiedWorkers(){return ut.spiedWorkers}static isIntercepting(){return ut.intercepting}}ut.spiedWorkers=[],ut.intercepting=!1;class ct{static getDelay(){return ct.delayMs}static setDelay(e){ct.delayMs="number"==typeof e&&e>0?e:0}static shouldForceIncomplete(e,t,n,r){return!(r<=0)&&e===p.COMPLETION_STATUS_KHR.value&&void 0!==t&&n-tthis._state,this.subscribe=e=>(this._listeners.add(e),()=>{this._listeners.delete(e)}),this._state=e}setState(e){this._state=e(this._state),this._emitChange()}setSnapshot(e){this._state=e,this._emitChange()}_emitChange(){for(const e of this._listeners)e()}}function pt(e){return(0,dt.useSyncExternalStore)(e.subscribe,e.getSnapshot)}var mt=n(848);const gt=(0,dt.createContext)(null);function Et(){const e=(0,dt.useContext)(gt);if(!e)throw new Error("CaptureMenuContext not provided — CaptureMenuRoot must be rendered inside CaptureMenuContext.Provider");return e}function vt({canvas:e}){const t=Et();return(0,mt.jsx)("li",{onClick:()=>t.handleCanvasSelected(e),children:(0,mt.jsx)("span",{children:`Id: ${e.id} - Size: ${e.width}*${e.height}`})})}function Ct(){const e=Et(),t=pt(e.store),n=t.selectedCanvas?`${t.selectedCanvas.id} (${t.selectedCanvas.width}*${t.selectedCanvas.height})`:"Choose Canvas...";return(0,mt.jsxs)("div",{className:"canvasListComponent",children:[(0,mt.jsx)("span",{commandName:"onCanvasSelection",onClick:e.handleCanvasListToggle,children:n}),(0,mt.jsx)("ul",{style:{display:t.showCanvasList?"block":"none",visibility:t.showCanvasList?"visible":"hidden"},children:t.canvases.map((e,t)=>(0,mt.jsx)(vt,{canvas:e},e.id||t))})]})}function Dt(){const e=Et(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"captureMenuActionsComponent",children:[(0,mt.jsx)("div",{commandName:"onCaptureRequested",onClick:e.handleCaptureRequested}),t.isPlaying?(0,mt.jsx)("div",{commandName:"onPauseRequested",onClick:e.handlePauseRequested}):(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("div",{commandName:"onPlayRequested",onClick:e.handlePlayRequested}),(0,mt.jsx)("div",{commandName:"onPlayNextFrameRequested",onClick:e.handlePlayNextFrameRequested})]})]})}function St(){const e=pt(Et().store);return(0,mt.jsxs)("span",{className:"fpsCounterComponent",children:[e.fps.toFixed(2)," Fps"]})}function At(){const e=pt(Et().store);return(0,mt.jsxs)("div",{children:[(0,mt.jsxs)("div",{className:"captureMenuComponent "+(e.visible?"active":""),children:[(0,mt.jsx)(Ct,{}),(0,mt.jsx)(Dt,{}),(0,mt.jsx)(St,{})]}),(0,mt.jsx)("div",{className:"captureMenuLogComponent "+(e.logVisible?"active":""),children:(0,mt.jsx)("span",{className:e.logLevel===i.error?"error":"",children:e.logText})})]})}class _t{constructor(e={}){this.options=e,this.handleCanvasListToggle=()=>{this.store.getSnapshot(),this.store.setState(e=>Object.assign(Object.assign({},e),{selectedCanvas:null,showCanvasList:!e.showCanvasList,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!e.showCanvasList&&!this._hideLog})),this.onCanvasSelected.trigger(null),this._isTrackingCanvas&&this.trackPageCanvases()},this.handleCanvasSelected=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{selectedCanvas:e,showCanvasList:!1,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)},this.handleCaptureRequested=()=>{const e=this.getSelectedCanvasInformation();e&&this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.PleaseWaitHelpText,logVisible:!this._hideLog})),setTimeout(()=>{this.onCaptureRequested.trigger(e)},200)},this.handlePauseRequested=()=>{this.onPauseRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!1}))},this.handlePlayRequested=()=>{this.onPlayRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!0}))},this.handlePlayNextFrameRequested=()=>{this.onPlayNextFrameRequested.trigger(this.getSelectedCanvasInformation())},this._rootPlaceHolder=e.rootPlaceHolder||document.body,this._hideLog=!!e.hideLog,this._isTrackingCanvas=!1,this._extraCanvasEntries=[],this.onCanvasSelected=new l,this.onCaptureRequested=new l,this.onPauseRequested=new l,this.onPlayRequested=new l,this.onPlayNextFrameRequested=new l,this.store=new ft({visible:!0,logText:_t.SelectCanvasHelpText,logLevel:i.info,logVisible:!this._hideLog,canvases:[],selectedCanvas:null,showCanvasList:!1,isPlaying:!0,fps:0}),this._container=document.createElement("div"),this._container.className="spector-react-capture-menu",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(gt.Provider,{value:this},(0,dt.createElement)(At)))}getSelectedCanvasInformation(){return this.store.getSnapshot().selectedCanvas}trackPageCanvases(){if(this._isTrackingCanvas=!0,document.body){const e=document.body.querySelectorAll("canvas");this.updateCanvasesList(e)}}updateCanvasesList(e){const t=[];for(let n=0;nObject.assign(Object.assign({},n),{canvases:t,selectedCanvas:e,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}captureComplete(e){e?this.store.setState(t=>Object.assign(Object.assign({},t),{logLevel:i.error,logText:e,logVisible:!this._hideLog})):this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog}))}setFPS(e){this.store.setState(t=>Object.assign(Object.assign({},t),{fps:e}))}_updateCanvasesInternal(e){for(const t of this._extraCanvasEntries)e.push(t);this.store.getSnapshot().showCanvasList?this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e})):1===e.length?(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:e[0],logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e[0])):(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:null,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(null))}}_t.SelectCanvasHelpText="Please, select a canvas in the list above.",_t.ActionsHelpText="Record with the red button, you can also pause or continue playing the current scene.",_t.PleaseWaitHelpText="Capturing, be patient (this can take up to 3 minutes)...";const yt=(0,dt.createContext)(null);function bt(){const e=(0,dt.useContext)(yt);if(!e)throw new Error("ResultViewContext not provided — ResultViewRoot must be rendered inside ResultViewContext.Provider");return e}function Tt(){const e=bt(),t=pt(e.store),n=(0,dt.useRef)(null),r=(0,dt.useCallback)(e=>{e.preventDefault();const t=e.currentTarget.parentElement,n=t.parentElement;if(!n)return;const r=n.querySelectorAll("li:not(.resultViewMenuSmall)");if("true"===t.getAttribute("open")){t.setAttribute("open","false");for(let e=0;e{e.handleSearchTextChange(t.target.value)},[e]),s=(0,dt.useCallback)(t=>{t.stopPropagation(),e.handleSearchTextChange("")},[e]),o=(0,dt.useCallback)(t=>n=>{n.preventDefault(),e.handleMenuStatusChange(t)},[e]),a=(0,dt.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),e.handleClose()},[e]);return(0,mt.jsxs)("ul",{className:"resultViewMenuComponent",ref:n,children:[(0,mt.jsx)("li",{className:"resultViewMenuOpen resultViewMenuSmall",children:(0,mt.jsx)("a",{href:"#",role:"button",onClick:r,children:"Menu"})}),(0,mt.jsxs)("li",{className:"searchContainer",children:[(0,mt.jsx)("input",{type:"text",placeholder:"Search...",value:t.searchText,commandName:"onSearchTextChanged",commandEventBinding:"change",onChange:i}),(0,mt.jsx)("a",{className:"clearSearch",commandName:"onSearchTextCleared",onClick:s,children:"X"})]}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:0===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCapturesClicked",onClick:o(0),children:"Captures"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:10===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInformationClicked",onClick:o(10),children:"Information"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:20===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInitStateClicked",onClick:o(20),children:"Init State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:40===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCommandsClicked",onClick:o(40),children:"Commands"+(t.commandCount>0?" ("+t.commandCount+")":"")})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:60===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCompareClicked",onClick:o(60),children:"Compare"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:30===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onEndStateClicked",onClick:o(30),children:"End State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{role:"button",commandName:"onCloseClicked",onClick:a,children:"Close"})})]})}function Rt({children:e}){return(0,mt.jsx)("div",{className:"resultViewContentComponent",children:e})}function xt({capture:e,active:t,onCaptureSelected:n,onSaveRequested:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),r()},[r]),s=(0,dt.useCallback)(()=>{n()},[n]),o=new Date(e.startTime).toTimeString().split(" ")[0];return(0,mt.jsxs)("li",{className:t?"active":"",onClick:s,children:[e.endState.VisualState.Attachments?e.endState.VisualState.Attachments.map((e,t)=>(0,mt.jsx)("img",{src:encodeURI(e.src)},t)):(0,mt.jsx)("span",{children:e.endState.VisualState.FrameBufferStatus}),(0,mt.jsxs)("span",{children:[o,(0,mt.jsx)("a",{href:"#",className:"captureListItemSave",commandName:"onSaveRequested",onClick:i})]})]})}function wt({active:e,captures:t,onCaptureSelected:n,onSaveRequested:r,onCaptureLoaded:i}){const s=(0,dt.useRef)(null),o=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault()},[]),l=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),function(e,t){let n=null;if(e&&e.dataTransfer&&e.dataTransfer.files&&(n=e.dataTransfer.files),e&&e.target&&e.target.files&&(n=e.target.files),n&&n.length>0)for(let e=0;e{a.error("Error while reading file: "+r.name+e)},i.onload=e=>{try{const n=JSON.parse(e.target.result);t(n)}catch(e){a.error("Error while reading file: "+r.name+e)}},i.readAsText(r)}}(e.nativeEvent,i)},[i]);return(0,mt.jsxs)("div",{className:"captureListComponent "+(e?"active":""),children:[(0,mt.jsx)("div",{className:"openCaptureFile",ref:s,onDragEnter:o,onDragOver:o,onDrop:l,children:(0,mt.jsx)("span",{children:"Drag files here to open a previously saved capture."})}),(0,mt.jsx)("ul",{children:t.map((e,t)=>(0,mt.jsx)(xt,{capture:e.capture,active:e.active,onCaptureSelected:()=>n(t),onSaveRequested:()=>r(e.capture)},t))})]})}function Ft({children:e}){return(0,mt.jsx)("div",{className:"visualStateListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Nt({item:e,onVisualStateSelected:t}){const n=(0,dt.useRef)(null);(0,dt.useEffect)(()=>{e.active&&n.current&&setTimeout(()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const r=(0,dt.useCallback)(()=>{t()},[t]),i=e.VisualState;return(0,mt.jsxs)("li",{ref:n,className:e.active?"active":"",onClick:r,commandName:"onVisualStateSelected",children:[i.Attachments?i.Attachments.map((e,t)=>e.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{src:encodeURI(e.src)}),i.Attachments.length>1&&(0,mt.jsx)("span",{children:e.attachmentName}),!!e.textureLayer&&(0,mt.jsx)("span",{children:"Layer: "+e.textureLayer}),!!e.textureCubeMapFace&&(0,mt.jsx)("span",{children:e.textureCubeMapFace})]},t):null):(0,mt.jsx)("span",{children:i.FrameBufferStatus}),(0,mt.jsx)("span",{children:i.FrameBuffer?"Frame buffer: "+i.FrameBuffer.__SPECTOR_Object_TAG.id:"Canvas frame buffer"})]})}function Lt({children:e}){return(0,mt.jsx)("div",{className:"commandListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Ot({command:e,onCommandSelected:t,onVertexSelected:n,onFragmentSelected:r,onShaderSelected:i}){var s;const o=(0,dt.useRef)(null),a=e.capture,l=function(e){switch(e){case 50:return"deprecated";case 10:return"unused";case 20:return"disabled";case 30:return"redundant";case 40:return"valid";default:return"unknown"}}(a.status),u=!!a.VisualState;let c="";u&&(c=" drawCall"),e.active&&(c=" active"),(0,dt.useEffect)(()=>{e.active&&o.current&&setTimeout(()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const h=(0,dt.useCallback)(e=>{t()},[t]),d=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==n||n()},[n]),f=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==r||r()},[r]),p=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==i||i()},[i]);let m=null;if(u&&"clear"!==a.name)try{const e=a.DrawCall.shaders[0],t=a.DrawCall.shaders[1];m=(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("a",{href:"#",onClick:d,children:e.name}),(0,mt.jsx)("a",{href:"#",onClick:f,children:t.name})]})}catch(e){}const g=(null===(s=a.shader)||void 0===s?void 0:s.source)?(0,mt.jsx)("a",{href:"#",commandName:"onShaderSourceSelected",onClick:p,children:"Source"}):null;return(0,mt.jsxs)("li",{ref:o,className:c,onClick:h,commandName:"onCommandSelected",children:[a.marker&&(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.marker+" "}),"LOG"===a.name?(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.text+" "}):(0,mt.jsx)("span",{dangerouslySetInnerHTML:{__html:a.text.replace(a.name,`${a.name}`)}}),g,m]})}function It({children:e}){return(0,mt.jsx)("div",{className:"commandDetailComponent",children:e})}function kt({left:e,children:t}){return(0,mt.jsx)("div",{className:e?"informationColumnLeftComponent":"informationColumnRightComponent",children:t})}function Mt({children:e}){return(0,mt.jsx)("div",{className:"jsonContentComponent",children:e})}function Pt(e,t,n,r){return{row:Math.max(0,parseInt(t,10)-1),column:n?Math.max(0,parseInt(n,10)-1):0,text:r.trim()||e,type:e.toLowerCase()}}var Bt,Ut,$t=Object.create,Gt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor,Wt=Object.getOwnPropertyNames,Ht=Object.getPrototypeOf,jt=Object.prototype.hasOwnProperty,zt=e=>{throw TypeError(e)},Xt=(e,t)=>{for(var n in t)Gt(e,n,{get:t[n],enumerable:!0})},Kt=(e,t,n)=>(((e,t)=>{t.has(e)||zt("Cannot access private method")})(e,t),n),Yt=(Bt=e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=/\r\n|[\n\r\u2028\u2029]/;e.codeFrameColumns=function(e,n,r={}){let i=new Proxy({},{get:()=>e=>e}),s=e.split(t),{start:o,end:a,markerLines:l}=function(e,t,n){let r=Object.assign({column:0,line:-1},e.start),i=Object.assign({},r,e.end),{linesAbove:s=2,linesBelow:o=3}=n||{},a=r.line,l=r.column,u=i.line,c=i.column,h=Math.max(a-(s+1),0),d=Math.min(t.length,u+o);-1===a&&(h=0),-1===u&&(d=t.length);let f=u-a,p={};if(f)for(let e=0;e<=f;e++){let n=e+a;if(l)if(0===e){let e=t[n-1].length;p[n]=[l,e-l+1]}else if(e===f)p[n]=[0,c];else{let r=t[n-e].length;p[n]=[0,r]}else p[n]=!0}else p[a]=l===c?!l||[l,0]:[l,c-l];return{start:h,end:d,markerLines:p}}(n,s,r),u=n.start&&"number"==typeof n.start.column,c=String(a).length,h=e.split(t,a).slice(o,a).map((e,t)=>{let n=o+1+t,s=` ${` ${n}`.slice(-c)} |`,a=l[n],u=!l[n+1];if(a){let t="";if(Array.isArray(a)){let n=e.slice(0,Math.max(a[0]-1,0)).replace(/[^\t]/g," "),o=a[1]||1;t=["\n ",i.gutter(s.replace(/\d/g," "))," ",n,i.marker("^").repeat(o)].join(""),u&&r.message&&(t+=" "+i.message(r.message))}return[i.marker(">"),i.gutter(s),e.length>0?` ${e}`:"",t].join("")}return` ${i.gutter(s)}${e.length>0?` ${e}`:""}`}).join("\n");return r.message&&!u&&(h=`${" ".repeat(c+1)}${r.message}\n${h}`),h}},()=>(Ut||Bt((Ut={exports:{}}).exports),Ut.exports));Xt({},{__debug:()=>Hs,check:()=>Vs,doc:()=>vs,format:()=>Gs,formatWithCursor:()=>$s,getSupportInfo:()=>Ws,util:()=>_s,version:()=>As});var qt=(e,t,n,r)=>{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Qt=class{diff(e,t,n={}){let r;"function"==typeof n?(r=n,n={}):"callback"in n&&(r=n.callback);let i=this.castInput(e,n),s=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),a=this.removeEmpty(this.tokenize(s,n));return this.diffWithOptionsObj(o,a,n,r)}diffWithOptionsObj(e,t,n,r){var i;let s=e=>(e=this.postProcess(e,n),r?void setTimeout(function(){r(e)},0):e),o=t.length,a=e.length,l=1,u=o+a;null!=n.maxEditLength&&(u=Math.min(u,n.maxEditLength));let c=null!==(i=n.timeout)&&void 0!==i?i:1/0,h=Date.now()+c,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=a&&f+1>=o)return s(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,g=()=>{for(let r=Math.max(p,-l);r<=Math.min(m,l);r+=2){let i,l=d[r-1],u=d[r+1];l&&(d[r-1]=void 0);let c=!1;if(u){let e=u.oldPos-r;c=u&&0<=e&&e=a&&f+1>=o)return s(this.buildValues(i.lastComponent,t,e))||!0;d[r]=i,i.oldPos+1>=a&&(m=Math.min(m,r-1)),f+1>=o&&(p=Math.max(p,r+1))}else d[r]=void 0}l++};if(r)!function e(){setTimeout(function(){if(l>u||Date.now()>h)return r(void 0);g()||e()},0)}();else for(;l<=u&&Date.now()<=h;){let e=g();if(e)return e}}addToPath(e,t,n,r,i){let s=e.lastComponent;return s&&!i.oneChangePerToken&&s.added===t&&s.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:s.count+1,added:t,removed:n,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:s}}}extractCommon(e,t,n,r,i){let s=t.length,o=n.length,a=e.oldPos,l=a-r,u=0;for(;l+1e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(a,a+e.count));a+=e.count,e.added||(l+=e.count)}}return i}},Zt=new class extends Qt{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Jt(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}function en(e,t){let n;switch(t){case"\n":n=/\n/gu;break;case"\r":n=/\r/gu;break;case"\r\n":n=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let r=e.match(n);return r?r.length:0}var tn="string",nn="array",rn="cursor",sn="indent",on="align",an="trim",ln="group",un="fill",cn="if-break",hn="indent-if-break",dn="line-suffix",fn="line-suffix-boundary",pn="line",mn="label",gn="break-parent",En=new Set([rn,sn,on,an,ln,un,cn,hn,dn,fn,pn,mn,gn]),vn=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},Cn=function(e){if("string"==typeof e)return tn;if(Array.isArray(e))return nn;if(!e)return;let{type:t}=e;return En.has(t)?t:void 0};var Dn=class extends Error{name="InvalidDocError";constructor(e){super(function(e){let t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(Cn(e))throw new Error("doc is valid.");let n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;let r=(e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e))([...En].map(e=>`'${e}'`));return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},Sn=Dn,An={},_n=function(e,t,n,r){let i=[e];for(;i.length>0;){let e=i.pop();if(e===An){n(i.pop());continue}n&&i.push(e,An);let s=Cn(e);if(!s)throw new Sn(e);if(!1!==(null==t?void 0:t(e)))switch(s){case nn:case un:{let t=s===nn?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case cn:i.push(e.flatContents,e.breakContents);break;case ln:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case on:case sn:case hn:case mn:case dn:i.push(e.contents);break;case tn:case rn:case an:case fn:case pn:case gn:break;default:throw new Sn(e)}}};function yn(e,t){if("string"==typeof e)return t(e);let n=new Map;return function e(r){if(n.has(r))return n.get(r);let i=function(n){switch(Cn(n)){case nn:return t(n.map(e));case un:return t({...n,parts:n.parts.map(e)});case cn:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case ln:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case on:case sn:case hn:case mn:case dn:return t({...n,contents:e(n.contents)});case tn:case rn:case an:case fn:case pn:case gn:return t(n);default:throw new Sn(n)}}(r);return n.set(r,i),i}(e)}function bn(e,t,n){let r=n,i=!1;return _n(e,function(e){if(i)return!1;let n=t(e);void 0!==n&&(i=!0,r=n)}),r}function Tn(e){if(e.type===ln&&e.break||e.type===pn&&e.hard||e.type===gn)return!0}function Rn(e){if(e.length>0){let t=vn(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function xn(e){return e.type!==pn||e.hard?e.type===cn?e.flatContents:e:e.soft?"":" "}function wn(e){for(e=[...e];e.length>=2&&vn(!1,e,-2).type===pn&&vn(!1,e,-1).type===gn;)e.length-=2;if(e.length>0){let t=Fn(vn(!1,e,-1));e[e.length-1]=t}return e}function Fn(e){switch(Cn(e)){case sn:case hn:case ln:case dn:case mn:{let t=Fn(e.contents);return{...e,contents:t}}case cn:return{...e,breakContents:Fn(e.breakContents),flatContents:Fn(e.flatContents)};case un:return{...e,parts:wn(e.parts)};case nn:return wn(e);case tn:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return tfunction(e){switch(Cn(e)){case un:if(e.parts.every(e=>""===e))return"";break;case ln:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===ln&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case on:case sn:case hn:case dn:if(!e.contents)return"";break;case cn:if(!e.flatContents&&!e.breakContents)return"";break;case nn:{let t=[];for(let n of e){if(!n)continue;let[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof vn(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case tn:case rn:case an:case fn:case pn:case mn:case gn:break;default:throw new Sn(e)}return e}(e))}(e))}function Ln(e){if(e.type===pn)return!0}function On(e,t){return e.type===mn?{...e,contents:t(e.contents)}:t(e)}var In=()=>{},kn=In,Mn=In,Pn=In;function Bn(e){return kn(e),{type:sn,contents:e}}function Un(e,t){return kn(t),{type:on,contents:t,n:e}}function $n(e,t={}){return kn(e),Mn(t.expandedStates,!0),{type:ln,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Gn(e){return kn(e),{type:dn,contents:e}}var Vn={type:fn},Wn={type:gn},Hn={type:an},jn={type:pn,hard:!0},zn={type:pn,hard:!0,literal:!0},Xn={type:pn},Kn={type:pn,soft:!0},Yn=[jn,Wn],qn=[zn,Wn],Qn={type:rn};function Zn(e,t){kn(e),Mn(t);let n=[];for(let r=0;r0){for(let e=0;e!(function(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}(e)||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e)),nr=/[^\x20-\x7F]/u,rr=function(e){if(!e)return 0;if(!nr.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(let n of e){let e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=tr(e)?1:2)}return t},ir=Symbol("MODE_BREAK"),sr=Symbol("MODE_FLAT"),or=Symbol("cursor"),ar=Symbol("DOC_FILL_PRINTED_LENGTH");function lr(e,t){return cr(e,{type:"indent"},t)}function ur(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?cr(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:cr(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function cr(e,t,n){let r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t],i="",s=0,o=0,a=0;for(let e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function hr(e){let t=0,n=0,r=e.length;e:for(;r--;){let i=e[r];if(i!==or)for(let n=i.length-1;n>=0;n--){let s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(or);return t}function dr(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length,a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}let{mode:e,doc:u}=a.pop(),c=Cn(u);switch(c){case tn:l.push(u),n-=rr(u);break;case nn:case un:{let t=c===nn?u:u.parts,n=u[ar]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case sn:case on:case hn:case mn:a.push({mode:e,doc:u.contents});break;case an:n+=hr(l);break;case ln:{if(s&&u.break)return!1;let t=u.break?ir:e,n=u.expandedStates&&t===ir?vn(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case cn:{let t=(u.groupId?i[u.groupId]||sr:e)===ir?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case pn:if(e===ir||u.hard)return!0;u.soft||(l.push(" "),n--);break;case dn:r=!0;break;case fn:if(r)return!1}}return!1}function fr(e,t){let n={},r=t.printWidth,i=Jt(t.endOfLine),s=0,o=[{ind:{value:"",length:0,queue:[]},mode:ir,doc:e}],a=[],l=!1,u=[],c=0;for(function(e){let t=new Set,n=[];_n(e,function(e){if(e.type===gn&&Rn(n),e.type===ln){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===ln&&n.pop().break&&Rn(n)},!0)}(e);o.length>0;){let{ind:e,mode:h,doc:d}=o.pop();switch(Cn(d)){case tn:{let e="\n"!==i?qt(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=rr(e));break}case nn:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case rn:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(or),c++;break;case sn:o.push({ind:lr(e,t),mode:h,doc:d.contents});break;case on:o.push({ind:ur(e,d.n,t),mode:h,doc:d.contents});break;case an:s-=hr(a);break;case ln:switch(h){case sr:if(!l){o.push({ind:e,mode:d.break?ir:sr,doc:d.contents});break}case ir:{l=!1;let t={ind:e,mode:sr,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&dr(t,o,i,a,n))o.push(t);else if(d.expandedStates){let t=vn(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:ir,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:ir,doc:t});break}{let t=d.expandedStates[r],s={ind:e,mode:sr,doc:t};if(dr(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:ir,doc:d.contents});break}}d.id&&(n[d.id]=vn(!1,o,-1).mode);break;case un:{let t=r-s,i=d[ar]??0,{parts:a}=d,l=a.length-i;if(0===l)break;let c=a[i+0],f=a[i+1],p={ind:e,mode:sr,doc:c},m={ind:e,mode:ir,doc:c},g=dr(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}let E={ind:e,mode:sr,doc:f},v={ind:e,mode:ir,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}let C=a[i+2],D={ind:e,mode:h,doc:{...d,[ar]:i+2}};dr({ind:e,mode:sr,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case cn:case hn:{let t=d.groupId?n[d.groupId]:h;if(t===ir){let t=d.type===cn?d.breakContents:d.negate?d.contents:Bn(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===sr){let t=d.type===cn?d.flatContents:d.negate?Bn(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case dn:u.push({ind:e,mode:h,doc:d.contents});break;case fn:u.length>0&&o.push({ind:e,mode:h,doc:jn});break;case pn:switch(h){case sr:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case ir:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=hr(a),a.push(i+e.value),s=e.length)}break;case mn:o.push({ind:e,mode:h,doc:d.contents});break;case gn:break;default:throw new Sn(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}let h=a.indexOf(or);if(-1!==h){let e=a.indexOf(or,h+1);if(-1===e)return{formatted:a.filter(e=>e!==or).join("")};let t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}var pr,mr,gr,Er=function(e,t,n=0){let r=0;for(let i=n;i=0;n-=2)if(!Array.isArray(t[n])&&--e<0)return n;return-1},gr=function*(){let{stack:e}=this;for(let t=e.length-3;t>=0;t-=2){let n=e[t];Array.isArray(n)||(yield n)}};var vr=class{constructor(e){((e,t)=>{t.has(e)?zt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,void 0)})(this,pr),this.stack=[e]}get key(){let{stack:e,siblings:t}=this;return vn(!1,e,null===t?-2:-4)??null}get index(){return null===this.siblings?null:vn(!1,this.stack,-2)}get node(){return vn(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return null!==this.siblings}get siblings(){let{stack:e}=this,t=vn(!1,e,-3);return Array.isArray(t)?t:null}get next(){let{siblings:e}=this;return null===e?null:e[this.index+1]}get previous(){let{siblings:e}=this;return null===e?null:e[this.index-1]}get isFirst(){return 0===this.index}get isLast(){let{siblings:e,index:t}=this;return null!==e&&t===e.length-1}get isRoot(){return 1===this.stack.length}get root(){return this.stack[0]}get ancestors(){return[...Kt(this,pr,gr).call(this)]}getName(){let{stack:e}=this,{length:t}=e;return t>1?vn(!1,e,-2):null}getValue(){return vn(!1,this.stack,-1)}getNode(e=0){let t=Kt(this,pr,mr).call(this,e);return-1===t?null:this.stack[t]}getParentNode(e=0){return this.getNode(e+1)}call(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{return e(this)}finally{n.length=r}}callParent(e,t=0){let n=Kt(this,pr,mr).call(this,t+1),r=this.stack.splice(n+1);try{return e(this)}finally{this.stack.push(...r)}}each(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{for(let t=0;t{n[r]=e(t,r,i)},...t),n}match(...e){let t=this.stack.length-1,n=null,r=this.stack[t--];for(let i of e){if(void 0===r)return!1;let e=null;if("number"==typeof n&&(e=n,n=this.stack[t--],r=this.stack[t--]),i&&!i(r,n,e))return!1;n=this.stack[t--],r=this.stack[t--]}return!0}findAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return t}hasAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return!0;return!1}},Cr=new Proxy(()=>{},{get:()=>Cr}),Dr=Cr;function*Sr(e,t){let{getVisitorKeys:n,filter:r=()=>!0}=t,i=e=>function(e){return null!==e&&"object"==typeof e}(e)&&r(e);for(let t of n(e)){let n=e[t];if(Array.isArray(n))for(let e of n)i(e)&&(yield e);else i(n)&&(yield n)}}function Ar(e){return(t,n,r)=>{let i=!(null==r||!r.backwards);if(!1===n)return!1;let{length:s}=t,o=n;for(;o>=0&&oObject.keys(e).filter(e=>!wr.has(e)),Nr=function(e){return e?t=>e(t,wr):Fr};function Lr(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=function(e){let t=e.type||e.kind||"(unknown type)",n=String(e.name||e.id&&("object"==typeof e.id?e.id.name:e.id)||e.key&&("object"==typeof e.key?e.key.name:e.key)||e.value&&("object"==typeof e.value?"":String(e.value))||e.operator||"");return n.length>20&&(n=n.slice(0,19)+"…"),t+(n?" "+n:"")}(e)}function Or(e,t){t.leading=!0,t.trailing=!1,Lr(e,t)}function Ir(e,t,n){t.leading=!1,t.trailing=!1,n&&(t.marker=n),Lr(e,t)}function kr(e,t){t.leading=!1,t.trailing=!0,Lr(e,t)}var Mr=new WeakMap;function Pr(e,t){if(Mr.has(e))return Mr.get(e);let{printer:{getCommentChildNodes:n,canAttachComment:r,getVisitorKeys:i},locStart:s,locEnd:o}=t;if(!r)return[];let a=((null==n?void 0:n(e,t))??[...Sr(e,{getVisitorKeys:Nr(i)})]).flatMap(e=>r(e)?[e]:Pr(e,t));return a.sort((e,t)=>s(e)-s(t)||o(e)-o(t)),Mr.set(e,a),a}function Br(e,t,n,r){let i,s,{locStart:o,locEnd:a}=n,l=o(t),u=a(t),c=Pr(e,n),h=0,d=c.length;for(;h>1,r=c[e],f=o(r),p=a(r);if(f<=l&&u<=p)return Br(r,t,n,r);if(p<=l)i=r,h=e+1;else{if(!(u<=f))throw new Error("Comment location overlaps with node location");s=r,d=e}}if("TemplateLiteral"===(null==r?void 0:r.type)){let{quasis:e}=r,o=Hr(e,t,n);i&&Hr(e,i,n)!==o&&(i=null),s&&Hr(e,s,n)!==o&&(s=null)}return{enclosingNode:r,precedingNode:i,followingNode:s}}var Ur=()=>!1,$r=e=>!/[\S\n\u2028\u2029]/u.test(e);function Gr(e,t,n,r){let{comment:i,precedingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=o(i);if(s)for(let t=r-1;t>=0;t--){let{comment:r,precedingNode:i}=n[t];if(i!==s||!$r(e.slice(a(r),l)))break;l=o(r)}return xr(e,l,{backwards:!0})}function Vr(e,t,n,r){let{comment:i,followingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=a(i);if(s)for(let t=r+1;t0;--s){let{comment:i,precedingNode:u,followingNode:c}=e[s-1];Dr.strictEqual(u,o),Dr.strictEqual(c,a);let h=t.originalText.slice(t.locEnd(i),l);if(!((null==(r=(n=t.printer).isGap)?void 0:r.call(n,h,t))??/^[\s(]*$/u.test(h)))break;l=t.locStart(i)}for(let[t,{comment:n}]of e.entries())t1&&e.comments.sort((e,n)=>t.locStart(e)-t.locStart(n));e.length=0}function Hr(e,t,n){let r=n.locStart(t)-1;for(let t=1;t"string"==typeof e||"function"==typeof e,choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>"string"==typeof e||"object"==typeof e,cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:"Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.",cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:"Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.",cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function qr({plugins:e=[],showDeprecated:t=!1}={}){let n=e.flatMap(e=>e.languages??[]),r=[];for(let i of function(e){let t=[];for(let[n,r]of Object.entries(e)){let e={name:n,...r};Array.isArray(e.default)&&(e.default=vn(!1,e.default,-1).value),t.push(e)}return t}(Object.assign({},...e.map(({options:e})=>e),Yr)))!t&&i.deprecated||(Array.isArray(i.choices)&&(t||(i.choices=i.choices.filter(e=>!e.deprecated)),"parser"===i.name&&(i.choices=[...i.choices,...Qr(i.choices,n,e)])),i.pluginDefaults=Object.fromEntries(e.filter(e=>{var t;return void 0!==(null==(t=e.defaultOptions)?void 0:t[i.name])}).map(e=>[e.name,e.defaultOptions[i.name]])),r.push(i));return{languages:n,options:r}}function*Qr(e,t,n){let r=new Set(e.map(e=>e.value));for(let e of t)if(e.parsers)for(let t of e.parsers)if(!r.has(t)){r.add(t);let i=n.find(e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t)),s=e.name;null!=i&&i.name&&(s+=` (plugin: ${i.name})`),yield{value:t,description:s}}}var Zr,Jr,ei,ti,ni,ri="windows"===(null==(Zr=globalThis.Deno)?void 0:Zr.build.os)||(null==(ei=null==(Jr=globalThis.navigator)?void 0:Jr.platform)?void 0:ei.startsWith("Win"))||(null==(ni=null==(ti=globalThis.process)?void 0:ti.platform)?void 0:ni.startsWith("win"))||!1;function ii(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function si(e,t){if(!t)return;let n=(e=>String(e).split(/[/\\]/u).pop())(t).toLowerCase();return e.find(({filenames:e})=>null==e?void 0:e.some(e=>e.toLowerCase()===n))??e.find(({extensions:e})=>null==e?void 0:e.some(e=>n.endsWith(e)))}function oi(e,t){if(t){if(String(t).startsWith("file:"))try{t=function(e){return ri?function(e){e=ii(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return""!==e.hostname&&(t=`\\\\${e.hostname}${t}`),t}(e):function(e){return e=ii(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}(e)}(t)}catch{return}if("string"==typeof t)return e.find(({isSupported:e})=>null==e?void 0:e({filepath:t}))}}var ai=function(e,t){let n=((e,t)=>{if(!e||null!=t)return t.toReversed||!Array.isArray(t)?t.toReversed():[...t].reverse()})(!1,e.plugins).flatMap(e=>e.languages??[]),r=function(e,t){if(t)return e.find(({name:e})=>e.toLowerCase()===t)??e.find(({aliases:e})=>null==e?void 0:e.includes(t))??e.find(({extensions:e})=>null==e?void 0:e.includes(`.${t}`))}(n,t.language)??si(n,t.physicalFile)??si(n,t.file)??oi(n,t.physicalFile)??oi(n,t.file)??void t.physicalFile;return null==r?void 0:r.parsers[0]},li={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(e=>li.value(e)).join(", ")}]`;let t=Object.keys(e);return 0===t.length?"{}":`{ ${t.map(t=>`${li.key(t)}: ${li.value(e[t])}`).join(", ")} }`},pair:({key:e,value:t})=>li.value({[e]:t})},ui=new Proxy(String,{get:()=>ui}),ci=ui,hi=Symbol.for("vnopts.VALUE_NOT_EXIST"),di=Symbol.for("vnopts.VALUE_UNCHANGED"),fi=" ".repeat(2);function pi(e,t,n,r){return[`Invalid ${ci.red(r.key(e))} value.`,`Expected ${ci.blue(n)},`,`but received ${t===hi?ci.gray("nothing"):ci.red(r.value(t))}.`].join(" ")}function mi({text:e,list:t},n){let r=[];return e&&r.push(`- ${ci.blue(e)}`),t&&r.push([`- ${ci.blue(t.title)}:`].concat(t.values.map(e=>mi(e,n-fi.length).replace(/^|\n/g,`$&${fi}`))).join("\n")),gi(r,n)}function gi(e,t){if(1===e.length)return e[0];let[n,r]=e,[i,s]=e.map(e=>e.split("\n",1)[0].length);return i>t&&i>s?r:n}var Ei=[],vi=[],Ci=(e,t,{descriptor:n,logger:r,schemas:i})=>{let s=[`Ignored unknown option ${ci.yellow(n.pair({key:e,value:t}))}.`],o=Object.keys(i).sort().find(t=>function(e,t){if(e===t)return 0;let n=e;e.length>t.length&&(e=t,t=n);let r=e.length,i=t.length;for(;r>0&&e.charCodeAt(~-r)===t.charCodeAt(~-i);)r--,i--;let s=0;for(;sa?u>a?a+1:u:u>l?l+1:u;return a}(e,t)<3);o&&s.push(`Did you mean ${ci.blue(n.key(o))}?`),r.warn(s.join(" "))},Di=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"],Si=class{static create(e){return function(e,t){let n=new e(t),r=Object.create(n);for(let e of Di)e in t&&(r[e]=Ai(t[e],n,Si.prototype[e].length));return r}(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,t){return!1}deprecated(e,t){return!1}forward(e,t){}redirect(e,t){}overlap(e,t,n){return e}preprocess(e,t){return e}postprocess(e,t){return di}};function Ai(e,t,n){return"function"==typeof e?(...r)=>e(...r.slice(0,n-1),t,...r.slice(n-1)):()=>e}var _i=class extends Si{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},yi=class extends Si{expected(){return"anything"}validate(){return!0}},bi=class extends Si{constructor({valueSchema:e,name:t=e.name,...n}){super({...n,name:t}),this._valueSchema=e}expected(e){let{text:t,list:n}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:t&&`an array of ${t}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(e,t){if(!Array.isArray(e))return!1;let n=[];for(let r of e){let e=t.normalizeValidateResult(this._valueSchema.validate(r,t),r);!0!==e&&n.push(e.value)}return 0===n.length||{value:n}}deprecated(e,t){let n=[];for(let r of e){let e=t.normalizeDeprecatedResult(this._valueSchema.deprecated(r,t),r);!1!==e&&n.push(...e.map(({value:e})=>({value:[e]})))}return n}forward(e,t){let n=[];for(let r of e){let e=t.normalizeForwardResult(this._valueSchema.forward(r,t),r);n.push(...e.map(Ti))}return n}redirect(e,t){let n=[],r=[];for(let i of e){let e=t.normalizeRedirectResult(this._valueSchema.redirect(i,t),i);"remain"in e&&n.push(e.remain),r.push(...e.redirect.map(Ti))}return 0===n.length?{redirect:r}:{redirect:r,remain:n}}overlap(e,t){return e.concat(t)}};function Ti({from:e,to:t}){return{from:[e],to:t}}var Ri=class extends Si{expected(){return"true or false"}validate(e){return"boolean"==typeof e}};function xi(e,t){let n=Object.create(null);for(let r of e){let e=r[t];if(n[e])throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n[e]=r}return n}function wi(e,t){if(e===t)return 0;let n=typeof e,r=typeof t,i=["undefined","object","boolean","number","string"];return n!==r?i.indexOf(n)-i.indexOf(r):"string"!==n?Number(e)-Number(t):e.localeCompare(t)}function Fi(e){return void 0===e?{}:e}function Ni(e){if("string"==typeof e)return{text:e};let{text:t,list:n}=e;return function(e){if(!e)throw new Error("Unexpected `expected` result, there should be at least one field.")}(void 0!==(t||n)),n?{text:t,list:{title:n.title,values:n.values.map(Ni)}}:{text:t}}function Li(e,t){return!0===e||(!1===e?{value:t}:e)}function Oi(e,t,n=!1){return!1!==e&&(!0===e?!!n||[{value:t}]:"value"in e?[e]:0!==e.length&&e)}function Ii(e,t){return"string"==typeof e||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function ki(e,t){return void 0===e?[]:Array.isArray(e)?e.map(e=>Ii(e,t)):[Ii(e,t)]}function Mi(e,t){let n=ki("object"==typeof e&&"redirect"in e?e.redirect:e,t);return 0===n.length?{remain:t,redirect:n}:"object"==typeof e&&"remain"in e?{remain:e.remain,redirect:n}:{redirect:n}}var Pi,Bi=class extends Si{constructor(e){super(e),this._choices=function(e,t){let n=new Map;for(let r of e){let e=r[t];if(n.has(e))throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n.set(e,r)}return n}(e.choices.map(e=>e&&"object"==typeof e?e:{value:e}),"value")}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(e=>this._choices.get(e)).filter(({hidden:e})=>!e).map(e=>e.value).sort(wi).map(e.value),n=t.slice(0,-2),r=t.slice(-2);return{text:n.concat(r.join(" or ")).join(", "),list:{title:"one of the following values",values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return!(!t||!t.deprecated)&&{value:e}}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},Ui=class extends Si{expected(){return"a number"}validate(e,t){return"number"==typeof e}},$i=class extends Ui{expected(){return"an integer"}validate(e,t){return!0===t.normalizeValidateResult(super.validate(e,t),e)&&function(e){return e===Math.floor(e)}(e)}},Gi=class extends Si{expected(){return"a string"}validate(e){return"string"==typeof e}},Vi=li,Wi=Ci,Hi=(e,t,n)=>{let{text:r,list:i}=n.normalizeExpectedResult(n.schemas[e].expected(n)),s=[];return r&&s.push(pi(e,t,r,n.descriptor)),i&&s.push([pi(e,t,i.title,n.descriptor)].concat(i.values.map(e=>mi(e,n.loggerPrintWidth))).join("\n")),gi(s,n.loggerPrintWidth)},ji=(e,t,{descriptor:n})=>{let r=[`${ci.yellow("string"==typeof e?n.key(e):n.pair(e))} is deprecated`];return t&&r.push(`we now treat it as ${ci.blue("string"==typeof t?n.key(t):n.pair(t))}`),r.join("; ")+"."},zi=class{constructor(e,t){let{logger:n=console,loggerPrintWidth:r=80,descriptor:i=Vi,unknown:s=Wi,invalid:o=Hi,deprecated:a=ji,missing:l=()=>!1,required:u=()=>!1,preprocess:c=e=>e,postprocess:h=()=>di}=t||{};this._utils={descriptor:i,logger:n||{warn:()=>{}},loggerPrintWidth:r,schemas:xi(e,"name"),normalizeDefaultResult:Fi,normalizeExpectedResult:Ni,normalizeDeprecatedResult:Oi,normalizeForwardResult:ki,normalizeRedirectResult:Mi,normalizeValidateResult:Li},this._unknownHandler=s,this._invalidHandler=function(e){return(...t)=>{let n=e(...t);return"string"==typeof n?new Error(n):n}}(o),this._deprecatedHandler=a,this._identifyMissing=(e,t)=>!(e in t)||l(e,t),this._identifyRequired=u,this._preprocess=c,this._postprocess=h,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=function(){let e=Object.create(null);return t=>{let n=JSON.stringify(t);return!!e[n]||(e[n]=!0,!1)}}()}normalize(e){let t={},n=[this._preprocess(e,this._utils)],r=()=>{for(;0!==n.length;){let e=n.shift(),r=this._applyNormalization(e,t);n.push(...r)}};r();for(let e of Object.keys(this._utils.schemas)){let r=this._utils.schemas[e];if(!(e in t)){let t=Fi(r.default(this._utils));"value"in t&&n.push({[e]:t.value})}}r();for(let e of Object.keys(this._utils.schemas)){if(!(e in t))continue;let n=this._utils.schemas[e],r=t[e],i=n.postprocess(r,this._utils);i!==di&&(this._applyValidation(i,e,n),t[e]=i)}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let n=[],{knownKeys:r,unknownKeys:i}=this._partitionOptionKeys(e);for(let i of r){let r=this._utils.schemas[i],s=r.preprocess(e[i],this._utils);this._applyValidation(s,i,r);let o=({from:e,to:t})=>{n.push("string"==typeof t?{[t]:e}:{[t.key]:t.value})},a=({value:e,redirectTo:t})=>{let n=Oi(r.deprecated(e,this._utils),s,!0);if(!1!==n)if(!0===n)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,t,this._utils));else for(let{value:e}of n){let n={key:i,value:e};if(!this._hasDeprecationWarned(n)){let r="string"==typeof t?{key:t,value:e}:t;this._utils.logger.warn(this._deprecatedHandler(n,r,this._utils))}}};ki(r.forward(s,this._utils),s).forEach(o);let l=Mi(r.redirect(s,this._utils),s);if(l.redirect.forEach(o),"remain"in l){let e=l.remain;t[i]=i in t?r.overlap(t[i],e,this._utils):e,a({value:e})}for(let{from:e,to:t}of l.redirect)a({value:e,redirectTo:t})}for(let r of i){let i=e[r];this._applyUnknownHandler(r,i,t,(e,t)=>{n.push({[e]:t})})}return n}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,hi,this._utils)}_partitionOptionKeys(e){let[t,n]=function(e,t){let n=[],r=[];for(let i of e)t(i)?n.push(i):r.push(i);return[n,r]}(Object.keys(e).filter(t=>!this._identifyMissing(t,e)),e=>e in this._utils.schemas);return{knownKeys:t,unknownKeys:n}}_applyValidation(e,t,n){let r=Li(n.validate(e,this._utils),e);if(!0!==r)throw this._invalidHandler(t,r.value,this._utils)}_applyUnknownHandler(e,t,n,r){let i=this._unknownHandler(e,t,this._utils);if(i)for(let e of Object.keys(i)){if(this._identifyMissing(e,i))continue;let t=i[e];e in this._utils.schemas?r(e,t):n[e]=t}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==di){if(t.delete)for(let n of t.delete)delete e[n];if(t.override){let{knownKeys:n,unknownKeys:r}=this._partitionOptionKeys(t.override);for(let r of n){let n=t.override[r];this._applyValidation(n,r,this._utils.schemas[r]),e[r]=n}for(let n of r){let r=t.override[n];this._applyUnknownHandler(n,r,e,(t,n)=>{let r=this._utils.schemas[t];this._applyValidation(n,t,r),e[t]=n})}}}}};function Xi(e,{isCLI:t,optionInfos:n,FlagSchema:r}){let i,{name:s}=e,o={name:s},a={};switch(e.type){case"int":i=$i,t&&(o.preprocess=Number);break;case"string":case"path":i=Gi;break;case"choice":i=Bi,o.choices=e.choices.map(t=>null!=t&&t.redirect?{...t,redirect:{to:{key:e.name,value:t.redirect}}}:t);break;case"boolean":i=Ri;break;case"flag":i=r,o.flags=n.flatMap(e=>[e.alias,e.description&&e.name,e.oppositeDescription&&`no-${e.name}`].filter(Boolean));break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?o.validate=(t,n,r)=>e.exception(t)||n.validate(t,r):o.validate=(e,t,n)=>void 0===e||t.validate(e,n),e.redirect&&(a.redirect=t=>t?{to:"string"==typeof e.redirect?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(a.deprecated=!0),t&&!e.array){let e=o.preprocess||(e=>e);o.preprocess=(t,n,r)=>n.preprocess(e(Array.isArray(t)?vn(!1,t,-1):t),r)}return e.array?bi.create({...t?{preprocess:e=>Array.isArray(e)?e:[e]}:{},...a,valueSchema:i.create(o)}):i.create({...o,...a})}var Ki=(e,t,n)=>{if(!e||null!=t){if(t.findLast)return t.findLast(n);for(let e=t.length-1;e>=0;e--){let r=t[e];if(n(r,e,t))return r}}};function Yi(e,t){if(!t)throw new Error("parserName is required.");let n=Ki(!1,e,e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t));if(n)return n;let r=`Couldn't resolve parser "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}function qi({plugins:e,parser:t}){return Qi(Yi(e,t),t)}function Qi(e,t){let n=e.parsers[t];return"function"==typeof n?n():n}var Zi={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null},Ji=async function(e,t={}){var n;let r={...e};if(!r.parser){if(!r.filepath)throw new Kr("No parser and no file path given, couldn't infer a parser.");if(r.parser=ai(r,{physicalFile:r.filepath}),!r.parser)throw new Kr(`No parser could be inferred for file "${r.filepath}".`)}let i=qr({plugins:e.plugins,showDeprecated:!0}).options,s={...Zi,...Object.fromEntries(i.filter(e=>void 0!==e.default).map(e=>[e.name,e.default]))},o=Yi(r.plugins,r.parser),a=await Qi(o,r.parser);r.astFormat=a.astFormat,r.locEnd=a.locEnd,r.locStart=a.locStart;let l=null!=(n=o.printers)&&n[a.astFormat]?o:function(e,t){if(!t)throw new Error("astFormat is required.");let n=Ki(!1,e,e=>e.printers&&Object.prototype.hasOwnProperty.call(e.printers,t));if(n)return n;let r=`Couldn't find plugin for AST format "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}(r.plugins,a.astFormat),u=await function(e,t){let n=e.printers[t];return"function"==typeof n?n():n}(l,a.astFormat);r.printer=u;let c={...s,...l.defaultOptions?Object.fromEntries(Object.entries(l.defaultOptions).filter(([,e])=>void 0!==e)):{}};for(let[e,t]of Object.entries(c))(null===r[e]||void 0===r[e])&&(r[e]=t);return"json"===r.parser&&(r.trailingComma="none"),function(e,t,{logger:n=!1,isCLI:r=!1,passThrough:i=!1,FlagSchema:s,descriptor:o}={}){if(r){if(!s)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=li;let a=i?Array.isArray(i)?(e,t)=>i.includes(e)?{[e]:t}:void 0:(e,t)=>({[e]:t}):(e,t,n)=>{let{_:r,...i}=n.schemas;return Ci(e,t,{...n,schemas:i})},l=function(e,{isCLI:t,FlagSchema:n}){let r=[];t&&r.push(yi.create({name:"_"}));for(let i of e)r.push(Xi(i,{isCLI:t,optionInfos:e,FlagSchema:n})),i.alias&&t&&r.push(_i.create({name:i.alias,sourceName:i.name}));return r}(t,{isCLI:r,FlagSchema:s}),u=new zi(l,{logger:n,unknown:a,descriptor:o}),c=!1!==n;c&&Pi&&(u._hasDeprecationWarned=Pi);let h=u.normalize(e);return c&&(Pi=u._hasDeprecationWarned),h}(r,i,{passThrough:Object.keys(Zi),...t})},es=((e,t,n)=>(n=null!=e?$t(Ht(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of Wt(t))!jt.call(e,n)&&void 0!==n&&Gt(e,n,{get:()=>t[n],enumerable:!(r=Vt(t,n))||r.enumerable});return e})(Gt(n,"default",{value:e,enumerable:!0}),e)))(Yt()),ts=async function(e,t){let n,r=await qi(t),i=r.preprocess?r.preprocess(e,t):e;t.originalText=i;try{n=await r.parse(i,t,t)}catch(t){!function(e,t){let{loc:n}=e;if(n){let r=(0,es.codeFrameColumns)(t,n,{highlightCode:!0});throw e.message+="\n"+r,e.codeFrame=r,e}throw e}(t,e)}return{text:i,ast:n}};async function ns(e,t){({ast:e}=await is(e,t));let n=new Map,r=new vr(e),i=()=>{},s=new Map;await async function(e,t,n,r,i){let{embeddedLanguageFormatting:s,printer:{embed:o,hasPrettierIgnore:a=()=>!1,getVisitorKeys:l}}=n;if(!o||"auto"!==s)return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let u=Nr(o.getVisitorKeys??l),c=[];!function t(){let{node:r}=e;if(null===r||"object"!=typeof r||a(e))return;for(let n of u(r))Array.isArray(r[n])?e.each(t,n):e.call(t,n);let s=o(e,n);if(s){if("function"==typeof s)return void c.push({print:s,node:r,pathStack:[...e.stack]});i.set(r,s)}}();let h=e.stack;for(let{print:r,node:s,pathStack:o}of c)try{e.stack=o;let a=await r(d,t,e,n);a&&i.set(s,a)}catch(e){if(globalThis.PRETTIER_DEBUG)throw e}function d(e,t){return async function(e,t,n,r){let i=await Ji({...n,...t,parentParser:n.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:s}=await ts(e,i);return Nn(await r(s,i))}(e,t,n,r)}e.stack=h}(r,a,t,ns,s);let o=await rs(r,t,a,void 0,s);if(function(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:n}=e;for(let e of t){if(!e.printed&&!n.has(e))throw new Error('Comment "'+e.value.trim()+'" was not printed. Please report this error!');delete e.printed}}(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return[Qn,o];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[o,Qn]}return o;function a(e,t){return void 0===e||e===r?l(t):Array.isArray(e)?r.call(()=>l(t),...e):r.call(()=>l(t),e)}function l(e){i(r);let o=r.node;if(null==o)return"";let l=o&&"object"==typeof o&&void 0===e;if(l&&n.has(o))return n.get(o);let u=rs(r,t,a,e,s);return l&&n.set(o,u),u}}function rs(e,t,n,r,i){var s;let o,{node:a}=e,{printer:l}=t;switch(o=null!=(s=l.hasPrettierIgnore)&&s.call(l,e)?function(e,t){let{originalText:n,[Symbol.for("comments")]:r,locStart:i,locEnd:s,[Symbol.for("printedComments")]:o}=t,{node:a}=e,l=i(a),u=s(a);for(let e of r)i(e)>=l&&s(e)<=u&&o.add(e);return n.slice(l,u)}(e,t):i.has(a)?i.get(a):l.print(e,t,n,r),a){case t.cursorNode:o=On(o,e=>[Qn,e,Qn]);break;case t.nodeBeforeCursor:o=On(o,e=>[e,Qn]);break;case t.nodeAfterCursor:o=On(o,e=>[Qn,e])}return l.printComment&&(!l.willPrintOwnComments||!l.willPrintOwnComments(e,t))&&(o=function(e,t,n){let{leading:r,trailing:i}=function(e,t){let n=e.node;if(!n)return{};let r=t[Symbol.for("printedComments")];if(0===(n.comments||[]).filter(e=>!r.has(e)).length)return{leading:"",trailing:""};let i,s=[],o=[];return e.each(()=>{let n=e.node;if(null!=r&&r.has(n))return;let{leading:a,trailing:l}=n;a?s.push(function(e,t){var n;let r=e.node,i=[zr(e,t)],{printer:s,originalText:o,locStart:a,locEnd:l}=t;if(null==(n=s.isBlockComment)?void 0:n.call(s,r)){let e=xr(o,l(r))?xr(o,a(r),{backwards:!0})?Yn:Xn:" ";i.push(e)}else i.push(Yn);let u=Rr(o,yr(o,l(r)));return!1!==u&&xr(o,u)&&i.push(Yn),i}(e,t)):l&&(i=function(e,t,n){var r;let i=e.node,s=zr(e,t),{printer:o,originalText:a,locStart:l}=t,u=null==(r=o.isBlockComment)?void 0:r.call(o,i);if(null!=n&&n.hasLineSuffix&&(null==n||!n.isBlock)||xr(a,l(i),{backwards:!0})){let e=jr(a,l(i));return{doc:Gn([Yn,e?Yn:"",s]),isBlock:u,hasLineSuffix:!0}}return!u||null!=n&&n.hasLineSuffix?{doc:[Gn([" ",s]),Wn],isBlock:u,hasLineSuffix:!0}:{doc:[" ",s],isBlock:u,hasLineSuffix:!1}}(e,t,i),o.push(i.doc))},"comments"),{leading:s,trailing:o}}(e,n);return r||i?On(t,e=>[r,e,i]):t}(e,o,t)),o}async function is(e,t){let n=e.comments??[];t[Symbol.for("comments")]=n,t[Symbol.for("printedComments")]=new Set,function(e,t){let{comments:n}=e;if(delete e.comments,!function(e){return Array.isArray(e)&&e.length>0}(n)||!t.printer.canAttachComment)return;let r=[],{printer:{experimentalFeatures:{avoidAstMutation:i=!1}={},handleComments:s={}},originalText:o}=t,{ownLine:a=Ur,endOfLine:l=Ur,remaining:u=Ur}=s,c=n.map((r,i)=>({...Br(e,r,t),comment:r,text:o,options:t,ast:e,isLastComment:n.length-1===i}));for(let[e,t]of c.entries()){let n,{comment:s,precedingNode:o,enclosingNode:h,followingNode:d,text:f,options:p,ast:m,isLastComment:g}=t;if(i?n=[t]:(s.enclosingNode=h,s.precedingNode=o,s.followingNode=d,n=[s,f,p,m,g]),Gr(f,p,c,e))s.placement="ownLine",a(...n)||(d?Or(d,s):o?kr(o,s):Ir(h||m,s));else if(Vr(f,p,c,e))s.placement="endOfLine",l(...n)||(o?kr(o,s):d?Or(d,s):Ir(h||m,s));else if(s.placement="remaining",!u(...n))if(o&&d){let e=r.length;e>0&&r[e-1].followingNode!==d&&Wr(r,p),r.push(t)}else o?kr(o,s):d?Or(d,s):Ir(h||m,s)}if(Wr(r,t),!i)for(let e of n)delete e.precedingNode,delete e.enclosingNode,delete e.followingNode}(e,t);let{printer:{preprocess:r}}=t;return{ast:e=r?await r(e,t):e,comments:n}}var ss=function(e,t){let{cursorOffset:n,locStart:r,locEnd:i}=t,s=Nr(t.printer.getVisitorKeys),o=e=>r(e)<=n&&i(e)>=n,a=e,l=[e];for(let t of function*(e,t){let n=[e];for(let e=0;e0&&(void 0===u||void 0===c);){a=l.pop();let e=void 0!==u,t=void 0!==c;for(let o of Sr(a,{getVisitorKeys:s})){if(!e){let e=i(o);e<=n&&e>h&&(u=o,h=e)}if(!t){let e=r(o);e>=n&&e{if(!e||null!=t){if(t.findLastIndex)return t.findLastIndex(n);for(let e=t.length-1;e>=0;e--)if(n(t[e],e,t))return e;return-1}})(!1,e,e=>"Program"!==e.type&&"File"!==e.type);return-1===t?e:e.slice(0,t+1)}function as(e,t,n,r,i=[],s){let{locStart:o,locEnd:a}=n,l=o(e),u=a(e);if(!(t>u||t=0&&(t={...t,...ss(r,t)});let s=await ns(r,t);n>0&&(s=Jn([Yn,s],n,t.tabWidth));let o=fr(s,t);if(n>0){let e=o.formatted.trim();void 0!==o.cursorNodeStart&&(o.cursorNodeStart-=o.formatted.indexOf(e),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>e.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=e+Jt(t.endOfLine)}let a=t[Symbol.for("comments")];if(t.cursorOffset>=0){let e,n,r,s;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&o.cursorNodeText)if(r=o.cursorNodeStart,s=o.cursorNodeText,t.cursorNode)e=t.locStart(t.cursorNode),n=i.slice(e,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");e=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let r=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):i.length;n=i.slice(e,r)}else e=0,n=i,r=0,s=o.formatted;let l=t.cursorOffset-e;if(n===s)return{formatted:o.formatted,cursorOffset:r+l,comments:a};let u=n.split("");u.splice(l,0,hs);let c=function(e,t){return Zt.diff(e,t,void 0)}(u,s.split("")),h=r;for(let e of c)if(e.removed){if(e.value.includes(hs))break}else h+=e.count;return{formatted:o.formatted,cursorOffset:h,comments:a}}return{formatted:o.formatted,cursorOffset:-1,comments:a}}function fs(e,t,n){return"number"!=typeof t||Number.isNaN(t)||t<0||t>e.length?n:t}function ps(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i}=t;return n=fs(e,n,-1),r=fs(e,r,0),i=fs(e,i,e.length),{...t,cursorOffset:n,rangeStart:r,rangeEnd:i}}function ms(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s}=ps(e,t),o="\ufeff"===e.charAt(0);if(o&&(e=e.slice(1),n--,r--,i--),"auto"===s&&(s=function(e){let t=e.indexOf("\r");return-1!==t?"\n"===e.charAt(t+1)?"crlf":"cr":"lf"}(e)),e.includes("\r")){let t=t=>en(e.slice(0,Math.max(t,0)),"\r\n");n-=t(n),r-=t(r),i-=t(i),e=function(e){return qt(!1,e,/\r\n?/gu,"\n")}(e)}return{hasBOM:o,text:e,options:ps(e,{...t,cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s})}}async function gs(e,t){let n=await qi(t);return!n.hasPragma||n.hasPragma(e)}async function Es(e,t){let n,{hasBOM:r,text:i,options:s}=ms(e,await Ji(t));return s.rangeStart>=s.rangeEnd&&""!==i||s.requirePragma&&!await gs(i,s)||s.checkIgnorePragma&&await async function(e,t){var n;let r=await qi(t);return null==(n=r.hasIgnorePragma)?void 0:n.call(r,e)}(i,s)?{formatted:e,cursorOffset:t.cursorOffset,comments:[]}:(s.rangeStart>0||s.rangeEndr);let a=e.slice(r,i).search(/\S/u),l=-1===a;if(!l)for(r+=a;i>r&&!/\S/u.test(e[i-1]);--i);let u,c,h=as(n,r,t,(e,n)=>cs(t,e,n),[],"rangeStart"),d=l?h:as(n,i,t,e=>cs(t,e),[],"rangeEnd");if(!h||!d)return{rangeStart:0,rangeEnd:0};if((({parser:e})=>"json"===e||"json5"===e||"jsonc"===e||"json-stringify"===e)(t)){let e=function(e,t){let n=[e.node,...e.parentNodes],r=new Set([t.node,...t.parentNodes]);return n.find(e=>ls.has(e.type)&&r.has(e))}(h,d);u=e,c=e}else({startNode:u,endNode:c}=function(e,t,{locStart:n,locEnd:r}){let i=e.node,s=t.node;if(i===s)return{startNode:i,endNode:s};let o=n(e.node);for(let e of os(t.parentNodes)){if(!(n(e)>=o))break;s=e}let a=r(t.node);for(let t of os(e.parentNodes)){if(!(r(t)<=a))break;if(i=t,i===s)break}return{startNode:i,endNode:s}}(h,d,t));return{rangeStart:Math.min(s(u),s(c)),rangeEnd:Math.max(o(u),o(c))}}(r,t,n),o=r.slice(i,s),a=Math.min(i,r.lastIndexOf("\n",i)+1),l=r.slice(a,i).match(/^\s*/u)[0],u=Er(l,t.tabWidth),c=await ds(o,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>i&&t.cursorOffset<=s?t.cursorOffset-i:-1,endOfLine:"lf"},u),h=c.formatted.trimEnd(),{cursorOffset:d}=t;d>s?d+=h.length-o.length:c.cursorOffset>=0&&(d=c.cursorOffset+i);let f=r.slice(0,i)+h+r.slice(s);if("lf"!==t.endOfLine){let e=Jt(t.endOfLine);d>=0&&"\r\n"===e&&(d+=en(f.slice(0,d),"\n")),f=qt(!1,f,"\n",e)}return{formatted:f,cursorOffset:d,comments:c.comments}}(i,s):(!s.requirePragma&&s.insertPragma&&s.printer.insertPragma&&!await gs(i,s)&&(i=s.printer.insertPragma(i)),n=await ds(i,s)),r&&(n.formatted="\ufeff"+n.formatted,n.cursorOffset>=0&&n.cursorOffset++),n)}var vs={};Xt(vs,{builders:()=>Cs,printer:()=>Ds,utils:()=>Ss});var Cs={join:Zn,line:Xn,softline:Kn,hardline:Yn,literalline:qn,group:$n,conditionalGroup:function(e,t){return $n(e[0],{...t,expandedStates:e})},fill:function(e){return Pn(e),{type:un,parts:e}},lineSuffix:Gn,lineSuffixBoundary:Vn,cursor:Qn,breakParent:Wn,ifBreak:function(e,t="",n={}){return kn(e),""!==t&&kn(t),{type:cn,breakContents:e,flatContents:t,groupId:n.groupId}},trim:Hn,indent:Bn,indentIfBreak:function(e,t){return kn(e),{type:hn,contents:e,groupId:t.groupId,negate:t.negate}},align:Un,addAlignmentToDoc:Jn,markAsRoot:function(e){return Un({type:"root"},e)},dedentToRoot:function(e){return Un(Number.NEGATIVE_INFINITY,e)},dedent:function(e){return Un(-1,e)},hardlineWithoutBreakParent:jn,literallineWithoutBreakParent:zn,label:function(e,t){return kn(t),e?{type:mn,label:e,contents:t}:t},concat:e=>e},Ds={printDocToString:fr},Ss={willBreak:function(e){return bn(e,Tn,!1)},traverseDoc:_n,findInDoc:bn,mapDoc:yn,removeLines:function(e){return yn(e,xn)},stripTrailingHardline:Nn,replaceEndOfLine:function(e,t=qn){return yn(e,e=>"string"==typeof e?Zn(t,e.split("\n")):e)},canBreak:function(e){return bn(e,Ln,!1)}},As="3.6.2",_s={};Xt(_s,{addDanglingComment:()=>Ir,addLeadingComment:()=>Or,addTrailingComment:()=>kr,getAlignmentSize:()=>Er,getIndentSize:()=>xs,getMaxContinuousCount:()=>ws,getNextNonSpaceNonCommentCharacter:()=>Fs,getNextNonSpaceNonCommentCharacterIndex:()=>Ms,getPreferredQuote:()=>Ls,getStringWidth:()=>rr,hasNewline:()=>xr,hasNewlineInRange:()=>Os,hasSpaces:()=>Is,isNextLineEmpty:()=>Bs,isNextLineEmptyAfterIndex:()=>Rs,isPreviousLineEmpty:()=>Ps,makeString:()=>ks,skip:()=>Ar,skipEverythingButNewLine:()=>Tr,skipInlineComment:()=>ys,skipNewline:()=>Rr,skipSpaces:()=>yr,skipToLineEnd:()=>br,skipTrailingComment:()=>bs,skipWhitespace:()=>_r});var ys=function(e,t){if(!1===t)return!1;if("/"===e.charAt(t)&&"*"===e.charAt(t+1))for(let n=t+2;nMath.max(e,n.length/t.length),0)},Fs=function(e,t){let n=Ts(e,t);return!1===n?"":e.charAt(n)},Ns="'",Ls=function(e,t){let n=!0===t||t===Ns?Ns:'"',r=n===Ns?'"':Ns,i=0,s=0;for(let t of e)t===n?i++:t===r&&s++;return i>s?r:n},Os=function(e,t,n){for(let r=t;ri===r?i:s===t?"\\"+s:s||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(i)?i:"\\"+i));return t+i+t};function Ms(e,t){return 2===arguments.length||"number"==typeof t?Ts(e,t):function(e,t,n){return Ts(e,n(t))}(...arguments)}function Ps(e,t){return 2===arguments.length||"number"==typeof t?jr(e,t):function(e,t,n){return jr(e,n(t))}(...arguments)}function Bs(e,t){return 2===arguments.length||"number"==typeof t?Rs(e,t):function(e,t,n){return Rs(e,n(t))}(...arguments)}function Us(e,t=1){return async(...n)=>{let r=n[t]??{},i=r.plugins??[];return n[t]={...r,plugins:Array.isArray(i)?i:Object.values(i)},e(...n)}}var $s=Us(Es);async function Gs(e,t){let{formatted:n}=await $s(e,{...t,cursorOffset:-1});return n}async function Vs(e,t){return await Gs(e,t)===e}var Ws=Us(qr,0),Hs={parse:Us(async function(e,t,n){let{text:r,options:i}=ms(e,await Ji(t)),s=await ts(r,i);return n&&(n.preprocessForPrint&&(s.ast=await is(s.ast,i)),n.massage&&(s.ast=function(e,t){let{printer:{massageAstNode:n,getVisitorKeys:r}}=t;if(!n)return e;let i=Nr(r),s=n.ignoredProperties??new Set;return function e(t,r){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>e(t,r)).filter(Boolean);let o={},a=new Set(i(t));for(let n in t)!Object.prototype.hasOwnProperty.call(t,n)||s.has(n)||(a.has(n)?o[n]=e(t[n],t):o[n]=t[n]);let l=n(t,o,r);return null!==l?l??o:void 0}(e)}(s.ast,i))),s}),formatAST:Us(async function(e,t){return t=await Ji(t),fr(await ns(e,t),t)}),formatDoc:Us(async function(e,t){let n=function(e){let t=Object.create(null),n=new Set;return function e(t,n,i){var s,o;if("string"==typeof t)return JSON.stringify(t);if(Array.isArray(t)){let n=t.map(e).filter(Boolean);return 1===n.length?n[0]:`[${n.join(", ")}]`}if(t.type===pn){let e=(null==(s=null==i?void 0:i[n+1])?void 0:s.type)===gn;return t.literal?e?"literalline":"literallineWithoutBreakParent":t.hard?e?"hardline":"hardlineWithoutBreakParent":t.soft?"softline":"line"}if(t.type===gn)return(null==(o=null==i?void 0:i[n-1])?void 0:o.type)===pn&&i[n-1].hard?void 0:"breakParent";if(t.type===an)return"trim";if(t.type===sn)return"indent("+e(t.contents)+")";if(t.type===on)return t.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+e(t.contents)+")":t.n<0?"dedent("+e(t.contents)+")":"root"===t.n.type?"markAsRoot("+e(t.contents)+")":"align("+JSON.stringify(t.n)+", "+e(t.contents)+")";if(t.type===cn)return"ifBreak("+e(t.breakContents)+(t.flatContents?", "+e(t.flatContents):"")+(t.groupId?(t.flatContents?"":', ""')+`, { groupId: ${r(t.groupId)} }`:"")+")";if(t.type===hn){let n=[];t.negate&&n.push("negate: true"),t.groupId&&n.push(`groupId: ${r(t.groupId)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return`indentIfBreak(${e(t.contents)}${i})`}if(t.type===ln){let n=[];t.break&&"propagated"!==t.break&&n.push("shouldBreak: true"),t.id&&n.push(`id: ${r(t.id)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return t.expandedStates?`conditionalGroup([${t.expandedStates.map(t=>e(t)).join(",")}]${i})`:`group(${e(t.contents)}${i})`}if(t.type===un)return`fill([${t.parts.map(t=>e(t)).join(", ")}])`;if(t.type===dn)return"lineSuffix("+e(t.contents)+")";if(t.type===fn)return"lineSuffixBoundary";if(t.type===mn)return`label(${JSON.stringify(t.label)}, ${e(t.contents)})`;if(t.type===rn)return"cursor";throw new Error("Unknown doc type "+t.type)}(er(e));function r(e){if("symbol"!=typeof e)return JSON.stringify(String(e));if(e in t)return t[e];let r=e.description||"symbol";for(let i=0;;i++){let s=r+(i>0?` #${i}`:"");if(!n.has(s))return n.add(s),t[e]=`Symbol.for(${JSON.stringify(s)})`}}}(e),{formatted:r}=await Es(n,{...t,parser:"__js_expression"});return r}),printToDoc:Us(async function(e,t){t=await Ji(t);let{ast:n}=await ts(e,t);return t.cursorOffset>=0&&(t={...t,...ss(n,t)}),ns(n,t)}),printDocToString:Us(async function(e,t){return fr(e,await Ji(t))})},js=Object.defineProperty;((e,t)=>{for(var n in t)js(e,n,{get:t[n],enumerable:!0})})({},{builders:()=>Jo,printer:()=>ea,utils:()=>ta});var zs="string",Xs="array",Ks="cursor",Ys="indent",qs="align",Qs="trim",Zs="group",Js="fill",eo="if-break",to="indent-if-break",no="line-suffix",ro="line-suffix-boundary",io="line",so="label",oo="break-parent",ao=new Set([Ks,Ys,qs,Qs,Zs,Js,eo,to,no,ro,io,so,oo]),lo=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},uo=function(e){if("string"==typeof e)return zs;if(Array.isArray(e))return Xs;if(!e)return;const{type:t}=e;return ao.has(t)?t:void 0};var co=class extends Error{name="InvalidDocError";constructor(e){super(function(e){const t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(uo(e))throw new Error("doc is valid.");const n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;const r=(i=[...ao].map(e=>`'${e}'`),new Intl.ListFormat("en-US",{type:"disjunction"}).format(i));var i;return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},ho={},fo=function(e,t,n,r){const i=[e];for(;i.length>0;){const e=i.pop();if(e===ho){n(i.pop());continue}n&&i.push(e,ho);const s=uo(e);if(!s)throw new co(e);if(!1!==(null==t?void 0:t(e)))switch(s){case Xs:case Js:{const t=s===Xs?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case eo:i.push(e.flatContents,e.breakContents);break;case Zs:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case qs:case Ys:case to:case so:case no:i.push(e.contents);break;case zs:case Ks:case Qs:case ro:case io:case oo:break;default:throw new co(e)}}};function po(e,t){if("string"==typeof e)return t(e);const n=new Map;return function e(r){if(n.has(r))return n.get(r);const i=function(n){switch(uo(n)){case Xs:return t(n.map(e));case Js:return t({...n,parts:n.parts.map(e)});case eo:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case Zs:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case qs:case Ys:case to:case so:case no:return t({...n,contents:e(n.contents)});case zs:case Ks:case Qs:case ro:case io:case oo:return t(n);default:throw new co(n)}}(r);return n.set(r,i),i}(e)}function mo(e,t,n){let r=n,i=!1;return fo(e,function(e){if(i)return!1;const n=t(e);void 0!==n&&(i=!0,r=n)}),r}function go(e){return!(e.type!==Zs||!e.break)||!(e.type!==io||!e.hard)||e.type===oo||void 0}function Eo(e){if(e.length>0){const t=lo(!1,e,-1);t.expandedStates||t.break||(t.break="propagated")}return null}function vo(e){return e.type!==io||e.hard?e.type===eo?e.flatContents:e:e.soft?"":" "}function Co(e){for(e=[...e];e.length>=2&&lo(!1,e,-2).type===io&&lo(!1,e,-1).type===oo;)e.length-=2;if(e.length>0){const t=Do(lo(!1,e,-1));e[e.length-1]=t}return e}function Do(e){switch(uo(e)){case Ys:case to:case Zs:case no:case so:{const t=Do(e.contents);return{...e,contents:t}}case eo:return{...e,breakContents:Do(e.breakContents),flatContents:Do(e.flatContents)};case Js:return{...e,parts:Co(e.parts)};case Xs:return Co(e);case zs:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return t{},_o=Ao,yo=Ao,bo=Ao;function To(e){return _o(e),{type:Ys,contents:e}}function Ro(e,t){return _o(t),{type:qs,contents:t,n:e}}function xo(e,t={}){return _o(e),yo(t.expandedStates,!0),{type:Zs,id:t.id,contents:e,break:Boolean(t.shouldBreak),expandedStates:t.expandedStates}}var wo={type:ro},Fo={type:oo},No={type:Qs},Lo={type:io,hard:!0},Oo={type:io,hard:!0,literal:!0},Io={type:io},ko={type:io,soft:!0},Mo=[Lo,Fo],Po=[Oo,Fo],Bo={type:Ks};function Uo(e,t){_o(e),yo(t);const n=[];for(let r=0;r{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Go=e=>{return!(12288===(t=e)||t>=65281&&t<=65376||t>=65504&&t<=65510||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e));var t},Vo=/[^\x20-\x7F]/u,Wo=function(e){if(!e)return 0;if(!Vo.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(const n of e){const e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=Go(e)?1:2)}return t},Ho=Symbol("MODE_BREAK"),jo=Symbol("MODE_FLAT"),zo=Symbol("cursor"),Xo=Symbol("DOC_FILL_PRINTED_LENGTH");function Ko(e,t){return qo(e,{type:"indent"},t)}function Yo(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?qo(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:qo(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function qo(e,t,n){const r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t];let i="",s=0,o=0,a=0;for(const e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function Qo(e){let t=0,n=0,r=e.length;e:for(;r--;){const i=e[r];if(i!==zo)for(let n=i.length-1;n>=0;n--){const s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(zo);return t}function Zo(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length;const a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}const{mode:e,doc:u}=a.pop(),c=uo(u);switch(c){case zs:l.push(u),n-=Wo(u);break;case Xs:case Js:{const t=c===Xs?u:u.parts,n=u[Xo]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case Ys:case qs:case to:case so:a.push({mode:e,doc:u.contents});break;case Qs:n+=Qo(l);break;case Zs:{if(s&&u.break)return!1;const t=u.break?Ho:e,n=u.expandedStates&&t===Ho?lo(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case eo:{const t=(u.groupId?i[u.groupId]||jo:e)===Ho?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case io:if(e===Ho||u.hard)return!0;u.soft||(l.push(" "),n--);break;case no:r=!0;break;case ro:if(r)return!1}}return!1}var Jo={join:Uo,line:Io,softline:ko,hardline:Mo,literalline:Po,group:xo,conditionalGroup:function(e,t){return xo(e[0],{...t,expandedStates:e})},fill:function(e){return bo(e),{type:Js,parts:e}},lineSuffix:function(e){return _o(e),{type:no,contents:e}},lineSuffixBoundary:wo,cursor:Bo,breakParent:Fo,ifBreak:function(e,t="",n={}){return _o(e),""!==t&&_o(t),{type:eo,breakContents:e,flatContents:t,groupId:n.groupId}},trim:No,indent:To,indentIfBreak:function(e,t){return _o(e),{type:to,contents:e,groupId:t.groupId,negate:t.negate}},align:Ro,addAlignmentToDoc:function(e,t,n){_o(e);let r=e;if(t>0){for(let e=0;ee},ea={printDocToString:function(e,t){const n={},r=t.printWidth,i=function(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}(t.endOfLine);let s=0;const o=[{ind:{value:"",length:0,queue:[]},mode:Ho,doc:e}],a=[];let l=!1;const u=[];let c=0;for(function(e){const t=new Set,n=[];fo(e,function(e){if(e.type===oo&&Eo(n),e.type===Zs){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===Zs&&n.pop().break&&Eo(n)},!0)}(e);o.length>0;){const{ind:e,mode:h,doc:d}=o.pop();switch(uo(d)){case zs:{const e="\n"!==i?$o(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=Wo(e));break}case Xs:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case Ks:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(zo),c++;break;case Ys:o.push({ind:Ko(e,t),mode:h,doc:d.contents});break;case qs:o.push({ind:Yo(e,d.n,t),mode:h,doc:d.contents});break;case Qs:s-=Qo(a);break;case Zs:switch(h){case jo:if(!l){o.push({ind:e,mode:d.break?Ho:jo,doc:d.contents});break}case Ho:{l=!1;const t={ind:e,mode:jo,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&Zo(t,o,i,a,n))o.push(t);else if(d.expandedStates){const t=lo(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:Ho,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:Ho,doc:t});break}{const t=d.expandedStates[r],s={ind:e,mode:jo,doc:t};if(Zo(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:Ho,doc:d.contents});break}}d.id&&(n[d.id]=lo(!1,o,-1).mode);break;case Js:{const t=r-s,i=d[Xo]??0,{parts:a}=d,l=a.length-i;if(0===l)break;const c=a[i+0],f=a[i+1],p={ind:e,mode:jo,doc:c},m={ind:e,mode:Ho,doc:c},g=Zo(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}const E={ind:e,mode:jo,doc:f},v={ind:e,mode:Ho,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}const C=a[i+2],D={ind:e,mode:h,doc:{...d,[Xo]:i+2}};Zo({ind:e,mode:jo,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case eo:case to:{const t=d.groupId?n[d.groupId]:h;if(t===Ho){const t=d.type===eo?d.breakContents:d.negate?d.contents:To(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===jo){const t=d.type===eo?d.flatContents:d.negate?To(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case no:u.push({ind:e,mode:h,doc:d.contents});break;case ro:u.length>0&&o.push({ind:e,mode:h,doc:Lo});break;case io:switch(h){case jo:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case Ho:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=Qo(a),a.push(i+e.value),s=e.length)}break;case so:o.push({ind:e,mode:h,doc:d.contents});break;case oo:break;default:throw new co(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}const h=a.indexOf(zo);if(-1!==h){const e=a.indexOf(zo,h+1);if(-1===e)return{formatted:a.filter(e=>e!==zo).join("")};const t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}},ta={willBreak:function(e){return mo(e,go,!1)},traverseDoc:fo,findInDoc:mo,mapDoc:po,removeLines:function(e){return po(e,vo)},stripTrailingHardline:function(e){return Do(function(e){return po(e,e=>function(e){switch(uo(e)){case Js:if(e.parts.every(e=>""===e))return"";break;case Zs:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===Zs&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case qs:case Ys:case to:case no:if(!e.contents)return"";break;case eo:if(!e.flatContents&&!e.breakContents)return"";break;case Xs:{const t=[];for(const n of e){if(!n)continue;const[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof lo(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case zs:case Ks:case Qs:case ro:case io:case so:case oo:break;default:throw new co(e)}return e}(e))}(e))},replaceEndOfLine:function(e,t=Po){return po(e,e=>"string"==typeof e?Uo(t,e.split("\n")):e)},canBreak:function(e){return mo(e,So,!1)}};function na(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}class ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class ia extends ra{constructor(e){super([]),this.idx=1,Object.assign(this,ma(e))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class sa extends ra{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ma(e))}}class oa extends ra{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ma(e))}}class aa extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class la extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ua extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ca extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ha extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class da extends ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ma(e))}}class fa{constructor(e){this.idx=1,Object.assign(this,ma(e))}accept(e){e.visit(this)}}function pa(e){function t(e){return e.map(pa)}if(e instanceof ia){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return"string"==typeof e.label&&(t.label=e.label),t}if(e instanceof oa)return{type:"Alternative",definition:t(e.definition)};if(e instanceof aa)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof la)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof ua)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ha)return{type:"RepetitionWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ca)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof da)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof fa){const t={type:"Terminal",name:e.terminalType.name,label:(n=e.terminalType,"string"==typeof(r=n).LABEL&&""!==r.LABEL?n.LABEL:n.name),idx:e.idx};"string"==typeof e.label&&(t.terminalLabel=e.label);const i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=i instanceof RegExp?i.source:i),t}if(e instanceof sa)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match");var n,r}function ma(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}class ga{visit(e){const t=e;switch(t.constructor){case ia:return this.visitNonTerminal(t);case oa:return this.visitAlternative(t);case aa:return this.visitOption(t);case la:return this.visitRepetitionMandatory(t);case ua:return this.visitRepetitionMandatoryWithSeparator(t);case ha:return this.visitRepetitionWithSeparator(t);case ca:return this.visitRepetition(t);case da:return this.visitAlternation(t);case fa:return this.visitTerminal(t);case sa:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Ea(e,t=[]){return!!(e instanceof aa||e instanceof ca||e instanceof ha)||(e instanceof da?e.definition.some(e=>Ea(e,t)):!(e instanceof ia&&t.includes(e))&&e instanceof ra&&(e instanceof ia&&t.push(e),e.definition.every(e=>Ea(e,t))))}function va(e){if(e instanceof ia)return"SUBRULE";if(e instanceof aa)return"OPTION";if(e instanceof da)return"OR";if(e instanceof la)return"AT_LEAST_ONE";if(e instanceof ua)return"AT_LEAST_ONE_SEP";if(e instanceof ha)return"MANY_SEP";if(e instanceof ca)return"MANY";if(e instanceof fa)return"CONSUME";throw Error("non exhaustive match")}class Ca{walk(e,t=[]){e.definition.forEach((n,r)=>{const i=e.definition.slice(r+1);if(n instanceof ia)this.walkProdRef(n,i,t);else if(n instanceof fa)this.walkTerminal(n,i,t);else if(n instanceof oa)this.walkFlat(n,i,t);else if(n instanceof aa)this.walkOption(n,i,t);else if(n instanceof la)this.walkAtLeastOne(n,i,t);else if(n instanceof ua)this.walkAtLeastOneSep(n,i,t);else if(n instanceof ha)this.walkManySep(n,i,t);else if(n instanceof ca)this.walkMany(n,i,t);else{if(!(n instanceof da))throw Error("non exhaustive match");this.walkOr(n,i,t)}})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);e.definition.forEach(e=>{const t=new oa({definition:[e]});this.walk(t,r)})}}function Da(e,t,n){return[new aa({definition:[new fa({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Sa(e){if(e instanceof ia)return Sa(e.referencedRule);if(e instanceof fa)return[e.terminalType];if(function(e){return e instanceof oa||e instanceof aa||e instanceof ca||e instanceof la||e instanceof ua||e instanceof ha||e instanceof fa||e instanceof sa}(e))return function(e){let t=[];const n=e.definition;let r,i=0,s=n.length>i,o=!0;for(;s&&o;)r=n[i],o=Ea(r),t=t.concat(Sa(r)),i+=1,s=n.length>i;return[...new Set(t)]}(e);if(function(e){return e instanceof da}(e))return function(e){const t=e.definition.map(e=>Sa(e));return[...new Set(t.flat())]}(e);throw Error("non exhaustive match")}const Aa="_~IN~_";class _a extends Ca{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=(i=e.referencedRule,s=e.idx,i.name+s+Aa+this.topProd.name);var i,s;const o=t.concat(n),a=Sa(new oa({definition:o}));this.follows[r]=a}}function ya(e){return e.charCodeAt(0)}function ba(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function Ta(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t],e[t]=!0}function Ra(e){if(void 0===e)throw Error("Internal Error - Should never get here!");return!0}function xa(){throw Error("Internal Error - Should never get here!")}function wa(e){return"Character"===e.type}const Fa=[];for(let e=ya("0");e<=ya("9");e++)Fa.push(e);const Na=[ya("_")].concat(Fa);for(let e=ya("a");e<=ya("z");e++)Na.push(e);for(let e=ya("A");e<=ya("Z");e++)Na.push(e);const La=[ya(" "),ya("\f"),ya("\n"),ya("\r"),ya("\t"),ya("\v"),ya("\t"),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya("\u2028"),ya("\u2029"),ya(" "),ya(" "),ya(" "),ya("\ufeff")],Oa=/[0-9a-fA-F]/,Ia=/[0-9]/,ka=/[1-9]/;class Ma{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}function Pa(e){console&&console.error&&console.error(`Error: ${e}`)}function Ba(e){console&&console.warn&&console.warn(`Warning: ${e}`)}let Ua={};const $a=new class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Ta(n,"global");break;case"i":Ta(n,"ignoreCase");break;case"m":Ta(n,"multiLine");break;case"u":Ta(n,"unicode");break;case"y":Ta(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":let t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}}Ra(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return xa()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;Ra(t)}if(!0!==e||void 0!==t)return Ra(t)?("?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t):void 0}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),Ra(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):xa()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ya("\n"),ya("\r"),ya("\u2028"),ya("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=Fa;break;case"D":e=Fa,t=!0;break;case"s":e=La;break;case"S":e=La,t=!0;break;case"w":e=Na;break;case"W":e=Na,t=!0}return Ra(e)?{type:"Set",value:e,complement:t}:xa()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ya("\f");break;case"n":e=ya("\n");break;case"r":e=ya("\r");break;case"t":e=ya("\t");break;case"v":e=ya("\v")}return Ra(e)?{type:"Character",value:e}:xa()}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:ya("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:ya(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:ya(this.popChar())}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const t=this.classAtom();if(t.type,wa(t)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,wa(n)){if(n.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};function Ga(e){const t=e.toString();if(Ua.hasOwnProperty(t))return Ua[t];{const e=$a.pattern(t);return Ua[t]=e,e}}const Va="Complement Sets are not supported for first char optimization",Wa='Unable to use "first char" lexer optimizations:\n';function Ha(e,t=!1){try{const t=Ga(e);return ja(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===Va)t&&Ba(`${Wa}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),Pa(`${Wa}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function ja(e,t,n){switch(e.type){case"Disjunction":for(let r=0;r{if("number"==typeof e)za(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)za(e,t,n);else{for(let e=r.from;e<=r.to&&e=ul){const e=r.from>=ul?r.from:ul,n=r.to,i=hl(e),s=hl(n);for(let e=i;e<=s;e++)t[e]=e}}}});break;case"Group":ja(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}const o=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===Ka(s)||"Group"!==s.type&&!1===o)break}break;default:throw Error("non exhaustive match!")}return Object.values(t)}function za(e,t,n){const r=hl(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=hl(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=hl(e.charCodeAt(0));t[n]=n}}}(e,t)}function Xa(e,t){return e.value.find(e=>{if("number"==typeof e)return t.includes(e);{const n=e;return void 0!==t.find(e=>n.from<=e&&e<=n.to)}})}function Ka(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(Array.isArray(e.value)?e.value.every(Ka):Ka(e.value))}class Ya extends Ma{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e);case"Lookbehind":return void this.visitLookbehind(e);case"NegativeLookbehind":return void this.visitNegativeLookbehind(e)}super.visitChildren(e)}}visitCharacter(e){this.targetCharCodes.includes(e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===Xa(e,this.targetCharCodes)&&(this.found=!0):void 0!==Xa(e,this.targetCharCodes)&&(this.found=!0)}}function qa(e,t){if(t instanceof RegExp){const n=Ga(t),r=new Ya(e);return r.visit(n),r.found}for(const n of t){const t=n.charCodeAt(0);if(e.includes(t))return!0}return!1}const Qa="PATTERN",Za="defaultMode",Ja="modes";const el=/[^\\][$]/,tl=/[^\\[][\^]|^\^/;function nl(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function rl(e){const t=e.PATTERN;if(t instanceof RegExp)return!1;if("function"==typeof t)return!0;if(Object.hasOwn(t,"exec"))return!0;if("string"==typeof t)return!1;throw Error("non exhaustive match")}function il(e){return"string"==typeof e&&1===e.length&&e.charCodeAt(0)}const sl={test:function(e){const t=e.length;for(let n=this.lastIndex;n"string"==typeof e?e.charCodeAt(0):e)}function ll(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const ul=256;let cl=[];function hl(e){return ee.CATEGORIES).flat().filter(Boolean);const e=n.filter(e=>!t.includes(e));t=t.concat(e),0===e.length?r=!1:n=e}return t}(e);!function(e){e.forEach(e=>{var t;Cl(e)||(gl[ml]=e,e.tokenTypeIdx=ml++),Dl(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Dl(e)||(e.CATEGORIES=[]),t=e,Object.hasOwn(null!=t?t:{},"categoryMatches")||(e.categoryMatches=[]),function(e){return Object.hasOwn(null!=e?e:{},"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})})}(t),function(e){e.forEach(e=>{vl([],e)})}(t),function(e){e.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(t=>{e.categoryMatches.push(gl[t].tokenTypeIdx)})})}(t),t.forEach(e=>{e.isParent=e.categoryMatches.length>0})}function vl(e,t){e.forEach(e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),t.CATEGORIES.forEach(n=>{const r=e.concat(t);r.includes(n)||vl(r,n)})}function Cl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}function Dl(e){return Object.hasOwn(null!=e?e:{},"CATEGORIES")}function Sl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}var Al;!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"}(Al||(Al={}));const _l={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:{buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i,s)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`},traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(_l);class yl{constructor(e,t=_l){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=Object.assign({},_l,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===_l.lineTerminatorsPattern)this.config.lineTerminatorsPattern=sl;else if(this.config.lineTerminatorCharacters===_l.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Array.isArray(e)?n={modes:{defaultMode:[...e]},defaultMode:Za}:(r=!1,n=Object.assign({},e))}),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){const t=[];return Object.hasOwn(e,Za)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+Za+"> property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(e,Ja)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(e,Ja)&&Object.hasOwn(e,Za)&&!Object.hasOwn(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${Za}: <${e.defaultMode}>which does not exist\n`,type:Al.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(e,Ja)&&Object.keys(e.modes).forEach(n=>{const r=e.modes[n];r.forEach((e,i)=>{void 0===e?t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:Al.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(e,"LONGER_ALT")&&(Array.isArray(e.LONGER_ALT)?e.LONGER_ALT:[e.LONGER_ALT]).forEach(i=>{void 0===i||r.includes(i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${e.name}> outside of mode <${n}>\n`,type:Al.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(function(e,t,n){const r=[];let i=!1;const s=Object.values(e.modes||{}).flat().filter(Boolean).filter(e=>e[Qa]!==yl.NA),o=al(n);return t&&s.forEach(e=>{const t=ol(e,o);if(!1!==t){const n=function(e,t){if(t.issue===Al.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Al.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else Object.hasOwn(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):qa(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:Al.NO_LINE_BREAKS_FLAGS}),r}(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},Object.entries(n.modes).forEach(([e,t])=>{n.modes[e]=t.filter(e=>void 0!==e)});const i=Object.keys(n.modes);if(Object.entries(n.modes).forEach(([e,n])=>{this.TRACE_INIT(`Mode: <${e}> processing`,()=>{if(this.modes.push(e),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e,t){let n=[];const r=function(e){const t=e.filter(e=>!Object.hasOwn(e,Qa));return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:Al.MISSING_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(e);n=n.concat(r.errors);const i=function(e){const t=e.filter(e=>{const t=e[Qa];return!(t instanceof RegExp||"function"==typeof t||Object.hasOwn(t,"exec")||"string"==typeof t)});return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Al.INVALID_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=e.filter(e=>e[Qa]instanceof RegExp);return t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return el.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return tl.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){return e.filter(e=>{const t=e[Qa];return t instanceof RegExp&&(t.multiline||t.global)}).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Al.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){const t=[];let n=e.map(n=>e.reduce((e,r)=>(n.PATTERN.source!==r.PATTERN.source||t.includes(r)||r.PATTERN===yl.NA||(t.push(r),e.push(r)),e),[]));return n=n.filter(Boolean),n.filter(e=>e.length>1).map(e=>{const t=e.map(e=>e.name);return{message:`The same RegExp pattern ->${e[0].PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:Al.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}(n)),t=t.concat(function(e){return e.filter(e=>e.PATTERN.test("")).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:Al.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}(n)),t}(s)),n=n.concat(function(e){const t=e.filter(e=>{if(!Object.hasOwn(e,"GROUP"))return!1;const t=e.GROUP;return t!==yl.SKIPPED&&t!==yl.NA&&!("string"==typeof t)});return t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Al.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}(s)),n=n.concat(function(e,t){return e.filter(e=>void 0!==e.PUSH_MODE&&!t.includes(e.PUSH_MODE)).map(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:Al.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}(s,t)),n=n.concat(function(e){const t=[],n=e.reduce((e,t,n)=>{const r=t.PATTERN;return r===yl.NA||("string"==typeof r?e.push({str:r,idx:n,tokenType:t}):r instanceof RegExp&&(i=r,void 0===[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(e=>-1!==i.source.indexOf(e)))&&e.push({str:r.source,idx:n,tokenType:t})),e;var i},[]);return e.forEach((e,r)=>{n.forEach(({str:n,idx:i,tokenType:s})=>{if(r${s.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:Al.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}})}),t}(s)),n}(n,i))}),0===this.lexerDefinitionErrors.length){let r;El(n),this.TRACE_INIT("analyzeTokenTypes",()=>{r=function(e,t){const n=(t=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()},t)).tracer;let r;n("initCharCodeToOptimizedIndexMap",()=>{!function(){if(0===cl.length){cl=new Array(65536);for(let e=0;e<65536;e++)cl[e]=e>255?255+~~(e/255):e}}()}),n("Reject Lexer.NA",()=>{r=e.filter(e=>e[Qa]!==yl.NA)});let i,s,o,a,l,u,c,h,d,f,p,m=!1;n("Transform Patterns",()=>{m=!1,i=r.map(e=>{const t=e[Qa];if(t instanceof RegExp){const e=t.source;return 1!==e.length||"^"===e||"$"===e||"."===e||t.ignoreCase?2!==e.length||"\\"!==e[0]||["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(e[1])?nl(t):e[1]:e}if("function"==typeof t)return m=!0,{exec:t};if("object"==typeof t)return m=!0,t;if("string"==typeof t){if(1===t.length)return t;{const e=t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return nl(new RegExp(e))}}throw Error("non exhaustive match")})}),n("misc mapping",()=>{s=r.map(e=>e.tokenTypeIdx),o=r.map(e=>{const t=e.GROUP;if(t!==yl.SKIPPED){if("string"==typeof t)return t;if(void 0===t)return!1;throw Error("non exhaustive match")}}),a=r.map(e=>{const t=e.LONGER_ALT;if(t)return Array.isArray(t)?t.map(e=>r.indexOf(e)):[r.indexOf(t)]}),l=r.map(e=>e.PUSH_MODE),u=r.map(e=>Object.hasOwn(e,"POP_MODE"))}),n("Line Terminator Handling",()=>{const e=al(t.lineTerminatorCharacters);c=r.map(e=>!1),"onlyOffset"!==t.positionTracking&&(c=r.map(t=>Object.hasOwn(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===ol(t,e)&&qa(e,t.PATTERN)))}),n("Misc Mapping #2",()=>{h=r.map(rl),d=i.map(il),f=r.reduce((e,t)=>{const n=t.GROUP;return"string"==typeof n&&n!==yl.SKIPPED&&(e[n]=[]),e},{}),p=i.map((e,t)=>({pattern:i[t],longerAlt:a[t],canLineTerminator:c[t],isCustom:h[t],short:d[t],group:o[t],push:l[t],pop:u[t],tokenTypeIdx:s[t],tokenType:r[t]}))});let g=!0,E=[];return t.safeMode||n("First Char Optimization",()=>{E=r.reduce((e,n,r)=>{if("string"==typeof n.PATTERN){const t=hl(n.PATTERN.charCodeAt(0));ll(e,t,p[r])}else if(Array.isArray(n.START_CHARS_HINT)){let t;n.START_CHARS_HINT.forEach(n=>{const i=hl("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,ll(e,i,p[r]))})}else if(n.PATTERN instanceof RegExp)if(n.PATTERN.unicode)g=!1,t.ensureOptimizations&&Pa(`${Wa}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=Ha(n.PATTERN,t.ensureOptimizations);0===i.length&&(g=!1),i.forEach(t=>{ll(e,t,p[r])})}else t.ensureOptimizations&&Pa(`${Wa}\tTokenType: <${n.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return e},[])}),{emptyGroups:f,patternIdxToConfig:p,charCodeToPatternIdxToConfig:E,hasCustom:m,canBeOptimized:g}}(n,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[e]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[e]=r.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[e]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}this.lexerDefinitionWarning.forEach(e=>{Ba(e.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(r&&(this.handleModes=()=>{}),!1===this.trackStartLines&&(this.computeNewColumn=e=>e),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=()=>{}),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const e=Object.entries(this.canModeBeOptimized).reduce((e,[t,n])=>(!1===n&&e.push(t),e),[]);if(t.ensureOptimizations&&e.length>0)throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Ua={}}),this.TRACE_INIT("toFastProperties",()=>{na(this)})})}tokenize(e,t=this.defaultMode){if(this.lexerDefinitionErrors.length>0){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,s,o,a,l,u,c,h,d,f,p,m,g;const E=e,v=E.length;let C=0,D=0;const S=this.hasCustom?0:Math.floor(e.length/10),A=new Array(S),_=[];let y=this.trackStartLines?1:void 0,b=this.trackStartLines?1:void 0;const T=function(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(!Array.isArray(r))throw Error("non exhaustive match");t[n]=[]}),t}(this.emptyGroups),R=this.trackStartLines,x=this.config.lineTerminatorsPattern;let w=0,F=[],N=[];const L=[],O=[];Object.freeze(O);let I=!1;const k=e=>{if(1===L.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);_.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{L.pop();const e=L.at(-1);F=this.patternIdxToConfig[e],N=this.charCodeToPatternIdxToConfig[e],w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}};function M(e){L.push(e),N=this.charCodeToPatternIdxToConfig[e],F=this.patternIdxToConfig[e],w=F.length,w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}let P;M.call(this,t);const B=this.config.recoveryEnabled;for(;Ca.length){a=s,c=s.length,l=u,P=t;break}}}break}}if(-1!==c){if(h=P.group,void 0!==h&&(a=null!==a?a:e.substring(C,C+c),d=P.tokenTypeIdx,f=this.createTokenInstance(a,C,d,P.tokenType,y,b,c),this.handlePayload(f,l),!1===h?D=this.addToken(A,D,f):T[h].push(f)),!0===R&&!0===P.canLineTerminator){let t,n,r=0;x.lastIndex=0;do{a=null!==a?a:e.substring(C,C+c),t=x.test(a),!0===t&&(n=x.lastIndex-1,r++)}while(!0===t);0!==r?(y+=r,b=c-n,this.updateTokenEndLineColumnLocation(f,h,n,r,y,b,c)):b=this.computeNewColumn(b,c)}else b=this.computeNewColumn(b,c);C+=c,this.handleModes(P,k,M,f)}else{const t=C,n=y,i=b;let s=!1===B;for(;!1===s&&C`Expecting ${Tl(e)?`--\x3e ${bl(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o="\nbut found: '"+t[0].image+"'";return r?s+r+o:s+`one of these possible Token sequences:\n${e.reduce((e,t)=>e.concat(t),[]).map(e=>`[${e.map(e=>bl(e)).join(", ")}]`).map((e,t)=>` ${t+1}. ${e}`).join("\n")}`+o},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",s="\nbut found: '"+t[0].image+"'";return n?i+n+s:i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map(e=>`[${e.map(e=>bl(e)).join(",")}]`).join(" ,")}>`+s}};Object.freeze(Bl);const Ul={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},$l={buildDuplicateFoundError(e,t){const n=e.name,r=t[0],i=r.idx,s=va(r),o=(a=r)instanceof fa?a.terminalType.name:a instanceof ia?a.nonTerminalName:"";var a;let l=`->${s}${i>0?i:""}<- ${o?`with argument: ->${o}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,"\n"),l},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=e.prefixPath.map(e=>bl(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=0===e.alternation.idx?"":e.alternation.idx,n=0===e.prefixPath.length;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule,\n`;return r+=n?"These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n":`<${e.prefixPath.map(e=>bl(e)).join(", ")}> may appears as a prefix path in all these alternatives.\n`,r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=va(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${t} --\x3e ${e.leftRecursionPath.map(e=>e.name).concat([t]).join(" --\x3e ")}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof sa?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class Gl extends ga{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:rc.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Vl extends Ca{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){0===this.ruleStack.length?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Wl extends Vl{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const e=t.concat(n),r=new oa({definition:e});this.possibleTokTypes=Sa(r),this.found=!0}}}class Hl extends Ca{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class jl extends Hl{walkMany(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}}class zl extends Hl{walkManySep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}}class Xl extends Hl{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}}class Kl extends Hl{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}}function Yl(e,t,n=[]){n=[...n];let r=[],i=0;function s(s){const o=Yl(s.concat(e.slice(i+1)),t,n);return r.concat(o)}for(;n.length{0!==e.definition.length&&(r=s(e.definition))}),r;if(!(t instanceof fa))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:e.slice(i)}),r}function ql(e,t,n,r){const i=[...n];i.push(e.name);const s=[...r];return s.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:s}}var Ql;function Zl(e){if(e instanceof aa||"Option"===e)return Ql.OPTION;if(e instanceof ca||"Repetition"===e)return Ql.REPETITION;if(e instanceof la||"RepetitionMandatory"===e)return Ql.REPETITION_MANDATORY;if(e instanceof ua||"RepetitionMandatoryWithSeparator"===e)return Ql.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ha||"RepetitionWithSeparator"===e)return Ql.REPETITION_WITH_SEPARATOR;if(e instanceof da||"Alternation"===e)return Ql.ALTERNATION;throw Error("non exhaustive match")}function Jl(e,t,n,r){const i=e.length,s=e.every(e=>e.every(e=>1===e.length));if(t)return function(t){const r=t.map(e=>e.GATE);for(let t=0;te.flat()).reduce((e,t,n)=>(t.forEach(t=>{t.tokenTypeIdx in e||(e[t.tokenTypeIdx]=n),t.categoryMatches.forEach(t=>{Object.hasOwn(e,t)||(e[t]=n)})}),e),{});return function(){const e=this.LA_FAST(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t1===e.length),i=e.length;if(r&&!n){const t=e.flat();if(1===t.length&&0===t[0].categoryMatches.length){const e=t[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===e}}{const e=t.reduce((e,t,n)=>(e[t.tokenTypeIdx]=!0,t.categoryMatches.forEach(t=>{e[t]=!0}),e),[]);return function(){const t=this.LA_FAST(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;nYl([e],1)),r=ru(n.length),i=n.map(e=>{const t={};return e.forEach(e=>{iu(e.partialPath).forEach(e=>{t[e]=!0})}),t});let s=n;for(let e=1;e<=t;e++){const n=s;s=ru(n.length);for(let o=0;o{iu(e.partialPath).forEach(e=>{i[o][e]=!0})})}}}}return r}function au(e,t,n,r){const i=new nu(e,Ql.ALTERNATION,r);return t.accept(i),ou(i.result,n)}function lu(e,t,n,r){const i=new nu(e,n);t.accept(i);const s=i.result,o=new tu(t,e,n).startWalking();return ou([new oa({definition:s}),new oa({definition:o})],r)}function uu(e,t){e:for(let n=0;ne.every(e=>e.every(e=>0===e.categoryMatches.length)))}function hu(e){return`${va(e)}_#_${e.idx}_#_${du(e)}`}function du(e){return e instanceof fa?e.terminalType.name:e instanceof ia?e.nonTerminalName:""}class fu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function pu(e,t,n,r=[]){const i=[],s=mu(t.definition);if(0===s.length)return[];{const t=e.name;s.includes(e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:rc.LEFT_RECURSION,ruleName:t});const o=r.concat([e]),a=s.filter(e=>!o.includes(e)).flatMap(t=>{const i=[...r];return i.push(t),pu(e,t,n,i)});return i.concat(a)}}function mu(e){let t=[];if(0===e.length)return t;const n=e[0];if(n instanceof ia)t.push(n.referencedRule);else if(n instanceof oa||n instanceof aa||n instanceof la||n instanceof ua||n instanceof ha||n instanceof ca)t=t.concat(mu(n.definition));else if(n instanceof da)t=n.definition.map(e=>mu(e.definition)).flat();else if(!(n instanceof fa))throw Error("non exhaustive match");const r=Ea(n),i=e.length>1;if(r&&i){const n=e.slice(1);return t.concat(mu(n))}return t}class gu extends ga{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}class Eu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}const vu="MismatchedTokenException",Cu="NoViableAltException",Du="EarlyExitException",Su="NotAllInputParsedException",Au=[vu,Cu,Du,Su];function _u(e){return Au.includes(e.name)}Object.freeze(Au);class yu extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class bu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=vu}}class Tu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Cu}}class Ru extends yu{constructor(e,t){super(e,t),this.name=Su}}class xu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Du}}const wu={},Fu="InRuleRecoveryException";class Nu extends Error{constructor(e){super(e),this.name=Fu}}function Lu(e,t,n,r,i,s,o){const a=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[a];if(void 0===l){const e=this.getCurrRuleFullName();l=new s(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[a]=l}let u=l.token,c=l.occurrence;const h=l.isEndOfRule;0===this.RULE_STACK_IDX&&h&&void 0===u&&(u=Ml,c=1),void 0!==u&&void 0!==c&&this.shouldInRepetitionRecoveryBeTried(u,c,o)&&this.tryInRepetitionRecovery(e,t,n,u)}const Ou=1024,Iu=1280,ku=1536;function Mu(e,t,n){return n|t|e}class Pu{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:tc.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(0===t.length){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return e.flatMap(e=>pu(e,e,$l))}validateEmptyOrAlternatives(e){return e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.slice(0,-1).flatMap((r,i)=>0===function(e,t,n){const r="EXIT_NONE_TERMINAL",i=[r],s="EXIT_ALTERNATIVE";let o=!1;const a=t.length,l=a-1-1,u=[],c=[];for(c.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});0!==c.length;){const e=c.pop();if(e===s){o&&c.at(-1).idx<=l&&c.pop();continue}const h=e.def,d=e.idx,f=e.ruleStack,p=e.occurrenceStack;if(0===h.length)continue;const m=h[0];if(m===r){const e={idx:d,def:h.slice(1),ruleStack:f.slice(0,-1),occurrenceStack:p.slice(0,-1)};c.push(e)}else if(m instanceof fa)if(d=0;e--){const t={idx:d,def:m.definition[e].definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p};c.push(t),c.push(s)}else if(m instanceof oa)c.push({idx:d,def:m.definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p});else{if(!(m instanceof sa))throw Error("non exhaustive match");c.push(ql(m,d,f,p))}}return u}([r],[],fl).length?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:rc.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}(e,$l))}validateAmbiguousAlternationAlternatives(e,t){return e.flatMap(e=>function(e,t,n){const r=new gu;e.accept(r);let i=r.alternations;i=i.filter(e=>!0!==e.ignoreAmbiguities);return i.flatMap(r=>{const i=r.idx,s=r.maxLookahead||t,o=au(i,e,s,r),a=function(e,t,n,r){const i=[];return e.reduce((n,r,s)=>(!0===t.definition[s].ignoreAmbiguities||r.forEach(r=>{const o=[s];e.forEach((e,n)=>{s!==n&&uu(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&o.push(n)}),o.length>1&&!uu(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]).map(e=>{const i=e.alts.map(e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}(o,r,e,n),l=function(e,t,n,r){const i=e.reduce((e,t,n)=>{const r=t.map(e=>({idx:n,path:e}));return e.concat(r)},[]);return i.flatMap(e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const s=e.idx,o=e.path;return i.filter(e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx{const n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}));var n,r}).map(e=>{const i=[e.idx+1,s+1],o=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})})}(o,r,e,n);return a.concat(l)})}(e,t,$l))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return e.forEach(e=>{const i=new Eu;e.accept(i),i.allProductions.forEach(i=>{const s=Zl(i),o=i.maxLookahead||t;if(0===lu(i.idx,e,s,o)[0].flat().length){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:rc.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}(e,t,$l)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,s){const o=au(e,t,n);return s(o,r,cu(o)?pl:fl,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Jl)}buildLookaheadForOptional(e){return function(e,t,n,r,i,s){const o=lu(e,t,i,n),a=cu(o)?pl:fl;return s(o[0],a,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Zl(e.prodType),eu)}}const Bu=new class extends ga{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function Uu(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset"function"==typeof e.GATE);return s.hasPredicates=o,n.definition.push(s),i.forEach(e=>{const t=new oa({definition:[]});s.definition.push(t),Object.hasOwn(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Object.hasOwn(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),Hu}function Zu(e){return 0===e?"":`${e}`}function Ju(e){if(e<0||e>zu){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${zu+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const ec=Pl(Ml,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ec);const tc=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Bl,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),nc=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var rc,ic,sc;!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(rc||(rc={}));class oc{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",()=>{na(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=function(e){const t=Object.assign({errMsgProvider:Ul},e),n={};return e.rules.forEach(e=>{n[e.name]=e}),function(e,t){const n=new Gl(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(0===n.length&&!1===this.skipValidations){const e=function(e){var t;const n=null!==(t=e.errMsgProvider)&&void 0!==t?t:$l;return function(e,t,n,r){const i=e.flatMap(e=>function(e,t){const n=new fu;e.accept(n);const r=n.allProductions,i=Object.groupBy(r,hu),s=Object.fromEntries(Object.entries(i).filter(([e,t])=>t.length>1));return Object.values(s).map(n=>{const r=n[0],i=t.buildDuplicateFoundError(e,n),s=va(r),o={message:i,type:rc.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:s,occurrence:r.idx},a=du(r);return a&&(o.parameter=a),o})}(e,n)),s=function(e,t,n){const r=[],i=t.map(e=>e.name);return e.forEach(e=>{const t=e.name;if(i.includes(t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:rc.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}(e,t,n),o=e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:rc.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}(e,n)),a=e.flatMap(t=>function(e,t,n,r){const i=[],s=t.reduce((t,n)=>n.name===e.name?t+1:t,0);if(s>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:rc.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n));return i.concat(s,o,a)}(e.rules,e.tokenTypes,n,e.grammarName)}({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:$l,grammarName:t}),n=function(e){return e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}).map(e=>Object.assign({type:rc.CUSTOM_LOOKAHEAD_VALIDATION},e))}({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(e,n)}}),0===this.definitionErrors.length&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const e=function(e){const t={};return e.forEach(e=>{const n=new _a(e).startWalking();Object.assign(t,n)}),t}(Object.values(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!oc.DEFER_DEFINITION_ERRORS_HANDLING&&0!==this.definitionErrors.length)throw e=this.definitionErrors.map(e=>e.message),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initGastRecorder(t),n.initPerformanceTracer(t),Object.hasOwn(t,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=Object.hasOwn(t,"skipValidations")?t.skipValidations:tc.skipValidations}}oc.DEFER_DEFINITION_ERRORS_HANDLING=!1,ic=oc,sc=[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:tc.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Lu)}getTokenToInsert(e){const t=Pl(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let a=!1;const l=this.LA_FAST(1);let u=this.LA_FAST(1);const c=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),n=new bu(t,l,this.LA(0));n.resyncedTokens=o.slice(0,-1),this.SAVE_ERROR(n)};for(;!a;){if(this.tokenMatcher(u,r))return void c();if(n.call(this))return c(),void e.apply(this,t);this.tokenMatcher(u,i)?a=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o))}this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA_FAST(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getNextPossibleTokenTypes(e){const t=e.ruleStack[0],n=this.getGAstProductions()[t];return new Wl(n,e).startWalking()}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new Nu("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(0===t.length)return!1;const n=this.LA_FAST(1);return void 0!==t.find(e=>this.tokenMatcher(n,e))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(t).includes(e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA_FAST(1),n=2;for(;;){const r=e.find(e=>fl(t,e));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(0===this.RULE_STACK_IDX)return wu;const e=this.currRuleShortName,t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK,n=this.RULE_STACK_IDX+1,r=new Array(n);for(let i=0;ithis.getFollowSetFromFollowKey(e)).flat()}getFollowSetFromFollowKey(e){if(e===wu)return[Ml];const t=e.ruleName+e.idxInCallingRule+Aa+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Ml)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA_FAST(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return t.slice(0,-1)}attemptInRepetitionRecovery(e,t,n,r,i,s,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){const e=this.RULE_STACK_IDX+1,t=new Array(e);for(let n=0;n{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:o}=function(e){Bu.reset(),e.accept(Bu);const t=Bu.dslMethods;return Bu.reset(),t}(e);t.forEach(t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${va(t)}${n}`,()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=Mu(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),n.forEach(t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,va(t))}),r.forEach(t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,va(t))}),i.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Ou,"RepetitionMandatory",t.maxLookahead,va(t))}),s.forEach(t=>{this.computeLookaheadFunc(e,t.idx,ku,"RepetitionMandatoryWithSeparator",t.maxLookahead,va(t))}),o.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Iu,"RepetitionWithSeparator",t.maxLookahead,va(t))})})})}computeLookaheadFunc(e,t,n,r,i,s){this.TRACE_INIT(`${s}${0===t?"":t}`,()=>{const s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=Mu(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,s)})}getKeyForAutomaticLookahead(e,t){return Mu(this.currRuleShortName,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:tc.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=$u,this.setNodeLocationFromNode=$u,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Uu,this.setNodeLocationFromNode=Uu,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{}}else this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{}}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA_FAST(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];var r,i,s;i=t,s=e,void 0===(r=n).children[s]?r.children[s]=[i]:r.children[s].push(i),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(void 0===this.baseCstVisitorConstructor){const e=function(e,t){const n=function(){};Gu(n,e+"BaseSemantics");const r={visit:function(e,t){if(Array.isArray(e)&&(e=e[0]),void 0!==e)return this[e.name](e.children,t)},validateVisitor:function(){const e=function(e,t){const n=function(e,t){return t.filter(t=>"function"==typeof e[t]==0).map(t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Wu.MISSING_METHOD,methodName:t})).filter(Boolean)}(e,t);return n}(this,t);if(0!==e.length){const t=e.map(e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(void 0===this.baseCstVisitorWithDefaultsConstructor){const e=function(e,t,n){const r=function(){};Gu(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return t.forEach(e=>{i[e]=Vu}),(r.prototype=i).constructor=r,r}(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):ec}LA_FAST(e){const t=this.currIdx+e;return this.tokVector[t]}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?ec:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=pl,this.subruleIdx=0,this.currRuleShortName=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(Array.isArray(e)){if(0===e.length)throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(Array.isArray(e))this.tokensMap=e.reduce((e,t)=>(e[t.name]=t,e),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(Sl)){const t=Object.values(e.modes).flat(),n=[...new Set(t)];this.tokensMap=n.reduce((e,t)=>(e[t.name]=t,e),{})}else{if("object"!=typeof e||null===e)throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=Object.assign({},e)}this.tokensMap.EOF=Ml;const n=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every(e=>{var t;return 0==(null===(t=e.categoryMatches)||void 0===t?void 0:t.length)});this.tokenMatcher=n?pl:fl,El(Object.values(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:nc.resyncEnabled,i=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:nc.recoveryValueFunc,s=this.ruleShortNameIdx<<12;let o;return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,o=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...t){this.onBeforeParse(e);try{return o.apply(this,t)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:t,coreRule:o})}invokeRuleCatch(e,t,n){const r=0===this.RULE_STACK_IDX,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(_u(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(Ou,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,Ou,e,Xl)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(ku,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Kl],t,ku,e,Kl)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let s=!0;for(;!0===i.call(this)&&!0===s;)s=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,jl,s)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(Iu,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,zl],t,Iu,e,zl)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,ku,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=Array.isArray(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX]),this.cstFinallyStateUpdate()}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.coreRule.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw _u(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA_FAST(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new bu(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===Fu?n:e}}}saveRecogState(){const e=this.errors,t=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);const t=e.RULE_STACK;for(let e=0;e=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX])}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=n,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ml)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let e=0;e${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:rc.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){var n;const r=null!==(n=e.coreRule)&&void 0!==n?n:e;return function(){this.isBackTrackingStack.push(1);const e=this.saveRecogState();try{return r.apply(this,t),!0}catch(e){if(_u(e))return!1;throw e}finally{this.reloadRecogState(e),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Object.values(this.gastProductionsCache).map(pa)}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:tc.errorMessageProvider}SAVE_ERROR(e){if(_u(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=lu(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],s=[];for(let e=1;e<=this.maxLookahead;e++)s.push(this.LA(e));const o=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:s,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new xu(o,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=au(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));const s=this.LA(0),o=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:s,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Tu(o,this.LA(1),s))}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const n=t>0?t:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return ec}topLevelRuleRecord(e,t){try{const n=new sa({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}}optionInternalRecord(e,t){return qu.call(this,aa,e,t)}atLeastOneInternalRecord(e,t){qu.call(this,la,t,e)}atLeastOneSepFirstInternalRecord(e,t){qu.call(this,ua,t,e,ju)}manyInternalRecord(e,t){qu.call(this,ca,t,e)}manySepFirstInternalRecord(e,t){qu.call(this,ha,t,e,ju)}orInternalRecord(e,t){return Qu.call(this,e,t)}subruleInternalRecord(e,t,n){if(Ju(t),!e||!Object.hasOwn(e,"ruleName")){const n=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=e.ruleName,s=new ia({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(s),this.outputCst?Yu:Hu}consumeInternalRecord(e,t,n){if(Ju(t),!Cl(e)){const n=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=new fa({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),Ku}},class{initPerformanceTracer(e){if(Object.hasOwn(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=tc.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()}}],sc.forEach(e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach(n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(ic.prototype,n,r):ic.prototype[n]=e.prototype[n]})});class ac extends oc{constructor(e,t=tc){const n=Object.assign({},t);n.outputCst=!1,super(e,n)}}function lc(e){return void 0!==e.lineNoCont?e.lineNoCont:e.startLine}class uc{visit(e){return e&&this[e.kind](e)}arraySpecifier(e){this.visit(e.size)}binaryExpression(e){this.visit(e.lhs),this.visit(e.rhs)}methodCall(e){this.visit(e.on),this.visit(e.functionCall)}functionCall(e){this.visit(e.callee);for(const t of e.args)this.visit(t)}arrayAccess(e){this.visit(e.on),this.visit(e.index)}translationUnit(e){for(const t of e.declarations)this.visit(t)}assignmentExpression(e){this.visit(e.lhs),this.visit(e.rhs)}fieldAccess(e){this.visit(e.on)}conditionalExpression(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}postfixExpression(e){this.visit(e.on)}commaExpression(e){this.visit(e.lhs),this.visit(e.rhs)}unaryExpression(e){this.visit(e.on)}functionDefinition(e){this.visit(e.returnType);for(const t of e.params)this.visit(t);this.visit(e.body)}functionPrototype(e){this.visit(e.returnType);for(const t of e.params)this.visit(t)}parameterDeclaration(e){this.visit(e.arraySpecifier),this.visit(e.typeSpecifier)}typeSpecifier(e){hc(e.typeSpecifierNonArray)&&this.visit(e.typeSpecifierNonArray),this.visit(e.arraySpecifier)}compoundStatement(e){for(const t of e.statements)this.visit(t)}returnStatement(e){this.visit(e.what)}continueStatement(e){}breakStatement(e){}discardStatement(e){}declarator(e){this.visit(e.arraySpecifier),this.visit(e.init)}doWhileStatement(e){this.visit(e.statement),this.visit(e.conditionExpression)}whileStatement(e){this.visit(e.conditionExpression),this.visit(e.statement)}forStatement(e){this.visit(e.initExpression),this.visit(e.conditionExpression),this.visit(e.loopExpression),this.visit(e.statement)}expressionStatement(e){this.visit(e.expression)}initDeclaratorListDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}precisionDeclaration(e){this.visit(e.typeSpecifierNoPrec)}selectionStatement(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}storageQualifier(e){}switchStatement(e){this.visit(e.initExpression);for(const t of e.cases)this.visit(t)}caseLabel(e){this.visit(e.case_)}caseBlock(e){this.visit(e.caseLabel);for(const t of e.statements)this.visit(t)}fullySpecifiedType(e){this.visit(e.typeQualifier),this.visit(e.typeSpecifier)}typeQualifier(e){this.visit(e.storageQualifier),this.visit(e.layoutQualifier)}structSpecifier(e){for(const t of e.declarations)this.visit(t)}layoutQualifier(e){}invariantDeclaration(e){}structDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}variableExpression(e){}constantExpression(e){}uniformBlock(e){this.visit(e.typeQualifier);for(const t of e.declarations)this.visit(t);this.visit(e.arraySpecifier)}ppDefine(e){this.visit(e.node)}ppDir(e){}ppExtension(e){}ppCall(e){}ppPragma(e){}}function cc(e){return"tokenType"in e}function hc(e){return"kind"in e}function dc(e,t){const n=e.split("\n"),r=t.startLine,i=t.endLine;return"./src/compiler.lambda:"+r+":"+(t.startColumn-1)+"\n"+n.map((e,t)=>[t+1,e]).slice(r-2,i+2).map(([e,n])=>{var s,o,a;return e>=r&&e<=i&&(s=n,o=6+(r===e?t.startColumn-1:0),a=6+(i===e?t.endColumn:n.length),n=s+"\n"+"-".repeat(o)+"^".repeat(a-o)),(""+e).padStart(5)+" "+n}).join("\n")}const fc=["active","asm","atomic_uint","attribute","cast","class","coherent","common","double","dvec2","dvec3","dvec4","enum","extern","external","filter","fixed","fvec2","fvec3","fvec4","goto","half","hvec2","hvec3","hvec4","iimage1D","iimage1DArray","iimage2D","iimage2DArray","iimage3D","iimageBuffer","iimageCube","image1D","image1DArray","image2D","image2DArray","image3D","imageBuffer","imageCube","inline","input","interface","isampler1D","isampler1DArray","isampler2DMS","isampler2DMSArray","isampler2DRect","isamplerBuffer","long","namespace","noinline","noperspective","output","partition","patch","public","readonly","resource","restrict","sample","sampler1D","sampler1DArray","sampler1DArrayShadow","sampler1DShadow","sampler2DMS","sampler2DMSArray","sampler2DRect","sampler2DRectShadow","sampler3DRect","samplerBuffer","short","sizeof","static","subroutine","superp","template","this","typedef","uimage1D","uimage1DArray","uimage2D","uimage2DArray","uimage3D","uimageBuffer","uimageCube","union","unsigned","usampler1D","usampler1DArray","usampler2DMS","usampler2DMSArray","usampler2DRect","usamplerBuffer","using","volatile","volatile","writeonly"];var pc;!function(e){e.ASSIGN_OP=kl({name:"ASSIGN_OP",pattern:yl.NA}),e.UNARY_OP=kl({name:"UNARY_OP",pattern:yl.NA}),e.POSTFIX_OP=kl({name:"POSTFIX_OP",pattern:yl.NA}),e.PRECISION_QUALIFIER=kl({name:"PRECISION_QUALIFIER",pattern:yl.NA}),e.INTERPOLATION_QUALIFIER=kl({name:"INTERPOLATION_QUALIFIER",pattern:yl.NA}),e.MULTIPLICATIVE_OP=kl({name:"MULTIPLICATIVE_OP",pattern:yl.NA}),e.ADDITIVE_OP=kl({name:"ADDITIVE_OP",pattern:yl.NA}),e.SHIFT_OP=kl({name:"SHIFT_OP",pattern:yl.NA}),e.RELATIONAL_OP=kl({name:"RELATIONAL_OP",pattern:yl.NA}),e.EQUALITY_OP=kl({name:"EQUALITY_OP",pattern:yl.NA}),e.PARAMETER_QUALIFIER=kl({name:"PARAMETER_QUALIFIER",pattern:yl.NA}),e.WHITESPACE=kl({name:"WHITESPACE",pattern:/\s+/,group:yl.SKIPPED}),e.LINE_COMMENT=kl({name:"LINE_COMMENT",pattern:/\/\/[^\r\n]*/,group:"COMMENTS"}),e.MULTILINE_COMMENT=kl({name:"MULTILINE_COMMENT",pattern:/\/\*[\s\S]*?\*\//,group:"COMMENTS"}),e.MULASSIGN=kl({name:"MULASSIGN",pattern:"*=",label:"'*='",categories:e.ASSIGN_OP}),e.DIVASSIGN=kl({name:"DIVASSIGN",pattern:"/=",label:"'/='",categories:e.ASSIGN_OP}),e.MODASSIGN=kl({name:"MODASSIGN",pattern:"%=",label:"'%='",categories:e.ASSIGN_OP}),e.ADDASSIGN=kl({name:"ADDASSIGN",pattern:"+=",label:"'+='",categories:e.ASSIGN_OP}),e.SUBASSIGN=kl({name:"SUBASSIGN",pattern:"-=",label:"'-='",categories:e.ASSIGN_OP}),e.LEFTASSIGN=kl({name:"LEFTASSIGN",pattern:"<<=",label:"'<<='",categories:e.ASSIGN_OP}),e.RIGHTASSIGN=kl({name:"RIGHTASSIGN",pattern:">>=",label:"'>>='",categories:e.ASSIGN_OP}),e.ANDASSIGN=kl({name:"ANDASSIGN",pattern:"&=",label:"'&='",categories:e.ASSIGN_OP}),e.XORASSIGN=kl({name:"XORASSIGN",pattern:"^=",label:"'^='",categories:e.ASSIGN_OP}),e.ORASSIGN=kl({name:"ORASSIGN",pattern:"|=",label:"'|='",categories:e.ASSIGN_OP}),e.INC_OP=kl({name:"INC_OP",pattern:"++",label:"'++'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.QUESTION=kl({name:"QUESTION",pattern:"?",label:"'?'"}),e.COLON=kl({name:"COLON",pattern:":",label:"':'"}),e.DEC_OP=kl({name:"DEC_OP",pattern:"--",label:"'--'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.AND_OP=kl({name:"AND_OP",pattern:"&&",label:"'&&'"}),e.XOR_OP=kl({name:"XOR_OP",pattern:"^^",label:"'^^'"}),e.OR_OP=kl({name:"OR_OP",pattern:"||",label:"'||'"}),e.LEFT_OP=kl({name:"LEFT_OP",pattern:"<<",label:"'<<'",categories:e.SHIFT_OP}),e.RIGHT_OP=kl({name:"RIGHT_OP",pattern:">>",label:"'>>'",categories:e.SHIFT_OP}),e.EQ_OP=kl({name:"EQ_OP",pattern:"==",label:"'=='",categories:e.EQUALITY_OP}),e.NE_OP=kl({name:"NE_OP",pattern:"!=",label:"'!='",categories:e.EQUALITY_OP}),e.LE_OP=kl({name:"LE_OP",pattern:"<=",label:"'<='",categories:e.RELATIONAL_OP}),e.GE_OP=kl({name:"GE_OP",pattern:">=",label:"'>='",categories:e.RELATIONAL_OP}),e.LEFT_ANGLE=kl({name:"LEFT_ANGLE",pattern:"<",label:"'<'",categories:e.RELATIONAL_OP}),e.RIGHT_ANGLE=kl({name:"RIGHT_ANGLE",pattern:">",label:"'>'",categories:e.RELATIONAL_OP}),e.PLUS=kl({name:"PLUS",pattern:"+",label:"'+'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.TILDE=kl({name:"TILDE",pattern:"~",label:"'~'",categories:e.UNARY_OP}),e.BANG=kl({name:"BANG",pattern:"!",label:"'!'",categories:e.UNARY_OP}),e.CARET=kl({name:"CARET",pattern:"^",label:"'^'"}),e.AMPERSAND=kl({name:"AND",pattern:"&",label:"'&'"}),e.VERTICAL_BAR=kl({name:"VERTICAL_BAR",pattern:"|",label:"'|'"}),e.SLASH=kl({name:"SLASH",pattern:"/",label:"'/'",categories:e.MULTIPLICATIVE_OP}),e.PERCENT=kl({name:"PERCENT",pattern:"%",label:"'%'",categories:e.MULTIPLICATIVE_OP}),e.STAR=kl({name:"STAR",pattern:"*",label:"'*'",categories:e.MULTIPLICATIVE_OP}),e.DASH=kl({name:"DASH",pattern:"-",label:"'-'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.COMMA=kl({name:"COMMA",pattern:",",label:"','"}),e.EQUAL=kl({name:"EQUAL",pattern:"=",label:"'='",categories:e.ASSIGN_OP}),e.LEFT_PAREN=kl({name:"LEFT_PAREN",pattern:"(",label:"'('"}),e.RIGHT_PAREN=kl({name:"RIGHT_PAREN",pattern:")",label:"')'"}),e.LEFT_BRACKET=kl({name:"LEFT_BRACKET",pattern:"[",label:"'['"}),e.RIGHT_BRACKET=kl({name:"RIGHT_BRACKET",pattern:"]",label:"']'"}),e.LEFT_BRACE=kl({name:"LEFT_BRACE",pattern:"{",label:"'{'"}),e.RIGHT_BRACE=kl({name:"RIGHT_BRACE",pattern:"}",label:"'}'"}),e.SEMICOLON=kl({name:"SEMICOLON",pattern:";",label:"';'"}),e.IDENTIFIER=kl({name:"IDENTIFIER",pattern:yl.NA}),e.NON_PP_IDENTIFIER=kl({name:"NON_PP_IDENTIFIER",pattern:/[a-z_]\w*/i,categories:e.IDENTIFIER}),e.PP=kl({name:"PP",pattern:yl.NA,categories:e.IDENTIFIER});const t=(t,n)=>kl({name:t,pattern:n,categories:e.PP,longer_alt:e.NON_PP_IDENTIFIER});e.DEFINE=t("DEFINE","define"),e.UNDEF=t("UNDEF","undef"),e.ENDIF=t("ENDIF","endif"),e.IFDEF=t("IFDEF","ifdef"),e.IFNDEF=t("IFNDEF","ifndef"),e.ELIF=t("ELIF","elif"),e.ERROR=t("ERROR","error"),e.VERSION=t("VERSION","version"),e.PRAGMA_DIRECTIVE=kl({name:"PRAGMA_DIRECTIVE",pattern:/#\s*pragma\s+[^\r\n]*/}),e.LINE=t("LINE","line"),e.EXTENSION=t("EXTENSION","extension"),e.INCLUDE=t("INCLUDE","include"),e.HASH_INCLUDE_MODULE=kl({name:"HASH_INCLUDE_MODULE",pattern:/#\s*include\s*<[\w\-./\\$@ ]+>/}),e.HASH=kl({name:"HASH",pattern:"#"}),e.KEYWORD=kl({name:"KEYWORD",pattern:yl.NA});const n=(t,n)=>kl({name:t,pattern:t.toLowerCase(),label:"'"+t.toLowerCase()+"'",longer_alt:e.NON_PP_IDENTIFIER,categories:n?[e.KEYWORD,n]:e.KEYWORD});e.CONST=n("CONST"),e.UNIFORM=n("UNIFORM"),e.LAYOUT=n("LAYOUT"),e.CENTROID=n("CENTROID"),e.FLAT=n("FLAT",e.INTERPOLATION_QUALIFIER),e.SMOOTH=n("SMOOTH",e.INTERPOLATION_QUALIFIER),e.BREAK=n("BREAK"),e.CONTINUE=n("CONTINUE"),e.DO=n("DO"),e.PRECISION=n("PRECISION"),e.FOR=n("FOR"),e.WHILE=n("WHILE"),e.SWITCH=n("SWITCH"),e.CASE=n("CASE"),e.DEFAULT=n("DEFAULT"),e.IF=n("IF"),e.ELSE=n("ELSE"),e.INVARIANT=n("INVARIANT"),e.INOUT=n("INOUT",e.PARAMETER_QUALIFIER),e.OUT=n("OUT",e.PARAMETER_QUALIFIER),e.VOID=n("VOID"),e.STRUCT=n("STRUCT"),e.DISCARD=n("DISCARD"),e.RETURN=n("RETURN"),e.LOWP=n("LOWP",e.PRECISION_QUALIFIER),e.MEDIUMP=n("MEDIUMP",e.PRECISION_QUALIFIER),e.HIGHP=n("HIGHP",e.PRECISION_QUALIFIER),e.CONSTANT=kl({name:"CONSTANT",pattern:yl.NA}),e.BASIC_TYPE=kl({name:"BASIC_TYPE",pattern:yl.NA});const r=t=>kl({name:t.toUpperCase(),pattern:t,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE});e.BOOL=r("bool"),e.INT=r("int"),e.FLOAT=r("float"),e.MAT2X3=r("mat2x3"),e.MAT2X4=r("mat2x4"),e.MAT2X2=kl({name:"mat2x2".toUpperCase(),pattern:/mat2(?:x2)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat2"}),e.MAT3X2=r("mat3x2"),e.MAT3X4=r("mat3x4"),e.MAT3X3=kl({name:"mat3x3".toUpperCase(),pattern:/mat3(?:x3)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat3"}),e.MAT4X2=r("mat4x2"),e.MAT4X3=r("mat4x3"),e.MAT4X4=kl({name:"MAT4X4",pattern:/mat4(?:x4)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat4"}),e.VEC2=r("vec2"),e.VEC3=r("vec3"),e.VEC4=r("vec4"),e.IVEC2=r("ivec2"),e.IVEC3=r("ivec3"),e.IVEC4=r("ivec4"),e.BVEC2=r("bvec2"),e.BVEC3=r("bvec3"),e.BVEC4=r("bvec4"),e.UINT=r("uint"),e.UVEC2=r("uvec2"),e.UVEC3=r("uvec3"),e.UVEC4=r("uvec4"),e.USAMPLERCUBE=r("usamplerCube"),e.USAMPLER3D=r("usampler3D"),e.USAMPLER2DARRAY=r("usampler2DArray"),e.USAMPLER2D=r("usampler2D"),e.SAMPLERCUBESHADOW=r("samplerCubeShadow"),e.SAMPLERCUBE=r("samplerCube"),e.SAMPLER3D=r("sampler3D"),e.SAMPLER2DSHADOW=r("sampler2DShadow"),e.SAMPLER2DARRAYSHADOW=r("sampler2DArrayShadow"),e.SAMPLER2DARRAY=r("sampler2DArray"),e.SAMPLER2D=r("sampler2D"),e.ISAMPLERCUBE=r("isamplerCube"),e.ISAMPLER3D=r("isampler3D"),e.ISAMPLER2DARRAY=r("isampler2DArray"),e.ISAMPLER2D=r("isampler2D"),e.IN=n("IN",e.PARAMETER_QUALIFIER),e.VARYING=n("VARYING"),e.ATTRIBUTE=n("ATTRIBUTE"),e.BOOLCONSTANT=kl({name:"BOOLCONSTANT",pattern:/true|false/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.CONSTANT}),e.FLOATCONSTANT=kl({name:"FLOATCONSTANT",pattern:/((\d+\.\d*|\.\d+)(e[+-]?\d+)?|\d+e[+-]?\d+)f?/i,categories:e.CONSTANT}),e.DOT=kl({name:"DOT",pattern:".",label:"'.'"}),e.UINTCONSTANT=kl({name:"UINTCONSTANT",pattern:/0x[\da-f]+u|\d+u/i,categories:e.CONSTANT}),e.INTCONSTANT=kl({name:"INTCONSTANT",pattern:/0x[\da-f]+|\d+/i,categories:e.CONSTANT}),e.STRING=kl({name:"STRING",pattern:/"([^"\\]+|\\")+"/})}(pc||(pc={}));const mc=Object.values(pc).filter(e=>e!==pc.NON_PP_IDENTIFIER).flatMap(e=>Array.isArray(e)?e:[e]);mc.push(pc.NON_PP_IDENTIFIER);const gc=new yl(mc,{ensureOptimizations:!1});new class extends uc{constructor(){super(...arguments),this.markError=()=>{}}eval(e,t,n){return this.isDefined=t,this.markError=n,super.visit(e)}constantExpression(e){if(e.const_.tokenType!==pc.INTCONSTANT)throw new Error("XX");return+e.const_.image}unaryExpression(e){switch(e.op.tokenType){case pc.NON_PP_IDENTIFIER:return+this.isDefined(e.on.var.image);case pc.DASH:return-this.visit(e.on);case pc.TILDE:return~this.visit(e.on);case pc.BANG:return+!this.visit(e.on);case pc.PLUS:return this.visit(e.on);default:throw new Error(e.op.tokenType.name)}}binaryExpression(e){const t=this.visit(e.lhs);switch(e.op.tokenType){case pc.AND_OP:return t&&this.visit(e.rhs);case pc.OR_OP:return t||this.visit(e.rhs);default:{const n=this.visit(e.rhs);return 0|function(e,t,n){switch(e){case pc.PLUS:return t+n;case pc.DASH:return t-n;case pc.STAR:return t*n;case pc.PERCENT:return t%n;case pc.SLASH:return t/n;case pc.LEFT_OP:return t<>n;case pc.EQ_OP:return t===n;case pc.NE_OP:return t!==n;case pc.LE_OP:return t<=n;case pc.GE_OP:return t>=n;case pc.LEFT_ANGLE:return tn;case pc.XOR_OP:return t!==n;case pc.AND_OP:return t&&n;case pc.OR_OP:return t||n;case pc.AMPERSAND:return t&n;case pc.CARET:return t^n;case pc.VERTICAL_BAR:return t|n;default:throw new Error}}(e.op.tokenType,t,n)}}}variableExpression(e){return this.markError("P0001",e.var,"undefined identifier "+e.var.image),0}};const Ec=new class extends ac{getTokensOnLine(){const e=[],t=lc(this.LA(0));let n;for(;lc(n=this.LA(1))===t;)e.push(n),this.SKIP_TOKEN();return e}constructor(){super(mc,{skipValidations:!0}),this.multiplicativeExpression=this.RR("multiplicativeExpression",()=>this.LEFT_ASSOC(this.preprocessing?this.ppUnaryExpression:this.unaryExpression,pc.MULTIPLICATIVE_OP)),this.additiveExpression=this.RR("additiveExpression",()=>this.LEFT_ASSOC(this.multiplicativeExpression,pc.ADDITIVE_OP)),this.shiftExpression=this.RR("shiftExpression",()=>this.LEFT_ASSOC(this.additiveExpression,pc.SHIFT_OP)),this.relationalExpression=this.RR("relationalExpression",()=>this.LEFT_ASSOC(this.shiftExpression,pc.RELATIONAL_OP)),this.equalityExpression=this.RR("equalityExpression",()=>this.LEFT_ASSOC(this.relationalExpression,pc.EQUALITY_OP)),this.andExpression=this.RR("andExpression",()=>this.LEFT_ASSOC(this.equalityExpression,pc.AMPERSAND)),this.exclusiveOrExpression=this.RR("exclusiveOrExpression",()=>this.LEFT_ASSOC(this.andExpression,pc.CARET)),this.inclusiveOrExpression=this.RR("inclusiveOrExpression",()=>this.LEFT_ASSOC(this.exclusiveOrExpression,pc.VERTICAL_BAR)),this.logicalAndExpression=this.RR("logicalAndExpression",()=>this.LEFT_ASSOC(this.inclusiveOrExpression,pc.AND_OP)),this.logicalXorExpression=this.RR("logicalXorExpression",()=>this.LEFT_ASSOC(this.logicalAndExpression,pc.XOR_OP)),this.logicalOrExpression=this.RR("logicalOrExpression",()=>this.LEFT_ASSOC(this.logicalXorExpression,pc.OR_OP)),this.assignmentExpression=this.RR("assignmentExpression",()=>{const e=this.SUBRULE(this.conditionalExpression);return this.OPTION(()=>{const t=this.CONSUME(pc.ASSIGN_OP),n=this.SUBRULE1(this.assignmentExpression);return{kind:"assignmentExpression",lhs:e,op:t,rhs:n}})??e}),this.expression=this.RR("expression",()=>{let e;return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.SUBRULE(this.assignmentExpression);return e=e?{kind:"commaExpression",lhs:e,rhs:t}:t}}),e}),this.conditionalExpression=this.RR("conditionalExpression",()=>{const e=this.SUBRULE1(this.logicalOrExpression);return this.OPTION(()=>({kind:"conditionalExpression",condition:e,QUESTION:this.CONSUME(pc.QUESTION),yes:this.SUBRULE2(this.expression),COLON:this.CONSUME(pc.COLON),no:this.SUBRULE3(this.assignmentExpression)}))??e}),this.switchStatement=this.RR("switchStatement",()=>{this.CONSUME(pc.SWITCH),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);this.CONSUME(pc.RIGHT_PAREN),this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.caseBlock))),this.CONSUME(pc.RIGHT_BRACE),{kind:"switchStatement",initExpression:e,cases:t}}),this.caseBlock=this.RR("caseBlock",()=>{const e=this.SUBRULE(this.caseLabel),t=[];return this.MANY1(()=>t.push(this.SUBRULE(this.statement))),{kind:"caseBlock",caseLabel:e,statements:t}}),this.jumpStatement=this.RR("jumpStatement",()=>{const e=this.OR([{ALT:()=>(this.CONSUME(pc.CONTINUE),{kind:"continueStatement"})},{ALT:()=>(this.CONSUME(pc.BREAK),{kind:"breakStatement"})},{ALT:()=>(this.CONSUME(pc.DISCARD),{kind:"discardStatement"})},{ALT:()=>(this.CONSUME(pc.RETURN),{kind:"returnStatement",what:this.OPTION(()=>this.SUBRULE(this.expression))})}]);return this.CONSUME(pc.SEMICOLON),e}),this.primaryExpression=this.RR("primaryExpression",()=>this.OR([{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),e}},{ALT:()=>({kind:"variableExpression",var:this.CONSUME(pc.IDENTIFIER)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.CONSTANT)})}])),this.constantExpression=this.RR("constantExpression",()=>this.SUBRULE(this.conditionalExpression)),this.layoutQualifier=this.RR("layoutQualifier",()=>{this.CONSUME(pc.LAYOUT),this.CONSUME(pc.LEFT_PAREN);const e=[];return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.CONSUME(pc.IDENTIFIER);let n;this.OPTION(()=>{this.CONSUME(pc.EQUAL),n=this.OR([{ALT:()=>this.CONSUME(pc.INTCONSTANT)},{ALT:()=>this.CONSUME(pc.UINTCONSTANT)}])}),e.push({IDENTIFIER:t,init:n})}}),this.CONSUME(pc.RIGHT_PAREN),{kind:"layoutQualifier",layoutQualifierIds:e}}),this.storageQualifier=this.RR("storageQualifier",()=>{let e,t,n,r,i,s,o;return this.OR([{ALT:()=>e=this.CONSUME(pc.CONST)},{ALT:()=>{t=this.OPTION(()=>this.CONSUME(pc.CENTROID)),this.OR9([{ALT:()=>n=this.CONSUME(pc.IN)},{ALT:()=>r=this.CONSUME(pc.OUT)},{ALT:()=>s=this.CONSUME(pc.VARYING)},{ALT:()=>o=this.CONSUME(pc.ATTRIBUTE)}])}},{ALT:()=>i=this.CONSUME(pc.UNIFORM)}]),{kind:"storageQualifier",CONST:e,CENTROID:t,IN:n,OUT:r,VARYING:s,ATTRIBUTE:o,UNIFORM:i}}),this.typeQualifier=this.RR("typeQualifier",()=>{let e,t,n,r;return this.OR([{ALT:()=>e=this.SUBRULE(this.storageQualifier)},{ALT:()=>{t=this.SUBRULE1(this.layoutQualifier),e=this.OPTION1(()=>this.SUBRULE2(this.storageQualifier))}},{ALT:()=>{n=this.CONSUME(pc.INTERPOLATION_QUALIFIER),e=this.OPTION2(()=>this.SUBRULE3(this.storageQualifier))}},{ALT:()=>{r=this.CONSUME(pc.INVARIANT),n=this.OPTION3(()=>this.CONSUME1(pc.INTERPOLATION_QUALIFIER)),e=this.SUBRULE7(this.storageQualifier)}}]),{kind:"typeQualifier",storageQualifier:e,layoutQualifier:t,interpolationQualifier:n,invariantQualifier:r}}),this.precisionQualifier=this.RR("precisionQualifier",()=>this.CONSUME(pc.PRECISION_QUALIFIER)),this.arraySpecifier=this.RR("arraySpecifier",()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.OPTION3(()=>this.SUBRULE(this.constantExpression));return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arraySpecifier",size:e}}),this.typeSpecifierNonArray=this.RR("typeSpecifierNonArray",()=>this.OR([{ALT:()=>this.CONSUME(pc.BASIC_TYPE)},{ALT:()=>this.CONSUME(pc.VOID)},{ALT:()=>this.SUBRULE(this.structSpecifier)},{ALT:()=>this.CONSUME(pc.IDENTIFIER)}])),this.typeSpecifierNoPrec=this.RR("typeSpecifierNoPrec",()=>{const e=this.SUBRULE(this.typeSpecifierNonArray);return{kind:"typeSpecifier",precisionQualifier:void 0,arraySpecifier:this.OPTION1(()=>this.SUBRULE(this.arraySpecifier)),typeSpecifierNonArray:e}}),this.functionCall=this.RR("functionCall",()=>{const e=this.SUBRULE(this.typeSpecifierNoPrec);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({DEF:()=>t.push(this.SUBRULE(this.assignmentExpression)),SEP:pc.COMMA}),this.CONSUME(pc.RIGHT_PAREN),{kind:"functionCall",callee:e,args:t}}),this.functionCallHeader=this.RULE("functionCallHeader",()=>{this.SUBRULE(this.typeSpecifierNoPrec),this.CONSUME(pc.LEFT_PAREN)}),this.postfixExpression=this.RR("postfixExpression",()=>{const e=this.LA(1);let t=this.OR1([{GATE:this.BACKTRACK(this.functionCallHeader),ALT:()=>this.SUBRULE1(this.functionCall)},{ALT:()=>this.SUBRULE(this.primaryExpression)}]);return this.MANY(()=>{t=this.OR2([{ALT:()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arrayAccess",on:t,index:e}}},{ALT:()=>{this.CONSUME1(pc.DOT);const e=this.SUBRULE2(this.functionCall);return{kind:"methodCall",on:t,functionCall:e}}},{ALT:()=>{this.CONSUME2(pc.DOT);const e=this.CONSUME(pc.IDENTIFIER);return{kind:"fieldAccess",on:t,field:e}}},{ALT:()=>{const e=this.CONSUME(pc.POSTFIX_OP);return{kind:"postfixExpression",on:t,op:e}}}]),this.FINALIZE(t,e)}),t}),this.unaryExpression=this.RR("unaryExpression",()=>this.OR([{ALT:()=>this.SUBRULE1(this.postfixExpression)},{ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.UNARY_OP),on:this.SUBRULE2(this.unaryExpression)})}])),this.ppUnaryExpression=this.RR("ppUnaryExpression",()=>this.OR([{GATE:()=>this.LA(1).tokenType===pc.NON_PP_IDENTIFIER&&"defined"===this.LA(1).image,ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.IDENTIFIER),on:{kind:"variableExpression",var:this.OR1([{ALT:()=>this.SUBRULE(this.ppIdentifier)},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE1(this.ppIdentifier);return this.CONSUME(pc.RIGHT_PAREN),e}}])}})},{ALT:()=>({kind:"unaryExpression",op:this.OR2([{ALT:()=>this.CONSUME(pc.PLUS)},{ALT:()=>this.CONSUME(pc.DASH)},{ALT:()=>this.CONSUME(pc.TILDE)},{ALT:()=>this.CONSUME(pc.BANG)}]),on:this.SUBRULE2(this.ppUnaryExpression)})},{ALT:()=>this.SUBRULE(this.ppPrimaryExpression)}])),this.ppPrimaryExpression=this.RR("ppPrimaryExpression",()=>this.OR([{ALT:()=>({kind:"variableExpression",var:this.SUBRULE(this.ppIdentifier)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.INTCONSTANT)})},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.ppConstantExpression);return this.CONSUME(pc.RIGHT_PAREN),e}}])),this.ppConstantExpression=this.RR("ppConstantExpression",()=>{try{return this.preprocessing=!0,this.LEFT_ASSOC(this.logicalAndExpression,pc.OR_OP)}finally{this.preprocessing=!1}}),this.typeSpecifier=this.RR("typeSpecifier",()=>{const e=this.OPTION(()=>this.SUBRULE(this.precisionQualifier)),t=this.SUBRULE(this.typeSpecifierNoPrec);return Object.assign({},t,{precisionQualifier:e})}),this.parameterDeclaration=this.RR("parameterDeclaration",()=>{const e=this.OPTION(()=>this.CONSUME(pc.CONST)),t=this.OPTION1(()=>this.CONSUME(pc.PARAMETER_QUALIFIER)),n=this.SUBRULE(this.typeSpecifier);let r,i;return this.OPTION2(()=>{r=this.CONSUME2(pc.IDENTIFIER),i=this.OPTION3(()=>this.SUBRULE(this.arraySpecifier))}),{kind:"parameterDeclaration",parameterTypeQualifier:e,pName:r,arraySpecifier:i,parameterQualifier:t,typeSpecifier:n}}),this.fullySpecifiedType=this.RR("fullySpecifiedType",()=>({kind:"fullySpecifiedType",typeQualifier:this.OPTION(()=>this.SUBRULE(this.typeQualifier)),typeSpecifier:this.SUBRULE(this.typeSpecifier)})),this.structDeclaration=this.RR("structDeclaration",()=>{const e=this.SUBRULE(this.fullySpecifiedType),t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME(pc.IDENTIFIER),arraySpecifier:this.OPTION(()=>this.SUBRULE(this.arraySpecifier)),init:void 0};return t.push(e),e})}),this.CONSUME(pc.SEMICOLON),{kind:"structDeclaration",fsType:e,declarators:t}}),this.structSpecifier=this.RR("structSpecifier",()=>{this.CONSUME(pc.STRUCT);const e=this.OPTION2(()=>this.CONSUME(pc.IDENTIFIER));this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),{kind:"structSpecifier",name:e,declarations:t}}),this.initializer=this.RR("initializer",()=>this.SUBRULE(this.assignmentExpression)),this.singleDeclaration=this.RULE("singleDeclaration",()=>this.OR([{ALT:()=>{this.SUBRULE(this.fullySpecifiedType),this.OPTION1(()=>{this.CONSUME1(pc.IDENTIFIER),this.OPTION2(()=>{this.CONSUME(pc.LEFT_BRACKET),this.OPTION3(()=>this.SUBRULE(this.constantExpression)),this.CONSUME(pc.RIGHT_BRACKET)}),this.OPTION4(()=>{this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)})})}},{ALT:()=>({kind:"invariantDeclaration",INVARIANT:this.CONSUME(pc.INVARIANT),IDENTIFIER:this.CONSUME2(pc.IDENTIFIER)})}])),this.initDeclaratorList=this.RR("initDeclaratorList",()=>this.SUBRULE(this.externalDeclaration,{ARGS:[!1,!1]})),this.expressionStatement=this.RR("expressionStatement",()=>{const e=this.OPTION(()=>this.SUBRULE(this.expression));return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:e}}),this.condition=this.RR("condition",()=>this.OR({MAX_LOOKAHEAD:4,DEF:[{GATE:this.BACKTRACK(this.singleDeclaration),ALT:()=>{const e=this.SUBRULE2(this.fullySpecifiedType),t=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.EQUAL),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:[{kind:"declarator",name:t,init:this.SUBRULE3(this.initializer),arraySpecifier:void 0}]}}},{ALT:()=>this.SUBRULE(this.expression)}]})),this.caseLabel=this.RR("caseLabel",()=>this.OR([{ALT:()=>{this.CONSUME(pc.CASE);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.COLON),{kind:"caseLabel",case_:e}}},{ALT:()=>(this.CONSUME2(pc.DEFAULT),this.CONSUME2(pc.COLON),{kind:"caseLabel",case_:void 0})}])),this.selectionStatement=this.RR("selectionStatement",()=>{this.CONSUME(pc.IF),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),{kind:"selectionStatement",condition:e,yes:this.SUBRULE2(this.statement,{ARGS:[!0]}),no:this.OPTION(()=>(this.CONSUME(pc.ELSE),this.SUBRULE3(this.statement,{ARGS:[!0]})))}}),this.statement=this.RR("statement",e=>this.OR([{ALT:()=>this.SUBRULE(this.ppDirective),IGNORE_AMBIGUITIES:!0},{ALT:()=>{const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:{kind:"variableExpression",var:e}}},IGNORE_AMBIGUITIES:!0},{GATE:this.BACKTRACK(this.expressionStatement),ALT:()=>this.SUBRULE(this.expressionStatement)},{ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.selectionStatement)},{ALT:()=>this.SUBRULE(this.switchStatement)},{ALT:()=>this.SUBRULE(this.iterationStatement)},{ALT:()=>this.SUBRULE(this.jumpStatement)},{ALT:()=>this.SUBRULE(this.compoundStatement,{ARGS:[!!e]})}])),this.compoundStatement=this.RR("compoundStatement",e=>{if("object"==typeof e)throw new Error;this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.statement))),this.CONSUME(pc.RIGHT_BRACE),{kind:"compoundStatement",statements:t,newScope:!!e}}),this.iterationStatement=this.RR("iterationStatement",()=>this.OR([{ALT:()=>{this.CONSUME(pc.WHILE),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.condition);return this.CONSUME(pc.RIGHT_PAREN),{kind:"whileStatement",conditionExpression:e,statement:this.SUBRULE(this.statement)}}},{ALT:()=>{this.CONSUME2(pc.DO);const e=this.SUBRULE2(this.statement,{ARGS:[!0]});this.CONSUME2(pc.WHILE),this.CONSUME2(pc.LEFT_PAREN);const t=this.SUBRULE2(this.expression);return this.CONSUME2(pc.RIGHT_PAREN),this.CONSUME2(pc.SEMICOLON),{kind:"doWhileStatement",statement:e,conditionExpression:t}}},{ALT:()=>{this.CONSUME3(pc.FOR),this.CONSUME3(pc.LEFT_PAREN);const e=this.OR3([{GATE:this.BACKTRACK(this.initDeclaratorList),ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.expressionStatement)}]),t=this.OPTION3(()=>this.SUBRULE3(this.condition));this.CONSUME4(pc.SEMICOLON);const n=this.OPTION4(()=>this.SUBRULE4(this.expression));return this.CONSUME3(pc.RIGHT_PAREN),{kind:"forStatement",initExpression:e,conditionExpression:t,loopExpression:n,statement:this.SUBRULE3(this.statement)}}}])),this.translationUnit=this.RR("translationUnit",()=>{const e=[];return this.AT_LEAST_ONE(()=>e.push(this.SUBRULE(this.externalDeclaration,{ARGS:[!0,!0]}))),{kind:"translationUnit",declarations:e}}),this.uniformBlock=this.RR("uniformBlock",()=>{const e=this.SUBRULE(this.typeQualifier),t=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_BRACE);const n=[];let r,i;return this.MANY(()=>n.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),this.OPTION(()=>{r=this.CONSUME1(pc.IDENTIFIER),i=this.OPTION1(()=>this.SUBRULE(this.arraySpecifier))}),this.CONSUME(pc.SEMICOLON),{kind:"uniformBlock",typeQualifier:e,blockName:t,declarations:n,namespace:r,arraySpecifier:i}}),this.uniformBlockHeader=this.RULE("uniformBlockHeader",()=>{this.OPTION(()=>this.SUBRULE(this.layoutQualifier)),this.CONSUME(pc.UNIFORM),this.CONSUME(pc.IDENTIFIER),this.CONSUME(pc.LEFT_BRACE)}),this.typeQualifierDeclaration=this.RR("typeQualifierDeclaration",()=>{const e=this.SUBRULE(this.typeQualifier);return this.CONSUME(pc.SEMICOLON),{kind:"typeQualifierDeclaration",typeQualifier:e}}),this.externalDeclaration=this.RR("externalDeclaration",(e,t)=>this.OR([{ALT:()=>this.SUBRULE(this.ppCall)},{ALT:()=>this.SUBRULE(this.ppDirective)},{GATE:this.BACKTRACK(this.typeQualifierDeclaration),ALT:()=>this.SUBRULE(this.typeQualifierDeclaration)},{GATE:e?this.BACKTRACK(this.uniformBlockHeader):()=>!1,ALT:()=>this.SUBRULE(this.uniformBlock)},{ALT:()=>{const e=this.SUBRULE(this.fullySpecifiedType);return this.OR2([{GATE:t?void 0:()=>!1,ALT:()=>{const t=this.CONSUME1(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const n=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>n.push(this.SUBRULE(this.parameterDeclaration))}),this.CONSUME(pc.RIGHT_PAREN),this.OR3([{ALT:()=>(this.CONSUME(pc.SEMICOLON),{kind:"functionPrototype",name:t,returnType:e,params:n})},{ALT:()=>{const r=this.SUBRULE(this.compoundStatement);return{kind:"functionDefinition",name:t,returnType:e,params:n,body:r}},IGNORE_AMBIGUITIES:!1}])}},{ALT:()=>{const t=[];return this.MANY_SEP2({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME3(pc.IDENTIFIER),arraySpecifier:this.OPTION5(()=>this.SUBRULE(this.arraySpecifier)),init:this.OPTION7(()=>(this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)))};return t.push(e),e})}),this.CONSUME2(pc.SEMICOLON),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:t}}}])}},{ALT:()=>{this.CONSUME(pc.PRECISION);const e=this.CONSUME(pc.PRECISION_QUALIFIER),t=this.SUBRULE(this.typeSpecifierNoPrec);return this.CONSUME3(pc.SEMICOLON),{kind:"precisionDeclaration",precisionQualifier:e,typeSpecifierNoPrec:t}}}])),this.ppDefine=this.RR("ppDefine",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.DEFINE);const e=this.CONSUME(pc.IDENTIFIER),t=this.LA(1).tokenType===pc.LEFT_PAREN&&e.endOffset+1===this.LA(1).startOffset,n={kind:"ppDefine",what:e,params:this.OPTION({GATE:()=>t,DEF:()=>{this.CONSUME(pc.LEFT_PAREN);const e=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>e.push(this.SUBRULE(this.ppIdentifier))}),this.CONSUME(pc.RIGHT_PAREN),e}}),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(n),n}),this.ppInclude=this.RR("ppInclude",()=>{let e="";return this.OR([{ALT:()=>{const t=this.CONSUME(pc.HASH_INCLUDE_MODULE);e=t.image.substring(t.image.indexOf("<"))}},{ALT:()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.INCLUDE),e=this.CONSUME(pc.STRING).image}}]),{kind:"ppInclude",what:e}}),this.ppCall=this.RR("ppCall",()=>{const e=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>{const e=[];this.MANY(()=>this.OR({DEF:[{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>e.push(this.CONSUME(pc.BASIC_TYPE))},{ALT:()=>e.push(this.CONSUME(pc.ASSIGN_OP))},{ALT:()=>e.push(this.CONSUME(pc.SHIFT_OP))},{ALT:()=>e.push(this.CONSUME(pc.CONSTANT))},{ALT:()=>e.push(this.CONSUME(pc.KEYWORD))},{ALT:()=>e.push(this.CONSUME2(pc.IDENTIFIER))}]})),t.push({tokens:e,node:void 0})},MAX_LOOKAHEAD:1}),this.CONSUME(pc.RIGHT_PAREN),{kind:"ppCall",callee:e,args:t}}),this.ppCallArg=this.RULE("ppCallArg",()=>{const e=[];return e.push(this.CONSUME(pc.LEFT_PAREN)),this.MANY(()=>this.OR([{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>(e.push(this.LA(1)),this.SKIP_TOKEN())}])),e.push(this.CONSUME(pc.RIGHT_PAREN)),e}),this.ppNone=this.RR("ppNone",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.ELSE)},{ALT:()=>this.CONSUME(pc.ENDIF)}]),tokens:[],node:void 0};return this.ppDefs.push(e),e}),this.ppMulti=this.RR("ppMulti",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IF)},{ALT:()=>this.CONSUME(pc.ELIF)},{ALT:()=>this.CONSUME(pc.ERROR)},{ALT:()=>this.CONSUME(pc.VERSION)},{ALT:()=>this.CONSUME(pc.LINE)}]),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(e),e}),this.ppPragma=this.RR("ppPragma",()=>({kind:"ppPragma",dir:this.CONSUME(pc.PRAGMA_DIRECTIVE)})),this.ppSingle=this.RR("ppSingle",()=>(this.CONSUME(pc.HASH),{kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IFDEF)},{ALT:()=>this.CONSUME(pc.IFNDEF)}]),tokens:[this.CONSUME(pc.IDENTIFIER)],node:void 0})),this.ppExtension=this.RR("ppExtension",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.EXTENSION);const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.COLON),{kind:"ppExtension",extension:e,behavior:this.CONSUME1(pc.IDENTIFIER)}}),this.ppDirective=this.RR("ppDirective",()=>this.OR([{ALT:()=>this.SUBRULE(this.ppDefine)},{ALT:()=>this.SUBRULE(this.ppExtension)},{ALT:()=>this.SUBRULE(this.ppNone)},{ALT:()=>this.SUBRULE(this.ppSingle)},{ALT:()=>this.SUBRULE(this.ppMulti)},{ALT:()=>this.SUBRULE(this.ppPragma)},{ALT:()=>this.SUBRULE(this.ppInclude)}])),this.ppIdentifier=this.RR("ppIdentifier",()=>this.OR([{ALT:()=>this.CONSUME(pc.IDENTIFIER)},{ALT:()=>this.CONSUME(pc.KEYWORD)},{ALT:()=>this.CONSUME(pc.BASIC_TYPE)}])),this.ppDefs=[],this.performSelfAnalysis()}reset(){super.reset(),this.ppDefs=[],this.backtracking=!1,this.preprocessing=!1}LEFT_ASSOC(e,t){const n=this.LA(1);let r=this.SUBRULE1(e);return this.MANY(()=>{const i=this.CONSUME(t),s=this.SUBRULE2(e);return r={kind:"binaryExpression",lhs:r,rhs:s,op:i,firstToken:n,lastToken:this.LA(0)},r}),r}ANNOTATE(e){return(...t)=>{const n=this.LA(1),r=e(...t);return r&&hc(r)&&!r.firstToken&&this.FINALIZE(r,n),r}}BACKTRACK(e,t){const n=super.BACKTRACK(e,t);return function(){try{return this.backtracking=!0,n.call(this)}finally{this.backtracking=!1}}}RR(e,t,n){return super.RULE(e,this.ANNOTATE(t),n)}FINALIZE(e,t){this.RECORDING_PHASE||this.backtracking||(e.firstToken=t,e.lastToken=this.LA(0))}isAtEof(){return this.LA(1).tokenType===Ml}};const{ll:{printDocToString:vc},LX:{indentIfBreak:Cc,group:Dc,indent:Sc,join:Ac,line:_c,softline:yc,hardline:bc,fill:Tc,lineSuffixBoundary:Rc}}=r,xc=new class extends uc{constructor(){super(...arguments),this.result=void 0}visit(e){if(!this.result){const t=this.result=[];return super.visit(e),this.result=void 0,t}e&&this.result.push(e)}};function wc(e){return(cc(e)?e:e.lastToken).endOffset+1}const Fc={"glsl-parser":{parse(e,t){const n=function(e){const t=function(e){const t=[];let n="",r=0,i=0;return{result:e.replace(/\\(\r\n|\n\r|\r|\n)(.*?)(?:(?=\\?[\r\n])|$)/g,(s,o,a,l)=>{r++,i+=function(e,t){let n=t;for(;n>=0&&"\r"!==e[n]&&"\n"!==e[n];)n--;return t-n-1}(e,l),t.push({originalOffset:l+1+o.length,newOffset:l-n.length,length:a.length,lineDiff:-r,columnDiff:i}),n+=" "+o;let u="";return e.length>l+s.length&&"\\"===e[l+s.length]||(u=n,n="",r=0,i=0),a+u}),changes:t}}(e),n=gc.tokenize(t.result);!function(e,t){if(t.errors.length)throw new Error("LEXER ERROR: "+t.errors.map(t=>t.message+":\n"+dc(e,{startLine:t.line,startColumn:t.column,endLine:t.line,endColumn:t.column+t.length})).join())}(t.result,n),function(e,t){let n=0;function r(e,t){const n=t.originalOffset-t.newOffset;e.startOffset>=t.newOffset&&(e.lineNoCont=e.startLine,e.startOffset+=n,e.startLine-=t.lineDiff,e.startColumn-=t.columnDiff),e.endOffset+=n,e.endLine-=t.lineDiff,e.endColumn-=t.columnDiff}for(const i of t){for(;e[n]&&e[n].endOffset0)throw new Error("PARSE ERROR: "+t.map(t=>t.message+"\n"+t.context.ruleStack.join(" > ")+"\n"+dc(e,t.token)).join("\n"))}(t.result,Ec.errors);const i=Ec.ppDefs;function s(e,t){Ec.input=e;const n=t(Ec);return Ec.isAtEof()&&0===Ec.errors.length?n:void 0}for(const e of i)e.node=s(e.tokens,e=>e.externalDeclaration(!0,!0))??s(e.tokens,e=>e.statement())??s(e.tokens,e=>e.expression());return r.comments=n.groups.COMMENTS,r}(e);return n.comments?.forEach(e=>e.value=JSON.stringify(e)),n},astFormat:"glsl-ast",locStart:function(e){return(cc(e)?e:e.firstToken).startOffset},locEnd:wc}};function Nc(e){switch(e){case pc.STAR:case pc.SLASH:case pc.PERCENT:return 4;case pc.PLUS:case pc.DASH:return 5;case pc.LEFT_OP:case pc.RIGHT_OP:return 6;case pc.LEFT_ANGLE:case pc.RIGHT_ANGLE:case pc.LE_OP:case pc.GE_OP:return 7;case pc.EQ_OP:case pc.NE_OP:return 8;case pc.AMPERSAND:return 9;case pc.CARET:return 10;case pc.VERTICAL_BAR:return 11;case pc.AND_OP:case pc.XOR_OP:return 12;case pc.OR_OP:return 13;case pc.COMMA:return 17;default:throw new Error}}function Lc(e,t){switch(e.kind){default:return 1;case"variableExpression":return t?.find(t=>t.image===e.var.image)?18:1;case"arrayAccess":case"functionCall":case"fieldAccess":case"postfixExpression":return 2;case"unaryExpression":return 3;case"binaryExpression":return Nc(e.op.tokenType);case"conditionalExpression":return 15;case"assignmentExpression":return 16;case"commaExpression":return 17}}function Oc(e,t){return t?["(",e,")"]:e}function Ic(e,t,n,r){const i="binaryExpression"===n.kind&&"binaryExpression"===n.lhs.kind&&Nc(n.lhs.op.tokenType)===Nc(n.op.tokenType)||"commaExpression"===n.kind&&"commaExpression"===n.lhs.kind,s="binaryExpression"===n.kind?n.op.tokenType:pc.COMMA;let o;return i?(o=e.call(e=>Ic(e,t,e.getValue(),r),"lhs"),o.push("commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))),o):[Oc(e.call(t,"lhs"),Lc(n.lhs,r)>Nc(s)),"commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))]}function kc(e,t,n){return"expressionStatement"!==e.kind||e.expression?"compoundStatement"===e.kind||n?[" ",t]:Sc([_c,t]):";"}function Mc(e,t){return vc(e,Object.assign({},t,{printWidth:t.printWidth-2})).formatted.trim().replace(/^.*(?=[\r\n])/gm,e=>e+" ".repeat(t.printWidth-2-e.length+1)+"\\")}function Pc(e){return"assignmentExpression"===e.kind}function Bc(e){return"assignmentExpression"===e.kind||"declarator"===e.kind}function Uc(e,t,n,r,i,s){const o=function(e,t,n){if(!n)return"only-left";const r=!Pc(n);return e.match(Pc,Bc,e=>!r||"expressionStatement"!==e.kind&&"initDeclaratorListDeclaration"!==e.kind)?r?"chain-tail":"chain":!r&&Pc(n.rhs)||(t.originalText,0)||"binaryExpression"===n.kind||"commaExpression"===n.kind||"conditionalExpression"===n.kind&&"binaryExpression"===n.condition.kind?"break-after-operator":"constantExpression"===n.kind?"never-break-after-operator":"fluid"}(e,t,s);switch(o){case"break-after-operator":return Dc([Dc(n),r,Dc(Sc([_c,i]))]);case"never-break-after-operator":return Dc([Dc(n),r," ",i]);case"fluid":{const e=Symbol("assignment");return Dc([Dc(n),r,Dc(Sc(_c),{id:e}),Rc,Cc(i,{groupId:e})])}case"chain":return[Dc(n),r,_c,i];case"chain-tail":return[Dc(n),r,Sc([_c,i])];case"only-left":return n;default:throw new Error}}const $c={"glsl-ast":{print(e,t,n){const r=t.inMacro,i=e.getValue();if(!i)return[];if(cc(i))return i.image;const s=t=>e.call(n,t);try{switch(i.kind){case"translationUnit":{const r=[];return e.each((e,i)=>{const s=e.getValue();r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc),r.push(bc)},"declarations"),r}case"precisionDeclaration":return["precision ",i.precisionQualifier.image," ",e.call(n,"typeSpecifierNoPrec"),";"];case"fullySpecifiedType":{const e=[];return i.typeQualifier&&e.push(s("typeQualifier")," "),e.push(s("typeSpecifier")),e}case"typeSpecifier":{const e=[];return i.precisionQualifier&&e.push(i.precisionQualifier.image," "),e.push(s("typeSpecifierNonArray")),i.arraySpecifier&&e.push(s("arraySpecifier")),e}case"typeQualifier":{const e=[];return i.invariantQualifier&&e.push("invariant"),i.interpolationQualifier&&e.push(i.interpolationQualifier.image),i.layoutQualifier&&e.push(s("layoutQualifier")),i.storageQualifier&&e.push(s("storageQualifier")),Ac(" ",e)}case"storageQualifier":{const t=[];return i.CONST&&t.push("const"),i.CENTROID&&e.getParentNode().interpolationQualifier?.tokenType!==pc.FLAT&&t.push("centroid"),i.IN&&t.push("in"),i.OUT&&t.push("out"),i.VARYING&&t.push("varying"),i.ATTRIBUTE&&t.push("attribute"),i.UNIFORM&&t.push("uniform"),Ac(" ",t)}case"functionPrototype":case"functionDefinition":return[Dc([s("returnType")," ",s("name"),"(",Sc([yc,Ac([",",_c],e.map(n,"params"))]),yc,")"]),"functionPrototype"===i.kind?";":[" ",s("body")]];case"parameterDeclaration":return[i.parameterTypeQualifier?[s("parameterTypeQualifier")," "]:"",i.parameterQualifier?.tokenType===pc.OUT||i.parameterQualifier?.tokenType===pc.INOUT?i.parameterQualifier?.image+" ":"",s("typeSpecifier")," ",s("pName"),s("arraySpecifier")];case"initDeclaratorListDeclaration":case"structDeclaration":{const t=e.map(n,"declarators"),r="forStatement"===e.getParentNode().kind,o=i.declarators.some(e=>e.init);return Dc([s("fsType"),0===t.length?"":" ",1===t.length?t:Dc(Sc(Ac([",",o&&!r?bc:_c],t))),";"])}case"declarator":{const n=s("arraySpecifier"),r=[i.name.image,n];return Uc(e,t,r," =",s("init"),i.init)}case"arraySpecifier":return Dc(["[",Sc([yc,s("size")]),yc,"]"]);case"arrayAccess":return[Oc(s("on"),Lc(i.on,r)>2),"[",s("index"),"]"];case"structSpecifier":{const r=[];return e.each((e,i,s)=>{const o=e.getValue();r.push(bc),r.push(n(e)),i!==s.length-1&&_s.isNextLineEmpty(t.originalText,o,wc)&&r.push(bc)},"declarations"),Dc(["struct",i.name?" "+i.name.image:""," {",Sc(r),bc,"}"])}case"compoundStatement":{const r=[],s=!!i.comments?.some(e=>!e.leading&&!e.trailing&&!e.printed);return e.each((e,i)=>{const s=e.getValue();0!==i&&r.push(bc),r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc)},"statements"),s&&e.each(e=>{const t=e.getValue();t.leading||t.trailing||(r.push(n(e)),t.printed=!0)},"comments"),Dc(["{",r.length?[Sc([bc,r]),bc]:"","}"])}case"returnStatement":return i.what?["return"," ",s("what"),";"]:"return;";case"breakStatement":return"break;";case"continueStatement":return"continue;";case"discardStatement":return"discard;";case"selectionStatement":{const e=[],t=kc(i.yes,s("yes"),!1),n=Dc(["if (",Dc([Sc([yc,s("condition")]),yc]),")",t]);if(e.push(n),i.no){const t=i.yes.comments?.some(e=>e.trailing&&e.tokenType===pc.LINE_COMMENT)||i.yes.comments?.findLast(e=>!e.leading&&!e.trailing)?.tokenType===pc.LINE_COMMENT,n="compoundStatement"===i.yes.kind&&!t;e.push(n?" ":bc),e.push("else",Dc(kc(i.no,s("no"),"selectionStatement"===i.no.kind)))}return e}case"forStatement":{const e=kc(i.statement,s("statement"),!1),t=!1,n=t?[t,yc]:"";return"expressionStatement"!==i.initExpression.kind||i.initExpression.expression||i.conditionExpression||i.loopExpression?[n,Dc(["for (",Dc([Sc([yc,s("initExpression"),_c,s("conditionExpression"),";",_c,s("loopExpression")]),yc]),")",e])]:[n,Dc(["for (;;)",e])]}case"whileStatement":{const e=kc(i.statement,s("statement"),!1);return["while (",Dc(s("conditionExpression")),")",e]}case"doWhileStatement":return["do ",s("statement")," while (",Dc(s("conditionExpression")),");"];case"functionCall":return function(t){const r=e.map(n,"args");let i,o;if(void 0===t.callee.arraySpecifier&&cc(t.callee.typeSpecifierNonArray)&&void 0!==(i=function(e){switch(e){case pc.MAT2X2:return[2,2];case pc.MAT2X3:return[2,3];case pc.MAT2X4:return[2,4];case pc.MAT3X2:return[3,2];case pc.MAT3X3:return[3,3];case pc.MAT3X4:return[3,4];case pc.MAT4X2:return[4,2];case pc.MAT4X3:return[4,3];case pc.MAT4X4:return[4,4];default:return}}(t.callee.typeSpecifierNonArray.tokenType))&&i[0]*i[1]===t.args.length){const e=t.args.every(e=>"constantExpression"===e.kind&&(e.const_.tokenType===pc.FLOATCONSTANT||e.const_.tokenType===pc.INTCONSTANT)||"unaryExpression"===e.kind&&(e.op.tokenType===pc.PLUS||e.op.tokenType===pc.DASH)&&"constantExpression"===e.on.kind&&(e.on.const_.tokenType===pc.FLOATCONSTANT||e.on.const_.tokenType===pc.INTCONSTANT));if(e){const e=[],n=[];let s=0,a=0;for(let i=0;i2),".",s("functionCall")];case"postfixExpression":return[Oc(s("on"),Lc(i.on,r)>2),s("op")];case"unaryExpression":return[s("op"),Oc(s("on"),Lc(i.on,r)>3)];case"assignmentExpression":{const n=s("lhs");return Uc(e,t,n," "+i.op.image,s("rhs"),i.rhs)}case"conditionalExpression":return[Oc(s("condition"),Lc(i.condition,r)>=15),Sc([_c,"? ",s("yes"),_c,": ",s("no")])];case"commaExpression":case"binaryExpression":{const t=Ic(e,n,i,r),s=e.getParentNode();if("selectionStatement"===s.kind||"whileStatement"===s.kind||"switchStatement"===s.kind||"doWhileStatement"===s.kind)return t;const o=()=>{const t=e.getParentNode();return!!t&&("functionCall"===t.kind&&"commaExpression"===i.kind||"binaryExpression"===t.kind&&((n=t.op.tokenType)===pc.CARET||n===pc.VERTICAL_BAR||n===pc.AMPERSAND));var n},a=e.getParentNode(1);if("returnStatement"===s.kind||"forStatement"===s.kind||"conditionalExpression"===s.kind&&"returnStatement"!==a.kind&&"functionCall"!==a.kind||"assignmentExpression"===s.kind||"declarator"===s.kind)return Dc(t);{const e=t.slice(0,1),n=t.slice(e.length);return Dc(Oc([...e,Sc(n)],o()))}}case"expressionStatement":return[s("expression"),";"];case"fieldAccess":return[Oc(s("on"),Lc(i.on,r)>2),".",s("field")];case"constantExpression":{const e=i.const_;return e.tokenType===pc.FLOATCONSTANT?function(e){const t=e.indexOf(".");return 0===t&&(e="0"+e),e=e.replace("E","e"),-1!==t&&(e=(e=(e=(e=e.replace(".e","e")).replace(/(?=4):Tc(Ac(_c,e.map(n,"tokens")))])]);return t.inMacro=void 0,Mc(r,t)}case"ppDir":return Mc(Dc(["#",i.dir.image," ",Sc(i.node?s("node"):Tc(Ac(_c,e.map(n,"tokens"))))]),t);case"ppPragma":return i.dir.image.replace(/^#\s+/,"#").replace(/^#pragma\s{2,}/,"#pragma ");case"ppCall":return Dc([i.callee.image,"(",Ac([",",_c],e.map((e,t,n)=>n[t].tokens.map(e=>e.image),"args")),")"]);case"ppInclude":return["#include ",i.what];case"ppExtension":return["#extension ",i.extension.image," : ",i.behavior.image];case"switchStatement":return["switch (",Dc([Sc([yc,s("initExpression")]),yc]),") {",i.cases.length?Sc([bc,Ac(bc,e.map(n,"cases"))]):"",bc,"}"];case"caseBlock":{const r=s("caseLabel"),i=[];return e.each((e,r)=>{const s=e.getValue();i.push(bc),i.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&i.push(bc)},"statements"),[r,Sc(i)]}case"caseLabel":return void 0===i.case_?"default:":["case ",s("case_"),":"];case"layoutQualifier":return["layout(",Ac(", ",i.layoutQualifierIds.map(e=>void 0===e.init?e.IDENTIFIER.image:[e.IDENTIFIER.image," = ",e.init.image])),")"];case"uniformBlock":return[s("typeQualifier")," ",i.blockName.image," {",Sc([bc,Ac(bc,e.map(n,"declarations"))]),bc,"};"];case"typeQualifierDeclaration":return[s("typeQualifier"),";"];default:throw new Error("unexpected n type "+i.kind+"\n"+JSON.stringify(i).substring(0,100))}}catch(e){throw console.error("error printing "+JSON.stringify(i).substring(0,100)+"\n"),e}},embed(e,t){const n=e.getValue();return!cc(n)||n.tokenType!==pc.LINE_COMMENT&&n.tokenType!==pc.MULTILINE_COMMENT?null:(e,t,n,r)=>{}},getVisitorKeys:(e,t)=>cc(e)?[]:Object.keys(e).filter(e=>!t.has(e)),getCommentChildNodes:e=>cc(e)?[]:xc.visit(e),canAttachComment:e=>!0,printComment:function(e,t){const n=e.getValue();return n.tokenType===pc.MULTILINE_COMMENT&&"*"===n.image[2]?"/**\n"+n.image.substring(3,n.image.length-2).split("\n").map(e=>" *"===e?"":e.startsWith(" * ")?e.substring(3):e).join("\n").trim().split("\n").map(e=>""===e?" *":" * "+e).join("\n")+"\n */":n.image},hasPrettierIgnore(e){const t=e.getValue();return(t&&hc(t)&&t.comments?.some(e=>/\/\/\s*prettier-ignore\b.*/.test(e.image)))??!1}}},Gc={parsers:Fc,printers:$c};function Vc(e){return e.replace(/^([^\n]*;)\n(?=(?:[A-Za-z_]\w*\s+)+[A-Za-z_]\w*\s*\()/gm,"$1\n\n").replace(/^}\n(?=\S)/gm,"}\n\n")}var Wc,Hc,jc=(Wc={program:function(e){return jc(e.program)+jc(e.wsEnd)},segment:function(e){return jc(e.blocks)},text:function(e){return jc(e.text)},literal:function(e){return jc(e.wsStart)+jc(e.literal)+jc(e.wsEnd)},identifier:function(e){return jc(e.identifier)+jc(e.wsEnd)},binary:function(e){return jc(e.left)+jc(e.operator)+jc(e.right)},group:function(e){return jc(e.lp)+jc(e.expression)+jc(e.rp)},unary:function(e){return jc(e.operator)+jc(e.expression)},unary_defined:function(e){return jc(e.operator)+jc(e.lp)+jc(e.identifier)+jc(e.rp)},int_constant:function(e){return jc(e.token)+jc(e.wsEnd)},elseif:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},if:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},ifdef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},ifndef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},else:function(e){return jc(e.token)+jc(e.wsEnd)+jc(e.body)},error:function(e){return jc(e.error)+jc(e.message)+jc(e.wsEnd)},undef:function(e){return jc(e.undef)+jc(e.identifier)+jc(e.wsEnd)},define:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.body)+jc(e.wsEnd)},define_arguments:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.lp)+jc(e.args)+jc(e.rp)+jc(e.body)+jc(e.wsEnd)},conditional:function(e){return jc(e.wsStart)+jc(e.ifPart)+jc(e.elseIfParts)+jc(e.elsePart)+jc(e.endif)+jc(e.wsEnd)},version:function(e){return jc(e.version)+jc(e.value)+jc(e.profile)+jc(e.wsEnd)},pragma:function(e){return jc(e.pragma)+jc(e.body)+jc(e.wsEnd)},line:function(e){return jc(e.line)+jc(e.value)+jc(e.wsEnd)},extension:function(e){return jc(e.extension)+jc(e.name)+jc(e.colon)+jc(e.behavior)+jc(e.wsEnd)}},Hc=function(e){return"string"==typeof e?e:null==e?"":Array.isArray(e)?e.map(Hc).join(""):e.type in Wc?Wc[e.type](e):"NO GENERATOR FOR ".concat(e.type)+e});const zc=jc;function Xc(e,t,n,r){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Xc.prototype),i.expected=t,i.found=n,i.location=r,i.name="SyntaxError",i}function Kc(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}function Yc(e,t){var n,r={},i=(t=void 0!==t?t:{}).grammarSource,s={program:An,constant_expression:hr},o=An,a="<<",l=">>",u="<=",c=">=",h="==",d="!=",f="&&",p="||",m="(",g=")",E=",",v="!",C="-",D="~",S="+",A="*",_="/",y="%",b="<",T=">",R="|",x="^",w="&",F=":",N="#",L="define",O="line",I="undef",k="error",M="pragma",P="defined",B="if",U="ifdef",$="ifndef",G="elif",V="else",W="endif",H="version",j="extension",z="0",X="//",K="/*",Y="*/",q=/^[A-Za-z_]/,Q=/^[A-Za-z_0-9]/,Z=/^[uU]/,J=/^[1-9]/,ee=/^[0-7]/,te=/^[xX]/,ne=/^[0-9a-fA-F]/,re=/^[0-9]/,ie=/^[\n\r]/,se=/^[^\n\r]/,oe=/^[ \t]/,ae=gn("<<",!1),le=gn(">>",!1),ue=gn("<=",!1),ce=gn(">=",!1),he=gn("==",!1),de=gn("!=",!1),fe=gn("&&",!1),pe=gn("||",!1),me=gn("(",!1),ge=gn(")",!1),Ee=gn(",",!1),ve=gn("!",!1),Ce=gn("-",!1),De=gn("~",!1),Se=gn("+",!1),Ae=gn("*",!1),_e=gn("/",!1),ye=gn("%",!1),be=gn("<",!1),Te=gn(">",!1),Re=gn("|",!1),xe=gn("^",!1),we=gn("&",!1),Fe=gn(":",!1),Ne=gn("#",!1),Le=gn("define",!1),Oe=(gn("include",!1),gn("line",!1)),Ie=gn("undef",!1),ke=gn("error",!1),Me=gn("pragma",!1),Pe=gn("defined",!1),Be=gn("if",!1),Ue=gn("ifdef",!1),$e=gn("ifndef",!1),Ge=gn("elif",!1),Ve=gn("else",!1),We=gn("endif",!1),He=gn("version",!1),je=gn("extension",!1),ze=En([["A","Z"],["a","z"],"_"],!1,!1),Xe=En([["A","Z"],["a","z"],"_",["0","9"]],!1,!1),Ke=vn("number"),Ye=En(["u","U"],!1,!1),qe=En([["1","9"]],!1,!1),Qe=gn("0",!1),Ze=En([["0","7"]],!1,!1),Je=En(["x","X"],!1,!1),et=En([["0","9"],["a","f"],["A","F"]],!1,!1),tt=En([["0","9"]],!1,!1),nt=vn("control line"),rt=En(["\n","\r"],!1,!1),it=vn("token string"),st=En(["\n","\r"],!0,!1),ot=vn("text"),at=vn("if"),lt=vn("primary expression"),ut=vn("unary expression"),ct=vn("multiplicative expression"),ht=vn("additive expression"),dt=vn("shift expression"),ft=vn("relational expression"),pt=vn("equality expression"),mt=vn("and expression"),gt=vn("exclusive or expression"),Et=vn("inclusive or expression"),vt=vn("logical and expression"),Ct=vn("logical or expression"),Dt=vn("constant expression"),St=vn("whitespace or comment"),At=gn("//",!1),_t=gn("/*",!1),yt=gn("*/",!1),bt={type:"any"},Tt=vn("whitespace"),Rt=En([" ","\t"],!1,!1),xt=function(e,t){return gr("program",{program:e.blocks,wsEnd:t})},wt=function(e,t){return gr("int_constant",{token:e,wsEnd:t})},Ft=function(e,t){return gr("literal",{literal:e,wsEnd:t})},Nt=function(e){return"#"},Lt=function(e,t,n){return gr("literal",{literal:t,wsStart:e,wsEnd:n})},Ot=function(e,t){return gr("identifier",{identifier:e,wsEnd:t})},It=function(e){return gr("identifier",{identifier:e})},kt=function(e){return gr("text",{text:e.join("")})},Mt=function(e){return gr("segment",{blocks:e})},Pt=function(e,t,n,r,i){return[r,...i.flat()]},Bt=function(e,t,n,r,i,s){return gr("define_arguments",{define:e,identifier:t,lp:n,args:r||[],rp:i,body:s})},Ut=function(e,t,n){return gr("define",{define:e,identifier:t,body:n})},$t=function(e,t){return gr("line",{line:e,value:t})},Gt=function(e,t){return gr("undef",{undef:e,identifier:t})},Vt=function(e,t){return gr("error",{error:e,message:t})},Wt=function(e,t){return gr("pragma",{pragma:e,body:t})},Ht=function(e,t,n){return gr("version",{version:e,value:t,profile:n})},jt=function(e,t,n,r){return gr("extension",{extension:e,name:t,colon:n,behavior:r})},zt=function(e,t){return{...e,wsEnd:t}},Xt=function(e,t,n){return{...e,body:n,wsEnd:t}},Kt=function(e,t,n,r,i){return gr("elseif",{token:t,expression:n,wsEnd:r,body:i})},Yt=function(e,t,n,r,i){return gr("else",{token:n,wsEnd:r,body:i})},qt=function(e,t,n,r,i){return gr("conditional",{ifPart:e,elseIfParts:t,elsePart:n,endif:r,wsEnd:i})},Qt=function(e,t){return gr("ifdef",{token:e,identifier:t})},Zt=function(e,t){return gr("ifndef",{token:e,identifier:t})},Jt=function(e,t){return gr("if",{token:e,expression:t})},en=function(e,t,n){return gr("group",{lp:e,expression:t,rp:n})},tn=function(e,t,n,r){return gr("unary_defined",{operator:e,lp:t,identifier:n,rp:r})},nn=function(e,t){return gr("unary",{operator:e,expression:t})},rn=function(e,t){return Cr(e,t)},sn=function(e,t){return vr(e,t)},on=function(e,t,n){return Er(t,n)},an=function(e,t){return Er(e,t.flat())},ln=function(e){return e},un=function(e){return e},cn=0,hn=[{line:1,column:1}],dn=0,fn=[],pn=0,mn={};if("startRule"in t){if(!(t.startRule in s))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=s[t.startRule]}function gn(e,t){return{type:"literal",text:e,ignoreCase:t}}function En(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function vn(e){return{type:"other",description:e}}function Cn(t){var n,r=hn[t];if(r)return r;for(n=t-1;!hn[n];)n--;for(r={line:(r=hn[n]).line,column:r.column};ndn&&(dn=cn,fn=[]),fn.push(e))}function An(){var e,t,n,i=75*cn+0,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Qn())!==r?(n=dr(),e=xt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}function _n(){var t,n,i,s=75*cn+2,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===a?(n=a,cn+=2):(n=r,0===pn&&Sn(ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function yn(){var t,n,i,s=75*cn+3,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===l?(n=l,cn+=2):(n=r,0===pn&&Sn(le)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function bn(){var t,n,i,s=75*cn+4,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===u?(n=u,cn+=2):(n=r,0===pn&&Sn(ue)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Tn(){var t,n,i,s=75*cn+5,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===c?(n=c,cn+=2):(n=r,0===pn&&Sn(ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Rn(){var t,n,i,s=75*cn+6,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===h?(n=h,cn+=2):(n=r,0===pn&&Sn(he)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function xn(){var t,n,i,s=75*cn+7,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===d?(n=d,cn+=2):(n=r,0===pn&&Sn(de)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function wn(){var t,n,i,s=75*cn+8,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===f?(n=f,cn+=2):(n=r,0===pn&&Sn(fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Fn(){var t,n,i,s=75*cn+9,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===p?(n=p,cn+=2):(n=r,0===pn&&Sn(pe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Nn(){var t,n,i,s=75*cn+10,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,40===e.charCodeAt(cn)?(n=m,cn++):(n=r,0===pn&&Sn(me)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Ln(){var t,n,i,s=75*cn+11,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,41===e.charCodeAt(cn)?(n=g,cn++):(n=r,0===pn&&Sn(ge)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function On(){var t,n,i,s=75*cn+12,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,44===e.charCodeAt(cn)?(n=E,cn++):(n=r,0===pn&&Sn(Ee)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function In(){var t,n,i,s=75*cn+14,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,45===e.charCodeAt(cn)?(n=C,cn++):(n=r,0===pn&&Sn(Ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function kn(){var t,n,i,s=75*cn+16,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,43===e.charCodeAt(cn)?(n=S,cn++):(n=r,0===pn&&Sn(Se)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Mn(){var t,n,i,s=75*cn+17,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,42===e.charCodeAt(cn)?(n=A,cn++):(n=r,0===pn&&Sn(Ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Pn(){var t,n,i,s=75*cn+18,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,47===e.charCodeAt(cn)?(n=_,cn++):(n=r,0===pn&&Sn(_e)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Bn(){var t,n,i,s=75*cn+19,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,37===e.charCodeAt(cn)?(n=y,cn++):(n=r,0===pn&&Sn(ye)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Un(){var t,n,i,s=75*cn+20,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,60===e.charCodeAt(cn)?(n=b,cn++):(n=r,0===pn&&Sn(be)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function $n(){var t,n,i,s=75*cn+21,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,62===e.charCodeAt(cn)?(n=T,cn++):(n=r,0===pn&&Sn(Te)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Gn(){var t,n,i,s=75*cn+22,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,124===e.charCodeAt(cn)?(n=R,cn++):(n=r,0===pn&&Sn(Re)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Vn(){var t,n,i,s=75*cn+23,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,94===e.charCodeAt(cn)?(n=x,cn++):(n=r,0===pn&&Sn(xe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Wn(){var t,n,i,s=75*cn+24,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,38===e.charCodeAt(cn)?(n=w,cn++):(n=r,0===pn&&Sn(we)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Hn(){var t,n,i,s=75*cn+26,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,35===e.charCodeAt(cn)?(i=N,cn++):(i=r,0===pn&&Sn(Ne)),(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Nt(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function jn(){var t,n,i,s,o,a,l=75*cn+27,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===L?(a=L,cn+=6):(a=r,0===pn&&Sn(Le)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function zn(){var t,n,i,s,o,a,l=75*cn+37,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===G?(a=G,cn+=4):(a=r,0===pn&&Sn(Ge)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function Xn(){var t,n,i,s,o,a,l=75*cn+42,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Ot(n,i)):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t}function Kn(){var t,n,i,s,o=75*cn+44,a=mn[o];return a?(cn=a.nextPos,a.result):(pn++,t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+46,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,J.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(qe)),i!==r){for(s=[],o=qn();o!==r;)s.push(o),o=qn();n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o=75*cn+47,a=mn[o];if(a)return cn=a.nextPos,a.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r){for(i=[],ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));s!==r;)i.push(s),ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));t=n=[n,i]}else cn=t,t=r;return mn[o]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+48,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r)if(te.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Je)),i!==r){for(s=[],ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));o!==r;)s.push(o),ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));t=n=[n,i,s]}else cn=t,t=r;else cn=t,t=r;return mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),t=n!==r?e.substring(t,cn):n)),pn--,t===r&&(n=r,0===pn&&Sn(Ke)),mn[o]={nextPos:cn,result:t},t)}function Yn(){var t,n=75*cn+45,i=mn[n];return i?(cn=i.nextPos,i.result):(Z.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(Ye)),mn[n]={nextPos:cn,result:t},t)}function qn(){var t,n=75*cn+49,i=mn[n];return i?(cn=i.nextPos,i.result):(re.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(tt)),mn[n]={nextPos:cn,result:t},t)}function Qn(){var e,t,n,i,s,o=75*cn+50,a=mn[o];if(a)return cn=a.nextPos,a.result;if(cn,t=[],(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}if(n!==r){for(;n!==r;)if(t.push(n),(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}}else t=r;return t!==r&&(t=Mt(t)),e=t,mn[o]={nextPos:cn,result:e},e}function Zn(){var t,n,i,s,o,a,l,u,c,h,d,f=75*cn+51,p=mn[f];if(p)return cn=p.nextPos,p.result;if(pn++,t=function(){var t,n,i,s,o,a,l,u,c=75*cn+54,h=mn[c];if(h)return cn=h.nextPos,h.result;if(t=cn,n=cn,i=function(){var t,n,i,s=75*cn+55,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+35,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===U?(a=U,cn+=5):(a=r,0===pn&&Sn(Ue)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Qt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+36,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===$?(a=$,cn+=6):(a=r,0===pn&&Sn($e)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Zt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+34,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,2)===B?(a=B,cn+=2):(a=r,0===pn&&Sn(Be)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r?((i=Jn())===r&&(i=null),t=Jt(n,i)):(cn=t,t=r))),pn--,t===r&&(n=r,0===pn&&Sn(at)),mn[s]={nextPos:cn,result:t},t)}(),i!==r?(ie.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(rt)),s!==r?((o=Qn())===r&&(o=null),n=Xt(i,s,o)):(cn=n,n=r)):(cn=n,n=r),n!==r){for(i=[],s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s=cn,o=function(){var t,n,i,s,o,a,l=75*cn+38,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===V?(a=V,cn+=4):(a=r,0===pn&&Sn(Ve)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a!==r?((l=Qn())===r&&(l=null),s=Yt(n,i,o,a,l)):(cn=s,s=r)):(cn=s,s=r),s===r&&(s=null),o=function(){var t,n,i,s,o,a,l=75*cn+39,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===W?(a=W,cn+=5):(a=r,0===pn&&Sn(We)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a===r&&(a=null),t=qt(n,i,s,o,a)):(cn=t,t=r)}else cn=t,t=r;return mn[c]={nextPos:cn,result:t},t}(),t===r){if(t=cn,n=cn,(i=jn())!==r)if(s=function(){var t,n,i,s,o,a,l=75*cn+43,u=mn[l];if(u)return cn=u.nextPos,u.result;if(cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r&&(n=It(n)),t=n,mn[l]={nextPos:cn,result:t},t}(),s!==r)if((o=Nn())!==r){if(a=cn,(l=Xn())!==r){for(u=[],c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);c!==r;)u.push(c),c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);a=Pt(i,s,o,l,u)}else cn=a,a=r;a===r&&(a=null),(l=Ln())!==r?((u=Jn())===r&&(u=null),n=Bt(i,s,o,a,l,u)):(cn=n,n=r)}else cn=n,n=r;else cn=n,n=r;else cn=n,n=r;if(n===r&&(n=cn,(i=jn())!==r&&(s=Xn())!==r?((o=Jn())===r&&(o=null),n=Ut(i,s,o)):(cn=n,n=r),n===r)){if(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+29,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===O?(a=O,cn+=4):(a=r,0===pn&&Sn(Oe)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r){if(s=cn,o=[],(a=qn())!==r)for(;a!==r;)o.push(a),a=qn();else o=r;(s=o!==r?e.substring(s,cn):o)!==r?n=$t(i,s):(cn=n,n=r)}else cn=n,n=r;n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+30,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===I?(a=I,cn+=5):(a=r,0===pn&&Sn(Ie)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?n=Gt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+31,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===k?(a=k,cn+=5):(a=r,0===pn&&Sn(ke)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Vt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+32,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===M?(a=M,cn+=6):(a=r,0===pn&&Sn(Me)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Wt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+40,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,7)===H?(a=H,cn+=7):(a=r,0===pn&&Sn(He)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Kn())!==r?((o=Jn())===r&&(o=null),n=Ht(i,s,o)):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+41,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,9)===j?(a=j,cn+=9):(a=r,0===pn&&Sn(je)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?(o=function(){var t,n,i,s=75*cn+25,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,58===e.charCodeAt(cn)?(n=F,cn++):(n=r,0===pn&&Sn(Fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),o!==r&&(a=Jn())!==r?n=jt(i,s,o,a):(cn=n,n=r)):(cn=n,n=r))))))}n!==r?(ie.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(rt)),i===r&&(i=null),t=zt(n,i)):(cn=t,t=r)}return pn--,t===r&&(n=r,0===pn&&Sn(nt)),mn[f]={nextPos:cn,result:t},t}function Jn(){var t,n,i,s=75*cn+52,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st)),i!==r)for(;i!==r;)n.push(i),se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(it)),mn[s]={nextPos:cn,result:t},t}function er(){var t,n,i,s,o,a,l=75*cn+53,u=mn[l];if(u)return cn=u.nextPos,u.result;if(pn++,t=cn,n=cn,i=cn,pn++,s=cn,(o=pr())===r&&(o=null),35===e.charCodeAt(cn)?(a=N,cn++):(a=r,0===pn&&Sn(Ne)),a!==r?s=o=[o,a]:(cn=s,s=r),pn--,s===r?i=void 0:(cn=i,i=r),i!==r){if(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st)),o!==r)for(;o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));else s=r;s!==r?(ie.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(rt)),o===r&&(o=null),n=i=[i,s,o]):(cn=n,n=r)}else cn=n,n=r;return n===r&&(ie.test(e.charAt(cn))?(n=e.charAt(cn),cn++):(n=r,0===pn&&Sn(rt))),t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(ot)),mn[l]={nextPos:cn,result:t},t}function tr(){var t,n,i,s,o,a=75*cn+57,l=mn[a];return l?(cn=l.nextPos,l.result):(pn++,t=cn,n=function(){var t,n,i,s,o=75*cn+33,a=mn[o];return a?(cn=a.nextPos,a.result):(t=cn,n=dr(),e.substr(cn,7)===P?(i=P,cn+=7):(i=r,0===pn&&Sn(Pe)),i!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[o]={nextPos:cn,result:t},t)}(),n!==r?((i=Nn())===r&&(i=null),(s=Xn())!==r?((o=Ln())===r&&(o=null),t=tn(n,i,s,o)):(cn=t,t=r)):(cn=t,t=r),t===r&&(t=cn,(n=kn())===r&&(n=In())===r&&(n=function(){var t,n,i,s=75*cn+13,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,33===e.charCodeAt(cn)?(n=v,cn++):(n=r,0===pn&&Sn(ve)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),n===r&&(n=function(){var t,n,i,s=75*cn+15,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,126===e.charCodeAt(cn)?(n=D,cn++):(n=r,0===pn&&Sn(De)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}())),n!==r&&(i=tr())!==r?t=nn(n,i):(cn=t,t=r),t===r&&(t=function(){var e,t,n,i,s=75*cn+56,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,e=function(){var e,t,n,i=75*cn+1,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Kn())!==r?(n=dr(),e=wt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}(),e===r&&(e=cn,(t=Nn())!==r&&(n=hr())!==r&&(i=Ln())!==r?e=en(t,n,i):(cn=e,e=r),e===r&&(e=Xn())),pn--,e===r&&(t=r,0===pn&&Sn(lt)),mn[s]={nextPos:cn,result:e},e)}())),pn--,t===r&&(n=r,0===pn&&Sn(ut)),mn[a]={nextPos:cn,result:t},t)}function nr(){var e,t,n,i,s,o,a=75*cn+58,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=tr())!==r){for(n=[],i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ct)),mn[a]={nextPos:cn,result:e},e}function rr(){var e,t,n,i,s,o,a=75*cn+59,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=nr())!==r){for(n=[],i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ht)),mn[a]={nextPos:cn,result:e},e}function ir(){var e,t,n,i,s,o,a=75*cn+60,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=rr())!==r){for(n=[],i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(dt)),mn[a]={nextPos:cn,result:e},e}function sr(){var e,t,n,i,s,o,a=75*cn+61,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ir())!==r){for(n=[],i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ft)),mn[a]={nextPos:cn,result:e},e}function or(){var e,t,n,i,s,o,a=75*cn+62,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=sr())!==r){for(n=[],i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(pt)),mn[a]={nextPos:cn,result:e},e}function ar(){var e,t,n,i,s,o,a=75*cn+63,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=or())!==r){for(n=[],i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(mt)),mn[a]={nextPos:cn,result:e},e}function lr(){var e,t,n,i,s,o,a=75*cn+64,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ar())!==r){for(n=[],i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(gt)),mn[a]={nextPos:cn,result:e},e}function ur(){var e,t,n,i,s,o,a=75*cn+65,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=lr())!==r){for(n=[],i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Et)),mn[a]={nextPos:cn,result:e},e}function cr(){var e,t,n,i,s,o,a=75*cn+66,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ur())!==r){for(n=[],i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(vt)),mn[a]={nextPos:cn,result:e},e}function hr(){var e,t=75*cn+68,n=mn[t];return n?(cn=n.nextPos,n.result):(pn++,e=function(){var e,t,n,i,s,o,a=75*cn+67,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=cr())!==r){for(n=[],i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Ct)),mn[a]={nextPos:cn,result:e},e}(),pn--,e===r&&0===pn&&Sn(Dt),mn[t]={nextPos:cn,result:e},e)}function dr(){var e,t,n,i,s,o,a=75*cn+69,l=mn[a];if(l)return cn=l.nextPos,l.result;for(pn++,cn,(t=pr())===r&&(t=null),n=[],i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);return e=sn(t,n),pn--,t=r,0===pn&&Sn(St),mn[a]={nextPos:cn,result:e},e}function fr(){var t,n,i,s,o,a,l=75*cn+70,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=function(){var t,n,i,s,o,a=75*cn+71,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,e.substr(cn,2)===X?(i=X,cn+=2):(i=r,0===pn&&Sn(At)),i!==r){for(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),t===r)if(t=cn,n=function(){var t,n,i,s,o,a,l,u=75*cn+72,c=mn[u];if(c)return cn=c.nextPos,c.result;if(t=cn,n=cn,e.substr(cn,2)===K?(i=K,cn+=2):(i=r,0===pn&&Sn(_t)),i!==r){for(s=[],o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);o!==r;)s.push(o),o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);e.substr(cn,2)===Y?(o=Y,cn+=2):(o=r,0===pn&&Sn(yt)),o!==r?n=i=[i,s,o]:(cn=n,n=r)}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[u]={nextPos:cn,result:t},t}(),n!==r){for(i=[],s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);t=an(n,i)}else cn=t,t=r;return mn[l]={nextPos:cn,result:t},t}function pr(){var t,n,i,s=75*cn+73,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt)),i!==r)for(;i!==r;)n.push(i),oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(Tt)),mn[s]={nextPos:cn,result:t},t}function mr(){var t,n,i,s=75*cn+74,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,pn++,Q.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Xe)),pn--,i===r?n=void 0:(cn=n,n=r),n!==r?(i=dr(),t=un(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}e=lh(e);const gr=(e,t)=>({type:e,...t}),Er=(...e)=>e.flat().filter(e=>null!=e&&""!==e&&0!==e.length),vr=(...e)=>{return(t=Er(e.flat())).length>1?t:t[0];var t},Cr=(...e)=>e.flat().reduce((e,[t,n])=>({type:"binary",operator:t,left:e,right:n}));if((n=o())!==r&&cn===e.length)return n;throw n!==r&&cn0){for(t=1,n=1;ts.length)throw new Error("'".concat(t,"': Too many arguments for macro"));if(u.length>":return t(n)>>t(r);case"<":return t(n)":return t(n)>t(r);case"<=":return t(n)<=t(r);case">=":return t(n)>=t(r);case"==":return t(n)==t(r);case"!=":return t(n)!=t(r);case"&":return t(n)&t(r);case"^":return t(n)^t(r);case"|":return t(n)|t(r);case"&&":return t(n)&&t(r);case"||":return t(n)||t(r);default:throw new Error("Preprocessing error: Unknown binary operator ".concat(i))}},unary:function(e,t){switch(e.operator.literal){case"+":return t(e.expression);case"-":return-1*t(e.expression);case"!":return!t(e.expression);case"~":return~t(e.expression);default:throw new Error("Preprocessing error: Unknown unary operator ".concat(e.operator.literal))}}},(r=function(e){var t=n[e.type];if(!t)throw new Error("No evaluate() evaluator for ".concat(e.type));return t(e,r)})(e);var n,r}((n=sh(r,t).trim(),eh(s)(n,{grammarSource:"expression",startRule:"constant_expression"})),t)},lh=function(e,t){return void 0===t&&(t={}),e.replace(/\\[\n\r]/g,"")},uh=function(e,t){void 0===t&&(t={});var n,r,i,s,o=Object.entries(t.defines||{}).reduce(function(e,t){var n,r=t[0],i=t[1];return th(th({},e),((n={})[r]={body:i},n))},{}),a=(void 0===(n=t.preserve)&&(n={}),function(e){var t=null==n?void 0:n[e.node.type];return"function"==typeof t?t(e):t});return r={conditional:{enter:function(e){var t=e,n=t.node;a(t)||(function(e,t){return"if"===t.type?!!t.expression&&oh(ah(t.expression,e)):"ifdef"===t.type?t.identifier.identifier in e:"ifndef"===t.type?!(t.identifier.identifier in e):void 0}(o,n.ifPart)?t.replaceWith(n.ifPart.body):n.elseIfParts.reduce(function(e,n){return e||oh(ah(n.expression,o))&&(t.replaceWith(n.body),!0)},!1)||(n.elsePart?t.replaceWith(n.elsePart.body):t.remove()))}},text:{enter:function(e){var t=e;t.node.text=sh(t.node.text,o)}},define_arguments:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body,s=n.args;o[r]={args:s,body:i},!a(t)&&t.remove()}},define:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body;o[r]={body:i},!a(t)&&t.remove()}},undef:{enter:function(e){var t=e;delete o[t.node.identifier.identifier],!a(t)&&t.remove()}},error:{enter:function(e){var n=e;if(t.stopOnError)throw new Error(n.node.message);!a(n)&&n.remove()}},pragma:{enter:function(e){var t=e;!a(t)&&t.remove()}},version:{enter:function(e){var t=e;!a(t)&&t.remove()}},extension:{enter:function(e){var t=e;!a(t)&&t.remove()}},line:{enter:function(e){var t=e;!a(t)&&t.remove()}}},i=!1,(s=function(e,t,n,o,a){var l;if(!i){var u=r[e.type],c=function(e,t,n,r,i){return{node:e,parent:t,parentPath:n,key:r,index:i,stop:function(){this.stopped=!0},skip:function(){this.skipped=!0},remove:function(){this.removed=!0},replaceWith:function(e){this.replaced=e},findParent:function(e){return n?e(n)?n:n.findParent(e):n}}}(e,t,n,o,a),h=t;if(null==u?void 0:u.enter){if(u.enter(c),c.removed){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));return"number"==typeof a?h[o].splice(a,1):h[o]=null,c}if(c.replaced){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));"number"==typeof a?h[o].splice(a,1,c.replaced):h[o]=c.replaced}if(c.skipped)return c}if(c.stopped)i=!0;else if(c.replaced){var d=c.replaced;s(d,t,n,o,a)}else Object.entries(e).filter(function(e){return e[0],function(e){return function(e){return!!(null==e?void 0:e.type)}(e)||Array.isArray(e)}(e[1])}).forEach(function(t){var n=t[0],r=t[1];if(Array.isArray(r))for(var o=0,a=0;o-a{let e=!0;return n?(i({source:o,formatted:null,error:""}),function(e){return Gs(e,{parser:"glsl-parser",plugins:[Gc],printWidth:80,tabWidth:4,useTabs:!1}).then(Vc)}(o).then(t=>{e&&i({source:o,formatted:t,error:""})}).catch(t=>{if(!e)return;const n=dh(t);a.error("shader formatting failed: "+n),i({source:o,formatted:null,error:n})}),()=>{e=!1}):(i({source:o,formatted:null,error:""}),()=>{e=!1})},[n,o]);const c=n&&r.source===o?r.formatted:null;return{source:c||o,formatted:!!c,preprocessed:u,error:(r.source===o?r.error:"")||l}}(C.source,C.preprocessed,e.beautify),S=D.source,A=C.edited,_=[e.fragment?e.sourceFragmentLog:e.sourceVertexLog,e.programLog].filter(e=>!!e).join("\n"),y=!e.translated&&!D.preprocessed&&!D.formatted,b=function(e,t,n,r){return!(e||t||!n||r)}(t,A,_,y);(0,dt.useLayoutEffect)(()=>{g.current={programId:e.programId,sourceVertex:e.sourceVertex,sourceFragment:e.sourceFragment}},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!d.current)return;if(!f.current){const e=ace.edit(d.current);e.setTheme("ace/theme/monokai"),e.getSession().setMode("ace/mode/glsl"),e.setShowPrintMargin(!1),f.current=e}const t=f.current;t.setReadOnly(!e.editable||e.translated),t.getValue()!==S&&t.setValue(S,-1);const n=()=>{const n=t.getValue();e.fragment?m.current.fragment=n:m.current.vertex=n,v(t=>e.fragment?t.fragment?t:Object.assign(Object.assign({},t),{fragment:!0}):t.vertex?t:Object.assign(Object.assign({},t),{vertex:!0})),function(e,t,n,r){e&&n(!1),t&&r(!1)}(e.beautify,e.preprocessed,c,h),-1!==p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{if(p.current=-1,!function(e,t){return e.programId===t.programId&&e.sourceVertex===t.sourceVertex&&e.sourceFragment===t.sourceFragment}(g.current,e))return;const t={sourceVertex:m.current.vertex,sourceFragment:m.current.fragment,translatedSourceVertex:e.translatedSourceVertex,translatedSourceFragment:e.translatedSourceFragment,programId:e.programId};u(t)},1500)},r=e.editable&&!e.translated;return r&&t.getSession().on("change",n),()=>{r&&t.getSession().off("change",n)}},[S,e.editable,e.translated,e.fragment,e.beautify,e.preprocessed,e.sourceVertex,e.sourceFragment,e.translatedSourceVertex,e.translatedSourceFragment,e.programId,c,h,u]),(0,dt.useEffect)(()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),m.current={baseProgramId:e.programId,baseVertex:e.sourceVertex,baseFragment:e.sourceFragment,vertex:e.sourceVertex,fragment:e.sourceFragment},v({vertex:!1,fragment:!1})},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!f.current)return;const e=t||(y&&!A?_:"");f.current.getSession().setAnnotations(function(e){if(!e)return[];const t=[],n=e.split(/\r?\n/);for(const e of n){const n=e.replace(/\0/g,"").trim();if(!n)continue;let r=/^(error|warning|info)\s*:\s*\d+\s*:\s*(\d+)(?:\s*:\s*(\d+))?\s*:\s*(.*)$/i.exec(n);if(r){t.push(Pt(r[1],r[2],r[3],r[4]));continue}if(r=/^\d+\s*\(\s*(\d+)\s*\)\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[2],r[1],"",r[3]));continue}if(r=/^\d+\s*:\s*(\d+)(?:\s*\(\s*(\d+)\s*\))?\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[3],r[1],r[2],r[4]));continue}const i=/\b(error|warning|info)\b/i.exec(n);t.push({row:0,column:0,text:n,type:i?i[1].toLowerCase():"info"})}return t}(e))},[_,y,t,D.formatted,D.preprocessed,A,e.beautify,e.fragment,e.programLog,e.sourceFragmentLog,e.sourceVertexLog,e.translated]),(0,dt.useEffect)(()=>()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),f.current&&(f.current.destroy(),f.current=null)},[]);const T=(0,dt.useCallback)(e=>{e.preventDefault(),n()},[n]),R=(0,dt.useCallback)(e=>{e.preventDefault(),r()},[r]),x=(0,dt.useCallback)(e=>{e.preventDefault(),null==i||i()},[i]),w=(0,dt.useCallback)(e=>{e.preventDefault(),null==o||o()},[o]),F=(0,dt.useCallback)(e=>{e.preventDefault(),l()},[l]),N=!e.singleShader||!e.fragment,L=!e.singleShader||e.fragment,O=D.error;return(0,mt.jsxs)("div",{className:"sourceCodeComponentContainer",children:[(0,mt.jsx)("div",{className:"sourceCodeMenuComponentContainer",children:(0,mt.jsxs)("ul",{className:"sourceCodeMenuComponent",children:[N&&e.translatedSourceVertex&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:!e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedVertexSourceClicked",onClick:x,children:"Translated Vertex"})}),L&&e.translatedSourceFragment&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedFragmentSourceClicked",onClick:w,children:"Translated Fragment"})}),N&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment||e.translated?"":"active",href:"#",role:"button",commandName:"onVertexSourceClicked",onClick:T,children:"Vertex"})}),L&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&!e.translated?"active":"",href:"#",role:"button",commandName:"onFragmentSourceClicked",onClick:R,children:"Fragment"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onSourceCodeCloseClicked",onClick:F,children:"Close"})})]})}),(0,mt.jsx)("div",{className:"sourceCodeComponent",ref:d}),(0,mt.jsx)(hh,{beautify:e.beautify,capturedDiagnosticsHidden:b,fragment:e.fragment,preprocessed:e.preprocessed,processingError:O,onBeautifyChanged:c,onFragmentSourceClicked:r,onPreprocessChanged:h,onVertexSourceClicked:n})]})}function hh({beautify:e,capturedDiagnosticsHidden:t,fragment:n,preprocessed:r,processingError:i,onBeautifyChanged:s,onFragmentSourceClicked:o,onPreprocessChanged:a,onVertexSourceClicked:l}){const u=(0,dt.useCallback)(e=>{s(e.target.checked)},[s]),c=(0,dt.useCallback)(e=>{a(e.target.checked)},[a]),h=(0,dt.useCallback)(e=>{e.preventDefault(),(n?o:l)(),s(!1),a(!1)},[n,s,o,a,l]);return(0,mt.jsx)("div",{className:"sourceCodeMenuComponentFooter",children:(0,mt.jsxs)("p",{children:[(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onBeautifyChanged",checked:e,onChange:u})," Beautify"]}),(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onPreprocessChanged",checked:r,onChange:c})," Preprocess"]}),i&&(0,mt.jsx)("span",{className:"sourceCodeFormatError",role:"alert",title:i,children:"Shader processing failed"}),t&&(0,mt.jsxs)("span",{className:"sourceCodeDiagnosticsNotice",role:"status",children:["Captured diagnostics hidden."," ",(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onShowCapturedDiagnostics",onClick:h,children:"Show original with diagnostics"})]})]})})}function dh(e){return e instanceof Error?e.message:String(e)}function fh({title:e,children:t}){const n=e?e.replace(/([A-Z])/g," $1").trim():"";return(0,mt.jsxs)("div",{className:"jsonGroupComponent",children:[(0,mt.jsx)("div",{className:"jsonGroupComponentTitle",children:n}),(0,mt.jsx)("ul",{children:t})]})}function ph({itemKey:e,value:t}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsx)("span",{className:"jsonItemComponentValue",children:t})]})}function mh({itemKey:e,value:t,pixelated:n,raw:r}){const i=bt();return(0,mt.jsx)("li",{className:"jsonItemImageHolder",children:(0,mt.jsxs)("div",{className:"jsonItemImage jsonItemImageClickable",children:[(0,mt.jsx)("img",{src:t,style:n?{imageRendering:"pixelated"}:void 0,title:"Open in texture viewer",onClick:()=>i.openTextureViewer({src:t,label:e,pixelated:n,raw:r||null})}),(0,mt.jsx)("span",{children:e})]})})}function gh({itemKey:e,value:t,help:n}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("span",{className:"jsonItemComponentValue",children:[t+" (",(0,mt.jsx)("a",{href:n,target:"_blank",className:"jsonSourceItemComponentOpen",children:"Open help page"}),")"]})]})}function Eh({visualState:e}){const t=bt();return(0,mt.jsxs)("div",{className:"jsonVisualStateItemComponent",children:[e.Attachments?e.Attachments.map((n,r)=>n.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{className:"jsonItemImageClickable",src:encodeURI(n.src),title:"Open in texture viewer",onClick:()=>t.openTextureViewer({src:n.src,label:n.attachmentName||"Attachment",pixelated:!1,raw:n.raw||null})}),e.Attachments.length>1&&(0,mt.jsx)("span",{children:n.attachmentName})]},r):null):(0,mt.jsx)("span",{children:e.FrameBufferStatus}),(0,mt.jsx)("span",{children:e.FrameBuffer?e.FrameBuffer.__SPECTOR_Object_TAG.displayText:"Canvas frame buffer"})]})}function vh({itemKey:e,shader:t,programLog:n,onOpen:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),null==r||r(t,n)},[r,n,t]),s=t.source?t.source.length:0,o=`${t.name||"Shader"} (${s} chars)`;return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("a",{href:"#",role:"button",className:"jsonSourceItemComponentOpen",commandName:"onShaderSourceOpen",onClick:i,children:["Open ",o]})]})}function Ch({items:e,onShaderSourceOpen:t}){return e&&0!==e.length?(0,mt.jsx)(mt.Fragment,{children:e.map((e,n)=>{switch(e.type){case"group":return(0,mt.jsx)(fh,{title:e.title,children:(0,mt.jsx)(Ch,{items:e.children,onShaderSourceOpen:t})},n);case"item":return(0,mt.jsx)(ph,{itemKey:e.key,value:e.value},n);case"image":return(0,mt.jsx)(mh,{itemKey:e.key,value:e.value,pixelated:e.pixelated,raw:e.raw},n);case"help":return(0,mt.jsx)(gh,{itemKey:e.key,value:e.value,help:e.help},n);case"shaderSource":return(0,mt.jsx)(vh,{itemKey:e.key,shader:e.shader,programLog:e.programLog,onOpen:t},n);case"visualState":return(0,mt.jsx)(Eh,{visualState:e.visualState},n);default:return null}})}):null}const Dh={added:"+",removed:"-",changed:"~",unchanged:" "};function Sh(e){const t=void 0===e.indexA?"_":String(e.indexA),n=void 0===e.indexB?"_":String(e.indexB);return e.type+"#"+t+"#"+n}function Ah(e){return!(!e.previousImage&&!e.currentImage)}function _h(){const e=bt(),t=pt(e.store),[n,r]=(0,dt.useState)(null);if((0,dt.useEffect)(()=>{r(null)},[t.compareRows]),!t.canCompare)return(0,mt.jsx)("div",{className:"compareViewComponent",children:(0,mt.jsx)("div",{className:"compareViewEmpty",children:"Capture the same page at least twice, then select a capture to compare it against the previous one."})});const{added:i,removed:s,changed:o,unchanged:a}=t.compareSummary,l=t.compareOnlyDifferences?t.compareRows.filter(e=>"unchanged"!==e.type):t.compareRows,u=l.find(e=>Sh(e)===n)||(l.length>0?l[0]:null),c=u?Sh(u):"";return(0,mt.jsxs)("div",{className:"compareViewComponent",children:[(0,mt.jsxs)("div",{className:"compareViewHeader",children:[(0,mt.jsx)("span",{className:"compareViewLabel",children:t.compareLabel}),(0,mt.jsxs)("span",{className:"compareViewSummary",children:[(0,mt.jsxs)("span",{className:"added",children:["+",i]}),(0,mt.jsxs)("span",{className:"removed",children:["-",s]}),(0,mt.jsxs)("span",{className:"changed",children:["~",o]}),(0,mt.jsxs)("span",{className:"unchanged",children:["=",a]})]}),(0,mt.jsxs)("label",{className:"compareViewToggle",children:[(0,mt.jsx)("input",{type:"checkbox",checked:t.compareOnlyDifferences,onChange:t=>e.handleCompareOnlyDifferencesChange(t.target.checked)}),"Differences only"]})]}),(0,mt.jsxs)("div",{className:"compareViewBody",children:[(0,mt.jsx)(yh,{}),(0,mt.jsx)("ul",{className:"compareViewList",children:0===l.length?(0,mt.jsx)("li",{className:"compareViewEmptyRow",children:"No differences between these two captures."}):l.map(e=>{const t=Sh(e);return(0,mt.jsx)(bh,{row:e,selected:t===c,onSelect:()=>r(t)},t)})}),(0,mt.jsx)("div",{className:"compareViewDetail",children:u?(0,mt.jsx)(Th,{row:u,onSelectCommand:e.handleCompareCommandSelected,onOpenTexture:(t,n)=>e.openTextureViewer({src:t,label:n,pixelated:!1,raw:null})}):(0,mt.jsx)("div",{className:"compareDetailEmpty",children:"Select a call to see its details."})})]})]})}function yh(){return(0,mt.jsxs)("div",{className:"compareViewLegend",children:[(0,mt.jsxs)("div",{className:"compareLegendRow added",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Added"]}),(0,mt.jsxs)("div",{className:"compareLegendRow removed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Removed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow changed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Changed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow unchanged",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Unchanged"]})]})}function bh(e){const{row:t,selected:n,onSelect:r}=e,i="removed"===t.type?t.previousText:t.currentText,s=i&&0===i.indexOf(t.name)?i.slice(t.name.length):"",o="compareRow "+t.type+(n?" selected":"");return(0,mt.jsxs)("li",{className:o,onClick:r,title:i,children:[(0,mt.jsx)("span",{className:"compareSign",children:Dh[t.type]}),(0,mt.jsxs)("span",{className:"compareRowText",children:[(0,mt.jsx)("span",{className:"compareCmdName",children:t.name}),s]})]})}function Th(e){const{row:t,onSelectCommand:n,onOpenTexture:r}=e,i=t.fieldDiffs||[],s=i.filter(e=>!Ah(e)),o=i.filter(Ah),a="changed"===t.type&&t.previousText!==t.currentText,l="removed"===t.type?t.previousText:t.currentText;return(0,mt.jsxs)("div",{className:"compareDetail",children:[(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Command"}),(0,mt.jsxs)("ul",{children:[(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"name"}),":"," ",(0,mt.jsx)("span",{className:"compareCmdName "+t.type,children:t.name})]}),(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"call"}),":"," ",a?(0,mt.jsxs)("span",{className:"compareTextChange",children:[(0,mt.jsx)("span",{className:"compareOld",children:t.previousText}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:t.currentText})]}):(0,mt.jsx)("span",{className:"compareNew",children:l})]}),void 0!==t.commandId&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",className:"compareCommandLink",title:"Show this command in the Commands view",onClick:e=>{e.preventDefault(),n(t.commandId)},children:"Show in Commands view →"})})]})]}),s.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Uniform & state changes"}),(0,mt.jsx)("ul",{children:s.map((e,t)=>(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),":"," ",(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:e.current})]},t))})]}),o.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Texture changes"}),(0,mt.jsx)("ul",{children:o.map((e,t)=>(0,mt.jsxs)("li",{className:"compareTextureItem",children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),(0,mt.jsxs)("div",{className:"compareImageDiff",children:[e.previousImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.previousImage,title:"Open in texture viewer",onClick:()=>r(e.previousImage,e.path+" (previous)")}):(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),e.currentImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.currentImage,title:"Open in texture viewer",onClick:()=>r(e.currentImage,e.path+" (current)")}):(0,mt.jsx)("span",{className:"compareNew",children:e.current})]})]},t))})]})]})}function Rh(e){const t=(255&e).toString(16);return 1===t.length?"0"+t:t}function xh(e,t,n,r){return"#"+Rh(e)+Rh(t)+Rh(n)+Rh(r)}function wh(e,t,n,r){const i=e=>(e/255).toFixed(2);return i(e)+", "+i(t)+", "+i(n)+", "+i(r)}function Fh(){const e=bt(),t=pt(e.store).textureViewer;return t.open?(0,mt.jsx)(Lh,{viewer:t,onClose:e.closeTextureViewer}):null}const Nh=120;function Lh(e){const{viewer:t,onClose:n}=e,r=(0,dt.useRef)(null),i=(0,dt.useRef)(null),s=(0,dt.useRef)(null),o=(0,dt.useRef)(null),[a,l]=(0,dt.useState)({r:!0,g:!0,b:!0,a:!0}),[u,c]=(0,dt.useState)(1),[h,d]=(0,dt.useState)("checker"),[f,p]=(0,dt.useState)(null),[m,g]=(0,dt.useState)(null),[E,v]=(0,dt.useState)(!1);(0,dt.useEffect)(()=>{let e=!1;const n=t=>{e||(o.current=t,p({width:t.width,height:t.height}),c(kh(t.width,t.height)),v(!0))};if(t.raw){const r=function(e){try{if(!e.data||e.width<=0||e.height<=0)return null;const t=function(e){const t=atob(e),n=new Uint8ClampedArray(t.length);for(let e=0;e{e=!0}}const r=new Image;return r.onload=()=>{const e=document.createElement("canvas");e.width=r.naturalWidth||1,e.height=r.naturalHeight||1;const t=e.getContext("2d");if(!t)return;t.drawImage(r,0,0);const i=t.getImageData(0,0,e.width,e.height);n({data:new Uint8ClampedArray(i.data),width:e.width,height:e.height})},r.src=t.src,()=>{e=!0}},[t.src,t.raw]),(0,dt.useEffect)(()=>{const e=o.current,t=r.current;if(!E||!e||!t)return;const n=function(e,t,n){let r=e.current;return r||(r=document.createElement("canvas"),e.current=r),r.width!==t&&(r.width=t),r.height!==n&&(r.height=n),r}(s,e.width,e.height),i=n.getContext("2d"),l=t.getContext("2d");if(!i||!l)return;const c=function(e,t){const n=new Uint8ClampedArray(e.length),r=t.a&&!t.r&&!t.g&&!t.b;for(let i=0;i{const e=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]);const C="textureViewerViewport"+("checker"===h?" checker":""),D="black"===h?{background:"#000"}:"white"===h?{background:"#fff"}:void 0;return(0,mt.jsx)("div",{className:"textureViewerOverlay",onClick:n,children:(0,mt.jsxs)("div",{className:"textureViewerModal",onClick:e=>e.stopPropagation(),children:[(0,mt.jsxs)("div",{className:"textureViewerHeader",children:[(0,mt.jsx)("span",{className:"textureViewerTitle",children:t.label}),(0,mt.jsxs)("span",{className:"textureViewerMeta",children:[f?f.width+" × "+f.height:"",!t.raw&&f?" · thumbnail":""]}),(0,mt.jsx)("span",{className:"textureViewerClose",title:"Close (Esc)",onClick:n,children:"✕"})]}),(0,mt.jsxs)("div",{className:"textureViewerToolbar",children:[(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Channels"}),(0,mt.jsx)(Oh,{channel:"r",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"g",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"b",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"a",mask:a,setMask:l})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"tvBtn",title:"Force alpha = 1 to reveal RGB hidden behind transparency",onClick:()=>l({r:!0,g:!0,b:!0,a:!1}),children:"Opaque"}),(0,mt.jsx)("span",{className:"tvBtn",title:"Show the alpha channel as grayscale",onClick:()=>l({r:!1,g:!1,b:!1,a:!0}),children:"Alpha → gray"})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"BG"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)(Ih,{value:"checker",glyph:"▦",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"black",glyph:"■",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"white",glyph:"□",background:h,setBackground:d})]})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Zoom"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.max(1,e/2)),children:"−"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(f?kh(f.width,f.height):1),children:"Fit"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.min(32,2*e)),children:"+"})]}),(0,mt.jsxs)("span",{className:"zoomVal",children:[Math.round(100*u),"%"]})]}),(0,mt.jsx)("div",{className:"textureViewerGroup textureViewerGroupEnd",children:(0,mt.jsx)("span",{className:"tvBtn primary",onClick:()=>{const e=s.current;e&&e.toBlob(e=>{if(!e)return;const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=((t.label||"texture").replace(/[^a-z0-9_\-]+/gi,"_").replace(/^_+|_+$/g,"")||"texture")+".png",r.click(),setTimeout(()=>URL.revokeObjectURL(n),0)})},children:"⭳ Save PNG"})})]}),(0,mt.jsxs)("div",{className:"textureViewerBody",children:[(0,mt.jsxs)("div",{className:C,style:D,children:[(0,mt.jsx)("canvas",{ref:r,className:"textureViewerCanvas",onMouseMove:e=>{const t=o.current,n=r.current,a=i.current,l=s.current;if(!t||!n)return;const c=n.getBoundingClientRect(),h=Math.floor((e.clientX-c.left)/u),d=Math.floor((e.clientY-c.top)/u);if(h<0||d<0||h>=t.width||d>=t.height)return g(null),void(a&&(a.style.display="none"));const f=4*(d*t.width+h);g({x:h,y:d,r:t.data[f],g:t.data[f+1],b:t.data[f+2],a:t.data[f+3]}),function(e,t,n,r){if(!e||!t)return;const i=e.getContext("2d");if(!i)return;i.imageSmoothingEnabled=!1,i.clearRect(0,0,Nh,Nh),i.drawImage(t,n-7,r-7,15,15,0,0,Nh,Nh),i.strokeStyle="#F0640D",i.lineWidth=2,i.strokeRect(56,56,8,8),e.style.display="block"}(a,l,h,d)},onMouseLeave:()=>{g(null),i.current&&(i.current.style.display="none")}}),(0,mt.jsx)("canvas",{ref:i,className:"textureViewerLoupe",width:Nh,height:Nh})]}),(0,mt.jsxs)("div",{className:"textureViewerRail",children:[(0,mt.jsx)("div",{className:"railTitle",children:"Pixel inspector"}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"position"}),(0,mt.jsx)("span",{className:"v",children:m?m.x+", "+m.y:"—"})]}),(0,mt.jsx)("div",{className:"swatch",children:(0,mt.jsx)("div",{className:"swatchInner",style:m?{background:"rgba("+m.r+","+m.g+","+m.b+","+m.a/255+")"}:void 0})}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"R"}),(0,mt.jsx)("span",{className:"v",children:m?m.r:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"G"}),(0,mt.jsx)("span",{className:"v",children:m?m.g:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"B"}),(0,mt.jsx)("span",{className:"v",children:m?m.b:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"A"}),(0,mt.jsx)("span",{className:"v",children:m?m.a:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"hex"}),(0,mt.jsx)("span",{className:"v",children:m?xh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"norm"}),(0,mt.jsx)("span",{className:"v",children:m?wh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"hint",children:["Move over the texture to sample pixels. Toggle channels to isolate RGB / alpha.",(0,mt.jsx)("b",{children:" Opaque"})," reveals colour hidden behind transparency (#183)."]})]})]})]})})}function Oh(e){const{channel:t,mask:n,setMask:r}=e,i=n[t],s="channel "+t+(i?" on":"");return(0,mt.jsx)("span",{className:s,onClick:()=>r(Object.assign(Object.assign({},n),{[t]:!i})),children:t.toUpperCase()})}function Ih(e){const{value:t,glyph:n,background:r,setBackground:i}=e;return(0,mt.jsx)("span",{className:"tvBtn"+(r===t?" active":""),onClick:()=>i(t),children:n})}function kh(e,t){return Math.max(1,Math.min(16,Math.floor(480/Math.max(e,t))||1))}function Mh(){const e=bt(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"resultViewComponent "+(t.visible?"active":""),children:[(0,mt.jsx)(Tt,{}),(0,mt.jsxs)(Rt,{children:[0===t.menuStatus&&(0,mt.jsx)(wt,{active:!0,captures:t.captures,onCaptureSelected:t=>{e.selectCapture(t),e.handleMenuStatusChange(40)},onSaveRequested:e.handleSaveRequested,onCaptureLoaded:e.handleCaptureLoaded}),40===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(Ft,{children:t.visualStates.map((t,n)=>(0,mt.jsx)(Nt,{item:t,onVisualStateSelected:()=>e.handleVisualStateSelected(n)},n))}),(0,mt.jsx)(Lt,{children:t.commands.map((t,n)=>(0,mt.jsx)(Ot,{command:t,onCommandSelected:()=>e.handleCommandSelected(n),onVertexSelected:()=>e.handleVertexSelected(n),onFragmentSelected:()=>e.handleFragmentSelected(n),onShaderSelected:()=>e.handleShaderSelected(n)},n))}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]}),10===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(kt,{left:!0,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationLeft})})}),(0,mt.jsx)(kt,{left:!1,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationRight})})})]}),20===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.initStateData})}),30===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.endStateData})}),60===t.menuStatus&&(0,mt.jsx)(_h,{}),50===t.menuStatus&&t.sourceCodeState&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(ch,{state:t.sourceCodeState,errorMessage:t.sourceCodeError,onVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!1),onFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!1),onTranslatedVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!0),onTranslatedFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!0),onCloseClicked:e.handleSourceCodeClose,onSourceCodeChanged:e.handleSourceCodeChanged,onBeautifyChanged:e.handleBeautifyChanged,onPreprocessChanged:e.handlePreprocessChanged}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]})]}),(0,mt.jsx)(Fh,{})]})}class Ph{static getMDNLink(e){const t=Ph.WebGL2Functions[e];if(t)return Ph.WebGL2RootUrl+t;const n=Ph.WebGLFunctions[e];if(n)return Ph.WebGLRootUrl+n;const r=Ph.AngleInstancedArraysExtFunctions[e];return r?Ph.AngleInstancedArraysExtRootUrl+r:Ph.WebGLRootUrl+e}}Ph.WebGL2RootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/",Ph.WebGLRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/",Ph.AngleInstancedArraysExtRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/",Ph.WebGL2Functions={beginQuery:"beginQuery",beginTransformFeedback:"beginTransformFeedback",bindBufferBase:"bindBufferBase",bindBufferRange:"bindBufferRange",bindSampler:"bindSampler",bindTransformFeedback:"bindTransformFeedback",bindVertexArray:"bindVertexArray",blitFramebuffer:"blitFramebuffer",clearBufferfv:"clearBuffer",clearBufferiv:"clearBuffer",clearBufferuiv:"clearBuffer",clearBufferfi:"clearBuffer",clientWaitSync:"clientWaitSync",compressedTexImage3D:"compressedTexImage3D",compressedTexSubImage3D:"compressedTexSubImage3D",copyBufferSubData:"copyBufferSubData",copyTexSubImage3D:"copyTexSubImage3D",createQuery:"createQuery",createSampler:"createSampler",createTransformFeedback:"createTransformFeedback",createVertexArray:"createVertexArray",deleteQuery:"deleteQuery",deleteSampler:"deleteSampler",deleteSync:"deleteSync",deleteTransformFeedback:"deleteTransformFeedback",deleteVertexArray:"deleteVertexArray",drawArraysInstanced:"drawArraysInstanced",drawBuffers:"drawBuffers",drawElementsInstanced:"drawElementsInstanced",drawRangeElements:"drawRangeElements",endQuery:"endQuery",endTransformFeedback:"endTransformFeedback",fenceSync:"fenceSync",framebufferTextureLayer:"framebufferTextureLayer",getActiveUniformBlockName:"getActiveUniformBlockName",getActiveUniformBlockParameter:"getActiveUniformBlockParameter",getActiveUniforms:"getActiveUniforms",getBufferSubData:"getBufferSubData",getFragDataLocation:"getFragDataLocation",getIndexedParameter:"getIndexedParameter",getInternalformatParameter:"getInternalformatParameter",getQuery:"getQuery",getQueryParameter:"getQueryParameter",getSamplerParameter:"getSamplerParameter",getSyncParameter:"getSyncParameter",getTransformFeedbackVarying:"getTransformFeedbackVarying",getUniformBlockIndex:"getUniformBlockIndex",getUniformIndices:"getUniformIndices",invalidateFramebuffer:"invalidateFramebuffer",invalidateSubFramebuffer:"invalidateSubFramebuffer",isQuery:"isQuery",isSampler:"isSampler",isSync:"isSync",isTransformFeedback:"isTransformFeedback",isVertexArray:"isVertexArray",pauseTransformFeedback:"pauseTransformFeedback",readBuffer:"readBuffer",renderbufferStorageMultisample:"renderbufferStorageMultisample",resumeTransformFeedback:"resumeTransformFeedback",samplerParameteri:"samplerParameter",samplerParameterf:"samplerParameter",texImage3D:"texImage3D",texStorage2D:"texStorage2D",texStorage3D:"texStorage3D",texSubImage3D:"texSubImage3D",transformFeedbackVaryings:"transformFeedbackVaryings",uniform1ui:"uniform",uniform2ui:"uniform",uniform3ui:"uniform",uniform4ui:"uniform",uniform1fv:"uniform",uniform2fv:"uniform",uniform3fv:"uniform",uniform4fv:"uniform",uniform1iv:"uniform",uniform2iv:"uniform",uniform3iv:"uniform",uniform4iv:"uniform",uniform1uiv:"uniform",uniform2uiv:"uniform",uniform3uiv:"uniform",uniform4uiv:"uniform",uniformBlockBinding:"uniformBlockBinding",uniformMatrix2fv:"uniformMatrix",uniformMatrix3x2fv:"uniformMatrix",uniformMatrix4x2fv:"uniformMatrix",uniformMatrix2x3fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4x3fv:"uniformMatrix",uniformMatrix2x4fv:"uniformMatrix",uniformMatrix3x4fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttribDivisor:"vertexAttribDivisor",vertexAttribI4i:"vertexAttribI",vertexAttribI4ui:"vertexAttribI",vertexAttribI4iv:"vertexAttribI",vertexAttribI4uiv:"vertexAttribI",vertexAttribIPointer:"vertexAttribIPointer",waitSync:"waitSync"},Ph.WebGLFunctions={uniform1f:"uniform",uniform1fv:"uniform",uniform1i:"uniform",uniform1iv:"uniform",uniform2f:"uniform",uniform2fv:"uniform",uniform2i:"uniform",uniform2iv:"uniform",uniform3f:"uniform",uniform3i:"uniform",uniform3iv:"uniform",uniform4f:"uniform",uniform4fv:"uniform",uniform4i:"uniform",uniform4iv:"uniform",uniformMatrix2fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttrib1f:"vertexAttrib",vertexAttrib2f:"vertexAttrib",vertexAttrib3f:"vertexAttrib",vertexAttrib4f:"vertexAttrib",vertexAttrib1fv:"vertexAttrib",vertexAttrib2fv:"vertexAttrib",vertexAttrib3fv:"vertexAttrib",vertexAttrib4fv:"vertexAttrib"},Ph.AngleInstancedArraysExtFunctions={drawArraysInstancedANGLE:"drawArraysInstancedANGLE",drawElementsInstancedANGLE:"drawElementsInstancedANGLE",vertexAttribDivisorANGLE:"vertexAttribDivisorANGLE"};const Bh={activeTexture:[["texture"]],attachShader:[["program","shader"]],beginQuery:[["target","query"]],beginTransformFeedback:[["primitiveMode"]],bindAttribLocation:[["program","index","name"]],bindBuffer:[["target","buffer"]],bindBufferBase:[["target","index","buffer"]],bindBufferRange:[["target","index","buffer","offset","size"]],bindFramebuffer:[["target","framebuffer"]],bindRenderbuffer:[["target","renderbuffer"]],bindSampler:[["unit","sampler"]],bindTexture:[["target","texture"]],bindTransformFeedback:[["target","tf"]],bindVertexArray:[["array"]],blendColor:[["red","green","blue","alpha"]],blendEquation:[["mode"]],blendEquationSeparate:[["modeRGB","modeAlpha"]],blendFunc:[["sfactor","dfactor"]],blendFuncSeparate:[["srcRGB","dstRGB","srcAlpha","dstAlpha"]],blitFramebuffer:[["srcX0","srcY0","srcX1","srcY1","dstX0","dstY0","dstX1","dstY1","mask","filter"]],bufferData:[["target","data","usage"],["target","size","usage"],["target","srcData","usage"],["target","srcData","usage","srcOffset","length"]],bufferSubData:[["target","dstByteOffset","srcData"],["target","offset","data"],["target","dstByteOffset","srcData","srcOffset","length"]],checkFramebufferStatus:[["target"]],clear:[["mask"]],clearBufferfi:[["buffer","drawbuffer","depth","stencil"]],clearBufferfv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferiv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferuiv:[["buffer","drawbuffer","values","srcOffset"]],clearColor:[["red","green","blue","alpha"]],clearDepth:[["depth"]],clearStencil:[["s"]],clientWaitSync:[["sync","flags","timeout"]],colorMask:[["red","green","blue","alpha"]],compileShader:[["shader"]],compressedTexImage2D:[["target","level","internalformat","width","height","border","data"],["target","level","internalformat","width","height","border","imageSize","offset"],["target","level","internalformat","width","height","border","srcData","srcOffset","srcLengthOverride"]],compressedTexImage3D:[["target","level","internalformat","width","height","depth","border","imageSize","offset"],["target","level","internalformat","width","height","depth","border","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage2D:[["target","level","xoffset","yoffset","width","height","format","data"],["target","level","xoffset","yoffset","width","height","format","imageSize","offset"],["target","level","xoffset","yoffset","width","height","format","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","imageSize","offset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","srcData","srcOffset","srcLengthOverride"]],copyBufferSubData:[["readTarget","writeTarget","readOffset","writeOffset","size"]],copyTexImage2D:[["target","level","internalformat","x","y","width","height","border"]],copyTexSubImage2D:[["target","level","xoffset","yoffset","x","y","width","height"]],copyTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","x","y","width","height"]],createBuffer:[[]],createFramebuffer:[[]],createProgram:[[]],createQuery:[[]],createRenderbuffer:[[]],createSampler:[[]],createShader:[["type"]],createTexture:[[]],createTransformFeedback:[[]],createVertexArray:[[]],cullFace:[["mode"]],deleteBuffer:[["buffer"]],deleteFramebuffer:[["framebuffer"]],deleteProgram:[["program"]],deleteQuery:[["query"]],deleteRenderbuffer:[["renderbuffer"]],deleteSampler:[["sampler"]],deleteShader:[["shader"]],deleteSync:[["sync"]],deleteTexture:[["texture"]],deleteTransformFeedback:[["tf"]],deleteVertexArray:[["vertexArray"]],depthFunc:[["func"]],depthMask:[["flag"]],depthRange:[["zNear","zFar"]],detachShader:[["program","shader"]],disable:[["cap"]],disableVertexAttribArray:[["index"]],drawArrays:[["mode","first","count"]],drawArraysInstanced:[["mode","first","count","instanceCount"]],drawBuffers:[["buffers"]],drawElements:[["mode","count","type","offset"]],drawElementsInstanced:[["mode","count","type","offset","instanceCount"]],drawRangeElements:[["mode","start","end","count","type","offset"]],enable:[["cap"]],enableVertexAttribArray:[["index"]],endQuery:[["target"]],endTransformFeedback:[[]],fenceSync:[["condition","flags"]],finish:[[]],flush:[[]],framebufferRenderbuffer:[["target","attachment","renderbuffertarget","renderbuffer"]],framebufferTexture2D:[["target","attachment","textarget","texture","level"]],framebufferTextureLayer:[["target","attachment","texture","level","layer"]],frontFace:[["mode"]],generateMipmap:[["target"]],getActiveAttrib:[["program","index"]],getActiveUniform:[["program","index"]],getActiveUniformBlockName:[["program","uniformBlockIndex"]],getActiveUniformBlockParameter:[["program","uniformBlockIndex","pname"]],getActiveUniforms:[["program","uniformIndices","pname"]],getAttachedShaders:[["program"]],getAttribLocation:[["program","name"]],getBufferParameter:[["target","pname"]],getBufferSubData:[["target","srcByteOffset","dstBuffer","dstOffset","length"]],getContextAttributes:[[]],getError:[[]],getExtension:[["extensionName"],["name"]],getFragDataLocation:[["program","name"]],getFramebufferAttachmentParameter:[["target","attachment","pname"]],getIndexedParameter:[["target","index"]],getInternalformatParameter:[["target","internalformat","pname"]],getParameter:[["pname"]],getProgramInfoLog:[["program"]],getProgramParameter:[["program","pname"]],getQuery:[["target","pname"]],getQueryParameter:[["query","pname"]],getRenderbufferParameter:[["target","pname"]],getSamplerParameter:[["sampler","pname"]],getShaderInfoLog:[["shader"]],getShaderParameter:[["shader","pname"]],getShaderPrecisionFormat:[["shadertype","precisiontype"]],getShaderSource:[["shader"]],getSupportedExtensions:[[]],getSyncParameter:[["sync","pname"]],getTexParameter:[["target","pname"]],getTransformFeedbackVarying:[["program","index"]],getUniform:[["program","location"]],getUniformBlockIndex:[["program","uniformBlockName"]],getUniformIndices:[["program","uniformNames"]],getUniformLocation:[["program","name"]],getVertexAttrib:[["index","pname"]],getVertexAttribOffset:[["index","pname"]],hint:[["target","mode"]],invalidateFramebuffer:[["target","attachments"]],invalidateSubFramebuffer:[["target","attachments","x","y","width","height"]],isBuffer:[["buffer"]],isContextLost:[[]],isEnabled:[["cap"]],isFramebuffer:[["framebuffer"]],isProgram:[["program"]],isQuery:[["query"]],isRenderbuffer:[["renderbuffer"]],isSampler:[["sampler"]],isShader:[["shader"]],isSync:[["sync"]],isTexture:[["texture"]],isTransformFeedback:[["tf"]],isVertexArray:[["vertexArray"]],lineWidth:[["width"]],linkProgram:[["program"]],pauseTransformFeedback:[[]],pixelStorei:[["pname","param"]],polygonOffset:[["factor","units"]],readBuffer:[["src"]],readPixels:[["x","y","width","height","format","type","dstData"],["x","y","width","height","format","type","offset"],["x","y","width","height","format","type","pixels"],["x","y","width","height","format","type","dstData","dstOffset"]],renderbufferStorage:[["target","internalformat","width","height"]],renderbufferStorageMultisample:[["target","samples","internalformat","width","height"]],resumeTransformFeedback:[[]],sampleCoverage:[["value","invert"]],samplerParameterf:[["sampler","pname","param"]],samplerParameteri:[["sampler","pname","param"]],scissor:[["x","y","width","height"]],shaderSource:[["shader","source"]],stencilFunc:[["func","ref","mask"]],stencilFuncSeparate:[["face","func","ref","mask"]],stencilMask:[["mask"]],stencilMaskSeparate:[["face","mask"]],stencilOp:[["fail","zfail","zpass"]],stencilOpSeparate:[["face","fail","zfail","zpass"]],texImage2D:[["target","level","internalformat","format","type","source"],["target","level","internalformat","width","height","border","format","type","pboOffset"],["target","level","internalformat","width","height","border","format","type","pixels"],["target","level","internalformat","width","height","border","format","type","source"],["target","level","internalformat","width","height","border","format","type","srcData","srcOffset"]],texImage3D:[["target","level","internalformat","width","height","depth","border","format","type","pboOffset"],["target","level","internalformat","width","height","depth","border","format","type","source"],["target","level","internalformat","width","height","depth","border","format","type","srcData"],["target","level","internalformat","width","height","depth","border","format","type","srcData","srcOffset"]],texParameterf:[["target","pname","param"]],texParameteri:[["target","pname","param"]],texStorage2D:[["target","levels","internalformat","width","height"]],texStorage3D:[["target","levels","internalformat","width","height","depth"]],texSubImage2D:[["target","level","xoffset","yoffset","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","pboOffset"],["target","level","xoffset","yoffset","width","height","format","type","pixels"],["target","level","xoffset","yoffset","width","height","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","srcData","srcOffset"]],texSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","pboOffset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","source"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","srcData","srcOffset"]],transformFeedbackVaryings:[["program","varyings","bufferMode"]],uniform1f:[["location","x"]],uniform1fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1i:[["location","x"]],uniform1iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1ui:[["location","v0"]],uniform1uiv:[["location","data","srcOffset","srcLength"]],uniform2f:[["location","x","y"]],uniform2fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2i:[["location","x","y"]],uniform2iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2ui:[["location","v0","v1"]],uniform2uiv:[["location","data","srcOffset","srcLength"]],uniform3f:[["location","x","y","z"]],uniform3fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3i:[["location","x","y","z"]],uniform3iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3ui:[["location","v0","v1","v2"]],uniform3uiv:[["location","data","srcOffset","srcLength"]],uniform4f:[["location","x","y","z","w"]],uniform4fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4i:[["location","x","y","z","w"]],uniform4iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4ui:[["location","v0","v1","v2","v3"]],uniform4uiv:[["location","data","srcOffset","srcLength"]],uniformBlockBinding:[["program","uniformBlockIndex","uniformBlockBinding"]],uniformMatrix2fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x3fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x3fv:[["location","transpose","data","srcOffset","srcLength"]],useProgram:[["program"]],validateProgram:[["program"]],vertexAttrib1f:[["index","x"]],vertexAttrib1fv:[["index","values"]],vertexAttrib2f:[["index","x","y"]],vertexAttrib2fv:[["index","values"]],vertexAttrib3f:[["index","x","y","z"]],vertexAttrib3fv:[["index","values"]],vertexAttrib4f:[["index","x","y","z","w"]],vertexAttrib4fv:[["index","values"]],vertexAttribDivisor:[["index","divisor"]],vertexAttribI4i:[["index","x","y","z","w"]],vertexAttribI4iv:[["index","values"]],vertexAttribI4ui:[["index","x","y","z","w"]],vertexAttribI4uiv:[["index","values"]],vertexAttribIPointer:[["index","size","type","stride","offset"]],vertexAttribPointer:[["index","size","type","normalized","stride","offset"]],viewport:[["x","y","width","height"]],waitSync:[["sync","flags","timeout"]]};class Uh{static getNames(e,t){const n=Bh[e];if(!n||0===n.length)return null;for(const e of n)if(e.length===t)return e;let r=null;for(const e of n)e.length>=t&&(null===r||e.lengthi.length&&(i=e);return i}static getName(e,t,n){const r=Uh.getNames(e,n);return r&&t>=0&&t{const e={};for(let t=0;t<64;t++)e["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;return e})();class qh{constructor(e){this.sources=e.sources||[],this.names=e.names||[],this.sourceRoot=e.sourceRoot||"",this.lines=qh.parseMappings(e.mappings||"")}originalPositionFor(e,t){const n={source:null,line:null,column:null,name:null},r=e-1;if(r<0||r>=this.lines.length)return n;const i=this.lines[r];if(!i||0===i.length)return n;const s=this.findSegment(i,t);if(!s)return n;const o=s.sourceIndex>=0&&s.sourceIndex=0&&s.nameIndex>1,o=e[s];o.generatedColumn<=t?(i=o,n=s+1):r=s-1}return i}static parseMappings(e){const t=[];let n=0,r=0,i=0,s=0;const o=e.split(";");for(let e=0;e0){const e=a.split(",");for(let t=0;t=4&&(n+=o[1],r+=o[2],i+=o[3],a.sourceIndex=n,a.originalLine=r,a.originalColumn=i,o.length>=5&&(s+=o[4],a.nameIndex=s)),l.push(a)}}l.sort((e,t)=>e.generatedColumn-t.generatedColumn),t.push(l)}return t}static decodeSegment(e){const t=[];let n=0;for(;n>>=1,t.push(o?-r:r)}return t}}var Qh=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})};class Zh{constructor(e){this.cache=new Map,this.inflight=new Map,this.fetchFn=e||("undefined"!=typeof fetch?fetch.bind(globalThis):void 0)}resolveFrames(e){return Qh(this,void 0,void 0,function*(){return e&&0!==e.length?Promise.all(e.map(e=>this.resolveFrame(e))):e||[]})}resolveFrame(e){return Qh(this,void 0,void 0,function*(){const t=Zh.parseFrame(e);if(!t)return e;let n;try{n=yield this.getConsumer(t.url)}catch(t){return e}if(!n)return e;const r=n.originalPositionFor(t.line,t.column);return r.source&&null!==r.line?Zh.formatFrame(t.functionName,r.name,r.source,r.line,r.column||0):e})}static parseFrame(e){if(!e)return null;let t=e.match(/^(.*?)\s*\((.+):(\d+):(\d+)\)\s*$/);return t?{functionName:t[1].trim(),url:t[2],line:parseInt(t[3],10),column:parseInt(t[4],10)}:(t=e.match(/^\s*(.+):(\d+):(\d+)\s*$/),t?{functionName:"",url:t[1].trim(),line:parseInt(t[2],10),column:parseInt(t[3],10)}:null)}static formatFrame(e,t,n,r,i){const s=t||e,o=n+":"+r+":"+i;return s?s+" ("+o+")":o}getConsumer(e){return Qh(this,void 0,void 0,function*(){if(this.cache.has(e))return this.cache.get(e);const t=this.inflight.get(e);if(t)return t;const n=this.loadConsumer(e).then(t=>(this.cache.set(e,t),this.inflight.delete(e),t)).catch(()=>(this.cache.set(e,null),this.inflight.delete(e),null));return this.inflight.set(e,n),n})}loadConsumer(e){return Qh(this,void 0,void 0,function*(){if(!this.fetchFn)return null;const t=yield this.fetchFn(e);if(!t.ok)return null;const n=yield t.text(),r=Zh.extractSourceMappingURL(n);if(!r)return null;let i;if(0===r.indexOf("data:"))i=Zh.parseDataUri(r);else{const t=Zh.resolveUrl(r,e),n=yield this.fetchFn(t);if(!n.ok)return null;i=yield n.json()}return i&&"string"==typeof i.mappings?new qh(i):null})}static extractSourceMappingURL(e){const t=/\/\/[#@]\s*sourceMappingURL=(\S+)\s*$/gm;let n,r=null;for(;null!==(n=t.exec(e));)r=n[1];return r}static parseDataUri(e){const t=e.indexOf(",");if(-1===t)return null;const n=e.substring(0,t),r=e.substring(t+1);try{const e=/;base64/i.test(n)?Zh.decodeBase64(r):decodeURIComponent(r);return JSON.parse(e)}catch(e){return null}}static decodeBase64(e){if("function"==typeof atob)return atob(e);const t=globalThis.Buffer;if(t)return t.from(e,"base64").toString("utf-8");throw new Error("No base64 decoder available.")}static resolveUrl(e,t){try{return new URL(e,t).href}catch(t){return e}}}function Jh(e){return e&&(e.text||e.name)||""}function ed(e,t){const n=[];if(!e||!t)return n;const r=e.DrawCall,i=t.DrawCall;ad("uniform",r&&r.uniforms,i&&i.uniforms,n),ad("uniformBlock",r&&r.uniformBlocks,i&&i.uniformBlocks,n);const s=sd(e,t);for(const r of s){if(td[r])continue;const i=e[r],s=t[r];(rd(i)||rd(s))&&od(i,s,r,n)}return n}const td={id:!0,name:!0,commandArguments:!0,result:!0,status:!0,marker:!0,text:!0,startTime:!0,commandEndTime:!0,endTime:!0,stackTrace:!0,consumeCommandId:!0,VisualState:!0},nd={__SPECTOR_Object_TAG:!0,__SPECTOR_Object_CustomData:!0,__SPECTOR_Metadata:!0,customData:!0,visual:!0,visualPixels:!0,VisualState:!0,texture:!0,sampler:!0,location:!0,source:!0,translatedSource:!0,analyserName:!0,uniforms:!0,uniformBlocks:!0,length:!0};function rd(e){return null!==e&&"object"==typeof e}function id(e){if(!rd(e))return null;const t=e.__SPECTOR_Object_TAG||("string"==typeof e.typeName&&"id"in e?e:null);return t&&"string"==typeof t.typeName?t.typeName:null}function sd(e,t){const n=[],r={},i=e=>{if(rd(e))for(const t in e)e.hasOwnProperty(t)&&!r[t]&&(r[t]=!0,n.push(t))};return i(e),i(t),n}function od(e,t,n,r,i=0){const s=id(e),o=id(t);if(null!==s||null!==o){const e=null!==s?s:"(absent)",t=null!==o?o:"(absent)";return void(e!==t&&r.push({path:n,previous:e,current:t}))}const a=rd(e),l=rd(t);if(!a&&!l){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}if(a!==l||i>=8){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}for(const s of sd(e,t))nd[s]||od(e?e[s]:void 0,t?t[s]:void 0,n+"."+s,r,i+1)}function ad(e,t,n,r){const i=hd(t),s=hd(n),o=[],a={};for(const e in i)i.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const e in s)s.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const t of o){const n=i.hasOwnProperty(t)?i[t]:void 0,o=s.hasOwnProperty(t)?s[t]:void 0,a=n?dd(n.value):"(absent)",l=o?dd(o.value):"(absent)";a!==l&&r.push({path:e+" "+t,previous:a,current:l}),ld(e+" "+t,n,o,r)}}function ld(e,t,n,r){const i=t&&t.texture,s=n&&n.texture;(rd(i)||rd(s))&&cd(e+" texture",i,s,r);const o=t&&t.textures,a=n&&n.textures,l=Array.isArray(o)?o.length:0,u=Array.isArray(a)?a.length:0,c=Math.max(l,u);for(let t=0;t0?o[t]:void 0,u>0?a[t]:void 0,r)}const ud=["width","height","depth","format","internalFormat","textureType"];function cd(e,t,n,r){(rd(t)||rd(n))&&(function(e,t,n,r){for(const i of ud){const s=t?t[i]:void 0,o=n?n[i]:void 0;if(void 0===s&&void 0===o)continue;const a=dd(s),l=dd(o);a!==l&&r.push({path:e+" "+i,previous:a,current:l})}}(e,t,n,r),function(e,t,n,r){if(rd(t)||rd(n))for(const i of sd(t,n)){const s=t?t[i]:void 0,o=n?n[i]:void 0,a="string"==typeof s,l="string"==typeof o;(a||l)&&s!==o&&r.push({path:e+" ("+i+")",previous:a?"(image)":"(absent)",current:l?"(image)":"(absent)",previousImage:a?s:void 0,currentImage:l?o:void 0})}}(e,t&&t.visual,n&&n.visual,r))}function hd(e){const t={};if(Array.isArray(e))for(const n of e)n&&"string"==typeof n.name&&(t[n.name]=n);return t}function dd(e){if(void 0===e)return"(absent)";if(null===e)return"null";try{return JSON.stringify(e)}catch(t){return String(e)}}function fd(e,t){for(let n=0;n{if(this.store.getSnapshot().currentCapture)switch(e){case 0:this._displayCaptures();break;case 40:this._displayCurrentCapture();break;case 10:this._displayInformation();break;case 20:this._displayInitState();break;case 30:this._displayEndState();break;case 60:this._displayCompare()}else this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))},this.handleSearchTextChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{searchText:e})),this._search(e)},this.handleCompareOnlyDifferencesChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{compareOnlyDifferences:e}))},this.handleCompareCommandSelected=e=>{null!=e&&(this._currentCommandId=e,this._displayCurrentCapture())},this.handleCommandSelected=e=>{this.selectCommand(e)},this.openTextureViewer=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{textureViewer:{open:!0,src:e.src,label:e.label,pixelated:e.pixelated,raw:e.raw||null}}))},this.closeTextureViewer=()=>{this.store.setState(e=>Object.assign(Object.assign({},e),{textureViewer:Object.assign(Object.assign({},e.textureViewer),{open:!1})}))},this.handleVisualStateSelected=e=>{this.selectVisualState(e)},this.handleVertexSelected=e=>{this.selectCommand(e),this._openShader(!1)},this.handleFragmentSelected=e=>{this.selectCommand(e),this._openShader(!0)},this.handleShaderSelected=e=>{var t;const n=null===(t=this.store.getSnapshot().commands[e])||void 0===t?void 0:t.capture.shader;n&&(this.selectCommand(e),this._openCapturedShader(n))},this.handleShaderSourceOpen=(e,t)=>{this._openCapturedShader(e,t)},this.handleSourceCodeChanged=e=>{this.onSourceCodeChanged.trigger(e)},this.handleSourceCodeClose=()=>{this._displayCurrentCapture()},this.handleSourceCodeTabChange=(e,t)=>{this.store.setState(n=>n.sourceCodeState?Object.assign(Object.assign({},n),{sourceCodeState:Object.assign(Object.assign({},n.sourceCodeState),{fragment:e,translated:t})}):n)},this.handleBeautifyChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{beautify:e})}):t)},this.handlePreprocessChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{preprocessed:e})}):t)},this.handleSaveRequested=e=>{this.saveCapture(e)},this.handleCaptureLoaded=e=>{this.addCapture(e)},this.handleClose=()=>{this.hide()},this._rootPlaceHolder=e||document.body,this.onSourceCodeChanged=new l,this.store=new ft(Object.assign({},pd)),this._container=document.createElement("div"),this._container.className="spector-react-result-view",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(yt.Provider,{value:this},(0,dt.createElement)(Mh))),this._rootPlaceHolder.addEventListener("keydown",e=>{if(40!==this.store.getSnapshot().menuStatus)return;const t=e.keyCode;38===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousCommand()):40===t?(e.preventDefault(),e.stopPropagation(),this._selectNextCommand()):33===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousVisualState()):34===t&&(e.preventDefault(),e.stopPropagation(),this._selectNextVisualState())})}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}addCapture(e){return this.store.setState(t=>{const n=t.captures.map(e=>({capture:e.capture,active:!1}));return Object.assign(Object.assign({},t),{captures:[{capture:e,active:!0},...n],currentCapture:e})}),this._currentCommandId=-1,this._displayCurrentCapture(),0}selectCapture(e){this._currentCommandId=-1,this.store.setState(t=>{var n,r;const i=t.captures.map((t,n)=>({capture:t.capture,active:n===e}));return Object.assign(Object.assign({},t),{captures:i,currentCapture:null!==(r=null===(n=i[e])||void 0===n?void 0:n.capture)&&void 0!==r?r:null})}),this._displayCurrentCapture()}selectCommand(e){const t=this.store.getSnapshot();if(e<0||e>=t.commands.length)return;const n=t.commands[e];this._currentCommandId=n.capture.id;const r=n.visualStateIndex,i=this._buildCommandDetail(e,t.commands,t.visualStates);this.store.setState(t=>Object.assign(Object.assign({},t),{commands:t.commands.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentCommandIndex:e,visualStates:t.visualStates.map((e,t)=>e.active!==(t===r)?Object.assign(Object.assign({},e),{active:t===r}):e),currentVisualStateIndex:r,commandDetailData:i}))}selectVisualState(e){const t=this.store.getSnapshot();if(e<0||e>=t.visualStates.length)return;const n=t.visualStates[e].commandIndex;if(n===Number.MIN_VALUE)return void this._displayInitState();if(n===Number.MAX_VALUE)return void this._displayEndState();n>=0&&(this._currentCommandId=t.commands[n].capture.id);const r=n>=0?this._buildCommandDetail(n,t.commands,t.visualStates):t.commandDetailData;this.store.setState(t=>Object.assign(Object.assign({},t),{visualStates:t.visualStates.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentVisualStateIndex:e,commands:n>=0?t.commands.map((e,t)=>e.active!==(t===n)?Object.assign(Object.assign({},e),{active:t===n}):e):t.commands,currentCommandIndex:n>=0?n:t.currentCommandIndex,commandDetailData:r}))}showSourceCodeError(e){this.store.setState(t=>Object.assign(Object.assign({},t),{sourceCodeError:e}))}saveCapture(e){const t=JSON.stringify(e,null,4),n=new Blob([t],{type:"octet/stream"}),r="capture "+new Date(e.startTime).toTimeString().split(" ")[0]+".json",i=document.createElement("a"),s=window.URL.createObjectURL(n);i.setAttribute("href",s),i.setAttribute("download",r),i.click()}_displayCaptures(){this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))}_displayCompare(){const e=this.store.getSnapshot(),t=e.captures.findIndex(e=>e.active),n=t>=0?e.captures[t]:null,r=n?e.captures[t+1]:null;if(!n||!r)return void this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:60,canCompare:!1,compareRows:[],compareSummary:{added:0,removed:0,changed:0,unchanged:0},compareLabel:""}));const i=function(e,t){const n=function(e,t){const n=e.length,r=t.length,i=e.map(Jh),s=t.map(Jh),o=[];for(let e=0;e<=n;e++)o.push(new Array(r+1).fill(0));for(let e=n-1;e>=0;e--)for(let t=r-1;t>=0;t--)o[e][t]=i[e]===s[t]?o[e+1][t+1]+1:Math.max(o[e+1][t],o[e][t+1]);const a=[];let l=[];const u=()=>{for(const e of l)a.push(e);l=[]};let c=0,h=0;for(;c0?a.push({type:"changed",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id,fieldDiffs:n}):a.push({type:"unchanged",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id}),c++,h++}else if(o[c+1][h]>=o[c][h+1])l.push({type:"removed",name:e[c].name,previousText:e[c].text,indexA:c}),c++;else{const n=fd(l,t[h].name);n?a.push({type:"changed",name:t[h].name,previousText:n.previousText,currentText:t[h].text,indexA:n.indexA,indexB:h,commandId:t[h].id,fieldDiffs:ed(e[n.indexA],t[h])}):(u(),a.push({type:"added",name:t[h].name,currentText:t[h].text,indexB:h,commandId:t[h].id})),h++}for(;cObject.assign(Object.assign({},e),{menuStatus:60,canCompare:!0,compareRows:i.rows,compareSummary:i.summary,compareLabel:s}))}static _captureLabel(e){try{return new Date(e.startTime).toTimeString().split(" ")[0]}catch(e){return"capture"}}_displayInformation(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];zh(n,"Canvas",t.canvas,e.searchText),zh(n,"Context",t.context,e.searchText);const r=[];for(const n of t.analyses){const t="Primitives"===n.analyserName?"Vertices count":n.analyserName;zh(r,t,n,e.searchText)}zh(r,"Frame Memory Changes",t.frameMemory,e.searchText),zh(r,"Total Memory (seconds since application start: bytes)",t.memory,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:10,commandCount:t.commands.length,informationLeft:n,informationRight:r}))}_displayInitState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.initState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:20,commandCount:t.commands.length,initStateData:n}))}_displayEndState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.endState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:30,commandCount:t.commands.length,endStateData:n}))}_displayCurrentCapture(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=e.searchText,r=e.captures.map(e=>({capture:e.capture,active:e.capture===t})),i=[];i.push({VisualState:t.initState.VisualState,time:t.startTime,commandIndex:Number.MIN_VALUE,active:!1,previousVisualStateIndex:-1,nextVisualStateIndex:-1});const s=[];let o=0,a=!1,l=-1,u=-1;for(let e=0;e0?c-1:-1,nextCommandIndex:-1,visualStateIndex:o,active:!1};if(c>0&&(s[c-1].nextCommandIndex=c),r.VisualState){const e=i.length,t=i.length-1,n={VisualState:r.VisualState,time:r.endTime,commandIndex:c,active:!1,previousVisualStateIndex:t,nextVisualStateIndex:-1};i[t].nextVisualStateIndex=e,i.push(n),o=e,a=!0}else a||(i[0].commandIndex=c,a=!0);h.visualStateIndex=o,s.push(h),(-1===this._currentCommandId&&0===c||this._currentCommandId===r.id)&&(l=c,u=o)}l>=0&&(s[l].active=!0,this._currentCommandId=s[l].capture.id),u>=0&&(i[u].active=!0);let c=[];l>=0&&(c=this._buildCommandDetail(l,s,i)),this.store.setState(e=>Object.assign(Object.assign({},e),{captures:r,menuStatus:40,commandCount:t.commands.length,commands:s,currentCommandIndex:l,visualStates:i,currentVisualStateIndex:u,sourceCodeState:null,sourceCodeError:"",commandDetailData:c}))}_openShader(e){const t=this.store.getSnapshot();if(t.currentCommandIndex<0||t.currentCommandIndex>=t.commands.length)return;const n=t.commands[t.currentCommandIndex].capture.DrawCall;if(!n||!n.shaders||n.shaders.length<2)return;const r={programId:n.programStatus.program.__SPECTOR_Object_TAG.id,nameVertex:n.shaders[0].name,nameFragment:n.shaders[1].name,sourceVertex:n.shaders[0].source,sourceFragment:n.shaders[1].source,translatedSourceVertex:n.shaders[0].translatedSource,translatedSourceFragment:n.shaders[1].translatedSource,fragment:e,translated:!1,editable:n.programStatus.RECOMPILABLE,beautify:!0,preprocessed:!1,singleShader:!1,sourceVertexLog:n.shaders[0].infoLog||"",sourceFragmentLog:n.shaders[1].infoLog||"",programLog:n.programStatus.infoLog||""},i=this._buildCommandDetail(t.currentCommandIndex,t.commands,t.visualStates);this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:"",commandDetailData:i}))}_openCapturedShader(e,t=""){if(!e||"string"!=typeof e.source)return;const n="FRAGMENT_SHADER"===e.shaderType,r={programId:-1,nameVertex:n?"":e.name,nameFragment:n?e.name:"",sourceVertex:n?"":e.source,sourceFragment:n?e.source:"",translatedSourceVertex:n?"":e.translatedSource||"",translatedSourceFragment:n&&e.translatedSource||"",fragment:n,translated:!1,editable:!1,beautify:!0,preprocessed:!1,singleShader:!0,sourceVertexLog:n?"":e.infoLog||"",sourceFragmentLog:n&&e.infoLog||"",programLog:t};this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:""}))}_buildCommandDetail(e,t,n){if(e<0||e>=t.length)return[];const r=t[e],i=n[r.visualStateIndex],s=this._resolvedStackTraces.get(r.capture.id),o=function(e,t,n){const r=[];t&&r.push({type:"visualState",visualState:t});let i="Unknown";switch(e.status){case 50:i="Deprecated";break;case 10:i="Unused";break;case 20:i="Disabled";break;case 30:i="Redundant";break;case 40:i="Valid"}const s=Ph.getMDNLink(e.name);e.result?zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,result:e.result,status:i},""):"LOG"!==e.name&&zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,status:i},"");for(const t in e)"VisualState"!==t&&"result"!==t&&("commandArguments"===t&&Array.isArray(e.commandArguments)?Kh(r,e.name,e.commandArguments):Xh(r,t,e)||("stackTrace"===t&&Array.isArray(e.stackTrace)?zh(r,"stackTrace",n||e.stackTrace,""):"object"==typeof e[t]&&zh(r,t,e[t],"")));return r}(r.capture,null==i?void 0:i.VisualState,s);return s||this._resolveStackTraceAsync(r.capture),o}_resolveStackTraceAsync(e){const t=e.id;this._resolvedStackTraces.has(t)||this._resolvingStackTraces.has(t)||e.stackTrace&&0!==e.stackTrace.length&&(this._resolvingStackTraces.add(t),this._sourceMapResolver.resolveFrames(e.stackTrace).then(n=>{this._resolvingStackTraces.delete(t),this._resolvedStackTraces.set(t,n);let r=!1;for(let t=0;tObject.assign(Object.assign({},t),{commandDetailData:e}))}}).catch(()=>{this._resolvingStackTraces.delete(t)}))}_selectPreviousCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.previousCommandIndex<0||this.selectCommand(t.previousCommandIndex)}_selectNextCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.nextCommandIndex<0||this.selectCommand(t.nextCommandIndex)}_selectPreviousVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.previousVisualStateIndex<0||this.selectVisualState(t.previousVisualStateIndex)}_selectNextVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.nextVisualStateIndex<0||this.selectVisualState(t.nextVisualStateIndex)}_search(e){switch(this.store.getSnapshot().menuStatus){case 0:case 40:this._displayCurrentCapture();break;case 30:this._displayEndState();break;case 10:this._displayInformation();break;case 20:this._displayInitState()}this.store.setState(e=>Object.assign(Object.assign({},e),{searchText:""}))}}class gd{constructor(e,t={}){this.worker=e,this.captureTimeout=t.captureTimeout||1e4,this.disposed=!1,this.captureTimer=null,this.onCapture=new l,this.onCaptureStarted=new l,this.onError=new l,this.onFps=new l,this.onContextReady=new l,this.messageHandler=this.handleMessage.bind(this),this.worker.addEventListener("message",this.messageHandler)}triggerCapture(e=0,t=0,n=!1,r=!1){if(this.disposed)return;this.clearCaptureTimer();const i={type:"spector:trigger-capture",version:1,canvasIndex:e,commandCount:t,quickCapture:n,fullCapture:r};this.worker.postMessage(i),this.captureTimer=setTimeout(()=>{this.onError.trigger("Capture timed out after "+this.captureTimeout+"ms"),this.captureTimer=null},this.captureTimeout)}dispose(){this.disposed||(this.disposed=!0,this.clearCaptureTimer(),this.worker.removeEventListener("message",this.messageHandler),this.onCapture.clear(),this.onCaptureStarted.clear(),this.onError.clear(),this.onFps.clear(),this.onContextReady.clear())}handleMessage(e){const t=e.data;if(!function(e){return null!=e&&"object"==typeof e&&"string"==typeof e.type&&0===e.type.indexOf("spector:")}(t))return;const n=t;switch(n.type){case"spector:context-ready":this.onContextReady.trigger({canvasCount:n.canvasCount,canvasWidth:n.canvasWidth,canvasHeight:n.canvasHeight});break;case"spector:capture-started":this.onCaptureStarted.trigger(void 0);break;case"spector:capture-complete":this.clearCaptureTimer(),this.onCapture.trigger(n.capture);break;case"spector:error":this.clearCaptureTimer(),this.onError.trigger(n.error);break;case"spector:fps":this.onFps.trigger(n.fps)}}clearCaptureTimer(){null!=this.captureTimer&&(clearTimeout(this.captureTimer),this.captureTimer=null)}}var Ed=n(72),vd=n.n(Ed),Cd=n(825),Dd=n.n(Cd),Sd=n(659),Ad=n.n(Sd),_d=n(56),yd=n.n(_d),bd=n(540),Td=n.n(bd),Rd=n(113),xd=n.n(Rd),wd=n(377),Fd={};Fd.styleTagTransform=xd(),Fd.setAttributes=yd(),Fd.insert=Ad().bind(null,"html"),Fd.domAPI=Dd(),Fd.insertStyleElement=Td(),vd()(wd.A,Fd),wd.A&&wd.A.locals&&wd.A.locals;var Nd=n(160),Ld={};Ld.styleTagTransform=xd(),Ld.setAttributes=yd(),Ld.insert=Ad().bind(null,"html"),Ld.domAPI=Dd(),Ld.insertStyleElement=Td(),vd()(Nd.A,Ld),Nd.A&&Nd.A.locals&&Nd.A.locals;class Od{constructor(e){this.timeSpy=e,this.init()}spyXRSession(e){this.currentXRSession&&this.unspyXRSession();for(const e of at.getRequestAnimationFrameFunctionNames())y.resetOriginFunction(this.timeSpy.getSpiedScope(),e);this.timeSpy.spyRequestAnimationFrame("requestAnimationFrame",e),this.currentXRSession=e}unspyXRSession(){if(this.currentXRSession){y.resetOriginFunction(this.currentXRSession,"requestAnimationFrame"),this.currentXRSession=void 0;for(const e of at.getRequestAnimationFrameFunctionNames())this.timeSpy.spyRequestAnimationFrame(e,this.timeSpy.getSpiedScope())}}init(){if(!navigator.xr)return;class e extends XRWebGLLayer{constructor(e,t,n){super(e,t,n),this.glContext=t}getContext(){return this.glContext}}class t extends XRWebGLBinding{constructor(e,t){super(e,t),this.glContext=t}createProjectionLayer(e){const t=super.createProjectionLayer(e);return t.glContext=this.glContext,t}}window.XRWebGLLayer=e,window.XRWebGLBinding=t;const n=navigator.xr.requestSession;Object.defineProperty(navigator.xr,"requestSessionInternal",{writable:!0}),navigator.xr.requestSessionInternal=n,Object.defineProperty(navigator.xr,"requestSession",{writable:!0}),navigator.xr.requestSession=(e,t)=>((e,t)=>navigator.xr.requestSessionInternal(e,t).then(e=>{const t=e;return t._updateRenderState=e.updateRenderState,t.updateRenderState=e=>function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){if(e.baseLayer){const n=e.baseLayer;t.glContext=n.getContext()}if(e.layers)for(const n of e.layers){const e=n;e.glContext&&(t.glContext=e.glContext)}return t._updateRenderState(e)}),this.spyXRSession(t),e.addEventListener("end",()=>{this.unspyXRSession()}),Promise.resolve(e)}))(e,t)}}const Id={CaptureMenu:_t,ResultView:md};class kd{static getFirstAvailable3dContext(e){return this.tryGetContextFromHelperField(e)||this.tryGetContextFromCanvas(e,"webgl")||this.tryGetContextFromCanvas(e,"experimental-webgl")||this.tryGetContextFromCanvas(e,"webgl2")||this.tryGetContextFromCanvas(e,"experimental-webgl2")}static tryGetContextFromHelperField(e){const t=e instanceof HTMLCanvasElement?e.getAttribute("__spector_context_type"):e.__spector_context_type;if(t)return this.tryGetContextFromCanvas(e,t)}static tryGetContextFromCanvas(e,t){let n;try{n=e.getContext(t)}catch(e){}return n}constructor(e={}){this.noFrameTimeout=-1,this.options=Object.assign({enableXRCapture:!1},e),this.captureNextFrames=0,this.captureNextCommands=0,this.quickCapture=!1,this.fullCapture=!1,this.retry=0,this.contexts=[],this.workerBridges=new Map,this.timeSpy=new at,this.onCaptureStarted=new l,this.onCapture=new l,this.onError=new l,this.timeSpy.onFrameStart.add(this.onFrameStart,this),this.timeSpy.onFrameEnd.add(this.onFrameEnd,this),this.timeSpy.onError.add(this.onErrorInternal,this),ct.install(),this.options.enableXRCapture&&(this.xrSpy=new Od(this.timeSpy))}displayUI(e=!1){this.captureMenu||(this.getCaptureUI(),this.captureMenu.onPauseRequested.add(this.pause,this),this.captureMenu.onPlayRequested.add(this.play,this),this.captureMenu.onPlayNextFrameRequested.add(this.playNextFrame,this),this.captureMenu.onCaptureRequested.add(e=>{e&&(e.ref instanceof Worker?this.captureWorker(e.ref):this.captureCanvas(e.ref))},this),setInterval(()=>{this.captureMenu.setFPS(this.getFps())},1e3),e||this.captureMenu.trackPageCanvases(),this.captureMenu.display()),this.resultView||(this.getResultUI(),this.onCapture.add(e=>{this.resultView.display(),this.resultView.addCapture(e)}))}getResultUI(){return this.resultView||(this.resultView=new md,this.resultView.onSourceCodeChanged.add(e=>{this.rebuildProgramFromProgramId(e.programId,e.sourceVertex,e.sourceFragment,t=>{this.referenceNewProgram(e.programId,t),this.resultView.showSourceCodeError(null)},e=>{this.resultView.showSourceCodeError(e)})})),this.resultView}getCaptureUI(){return this.captureMenu||(this.captureMenu=new _t),this.captureMenu}rebuildProgramFromProgramId(e,t,n,r,i){const s=Pe.getFromGlobalStore(e);this.rebuildProgram(s,t,n,r,i)}rebuildProgram(e,t,n,r,i){o.rebuildProgram(e,t,n,r,i)}referenceNewProgram(e,t){Pe.updateInGlobalStore(e,t)}pause(){this.timeSpy.changeSpeedRatio(0)}play(){this.timeSpy.changeSpeedRatio(1)}playNextFrame(){this.timeSpy.playNextFrame()}drawOnlyEveryXFrame(e){this.timeSpy.changeSpeedRatio(e)}getFps(){return this.timeSpy.getFps()}spyCanvases(){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt,this.canvasSpy.onContextRequested.add(this.spyContext,this))}spyCanvas(e){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt(e),this.canvasSpy.onContextRequested.add(this.spyContext,this))}getAvailableContexts(){return this.contexts}setShaderCompileDelay(e){ct.install(),ct.setDelay(e)}clearShaderCompileDelay(){ct.setDelay(0)}getShaderCompileDelay(){return ct.getDelay()}captureCanvas(e,t=0,n=!1,r=!1){const i=this.getAvailableContextSpyByCanvas(e);if(i)this.captureContextSpy(i,t,n,r);else{const i=kd.getFirstAvailable3dContext(e);i?this.captureContext(i,t,n,r):a.error("No webgl context available on the chosen canvas.")}}captureContext(e,t=0,n=!1,r=!1){let i=this.getAvailableContextSpyByCanvas(e.canvas);i||(i=e.getIndexedParameter?new ot({context:e,version:2,recordAlways:!1}):new ot({context:e,version:1,recordAlways:!1}),i.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:i.context.canvas,contextSpy:i})),i&&this.captureContextSpy(i,t,n,r)}captureXRContext(e=0,t=!1,n=!1){this.captureContext(this.getXRContext(),e,t,n)}captureContextSpy(e,t=0,n=!1,r=!1){this.quickCapture=n,this.fullCapture=r,this.capturingContext?this.onErrorInternal("Already capturing a context."):(this.retry=0,this.capturingContext=e,this.capturingContext.setMarker(this.marker),(t=Math.min(t,1e4))>0?this.captureCommands(t):this.captureFrames(1),this.noFrameTimeout=setTimeout(()=>{t>0?this.stopCapture():this.capturingContext&&this.retry>1?this.onErrorInternal("No frames with gl commands detected. Try moving the camera."):this.onErrorInternal("No frames detected. Try moving the camera or implementing requestAnimationFrame.")},1e4))}captureNextFrame(e,t=!1,n=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,0,t,n):this.captureContext(e,0,t,n)}startCapture(e,t,n=!1,r=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,t,n,r):this.captureContext(e,t,n,r)}stopCapture(){if(this.capturingContext){const e=this.capturingContext.stopCapture();if(e.commands.length>0)return this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),this.triggerCapture(e),this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,e;0===this.captureNextCommands&&(this.retry++,this.captureFrames(1))}}setMarker(e){this.marker=e,this.capturingContext&&this.capturingContext.setMarker(e)}clearMarker(){this.marker=null,this.capturingContext&&this.capturingContext.clearMarker()}addRequestAnimationFrameFunctionName(e){this.timeSpy.addRequestAnimationFrameFunctionName(e)}setSpiedScope(e){this.timeSpy.setSpiedScope(e)}log(e){this.capturingContext&&this.capturingContext.log(e)}spyWorkers(e="spector.worker.bundle.js"){ut.startIntercepting(e)}stopSpyingWorkers(){ut.stopIntercepting()}spyWorker(e){let t=this.workerBridges.get(e);return t||(t=new gd(e),t.onCapture.add(e=>{this.triggerCapture(e)},this),t.onError.add(e=>{this.onErrorInternal(e)},this),t.onContextReady.add(t=>{if(this.captureMenu){const n=this.workerBridges.size;this.captureMenu.addCanvasInformation({id:"Worker "+n,width:t.canvasWidth,height:t.canvasHeight,ref:e})}},this),t.onFps.add(e=>{this.captureMenu&&this.captureMenu.setFPS(e)},this),this.workerBridges.set(e,t),t)}captureWorker(e,t=0,n=!1,r=!1){this.spyWorker(e).triggerCapture(0,t,n,r)}captureFrames(e){this.captureNextFrames=e,this.captureNextCommands=0,this.playNextFrame()}captureCommands(e){this.captureNextFrames=0,this.captureNextCommands=e,this.play(),this.capturingContext?(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(e,this.quickCapture,this.fullCapture)):(this.onErrorInternal("No context to capture from."),this.captureNextCommands=0)}spyContext(e){let t=this.getAvailableContextSpyByCanvas(e.context.canvas);t||(t=new ot({context:e.context,version:e.contextVersion,recordAlways:!0}),t.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:t.context.canvas,contextSpy:t})),t.spy()}getAvailableContextSpyByCanvas(e){for(const t of this.contexts)if(t.canvas===e)return t.contextSpy}getXRContext(){return this.options.enableXRCapture||a.error("Cannot retrieve WebXR context if capturing WebXR is disabled."),this.xrSpy.currentXRSession||a.error("No currently active WebXR session."),this.xrSpy.currentXRSession.glContext}onFrameStart(){this.captureNextCommands>0||(this.captureNextFrames>0?(this.capturingContext&&(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(0,this.quickCapture,this.fullCapture)),this.captureNextFrames--):this.capturingContext=void 0)}onFrameEnd(){this.captureNextCommands>0||0===this.captureNextFrames&&this.stopCapture()}triggerCapture(e){this.captureMenu&&this.captureMenu.captureComplete(null),this.onCapture.trigger(e)}onErrorInternal(e){if(a.error(e),this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),!this.capturingContext)throw e;this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,this.retry=0,this.captureMenu&&this.captureMenu.captureComplete(e),this.onError.trigger(e)}}},180(e,t,n){e=n.nmd(e),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/lang"),s=e("../lib/event"),o='.ace_search {background-color: #ddd;color: #666;border: 1px solid #cbcbcb;border-top: 0 none;overflow: hidden;margin: 0;padding: 4px 6px 0 4px;position: absolute;top: 0;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {margin: 0 20px 4px 0;overflow: hidden;line-height: 1.9;}.ace_replace_form {margin-right: 0;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {border-radius: 3px 0 0 3px;background-color: white;color: black;border: 1px solid #cbcbcb;border-right: 0 none;outline: 0;padding: 0;font-size: inherit;margin: 0;line-height: inherit;padding: 0 6px;min-width: 17em;vertical-align: top;min-height: 1.8em;box-sizing: content-box;}.ace_searchbtn {border: 1px solid #cbcbcb;line-height: inherit;display: inline-block;padding: 0 6px;background: #fff;border-right: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;margin: 0;position: relative;color: #666;}.ace_searchbtn:last-child {border-radius: 0 3px 3px 0;border-right: 1px solid #cbcbcb;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn:hover {background-color: #eef1f6;}.ace_searchbtn.prev, .ace_searchbtn.next {padding: 0px 0.7em}.ace_searchbtn.prev:after, .ace_searchbtn.next:after {content: "";border: solid 2px #888;width: 0.5em;height: 0.5em;border-width: 2px 0 0 2px;display:inline-block;transform: rotate(-45deg);}.ace_searchbtn.next:after {border-width: 0 2px 2px 0 ;}.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;font: 16px/16px Arial;padding: 0;height: 14px;width: 14px;top: 9px;right: 7px;position: absolute;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;box-sizing: border-box!important;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;clear: both;}.ace_search_counter {float: left;font-family: arial;padding: 0 8px;}',a=e("../keyboard/hash_handler").HashHandler,l=e("../lib/keys");r.importCssString(o,"ace_searchbox");var u=function(e,t,n){var i=r.createElement("div");r.buildDom(["div",{class:"ace_search right"},["span",{action:"hide",class:"ace_searchbtn_close"}],["div",{class:"ace_search_form"},["input",{class:"ace_search_field",placeholder:"Search for",spellcheck:"false"}],["span",{action:"findPrev",class:"ace_searchbtn prev"},"​"],["span",{action:"findNext",class:"ace_searchbtn next"},"​"],["span",{action:"findAll",class:"ace_searchbtn",title:"Alt-Enter"},"All"]],["div",{class:"ace_replace_form"},["input",{class:"ace_search_field",placeholder:"Replace with",spellcheck:"false"}],["span",{action:"replaceAndFindNext",class:"ace_searchbtn"},"Replace"],["span",{action:"replaceAll",class:"ace_searchbtn"},"All"]],["div",{class:"ace_search_options"},["span",{action:"toggleReplace",class:"ace_button",title:"Toggle Replace mode",style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{class:"ace_search_counter"}],["span",{action:"toggleRegexpMode",class:"ace_button",title:"RegExp Search"},".*"],["span",{action:"toggleCaseSensitive",class:"ace_button",title:"CaseSensitive Search"},"Aa"],["span",{action:"toggleWholeWords",class:"ace_button",title:"Whole Word Search"},"\\b"],["span",{action:"searchInSelection",class:"ace_button",title:"Search In Selection"},"S"]]],i),this.element=i.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),r.importCssString(o,"ace_searchbox",e.container)};(function(){this.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},this.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;s.addListener(e,"mousedown",function(e){setTimeout(function(){t.activeInput.focus()},0),s.stopPropagation(e)}),s.addListener(e,"click",function(e){var n=(e.target||e.srcElement).getAttribute("action");n&&t[n]?t[n]():t.$searchBarKb.commands[n]&&t.$searchBarKb.commands[n].exec(t),s.stopPropagation(e)}),s.addCommandKeyListener(e,function(e,n,r){var i=l.keyCodeToString(r),o=t.$searchBarKb.findKeyCommand(n,i);o&&o.exec&&(o.exec(t),s.stopEvent(e))}),this.$onChange=i.delayedCall(function(){t.find(!1,!1)}),s.addListener(this.searchInput,"input",function(){t.$onChange.schedule(20)}),s.addListener(this.searchInput,"focus",function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()}),s.addListener(this.replaceInput,"focus",function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()})},this.$closeSearchBarKb=new a([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new a,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.editor.getReadOnly()||(e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus())},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),this.setSearchRange=function(e){this.searchRange=e,e?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(e){r.setCssClass(this.replaceOption,"checked",this.searchRange),r.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var t=this.editor.getReadOnly();this.replaceOption.style.display=t?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!t?"":"none",this.find(!1,!1,e)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,n){var i=!this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n,range:this.searchRange})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",i),this.editor._emit("findSearchBox",{match:!i}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,n=0,r=0;if(t){var i=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),s=e.session.doc.positionToIndex(e.selection.anchor);this.searchRange&&(s-=e.session.doc.positionToIndex(this.searchRange.start));for(var o,a=t.lastIndex=0;(o=t.exec(i))&&(n++,(a=o.index)<=s&&r++,!(n>999))&&(o[0]||(t.lastIndex=a+=1,!(a>=i.length))););}this.searchCounter.textContent=r+" of "+(n>999?"999+":n)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(u.prototype),t.SearchBox=u,t.Search=function(e,t){(e.searchBox||new u(e)).show(e.session.getTextRange(),t)}}),ace.require(["ace/ext/searchbox"],function(t){e&&(e.exports=t)})},49(e,t,n){e=n.nmd(e),ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=t.cFunctions="\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b",a=function(){var e=this.$keywords=this.createKeywordMapper({"keyword.control":"break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while|catch|operator|try|throw|using","storage.type":"asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|class|wchar_t|template|char16_t|char32_t","storage.modifier":"const|extern|register|restrict|static|volatile|inline|private|protected|public|friend|explicit|virtual|export|mutable|typename|constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local","keyword.operator":"and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace","variable.language":"this","constant.language":"NULL|true|false|TRUE|FALSE|nullptr"},"identifier"),t=/\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source,n="%"+/(\d+\$)?/.source+/[#0\- +']*/.source+/[,;:_]?/.source+/((-?\d+)|\*(-?\d+\$)?)?/.source+/(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source+/(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source+/(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source;this.$rules={start:[{token:"comment",regex:"//$",next:"start"},{token:"comment",regex:"//",next:"singleLineComment"},i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string",regex:"'(?:"+t+"|.)?'"},{token:"string.start",regex:'"',stateName:"qqstring",next:[{token:"string",regex:/\\\s*$/,next:"qqstring"},{token:"constant.language.escape",regex:t},{token:"constant.language.escape",regex:n},{token:"string.end",regex:'"|$',next:"start"},{defaultToken:"string"}]},{token:"string.start",regex:'R"\\(',stateName:"rawString",next:[{token:"string.end",regex:'\\)"',next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"keyword",regex:"#\\s*(?:include|import|pragma|line|define|undef|version)\\b",next:"directive"},{token:"keyword",regex:"#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b"},{token:"support.function.C99.c",regex:o},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*"},{token:"keyword.operator",regex:/--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],singleLineComment:[{token:"comment",regex:/\\$/,next:"singleLineComment"},{token:"comment",regex:/$/,next:"start"},{defaultToken:"comment"}],directive:[{token:"constant.other.multiline",regex:/\\/},{token:"constant.other.multiline",regex:/.*\\/},{token:"constant.other",regex:"\\s*<.+?>",next:"start"},{token:"constant.other",regex:'\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',next:"start"},{token:"constant.other",regex:"\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",next:"start"},{token:"constant.other",regex:/[^\\\/]+/,next:"start"}]},this.embedRules(i,"doc-",[i.getEndRule("start")]),this.normalizeRules()};r.inherits(a,s),t.c_cppHighlightRules=a}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var i=n[1].length,s=e.findMatchingBracket({row:t,column:i});if(!s||s.row==t)return 0;var o=this.$getIndent(e.getLine(s.row));e.replace(new r(t,0,t,i-1),o)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i,s=e.getLine(n);if(this.startRegionRe.test(s))return this.getCommentRegionBlock(e,s,n);if(i=s.match(this.foldingStartMarker)){var o=i.index;if(i[1])return this.openingBracketBlock(e,i[1],n,o);var a=e.getCommentFoldRange(n,o+i[0].length,1);return a&&!a.isMultiLine()&&(r?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(i=s.match(this.foldingStopMarker))?(o=i.index+i[0].length,i[1]?this.closingBracketBlock(e,i[1],n,o):e.getCommentFoldRange(n,o,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length,a=t+=1,l=e.getLength();++tu)break;var c=this.getFoldWidgetRange(e,"all",t);if(c){if(c.start.row<=s)break;if(c.isMultiLine())t=c.end.row;else if(r==u)break}a=t}}return new i(s,o,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\s*$/),s=e.getLength(),o=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++no)return new i(o,r,n,t.length)}}.call(o.prototype)}),ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./c_cpp_highlight_rules").c_cppHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&"comment"==s[s.length-1].type)return r;if("start"==e)(a=t.match(/^.*[\{\(\[]\s*$/))&&(r+=n);else if("doc-start"==e){if("start"==o)return"";var a;(a=t.match(/^\s*(\/?)\*/))&&(a[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/c_cpp"}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/glsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/c_cpp_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp_highlight_rules").c_cppHighlightRules,s=function(){var e=this.createKeywordMapper({"variable.language":"this",keyword:"layout|attribute|const|uniform|varying|break|continue|do|for|while|if|else|in|out|inout|float|int|void|bool|true|false|lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|samplerCube|struct","constant.language":"radians|degrees|sin|cos|tan|asin|acos|atan|pow|exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|normalize|faceforward|reflect|refract|matrixCompMult|lessThan|lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|texture2DProjLod|textureCube|textureCubeLod|gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|gl_DepthRangeParameters|gl_DepthRange|gl_Position|gl_PointSize|gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData"},"identifier");this.$rules=(new i).$rules,this.$rules.start.forEach(function(t){"function"==typeof t.token&&(t.token=e)})};r.inherits(s,i),t.glslHighlightRules=s}),ace.define("ace/mode/glsl",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/glsl_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp").Mode,s=e("./glsl_highlight_rules").glslHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.$id="ace/mode/glsl"}.call(u.prototype),t.Mode=u}),ace.require(["ace/mode/glsl"],function(t){e&&(e.exports=t)})},429(e,t,n){e=n.nmd(e),ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.require(["ace/theme/monokai"],function(t){e&&(e.exports=t)})}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r](s,s.exports,n),s.loaded=!0,s.exports}return n.amdD=function(){throw new Error("define cannot be used indirect")},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.nc=void 0,n(832),n(49),n(429),n(902),n(180),n(878)})()); }; diff --git a/extensions/spector.bundle.js b/extensions/spector.bundle.js index 662efd1..3c6dcc0 100644 --- a/extensions/spector.bundle.js +++ b/extensions/spector.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see spector.bundle.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("SPECTOR",[],t):"object"==typeof exports?exports.SPECTOR=t():e.SPECTOR=t()}(self,()=>(()=>{var e={377(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.captureMenuComponent{position:absolute;padding:7px;z-index:99999;top:10px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuComponent.active{visibility:visible;display:block}.captureMenuComponent,.captureMenuComponent:after,.captureMenuComponent:before{box-sizing:content-box}.captureMenuLogComponent{position:absolute;padding:7px;z-index:80000;top:66px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuLogComponent.active{visibility:visible;display:block}.captureMenuLogComponent,.captureMenuLogComponent:after,.captureMenuLogComponent:before{box-sizing:content-box}.captureMenuLogComponent span.error{color:red}.canvasListComponent{float:left;width:50%;height:100%}.canvasListComponent [commandName=onCanvasSelection]{vertical-align:center;line-height:40px;white-space:nowrap;text-overflow:ellipsis;width:190px;display:inline-block;overflow:hidden;margin:0px 5px}.canvasListComponent [commandName=onCanvasSelection]:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.canvasListComponent ul{margin:0px;padding:7px;list-style:none;position:absolute;top:54px;left:-2px;width:400px;border:2px solid #222;background-color:#2c2c2c}.canvasListComponent ul li{margin:5px}.canvasListComponent ul li:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.captureMenuActionsComponent{float:left;width:30%;height:100%;margin-top:7.5px}.captureMenuActionsComponent div{float:left}.captureMenuActionsComponent [commandName=onCaptureRequested]{border-radius:50%;background:#2c2c2c;border:2px solid red;width:21px;height:21px}.captureMenuActionsComponent [commandName=onCaptureRequested]:hover{background:red;cursor:pointer;transition:background .3s;-webkit-transition:background .3s;-moz-transition:background .3s}.captureMenuActionsComponent [commandName=onPlayRequested],.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPlayRequested]:before,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{content:"";position:absolute;display:inline-block;margin-top:6px;margin-left:4px;width:7px;height:7px;border-top:2px solid #f9f9f9;border-right:2px solid #f9f9f9;background-color:#f9f9f9;-moz-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg);z-index:-20}.captureMenuActionsComponent [commandName=onPlayRequested]:after,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:after{content:"";position:absolute;display:inline-block;width:8px;height:20px;background-color:#2c2c2c;z-index:-10}.captureMenuActionsComponent [commandName=onPlayRequested]:hover,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPauseRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPauseRequested]:before{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:12px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:after{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:7px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{background-color:#2c2c2c}.fpsCounterComponent{float:left;width:20%;vertical-align:center;line-height:40px;white-space:nowrap}',""]);const a=o},160(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.resultViewComponent{position:absolute;z-index:99999;border:1px solid #000;top:0;left:0;bottom:0;right:0;background-color:#222;opacity:1;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.resultViewComponent.active{visibility:visible;display:block}.resultViewComponent,.resultViewComponent:after,.resultViewComponent:before{box-sizing:content-box}.resultViewMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.resultViewMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.resultViewMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.resultViewMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.resultViewMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.resultViewMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.resultViewMenuComponent a.clearSearch{padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.resultViewMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}@media all and (max-width: 1024px){.resultViewMenuComponent .resultViewMenuOpen{display:block;visibility:visible}.resultViewMenuComponent li:not(.resultViewMenuSmall){display:none;visibility:hidden}.resultViewMenuComponent li{background:#2c2c2c}.resultViewMenuComponent li.searchContainer{background:rgb(69.5,69.5,69.5)}.resultViewMenuComponent{padding:0px;position:absolute;overflow-y:visible;top:0px;left:0px;right:0px;bottom:0px;z-index:999999;display:block}.resultViewMenuComponent a.active{background:#2c2c2c}}.resultViewMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:40px;position:relative;top:-1px;box-sizing:border-box}.resultViewMenuComponent input:focus{border:0;outline:0 none}.resultViewMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.resultViewMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.resultViewMenuComponent ::-webkit-input-placeholder{color:#ccc}.resultViewMenuComponent :-moz-placeholder{color:#ccc}.resultViewMenuComponent ::-moz-placeholder{color:#ccc}.resultViewMenuComponent :-ms-input-placeholder{color:#ccc}.resultViewContentComponent{position:absolute;top:40px;left:0;bottom:0;right:0}.informationColumnLeftComponent{position:absolute;top:0;left:0;bottom:0;right:50%;overflow:auto;overflow-x:hidden;overflow-y:visible}.informationColumnRightComponent{position:absolute;top:0;left:50%;bottom:0;right:0;overflow:auto;overflow-x:hidden;overflow-y:visible}.captureListComponent{position:absolute;top:40px;left:0;bottom:0;right:0;background:#222;z-index:9000;display:none;visibility:hidden;overflow-y:visible;overflow-x:hidden}.captureListComponent.active{display:block;visibility:visible}.captureListComponent .openCaptureFile{border:1px dashed #f9f9f9;display:block;margin:5px;padding:5px;text-align:center;font-style:italic}.captureListComponent .openCaptureFile span{line-height:100%;vertical-align:middle}.captureListComponent ul{margin:0px;padding:0px;list-style:none;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-start}.captureListComponent ul li{margin:5px;border:1px solid #606060}.captureListComponent ul li img{width:295px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;display:block}.captureListComponent ul li span{display:block;text-align:center;border:5px solid #222}.captureListComponent ul li span .captureListItemSave{color:#f9f9f9;font-size:16px;margin-left:10px;position:relative;padding:3px 8px 3px 32px}.captureListComponent ul li span .captureListItemSave:before,.captureListComponent ul li span .captureListItemSave:after{box-sizing:border-box;content:"";position:absolute}.captureListComponent ul li span .captureListItemSave:before{background:#222;border-color:#f9f9f9;border-style:solid;border-width:7px 2px 1px;border-radius:1px;height:16px;left:8px;top:5px;width:16px}.captureListComponent ul li span .captureListItemSave:after{background:#f9f9f9;border-color:#d9d9d9;border-style:solid;border-width:1px 1px 1px 4px;height:5px;left:13px;top:5px;width:7px}.captureListComponent ul li:hover{cursor:pointer}.captureListComponent ul li.active span{background:#f0640d;border:5px solid #f0640d}.captureListComponent ul li.active span .captureListItemSave:before{background:#f0640d}.captureListComponent ul li.active span .captureListItemSave:after{border-color:#f0640d}.visualStateListComponent{position:absolute;top:0;left:0;bottom:0;padding:5px;right:80%;overflow-y:visible;overflow-x:hidden}.visualStateListComponent ul{margin:0px;padding:0px;list-style:none}.visualStateListComponent ul li{margin:20px 15px 0px 15px;border:1px solid #606060}.visualStateListComponent ul li img{display:block;padding:0px;box-sizing:border-box;max-height:600px;width:100%;margin:0 auto;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.visualStateListComponent ul li:hover{cursor:pointer}.visualStateListComponent ul li span{border:5px solid #222;background:#222;box-sizing:border-box;display:inline-block;width:100%;margin:0px;padding:5px;word-wrap:break-word}.visualStateListComponent ul li.active{border:2px solid #f0640d}.commandListComponent{position:absolute;top:0;left:20%;right:40%;bottom:0;color:hsl(0,0%,82.6470588235%)}.commandListComponent ul{margin:0px;padding:0px;list-style:none;overflow-y:visible;overflow-x:hidden;height:100%}.commandListComponent ul li{padding:8px}.commandListComponent ul li span{word-wrap:break-word;line-height:22px}.commandListComponent ul li:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.commandListComponent ul li:nth-child(even){background:#2c2c2c}.commandListComponent ul li:nth-child(odd){background:#222}.commandListComponent ul li .important{font-weight:800}.commandListComponent ul li .important.deprecated{color:red}.commandListComponent ul li .important.unused{color:#ff0}.commandListComponent ul li .important.disabled{color:gray}.commandListComponent ul li .important.redundant{color:orange}.commandListComponent ul li .important.valid{color:#adff2f}.commandListComponent ul li .marker{font-size:16px;font-weight:900;color:#adff2f}.commandListComponent ul li.active{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.commandListComponent ul li.drawCall{background:#5db0d7;color:#222}.commandListComponent ul li a{margin-left:5px;margin-right:5px;color:#5db0d7;background:#222;padding:5px;font-weight:900;display:inline-block}.commandDetailComponent{position:absolute;top:0;left:60%;right:0;bottom:0;overflow-y:visible;overflow-x:hidden}.jsonGroupComponent{display:block;margin:10px;padding:10px;padding-bottom:5px}.jsonGroupComponent .jsonGroupComponentTitle{display:block;font-size:16px;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:5px;margin-bottom:5px;text-transform:capitalize}.jsonGroupComponent ul{margin:0px;padding:0px;list-style:none}.jsonGroupComponent ul li:nth-child(even){background:#222}.jsonGroupComponent ul li:nth-child(odd){background:#222}.jsonItemComponentKey{color:#f0640d}.jsonItemComponentValue{white-space:pre-wrap}.jsonItemImageHolder{width:50%;margin:auto}.jsonItemImageHolder .jsonItemImage{margin:5px;display:block;border:1px solid #606060;width:100%}.jsonItemImageHolder .jsonItemImage img{width:100%;display:block;margin:auto;max-width:256px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.jsonItemImageHolder .jsonItemImage span{margin:0px;padding:5px;word-wrap:break-word;display:inline-block;width:100%;box-sizing:border-box}[commandName=onOpenSourceClicked]:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.jsonVisualStateItemComponent{text-align:center;padding:10px}.jsonVisualStateItemComponent img{background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;border:1px solid #606060;margin:5px;width:100%;max-width:512px;max-height:800px}.jsonVisualStateItemComponent span{display:block}.jsonContentComponent{position:absolute;top:0;left:0;right:0;bottom:0;padding:10px;overflow-y:visible;overflow-x:hidden}.jsonItemComponentValue{word-break:break-all;white-space:normal}.jsonSourceItemComponentOpen{font-weight:bold;color:#5db0d7;text-decoration:underline}.sourceCodeMenuComponentContainer{position:absolute;left:0;top:0;bottom:48px;right:40%}.sourceCodeMenuComponentFooter{position:absolute;left:0;right:40%;bottom:0;padding:0 15px}.sourceCodeFormatError{color:#f0640d;margin-left:15px}.sourceCodeDiagnosticsNotice{color:#5db0d7;margin-left:15px}.sourceCodeDiagnosticsNotice a{color:#c9c9c9;text-decoration:underline}.sourceCodeMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.sourceCodeMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.sourceCodeMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.sourceCodeMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.sourceCodeMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.sourceCodeMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.sourceCodeMenuComponent a.clearSearch{display:inline-block;padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.sourceCodeMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}.sourceCodeMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:100%;position:relative;top:-1px;box-sizing:border-box}.sourceCodeMenuComponent input:focus{border:0;outline:0 none}.sourceCodeMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.sourceCodeMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.sourceCodeMenuComponent ::-webkit-input-placeholder{color:#ccc}.sourceCodeMenuComponent :-moz-placeholder{color:#ccc}.sourceCodeMenuComponent ::-moz-placeholder{color:#ccc}.sourceCodeMenuComponent :-ms-input-placeholder{color:#ccc}.sourceCodeComponent{position:absolute;top:42px;left:0;bottom:48px;right:40%;background:#222;z-index:9000;overflow-x:visible;overflow:auto}.sourceCodeComponent .sourceCodeComponentTitle{font-size:16px;font-weight:800;line-height:50px;color:#f0640d;padding:1em;margin:.5em 0}.compareViewComponent{position:absolute;top:50px;left:0px;right:0px;bottom:0px;overflow:hidden;display:flex;flex-direction:column;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:13px}.compareViewComponent .compareViewEmpty,.compareViewComponent .compareViewEmptyRow,.compareViewComponent .compareDetailEmpty{padding:1em;color:#c9c9c9;text-align:center}.compareViewComponent .compareViewHeader{flex:0 0 auto;display:flex;align-items:center;gap:16px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid rgb(8.5,8.5,8.5);white-space:nowrap}.compareViewComponent .compareViewHeader .compareViewLabel{color:#5db0d7}.compareViewComponent .compareViewHeader .compareViewSummary span{margin-right:8px;font-weight:700}.compareViewComponent .compareViewHeader .compareViewSummary span.added{color:#adff2f}.compareViewComponent .compareViewHeader .compareViewSummary span.removed{color:#ff5a5a}.compareViewComponent .compareViewHeader .compareViewSummary span.changed{color:#f0640d}.compareViewComponent .compareViewHeader .compareViewSummary span.unchanged{color:#c9c9c9}.compareViewComponent .compareViewHeader .compareViewToggle{margin-left:auto;cursor:pointer;user-select:none}.compareViewComponent .compareViewHeader .compareViewToggle input{vertical-align:middle;margin-right:4px}.compareViewComponent .compareViewBody{flex:1 1 auto;display:flex;min-height:0}.compareViewComponent .compareViewLegend{flex:0 0 130px;box-sizing:border-box;padding:10px;background:#2c2c2c;border-right:2px solid #222}.compareViewComponent .compareViewLegend .compareLegendRow{display:flex;align-items:center;gap:8px;margin:8px 0}.compareViewComponent .compareViewLegend .compareLegendRow.unchanged{opacity:.5}.compareViewComponent .compareViewLegend .compareLegendChip{width:12px;height:12px;border-radius:2px;background:#c9c9c9}.compareViewComponent .compareViewLegend .added .compareLegendChip{background:#adff2f}.compareViewComponent .compareViewLegend .removed .compareLegendChip{background:#ff5a5a}.compareViewComponent .compareViewLegend .changed .compareLegendChip{background:#f0640d}.compareViewComponent .compareViewList{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;margin:0;padding:0;list-style:none}.compareViewComponent .compareViewList .compareRow{display:flex;align-items:baseline;padding:3px 10px;line-height:20px;cursor:pointer;white-space:nowrap}.compareViewComponent .compareViewList .compareRow:nth-child(odd){background:#222}.compareViewComponent .compareViewList .compareRow:nth-child(even){background:#2c2c2c}.compareViewComponent .compareViewList .compareRow .compareSign{flex:0 0 14px;font-weight:800}.compareViewComponent .compareViewList .compareRow .compareRowText{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.compareViewComponent .compareViewList .compareRow .compareCmdName{font-weight:700}.compareViewComponent .compareViewList .compareRow.added .compareSign,.compareViewComponent .compareViewList .compareRow.added .compareCmdName{color:#adff2f}.compareViewComponent .compareViewList .compareRow.removed .compareSign,.compareViewComponent .compareViewList .compareRow.removed .compareCmdName{color:#ff5a5a}.compareViewComponent .compareViewList .compareRow.changed .compareSign,.compareViewComponent .compareViewList .compareRow.changed .compareCmdName{color:#f0640d}.compareViewComponent .compareViewList .compareRow.unchanged{opacity:.55}.compareViewComponent .compareViewList .compareRow.selected{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.compareViewComponent .compareViewList .compareRow.selected .compareSign,.compareViewComponent .compareViewList .compareRow.selected .compareCmdName{color:#222}.compareViewComponent .compareViewList .compareViewEmptyRow{cursor:default}.compareViewComponent .compareViewDetail{flex:0 0 42%;box-sizing:border-box;overflow-y:auto;border-left:2px solid #222;padding:4px 12px 12px}.compareViewComponent .compareViewDetail .compareDetailGroup{margin:12px 0}.compareViewComponent .compareViewDetail .compareDetailGroup ul{margin:0;padding:0;list-style:none}.compareViewComponent .compareViewDetail .compareDetailGroup li{padding:2px 0;white-space:pre-wrap;word-break:break-word}.compareViewComponent .compareViewDetail .compareDetailTitle{display:block;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin-bottom:6px;text-transform:capitalize}.compareViewComponent .compareViewDetail .compareDetailKey{color:#f0640d}.compareViewComponent .compareViewDetail .compareCmdName{font-weight:700}.compareViewComponent .compareViewDetail .compareCmdName.added{color:#adff2f}.compareViewComponent .compareViewDetail .compareCmdName.removed{color:#ff5a5a}.compareViewComponent .compareViewDetail .compareCmdName.changed{color:#f0640d}.compareViewComponent .compareViewDetail .compareArrow{color:#c9c9c9}.compareViewComponent .compareViewDetail .compareOld{opacity:.7;text-decoration:line-through}.compareViewComponent .compareViewDetail .compareNew{color:#f9f9f9}.compareViewComponent .compareViewDetail .compareCommandLink{color:#5db0d7;text-decoration:none;cursor:pointer;border-bottom:1px dotted currentColor}.compareViewComponent .compareViewDetail .compareCommandLink:hover{color:#f0640d}.compareViewComponent .compareViewDetail .compareTextureItem{padding-bottom:6px}.compareViewComponent .compareViewDetail .compareImageDiff{display:flex;align-items:center;margin-top:4px}.compareViewComponent .compareViewDetail .compareThumb{width:48px;height:48px;object-fit:contain;margin:2px 6px 2px 0;border:1px solid rgb(8.5,8.5,8.5);background:#222;image-rendering:pixelated}.jsonItemImageClickable{cursor:zoom-in}.textureViewerOverlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:100000;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.6);font-family:Consolas,monaco,monospace;font-size:13px;color:#f9f9f9}.textureViewerOverlay .textureViewerModal{width:min(900px,92vw);height:min(640px,90vh);display:flex;flex-direction:column;overflow:hidden;background:#222;border:1px solid #000;box-shadow:0 10px 40px rgba(0,0,0,.6)}.textureViewerOverlay .textureViewerHeader{flex:0 0 auto;display:flex;align-items:center;gap:12px;height:40px;padding:0 12px;background:#2c2c2c;border-bottom:2px solid #222}.textureViewerOverlay .textureViewerHeader .textureViewerTitle{color:#5db0d7}.textureViewerOverlay .textureViewerHeader .textureViewerMeta{color:#c9c9c9;font-size:12px}.textureViewerOverlay .textureViewerHeader .textureViewerClose{margin-left:auto;width:26px;height:26px;display:flex;align-items:center;justify-content:center;border-radius:3px;color:#c9c9c9;cursor:pointer}.textureViewerOverlay .textureViewerHeader .textureViewerClose:hover{color:#f9f9f9;background:hsla(0,0%,100%,.08)}.textureViewerOverlay .textureViewerToolbar{flex:0 0 auto;display:flex;align-items:center;flex-wrap:wrap;gap:14px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid #000;font-size:12px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup{display:flex;align-items:center;gap:6px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup .lbl{color:#c9c9c9;margin-right:2px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroupEnd{margin-left:auto}.textureViewerOverlay .textureViewerToolbar .channel{width:26px;height:24px;display:flex;align-items:center;justify-content:center;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#777;font-weight:800;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .channel.on.r{background:#e14b4b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.g{background:#4bd44b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.b{background:#4b8fe1;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.a{background:#dedede;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .tvBtn{height:24px;padding:0 10px;display:inline-flex;align-items:center;gap:6px;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#f9f9f9;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .tvBtn:hover{background:#333}.textureViewerOverlay .textureViewerToolbar .tvBtn.active{background:#f0640d;color:#1a1a1a;border-color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary{border-color:#f0640d;color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary:hover{background:#f0640d;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .seg{display:flex}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn{border-radius:0;border-right-width:0}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:first-child{border-radius:3px 0 0 3px}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:last-child{border-radius:0 3px 3px 0;border-right-width:1px}.textureViewerOverlay .textureViewerToolbar .zoomVal{min-width:44px;text-align:center;color:#c9c9c9}.textureViewerOverlay .textureViewerBody{flex:1 1 auto;display:flex;min-height:0}.textureViewerOverlay .textureViewerViewport{flex:1 1 auto;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#141414}.textureViewerOverlay .textureViewerViewport.checker{background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}.textureViewerOverlay .textureViewerCanvas{image-rendering:pixelated;cursor:crosshair;box-shadow:0 0 0 1px #000}.textureViewerOverlay .textureViewerLoupe{position:absolute;display:none;width:120px;height:120px;pointer-events:none;image-rendering:pixelated;border:1px solid #000;box-shadow:0 2px 8px rgba(0,0,0,.6);background:#000;left:16px;top:16px}.textureViewerOverlay .textureViewerRail{flex:0 0 210px;box-sizing:border-box;padding:12px;overflow-y:auto;background:#2c2c2c;border-left:2px solid #222}.textureViewerOverlay .textureViewerRail .railTitle{color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin:0 0 8px;text-transform:capitalize}.textureViewerOverlay .textureViewerRail .kv{display:flex;justify-content:space-between;margin:4px 0}.textureViewerOverlay .textureViewerRail .kv .k{color:#f0640d}.textureViewerOverlay .textureViewerRail .kv .v{color:#f9f9f9}.textureViewerOverlay .textureViewerRail .swatch{width:100%;height:34px;margin:8px 0;border:1px solid #000;background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0}.textureViewerOverlay .textureViewerRail .swatch .swatchInner{width:100%;height:100%}.textureViewerOverlay .textureViewerRail .hint{color:#c9c9c9;margin-top:10px;line-height:1.5}',""]);const a=o},636(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,".ace-monokai {\n color: #f9f9f9;\n font-size: 14px;\n}\n\n.ace-monokai .ace_entity.ace_name.ace_tag,\n.ace-monokai .ace_keyword,\n.ace-monokai .ace_meta.ace_tag,\n.ace-monokai .ace_storage {\n color: #F0640D\n}\n\n.ace-monokai .ace_constant.ace_character,\n.ace-monokai .ace_constant.ace_other {\n color: #5db0d7;\n}\n\n.ace-monokai .ace_marker-layer .ace_selection {\n background: #a6e22e\n}\n\n.ace-monokai .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #a6e22e;\n}\n\n.ace-monokai .ace_marker-layer .ace_active-line {\n background: #2c2c2c\n}\n.ace-monokai .ace_gutter-active-line {\n background-color: #2c2c2c\n}\n.ace-monokai .ace_marker-layer .ace_selected-word {\n border: 1px solid #a6e22e\n}\n\n.ace-monokai .ace_constant.ace_language {\n color: #e6db74\n}\n.ace-monokai .ace_constant.ace_numeric {\n color: #ae81ff\n}\n\n.ace-monokai .ace_gutter {\n background: #222;\n color: #8F908A;\n}",""]);const a=o},314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var a=0;a0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},601(e){"use strict";e.exports=function(e){return e[1]}},832(e,t,n){e=n.nmd(e),function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,n,r){"string"==typeof e?(2==arguments.length&&(r=n),t.modules[e]||(t.payloads[e]=r,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var n,r,i=function(e,t,n){if("string"==typeof t){var r=a(e,t);if(null!=r)return n&&n(),r}else if("[object Array]"===Object.prototype.toString.call(t)){for(var i=[],o=0,l=t.length;o1&&function(e,t,n){if(Array.prototype.indexOf)return e.indexOf("",n);for(var r=0;r-1&&(n=RegExp(this.source,i.replace.call(((r=this).global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),"g","")),i.replace.call(e.slice(a.index),n,function(){for(var e=1;ea.index&&this.lastIndex--}return a},o||(RegExp.prototype.test=function(e){var t=i.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError("Function.prototype.bind called on incompatible "+t);var n=d.call(arguments,1),i=function(){if(this instanceof i){var r=t.apply(this,n.concat(d.call(arguments)));return Object(r)===r?r:this}return t.apply(e,n.concat(d.call(arguments)))};return t.prototype&&(r.prototype=t.prototype,i.prototype=new r,r.prototype=null),i});var i,s,o,a,l,u=Function.prototype.call,c=Array.prototype,h=Object.prototype,d=c.slice,f=u.bind(h.toString),p=u.bind(h.hasOwnProperty);if((l=p(h,"__defineGetter__"))&&(i=u.bind(h.__defineGetter__),s=u.bind(h.__defineSetter__),o=u.bind(h.__lookupGetter__),a=u.bind(h.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,n=[];if(n.splice.apply(n,e(20)),n.splice.apply(n,e(26)),t=n.length,n.splice(5,0,"XXX"),n.length,t+1==n.length)return!0}()){var m=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?m.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(d.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):null==e?e=0:e<0&&(e=Math.max(n+e,0)),e+ta)for(h=u;h--;)this[l+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else for(this.length=c+s,h=0;h>>0;if("[object Function]"!=f(e))throw new TypeError;for(;++i>>0,i=Array(r),s=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var o=0;o>>0,s=[],o=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var a=0;a>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,s=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s++];break}if(++s>=r)throw new TypeError("reduce of empty array with no initial value")}for(;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,s=r-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s--];break}if(--s<0)throw new TypeError("reduceRight of empty array with no initial value")}do{s in this&&(i=e.call(void 0,i,n[s],s,t))}while(s--);return i}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=C&&"[object String]"==f(this)?this.split(""):L(this),n=t.length>>>0;if(!n)return-1;var r=0;for(arguments.length>1&&(r=N(arguments[1])),r=r>=0?r:Math.max(0,n+r);r>>0;if(!n)return-1;var r=n-1;for(arguments.length>1&&(r=Math.min(r,N(arguments[1]))),r=r>=0?r:n-Math.abs(r);r>=0;r--)if(r in t&&e===t[r])return r;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:h)}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(p(e,t)){var n;if(n={enumerable:!0,configurable:!0},l){var r=e.__proto__;e.__proto__=h;var i=o(e,t),s=a(e,t);if(e.__proto__=r,i||s)return i&&(n.get=i),s&&(n.set=s),n}return n.value=e[t],n}}),Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),Object.create||(g=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var n;if(null===e)n=g();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var r=function(){};r.prototype=e,(n=new r).__proto__=e}return void 0!==t&&Object.defineProperties(n,t),n}),Object.defineProperty){var S=D({}),A="undefined"==typeof document||D(document.createElement("div"));if(!S||!A)var _=Object.defineProperty}Object.defineProperty&&!_||(Object.defineProperty=function(e,t,n){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof n&&"function"!=typeof n||null===n)throw new TypeError("Property description must be an object: "+n);if(_)try{return _.call(Object,e,t,n)}catch(e){}if(p(n,"value"))if(l&&(o(e,t)||a(e,t))){var r=e.__proto__;e.__proto__=h,delete e[t],e[t]=n.value,e.__proto__=r}else e[t]=n.value;else{if(!l)throw new TypeError("getters & setters can not be defined on this javascript engine");p(n,"get")&&i(e,t,n.get),p(n,"set")&&s(e,t,n.set)}return e}),Object.defineProperties||(Object.defineProperties=function(e,t){for(var n in t)p(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=(E=Object.freeze,function(e){return"function"==typeof e?e:E(e)})}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";p(e,t);)t+="?";e[t]=!0;var n=p(e,t);return delete e[t],n}),!Object.keys){var y=!0,b=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],T=b.length;for(var R in{toString:null})y=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)p(e,n)&&t.push(n);if(y)for(var r=0,i=T;r0||-1)*Math.floor(Math.abs(e))),e}var L=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,n){"use strict";e("./regexp"),e("./es5-shim"),"undefined"==typeof Element||Element.prototype.remove||Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,n){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var r="object"==typeof navigator?navigator:{},i=(/mac|win|linux/i.exec(r.platform)||["other"])[0].toLowerCase(),s=r.userAgent||"",o=r.appName||"";t.isWin="win"==i,t.isMac="mac"==i,t.isLinux="linux"==i,t.isIE="Microsoft Internet Explorer"==o||o.indexOf("MSAppHost")>=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,t.isAIR=s.indexOf("AdobeAIR")>=0,t.isAndroid=s.indexOf("Android")>=0,t.isChromeOS=s.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./useragent");if(t.buildDom=function e(t,n,r){if("string"==typeof t&&t){var i=document.createTextNode(t);return n&&n.appendChild(i),i}if(!Array.isArray(t))return t;if("string"!=typeof t[0]||!t[0]){for(var s=[],o=0;o=1.5,"undefined"!=typeof document){var i=document.createElement("div");t.HI_DPI&&void 0!==i.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),r.isEdge||void 0===i.style.animationName||(t.HAS_CSS_ANIMATION=!0),i=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./oop"),i=function(){var e,t,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in n.FUNCTION_KEYS)e=n.FUNCTION_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);for(t in n.PRINTABLE_KEYS)e=n.PRINTABLE_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);return r.mixin(n,n.MODIFIER_KEYS),r.mixin(n,n.PRINTABLE_KEYS),r.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)n.KEY_MODS[t]=e.filter(function(e){return t&n.KEY_MODS[e]}).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();r.mixin(t,i),t.keyCodeToString=function(e){var t=i[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./keys"),i=e("./useragent"),s=null,o=0;t.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var r=function(){n.call(e,window.event)};n._wrapper=r,e.attachEvent("on"+t,r)}},t.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,n,r){function i(e){n&&n(e),r&&r(e),t.removeListener(document,"mousemove",n,!0),t.removeListener(document,"mouseup",i,!0),t.removeListener(document,"dragstart",i,!0)}return t.addListener(document,"mousemove",n,!0),t.addListener(document,"mouseup",i,!0),t.addListener(document,"dragstart",i,!0),i},t.addMouseWheelListener=function(e,n){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),n(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}n(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),n(e)})},t.addMultiMouseDownListener=function(e,n,r,s){var o,a,l,u=0,c={2:"dblclick",3:"tripleclick",4:"quadclick"};function h(e){if(0!==t.getButton(e)?u=0:e.detail>1?++u>4&&(u=1):u=1,i.isIE){var h=Math.abs(e.clientX-o)>5||Math.abs(e.clientY-a)>5;l&&!h||(u=1),l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),1==u&&(o=e.clientX,a=e.clientY)}if(e._clicks=u,r[s]("mousedown",e),u>4)u=0;else if(u>1)return r[s](c[u],e)}function d(e){u=2,l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),r[s]("mousedown",e),r[s](c[u],e)}Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",h),i.isOldIE&&t.addListener(e,"dblclick",d)})};var a=i.isMac&&i.isOpera&&!("KeyboardEvent"in window)?function(e){return(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)}:function(e){return(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};function l(e,t,n){var l=a(t);if(!i.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(l|=8),s.altGr){if(!(3&~l))return;s.altGr=0}if(18===n||17===n){var u="location"in t?t.location:t.keyLocation;17===n&&1===u?1==s[n]&&(o=t.timeStamp):18===n&&3===l&&2===u&&t.timeStamp-o<50&&(s.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),l||13!==n||3!==(u="location"in t?t.location:t.keyLocation)||(e(t,l,-n),!t.defaultPrevented)){if(i.isChromeOS&&8&l){if(e(t,l,n),t.defaultPrevented)return;l&=-9}return!!(l||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&e(t,l,n)}}function u(){s=Object.create(null)}if(t.getModifierString=function(e){return r.KEY_MODS[a(e)]},t.addCommandKeyListener=function(e,n){var r=t.addListener;if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var o=null;r(e,"keydown",function(e){o=e.keyCode}),r(e,"keypress",function(e){return l(n,e,o)})}else{var a=null;r(e,"keydown",function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=l(n,e,e.keyCode);return a=e.defaultPrevented,t}),r(e,"keypress",function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),r(e,"keyup",function(e){s[e.keyCode]=null}),s||(u(),r(window,"focus",u))}},"object"==typeof window&&window.postMessage&&!i.isOldIE){var c=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+c++,i=function(s){s.data==r&&(t.stopPropagation(s),t.removeListener(n,"message",i),e())};t.addListener(n,"message",i),n.postMessage(r,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function n(){t.$idleBlocked?setTimeout(n,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,n=e.end,r=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(r.row,r.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(r.row,r.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else this.end.rowt)var i={row:t+1,column:0};else this.start.row0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;nDate.now()-50)||(r=!1)},cancel:function(){r=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("../lib/dom"),o=e("../lib/lang"),a=e("../clipboard"),l=i.isChrome<18,u=i.isIE,c=i.isChrome>63,h=400,d=e("../lib/keys"),f=d.KEY_MODS,p=i.isIOS,m=p?/\s/:/\n/;t.TextInput=function(e,t){var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild);var g=!1,E=!1,v=!1,C=!1,D="";i.isMobile||(n.style.fontSize="1px");var S=!1,A=!1,_="",y=0,b=0,T=0;try{var R=document.activeElement===n}catch(e){}r.addListener(n,"blur",function(e){A||(t.onBlur(e),R=!1)}),r.addListener(n,"focus",function(e){if(!A){if(R=!0,i.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),i.isEdge?setTimeout(x):x()}}),this.$focusScroll=!1,this.focus=function(){if(D||c||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var t=0!=n.getBoundingClientRect().top}catch(e){return}var r=[];if(t)for(var i=n.parentElement;i&&1==i.nodeType;)r.push(i),i.setAttribute("ace_nocontext",!0),i=!i.parentElement&&i.getRootNode?i.getRootNode().host:i.parentElement;n.focus({preventScroll:!0}),t&&r.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="","0px"==n.style.top&&(n.style.top=e)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return R},t.on("beforeEndOperation",function(){t.curOp&&"insertstring"==t.curOp.command.name||(v&&(_=n.value="",U()),x())});var x=p?function(e){if(R&&(!g||e)&&!C){e||(e="");var r="\n ab"+e+"cde fg\n";r!=n.value&&(n.value=_=r);var i=4+(e.length||(t.selection.isEmpty()?0:1));4==y&&b==i||n.setSelectionRange(4,i),y=4,b=i}}:function(){if(!v&&!C&&(R||F)){v=!0;var e=t.selection,r=e.getRange(),i=e.cursor.row,s=r.start.column,o=r.end.column,a=t.session.getLine(i);if(r.start.row!=i){var l=t.session.getLine(i-1);s=r.start.rowi+1?u.length:o,o+=a.length+1,a=a+"\n"+u}a.length>h&&(s0&&_[h]==e[h];)h++,o--;for(l=l.slice(h),h=1;a>0&&_.length-h>y-1&&_[_.length-h]==e[e.length-h];)h++,a--;u-=h-1,c-=h-1;var d=l.length-h+1;return d<0&&(o=-d,d=0),l=l.slice(0,d),r||l||u||o||a||c?(C=!0,l&&!o&&!a&&!u&&!c||S?t.onTextInput(l):t.onTextInput(l,{extendLeft:o,extendRight:a,restoreStart:u,restoreEnd:c}),C=!1,_=e,y=i,b=s,T=c,l):""},L=function(e){if(v)return B();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var r=n.value,i=N(r,!0);(r.length>500||m.test(i))&&x()},O=function(e,t,n){var r=e.clipboardData||window.clipboardData;if(r&&!l){var i=u||n?"Text":"text/plain";try{return t?!1!==r.setData(i,t):r.getData(i)}catch(e){if(!n)return O(e,t,!0)}}},I=function(e,i){var s=t.getCopyText();if(!s)return r.preventDefault(e);O(e,s)?(p&&(x(s),g=s,setTimeout(function(){g=!1},10)),i?t.onCut():t.onCopy(),r.preventDefault(e)):(g=!0,n.value=s,n.select(),setTimeout(function(){g=!1,x(),i?t.onCut():t.onCopy()}))},k=function(e){I(e,!0)},M=function(e){I(e,!1)},P=function(e){var s=O(e);a.pasteCancelled()||("string"==typeof s?(s&&t.onPaste(s,e),i.isIE&&setTimeout(x),r.preventDefault(e)):(n.value="",E=!0))};r.addCommandKeyListener(n,t.onCommandKey.bind(t)),r.addListener(n,"select",function(e){v||(g?g=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=_.length&&e.value===_&&_&&e.selectionEnd!==b}(n)&&(t.selectAll(),x()))}),r.addListener(n,"input",L),r.addListener(n,"cut",k),r.addListener(n,"copy",M),r.addListener(n,"paste",P),"oncut"in n&&"oncopy"in n&&"onpaste"in n||r.addListener(e,"keydown",function(e){if((!i.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:M(e);break;case 86:P(e);break;case 88:k(e)}});var B=function(){if(v&&t.onCompositionUpdate&&!t.$readOnly){if(S)return $();if(v.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;N(e),v.markerRange&&(v.context&&(v.markerRange.start.column=v.selectionStart=v.context.compositionStartOffset),v.markerRange.end.column=v.markerRange.start.column+b-v.selectionStart+T)}}},U=function(e){t.onCompositionEnd&&!t.$readOnly&&(v=!1,t.onCompositionEnd(),t.off("mousedown",$),e&&L())};function $(){A=!0,n.blur(),n.focus(),A=!1}var G,V=o.delayedCall(B,50).schedule.bind(null,null);function W(){clearTimeout(G),G=setTimeout(function(){D&&(n.style.cssText=D,D=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()},0)}r.addListener(n,"compositionstart",function(e){if(!v&&t.onCompositionStart&&!t.$readOnly&&(v={},!S)){setTimeout(B,0),t.on("mousedown",$);var r=t.getSelectionRange();r.end.row=r.start.row,r.end.column=r.start.column,v.markerRange=r,v.selectionStart=y,t.onCompositionStart(v),v.useTextareaForIME?(n.value="",_="",y=0,b=0):(n.msGetInputContext&&(v.context=n.msGetInputContext()),n.getInputContext&&(v.context=n.getInputContext()))}}),r.addListener(n,"compositionupdate",B),r.addListener(n,"keyup",function(e){27==e.keyCode&&n.value.lengthb&&"\n"==_[s]?o=d.end:rb&&_.slice(0,s).split("\n").length>2?o=d.down:s>b&&" "==_[s-1]?(o=d.right,a=f.option):(s>b||s==b&&b!=y&&r==s)&&(o=d.right),r!==s&&(a|=f.shift),o){if(!t.onCommandKey({},a,o)&&t.commands){o=d.keyCodeToString(o);var l=t.commands.findKeyCommand(a,o);l&&t.execCommand(l)}y=r,b=s,x("")}}};document.addEventListener("selectionchange",s),t.on("destroy",function(){document.removeEventListener("selectionchange",s)})}(0,t,n)}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/useragent");function i(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function s(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)n=2*t.row-e.start.row-e.end.row;else n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,s=e.getButton();return 0!==s?((i.getSelectionRange().isEmpty()||1==s)&&i.selection.moveToPosition(n),void(2==s&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||i.isFocused()||(i.focus(),!this.$focusTimeout||this.$clickSelection||i.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(-1==r)e=this.$clickSelection.end;else if(1==r)e=this.$clickSelection.start;else{var i=s(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(i.start),a=this.$clickSelection.comparePoint(i.end);if(-1==o&&a<=0)t=this.$clickSelection.end,i.end.row==r.row&&i.end.column==r.column||(r=i.start);else if(1==a&&o>=0)t=this.$clickSelection.start,i.start.row==r.row&&i.start.column==r.column||(r=i.end);else if(-1==o&&1==a)r=i.end,t=i.start;else{var l=s(this.$clickSelection,r);r=l.cursor,t=l.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e,t,n,r,i=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,n=this.x,r=this.y,Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))),s=Date.now();(i>0||s-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session.getBracketRange(t);r?(r.isEmpty()&&(r.start.column--,r.end.column++),this.setState("select")):(r=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=r,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,s=i?e.wheelX/i:n.vx,o=i?e.wheelY/i:n.vy;i<550&&(s=(s+n.vx)/2,o=(o+n.vy)/2);var a=Math.abs(s/o),l=!1;return a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?n.allowed=r:r-n.allowed<550&&(Math.abs(s)<=1.5*Math.abs(n.vx)&&Math.abs(o)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=r):n.allowed=0),n.t=r,n.vx=s,n.vy=o,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(i.prototype),t.DefaultHandlers=i}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}(function(){this.$init=function(){return this.$element=r.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){r.addCssClass(this.getElement(),e)},this.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(i.prototype),t.Tooltip=i}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/event"),o=e("../tooltip").Tooltip;function a(e){o.call(this,e)}i.inherits(a,o),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),s=this.getHeight();(e+=15)+i>n&&(e-=e+i-n),(t+=15)+s>r&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=function(e){var t,n,i,o=e.editor,l=o.renderer.$gutterLayer,u=new a(o.container);function c(){t&&(t=clearTimeout(t)),i&&(u.hide(),i=null,o._signal("hideGutterTooltip",u),o.removeEventListener("mousewheel",c))}function h(e){u.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",function(t){if(o.isFocused()&&0==t.getButton()&&"foldWidgets"!=l.getRegion(t)){var n=t.getDocumentPosition().row,r=o.session.selection;if(t.getShiftKey())r.selectTo(n,0);else{if(2==t.domEvent.detail)return o.selectAll(),t.preventDefault();e.$clickSelection=o.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}),e.editor.setDefaultHandler("guttermousemove",function(s){var a=s.domEvent.target||s.domEvent.srcElement;if(r.hasCssClass(a,"ace_fold-widget"))return c();i&&e.$tooltipFollowsMouse&&h(s),n=s,t||(t=setTimeout(function(){t=null,n&&!e.isMousePressed?function(){var t=n.getDocumentPosition().row,r=l.$annotations[t];if(!r)return c();if(t==o.session.getLength()){var s=o.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(s>o.session.documentToScreenRow(a.row,a.column))return c()}if(i!=r)if(i=r.text.join("
"),u.setHtml(i),u.show(),o._signal("showGutterTooltip",u),o.on("mousewheel",c),e.$tooltipFollowsMouse)h(n);else{var d=n.domEvent.target.getBoundingClientRect(),f=u.getElement().style;f.left=d.right+"px",f.top=d.bottom+"px"}}():c()},50))}),s.addListener(o.renderer.$gutter,"mouseout",function(e){n=null,i&&!t&&(t=setTimeout(function(){t=null,c()},50))}),o.on("changeSession",c)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent");function o(e){var t=e.editor,n=r.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),t.addEventListener("mousedown",this.onMouseDown.bind(e));var o,l,u,c,h,d,f,p,m,g,E,v=t.container,C=0;function D(){var e=d;(function(e,n){var r=Date.now(),i=!n||e.row!=n.row,s=!n||e.column!=n.column;!g||i||s?(t.moveCursorToPosition(e),g=r,E={x:l,y:u}):a(E.x,E.y,l,u)>5?g=null:r-g>=200&&(t.renderer.scrollCursorIntoView(),g=null)})(d=t.renderer.screenToTextCoordinates(l,u),e),function(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,s=t.renderer.layerConfig.characterWidth,o=t.renderer.scroller.getBoundingClientRect(),a={x:{left:l-o.left,right:o.right-l},y:{top:u-o.top,bottom:o.bottom-u}},c=Math.min(a.x.left,a.x.right),h=Math.min(a.y.top,a.y.bottom),d={row:e.row,column:e.column};c/s<=2&&(d.column+=a.x.left=200&&t.renderer.scrollCursorIntoView(d):m=r:m=null}(d,e)}function S(){h=t.selection.toOrientedRange(),o=t.session.addMarker(h,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(c),D(),c=setInterval(D,20),C=0,i.addListener(document,"mousemove",y)}function A(){clearInterval(c),t.session.removeMarker(o),o=null,t.selection.fromOrientedRange(h),t.isFocused()&&!p&&t.$resetCursorStyle(),h=null,d=null,C=0,m=null,g=null,i.removeListener(document,"mousemove",y)}this.onDragStart=function(e){if(this.cancelDrag||!v.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}h=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?"copy":"copyMove",s.isOpera&&(t.container.appendChild(n),n.scrollTop=0),i.setDragImage&&i.setDragImage(n,0,0),s.isOpera&&t.container.removeChild(n),i.clearData(),i.setData("Text",t.session.getTextRange()),p=!0,this.setState("drag")},this.onDragEnd=function(e){if(v.draggable=!1,p=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;f||"move"!=n||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||S(),C++,e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||(S(),C++),null!==_&&(_=null),e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragLeave=function(e){if(--C<=0&&o)return A(),f=null,i.preventDefault(e)},this.onDrop=function(e){if(d){var n=e.dataTransfer;if(p)switch(f){case"move":h=h.contains(d.row,d.column)?{start:d,end:d}:t.moveText(h,d);break;case"copy":h=t.moveText(h,d,!0)}else{var r=n.getData("Text");h={start:d,end:t.session.insert(d,r)},t.focus(),f=null}return A(),i.preventDefault(e)}},i.addListener(v,"dragstart",this.onDragStart.bind(e)),i.addListener(v,"dragend",this.onDragEnd.bind(e)),i.addListener(v,"dragenter",this.onDragEnter.bind(e)),i.addListener(v,"dragover",this.onDragOver.bind(e)),i.addListener(v,"dragleave",this.onDragLeave.bind(e)),i.addListener(v,"drop",this.onDrop.bind(e));var _=null;function y(){null==_&&(_=setTimeout(function(){null!=_&&o&&A()},20))}function b(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function T(e){var t=["copy","copymove","all","uninitialized"],n=s.isMac?e.altKey:e.ctrlKey,r="uninitialized";try{r=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var i="none";return n&&t.indexOf(r)>=0?i="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(r)>=0?i="move":t.indexOf(r)>=0&&(i="copy"),i}}function a(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=s.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;s.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton();if(1===(e.domEvent.detail||1)&&0===r&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var i=e.domEvent.target||e.domEvent.srcElement;"unselectable"in i&&(i.unselectable="on"),t.getDragDelay()?(s.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(o.prototype),t.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./mouse_event").MouseEvent,i=e("../lib/dom");t.addTouchListeners=function(e,t){var n,s,o,a,l,u,c,h,d,f="scroll",p=0,m=0,g=0,E=0;function v(){var e,n,r;d||(e=window.navigator&&window.navigator.clipboard,n=!1,r=function(r){var s,o,a=r.target.getAttribute("action");if("more"==a||!n)return n=!n,s=t.getCopyText(),o=t.session.getUndoManager().hasUndo(),void d.replaceChild(i.buildDom(n?["span",!s&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],s&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],s&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],o&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),d.firstChild);"paste"==a?e.readText().then(function(e){t.execCommand(a,e)}):a&&("cut"!=a&&"copy"!=a||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(a)),d.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&t.focus()},d=i.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){f="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),r(e)},onclick:r},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container));var s=t.selection.cursor,o=t.renderer.textToScreenCoordinates(s.row,s.column),a=t.container.getBoundingClientRect();d.style.top=o.pageY-a.top-3+"px",d.style.right="10px",d.style.display="",d.firstChild.style.display="none",t.on("input",C)}function C(e){d&&(d.style.display="none"),t.off("input",C)}function D(){l=null,clearTimeout(l);var e=t.selection.getRange(),n=e.contains(c.row,c.column);!e.isEmpty()&&n||(t.selection.moveToPosition(c),t.selection.selectWord()),f="wait",v()}e.addEventListener("contextmenu",function(e){h&&t.textInput.getElement().focus()}),e.addEventListener("touchstart",function(e){var i=e.touches;if(l||i.length>1)return clearTimeout(l),l=null,o=-1,void(f="zoom");h=t.$mouseHandler.isMousePressed=!0;var u=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,v=e.timeStamp;a=v;var C=i[0],S=C.clientX,A=C.clientY;Math.abs(n-S)+Math.abs(s-A)>u&&(o=-1),n=e.clientX=S,s=e.clientY=A,g=E=0;var _=new r(e,t);if(c=_.getDocumentPosition(),v-o<500&&1==i.length&&!p)m++,e.preventDefault(),e.button=0,function(){l=null,clearTimeout(l),t.selection.moveToPosition(c);var e=m>=2?t.selection.getLineRange(c.row):t.session.getBracketRange(c);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),f="wait"}();else{m=0;var y=t.selection.cursor,b=t.selection.isEmpty()?y:t.selection.anchor,T=t.renderer.$cursorLayer.getPixelPosition(y,!0),R=t.renderer.$cursorLayer.getPixelPosition(b,!0),x=t.renderer.scroller.getBoundingClientRect(),w=function(e,t){return(e/=d)*e+(t=t/u-.75)*t};if(e.clientXN?"cursor":"anchor"),f=N<3.5?"anchor":F<3.5?"cursor":"scroll",l=setTimeout(D,450)}o=v}),e.addEventListener("touchend",function(e){h=t.$mouseHandler.isMousePressed=!1,u&&clearInterval(u),"zoom"==f?(f="",p=0):l?(t.selection.moveToPosition(c),p=0,v()):"scroll"==f?(p+=60,u=setInterval(function(){p--<=0&&(clearInterval(u),u=null),Math.abs(g)<.01&&(g=0),Math.abs(E)<.01&&(E=0),p<20&&(g*=.9),p<20&&(E*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*g,10*E),e==t.session.getScrollTop()&&(p=0)},10),e.preventDefault(),C()):v(),clearTimeout(l),l=null}),e.addEventListener("touchmove",function(e){l&&(clearTimeout(l),l=null);var i=e.touches;if(!(i.length>1||"zoom"==f)){var o=i[0],u=n-o.clientX,c=s-o.clientY;if("wait"==f){if(!(u*u+c*c>4))return e.preventDefault();f="cursor"}n=o.clientX,s=o.clientY,e.clientX=o.clientX,e.clientY=o.clientY;var h=e.timeStamp,d=h-a;if(a=h,"scroll"==f){var p=new r(e,t);p.speed=1,p.wheelX=u,p.wheelY=c,10*Math.abs(u)1&&(i=n[n.length-2]);var o=l[t+"Path"];return null==o?o=l.basePath:"/"==r&&(t=r=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+t+r+i+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,r){var i,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{i=e(n)}catch(e){}if(i&&!t.$loading[n])return r&&r(i);if(t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r),!(t.$loading[n].length>1)){var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var r=t.$loading[n];t.$loading[n]=null,r.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,o),a),u()}};var u=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),u=function(){})};function c(i){if(a&&a.document){l.packaged=i||e.packaged||r.packaged||a.define&&n.amdD.packaged;for(var s={},o="",u=document.currentScript||document._currentScript,c=(u&&u.ownerDocument||document).getElementsByTagName("script"),d=0;d=e){for(s=h+1;s=e;)s++;for(a=h,l=s-1;a=t.length||2!=(l=n[i-1])&&3!=l||2!=(u=t[i+1])&&3!=u?4:(s&&(u=3),u==l?u:4);case 10:return 2==(l=i>0?n[i-1]:5)&&i+10&&2==n[i-1])return 2;if(s)return 4;for(f=i+1,d=t.length;f=1425&&m<=2303||64286==m;if(l=t[f],g&&(1==l||7==l))return 1}return i<1||5==(l=t[i-1])?4:n[i-1];case 5:return s=!1,o=!0,r;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:s=!1;case h:return 4}}function g(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?t>191?0:d[t]:5==n?/[\u0591-\u05f4]/.test(e)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?12:/[\u0660-\u0669\u066b-\u066c]/.test(e)?3:1642==t?c:/[\u06f0-\u06f9]/.test(e)?2:7:32==n&&t<=8287?f[255&t]:254==n&&t>=65136?7:4}t.L=0,t.R=1,t.EN=2,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,n,c){if(e.length<2)return{};var d=e.split(""),f=new Array(d.length),E=new Array(d.length),v=[];r=c?1:0,function(e,t,n,c){var h=r?u:l,d=null,f=null,p=null,E=0,v=null,C=-1,D=null,S=null,A=[];if(!c)for(D=0,c=[];D0)if(16==v){for(D=C;D-1){for(D=C;D=0&&8==c[_];_--)t[_]=r}}(d,v,d.length,n);for(var C=0;C7&&n[C]<13||4===n[C]||n[C]===h)?v[C]=t.ON_R:C>0&&"ل"===d[C-1]&&/\u0622|\u0623|\u0625|\u0627/.test(d[C])&&(v[C-1]=v[C]=t.R_H,C++);for(d[d.length-1]===t.DOT&&(v[d.length-1]=t.B),"‫"===d[0]&&(v[0]=t.RLE),C=0;C=0&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,r=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===r;)r=n,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[e];s&&(void 0===t&&(t=this.getSplitIndex()),t>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&s[i]%2!=0&&i++;for(var a=0;at&&s[i]%2==0&&(o+=this.charWidths[s[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(e,t){var n,r=this.bidiMap,i=r.bidiLevels,s=[],o=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,u=!1,c=!1,h=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,f=0;f=a&&dn+s/2;){if(n+=s,r===i.length-1){s=0;break}s=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!=0&&i[r]%2==0?(e0&&i[r-1]%2==0&&i[r]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&0===s&&i[r-1]%2==0||!this.isRtlDir&&0===r&&i[r]%2!=0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!=0&&0!==s&&r--,t=this.bidiMap.logicalFromVisual[r]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(o.prototype),t.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")})};(function(){r.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},this.$setSelection=function(e,t,n,r){var i=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||s)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n,r="number"==typeof e?e:this.lead.row,i=this.session.getFoldLine(r);return i?(r=i.start.row,n=i.end.row):n=r,!0===t?new o(r,0,n,this.session.getLine(n).length):new o(r,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i)this.moveCursorTo(i.end.row,i.end.column);else{if(this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t)),t>=n.length)return this.moveCursorTo(e,n.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(s)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)}},this.$shortWordEndIndex=function(e){var t,n=0,r=/\s/,i=this.session.tokenRe;if(i.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&r.test(t);)n++;if(n<1)for(i.lastIndex=0;(t=e[n])&&!i.test(t);)if(i.lastIndex=0,n++,r.test(t)){if(n>2){n--;break}for(;(t=e[n])&&r.test(t);)n++;if(n>2)break}}return i.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do{e++,r=this.doc.getLine(e)}while(e0&&/^\s*$/.test(r));n=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(t,n-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n,r=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(r.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(r.column),r.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=r.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?r.column=this.$desiredColumn:this.$desiredColumn=r.column);var i=this.session.screenToDocumentPosition(r.row+e,r.column,n);0!==e&&0===t&&i.row===this.lead.row&&i.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[i.row]&&(i.row>0||e>0)&&i.row++,this.moveCursorTo(i.row,i.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch(e){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,n){"use strict";var r=e("./config"),i=2e3,s=function(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],r=[],i=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",a=[],l=0;l1?this.$applyToken:u.token),h>1&&(/\\\d/.test(u.regex)?c=u.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(h=1,c=this.removeCapturingGroups(u.regex)),u.splitRegex||"string"==typeof u.token||a.push(u)),s[i]=l,i+=h,r.push(c),u.onMatch||(u.onMatch=null)}}r.length||(s[0]=0,r.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){i=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var r=[],i=0,s=n.length;ic){var E=e.substring(c,g-m.length);d.type==f?d.value+=E:(d.type&&u.push(d),d={type:f,value:E})}for(var v=0;vi){for(h>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});c1&&n[0]!==r&&n.unshift("#tmp",r),{tokens:u,state:n.length?n:r}},this.reportError=r.reportError}).call(s.prototype),t.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var n in e){for(var r=e[n],i=0;i=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(void 0!==n)return n;for(n=0;t>0;)n+=e[t-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)}}).call(i.prototype),t.TokenIterator=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r,i=e("../../lib/oop"),s=e("../behaviour").Behaviour,o=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],u=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],c={},h={'"':'"',"'":"'"},d=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,c.rangeCount!=e.multiSelect.rangeCount&&(c={rangeCount:e.multiSelect.rangeCount})),c[t])return r=c[t];r=c[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},f=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},p=function(e){this.add("braces","insertion",function(t,n,i,s,o){var l=i.getCursorPosition(),u=s.doc.getLine(l.row);if("{"==o){d(i);var c=i.getSelectionRange(),h=s.doc.getTextRange(c);if(""!==h&&"{"!==h&&i.getWrapBehavioursEnabled())return f(c,h,"{","}");if(p.isSaneInsertion(i,s))return/[\]\}\)]/.test(u[l.column])||i.inMultiSelectMode||e&&e.braces?(p.recordAutoInsert(i,s,"}"),{text:"{}",selection:[1,1]}):(p.recordMaybeInsert(i,s,"{"),{text:"{",selection:[1,1]})}else if("}"==o){if(d(i),"}"==u.substring(l.column,l.column+1)&&null!==s.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&p.isAutoInsertedClosing(l,u,o))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==o||"\r\n"==o){d(i);var m="";if(p.isMaybeInsertedClosing(l,u)&&(m=a.stringRepeat("}",r.maybeInsertedBrackets),p.clearMaybeInsertedClosing()),"}"===u.substring(l.column,l.column+1)){var g=s.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!g)return null;var E=this.$getIndent(s.getLine(g.row))}else{if(!m)return void p.clearMaybeInsertedClosing();E=this.$getIndent(u)}var v=E+s.getTabString();return{text:"\n"+v+"\n"+E+m,selection:[1,v.length,1,v.length]}}p.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,i,s){var o=i.doc.getTextRange(s);if(!s.isMultiLine()&&"{"==o){if(d(n),"}"==i.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s;r.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if("("==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"(",")");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(")"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"("==s&&(d(n),")"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("brackets","insertion",function(e,t,n,r,i){if("["==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"[","]");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if("]"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"["==s&&(d(n),"]"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("string_dquotes","insertion",function(e,t,n,r,i){var s=r.$mode.$quotes||h;if(1==i.length&&s[i]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(i))return;d(n);var o=i,a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(!(""===l||1==l.length&&s[l])&&n.getWrapBehavioursEnabled())return f(a,l,o,o);if(!l){var u=n.getCursorPosition(),c=r.doc.getLine(u.row),p=c.substring(u.column-1,u.column),m=c.substring(u.column,u.column+1),g=r.getTokenAt(u.row,u.column),E=r.getTokenAt(u.row,u.column+1);if("\\"==p&&g&&/escape/.test(g.type))return null;var v,C=g&&/string|escape/.test(g.type),D=!E||/string|escape/.test(E.type);if(m==o)(v=C!==D)&&/string\.end/.test(E.type)&&(v=!1);else{if(C&&!D)return null;if(C&&D)return null;var S=r.$mode.tokenRe;S.lastIndex=0;var A=S.test(p);S.lastIndex=0;var _=S.test(p);if(A||_)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;var y=c[u.column-2];if(p==o&&(y==o||S.test(y)))return null;v=!0}return{text:v?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.$mode.$quotes||h,o=r.doc.getTextRange(i);if(!i.isMultiLine()&&s.hasOwnProperty(o)&&(d(n),r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==o))return i.end.column++,i})};p.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new o(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",l)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var i=new o(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",l))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",u)},p.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},p.recordAutoInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isAutoInsertedClosing(i,s,r.autoInsertedLineEnd[0])||(r.autoInsertedBrackets=0),r.autoInsertedRow=i.row,r.autoInsertedLineEnd=n+s.substr(i.column),r.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isMaybeInsertedClosing(i,s)||(r.maybeInsertedBrackets=0),r.maybeInsertedRow=i.row,r.maybeInsertedLineStart=s.substr(0,i.column)+n,r.maybeInsertedLineEnd=s.substr(i.column),r.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return r.autoInsertedBrackets>0&&e.row===r.autoInsertedRow&&n===r.autoInsertedLineEnd[0]&&t.substr(e.column)===r.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return r.maybeInsertedBrackets>0&&e.row===r.maybeInsertedRow&&t.substr(e.column)===r.maybeInsertedLineEnd&&t.substr(0,e.column)==r.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){r.autoInsertedLineEnd=r.autoInsertedLineEnd.substr(1),r.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){r&&(r.maybeInsertedBrackets=0,r.maybeInsertedRow=-1)},i.inherits(p,s),t.CstyleBehaviour=p}),ace.define("ace/unicode",["require","exports","module"],function(e,t,n){"use strict";for(var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,s=[],o=0;o2?r%u!=u-1:r%u==0})}else{if(!this.blockComment)return!1;var f=this.blockComment.start,p=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+l.escapeRegExp(f)+")"),g=new RegExp("(?:"+l.escapeRegExp(p)+")\\s*$"),E=function(e,t){C(e,t)||s&&!/\S/.test(e)||(i.insertInLine({row:t,column:e.length},p),i.insertInLine({row:t,column:a},f))},v=function(e,t){var n;(n=e.match(g))&&i.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(m))&&i.removeInLine(t,n[1].length,n[0].length)},C=function(e,n){if(m.test(e))return!0;for(var r=t.getTokens(n),i=0;ie.length&&(S=e.length)}),a==1/0&&(a=S,s=!1,o=!1),c&&a%u!=0&&(a=Math.floor(a/u)*u),D(o?v:E)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(i){!i.start&&i[0]&&(i=i[0]);var s,o,a=(m=new u(t,r.row,r.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var h,d;a&&/comment/.test(a.type);){if(-1!=(g=a.value.indexOf(i.start))){var f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g;h=new c(f,p,f,p+i.start.length);break}a=m.stepBackward()}var m;for(a=(m=new u(t,r.row,r.column)).getCurrentToken();a&&/comment/.test(a.type);){var g;if(-1!=(g=a.value.indexOf(i.end))){f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g,d=new c(f,p,f,p+i.end.length);break}a=m.stepForward()}d&&t.remove(d),h&&(t.remove(h),s=h.start.row,o=-i.start.length)}else o=i.start.length,s=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);l.start.row==s&&(l.start.column+=o),l.end.row==s&&(l.end.column+=o),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var n=e[t],i=n.prototype.$id,s=r.$modes[i];s||(r.$modes[i]=s=new n),r.$modes[t]||(r.$modes[t]=s),this.$embeds.push(t),this.$modes[t]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;tthis.row)){var n=function(t,n,r){var i="insert"==t.action,s=(i?1:-1)*(t.end.row-t.start.row),o=(i?1:-1)*(t.end.column-t.start.column),a=t.start,l=i?a:t.end;return e(n,a,r)?{row:n.row,column:n.column}:e(l,n,!r)?{row:n.row+s,column:n.column+(n.row==l.row?o:0)}:{row:a.row,column:a.column}}(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(e,t,n){var r;if(r=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=r.row||this.column!=r.column){var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=e("./anchor").Anchor,l=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new a(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();void 0===e?e=n:e<0?e=0:e>=n&&(e=n-1,t=void 0);var r=this.getLine(e);return null==t&&(t=r.length),{row:e,column:t=Math.min(Math.max(t,0),r.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof o||(e=o.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,r=n.length-t+1,i=e.start.row,s=e.start.column,o=0,a=0;o20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,-1==r&&(r=t),s<=r&&n.fireUpdateEvent(s,r)}}};(function(){r.implement(this,i),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens}}).call(s.prototype),t.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=(e("./lib/oop"),e("./range").Range),s=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,n,s){if(this.regExp)for(var o=s.firstRow,a=s.lastRow,l=o;l<=a;l++){var u=this.cache[l];null==u&&((u=r.getMatchOffsets(n.getLine(l),this.regExp)).length>this.MAX_RANGES&&(u=u.slice(0,this.MAX_RANGES)),u=u.map(function(e){return new i(l,e.offset,l,e.offset+e.length)}),this.cache[l]=u.length?u:"");for(var c=u.length;c--;)t.drawSingleLineMarker(e,u[c].toScreenRange(n),this.clazz,s)}}}).call(s.prototype),t.SearchHighlight=s}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range;function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var r,i,s=0,o=this.folds,a=!0;null==t&&(t=this.end.row,n=this.end.column);for(var l=0;l0)){var l=r(e,o.start);return 0===a?t&&0!==l?-s-2:s:l>0||0===l&&!t?s:-s-1}}return-s-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},this.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],n=this.ranges,i=(n=n.sort(function(e,t){return r(e.start,t.start)}))[0],s=1;s=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=r);o++);if("insert"==e.action){for(var l=i-r,u=-t.column+n.column;or);o++)if(c.start.row==r&&c.start.column>=t.column&&(c.start.column==t.column&&this.$bias<=0||(c.start.column+=u,c.start.row+=l)),c.end.row==r&&c.end.column>=t.column){if(c.end.column==t.column&&this.$bias<0)continue;c.end.column==t.column&&u>0&&oc.start.column&&c.end.column==s[o+1].start.column&&(c.end.column-=u),c.end.column+=u,c.end.row+=l}}else for(l=r-i,u=t.column-n.column;oi);o++)c.end.rowt.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=u,c.end.row+=l):c.end.row>i&&(c.end.row+=l),c.start.rowt.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=u,c.start.row+=l):c.start.row>i&&(c.start.row+=l);if(0!=l&&o=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;for(t&&(r=n.indexOf(t)),-1==r&&(r=0);r=e)return i}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,r=t-e+1,i=0;i=t){a=e?r-=t-a:r=0);break}o>=e&&(r-=a>=e?o-a:o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n,r=this.$foldData,o=!1;e instanceof s?n=e:(n=new s(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,u=n.end.row,c=n.end.column,h=this.getFoldAt(a,l,1),d=this.getFoldAt(u,c,-1);if(h&&d==h)return h.addSubFold(n);h&&!h.range.isStart(a,l)&&this.removeFold(h),d&&!d.range.isEnd(u,c)&&this.removeFold(d);var f=this.getFoldsInRange(n.range);f.length>0&&(this.removeFolds(f),f.forEach(function(e){n.addSubFold(e)}));for(var p=0;p0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;if(null==e?(n=new r(0,0,this.getLength(),0),t=!0):n="number"==typeof e?new r(e,0,e,this.getLine(e).length):"row"in e?r.fromPoints(e,e):e,i=this.getFoldsInRangeList(n),t)this.removeFolds(i);else for(var s=i;s.length;)this.expandFolds(s),s=this.getFoldsInRangeList(n);if(i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){null==r&&(r=e.start.row),null==i&&(i=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var s=this.doc,o="";return e.walk(function(e,t,n,a){if(!(tc)break}while(s&&l.test(s.type));s=i.stepBackward()}else s=i.getCurrentToken();return u.end.row=i.getCurrentTokenRow(),u.end.column=i.getCurrentTokenColumn()+s.value.length-2,u}},this.foldAll=function(e,t,n){null==n&&(n=1e5);var r=this.foldWidgets;if(r){t=t||this.getLength();for(var i=e=e||0;i=e){i=s.end.row;try{var o=this.addFold("...",s);o&&(o.collapseChildren=n)}catch(e){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};for(var r,i=e-1;i>=0;){var s=n[i];if(null==s&&(s=n[i]=this.getFoldWidget(i)),"start"==s){var o=this.getFoldWidgetRange(i);if(r||(r=o),o&&o.end.row>=e)break}i--}return{range:-1!==i&&o,firstRange:r}},this.onFoldWidgetClick=function(e,t){var n={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var r=t.target||t.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),r=this.getLine(e),i="end"===n?-1:1,s=this.getFoldAt(e,-1===i?0:r.length,i);if(s)return t.children||t.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()&&(s=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(s.range))return this.removeFold(s),s;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,u=a.range.end.row;this.foldAll(l,u,t.all?1e4:0)}else t.children?(u=o?o.end.row:this.getLength(),this.foldAll(e+1,u,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var r=this.getParentFoldRangeData(t,!0);if(n=r.range||r.firstRange){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold("...",n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){"use strict";var r=e("../token_iterator").TokenIterator,i=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(""==n)return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t,n=this.getLine(e.row),r=!0,s=n.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(o||(s=n.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),r=!1),!o)return null;if(o[1]){if(!(a=this.$findClosingBracket(o[1],e)))return null;t=i.fromPoints(e,a),r||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a;if(!(a=this.$findOpeningBracket(o[2],e)))return null;t=i.fromPoints(a,e),r||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn()-2,u=a.value;;){for(;l>=0;){var c=u.charAt(l);if(c==i){if(0==(s-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else c==e&&(s+=1);l-=1}do{a=o.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(u=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn();;){for(var u=a.value,c=u.length;ln&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>1,s=e[i];if(t>s)n=i+1;else{if(!(t=t);s++);return(n=r[s])?(n.index=s,n.start=i-n.value.length,n):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe)),r)var i=this.tokenRe;else i=/^\s+$/.test(n.slice(t-1,t+1))?/\s/:this.nonTokenRe;var s=t;if(s>0){do{s--}while(s>=0&&n.charAt(s).match(i));s++}for(var o=t;oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,s=this.$foldData[i],o=s?s.start.row:1/0,a=t.length,l=0;lo){if((l=s.end.row+1)>=a)break;o=(s=this.$foldData[i++])?s.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>r&&(r=n[l])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var r=e[n];"insert"==r.action||"remove"==r.action?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;ne.end.column&&(s.start.column+=u),s.end.row==e.end.row&&s.end.column>e.end.column&&(s.end.column+=u)),o&&s.start.row>=e.end.row&&(s.start.row+=o,s.end.row+=o)}if(s.end=this.insert(s.start,r),i.length){var a=e.start,l=s.start,u=(o=l.row-a.row,l.column-a.column);this.addFolds(i.map(function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=u),e.end.row==a.row&&(e.end.column+=u),e.start.row+=o,e.end.row+=o,e}))}return s},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},this.outdentRows=function(e){for(var t=e.collapseRows(),n=new c(0,0,0,0),r=this.getTabSize(),i=t.start.row;i<=t.end.row;++i){var s=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o0){var i;if((i=this.getRowFoldEnd(t+n))>this.doc.getLength()-1)return 0;r=i-t}else e=this.$clipRowToDocument(e),r=(t=this.$clipRowToDocument(t))-e+1;var s=new c(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(e){return(e=e.clone()).start.row+=r,e.end.row+=r,e}),a=0==n?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+r,a),o.length&&this.addFolds(o),r},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1&&(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,i=e.end,s=r.row,o=i.row,a=o-s,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[t?"$wrapData":"$rowLengthCache"].splice(s,a);var u=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var c=0;if(m=this.getFoldLine(i.row)){m.addRemoveChars(i.row,i.column,r.column-i.column),m.shiftRow(-a);var h=this.getFoldLine(s);h&&h!==m&&(h.merge(m),m=h),c=u.indexOf(m)+1}for(;c=i.row&&m.shiftRow(-a);o=s}else{var d=Array(a);d.unshift(s,0);var f=t?this.$wrapData:this.$rowLengthCache;if(f.splice.apply(f,d),u=this.$foldData,c=0,m=this.getFoldLine(s)){var p=m.range.compareInside(r.row,r.column);0==p?(m=m.split(r.row,r.column))&&(m.shiftRow(a),m.addRemoveChars(o,0,i.column-r.column)):-1==p&&(m.addRemoveChars(s,0,i.column-r.column),m.shiftRow(a)),c=u.indexOf(m)+1}for(;c=s&&m.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===n&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(m=this.getFoldLine(s))&&m.addRemoveChars(s,r.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),l},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(n,r){var i,s,o=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,u=this.$wrapLimit,c=n;for(r=Math.min(r,o.length-1);c<=r;)(s=this.getFoldLine(c,s))?(i=[],s.walk(function(n,r,s,a){var l;if(null!=n){(l=this.$getDisplayTokens(n,i.length))[0]=e;for(var u=1;u=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}this.$computeWrapSplits=function(n,r,i){if(0==n.length)return[];var s=[],o=n.length,a=0,l=0,u=this.$wrapAsCode,c=this.$indentedSoftWrap,h=r<=Math.max(2*i,8)||!1===c?0:Math.floor(r/2);function d(e){for(var t=e-a,r=a;rr-f;){var p=a+r-f;if(n[p-1]>=10&&n[p]>=10)d(p);else if(n[p]!=e&&n[p]!=t){for(var m=Math.max(p-(r-(r>>2)),a-1);p>m&&n[p]m&&n[p]m&&9==n[p];)p--}else for(;p>m&&n[p]<10;)p--;p>m?d(++p):(2==n[p=a+r]&&p--,d(p-f))}else{for(;p!=a-1&&n[p]!=e;p--);if(p>a){d(p);continue}for(p=a+r;p39&&o<48||o>57&&o<64?i.push(9):o>=4352&&n(o)?i.push(1,2):i.push(1)}return i},this.$getStringScreenWidth=function(e,t,r){if(0==t)return[0,0];var i,s;for(null==t&&(t=1/0),r=r||0,s=0;s=4352&&n(i)?r+=2:r+=1,!(r>t));s++);return[r,s]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0){a=u[c],s=this.$docRowCache[c];var d=e>u[h-1]}else d=!h;for(var f=this.getLength()-1,p=this.getNextFoldLine(s),m=p?p.start.row:1/0;a<=e&&!(a+(l=this.getRowLength(s))>e||s>=f);)a+=l,++s>m&&(s=p.end.row+1,m=(p=this.getNextFoldLine(s,p))?p.start.row:1/0),d&&(this.$docRowCache.push(s),this.$screenRowCache.push(a));if(p&&p.start.row<=s)r=this.getFoldDisplayLine(p),s=p.start.row;else{if(a+l<=e||s>f)return{row:f,column:this.getLine(f).length};r=this.getLine(s),p=null}var g=0,E=Math.floor(e-a);if(this.$useWrapMode){var v=this.$wrapData[s];v&&(i=v[E],E>0&&v.length&&(g=v.indent,o=v[E-1]||v[v.length-1],r=r.substring(o)))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+E,s,E)&&(t=this.$bidiHandler.offsetToCol(n)),o+=this.$getStringScreenWidth(r,t-g)[1],this.$useWrapMode&&o>=i&&(o=i-1),p?p.idxToPosition(o):{row:s,column:o}},this.documentToScreenPosition=function(e,t){if(void 0===t)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r,i=0,s=null;(r=this.getFoldAt(e,t,1))&&(e=r.start.row,t=r.start.column);var o,a=0,l=this.$docRowCache,u=this.$getRowCacheIndex(l,e),c=l.length;if(c&&u>=0){a=l[u],i=this.$screenRowCache[u];var h=e>l[c-1]}else h=!c;for(var d=this.getNextFoldLine(a),f=d?d.start.row:1/0;a=f){if((o=d.end.row+1)>e)break;f=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;i+=this.getRowLength(a),a=o,h&&(this.$docRowCache.push(a),this.$screenRowCache.push(i))}var p="";d&&a>=f?(p=this.getFoldDisplayLine(d,e,t),s=d.start.row):(p=this.getLine(e).substring(0,t),s=e);var m=0;if(this.$useWrapMode){var g=this.$wrapData[s];if(g){for(var E=0;p.length>=g[E];)i++,E++;p=p.substring(g[E-1]||0,p.length),m=E>0?g.indent:0}}return{row:i,column:m+this.$getStringScreenWidth(p)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,r=0,i=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);ri&&(r=t.end.row+1,i=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var o=this.$foldData,a=0;an);s++);return[r,s]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=n}.call(p.prototype),e("./edit_session/folding").Folding.call(p.prototype),e("./edit_session/bracket_match").BracketMatch.call(p.prototype),o.defineOptions(p.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=p}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(){this.$options={}};(function(){this.set=function(e){return i.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i,o){return r=new s(e,n,i,o),!(n==o&&t.start&&t.start.start&&0!=t.skipCurrent&&r.isEqual(t.start)&&(r=null,1))}),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],a=t.re;if(t.$isMultiLine){var l,u=a.length,c=i.length-u;e:for(var h=a.offset||0;h<=c;h++){for(var d=0;dm||(o.push(l=new s(h,m,h+u-1,g)),u>2&&(h=h+u-2))}}else for(var E=0;ES&&o[d].end.row==n.end.row;)d--;for(o=o.slice(E,d+1),E=0,d=o.length;E=a;n--)if(h(n,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(n=l,a=o.row;n>=a;n--)if(h(n,Number.MAX_VALUE,e))return}};else u=function(e){var n=o.row;if(!h(n,o.column,e)){for(n+=1;n<=l;n++)if(h(n,0,e))return;if(0!=t.wrap)for(n=a,l=o.row;n<=l;n++)if(h(n,0,e))return}};if(t.$isMultiLine)var c=n.length,h=function(t,i,s){var o=r?t-c+1:t;if(!(o<0)){var a=e.getLine(o),l=a.search(n[0]);if(!(!r&&li))return!!s(o,l,o+c-1,h)||void 0}}};else h=r?function(t,r,i){var s,o=e.getLine(t),a=[],l=0;for(n.lastIndex=0;s=n.exec(o);){var u=s[0].length;if(l=s.index,!u){if(l>=o.length)break;n.lastIndex=l+=1}if(s.index+u>r)break;a.push(s.index,u)}for(var c=a.length-1;c>=0;c-=2){var h=a[c-1];if(i(t,h,t,h+(u=a[c])))return!0}}:function(t,r,i){var s,o,a=e.getLine(t);for(n.lastIndex=r;o=n.exec(a);){var l=o[0].length;if(i(t,s=o.index,t,s+l))return!0;if(!l&&(n.lastIndex=s+=1,s>=a.length))return!1}};return{forEach:u}}}).call(o.prototype),t.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/keys"),i=e("../lib/useragent"),s=r.KEY_MODS;function o(e,t){this.platform=t||(i.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function a(e,t){o.call(this,e,t),this.$singleCommand=!1}a.prototype=o.prototype,function(){function e(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var n=e&&("string"==typeof e?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var s=r[i];if(s==e)delete r[i];else if(Array.isArray(s)){var o=s.indexOf(e);-1!=o&&(s.splice(o,1),1==s.length&&(r[i]=s[0]))}}},this.bindKey=function(e,t,n){if("object"==typeof e&&e&&(null==n&&(n=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach(function(e){var r="";if(-1!=e.indexOf(" ")){var i=e.split(/\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=s[t.hashId]+t.key;r+=(r?" ":"")+n,this._addCommandToBinding(r,"chainKeys")},this),r+=" "}var o=this.parseKeys(e),a=s[o.hashId]+o.key;this._addCommandToBinding(r+a,t,n)},this)},this._addCommandToBinding=function(t,n,r){var i,s=this.commandKeyBinding;if(n)if(!s[t]||this.$singleCommand)s[t]=n;else{Array.isArray(s[t])?-1!=(i=s[t].indexOf(n))&&s[t].splice(i,1):s[t]=[s[t]],"number"!=typeof r&&(r=e(n));var o=s[t];for(i=0;ir);i++);o.splice(i,0,n)}else delete s[t]},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(n){if("string"==typeof n)return this.bindKey(n,t);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=t),this.addCommand(n))}},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),i=r[n];if(r.FUNCTION_KEYS[i])n=r.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:n.toUpperCase(),hashId:-1}}for(var s=0,o=t.length;o--;){var a=r.KEY_MODS[t[o]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[o]+" in "+e),!1;s|=a}return{key:n,hashId:s}},this.findKeyCommand=function(e,t){var n=s[e]+t;return this.commandKeyBinding[n]},this.handleKeyboard=function(e,t,n,r){if(!(r<0)){var i=s[t]+n,o=this.commandKeyBinding[i];return e.$keyChain&&(e.$keyChain+=" "+i,o=this.commandKeyBinding[e.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(e.$keyChain&&(t&&4!=t||1!=n.length?(-1==t||r>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-i.length-1)),{command:o}):(e.$keyChain=e.$keyChain||i,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(o.prototype),t.HashHandler=o,t.MultiHashHandler=a}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){i.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};r.inherits(o,i),function(){r.implement(this,s),this.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var i={editor:t,command:e,args:n};return i.returnValue=this._emit("exec",i),this._signal("afterExec",i),!1!==i.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map(function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=e("../config"),s=e("../range").Range;function o(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(e){i.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,a=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(n.row),u=n.row+1;u<=i.row+1;u++){var c=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(u)));0!==c.length&&(c=" "+c),l+=c}i.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;o=i.lastRow||r.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var i=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&-1!==n.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var n=this;E.loadModule(["keybinding",e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||i.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=t.findMatchingBracket(e.getCursorPosition());if(n)var r=new f(n.row,n.column,n.row,n.column+1);else t.$mode.getMatching&&(r=t.$mode.getMatching(e.session));r&&(t.$bracketHighlight=t.addMarker(r,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=e.getCursorPosition(),r=new v(e.session,n.row,n.column),i=r.getCurrentToken();if(!i||!/\b(?:tag-open|tag-name)/.test(i.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1==i.type.indexOf("tag-open")||(i=r.stepForward())){var s=i.value,o=0,a=r.stepBackward();if("<"==a.value)do{a=i,(i=r.stepForward())&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"=0);else{do{i=a,a=r.stepBackward(),i&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var n=new f(e.row,e.column,e.row,1/0);n.id=t.addMarker(n,"ace_active-line","screenLine"),t.$highlightLineMarker=n}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var n=t.start.column,r=t.end.column,i=e.getLine(t.start.row),s=i.substring(n,r);if(!(s.length>5e3)&&/[\w\d]/.test(s)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),a=i.substring(n-1,r+1);if(o.test(a))return o}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var r=this.selection.getAllRanges(),i=0;ia.search(/\S|$/)){var l=a.substr(i.column).search(/\S|$/);n.doc.removeInLine(i.row,i.column,i.column+l)}}this.clearSelection();var u=i.column,c=n.getState(i.row),h=(a=n.getLine(i.row),r.checkOutdent(c,a,e));if(n.insert(i,e),s&&s.selection&&(2==s.selection.length?this.selection.setSelectionRange(new f(i.row,u+s.selection[0],i.row,u+s.selection[1])):this.selection.setSelectionRange(new f(i.row+s.selection[0],s.selection[1],i.row+s.selection[2],s.selection[3]))),n.getDocument().isNewLine(e)){var d=r.getNextLineIndent(c,a.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},d)}h&&r.autoOutdent(c,n,i.row)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(e,t){var n;(t.extendLeft||t.extendRight)&&((n=this.selection.getRange()).start.column-=t.extendLeft,n.end.column+=t.extendRight,this.selection.setRange(n),e||n.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((n=this.selection.getRange()).start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,"deletion",this,n,t);if(0===t.end.column){var s=n.getTextRange(t);if("\n"==s[s.length-1]){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var n,r,i=this.session.getLine(e.row);tt.toLowerCase()?1:0});var i=new f(0,0,0,0);for(r=e.first;r<=e.last;r++){var s=t.getLine(r);i.start.row=r,i.end.row=r,i.end.column=s.length,t.replace(i,n[r-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var r=this.session.getLine(e);n.lastIndex=t)return{value:i[0],start:i.index,end:i.index+i[0].length}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new f(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var s=this.getNumberAt(t,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,a=s.start+s.value.length-o,l=parseFloat(s.value);l*=Math.pow(10,a),o!==s.end&&n=a&&o<=l&&(n=t,u.selection.clearSelection(),u.moveCursorTo(e,a+r),u.selection.selectTo(e,l+r)),a=l});for(var c,h=this.$toggleWordPairs,d=0;df+1)break;f=p.last}for(c--,a=this.session.$moveLines(d,f,t?0:e),t&&-1==e&&(h=c+1);h<=c;)o[h].moveBy(a,0),h++;t||(a=0),l+=a}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);!0===t?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):!1===t&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,i*r.lineHeight),null!=t&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new v(this.session,n.row,n.column),i=r.getCurrentToken(),s=i||r.stepForward();if(s){var o,a,l=!1,u={},c=n.column-s.start,h={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;c=0;--s)this.$tryReplace(n[s],e)&&r++;return this.selection.setSelectionRange(i),r},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return null!==(t=this.$search.replace(n,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&r.mixin(t,e);var i=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(i)||this.$search.$options.needle)||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var s=this.$search.find(this.session);return t.preventScroll?s:s?(this.revealRange(s,n),s):(t.backwards?i.start=i.end:i.end=i.start,void this.selection.setRange(i))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(e){var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var s=this.on("changeSelection",function(){r=!0}),o=this.renderer.on("beforeRender",function(){r&&(t=n.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,s=e.$cursorLayer.$pixelPos,o=e.layerConfig,a=s.top-o.offset;null!=(r=s.top>=0&&a+t.top<0||!(s.topwindow.innerHeight)&&null)&&(i.style.top=a+"px",i.style.left=s.left+"px",i.style.height=o.lineHeight+"px",i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",o))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,i.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},this.prompt=function(e,t,n){var r=this;E.loadModule("./ext/prompt",function(i){i.prompt(r,e,t,n)})}}.call(D.prototype),E.defineOptions(D.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?S.attach(this):S.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?S.attach(this):S.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.renderer.$composition||this.getValue();if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),i.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!e&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),i.addCssClass(this.container,"ace_hasPlaceholder");var t=i.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var S={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=D}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,n){this.$fromUndo||e!=this.$lastDelta&&(!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,r=n.length;r--;){var i=n[r][0];if(i.id<=e)break;i.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?a(e):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(r.prototype);var i=e("./range").Range,s=i.comparePoints;function o(e){return{row:e.row,column:e.column}}function a(e){if(e=e||this,Array.isArray(e))return e.map(a).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function u(e,t){var n="insert"==e.action,r="insert"==t.action;if(n&&r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}else if(!n&&r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(!n&&!r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}return[t,e]}function c(e,t){for(var n=e.length;n--;)for(var r=0;r=0?d(e,t,-1):(s(e.start,t.start)<=0||d(e,i.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!n&&r)s(t.start,e.end)>=0?d(t,e,-1):(s(t.start,e.start)<=0||d(t,i.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{var o,a;if(!(s(t.end,e.start)<=0))return s(e.start,t.start)<0&&(o=e,e=p(e,t.start)),s(e.end,t.end)>0&&(a=p(e,t.end)),f(t.end,e.start,e.end,-1),a&&!o&&(e.lines=a.lines,e.start=a.start,e.end=a.end,a=e),[t,o,a].filter(Boolean);d(e,t,-1)}return[t,e]}function d(e,t,n){f(e.start,t.start,t.end,n),f(e.end,t.start,t.end,n)}function f(e,t,n,r){e.row==(1==r?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function p(e,t){var n=e.lines,r=e.end;e.end=o(t);var i=e.end.row-e.start.row,s=n.splice(i,n.length),a=i?t.column:t.column-e.start.column;return n.push(s[0].substring(0,a)),s[0]=s[0].substr(a),{start:o(t),end:r,lines:s,action:e.action}}function m(e,t){t=function(e){return{start:o(e.start),end:o(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var n=e.length;n--;){for(var r=e[n],i=0;is&&(l=i.end.row+1,s=(i=t.getNextFoldLine(l,i))?i.start.row:1/0),l>r){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,e,this.session,u),this.$lines.push(o)),this.$renderCell(o,e,i,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,i=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(i=t.getLength()+r-1);var s=n?n.getWidth(t,i,e):i.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();(s+=o.left+o.right)===this.gutterWidth||isNaN(s)||(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(r.row>this.$cursorRow){var i=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&i&&i.start.row==t[n-1].row))break;r=t[n-1]}r.element.className="ace_gutter-active-line "+r.element.className,this.$cursorCell=r;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;if(this.oldLastRow=n,!t||r0;i--)this.$lines.shift();if(r>n)for(i=this.session.getFoldedRowCount(n+1,r);i>0;i--)this.$lines.pop();e.firstRowr&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,n){for(var r=[],i=t,s=this.session.getNextFoldLine(i),o=s?s.start.row:1/0;i>o&&(i=s.end.row+1,o=(s=this.session.getNextFoldLine(i,s))?s.start.row:1/0),!(i>n);){var a=this.$lines.createCell(i,e,this.session,u);this.$renderCell(a,e,s,i),r.push(a),i++}return r},this.$renderCell=function(e,t,n,i){var s=e.element,o=this.session,a=s.childNodes[0],l=s.childNodes[1],u=o.$firstLineNumber,c=o.$breakpoints,h=o.$decorations,d=o.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&o.foldWidgets,p=n?n.start.row:Number.MAX_VALUE,m="ace_gutter-cell ";if(this.$highlightGutterLine&&(i==this.$cursorRow||n&&i=p&&this.$cursorRow<=n.end.row)&&(m+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),c[i]&&(m+=c[i]),h[i]&&(m+=h[i]),this.$annotations[i]&&(m+=this.$annotations[i].className),s.className!=m&&(s.className=m),f){var g=f[i];null==g&&(g=f[i]=o.getFoldWidget(i))}if(g){m="ace_fold-widget ace_"+g,"start"==g&&i==p&&in.right-t.right?"foldWidgets":void 0}}).call(l.prototype),t.Gutter=l}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/dom"),s=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){function e(e,t,n,r){return(e?1:0)|(t?2:0)|(n?4:0)|(r?8:0)}this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},this.update=function(e){if(e){var t;for(var n in this.config=e,this.i=0,this.markers){var r=this.markers[n];if(r.range){var i=r.range.clipRows(e.firstRow,e.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),r.renderer){var s=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,s,e)}else"fullLine"==r.type?this.drawFullLineMarker(t,i,r.clazz,e):"screenLine"==r.type?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?"text"==r.type?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+" ace_start ace_br15",e)}else r.update(t,this,this.session,e)}if(-1!=this.i)for(;this.if,c==u),s,c==u?0:1,o)},this.drawMultiLineMarker=function(e,t,n,r,i){var s=this.$padding,o=r.lineHeight,a=this.$getTop(t.start.row,r),l=s+t.start.column*r.characterWidth;if(i=i||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((u=t.clone()).end.row=u.start.row,u.end.column=this.session.getLine(u.start.row).length,this.drawBidiSingleLineMarker(e,u,n+" ace_br1 ace_start",r,null,i)):this.elt(n+" ace_br1 ace_start","height:"+o+"px;right:0;top:"+a+"px;left:"+l+"px;"+(i||"")),this.session.$bidiHandler.isBidiRow(t.end.row)){var u;(u=t.clone()).start.row=u.end.row,u.start.column=0,this.drawBidiSingleLineMarker(e,u,n+" ace_br12",r,null,i)}else{a=this.$getTop(t.end.row,r);var c=t.end.column*r.characterWidth;this.elt(n+" ace_br12","height:"+o+"px;width:"+c+"px;top:"+a+"px;left:"+s+"px;"+(i||""))}if(!((o=(t.end.row-t.start.row-1)*r.lineHeight)<=0)){a=this.$getTop(t.start.row+1,r);var h=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+o+"px;right:0;top:"+a+"px;left:"+s+"px;"+(i||""))}},this.drawSingleLineMarker=function(e,t,n,r,i,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,i,s);var o=r.lineHeight,a=(t.end.column+(i||0)-t.start.column)*r.characterWidth,l=this.$getTop(t.start.row,r),u=this.$padding+t.start.column*r.characterWidth;this.elt(n,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+u+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(e,t,n,r,i,s){var o=r.lineHeight,a=this.$getTop(t.start.row,r),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(n,"height:"+o+"px;width:"+e.width+(i||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-s),this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))},this.drawScreenLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))}}).call(s.prototype),t.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=function(e){this.dom=i,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){r.implement(this,a),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;nc&&(a=l.end.row+1,c=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(a>i);){var h=s[o++];if(h){this.dom.removeChildren(h),this.$renderLine(h,a,a==c&&l),u&&(h.style.top=this.$lines.computeLineTop(a,e,this.session)+"px");var d=e.lineHeight*this.session.getRowLength(a)+"px";h.style.height!=d&&(u=!0,h.style.height=d)}a++}if(u)for(;o0;i--)this.$lines.shift();if(t.lastRow>e.lastRow)for(i=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);i>0;i--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,n){for(var r=[],s=t,o=this.session.getNextFoldLine(s),a=o?o.start.row:1/0;s>a&&(s=o.end.row+1,a=(o=this.session.getNextFoldLine(s,o))?o.start.row:1/0),!(s>n);){var l=this.$lines.createCell(s,e,this.session),u=l.element;this.dom.removeChildren(u),i.setStyle(u.style,"height",this.$lines.computeLineHeight(s,e,this.session)+"px"),i.setStyle(u.style,"top",this.$lines.computeLineTop(s,e,this.session)+"px"),this.$renderLine(u,s,s==a&&o),this.$useLineGroups()?u.className="ace_line_group":u.className="ace_line",r.push(l),s++}return r},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,n=e.lastRow,r=this.$lines;r.getLength();)r.pop();r.push(this.$renderLinesFragment(e,t,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,r){for(var i,o=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),u=0;i=a.exec(r);){var c=i[1],h=i[2],d=i[3],f=i[4],p=i[5];if(o.showInvisibles||!h){var m=u!=i.index?r.slice(u,i.index):"";if(u=i.index+i[0].length,m&&l.appendChild(this.dom.createTextNode(m,this.element)),c){var g=o.session.getScreenTabSize(t+i.index);l.appendChild(o.$tabStrings[g].cloneNode(!0)),t+=g-1}else h?o.showInvisibles?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",v.textContent=s.stringRepeat(o.SPACE_CHAR,h.length),l.appendChild(v)):l.appendChild(this.com.createTextNode(h,this.element)):d?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",v.textContent=s.stringRepeat(o.SPACE_CHAR,d.length),l.appendChild(v)):f?(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className=o.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",v.textContent=o.showInvisibles?o.SPACE_CHAR:f,l.appendChild(v)):p&&(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className="ace_cjk",v.textContent=p,l.appendChild(v))}}if(l.appendChild(this.dom.createTextNode(u?r.slice(u):r,this.element)),this.$textToken[n.type])e.appendChild(l);else{var E="ace_"+n.type.replace(/\./g," ace_"),v=this.dom.createElement("span");"fold"==n.type&&(v.style.width=n.value.length*this.config.characterWidth+"px"),v.className=E,v.appendChild(l),e.appendChild(v)}return t+r.length},this.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(" "==t[0]){for(var i=(r-=r%this.tabSize)/this.tabSize,s=0;s=o;)a=this.$renderToken(l,a,c,h.substring(0,o-r)),h=h.substring(o-r),r=o,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(s.stringRepeat(" ",n.indent),this.element)),a=0,o=n[++i]||Number.MAX_VALUE;0!=h.length&&(r+=h.length,a=this.$renderToken(l,a,c,h))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(e,t){var n=0,r=t[0],i=r.value;this.displayIndentGuides&&(i=this.renderIndentGuide(e,i)),i&&(n=this.$renderToken(e,n,r,i));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,r,i);n=this.$renderToken(e,n,r,i)}},this.$renderOverflowMessage=function(e,t,n,r,i){n&&this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=i?"":"",e.appendChild(s)},this.$renderLine=function(e,t,n){if(n||0==n||(n=this.session.getFoldLine(t)),n)var r=this.$getFoldLineTokens(t,n);else r=this.session.getTokens(t);var i=e;if(r.length){var s=this.session.getRowSplitData(t);s&&s.length?(this.$renderWrappedLine(e,r,s),i=e.lastChild):(i=e,this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i)),this.$renderSimpleLine(i,r))}else this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i));if(this.showInvisibles&&i){n&&(t=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,i.appendChild(o)}},this.$getFoldLineTokens=function(e,t){var n=this.session,r=[],i=n.getTokens(e);return t.walk(function(e,t,s,o,a){null!=e?r.push({type:"fold",value:e}):(a&&(i=n.getTokens(t)),i.length&&function(e,t,n){for(var i=0,s=0;s+e[i].value.lengthn-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),s=t+o.length,i+=1);sn?r.push({type:e[i].type,value:o.substring(0,n-s)}):r.push(e[i]),s+=o.length,i+=1}}(i,o,s))},t.end.row,this.session.getLine(t.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),t.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)r.setStyle(t[n].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){r.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){r.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&r.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}else this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||o.top<0)&&n>1)){var a=this.cursors[i++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,o,e,t[n],this.session):this.isCursorInView(o,e)?(r.setStyle(l,"display","block"),r.translate(a,o.left,o.top),r.setStyle(l,"width",Math.round(e.characterWidth)+"px"),r.setStyle(l,"height",e.lineHeight+"px")):r.setStyle(l,"display","none")}}for(;this.cursors.length>i;)this.removeCursor();var u=this.session.getOverwrite();this.$setOverwrite(u),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(i.prototype),t.Cursor=i}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,a=32768,l=function(e){this.element=i.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){r.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(l.prototype);var u=function(e,t){l.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=i.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};r.inherits(u,l),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>a?(this.coeff=a/e,e=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(u.prototype);var c=function(e,t){l.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};r.inherits(c,l),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(c.prototype),t.ScrollBar=u,t.ScrollBarV=u,t.ScrollBarH=c,t.VScrollBar=u,t.HScrollBar=c}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){"use strict";var r=e("./lib/event"),i=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(r.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(i.prototype),t.RenderLoop=i}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,u=256,c="function"==typeof ResizeObserver,h=200,d=t.FontMetrics=function(e){this.el=i.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.innerHTML=s.stringRepeat("X",u),this.$characterSize={width:0,height:0},c?this.$addObserver():this.checkForSizeChanges()};(function(){r.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){var n=t[0].contentRect;e.checkForSizeChanges({height:n.height,width:n.width/u})}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/u};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.innerHTML=s.stringRepeat(e,u),this.$main.getBoundingClientRect().width/u},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=i.buildDom([e(0,0),e(h,0),e(0,h),e(h,h)],this.el)},this.transformCoordinates=function(e,t){function n(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function r(e,t){return[e[0]-t[0],e[1]-t[1]]}function i(e,t){return[e[0]+t[0],e[1]+t[1]]}function s(e,t){return[e*t[0],e*t[1]]}function o(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=s(1/this.$getZoom(this.el),e)),this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),u=o(this.els[2]),c=o(this.els[3]),d=n(r(c,l),r(c,u),r(i(l,u),i(c,a))),f=s(1+d[0],r(l,a)),p=s(1+d[1],r(u,a));if(t){var m=t,g=d[0]*m[0]/h+d[1]*m[1]/h+1,E=i(s(m[0],f),s(m[1],p));return i(s(1/g/h,E),a)}var v=r(e,a),C=n(r(f,s(d[0],v)),r(p,s(d[1],v)),v);return s(h,C)}}).call(d.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./config"),o=e("./layer/gutter").Gutter,a=e("./layer/marker").Marker,l=e("./layer/text").Text,u=e("./layer/cursor").Cursor,c=e("./scrollbar").HScrollBar,h=e("./scrollbar").VScrollBar,d=e("./renderloop").RenderLoop,f=e("./layer/font_metrics").FontMetrics,p=e("./lib/event_emitter").EventEmitter,m='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);opacity: 0.7;transform-origin: left;text-indent: 10px;}',g=e("./lib/useragent"),E=g.isIE;i.importCssString(m,"ace_editor.css");var v=function(e,t){var n=this;this.container=e||i.createElement("div"),i.addCssClass(this.container,"ace_editor"),i.HI_DPI&&i.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=i.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=i.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=i.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var r=this.$textLayer=new l(this.content);this.canvas=r.element,this.$markerFront=new a(this.content),this.$cursorLayer=new u(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new f(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!g.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,p),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),i.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,n){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,r){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var i=this.container;r||(r=i.clientHeight||i.scrollHeight),n||(n=i.clientWidth||i.scrollWidth);var s=this.$updateCachedSize(e,t,n,r);if(!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var s=0,o=this.$size,a={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if(r&&(e||o.height!=r)&&(o.height=r,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL),n&&(e||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,i.setStyle(this.scrollBarH.element.style,"left",t+"px"),i.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),i.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";i.setStyle(this.scrollBarH.element.style,"right",l),i.setStyle(this.scroller.style,"right",l),i.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(s|=this.CHANGE_FULL)}return o.$dirty=!n||!r,s&&this._signal("resize",a),s},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=i.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=i.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var n=this.$cursorLayer.$pixelPos;if(n){t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var r=this.layerConfig,s=n.top,o=n.left;s-=r.offset;var a=t&&t.useTextareaForIME?this.lineHeight:E?0:1;if(s<0||s>r.height-a)i.translate(this.textarea,0,0);else{var l=1,u=this.$size.height-a;if(t)if(t.useTextareaForIME){var c=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(c)[0]}else s+=this.lineHeight+2;else s+=this.lineHeight;(o-=this.scrollLeft)>this.$size.scrollerWidth-l&&(o=this.$size.scrollerWidth-l),o+=this.gutterWidth+this.margin.left,i.setStyle(e,"height",a+"px"),i.setStyle(e,"width",l+"px"),i.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-l),Math.min(s,u))}}}else i.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},this.setMargin=function(e,t,n,r){var i=this.margin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),i.translate(this.content,-this.scrollLeft,-n.offset);var s=n.width+2*this.$padding+"px",o=n.minHeight+"px";i.setStyle(this.content.style,"width",s),i.setStyle(this.content.style,"height",o)}if(e&this.CHANGE_H_SCROLL&&(i.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender")}else this.$changes|=e},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=!(n<=2*this.lineHeight)&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||r!=this.$vScroll){r!=this.$vScroll&&(this.$vScroll=r,this.scrollBarV.setVisible(r));var i=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,i,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength()*this.lineHeight,i=this.$getLongestLine(),s=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-i-2*this.$padding<0),o=this.$horizScroll!==s;o&&(this.$horizScroll=s,this.scrollBarH.setVisible(s));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,u=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;r+=u;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,r-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,i+2*this.$padding-t.scrollerWidth+c.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-r+u<0||this.scrollTop>c.top),d=a!==h;d&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var f,p,m=this.scrollTop%this.lineHeight,g=Math.ceil(l/this.lineHeight)-1,E=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),v=E+g,C=this.lineHeight;E=e.screenToDocumentRow(E,0);var D=e.getFoldLine(E);D&&(E=D.start.row),f=e.documentToScreenRow(E,0),p=e.getRowLength(E)*C,v=Math.min(e.screenToDocumentRow(v,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(v)*C+p,m=this.scrollTop-f*C;var S=0;return(this.layerConfig.width!=i||o)&&(S=this.CHANGE_H_SCROLL),(o||d)&&(S|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(i=this.$getLongestLine())),this.layerConfig={width:i,padding:this.$padding,firstRow:E,firstRowScreen:f,lastRow:v,lineHeight:C,characterWidth:this.characterWidth,minHeight:l,maxHeight:r,offset:m,gutterOffset:C?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/C)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(i-this.$padding),S},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1||tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t,n){if(0!==this.$size.scrollerHeight){var r=this.$cursorLayer.getPixelPosition(e),i=r.left,s=r.top,o=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+o>s?(t&&l+o>s+this.lineHeight&&(s-=t*this.$size.scrollerHeight),0===s&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):l+this.$size.scrollerHeight-ai?(i=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:a,side:s-a>0?1:-1,offsetX:i}},this.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),a=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),i)},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),s=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+s-this.scrollTop}},this.visualizeFocus=function(){i.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){i.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),e.useTextareaForIME=this.$useTextareaForIME,this.$useTextareaForIME?(i.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),i.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText,this.$composition=null,this.$cursorLayer.element.style.display="")},this.addToken=function(e,t,n,r){var i=this.session;i.bgTokenizer.lines[n]=null;var s={type:t,value:e},o=i.getTokens(n);if(null==r)o.push(s);else for(var a=0,l=0;l50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,n){var r=null,i=!1,a=Object.create(s),u=[],c=new l({messageBuffer:u,terminate:function(){},postMessage:function(e){u.push(e),r&&(i?setTimeout(h):h())}});c.setEmitSync=function(e){i=e};var h=function(){var e=u.shift();e.command?r[e.command].apply(r,e.args):e.event&&a._signal(e.event,e.data)};return a.postMessage=function(e){c.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},o.loadModule(["worker",t],function(e){for(r=new e[n](a);u.length;)h()}),c},t.WorkerClient=l,t.createWorker=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(e,t,n,r,i,s){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,i),this.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,s=t.start.column-this.pos.column;if(this.updateAnchors(e),i&&(this.length+=n),i&&!this.session.$fromUndo)if("insert"===e.action)for(var o=this.others.length-1;o>=0;o--){var a={row:(l=this.others[o]).row,column:l.column+s};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(o=this.others.length-1;o>=0;o--){var l;a={row:(l=this.others[o]).row,column:l.column+s},this.doc.remove(new r(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,i){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),i,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)}},this.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new r,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{n=this.getRange();var r=this.isBackwards(),s=n.start.row,o=n.end.row;if(s==o){if(r)var a=n.end,l=n.start;else a=n.start,l=n.end;return this.addRange(i.fromPoints(l,l)),void this.addRange(i.fromPoints(a,a))}var u=[],c=this.getLineRange(s,!0);c.start.column=n.start.column,u.push(c);for(var h=s+1;h1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(r,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],s=e.column0;)E--;if(E>0)for(var v=0;r[v].isEmpty();)v++;for(var C=E;C>=v;C--)r[C].isEmpty()&&r.splice(C,1)}return r}}.call(s.prototype);var d=e("./editor").Editor;function f(e,t){return e.row==t.row&&e.column==t.column}function p(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",o),e.commands.addCommands(u.defaultCommands),function(e){if(e.textInput){var t=e.textInput.getElement(),n=!1;a.addListener(t,"keydown",function(t){var i=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&i?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&r()}),a.addListener(t,"keyup",r),a.addListener(t,"blur",r)}function r(t){n&&(e.renderer.setMouseCursor(""),n=!1)}}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var r=e[n];if(r.marker){this.session.removeMarker(r.marker);var i=t.indexOf(r);-1!=i&&t.splice(i,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(u.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(u.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?r=n.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?r=n.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});else{var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return r}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var r,i=n&&n.keepOrder,o=1==n||n&&n.$byLines,a=this.session,l=this.selection,u=l.rangeList,c=(i?l:u).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var h=l._eventRegistry;l._eventRegistry={};var d=new s(a);this.inVirtualSelectionMode=!0;for(var f=c.length;f--;){if(o)for(;f>0&&c[f].start.row==c[f-1].end.row;)f--;d.fromOrientedRange(c[f]),d.index=f,this.selection=a.selection=d;var p=e.exec?e.exec(this,t||{}):e(this,t||{});r||void 0===p||(r=p),d.toOrientedRange(c[f])}d.detach(),this.selection=a.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=h,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),r}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],r=0;ro&&(o=n.column),rc?e.insert(r,l.stringRepeat(" ",s-c)):e.remove(new i(r.row,r.column,r.row,r.column-s+c)),t.start.column=t.end.column=o,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var c=this.selection.getRange(),h=c.start.row,d=c.end.row,f=h==d;if(f){var p,m=this.session.getLength();do{p=this.session.getLine(d)}while(/[=:]/.test(p)&&++d0);h<0&&(h=0),d>=m&&(d=m-1)}var g=this.session.removeFullLines(h,d);g=this.$reAlignText(g,f),this.session.insert({row:h,column:0},g.join("\n")+"\n"),f||(c.start.column=0,c.end.column=g[g.length-1].length),this.selection.setRange(c)}},this.$reAlignText=function(e,t){var n,r,i,s=!0,o=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==n?(n=t[1].length,r=t[2].length,i=t[3].length,t):(n+r+i!=t[1].length+t[2].length+t[3].length&&(o=!1),n!=t[1].length&&(s=!1),n>t[1].length&&(n=t[1].length),rt[3].length&&(i=t[3].length),t):[e]}).map(t?u:s?o?function(e){return e[2]?a(n+r-e[2].length)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:u:function(e){return e[2]?a(n)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function a(e){return l.stringRepeat(" ",e)}function u(e){return e[2]?a(n)+e[2]+a(r-e[2].length+i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=p,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){p(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,s=e.getLine(t),o=s.search(i);if(-1!=o){for(var a=n||s.length,l=e.getLength(),u=t,c=t;++tu){var f=e.getLine(c).length;return new r(u,a,c,f)}}},this.openingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i+1},a=e.$findClosingBracket(t,o,s);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>o.row&&(a.row--,a.column=e.getLine(a.row).length),r.fromPoints(o,a)}},this.closingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i},a=e.$findOpeningBracket(t,o);if(a)return a.column++,o.column--,r.fromPoints(a,o)}}).call(i.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}e("./range").Range,function(){this.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(n&&e.action){for(var r=e.data,i=r.start.row,s=r.end.row,o="add"==e.action,a=i+1;a0&&!r[i];)i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=s;o++){var a=r[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var u=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(u-=t.scrollLeft),a.el.style.left=u+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}.call(i.prototype),t.LineWidgets=i}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,n){"use strict";var r=e("../line_widgets").LineWidgets,i=e("../lib/dom"),s=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var o=e.getCursorPosition(),a=o.row,l=n.widgetManager.getWidgetsAtRow(a).filter(function(e){return"errorMarker"==e.type})[0];l?l.destroy():a-=t;var u,c=function(e,t,n){var r=e.getAnnotations().sort(s.comparePoints);if(r.length){var i=function(e,t,n){for(var r=0,i=e.length-1;r<=i;){var s=r+i>>1,o=n(t,e[s]);if(o>0)r=s+1;else{if(!(o<0))return s;i=s-1}}return-(r+1)}(r,{row:t,column:-1},s.comparePoints);i<0&&(i=-i-1),i>=r.length?i=n>0?0:r.length-1:0===i&&n<0&&(i=r.length-1);var o=r[i];if(o&&n){if(o.row===t){do{o=r[i+=n]}while(o&&o.row===t);if(!o)return r.slice()}var a=[];t=o.row;do{a[n<0?"unshift":"push"](o),o=r[i+=n]}while(o&&o.row==t);return a.length&&a}}}(n,a,t);if(c){var h=c[0];o.column=(h.pos&&"number"!=typeof h.column?h.pos.sc:h.column)||0,o.row=h.row,u=e.renderer.$gutterLayer.$annotations[o.row]}else{if(l)return;u={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(o.row),e.selection.moveToPosition(o);var d={row:o.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},f=d.el.appendChild(i.createElement("div")),p=d.el.appendChild(i.createElement("div"));p.className="error_widget_arrow "+u.className;var m=e.renderer.$cursorLayer.getPixelPosition(o).left;p.style.left=m+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",f.className="error_widget "+u.className,f.innerHTML=u.text.join("
"),f.appendChild(i.createElement("div"));var g=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(g),n.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(g),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t,r){"use strict";e("./lib/fixoldbrowsers");var i=e("./lib/dom"),s=e("./lib/event"),o=e("./range").Range,a=e("./editor").Editor,l=e("./edit_session").EditSession,u=e("./undomanager").UndoManager,c=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,t.define=n.amdD,t.edit=function(e,n){if("string"==typeof e){var r=e;if(!(e=document.getElementById(r)))throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof a)return e.env.editor;var o="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;o=l.value,e=i.createElement("pre"),l.parentNode.replaceChild(e,l)}else e&&(o=e.textContent,e.innerHTML="");var u=t.createEditSession(o),h=new a(new c(e),u,n),d={document:u,editor:h,onResize:h.resize.bind(h,null)};return l&&(d.textarea=l),s.addListener(window,"resize",d.onResize),h.on("destroy",function(){s.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),h.container.env=h.env=d,h},t.createEditSession=function(e,t){var n=new l(e,t);return n.setUndoManager(new u),n},t.Range=o,t.Editor=a,t.EditSession=l,t.UndoManager=u,t.VirtualRenderer=c,t.version=t.config.version}),ace.require(["ace/ace"],function(t){for(var n in t&&(t.config.init(!0),t.define=ace.define),window.ace||(window.ace=t),t)t.hasOwnProperty(n)&&(window.ace[n]=t[n]);window.ace.default=window.ace,e&&(e.exports=window.ace)}),e.exports={ace}},247(e,t,n){"use strict";var r=n(982),i=n(159),s=n(961);function o(e){var t="https://react.dev/errors/"+e;if(1P||(e.current=M[P],M[P]=null,P--)}function $(e,t){P++,M[P]=e.current,e.current=t}var G,V,W=B(null),H=B(null),j=B(null),z=B(null);function X(e,t){switch($(j,t),$(H,e),$(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=Eh(t=gh(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(W),$(W,e)}function K(){U(W),U(H),U(j)}function Y(e){null!==e.memoizedState&&$(z,e);var t=W.current,n=Eh(t,e.type);t!==n&&($(H,e),$(W,n))}function q(e){H.current===e&&(U(W),U(H)),z.current===e&&(U(z),ud._currentValue=k)}function Q(e){if(void 0===G)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);G=t&&t[1]||"",V=-1)":-1--i||l[r]!==u[i]){var c="\n"+l[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}}while(1<=r&&0<=i);break}}}finally{Z=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Q(n):""}function ee(e,t){switch(e.tag){case 26:case 27:case 5:return Q(e.type);case 16:return Q("Lazy");case 13:return e.child!==t&&null!==t?Q("Suspense Fallback"):Q("Suspense");case 19:return Q("SuspenseList");case 0:case 15:return J(e.type,!1);case 11:return J(e.type.render,!1);case 1:return J(e.type,!0);case 31:return Q("Activity");default:return""}}function te(e){try{var t="",n=null;do{t+=ee(e,n),n=e,e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var ne=Object.prototype.hasOwnProperty,re=r.unstable_scheduleCallback,ie=r.unstable_cancelCallback,se=r.unstable_shouldYield,oe=r.unstable_requestPaint,ae=r.unstable_now,le=r.unstable_getCurrentPriorityLevel,ue=r.unstable_ImmediatePriority,ce=r.unstable_UserBlockingPriority,he=r.unstable_NormalPriority,de=r.unstable_LowPriority,fe=r.unstable_IdlePriority,pe=r.log,me=r.unstable_setDisableYieldValue,ge=null,Ee=null;function ve(e){if("function"==typeof pe&&me(e),Ee&&"function"==typeof Ee.setStrictMode)try{Ee.setStrictMode(ge,e)}catch(e){}}var Ce=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(De(e)/Se|0)|0},De=Math.log,Se=Math.LN2,Ae=256,_e=262144,ye=4194304;function be(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Te(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var i=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var a=134217727&r;return 0!==a?0!==(r=a&~s)?i=be(r):0!==(o&=a)?i=be(o):n||0!==(n=a&~e)&&(i=be(n)):0!==(a=r&~s)?i=be(a):0!==o?i=be(o):n||0!==(n=r&~e)&&(i=be(n)),0===i?0:0!==t&&t!==i&&0===(t&s)&&((s=i&-i)>=(n=t&-t)||32===s&&4194048&n)?t:i}function Re(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function we(){var e=ye;return!(62914560&(ye<<=1))&&(ye=4194304),e}function Fe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ne(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Le(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ce(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function Oe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ce(n),i=1<=bn),xn=String.fromCharCode(32),wn=!1;function Fn(e,t){switch(e){case"keyup":return-1!==_n.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Ln=!1,On={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function In(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!On[e.type]:"textarea"===t}function kn(e,t,n,r){It?kt?kt.push(r):kt=[r]:It=r,0<(t=nh(t,"onChange")).length&&(n=new tn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Mn=null,Pn=null;function Bn(e){Kc(e,0)}function Un(e){if(ft(Qe(e)))return e}function $n(e,t){if("change"===e)return t}var Gn=!1;if($t){var Vn;if($t){var Wn="oninput"in document;if(!Wn){var Hn=document.createElement("div");Hn.setAttribute("oninput","return;"),Wn="function"==typeof Hn.oninput}Vn=Wn}else Vn=!1;Gn=Vn&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Jn(r)}}function tr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?tr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function nr(e){for(var t=pt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=pt((e=t.contentWindow).document)}return t}function rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var ir=$t&&"documentMode"in document&&11>=document.documentMode,sr=null,or=null,ar=null,lr=!1;function ur(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;lr||null==sr||sr!==pt(r)||(r="selectionStart"in(r=sr)&&rr(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},ar&&Zn(ar,r)||(ar=r,0<(r=nh(or,"onSelect")).length&&(t=new tn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=sr)))}function cr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var hr={animationend:cr("Animation","AnimationEnd"),animationiteration:cr("Animation","AnimationIteration"),animationstart:cr("Animation","AnimationStart"),transitionrun:cr("Transition","TransitionRun"),transitionstart:cr("Transition","TransitionStart"),transitioncancel:cr("Transition","TransitionCancel"),transitionend:cr("Transition","TransitionEnd")},dr={},fr={};function pr(e){if(dr[e])return dr[e];if(!hr[e])return e;var t,n=hr[e];for(t in n)if(n.hasOwnProperty(t)&&t in fr)return dr[e]=n[t];return e}$t&&(fr=document.createElement("div").style,"AnimationEvent"in window||(delete hr.animationend.animation,delete hr.animationiteration.animation,delete hr.animationstart.animation),"TransitionEvent"in window||delete hr.transitionend.transition);var mr=pr("animationend"),gr=pr("animationiteration"),Er=pr("animationstart"),vr=pr("transitionrun"),Cr=pr("transitionstart"),Dr=pr("transitioncancel"),Sr=pr("transitionend"),Ar=new Map,_r="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function yr(e,t){Ar.set(e,t),nt(t,[e])}_r.push("scrollEnd");var br="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Tr=[],Rr=0,xr=0;function wr(){for(var e=Rr,t=xr=Rr=0;t>=o,i-=o,ti=1<<32-Ce(t)+i|n<p?(m=h,h=null):m=h.sibling;var g=f(i,h,a[p],l);if(null===g){null===h&&(h=m);break}e&&h&&null===g.alternate&&t(i,h),o=s(g,o,p),null===c?u=g:c.sibling=g,c=g,h=m}if(p===a.length)return n(i,h),ci&&ri(i,p),u;if(null===h){for(;pm?(g=p,p=null):g=p.sibling;var C=f(i,p,v.value,u);if(null===C){null===p&&(p=g);break}e&&p&&null===C.alternate&&t(i,p),a=s(C,a,m),null===h?c=C:h.sibling=C,h=C,p=g}if(v.done)return n(i,p),ci&&ri(i,m),c;if(null===p){for(;!v.done;m++,v=l.next())null!==(v=d(i,v.value,u))&&(a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return ci&&ri(i,m),c}for(p=r(p);!v.done;m++,v=l.next())null!==(v=E(p,i,m,v.value,u))&&(e&&null!==v.alternate&&p.delete(null===v.key?m:v.key),a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return e&&p.forEach(function(e){return t(i,e)}),ci&&ri(i,m),c}(l,u,c=C.call(c),h)}if("function"==typeof c.then)return v(l,u,ls(c),h);if(c.$$typeof===D)return v(l,u,Li(l,c),h);cs(l,c)}return"string"==typeof c&&""!==c||"number"==typeof c||"bigint"==typeof c?(c=""+c,null!==u&&6===u.tag?(n(l,u.sibling),(h=i(u,c)).return=l,l=h):(n(l,u),(h=Wr(c,l.mode,h)).return=l,l=h),a(l)):n(l,u)}return function(e,t,n,r){try{as=0;var i=v(e,t,n,r);return os=null,i}catch(t){if(t===qi||t===Zi)throw t;var s=Pr(29,t,null,e.mode);return s.lanes=r,s.return=e,s}}}var ds=hs(!0),fs=hs(!1),ps=!1;function ms(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Es(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vs(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&du){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ir(e),Or(e,null,n),t}return Fr(e,r,t,n),Ir(e)}function Cs(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Oe(e,n)}}function Ds(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===s?i=s=o:s=s.next=o,n=n.next}while(null!==n);null===s?i=s=t:s=s.next=t}else i=s=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ss=!1;function As(){if(Ss&&null!==Wi)throw Wi}function _s(e,t,n,r){Ss=!1;var i=e.updateQueue;ps=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var l=a,u=l.next;l.next=null,null===o?s=u:o.next=u,o=l;var c=e.alternate;null!==c&&(a=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===a?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l)}if(null!==s){var h=i.baseState;for(o=0,c=u=l=null,a=s;;){var f=-536870913&a.lane,p=f!==a.lane;if(p?(mu&f)===f:(r&f)===f){0!==f&&f===Vi&&(Ss=!0),null!==c&&(c=c.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var m=e,g=a;f=t;var E=n;switch(g.tag){case 1:if("function"==typeof(m=g.payload)){h=m.call(E,h,f);break e}h=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(f="function"==typeof(m=g.payload)?m.call(E,h,f):m))break e;h=d({},h,f);break e;case 2:ps=!0}}null!==(f=a.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=i.callbacks)?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===c?(u=c=p,l=h):c=c.next=p,o|=f;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(p=a).next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}null===c&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null===s&&(i.shared.lanes=0),_u|=o,e.lanes=o,e.memoizedState=h}}function ys(e,t){if("function"!=typeof e)throw Error(o(191,e));e.call(t)}function bs(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;es?s:8;var o,a,l,u=O.T,c={};O.T=c,ca(e,!1,t,n);try{var h=i(),d=O.S;null!==d&&d(c,h),null!==h&&"object"==typeof h&&"function"==typeof h.then?ua(e,t,(o=r,a=[],l={status:"pending",value:null,reason:null,then:function(e){a.push(e)}},h.then(function(){l.status="fulfilled",l.value=o;for(var e=0;e<\/script>",s=s.removeChild(s.firstChild);break;case"select":s="string"==typeof r.is?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s="string"==typeof r.is?a.createElement(i,{is:r.is}):a.createElement(i)}}s[$e]=t,s[Ge]=r;e:for(a=t.child;null!==a;){if(5===a.tag||6===a.tag)s.appendChild(a.stateNode);else if(4!==a.tag&&27!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;null===a.sibling;){if(null===a.return||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=s;e:switch(hh(s,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&ol(t)}}return hl(t),al(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&ol(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));if(e=j.current,Ei(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(i=li))switch(i.tag){case 27:case 5:r=i.memoizedProps}e[$e]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||lh(e.nodeValue,n)))||pi(t,!0)}else(e=mh(e).createTextNode(r))[$e]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(r=Ei(t),null!==n){if(null===e){if(!r)throw Error(o(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(o(557));e[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Ps(t),t):(Ps(t),null);if(128&t.flags)throw Error(o(558))}return hl(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=Ei(t),null!==r&&null!==r.dehydrated){if(null===e){if(!i)throw Error(o(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(o(317));i[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),i=!1}else i=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return 256&t.flags?(Ps(t),t):(Ps(t),null)}return Ps(t),128&t.flags?(t.lanes=n,t):(n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(i=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(i=r.alternate.memoizedState.cachePool.pool),s=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(s=r.memoizedState.cachePool.pool),s!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ul(t,t.updateQueue),hl(t),null);case 4:return K(),null===e&&Zc(t.stateNode.containerInfo),hl(t),null;case 10:return bi(t.type),hl(t),null;case 19:if(U(Bs),null===(r=t.memoizedState))return hl(t),null;if(i=!!(128&t.flags),null===(s=r.rendering))if(i)cl(r,!1);else{if(0!==Au||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(s=Us(e))){for(t.flags|=128,cl(r,!1),e=s.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)$r(n,e),n=n.sibling;return $(Bs,1&Bs.current|2),ci&&ri(t,r.treeForkCount),t.child}e=e.sibling}null!==r.tail&&ae()>Ou&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=Us(s))){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),cl(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!ci)return hl(t),null}else 2*ae()-r.renderingStartTime>Ou&&536870912!==n&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=r.last)?e.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ae(),e.sibling=null,n=Bs.current,$(Bs,i?1&n|2:1&n),ci&&ri(t,r.treeForkCount),e):(hl(t),null);case 22:case 23:return Ps(t),Fs(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?!!(536870912&n)&&!(128&t.flags)&&(hl(t),6&t.subtreeFlags&&(t.flags|=8192)):hl(t),null!==(n=t.updateQueue)&&ul(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&U(zi),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),bi(Pi),hl(t),null;case 25:case 30:return null}throw Error(o(156,t.tag))}function fl(e,t){switch(oi(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return bi(Pi),K(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return q(t),null;case 31:if(null!==t.memoizedState){if(Ps(t),null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Ps(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return U(Bs),null;case 4:return K(),null;case 10:return bi(t.type),null;case 22:case 23:return Ps(t),Fs(),null!==e&&U(zi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return bi(Pi),null;default:return null}}function pl(e,t){switch(oi(t),t.tag){case 3:bi(Pi),K();break;case 26:case 27:case 5:q(t);break;case 4:K();break;case 31:null!==t.memoizedState&&Ps(t);break;case 13:Ps(t);break;case 19:U(Bs);break;case 10:bi(t.type);break;case 22:case 23:Ps(t),Fs(),null!==e&&U(zi);break;case 24:bi(Pi)}}function ml(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var s=n.create,o=n.inst;r=s(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ac(t,t.return,e)}}function gl(e,t,n){try{var r=t.updateQueue,i=null!==r?r.lastEffect:null;if(null!==i){var s=i.next;r=s;do{if((r.tag&e)===e){var o=r.inst,a=o.destroy;if(void 0!==a){o.destroy=void 0,i=t;var l=n,u=a;try{u()}catch(e){Ac(i,l,e)}}}r=r.next}while(r!==s)}}catch(e){Ac(t,t.return,e)}}function El(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{bs(t,n)}catch(t){Ac(e,e.return,t)}}}function vl(e,t,n){n.props=Aa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ac(e,t,n)}}function Cl(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(n){Ac(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(n){Ac(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){Ac(e,t,n)}else n.current=null}function Sl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ac(e,e.return,t)}}function Al(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,a=null,l=null,u=null,c=null,h=null;for(p in n){var d=n[p];if(n.hasOwnProperty(p)&&null!=d)switch(p){case"checked":case"value":break;case"defaultValue":u=d;default:r.hasOwnProperty(p)||uh(e,t,p,null,r,d)}}for(var f in r){var p=r[f];if(d=n[f],r.hasOwnProperty(f)&&(null!=p||null!=d))switch(f){case"type":s=p;break;case"name":i=p;break;case"checked":c=p;break;case"defaultChecked":h=p;break;case"value":a=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(o(137,t));break;default:p!==d&&uh(e,t,f,p,r,d)}}return void Et(e,a,l,u,c,h,s,i);case"select":for(s in p=a=l=f=null,n)if(u=n[s],n.hasOwnProperty(s)&&null!=u)switch(s){case"value":break;case"multiple":p=u;default:r.hasOwnProperty(s)||uh(e,t,s,null,r,u)}for(i in r)if(s=r[i],u=n[i],r.hasOwnProperty(i)&&(null!=s||null!=u))switch(i){case"value":f=s;break;case"defaultValue":l=s;break;case"multiple":a=s;default:s!==u&&uh(e,t,i,s,r,u)}return t=l,n=a,r=p,void(null!=f?Dt(e,!!n,f,!1):!!r!=!!n&&(null!=t?Dt(e,!!n,t,!0):Dt(e,!!n,n?[]:"",!1)));case"textarea":for(l in p=f=null,n)if(i=n[l],n.hasOwnProperty(l)&&null!=i&&!r.hasOwnProperty(l))switch(l){case"value":case"children":break;default:uh(e,t,l,null,r,i)}for(a in r)if(i=r[a],s=n[a],r.hasOwnProperty(a)&&(null!=i||null!=s))switch(a){case"value":f=i;break;case"defaultValue":p=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(o(91));break;default:i!==s&&uh(e,t,a,i,r,s)}return void St(e,f,p);case"option":for(var m in n)f=n[m],n.hasOwnProperty(m)&&null!=f&&!r.hasOwnProperty(m)&&("selected"===m?e.selected=!1:uh(e,t,m,null,r,f));for(u in r)f=r[u],p=n[u],!r.hasOwnProperty(u)||f===p||null==f&&null==p||("selected"===u?e.selected=f&&"function"!=typeof f&&"symbol"!=typeof f:uh(e,t,u,f,r,p));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)f=n[g],n.hasOwnProperty(g)&&null!=f&&!r.hasOwnProperty(g)&&uh(e,t,g,null,r,f);for(c in r)if(f=r[c],p=n[c],r.hasOwnProperty(c)&&f!==p&&(null!=f||null!=p))switch(c){case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(o(137,t));break;default:uh(e,t,c,f,r,p)}return;default:if(Rt(t)){for(var E in n)f=n[E],n.hasOwnProperty(E)&&void 0!==f&&!r.hasOwnProperty(E)&&ch(e,t,E,void 0,r,f);for(h in r)f=r[h],p=n[h],!r.hasOwnProperty(h)||f===p||void 0===f&&void 0===p||ch(e,t,h,f,r,p);return}}for(var v in n)f=n[v],n.hasOwnProperty(v)&&null!=f&&!r.hasOwnProperty(v)&&uh(e,t,v,null,r,f);for(d in r)f=r[d],p=n[d],!r.hasOwnProperty(d)||f===p||null==f&&null==p||uh(e,t,d,f,r,p)}(r,e.type,n,t),r[Ge]=t}catch(t){Ac(e,e.return,t)}}function _l(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&bh(e.type)||4===e.tag}function yl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||_l(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&bh(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function bl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Nt));else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(bl(e,t,n),e=e.sibling;null!==e;)bl(e,t,n),e=e.sibling}function Tl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Tl(e,t,n),e=e.sibling;null!==e;)Tl(e,t,n),e=e.sibling}function Rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);hh(t,r,n),t[$e]=e,t[Ge]=n}catch(t){Ac(e,e.return,t)}}var xl=!1,wl=!1,Fl=!1,Nl="function"==typeof WeakSet?WeakSet:Set,Ll=null;function Ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Xl(e,n),4&r&&ml(5,n);break;case 1:if(Xl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){Ac(n,n.return,e)}else{var i=Aa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ac(n,n.return,e)}}64&r&&El(n),512&r&&Cl(n,n.return);break;case 3:if(Xl(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{bs(e,t)}catch(e){Ac(n,n.return,e)}}break;case 27:null===t&&4&r&&Rl(n);case 26:case 5:Xl(e,n),null===t&&4&r&&Sl(n),512&r&&Cl(n,n.return);break;case 12:Xl(e,n);break;case 31:Xl(e,n),4&r&&Ul(e,n);break;case 13:Xl(e,n),4&r&&$l(e,n),64&r&&null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Tc.bind(null,n));break;case 22:if(!(r=null!==n.memoizedState||xl)){t=null!==t&&null!==t.memoizedState||wl,i=xl;var s=wl;xl=r,(wl=t)&&!s?Yl(e,n,!!(8772&n.subtreeFlags)):Xl(e,n),xl=i,wl=s}break;case 30:break;default:Xl(e,n)}}function Il(e){var t=e.alternate;null!==t&&(e.alternate=null,Il(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&Ke(t),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var kl=null,Ml=!1;function Pl(e,t,n){for(n=n.child;null!==n;)Bl(e,t,n),n=n.sibling}function Bl(e,t,n){if(Ee&&"function"==typeof Ee.onCommitFiberUnmount)try{Ee.onCommitFiberUnmount(ge,n)}catch(e){}switch(n.tag){case 26:wl||Dl(n,t),Pl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:wl||Dl(n,t);var r=kl,i=Ml;bh(n.type)&&(kl=n.stateNode,Ml=!1),Pl(e,t,n),Ph(n.stateNode),kl=r,Ml=i;break;case 5:wl||Dl(n,t);case 6:if(r=kl,i=Ml,kl=null,Pl(e,t,n),Ml=i,null!==(kl=r))if(Ml)try{(9===kl.nodeType?kl.body:"HTML"===kl.nodeName?kl.ownerDocument.body:kl).removeChild(n.stateNode)}catch(e){Ac(n,t,e)}else try{kl.removeChild(n.stateNode)}catch(e){Ac(n,t,e)}break;case 18:null!==kl&&(Ml?(Th(9===(e=kl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Gd(e)):Th(kl,n.stateNode));break;case 4:r=kl,i=Ml,kl=n.stateNode.containerInfo,Ml=!0,Pl(e,t,n),kl=r,Ml=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),wl||gl(4,n,t),Pl(e,t,n);break;case 1:wl||(Dl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&vl(n,t,r)),Pl(e,t,n);break;case 21:Pl(e,t,n);break;case 22:wl=(r=wl)||null!==n.memoizedState,Pl(e,t,n),wl=r;break;default:Pl(e,t,n)}}function Ul(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)){e=e.dehydrated;try{Gd(e)}catch(e){Ac(t,t.return,e)}}}function $l(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{Gd(e)}catch(e){Ac(t,t.return,e)}}function Gl(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Nl),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Nl),t;default:throw Error(o(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Rc.bind(null,e,t);t.then(r,r)}})}function Vl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r title"))),hh(s,r,n),s[$e]=e,Je(s),r=s;break e;case"link":var a=td("link","href",i).get(r+(n.href||""));if(a)for(var l=0;la)break;var c=l.transferSize,h=l.initiatorType;c&&dh(h)&&(o+=c*((l=l.responseEnd)id?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}(h,p)))return Uu=s,e.cancelPendingCommit=p(pc.bind(null,e,t,s,n,r,i,o,a,l,c,h,null,d,f)),void Qu(e,s,o,!u)}pc(e,t,s,n,r,i,o,a,l)}function qu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var r=0;rg&&(o=g,g=m,m=o);var E=er(a,m),v=er(a,g);if(E&&v&&(1!==f.rangeCount||f.anchorNode!==E.node||f.anchorOffset!==E.offset||f.focusNode!==v.node||f.focusOffset!==v.offset)){var C=h.createRange();C.setStart(E.node,E.offset),f.removeAllRanges(),m>g?(f.addRange(C),f.extend(v.node,v.offset)):(C.setEnd(v.node,v.offset),f.addRange(C))}}}}for(h=[],f=a;f=f.parentNode;)1===f.nodeType&&h.push({element:f,left:f.scrollLeft,top:f.scrollTop});for("function"==typeof a.focus&&a.focus(),a=0;an?32:n,O.T=null,n=Gu,Gu=null;var s=Pu,a=Uu;if(Mu=0,Bu=Pu=null,Uu=0,6&du)throw Error(o(331));var l=du;if(du|=4,au(s.current),Jl(s,s.current,a,n),du=l,kc(0,!1),Ee&&"function"==typeof Ee.onPostCommitFiberRoot)try{Ee.onPostCommitFiberRoot(ge,s)}catch(e){}return!0}finally{I.p=i,O.T=r,vc(e,t)}}function Sc(e,t,n){t=Xr(n,t),null!==(e=vs(e,t=xa(e.stateNode,t,2),2))&&(Ne(e,2),Ic(e))}function Ac(e,t,n){if(3===e.tag)Sc(e,e,n);else for(;null!==t;){if(3===t.tag){Sc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===ku||!ku.has(r))){e=Xr(n,e),null!==(r=vs(t,n=wa(2),2))&&(Fa(n,r,t,e),Ne(r,2),Ic(r));break}}t=t.return}}function _c(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hu;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(Du=!0,i.add(n),e=yc.bind(null,e,t,n),t.then(e,e))}function yc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,fu===e&&(mu&n)===n&&(4===Au||3===Au&&(62914560&mu)===mu&&300>ae()-Nu?!(2&du)&&ec(e,0):bu|=n,Ru===mu&&(Ru=0)),Ic(e)}function bc(e,t){0===t&&(t=we()),null!==(e=Lr(e,t))&&(Ne(e,t),Ic(e))}function Tc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),bc(e,n)}function Rc(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}null!==r&&r.delete(t),bc(e,n)}var xc=null,wc=null,Fc=!1,Nc=!1,Lc=!1,Oc=0;function Ic(e){e!==wc&&null===e.next&&(null===wc?xc=wc=e:wc=wc.next=e),Nc=!0,Fc||(Fc=!0,_h(function(){6&du?re(ue,Mc):Pc()}))}function kc(e,t){if(!Lc&&Nc){Lc=!0;do{for(var n=!1,r=xc;null!==r;){if(!t)if(0!==e){var i=r.pendingLanes;if(0===i)var s=0;else{var o=r.suspendedLanes,a=r.pingedLanes;s=(1<<31-Ce(42|e)+1)-1,s=201326741&(s&=i&~(o&~a))?201326741&s|1:s?2|s:0}0!==s&&(n=!0,$c(r,s))}else s=mu,!(3&(s=Te(r,r===fu?s:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Re(r,s)||(n=!0,$c(r,s));r=r.next}}while(n);Lc=!1}}function Mc(){Pc()}function Pc(){Nc=Fc=!1;var e,t=0;0!==Oc&&((e=window.event)&&"popstate"===e.type?e!==Ch&&(Ch=e,1):(Ch=null,0))&&(t=Oc);for(var n=ae(),r=null,i=xc;null!==i;){var s=i.next,o=Bc(i,n);0===o?(i.next=null,null===r?xc=s:r.next=s,null===s&&(wc=r)):(r=i,(0!==t||3&o)&&(Nc=!0)),i=s}0!==Mu&&5!==Mu||kc(t,!1),0!==Oc&&(Oc=0)}function Bc(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=-62914561&e.pendingLanes;0 title"):null)}function rd(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var id=0;function sd(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)ad(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var od=null;function ad(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,od=new Map,t.forEach(ld,e),od=null,sd.call(e))}function ld(e,t){if(!(4&t.state.loading)){var n=od.get(e);if(n)var r=n.get(null);else{n=new Map,od.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s>>1,i=e[r];if(!(0>>1;rs(l,n))us(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[a]=n,r=a);else{if(!(us(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var u=[],c=[],h=1,d=null,f=3,p=!1,m=!1,g=!1,E=!1,v="function"==typeof setTimeout?setTimeout:null,C="function"==typeof clearTimeout?clearTimeout:null,D="undefined"!=typeof setImmediate?setImmediate:null;function S(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function A(e){if(g=!1,S(e),!m)if(null!==r(u))m=!0,y||(y=!0,_());else{var t=r(c);null!==t&&L(A,t.startTime-e)}}var _,y=!1,b=-1,T=5,R=-1;function x(){return!(!E&&t.unstable_now()-Re&&x());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var a=o(d.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof a){d.callback=a,S(e),n=!0;break t}d===r(u)&&i(u),S(e)}else i(u);d=r(u)}if(null!==d)n=!0;else{var l=r(c);null!==l&&L(A,l.startTime-e),n=!1}}break e}finally{d=null,f=s,p=!1}n=void 0}}finally{n?_():y=!1}}}if("function"==typeof D)_=function(){D(w)};else if("undefined"!=typeof MessageChannel){var F=new MessageChannel,N=F.port2;F.port1.onmessage=w,_=function(){N.postMessage(null)}}else _=function(){v(w,0)};function L(e,n){b=v(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125o?(e.sortIndex=s,n(c,e),null===r(u)&&e===r(c)&&(g?(C(b),b=-1):g=!0,L(A,s-o))):(e.sortIndex=a,n(u,e),m||p||(m=!0,y||(y=!0,_()))),e},t.unstable_shouldYield=x,t.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}},982(e,t,n){"use strict";e.exports=n(477)},902(e,t,n){"use strict";var r=n(72),i=n.n(r),s=n(825),o=n.n(s),a=n(659),l=n.n(a),u=n(56),c=n.n(u),h=n(540),d=n.n(h),f=n(113),p=n.n(f),m=n(636),g={};g.styleTagTransform=p(),g.setAttributes=c(),g.insert=l().bind(null,"html"),g.domAPI=o(),g.insertStyleElement=d(),i()(m.A,g),m.A&&m.A.locals&&m.A.locals},72(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},878(e,t,n){"use strict";n.r(t),n.d(t,{EmbeddedFrontend:()=>Id,Spector:()=>kd});var r={};n.r(r),n.d(r,{LX:()=>Jo,ll:()=>ea});var i,s={};n.r(s),n.d(s,{SyntaxError:()=>Xc,parse:()=>Yc});class o{static isBuildableProgram(e){return!!e&&!!e[this.rebuildProgramFunctionName]}static rebuildProgram(e,t,n,r,i){this.isBuildableProgram(e)&&e[this.rebuildProgramFunctionName](t,n,r,i)}}o.rebuildProgramFunctionName="__SPECTOR_rebuildProgram",function(e){e[e.noLog=0]="noLog",e[e.error=1]="error",e[e.warning=2]="warning",e[e.info=3]="info"}(i||(i={}));class a{static error(e,...t){this.level>0&&console.error(e,t)}static warn(e,...t){this.level>1&&console.warn(e,t)}static info(e,...t){this.level>2&&console.log(e,t)}}a.level=i.warning;class l{constructor(){this.callbacks=[],this.counter=-1}add(e,t){return this.counter++,t&&(e=e.bind(t)),this.callbacks[this.counter]=e,this.counter}remove(e){delete this.callbacks[e]}clear(){this.callbacks={}}trigger(e){for(const t in this.callbacks)this.callbacks.hasOwnProperty(t)&&this.callbacks[t](e)}}class u{constructor(){if("undefined"!=typeof performance&&performance.now)this.nowFunction=()=>performance.now();else{const e=new Date;this.nowFunction=e.getTime.bind(e)}}static get now(){return u.instance.nowFunction()}}u.instance=new u;class c{constructor(e){this.options=e}appendAnalysis(e){e.analyses=e.analyses||[];const t=this.getAnalysis(e);e.analyses.push(t)}getAnalysis(e){const t={analyserName:this.analyserName};return this.appendToAnalysis(e,t),t}}class h extends c{get analyserName(){return h.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={};for(const t of e.commands)n[t.name]=n[t.name]||0,n[t.name]++;const r=Object.keys(n).map(e=>[e,n[e]]);r.sort((e,t)=>{const n=t[1]-e[1];return 0===n?e[0].localeCompare(t[0]):n});for(const e of r)t[e[0]]=e[1]}}h.analyserName="Commands";const d=["drawArrays","drawElements","drawArraysInstanced","drawArraysInstancedANGLE","drawElementsInstanced","drawElementsInstancedANGLE","drawRangeElements","multiDrawArraysWEBGL","multiDrawElementsWEBGL","multiDrawArraysInstancedWEBGL","multiDrawElementsInstancedWEBGL","multiDrawArraysInstancedBaseInstanceWEBGL","multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL","drawArraysInstancedBaseInstanceWEBGL","drawElementsInstancedBaseVertexBaseInstanceWEBGL"];class f extends c{get analyserName(){return f.analyserName}appendToAnalysis(e,t){if(e.commands){t.total=e.commands.length,t.draw=0,t.clear=0;for(const n of e.commands)"clear"===n.name?t.clear++:d.indexOf(n.name)>-1&&t.draw++}}}f.analyserName="CommandsSummary";class p{static isWebGlConstant(e){return null!==g[e]&&void 0!==g[e]}static stringifyWebGlConstant(e,t){if(null==e)return"";if(0===e){return this.zeroMeaningByCommand[t]||"0"}if(1===e){return this.oneMeaningByCommand[t]||"1"}const n=g[e];return n?n.name:e+""}}p.DEPTH_BUFFER_BIT={name:"DEPTH_BUFFER_BIT",value:256,description:"Passed to clear to clear the current depth buffer."},p.STENCIL_BUFFER_BIT={name:"STENCIL_BUFFER_BIT",value:1024,description:"Passed to clear to clear the current stencil buffer."},p.COLOR_BUFFER_BIT={name:"COLOR_BUFFER_BIT",value:16384,description:"Passed to clear to clear the current color buffer."},p.POINTS={name:"POINTS",value:0,description:"Passed to drawElements or drawArrays to draw single points."},p.LINES={name:"LINES",value:1,description:"Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it."},p.LINE_LOOP={name:"LINE_LOOP",value:2,description:"Passed to drawElements or drawArrays to draw lines. Each set of two vertices is treated as a separate line segment."},p.LINE_STRIP={name:"LINE_STRIP",value:3,description:"Passed to drawElements or drawArrays to draw a connected group of line segments from the first vertex to the last."},p.TRIANGLES={name:"TRIANGLES",value:4,description:"Passed to drawElements or drawArrays to draw triangles. Each set of three vertices creates a separate triangle."},p.TRIANGLE_STRIP={name:"TRIANGLE_STRIP",value:5,description:"Passed to drawElements or drawArrays to draw a connected group of triangles."},p.TRIANGLE_FAN={name:"TRIANGLE_FAN",value:6,description:"Passed to drawElements or drawArrays to draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan."},p.ZERO={name:"ZERO",value:0,description:"Passed to blendFunc or blendFuncSeparate to turn off a component."},p.ONE={name:"ONE",value:1,description:"Passed to blendFunc or blendFuncSeparate to turn on a component."},p.SRC_COLOR={name:"SRC_COLOR",value:768,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source elements color."},p.ONE_MINUS_SRC_COLOR={name:"ONE_MINUS_SRC_COLOR",value:769,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source elements color."},p.SRC_ALPHA={name:"SRC_ALPHA",value:770,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source's alpha."},p.ONE_MINUS_SRC_ALPHA={name:"ONE_MINUS_SRC_ALPHA",value:771,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source's alpha."},p.DST_ALPHA={name:"DST_ALPHA",value:772,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's alpha."},p.ONE_MINUS_DST_ALPHA={name:"ONE_MINUS_DST_ALPHA",value:773,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's alpha."},p.DST_COLOR={name:"DST_COLOR",value:774,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's color."},p.ONE_MINUS_DST_COLOR={name:"ONE_MINUS_DST_COLOR",value:775,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's color."},p.SRC_ALPHA_SATURATE={name:"SRC_ALPHA_SATURATE",value:776,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the minimum of source's alpha or one minus the destination's alpha."},p.CONSTANT_COLOR={name:"CONSTANT_COLOR",value:32769,description:"Passed to blendFunc or blendFuncSeparate to specify a constant color blend function."},p.ONE_MINUS_CONSTANT_COLOR={name:"ONE_MINUS_CONSTANT_COLOR",value:32770,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant color blend function."},p.CONSTANT_ALPHA={name:"CONSTANT_ALPHA",value:32771,description:"Passed to blendFunc or blendFuncSeparate to specify a constant alpha blend function."},p.ONE_MINUS_CONSTANT_ALPHA={name:"ONE_MINUS_CONSTANT_ALPHA",value:32772,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant alpha blend function."},p.FUNC_ADD={name:"FUNC_ADD",value:32774,description:"Passed to blendEquation or blendEquationSeparate to set an addition blend function."},p.FUNC_SUBSTRACT={name:"FUNC_SUBSTRACT",value:32778,description:"Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination)."},p.FUNC_REVERSE_SUBTRACT={name:"FUNC_REVERSE_SUBTRACT",value:32779,description:"Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source)."},p.BLEND_EQUATION={name:"BLEND_EQUATION",value:32777,description:"Passed to getParameter to get the current RGB blend function."},p.BLEND_EQUATION_RGB={name:"BLEND_EQUATION_RGB",value:32777,description:"Passed to getParameter to get the current RGB blend function. Same as BLEND_EQUATION"},p.BLEND_EQUATION_ALPHA={name:"BLEND_EQUATION_ALPHA",value:34877,description:"Passed to getParameter to get the current alpha blend function. Same as BLEND_EQUATION"},p.BLEND_DST_RGB={name:"BLEND_DST_RGB",value:32968,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_SRC_RGB={name:"BLEND_SRC_RGB",value:32969,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_DST_ALPHA={name:"BLEND_DST_ALPHA",value:32970,description:"Passed to getParameter to get the current destination alpha blend function."},p.BLEND_SRC_ALPHA={name:"BLEND_SRC_ALPHA",value:32971,description:"Passed to getParameter to get the current source alpha blend function."},p.BLEND_COLOR={name:"BLEND_COLOR",value:32773,description:"Passed to getParameter to return a the current blend color."},p.ARRAY_BUFFER_BINDING={name:"ARRAY_BUFFER_BINDING",value:34964,description:"Passed to getParameter to get the array buffer binding."},p.ELEMENT_ARRAY_BUFFER_BINDING={name:"ELEMENT_ARRAY_BUFFER_BINDING",value:34965,description:"Passed to getParameter to get the current element array buffer."},p.LINE_WIDTH={name:"LINE_WIDTH",value:2849,description:"Passed to getParameter to get the current lineWidth (set by the lineWidth method)."},p.ALIASED_POINT_SIZE_RANGE={name:"ALIASED_POINT_SIZE_RANGE",value:33901,description:"Passed to getParameter to get the current size of a point drawn with gl.POINTS"},p.ALIASED_LINE_WIDTH_RANGE={name:"ALIASED_LINE_WIDTH_RANGE",value:33902,description:"Passed to getParameter to get the range of available widths for a line. Returns a length-2 array with the lo value at 0, and hight at 1."},p.CULL_FACE_MODE={name:"CULL_FACE_MODE",value:2885,description:"Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK"},p.FRONT_FACE={name:"FRONT_FACE",value:2886,description:"Passed to getParameter to determine the current value of frontFace. Should return CW or CCW."},p.DEPTH_RANGE={name:"DEPTH_RANGE",value:2928,description:"Passed to getParameter to return a length-2 array of floats giving the current depth range."},p.DEPTH_WRITEMASK={name:"DEPTH_WRITEMASK",value:2930,description:"Passed to getParameter to determine if the depth write mask is enabled."},p.DEPTH_CLEAR_VALUE={name:"DEPTH_CLEAR_VALUE",value:2931,description:"Passed to getParameter to determine the current depth clear value."},p.DEPTH_FUNC={name:"DEPTH_FUNC",value:2932,description:"Passed to getParameter to get the current depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_CLEAR_VALUE={name:"STENCIL_CLEAR_VALUE",value:2961,description:"Passed to getParameter to get the value the stencil will be cleared to."},p.STENCIL_FUNC={name:"STENCIL_FUNC",value:2962,description:"Passed to getParameter to get the current stencil function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_FAIL={name:"STENCIL_FAIL",value:2964,description:"Passed to getParameter to get the current stencil fail function. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_FAIL={name:"STENCIL_PASS_DEPTH_FAIL",value:2965,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test fail. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_PASS={name:"STENCIL_PASS_DEPTH_PASS",value:2966,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test pass. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_REF={name:"STENCIL_REF",value:2967,description:"Passed to getParameter to get the reference value used for stencil tests."},p.STENCIL_VALUE_MASK={name:"STENCIL_VALUE_MASK",value:2963,description:" "},p.STENCIL_WRITEMASK={name:"STENCIL_WRITEMASK",value:2968,description:" "},p.STENCIL_BACK_FUNC={name:"STENCIL_BACK_FUNC",value:34816,description:" "},p.STENCIL_BACK_FAIL={name:"STENCIL_BACK_FAIL",value:34817,description:" "},p.STENCIL_BACK_PASS_DEPTH_FAIL={name:"STENCIL_BACK_PASS_DEPTH_FAIL",value:34818,description:" "},p.STENCIL_BACK_PASS_DEPTH_PASS={name:"STENCIL_BACK_PASS_DEPTH_PASS",value:34819,description:" "},p.STENCIL_BACK_REF={name:"STENCIL_BACK_REF",value:36003,description:" "},p.STENCIL_BACK_VALUE_MASK={name:"STENCIL_BACK_VALUE_MASK",value:36004,description:" "},p.STENCIL_BACK_WRITEMASK={name:"STENCIL_BACK_WRITEMASK",value:36005,description:" "},p.VIEWPORT={name:"VIEWPORT",value:2978,description:"Returns an Int32Array with four elements for the current viewport dimensions."},p.SCISSOR_BOX={name:"SCISSOR_BOX",value:3088,description:"Returns an Int32Array with four elements for the current scissor box dimensions."},p.COLOR_CLEAR_VALUE={name:"COLOR_CLEAR_VALUE",value:3106,description:" "},p.COLOR_WRITEMASK={name:"COLOR_WRITEMASK",value:3107,description:" "},p.UNPACK_ALIGNMENT={name:"UNPACK_ALIGNMENT",value:3317,description:" "},p.PACK_ALIGNMENT={name:"PACK_ALIGNMENT",value:3333,description:" "},p.MAX_TEXTURE_SIZE={name:"MAX_TEXTURE_SIZE",value:3379,description:" "},p.MAX_VIEWPORT_DIMS={name:"MAX_VIEWPORT_DIMS",value:3386,description:" "},p.SUBPIXEL_BITS={name:"SUBPIXEL_BITS",value:3408,description:" "},p.RED_BITS={name:"RED_BITS",value:3410,description:" "},p.GREEN_BITS={name:"GREEN_BITS",value:3411,description:" "},p.BLUE_BITS={name:"BLUE_BITS",value:3412,description:" "},p.ALPHA_BITS={name:"ALPHA_BITS",value:3413,description:" "},p.DEPTH_BITS={name:"DEPTH_BITS",value:3414,description:" "},p.STENCIL_BITS={name:"STENCIL_BITS",value:3415,description:" "},p.POLYGON_OFFSET_UNITS={name:"POLYGON_OFFSET_UNITS",value:10752,description:" "},p.POLYGON_OFFSET_FACTOR={name:"POLYGON_OFFSET_FACTOR",value:32824,description:" "},p.TEXTURE_BINDING_2D={name:"TEXTURE_BINDING_2D",value:32873,description:" "},p.SAMPLE_BUFFERS={name:"SAMPLE_BUFFERS",value:32936,description:" "},p.SAMPLES={name:"SAMPLES",value:32937,description:" "},p.SAMPLE_COVERAGE_VALUE={name:"SAMPLE_COVERAGE_VALUE",value:32938,description:" "},p.SAMPLE_COVERAGE_INVERT={name:"SAMPLE_COVERAGE_INVERT",value:32939,description:" "},p.COMPRESSED_TEXTURE_FORMATS={name:"COMPRESSED_TEXTURE_FORMATS",value:34467,description:" "},p.VENDOR={name:"VENDOR",value:7936,description:" "},p.RENDERER={name:"RENDERER",value:7937,description:" "},p.VERSION={name:"VERSION",value:7938,description:" "},p.IMPLEMENTATION_COLOR_READ_TYPE={name:"IMPLEMENTATION_COLOR_READ_TYPE",value:35738,description:" "},p.IMPLEMENTATION_COLOR_READ_FORMAT={name:"IMPLEMENTATION_COLOR_READ_FORMAT",value:35739,description:" "},p.BROWSER_DEFAULT_WEBGL={name:"BROWSER_DEFAULT_WEBGL",value:37444,description:" "},p.STATIC_DRAW={name:"STATIC_DRAW",value:35044,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and not change often."},p.STREAM_DRAW={name:"STREAM_DRAW",value:35040,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to not be used often."},p.DYNAMIC_DRAW={name:"DYNAMIC_DRAW",value:35048,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and change often."},p.ARRAY_BUFFER={name:"ARRAY_BUFFER",value:34962,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.ELEMENT_ARRAY_BUFFER={name:"ELEMENT_ARRAY_BUFFER",value:34963,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.BUFFER_SIZE={name:"BUFFER_SIZE",value:34660,description:"Passed to getBufferParameter to get a buffer's size."},p.BUFFER_USAGE={name:"BUFFER_USAGE",value:34661,description:"Passed to getBufferParameter to get the hint for the buffer passed in when it was created."},p.CURRENT_VERTEX_ATTRIB={name:"CURRENT_VERTEX_ATTRIB",value:34342,description:"Passed to getVertexAttrib to read back the current vertex attribute."},p.VERTEX_ATTRIB_ARRAY_ENABLED={name:"VERTEX_ATTRIB_ARRAY_ENABLED",value:34338,description:" "},p.VERTEX_ATTRIB_ARRAY_SIZE={name:"VERTEX_ATTRIB_ARRAY_SIZE",value:34339,description:" "},p.VERTEX_ATTRIB_ARRAY_STRIDE={name:"VERTEX_ATTRIB_ARRAY_STRIDE",value:34340,description:" "},p.VERTEX_ATTRIB_ARRAY_TYPE={name:"VERTEX_ATTRIB_ARRAY_TYPE",value:34341,description:" "},p.VERTEX_ATTRIB_ARRAY_NORMALIZED={name:"VERTEX_ATTRIB_ARRAY_NORMALIZED",value:34922,description:" "},p.VERTEX_ATTRIB_ARRAY_POINTER={name:"VERTEX_ATTRIB_ARRAY_POINTER",value:34373,description:" "},p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING={name:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",value:34975,description:" "},p.CULL_FACE={name:"CULL_FACE",value:2884,description:"Passed to enable/disable to turn on/off culling. Can also be used with getParameter to find the current culling method."},p.FRONT={name:"FRONT",value:1028,description:"Passed to cullFace to specify that only front faces should be drawn."},p.BACK={name:"BACK",value:1029,description:"Passed to cullFace to specify that only back faces should be drawn."},p.FRONT_AND_BACK={name:"FRONT_AND_BACK",value:1032,description:"Passed to cullFace to specify that front and back faces should be drawn."},p.BLEND={name:"BLEND",value:3042,description:"Passed to enable/disable to turn on/off blending. Can also be used with getParameter to find the current blending method."},p.DEPTH_TEST={name:"DEPTH_TEST",value:2929,description:"Passed to enable/disable to turn on/off the depth test. Can also be used with getParameter to query the depth test."},p.DITHER={name:"DITHER",value:3024,description:"Passed to enable/disable to turn on/off dithering. Can also be used with getParameter to find the current dithering method."},p.POLYGON_OFFSET_FILL={name:"POLYGON_OFFSET_FILL",value:32823,description:"Passed to enable/disable to turn on/off the polygon offset. Useful for rendering hidden-line images, decals, and or solids with highlighted edges. Can also be used with getParameter to query the scissor test."},p.SAMPLE_ALPHA_TO_COVERAGE={name:"SAMPLE_ALPHA_TO_COVERAGE",value:32926,description:"Passed to enable/disable to turn on/off the alpha to coverage. Used in multi-sampling alpha channels."},p.SAMPLE_COVERAGE={name:"SAMPLE_COVERAGE",value:32928,description:"Passed to enable/disable to turn on/off the sample coverage. Used in multi-sampling."},p.SCISSOR_TEST={name:"SCISSOR_TEST",value:3089,description:"Passed to enable/disable to turn on/off the scissor test. Can also be used with getParameter to query the scissor test."},p.STENCIL_TEST={name:"STENCIL_TEST",value:2960,description:"Passed to enable/disable to turn on/off the stencil test. Can also be used with getParameter to query the stencil test."},p.NO_ERROR={name:"NO_ERROR",value:0,description:"Returned from getError."},p.INVALID_ENUM={name:"INVALID_ENUM",value:1280,description:"Returned from getError."},p.INVALID_VALUE={name:"INVALID_VALUE",value:1281,description:"Returned from getError."},p.INVALID_OPERATION={name:"INVALID_OPERATION",value:1282,description:"Returned from getError."},p.OUT_OF_MEMORY={name:"OUT_OF_MEMORY",value:1285,description:"Returned from getError."},p.CONTEXT_LOST_WEBGL={name:"CONTEXT_LOST_WEBGL",value:37442,description:"Returned from getError."},p.CW={name:"CW",value:2304,description:"Passed to frontFace to specify the front face of a polygon is drawn in the clockwise direction"},p.CCW={name:"CCW",value:2305,description:"Passed to frontFace to specify the front face of a polygon is drawn in the counter clockwise direction"},p.DONT_CARE={name:"DONT_CARE",value:4352,description:"There is no preference for this behavior."},p.FASTEST={name:"FASTEST",value:4353,description:"The most efficient behavior should be used."},p.NICEST={name:"NICEST",value:4354,description:"The most correct or the highest quality option should be used."},p.GENERATE_MIPMAP_HINT={name:"GENERATE_MIPMAP_HINT",value:33170,description:"Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap()."},p.BYTE={name:"BYTE",value:5120,description:" "},p.UNSIGNED_BYTE={name:"UNSIGNED_BYTE",value:5121,description:" "},p.SHORT={name:"SHORT",value:5122,description:" "},p.UNSIGNED_SHORT={name:"UNSIGNED_SHORT",value:5123,description:" "},p.INT={name:"INT",value:5124,description:" "},p.UNSIGNED_INT={name:"UNSIGNED_INT",value:5125,description:" "},p.FLOAT={name:"FLOAT",value:5126,description:" "},p.DEPTH_COMPONENT={name:"DEPTH_COMPONENT",value:6402,description:" "},p.ALPHA={name:"ALPHA",value:6406,description:" "},p.RGB={name:"RGB",value:6407,description:" "},p.RGBA={name:"RGBA",value:6408,description:" "},p.LUMINANCE={name:"LUMINANCE",value:6409,description:" "},p.LUMINANCE_ALPHA={name:"LUMINANCE_ALPHA",value:6410,description:" "},p.UNSIGNED_SHORT_4_4_4_4={name:"UNSIGNED_SHORT_4_4_4_4",value:32819,description:" "},p.UNSIGNED_SHORT_5_5_5_1={name:"UNSIGNED_SHORT_5_5_5_1",value:32820,description:" "},p.UNSIGNED_SHORT_5_6_5={name:"UNSIGNED_SHORT_5_6_5",value:33635,description:" "},p.FRAGMENT_SHADER={name:"FRAGMENT_SHADER",value:35632,description:"Passed to createShader to define a fragment shader."},p.VERTEX_SHADER={name:"VERTEX_SHADER",value:35633,description:"Passed to createShader to define a vertex shader"},p.COMPILE_STATUS={name:"COMPILE_STATUS",value:35713,description:"Passed to getShaderParamter to get the status of the compilation. Returns false if the shader was not compiled. You can then query getShaderInfoLog to find the exact error"},p.DELETE_STATUS={name:"DELETE_STATUS",value:35712,description:"Passed to getShaderParamter to determine if a shader was deleted via deleteShader. Returns true if it was, false otherwise."},p.LINK_STATUS={name:"LINK_STATUS",value:35714,description:"Passed to getProgramParameter after calling linkProgram to determine if a program was linked correctly. Returns false if there were errors. Use getProgramInfoLog to find the exact error."},p.VALIDATE_STATUS={name:"VALIDATE_STATUS",value:35715,description:"Passed to getProgramParameter after calling validateProgram to determine if it is valid. Returns false if errors were found."},p.ATTACHED_SHADERS={name:"ATTACHED_SHADERS",value:35717,description:"Passed to getProgramParameter after calling attachShader to determine if the shader was attached correctly. Returns false if errors occurred."},p.COMPLETION_STATUS_KHR={name:"COMPLETION_STATUS_KHR",value:37297,description:"Passed to getProgramParameter (KHR_parallel_shader_compile) to query whether an asynchronous shader/program link has completed. Returns true once the program is ready to use without blocking."},p.ACTIVE_ATTRIBUTES={name:"ACTIVE_ATTRIBUTES",value:35721,description:"Passed to getProgramParameter to get the number of attributes active in a program."},p.ACTIVE_UNIFORMS={name:"ACTIVE_UNIFORMS",value:35718,description:"Passed to getProgramParamter to get the number of uniforms active in a program."},p.MAX_VERTEX_ATTRIBS={name:"MAX_VERTEX_ATTRIBS",value:34921,description:" "},p.MAX_VERTEX_UNIFORM_VECTORS={name:"MAX_VERTEX_UNIFORM_VECTORS",value:36347,description:" "},p.MAX_VARYING_VECTORS={name:"MAX_VARYING_VECTORS",value:36348,description:" "},p.MAX_COMBINED_TEXTURE_IMAGE_UNITS={name:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",value:35661,description:" "},p.MAX_VERTEX_TEXTURE_IMAGE_UNITS={name:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",value:35660,description:" "},p.MAX_TEXTURE_IMAGE_UNITS={name:"MAX_TEXTURE_IMAGE_UNITS",value:34930,description:"Implementation dependent number of maximum texture units. At least 8."},p.MAX_FRAGMENT_UNIFORM_VECTORS={name:"MAX_FRAGMENT_UNIFORM_VECTORS",value:36349,description:" "},p.SHADER_TYPE={name:"SHADER_TYPE",value:35663,description:" "},p.SHADING_LANGUAGE_VERSION={name:"SHADING_LANGUAGE_VERSION",value:35724,description:" "},p.CURRENT_PROGRAM={name:"CURRENT_PROGRAM",value:35725,description:" "},p.NEVER={name:"NEVER",value:512,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn."},p.ALWAYS={name:"ALWAYS",value:519,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn."},p.LESS={name:"LESS",value:513,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value."},p.EQUAL={name:"EQUAL",value:514,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value."},p.LEQUAL={name:"LEQUAL",value:515,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value."},p.GREATER={name:"GREATER",value:516,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value."},p.GEQUAL={name:"GEQUAL",value:518,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value."},p.NOTEQUAL={name:"NOTEQUAL",value:517,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value."},p.KEEP={name:"KEEP",value:7680,description:" "},p.REPLACE={name:"REPLACE",value:7681,description:" "},p.INCR={name:"INCR",value:7682,description:" "},p.DECR={name:"DECR",value:7683,description:" "},p.INVERT={name:"INVERT",value:5386,description:" "},p.INCR_WRAP={name:"INCR_WRAP",value:34055,description:" "},p.DECR_WRAP={name:"DECR_WRAP",value:34056,description:" "},p.NEAREST={name:"NEAREST",value:9728,description:" "},p.LINEAR={name:"LINEAR",value:9729,description:" "},p.NEAREST_MIPMAP_NEAREST={name:"NEAREST_MIPMAP_NEAREST",value:9984,description:" "},p.LINEAR_MIPMAP_NEAREST={name:"LINEAR_MIPMAP_NEAREST",value:9985,description:" "},p.NEAREST_MIPMAP_LINEAR={name:"NEAREST_MIPMAP_LINEAR",value:9986,description:" "},p.LINEAR_MIPMAP_LINEAR={name:"LINEAR_MIPMAP_LINEAR",value:9987,description:" "},p.TEXTURE_MAG_FILTER={name:"TEXTURE_MAG_FILTER",value:10240,description:" "},p.TEXTURE_MIN_FILTER={name:"TEXTURE_MIN_FILTER",value:10241,description:" "},p.TEXTURE_WRAP_S={name:"TEXTURE_WRAP_S",value:10242,description:" "},p.TEXTURE_WRAP_T={name:"TEXTURE_WRAP_T",value:10243,description:" "},p.TEXTURE_2D={name:"TEXTURE_2D",value:3553,description:" "},p.TEXTURE={name:"TEXTURE",value:5890,description:" "},p.TEXTURE_CUBE_MAP={name:"TEXTURE_CUBE_MAP",value:34067,description:" "},p.TEXTURE_BINDING_CUBE_MAP={name:"TEXTURE_BINDING_CUBE_MAP",value:34068,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_X={name:"TEXTURE_CUBE_MAP_POSITIVE_X",value:34069,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_X={name:"TEXTURE_CUBE_MAP_NEGATIVE_X",value:34070,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Y={name:"TEXTURE_CUBE_MAP_POSITIVE_Y",value:34071,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Y={name:"TEXTURE_CUBE_MAP_NEGATIVE_Y",value:34072,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Z={name:"TEXTURE_CUBE_MAP_POSITIVE_Z",value:34073,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Z={name:"TEXTURE_CUBE_MAP_NEGATIVE_Z",value:34074,description:" "},p.MAX_CUBE_MAP_TEXTURE_SIZE={name:"MAX_CUBE_MAP_TEXTURE_SIZE",value:34076,description:" "},p.TEXTURE0={name:"TEXTURE0",value:33984,description:"A texture unit."},p.TEXTURE1={name:"TEXTURE1",value:33985,description:"A texture unit."},p.TEXTURE2={name:"TEXTURE2",value:33986,description:"A texture unit."},p.TEXTURE3={name:"TEXTURE3",value:33987,description:"A texture unit."},p.TEXTURE4={name:"TEXTURE4",value:33988,description:"A texture unit."},p.TEXTURE5={name:"TEXTURE5",value:33989,description:"A texture unit."},p.TEXTURE6={name:"TEXTURE6",value:33990,description:"A texture unit."},p.TEXTURE7={name:"TEXTURE7",value:33991,description:"A texture unit."},p.TEXTURE8={name:"TEXTURE8",value:33992,description:"A texture unit."},p.TEXTURE9={name:"TEXTURE9",value:33993,description:"A texture unit."},p.TEXTURE10={name:"TEXTURE10",value:33994,description:"A texture unit."},p.TEXTURE11={name:"TEXTURE11",value:33995,description:"A texture unit."},p.TEXTURE12={name:"TEXTURE12",value:33996,description:"A texture unit."},p.TEXTURE13={name:"TEXTURE13",value:33997,description:"A texture unit."},p.TEXTURE14={name:"TEXTURE14",value:33998,description:"A texture unit."},p.TEXTURE15={name:"TEXTURE15",value:33999,description:"A texture unit."},p.TEXTURE16={name:"TEXTURE16",value:34e3,description:"A texture unit."},p.TEXTURE17={name:"TEXTURE17",value:34001,description:"A texture unit."},p.TEXTURE18={name:"TEXTURE18",value:34002,description:"A texture unit."},p.TEXTURE19={name:"TEXTURE19",value:34003,description:"A texture unit."},p.TEXTURE20={name:"TEXTURE20",value:34004,description:"A texture unit."},p.TEXTURE21={name:"TEXTURE21",value:34005,description:"A texture unit."},p.TEXTURE22={name:"TEXTURE22",value:34006,description:"A texture unit."},p.TEXTURE23={name:"TEXTURE23",value:34007,description:"A texture unit."},p.TEXTURE24={name:"TEXTURE24",value:34008,description:"A texture unit."},p.TEXTURE25={name:"TEXTURE25",value:34009,description:"A texture unit."},p.TEXTURE26={name:"TEXTURE26",value:34010,description:"A texture unit."},p.TEXTURE27={name:"TEXTURE27",value:34011,description:"A texture unit."},p.TEXTURE28={name:"TEXTURE28",value:34012,description:"A texture unit."},p.TEXTURE29={name:"TEXTURE29",value:34013,description:"A texture unit."},p.TEXTURE30={name:"TEXTURE30",value:34014,description:"A texture unit."},p.TEXTURE31={name:"TEXTURE31",value:34015,description:"A texture unit."},p.ACTIVE_TEXTURE={name:"ACTIVE_TEXTURE",value:34016,description:"The current active texture unit."},p.REPEAT={name:"REPEAT",value:10497,description:" "},p.CLAMP_TO_EDGE={name:"CLAMP_TO_EDGE",value:33071,description:" "},p.MIRRORED_REPEAT={name:"MIRRORED_REPEAT",value:33648,description:" "},p.FLOAT_VEC2={name:"FLOAT_VEC2",value:35664,description:" "},p.FLOAT_VEC3={name:"FLOAT_VEC3",value:35665,description:" "},p.FLOAT_VEC4={name:"FLOAT_VEC4",value:35666,description:" "},p.INT_VEC2={name:"INT_VEC2",value:35667,description:" "},p.INT_VEC3={name:"INT_VEC3",value:35668,description:" "},p.INT_VEC4={name:"INT_VEC4",value:35669,description:" "},p.BOOL={name:"BOOL",value:35670,description:" "},p.BOOL_VEC2={name:"BOOL_VEC2",value:35671,description:" "},p.BOOL_VEC3={name:"BOOL_VEC3",value:35672,description:" "},p.BOOL_VEC4={name:"BOOL_VEC4",value:35673,description:" "},p.FLOAT_MAT2={name:"FLOAT_MAT2",value:35674,description:" "},p.FLOAT_MAT3={name:"FLOAT_MAT3",value:35675,description:" "},p.FLOAT_MAT4={name:"FLOAT_MAT4",value:35676,description:" "},p.SAMPLER_2D={name:"SAMPLER_2D",value:35678,description:" "},p.SAMPLER_CUBE={name:"SAMPLER_CUBE",value:35680,description:" "},p.LOW_FLOAT={name:"LOW_FLOAT",value:36336,description:" "},p.MEDIUM_FLOAT={name:"MEDIUM_FLOAT",value:36337,description:" "},p.HIGH_FLOAT={name:"HIGH_FLOAT",value:36338,description:" "},p.LOW_INT={name:"LOW_INT",value:36339,description:" "},p.MEDIUM_INT={name:"MEDIUM_INT",value:36340,description:" "},p.HIGH_INT={name:"HIGH_INT",value:36341,description:" "},p.FRAMEBUFFER={name:"FRAMEBUFFER",value:36160,description:" "},p.RENDERBUFFER={name:"RENDERBUFFER",value:36161,description:" "},p.RGBA4={name:"RGBA4",value:32854,description:" "},p.RGB5_A1={name:"RGB5_A1",value:32855,description:" "},p.RGB565={name:"RGB565",value:36194,description:" "},p.DEPTH_COMPONENT16={name:"DEPTH_COMPONENT16",value:33189,description:" "},p.STENCIL_INDEX={name:"STENCIL_INDEX",value:6401,description:" "},p.STENCIL_INDEX8={name:"STENCIL_INDEX8",value:36168,description:" "},p.DEPTH_STENCIL={name:"DEPTH_STENCIL",value:34041,description:" "},p.RENDERBUFFER_WIDTH={name:"RENDERBUFFER_WIDTH",value:36162,description:" "},p.RENDERBUFFER_HEIGHT={name:"RENDERBUFFER_HEIGHT",value:36163,description:" "},p.RENDERBUFFER_INTERNAL_FORMAT={name:"RENDERBUFFER_INTERNAL_FORMAT",value:36164,description:" "},p.RENDERBUFFER_RED_SIZE={name:"RENDERBUFFER_RED_SIZE",value:36176,description:" "},p.RENDERBUFFER_GREEN_SIZE={name:"RENDERBUFFER_GREEN_SIZE",value:36177,description:" "},p.RENDERBUFFER_BLUE_SIZE={name:"RENDERBUFFER_BLUE_SIZE",value:36178,description:" "},p.RENDERBUFFER_ALPHA_SIZE={name:"RENDERBUFFER_ALPHA_SIZE",value:36179,description:" "},p.RENDERBUFFER_DEPTH_SIZE={name:"RENDERBUFFER_DEPTH_SIZE",value:36180,description:" "},p.RENDERBUFFER_STENCIL_SIZE={name:"RENDERBUFFER_STENCIL_SIZE",value:36181,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",value:36048,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",value:36049,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",value:36050,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",value:36051,description:" "},p.COLOR_ATTACHMENT0={name:"COLOR_ATTACHMENT0",value:36064,description:" "},p.DEPTH_ATTACHMENT={name:"DEPTH_ATTACHMENT",value:36096,description:" "},p.STENCIL_ATTACHMENT={name:"STENCIL_ATTACHMENT",value:36128,description:" "},p.DEPTH_STENCIL_ATTACHMENT={name:"DEPTH_STENCIL_ATTACHMENT",value:33306,description:" "},p.NONE={name:"NONE",value:0,description:" "},p.FRAMEBUFFER_COMPLETE={name:"FRAMEBUFFER_COMPLETE",value:36053,description:" "},p.FRAMEBUFFER_INCOMPLETE_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",value:36054,description:" "},p.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",value:36055,description:" "},p.FRAMEBUFFER_INCOMPLETE_DIMENSIONS={name:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",value:36057,description:" "},p.FRAMEBUFFER_UNSUPPORTED={name:"FRAMEBUFFER_UNSUPPORTED",value:36061,description:" "},p.FRAMEBUFFER_BINDING={name:"FRAMEBUFFER_BINDING",value:36006,description:" "},p.RENDERBUFFER_BINDING={name:"RENDERBUFFER_BINDING",value:36007,description:" "},p.MAX_RENDERBUFFER_SIZE={name:"MAX_RENDERBUFFER_SIZE",value:34024,description:" "},p.INVALID_FRAMEBUFFER_OPERATION={name:"INVALID_FRAMEBUFFER_OPERATION",value:1286,description:" "},p.UNPACK_FLIP_Y_WEBGL={name:"UNPACK_FLIP_Y_WEBGL",value:37440,description:" "},p.UNPACK_PREMULTIPLY_ALPHA_WEBGL={name:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",value:37441,description:" "},p.UNPACK_COLORSPACE_CONVERSION_WEBGL={name:"UNPACK_COLORSPACE_CONVERSION_WEBGL",value:37443,description:" "},p.READ_BUFFER={name:"READ_BUFFER",value:3074,description:" "},p.UNPACK_ROW_LENGTH={name:"UNPACK_ROW_LENGTH",value:3314,description:" "},p.UNPACK_SKIP_ROWS={name:"UNPACK_SKIP_ROWS",value:3315,description:" "},p.UNPACK_SKIP_PIXELS={name:"UNPACK_SKIP_PIXELS",value:3316,description:" "},p.PACK_ROW_LENGTH={name:"PACK_ROW_LENGTH",value:3330,description:" "},p.PACK_SKIP_ROWS={name:"PACK_SKIP_ROWS",value:3331,description:" "},p.PACK_SKIP_PIXELS={name:"PACK_SKIP_PIXELS",value:3332,description:" "},p.TEXTURE_BINDING_3D={name:"TEXTURE_BINDING_3D",value:32874,description:" "},p.UNPACK_SKIP_IMAGES={name:"UNPACK_SKIP_IMAGES",value:32877,description:" "},p.UNPACK_IMAGE_HEIGHT={name:"UNPACK_IMAGE_HEIGHT",value:32878,description:" "},p.MAX_3D_TEXTURE_SIZE={name:"MAX_3D_TEXTURE_SIZE",value:32883,description:" "},p.MAX_ELEMENTS_VERTICES={name:"MAX_ELEMENTS_VERTICES",value:33e3,description:" "},p.MAX_ELEMENTS_INDICES={name:"MAX_ELEMENTS_INDICES",value:33001,description:" "},p.MAX_TEXTURE_LOD_BIAS={name:"MAX_TEXTURE_LOD_BIAS",value:34045,description:" "},p.MAX_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_FRAGMENT_UNIFORM_COMPONENTS",value:35657,description:" "},p.MAX_VERTEX_UNIFORM_COMPONENTS={name:"MAX_VERTEX_UNIFORM_COMPONENTS",value:35658,description:" "},p.MAX_ARRAY_TEXTURE_LAYERS={name:"MAX_ARRAY_TEXTURE_LAYERS",value:35071,description:" "},p.MIN_PROGRAM_TEXEL_OFFSET={name:"MIN_PROGRAM_TEXEL_OFFSET",value:35076,description:" "},p.MAX_PROGRAM_TEXEL_OFFSET={name:"MAX_PROGRAM_TEXEL_OFFSET",value:35077,description:" "},p.MAX_VARYING_COMPONENTS={name:"MAX_VARYING_COMPONENTS",value:35659,description:" "},p.FRAGMENT_SHADER_DERIVATIVE_HINT={name:"FRAGMENT_SHADER_DERIVATIVE_HINT",value:35723,description:" "},p.RASTERIZER_DISCARD={name:"RASTERIZER_DISCARD",value:35977,description:" "},p.VERTEX_ARRAY_BINDING={name:"VERTEX_ARRAY_BINDING",value:34229,description:" "},p.MAX_VERTEX_OUTPUT_COMPONENTS={name:"MAX_VERTEX_OUTPUT_COMPONENTS",value:37154,description:" "},p.MAX_FRAGMENT_INPUT_COMPONENTS={name:"MAX_FRAGMENT_INPUT_COMPONENTS",value:37157,description:" "},p.MAX_SERVER_WAIT_TIMEOUT={name:"MAX_SERVER_WAIT_TIMEOUT",value:37137,description:" "},p.MAX_ELEMENT_INDEX={name:"MAX_ELEMENT_INDEX",value:36203,description:" "},p.RED={name:"RED",value:6403,description:" "},p.RGB8={name:"RGB8",value:32849,description:" "},p.RGBA8={name:"RGBA8",value:32856,description:" "},p.RGB10_A2={name:"RGB10_A2",value:32857,description:" "},p.TEXTURE_3D={name:"TEXTURE_3D",value:32879,description:" "},p.TEXTURE_WRAP_R={name:"TEXTURE_WRAP_R",value:32882,description:" "},p.TEXTURE_MIN_LOD={name:"TEXTURE_MIN_LOD",value:33082,description:" "},p.TEXTURE_MAX_LOD={name:"TEXTURE_MAX_LOD",value:33083,description:" "},p.TEXTURE_BASE_LEVEL={name:"TEXTURE_BASE_LEVEL",value:33084,description:" "},p.TEXTURE_MAX_LEVEL={name:"TEXTURE_MAX_LEVEL",value:33085,description:" "},p.TEXTURE_COMPARE_MODE={name:"TEXTURE_COMPARE_MODE",value:34892,description:" "},p.TEXTURE_COMPARE_FUNC={name:"TEXTURE_COMPARE_FUNC",value:34893,description:" "},p.SRGB={name:"SRGB",value:35904,description:" "},p.SRGB8={name:"SRGB8",value:35905,description:" "},p.SRGB8_ALPHA8={name:"SRGB8_ALPHA8",value:35907,description:" "},p.COMPARE_REF_TO_TEXTURE={name:"COMPARE_REF_TO_TEXTURE",value:34894,description:" "},p.RGBA32F={name:"RGBA32F",value:34836,description:" "},p.RGB32F={name:"RGB32F",value:34837,description:" "},p.RGBA16F={name:"RGBA16F",value:34842,description:" "},p.RGB16F={name:"RGB16F",value:34843,description:" "},p.TEXTURE_2D_ARRAY={name:"TEXTURE_2D_ARRAY",value:35866,description:" "},p.TEXTURE_BINDING_2D_ARRAY={name:"TEXTURE_BINDING_2D_ARRAY",value:35869,description:" "},p.R11F_G11F_B10F={name:"R11F_G11F_B10F",value:35898,description:" "},p.RGB9_E5={name:"RGB9_E5",value:35901,description:" "},p.RGBA32UI={name:"RGBA32UI",value:36208,description:" "},p.RGB32UI={name:"RGB32UI",value:36209,description:" "},p.RGBA16UI={name:"RGBA16UI",value:36214,description:" "},p.RGB16UI={name:"RGB16UI",value:36215,description:" "},p.RGBA8UI={name:"RGBA8UI",value:36220,description:" "},p.RGB8UI={name:"RGB8UI",value:36221,description:" "},p.RGBA32I={name:"RGBA32I",value:36226,description:" "},p.RGB32I={name:"RGB32I",value:36227,description:" "},p.RGBA16I={name:"RGBA16I",value:36232,description:" "},p.RGB16I={name:"RGB16I",value:36233,description:" "},p.RGBA8I={name:"RGBA8I",value:36238,description:" "},p.RGB8I={name:"RGB8I",value:36239,description:" "},p.RED_INTEGER={name:"RED_INTEGER",value:36244,description:" "},p.RGB_INTEGER={name:"RGB_INTEGER",value:36248,description:" "},p.RGBA_INTEGER={name:"RGBA_INTEGER",value:36249,description:" "},p.R8={name:"R8",value:33321,description:" "},p.RG8={name:"RG8",value:33323,description:" "},p.R16F={name:"R16F",value:33325,description:" "},p.R32F={name:"R32F",value:33326,description:" "},p.RG16F={name:"RG16F",value:33327,description:" "},p.RG32F={name:"RG32F",value:33328,description:" "},p.R8I={name:"R8I",value:33329,description:" "},p.R8UI={name:"R8UI",value:33330,description:" "},p.R16I={name:"R16I",value:33331,description:" "},p.R16UI={name:"R16UI",value:33332,description:" "},p.R32I={name:"R32I",value:33333,description:" "},p.R32UI={name:"R32UI",value:33334,description:" "},p.RG8I={name:"RG8I",value:33335,description:" "},p.RG8UI={name:"RG8UI",value:33336,description:" "},p.RG16I={name:"RG16I",value:33337,description:" "},p.RG16UI={name:"RG16UI",value:33338,description:" "},p.RG32I={name:"RG32I",value:33339,description:" "},p.RG32UI={name:"RG32UI",value:33340,description:" "},p.R8_SNORM={name:"R8_SNORM",value:36756,description:" "},p.RG8_SNORM={name:"RG8_SNORM",value:36757,description:" "},p.RGB8_SNORM={name:"RGB8_SNORM",value:36758,description:" "},p.RGBA8_SNORM={name:"RGBA8_SNORM",value:36759,description:" "},p.RGB10_A2UI={name:"RGB10_A2UI",value:36975,description:" "},p.TEXTURE_IMMUTABLE_FORMAT={name:"TEXTURE_IMMUTABLE_FORMAT",value:37167,description:" "},p.TEXTURE_IMMUTABLE_LEVELS={name:"TEXTURE_IMMUTABLE_LEVELS",value:33503,description:" "},p.UNSIGNED_INT_2_10_10_10_REV={name:"UNSIGNED_INT_2_10_10_10_REV",value:33640,description:" "},p.UNSIGNED_INT_10F_11F_11F_REV={name:"UNSIGNED_INT_10F_11F_11F_REV",value:35899,description:" "},p.UNSIGNED_INT_5_9_9_9_REV={name:"UNSIGNED_INT_5_9_9_9_REV",value:35902,description:" "},p.FLOAT_32_UNSIGNED_INT_24_8_REV={name:"FLOAT_32_UNSIGNED_INT_24_8_REV",value:36269,description:" "},p.UNSIGNED_INT_24_8={name:"UNSIGNED_INT_24_8",value:34042,description:" "},p.HALF_FLOAT={name:"HALF_FLOAT",value:5131,description:" "},p.RG={name:"RG",value:33319,description:" "},p.RG_INTEGER={name:"RG_INTEGER",value:33320,description:" "},p.INT_2_10_10_10_REV={name:"INT_2_10_10_10_REV",value:36255,description:" "},p.CURRENT_QUERY={name:"CURRENT_QUERY",value:34917,description:" "},p.QUERY_RESULT={name:"QUERY_RESULT",value:34918,description:" "},p.QUERY_RESULT_AVAILABLE={name:"QUERY_RESULT_AVAILABLE",value:34919,description:" "},p.ANY_SAMPLES_PASSED={name:"ANY_SAMPLES_PASSED",value:35887,description:" "},p.ANY_SAMPLES_PASSED_CONSERVATIVE={name:"ANY_SAMPLES_PASSED_CONSERVATIVE",value:36202,description:" "},p.MAX_DRAW_BUFFERS={name:"MAX_DRAW_BUFFERS",value:34852,description:" "},p.DRAW_BUFFER0={name:"DRAW_BUFFER0",value:34853,description:" "},p.DRAW_BUFFER1={name:"DRAW_BUFFER1",value:34854,description:" "},p.DRAW_BUFFER2={name:"DRAW_BUFFER2",value:34855,description:" "},p.DRAW_BUFFER3={name:"DRAW_BUFFER3",value:34856,description:" "},p.DRAW_BUFFER4={name:"DRAW_BUFFER4",value:34857,description:" "},p.DRAW_BUFFER5={name:"DRAW_BUFFER5",value:34858,description:" "},p.DRAW_BUFFER6={name:"DRAW_BUFFER6",value:34859,description:" "},p.DRAW_BUFFER7={name:"DRAW_BUFFER7",value:34860,description:" "},p.DRAW_BUFFER8={name:"DRAW_BUFFER8",value:34861,description:" "},p.DRAW_BUFFER9={name:"DRAW_BUFFER9",value:34862,description:" "},p.DRAW_BUFFER10={name:"DRAW_BUFFER10",value:34863,description:" "},p.DRAW_BUFFER11={name:"DRAW_BUFFER11",value:34864,description:" "},p.DRAW_BUFFER12={name:"DRAW_BUFFER12",value:34865,description:" "},p.DRAW_BUFFER13={name:"DRAW_BUFFER13",value:34866,description:" "},p.DRAW_BUFFER14={name:"DRAW_BUFFER14",value:34867,description:" "},p.DRAW_BUFFER15={name:"DRAW_BUFFER15",value:34868,description:" "},p.MAX_COLOR_ATTACHMENTS={name:"MAX_COLOR_ATTACHMENTS",value:36063,description:" "},p.COLOR_ATTACHMENT1={name:"COLOR_ATTACHMENT1",value:36065,description:" "},p.COLOR_ATTACHMENT2={name:"COLOR_ATTACHMENT2",value:36066,description:" "},p.COLOR_ATTACHMENT3={name:"COLOR_ATTACHMENT3",value:36067,description:" "},p.COLOR_ATTACHMENT4={name:"COLOR_ATTACHMENT4",value:36068,description:" "},p.COLOR_ATTACHMENT5={name:"COLOR_ATTACHMENT5",value:36069,description:" "},p.COLOR_ATTACHMENT6={name:"COLOR_ATTACHMENT6",value:36070,description:" "},p.COLOR_ATTACHMENT7={name:"COLOR_ATTACHMENT7",value:36071,description:" "},p.COLOR_ATTACHMENT8={name:"COLOR_ATTACHMENT8",value:36072,description:" "},p.COLOR_ATTACHMENT9={name:"COLOR_ATTACHMENT9",value:36073,description:" "},p.COLOR_ATTACHMENT10={name:"COLOR_ATTACHMENT10",value:36074,description:" "},p.COLOR_ATTACHMENT11={name:"COLOR_ATTACHMENT11",value:36075,description:" "},p.COLOR_ATTACHMENT12={name:"COLOR_ATTACHMENT12",value:36076,description:" "},p.COLOR_ATTACHMENT13={name:"COLOR_ATTACHMENT13",value:36077,description:" "},p.COLOR_ATTACHMENT14={name:"COLOR_ATTACHMENT14",value:36078,description:" "},p.COLOR_ATTACHMENT15={name:"COLOR_ATTACHMENT15",value:36079,description:" "},p.SAMPLER_3D={name:"SAMPLER_3D",value:35679,description:" "},p.SAMPLER_2D_SHADOW={name:"SAMPLER_2D_SHADOW",value:35682,description:" "},p.SAMPLER_2D_ARRAY={name:"SAMPLER_2D_ARRAY",value:36289,description:" "},p.SAMPLER_2D_ARRAY_SHADOW={name:"SAMPLER_2D_ARRAY_SHADOW",value:36292,description:" "},p.SAMPLER_CUBE_SHADOW={name:"SAMPLER_CUBE_SHADOW",value:36293,description:" "},p.INT_SAMPLER_2D={name:"INT_SAMPLER_2D",value:36298,description:" "},p.INT_SAMPLER_3D={name:"INT_SAMPLER_3D",value:36299,description:" "},p.INT_SAMPLER_CUBE={name:"INT_SAMPLER_CUBE",value:36300,description:" "},p.INT_SAMPLER_2D_ARRAY={name:"INT_SAMPLER_2D_ARRAY",value:36303,description:" "},p.UNSIGNED_INT_SAMPLER_2D={name:"UNSIGNED_INT_SAMPLER_2D",value:36306,description:" "},p.UNSIGNED_INT_SAMPLER_3D={name:"UNSIGNED_INT_SAMPLER_3D",value:36307,description:" "},p.UNSIGNED_INT_SAMPLER_CUBE={name:"UNSIGNED_INT_SAMPLER_CUBE",value:36308,description:" "},p.UNSIGNED_INT_SAMPLER_2D_ARRAY={name:"UNSIGNED_INT_SAMPLER_2D_ARRAY",value:36311,description:" "},p.MAX_SAMPLES={name:"MAX_SAMPLES",value:36183,description:" "},p.SAMPLER_BINDING={name:"SAMPLER_BINDING",value:35097,description:" "},p.PIXEL_PACK_BUFFER={name:"PIXEL_PACK_BUFFER",value:35051,description:" "},p.PIXEL_UNPACK_BUFFER={name:"PIXEL_UNPACK_BUFFER",value:35052,description:" "},p.PIXEL_PACK_BUFFER_BINDING={name:"PIXEL_PACK_BUFFER_BINDING",value:35053,description:" "},p.PIXEL_UNPACK_BUFFER_BINDING={name:"PIXEL_UNPACK_BUFFER_BINDING",value:35055,description:" "},p.COPY_READ_BUFFER={name:"COPY_READ_BUFFER",value:36662,description:" "},p.COPY_WRITE_BUFFER={name:"COPY_WRITE_BUFFER",value:36663,description:" "},p.COPY_READ_BUFFER_BINDING={name:"COPY_READ_BUFFER_BINDING",value:36662,description:" "},p.COPY_WRITE_BUFFER_BINDING={name:"COPY_WRITE_BUFFER_BINDING",value:36663,description:" "},p.FLOAT_MAT2x3={name:"FLOAT_MAT2x3",value:35685,description:" "},p.FLOAT_MAT2x4={name:"FLOAT_MAT2x4",value:35686,description:" "},p.FLOAT_MAT3x2={name:"FLOAT_MAT3x2",value:35687,description:" "},p.FLOAT_MAT3x4={name:"FLOAT_MAT3x4",value:35688,description:" "},p.FLOAT_MAT4x2={name:"FLOAT_MAT4x2",value:35689,description:" "},p.FLOAT_MAT4x3={name:"FLOAT_MAT4x3",value:35690,description:" "},p.UNSIGNED_INT_VEC2={name:"UNSIGNED_INT_VEC2",value:36294,description:" "},p.UNSIGNED_INT_VEC3={name:"UNSIGNED_INT_VEC3",value:36295,description:" "},p.UNSIGNED_INT_VEC4={name:"UNSIGNED_INT_VEC4",value:36296,description:" "},p.UNSIGNED_NORMALIZED={name:"UNSIGNED_NORMALIZED",value:35863,description:" "},p.SIGNED_NORMALIZED={name:"SIGNED_NORMALIZED",value:36764,description:" "},p.VERTEX_ATTRIB_ARRAY_INTEGER={name:"VERTEX_ATTRIB_ARRAY_INTEGER",value:35069,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR={name:"VERTEX_ATTRIB_ARRAY_DIVISOR",value:35070,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_MODE={name:"TRANSFORM_FEEDBACK_BUFFER_MODE",value:35967,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",value:35968,description:" "},p.TRANSFORM_FEEDBACK_VARYINGS={name:"TRANSFORM_FEEDBACK_VARYINGS",value:35971,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_START={name:"TRANSFORM_FEEDBACK_BUFFER_START",value:35972,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_SIZE={name:"TRANSFORM_FEEDBACK_BUFFER_SIZE",value:35973,description:" "},p.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN={name:"TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",value:35976,description:" "},p.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",value:35978,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",value:35979,description:" "},p.INTERLEAVED_ATTRIBS={name:"INTERLEAVED_ATTRIBS",value:35980,description:" "},p.SEPARATE_ATTRIBS={name:"SEPARATE_ATTRIBS",value:35981,description:" "},p.TRANSFORM_FEEDBACK_BUFFER={name:"TRANSFORM_FEEDBACK_BUFFER",value:35982,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_BINDING={name:"TRANSFORM_FEEDBACK_BUFFER_BINDING",value:35983,description:" "},p.TRANSFORM_FEEDBACK={name:"TRANSFORM_FEEDBACK",value:36386,description:" "},p.TRANSFORM_FEEDBACK_PAUSED={name:"TRANSFORM_FEEDBACK_PAUSED",value:36387,description:" "},p.TRANSFORM_FEEDBACK_ACTIVE={name:"TRANSFORM_FEEDBACK_ACTIVE",value:36388,description:" "},p.TRANSFORM_FEEDBACK_BINDING={name:"TRANSFORM_FEEDBACK_BINDING",value:36389,description:" "},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",value:33296,description:" "},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",value:33297,description:" "},p.FRAMEBUFFER_ATTACHMENT_RED_SIZE={name:"FRAMEBUFFER_ATTACHMENT_RED_SIZE",value:33298,description:" "},p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE={name:"FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",value:33299,description:" "},p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE={name:"FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",value:33300,description:" "},p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE={name:"FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",value:33301,description:" "},p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE={name:"FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",value:33302,description:" "},p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE={name:"FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",value:33303,description:" "},p.FRAMEBUFFER_DEFAULT={name:"FRAMEBUFFER_DEFAULT",value:33304,description:" "},p.DEPTH24_STENCIL8={name:"DEPTH24_STENCIL8",value:35056,description:" "},p.DRAW_FRAMEBUFFER_BINDING={name:"DRAW_FRAMEBUFFER_BINDING",value:36006,description:" "},p.READ_FRAMEBUFFER={name:"READ_FRAMEBUFFER",value:36008,description:" "},p.DRAW_FRAMEBUFFER={name:"DRAW_FRAMEBUFFER",value:36009,description:" "},p.READ_FRAMEBUFFER_BINDING={name:"READ_FRAMEBUFFER_BINDING",value:36010,description:" "},p.RENDERBUFFER_SAMPLES={name:"RENDERBUFFER_SAMPLES",value:36011,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",value:36052,description:" "},p.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE={name:"FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",value:36182,description:" "},p.UNIFORM_BUFFER={name:"UNIFORM_BUFFER",value:35345,description:" "},p.UNIFORM_BUFFER_BINDING={name:"UNIFORM_BUFFER_BINDING",value:35368,description:" "},p.UNIFORM_BUFFER_START={name:"UNIFORM_BUFFER_START",value:35369,description:" "},p.UNIFORM_BUFFER_SIZE={name:"UNIFORM_BUFFER_SIZE",value:35370,description:" "},p.MAX_VERTEX_UNIFORM_BLOCKS={name:"MAX_VERTEX_UNIFORM_BLOCKS",value:35371,description:" "},p.MAX_FRAGMENT_UNIFORM_BLOCKS={name:"MAX_FRAGMENT_UNIFORM_BLOCKS",value:35373,description:" "},p.MAX_COMBINED_UNIFORM_BLOCKS={name:"MAX_COMBINED_UNIFORM_BLOCKS",value:35374,description:" "},p.MAX_UNIFORM_BUFFER_BINDINGS={name:"MAX_UNIFORM_BUFFER_BINDINGS",value:35375,description:" "},p.MAX_UNIFORM_BLOCK_SIZE={name:"MAX_UNIFORM_BLOCK_SIZE",value:35376,description:" "},p.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS={name:"MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",value:35377,description:" "},p.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",value:35379,description:" "},p.UNIFORM_BUFFER_OFFSET_ALIGNMENT={name:"UNIFORM_BUFFER_OFFSET_ALIGNMENT",value:35380,description:" "},p.ACTIVE_UNIFORM_BLOCKS={name:"ACTIVE_UNIFORM_BLOCKS",value:35382,description:" "},p.UNIFORM_TYPE={name:"UNIFORM_TYPE",value:35383,description:" "},p.UNIFORM_SIZE={name:"UNIFORM_SIZE",value:35384,description:" "},p.UNIFORM_BLOCK_INDEX={name:"UNIFORM_BLOCK_INDEX",value:35386,description:" "},p.UNIFORM_OFFSET={name:"UNIFORM_OFFSET",value:35387,description:" "},p.UNIFORM_ARRAY_STRIDE={name:"UNIFORM_ARRAY_STRIDE",value:35388,description:" "},p.UNIFORM_MATRIX_STRIDE={name:"UNIFORM_MATRIX_STRIDE",value:35389,description:" "},p.UNIFORM_IS_ROW_MAJOR={name:"UNIFORM_IS_ROW_MAJOR",value:35390,description:" "},p.UNIFORM_BLOCK_BINDING={name:"UNIFORM_BLOCK_BINDING",value:35391,description:" "},p.UNIFORM_BLOCK_DATA_SIZE={name:"UNIFORM_BLOCK_DATA_SIZE",value:35392,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORMS={name:"UNIFORM_BLOCK_ACTIVE_UNIFORMS",value:35394,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES={name:"UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",value:35395,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",value:35396,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",value:35398,description:" "},p.OBJECT_TYPE={name:"OBJECT_TYPE",value:37138,description:" "},p.SYNC_CONDITION={name:"SYNC_CONDITION",value:37139,description:" "},p.SYNC_STATUS={name:"SYNC_STATUS",value:37140,description:" "},p.SYNC_FLAGS={name:"SYNC_FLAGS",value:37141,description:" "},p.SYNC_FENCE={name:"SYNC_FENCE",value:37142,description:" "},p.SYNC_GPU_COMMANDS_COMPLETE={name:"SYNC_GPU_COMMANDS_COMPLETE",value:37143,description:" "},p.UNSIGNALED={name:"UNSIGNALED",value:37144,description:" "},p.SIGNALED={name:"SIGNALED",value:37145,description:" "},p.ALREADY_SIGNALED={name:"ALREADY_SIGNALED",value:37146,description:" "},p.TIMEOUT_EXPIRED={name:"TIMEOUT_EXPIRED",value:37147,description:" "},p.CONDITION_SATISFIED={name:"CONDITION_SATISFIED",value:37148,description:" "},p.WAIT_FAILED={name:"WAIT_FAILED",value:37149,description:" "},p.SYNC_FLUSH_COMMANDS_BIT={name:"SYNC_FLUSH_COMMANDS_BIT",value:1,description:" "},p.COLOR={name:"COLOR",value:6144,description:" "},p.DEPTH={name:"DEPTH",value:6145,description:" "},p.STENCIL={name:"STENCIL",value:6146,description:" "},p.MIN={name:"MIN",value:32775,description:" "},p.MAX={name:"MAX",value:32776,description:" "},p.DEPTH_COMPONENT24={name:"DEPTH_COMPONENT24",value:33190,description:" "},p.STREAM_READ={name:"STREAM_READ",value:35041,description:" "},p.STREAM_COPY={name:"STREAM_COPY",value:35042,description:" "},p.STATIC_READ={name:"STATIC_READ",value:35045,description:" "},p.STATIC_COPY={name:"STATIC_COPY",value:35046,description:" "},p.DYNAMIC_READ={name:"DYNAMIC_READ",value:35049,description:" "},p.DYNAMIC_COPY={name:"DYNAMIC_COPY",value:35050,description:" "},p.DEPTH_COMPONENT32F={name:"DEPTH_COMPONENT32F",value:36012,description:" "},p.DEPTH32F_STENCIL8={name:"DEPTH32F_STENCIL8",value:36013,description:" "},p.INVALID_INDEX={name:"INVALID_INDEX",value:4294967295,description:" "},p.TIMEOUT_IGNORED={name:"TIMEOUT_IGNORED",value:-1,description:" "},p.MAX_CLIENT_WAIT_TIMEOUT_WEBGL={name:"MAX_CLIENT_WAIT_TIMEOUT_WEBGL",value:37447,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE={name:"VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",value:35070,description:"Describes the frequency divisor used for instanced rendering.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_VENDOR_WEBGL={name:"UNMASKED_VENDOR_WEBGL",value:37445,description:"Passed to getParameter to get the vendor string of the graphics driver.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_RENDERER_WEBGL={name:"UNMASKED_RENDERER_WEBGL",value:37446,description:"Passed to getParameter to get the renderer string of the graphics driver.",extensionName:"WEBGL_debug_renderer_info"},p.MAX_TEXTURE_MAX_ANISOTROPY_EXT={name:"MAX_TEXTURE_MAX_ANISOTROPY_EXT",value:34047,description:"Returns the maximum available anisotropy.",extensionName:"EXT_texture_filter_anisotropic"},p.TEXTURE_MAX_ANISOTROPY_EXT={name:"TEXTURE_MAX_ANISOTROPY_EXT",value:34046,description:"Passed to texParameter to set the desired maximum anisotropy for a texture.",extensionName:"EXT_texture_filter_anisotropic"},p.COMPRESSED_RGB_S3TC_DXT1_EXT={name:"COMPRESSED_RGB_S3TC_DXT1_EXT",value:33776,description:"A DXT1-compressed image in an RGB image format.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT1_EXT={name:"COMPRESSED_RGBA_S3TC_DXT1_EXT",value:33777,description:"A DXT1-compressed image in an RGB image format with a simple on/off alpha value.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT3_EXT={name:"COMPRESSED_RGBA_S3TC_DXT3_EXT",value:33778,description:"A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT5_EXT={name:"COMPRESSED_RGBA_S3TC_DXT5_EXT",value:33779,description:"A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_R11_EAC={name:"COMPRESSED_R11_EAC",value:37488,description:"One-channel (red) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_R11_EAC={name:"COMPRESSED_SIGNED_R11_EAC",value:37489,description:"One-channel (red) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RG11_EAC={name:"COMPRESSED_RG11_EAC",value:37490,description:"Two-channel (red and green) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_RG11_EAC={name:"COMPRESSED_SIGNED_RG11_EAC",value:37491,description:"Two-channel (red and green) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_ETC2={name:"COMPRESSED_RGB8_ETC2",value:37492,description:"Compresses RBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGBA8_ETC2_EAC={name:"COMPRESSED_RGBA8_ETC2_EAC",value:37493,description:"Compresses RGBA8 data. The RGB part is encoded the same as RGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ETC2={name:"COMPRESSED_SRGB8_ETC2",value:37494,description:"Compresses sRBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC={name:"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",value:37495,description:"Compresses sRGBA8 data. The sRGB part is encoded the same as SRGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37496,description:"Similar to RGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37497,description:"Similar to SRGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_4BPPV1_IMG",value:35840,description:"RGB compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",value:35842,description:"RGBA compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_2BPPV1_IMG",value:35841,description:"RGB compression in 2-bit mode. One block for each 8×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",value:35843,description:"RGBA compression in 2-bit mode. One block for each 8×4 pixe",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_ETC1_WEBGL={name:"COMPRESSED_RGB_ETC1_WEBGL",value:36196,description:"Compresses 24-bit RGB data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc1"},p.COMPRESSED_RGB_ATC_WEBGL={name:"COMPRESSED_RGB_ATC_WEBGL",value:35986,description:"Compresses RGB textures with no alpha channel.",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",value:35986,description:"Compresses RGBA textures using explicit alpha encoding (useful when alpha transitions are sharp).",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",value:34798,description:"Compresses RGBA textures using interpolated alpha encoding (useful when alpha transitions are gradient).",extensionName:"WEBGL_compressed_texture_atc"},p.UNSIGNED_INT_24_8_WEBGL={name:"UNSIGNED_INT_24_8_WEBGL",value:34042,description:"Unsigned integer type for 24-bit depth texture data.",extensionName:"WEBGL_depth_texture"},p.HALF_FLOAT_OES={name:"HALF_FLOAT_OES",value:36193,description:"Half floating-point type (16-bit).",extensionName:"OES_texture_half_float"},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",value:33297,description:" ",extensionName:"WEBGL_color_buffer_float"},p.UNSIGNED_NORMALIZED_EXT={name:"UNSIGNED_NORMALIZED_EXT",value:35863,description:" ",extensionName:"WEBGL_color_buffer_float"},p.MIN_EXT={name:"MIN_EXT",value:32775,description:"Produces the minimum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.MAX_EXT={name:"MAX_EXT",value:32776,description:"Produces the maximum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.SRGB_EXT={name:"SRGB_EXT",value:35904,description:"Unsized sRGB format that leaves the precision up to the driver.",extensionName:"EXT_sRGB"},p.SRGB_ALPHA_EXT={name:"SRGB_ALPHA_EXT",value:35906,description:"Unsized sRGB format with unsized alpha component.",extensionName:"EXT_sRGB"},p.SRGB8_ALPHA8_EXT={name:"SRGB8_ALPHA8_EXT",value:35907,description:"Sized (8-bit) sRGB and alpha formats.",extensionName:"EXT_sRGB"},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",value:33296,description:"Returns the framebuffer color encoding.",extensionName:"EXT_sRGB"},p.FRAGMENT_SHADER_DERIVATIVE_HINT_OES={name:"FRAGMENT_SHADER_DERIVATIVE_HINT_OES",value:35723,description:"Indicates the accuracy of the derivative calculation for the GLSL built-in functions: dFdx, dFdy, and fwidth.",extensionName:"OES_standard_derivatives"},p.COLOR_ATTACHMENT0_WEBGL={name:"COLOR_ATTACHMENT0_WEBGL",value:36064,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT1_WEBGL={name:"COLOR_ATTACHMENT1_WEBGL",value:36065,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT2_WEBGL={name:"COLOR_ATTACHMENT2_WEBGL",value:36066,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT3_WEBGL={name:"COLOR_ATTACHMENT3_WEBGL",value:36067,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT4_WEBGL={name:"COLOR_ATTACHMENT4_WEBGL",value:36068,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT5_WEBGL={name:"COLOR_ATTACHMENT5_WEBGL",value:36069,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT6_WEBGL={name:"COLOR_ATTACHMENT6_WEBGL",value:36070,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT7_WEBGL={name:"COLOR_ATTACHMENT7_WEBGL",value:36071,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT8_WEBGL={name:"COLOR_ATTACHMENT8_WEBGL",value:36072,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT9_WEBGL={name:"COLOR_ATTACHMENT9_WEBGL",value:36073,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT10_WEBGL={name:"COLOR_ATTACHMENT10_WEBGL",value:36074,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT11_WEBGL={name:"COLOR_ATTACHMENT11_WEBGL",value:36075,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT12_WEBGL={name:"COLOR_ATTACHMENT12_WEBGL",value:36076,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT13_WEBGL={name:"COLOR_ATTACHMENT13_WEBGL",value:36077,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT14_WEBGL={name:"COLOR_ATTACHMENT14_WEBGL",value:36078,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT15_WEBGL={name:"COLOR_ATTACHMENT15_WEBGL",value:36079,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER0_WEBGL={name:"DRAW_BUFFER0_WEBGL",value:34853,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER1_WEBGL={name:"DRAW_BUFFER1_WEBGL",value:34854,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER2_WEBGL={name:"DRAW_BUFFER2_WEBGL",value:34855,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER3_WEBGL={name:"DRAW_BUFFER3_WEBGL",value:34856,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER4_WEBGL={name:"DRAW_BUFFER4_WEBGL",value:34857,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER5_WEBGL={name:"DRAW_BUFFER5_WEBGL",value:34858,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER6_WEBGL={name:"DRAW_BUFFER6_WEBGL",value:34859,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER7_WEBGL={name:"DRAW_BUFFER7_WEBGL",value:34860,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER8_WEBGL={name:"DRAW_BUFFER8_WEBGL",value:34861,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER9_WEBGL={name:"DRAW_BUFFER9_WEBGL",value:34862,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER10_WEBGL={name:"DRAW_BUFFER10_WEBGL",value:34863,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER11_WEBGL={name:"DRAW_BUFFER11_WEBGL",value:34864,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER12_WEBGL={name:"DRAW_BUFFER12_WEBGL",value:34865,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER13_WEBGL={name:"DRAW_BUFFER13_WEBGL",value:34866,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER14_WEBGL={name:"DRAW_BUFFER14_WEBGL",value:34867,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER15_WEBGL={name:"DRAW_BUFFER15_WEBGL",value:34868,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.MAX_COLOR_ATTACHMENTS_WEBGL={name:"MAX_COLOR_ATTACHMENTS_WEBGL",value:36063,description:"Maximum number of framebuffer color attachment points",extensionName:"WEBGL_draw_buffers"},p.MAX_DRAW_BUFFERS_WEBGL={name:"MAX_DRAW_BUFFERS_WEBGL",value:34852,description:"Maximum number of draw buffers",extensionName:"WEBGL_draw_buffers"},p.VERTEX_ARRAY_BINDING_OES={name:"VERTEX_ARRAY_BINDING_OES",value:34229,description:"The bound vertex array object (VAO).",extensionName:"VERTEX_ARRAY_BINDING_OES"},p.QUERY_COUNTER_BITS_EXT={name:"QUERY_COUNTER_BITS_EXT",value:34916,description:"The number of bits used to hold the query result for the given target.",extensionName:"EXT_disjoint_timer_query"},p.CURRENT_QUERY_EXT={name:"CURRENT_QUERY_EXT",value:34917,description:"The currently active query.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_EXT={name:"QUERY_RESULT_EXT",value:34918,description:"The query result.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_AVAILABLE_EXT={name:"QUERY_RESULT_AVAILABLE_EXT",value:34919,description:"A Boolean indicating whether or not a query result is available.",extensionName:"EXT_disjoint_timer_query"},p.TIME_ELAPSED_EXT={name:"TIME_ELAPSED_EXT",value:35007,description:"Elapsed time (in nanoseconds).",extensionName:"EXT_disjoint_timer_query"},p.TIMESTAMP_EXT={name:"TIMESTAMP_EXT",value:36392,description:"The current time.",extensionName:"EXT_disjoint_timer_query"},p.GPU_DISJOINT_EXT={name:"GPU_DISJOINT_EXT",value:36795,description:"A Boolean indicating whether or not the GPU performed any disjoint operation.",extensionName:"EXT_disjoint_timer_query"},p.zeroMeaningByCommand={getError:"NO_ERROR",blendFunc:"ZERO",blendFuncSeparate:"ZERO",readBuffer:"NONE",getFramebufferAttachmentParameter:"NONE",texParameterf:"NONE",texParameteri:"NONE",drawArrays:"POINTS",drawElements:"POINTS",drawArraysInstanced:"POINTS",drawArraysInstancedAngle:"POINTS",drawBuffers:"POINTS",drawElementsInstanced:"POINTS",drawRangeElements:"POINTS"},p.oneMeaningByCommand={blendFunc:"ONE",blendFuncSeparate:"ONE",drawArrays:"LINES",drawElements:"LINES",drawArraysInstanced:"LINES",drawArraysInstancedAngle:"LINES",drawBuffers:"LINES",drawElementsInstanced:"LINES",drawRangeElements:"LINES"};const m={},g={};!function(){for(const e in p)if(p.hasOwnProperty(e)){const t=p[e];m[t.name]=t,g[t.value]=t}}();class E extends c{get analyserName(){return E.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={total:0,totalTriangles:0,totalTriangleStrip:0,totalTriangleFan:0,totalLines:0,totalLineStrip:0,totalLineLoop:0,totalPoints:0};for(const t of e.commands)"drawArrays"===t.name&&t.commandArguments.length>=3||"drawArraysInstanced"===t.name&&t.commandArguments.length>=3||"drawArraysInstancedANGLE"===t.name&&t.commandArguments.length>=3?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[2]):"drawElements"===t.name&&t.commandArguments.length>=2||"drawElementsInstanced"===t.name&&t.commandArguments.length>=2||"drawElementsInstancedANGLE"===t.name&&t.commandArguments.length>=2?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[1]):"drawRangeElements"===t.name&&t.commandArguments.length>=4&&this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[3]);t.total=n.total,t.triangles=n.totalTriangles,t.triangleStrip=n.totalTriangleStrip,t.triangleFan=n.totalTriangleFan,t.lines=n.totalLines,t.lineStrip=n.totalLineStrip,t.lineLoop=n.totalLineLoop,t.points=n.totalPoints}appendToPrimitives(e,t,n){t===p.POINTS.value?e.totalPoints+=n:t===p.LINES.value?e.totalLines+=n:t===p.LINE_STRIP.value?e.totalLineStrip+=n:t===p.LINE_LOOP.value?e.totalLineLoop+=n:t===p.TRIANGLES.value?e.totalTriangles+=n:t===p.TRIANGLE_STRIP.value?e.totalTriangleStrip+=n:t===p.TRIANGLE_FAN.value&&(e.totalTriangleFan+=n),e.total+=n}}E.analyserName="Primitives";class v{constructor(e){this.contextInformation=e,this.analysers=[],this.initAnalysers()}appendAnalyses(e){for(const t in this.analysers)this.analysers.hasOwnProperty(t)&&this.analysers[t].appendAnalysis(e)}initAnalysers(){this.analysers.push(new h(this.contextInformation),new f(this.contextInformation),new E(this.contextInformation))}}class C{static getStackTrace(e=0,t=0){const n=[];try{throw new Error("Errorator.")}catch(e){if(e.stack){const t=e.stack.split("\n");for(let e=0,r=t.length;e0;t++)n.shift();for(let e=0;e0;e++)n.pop()}return n}}class D{static getWebGlObjectTag(e){return e[D.SPECTOROBJECTTAGKEY]}static attachWebGlObjectTag(e,t){t.displayText=D.stringifyWebGlObjectTag(t),e[D.SPECTOROBJECTTAGKEY]=t}static stringifyWebGlObjectTag(e){return e?`${e.typeName} - ID: ${e.id}`:"No tag available."}}D.SPECTOROBJECTTAGKEY="__SPECTOR_Object_TAG";class S{get type(){return("undefined"!=typeof globalThis?globalThis:self)[this.typeName]||null}constructor(){this.id=0}tagWebGlObject(e){if(!this.type)return;let t;if(!e)return t;if(t=D.getWebGlObjectTag(e),t)return t;if(e instanceof this.type){const n=this.getNextId();return t={typeName:this.typeName,id:n},D.attachWebGlObjectTag(e,t),t}return t}getNextId(){return this.id++}}class A{constructor(e){this.options=e}createCapture(e,t,n){const r=C.getStackTrace(4,1),i=0===e.name.indexOf("uniform")?this.stringifyUniform(e.arguments):this.stringify(e.arguments,e.result),s={id:t,startTime:e.startTime,commandEndTime:e.endTime,endTime:0,name:e.name,commandArguments:e.arguments,result:e.result,stackTrace:r,status:0,marker:n,text:i};this.transformCapture(s);for(let e=0;e50&&(s.commandArguments[e]="Array Length: "+t.length)}if(s.commandArguments){const e=[];for(let t=0;t0&&(n+=": "+this.stringifyArgs(e).join(", ")),null!=t&&(n+=" -> "+this.stringifyResult(t)),n}stringifyUniform(e){let t=this.spiedCommandName;if(e&&e.length>0){const n=[];n.push(this.stringifyValue(e[0]));for(let t=1;t0&&"number"==typeof s)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");else{const e=this.stringifyValue(s);r.push(e)}}return r}}_.commandName="bufferSubData";class y{static storeOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]||(e[n]=e[t])}static resetOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]&&(e[t]=e[n],delete e[n])}static storePrototypeOriginFunction(e,t){if(!e)return;if(!e.prototype[t])return;const n=this.getOriginFunctionName(t);e.prototype[n]||(e.prototype[n]=e.prototype[t])}static executePrototypeOriginFunction(e,t,n,r){if(!e)return;const i=this.getOriginFunctionName(n);return t.prototype[i]?(e[i]||(e[i]=t.prototype[i]),this.executeFunction(e,i,r)):void 0}static executeOriginFunction(e,t,n){if(!e)return;const r=this.getOriginFunctionName(t);return e[r]?this.executeFunction(e,r,n):void 0}static executeFunction(e,t,n){const r=n;if(void 0===r||0===r.length)return e[t]();switch(r.length){case 1:return e[t](r[0]);case 2:return e[t](r[0],r[1]);case 3:return e[t](r[0],r[1],r[2]);case 4:return e[t](r[0],r[1],r[2],r[3]);case 5:return e[t](r[0],r[1],r[2],r[3],r[4]);case 6:return e[t](r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6]);case 8:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]);case 9:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8]);case 10:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9]);case 11:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10]);case 12:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11]);case 13:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12]);case 14:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13]);case 15:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14]);case 16:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);case 17:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16]);case 18:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17]);case 19:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18]);case 20:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19]);default:return e[t].apply(e,r)}}static getOriginFunctionName(e){return this.originFunctionPrefix+e}}y.originFunctionPrefix="__SPECTOR_Origin_";class b extends A{get spiedCommandName(){return b.commandName}stringifyArgs(e){const t=[];if(e.length>0){const n=e[0],r=this.stringifyValue(n);t.push(r)}if(e.length>1){const n=""+e[1];t.push(n)}return e.length>2&&t.push(e[2]),t}}b.commandName="bindAttribLocation";class T extends A{get spiedCommandName(){return T.commandName}stringifyArgs(e){const t=[],n=this.options.context.getParameter(p.READ_FRAMEBUFFER_BINDING.value),r=this.options.tagWebGlObject(n);t.push("READ FROM: "+this.stringifyValue(r));const i=this.options.context.getParameter(p.DRAW_FRAMEBUFFER_BINDING.value),s=this.options.tagWebGlObject(i);t.push("WRITE TO: "+this.stringifyValue(s));for(let n=0;n<8;n++)t.push(e[n]);return(e[8]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[8]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[8]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t.push(p.stringifyWebGlConstant(e[9],"blitFrameBuffer")),t}}T.commandName="blitFrameBuffer";class R extends A{get spiedCommandName(){return R.commandName}stringifyArgs(e){const t=[];return(e[0]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[0]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[0]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t}}R.commandName="clear";class x{static getProgramData(e,t){const n={LINK_STATUS:e.getProgramParameter(t,p.LINK_STATUS.value),VALIDATE_STATUS:e.getProgramParameter(t,p.VALIDATE_STATUS.value),infoLog:e.getProgramInfoLog(t)||""},r=e.getAttachedShaders(t)||[],i=new Array(2);let s=0;for(const t of r){const n=this.getShaderData(e,t);s+=n.source.length,n.shaderType===p.FRAGMENT_SHADER.name?i[1]=n:i[0]=n}return{programStatus:n,shaders:i,length:s}}static getShaderData(e,t){const n=e.getShaderSource(t)||"",r=e.getExtension("WEBGL_debug_shaders"),i=r?r.getTranslatedShaderSource(t):null,s=e.getShaderParameter(t,p.SHADER_TYPE.value)===p.FRAGMENT_SHADER.value;let o=t&&t.__SPECTOR_Metadata&&t.__SPECTOR_Metadata.name?t.__SPECTOR_Metadata.name:this.readNameFromShaderSource(n);return o||(o=s?"Fragment":"Vertex"),{COMPILE_STATUS:e.getShaderParameter(t,p.COMPILE_STATUS.value),shaderType:s?p.FRAGMENT_SHADER.name:p.VERTEX_SHADER.name,name:o,source:n,translatedSource:i,infoLog:e.getShaderInfoLog(t)||""}}static readNameFromShaderSource(e){try{let t,n="";const r=/#define[\s]+SHADER_NAME[\s]+([\S]+)(\n|$)/gi;if(t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),""===n){const r=/#define[\s]+SHADER_NAME_B64[\s]+([\S]+)(\n|$)/gi;t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),n&&(n=decodeURIComponent(atob(n)))}return n}catch(e){return null}}}class w extends A{constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.shader=x.getShaderData(this.options.context,t)}finally{n&&n(!0)}}getShaderDisplayText(e){return this.stringifyValue(e.commandArguments[0])}}class F extends w{get spiedCommandName(){return F.commandName}transformCapture(e){if(super.transformCapture(e),e.shader){const t=e.shader.COMPILE_STATUS?"compiled":"failed";e.text=`${this.spiedCommandName}: ${this.getShaderDisplayText(e)} -> ${t}`}}}F.commandName="compileShader";const N=["lineWidth"];class L extends A{get spiedCommandName(){return this.internalSpiedCommandName}constructor(e,t){super(e),this.internalSpiedCommandName=t,this.isDeprecated=N.indexOf(this.spiedCommandName)>-1}transformCapture(e){this.isDeprecated&&(e.status=50)}}class O extends A{get spiedCommandName(){return O.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}O.commandName="disableVertexAttribArray";class I extends A{get spiedCommandName(){return I.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(e[1]+" indices"),t.push(e[2]),t}}I.commandName="drawArrays";class k extends A{get spiedCommandName(){return k.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}k.commandName="drawArraysInstanced";class M extends A{get spiedCommandName(){return M.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstancedANGLE")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}M.commandName="drawArraysInstancedANGLE";class P extends A{get spiedCommandName(){return P.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElements")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElements")),t.push(e[3]),t}}P.commandName="drawElements";class B extends A{get spiedCommandName(){return B.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstancedANGLE")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstancedANGLE")),t.push(e[3]),t.push(e[4]),t}}B.commandName="drawElementsInstancedANGLE";class U extends A{get spiedCommandName(){return U.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t}}U.commandName="drawElementsInstanced";class $ extends A{get spiedCommandName(){return $.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawRangeElements")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(p.stringifyWebGlConstant(e[4],"drawRangeElements")),t.push(e[5]),t}}$.commandName="drawRangeElements";class G extends A{get spiedCommandName(){return G.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}G.commandName="getActiveAttrib";class V extends A{get spiedCommandName(){return V.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}V.commandName="getActiveUniform";class W extends A{get spiedCommandName(){return W.commandName}stringifyResult(e){var t;if(null!=e)return null!==(t=null==e?void 0:e.toFixed(0))&&void 0!==t?t:"0"}}W.commandName="getAttribLocation";class H extends A{get spiedCommandName(){return H.commandName}stringifyResult(e){return e?"true":"false"}}H.commandName="getExtension";class j extends A{get spiedCommandName(){return j.commandName}stringifyResult(e){if(!e)return"null";const t=D.getWebGlObjectTag(e);return t?t.displayText:e}}j.commandName="getParameter";class z extends A{get spiedCommandName(){return z.commandName}stringifyResult(e){if(e)return`min: ${e.rangeMin}, max: ${e.rangeMax}, precision: ${e.precision}`}}z.commandName="getShaderPrecisionFormat";class X extends w{get spiedCommandName(){return X.commandName}stringifyResult(e){if("string"!=typeof e||0===e.trim().length)return"No messages";const t=e.split(/\r?\n/).filter(e=>e.trim().length>0).length;return t+(1===t?" message":" messages")}}X.commandName="getShaderInfoLog";class K extends A{get spiedCommandName(){return K.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}K.commandName="getTransformFeedbackVarying";class Y extends A{get spiedCommandName(){return Y.commandName}constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.program=x.getProgramData(this.options.context,t)}finally{n&&n(!0)}const r=e.program.programStatus.LINK_STATUS?"linked":"failed";e.text=`${this.spiedCommandName}: ${this.stringifyValue(t)} -> ${r}`}}Y.commandName="linkProgram";class q extends A{get spiedCommandName(){return q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"multiDrawArraysInstancedBaseInstanceWEBGL")),t.push(`drawCount=${e[9]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t}}q.commandName="multiDrawArraysInstancedBaseInstanceWEBGL";class Q extends A{get spiedCommandName(){return Q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[7]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t}}Q.commandName="multiDrawArraysInstancedWEBGL";class Z extends A{get spiedCommandName(){return Z.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[5]}`),t.push(e[2]),t.push(e[4]),t}}Z.commandName="multiDrawArraysWEBGL";class J extends A{get spiedCommandName(){return J.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[11]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t.push(e[10]),t}}J.commandName="multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL";class ee extends A{get spiedCommandName(){return ee.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[8]}`),t.push(e[2]),t.push(e[5]),t.push(e[7]),t}}ee.commandName="multiDrawElementsInstancedWEBGL";class te extends A{get spiedCommandName(){return te.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[6]}`),t.push(e[2]),t.push(e[5]),t}}te.commandName="multiDrawElementsWEBGL";class ne extends A{get spiedCommandName(){return ne.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(`baseInstance = ${e[4]}`),t}}ne.commandName="drawArraysInstancedBaseInstanceWEBGL";class re extends A{get spiedCommandName(){return re.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t.push(`baseVertex = ${e[5]}`),t.push(`baseInstance = ${e[6]}`),t}}re.commandName="drawElementsInstancedBaseVertexBaseInstanceWEBGL";class ie extends A{get spiedCommandName(){return ie.commandName}stringifyArgs(e){var t,n;const r=[];for(let i=0;i<4;i++)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");return r}}function se(e){return null==e?"":`${e.toFixed(0)} (0b${(e>>>0).toString(2)})`}ie.commandName="scissor";class oe extends A{get spiedCommandName(){return oe.commandName}stringifyArgs(e){const t=[];return t.push(se(e[0])),t}}oe.commandName="stencilMask";class ae extends A{get spiedCommandName(){return ae.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilMaskSeparate")),t.push(se(e[1])),t}}ae.commandName="stencilMaskSeparate";class le extends A{get spiedCommandName(){return le.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFunc")),t.push(se(e[1])),t.push(se(e[2])),t}}le.commandName="stencilFunc";class ue extends A{get spiedCommandName(){return ue.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFuncSeparate")),t.push(p.stringifyWebGlConstant(e[1],"stencilFuncSeparate")),t.push(se(e[2])),t.push(se(e[3])),t}}ue.commandName="stencilFuncSeparate";class ce extends A{get spiedCommandName(){return ce.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t.push(e[1]),t.push(p.stringifyWebGlConstant(e[2],"vertexAttribPointer")),t.push(e[3]),t.push(e[4]),t.push(e[5]),t}}ce.commandName="vertexAttribPointer";class he extends A{get spiedCommandName(){return he.commandName}stringifyArgs(e){const t=[];for(let n=0;n<4;n++)t.push(e[n].toFixed(0));return t}}he.commandName="viewport";class de extends A{get spiedCommandName(){return de.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}de.commandName="enableVertexAttribArray";class fe extends w{get spiedCommandName(){return fe.commandName}stringifyArgs(e){const t="string"==typeof e[1]?e[1]:"";return[this.stringifyValue(e[0]),t.length+" chars"]}transformCapture(e){super.transformCapture(e);const t=e.commandArguments[1];e.shader&&"string"==typeof t&&(e.shader.source=t,e.shader.COMPILE_STATUS=null,e.shader.translatedSource="",e.shader.infoLog="")}}fe.commandName="shaderSource";class pe{constructor(e){this.spiedCommandName=e.spiedCommandName,this.spiedCommandRunningContext=e.spiedCommandRunningContext,this.spiedCommand=this.spiedCommandRunningContext[this.spiedCommandName],y.storeOriginFunction(this.spiedCommandRunningContext,this.spiedCommandName),this.callback=e.callback,this.commandOptions={context:e.context,contextVersion:e.contextVersion,extensions:e.extensions,toggleCapture:e.toggleCapture},this.initCustomCommands(),this.initCommand()}spy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.overloadedCommand}unSpy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.spiedCommand}createCapture(e,t,n){return this.command.createCapture(e,t,n)}initCommand(){pe.customCommandsConstructors[this.spiedCommandName]?this.command=pe.customCommandsConstructors[this.spiedCommandName](this.commandOptions):this.command=new L(this.commandOptions,this.spiedCommandName),this.overloadedCommand=this.getSpy()}getSpy(){const e=this;return function(){const t=u.now,n=y.executeOriginFunction(e.spiedCommandRunningContext,e.spiedCommandName,arguments),r=u.now;try{const i={name:e.spiedCommandName,arguments,result:n,startTime:t,endTime:r};e.callback(e,i)}catch(e){}return n}}initCustomCommands(){pe.customCommandsConstructors||(pe.customCommandsConstructors={[b.commandName]:e=>new b(e),[T.commandName]:e=>new T(e),[_.commandName]:e=>new _(e),[R.commandName]:e=>new R(e),[F.commandName]:e=>new F(e),[O.commandName]:e=>new O(e),[I.commandName]:e=>new I(e),[k.commandName]:e=>new k(e),[M.commandName]:e=>new M(e),[P.commandName]:e=>new P(e),[U.commandName]:e=>new U(e),[B.commandName]:e=>new B(e),[$.commandName]:e=>new $(e),[G.commandName]:e=>new G(e),[V.commandName]:e=>new V(e),[W.commandName]:e=>new W(e),[H.commandName]:e=>new H(e),[j.commandName]:e=>new j(e),[X.commandName]:e=>new X(e),[z.commandName]:e=>new z(e),[K.commandName]:e=>new K(e),[Y.commandName]:e=>new Y(e),[q.commandName]:e=>new q(e),[Q.commandName]:e=>new Q(e),[Z.commandName]:e=>new Z(e),[J.commandName]:e=>new J(e),[ee.commandName]:e=>new ee(e),[te.commandName]:e=>new te(e),[ne.commandName]:e=>new ne(e),[re.commandName]:e=>new re(e),[ie.commandName]:e=>new ie(e),[fe.commandName]:e=>new fe(e),[oe.commandName]:e=>new oe(e),[ae.commandName]:e=>new ae(e),[le.commandName]:e=>new le(e),[ue.commandName]:e=>new ue(e),[ce.commandName]:e=>new ce(e),[he.commandName]:e=>new he(e),[de.commandName]:e=>new de(e)})}}class me{constructor(e){this.options=e,this.context=e.context,this.contextVersion=e.contextVersion,this.extensions=e.extensions,this.toggleCapture=e.toggleCapture,this.consumeCommands=this.getConsumeCommands(),this.changeCommandsByState=this.getChangeCommandsByState(),this.commandNameToStates=this.getCommandNameToStates()}get requireStartAndStopStates(){return!0}startCapture(e,t,n){return this.quickCapture=t,this.fullCapture=n,this.capturedCommandsByState={},e&&this.requireStartAndStopStates&&(this.currentState={},this.readFromContextNoSideEffects()),this.copyCurrentStateToPrevious(),this.currentState={},this.previousState}stopCapture(){return this.requireStartAndStopStates&&this.readFromContextNoSideEffects(),this.analyse(void 0),this.currentState}registerCallbacks(e){for(const t in this.changeCommandsByState)if(this.changeCommandsByState.hasOwnProperty(t))for(const n of this.changeCommandsByState[t])e[n]=e[n]||[],e[n].push(this.onChangeCommand.bind(this));for(const t of this.consumeCommands)e[t]=e[t]||[],e[t].push(this.onConsumeCommand.bind(this))}getStateData(){return this.currentState}getConsumeCommands(){return[]}getChangeCommandsByState(){return{}}copyCurrentStateToPrevious(){this.currentState&&(this.previousState=this.currentState)}onChangeCommand(e){const t=this.commandNameToStates[e.name];for(const n of t){if(!this.isValidChangeCommand(e,n))return;this.capturedCommandsByState[n]=this.capturedCommandsByState[n]||[],this.capturedCommandsByState[n].push(e)}}isValidChangeCommand(e,t){return!0}onConsumeCommand(e){this.isValidConsumeCommand(e)&&(this.readFromContextNoSideEffects(),this.analyse(e),this.storeCommandIds(),e[this.stateName]=this.currentState,this.startCapture(!1,this.quickCapture,this.fullCapture))}isValidConsumeCommand(e){return this.lastCommandName=null==e?void 0:e.name,!0}analyse(e){for(const t in this.capturedCommandsByState)if(this.capturedCommandsByState.hasOwnProperty(t)){const n=this.capturedCommandsByState[t],r=n.length-1;if(r>=0)if(e){for(let t=0;t1&&this.parameters.push(this.getWebgl2Parameters());const e={};for(let t=1;t<=this.contextVersion&&!(t>this.parameters.length);t++)if(this.parameters[t-1])for(const n of this.parameters[t-1])if(n.changeCommands)for(const t of n.changeCommands)e[n.constant.name]=e[n.constant.name]||[],e[n.constant.name].push(t);return e}readFromContext(){for(let e=1;e<=this.contextVersion&&!(e>this.parameters.length);e++)for(const t of this.parameters[e-1]){const e=this.readParameterFromContext(t);if(null==e){const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n;continue}const n=D.getWebGlObjectTag(e);if(n)this.currentState[t.constant.name]=n;else{const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n}}}readParameterFromContext(e){return e.constant.extensionName&&!this.extensions[e.constant.extensionName]?`Extension ${e.constant.extensionName} is unavailable.`:this.context.getParameter(e.constant.value)}stringifyParameterValue(e,t){if(null===e)return"null";if(void 0===e)return"undefined";if(30===t.returnType)return se(e);if("number"==typeof e&&p.isWebGlConstant(e)){if(20===t.returnType){const n=t.changeCommands&&t.changeCommands[0]||"";return p.stringifyWebGlConstant(e,n)}return e}if(e.length&&"string"!=typeof e){const t=[];for(let n=0;n1?r=this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value):this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.value)===p.RENDERBUFFER.value&&(r=e.getRenderbufferParameter(e.RENDERBUFFER,e.RENDERBUFFER_STENCIL_SIZE))):r=this.readParameterFromContext({constant:p.STENCIL_BITS}),this.currentState[p.STENCIL_BITS.name]=""+r}isValidChangeCommand(e,t){return"enable"===e.name||"disable"===e.name?e.commandArguments[0]===p.STENCIL_TEST.value:"stencilOp"===e.name||"stencilOpSeparate"===e.name?xe.stencilOpStates.indexOf(e.commandArguments[0])>0:"stencilFunc"===e.name||"stencilFuncSeparate"===e.name?xe.stencilFuncStates.indexOf(e.commandArguments[0])>0:"stencilMask"!==e.name&&"stencilMaskSeparate"!==e.name||xe.stencilMaskStates.indexOf(e.commandArguments[0])>0}getConsumeCommands(){return d}isStateEnable(e,t){return this.context.isEnabled(p.STENCIL_TEST.value)}}xe.stateName="StencilState",xe.stencilOpStates=[p.STENCIL_BACK_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_PASS.value,p.STENCIL_FAIL.value,p.STENCIL_PASS_DEPTH_FAIL.value,p.STENCIL_PASS_DEPTH_PASS.value],xe.stencilFuncStates=[p.STENCIL_BACK_FUNC.value,p.STENCIL_BACK_REF.value,p.STENCIL_BACK_VALUE_MASK.value,p.STENCIL_FUNC.value,p.STENCIL_REF.value,p.STENCIL_VALUE_MASK.value],xe.stencilMaskStates=[p.STENCIL_BACK_WRITEMASK.value,p.STENCIL_WRITEMASK.value];class we{static isSupportedCombination(e,t,n){return e=e||p.UNSIGNED_BYTE.value,((t=t||p.RGBA.value)===p.RGB.value||t===p.RGBA.value)&&(n===p.RGB.value||n===p.RGBA.value||n===p.RGBA8.value||n===p.RGBA16F.value||n===p.RGBA32F.value||n===p.RGB16F.value||n===p.RGB32F.value||n===p.R11F_G11F_B10F.value||n===p.SRGB8.value||n===p.SRGB8_ALPHA8.value)&&this.isSupportedComponentType(e)}static readPixels(e,t,n,r,i,s){e.getError(),s===p.UNSIGNED_NORMALIZED.value&&(s=p.UNSIGNED_BYTE.value);const o=r*i*4;let a;if(s===p.UNSIGNED_BYTE.value?a=new Uint8Array(o):(s=p.FLOAT.value,a=new Float32Array(o)),e.readPixels(t,n,r,i,e.RGBA,s,a),e.getError())return;if(s===p.UNSIGNED_BYTE.value)return a;const l=new Uint8Array(r*i*4);for(let e=0;e1){const e=this.context.getParameter(p.MAX_DRAW_BUFFERS.value);for(let n=0;n1?this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value):p.UNSIGNED_BYTE.value;l===p.RENDERBUFFER.value?this.readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,c,u):l===p.TEXTURE.value&&this.readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,c,u)}readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,l,u){let c=0,h=0;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,c=e.samples,h=e.internalFormat,!c&&!we.isSupportedCombination(l,p.RGBA.value,h))return}else s+=r,o+=i;if(r=i=0,c){const a=e,u=e.createRenderbuffer(),c=e.getParameter(e.RENDERBUFFER_BINDING);e.bindRenderbuffer(e.RENDERBUFFER,u),e.renderbufferStorage(e.RENDERBUFFER,h,s,o),e.bindRenderbuffer(e.RENDERBUFFER,c),e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u);const d=a.getParameter(a.READ_FRAMEBUFFER_BINDING),f=a.getParameter(a.DRAW_FRAMEBUFFER_BINDING);a.bindFramebuffer(a.READ_FRAMEBUFFER,t),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,this.captureFrameBuffer),a.blitFramebuffer(0,0,s,o,0,0,s,o,e.COLOR_BUFFER_BIT,e.NEAREST),a.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),a.bindFramebuffer(a.READ_FRAMEBUFFER,d),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,f),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t),e.deleteRenderbuffer(u)}else e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,l,u){let c=0;this.contextVersion>1&&(c=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value));const h=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL.value),d=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE.value);d>0?g[d].name:p.TEXTURE_2D.name;let f=!1,m=l;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,void 0!==e.type&&(m=e.type),f=e.target===p.TEXTURE_2D_ARRAY.name,!we.isSupportedCombination(e.type,e.format,e.internalFormat))return}else s+=r,o+=i;r=i=0,e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),c>0||f?e.framebufferTextureLayer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,u,h,c):e.framebufferTexture2D(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,d||p.TEXTURE_2D.value,u,h),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,d,c,m),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}getCapture(e,t,n,r,i,s,o,l,u){i=Math.floor(i),s=Math.floor(s);const c={attachmentName:t,src:null,textureCubeMapFace:o?g[o].name:null,textureLayer:l,raw:null};if(!this.quickCapture)try{const t=we.readPixels(e,n,r,i,s,u);if(t){c.raw=Ne.encode(t,i,s),this.workingCanvas.width=i,this.workingCanvas.height=s;const e=this.workingContext2D.createImageData(i,s);if(e.data.set(t),this.workingContext2D.putImageData(e,0,0),this.fullCapture)this.captureCanvas.width=this.workingCanvas.width,this.captureCanvas.height=this.workingCanvas.height;else{const e=i/s;e<1?(this.captureCanvas.width=Le.captureBaseSize*e,this.captureCanvas.height=Le.captureBaseSize):e>1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this.captureContext2D.drawImage(this.workingCanvas,0,0,i,s,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",c.src=Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D)}}catch(e){a.warn("Spector can not capture the visual state: "+e)}this.currentState.Attachments.push(c)}analyse(e){}}Le.stateName="VisualState",Le.captureBaseSize=256;class Oe{constructor(e){this.context=e.context,this.captureFrameBuffer=e.context.createFramebuffer(),this.workingCanvas=Fe.createCanvas(1,1),this.workingContext2D=Fe.get2DContext(this.workingCanvas),this.captureCanvas=Fe.createCanvas(1,1),this.captureContext2D=Fe.get2DContext(this.captureCanvas),Fe.setImageSmoothing(this.captureContext2D,!0)}appendTextureState(e,t,n=null,r){if(!t)return;const i=t.__SPECTOR_Object_CustomData;if(i&&(this.fullCapture=r,i.type&&(e.textureType=this.getWebGlConstant(i.type)),i.format&&(e.format=this.getWebGlConstant(i.format)),i.internalFormat&&(e.internalFormat=this.getWebGlConstant(i.internalFormat)),e.width=i.width,e.height=i.height,i.depth&&(e.depth=i.depth),n)){const r="NEAREST"===e.samplerMagFilter||"NEAREST"===e.magFilter,s=this.getTextureVisualState(n,t,i,r);if(s){e.visual=s.visual;for(const t in s.visualPixels)if(s.visualPixels.hasOwnProperty(t)){e.visualPixels=s.visualPixels;break}}}}getTextureVisualState(e,t,n,r){try{const i=this.context,s={},o={};if(!we.isSupportedCombination(n.type,n.format,n.internalFormat))return{visual:s,visualPixels:o};const a=this.context.getParameter(p.FRAMEBUFFER_BINDING.value);i.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer);try{const a=0,l=n.width,u=n.height;if(e===p.TEXTURE_3D&&n.depth){const e=i;for(let c=0;c2&&c2&&c1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}return this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this._setSmoothing(!o),this.captureContext2D.drawImage(this.workingCanvas,0,0,r,i,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",{src:Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D),raw:l}}catch(e){}return{src:void 0,raw:null}}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}_setSmoothing(e){Fe.setImageSmoothing(this.captureContext2D,e)}}Oe.captureBaseSize=64,Oe.cubeMapFaces=[p.TEXTURE_CUBE_MAP_POSITIVE_X,p.TEXTURE_CUBE_MAP_POSITIVE_Y,p.TEXTURE_CUBE_MAP_POSITIVE_Z,p.TEXTURE_CUBE_MAP_NEGATIVE_X,p.TEXTURE_CUBE_MAP_NEGATIVE_Y,p.TEXTURE_CUBE_MAP_NEGATIVE_Z];class Ie{constructor(e){this.context=e.context}getUboValue(e,t,n,r){const i=Ie.uboTypes[r];if(!i)return;const s=new i.arrayBufferView(n*i.lengthMultiplier),o=this.context,a=o.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,e);if(a){const n=o.getIndexedParameter(p.UNIFORM_BUFFER_START.value,e),r=o.getParameter(p.UNIFORM_BUFFER_BINDING.value);try{o.bindBuffer(p.UNIFORM_BUFFER.value,a),o.getBufferSubData(p.UNIFORM_BUFFER.value,n+t,s)}catch(e){return}r&&o.bindBuffer(p.UNIFORM_BUFFER.value,r)}return Array.prototype.slice.call(s)}}Ie.uboTypes={[p.BOOL.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.BOOL_VEC2.value]:{arrayBufferView:Uint8Array,lengthMultiplier:2},[p.BOOL_VEC3.value]:{arrayBufferView:Uint8Array,lengthMultiplier:3},[p.BOOL_VEC4.value]:{arrayBufferView:Uint8Array,lengthMultiplier:4},[p.INT.value]:{arrayBufferView:Int32Array,lengthMultiplier:1},[p.INT_VEC2.value]:{arrayBufferView:Int32Array,lengthMultiplier:2},[p.INT_VEC3.value]:{arrayBufferView:Int32Array,lengthMultiplier:3},[p.INT_VEC4.value]:{arrayBufferView:Int32Array,lengthMultiplier:4},[p.UNSIGNED_INT.value]:{arrayBufferView:Uint32Array,lengthMultiplier:1},[p.UNSIGNED_INT_VEC2.value]:{arrayBufferView:Uint32Array,lengthMultiplier:2},[p.UNSIGNED_INT_VEC3.value]:{arrayBufferView:Uint32Array,lengthMultiplier:3},[p.UNSIGNED_INT_VEC4.value]:{arrayBufferView:Uint32Array,lengthMultiplier:4},[p.FLOAT.value]:{arrayBufferView:Float32Array,lengthMultiplier:1},[p.FLOAT_VEC2.value]:{arrayBufferView:Float32Array,lengthMultiplier:2},[p.FLOAT_VEC3.value]:{arrayBufferView:Float32Array,lengthMultiplier:3},[p.FLOAT_VEC4.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT2x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT3.value]:{arrayBufferView:Float32Array,lengthMultiplier:9},[p.FLOAT_MAT3x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT3x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.FLOAT_MAT4.value]:{arrayBufferView:Float32Array,lengthMultiplier:16},[p.FLOAT_MAT4x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT4x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.SAMPLER_2D.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.SAMPLER_CUBE.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1}};class ke extends S{get typeName(){return"WebGLBuffer"}}class Me extends S{get typeName(){return"WebGLFramebuffer"}}class Pe extends S{get typeName(){return"WebGLProgram"}static saveInGlobalStore(e){const t=D.getWebGlObjectTag(e);t&&(this.store[t.id]=e)}static getFromGlobalStore(e){return this.store[e]}static updateInGlobalStore(e,t){if(!t)return;const n=this.getFromGlobalStore(e);if(!n)return;const r=D.getWebGlObjectTag(n);r&&(D.attachWebGlObjectTag(t,r),this.store[r.id]=t)}}Pe.store={};class Be extends S{get typeName(){return"WebGLQuery"}}class Ue extends S{get typeName(){return"WebGLRenderbuffer"}}class $e extends S{get typeName(){return"WebGLSampler"}}class Ge extends S{get typeName(){return"WebGLShader"}}class Ve extends S{get typeName(){return"WebGLSync"}}class We extends S{get typeName(){return"WebGLTexture"}}class He extends S{get typeName(){return"WebGLTransformFeedback"}}class je extends S{get typeName(){return"WebGLUniformLocation"}}class ze extends S{get typeName(){return"WebGLVertexArrayObject"}}class Xe extends me{get stateName(){return Xe.stateName}get requireStartAndStopStates(){return!1}constructor(e){super(e),this.drawCallTextureInputState=new Oe(e),this.drawCallUboInputState=new Ie(e)}getConsumeCommands(){return d}getChangeCommandsByState(){return{}}readFromContext(){var e,t;const n=this.context.getParameter(p.CURRENT_PROGRAM.value);if(!n)return;this.currentState.frameBuffer=this.readFrameBufferFromContext();const r=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData:x.getProgramData(this.context,n);if(this.currentState.programStatus=Object.assign({},r.programStatus),this.currentState.programStatus.program=this.getSpectorData(n),this.currentState.programStatus.RECOMPILABLE=o.isBuildableProgram(n),this.currentState.programStatus.RECOMPILABLE&&Pe.saveInGlobalStore(n),this.currentState.shaders=r.shaders,(null===(e=this.lastCommandName)||void 0===e?void 0:e.indexOf("Elements"))>=0){const e=this.context.getParameter(this.context.ELEMENT_ARRAY_BUFFER_BINDING);e&&(this.currentState.elementArray={},this.currentState.elementArray.arrayBuffer=this.getSpectorData(e))}const i=this.context.getProgramParameter(n,p.ACTIVE_ATTRIBUTES.value);this.currentState.attributes=[];for(let e=0;e1){const e=this.context.getProgramParameter(n,p.ACTIVE_UNIFORM_BLOCKS.value);this.currentState.uniformBlocks=[];for(let t=0;t1){const e=this.context;t.colorAttachments=[];const n=e.getParameter(p.MAX_DRAW_BUFFERS.value);for(let e=0;e1&&(r.alphaSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE.value),r.blueSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE.value),r.encoding=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.value)),r.componentType=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value)),r.depthSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE.value),r.greenSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE.value),r.redSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_RED_SIZE.value),r.stencilSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value),n===p.TEXTURE.value&&(r.textureLayer=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value))),r}readAttributeFromContext(e,t){const n=this.context.getActiveAttrib(e,t),r=this.context.getAttribLocation(e,n.name);if(-1===r)return{name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:-1};const i=this.context.getVertexAttrib(r,p.CURRENT_VERTEX_ATTRIB.value),s=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING.value),o={name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:r,offsetPointer:this.context.getVertexAttribOffset(r,p.VERTEX_ATTRIB_ARRAY_POINTER.value),bufferBinding:this.getSpectorData(s),enabled:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_ENABLED.value),arraySize:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_SIZE.value),stride:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_STRIDE.value),arrayType:this.getWebGlConstant(this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_TYPE.value)),normalized:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_NORMALIZED.value),vertexAttrib:Array.prototype.slice.call(i)};return this.extensions[p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.extensionName]?o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.value):this.contextVersion>1&&(o.integer=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_INTEGER.value),o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR.value)),this.appendBufferCustomData(o,s),o}readUniformFromContext(e,t){const n=this.context.getActiveUniform(e,t),r=this.context.getUniformLocation(e,n.name);if(r){if(n.size>1&&n.name&&n.name.indexOf("[0]")===n.name.length-3){const t=[];for(let r=0;r1){r.baseLevel=this.context.getTexParameter(t.value,p.TEXTURE_BASE_LEVEL.value),r.immutable=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_FORMAT.value),r.immutableLevels=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_LEVELS.value),r.maxLevel=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LEVEL.value);const e=this.context.getParameter(p.SAMPLER_BINDING.value);if(e){r.sampler=this.getSpectorData(e);const t=this.context;r.samplerMaxLod=t.getSamplerParameter(e,p.TEXTURE_MAX_LOD.value),r.samplerMinLod=t.getSamplerParameter(e,p.TEXTURE_MIN_LOD.value),r.samplerCompareFunc=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_FUNC.value)),r.samplerCompareMode=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_MODE.value)),r.samplerWrapS=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_S.value)),r.samplerWrapT=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_T.value)),r.samplerWrapR=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_R.value)),r.samplerMagFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MAG_FILTER.value)),r.samplerMinFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MIN_FILTER.value))}else r.maxLod=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LOD.value),r.minLod=this.context.getTexParameter(t.value,p.TEXTURE_MIN_LOD.value),r.compareFunc=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_FUNC.value)),r.compareMode=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_MODE.value)),r.wrapR=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_WRAP_R.value))}const i=this.getTextureStorage(t);if(i){const e=this.quickCapture?null:t;this.drawCallTextureInputState.appendTextureState(r,i,e,this.fullCapture)}return this.context.activeTexture(n),r}getTextureStorage(e){return e===p.TEXTURE_2D?this.context.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP?this.context.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):e===p.TEXTURE_3D?this.context.getParameter(p.TEXTURE_BINDING_3D.value):e===p.TEXTURE_2D_ARRAY?this.context.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):void 0}readUniformsFromContextIntoState(e,t,n,r){const i=this.context,s=i.getActiveUniforms(e,t,p.UNIFORM_TYPE.value),o=i.getActiveUniforms(e,t,p.UNIFORM_SIZE.value),a=i.getActiveUniforms(e,t,p.UNIFORM_BLOCK_INDEX.value),l=i.getActiveUniforms(e,t,p.UNIFORM_OFFSET.value),u=i.getActiveUniforms(e,t,p.UNIFORM_ARRAY_STRIDE.value),c=i.getActiveUniforms(e,t,p.UNIFORM_MATRIX_STRIDE.value),h=i.getActiveUniforms(e,t,p.UNIFORM_IS_ROW_MAJOR.value);for(let d=0;d-1&&(t.blockName=i.getActiveUniformBlockName(e,t.blockIndice)),t.offset=l[d],t.arrayStride=u[d],t.matrixStride=c[d],t.rowMajor=h[d],t.blockIndice>-1){const e=r[a[d]].bindingPoint;t.value=this.drawCallUboInputState.getUboValue(e,t.offset,t.size,s[d])}}}readTransformFeedbackFromContext(e,t){const n=this.context,r=n.getTransformFeedbackVarying(e,t),i=n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value,t),s={name:r.name,size:r.size,type:this.getWebGlConstant(r.type),buffer:this.getSpectorData(i),bufferSize:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_SIZE.value,t),bufferStart:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_START.value,t)};return this.appendBufferCustomData(s,i),s}readUniformBlockFromContext(e,t){const n=this.context,r=n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_BINDING.value),i=n.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,r),s={name:n.getActiveUniformBlockName(e,t),bindingPoint:r,size:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_DATA_SIZE.value),activeUniformCount:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_ACTIVE_UNIFORMS.value),vertex:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER.value),fragment:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER.value),buffer:this.getSpectorData(i)};return this.appendBufferCustomData(s,i),s}appendBufferCustomData(e,t){if(t){const n=t.__SPECTOR_Object_CustomData;n&&(n.usage&&(e.bufferUsage=this.getWebGlConstant(n.usage)),e.bufferLength=n.length,n.offset&&(e.bufferOffset=n.offset),n.sourceLength&&(e.bufferSourceLength=n.sourceLength))}}getWebGlConstant(e){const t=g[e];return t?t.name:e}}Xe.stateName="DrawCall",Xe.samplerTypes={[p.SAMPLER_2D.value]:p.TEXTURE_2D,[p.SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.SAMPLER_3D.value]:p.TEXTURE_3D,[p.SAMPLER_2D_SHADOW.value]:p.TEXTURE_2D,[p.SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_2D_ARRAY_SHADOW.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_CUBE_SHADOW.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.UNSIGNED_INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.UNSIGNED_INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.UNSIGNED_INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.UNSIGNED_INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY};class Ke{constructor(e){this.contextInformation=e,this.stateTrackers=[],this.onCommandCapturedCallbacks={},this.initStateTrackers()}startCapture(e,t,n){for(const r of this.stateTrackers){const i=r.startCapture(!0,t,n);r.requireStartAndStopStates&&(e.initState[r.stateName]=i)}}stopCapture(e){for(const t of this.stateTrackers){const n=t.stopCapture();t.requireStartAndStopStates&&(e.endState[t.stateName]=n)}}captureState(e){const t=this.onCommandCapturedCallbacks[e.name];if(t)for(const n of t)n(e)}initStateTrackers(){this.stateTrackers.push(new Ee(this.contextInformation),new ve(this.contextInformation),new Ce(this.contextInformation),new De(this.contextInformation),new Se(this.contextInformation),new Ae(this.contextInformation),new _e(this.contextInformation),new ye(this.contextInformation),new be(this.contextInformation),new Te(this.contextInformation),new Re(this.contextInformation),new xe(this.contextInformation),new Le(this.contextInformation),new Xe(this.contextInformation));for(const e of this.stateTrackers)e.registerCallbacks(this.onCommandCapturedCallbacks)}}class Ye{static initializeByteSizeFormat(){this.byteSizePerInternalFormat||(this.byteSizePerInternalFormat={[p.R8.value]:1,[p.R16F.value]:2,[p.R32F.value]:4,[p.R8UI.value]:1,[p.RG8.value]:2,[p.RG16F.value]:4,[p.RG32F.value]:8,[p.ALPHA.value]:1,[p.RGB.value]:3,[p.RGBA.value]:4,[p.LUMINANCE.value]:1,[p.LUMINANCE_ALPHA.value]:2,[p.DEPTH_COMPONENT.value]:1,[p.DEPTH_STENCIL.value]:2,[p.SRGB_EXT.value]:3,[p.SRGB_ALPHA_EXT.value]:4,[p.RGB8.value]:3,[p.SRGB8.value]:3,[p.RGB565.value]:2,[p.R11F_G11F_B10F.value]:4,[p.RGB9_E5.value]:2,[p.RGB16F.value]:6,[p.RGB32F.value]:12,[p.RGB8UI.value]:3,[p.RGBA8.value]:4,[p.RGB5_A1.value]:2,[p.RGBA16F.value]:8,[p.RGBA32F.value]:16,[p.RGBA8UI.value]:4,[p.COMPRESSED_R11_EAC.value]:4,[p.COMPRESSED_SIGNED_R11_EAC.value]:4,[p.COMPRESSED_RG11_EAC.value]:4,[p.COMPRESSED_SIGNED_RG11_EAC.value]:4,[p.COMPRESSED_RGB8_ETC2.value]:4,[p.COMPRESSED_RGBA8_ETC2_EAC.value]:4,[p.COMPRESSED_SRGB8_ETC2.value]:4,[p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC.value]:4,[p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_RGB_S3TC_DXT1_EXT.value]:.5,[p.COMPRESSED_RGBA_S3TC_DXT3_EXT.value]:1,[p.COMPRESSED_RGBA_S3TC_DXT5_EXT.value]:1,[p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGB_ETC1_WEBGL.value]:.5,[p.COMPRESSED_RGB_ATC_WEBGL.value]:.5,[p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL.value]:1,[p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL.value]:1})}constructor(e){this.options=e,this.createCommandNames=this.getCreateCommandNames(),this.updateCommandNames=this.getUpdateCommandNames(),this.deleteCommandNames=this.getDeleteCommandNames(),this.startTime=u.now,this.memoryPerSecond={},this.totalMemory=0,this.frameMemory=0,this.capturing=!1,Ye.initializeByteSizeFormat()}registerCallbacks(e){for(const t of this.createCommandNames)e[t]=e[t]||[],e[t].push(this.createWithoutSideEffects.bind(this));for(const t of this.updateCommandNames)e[t]=e[t]||[],e[t].push(this.updateWithoutSideEffects.bind(this));for(const t of this.deleteCommandNames)e[t]=e[t]||[],e[t].push(this.deleteWithoutSideEffects.bind(this))}startCapture(){this.frameMemory=0,this.capturing=!0}stopCapture(){this.frameMemory=0,this.capturing=!1}appendRecordedInformation(e){e.frameMemory[this.objectName]=this.frameMemory,e.memory[this.objectName]=this.memoryPerSecond}create(e){}createWithoutSideEffects(e){this.options.toggleCapture(!1);try{this.create(e)}finally{this.options.toggleCapture(!0)}}updateWithoutSideEffects(e){if(e&&0!==e.arguments.length){this.options.toggleCapture(!1);try{const t=e.arguments[0],n=this.getBoundInstance(t);if(!n)return;if(!D.getWebGlObjectTag(n))return;const r=this.getWebGlConstant(t),i=this.update(e,r,n);this.changeMemorySize(i)}finally{this.options.toggleCapture(!0)}}}deleteWithoutSideEffects(e){if(!e||!e.arguments||e.arguments.length<1)return;const t=e.arguments[0];if(t){this.options.toggleCapture(!1);try{const e=this.delete(t);this.changeMemorySize(-e)}finally{this.options.toggleCapture(!0)}}}changeMemorySize(e){this.totalMemory+=e,this.capturing&&(this.frameMemory+=e);const t=u.now-this.startTime,n=Math.round(t/1e3);this.memoryPerSecond[n]=this.totalMemory}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}getByteSizeForInternalFormat(e){return Ye.byteSizePerInternalFormat[e]||4}readPixelStoreState(){const e=this.options.context,t={UNPACK_FLIP_Y_WEBGL:e.getParameter(p.UNPACK_FLIP_Y_WEBGL.value),UNPACK_PREMULTIPLY_ALPHA_WEBGL:e.getParameter(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL.value),UNPACK_COLORSPACE_CONVERSION_WEBGL:e.getParameter(p.UNPACK_COLORSPACE_CONVERSION_WEBGL.value),UNPACK_ALIGNMENT:e.getParameter(p.UNPACK_ALIGNMENT.value)};return e instanceof WebGL2RenderingContext&&(t.UNPACK_ROW_LENGTH=e.getParameter(p.UNPACK_ROW_LENGTH.value),t.UNPACK_IMAGE_HEIGHT=e.getParameter(p.UNPACK_IMAGE_HEIGHT.value),t.UNPACK_SKIP_PIXELS=e.getParameter(p.UNPACK_SKIP_PIXELS.value),t.UNPACK_SKIP_ROWS=e.getParameter(p.UNPACK_SKIP_ROWS.value),t.UNPACK_SKIP_IMAGES=e.getParameter(p.UNPACK_SKIP_IMAGES.value)),t}}class qe extends Ye{get objectName(){return"Buffer"}getCreateCommandNames(){return["createBuffer"]}getUpdateCommandNames(){return["bufferData"]}getDeleteCommandNames(){return["deleteBuffer"]}getBoundInstance(e){const t=this.options.context;return e===p.ARRAY_BUFFER.value?t.getParameter(p.ARRAY_BUFFER_BINDING.value):e===p.ELEMENT_ARRAY_BUFFER.value?t.getParameter(p.ELEMENT_ARRAY_BUFFER_BINDING.value):e===p.COPY_READ_BUFFER.value?t.getParameter(p.COPY_READ_BUFFER_BINDING.value):e===p.COPY_WRITE_BUFFER.value?t.getParameter(p.COPY_WRITE_BUFFER_BINDING.value):e===p.TRANSFORM_FEEDBACK_BUFFER.value?t.getParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value):e===p.UNIFORM_BUFFER.value?t.getParameter(p.UNIFORM_BUFFER_BINDING.value):e===p.PIXEL_PACK_BUFFER.value?t.getParameter(p.PIXEL_PACK_BUFFER_BINDING.value):e===p.PIXEL_UNPACK_BUFFER.value?t.getParameter(p.PIXEL_UNPACK_BUFFER_BINDING.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(t,e);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){const n=this.getLength(t);return t.arguments.length>=4?{target:e,length:n,usage:t.arguments[2],offset:t.arguments[3],sourceLength:t.arguments[1]?t.arguments[1].length:-1}:3===t.arguments.length?{target:e,length:n,usage:t.arguments[2]}:void 0}getLength(e){const t=e.arguments[1],n=e.arguments[3],r=e.arguments[4];if("number"==typeof t)return t;if("number"==typeof r&&r>0)return r;const i=t.byteLength||t.length||0;return"number"==typeof n&&n>0?i-n:i}}class Qe extends Ye{get objectName(){return"Renderbuffer"}getCreateCommandNames(){return["createRenderbuffer"]}getUpdateCommandNames(){return["renderbufferStorage","renderbufferStorageMultisample"]}getDeleteCommandNames(){return["deleteRenderbuffer"]}getBoundInstance(e){const t=this.options.context;if(e===p.RENDERBUFFER.value)return t.getParameter(p.RENDERBUFFER_BINDING.value)}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(e,t);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return r.length=r.width*r.height*this.getByteSizeForInternalFormat(r.internalFormat),n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){return 4===e.arguments.length?{target:t,internalFormat:e.arguments[1],width:e.arguments[2],height:e.arguments[3],length:0,samples:0}:{target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,samples:e.arguments[1]}}}class Ze extends Ye{get objectName(){return"Texture2d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage2D","compressedTexImage2D","texStorage2D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D.value?t.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP_POSITIVE_X.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Y.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Z.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_X.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Y.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Z.value?t.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target===p.TEXTURE_2D_ARRAY.name||t.target===p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else{const e="TEXTURE_2D"===t?1:6;let n=r.internalFormat;n===p.RGBA.value&&(r.type===p.FLOAT.value&&(n=p.RGBA32F.value),r.type===p.HALF_FLOAT_OES.value&&(n=p.RGBA16F.value)),r.length=r.width*r.height*e*this.getByteSizeForInternalFormat(n)}return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage2D"===e.name?this.getTexImage2DCustomData(e,t,n):"compressedTexImage2D"===e.name?this.getCompressedTexImage2DCustomData(e,t,n):"texStorage2D"===e.name?this.getTexStorage2DCustomData(e,t,n):void 0}getTexStorage2DCustomData(e,t,n){let r;return 5===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!1}),r}getCompressedTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=7&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!0}),r}getTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8?r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],format:e.arguments[6],type:e.arguments[7],length:0,isCompressed:!1}:6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[5].width,height:e.arguments[5].height,format:e.arguments[3],type:e.arguments[4],length:0,isCompressed:!1}),r}}class Je extends Ye{get objectName(){return"Texture3d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage3D","compressedTexImage3D","texStorage3D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D_ARRAY.value?t.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):e===p.TEXTURE_3D.value?t.getParameter(p.TEXTURE_BINDING_3D.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target!==p.TEXTURE_2D_ARRAY.name&&t.target!==p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){if(e.arguments.length>=2&&0!==e.arguments[1])return 0;const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else r.length=r.width*r.height*r.depth*this.getByteSizeForInternalFormat(r.internalFormat);return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage3D"===e.name?this.getTexImage3DCustomData(e,t,n):"compressedTexImage3D"===e.name?this.getCompressedTexImage3DCustomData(e,t,n):"texStorage3D"===e.name?this.getTexStorage3DCustomData(e,t,n):void 0}getTexStorage3DCustomData(e,t,n){let r;return 6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!1}),r}getCompressedTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!0}),r}getTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=9&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],format:e.arguments[7],type:e.arguments[8],length:0,isCompressed:!1}),r}}class et extends Ye{get objectName(){return"Program"}getCreateCommandNames(){return["createProgram"]}getUpdateCommandNames(){return["linkProgram"]}getDeleteCommandNames(){return["deleteProgram"]}getBoundInstance(e){return e}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){if(e.arguments.length>=1&&!e.arguments[0])return 0;const r=this.getCustomData(n);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e){const t=this.options.context;return x.getProgramData(t,e)}}class tt{constructor(e){this.contextInformation=e,this.onCommandCallbacks={},this.recorders=[],this.initRecorders()}recordCommand(e){const t=this.onCommandCallbacks[e.name];if(t)for(const n of t)n(e)}startCapture(){for(const e of this.recorders)e.startCapture()}stopCapture(){for(const e of this.recorders)e.stopCapture()}appendRecordedInformation(e){for(const t of this.recorders)t.appendRecordedInformation(e)}initRecorders(){this.recorders.push(new qe(this.contextInformation),new Qe(this.contextInformation),new Ze(this.contextInformation),new Je(this.contextInformation),new et(this.contextInformation));for(const e of this.recorders)e.registerCallbacks(this.onCommandCallbacks)}}class nt{constructor(e){this.contextInformation=e,this.webGlObjects=[],this.initWebglObjects()}tagWebGlObjects(e){for(const t of this.webGlObjects){for(let n=0;n0&&this.currentCapture.commands.length===this.maxCommands&&this.onMaxCommand.trigger(this)}}}spyContext(e){const t=[];for(const n in e)n&&t.push(n);for(let n=0;n{this.spyRequestAnimationFrame("requestAnimationFrame",e.display)})}spyRequestAnimationFrame(e,t){const n=this;y.storeOriginFunction(t,e),t[e]=function(){const r=arguments[0],i=n.getCallback(n,r,()=>{n.spiedScope[e](r)});return y.executeOriginFunction(t,e,[i])}}spySetTimer(e){const t=this,n=this.spiedScope,r="setTimeout"===e;y.storeOriginFunction(n,e),n[e]=function(){const i=arguments[0],s=arguments[1],o=Array.prototype.slice.call(arguments);return at.setTimerCommonValues.indexOf(s)>-1&&(o[0]=t.getCallback(t,i,r?()=>{n[e](i)}:null)),y.executeOriginFunction(n,e,o)}}getCallback(e,t,n=null){return function(){const r=u.now;if(e.lastFrame=++e.lastFrame%e.speedRatio,e.willPlayNextFrame||e.speedRatio&&!e.lastFrame){try{e.onFrameStart.trigger(e)}catch(t){e.onError.trigger(t)}try{t.apply(e.spiedScope,arguments)}catch(t){e.onError.trigger(t)}e.lastSixtyFramesCurrentIndex=(e.lastSixtyFramesCurrentIndex+1)%at.fpsWindowSize,e.lastSixtyFramesDuration[e.lastSixtyFramesCurrentIndex]=r-e.lastSixtyFramesPreviousStart;try{e.onFrameEnd.trigger(e)}catch(t){e.onError.trigger(t)}e.willPlayNextFrame=!1}else n&&n();e.lastSixtyFramesPreviousStart=r}}}at.requestAnimationFrameFunctions=["requestAnimationFrame","msRequestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame"],at.setTimerFunctions=["setTimeout","setInterval"],at.setTimerCommonValues=[0,15,16,33,32,40],at.fpsWindowSize=60;class lt{constructor(e){this.canvas=e,this.onContextRequested=new l,this.init()}init(){const e=this,t=function(){const t="undefined"!=typeof HTMLCanvasElement&&this instanceof HTMLCanvasElement?HTMLCanvasElement:OffscreenCanvas,n=e.canvas?y.executeOriginFunction(this,"getContext",arguments):y.executePrototypeOriginFunction(this,t,"getContext",arguments);if(arguments.length>0){const e=arguments[0];if("webgl"!==e&&"experimental-webgl"!==e&&"webgl2"!==e&&"experimental-webgl2"!==e)return n}if(n){const t=Array.prototype.slice.call(arguments),r="webgl2"===t[0]||"experimental-webgl2"===t[0]?2:1;e.onContextRequested.trigger({context:n,contextVersion:r})}return n};this.canvas?(y.storeOriginFunction(this.canvas,"getContext"),this.canvas.getContext=t):("undefined"!=typeof HTMLCanvasElement&&(y.storePrototypeOriginFunction(HTMLCanvasElement,"getContext"),HTMLCanvasElement.prototype.getContext=t),"undefined"!=typeof OffscreenCanvas&&(y.storePrototypeOriginFunction(OffscreenCanvas,"getContext"),OffscreenCanvas.prototype.getContext=t))}}class ut{static startIntercepting(e){if(ut.intercepting)return;if("undefined"==typeof Worker)return;ut.workerBundleUrl=e,ut.originalWorkerConstructor=Worker,ut.intercepting=!0;const t=Worker;globalThis.Worker=function(e,n){if(n&&"module"===n.type)return new t(e,n);const r=e.toString();try{let i;try{i=new URL(r,location.href).href}catch(r){return new t(e,n)}const s=new XMLHttpRequest;if(s.open("GET",i,!1),s.send(),200===s.status&&ut.shouldInjectSource(s.responseText)){const e=ut.rewriteImportScripts(s.responseText,i),o="(function(){\n var __spectorBase = "+JSON.stringify(i)+';\n self.__SPECTOR_workerBaseUrl = __spectorBase;\n function __spectorResolve(u) {\n if (u == null) return u;\n if (typeof u !== "string") {\n if (u instanceof URL) return u;\n try { u = String(u); } catch (e) { return u; }\n }\n if (/^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i.test(u)) return u;\n try { return new URL(u, __spectorBase).href; }\n catch (e) { return u; }\n }\n self.__SPECTOR_resolveWorkerUrl = __spectorResolve;\n var __origImportScripts = self.importScripts;\n if (typeof __origImportScripts === "function") {\n self.importScripts = function() {\n var args = new Array(arguments.length);\n for (var i = 0; i < arguments.length; i++) args[i] = __spectorResolve(arguments[i]);\n return __origImportScripts.apply(self, args);\n };\n }\n var __origFetch = self.fetch;\n if (typeof __origFetch === "function") {\n self.fetch = function(input, init) {\n try {\n if (typeof input === "string") {\n input = __spectorResolve(input);\n } else if (input && typeof input === "object" && "url" in input && typeof Request === "function") {\n var r = input;\n var resolved = __spectorResolve(r.url);\n if (resolved !== r.url) input = new Request(resolved, r);\n }\n } catch (e) { /* fall through with original input */ }\n return __origFetch.call(self, input, init);\n };\n }\n if (typeof XMLHttpRequest === "function" && XMLHttpRequest.prototype && XMLHttpRequest.prototype.open) {\n var __origXhrOpen = XMLHttpRequest.prototype.open;\n XMLHttpRequest.prototype.open = function(method, url) {\n var args = Array.prototype.slice.call(arguments);\n args[1] = __spectorResolve(url);\n return __origXhrOpen.apply(this, args);\n };\n }\n if (typeof Worker === "function") {\n var __OrigWorker = Worker;\n self.Worker = function(scriptURL, options) {\n var resolved = __spectorResolve(scriptURL);\n return new __OrigWorker(resolved, options);\n };\n self.Worker.prototype = __OrigWorker.prototype;\n }\n})();\n',a="importScripts("+JSON.stringify(ut.workerBundleUrl)+");\n",l=new Blob([o+a+e],{type:"application/javascript"}),u=URL.createObjectURL(l),c=new t(u,n);return ut.spiedWorkers.push({worker:c,originalUrl:r}),c}}catch(e){console.warn("[Spector.js] Could not inject into Worker ("+r+"):",e)}const i=new t(e,n);return ut.spiedWorkers.push({worker:i,originalUrl:r}),i},globalThis.Worker.prototype=t.prototype}static stopIntercepting(){ut.intercepting&&(globalThis.Worker=ut.originalWorkerConstructor,ut.intercepting=!1)}static rewriteImportScripts(e,t){const n=/(['"`])((?:\\.|(?!\1).)*)\1/g;return e.replace(/importScripts\s*\(([^)]*)\)/g,(e,r)=>"importScripts("+r.replace(n,(e,n,r)=>{if("`"===n&&-1!==r.indexOf("${"))return e;let i;try{i=new URL(r,t).href}catch(t){return e}return n+i+n})+")")}static shouldInjectSource(e){return!/\bimport\s*(?:\/\*[\s\S]*?\*\/\s*)?\(/.test(e)&&!/\bnew\s+(?:(?:self|globalThis)\s*\.\s*)?(?:Worker|SharedWorker)\s*\(/.test(e)}static getSpiedWorkers(){return ut.spiedWorkers}static isIntercepting(){return ut.intercepting}}ut.spiedWorkers=[],ut.intercepting=!1;class ct{static getDelay(){return ct.delayMs}static setDelay(e){ct.delayMs="number"==typeof e&&e>0?e:0}static shouldForceIncomplete(e,t,n,r){return!(r<=0)&&e===p.COMPLETION_STATUS_KHR.value&&void 0!==t&&n-tthis._state,this.subscribe=e=>(this._listeners.add(e),()=>{this._listeners.delete(e)}),this._state=e}setState(e){this._state=e(this._state),this._emitChange()}setSnapshot(e){this._state=e,this._emitChange()}_emitChange(){for(const e of this._listeners)e()}}function pt(e){return(0,dt.useSyncExternalStore)(e.subscribe,e.getSnapshot)}var mt=n(848);const gt=(0,dt.createContext)(null);function Et(){const e=(0,dt.useContext)(gt);if(!e)throw new Error("CaptureMenuContext not provided — CaptureMenuRoot must be rendered inside CaptureMenuContext.Provider");return e}function vt({canvas:e}){const t=Et();return(0,mt.jsx)("li",{onClick:()=>t.handleCanvasSelected(e),children:(0,mt.jsx)("span",{children:`Id: ${e.id} - Size: ${e.width}*${e.height}`})})}function Ct(){const e=Et(),t=pt(e.store),n=t.selectedCanvas?`${t.selectedCanvas.id} (${t.selectedCanvas.width}*${t.selectedCanvas.height})`:"Choose Canvas...";return(0,mt.jsxs)("div",{className:"canvasListComponent",children:[(0,mt.jsx)("span",{commandName:"onCanvasSelection",onClick:e.handleCanvasListToggle,children:n}),(0,mt.jsx)("ul",{style:{display:t.showCanvasList?"block":"none",visibility:t.showCanvasList?"visible":"hidden"},children:t.canvases.map((e,t)=>(0,mt.jsx)(vt,{canvas:e},e.id||t))})]})}function Dt(){const e=Et(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"captureMenuActionsComponent",children:[(0,mt.jsx)("div",{commandName:"onCaptureRequested",onClick:e.handleCaptureRequested}),t.isPlaying?(0,mt.jsx)("div",{commandName:"onPauseRequested",onClick:e.handlePauseRequested}):(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("div",{commandName:"onPlayRequested",onClick:e.handlePlayRequested}),(0,mt.jsx)("div",{commandName:"onPlayNextFrameRequested",onClick:e.handlePlayNextFrameRequested})]})]})}function St(){const e=pt(Et().store);return(0,mt.jsxs)("span",{className:"fpsCounterComponent",children:[e.fps.toFixed(2)," Fps"]})}function At(){const e=pt(Et().store);return(0,mt.jsxs)("div",{children:[(0,mt.jsxs)("div",{className:"captureMenuComponent "+(e.visible?"active":""),children:[(0,mt.jsx)(Ct,{}),(0,mt.jsx)(Dt,{}),(0,mt.jsx)(St,{})]}),(0,mt.jsx)("div",{className:"captureMenuLogComponent "+(e.logVisible?"active":""),children:(0,mt.jsx)("span",{className:e.logLevel===i.error?"error":"",children:e.logText})})]})}class _t{constructor(e={}){this.options=e,this.handleCanvasListToggle=()=>{this.store.getSnapshot(),this.store.setState(e=>Object.assign(Object.assign({},e),{selectedCanvas:null,showCanvasList:!e.showCanvasList,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!e.showCanvasList&&!this._hideLog})),this.onCanvasSelected.trigger(null),this._isTrackingCanvas&&this.trackPageCanvases()},this.handleCanvasSelected=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{selectedCanvas:e,showCanvasList:!1,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)},this.handleCaptureRequested=()=>{const e=this.getSelectedCanvasInformation();e&&this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.PleaseWaitHelpText,logVisible:!this._hideLog})),setTimeout(()=>{this.onCaptureRequested.trigger(e)},200)},this.handlePauseRequested=()=>{this.onPauseRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!1}))},this.handlePlayRequested=()=>{this.onPlayRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!0}))},this.handlePlayNextFrameRequested=()=>{this.onPlayNextFrameRequested.trigger(this.getSelectedCanvasInformation())},this._rootPlaceHolder=e.rootPlaceHolder||document.body,this._hideLog=!!e.hideLog,this._isTrackingCanvas=!1,this._extraCanvasEntries=[],this.onCanvasSelected=new l,this.onCaptureRequested=new l,this.onPauseRequested=new l,this.onPlayRequested=new l,this.onPlayNextFrameRequested=new l,this.store=new ft({visible:!0,logText:_t.SelectCanvasHelpText,logLevel:i.info,logVisible:!this._hideLog,canvases:[],selectedCanvas:null,showCanvasList:!1,isPlaying:!0,fps:0}),this._container=document.createElement("div"),this._container.className="spector-react-capture-menu",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(gt.Provider,{value:this},(0,dt.createElement)(At)))}getSelectedCanvasInformation(){return this.store.getSnapshot().selectedCanvas}trackPageCanvases(){if(this._isTrackingCanvas=!0,document.body){const e=document.body.querySelectorAll("canvas");this.updateCanvasesList(e)}}updateCanvasesList(e){const t=[];for(let n=0;nObject.assign(Object.assign({},n),{canvases:t,selectedCanvas:e,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}captureComplete(e){e?this.store.setState(t=>Object.assign(Object.assign({},t),{logLevel:i.error,logText:e,logVisible:!this._hideLog})):this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog}))}setFPS(e){this.store.setState(t=>Object.assign(Object.assign({},t),{fps:e}))}_updateCanvasesInternal(e){for(const t of this._extraCanvasEntries)e.push(t);this.store.getSnapshot().showCanvasList?this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e})):1===e.length?(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:e[0],logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e[0])):(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:null,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(null))}}_t.SelectCanvasHelpText="Please, select a canvas in the list above.",_t.ActionsHelpText="Record with the red button, you can also pause or continue playing the current scene.",_t.PleaseWaitHelpText="Capturing, be patient (this can take up to 3 minutes)...";const yt=(0,dt.createContext)(null);function bt(){const e=(0,dt.useContext)(yt);if(!e)throw new Error("ResultViewContext not provided — ResultViewRoot must be rendered inside ResultViewContext.Provider");return e}function Tt(){const e=bt(),t=pt(e.store),n=(0,dt.useRef)(null),r=(0,dt.useCallback)(e=>{e.preventDefault();const t=e.currentTarget.parentElement,n=t.parentElement;if(!n)return;const r=n.querySelectorAll("li:not(.resultViewMenuSmall)");if("true"===t.getAttribute("open")){t.setAttribute("open","false");for(let e=0;e{e.handleSearchTextChange(t.target.value)},[e]),s=(0,dt.useCallback)(t=>{t.stopPropagation(),e.handleSearchTextChange("")},[e]),o=(0,dt.useCallback)(t=>n=>{n.preventDefault(),e.handleMenuStatusChange(t)},[e]),a=(0,dt.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),e.handleClose()},[e]);return(0,mt.jsxs)("ul",{className:"resultViewMenuComponent",ref:n,children:[(0,mt.jsx)("li",{className:"resultViewMenuOpen resultViewMenuSmall",children:(0,mt.jsx)("a",{href:"#",role:"button",onClick:r,children:"Menu"})}),(0,mt.jsxs)("li",{className:"searchContainer",children:[(0,mt.jsx)("input",{type:"text",placeholder:"Search...",value:t.searchText,commandName:"onSearchTextChanged",commandEventBinding:"change",onChange:i}),(0,mt.jsx)("a",{className:"clearSearch",commandName:"onSearchTextCleared",onClick:s,children:"X"})]}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:0===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCapturesClicked",onClick:o(0),children:"Captures"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:10===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInformationClicked",onClick:o(10),children:"Information"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:20===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInitStateClicked",onClick:o(20),children:"Init State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:40===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCommandsClicked",onClick:o(40),children:"Commands"+(t.commandCount>0?" ("+t.commandCount+")":"")})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:60===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCompareClicked",onClick:o(60),children:"Compare"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:30===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onEndStateClicked",onClick:o(30),children:"End State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{role:"button",commandName:"onCloseClicked",onClick:a,children:"Close"})})]})}function Rt({children:e}){return(0,mt.jsx)("div",{className:"resultViewContentComponent",children:e})}function xt({capture:e,active:t,onCaptureSelected:n,onSaveRequested:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),r()},[r]),s=(0,dt.useCallback)(()=>{n()},[n]),o=new Date(e.startTime).toTimeString().split(" ")[0];return(0,mt.jsxs)("li",{className:t?"active":"",onClick:s,children:[e.endState.VisualState.Attachments?e.endState.VisualState.Attachments.map((e,t)=>(0,mt.jsx)("img",{src:encodeURI(e.src)},t)):(0,mt.jsx)("span",{children:e.endState.VisualState.FrameBufferStatus}),(0,mt.jsxs)("span",{children:[o,(0,mt.jsx)("a",{href:"#",className:"captureListItemSave",commandName:"onSaveRequested",onClick:i})]})]})}function wt({active:e,captures:t,onCaptureSelected:n,onSaveRequested:r,onCaptureLoaded:i}){const s=(0,dt.useRef)(null),o=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault()},[]),l=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),function(e,t){let n=null;if(e&&e.dataTransfer&&e.dataTransfer.files&&(n=e.dataTransfer.files),e&&e.target&&e.target.files&&(n=e.target.files),n&&n.length>0)for(let e=0;e{a.error("Error while reading file: "+r.name+e)},i.onload=e=>{try{const n=JSON.parse(e.target.result);t(n)}catch(e){a.error("Error while reading file: "+r.name+e)}},i.readAsText(r)}}(e.nativeEvent,i)},[i]);return(0,mt.jsxs)("div",{className:"captureListComponent "+(e?"active":""),children:[(0,mt.jsx)("div",{className:"openCaptureFile",ref:s,onDragEnter:o,onDragOver:o,onDrop:l,children:(0,mt.jsx)("span",{children:"Drag files here to open a previously saved capture."})}),(0,mt.jsx)("ul",{children:t.map((e,t)=>(0,mt.jsx)(xt,{capture:e.capture,active:e.active,onCaptureSelected:()=>n(t),onSaveRequested:()=>r(e.capture)},t))})]})}function Ft({children:e}){return(0,mt.jsx)("div",{className:"visualStateListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Nt({item:e,onVisualStateSelected:t}){const n=(0,dt.useRef)(null);(0,dt.useEffect)(()=>{e.active&&n.current&&setTimeout(()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const r=(0,dt.useCallback)(()=>{t()},[t]),i=e.VisualState;return(0,mt.jsxs)("li",{ref:n,className:e.active?"active":"",onClick:r,commandName:"onVisualStateSelected",children:[i.Attachments?i.Attachments.map((e,t)=>e.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{src:encodeURI(e.src)}),i.Attachments.length>1&&(0,mt.jsx)("span",{children:e.attachmentName}),!!e.textureLayer&&(0,mt.jsx)("span",{children:"Layer: "+e.textureLayer}),!!e.textureCubeMapFace&&(0,mt.jsx)("span",{children:e.textureCubeMapFace})]},t):null):(0,mt.jsx)("span",{children:i.FrameBufferStatus}),(0,mt.jsx)("span",{children:i.FrameBuffer?"Frame buffer: "+i.FrameBuffer.__SPECTOR_Object_TAG.id:"Canvas frame buffer"})]})}function Lt({children:e}){return(0,mt.jsx)("div",{className:"commandListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Ot({command:e,onCommandSelected:t,onVertexSelected:n,onFragmentSelected:r,onShaderSelected:i}){var s;const o=(0,dt.useRef)(null),a=e.capture,l=function(e){switch(e){case 50:return"deprecated";case 10:return"unused";case 20:return"disabled";case 30:return"redundant";case 40:return"valid";default:return"unknown"}}(a.status),u=!!a.VisualState;let c="";u&&(c=" drawCall"),e.active&&(c=" active"),(0,dt.useEffect)(()=>{e.active&&o.current&&setTimeout(()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const h=(0,dt.useCallback)(e=>{t()},[t]),d=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==n||n()},[n]),f=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==r||r()},[r]),p=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==i||i()},[i]);let m=null;if(u&&"clear"!==a.name)try{const e=a.DrawCall.shaders[0],t=a.DrawCall.shaders[1];m=(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("a",{href:"#",onClick:d,children:e.name}),(0,mt.jsx)("a",{href:"#",onClick:f,children:t.name})]})}catch(e){}const g=(null===(s=a.shader)||void 0===s?void 0:s.source)?(0,mt.jsx)("a",{href:"#",commandName:"onShaderSourceSelected",onClick:p,children:"Source"}):null;return(0,mt.jsxs)("li",{ref:o,className:c,onClick:h,commandName:"onCommandSelected",children:[a.marker&&(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.marker+" "}),"LOG"===a.name?(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.text+" "}):(0,mt.jsx)("span",{dangerouslySetInnerHTML:{__html:a.text.replace(a.name,`${a.name}`)}}),g,m]})}function It({children:e}){return(0,mt.jsx)("div",{className:"commandDetailComponent",children:e})}function kt({left:e,children:t}){return(0,mt.jsx)("div",{className:e?"informationColumnLeftComponent":"informationColumnRightComponent",children:t})}function Mt({children:e}){return(0,mt.jsx)("div",{className:"jsonContentComponent",children:e})}function Pt(e,t,n,r){return{row:Math.max(0,parseInt(t,10)-1),column:n?Math.max(0,parseInt(n,10)-1):0,text:r.trim()||e,type:e.toLowerCase()}}var Bt,Ut,$t=Object.create,Gt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor,Wt=Object.getOwnPropertyNames,Ht=Object.getPrototypeOf,jt=Object.prototype.hasOwnProperty,zt=e=>{throw TypeError(e)},Xt=(e,t)=>{for(var n in t)Gt(e,n,{get:t[n],enumerable:!0})},Kt=(e,t,n)=>(((e,t)=>{t.has(e)||zt("Cannot access private method")})(e,t),n),Yt=(Bt=e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=/\r\n|[\n\r\u2028\u2029]/;e.codeFrameColumns=function(e,n,r={}){let i=new Proxy({},{get:()=>e=>e}),s=e.split(t),{start:o,end:a,markerLines:l}=function(e,t,n){let r=Object.assign({column:0,line:-1},e.start),i=Object.assign({},r,e.end),{linesAbove:s=2,linesBelow:o=3}=n||{},a=r.line,l=r.column,u=i.line,c=i.column,h=Math.max(a-(s+1),0),d=Math.min(t.length,u+o);-1===a&&(h=0),-1===u&&(d=t.length);let f=u-a,p={};if(f)for(let e=0;e<=f;e++){let n=e+a;if(l)if(0===e){let e=t[n-1].length;p[n]=[l,e-l+1]}else if(e===f)p[n]=[0,c];else{let r=t[n-e].length;p[n]=[0,r]}else p[n]=!0}else p[a]=l===c?!l||[l,0]:[l,c-l];return{start:h,end:d,markerLines:p}}(n,s,r),u=n.start&&"number"==typeof n.start.column,c=String(a).length,h=e.split(t,a).slice(o,a).map((e,t)=>{let n=o+1+t,s=` ${` ${n}`.slice(-c)} |`,a=l[n],u=!l[n+1];if(a){let t="";if(Array.isArray(a)){let n=e.slice(0,Math.max(a[0]-1,0)).replace(/[^\t]/g," "),o=a[1]||1;t=["\n ",i.gutter(s.replace(/\d/g," "))," ",n,i.marker("^").repeat(o)].join(""),u&&r.message&&(t+=" "+i.message(r.message))}return[i.marker(">"),i.gutter(s),e.length>0?` ${e}`:"",t].join("")}return` ${i.gutter(s)}${e.length>0?` ${e}`:""}`}).join("\n");return r.message&&!u&&(h=`${" ".repeat(c+1)}${r.message}\n${h}`),h}},()=>(Ut||Bt((Ut={exports:{}}).exports),Ut.exports));Xt({},{__debug:()=>Hs,check:()=>Vs,doc:()=>vs,format:()=>Gs,formatWithCursor:()=>$s,getSupportInfo:()=>Ws,util:()=>_s,version:()=>As});var qt=(e,t,n,r)=>{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Qt=class{diff(e,t,n={}){let r;"function"==typeof n?(r=n,n={}):"callback"in n&&(r=n.callback);let i=this.castInput(e,n),s=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),a=this.removeEmpty(this.tokenize(s,n));return this.diffWithOptionsObj(o,a,n,r)}diffWithOptionsObj(e,t,n,r){var i;let s=e=>(e=this.postProcess(e,n),r?void setTimeout(function(){r(e)},0):e),o=t.length,a=e.length,l=1,u=o+a;null!=n.maxEditLength&&(u=Math.min(u,n.maxEditLength));let c=null!==(i=n.timeout)&&void 0!==i?i:1/0,h=Date.now()+c,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=a&&f+1>=o)return s(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,g=()=>{for(let r=Math.max(p,-l);r<=Math.min(m,l);r+=2){let i,l=d[r-1],u=d[r+1];l&&(d[r-1]=void 0);let c=!1;if(u){let e=u.oldPos-r;c=u&&0<=e&&e=a&&f+1>=o)return s(this.buildValues(i.lastComponent,t,e))||!0;d[r]=i,i.oldPos+1>=a&&(m=Math.min(m,r-1)),f+1>=o&&(p=Math.max(p,r+1))}else d[r]=void 0}l++};if(r)!function e(){setTimeout(function(){if(l>u||Date.now()>h)return r(void 0);g()||e()},0)}();else for(;l<=u&&Date.now()<=h;){let e=g();if(e)return e}}addToPath(e,t,n,r,i){let s=e.lastComponent;return s&&!i.oneChangePerToken&&s.added===t&&s.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:s.count+1,added:t,removed:n,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:s}}}extractCommon(e,t,n,r,i){let s=t.length,o=n.length,a=e.oldPos,l=a-r,u=0;for(;l+1e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(a,a+e.count));a+=e.count,e.added||(l+=e.count)}}return i}},Zt=new class extends Qt{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Jt(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}function en(e,t){let n;switch(t){case"\n":n=/\n/gu;break;case"\r":n=/\r/gu;break;case"\r\n":n=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let r=e.match(n);return r?r.length:0}var tn="string",nn="array",rn="cursor",sn="indent",on="align",an="trim",ln="group",un="fill",cn="if-break",hn="indent-if-break",dn="line-suffix",fn="line-suffix-boundary",pn="line",mn="label",gn="break-parent",En=new Set([rn,sn,on,an,ln,un,cn,hn,dn,fn,pn,mn,gn]),vn=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},Cn=function(e){if("string"==typeof e)return tn;if(Array.isArray(e))return nn;if(!e)return;let{type:t}=e;return En.has(t)?t:void 0};var Dn=class extends Error{name="InvalidDocError";constructor(e){super(function(e){let t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(Cn(e))throw new Error("doc is valid.");let n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;let r=(e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e))([...En].map(e=>`'${e}'`));return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},Sn=Dn,An={},_n=function(e,t,n,r){let i=[e];for(;i.length>0;){let e=i.pop();if(e===An){n(i.pop());continue}n&&i.push(e,An);let s=Cn(e);if(!s)throw new Sn(e);if(!1!==(null==t?void 0:t(e)))switch(s){case nn:case un:{let t=s===nn?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case cn:i.push(e.flatContents,e.breakContents);break;case ln:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case on:case sn:case hn:case mn:case dn:i.push(e.contents);break;case tn:case rn:case an:case fn:case pn:case gn:break;default:throw new Sn(e)}}};function yn(e,t){if("string"==typeof e)return t(e);let n=new Map;return function e(r){if(n.has(r))return n.get(r);let i=function(n){switch(Cn(n)){case nn:return t(n.map(e));case un:return t({...n,parts:n.parts.map(e)});case cn:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case ln:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case on:case sn:case hn:case mn:case dn:return t({...n,contents:e(n.contents)});case tn:case rn:case an:case fn:case pn:case gn:return t(n);default:throw new Sn(n)}}(r);return n.set(r,i),i}(e)}function bn(e,t,n){let r=n,i=!1;return _n(e,function(e){if(i)return!1;let n=t(e);void 0!==n&&(i=!0,r=n)}),r}function Tn(e){if(e.type===ln&&e.break||e.type===pn&&e.hard||e.type===gn)return!0}function Rn(e){if(e.length>0){let t=vn(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function xn(e){return e.type!==pn||e.hard?e.type===cn?e.flatContents:e:e.soft?"":" "}function wn(e){for(e=[...e];e.length>=2&&vn(!1,e,-2).type===pn&&vn(!1,e,-1).type===gn;)e.length-=2;if(e.length>0){let t=Fn(vn(!1,e,-1));e[e.length-1]=t}return e}function Fn(e){switch(Cn(e)){case sn:case hn:case ln:case dn:case mn:{let t=Fn(e.contents);return{...e,contents:t}}case cn:return{...e,breakContents:Fn(e.breakContents),flatContents:Fn(e.flatContents)};case un:return{...e,parts:wn(e.parts)};case nn:return wn(e);case tn:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return tfunction(e){switch(Cn(e)){case un:if(e.parts.every(e=>""===e))return"";break;case ln:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===ln&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case on:case sn:case hn:case dn:if(!e.contents)return"";break;case cn:if(!e.flatContents&&!e.breakContents)return"";break;case nn:{let t=[];for(let n of e){if(!n)continue;let[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof vn(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case tn:case rn:case an:case fn:case pn:case mn:case gn:break;default:throw new Sn(e)}return e}(e))}(e))}function Ln(e){if(e.type===pn)return!0}function On(e,t){return e.type===mn?{...e,contents:t(e.contents)}:t(e)}var In=()=>{},kn=In,Mn=In,Pn=In;function Bn(e){return kn(e),{type:sn,contents:e}}function Un(e,t){return kn(t),{type:on,contents:t,n:e}}function $n(e,t={}){return kn(e),Mn(t.expandedStates,!0),{type:ln,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Gn(e){return kn(e),{type:dn,contents:e}}var Vn={type:fn},Wn={type:gn},Hn={type:an},jn={type:pn,hard:!0},zn={type:pn,hard:!0,literal:!0},Xn={type:pn},Kn={type:pn,soft:!0},Yn=[jn,Wn],qn=[zn,Wn],Qn={type:rn};function Zn(e,t){kn(e),Mn(t);let n=[];for(let r=0;r0){for(let e=0;e!(function(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}(e)||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e)),nr=/[^\x20-\x7F]/u,rr=function(e){if(!e)return 0;if(!nr.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(let n of e){let e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=tr(e)?1:2)}return t},ir=Symbol("MODE_BREAK"),sr=Symbol("MODE_FLAT"),or=Symbol("cursor"),ar=Symbol("DOC_FILL_PRINTED_LENGTH");function lr(e,t){return cr(e,{type:"indent"},t)}function ur(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?cr(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:cr(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function cr(e,t,n){let r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t],i="",s=0,o=0,a=0;for(let e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function hr(e){let t=0,n=0,r=e.length;e:for(;r--;){let i=e[r];if(i!==or)for(let n=i.length-1;n>=0;n--){let s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(or);return t}function dr(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length,a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}let{mode:e,doc:u}=a.pop(),c=Cn(u);switch(c){case tn:l.push(u),n-=rr(u);break;case nn:case un:{let t=c===nn?u:u.parts,n=u[ar]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case sn:case on:case hn:case mn:a.push({mode:e,doc:u.contents});break;case an:n+=hr(l);break;case ln:{if(s&&u.break)return!1;let t=u.break?ir:e,n=u.expandedStates&&t===ir?vn(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case cn:{let t=(u.groupId?i[u.groupId]||sr:e)===ir?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case pn:if(e===ir||u.hard)return!0;u.soft||(l.push(" "),n--);break;case dn:r=!0;break;case fn:if(r)return!1}}return!1}function fr(e,t){let n={},r=t.printWidth,i=Jt(t.endOfLine),s=0,o=[{ind:{value:"",length:0,queue:[]},mode:ir,doc:e}],a=[],l=!1,u=[],c=0;for(function(e){let t=new Set,n=[];_n(e,function(e){if(e.type===gn&&Rn(n),e.type===ln){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===ln&&n.pop().break&&Rn(n)},!0)}(e);o.length>0;){let{ind:e,mode:h,doc:d}=o.pop();switch(Cn(d)){case tn:{let e="\n"!==i?qt(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=rr(e));break}case nn:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case rn:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(or),c++;break;case sn:o.push({ind:lr(e,t),mode:h,doc:d.contents});break;case on:o.push({ind:ur(e,d.n,t),mode:h,doc:d.contents});break;case an:s-=hr(a);break;case ln:switch(h){case sr:if(!l){o.push({ind:e,mode:d.break?ir:sr,doc:d.contents});break}case ir:{l=!1;let t={ind:e,mode:sr,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&dr(t,o,i,a,n))o.push(t);else if(d.expandedStates){let t=vn(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:ir,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:ir,doc:t});break}{let t=d.expandedStates[r],s={ind:e,mode:sr,doc:t};if(dr(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:ir,doc:d.contents});break}}d.id&&(n[d.id]=vn(!1,o,-1).mode);break;case un:{let t=r-s,i=d[ar]??0,{parts:a}=d,l=a.length-i;if(0===l)break;let c=a[i+0],f=a[i+1],p={ind:e,mode:sr,doc:c},m={ind:e,mode:ir,doc:c},g=dr(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}let E={ind:e,mode:sr,doc:f},v={ind:e,mode:ir,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}let C=a[i+2],D={ind:e,mode:h,doc:{...d,[ar]:i+2}};dr({ind:e,mode:sr,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case cn:case hn:{let t=d.groupId?n[d.groupId]:h;if(t===ir){let t=d.type===cn?d.breakContents:d.negate?d.contents:Bn(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===sr){let t=d.type===cn?d.flatContents:d.negate?Bn(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case dn:u.push({ind:e,mode:h,doc:d.contents});break;case fn:u.length>0&&o.push({ind:e,mode:h,doc:jn});break;case pn:switch(h){case sr:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case ir:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=hr(a),a.push(i+e.value),s=e.length)}break;case mn:o.push({ind:e,mode:h,doc:d.contents});break;case gn:break;default:throw new Sn(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}let h=a.indexOf(or);if(-1!==h){let e=a.indexOf(or,h+1);if(-1===e)return{formatted:a.filter(e=>e!==or).join("")};let t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}var pr,mr,gr,Er=function(e,t,n=0){let r=0;for(let i=n;i=0;n-=2)if(!Array.isArray(t[n])&&--e<0)return n;return-1},gr=function*(){let{stack:e}=this;for(let t=e.length-3;t>=0;t-=2){let n=e[t];Array.isArray(n)||(yield n)}};var vr=class{constructor(e){((e,t)=>{t.has(e)?zt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,void 0)})(this,pr),this.stack=[e]}get key(){let{stack:e,siblings:t}=this;return vn(!1,e,null===t?-2:-4)??null}get index(){return null===this.siblings?null:vn(!1,this.stack,-2)}get node(){return vn(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return null!==this.siblings}get siblings(){let{stack:e}=this,t=vn(!1,e,-3);return Array.isArray(t)?t:null}get next(){let{siblings:e}=this;return null===e?null:e[this.index+1]}get previous(){let{siblings:e}=this;return null===e?null:e[this.index-1]}get isFirst(){return 0===this.index}get isLast(){let{siblings:e,index:t}=this;return null!==e&&t===e.length-1}get isRoot(){return 1===this.stack.length}get root(){return this.stack[0]}get ancestors(){return[...Kt(this,pr,gr).call(this)]}getName(){let{stack:e}=this,{length:t}=e;return t>1?vn(!1,e,-2):null}getValue(){return vn(!1,this.stack,-1)}getNode(e=0){let t=Kt(this,pr,mr).call(this,e);return-1===t?null:this.stack[t]}getParentNode(e=0){return this.getNode(e+1)}call(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{return e(this)}finally{n.length=r}}callParent(e,t=0){let n=Kt(this,pr,mr).call(this,t+1),r=this.stack.splice(n+1);try{return e(this)}finally{this.stack.push(...r)}}each(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{for(let t=0;t{n[r]=e(t,r,i)},...t),n}match(...e){let t=this.stack.length-1,n=null,r=this.stack[t--];for(let i of e){if(void 0===r)return!1;let e=null;if("number"==typeof n&&(e=n,n=this.stack[t--],r=this.stack[t--]),i&&!i(r,n,e))return!1;n=this.stack[t--],r=this.stack[t--]}return!0}findAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return t}hasAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return!0;return!1}},Cr=new Proxy(()=>{},{get:()=>Cr}),Dr=Cr;function*Sr(e,t){let{getVisitorKeys:n,filter:r=()=>!0}=t,i=e=>function(e){return null!==e&&"object"==typeof e}(e)&&r(e);for(let t of n(e)){let n=e[t];if(Array.isArray(n))for(let e of n)i(e)&&(yield e);else i(n)&&(yield n)}}function Ar(e){return(t,n,r)=>{let i=!(null==r||!r.backwards);if(!1===n)return!1;let{length:s}=t,o=n;for(;o>=0&&oObject.keys(e).filter(e=>!wr.has(e)),Nr=function(e){return e?t=>e(t,wr):Fr};function Lr(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=function(e){let t=e.type||e.kind||"(unknown type)",n=String(e.name||e.id&&("object"==typeof e.id?e.id.name:e.id)||e.key&&("object"==typeof e.key?e.key.name:e.key)||e.value&&("object"==typeof e.value?"":String(e.value))||e.operator||"");return n.length>20&&(n=n.slice(0,19)+"…"),t+(n?" "+n:"")}(e)}function Or(e,t){t.leading=!0,t.trailing=!1,Lr(e,t)}function Ir(e,t,n){t.leading=!1,t.trailing=!1,n&&(t.marker=n),Lr(e,t)}function kr(e,t){t.leading=!1,t.trailing=!0,Lr(e,t)}var Mr=new WeakMap;function Pr(e,t){if(Mr.has(e))return Mr.get(e);let{printer:{getCommentChildNodes:n,canAttachComment:r,getVisitorKeys:i},locStart:s,locEnd:o}=t;if(!r)return[];let a=((null==n?void 0:n(e,t))??[...Sr(e,{getVisitorKeys:Nr(i)})]).flatMap(e=>r(e)?[e]:Pr(e,t));return a.sort((e,t)=>s(e)-s(t)||o(e)-o(t)),Mr.set(e,a),a}function Br(e,t,n,r){let i,s,{locStart:o,locEnd:a}=n,l=o(t),u=a(t),c=Pr(e,n),h=0,d=c.length;for(;h>1,r=c[e],f=o(r),p=a(r);if(f<=l&&u<=p)return Br(r,t,n,r);if(p<=l)i=r,h=e+1;else{if(!(u<=f))throw new Error("Comment location overlaps with node location");s=r,d=e}}if("TemplateLiteral"===(null==r?void 0:r.type)){let{quasis:e}=r,o=Hr(e,t,n);i&&Hr(e,i,n)!==o&&(i=null),s&&Hr(e,s,n)!==o&&(s=null)}return{enclosingNode:r,precedingNode:i,followingNode:s}}var Ur=()=>!1,$r=e=>!/[\S\n\u2028\u2029]/u.test(e);function Gr(e,t,n,r){let{comment:i,precedingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=o(i);if(s)for(let t=r-1;t>=0;t--){let{comment:r,precedingNode:i}=n[t];if(i!==s||!$r(e.slice(a(r),l)))break;l=o(r)}return xr(e,l,{backwards:!0})}function Vr(e,t,n,r){let{comment:i,followingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=a(i);if(s)for(let t=r+1;t0;--s){let{comment:i,precedingNode:u,followingNode:c}=e[s-1];Dr.strictEqual(u,o),Dr.strictEqual(c,a);let h=t.originalText.slice(t.locEnd(i),l);if(!((null==(r=(n=t.printer).isGap)?void 0:r.call(n,h,t))??/^[\s(]*$/u.test(h)))break;l=t.locStart(i)}for(let[t,{comment:n}]of e.entries())t1&&e.comments.sort((e,n)=>t.locStart(e)-t.locStart(n));e.length=0}function Hr(e,t,n){let r=n.locStart(t)-1;for(let t=1;t"string"==typeof e||"function"==typeof e,choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>"string"==typeof e||"object"==typeof e,cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:"Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.",cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:"Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.",cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function qr({plugins:e=[],showDeprecated:t=!1}={}){let n=e.flatMap(e=>e.languages??[]),r=[];for(let i of function(e){let t=[];for(let[n,r]of Object.entries(e)){let e={name:n,...r};Array.isArray(e.default)&&(e.default=vn(!1,e.default,-1).value),t.push(e)}return t}(Object.assign({},...e.map(({options:e})=>e),Yr)))!t&&i.deprecated||(Array.isArray(i.choices)&&(t||(i.choices=i.choices.filter(e=>!e.deprecated)),"parser"===i.name&&(i.choices=[...i.choices,...Qr(i.choices,n,e)])),i.pluginDefaults=Object.fromEntries(e.filter(e=>{var t;return void 0!==(null==(t=e.defaultOptions)?void 0:t[i.name])}).map(e=>[e.name,e.defaultOptions[i.name]])),r.push(i));return{languages:n,options:r}}function*Qr(e,t,n){let r=new Set(e.map(e=>e.value));for(let e of t)if(e.parsers)for(let t of e.parsers)if(!r.has(t)){r.add(t);let i=n.find(e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t)),s=e.name;null!=i&&i.name&&(s+=` (plugin: ${i.name})`),yield{value:t,description:s}}}var Zr,Jr,ei,ti,ni,ri="windows"===(null==(Zr=globalThis.Deno)?void 0:Zr.build.os)||(null==(ei=null==(Jr=globalThis.navigator)?void 0:Jr.platform)?void 0:ei.startsWith("Win"))||(null==(ni=null==(ti=globalThis.process)?void 0:ti.platform)?void 0:ni.startsWith("win"))||!1;function ii(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function si(e,t){if(!t)return;let n=(e=>String(e).split(/[/\\]/u).pop())(t).toLowerCase();return e.find(({filenames:e})=>null==e?void 0:e.some(e=>e.toLowerCase()===n))??e.find(({extensions:e})=>null==e?void 0:e.some(e=>n.endsWith(e)))}function oi(e,t){if(t){if(String(t).startsWith("file:"))try{t=function(e){return ri?function(e){e=ii(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return""!==e.hostname&&(t=`\\\\${e.hostname}${t}`),t}(e):function(e){return e=ii(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}(e)}(t)}catch{return}if("string"==typeof t)return e.find(({isSupported:e})=>null==e?void 0:e({filepath:t}))}}var ai=function(e,t){let n=((e,t)=>{if(!e||null!=t)return t.toReversed||!Array.isArray(t)?t.toReversed():[...t].reverse()})(!1,e.plugins).flatMap(e=>e.languages??[]),r=function(e,t){if(t)return e.find(({name:e})=>e.toLowerCase()===t)??e.find(({aliases:e})=>null==e?void 0:e.includes(t))??e.find(({extensions:e})=>null==e?void 0:e.includes(`.${t}`))}(n,t.language)??si(n,t.physicalFile)??si(n,t.file)??oi(n,t.physicalFile)??oi(n,t.file)??void t.physicalFile;return null==r?void 0:r.parsers[0]},li={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(e=>li.value(e)).join(", ")}]`;let t=Object.keys(e);return 0===t.length?"{}":`{ ${t.map(t=>`${li.key(t)}: ${li.value(e[t])}`).join(", ")} }`},pair:({key:e,value:t})=>li.value({[e]:t})},ui=new Proxy(String,{get:()=>ui}),ci=ui,hi=Symbol.for("vnopts.VALUE_NOT_EXIST"),di=Symbol.for("vnopts.VALUE_UNCHANGED"),fi=" ".repeat(2);function pi(e,t,n,r){return[`Invalid ${ci.red(r.key(e))} value.`,`Expected ${ci.blue(n)},`,`but received ${t===hi?ci.gray("nothing"):ci.red(r.value(t))}.`].join(" ")}function mi({text:e,list:t},n){let r=[];return e&&r.push(`- ${ci.blue(e)}`),t&&r.push([`- ${ci.blue(t.title)}:`].concat(t.values.map(e=>mi(e,n-fi.length).replace(/^|\n/g,`$&${fi}`))).join("\n")),gi(r,n)}function gi(e,t){if(1===e.length)return e[0];let[n,r]=e,[i,s]=e.map(e=>e.split("\n",1)[0].length);return i>t&&i>s?r:n}var Ei=[],vi=[],Ci=(e,t,{descriptor:n,logger:r,schemas:i})=>{let s=[`Ignored unknown option ${ci.yellow(n.pair({key:e,value:t}))}.`],o=Object.keys(i).sort().find(t=>function(e,t){if(e===t)return 0;let n=e;e.length>t.length&&(e=t,t=n);let r=e.length,i=t.length;for(;r>0&&e.charCodeAt(~-r)===t.charCodeAt(~-i);)r--,i--;let s=0;for(;sa?u>a?a+1:u:u>l?l+1:u;return a}(e,t)<3);o&&s.push(`Did you mean ${ci.blue(n.key(o))}?`),r.warn(s.join(" "))},Di=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"],Si=class{static create(e){return function(e,t){let n=new e(t),r=Object.create(n);for(let e of Di)e in t&&(r[e]=Ai(t[e],n,Si.prototype[e].length));return r}(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,t){return!1}deprecated(e,t){return!1}forward(e,t){}redirect(e,t){}overlap(e,t,n){return e}preprocess(e,t){return e}postprocess(e,t){return di}};function Ai(e,t,n){return"function"==typeof e?(...r)=>e(...r.slice(0,n-1),t,...r.slice(n-1)):()=>e}var _i=class extends Si{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},yi=class extends Si{expected(){return"anything"}validate(){return!0}},bi=class extends Si{constructor({valueSchema:e,name:t=e.name,...n}){super({...n,name:t}),this._valueSchema=e}expected(e){let{text:t,list:n}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:t&&`an array of ${t}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(e,t){if(!Array.isArray(e))return!1;let n=[];for(let r of e){let e=t.normalizeValidateResult(this._valueSchema.validate(r,t),r);!0!==e&&n.push(e.value)}return 0===n.length||{value:n}}deprecated(e,t){let n=[];for(let r of e){let e=t.normalizeDeprecatedResult(this._valueSchema.deprecated(r,t),r);!1!==e&&n.push(...e.map(({value:e})=>({value:[e]})))}return n}forward(e,t){let n=[];for(let r of e){let e=t.normalizeForwardResult(this._valueSchema.forward(r,t),r);n.push(...e.map(Ti))}return n}redirect(e,t){let n=[],r=[];for(let i of e){let e=t.normalizeRedirectResult(this._valueSchema.redirect(i,t),i);"remain"in e&&n.push(e.remain),r.push(...e.redirect.map(Ti))}return 0===n.length?{redirect:r}:{redirect:r,remain:n}}overlap(e,t){return e.concat(t)}};function Ti({from:e,to:t}){return{from:[e],to:t}}var Ri=class extends Si{expected(){return"true or false"}validate(e){return"boolean"==typeof e}};function xi(e,t){let n=Object.create(null);for(let r of e){let e=r[t];if(n[e])throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n[e]=r}return n}function wi(e,t){if(e===t)return 0;let n=typeof e,r=typeof t,i=["undefined","object","boolean","number","string"];return n!==r?i.indexOf(n)-i.indexOf(r):"string"!==n?Number(e)-Number(t):e.localeCompare(t)}function Fi(e){return void 0===e?{}:e}function Ni(e){if("string"==typeof e)return{text:e};let{text:t,list:n}=e;return function(e){if(!e)throw new Error("Unexpected `expected` result, there should be at least one field.")}(void 0!==(t||n)),n?{text:t,list:{title:n.title,values:n.values.map(Ni)}}:{text:t}}function Li(e,t){return!0===e||(!1===e?{value:t}:e)}function Oi(e,t,n=!1){return!1!==e&&(!0===e?!!n||[{value:t}]:"value"in e?[e]:0!==e.length&&e)}function Ii(e,t){return"string"==typeof e||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function ki(e,t){return void 0===e?[]:Array.isArray(e)?e.map(e=>Ii(e,t)):[Ii(e,t)]}function Mi(e,t){let n=ki("object"==typeof e&&"redirect"in e?e.redirect:e,t);return 0===n.length?{remain:t,redirect:n}:"object"==typeof e&&"remain"in e?{remain:e.remain,redirect:n}:{redirect:n}}var Pi,Bi=class extends Si{constructor(e){super(e),this._choices=function(e,t){let n=new Map;for(let r of e){let e=r[t];if(n.has(e))throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n.set(e,r)}return n}(e.choices.map(e=>e&&"object"==typeof e?e:{value:e}),"value")}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(e=>this._choices.get(e)).filter(({hidden:e})=>!e).map(e=>e.value).sort(wi).map(e.value),n=t.slice(0,-2),r=t.slice(-2);return{text:n.concat(r.join(" or ")).join(", "),list:{title:"one of the following values",values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return!(!t||!t.deprecated)&&{value:e}}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},Ui=class extends Si{expected(){return"a number"}validate(e,t){return"number"==typeof e}},$i=class extends Ui{expected(){return"an integer"}validate(e,t){return!0===t.normalizeValidateResult(super.validate(e,t),e)&&function(e){return e===Math.floor(e)}(e)}},Gi=class extends Si{expected(){return"a string"}validate(e){return"string"==typeof e}},Vi=li,Wi=Ci,Hi=(e,t,n)=>{let{text:r,list:i}=n.normalizeExpectedResult(n.schemas[e].expected(n)),s=[];return r&&s.push(pi(e,t,r,n.descriptor)),i&&s.push([pi(e,t,i.title,n.descriptor)].concat(i.values.map(e=>mi(e,n.loggerPrintWidth))).join("\n")),gi(s,n.loggerPrintWidth)},ji=(e,t,{descriptor:n})=>{let r=[`${ci.yellow("string"==typeof e?n.key(e):n.pair(e))} is deprecated`];return t&&r.push(`we now treat it as ${ci.blue("string"==typeof t?n.key(t):n.pair(t))}`),r.join("; ")+"."},zi=class{constructor(e,t){let{logger:n=console,loggerPrintWidth:r=80,descriptor:i=Vi,unknown:s=Wi,invalid:o=Hi,deprecated:a=ji,missing:l=()=>!1,required:u=()=>!1,preprocess:c=e=>e,postprocess:h=()=>di}=t||{};this._utils={descriptor:i,logger:n||{warn:()=>{}},loggerPrintWidth:r,schemas:xi(e,"name"),normalizeDefaultResult:Fi,normalizeExpectedResult:Ni,normalizeDeprecatedResult:Oi,normalizeForwardResult:ki,normalizeRedirectResult:Mi,normalizeValidateResult:Li},this._unknownHandler=s,this._invalidHandler=function(e){return(...t)=>{let n=e(...t);return"string"==typeof n?new Error(n):n}}(o),this._deprecatedHandler=a,this._identifyMissing=(e,t)=>!(e in t)||l(e,t),this._identifyRequired=u,this._preprocess=c,this._postprocess=h,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=function(){let e=Object.create(null);return t=>{let n=JSON.stringify(t);return!!e[n]||(e[n]=!0,!1)}}()}normalize(e){let t={},n=[this._preprocess(e,this._utils)],r=()=>{for(;0!==n.length;){let e=n.shift(),r=this._applyNormalization(e,t);n.push(...r)}};r();for(let e of Object.keys(this._utils.schemas)){let r=this._utils.schemas[e];if(!(e in t)){let t=Fi(r.default(this._utils));"value"in t&&n.push({[e]:t.value})}}r();for(let e of Object.keys(this._utils.schemas)){if(!(e in t))continue;let n=this._utils.schemas[e],r=t[e],i=n.postprocess(r,this._utils);i!==di&&(this._applyValidation(i,e,n),t[e]=i)}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let n=[],{knownKeys:r,unknownKeys:i}=this._partitionOptionKeys(e);for(let i of r){let r=this._utils.schemas[i],s=r.preprocess(e[i],this._utils);this._applyValidation(s,i,r);let o=({from:e,to:t})=>{n.push("string"==typeof t?{[t]:e}:{[t.key]:t.value})},a=({value:e,redirectTo:t})=>{let n=Oi(r.deprecated(e,this._utils),s,!0);if(!1!==n)if(!0===n)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,t,this._utils));else for(let{value:e}of n){let n={key:i,value:e};if(!this._hasDeprecationWarned(n)){let r="string"==typeof t?{key:t,value:e}:t;this._utils.logger.warn(this._deprecatedHandler(n,r,this._utils))}}};ki(r.forward(s,this._utils),s).forEach(o);let l=Mi(r.redirect(s,this._utils),s);if(l.redirect.forEach(o),"remain"in l){let e=l.remain;t[i]=i in t?r.overlap(t[i],e,this._utils):e,a({value:e})}for(let{from:e,to:t}of l.redirect)a({value:e,redirectTo:t})}for(let r of i){let i=e[r];this._applyUnknownHandler(r,i,t,(e,t)=>{n.push({[e]:t})})}return n}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,hi,this._utils)}_partitionOptionKeys(e){let[t,n]=function(e,t){let n=[],r=[];for(let i of e)t(i)?n.push(i):r.push(i);return[n,r]}(Object.keys(e).filter(t=>!this._identifyMissing(t,e)),e=>e in this._utils.schemas);return{knownKeys:t,unknownKeys:n}}_applyValidation(e,t,n){let r=Li(n.validate(e,this._utils),e);if(!0!==r)throw this._invalidHandler(t,r.value,this._utils)}_applyUnknownHandler(e,t,n,r){let i=this._unknownHandler(e,t,this._utils);if(i)for(let e of Object.keys(i)){if(this._identifyMissing(e,i))continue;let t=i[e];e in this._utils.schemas?r(e,t):n[e]=t}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==di){if(t.delete)for(let n of t.delete)delete e[n];if(t.override){let{knownKeys:n,unknownKeys:r}=this._partitionOptionKeys(t.override);for(let r of n){let n=t.override[r];this._applyValidation(n,r,this._utils.schemas[r]),e[r]=n}for(let n of r){let r=t.override[n];this._applyUnknownHandler(n,r,e,(t,n)=>{let r=this._utils.schemas[t];this._applyValidation(n,t,r),e[t]=n})}}}}};function Xi(e,{isCLI:t,optionInfos:n,FlagSchema:r}){let i,{name:s}=e,o={name:s},a={};switch(e.type){case"int":i=$i,t&&(o.preprocess=Number);break;case"string":case"path":i=Gi;break;case"choice":i=Bi,o.choices=e.choices.map(t=>null!=t&&t.redirect?{...t,redirect:{to:{key:e.name,value:t.redirect}}}:t);break;case"boolean":i=Ri;break;case"flag":i=r,o.flags=n.flatMap(e=>[e.alias,e.description&&e.name,e.oppositeDescription&&`no-${e.name}`].filter(Boolean));break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?o.validate=(t,n,r)=>e.exception(t)||n.validate(t,r):o.validate=(e,t,n)=>void 0===e||t.validate(e,n),e.redirect&&(a.redirect=t=>t?{to:"string"==typeof e.redirect?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(a.deprecated=!0),t&&!e.array){let e=o.preprocess||(e=>e);o.preprocess=(t,n,r)=>n.preprocess(e(Array.isArray(t)?vn(!1,t,-1):t),r)}return e.array?bi.create({...t?{preprocess:e=>Array.isArray(e)?e:[e]}:{},...a,valueSchema:i.create(o)}):i.create({...o,...a})}var Ki=(e,t,n)=>{if(!e||null!=t){if(t.findLast)return t.findLast(n);for(let e=t.length-1;e>=0;e--){let r=t[e];if(n(r,e,t))return r}}};function Yi(e,t){if(!t)throw new Error("parserName is required.");let n=Ki(!1,e,e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t));if(n)return n;let r=`Couldn't resolve parser "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}function qi({plugins:e,parser:t}){return Qi(Yi(e,t),t)}function Qi(e,t){let n=e.parsers[t];return"function"==typeof n?n():n}var Zi={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null},Ji=async function(e,t={}){var n;let r={...e};if(!r.parser){if(!r.filepath)throw new Kr("No parser and no file path given, couldn't infer a parser.");if(r.parser=ai(r,{physicalFile:r.filepath}),!r.parser)throw new Kr(`No parser could be inferred for file "${r.filepath}".`)}let i=qr({plugins:e.plugins,showDeprecated:!0}).options,s={...Zi,...Object.fromEntries(i.filter(e=>void 0!==e.default).map(e=>[e.name,e.default]))},o=Yi(r.plugins,r.parser),a=await Qi(o,r.parser);r.astFormat=a.astFormat,r.locEnd=a.locEnd,r.locStart=a.locStart;let l=null!=(n=o.printers)&&n[a.astFormat]?o:function(e,t){if(!t)throw new Error("astFormat is required.");let n=Ki(!1,e,e=>e.printers&&Object.prototype.hasOwnProperty.call(e.printers,t));if(n)return n;let r=`Couldn't find plugin for AST format "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}(r.plugins,a.astFormat),u=await function(e,t){let n=e.printers[t];return"function"==typeof n?n():n}(l,a.astFormat);r.printer=u;let c={...s,...l.defaultOptions?Object.fromEntries(Object.entries(l.defaultOptions).filter(([,e])=>void 0!==e)):{}};for(let[e,t]of Object.entries(c))(null===r[e]||void 0===r[e])&&(r[e]=t);return"json"===r.parser&&(r.trailingComma="none"),function(e,t,{logger:n=!1,isCLI:r=!1,passThrough:i=!1,FlagSchema:s,descriptor:o}={}){if(r){if(!s)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=li;let a=i?Array.isArray(i)?(e,t)=>i.includes(e)?{[e]:t}:void 0:(e,t)=>({[e]:t}):(e,t,n)=>{let{_:r,...i}=n.schemas;return Ci(e,t,{...n,schemas:i})},l=function(e,{isCLI:t,FlagSchema:n}){let r=[];t&&r.push(yi.create({name:"_"}));for(let i of e)r.push(Xi(i,{isCLI:t,optionInfos:e,FlagSchema:n})),i.alias&&t&&r.push(_i.create({name:i.alias,sourceName:i.name}));return r}(t,{isCLI:r,FlagSchema:s}),u=new zi(l,{logger:n,unknown:a,descriptor:o}),c=!1!==n;c&&Pi&&(u._hasDeprecationWarned=Pi);let h=u.normalize(e);return c&&(Pi=u._hasDeprecationWarned),h}(r,i,{passThrough:Object.keys(Zi),...t})},es=((e,t,n)=>(n=null!=e?$t(Ht(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of Wt(t))!jt.call(e,n)&&void 0!==n&&Gt(e,n,{get:()=>t[n],enumerable:!(r=Vt(t,n))||r.enumerable});return e})(Gt(n,"default",{value:e,enumerable:!0}),e)))(Yt()),ts=async function(e,t){let n,r=await qi(t),i=r.preprocess?r.preprocess(e,t):e;t.originalText=i;try{n=await r.parse(i,t,t)}catch(t){!function(e,t){let{loc:n}=e;if(n){let r=(0,es.codeFrameColumns)(t,n,{highlightCode:!0});throw e.message+="\n"+r,e.codeFrame=r,e}throw e}(t,e)}return{text:i,ast:n}};async function ns(e,t){({ast:e}=await is(e,t));let n=new Map,r=new vr(e),i=()=>{},s=new Map;await async function(e,t,n,r,i){let{embeddedLanguageFormatting:s,printer:{embed:o,hasPrettierIgnore:a=()=>!1,getVisitorKeys:l}}=n;if(!o||"auto"!==s)return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let u=Nr(o.getVisitorKeys??l),c=[];!function t(){let{node:r}=e;if(null===r||"object"!=typeof r||a(e))return;for(let n of u(r))Array.isArray(r[n])?e.each(t,n):e.call(t,n);let s=o(e,n);if(s){if("function"==typeof s)return void c.push({print:s,node:r,pathStack:[...e.stack]});i.set(r,s)}}();let h=e.stack;for(let{print:r,node:s,pathStack:o}of c)try{e.stack=o;let a=await r(d,t,e,n);a&&i.set(s,a)}catch(e){if(globalThis.PRETTIER_DEBUG)throw e}function d(e,t){return async function(e,t,n,r){let i=await Ji({...n,...t,parentParser:n.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:s}=await ts(e,i);return Nn(await r(s,i))}(e,t,n,r)}e.stack=h}(r,a,t,ns,s);let o=await rs(r,t,a,void 0,s);if(function(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:n}=e;for(let e of t){if(!e.printed&&!n.has(e))throw new Error('Comment "'+e.value.trim()+'" was not printed. Please report this error!');delete e.printed}}(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return[Qn,o];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[o,Qn]}return o;function a(e,t){return void 0===e||e===r?l(t):Array.isArray(e)?r.call(()=>l(t),...e):r.call(()=>l(t),e)}function l(e){i(r);let o=r.node;if(null==o)return"";let l=o&&"object"==typeof o&&void 0===e;if(l&&n.has(o))return n.get(o);let u=rs(r,t,a,e,s);return l&&n.set(o,u),u}}function rs(e,t,n,r,i){var s;let o,{node:a}=e,{printer:l}=t;switch(o=null!=(s=l.hasPrettierIgnore)&&s.call(l,e)?function(e,t){let{originalText:n,[Symbol.for("comments")]:r,locStart:i,locEnd:s,[Symbol.for("printedComments")]:o}=t,{node:a}=e,l=i(a),u=s(a);for(let e of r)i(e)>=l&&s(e)<=u&&o.add(e);return n.slice(l,u)}(e,t):i.has(a)?i.get(a):l.print(e,t,n,r),a){case t.cursorNode:o=On(o,e=>[Qn,e,Qn]);break;case t.nodeBeforeCursor:o=On(o,e=>[e,Qn]);break;case t.nodeAfterCursor:o=On(o,e=>[Qn,e])}return l.printComment&&(!l.willPrintOwnComments||!l.willPrintOwnComments(e,t))&&(o=function(e,t,n){let{leading:r,trailing:i}=function(e,t){let n=e.node;if(!n)return{};let r=t[Symbol.for("printedComments")];if(0===(n.comments||[]).filter(e=>!r.has(e)).length)return{leading:"",trailing:""};let i,s=[],o=[];return e.each(()=>{let n=e.node;if(null!=r&&r.has(n))return;let{leading:a,trailing:l}=n;a?s.push(function(e,t){var n;let r=e.node,i=[zr(e,t)],{printer:s,originalText:o,locStart:a,locEnd:l}=t;if(null==(n=s.isBlockComment)?void 0:n.call(s,r)){let e=xr(o,l(r))?xr(o,a(r),{backwards:!0})?Yn:Xn:" ";i.push(e)}else i.push(Yn);let u=Rr(o,yr(o,l(r)));return!1!==u&&xr(o,u)&&i.push(Yn),i}(e,t)):l&&(i=function(e,t,n){var r;let i=e.node,s=zr(e,t),{printer:o,originalText:a,locStart:l}=t,u=null==(r=o.isBlockComment)?void 0:r.call(o,i);if(null!=n&&n.hasLineSuffix&&(null==n||!n.isBlock)||xr(a,l(i),{backwards:!0})){let e=jr(a,l(i));return{doc:Gn([Yn,e?Yn:"",s]),isBlock:u,hasLineSuffix:!0}}return!u||null!=n&&n.hasLineSuffix?{doc:[Gn([" ",s]),Wn],isBlock:u,hasLineSuffix:!0}:{doc:[" ",s],isBlock:u,hasLineSuffix:!1}}(e,t,i),o.push(i.doc))},"comments"),{leading:s,trailing:o}}(e,n);return r||i?On(t,e=>[r,e,i]):t}(e,o,t)),o}async function is(e,t){let n=e.comments??[];t[Symbol.for("comments")]=n,t[Symbol.for("printedComments")]=new Set,function(e,t){let{comments:n}=e;if(delete e.comments,!function(e){return Array.isArray(e)&&e.length>0}(n)||!t.printer.canAttachComment)return;let r=[],{printer:{experimentalFeatures:{avoidAstMutation:i=!1}={},handleComments:s={}},originalText:o}=t,{ownLine:a=Ur,endOfLine:l=Ur,remaining:u=Ur}=s,c=n.map((r,i)=>({...Br(e,r,t),comment:r,text:o,options:t,ast:e,isLastComment:n.length-1===i}));for(let[e,t]of c.entries()){let n,{comment:s,precedingNode:o,enclosingNode:h,followingNode:d,text:f,options:p,ast:m,isLastComment:g}=t;if(i?n=[t]:(s.enclosingNode=h,s.precedingNode=o,s.followingNode=d,n=[s,f,p,m,g]),Gr(f,p,c,e))s.placement="ownLine",a(...n)||(d?Or(d,s):o?kr(o,s):Ir(h||m,s));else if(Vr(f,p,c,e))s.placement="endOfLine",l(...n)||(o?kr(o,s):d?Or(d,s):Ir(h||m,s));else if(s.placement="remaining",!u(...n))if(o&&d){let e=r.length;e>0&&r[e-1].followingNode!==d&&Wr(r,p),r.push(t)}else o?kr(o,s):d?Or(d,s):Ir(h||m,s)}if(Wr(r,t),!i)for(let e of n)delete e.precedingNode,delete e.enclosingNode,delete e.followingNode}(e,t);let{printer:{preprocess:r}}=t;return{ast:e=r?await r(e,t):e,comments:n}}var ss=function(e,t){let{cursorOffset:n,locStart:r,locEnd:i}=t,s=Nr(t.printer.getVisitorKeys),o=e=>r(e)<=n&&i(e)>=n,a=e,l=[e];for(let t of function*(e,t){let n=[e];for(let e=0;e0&&(void 0===u||void 0===c);){a=l.pop();let e=void 0!==u,t=void 0!==c;for(let o of Sr(a,{getVisitorKeys:s})){if(!e){let e=i(o);e<=n&&e>h&&(u=o,h=e)}if(!t){let e=r(o);e>=n&&e{if(!e||null!=t){if(t.findLastIndex)return t.findLastIndex(n);for(let e=t.length-1;e>=0;e--)if(n(t[e],e,t))return e;return-1}})(!1,e,e=>"Program"!==e.type&&"File"!==e.type);return-1===t?e:e.slice(0,t+1)}function as(e,t,n,r,i=[],s){let{locStart:o,locEnd:a}=n,l=o(e),u=a(e);if(!(t>u||t=0&&(t={...t,...ss(r,t)});let s=await ns(r,t);n>0&&(s=Jn([Yn,s],n,t.tabWidth));let o=fr(s,t);if(n>0){let e=o.formatted.trim();void 0!==o.cursorNodeStart&&(o.cursorNodeStart-=o.formatted.indexOf(e),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>e.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=e+Jt(t.endOfLine)}let a=t[Symbol.for("comments")];if(t.cursorOffset>=0){let e,n,r,s;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&o.cursorNodeText)if(r=o.cursorNodeStart,s=o.cursorNodeText,t.cursorNode)e=t.locStart(t.cursorNode),n=i.slice(e,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");e=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let r=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):i.length;n=i.slice(e,r)}else e=0,n=i,r=0,s=o.formatted;let l=t.cursorOffset-e;if(n===s)return{formatted:o.formatted,cursorOffset:r+l,comments:a};let u=n.split("");u.splice(l,0,hs);let c=function(e,t){return Zt.diff(e,t,void 0)}(u,s.split("")),h=r;for(let e of c)if(e.removed){if(e.value.includes(hs))break}else h+=e.count;return{formatted:o.formatted,cursorOffset:h,comments:a}}return{formatted:o.formatted,cursorOffset:-1,comments:a}}function fs(e,t,n){return"number"!=typeof t||Number.isNaN(t)||t<0||t>e.length?n:t}function ps(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i}=t;return n=fs(e,n,-1),r=fs(e,r,0),i=fs(e,i,e.length),{...t,cursorOffset:n,rangeStart:r,rangeEnd:i}}function ms(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s}=ps(e,t),o="\ufeff"===e.charAt(0);if(o&&(e=e.slice(1),n--,r--,i--),"auto"===s&&(s=function(e){let t=e.indexOf("\r");return-1!==t?"\n"===e.charAt(t+1)?"crlf":"cr":"lf"}(e)),e.includes("\r")){let t=t=>en(e.slice(0,Math.max(t,0)),"\r\n");n-=t(n),r-=t(r),i-=t(i),e=function(e){return qt(!1,e,/\r\n?/gu,"\n")}(e)}return{hasBOM:o,text:e,options:ps(e,{...t,cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s})}}async function gs(e,t){let n=await qi(t);return!n.hasPragma||n.hasPragma(e)}async function Es(e,t){let n,{hasBOM:r,text:i,options:s}=ms(e,await Ji(t));return s.rangeStart>=s.rangeEnd&&""!==i||s.requirePragma&&!await gs(i,s)||s.checkIgnorePragma&&await async function(e,t){var n;let r=await qi(t);return null==(n=r.hasIgnorePragma)?void 0:n.call(r,e)}(i,s)?{formatted:e,cursorOffset:t.cursorOffset,comments:[]}:(s.rangeStart>0||s.rangeEndr);let a=e.slice(r,i).search(/\S/u),l=-1===a;if(!l)for(r+=a;i>r&&!/\S/u.test(e[i-1]);--i);let u,c,h=as(n,r,t,(e,n)=>cs(t,e,n),[],"rangeStart"),d=l?h:as(n,i,t,e=>cs(t,e),[],"rangeEnd");if(!h||!d)return{rangeStart:0,rangeEnd:0};if((({parser:e})=>"json"===e||"json5"===e||"jsonc"===e||"json-stringify"===e)(t)){let e=function(e,t){let n=[e.node,...e.parentNodes],r=new Set([t.node,...t.parentNodes]);return n.find(e=>ls.has(e.type)&&r.has(e))}(h,d);u=e,c=e}else({startNode:u,endNode:c}=function(e,t,{locStart:n,locEnd:r}){let i=e.node,s=t.node;if(i===s)return{startNode:i,endNode:s};let o=n(e.node);for(let e of os(t.parentNodes)){if(!(n(e)>=o))break;s=e}let a=r(t.node);for(let t of os(e.parentNodes)){if(!(r(t)<=a))break;if(i=t,i===s)break}return{startNode:i,endNode:s}}(h,d,t));return{rangeStart:Math.min(s(u),s(c)),rangeEnd:Math.max(o(u),o(c))}}(r,t,n),o=r.slice(i,s),a=Math.min(i,r.lastIndexOf("\n",i)+1),l=r.slice(a,i).match(/^\s*/u)[0],u=Er(l,t.tabWidth),c=await ds(o,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>i&&t.cursorOffset<=s?t.cursorOffset-i:-1,endOfLine:"lf"},u),h=c.formatted.trimEnd(),{cursorOffset:d}=t;d>s?d+=h.length-o.length:c.cursorOffset>=0&&(d=c.cursorOffset+i);let f=r.slice(0,i)+h+r.slice(s);if("lf"!==t.endOfLine){let e=Jt(t.endOfLine);d>=0&&"\r\n"===e&&(d+=en(f.slice(0,d),"\n")),f=qt(!1,f,"\n",e)}return{formatted:f,cursorOffset:d,comments:c.comments}}(i,s):(!s.requirePragma&&s.insertPragma&&s.printer.insertPragma&&!await gs(i,s)&&(i=s.printer.insertPragma(i)),n=await ds(i,s)),r&&(n.formatted="\ufeff"+n.formatted,n.cursorOffset>=0&&n.cursorOffset++),n)}var vs={};Xt(vs,{builders:()=>Cs,printer:()=>Ds,utils:()=>Ss});var Cs={join:Zn,line:Xn,softline:Kn,hardline:Yn,literalline:qn,group:$n,conditionalGroup:function(e,t){return $n(e[0],{...t,expandedStates:e})},fill:function(e){return Pn(e),{type:un,parts:e}},lineSuffix:Gn,lineSuffixBoundary:Vn,cursor:Qn,breakParent:Wn,ifBreak:function(e,t="",n={}){return kn(e),""!==t&&kn(t),{type:cn,breakContents:e,flatContents:t,groupId:n.groupId}},trim:Hn,indent:Bn,indentIfBreak:function(e,t){return kn(e),{type:hn,contents:e,groupId:t.groupId,negate:t.negate}},align:Un,addAlignmentToDoc:Jn,markAsRoot:function(e){return Un({type:"root"},e)},dedentToRoot:function(e){return Un(Number.NEGATIVE_INFINITY,e)},dedent:function(e){return Un(-1,e)},hardlineWithoutBreakParent:jn,literallineWithoutBreakParent:zn,label:function(e,t){return kn(t),e?{type:mn,label:e,contents:t}:t},concat:e=>e},Ds={printDocToString:fr},Ss={willBreak:function(e){return bn(e,Tn,!1)},traverseDoc:_n,findInDoc:bn,mapDoc:yn,removeLines:function(e){return yn(e,xn)},stripTrailingHardline:Nn,replaceEndOfLine:function(e,t=qn){return yn(e,e=>"string"==typeof e?Zn(t,e.split("\n")):e)},canBreak:function(e){return bn(e,Ln,!1)}},As="3.6.2",_s={};Xt(_s,{addDanglingComment:()=>Ir,addLeadingComment:()=>Or,addTrailingComment:()=>kr,getAlignmentSize:()=>Er,getIndentSize:()=>xs,getMaxContinuousCount:()=>ws,getNextNonSpaceNonCommentCharacter:()=>Fs,getNextNonSpaceNonCommentCharacterIndex:()=>Ms,getPreferredQuote:()=>Ls,getStringWidth:()=>rr,hasNewline:()=>xr,hasNewlineInRange:()=>Os,hasSpaces:()=>Is,isNextLineEmpty:()=>Bs,isNextLineEmptyAfterIndex:()=>Rs,isPreviousLineEmpty:()=>Ps,makeString:()=>ks,skip:()=>Ar,skipEverythingButNewLine:()=>Tr,skipInlineComment:()=>ys,skipNewline:()=>Rr,skipSpaces:()=>yr,skipToLineEnd:()=>br,skipTrailingComment:()=>bs,skipWhitespace:()=>_r});var ys=function(e,t){if(!1===t)return!1;if("/"===e.charAt(t)&&"*"===e.charAt(t+1))for(let n=t+2;nMath.max(e,n.length/t.length),0)},Fs=function(e,t){let n=Ts(e,t);return!1===n?"":e.charAt(n)},Ns="'",Ls=function(e,t){let n=!0===t||t===Ns?Ns:'"',r=n===Ns?'"':Ns,i=0,s=0;for(let t of e)t===n?i++:t===r&&s++;return i>s?r:n},Os=function(e,t,n){for(let r=t;ri===r?i:s===t?"\\"+s:s||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(i)?i:"\\"+i));return t+i+t};function Ms(e,t){return 2===arguments.length||"number"==typeof t?Ts(e,t):function(e,t,n){return Ts(e,n(t))}(...arguments)}function Ps(e,t){return 2===arguments.length||"number"==typeof t?jr(e,t):function(e,t,n){return jr(e,n(t))}(...arguments)}function Bs(e,t){return 2===arguments.length||"number"==typeof t?Rs(e,t):function(e,t,n){return Rs(e,n(t))}(...arguments)}function Us(e,t=1){return async(...n)=>{let r=n[t]??{},i=r.plugins??[];return n[t]={...r,plugins:Array.isArray(i)?i:Object.values(i)},e(...n)}}var $s=Us(Es);async function Gs(e,t){let{formatted:n}=await $s(e,{...t,cursorOffset:-1});return n}async function Vs(e,t){return await Gs(e,t)===e}var Ws=Us(qr,0),Hs={parse:Us(async function(e,t,n){let{text:r,options:i}=ms(e,await Ji(t)),s=await ts(r,i);return n&&(n.preprocessForPrint&&(s.ast=await is(s.ast,i)),n.massage&&(s.ast=function(e,t){let{printer:{massageAstNode:n,getVisitorKeys:r}}=t;if(!n)return e;let i=Nr(r),s=n.ignoredProperties??new Set;return function e(t,r){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>e(t,r)).filter(Boolean);let o={},a=new Set(i(t));for(let n in t)!Object.prototype.hasOwnProperty.call(t,n)||s.has(n)||(a.has(n)?o[n]=e(t[n],t):o[n]=t[n]);let l=n(t,o,r);return null!==l?l??o:void 0}(e)}(s.ast,i))),s}),formatAST:Us(async function(e,t){return t=await Ji(t),fr(await ns(e,t),t)}),formatDoc:Us(async function(e,t){let n=function(e){let t=Object.create(null),n=new Set;return function e(t,n,i){var s,o;if("string"==typeof t)return JSON.stringify(t);if(Array.isArray(t)){let n=t.map(e).filter(Boolean);return 1===n.length?n[0]:`[${n.join(", ")}]`}if(t.type===pn){let e=(null==(s=null==i?void 0:i[n+1])?void 0:s.type)===gn;return t.literal?e?"literalline":"literallineWithoutBreakParent":t.hard?e?"hardline":"hardlineWithoutBreakParent":t.soft?"softline":"line"}if(t.type===gn)return(null==(o=null==i?void 0:i[n-1])?void 0:o.type)===pn&&i[n-1].hard?void 0:"breakParent";if(t.type===an)return"trim";if(t.type===sn)return"indent("+e(t.contents)+")";if(t.type===on)return t.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+e(t.contents)+")":t.n<0?"dedent("+e(t.contents)+")":"root"===t.n.type?"markAsRoot("+e(t.contents)+")":"align("+JSON.stringify(t.n)+", "+e(t.contents)+")";if(t.type===cn)return"ifBreak("+e(t.breakContents)+(t.flatContents?", "+e(t.flatContents):"")+(t.groupId?(t.flatContents?"":', ""')+`, { groupId: ${r(t.groupId)} }`:"")+")";if(t.type===hn){let n=[];t.negate&&n.push("negate: true"),t.groupId&&n.push(`groupId: ${r(t.groupId)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return`indentIfBreak(${e(t.contents)}${i})`}if(t.type===ln){let n=[];t.break&&"propagated"!==t.break&&n.push("shouldBreak: true"),t.id&&n.push(`id: ${r(t.id)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return t.expandedStates?`conditionalGroup([${t.expandedStates.map(t=>e(t)).join(",")}]${i})`:`group(${e(t.contents)}${i})`}if(t.type===un)return`fill([${t.parts.map(t=>e(t)).join(", ")}])`;if(t.type===dn)return"lineSuffix("+e(t.contents)+")";if(t.type===fn)return"lineSuffixBoundary";if(t.type===mn)return`label(${JSON.stringify(t.label)}, ${e(t.contents)})`;if(t.type===rn)return"cursor";throw new Error("Unknown doc type "+t.type)}(er(e));function r(e){if("symbol"!=typeof e)return JSON.stringify(String(e));if(e in t)return t[e];let r=e.description||"symbol";for(let i=0;;i++){let s=r+(i>0?` #${i}`:"");if(!n.has(s))return n.add(s),t[e]=`Symbol.for(${JSON.stringify(s)})`}}}(e),{formatted:r}=await Es(n,{...t,parser:"__js_expression"});return r}),printToDoc:Us(async function(e,t){t=await Ji(t);let{ast:n}=await ts(e,t);return t.cursorOffset>=0&&(t={...t,...ss(n,t)}),ns(n,t)}),printDocToString:Us(async function(e,t){return fr(e,await Ji(t))})},js=Object.defineProperty;((e,t)=>{for(var n in t)js(e,n,{get:t[n],enumerable:!0})})({},{builders:()=>Jo,printer:()=>ea,utils:()=>ta});var zs="string",Xs="array",Ks="cursor",Ys="indent",qs="align",Qs="trim",Zs="group",Js="fill",eo="if-break",to="indent-if-break",no="line-suffix",ro="line-suffix-boundary",io="line",so="label",oo="break-parent",ao=new Set([Ks,Ys,qs,Qs,Zs,Js,eo,to,no,ro,io,so,oo]),lo=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},uo=function(e){if("string"==typeof e)return zs;if(Array.isArray(e))return Xs;if(!e)return;const{type:t}=e;return ao.has(t)?t:void 0};var co=class extends Error{name="InvalidDocError";constructor(e){super(function(e){const t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(uo(e))throw new Error("doc is valid.");const n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;const r=(i=[...ao].map(e=>`'${e}'`),new Intl.ListFormat("en-US",{type:"disjunction"}).format(i));var i;return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},ho={},fo=function(e,t,n,r){const i=[e];for(;i.length>0;){const e=i.pop();if(e===ho){n(i.pop());continue}n&&i.push(e,ho);const s=uo(e);if(!s)throw new co(e);if(!1!==(null==t?void 0:t(e)))switch(s){case Xs:case Js:{const t=s===Xs?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case eo:i.push(e.flatContents,e.breakContents);break;case Zs:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case qs:case Ys:case to:case so:case no:i.push(e.contents);break;case zs:case Ks:case Qs:case ro:case io:case oo:break;default:throw new co(e)}}};function po(e,t){if("string"==typeof e)return t(e);const n=new Map;return function e(r){if(n.has(r))return n.get(r);const i=function(n){switch(uo(n)){case Xs:return t(n.map(e));case Js:return t({...n,parts:n.parts.map(e)});case eo:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case Zs:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case qs:case Ys:case to:case so:case no:return t({...n,contents:e(n.contents)});case zs:case Ks:case Qs:case ro:case io:case oo:return t(n);default:throw new co(n)}}(r);return n.set(r,i),i}(e)}function mo(e,t,n){let r=n,i=!1;return fo(e,function(e){if(i)return!1;const n=t(e);void 0!==n&&(i=!0,r=n)}),r}function go(e){return!(e.type!==Zs||!e.break)||!(e.type!==io||!e.hard)||e.type===oo||void 0}function Eo(e){if(e.length>0){const t=lo(!1,e,-1);t.expandedStates||t.break||(t.break="propagated")}return null}function vo(e){return e.type!==io||e.hard?e.type===eo?e.flatContents:e:e.soft?"":" "}function Co(e){for(e=[...e];e.length>=2&&lo(!1,e,-2).type===io&&lo(!1,e,-1).type===oo;)e.length-=2;if(e.length>0){const t=Do(lo(!1,e,-1));e[e.length-1]=t}return e}function Do(e){switch(uo(e)){case Ys:case to:case Zs:case no:case so:{const t=Do(e.contents);return{...e,contents:t}}case eo:return{...e,breakContents:Do(e.breakContents),flatContents:Do(e.flatContents)};case Js:return{...e,parts:Co(e.parts)};case Xs:return Co(e);case zs:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return t{},_o=Ao,yo=Ao,bo=Ao;function To(e){return _o(e),{type:Ys,contents:e}}function Ro(e,t){return _o(t),{type:qs,contents:t,n:e}}function xo(e,t={}){return _o(e),yo(t.expandedStates,!0),{type:Zs,id:t.id,contents:e,break:Boolean(t.shouldBreak),expandedStates:t.expandedStates}}var wo={type:ro},Fo={type:oo},No={type:Qs},Lo={type:io,hard:!0},Oo={type:io,hard:!0,literal:!0},Io={type:io},ko={type:io,soft:!0},Mo=[Lo,Fo],Po=[Oo,Fo],Bo={type:Ks};function Uo(e,t){_o(e),yo(t);const n=[];for(let r=0;r{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Go=e=>{return!(12288===(t=e)||t>=65281&&t<=65376||t>=65504&&t<=65510||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e));var t},Vo=/[^\x20-\x7F]/u,Wo=function(e){if(!e)return 0;if(!Vo.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(const n of e){const e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=Go(e)?1:2)}return t},Ho=Symbol("MODE_BREAK"),jo=Symbol("MODE_FLAT"),zo=Symbol("cursor"),Xo=Symbol("DOC_FILL_PRINTED_LENGTH");function Ko(e,t){return qo(e,{type:"indent"},t)}function Yo(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?qo(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:qo(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function qo(e,t,n){const r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t];let i="",s=0,o=0,a=0;for(const e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function Qo(e){let t=0,n=0,r=e.length;e:for(;r--;){const i=e[r];if(i!==zo)for(let n=i.length-1;n>=0;n--){const s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(zo);return t}function Zo(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length;const a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}const{mode:e,doc:u}=a.pop(),c=uo(u);switch(c){case zs:l.push(u),n-=Wo(u);break;case Xs:case Js:{const t=c===Xs?u:u.parts,n=u[Xo]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case Ys:case qs:case to:case so:a.push({mode:e,doc:u.contents});break;case Qs:n+=Qo(l);break;case Zs:{if(s&&u.break)return!1;const t=u.break?Ho:e,n=u.expandedStates&&t===Ho?lo(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case eo:{const t=(u.groupId?i[u.groupId]||jo:e)===Ho?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case io:if(e===Ho||u.hard)return!0;u.soft||(l.push(" "),n--);break;case no:r=!0;break;case ro:if(r)return!1}}return!1}var Jo={join:Uo,line:Io,softline:ko,hardline:Mo,literalline:Po,group:xo,conditionalGroup:function(e,t){return xo(e[0],{...t,expandedStates:e})},fill:function(e){return bo(e),{type:Js,parts:e}},lineSuffix:function(e){return _o(e),{type:no,contents:e}},lineSuffixBoundary:wo,cursor:Bo,breakParent:Fo,ifBreak:function(e,t="",n={}){return _o(e),""!==t&&_o(t),{type:eo,breakContents:e,flatContents:t,groupId:n.groupId}},trim:No,indent:To,indentIfBreak:function(e,t){return _o(e),{type:to,contents:e,groupId:t.groupId,negate:t.negate}},align:Ro,addAlignmentToDoc:function(e,t,n){_o(e);let r=e;if(t>0){for(let e=0;ee},ea={printDocToString:function(e,t){const n={},r=t.printWidth,i=function(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}(t.endOfLine);let s=0;const o=[{ind:{value:"",length:0,queue:[]},mode:Ho,doc:e}],a=[];let l=!1;const u=[];let c=0;for(function(e){const t=new Set,n=[];fo(e,function(e){if(e.type===oo&&Eo(n),e.type===Zs){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===Zs&&n.pop().break&&Eo(n)},!0)}(e);o.length>0;){const{ind:e,mode:h,doc:d}=o.pop();switch(uo(d)){case zs:{const e="\n"!==i?$o(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=Wo(e));break}case Xs:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case Ks:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(zo),c++;break;case Ys:o.push({ind:Ko(e,t),mode:h,doc:d.contents});break;case qs:o.push({ind:Yo(e,d.n,t),mode:h,doc:d.contents});break;case Qs:s-=Qo(a);break;case Zs:switch(h){case jo:if(!l){o.push({ind:e,mode:d.break?Ho:jo,doc:d.contents});break}case Ho:{l=!1;const t={ind:e,mode:jo,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&Zo(t,o,i,a,n))o.push(t);else if(d.expandedStates){const t=lo(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:Ho,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:Ho,doc:t});break}{const t=d.expandedStates[r],s={ind:e,mode:jo,doc:t};if(Zo(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:Ho,doc:d.contents});break}}d.id&&(n[d.id]=lo(!1,o,-1).mode);break;case Js:{const t=r-s,i=d[Xo]??0,{parts:a}=d,l=a.length-i;if(0===l)break;const c=a[i+0],f=a[i+1],p={ind:e,mode:jo,doc:c},m={ind:e,mode:Ho,doc:c},g=Zo(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}const E={ind:e,mode:jo,doc:f},v={ind:e,mode:Ho,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}const C=a[i+2],D={ind:e,mode:h,doc:{...d,[Xo]:i+2}};Zo({ind:e,mode:jo,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case eo:case to:{const t=d.groupId?n[d.groupId]:h;if(t===Ho){const t=d.type===eo?d.breakContents:d.negate?d.contents:To(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===jo){const t=d.type===eo?d.flatContents:d.negate?To(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case no:u.push({ind:e,mode:h,doc:d.contents});break;case ro:u.length>0&&o.push({ind:e,mode:h,doc:Lo});break;case io:switch(h){case jo:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case Ho:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=Qo(a),a.push(i+e.value),s=e.length)}break;case so:o.push({ind:e,mode:h,doc:d.contents});break;case oo:break;default:throw new co(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}const h=a.indexOf(zo);if(-1!==h){const e=a.indexOf(zo,h+1);if(-1===e)return{formatted:a.filter(e=>e!==zo).join("")};const t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}},ta={willBreak:function(e){return mo(e,go,!1)},traverseDoc:fo,findInDoc:mo,mapDoc:po,removeLines:function(e){return po(e,vo)},stripTrailingHardline:function(e){return Do(function(e){return po(e,e=>function(e){switch(uo(e)){case Js:if(e.parts.every(e=>""===e))return"";break;case Zs:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===Zs&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case qs:case Ys:case to:case no:if(!e.contents)return"";break;case eo:if(!e.flatContents&&!e.breakContents)return"";break;case Xs:{const t=[];for(const n of e){if(!n)continue;const[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof lo(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case zs:case Ks:case Qs:case ro:case io:case so:case oo:break;default:throw new co(e)}return e}(e))}(e))},replaceEndOfLine:function(e,t=Po){return po(e,e=>"string"==typeof e?Uo(t,e.split("\n")):e)},canBreak:function(e){return mo(e,So,!1)}};function na(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}class ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class ia extends ra{constructor(e){super([]),this.idx=1,Object.assign(this,ma(e))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class sa extends ra{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ma(e))}}class oa extends ra{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ma(e))}}class aa extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class la extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ua extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ca extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ha extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class da extends ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ma(e))}}class fa{constructor(e){this.idx=1,Object.assign(this,ma(e))}accept(e){e.visit(this)}}function pa(e){function t(e){return e.map(pa)}if(e instanceof ia){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return"string"==typeof e.label&&(t.label=e.label),t}if(e instanceof oa)return{type:"Alternative",definition:t(e.definition)};if(e instanceof aa)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof la)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof ua)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ha)return{type:"RepetitionWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ca)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof da)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof fa){const t={type:"Terminal",name:e.terminalType.name,label:(n=e.terminalType,"string"==typeof(r=n).LABEL&&""!==r.LABEL?n.LABEL:n.name),idx:e.idx};"string"==typeof e.label&&(t.terminalLabel=e.label);const i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=i instanceof RegExp?i.source:i),t}if(e instanceof sa)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match");var n,r}function ma(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}class ga{visit(e){const t=e;switch(t.constructor){case ia:return this.visitNonTerminal(t);case oa:return this.visitAlternative(t);case aa:return this.visitOption(t);case la:return this.visitRepetitionMandatory(t);case ua:return this.visitRepetitionMandatoryWithSeparator(t);case ha:return this.visitRepetitionWithSeparator(t);case ca:return this.visitRepetition(t);case da:return this.visitAlternation(t);case fa:return this.visitTerminal(t);case sa:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Ea(e,t=[]){return!!(e instanceof aa||e instanceof ca||e instanceof ha)||(e instanceof da?e.definition.some(e=>Ea(e,t)):!(e instanceof ia&&t.includes(e))&&e instanceof ra&&(e instanceof ia&&t.push(e),e.definition.every(e=>Ea(e,t))))}function va(e){if(e instanceof ia)return"SUBRULE";if(e instanceof aa)return"OPTION";if(e instanceof da)return"OR";if(e instanceof la)return"AT_LEAST_ONE";if(e instanceof ua)return"AT_LEAST_ONE_SEP";if(e instanceof ha)return"MANY_SEP";if(e instanceof ca)return"MANY";if(e instanceof fa)return"CONSUME";throw Error("non exhaustive match")}class Ca{walk(e,t=[]){e.definition.forEach((n,r)=>{const i=e.definition.slice(r+1);if(n instanceof ia)this.walkProdRef(n,i,t);else if(n instanceof fa)this.walkTerminal(n,i,t);else if(n instanceof oa)this.walkFlat(n,i,t);else if(n instanceof aa)this.walkOption(n,i,t);else if(n instanceof la)this.walkAtLeastOne(n,i,t);else if(n instanceof ua)this.walkAtLeastOneSep(n,i,t);else if(n instanceof ha)this.walkManySep(n,i,t);else if(n instanceof ca)this.walkMany(n,i,t);else{if(!(n instanceof da))throw Error("non exhaustive match");this.walkOr(n,i,t)}})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);e.definition.forEach(e=>{const t=new oa({definition:[e]});this.walk(t,r)})}}function Da(e,t,n){return[new aa({definition:[new fa({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Sa(e){if(e instanceof ia)return Sa(e.referencedRule);if(e instanceof fa)return[e.terminalType];if(function(e){return e instanceof oa||e instanceof aa||e instanceof ca||e instanceof la||e instanceof ua||e instanceof ha||e instanceof fa||e instanceof sa}(e))return function(e){let t=[];const n=e.definition;let r,i=0,s=n.length>i,o=!0;for(;s&&o;)r=n[i],o=Ea(r),t=t.concat(Sa(r)),i+=1,s=n.length>i;return[...new Set(t)]}(e);if(function(e){return e instanceof da}(e))return function(e){const t=e.definition.map(e=>Sa(e));return[...new Set(t.flat())]}(e);throw Error("non exhaustive match")}const Aa="_~IN~_";class _a extends Ca{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=(i=e.referencedRule,s=e.idx,i.name+s+Aa+this.topProd.name);var i,s;const o=t.concat(n),a=Sa(new oa({definition:o}));this.follows[r]=a}}function ya(e){return e.charCodeAt(0)}function ba(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function Ta(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t],e[t]=!0}function Ra(e){if(void 0===e)throw Error("Internal Error - Should never get here!");return!0}function xa(){throw Error("Internal Error - Should never get here!")}function wa(e){return"Character"===e.type}const Fa=[];for(let e=ya("0");e<=ya("9");e++)Fa.push(e);const Na=[ya("_")].concat(Fa);for(let e=ya("a");e<=ya("z");e++)Na.push(e);for(let e=ya("A");e<=ya("Z");e++)Na.push(e);const La=[ya(" "),ya("\f"),ya("\n"),ya("\r"),ya("\t"),ya("\v"),ya("\t"),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya("\u2028"),ya("\u2029"),ya(" "),ya(" "),ya(" "),ya("\ufeff")],Oa=/[0-9a-fA-F]/,Ia=/[0-9]/,ka=/[1-9]/;class Ma{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}function Pa(e){console&&console.error&&console.error(`Error: ${e}`)}function Ba(e){console&&console.warn&&console.warn(`Warning: ${e}`)}let Ua={};const $a=new class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Ta(n,"global");break;case"i":Ta(n,"ignoreCase");break;case"m":Ta(n,"multiLine");break;case"u":Ta(n,"unicode");break;case"y":Ta(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":let t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}}Ra(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return xa()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;Ra(t)}if(!0!==e||void 0!==t)return Ra(t)?("?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t):void 0}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),Ra(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):xa()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ya("\n"),ya("\r"),ya("\u2028"),ya("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=Fa;break;case"D":e=Fa,t=!0;break;case"s":e=La;break;case"S":e=La,t=!0;break;case"w":e=Na;break;case"W":e=Na,t=!0}return Ra(e)?{type:"Set",value:e,complement:t}:xa()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ya("\f");break;case"n":e=ya("\n");break;case"r":e=ya("\r");break;case"t":e=ya("\t");break;case"v":e=ya("\v")}return Ra(e)?{type:"Character",value:e}:xa()}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:ya("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:ya(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:ya(this.popChar())}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const t=this.classAtom();if(t.type,wa(t)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,wa(n)){if(n.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};function Ga(e){const t=e.toString();if(Ua.hasOwnProperty(t))return Ua[t];{const e=$a.pattern(t);return Ua[t]=e,e}}const Va="Complement Sets are not supported for first char optimization",Wa='Unable to use "first char" lexer optimizations:\n';function Ha(e,t=!1){try{const t=Ga(e);return ja(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===Va)t&&Ba(`${Wa}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),Pa(`${Wa}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function ja(e,t,n){switch(e.type){case"Disjunction":for(let r=0;r{if("number"==typeof e)za(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)za(e,t,n);else{for(let e=r.from;e<=r.to&&e=ul){const e=r.from>=ul?r.from:ul,n=r.to,i=hl(e),s=hl(n);for(let e=i;e<=s;e++)t[e]=e}}}});break;case"Group":ja(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}const o=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===Ka(s)||"Group"!==s.type&&!1===o)break}break;default:throw Error("non exhaustive match!")}return Object.values(t)}function za(e,t,n){const r=hl(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=hl(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=hl(e.charCodeAt(0));t[n]=n}}}(e,t)}function Xa(e,t){return e.value.find(e=>{if("number"==typeof e)return t.includes(e);{const n=e;return void 0!==t.find(e=>n.from<=e&&e<=n.to)}})}function Ka(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(Array.isArray(e.value)?e.value.every(Ka):Ka(e.value))}class Ya extends Ma{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e);case"Lookbehind":return void this.visitLookbehind(e);case"NegativeLookbehind":return void this.visitNegativeLookbehind(e)}super.visitChildren(e)}}visitCharacter(e){this.targetCharCodes.includes(e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===Xa(e,this.targetCharCodes)&&(this.found=!0):void 0!==Xa(e,this.targetCharCodes)&&(this.found=!0)}}function qa(e,t){if(t instanceof RegExp){const n=Ga(t),r=new Ya(e);return r.visit(n),r.found}for(const n of t){const t=n.charCodeAt(0);if(e.includes(t))return!0}return!1}const Qa="PATTERN",Za="defaultMode",Ja="modes";const el=/[^\\][$]/,tl=/[^\\[][\^]|^\^/;function nl(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function rl(e){const t=e.PATTERN;if(t instanceof RegExp)return!1;if("function"==typeof t)return!0;if(Object.hasOwn(t,"exec"))return!0;if("string"==typeof t)return!1;throw Error("non exhaustive match")}function il(e){return"string"==typeof e&&1===e.length&&e.charCodeAt(0)}const sl={test:function(e){const t=e.length;for(let n=this.lastIndex;n"string"==typeof e?e.charCodeAt(0):e)}function ll(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const ul=256;let cl=[];function hl(e){return ee.CATEGORIES).flat().filter(Boolean);const e=n.filter(e=>!t.includes(e));t=t.concat(e),0===e.length?r=!1:n=e}return t}(e);!function(e){e.forEach(e=>{var t;Cl(e)||(gl[ml]=e,e.tokenTypeIdx=ml++),Dl(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Dl(e)||(e.CATEGORIES=[]),t=e,Object.hasOwn(null!=t?t:{},"categoryMatches")||(e.categoryMatches=[]),function(e){return Object.hasOwn(null!=e?e:{},"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})})}(t),function(e){e.forEach(e=>{vl([],e)})}(t),function(e){e.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(t=>{e.categoryMatches.push(gl[t].tokenTypeIdx)})})}(t),t.forEach(e=>{e.isParent=e.categoryMatches.length>0})}function vl(e,t){e.forEach(e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),t.CATEGORIES.forEach(n=>{const r=e.concat(t);r.includes(n)||vl(r,n)})}function Cl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}function Dl(e){return Object.hasOwn(null!=e?e:{},"CATEGORIES")}function Sl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}var Al;!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"}(Al||(Al={}));const _l={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:{buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i,s)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`},traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(_l);class yl{constructor(e,t=_l){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=Object.assign({},_l,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===_l.lineTerminatorsPattern)this.config.lineTerminatorsPattern=sl;else if(this.config.lineTerminatorCharacters===_l.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Array.isArray(e)?n={modes:{defaultMode:[...e]},defaultMode:Za}:(r=!1,n=Object.assign({},e))}),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){const t=[];return Object.hasOwn(e,Za)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+Za+"> property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(e,Ja)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(e,Ja)&&Object.hasOwn(e,Za)&&!Object.hasOwn(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${Za}: <${e.defaultMode}>which does not exist\n`,type:Al.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(e,Ja)&&Object.keys(e.modes).forEach(n=>{const r=e.modes[n];r.forEach((e,i)=>{void 0===e?t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:Al.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(e,"LONGER_ALT")&&(Array.isArray(e.LONGER_ALT)?e.LONGER_ALT:[e.LONGER_ALT]).forEach(i=>{void 0===i||r.includes(i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${e.name}> outside of mode <${n}>\n`,type:Al.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(function(e,t,n){const r=[];let i=!1;const s=Object.values(e.modes||{}).flat().filter(Boolean).filter(e=>e[Qa]!==yl.NA),o=al(n);return t&&s.forEach(e=>{const t=ol(e,o);if(!1!==t){const n=function(e,t){if(t.issue===Al.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Al.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else Object.hasOwn(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):qa(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:Al.NO_LINE_BREAKS_FLAGS}),r}(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},Object.entries(n.modes).forEach(([e,t])=>{n.modes[e]=t.filter(e=>void 0!==e)});const i=Object.keys(n.modes);if(Object.entries(n.modes).forEach(([e,n])=>{this.TRACE_INIT(`Mode: <${e}> processing`,()=>{if(this.modes.push(e),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e,t){let n=[];const r=function(e){const t=e.filter(e=>!Object.hasOwn(e,Qa));return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:Al.MISSING_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(e);n=n.concat(r.errors);const i=function(e){const t=e.filter(e=>{const t=e[Qa];return!(t instanceof RegExp||"function"==typeof t||Object.hasOwn(t,"exec")||"string"==typeof t)});return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Al.INVALID_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=e.filter(e=>e[Qa]instanceof RegExp);return t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return el.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return tl.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){return e.filter(e=>{const t=e[Qa];return t instanceof RegExp&&(t.multiline||t.global)}).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Al.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){const t=[];let n=e.map(n=>e.reduce((e,r)=>(n.PATTERN.source!==r.PATTERN.source||t.includes(r)||r.PATTERN===yl.NA||(t.push(r),e.push(r)),e),[]));return n=n.filter(Boolean),n.filter(e=>e.length>1).map(e=>{const t=e.map(e=>e.name);return{message:`The same RegExp pattern ->${e[0].PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:Al.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}(n)),t=t.concat(function(e){return e.filter(e=>e.PATTERN.test("")).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:Al.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}(n)),t}(s)),n=n.concat(function(e){const t=e.filter(e=>{if(!Object.hasOwn(e,"GROUP"))return!1;const t=e.GROUP;return t!==yl.SKIPPED&&t!==yl.NA&&!("string"==typeof t)});return t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Al.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}(s)),n=n.concat(function(e,t){return e.filter(e=>void 0!==e.PUSH_MODE&&!t.includes(e.PUSH_MODE)).map(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:Al.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}(s,t)),n=n.concat(function(e){const t=[],n=e.reduce((e,t,n)=>{const r=t.PATTERN;return r===yl.NA||("string"==typeof r?e.push({str:r,idx:n,tokenType:t}):r instanceof RegExp&&(i=r,void 0===[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(e=>-1!==i.source.indexOf(e)))&&e.push({str:r.source,idx:n,tokenType:t})),e;var i},[]);return e.forEach((e,r)=>{n.forEach(({str:n,idx:i,tokenType:s})=>{if(r${s.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:Al.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}})}),t}(s)),n}(n,i))}),0===this.lexerDefinitionErrors.length){let r;El(n),this.TRACE_INIT("analyzeTokenTypes",()=>{r=function(e,t){const n=(t=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()},t)).tracer;let r;n("initCharCodeToOptimizedIndexMap",()=>{!function(){if(0===cl.length){cl=new Array(65536);for(let e=0;e<65536;e++)cl[e]=e>255?255+~~(e/255):e}}()}),n("Reject Lexer.NA",()=>{r=e.filter(e=>e[Qa]!==yl.NA)});let i,s,o,a,l,u,c,h,d,f,p,m=!1;n("Transform Patterns",()=>{m=!1,i=r.map(e=>{const t=e[Qa];if(t instanceof RegExp){const e=t.source;return 1!==e.length||"^"===e||"$"===e||"."===e||t.ignoreCase?2!==e.length||"\\"!==e[0]||["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(e[1])?nl(t):e[1]:e}if("function"==typeof t)return m=!0,{exec:t};if("object"==typeof t)return m=!0,t;if("string"==typeof t){if(1===t.length)return t;{const e=t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return nl(new RegExp(e))}}throw Error("non exhaustive match")})}),n("misc mapping",()=>{s=r.map(e=>e.tokenTypeIdx),o=r.map(e=>{const t=e.GROUP;if(t!==yl.SKIPPED){if("string"==typeof t)return t;if(void 0===t)return!1;throw Error("non exhaustive match")}}),a=r.map(e=>{const t=e.LONGER_ALT;if(t)return Array.isArray(t)?t.map(e=>r.indexOf(e)):[r.indexOf(t)]}),l=r.map(e=>e.PUSH_MODE),u=r.map(e=>Object.hasOwn(e,"POP_MODE"))}),n("Line Terminator Handling",()=>{const e=al(t.lineTerminatorCharacters);c=r.map(e=>!1),"onlyOffset"!==t.positionTracking&&(c=r.map(t=>Object.hasOwn(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===ol(t,e)&&qa(e,t.PATTERN)))}),n("Misc Mapping #2",()=>{h=r.map(rl),d=i.map(il),f=r.reduce((e,t)=>{const n=t.GROUP;return"string"==typeof n&&n!==yl.SKIPPED&&(e[n]=[]),e},{}),p=i.map((e,t)=>({pattern:i[t],longerAlt:a[t],canLineTerminator:c[t],isCustom:h[t],short:d[t],group:o[t],push:l[t],pop:u[t],tokenTypeIdx:s[t],tokenType:r[t]}))});let g=!0,E=[];return t.safeMode||n("First Char Optimization",()=>{E=r.reduce((e,n,r)=>{if("string"==typeof n.PATTERN){const t=hl(n.PATTERN.charCodeAt(0));ll(e,t,p[r])}else if(Array.isArray(n.START_CHARS_HINT)){let t;n.START_CHARS_HINT.forEach(n=>{const i=hl("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,ll(e,i,p[r]))})}else if(n.PATTERN instanceof RegExp)if(n.PATTERN.unicode)g=!1,t.ensureOptimizations&&Pa(`${Wa}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=Ha(n.PATTERN,t.ensureOptimizations);0===i.length&&(g=!1),i.forEach(t=>{ll(e,t,p[r])})}else t.ensureOptimizations&&Pa(`${Wa}\tTokenType: <${n.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return e},[])}),{emptyGroups:f,patternIdxToConfig:p,charCodeToPatternIdxToConfig:E,hasCustom:m,canBeOptimized:g}}(n,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[e]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[e]=r.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[e]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}this.lexerDefinitionWarning.forEach(e=>{Ba(e.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(r&&(this.handleModes=()=>{}),!1===this.trackStartLines&&(this.computeNewColumn=e=>e),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=()=>{}),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const e=Object.entries(this.canModeBeOptimized).reduce((e,[t,n])=>(!1===n&&e.push(t),e),[]);if(t.ensureOptimizations&&e.length>0)throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Ua={}}),this.TRACE_INIT("toFastProperties",()=>{na(this)})})}tokenize(e,t=this.defaultMode){if(this.lexerDefinitionErrors.length>0){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,s,o,a,l,u,c,h,d,f,p,m,g;const E=e,v=E.length;let C=0,D=0;const S=this.hasCustom?0:Math.floor(e.length/10),A=new Array(S),_=[];let y=this.trackStartLines?1:void 0,b=this.trackStartLines?1:void 0;const T=function(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(!Array.isArray(r))throw Error("non exhaustive match");t[n]=[]}),t}(this.emptyGroups),R=this.trackStartLines,x=this.config.lineTerminatorsPattern;let w=0,F=[],N=[];const L=[],O=[];Object.freeze(O);let I=!1;const k=e=>{if(1===L.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);_.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{L.pop();const e=L.at(-1);F=this.patternIdxToConfig[e],N=this.charCodeToPatternIdxToConfig[e],w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}};function M(e){L.push(e),N=this.charCodeToPatternIdxToConfig[e],F=this.patternIdxToConfig[e],w=F.length,w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}let P;M.call(this,t);const B=this.config.recoveryEnabled;for(;Ca.length){a=s,c=s.length,l=u,P=t;break}}}break}}if(-1!==c){if(h=P.group,void 0!==h&&(a=null!==a?a:e.substring(C,C+c),d=P.tokenTypeIdx,f=this.createTokenInstance(a,C,d,P.tokenType,y,b,c),this.handlePayload(f,l),!1===h?D=this.addToken(A,D,f):T[h].push(f)),!0===R&&!0===P.canLineTerminator){let t,n,r=0;x.lastIndex=0;do{a=null!==a?a:e.substring(C,C+c),t=x.test(a),!0===t&&(n=x.lastIndex-1,r++)}while(!0===t);0!==r?(y+=r,b=c-n,this.updateTokenEndLineColumnLocation(f,h,n,r,y,b,c)):b=this.computeNewColumn(b,c)}else b=this.computeNewColumn(b,c);C+=c,this.handleModes(P,k,M,f)}else{const t=C,n=y,i=b;let s=!1===B;for(;!1===s&&C`Expecting ${Tl(e)?`--\x3e ${bl(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o="\nbut found: '"+t[0].image+"'";return r?s+r+o:s+`one of these possible Token sequences:\n${e.reduce((e,t)=>e.concat(t),[]).map(e=>`[${e.map(e=>bl(e)).join(", ")}]`).map((e,t)=>` ${t+1}. ${e}`).join("\n")}`+o},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",s="\nbut found: '"+t[0].image+"'";return n?i+n+s:i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map(e=>`[${e.map(e=>bl(e)).join(",")}]`).join(" ,")}>`+s}};Object.freeze(Bl);const Ul={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},$l={buildDuplicateFoundError(e,t){const n=e.name,r=t[0],i=r.idx,s=va(r),o=(a=r)instanceof fa?a.terminalType.name:a instanceof ia?a.nonTerminalName:"";var a;let l=`->${s}${i>0?i:""}<- ${o?`with argument: ->${o}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,"\n"),l},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=e.prefixPath.map(e=>bl(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=0===e.alternation.idx?"":e.alternation.idx,n=0===e.prefixPath.length;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule,\n`;return r+=n?"These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n":`<${e.prefixPath.map(e=>bl(e)).join(", ")}> may appears as a prefix path in all these alternatives.\n`,r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=va(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${t} --\x3e ${e.leftRecursionPath.map(e=>e.name).concat([t]).join(" --\x3e ")}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof sa?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class Gl extends ga{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:rc.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Vl extends Ca{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){0===this.ruleStack.length?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Wl extends Vl{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const e=t.concat(n),r=new oa({definition:e});this.possibleTokTypes=Sa(r),this.found=!0}}}class Hl extends Ca{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class jl extends Hl{walkMany(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}}class zl extends Hl{walkManySep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}}class Xl extends Hl{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}}class Kl extends Hl{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}}function Yl(e,t,n=[]){n=[...n];let r=[],i=0;function s(s){const o=Yl(s.concat(e.slice(i+1)),t,n);return r.concat(o)}for(;n.length{0!==e.definition.length&&(r=s(e.definition))}),r;if(!(t instanceof fa))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:e.slice(i)}),r}function ql(e,t,n,r){const i=[...n];i.push(e.name);const s=[...r];return s.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:s}}var Ql;function Zl(e){if(e instanceof aa||"Option"===e)return Ql.OPTION;if(e instanceof ca||"Repetition"===e)return Ql.REPETITION;if(e instanceof la||"RepetitionMandatory"===e)return Ql.REPETITION_MANDATORY;if(e instanceof ua||"RepetitionMandatoryWithSeparator"===e)return Ql.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ha||"RepetitionWithSeparator"===e)return Ql.REPETITION_WITH_SEPARATOR;if(e instanceof da||"Alternation"===e)return Ql.ALTERNATION;throw Error("non exhaustive match")}function Jl(e,t,n,r){const i=e.length,s=e.every(e=>e.every(e=>1===e.length));if(t)return function(t){const r=t.map(e=>e.GATE);for(let t=0;te.flat()).reduce((e,t,n)=>(t.forEach(t=>{t.tokenTypeIdx in e||(e[t.tokenTypeIdx]=n),t.categoryMatches.forEach(t=>{Object.hasOwn(e,t)||(e[t]=n)})}),e),{});return function(){const e=this.LA_FAST(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t1===e.length),i=e.length;if(r&&!n){const t=e.flat();if(1===t.length&&0===t[0].categoryMatches.length){const e=t[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===e}}{const e=t.reduce((e,t,n)=>(e[t.tokenTypeIdx]=!0,t.categoryMatches.forEach(t=>{e[t]=!0}),e),[]);return function(){const t=this.LA_FAST(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;nYl([e],1)),r=ru(n.length),i=n.map(e=>{const t={};return e.forEach(e=>{iu(e.partialPath).forEach(e=>{t[e]=!0})}),t});let s=n;for(let e=1;e<=t;e++){const n=s;s=ru(n.length);for(let o=0;o{iu(e.partialPath).forEach(e=>{i[o][e]=!0})})}}}}return r}function au(e,t,n,r){const i=new nu(e,Ql.ALTERNATION,r);return t.accept(i),ou(i.result,n)}function lu(e,t,n,r){const i=new nu(e,n);t.accept(i);const s=i.result,o=new tu(t,e,n).startWalking();return ou([new oa({definition:s}),new oa({definition:o})],r)}function uu(e,t){e:for(let n=0;ne.every(e=>e.every(e=>0===e.categoryMatches.length)))}function hu(e){return`${va(e)}_#_${e.idx}_#_${du(e)}`}function du(e){return e instanceof fa?e.terminalType.name:e instanceof ia?e.nonTerminalName:""}class fu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function pu(e,t,n,r=[]){const i=[],s=mu(t.definition);if(0===s.length)return[];{const t=e.name;s.includes(e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:rc.LEFT_RECURSION,ruleName:t});const o=r.concat([e]),a=s.filter(e=>!o.includes(e)).flatMap(t=>{const i=[...r];return i.push(t),pu(e,t,n,i)});return i.concat(a)}}function mu(e){let t=[];if(0===e.length)return t;const n=e[0];if(n instanceof ia)t.push(n.referencedRule);else if(n instanceof oa||n instanceof aa||n instanceof la||n instanceof ua||n instanceof ha||n instanceof ca)t=t.concat(mu(n.definition));else if(n instanceof da)t=n.definition.map(e=>mu(e.definition)).flat();else if(!(n instanceof fa))throw Error("non exhaustive match");const r=Ea(n),i=e.length>1;if(r&&i){const n=e.slice(1);return t.concat(mu(n))}return t}class gu extends ga{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}class Eu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}const vu="MismatchedTokenException",Cu="NoViableAltException",Du="EarlyExitException",Su="NotAllInputParsedException",Au=[vu,Cu,Du,Su];function _u(e){return Au.includes(e.name)}Object.freeze(Au);class yu extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class bu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=vu}}class Tu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Cu}}class Ru extends yu{constructor(e,t){super(e,t),this.name=Su}}class xu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Du}}const wu={},Fu="InRuleRecoveryException";class Nu extends Error{constructor(e){super(e),this.name=Fu}}function Lu(e,t,n,r,i,s,o){const a=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[a];if(void 0===l){const e=this.getCurrRuleFullName();l=new s(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[a]=l}let u=l.token,c=l.occurrence;const h=l.isEndOfRule;0===this.RULE_STACK_IDX&&h&&void 0===u&&(u=Ml,c=1),void 0!==u&&void 0!==c&&this.shouldInRepetitionRecoveryBeTried(u,c,o)&&this.tryInRepetitionRecovery(e,t,n,u)}const Ou=1024,Iu=1280,ku=1536;function Mu(e,t,n){return n|t|e}class Pu{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:tc.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(0===t.length){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return e.flatMap(e=>pu(e,e,$l))}validateEmptyOrAlternatives(e){return e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.slice(0,-1).flatMap((r,i)=>0===function(e,t,n){const r="EXIT_NONE_TERMINAL",i=[r],s="EXIT_ALTERNATIVE";let o=!1;const a=t.length,l=a-1-1,u=[],c=[];for(c.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});0!==c.length;){const e=c.pop();if(e===s){o&&c.at(-1).idx<=l&&c.pop();continue}const h=e.def,d=e.idx,f=e.ruleStack,p=e.occurrenceStack;if(0===h.length)continue;const m=h[0];if(m===r){const e={idx:d,def:h.slice(1),ruleStack:f.slice(0,-1),occurrenceStack:p.slice(0,-1)};c.push(e)}else if(m instanceof fa)if(d=0;e--){const t={idx:d,def:m.definition[e].definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p};c.push(t),c.push(s)}else if(m instanceof oa)c.push({idx:d,def:m.definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p});else{if(!(m instanceof sa))throw Error("non exhaustive match");c.push(ql(m,d,f,p))}}return u}([r],[],fl).length?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:rc.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}(e,$l))}validateAmbiguousAlternationAlternatives(e,t){return e.flatMap(e=>function(e,t,n){const r=new gu;e.accept(r);let i=r.alternations;i=i.filter(e=>!0!==e.ignoreAmbiguities);return i.flatMap(r=>{const i=r.idx,s=r.maxLookahead||t,o=au(i,e,s,r),a=function(e,t,n,r){const i=[];return e.reduce((n,r,s)=>(!0===t.definition[s].ignoreAmbiguities||r.forEach(r=>{const o=[s];e.forEach((e,n)=>{s!==n&&uu(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&o.push(n)}),o.length>1&&!uu(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]).map(e=>{const i=e.alts.map(e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}(o,r,e,n),l=function(e,t,n,r){const i=e.reduce((e,t,n)=>{const r=t.map(e=>({idx:n,path:e}));return e.concat(r)},[]);return i.flatMap(e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const s=e.idx,o=e.path;return i.filter(e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx{const n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}));var n,r}).map(e=>{const i=[e.idx+1,s+1],o=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})})}(o,r,e,n);return a.concat(l)})}(e,t,$l))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return e.forEach(e=>{const i=new Eu;e.accept(i),i.allProductions.forEach(i=>{const s=Zl(i),o=i.maxLookahead||t;if(0===lu(i.idx,e,s,o)[0].flat().length){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:rc.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}(e,t,$l)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,s){const o=au(e,t,n);return s(o,r,cu(o)?pl:fl,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Jl)}buildLookaheadForOptional(e){return function(e,t,n,r,i,s){const o=lu(e,t,i,n),a=cu(o)?pl:fl;return s(o[0],a,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Zl(e.prodType),eu)}}const Bu=new class extends ga{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function Uu(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset"function"==typeof e.GATE);return s.hasPredicates=o,n.definition.push(s),i.forEach(e=>{const t=new oa({definition:[]});s.definition.push(t),Object.hasOwn(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Object.hasOwn(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),Hu}function Zu(e){return 0===e?"":`${e}`}function Ju(e){if(e<0||e>zu){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${zu+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const ec=Pl(Ml,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ec);const tc=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Bl,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),nc=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var rc,ic,sc;!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(rc||(rc={}));class oc{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",()=>{na(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=function(e){const t=Object.assign({errMsgProvider:Ul},e),n={};return e.rules.forEach(e=>{n[e.name]=e}),function(e,t){const n=new Gl(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(0===n.length&&!1===this.skipValidations){const e=function(e){var t;const n=null!==(t=e.errMsgProvider)&&void 0!==t?t:$l;return function(e,t,n,r){const i=e.flatMap(e=>function(e,t){const n=new fu;e.accept(n);const r=n.allProductions,i=Object.groupBy(r,hu),s=Object.fromEntries(Object.entries(i).filter(([e,t])=>t.length>1));return Object.values(s).map(n=>{const r=n[0],i=t.buildDuplicateFoundError(e,n),s=va(r),o={message:i,type:rc.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:s,occurrence:r.idx},a=du(r);return a&&(o.parameter=a),o})}(e,n)),s=function(e,t,n){const r=[],i=t.map(e=>e.name);return e.forEach(e=>{const t=e.name;if(i.includes(t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:rc.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}(e,t,n),o=e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:rc.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}(e,n)),a=e.flatMap(t=>function(e,t,n,r){const i=[],s=t.reduce((t,n)=>n.name===e.name?t+1:t,0);if(s>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:rc.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n));return i.concat(s,o,a)}(e.rules,e.tokenTypes,n,e.grammarName)}({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:$l,grammarName:t}),n=function(e){return e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}).map(e=>Object.assign({type:rc.CUSTOM_LOOKAHEAD_VALIDATION},e))}({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(e,n)}}),0===this.definitionErrors.length&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const e=function(e){const t={};return e.forEach(e=>{const n=new _a(e).startWalking();Object.assign(t,n)}),t}(Object.values(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!oc.DEFER_DEFINITION_ERRORS_HANDLING&&0!==this.definitionErrors.length)throw e=this.definitionErrors.map(e=>e.message),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initGastRecorder(t),n.initPerformanceTracer(t),Object.hasOwn(t,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=Object.hasOwn(t,"skipValidations")?t.skipValidations:tc.skipValidations}}oc.DEFER_DEFINITION_ERRORS_HANDLING=!1,ic=oc,sc=[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:tc.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Lu)}getTokenToInsert(e){const t=Pl(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let a=!1;const l=this.LA_FAST(1);let u=this.LA_FAST(1);const c=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),n=new bu(t,l,this.LA(0));n.resyncedTokens=o.slice(0,-1),this.SAVE_ERROR(n)};for(;!a;){if(this.tokenMatcher(u,r))return void c();if(n.call(this))return c(),void e.apply(this,t);this.tokenMatcher(u,i)?a=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o))}this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA_FAST(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getNextPossibleTokenTypes(e){const t=e.ruleStack[0],n=this.getGAstProductions()[t];return new Wl(n,e).startWalking()}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new Nu("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(0===t.length)return!1;const n=this.LA_FAST(1);return void 0!==t.find(e=>this.tokenMatcher(n,e))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(t).includes(e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA_FAST(1),n=2;for(;;){const r=e.find(e=>fl(t,e));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(0===this.RULE_STACK_IDX)return wu;const e=this.currRuleShortName,t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK,n=this.RULE_STACK_IDX+1,r=new Array(n);for(let i=0;ithis.getFollowSetFromFollowKey(e)).flat()}getFollowSetFromFollowKey(e){if(e===wu)return[Ml];const t=e.ruleName+e.idxInCallingRule+Aa+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Ml)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA_FAST(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return t.slice(0,-1)}attemptInRepetitionRecovery(e,t,n,r,i,s,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){const e=this.RULE_STACK_IDX+1,t=new Array(e);for(let n=0;n{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:o}=function(e){Bu.reset(),e.accept(Bu);const t=Bu.dslMethods;return Bu.reset(),t}(e);t.forEach(t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${va(t)}${n}`,()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=Mu(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),n.forEach(t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,va(t))}),r.forEach(t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,va(t))}),i.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Ou,"RepetitionMandatory",t.maxLookahead,va(t))}),s.forEach(t=>{this.computeLookaheadFunc(e,t.idx,ku,"RepetitionMandatoryWithSeparator",t.maxLookahead,va(t))}),o.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Iu,"RepetitionWithSeparator",t.maxLookahead,va(t))})})})}computeLookaheadFunc(e,t,n,r,i,s){this.TRACE_INIT(`${s}${0===t?"":t}`,()=>{const s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=Mu(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,s)})}getKeyForAutomaticLookahead(e,t){return Mu(this.currRuleShortName,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:tc.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=$u,this.setNodeLocationFromNode=$u,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Uu,this.setNodeLocationFromNode=Uu,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{}}else this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{}}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA_FAST(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];var r,i,s;i=t,s=e,void 0===(r=n).children[s]?r.children[s]=[i]:r.children[s].push(i),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(void 0===this.baseCstVisitorConstructor){const e=function(e,t){const n=function(){};Gu(n,e+"BaseSemantics");const r={visit:function(e,t){if(Array.isArray(e)&&(e=e[0]),void 0!==e)return this[e.name](e.children,t)},validateVisitor:function(){const e=function(e,t){const n=function(e,t){return t.filter(t=>"function"==typeof e[t]==0).map(t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Wu.MISSING_METHOD,methodName:t})).filter(Boolean)}(e,t);return n}(this,t);if(0!==e.length){const t=e.map(e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(void 0===this.baseCstVisitorWithDefaultsConstructor){const e=function(e,t,n){const r=function(){};Gu(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return t.forEach(e=>{i[e]=Vu}),(r.prototype=i).constructor=r,r}(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):ec}LA_FAST(e){const t=this.currIdx+e;return this.tokVector[t]}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?ec:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=pl,this.subruleIdx=0,this.currRuleShortName=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(Array.isArray(e)){if(0===e.length)throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(Array.isArray(e))this.tokensMap=e.reduce((e,t)=>(e[t.name]=t,e),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(Sl)){const t=Object.values(e.modes).flat(),n=[...new Set(t)];this.tokensMap=n.reduce((e,t)=>(e[t.name]=t,e),{})}else{if("object"!=typeof e||null===e)throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=Object.assign({},e)}this.tokensMap.EOF=Ml;const n=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every(e=>{var t;return 0==(null===(t=e.categoryMatches)||void 0===t?void 0:t.length)});this.tokenMatcher=n?pl:fl,El(Object.values(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:nc.resyncEnabled,i=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:nc.recoveryValueFunc,s=this.ruleShortNameIdx<<12;let o;return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,o=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...t){this.onBeforeParse(e);try{return o.apply(this,t)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:t,coreRule:o})}invokeRuleCatch(e,t,n){const r=0===this.RULE_STACK_IDX,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(_u(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(Ou,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,Ou,e,Xl)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(ku,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Kl],t,ku,e,Kl)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let s=!0;for(;!0===i.call(this)&&!0===s;)s=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,jl,s)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(Iu,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,zl],t,Iu,e,zl)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,ku,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=Array.isArray(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX]),this.cstFinallyStateUpdate()}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.coreRule.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw _u(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA_FAST(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new bu(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===Fu?n:e}}}saveRecogState(){const e=this.errors,t=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);const t=e.RULE_STACK;for(let e=0;e=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX])}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=n,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ml)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let e=0;e${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:rc.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){var n;const r=null!==(n=e.coreRule)&&void 0!==n?n:e;return function(){this.isBackTrackingStack.push(1);const e=this.saveRecogState();try{return r.apply(this,t),!0}catch(e){if(_u(e))return!1;throw e}finally{this.reloadRecogState(e),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Object.values(this.gastProductionsCache).map(pa)}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:tc.errorMessageProvider}SAVE_ERROR(e){if(_u(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=lu(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],s=[];for(let e=1;e<=this.maxLookahead;e++)s.push(this.LA(e));const o=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:s,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new xu(o,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=au(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));const s=this.LA(0),o=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:s,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Tu(o,this.LA(1),s))}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const n=t>0?t:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return ec}topLevelRuleRecord(e,t){try{const n=new sa({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}}optionInternalRecord(e,t){return qu.call(this,aa,e,t)}atLeastOneInternalRecord(e,t){qu.call(this,la,t,e)}atLeastOneSepFirstInternalRecord(e,t){qu.call(this,ua,t,e,ju)}manyInternalRecord(e,t){qu.call(this,ca,t,e)}manySepFirstInternalRecord(e,t){qu.call(this,ha,t,e,ju)}orInternalRecord(e,t){return Qu.call(this,e,t)}subruleInternalRecord(e,t,n){if(Ju(t),!e||!Object.hasOwn(e,"ruleName")){const n=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=e.ruleName,s=new ia({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(s),this.outputCst?Yu:Hu}consumeInternalRecord(e,t,n){if(Ju(t),!Cl(e)){const n=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=new fa({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),Ku}},class{initPerformanceTracer(e){if(Object.hasOwn(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=tc.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()}}],sc.forEach(e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach(n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(ic.prototype,n,r):ic.prototype[n]=e.prototype[n]})});class ac extends oc{constructor(e,t=tc){const n=Object.assign({},t);n.outputCst=!1,super(e,n)}}function lc(e){return void 0!==e.lineNoCont?e.lineNoCont:e.startLine}class uc{visit(e){return e&&this[e.kind](e)}arraySpecifier(e){this.visit(e.size)}binaryExpression(e){this.visit(e.lhs),this.visit(e.rhs)}methodCall(e){this.visit(e.on),this.visit(e.functionCall)}functionCall(e){this.visit(e.callee);for(const t of e.args)this.visit(t)}arrayAccess(e){this.visit(e.on),this.visit(e.index)}translationUnit(e){for(const t of e.declarations)this.visit(t)}assignmentExpression(e){this.visit(e.lhs),this.visit(e.rhs)}fieldAccess(e){this.visit(e.on)}conditionalExpression(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}postfixExpression(e){this.visit(e.on)}commaExpression(e){this.visit(e.lhs),this.visit(e.rhs)}unaryExpression(e){this.visit(e.on)}functionDefinition(e){this.visit(e.returnType);for(const t of e.params)this.visit(t);this.visit(e.body)}functionPrototype(e){this.visit(e.returnType);for(const t of e.params)this.visit(t)}parameterDeclaration(e){this.visit(e.arraySpecifier),this.visit(e.typeSpecifier)}typeSpecifier(e){hc(e.typeSpecifierNonArray)&&this.visit(e.typeSpecifierNonArray),this.visit(e.arraySpecifier)}compoundStatement(e){for(const t of e.statements)this.visit(t)}returnStatement(e){this.visit(e.what)}continueStatement(e){}breakStatement(e){}discardStatement(e){}declarator(e){this.visit(e.arraySpecifier),this.visit(e.init)}doWhileStatement(e){this.visit(e.statement),this.visit(e.conditionExpression)}whileStatement(e){this.visit(e.conditionExpression),this.visit(e.statement)}forStatement(e){this.visit(e.initExpression),this.visit(e.conditionExpression),this.visit(e.loopExpression),this.visit(e.statement)}expressionStatement(e){this.visit(e.expression)}initDeclaratorListDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}precisionDeclaration(e){this.visit(e.typeSpecifierNoPrec)}selectionStatement(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}storageQualifier(e){}switchStatement(e){this.visit(e.initExpression);for(const t of e.cases)this.visit(t)}caseLabel(e){this.visit(e.case_)}caseBlock(e){this.visit(e.caseLabel);for(const t of e.statements)this.visit(t)}fullySpecifiedType(e){this.visit(e.typeQualifier),this.visit(e.typeSpecifier)}typeQualifier(e){this.visit(e.storageQualifier),this.visit(e.layoutQualifier)}structSpecifier(e){for(const t of e.declarations)this.visit(t)}layoutQualifier(e){}invariantDeclaration(e){}structDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}variableExpression(e){}constantExpression(e){}uniformBlock(e){this.visit(e.typeQualifier);for(const t of e.declarations)this.visit(t);this.visit(e.arraySpecifier)}ppDefine(e){this.visit(e.node)}ppDir(e){}ppExtension(e){}ppCall(e){}ppPragma(e){}}function cc(e){return"tokenType"in e}function hc(e){return"kind"in e}function dc(e,t){const n=e.split("\n"),r=t.startLine,i=t.endLine;return"./src/compiler.lambda:"+r+":"+(t.startColumn-1)+"\n"+n.map((e,t)=>[t+1,e]).slice(r-2,i+2).map(([e,n])=>{var s,o,a;return e>=r&&e<=i&&(s=n,o=6+(r===e?t.startColumn-1:0),a=6+(i===e?t.endColumn:n.length),n=s+"\n"+"-".repeat(o)+"^".repeat(a-o)),(""+e).padStart(5)+" "+n}).join("\n")}const fc=["active","asm","atomic_uint","attribute","cast","class","coherent","common","double","dvec2","dvec3","dvec4","enum","extern","external","filter","fixed","fvec2","fvec3","fvec4","goto","half","hvec2","hvec3","hvec4","iimage1D","iimage1DArray","iimage2D","iimage2DArray","iimage3D","iimageBuffer","iimageCube","image1D","image1DArray","image2D","image2DArray","image3D","imageBuffer","imageCube","inline","input","interface","isampler1D","isampler1DArray","isampler2DMS","isampler2DMSArray","isampler2DRect","isamplerBuffer","long","namespace","noinline","noperspective","output","partition","patch","public","readonly","resource","restrict","sample","sampler1D","sampler1DArray","sampler1DArrayShadow","sampler1DShadow","sampler2DMS","sampler2DMSArray","sampler2DRect","sampler2DRectShadow","sampler3DRect","samplerBuffer","short","sizeof","static","subroutine","superp","template","this","typedef","uimage1D","uimage1DArray","uimage2D","uimage2DArray","uimage3D","uimageBuffer","uimageCube","union","unsigned","usampler1D","usampler1DArray","usampler2DMS","usampler2DMSArray","usampler2DRect","usamplerBuffer","using","volatile","volatile","writeonly"];var pc;!function(e){e.ASSIGN_OP=kl({name:"ASSIGN_OP",pattern:yl.NA}),e.UNARY_OP=kl({name:"UNARY_OP",pattern:yl.NA}),e.POSTFIX_OP=kl({name:"POSTFIX_OP",pattern:yl.NA}),e.PRECISION_QUALIFIER=kl({name:"PRECISION_QUALIFIER",pattern:yl.NA}),e.INTERPOLATION_QUALIFIER=kl({name:"INTERPOLATION_QUALIFIER",pattern:yl.NA}),e.MULTIPLICATIVE_OP=kl({name:"MULTIPLICATIVE_OP",pattern:yl.NA}),e.ADDITIVE_OP=kl({name:"ADDITIVE_OP",pattern:yl.NA}),e.SHIFT_OP=kl({name:"SHIFT_OP",pattern:yl.NA}),e.RELATIONAL_OP=kl({name:"RELATIONAL_OP",pattern:yl.NA}),e.EQUALITY_OP=kl({name:"EQUALITY_OP",pattern:yl.NA}),e.PARAMETER_QUALIFIER=kl({name:"PARAMETER_QUALIFIER",pattern:yl.NA}),e.WHITESPACE=kl({name:"WHITESPACE",pattern:/\s+/,group:yl.SKIPPED}),e.LINE_COMMENT=kl({name:"LINE_COMMENT",pattern:/\/\/[^\r\n]*/,group:"COMMENTS"}),e.MULTILINE_COMMENT=kl({name:"MULTILINE_COMMENT",pattern:/\/\*[\s\S]*?\*\//,group:"COMMENTS"}),e.MULASSIGN=kl({name:"MULASSIGN",pattern:"*=",label:"'*='",categories:e.ASSIGN_OP}),e.DIVASSIGN=kl({name:"DIVASSIGN",pattern:"/=",label:"'/='",categories:e.ASSIGN_OP}),e.MODASSIGN=kl({name:"MODASSIGN",pattern:"%=",label:"'%='",categories:e.ASSIGN_OP}),e.ADDASSIGN=kl({name:"ADDASSIGN",pattern:"+=",label:"'+='",categories:e.ASSIGN_OP}),e.SUBASSIGN=kl({name:"SUBASSIGN",pattern:"-=",label:"'-='",categories:e.ASSIGN_OP}),e.LEFTASSIGN=kl({name:"LEFTASSIGN",pattern:"<<=",label:"'<<='",categories:e.ASSIGN_OP}),e.RIGHTASSIGN=kl({name:"RIGHTASSIGN",pattern:">>=",label:"'>>='",categories:e.ASSIGN_OP}),e.ANDASSIGN=kl({name:"ANDASSIGN",pattern:"&=",label:"'&='",categories:e.ASSIGN_OP}),e.XORASSIGN=kl({name:"XORASSIGN",pattern:"^=",label:"'^='",categories:e.ASSIGN_OP}),e.ORASSIGN=kl({name:"ORASSIGN",pattern:"|=",label:"'|='",categories:e.ASSIGN_OP}),e.INC_OP=kl({name:"INC_OP",pattern:"++",label:"'++'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.QUESTION=kl({name:"QUESTION",pattern:"?",label:"'?'"}),e.COLON=kl({name:"COLON",pattern:":",label:"':'"}),e.DEC_OP=kl({name:"DEC_OP",pattern:"--",label:"'--'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.AND_OP=kl({name:"AND_OP",pattern:"&&",label:"'&&'"}),e.XOR_OP=kl({name:"XOR_OP",pattern:"^^",label:"'^^'"}),e.OR_OP=kl({name:"OR_OP",pattern:"||",label:"'||'"}),e.LEFT_OP=kl({name:"LEFT_OP",pattern:"<<",label:"'<<'",categories:e.SHIFT_OP}),e.RIGHT_OP=kl({name:"RIGHT_OP",pattern:">>",label:"'>>'",categories:e.SHIFT_OP}),e.EQ_OP=kl({name:"EQ_OP",pattern:"==",label:"'=='",categories:e.EQUALITY_OP}),e.NE_OP=kl({name:"NE_OP",pattern:"!=",label:"'!='",categories:e.EQUALITY_OP}),e.LE_OP=kl({name:"LE_OP",pattern:"<=",label:"'<='",categories:e.RELATIONAL_OP}),e.GE_OP=kl({name:"GE_OP",pattern:">=",label:"'>='",categories:e.RELATIONAL_OP}),e.LEFT_ANGLE=kl({name:"LEFT_ANGLE",pattern:"<",label:"'<'",categories:e.RELATIONAL_OP}),e.RIGHT_ANGLE=kl({name:"RIGHT_ANGLE",pattern:">",label:"'>'",categories:e.RELATIONAL_OP}),e.PLUS=kl({name:"PLUS",pattern:"+",label:"'+'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.TILDE=kl({name:"TILDE",pattern:"~",label:"'~'",categories:e.UNARY_OP}),e.BANG=kl({name:"BANG",pattern:"!",label:"'!'",categories:e.UNARY_OP}),e.CARET=kl({name:"CARET",pattern:"^",label:"'^'"}),e.AMPERSAND=kl({name:"AND",pattern:"&",label:"'&'"}),e.VERTICAL_BAR=kl({name:"VERTICAL_BAR",pattern:"|",label:"'|'"}),e.SLASH=kl({name:"SLASH",pattern:"/",label:"'/'",categories:e.MULTIPLICATIVE_OP}),e.PERCENT=kl({name:"PERCENT",pattern:"%",label:"'%'",categories:e.MULTIPLICATIVE_OP}),e.STAR=kl({name:"STAR",pattern:"*",label:"'*'",categories:e.MULTIPLICATIVE_OP}),e.DASH=kl({name:"DASH",pattern:"-",label:"'-'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.COMMA=kl({name:"COMMA",pattern:",",label:"','"}),e.EQUAL=kl({name:"EQUAL",pattern:"=",label:"'='",categories:e.ASSIGN_OP}),e.LEFT_PAREN=kl({name:"LEFT_PAREN",pattern:"(",label:"'('"}),e.RIGHT_PAREN=kl({name:"RIGHT_PAREN",pattern:")",label:"')'"}),e.LEFT_BRACKET=kl({name:"LEFT_BRACKET",pattern:"[",label:"'['"}),e.RIGHT_BRACKET=kl({name:"RIGHT_BRACKET",pattern:"]",label:"']'"}),e.LEFT_BRACE=kl({name:"LEFT_BRACE",pattern:"{",label:"'{'"}),e.RIGHT_BRACE=kl({name:"RIGHT_BRACE",pattern:"}",label:"'}'"}),e.SEMICOLON=kl({name:"SEMICOLON",pattern:";",label:"';'"}),e.IDENTIFIER=kl({name:"IDENTIFIER",pattern:yl.NA}),e.NON_PP_IDENTIFIER=kl({name:"NON_PP_IDENTIFIER",pattern:/[a-z_]\w*/i,categories:e.IDENTIFIER}),e.PP=kl({name:"PP",pattern:yl.NA,categories:e.IDENTIFIER});const t=(t,n)=>kl({name:t,pattern:n,categories:e.PP,longer_alt:e.NON_PP_IDENTIFIER});e.DEFINE=t("DEFINE","define"),e.UNDEF=t("UNDEF","undef"),e.ENDIF=t("ENDIF","endif"),e.IFDEF=t("IFDEF","ifdef"),e.IFNDEF=t("IFNDEF","ifndef"),e.ELIF=t("ELIF","elif"),e.ERROR=t("ERROR","error"),e.VERSION=t("VERSION","version"),e.PRAGMA_DIRECTIVE=kl({name:"PRAGMA_DIRECTIVE",pattern:/#\s*pragma\s+[^\r\n]*/}),e.LINE=t("LINE","line"),e.EXTENSION=t("EXTENSION","extension"),e.INCLUDE=t("INCLUDE","include"),e.HASH_INCLUDE_MODULE=kl({name:"HASH_INCLUDE_MODULE",pattern:/#\s*include\s*<[\w\-./\\$@ ]+>/}),e.HASH=kl({name:"HASH",pattern:"#"}),e.KEYWORD=kl({name:"KEYWORD",pattern:yl.NA});const n=(t,n)=>kl({name:t,pattern:t.toLowerCase(),label:"'"+t.toLowerCase()+"'",longer_alt:e.NON_PP_IDENTIFIER,categories:n?[e.KEYWORD,n]:e.KEYWORD});e.CONST=n("CONST"),e.UNIFORM=n("UNIFORM"),e.LAYOUT=n("LAYOUT"),e.CENTROID=n("CENTROID"),e.FLAT=n("FLAT",e.INTERPOLATION_QUALIFIER),e.SMOOTH=n("SMOOTH",e.INTERPOLATION_QUALIFIER),e.BREAK=n("BREAK"),e.CONTINUE=n("CONTINUE"),e.DO=n("DO"),e.PRECISION=n("PRECISION"),e.FOR=n("FOR"),e.WHILE=n("WHILE"),e.SWITCH=n("SWITCH"),e.CASE=n("CASE"),e.DEFAULT=n("DEFAULT"),e.IF=n("IF"),e.ELSE=n("ELSE"),e.INVARIANT=n("INVARIANT"),e.INOUT=n("INOUT",e.PARAMETER_QUALIFIER),e.OUT=n("OUT",e.PARAMETER_QUALIFIER),e.VOID=n("VOID"),e.STRUCT=n("STRUCT"),e.DISCARD=n("DISCARD"),e.RETURN=n("RETURN"),e.LOWP=n("LOWP",e.PRECISION_QUALIFIER),e.MEDIUMP=n("MEDIUMP",e.PRECISION_QUALIFIER),e.HIGHP=n("HIGHP",e.PRECISION_QUALIFIER),e.CONSTANT=kl({name:"CONSTANT",pattern:yl.NA}),e.BASIC_TYPE=kl({name:"BASIC_TYPE",pattern:yl.NA});const r=t=>kl({name:t.toUpperCase(),pattern:t,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE});e.BOOL=r("bool"),e.INT=r("int"),e.FLOAT=r("float"),e.MAT2X3=r("mat2x3"),e.MAT2X4=r("mat2x4"),e.MAT2X2=kl({name:"mat2x2".toUpperCase(),pattern:/mat2(?:x2)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat2"}),e.MAT3X2=r("mat3x2"),e.MAT3X4=r("mat3x4"),e.MAT3X3=kl({name:"mat3x3".toUpperCase(),pattern:/mat3(?:x3)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat3"}),e.MAT4X2=r("mat4x2"),e.MAT4X3=r("mat4x3"),e.MAT4X4=kl({name:"MAT4X4",pattern:/mat4(?:x4)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat4"}),e.VEC2=r("vec2"),e.VEC3=r("vec3"),e.VEC4=r("vec4"),e.IVEC2=r("ivec2"),e.IVEC3=r("ivec3"),e.IVEC4=r("ivec4"),e.BVEC2=r("bvec2"),e.BVEC3=r("bvec3"),e.BVEC4=r("bvec4"),e.UINT=r("uint"),e.UVEC2=r("uvec2"),e.UVEC3=r("uvec3"),e.UVEC4=r("uvec4"),e.USAMPLERCUBE=r("usamplerCube"),e.USAMPLER3D=r("usampler3D"),e.USAMPLER2DARRAY=r("usampler2DArray"),e.USAMPLER2D=r("usampler2D"),e.SAMPLERCUBESHADOW=r("samplerCubeShadow"),e.SAMPLERCUBE=r("samplerCube"),e.SAMPLER3D=r("sampler3D"),e.SAMPLER2DSHADOW=r("sampler2DShadow"),e.SAMPLER2DARRAYSHADOW=r("sampler2DArrayShadow"),e.SAMPLER2DARRAY=r("sampler2DArray"),e.SAMPLER2D=r("sampler2D"),e.ISAMPLERCUBE=r("isamplerCube"),e.ISAMPLER3D=r("isampler3D"),e.ISAMPLER2DARRAY=r("isampler2DArray"),e.ISAMPLER2D=r("isampler2D"),e.IN=n("IN",e.PARAMETER_QUALIFIER),e.VARYING=n("VARYING"),e.ATTRIBUTE=n("ATTRIBUTE"),e.BOOLCONSTANT=kl({name:"BOOLCONSTANT",pattern:/true|false/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.CONSTANT}),e.FLOATCONSTANT=kl({name:"FLOATCONSTANT",pattern:/((\d+\.\d*|\.\d+)(e[+-]?\d+)?|\d+e[+-]?\d+)f?/i,categories:e.CONSTANT}),e.DOT=kl({name:"DOT",pattern:".",label:"'.'"}),e.UINTCONSTANT=kl({name:"UINTCONSTANT",pattern:/0x[\da-f]+u|\d+u/i,categories:e.CONSTANT}),e.INTCONSTANT=kl({name:"INTCONSTANT",pattern:/0x[\da-f]+|\d+/i,categories:e.CONSTANT}),e.STRING=kl({name:"STRING",pattern:/"([^"\\]+|\\")+"/})}(pc||(pc={}));const mc=Object.values(pc).filter(e=>e!==pc.NON_PP_IDENTIFIER).flatMap(e=>Array.isArray(e)?e:[e]);mc.push(pc.NON_PP_IDENTIFIER);const gc=new yl(mc,{ensureOptimizations:!1});new class extends uc{constructor(){super(...arguments),this.markError=()=>{}}eval(e,t,n){return this.isDefined=t,this.markError=n,super.visit(e)}constantExpression(e){if(e.const_.tokenType!==pc.INTCONSTANT)throw new Error("XX");return+e.const_.image}unaryExpression(e){switch(e.op.tokenType){case pc.NON_PP_IDENTIFIER:return+this.isDefined(e.on.var.image);case pc.DASH:return-this.visit(e.on);case pc.TILDE:return~this.visit(e.on);case pc.BANG:return+!this.visit(e.on);case pc.PLUS:return this.visit(e.on);default:throw new Error(e.op.tokenType.name)}}binaryExpression(e){const t=this.visit(e.lhs);switch(e.op.tokenType){case pc.AND_OP:return t&&this.visit(e.rhs);case pc.OR_OP:return t||this.visit(e.rhs);default:{const n=this.visit(e.rhs);return 0|function(e,t,n){switch(e){case pc.PLUS:return t+n;case pc.DASH:return t-n;case pc.STAR:return t*n;case pc.PERCENT:return t%n;case pc.SLASH:return t/n;case pc.LEFT_OP:return t<>n;case pc.EQ_OP:return t===n;case pc.NE_OP:return t!==n;case pc.LE_OP:return t<=n;case pc.GE_OP:return t>=n;case pc.LEFT_ANGLE:return tn;case pc.XOR_OP:return t!==n;case pc.AND_OP:return t&&n;case pc.OR_OP:return t||n;case pc.AMPERSAND:return t&n;case pc.CARET:return t^n;case pc.VERTICAL_BAR:return t|n;default:throw new Error}}(e.op.tokenType,t,n)}}}variableExpression(e){return this.markError("P0001",e.var,"undefined identifier "+e.var.image),0}};const Ec=new class extends ac{getTokensOnLine(){const e=[],t=lc(this.LA(0));let n;for(;lc(n=this.LA(1))===t;)e.push(n),this.SKIP_TOKEN();return e}constructor(){super(mc,{skipValidations:!0}),this.multiplicativeExpression=this.RR("multiplicativeExpression",()=>this.LEFT_ASSOC(this.preprocessing?this.ppUnaryExpression:this.unaryExpression,pc.MULTIPLICATIVE_OP)),this.additiveExpression=this.RR("additiveExpression",()=>this.LEFT_ASSOC(this.multiplicativeExpression,pc.ADDITIVE_OP)),this.shiftExpression=this.RR("shiftExpression",()=>this.LEFT_ASSOC(this.additiveExpression,pc.SHIFT_OP)),this.relationalExpression=this.RR("relationalExpression",()=>this.LEFT_ASSOC(this.shiftExpression,pc.RELATIONAL_OP)),this.equalityExpression=this.RR("equalityExpression",()=>this.LEFT_ASSOC(this.relationalExpression,pc.EQUALITY_OP)),this.andExpression=this.RR("andExpression",()=>this.LEFT_ASSOC(this.equalityExpression,pc.AMPERSAND)),this.exclusiveOrExpression=this.RR("exclusiveOrExpression",()=>this.LEFT_ASSOC(this.andExpression,pc.CARET)),this.inclusiveOrExpression=this.RR("inclusiveOrExpression",()=>this.LEFT_ASSOC(this.exclusiveOrExpression,pc.VERTICAL_BAR)),this.logicalAndExpression=this.RR("logicalAndExpression",()=>this.LEFT_ASSOC(this.inclusiveOrExpression,pc.AND_OP)),this.logicalXorExpression=this.RR("logicalXorExpression",()=>this.LEFT_ASSOC(this.logicalAndExpression,pc.XOR_OP)),this.logicalOrExpression=this.RR("logicalOrExpression",()=>this.LEFT_ASSOC(this.logicalXorExpression,pc.OR_OP)),this.assignmentExpression=this.RR("assignmentExpression",()=>{const e=this.SUBRULE(this.conditionalExpression);return this.OPTION(()=>{const t=this.CONSUME(pc.ASSIGN_OP),n=this.SUBRULE1(this.assignmentExpression);return{kind:"assignmentExpression",lhs:e,op:t,rhs:n}})??e}),this.expression=this.RR("expression",()=>{let e;return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.SUBRULE(this.assignmentExpression);return e=e?{kind:"commaExpression",lhs:e,rhs:t}:t}}),e}),this.conditionalExpression=this.RR("conditionalExpression",()=>{const e=this.SUBRULE1(this.logicalOrExpression);return this.OPTION(()=>({kind:"conditionalExpression",condition:e,QUESTION:this.CONSUME(pc.QUESTION),yes:this.SUBRULE2(this.expression),COLON:this.CONSUME(pc.COLON),no:this.SUBRULE3(this.assignmentExpression)}))??e}),this.switchStatement=this.RR("switchStatement",()=>{this.CONSUME(pc.SWITCH),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);this.CONSUME(pc.RIGHT_PAREN),this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.caseBlock))),this.CONSUME(pc.RIGHT_BRACE),{kind:"switchStatement",initExpression:e,cases:t}}),this.caseBlock=this.RR("caseBlock",()=>{const e=this.SUBRULE(this.caseLabel),t=[];return this.MANY1(()=>t.push(this.SUBRULE(this.statement))),{kind:"caseBlock",caseLabel:e,statements:t}}),this.jumpStatement=this.RR("jumpStatement",()=>{const e=this.OR([{ALT:()=>(this.CONSUME(pc.CONTINUE),{kind:"continueStatement"})},{ALT:()=>(this.CONSUME(pc.BREAK),{kind:"breakStatement"})},{ALT:()=>(this.CONSUME(pc.DISCARD),{kind:"discardStatement"})},{ALT:()=>(this.CONSUME(pc.RETURN),{kind:"returnStatement",what:this.OPTION(()=>this.SUBRULE(this.expression))})}]);return this.CONSUME(pc.SEMICOLON),e}),this.primaryExpression=this.RR("primaryExpression",()=>this.OR([{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),e}},{ALT:()=>({kind:"variableExpression",var:this.CONSUME(pc.IDENTIFIER)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.CONSTANT)})}])),this.constantExpression=this.RR("constantExpression",()=>this.SUBRULE(this.conditionalExpression)),this.layoutQualifier=this.RR("layoutQualifier",()=>{this.CONSUME(pc.LAYOUT),this.CONSUME(pc.LEFT_PAREN);const e=[];return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.CONSUME(pc.IDENTIFIER);let n;this.OPTION(()=>{this.CONSUME(pc.EQUAL),n=this.OR([{ALT:()=>this.CONSUME(pc.INTCONSTANT)},{ALT:()=>this.CONSUME(pc.UINTCONSTANT)}])}),e.push({IDENTIFIER:t,init:n})}}),this.CONSUME(pc.RIGHT_PAREN),{kind:"layoutQualifier",layoutQualifierIds:e}}),this.storageQualifier=this.RR("storageQualifier",()=>{let e,t,n,r,i,s,o;return this.OR([{ALT:()=>e=this.CONSUME(pc.CONST)},{ALT:()=>{t=this.OPTION(()=>this.CONSUME(pc.CENTROID)),this.OR9([{ALT:()=>n=this.CONSUME(pc.IN)},{ALT:()=>r=this.CONSUME(pc.OUT)},{ALT:()=>s=this.CONSUME(pc.VARYING)},{ALT:()=>o=this.CONSUME(pc.ATTRIBUTE)}])}},{ALT:()=>i=this.CONSUME(pc.UNIFORM)}]),{kind:"storageQualifier",CONST:e,CENTROID:t,IN:n,OUT:r,VARYING:s,ATTRIBUTE:o,UNIFORM:i}}),this.typeQualifier=this.RR("typeQualifier",()=>{let e,t,n,r;return this.OR([{ALT:()=>e=this.SUBRULE(this.storageQualifier)},{ALT:()=>{t=this.SUBRULE1(this.layoutQualifier),e=this.OPTION1(()=>this.SUBRULE2(this.storageQualifier))}},{ALT:()=>{n=this.CONSUME(pc.INTERPOLATION_QUALIFIER),e=this.OPTION2(()=>this.SUBRULE3(this.storageQualifier))}},{ALT:()=>{r=this.CONSUME(pc.INVARIANT),n=this.OPTION3(()=>this.CONSUME1(pc.INTERPOLATION_QUALIFIER)),e=this.SUBRULE7(this.storageQualifier)}}]),{kind:"typeQualifier",storageQualifier:e,layoutQualifier:t,interpolationQualifier:n,invariantQualifier:r}}),this.precisionQualifier=this.RR("precisionQualifier",()=>this.CONSUME(pc.PRECISION_QUALIFIER)),this.arraySpecifier=this.RR("arraySpecifier",()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.OPTION3(()=>this.SUBRULE(this.constantExpression));return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arraySpecifier",size:e}}),this.typeSpecifierNonArray=this.RR("typeSpecifierNonArray",()=>this.OR([{ALT:()=>this.CONSUME(pc.BASIC_TYPE)},{ALT:()=>this.CONSUME(pc.VOID)},{ALT:()=>this.SUBRULE(this.structSpecifier)},{ALT:()=>this.CONSUME(pc.IDENTIFIER)}])),this.typeSpecifierNoPrec=this.RR("typeSpecifierNoPrec",()=>{const e=this.SUBRULE(this.typeSpecifierNonArray);return{kind:"typeSpecifier",precisionQualifier:void 0,arraySpecifier:this.OPTION1(()=>this.SUBRULE(this.arraySpecifier)),typeSpecifierNonArray:e}}),this.functionCall=this.RR("functionCall",()=>{const e=this.SUBRULE(this.typeSpecifierNoPrec);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({DEF:()=>t.push(this.SUBRULE(this.assignmentExpression)),SEP:pc.COMMA}),this.CONSUME(pc.RIGHT_PAREN),{kind:"functionCall",callee:e,args:t}}),this.functionCallHeader=this.RULE("functionCallHeader",()=>{this.SUBRULE(this.typeSpecifierNoPrec),this.CONSUME(pc.LEFT_PAREN)}),this.postfixExpression=this.RR("postfixExpression",()=>{const e=this.LA(1);let t=this.OR1([{GATE:this.BACKTRACK(this.functionCallHeader),ALT:()=>this.SUBRULE1(this.functionCall)},{ALT:()=>this.SUBRULE(this.primaryExpression)}]);return this.MANY(()=>{t=this.OR2([{ALT:()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arrayAccess",on:t,index:e}}},{ALT:()=>{this.CONSUME1(pc.DOT);const e=this.SUBRULE2(this.functionCall);return{kind:"methodCall",on:t,functionCall:e}}},{ALT:()=>{this.CONSUME2(pc.DOT);const e=this.CONSUME(pc.IDENTIFIER);return{kind:"fieldAccess",on:t,field:e}}},{ALT:()=>{const e=this.CONSUME(pc.POSTFIX_OP);return{kind:"postfixExpression",on:t,op:e}}}]),this.FINALIZE(t,e)}),t}),this.unaryExpression=this.RR("unaryExpression",()=>this.OR([{ALT:()=>this.SUBRULE1(this.postfixExpression)},{ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.UNARY_OP),on:this.SUBRULE2(this.unaryExpression)})}])),this.ppUnaryExpression=this.RR("ppUnaryExpression",()=>this.OR([{GATE:()=>this.LA(1).tokenType===pc.NON_PP_IDENTIFIER&&"defined"===this.LA(1).image,ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.IDENTIFIER),on:{kind:"variableExpression",var:this.OR1([{ALT:()=>this.SUBRULE(this.ppIdentifier)},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE1(this.ppIdentifier);return this.CONSUME(pc.RIGHT_PAREN),e}}])}})},{ALT:()=>({kind:"unaryExpression",op:this.OR2([{ALT:()=>this.CONSUME(pc.PLUS)},{ALT:()=>this.CONSUME(pc.DASH)},{ALT:()=>this.CONSUME(pc.TILDE)},{ALT:()=>this.CONSUME(pc.BANG)}]),on:this.SUBRULE2(this.ppUnaryExpression)})},{ALT:()=>this.SUBRULE(this.ppPrimaryExpression)}])),this.ppPrimaryExpression=this.RR("ppPrimaryExpression",()=>this.OR([{ALT:()=>({kind:"variableExpression",var:this.SUBRULE(this.ppIdentifier)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.INTCONSTANT)})},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.ppConstantExpression);return this.CONSUME(pc.RIGHT_PAREN),e}}])),this.ppConstantExpression=this.RR("ppConstantExpression",()=>{try{return this.preprocessing=!0,this.LEFT_ASSOC(this.logicalAndExpression,pc.OR_OP)}finally{this.preprocessing=!1}}),this.typeSpecifier=this.RR("typeSpecifier",()=>{const e=this.OPTION(()=>this.SUBRULE(this.precisionQualifier)),t=this.SUBRULE(this.typeSpecifierNoPrec);return Object.assign({},t,{precisionQualifier:e})}),this.parameterDeclaration=this.RR("parameterDeclaration",()=>{const e=this.OPTION(()=>this.CONSUME(pc.CONST)),t=this.OPTION1(()=>this.CONSUME(pc.PARAMETER_QUALIFIER)),n=this.SUBRULE(this.typeSpecifier);let r,i;return this.OPTION2(()=>{r=this.CONSUME2(pc.IDENTIFIER),i=this.OPTION3(()=>this.SUBRULE(this.arraySpecifier))}),{kind:"parameterDeclaration",parameterTypeQualifier:e,pName:r,arraySpecifier:i,parameterQualifier:t,typeSpecifier:n}}),this.fullySpecifiedType=this.RR("fullySpecifiedType",()=>({kind:"fullySpecifiedType",typeQualifier:this.OPTION(()=>this.SUBRULE(this.typeQualifier)),typeSpecifier:this.SUBRULE(this.typeSpecifier)})),this.structDeclaration=this.RR("structDeclaration",()=>{const e=this.SUBRULE(this.fullySpecifiedType),t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME(pc.IDENTIFIER),arraySpecifier:this.OPTION(()=>this.SUBRULE(this.arraySpecifier)),init:void 0};return t.push(e),e})}),this.CONSUME(pc.SEMICOLON),{kind:"structDeclaration",fsType:e,declarators:t}}),this.structSpecifier=this.RR("structSpecifier",()=>{this.CONSUME(pc.STRUCT);const e=this.OPTION2(()=>this.CONSUME(pc.IDENTIFIER));this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),{kind:"structSpecifier",name:e,declarations:t}}),this.initializer=this.RR("initializer",()=>this.SUBRULE(this.assignmentExpression)),this.singleDeclaration=this.RULE("singleDeclaration",()=>this.OR([{ALT:()=>{this.SUBRULE(this.fullySpecifiedType),this.OPTION1(()=>{this.CONSUME1(pc.IDENTIFIER),this.OPTION2(()=>{this.CONSUME(pc.LEFT_BRACKET),this.OPTION3(()=>this.SUBRULE(this.constantExpression)),this.CONSUME(pc.RIGHT_BRACKET)}),this.OPTION4(()=>{this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)})})}},{ALT:()=>({kind:"invariantDeclaration",INVARIANT:this.CONSUME(pc.INVARIANT),IDENTIFIER:this.CONSUME2(pc.IDENTIFIER)})}])),this.initDeclaratorList=this.RR("initDeclaratorList",()=>this.SUBRULE(this.externalDeclaration,{ARGS:[!1,!1]})),this.expressionStatement=this.RR("expressionStatement",()=>{const e=this.OPTION(()=>this.SUBRULE(this.expression));return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:e}}),this.condition=this.RR("condition",()=>this.OR({MAX_LOOKAHEAD:4,DEF:[{GATE:this.BACKTRACK(this.singleDeclaration),ALT:()=>{const e=this.SUBRULE2(this.fullySpecifiedType),t=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.EQUAL),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:[{kind:"declarator",name:t,init:this.SUBRULE3(this.initializer),arraySpecifier:void 0}]}}},{ALT:()=>this.SUBRULE(this.expression)}]})),this.caseLabel=this.RR("caseLabel",()=>this.OR([{ALT:()=>{this.CONSUME(pc.CASE);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.COLON),{kind:"caseLabel",case_:e}}},{ALT:()=>(this.CONSUME2(pc.DEFAULT),this.CONSUME2(pc.COLON),{kind:"caseLabel",case_:void 0})}])),this.selectionStatement=this.RR("selectionStatement",()=>{this.CONSUME(pc.IF),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),{kind:"selectionStatement",condition:e,yes:this.SUBRULE2(this.statement,{ARGS:[!0]}),no:this.OPTION(()=>(this.CONSUME(pc.ELSE),this.SUBRULE3(this.statement,{ARGS:[!0]})))}}),this.statement=this.RR("statement",e=>this.OR([{ALT:()=>this.SUBRULE(this.ppDirective),IGNORE_AMBIGUITIES:!0},{ALT:()=>{const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:{kind:"variableExpression",var:e}}},IGNORE_AMBIGUITIES:!0},{GATE:this.BACKTRACK(this.expressionStatement),ALT:()=>this.SUBRULE(this.expressionStatement)},{ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.selectionStatement)},{ALT:()=>this.SUBRULE(this.switchStatement)},{ALT:()=>this.SUBRULE(this.iterationStatement)},{ALT:()=>this.SUBRULE(this.jumpStatement)},{ALT:()=>this.SUBRULE(this.compoundStatement,{ARGS:[!!e]})}])),this.compoundStatement=this.RR("compoundStatement",e=>{if("object"==typeof e)throw new Error;this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.statement))),this.CONSUME(pc.RIGHT_BRACE),{kind:"compoundStatement",statements:t,newScope:!!e}}),this.iterationStatement=this.RR("iterationStatement",()=>this.OR([{ALT:()=>{this.CONSUME(pc.WHILE),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.condition);return this.CONSUME(pc.RIGHT_PAREN),{kind:"whileStatement",conditionExpression:e,statement:this.SUBRULE(this.statement)}}},{ALT:()=>{this.CONSUME2(pc.DO);const e=this.SUBRULE2(this.statement,{ARGS:[!0]});this.CONSUME2(pc.WHILE),this.CONSUME2(pc.LEFT_PAREN);const t=this.SUBRULE2(this.expression);return this.CONSUME2(pc.RIGHT_PAREN),this.CONSUME2(pc.SEMICOLON),{kind:"doWhileStatement",statement:e,conditionExpression:t}}},{ALT:()=>{this.CONSUME3(pc.FOR),this.CONSUME3(pc.LEFT_PAREN);const e=this.OR3([{GATE:this.BACKTRACK(this.initDeclaratorList),ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.expressionStatement)}]),t=this.OPTION3(()=>this.SUBRULE3(this.condition));this.CONSUME4(pc.SEMICOLON);const n=this.OPTION4(()=>this.SUBRULE4(this.expression));return this.CONSUME3(pc.RIGHT_PAREN),{kind:"forStatement",initExpression:e,conditionExpression:t,loopExpression:n,statement:this.SUBRULE3(this.statement)}}}])),this.translationUnit=this.RR("translationUnit",()=>{const e=[];return this.AT_LEAST_ONE(()=>e.push(this.SUBRULE(this.externalDeclaration,{ARGS:[!0,!0]}))),{kind:"translationUnit",declarations:e}}),this.uniformBlock=this.RR("uniformBlock",()=>{const e=this.SUBRULE(this.typeQualifier),t=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_BRACE);const n=[];let r,i;return this.MANY(()=>n.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),this.OPTION(()=>{r=this.CONSUME1(pc.IDENTIFIER),i=this.OPTION1(()=>this.SUBRULE(this.arraySpecifier))}),this.CONSUME(pc.SEMICOLON),{kind:"uniformBlock",typeQualifier:e,blockName:t,declarations:n,namespace:r,arraySpecifier:i}}),this.uniformBlockHeader=this.RULE("uniformBlockHeader",()=>{this.OPTION(()=>this.SUBRULE(this.layoutQualifier)),this.CONSUME(pc.UNIFORM),this.CONSUME(pc.IDENTIFIER),this.CONSUME(pc.LEFT_BRACE)}),this.typeQualifierDeclaration=this.RR("typeQualifierDeclaration",()=>{const e=this.SUBRULE(this.typeQualifier);return this.CONSUME(pc.SEMICOLON),{kind:"typeQualifierDeclaration",typeQualifier:e}}),this.externalDeclaration=this.RR("externalDeclaration",(e,t)=>this.OR([{ALT:()=>this.SUBRULE(this.ppCall)},{ALT:()=>this.SUBRULE(this.ppDirective)},{GATE:this.BACKTRACK(this.typeQualifierDeclaration),ALT:()=>this.SUBRULE(this.typeQualifierDeclaration)},{GATE:e?this.BACKTRACK(this.uniformBlockHeader):()=>!1,ALT:()=>this.SUBRULE(this.uniformBlock)},{ALT:()=>{const e=this.SUBRULE(this.fullySpecifiedType);return this.OR2([{GATE:t?void 0:()=>!1,ALT:()=>{const t=this.CONSUME1(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const n=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>n.push(this.SUBRULE(this.parameterDeclaration))}),this.CONSUME(pc.RIGHT_PAREN),this.OR3([{ALT:()=>(this.CONSUME(pc.SEMICOLON),{kind:"functionPrototype",name:t,returnType:e,params:n})},{ALT:()=>{const r=this.SUBRULE(this.compoundStatement);return{kind:"functionDefinition",name:t,returnType:e,params:n,body:r}},IGNORE_AMBIGUITIES:!1}])}},{ALT:()=>{const t=[];return this.MANY_SEP2({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME3(pc.IDENTIFIER),arraySpecifier:this.OPTION5(()=>this.SUBRULE(this.arraySpecifier)),init:this.OPTION7(()=>(this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)))};return t.push(e),e})}),this.CONSUME2(pc.SEMICOLON),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:t}}}])}},{ALT:()=>{this.CONSUME(pc.PRECISION);const e=this.CONSUME(pc.PRECISION_QUALIFIER),t=this.SUBRULE(this.typeSpecifierNoPrec);return this.CONSUME3(pc.SEMICOLON),{kind:"precisionDeclaration",precisionQualifier:e,typeSpecifierNoPrec:t}}}])),this.ppDefine=this.RR("ppDefine",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.DEFINE);const e=this.CONSUME(pc.IDENTIFIER),t=this.LA(1).tokenType===pc.LEFT_PAREN&&e.endOffset+1===this.LA(1).startOffset,n={kind:"ppDefine",what:e,params:this.OPTION({GATE:()=>t,DEF:()=>{this.CONSUME(pc.LEFT_PAREN);const e=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>e.push(this.SUBRULE(this.ppIdentifier))}),this.CONSUME(pc.RIGHT_PAREN),e}}),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(n),n}),this.ppInclude=this.RR("ppInclude",()=>{let e="";return this.OR([{ALT:()=>{const t=this.CONSUME(pc.HASH_INCLUDE_MODULE);e=t.image.substring(t.image.indexOf("<"))}},{ALT:()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.INCLUDE),e=this.CONSUME(pc.STRING).image}}]),{kind:"ppInclude",what:e}}),this.ppCall=this.RR("ppCall",()=>{const e=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>{const e=[];this.MANY(()=>this.OR({DEF:[{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>e.push(this.CONSUME(pc.BASIC_TYPE))},{ALT:()=>e.push(this.CONSUME(pc.ASSIGN_OP))},{ALT:()=>e.push(this.CONSUME(pc.SHIFT_OP))},{ALT:()=>e.push(this.CONSUME(pc.CONSTANT))},{ALT:()=>e.push(this.CONSUME(pc.KEYWORD))},{ALT:()=>e.push(this.CONSUME2(pc.IDENTIFIER))}]})),t.push({tokens:e,node:void 0})},MAX_LOOKAHEAD:1}),this.CONSUME(pc.RIGHT_PAREN),{kind:"ppCall",callee:e,args:t}}),this.ppCallArg=this.RULE("ppCallArg",()=>{const e=[];return e.push(this.CONSUME(pc.LEFT_PAREN)),this.MANY(()=>this.OR([{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>(e.push(this.LA(1)),this.SKIP_TOKEN())}])),e.push(this.CONSUME(pc.RIGHT_PAREN)),e}),this.ppNone=this.RR("ppNone",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.ELSE)},{ALT:()=>this.CONSUME(pc.ENDIF)}]),tokens:[],node:void 0};return this.ppDefs.push(e),e}),this.ppMulti=this.RR("ppMulti",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IF)},{ALT:()=>this.CONSUME(pc.ELIF)},{ALT:()=>this.CONSUME(pc.ERROR)},{ALT:()=>this.CONSUME(pc.VERSION)},{ALT:()=>this.CONSUME(pc.LINE)}]),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(e),e}),this.ppPragma=this.RR("ppPragma",()=>({kind:"ppPragma",dir:this.CONSUME(pc.PRAGMA_DIRECTIVE)})),this.ppSingle=this.RR("ppSingle",()=>(this.CONSUME(pc.HASH),{kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IFDEF)},{ALT:()=>this.CONSUME(pc.IFNDEF)}]),tokens:[this.CONSUME(pc.IDENTIFIER)],node:void 0})),this.ppExtension=this.RR("ppExtension",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.EXTENSION);const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.COLON),{kind:"ppExtension",extension:e,behavior:this.CONSUME1(pc.IDENTIFIER)}}),this.ppDirective=this.RR("ppDirective",()=>this.OR([{ALT:()=>this.SUBRULE(this.ppDefine)},{ALT:()=>this.SUBRULE(this.ppExtension)},{ALT:()=>this.SUBRULE(this.ppNone)},{ALT:()=>this.SUBRULE(this.ppSingle)},{ALT:()=>this.SUBRULE(this.ppMulti)},{ALT:()=>this.SUBRULE(this.ppPragma)},{ALT:()=>this.SUBRULE(this.ppInclude)}])),this.ppIdentifier=this.RR("ppIdentifier",()=>this.OR([{ALT:()=>this.CONSUME(pc.IDENTIFIER)},{ALT:()=>this.CONSUME(pc.KEYWORD)},{ALT:()=>this.CONSUME(pc.BASIC_TYPE)}])),this.ppDefs=[],this.performSelfAnalysis()}reset(){super.reset(),this.ppDefs=[],this.backtracking=!1,this.preprocessing=!1}LEFT_ASSOC(e,t){const n=this.LA(1);let r=this.SUBRULE1(e);return this.MANY(()=>{const i=this.CONSUME(t),s=this.SUBRULE2(e);return r={kind:"binaryExpression",lhs:r,rhs:s,op:i,firstToken:n,lastToken:this.LA(0)},r}),r}ANNOTATE(e){return(...t)=>{const n=this.LA(1),r=e(...t);return r&&hc(r)&&!r.firstToken&&this.FINALIZE(r,n),r}}BACKTRACK(e,t){const n=super.BACKTRACK(e,t);return function(){try{return this.backtracking=!0,n.call(this)}finally{this.backtracking=!1}}}RR(e,t,n){return super.RULE(e,this.ANNOTATE(t),n)}FINALIZE(e,t){this.RECORDING_PHASE||this.backtracking||(e.firstToken=t,e.lastToken=this.LA(0))}isAtEof(){return this.LA(1).tokenType===Ml}};const{ll:{printDocToString:vc},LX:{indentIfBreak:Cc,group:Dc,indent:Sc,join:Ac,line:_c,softline:yc,hardline:bc,fill:Tc,lineSuffixBoundary:Rc}}=r,xc=new class extends uc{constructor(){super(...arguments),this.result=void 0}visit(e){if(!this.result){const t=this.result=[];return super.visit(e),this.result=void 0,t}e&&this.result.push(e)}};function wc(e){return(cc(e)?e:e.lastToken).endOffset+1}const Fc={"glsl-parser":{parse(e,t){const n=function(e){const t=function(e){const t=[];let n="",r=0,i=0;return{result:e.replace(/\\(\r\n|\n\r|\r|\n)(.*?)(?:(?=\\?[\r\n])|$)/g,(s,o,a,l)=>{r++,i+=function(e,t){let n=t;for(;n>=0&&"\r"!==e[n]&&"\n"!==e[n];)n--;return t-n-1}(e,l),t.push({originalOffset:l+1+o.length,newOffset:l-n.length,length:a.length,lineDiff:-r,columnDiff:i}),n+=" "+o;let u="";return e.length>l+s.length&&"\\"===e[l+s.length]||(u=n,n="",r=0,i=0),a+u}),changes:t}}(e),n=gc.tokenize(t.result);!function(e,t){if(t.errors.length)throw new Error("LEXER ERROR: "+t.errors.map(t=>t.message+":\n"+dc(e,{startLine:t.line,startColumn:t.column,endLine:t.line,endColumn:t.column+t.length})).join())}(t.result,n),function(e,t){let n=0;function r(e,t){const n=t.originalOffset-t.newOffset;e.startOffset>=t.newOffset&&(e.lineNoCont=e.startLine,e.startOffset+=n,e.startLine-=t.lineDiff,e.startColumn-=t.columnDiff),e.endOffset+=n,e.endLine-=t.lineDiff,e.endColumn-=t.columnDiff}for(const i of t){for(;e[n]&&e[n].endOffset0)throw new Error("PARSE ERROR: "+t.map(t=>t.message+"\n"+t.context.ruleStack.join(" > ")+"\n"+dc(e,t.token)).join("\n"))}(t.result,Ec.errors);const i=Ec.ppDefs;function s(e,t){Ec.input=e;const n=t(Ec);return Ec.isAtEof()&&0===Ec.errors.length?n:void 0}for(const e of i)e.node=s(e.tokens,e=>e.externalDeclaration(!0,!0))??s(e.tokens,e=>e.statement())??s(e.tokens,e=>e.expression());return r.comments=n.groups.COMMENTS,r}(e);return n.comments?.forEach(e=>e.value=JSON.stringify(e)),n},astFormat:"glsl-ast",locStart:function(e){return(cc(e)?e:e.firstToken).startOffset},locEnd:wc}};function Nc(e){switch(e){case pc.STAR:case pc.SLASH:case pc.PERCENT:return 4;case pc.PLUS:case pc.DASH:return 5;case pc.LEFT_OP:case pc.RIGHT_OP:return 6;case pc.LEFT_ANGLE:case pc.RIGHT_ANGLE:case pc.LE_OP:case pc.GE_OP:return 7;case pc.EQ_OP:case pc.NE_OP:return 8;case pc.AMPERSAND:return 9;case pc.CARET:return 10;case pc.VERTICAL_BAR:return 11;case pc.AND_OP:case pc.XOR_OP:return 12;case pc.OR_OP:return 13;case pc.COMMA:return 17;default:throw new Error}}function Lc(e,t){switch(e.kind){default:return 1;case"variableExpression":return t?.find(t=>t.image===e.var.image)?18:1;case"arrayAccess":case"functionCall":case"fieldAccess":case"postfixExpression":return 2;case"unaryExpression":return 3;case"binaryExpression":return Nc(e.op.tokenType);case"conditionalExpression":return 15;case"assignmentExpression":return 16;case"commaExpression":return 17}}function Oc(e,t){return t?["(",e,")"]:e}function Ic(e,t,n,r){const i="binaryExpression"===n.kind&&"binaryExpression"===n.lhs.kind&&Nc(n.lhs.op.tokenType)===Nc(n.op.tokenType)||"commaExpression"===n.kind&&"commaExpression"===n.lhs.kind,s="binaryExpression"===n.kind?n.op.tokenType:pc.COMMA;let o;return i?(o=e.call(e=>Ic(e,t,e.getValue(),r),"lhs"),o.push("commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))),o):[Oc(e.call(t,"lhs"),Lc(n.lhs,r)>Nc(s)),"commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))]}function kc(e,t,n){return"expressionStatement"!==e.kind||e.expression?"compoundStatement"===e.kind||n?[" ",t]:Sc([_c,t]):";"}function Mc(e,t){return vc(e,Object.assign({},t,{printWidth:t.printWidth-2})).formatted.trim().replace(/^.*(?=[\r\n])/gm,e=>e+" ".repeat(t.printWidth-2-e.length+1)+"\\")}function Pc(e){return"assignmentExpression"===e.kind}function Bc(e){return"assignmentExpression"===e.kind||"declarator"===e.kind}function Uc(e,t,n,r,i,s){const o=function(e,t,n){if(!n)return"only-left";const r=!Pc(n);return e.match(Pc,Bc,e=>!r||"expressionStatement"!==e.kind&&"initDeclaratorListDeclaration"!==e.kind)?r?"chain-tail":"chain":!r&&Pc(n.rhs)||(t.originalText,0)||"binaryExpression"===n.kind||"commaExpression"===n.kind||"conditionalExpression"===n.kind&&"binaryExpression"===n.condition.kind?"break-after-operator":"constantExpression"===n.kind?"never-break-after-operator":"fluid"}(e,t,s);switch(o){case"break-after-operator":return Dc([Dc(n),r,Dc(Sc([_c,i]))]);case"never-break-after-operator":return Dc([Dc(n),r," ",i]);case"fluid":{const e=Symbol("assignment");return Dc([Dc(n),r,Dc(Sc(_c),{id:e}),Rc,Cc(i,{groupId:e})])}case"chain":return[Dc(n),r,_c,i];case"chain-tail":return[Dc(n),r,Sc([_c,i])];case"only-left":return n;default:throw new Error}}const $c={"glsl-ast":{print(e,t,n){const r=t.inMacro,i=e.getValue();if(!i)return[];if(cc(i))return i.image;const s=t=>e.call(n,t);try{switch(i.kind){case"translationUnit":{const r=[];return e.each((e,i)=>{const s=e.getValue();r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc),r.push(bc)},"declarations"),r}case"precisionDeclaration":return["precision ",i.precisionQualifier.image," ",e.call(n,"typeSpecifierNoPrec"),";"];case"fullySpecifiedType":{const e=[];return i.typeQualifier&&e.push(s("typeQualifier")," "),e.push(s("typeSpecifier")),e}case"typeSpecifier":{const e=[];return i.precisionQualifier&&e.push(i.precisionQualifier.image," "),e.push(s("typeSpecifierNonArray")),i.arraySpecifier&&e.push(s("arraySpecifier")),e}case"typeQualifier":{const e=[];return i.invariantQualifier&&e.push("invariant"),i.interpolationQualifier&&e.push(i.interpolationQualifier.image),i.layoutQualifier&&e.push(s("layoutQualifier")),i.storageQualifier&&e.push(s("storageQualifier")),Ac(" ",e)}case"storageQualifier":{const t=[];return i.CONST&&t.push("const"),i.CENTROID&&e.getParentNode().interpolationQualifier?.tokenType!==pc.FLAT&&t.push("centroid"),i.IN&&t.push("in"),i.OUT&&t.push("out"),i.VARYING&&t.push("varying"),i.ATTRIBUTE&&t.push("attribute"),i.UNIFORM&&t.push("uniform"),Ac(" ",t)}case"functionPrototype":case"functionDefinition":return[Dc([s("returnType")," ",s("name"),"(",Sc([yc,Ac([",",_c],e.map(n,"params"))]),yc,")"]),"functionPrototype"===i.kind?";":[" ",s("body")]];case"parameterDeclaration":return[i.parameterTypeQualifier?[s("parameterTypeQualifier")," "]:"",i.parameterQualifier?.tokenType===pc.OUT||i.parameterQualifier?.tokenType===pc.INOUT?i.parameterQualifier?.image+" ":"",s("typeSpecifier")," ",s("pName"),s("arraySpecifier")];case"initDeclaratorListDeclaration":case"structDeclaration":{const t=e.map(n,"declarators"),r="forStatement"===e.getParentNode().kind,o=i.declarators.some(e=>e.init);return Dc([s("fsType"),0===t.length?"":" ",1===t.length?t:Dc(Sc(Ac([",",o&&!r?bc:_c],t))),";"])}case"declarator":{const n=s("arraySpecifier"),r=[i.name.image,n];return Uc(e,t,r," =",s("init"),i.init)}case"arraySpecifier":return Dc(["[",Sc([yc,s("size")]),yc,"]"]);case"arrayAccess":return[Oc(s("on"),Lc(i.on,r)>2),"[",s("index"),"]"];case"structSpecifier":{const r=[];return e.each((e,i,s)=>{const o=e.getValue();r.push(bc),r.push(n(e)),i!==s.length-1&&_s.isNextLineEmpty(t.originalText,o,wc)&&r.push(bc)},"declarations"),Dc(["struct",i.name?" "+i.name.image:""," {",Sc(r),bc,"}"])}case"compoundStatement":{const r=[],s=!!i.comments?.some(e=>!e.leading&&!e.trailing&&!e.printed);return e.each((e,i)=>{const s=e.getValue();0!==i&&r.push(bc),r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc)},"statements"),s&&e.each(e=>{const t=e.getValue();t.leading||t.trailing||(r.push(n(e)),t.printed=!0)},"comments"),Dc(["{",r.length?[Sc([bc,r]),bc]:"","}"])}case"returnStatement":return i.what?["return"," ",s("what"),";"]:"return;";case"breakStatement":return"break;";case"continueStatement":return"continue;";case"discardStatement":return"discard;";case"selectionStatement":{const e=[],t=kc(i.yes,s("yes"),!1),n=Dc(["if (",Dc([Sc([yc,s("condition")]),yc]),")",t]);if(e.push(n),i.no){const t=i.yes.comments?.some(e=>e.trailing&&e.tokenType===pc.LINE_COMMENT)||i.yes.comments?.findLast(e=>!e.leading&&!e.trailing)?.tokenType===pc.LINE_COMMENT,n="compoundStatement"===i.yes.kind&&!t;e.push(n?" ":bc),e.push("else",Dc(kc(i.no,s("no"),"selectionStatement"===i.no.kind)))}return e}case"forStatement":{const e=kc(i.statement,s("statement"),!1),t=!1,n=t?[t,yc]:"";return"expressionStatement"!==i.initExpression.kind||i.initExpression.expression||i.conditionExpression||i.loopExpression?[n,Dc(["for (",Dc([Sc([yc,s("initExpression"),_c,s("conditionExpression"),";",_c,s("loopExpression")]),yc]),")",e])]:[n,Dc(["for (;;)",e])]}case"whileStatement":{const e=kc(i.statement,s("statement"),!1);return["while (",Dc(s("conditionExpression")),")",e]}case"doWhileStatement":return["do ",s("statement")," while (",Dc(s("conditionExpression")),");"];case"functionCall":return function(t){const r=e.map(n,"args");let i,o;if(void 0===t.callee.arraySpecifier&&cc(t.callee.typeSpecifierNonArray)&&void 0!==(i=function(e){switch(e){case pc.MAT2X2:return[2,2];case pc.MAT2X3:return[2,3];case pc.MAT2X4:return[2,4];case pc.MAT3X2:return[3,2];case pc.MAT3X3:return[3,3];case pc.MAT3X4:return[3,4];case pc.MAT4X2:return[4,2];case pc.MAT4X3:return[4,3];case pc.MAT4X4:return[4,4];default:return}}(t.callee.typeSpecifierNonArray.tokenType))&&i[0]*i[1]===t.args.length){const e=t.args.every(e=>"constantExpression"===e.kind&&(e.const_.tokenType===pc.FLOATCONSTANT||e.const_.tokenType===pc.INTCONSTANT)||"unaryExpression"===e.kind&&(e.op.tokenType===pc.PLUS||e.op.tokenType===pc.DASH)&&"constantExpression"===e.on.kind&&(e.on.const_.tokenType===pc.FLOATCONSTANT||e.on.const_.tokenType===pc.INTCONSTANT));if(e){const e=[],n=[];let s=0,a=0;for(let i=0;i2),".",s("functionCall")];case"postfixExpression":return[Oc(s("on"),Lc(i.on,r)>2),s("op")];case"unaryExpression":return[s("op"),Oc(s("on"),Lc(i.on,r)>3)];case"assignmentExpression":{const n=s("lhs");return Uc(e,t,n," "+i.op.image,s("rhs"),i.rhs)}case"conditionalExpression":return[Oc(s("condition"),Lc(i.condition,r)>=15),Sc([_c,"? ",s("yes"),_c,": ",s("no")])];case"commaExpression":case"binaryExpression":{const t=Ic(e,n,i,r),s=e.getParentNode();if("selectionStatement"===s.kind||"whileStatement"===s.kind||"switchStatement"===s.kind||"doWhileStatement"===s.kind)return t;const o=()=>{const t=e.getParentNode();return!!t&&("functionCall"===t.kind&&"commaExpression"===i.kind||"binaryExpression"===t.kind&&((n=t.op.tokenType)===pc.CARET||n===pc.VERTICAL_BAR||n===pc.AMPERSAND));var n},a=e.getParentNode(1);if("returnStatement"===s.kind||"forStatement"===s.kind||"conditionalExpression"===s.kind&&"returnStatement"!==a.kind&&"functionCall"!==a.kind||"assignmentExpression"===s.kind||"declarator"===s.kind)return Dc(t);{const e=t.slice(0,1),n=t.slice(e.length);return Dc(Oc([...e,Sc(n)],o()))}}case"expressionStatement":return[s("expression"),";"];case"fieldAccess":return[Oc(s("on"),Lc(i.on,r)>2),".",s("field")];case"constantExpression":{const e=i.const_;return e.tokenType===pc.FLOATCONSTANT?function(e){const t=e.indexOf(".");return 0===t&&(e="0"+e),e=e.replace("E","e"),-1!==t&&(e=(e=(e=(e=e.replace(".e","e")).replace(/(?=4):Tc(Ac(_c,e.map(n,"tokens")))])]);return t.inMacro=void 0,Mc(r,t)}case"ppDir":return Mc(Dc(["#",i.dir.image," ",Sc(i.node?s("node"):Tc(Ac(_c,e.map(n,"tokens"))))]),t);case"ppPragma":return i.dir.image.replace(/^#\s+/,"#").replace(/^#pragma\s{2,}/,"#pragma ");case"ppCall":return Dc([i.callee.image,"(",Ac([",",_c],e.map((e,t,n)=>n[t].tokens.map(e=>e.image),"args")),")"]);case"ppInclude":return["#include ",i.what];case"ppExtension":return["#extension ",i.extension.image," : ",i.behavior.image];case"switchStatement":return["switch (",Dc([Sc([yc,s("initExpression")]),yc]),") {",i.cases.length?Sc([bc,Ac(bc,e.map(n,"cases"))]):"",bc,"}"];case"caseBlock":{const r=s("caseLabel"),i=[];return e.each((e,r)=>{const s=e.getValue();i.push(bc),i.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&i.push(bc)},"statements"),[r,Sc(i)]}case"caseLabel":return void 0===i.case_?"default:":["case ",s("case_"),":"];case"layoutQualifier":return["layout(",Ac(", ",i.layoutQualifierIds.map(e=>void 0===e.init?e.IDENTIFIER.image:[e.IDENTIFIER.image," = ",e.init.image])),")"];case"uniformBlock":return[s("typeQualifier")," ",i.blockName.image," {",Sc([bc,Ac(bc,e.map(n,"declarations"))]),bc,"};"];case"typeQualifierDeclaration":return[s("typeQualifier"),";"];default:throw new Error("unexpected n type "+i.kind+"\n"+JSON.stringify(i).substring(0,100))}}catch(e){throw console.error("error printing "+JSON.stringify(i).substring(0,100)+"\n"),e}},embed(e,t){const n=e.getValue();return!cc(n)||n.tokenType!==pc.LINE_COMMENT&&n.tokenType!==pc.MULTILINE_COMMENT?null:(e,t,n,r)=>{}},getVisitorKeys:(e,t)=>cc(e)?[]:Object.keys(e).filter(e=>!t.has(e)),getCommentChildNodes:e=>cc(e)?[]:xc.visit(e),canAttachComment:e=>!0,printComment:function(e,t){const n=e.getValue();return n.tokenType===pc.MULTILINE_COMMENT&&"*"===n.image[2]?"/**\n"+n.image.substring(3,n.image.length-2).split("\n").map(e=>" *"===e?"":e.startsWith(" * ")?e.substring(3):e).join("\n").trim().split("\n").map(e=>""===e?" *":" * "+e).join("\n")+"\n */":n.image},hasPrettierIgnore(e){const t=e.getValue();return(t&&hc(t)&&t.comments?.some(e=>/\/\/\s*prettier-ignore\b.*/.test(e.image)))??!1}}},Gc={parsers:Fc,printers:$c};function Vc(e){return e.replace(/^([^\n]*;)\n(?=(?:[A-Za-z_]\w*\s+)+[A-Za-z_]\w*\s*\()/gm,"$1\n\n").replace(/^}\n(?=\S)/gm,"}\n\n")}var Wc,Hc,jc=(Wc={program:function(e){return jc(e.program)+jc(e.wsEnd)},segment:function(e){return jc(e.blocks)},text:function(e){return jc(e.text)},literal:function(e){return jc(e.wsStart)+jc(e.literal)+jc(e.wsEnd)},identifier:function(e){return jc(e.identifier)+jc(e.wsEnd)},binary:function(e){return jc(e.left)+jc(e.operator)+jc(e.right)},group:function(e){return jc(e.lp)+jc(e.expression)+jc(e.rp)},unary:function(e){return jc(e.operator)+jc(e.expression)},unary_defined:function(e){return jc(e.operator)+jc(e.lp)+jc(e.identifier)+jc(e.rp)},int_constant:function(e){return jc(e.token)+jc(e.wsEnd)},elseif:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},if:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},ifdef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},ifndef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},else:function(e){return jc(e.token)+jc(e.wsEnd)+jc(e.body)},error:function(e){return jc(e.error)+jc(e.message)+jc(e.wsEnd)},undef:function(e){return jc(e.undef)+jc(e.identifier)+jc(e.wsEnd)},define:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.body)+jc(e.wsEnd)},define_arguments:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.lp)+jc(e.args)+jc(e.rp)+jc(e.body)+jc(e.wsEnd)},conditional:function(e){return jc(e.wsStart)+jc(e.ifPart)+jc(e.elseIfParts)+jc(e.elsePart)+jc(e.endif)+jc(e.wsEnd)},version:function(e){return jc(e.version)+jc(e.value)+jc(e.profile)+jc(e.wsEnd)},pragma:function(e){return jc(e.pragma)+jc(e.body)+jc(e.wsEnd)},line:function(e){return jc(e.line)+jc(e.value)+jc(e.wsEnd)},extension:function(e){return jc(e.extension)+jc(e.name)+jc(e.colon)+jc(e.behavior)+jc(e.wsEnd)}},Hc=function(e){return"string"==typeof e?e:null==e?"":Array.isArray(e)?e.map(Hc).join(""):e.type in Wc?Wc[e.type](e):"NO GENERATOR FOR ".concat(e.type)+e});const zc=jc;function Xc(e,t,n,r){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Xc.prototype),i.expected=t,i.found=n,i.location=r,i.name="SyntaxError",i}function Kc(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}function Yc(e,t){var n,r={},i=(t=void 0!==t?t:{}).grammarSource,s={program:An,constant_expression:hr},o=An,a="<<",l=">>",u="<=",c=">=",h="==",d="!=",f="&&",p="||",m="(",g=")",E=",",v="!",C="-",D="~",S="+",A="*",_="/",y="%",b="<",T=">",R="|",x="^",w="&",F=":",N="#",L="define",O="line",I="undef",k="error",M="pragma",P="defined",B="if",U="ifdef",$="ifndef",G="elif",V="else",W="endif",H="version",j="extension",z="0",X="//",K="/*",Y="*/",q=/^[A-Za-z_]/,Q=/^[A-Za-z_0-9]/,Z=/^[uU]/,J=/^[1-9]/,ee=/^[0-7]/,te=/^[xX]/,ne=/^[0-9a-fA-F]/,re=/^[0-9]/,ie=/^[\n\r]/,se=/^[^\n\r]/,oe=/^[ \t]/,ae=gn("<<",!1),le=gn(">>",!1),ue=gn("<=",!1),ce=gn(">=",!1),he=gn("==",!1),de=gn("!=",!1),fe=gn("&&",!1),pe=gn("||",!1),me=gn("(",!1),ge=gn(")",!1),Ee=gn(",",!1),ve=gn("!",!1),Ce=gn("-",!1),De=gn("~",!1),Se=gn("+",!1),Ae=gn("*",!1),_e=gn("/",!1),ye=gn("%",!1),be=gn("<",!1),Te=gn(">",!1),Re=gn("|",!1),xe=gn("^",!1),we=gn("&",!1),Fe=gn(":",!1),Ne=gn("#",!1),Le=gn("define",!1),Oe=(gn("include",!1),gn("line",!1)),Ie=gn("undef",!1),ke=gn("error",!1),Me=gn("pragma",!1),Pe=gn("defined",!1),Be=gn("if",!1),Ue=gn("ifdef",!1),$e=gn("ifndef",!1),Ge=gn("elif",!1),Ve=gn("else",!1),We=gn("endif",!1),He=gn("version",!1),je=gn("extension",!1),ze=En([["A","Z"],["a","z"],"_"],!1,!1),Xe=En([["A","Z"],["a","z"],"_",["0","9"]],!1,!1),Ke=vn("number"),Ye=En(["u","U"],!1,!1),qe=En([["1","9"]],!1,!1),Qe=gn("0",!1),Ze=En([["0","7"]],!1,!1),Je=En(["x","X"],!1,!1),et=En([["0","9"],["a","f"],["A","F"]],!1,!1),tt=En([["0","9"]],!1,!1),nt=vn("control line"),rt=En(["\n","\r"],!1,!1),it=vn("token string"),st=En(["\n","\r"],!0,!1),ot=vn("text"),at=vn("if"),lt=vn("primary expression"),ut=vn("unary expression"),ct=vn("multiplicative expression"),ht=vn("additive expression"),dt=vn("shift expression"),ft=vn("relational expression"),pt=vn("equality expression"),mt=vn("and expression"),gt=vn("exclusive or expression"),Et=vn("inclusive or expression"),vt=vn("logical and expression"),Ct=vn("logical or expression"),Dt=vn("constant expression"),St=vn("whitespace or comment"),At=gn("//",!1),_t=gn("/*",!1),yt=gn("*/",!1),bt={type:"any"},Tt=vn("whitespace"),Rt=En([" ","\t"],!1,!1),xt=function(e,t){return gr("program",{program:e.blocks,wsEnd:t})},wt=function(e,t){return gr("int_constant",{token:e,wsEnd:t})},Ft=function(e,t){return gr("literal",{literal:e,wsEnd:t})},Nt=function(e){return"#"},Lt=function(e,t,n){return gr("literal",{literal:t,wsStart:e,wsEnd:n})},Ot=function(e,t){return gr("identifier",{identifier:e,wsEnd:t})},It=function(e){return gr("identifier",{identifier:e})},kt=function(e){return gr("text",{text:e.join("")})},Mt=function(e){return gr("segment",{blocks:e})},Pt=function(e,t,n,r,i){return[r,...i.flat()]},Bt=function(e,t,n,r,i,s){return gr("define_arguments",{define:e,identifier:t,lp:n,args:r||[],rp:i,body:s})},Ut=function(e,t,n){return gr("define",{define:e,identifier:t,body:n})},$t=function(e,t){return gr("line",{line:e,value:t})},Gt=function(e,t){return gr("undef",{undef:e,identifier:t})},Vt=function(e,t){return gr("error",{error:e,message:t})},Wt=function(e,t){return gr("pragma",{pragma:e,body:t})},Ht=function(e,t,n){return gr("version",{version:e,value:t,profile:n})},jt=function(e,t,n,r){return gr("extension",{extension:e,name:t,colon:n,behavior:r})},zt=function(e,t){return{...e,wsEnd:t}},Xt=function(e,t,n){return{...e,body:n,wsEnd:t}},Kt=function(e,t,n,r,i){return gr("elseif",{token:t,expression:n,wsEnd:r,body:i})},Yt=function(e,t,n,r,i){return gr("else",{token:n,wsEnd:r,body:i})},qt=function(e,t,n,r,i){return gr("conditional",{ifPart:e,elseIfParts:t,elsePart:n,endif:r,wsEnd:i})},Qt=function(e,t){return gr("ifdef",{token:e,identifier:t})},Zt=function(e,t){return gr("ifndef",{token:e,identifier:t})},Jt=function(e,t){return gr("if",{token:e,expression:t})},en=function(e,t,n){return gr("group",{lp:e,expression:t,rp:n})},tn=function(e,t,n,r){return gr("unary_defined",{operator:e,lp:t,identifier:n,rp:r})},nn=function(e,t){return gr("unary",{operator:e,expression:t})},rn=function(e,t){return Cr(e,t)},sn=function(e,t){return vr(e,t)},on=function(e,t,n){return Er(t,n)},an=function(e,t){return Er(e,t.flat())},ln=function(e){return e},un=function(e){return e},cn=0,hn=[{line:1,column:1}],dn=0,fn=[],pn=0,mn={};if("startRule"in t){if(!(t.startRule in s))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=s[t.startRule]}function gn(e,t){return{type:"literal",text:e,ignoreCase:t}}function En(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function vn(e){return{type:"other",description:e}}function Cn(t){var n,r=hn[t];if(r)return r;for(n=t-1;!hn[n];)n--;for(r={line:(r=hn[n]).line,column:r.column};ndn&&(dn=cn,fn=[]),fn.push(e))}function An(){var e,t,n,i=75*cn+0,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Qn())!==r?(n=dr(),e=xt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}function _n(){var t,n,i,s=75*cn+2,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===a?(n=a,cn+=2):(n=r,0===pn&&Sn(ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function yn(){var t,n,i,s=75*cn+3,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===l?(n=l,cn+=2):(n=r,0===pn&&Sn(le)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function bn(){var t,n,i,s=75*cn+4,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===u?(n=u,cn+=2):(n=r,0===pn&&Sn(ue)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Tn(){var t,n,i,s=75*cn+5,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===c?(n=c,cn+=2):(n=r,0===pn&&Sn(ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Rn(){var t,n,i,s=75*cn+6,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===h?(n=h,cn+=2):(n=r,0===pn&&Sn(he)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function xn(){var t,n,i,s=75*cn+7,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===d?(n=d,cn+=2):(n=r,0===pn&&Sn(de)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function wn(){var t,n,i,s=75*cn+8,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===f?(n=f,cn+=2):(n=r,0===pn&&Sn(fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Fn(){var t,n,i,s=75*cn+9,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===p?(n=p,cn+=2):(n=r,0===pn&&Sn(pe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Nn(){var t,n,i,s=75*cn+10,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,40===e.charCodeAt(cn)?(n=m,cn++):(n=r,0===pn&&Sn(me)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Ln(){var t,n,i,s=75*cn+11,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,41===e.charCodeAt(cn)?(n=g,cn++):(n=r,0===pn&&Sn(ge)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function On(){var t,n,i,s=75*cn+12,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,44===e.charCodeAt(cn)?(n=E,cn++):(n=r,0===pn&&Sn(Ee)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function In(){var t,n,i,s=75*cn+14,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,45===e.charCodeAt(cn)?(n=C,cn++):(n=r,0===pn&&Sn(Ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function kn(){var t,n,i,s=75*cn+16,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,43===e.charCodeAt(cn)?(n=S,cn++):(n=r,0===pn&&Sn(Se)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Mn(){var t,n,i,s=75*cn+17,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,42===e.charCodeAt(cn)?(n=A,cn++):(n=r,0===pn&&Sn(Ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Pn(){var t,n,i,s=75*cn+18,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,47===e.charCodeAt(cn)?(n=_,cn++):(n=r,0===pn&&Sn(_e)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Bn(){var t,n,i,s=75*cn+19,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,37===e.charCodeAt(cn)?(n=y,cn++):(n=r,0===pn&&Sn(ye)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Un(){var t,n,i,s=75*cn+20,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,60===e.charCodeAt(cn)?(n=b,cn++):(n=r,0===pn&&Sn(be)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function $n(){var t,n,i,s=75*cn+21,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,62===e.charCodeAt(cn)?(n=T,cn++):(n=r,0===pn&&Sn(Te)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Gn(){var t,n,i,s=75*cn+22,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,124===e.charCodeAt(cn)?(n=R,cn++):(n=r,0===pn&&Sn(Re)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Vn(){var t,n,i,s=75*cn+23,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,94===e.charCodeAt(cn)?(n=x,cn++):(n=r,0===pn&&Sn(xe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Wn(){var t,n,i,s=75*cn+24,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,38===e.charCodeAt(cn)?(n=w,cn++):(n=r,0===pn&&Sn(we)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Hn(){var t,n,i,s=75*cn+26,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,35===e.charCodeAt(cn)?(i=N,cn++):(i=r,0===pn&&Sn(Ne)),(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Nt(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function jn(){var t,n,i,s,o,a,l=75*cn+27,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===L?(a=L,cn+=6):(a=r,0===pn&&Sn(Le)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function zn(){var t,n,i,s,o,a,l=75*cn+37,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===G?(a=G,cn+=4):(a=r,0===pn&&Sn(Ge)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function Xn(){var t,n,i,s,o,a,l=75*cn+42,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Ot(n,i)):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t}function Kn(){var t,n,i,s,o=75*cn+44,a=mn[o];return a?(cn=a.nextPos,a.result):(pn++,t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+46,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,J.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(qe)),i!==r){for(s=[],o=qn();o!==r;)s.push(o),o=qn();n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o=75*cn+47,a=mn[o];if(a)return cn=a.nextPos,a.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r){for(i=[],ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));s!==r;)i.push(s),ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));t=n=[n,i]}else cn=t,t=r;return mn[o]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+48,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r)if(te.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Je)),i!==r){for(s=[],ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));o!==r;)s.push(o),ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));t=n=[n,i,s]}else cn=t,t=r;else cn=t,t=r;return mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),t=n!==r?e.substring(t,cn):n)),pn--,t===r&&(n=r,0===pn&&Sn(Ke)),mn[o]={nextPos:cn,result:t},t)}function Yn(){var t,n=75*cn+45,i=mn[n];return i?(cn=i.nextPos,i.result):(Z.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(Ye)),mn[n]={nextPos:cn,result:t},t)}function qn(){var t,n=75*cn+49,i=mn[n];return i?(cn=i.nextPos,i.result):(re.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(tt)),mn[n]={nextPos:cn,result:t},t)}function Qn(){var e,t,n,i,s,o=75*cn+50,a=mn[o];if(a)return cn=a.nextPos,a.result;if(cn,t=[],(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}if(n!==r){for(;n!==r;)if(t.push(n),(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}}else t=r;return t!==r&&(t=Mt(t)),e=t,mn[o]={nextPos:cn,result:e},e}function Zn(){var t,n,i,s,o,a,l,u,c,h,d,f=75*cn+51,p=mn[f];if(p)return cn=p.nextPos,p.result;if(pn++,t=function(){var t,n,i,s,o,a,l,u,c=75*cn+54,h=mn[c];if(h)return cn=h.nextPos,h.result;if(t=cn,n=cn,i=function(){var t,n,i,s=75*cn+55,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+35,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===U?(a=U,cn+=5):(a=r,0===pn&&Sn(Ue)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Qt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+36,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===$?(a=$,cn+=6):(a=r,0===pn&&Sn($e)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Zt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+34,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,2)===B?(a=B,cn+=2):(a=r,0===pn&&Sn(Be)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r?((i=Jn())===r&&(i=null),t=Jt(n,i)):(cn=t,t=r))),pn--,t===r&&(n=r,0===pn&&Sn(at)),mn[s]={nextPos:cn,result:t},t)}(),i!==r?(ie.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(rt)),s!==r?((o=Qn())===r&&(o=null),n=Xt(i,s,o)):(cn=n,n=r)):(cn=n,n=r),n!==r){for(i=[],s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s=cn,o=function(){var t,n,i,s,o,a,l=75*cn+38,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===V?(a=V,cn+=4):(a=r,0===pn&&Sn(Ve)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a!==r?((l=Qn())===r&&(l=null),s=Yt(n,i,o,a,l)):(cn=s,s=r)):(cn=s,s=r),s===r&&(s=null),o=function(){var t,n,i,s,o,a,l=75*cn+39,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===W?(a=W,cn+=5):(a=r,0===pn&&Sn(We)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a===r&&(a=null),t=qt(n,i,s,o,a)):(cn=t,t=r)}else cn=t,t=r;return mn[c]={nextPos:cn,result:t},t}(),t===r){if(t=cn,n=cn,(i=jn())!==r)if(s=function(){var t,n,i,s,o,a,l=75*cn+43,u=mn[l];if(u)return cn=u.nextPos,u.result;if(cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r&&(n=It(n)),t=n,mn[l]={nextPos:cn,result:t},t}(),s!==r)if((o=Nn())!==r){if(a=cn,(l=Xn())!==r){for(u=[],c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);c!==r;)u.push(c),c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);a=Pt(i,s,o,l,u)}else cn=a,a=r;a===r&&(a=null),(l=Ln())!==r?((u=Jn())===r&&(u=null),n=Bt(i,s,o,a,l,u)):(cn=n,n=r)}else cn=n,n=r;else cn=n,n=r;else cn=n,n=r;if(n===r&&(n=cn,(i=jn())!==r&&(s=Xn())!==r?((o=Jn())===r&&(o=null),n=Ut(i,s,o)):(cn=n,n=r),n===r)){if(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+29,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===O?(a=O,cn+=4):(a=r,0===pn&&Sn(Oe)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r){if(s=cn,o=[],(a=qn())!==r)for(;a!==r;)o.push(a),a=qn();else o=r;(s=o!==r?e.substring(s,cn):o)!==r?n=$t(i,s):(cn=n,n=r)}else cn=n,n=r;n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+30,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===I?(a=I,cn+=5):(a=r,0===pn&&Sn(Ie)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?n=Gt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+31,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===k?(a=k,cn+=5):(a=r,0===pn&&Sn(ke)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Vt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+32,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===M?(a=M,cn+=6):(a=r,0===pn&&Sn(Me)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Wt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+40,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,7)===H?(a=H,cn+=7):(a=r,0===pn&&Sn(He)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Kn())!==r?((o=Jn())===r&&(o=null),n=Ht(i,s,o)):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+41,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,9)===j?(a=j,cn+=9):(a=r,0===pn&&Sn(je)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?(o=function(){var t,n,i,s=75*cn+25,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,58===e.charCodeAt(cn)?(n=F,cn++):(n=r,0===pn&&Sn(Fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),o!==r&&(a=Jn())!==r?n=jt(i,s,o,a):(cn=n,n=r)):(cn=n,n=r))))))}n!==r?(ie.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(rt)),i===r&&(i=null),t=zt(n,i)):(cn=t,t=r)}return pn--,t===r&&(n=r,0===pn&&Sn(nt)),mn[f]={nextPos:cn,result:t},t}function Jn(){var t,n,i,s=75*cn+52,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st)),i!==r)for(;i!==r;)n.push(i),se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(it)),mn[s]={nextPos:cn,result:t},t}function er(){var t,n,i,s,o,a,l=75*cn+53,u=mn[l];if(u)return cn=u.nextPos,u.result;if(pn++,t=cn,n=cn,i=cn,pn++,s=cn,(o=pr())===r&&(o=null),35===e.charCodeAt(cn)?(a=N,cn++):(a=r,0===pn&&Sn(Ne)),a!==r?s=o=[o,a]:(cn=s,s=r),pn--,s===r?i=void 0:(cn=i,i=r),i!==r){if(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st)),o!==r)for(;o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));else s=r;s!==r?(ie.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(rt)),o===r&&(o=null),n=i=[i,s,o]):(cn=n,n=r)}else cn=n,n=r;return n===r&&(ie.test(e.charAt(cn))?(n=e.charAt(cn),cn++):(n=r,0===pn&&Sn(rt))),t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(ot)),mn[l]={nextPos:cn,result:t},t}function tr(){var t,n,i,s,o,a=75*cn+57,l=mn[a];return l?(cn=l.nextPos,l.result):(pn++,t=cn,n=function(){var t,n,i,s,o=75*cn+33,a=mn[o];return a?(cn=a.nextPos,a.result):(t=cn,n=dr(),e.substr(cn,7)===P?(i=P,cn+=7):(i=r,0===pn&&Sn(Pe)),i!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[o]={nextPos:cn,result:t},t)}(),n!==r?((i=Nn())===r&&(i=null),(s=Xn())!==r?((o=Ln())===r&&(o=null),t=tn(n,i,s,o)):(cn=t,t=r)):(cn=t,t=r),t===r&&(t=cn,(n=kn())===r&&(n=In())===r&&(n=function(){var t,n,i,s=75*cn+13,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,33===e.charCodeAt(cn)?(n=v,cn++):(n=r,0===pn&&Sn(ve)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),n===r&&(n=function(){var t,n,i,s=75*cn+15,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,126===e.charCodeAt(cn)?(n=D,cn++):(n=r,0===pn&&Sn(De)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}())),n!==r&&(i=tr())!==r?t=nn(n,i):(cn=t,t=r),t===r&&(t=function(){var e,t,n,i,s=75*cn+56,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,e=function(){var e,t,n,i=75*cn+1,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Kn())!==r?(n=dr(),e=wt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}(),e===r&&(e=cn,(t=Nn())!==r&&(n=hr())!==r&&(i=Ln())!==r?e=en(t,n,i):(cn=e,e=r),e===r&&(e=Xn())),pn--,e===r&&(t=r,0===pn&&Sn(lt)),mn[s]={nextPos:cn,result:e},e)}())),pn--,t===r&&(n=r,0===pn&&Sn(ut)),mn[a]={nextPos:cn,result:t},t)}function nr(){var e,t,n,i,s,o,a=75*cn+58,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=tr())!==r){for(n=[],i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ct)),mn[a]={nextPos:cn,result:e},e}function rr(){var e,t,n,i,s,o,a=75*cn+59,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=nr())!==r){for(n=[],i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ht)),mn[a]={nextPos:cn,result:e},e}function ir(){var e,t,n,i,s,o,a=75*cn+60,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=rr())!==r){for(n=[],i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(dt)),mn[a]={nextPos:cn,result:e},e}function sr(){var e,t,n,i,s,o,a=75*cn+61,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ir())!==r){for(n=[],i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ft)),mn[a]={nextPos:cn,result:e},e}function or(){var e,t,n,i,s,o,a=75*cn+62,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=sr())!==r){for(n=[],i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(pt)),mn[a]={nextPos:cn,result:e},e}function ar(){var e,t,n,i,s,o,a=75*cn+63,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=or())!==r){for(n=[],i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(mt)),mn[a]={nextPos:cn,result:e},e}function lr(){var e,t,n,i,s,o,a=75*cn+64,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ar())!==r){for(n=[],i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(gt)),mn[a]={nextPos:cn,result:e},e}function ur(){var e,t,n,i,s,o,a=75*cn+65,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=lr())!==r){for(n=[],i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Et)),mn[a]={nextPos:cn,result:e},e}function cr(){var e,t,n,i,s,o,a=75*cn+66,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ur())!==r){for(n=[],i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(vt)),mn[a]={nextPos:cn,result:e},e}function hr(){var e,t=75*cn+68,n=mn[t];return n?(cn=n.nextPos,n.result):(pn++,e=function(){var e,t,n,i,s,o,a=75*cn+67,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=cr())!==r){for(n=[],i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Ct)),mn[a]={nextPos:cn,result:e},e}(),pn--,e===r&&0===pn&&Sn(Dt),mn[t]={nextPos:cn,result:e},e)}function dr(){var e,t,n,i,s,o,a=75*cn+69,l=mn[a];if(l)return cn=l.nextPos,l.result;for(pn++,cn,(t=pr())===r&&(t=null),n=[],i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);return e=sn(t,n),pn--,t=r,0===pn&&Sn(St),mn[a]={nextPos:cn,result:e},e}function fr(){var t,n,i,s,o,a,l=75*cn+70,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=function(){var t,n,i,s,o,a=75*cn+71,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,e.substr(cn,2)===X?(i=X,cn+=2):(i=r,0===pn&&Sn(At)),i!==r){for(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),t===r)if(t=cn,n=function(){var t,n,i,s,o,a,l,u=75*cn+72,c=mn[u];if(c)return cn=c.nextPos,c.result;if(t=cn,n=cn,e.substr(cn,2)===K?(i=K,cn+=2):(i=r,0===pn&&Sn(_t)),i!==r){for(s=[],o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);o!==r;)s.push(o),o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);e.substr(cn,2)===Y?(o=Y,cn+=2):(o=r,0===pn&&Sn(yt)),o!==r?n=i=[i,s,o]:(cn=n,n=r)}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[u]={nextPos:cn,result:t},t}(),n!==r){for(i=[],s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);t=an(n,i)}else cn=t,t=r;return mn[l]={nextPos:cn,result:t},t}function pr(){var t,n,i,s=75*cn+73,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt)),i!==r)for(;i!==r;)n.push(i),oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(Tt)),mn[s]={nextPos:cn,result:t},t}function mr(){var t,n,i,s=75*cn+74,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,pn++,Q.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Xe)),pn--,i===r?n=void 0:(cn=n,n=r),n!==r?(i=dr(),t=un(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}e=lh(e);const gr=(e,t)=>({type:e,...t}),Er=(...e)=>e.flat().filter(e=>null!=e&&""!==e&&0!==e.length),vr=(...e)=>{return(t=Er(e.flat())).length>1?t:t[0];var t},Cr=(...e)=>e.flat().reduce((e,[t,n])=>({type:"binary",operator:t,left:e,right:n}));if((n=o())!==r&&cn===e.length)return n;throw n!==r&&cn0){for(t=1,n=1;ts.length)throw new Error("'".concat(t,"': Too many arguments for macro"));if(u.length>":return t(n)>>t(r);case"<":return t(n)":return t(n)>t(r);case"<=":return t(n)<=t(r);case">=":return t(n)>=t(r);case"==":return t(n)==t(r);case"!=":return t(n)!=t(r);case"&":return t(n)&t(r);case"^":return t(n)^t(r);case"|":return t(n)|t(r);case"&&":return t(n)&&t(r);case"||":return t(n)||t(r);default:throw new Error("Preprocessing error: Unknown binary operator ".concat(i))}},unary:function(e,t){switch(e.operator.literal){case"+":return t(e.expression);case"-":return-1*t(e.expression);case"!":return!t(e.expression);case"~":return~t(e.expression);default:throw new Error("Preprocessing error: Unknown unary operator ".concat(e.operator.literal))}}},(r=function(e){var t=n[e.type];if(!t)throw new Error("No evaluate() evaluator for ".concat(e.type));return t(e,r)})(e);var n,r}((n=sh(r,t).trim(),eh(s)(n,{grammarSource:"expression",startRule:"constant_expression"})),t)},lh=function(e,t){return void 0===t&&(t={}),e.replace(/\\[\n\r]/g,"")},uh=function(e,t){void 0===t&&(t={});var n,r,i,s,o=Object.entries(t.defines||{}).reduce(function(e,t){var n,r=t[0],i=t[1];return th(th({},e),((n={})[r]={body:i},n))},{}),a=(void 0===(n=t.preserve)&&(n={}),function(e){var t=null==n?void 0:n[e.node.type];return"function"==typeof t?t(e):t});return r={conditional:{enter:function(e){var t=e,n=t.node;a(t)||(function(e,t){return"if"===t.type?!!t.expression&&oh(ah(t.expression,e)):"ifdef"===t.type?t.identifier.identifier in e:"ifndef"===t.type?!(t.identifier.identifier in e):void 0}(o,n.ifPart)?t.replaceWith(n.ifPart.body):n.elseIfParts.reduce(function(e,n){return e||oh(ah(n.expression,o))&&(t.replaceWith(n.body),!0)},!1)||(n.elsePart?t.replaceWith(n.elsePart.body):t.remove()))}},text:{enter:function(e){var t=e;t.node.text=sh(t.node.text,o)}},define_arguments:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body,s=n.args;o[r]={args:s,body:i},!a(t)&&t.remove()}},define:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body;o[r]={body:i},!a(t)&&t.remove()}},undef:{enter:function(e){var t=e;delete o[t.node.identifier.identifier],!a(t)&&t.remove()}},error:{enter:function(e){var n=e;if(t.stopOnError)throw new Error(n.node.message);!a(n)&&n.remove()}},pragma:{enter:function(e){var t=e;!a(t)&&t.remove()}},version:{enter:function(e){var t=e;!a(t)&&t.remove()}},extension:{enter:function(e){var t=e;!a(t)&&t.remove()}},line:{enter:function(e){var t=e;!a(t)&&t.remove()}}},i=!1,(s=function(e,t,n,o,a){var l;if(!i){var u=r[e.type],c=function(e,t,n,r,i){return{node:e,parent:t,parentPath:n,key:r,index:i,stop:function(){this.stopped=!0},skip:function(){this.skipped=!0},remove:function(){this.removed=!0},replaceWith:function(e){this.replaced=e},findParent:function(e){return n?e(n)?n:n.findParent(e):n}}}(e,t,n,o,a),h=t;if(null==u?void 0:u.enter){if(u.enter(c),c.removed){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));return"number"==typeof a?h[o].splice(a,1):h[o]=null,c}if(c.replaced){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));"number"==typeof a?h[o].splice(a,1,c.replaced):h[o]=c.replaced}if(c.skipped)return c}if(c.stopped)i=!0;else if(c.replaced){var d=c.replaced;s(d,t,n,o,a)}else Object.entries(e).filter(function(e){return e[0],function(e){return function(e){return!!(null==e?void 0:e.type)}(e)||Array.isArray(e)}(e[1])}).forEach(function(t){var n=t[0],r=t[1];if(Array.isArray(r))for(var o=0,a=0;o-a{let e=!0;return n?(i({source:o,formatted:null,error:""}),function(e){return Gs(e,{parser:"glsl-parser",plugins:[Gc],printWidth:80,tabWidth:4,useTabs:!1}).then(Vc)}(o).then(t=>{e&&i({source:o,formatted:t,error:""})}).catch(t=>{if(!e)return;const n=dh(t);a.error("shader formatting failed: "+n),i({source:o,formatted:null,error:n})}),()=>{e=!1}):(i({source:o,formatted:null,error:""}),()=>{e=!1})},[n,o]);const c=n&&r.source===o?r.formatted:null;return{source:c||o,formatted:!!c,preprocessed:u,error:(r.source===o?r.error:"")||l}}(C.source,C.preprocessed,e.beautify),S=D.source,A=C.edited,_=[e.fragment?e.sourceFragmentLog:e.sourceVertexLog,e.programLog].filter(e=>!!e).join("\n"),y=!e.translated&&!D.preprocessed&&!D.formatted,b=function(e,t,n,r){return!(e||t||!n||r)}(t,A,_,y);(0,dt.useLayoutEffect)(()=>{g.current={programId:e.programId,sourceVertex:e.sourceVertex,sourceFragment:e.sourceFragment}},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!d.current)return;if(!f.current){const e=ace.edit(d.current);e.setTheme("ace/theme/monokai"),e.getSession().setMode("ace/mode/glsl"),e.setShowPrintMargin(!1),f.current=e}const t=f.current;t.setReadOnly(!e.editable||e.translated),t.getValue()!==S&&t.setValue(S,-1);const n=()=>{const n=t.getValue();e.fragment?m.current.fragment=n:m.current.vertex=n,v(t=>e.fragment?t.fragment?t:Object.assign(Object.assign({},t),{fragment:!0}):t.vertex?t:Object.assign(Object.assign({},t),{vertex:!0})),function(e,t,n,r){e&&n(!1),t&&r(!1)}(e.beautify,e.preprocessed,c,h),-1!==p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{if(p.current=-1,!function(e,t){return e.programId===t.programId&&e.sourceVertex===t.sourceVertex&&e.sourceFragment===t.sourceFragment}(g.current,e))return;const t={sourceVertex:m.current.vertex,sourceFragment:m.current.fragment,translatedSourceVertex:e.translatedSourceVertex,translatedSourceFragment:e.translatedSourceFragment,programId:e.programId};u(t)},1500)},r=e.editable&&!e.translated;return r&&t.getSession().on("change",n),()=>{r&&t.getSession().off("change",n)}},[S,e.editable,e.translated,e.fragment,e.beautify,e.preprocessed,e.sourceVertex,e.sourceFragment,e.translatedSourceVertex,e.translatedSourceFragment,e.programId,c,h,u]),(0,dt.useEffect)(()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),m.current={baseProgramId:e.programId,baseVertex:e.sourceVertex,baseFragment:e.sourceFragment,vertex:e.sourceVertex,fragment:e.sourceFragment},v({vertex:!1,fragment:!1})},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!f.current)return;const e=t||(y&&!A?_:"");f.current.getSession().setAnnotations(function(e){if(!e)return[];const t=[],n=e.split(/\r?\n/);for(const e of n){const n=e.replace(/\0/g,"").trim();if(!n)continue;let r=/^(error|warning|info)\s*:\s*\d+\s*:\s*(\d+)(?:\s*:\s*(\d+))?\s*:\s*(.*)$/i.exec(n);if(r){t.push(Pt(r[1],r[2],r[3],r[4]));continue}if(r=/^\d+\s*\(\s*(\d+)\s*\)\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[2],r[1],"",r[3]));continue}if(r=/^\d+\s*:\s*(\d+)(?:\s*\(\s*(\d+)\s*\))?\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[3],r[1],r[2],r[4]));continue}const i=/\b(error|warning|info)\b/i.exec(n);t.push({row:0,column:0,text:n,type:i?i[1].toLowerCase():"info"})}return t}(e))},[_,y,t,D.formatted,D.preprocessed,A,e.beautify,e.fragment,e.programLog,e.sourceFragmentLog,e.sourceVertexLog,e.translated]),(0,dt.useEffect)(()=>()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),f.current&&(f.current.destroy(),f.current=null)},[]);const T=(0,dt.useCallback)(e=>{e.preventDefault(),n()},[n]),R=(0,dt.useCallback)(e=>{e.preventDefault(),r()},[r]),x=(0,dt.useCallback)(e=>{e.preventDefault(),null==i||i()},[i]),w=(0,dt.useCallback)(e=>{e.preventDefault(),null==o||o()},[o]),F=(0,dt.useCallback)(e=>{e.preventDefault(),l()},[l]),N=!e.singleShader||!e.fragment,L=!e.singleShader||e.fragment,O=D.error;return(0,mt.jsxs)("div",{className:"sourceCodeComponentContainer",children:[(0,mt.jsx)("div",{className:"sourceCodeMenuComponentContainer",children:(0,mt.jsxs)("ul",{className:"sourceCodeMenuComponent",children:[N&&e.translatedSourceVertex&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:!e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedVertexSourceClicked",onClick:x,children:"Translated Vertex"})}),L&&e.translatedSourceFragment&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedFragmentSourceClicked",onClick:w,children:"Translated Fragment"})}),N&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment||e.translated?"":"active",href:"#",role:"button",commandName:"onVertexSourceClicked",onClick:T,children:"Vertex"})}),L&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&!e.translated?"active":"",href:"#",role:"button",commandName:"onFragmentSourceClicked",onClick:R,children:"Fragment"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onSourceCodeCloseClicked",onClick:F,children:"Close"})})]})}),(0,mt.jsx)("div",{className:"sourceCodeComponent",ref:d}),(0,mt.jsx)(hh,{beautify:e.beautify,capturedDiagnosticsHidden:b,fragment:e.fragment,preprocessed:e.preprocessed,processingError:O,onBeautifyChanged:c,onFragmentSourceClicked:r,onPreprocessChanged:h,onVertexSourceClicked:n})]})}function hh({beautify:e,capturedDiagnosticsHidden:t,fragment:n,preprocessed:r,processingError:i,onBeautifyChanged:s,onFragmentSourceClicked:o,onPreprocessChanged:a,onVertexSourceClicked:l}){const u=(0,dt.useCallback)(e=>{s(e.target.checked)},[s]),c=(0,dt.useCallback)(e=>{a(e.target.checked)},[a]),h=(0,dt.useCallback)(e=>{e.preventDefault(),(n?o:l)(),s(!1),a(!1)},[n,s,o,a,l]);return(0,mt.jsx)("div",{className:"sourceCodeMenuComponentFooter",children:(0,mt.jsxs)("p",{children:[(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onBeautifyChanged",checked:e,onChange:u})," Beautify"]}),(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onPreprocessChanged",checked:r,onChange:c})," Preprocess"]}),i&&(0,mt.jsx)("span",{className:"sourceCodeFormatError",role:"alert",title:i,children:"Shader processing failed"}),t&&(0,mt.jsxs)("span",{className:"sourceCodeDiagnosticsNotice",role:"status",children:["Captured diagnostics hidden."," ",(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onShowCapturedDiagnostics",onClick:h,children:"Show original with diagnostics"})]})]})})}function dh(e){return e instanceof Error?e.message:String(e)}function fh({title:e,children:t}){const n=e?e.replace(/([A-Z])/g," $1").trim():"";return(0,mt.jsxs)("div",{className:"jsonGroupComponent",children:[(0,mt.jsx)("div",{className:"jsonGroupComponentTitle",children:n}),(0,mt.jsx)("ul",{children:t})]})}function ph({itemKey:e,value:t}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsx)("span",{className:"jsonItemComponentValue",children:t})]})}function mh({itemKey:e,value:t,pixelated:n,raw:r}){const i=bt();return(0,mt.jsx)("li",{className:"jsonItemImageHolder",children:(0,mt.jsxs)("div",{className:"jsonItemImage jsonItemImageClickable",children:[(0,mt.jsx)("img",{src:t,style:n?{imageRendering:"pixelated"}:void 0,title:"Open in texture viewer",onClick:()=>i.openTextureViewer({src:t,label:e,pixelated:n,raw:r||null})}),(0,mt.jsx)("span",{children:e})]})})}function gh({itemKey:e,value:t,help:n}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("span",{className:"jsonItemComponentValue",children:[t+" (",(0,mt.jsx)("a",{href:n,target:"_blank",className:"jsonSourceItemComponentOpen",children:"Open help page"}),")"]})]})}function Eh({visualState:e}){const t=bt();return(0,mt.jsxs)("div",{className:"jsonVisualStateItemComponent",children:[e.Attachments?e.Attachments.map((n,r)=>n.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{className:"jsonItemImageClickable",src:encodeURI(n.src),title:"Open in texture viewer",onClick:()=>t.openTextureViewer({src:n.src,label:n.attachmentName||"Attachment",pixelated:!1,raw:n.raw||null})}),e.Attachments.length>1&&(0,mt.jsx)("span",{children:n.attachmentName})]},r):null):(0,mt.jsx)("span",{children:e.FrameBufferStatus}),(0,mt.jsx)("span",{children:e.FrameBuffer?e.FrameBuffer.__SPECTOR_Object_TAG.displayText:"Canvas frame buffer"})]})}function vh({itemKey:e,shader:t,programLog:n,onOpen:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),null==r||r(t,n)},[r,n,t]),s=t.source?t.source.length:0,o=`${t.name||"Shader"} (${s} chars)`;return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("a",{href:"#",role:"button",className:"jsonSourceItemComponentOpen",commandName:"onShaderSourceOpen",onClick:i,children:["Open ",o]})]})}function Ch({items:e,onShaderSourceOpen:t}){return e&&0!==e.length?(0,mt.jsx)(mt.Fragment,{children:e.map((e,n)=>{switch(e.type){case"group":return(0,mt.jsx)(fh,{title:e.title,children:(0,mt.jsx)(Ch,{items:e.children,onShaderSourceOpen:t})},n);case"item":return(0,mt.jsx)(ph,{itemKey:e.key,value:e.value},n);case"image":return(0,mt.jsx)(mh,{itemKey:e.key,value:e.value,pixelated:e.pixelated,raw:e.raw},n);case"help":return(0,mt.jsx)(gh,{itemKey:e.key,value:e.value,help:e.help},n);case"shaderSource":return(0,mt.jsx)(vh,{itemKey:e.key,shader:e.shader,programLog:e.programLog,onOpen:t},n);case"visualState":return(0,mt.jsx)(Eh,{visualState:e.visualState},n);default:return null}})}):null}const Dh={added:"+",removed:"-",changed:"~",unchanged:" "};function Sh(e){const t=void 0===e.indexA?"_":String(e.indexA),n=void 0===e.indexB?"_":String(e.indexB);return e.type+"#"+t+"#"+n}function Ah(e){return!(!e.previousImage&&!e.currentImage)}function _h(){const e=bt(),t=pt(e.store),[n,r]=(0,dt.useState)(null);if((0,dt.useEffect)(()=>{r(null)},[t.compareRows]),!t.canCompare)return(0,mt.jsx)("div",{className:"compareViewComponent",children:(0,mt.jsx)("div",{className:"compareViewEmpty",children:"Capture the same page at least twice, then select a capture to compare it against the previous one."})});const{added:i,removed:s,changed:o,unchanged:a}=t.compareSummary,l=t.compareOnlyDifferences?t.compareRows.filter(e=>"unchanged"!==e.type):t.compareRows,u=l.find(e=>Sh(e)===n)||(l.length>0?l[0]:null),c=u?Sh(u):"";return(0,mt.jsxs)("div",{className:"compareViewComponent",children:[(0,mt.jsxs)("div",{className:"compareViewHeader",children:[(0,mt.jsx)("span",{className:"compareViewLabel",children:t.compareLabel}),(0,mt.jsxs)("span",{className:"compareViewSummary",children:[(0,mt.jsxs)("span",{className:"added",children:["+",i]}),(0,mt.jsxs)("span",{className:"removed",children:["-",s]}),(0,mt.jsxs)("span",{className:"changed",children:["~",o]}),(0,mt.jsxs)("span",{className:"unchanged",children:["=",a]})]}),(0,mt.jsxs)("label",{className:"compareViewToggle",children:[(0,mt.jsx)("input",{type:"checkbox",checked:t.compareOnlyDifferences,onChange:t=>e.handleCompareOnlyDifferencesChange(t.target.checked)}),"Differences only"]})]}),(0,mt.jsxs)("div",{className:"compareViewBody",children:[(0,mt.jsx)(yh,{}),(0,mt.jsx)("ul",{className:"compareViewList",children:0===l.length?(0,mt.jsx)("li",{className:"compareViewEmptyRow",children:"No differences between these two captures."}):l.map(e=>{const t=Sh(e);return(0,mt.jsx)(bh,{row:e,selected:t===c,onSelect:()=>r(t)},t)})}),(0,mt.jsx)("div",{className:"compareViewDetail",children:u?(0,mt.jsx)(Th,{row:u,onSelectCommand:e.handleCompareCommandSelected,onOpenTexture:(t,n)=>e.openTextureViewer({src:t,label:n,pixelated:!1,raw:null})}):(0,mt.jsx)("div",{className:"compareDetailEmpty",children:"Select a call to see its details."})})]})]})}function yh(){return(0,mt.jsxs)("div",{className:"compareViewLegend",children:[(0,mt.jsxs)("div",{className:"compareLegendRow added",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Added"]}),(0,mt.jsxs)("div",{className:"compareLegendRow removed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Removed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow changed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Changed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow unchanged",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Unchanged"]})]})}function bh(e){const{row:t,selected:n,onSelect:r}=e,i="removed"===t.type?t.previousText:t.currentText,s=i&&0===i.indexOf(t.name)?i.slice(t.name.length):"",o="compareRow "+t.type+(n?" selected":"");return(0,mt.jsxs)("li",{className:o,onClick:r,title:i,children:[(0,mt.jsx)("span",{className:"compareSign",children:Dh[t.type]}),(0,mt.jsxs)("span",{className:"compareRowText",children:[(0,mt.jsx)("span",{className:"compareCmdName",children:t.name}),s]})]})}function Th(e){const{row:t,onSelectCommand:n,onOpenTexture:r}=e,i=t.fieldDiffs||[],s=i.filter(e=>!Ah(e)),o=i.filter(Ah),a="changed"===t.type&&t.previousText!==t.currentText,l="removed"===t.type?t.previousText:t.currentText;return(0,mt.jsxs)("div",{className:"compareDetail",children:[(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Command"}),(0,mt.jsxs)("ul",{children:[(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"name"}),":"," ",(0,mt.jsx)("span",{className:"compareCmdName "+t.type,children:t.name})]}),(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"call"}),":"," ",a?(0,mt.jsxs)("span",{className:"compareTextChange",children:[(0,mt.jsx)("span",{className:"compareOld",children:t.previousText}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:t.currentText})]}):(0,mt.jsx)("span",{className:"compareNew",children:l})]}),void 0!==t.commandId&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",className:"compareCommandLink",title:"Show this command in the Commands view",onClick:e=>{e.preventDefault(),n(t.commandId)},children:"Show in Commands view →"})})]})]}),s.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Uniform & state changes"}),(0,mt.jsx)("ul",{children:s.map((e,t)=>(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),":"," ",(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:e.current})]},t))})]}),o.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Texture changes"}),(0,mt.jsx)("ul",{children:o.map((e,t)=>(0,mt.jsxs)("li",{className:"compareTextureItem",children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),(0,mt.jsxs)("div",{className:"compareImageDiff",children:[e.previousImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.previousImage,title:"Open in texture viewer",onClick:()=>r(e.previousImage,e.path+" (previous)")}):(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),e.currentImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.currentImage,title:"Open in texture viewer",onClick:()=>r(e.currentImage,e.path+" (current)")}):(0,mt.jsx)("span",{className:"compareNew",children:e.current})]})]},t))})]})]})}function Rh(e){const t=(255&e).toString(16);return 1===t.length?"0"+t:t}function xh(e,t,n,r){return"#"+Rh(e)+Rh(t)+Rh(n)+Rh(r)}function wh(e,t,n,r){const i=e=>(e/255).toFixed(2);return i(e)+", "+i(t)+", "+i(n)+", "+i(r)}function Fh(){const e=bt(),t=pt(e.store).textureViewer;return t.open?(0,mt.jsx)(Lh,{viewer:t,onClose:e.closeTextureViewer}):null}const Nh=120;function Lh(e){const{viewer:t,onClose:n}=e,r=(0,dt.useRef)(null),i=(0,dt.useRef)(null),s=(0,dt.useRef)(null),o=(0,dt.useRef)(null),[a,l]=(0,dt.useState)({r:!0,g:!0,b:!0,a:!0}),[u,c]=(0,dt.useState)(1),[h,d]=(0,dt.useState)("checker"),[f,p]=(0,dt.useState)(null),[m,g]=(0,dt.useState)(null),[E,v]=(0,dt.useState)(!1);(0,dt.useEffect)(()=>{let e=!1;const n=t=>{e||(o.current=t,p({width:t.width,height:t.height}),c(kh(t.width,t.height)),v(!0))};if(t.raw){const r=function(e){try{if(!e.data||e.width<=0||e.height<=0)return null;const t=function(e){const t=atob(e),n=new Uint8ClampedArray(t.length);for(let e=0;e{e=!0}}const r=new Image;return r.onload=()=>{const e=document.createElement("canvas");e.width=r.naturalWidth||1,e.height=r.naturalHeight||1;const t=e.getContext("2d");if(!t)return;t.drawImage(r,0,0);const i=t.getImageData(0,0,e.width,e.height);n({data:new Uint8ClampedArray(i.data),width:e.width,height:e.height})},r.src=t.src,()=>{e=!0}},[t.src,t.raw]),(0,dt.useEffect)(()=>{const e=o.current,t=r.current;if(!E||!e||!t)return;const n=function(e,t,n){let r=e.current;return r||(r=document.createElement("canvas"),e.current=r),r.width!==t&&(r.width=t),r.height!==n&&(r.height=n),r}(s,e.width,e.height),i=n.getContext("2d"),l=t.getContext("2d");if(!i||!l)return;const c=function(e,t){const n=new Uint8ClampedArray(e.length),r=t.a&&!t.r&&!t.g&&!t.b;for(let i=0;i{const e=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]);const C="textureViewerViewport"+("checker"===h?" checker":""),D="black"===h?{background:"#000"}:"white"===h?{background:"#fff"}:void 0;return(0,mt.jsx)("div",{className:"textureViewerOverlay",onClick:n,children:(0,mt.jsxs)("div",{className:"textureViewerModal",onClick:e=>e.stopPropagation(),children:[(0,mt.jsxs)("div",{className:"textureViewerHeader",children:[(0,mt.jsx)("span",{className:"textureViewerTitle",children:t.label}),(0,mt.jsxs)("span",{className:"textureViewerMeta",children:[f?f.width+" × "+f.height:"",!t.raw&&f?" · thumbnail":""]}),(0,mt.jsx)("span",{className:"textureViewerClose",title:"Close (Esc)",onClick:n,children:"✕"})]}),(0,mt.jsxs)("div",{className:"textureViewerToolbar",children:[(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Channels"}),(0,mt.jsx)(Oh,{channel:"r",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"g",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"b",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"a",mask:a,setMask:l})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"tvBtn",title:"Force alpha = 1 to reveal RGB hidden behind transparency",onClick:()=>l({r:!0,g:!0,b:!0,a:!1}),children:"Opaque"}),(0,mt.jsx)("span",{className:"tvBtn",title:"Show the alpha channel as grayscale",onClick:()=>l({r:!1,g:!1,b:!1,a:!0}),children:"Alpha → gray"})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"BG"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)(Ih,{value:"checker",glyph:"▦",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"black",glyph:"■",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"white",glyph:"□",background:h,setBackground:d})]})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Zoom"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.max(1,e/2)),children:"−"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(f?kh(f.width,f.height):1),children:"Fit"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.min(32,2*e)),children:"+"})]}),(0,mt.jsxs)("span",{className:"zoomVal",children:[Math.round(100*u),"%"]})]}),(0,mt.jsx)("div",{className:"textureViewerGroup textureViewerGroupEnd",children:(0,mt.jsx)("span",{className:"tvBtn primary",onClick:()=>{const e=s.current;e&&e.toBlob(e=>{if(!e)return;const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=((t.label||"texture").replace(/[^a-z0-9_\-]+/gi,"_").replace(/^_+|_+$/g,"")||"texture")+".png",r.click(),setTimeout(()=>URL.revokeObjectURL(n),0)})},children:"⭳ Save PNG"})})]}),(0,mt.jsxs)("div",{className:"textureViewerBody",children:[(0,mt.jsxs)("div",{className:C,style:D,children:[(0,mt.jsx)("canvas",{ref:r,className:"textureViewerCanvas",onMouseMove:e=>{const t=o.current,n=r.current,a=i.current,l=s.current;if(!t||!n)return;const c=n.getBoundingClientRect(),h=Math.floor((e.clientX-c.left)/u),d=Math.floor((e.clientY-c.top)/u);if(h<0||d<0||h>=t.width||d>=t.height)return g(null),void(a&&(a.style.display="none"));const f=4*(d*t.width+h);g({x:h,y:d,r:t.data[f],g:t.data[f+1],b:t.data[f+2],a:t.data[f+3]}),function(e,t,n,r){if(!e||!t)return;const i=e.getContext("2d");if(!i)return;i.imageSmoothingEnabled=!1,i.clearRect(0,0,Nh,Nh),i.drawImage(t,n-7,r-7,15,15,0,0,Nh,Nh),i.strokeStyle="#F0640D",i.lineWidth=2,i.strokeRect(56,56,8,8),e.style.display="block"}(a,l,h,d)},onMouseLeave:()=>{g(null),i.current&&(i.current.style.display="none")}}),(0,mt.jsx)("canvas",{ref:i,className:"textureViewerLoupe",width:Nh,height:Nh})]}),(0,mt.jsxs)("div",{className:"textureViewerRail",children:[(0,mt.jsx)("div",{className:"railTitle",children:"Pixel inspector"}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"position"}),(0,mt.jsx)("span",{className:"v",children:m?m.x+", "+m.y:"—"})]}),(0,mt.jsx)("div",{className:"swatch",children:(0,mt.jsx)("div",{className:"swatchInner",style:m?{background:"rgba("+m.r+","+m.g+","+m.b+","+m.a/255+")"}:void 0})}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"R"}),(0,mt.jsx)("span",{className:"v",children:m?m.r:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"G"}),(0,mt.jsx)("span",{className:"v",children:m?m.g:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"B"}),(0,mt.jsx)("span",{className:"v",children:m?m.b:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"A"}),(0,mt.jsx)("span",{className:"v",children:m?m.a:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"hex"}),(0,mt.jsx)("span",{className:"v",children:m?xh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"norm"}),(0,mt.jsx)("span",{className:"v",children:m?wh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"hint",children:["Move over the texture to sample pixels. Toggle channels to isolate RGB / alpha.",(0,mt.jsx)("b",{children:" Opaque"})," reveals colour hidden behind transparency (#183)."]})]})]})]})})}function Oh(e){const{channel:t,mask:n,setMask:r}=e,i=n[t],s="channel "+t+(i?" on":"");return(0,mt.jsx)("span",{className:s,onClick:()=>r(Object.assign(Object.assign({},n),{[t]:!i})),children:t.toUpperCase()})}function Ih(e){const{value:t,glyph:n,background:r,setBackground:i}=e;return(0,mt.jsx)("span",{className:"tvBtn"+(r===t?" active":""),onClick:()=>i(t),children:n})}function kh(e,t){return Math.max(1,Math.min(16,Math.floor(480/Math.max(e,t))||1))}function Mh(){const e=bt(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"resultViewComponent "+(t.visible?"active":""),children:[(0,mt.jsx)(Tt,{}),(0,mt.jsxs)(Rt,{children:[0===t.menuStatus&&(0,mt.jsx)(wt,{active:!0,captures:t.captures,onCaptureSelected:t=>{e.selectCapture(t),e.handleMenuStatusChange(40)},onSaveRequested:e.handleSaveRequested,onCaptureLoaded:e.handleCaptureLoaded}),40===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(Ft,{children:t.visualStates.map((t,n)=>(0,mt.jsx)(Nt,{item:t,onVisualStateSelected:()=>e.handleVisualStateSelected(n)},n))}),(0,mt.jsx)(Lt,{children:t.commands.map((t,n)=>(0,mt.jsx)(Ot,{command:t,onCommandSelected:()=>e.handleCommandSelected(n),onVertexSelected:()=>e.handleVertexSelected(n),onFragmentSelected:()=>e.handleFragmentSelected(n),onShaderSelected:()=>e.handleShaderSelected(n)},n))}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]}),10===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(kt,{left:!0,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationLeft})})}),(0,mt.jsx)(kt,{left:!1,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationRight})})})]}),20===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.initStateData})}),30===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.endStateData})}),60===t.menuStatus&&(0,mt.jsx)(_h,{}),50===t.menuStatus&&t.sourceCodeState&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(ch,{state:t.sourceCodeState,errorMessage:t.sourceCodeError,onVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!1),onFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!1),onTranslatedVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!0),onTranslatedFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!0),onCloseClicked:e.handleSourceCodeClose,onSourceCodeChanged:e.handleSourceCodeChanged,onBeautifyChanged:e.handleBeautifyChanged,onPreprocessChanged:e.handlePreprocessChanged}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]})]}),(0,mt.jsx)(Fh,{})]})}class Ph{static getMDNLink(e){const t=Ph.WebGL2Functions[e];if(t)return Ph.WebGL2RootUrl+t;const n=Ph.WebGLFunctions[e];if(n)return Ph.WebGLRootUrl+n;const r=Ph.AngleInstancedArraysExtFunctions[e];return r?Ph.AngleInstancedArraysExtRootUrl+r:Ph.WebGLRootUrl+e}}Ph.WebGL2RootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/",Ph.WebGLRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/",Ph.AngleInstancedArraysExtRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/",Ph.WebGL2Functions={beginQuery:"beginQuery",beginTransformFeedback:"beginTransformFeedback",bindBufferBase:"bindBufferBase",bindBufferRange:"bindBufferRange",bindSampler:"bindSampler",bindTransformFeedback:"bindTransformFeedback",bindVertexArray:"bindVertexArray",blitFramebuffer:"blitFramebuffer",clearBufferfv:"clearBuffer",clearBufferiv:"clearBuffer",clearBufferuiv:"clearBuffer",clearBufferfi:"clearBuffer",clientWaitSync:"clientWaitSync",compressedTexImage3D:"compressedTexImage3D",compressedTexSubImage3D:"compressedTexSubImage3D",copyBufferSubData:"copyBufferSubData",copyTexSubImage3D:"copyTexSubImage3D",createQuery:"createQuery",createSampler:"createSampler",createTransformFeedback:"createTransformFeedback",createVertexArray:"createVertexArray",deleteQuery:"deleteQuery",deleteSampler:"deleteSampler",deleteSync:"deleteSync",deleteTransformFeedback:"deleteTransformFeedback",deleteVertexArray:"deleteVertexArray",drawArraysInstanced:"drawArraysInstanced",drawBuffers:"drawBuffers",drawElementsInstanced:"drawElementsInstanced",drawRangeElements:"drawRangeElements",endQuery:"endQuery",endTransformFeedback:"endTransformFeedback",fenceSync:"fenceSync",framebufferTextureLayer:"framebufferTextureLayer",getActiveUniformBlockName:"getActiveUniformBlockName",getActiveUniformBlockParameter:"getActiveUniformBlockParameter",getActiveUniforms:"getActiveUniforms",getBufferSubData:"getBufferSubData",getFragDataLocation:"getFragDataLocation",getIndexedParameter:"getIndexedParameter",getInternalformatParameter:"getInternalformatParameter",getQuery:"getQuery",getQueryParameter:"getQueryParameter",getSamplerParameter:"getSamplerParameter",getSyncParameter:"getSyncParameter",getTransformFeedbackVarying:"getTransformFeedbackVarying",getUniformBlockIndex:"getUniformBlockIndex",getUniformIndices:"getUniformIndices",invalidateFramebuffer:"invalidateFramebuffer",invalidateSubFramebuffer:"invalidateSubFramebuffer",isQuery:"isQuery",isSampler:"isSampler",isSync:"isSync",isTransformFeedback:"isTransformFeedback",isVertexArray:"isVertexArray",pauseTransformFeedback:"pauseTransformFeedback",readBuffer:"readBuffer",renderbufferStorageMultisample:"renderbufferStorageMultisample",resumeTransformFeedback:"resumeTransformFeedback",samplerParameteri:"samplerParameter",samplerParameterf:"samplerParameter",texImage3D:"texImage3D",texStorage2D:"texStorage2D",texStorage3D:"texStorage3D",texSubImage3D:"texSubImage3D",transformFeedbackVaryings:"transformFeedbackVaryings",uniform1ui:"uniform",uniform2ui:"uniform",uniform3ui:"uniform",uniform4ui:"uniform",uniform1fv:"uniform",uniform2fv:"uniform",uniform3fv:"uniform",uniform4fv:"uniform",uniform1iv:"uniform",uniform2iv:"uniform",uniform3iv:"uniform",uniform4iv:"uniform",uniform1uiv:"uniform",uniform2uiv:"uniform",uniform3uiv:"uniform",uniform4uiv:"uniform",uniformBlockBinding:"uniformBlockBinding",uniformMatrix2fv:"uniformMatrix",uniformMatrix3x2fv:"uniformMatrix",uniformMatrix4x2fv:"uniformMatrix",uniformMatrix2x3fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4x3fv:"uniformMatrix",uniformMatrix2x4fv:"uniformMatrix",uniformMatrix3x4fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttribDivisor:"vertexAttribDivisor",vertexAttribI4i:"vertexAttribI",vertexAttribI4ui:"vertexAttribI",vertexAttribI4iv:"vertexAttribI",vertexAttribI4uiv:"vertexAttribI",vertexAttribIPointer:"vertexAttribIPointer",waitSync:"waitSync"},Ph.WebGLFunctions={uniform1f:"uniform",uniform1fv:"uniform",uniform1i:"uniform",uniform1iv:"uniform",uniform2f:"uniform",uniform2fv:"uniform",uniform2i:"uniform",uniform2iv:"uniform",uniform3f:"uniform",uniform3i:"uniform",uniform3iv:"uniform",uniform4f:"uniform",uniform4fv:"uniform",uniform4i:"uniform",uniform4iv:"uniform",uniformMatrix2fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttrib1f:"vertexAttrib",vertexAttrib2f:"vertexAttrib",vertexAttrib3f:"vertexAttrib",vertexAttrib4f:"vertexAttrib",vertexAttrib1fv:"vertexAttrib",vertexAttrib2fv:"vertexAttrib",vertexAttrib3fv:"vertexAttrib",vertexAttrib4fv:"vertexAttrib"},Ph.AngleInstancedArraysExtFunctions={drawArraysInstancedANGLE:"drawArraysInstancedANGLE",drawElementsInstancedANGLE:"drawElementsInstancedANGLE",vertexAttribDivisorANGLE:"vertexAttribDivisorANGLE"};const Bh={activeTexture:[["texture"]],attachShader:[["program","shader"]],beginQuery:[["target","query"]],beginTransformFeedback:[["primitiveMode"]],bindAttribLocation:[["program","index","name"]],bindBuffer:[["target","buffer"]],bindBufferBase:[["target","index","buffer"]],bindBufferRange:[["target","index","buffer","offset","size"]],bindFramebuffer:[["target","framebuffer"]],bindRenderbuffer:[["target","renderbuffer"]],bindSampler:[["unit","sampler"]],bindTexture:[["target","texture"]],bindTransformFeedback:[["target","tf"]],bindVertexArray:[["array"]],blendColor:[["red","green","blue","alpha"]],blendEquation:[["mode"]],blendEquationSeparate:[["modeRGB","modeAlpha"]],blendFunc:[["sfactor","dfactor"]],blendFuncSeparate:[["srcRGB","dstRGB","srcAlpha","dstAlpha"]],blitFramebuffer:[["srcX0","srcY0","srcX1","srcY1","dstX0","dstY0","dstX1","dstY1","mask","filter"]],bufferData:[["target","data","usage"],["target","size","usage"],["target","srcData","usage"],["target","srcData","usage","srcOffset","length"]],bufferSubData:[["target","dstByteOffset","srcData"],["target","offset","data"],["target","dstByteOffset","srcData","srcOffset","length"]],checkFramebufferStatus:[["target"]],clear:[["mask"]],clearBufferfi:[["buffer","drawbuffer","depth","stencil"]],clearBufferfv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferiv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferuiv:[["buffer","drawbuffer","values","srcOffset"]],clearColor:[["red","green","blue","alpha"]],clearDepth:[["depth"]],clearStencil:[["s"]],clientWaitSync:[["sync","flags","timeout"]],colorMask:[["red","green","blue","alpha"]],compileShader:[["shader"]],compressedTexImage2D:[["target","level","internalformat","width","height","border","data"],["target","level","internalformat","width","height","border","imageSize","offset"],["target","level","internalformat","width","height","border","srcData","srcOffset","srcLengthOverride"]],compressedTexImage3D:[["target","level","internalformat","width","height","depth","border","imageSize","offset"],["target","level","internalformat","width","height","depth","border","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage2D:[["target","level","xoffset","yoffset","width","height","format","data"],["target","level","xoffset","yoffset","width","height","format","imageSize","offset"],["target","level","xoffset","yoffset","width","height","format","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","imageSize","offset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","srcData","srcOffset","srcLengthOverride"]],copyBufferSubData:[["readTarget","writeTarget","readOffset","writeOffset","size"]],copyTexImage2D:[["target","level","internalformat","x","y","width","height","border"]],copyTexSubImage2D:[["target","level","xoffset","yoffset","x","y","width","height"]],copyTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","x","y","width","height"]],createBuffer:[[]],createFramebuffer:[[]],createProgram:[[]],createQuery:[[]],createRenderbuffer:[[]],createSampler:[[]],createShader:[["type"]],createTexture:[[]],createTransformFeedback:[[]],createVertexArray:[[]],cullFace:[["mode"]],deleteBuffer:[["buffer"]],deleteFramebuffer:[["framebuffer"]],deleteProgram:[["program"]],deleteQuery:[["query"]],deleteRenderbuffer:[["renderbuffer"]],deleteSampler:[["sampler"]],deleteShader:[["shader"]],deleteSync:[["sync"]],deleteTexture:[["texture"]],deleteTransformFeedback:[["tf"]],deleteVertexArray:[["vertexArray"]],depthFunc:[["func"]],depthMask:[["flag"]],depthRange:[["zNear","zFar"]],detachShader:[["program","shader"]],disable:[["cap"]],disableVertexAttribArray:[["index"]],drawArrays:[["mode","first","count"]],drawArraysInstanced:[["mode","first","count","instanceCount"]],drawBuffers:[["buffers"]],drawElements:[["mode","count","type","offset"]],drawElementsInstanced:[["mode","count","type","offset","instanceCount"]],drawRangeElements:[["mode","start","end","count","type","offset"]],enable:[["cap"]],enableVertexAttribArray:[["index"]],endQuery:[["target"]],endTransformFeedback:[[]],fenceSync:[["condition","flags"]],finish:[[]],flush:[[]],framebufferRenderbuffer:[["target","attachment","renderbuffertarget","renderbuffer"]],framebufferTexture2D:[["target","attachment","textarget","texture","level"]],framebufferTextureLayer:[["target","attachment","texture","level","layer"]],frontFace:[["mode"]],generateMipmap:[["target"]],getActiveAttrib:[["program","index"]],getActiveUniform:[["program","index"]],getActiveUniformBlockName:[["program","uniformBlockIndex"]],getActiveUniformBlockParameter:[["program","uniformBlockIndex","pname"]],getActiveUniforms:[["program","uniformIndices","pname"]],getAttachedShaders:[["program"]],getAttribLocation:[["program","name"]],getBufferParameter:[["target","pname"]],getBufferSubData:[["target","srcByteOffset","dstBuffer","dstOffset","length"]],getContextAttributes:[[]],getError:[[]],getExtension:[["extensionName"],["name"]],getFragDataLocation:[["program","name"]],getFramebufferAttachmentParameter:[["target","attachment","pname"]],getIndexedParameter:[["target","index"]],getInternalformatParameter:[["target","internalformat","pname"]],getParameter:[["pname"]],getProgramInfoLog:[["program"]],getProgramParameter:[["program","pname"]],getQuery:[["target","pname"]],getQueryParameter:[["query","pname"]],getRenderbufferParameter:[["target","pname"]],getSamplerParameter:[["sampler","pname"]],getShaderInfoLog:[["shader"]],getShaderParameter:[["shader","pname"]],getShaderPrecisionFormat:[["shadertype","precisiontype"]],getShaderSource:[["shader"]],getSupportedExtensions:[[]],getSyncParameter:[["sync","pname"]],getTexParameter:[["target","pname"]],getTransformFeedbackVarying:[["program","index"]],getUniform:[["program","location"]],getUniformBlockIndex:[["program","uniformBlockName"]],getUniformIndices:[["program","uniformNames"]],getUniformLocation:[["program","name"]],getVertexAttrib:[["index","pname"]],getVertexAttribOffset:[["index","pname"]],hint:[["target","mode"]],invalidateFramebuffer:[["target","attachments"]],invalidateSubFramebuffer:[["target","attachments","x","y","width","height"]],isBuffer:[["buffer"]],isContextLost:[[]],isEnabled:[["cap"]],isFramebuffer:[["framebuffer"]],isProgram:[["program"]],isQuery:[["query"]],isRenderbuffer:[["renderbuffer"]],isSampler:[["sampler"]],isShader:[["shader"]],isSync:[["sync"]],isTexture:[["texture"]],isTransformFeedback:[["tf"]],isVertexArray:[["vertexArray"]],lineWidth:[["width"]],linkProgram:[["program"]],pauseTransformFeedback:[[]],pixelStorei:[["pname","param"]],polygonOffset:[["factor","units"]],readBuffer:[["src"]],readPixels:[["x","y","width","height","format","type","dstData"],["x","y","width","height","format","type","offset"],["x","y","width","height","format","type","pixels"],["x","y","width","height","format","type","dstData","dstOffset"]],renderbufferStorage:[["target","internalformat","width","height"]],renderbufferStorageMultisample:[["target","samples","internalformat","width","height"]],resumeTransformFeedback:[[]],sampleCoverage:[["value","invert"]],samplerParameterf:[["sampler","pname","param"]],samplerParameteri:[["sampler","pname","param"]],scissor:[["x","y","width","height"]],shaderSource:[["shader","source"]],stencilFunc:[["func","ref","mask"]],stencilFuncSeparate:[["face","func","ref","mask"]],stencilMask:[["mask"]],stencilMaskSeparate:[["face","mask"]],stencilOp:[["fail","zfail","zpass"]],stencilOpSeparate:[["face","fail","zfail","zpass"]],texImage2D:[["target","level","internalformat","format","type","source"],["target","level","internalformat","width","height","border","format","type","pboOffset"],["target","level","internalformat","width","height","border","format","type","pixels"],["target","level","internalformat","width","height","border","format","type","source"],["target","level","internalformat","width","height","border","format","type","srcData","srcOffset"]],texImage3D:[["target","level","internalformat","width","height","depth","border","format","type","pboOffset"],["target","level","internalformat","width","height","depth","border","format","type","source"],["target","level","internalformat","width","height","depth","border","format","type","srcData"],["target","level","internalformat","width","height","depth","border","format","type","srcData","srcOffset"]],texParameterf:[["target","pname","param"]],texParameteri:[["target","pname","param"]],texStorage2D:[["target","levels","internalformat","width","height"]],texStorage3D:[["target","levels","internalformat","width","height","depth"]],texSubImage2D:[["target","level","xoffset","yoffset","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","pboOffset"],["target","level","xoffset","yoffset","width","height","format","type","pixels"],["target","level","xoffset","yoffset","width","height","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","srcData","srcOffset"]],texSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","pboOffset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","source"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","srcData","srcOffset"]],transformFeedbackVaryings:[["program","varyings","bufferMode"]],uniform1f:[["location","x"]],uniform1fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1i:[["location","x"]],uniform1iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1ui:[["location","v0"]],uniform1uiv:[["location","data","srcOffset","srcLength"]],uniform2f:[["location","x","y"]],uniform2fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2i:[["location","x","y"]],uniform2iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2ui:[["location","v0","v1"]],uniform2uiv:[["location","data","srcOffset","srcLength"]],uniform3f:[["location","x","y","z"]],uniform3fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3i:[["location","x","y","z"]],uniform3iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3ui:[["location","v0","v1","v2"]],uniform3uiv:[["location","data","srcOffset","srcLength"]],uniform4f:[["location","x","y","z","w"]],uniform4fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4i:[["location","x","y","z","w"]],uniform4iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4ui:[["location","v0","v1","v2","v3"]],uniform4uiv:[["location","data","srcOffset","srcLength"]],uniformBlockBinding:[["program","uniformBlockIndex","uniformBlockBinding"]],uniformMatrix2fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x3fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x3fv:[["location","transpose","data","srcOffset","srcLength"]],useProgram:[["program"]],validateProgram:[["program"]],vertexAttrib1f:[["index","x"]],vertexAttrib1fv:[["index","values"]],vertexAttrib2f:[["index","x","y"]],vertexAttrib2fv:[["index","values"]],vertexAttrib3f:[["index","x","y","z"]],vertexAttrib3fv:[["index","values"]],vertexAttrib4f:[["index","x","y","z","w"]],vertexAttrib4fv:[["index","values"]],vertexAttribDivisor:[["index","divisor"]],vertexAttribI4i:[["index","x","y","z","w"]],vertexAttribI4iv:[["index","values"]],vertexAttribI4ui:[["index","x","y","z","w"]],vertexAttribI4uiv:[["index","values"]],vertexAttribIPointer:[["index","size","type","stride","offset"]],vertexAttribPointer:[["index","size","type","normalized","stride","offset"]],viewport:[["x","y","width","height"]],waitSync:[["sync","flags","timeout"]]};class Uh{static getNames(e,t){const n=Bh[e];if(!n||0===n.length)return null;for(const e of n)if(e.length===t)return e;let r=null;for(const e of n)e.length>=t&&(null===r||e.lengthi.length&&(i=e);return i}static getName(e,t,n){const r=Uh.getNames(e,n);return r&&t>=0&&t{const e={};for(let t=0;t<64;t++)e["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;return e})();class qh{constructor(e){this.sources=e.sources||[],this.names=e.names||[],this.sourceRoot=e.sourceRoot||"",this.lines=qh.parseMappings(e.mappings||"")}originalPositionFor(e,t){const n={source:null,line:null,column:null,name:null},r=e-1;if(r<0||r>=this.lines.length)return n;const i=this.lines[r];if(!i||0===i.length)return n;const s=this.findSegment(i,t);if(!s)return n;const o=s.sourceIndex>=0&&s.sourceIndex=0&&s.nameIndex>1,o=e[s];o.generatedColumn<=t?(i=o,n=s+1):r=s-1}return i}static parseMappings(e){const t=[];let n=0,r=0,i=0,s=0;const o=e.split(";");for(let e=0;e0){const e=a.split(",");for(let t=0;t=4&&(n+=o[1],r+=o[2],i+=o[3],a.sourceIndex=n,a.originalLine=r,a.originalColumn=i,o.length>=5&&(s+=o[4],a.nameIndex=s)),l.push(a)}}l.sort((e,t)=>e.generatedColumn-t.generatedColumn),t.push(l)}return t}static decodeSegment(e){const t=[];let n=0;for(;n>>=1,t.push(o?-r:r)}return t}}var Qh=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})};class Zh{constructor(e){this.cache=new Map,this.inflight=new Map,this.fetchFn=e||("undefined"!=typeof fetch?fetch.bind(globalThis):void 0)}resolveFrames(e){return Qh(this,void 0,void 0,function*(){return e&&0!==e.length?Promise.all(e.map(e=>this.resolveFrame(e))):e||[]})}resolveFrame(e){return Qh(this,void 0,void 0,function*(){const t=Zh.parseFrame(e);if(!t)return e;let n;try{n=yield this.getConsumer(t.url)}catch(t){return e}if(!n)return e;const r=n.originalPositionFor(t.line,t.column);return r.source&&null!==r.line?Zh.formatFrame(t.functionName,r.name,r.source,r.line,r.column||0):e})}static parseFrame(e){if(!e)return null;let t=e.match(/^(.*?)\s*\((.+):(\d+):(\d+)\)\s*$/);return t?{functionName:t[1].trim(),url:t[2],line:parseInt(t[3],10),column:parseInt(t[4],10)}:(t=e.match(/^\s*(.+):(\d+):(\d+)\s*$/),t?{functionName:"",url:t[1].trim(),line:parseInt(t[2],10),column:parseInt(t[3],10)}:null)}static formatFrame(e,t,n,r,i){const s=t||e,o=n+":"+r+":"+i;return s?s+" ("+o+")":o}getConsumer(e){return Qh(this,void 0,void 0,function*(){if(this.cache.has(e))return this.cache.get(e);const t=this.inflight.get(e);if(t)return t;const n=this.loadConsumer(e).then(t=>(this.cache.set(e,t),this.inflight.delete(e),t)).catch(()=>(this.cache.set(e,null),this.inflight.delete(e),null));return this.inflight.set(e,n),n})}loadConsumer(e){return Qh(this,void 0,void 0,function*(){if(!this.fetchFn)return null;const t=yield this.fetchFn(e);if(!t.ok)return null;const n=yield t.text(),r=Zh.extractSourceMappingURL(n);if(!r)return null;let i;if(0===r.indexOf("data:"))i=Zh.parseDataUri(r);else{const t=Zh.resolveUrl(r,e),n=yield this.fetchFn(t);if(!n.ok)return null;i=yield n.json()}return i&&"string"==typeof i.mappings?new qh(i):null})}static extractSourceMappingURL(e){const t=/\/\/[#@]\s*sourceMappingURL=(\S+)\s*$/gm;let n,r=null;for(;null!==(n=t.exec(e));)r=n[1];return r}static parseDataUri(e){const t=e.indexOf(",");if(-1===t)return null;const n=e.substring(0,t),r=e.substring(t+1);try{const e=/;base64/i.test(n)?Zh.decodeBase64(r):decodeURIComponent(r);return JSON.parse(e)}catch(e){return null}}static decodeBase64(e){if("function"==typeof atob)return atob(e);const t=globalThis.Buffer;if(t)return t.from(e,"base64").toString("utf-8");throw new Error("No base64 decoder available.")}static resolveUrl(e,t){try{return new URL(e,t).href}catch(t){return e}}}function Jh(e){return e&&(e.text||e.name)||""}function ed(e,t){const n=[];if(!e||!t)return n;const r=e.DrawCall,i=t.DrawCall;ad("uniform",r&&r.uniforms,i&&i.uniforms,n),ad("uniformBlock",r&&r.uniformBlocks,i&&i.uniformBlocks,n);const s=sd(e,t);for(const r of s){if(td[r])continue;const i=e[r],s=t[r];(rd(i)||rd(s))&&od(i,s,r,n)}return n}const td={id:!0,name:!0,commandArguments:!0,result:!0,status:!0,marker:!0,text:!0,startTime:!0,commandEndTime:!0,endTime:!0,stackTrace:!0,consumeCommandId:!0,VisualState:!0},nd={__SPECTOR_Object_TAG:!0,__SPECTOR_Object_CustomData:!0,__SPECTOR_Metadata:!0,customData:!0,visual:!0,visualPixels:!0,VisualState:!0,texture:!0,sampler:!0,location:!0,source:!0,translatedSource:!0,analyserName:!0,uniforms:!0,uniformBlocks:!0,length:!0};function rd(e){return null!==e&&"object"==typeof e}function id(e){if(!rd(e))return null;const t=e.__SPECTOR_Object_TAG||("string"==typeof e.typeName&&"id"in e?e:null);return t&&"string"==typeof t.typeName?t.typeName:null}function sd(e,t){const n=[],r={},i=e=>{if(rd(e))for(const t in e)e.hasOwnProperty(t)&&!r[t]&&(r[t]=!0,n.push(t))};return i(e),i(t),n}function od(e,t,n,r,i=0){const s=id(e),o=id(t);if(null!==s||null!==o){const e=null!==s?s:"(absent)",t=null!==o?o:"(absent)";return void(e!==t&&r.push({path:n,previous:e,current:t}))}const a=rd(e),l=rd(t);if(!a&&!l){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}if(a!==l||i>=8){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}for(const s of sd(e,t))nd[s]||od(e?e[s]:void 0,t?t[s]:void 0,n+"."+s,r,i+1)}function ad(e,t,n,r){const i=hd(t),s=hd(n),o=[],a={};for(const e in i)i.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const e in s)s.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const t of o){const n=i.hasOwnProperty(t)?i[t]:void 0,o=s.hasOwnProperty(t)?s[t]:void 0,a=n?dd(n.value):"(absent)",l=o?dd(o.value):"(absent)";a!==l&&r.push({path:e+" "+t,previous:a,current:l}),ld(e+" "+t,n,o,r)}}function ld(e,t,n,r){const i=t&&t.texture,s=n&&n.texture;(rd(i)||rd(s))&&cd(e+" texture",i,s,r);const o=t&&t.textures,a=n&&n.textures,l=Array.isArray(o)?o.length:0,u=Array.isArray(a)?a.length:0,c=Math.max(l,u);for(let t=0;t0?o[t]:void 0,u>0?a[t]:void 0,r)}const ud=["width","height","depth","format","internalFormat","textureType"];function cd(e,t,n,r){(rd(t)||rd(n))&&(function(e,t,n,r){for(const i of ud){const s=t?t[i]:void 0,o=n?n[i]:void 0;if(void 0===s&&void 0===o)continue;const a=dd(s),l=dd(o);a!==l&&r.push({path:e+" "+i,previous:a,current:l})}}(e,t,n,r),function(e,t,n,r){if(rd(t)||rd(n))for(const i of sd(t,n)){const s=t?t[i]:void 0,o=n?n[i]:void 0,a="string"==typeof s,l="string"==typeof o;(a||l)&&s!==o&&r.push({path:e+" ("+i+")",previous:a?"(image)":"(absent)",current:l?"(image)":"(absent)",previousImage:a?s:void 0,currentImage:l?o:void 0})}}(e,t&&t.visual,n&&n.visual,r))}function hd(e){const t={};if(Array.isArray(e))for(const n of e)n&&"string"==typeof n.name&&(t[n.name]=n);return t}function dd(e){if(void 0===e)return"(absent)";if(null===e)return"null";try{return JSON.stringify(e)}catch(t){return String(e)}}function fd(e,t){for(let n=0;n{if(this.store.getSnapshot().currentCapture)switch(e){case 0:this._displayCaptures();break;case 40:this._displayCurrentCapture();break;case 10:this._displayInformation();break;case 20:this._displayInitState();break;case 30:this._displayEndState();break;case 60:this._displayCompare()}else this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))},this.handleSearchTextChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{searchText:e})),this._search(e)},this.handleCompareOnlyDifferencesChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{compareOnlyDifferences:e}))},this.handleCompareCommandSelected=e=>{null!=e&&(this._currentCommandId=e,this._displayCurrentCapture())},this.handleCommandSelected=e=>{this.selectCommand(e)},this.openTextureViewer=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{textureViewer:{open:!0,src:e.src,label:e.label,pixelated:e.pixelated,raw:e.raw||null}}))},this.closeTextureViewer=()=>{this.store.setState(e=>Object.assign(Object.assign({},e),{textureViewer:Object.assign(Object.assign({},e.textureViewer),{open:!1})}))},this.handleVisualStateSelected=e=>{this.selectVisualState(e)},this.handleVertexSelected=e=>{this.selectCommand(e),this._openShader(!1)},this.handleFragmentSelected=e=>{this.selectCommand(e),this._openShader(!0)},this.handleShaderSelected=e=>{var t;const n=null===(t=this.store.getSnapshot().commands[e])||void 0===t?void 0:t.capture.shader;n&&(this.selectCommand(e),this._openCapturedShader(n))},this.handleShaderSourceOpen=(e,t)=>{this._openCapturedShader(e,t)},this.handleSourceCodeChanged=e=>{this.onSourceCodeChanged.trigger(e)},this.handleSourceCodeClose=()=>{this._displayCurrentCapture()},this.handleSourceCodeTabChange=(e,t)=>{this.store.setState(n=>n.sourceCodeState?Object.assign(Object.assign({},n),{sourceCodeState:Object.assign(Object.assign({},n.sourceCodeState),{fragment:e,translated:t})}):n)},this.handleBeautifyChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{beautify:e})}):t)},this.handlePreprocessChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{preprocessed:e})}):t)},this.handleSaveRequested=e=>{this.saveCapture(e)},this.handleCaptureLoaded=e=>{this.addCapture(e)},this.handleClose=()=>{this.hide()},this._rootPlaceHolder=e||document.body,this.onSourceCodeChanged=new l,this.store=new ft(Object.assign({},pd)),this._container=document.createElement("div"),this._container.className="spector-react-result-view",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(yt.Provider,{value:this},(0,dt.createElement)(Mh))),this._rootPlaceHolder.addEventListener("keydown",e=>{if(40!==this.store.getSnapshot().menuStatus)return;const t=e.keyCode;38===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousCommand()):40===t?(e.preventDefault(),e.stopPropagation(),this._selectNextCommand()):33===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousVisualState()):34===t&&(e.preventDefault(),e.stopPropagation(),this._selectNextVisualState())})}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}addCapture(e){return this.store.setState(t=>{const n=t.captures.map(e=>({capture:e.capture,active:!1}));return Object.assign(Object.assign({},t),{captures:[{capture:e,active:!0},...n],currentCapture:e})}),this._currentCommandId=-1,this._displayCurrentCapture(),0}selectCapture(e){this._currentCommandId=-1,this.store.setState(t=>{var n,r;const i=t.captures.map((t,n)=>({capture:t.capture,active:n===e}));return Object.assign(Object.assign({},t),{captures:i,currentCapture:null!==(r=null===(n=i[e])||void 0===n?void 0:n.capture)&&void 0!==r?r:null})}),this._displayCurrentCapture()}selectCommand(e){const t=this.store.getSnapshot();if(e<0||e>=t.commands.length)return;const n=t.commands[e];this._currentCommandId=n.capture.id;const r=n.visualStateIndex,i=this._buildCommandDetail(e,t.commands,t.visualStates);this.store.setState(t=>Object.assign(Object.assign({},t),{commands:t.commands.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentCommandIndex:e,visualStates:t.visualStates.map((e,t)=>e.active!==(t===r)?Object.assign(Object.assign({},e),{active:t===r}):e),currentVisualStateIndex:r,commandDetailData:i}))}selectVisualState(e){const t=this.store.getSnapshot();if(e<0||e>=t.visualStates.length)return;const n=t.visualStates[e].commandIndex;if(n===Number.MIN_VALUE)return void this._displayInitState();if(n===Number.MAX_VALUE)return void this._displayEndState();n>=0&&(this._currentCommandId=t.commands[n].capture.id);const r=n>=0?this._buildCommandDetail(n,t.commands,t.visualStates):t.commandDetailData;this.store.setState(t=>Object.assign(Object.assign({},t),{visualStates:t.visualStates.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentVisualStateIndex:e,commands:n>=0?t.commands.map((e,t)=>e.active!==(t===n)?Object.assign(Object.assign({},e),{active:t===n}):e):t.commands,currentCommandIndex:n>=0?n:t.currentCommandIndex,commandDetailData:r}))}showSourceCodeError(e){this.store.setState(t=>Object.assign(Object.assign({},t),{sourceCodeError:e}))}saveCapture(e){const t=JSON.stringify(e,null,4),n=new Blob([t],{type:"octet/stream"}),r="capture "+new Date(e.startTime).toTimeString().split(" ")[0]+".json",i=document.createElement("a"),s=window.URL.createObjectURL(n);i.setAttribute("href",s),i.setAttribute("download",r),i.click()}_displayCaptures(){this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))}_displayCompare(){const e=this.store.getSnapshot(),t=e.captures.findIndex(e=>e.active),n=t>=0?e.captures[t]:null,r=n?e.captures[t+1]:null;if(!n||!r)return void this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:60,canCompare:!1,compareRows:[],compareSummary:{added:0,removed:0,changed:0,unchanged:0},compareLabel:""}));const i=function(e,t){const n=function(e,t){const n=e.length,r=t.length,i=e.map(Jh),s=t.map(Jh),o=[];for(let e=0;e<=n;e++)o.push(new Array(r+1).fill(0));for(let e=n-1;e>=0;e--)for(let t=r-1;t>=0;t--)o[e][t]=i[e]===s[t]?o[e+1][t+1]+1:Math.max(o[e+1][t],o[e][t+1]);const a=[];let l=[];const u=()=>{for(const e of l)a.push(e);l=[]};let c=0,h=0;for(;c0?a.push({type:"changed",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id,fieldDiffs:n}):a.push({type:"unchanged",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id}),c++,h++}else if(o[c+1][h]>=o[c][h+1])l.push({type:"removed",name:e[c].name,previousText:e[c].text,indexA:c}),c++;else{const n=fd(l,t[h].name);n?a.push({type:"changed",name:t[h].name,previousText:n.previousText,currentText:t[h].text,indexA:n.indexA,indexB:h,commandId:t[h].id,fieldDiffs:ed(e[n.indexA],t[h])}):(u(),a.push({type:"added",name:t[h].name,currentText:t[h].text,indexB:h,commandId:t[h].id})),h++}for(;cObject.assign(Object.assign({},e),{menuStatus:60,canCompare:!0,compareRows:i.rows,compareSummary:i.summary,compareLabel:s}))}static _captureLabel(e){try{return new Date(e.startTime).toTimeString().split(" ")[0]}catch(e){return"capture"}}_displayInformation(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];zh(n,"Canvas",t.canvas,e.searchText),zh(n,"Context",t.context,e.searchText);const r=[];for(const n of t.analyses){const t="Primitives"===n.analyserName?"Vertices count":n.analyserName;zh(r,t,n,e.searchText)}zh(r,"Frame Memory Changes",t.frameMemory,e.searchText),zh(r,"Total Memory (seconds since application start: bytes)",t.memory,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:10,commandCount:t.commands.length,informationLeft:n,informationRight:r}))}_displayInitState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.initState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:20,commandCount:t.commands.length,initStateData:n}))}_displayEndState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.endState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:30,commandCount:t.commands.length,endStateData:n}))}_displayCurrentCapture(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=e.searchText,r=e.captures.map(e=>({capture:e.capture,active:e.capture===t})),i=[];i.push({VisualState:t.initState.VisualState,time:t.startTime,commandIndex:Number.MIN_VALUE,active:!1,previousVisualStateIndex:-1,nextVisualStateIndex:-1});const s=[];let o=0,a=!1,l=-1,u=-1;for(let e=0;e0?c-1:-1,nextCommandIndex:-1,visualStateIndex:o,active:!1};if(c>0&&(s[c-1].nextCommandIndex=c),r.VisualState){const e=i.length,t=i.length-1,n={VisualState:r.VisualState,time:r.endTime,commandIndex:c,active:!1,previousVisualStateIndex:t,nextVisualStateIndex:-1};i[t].nextVisualStateIndex=e,i.push(n),o=e,a=!0}else a||(i[0].commandIndex=c,a=!0);h.visualStateIndex=o,s.push(h),(-1===this._currentCommandId&&0===c||this._currentCommandId===r.id)&&(l=c,u=o)}l>=0&&(s[l].active=!0,this._currentCommandId=s[l].capture.id),u>=0&&(i[u].active=!0);let c=[];l>=0&&(c=this._buildCommandDetail(l,s,i)),this.store.setState(e=>Object.assign(Object.assign({},e),{captures:r,menuStatus:40,commandCount:t.commands.length,commands:s,currentCommandIndex:l,visualStates:i,currentVisualStateIndex:u,sourceCodeState:null,sourceCodeError:"",commandDetailData:c}))}_openShader(e){const t=this.store.getSnapshot();if(t.currentCommandIndex<0||t.currentCommandIndex>=t.commands.length)return;const n=t.commands[t.currentCommandIndex].capture.DrawCall;if(!n||!n.shaders||n.shaders.length<2)return;const r={programId:n.programStatus.program.__SPECTOR_Object_TAG.id,nameVertex:n.shaders[0].name,nameFragment:n.shaders[1].name,sourceVertex:n.shaders[0].source,sourceFragment:n.shaders[1].source,translatedSourceVertex:n.shaders[0].translatedSource,translatedSourceFragment:n.shaders[1].translatedSource,fragment:e,translated:!1,editable:n.programStatus.RECOMPILABLE,beautify:!0,preprocessed:!1,singleShader:!1,sourceVertexLog:n.shaders[0].infoLog||"",sourceFragmentLog:n.shaders[1].infoLog||"",programLog:n.programStatus.infoLog||""},i=this._buildCommandDetail(t.currentCommandIndex,t.commands,t.visualStates);this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:"",commandDetailData:i}))}_openCapturedShader(e,t=""){if(!e||"string"!=typeof e.source)return;const n="FRAGMENT_SHADER"===e.shaderType,r={programId:-1,nameVertex:n?"":e.name,nameFragment:n?e.name:"",sourceVertex:n?"":e.source,sourceFragment:n?e.source:"",translatedSourceVertex:n?"":e.translatedSource||"",translatedSourceFragment:n&&e.translatedSource||"",fragment:n,translated:!1,editable:!1,beautify:!0,preprocessed:!1,singleShader:!0,sourceVertexLog:n?"":e.infoLog||"",sourceFragmentLog:n&&e.infoLog||"",programLog:t};this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:""}))}_buildCommandDetail(e,t,n){if(e<0||e>=t.length)return[];const r=t[e],i=n[r.visualStateIndex],s=this._resolvedStackTraces.get(r.capture.id),o=function(e,t,n){const r=[];t&&r.push({type:"visualState",visualState:t});let i="Unknown";switch(e.status){case 50:i="Deprecated";break;case 10:i="Unused";break;case 20:i="Disabled";break;case 30:i="Redundant";break;case 40:i="Valid"}const s=Ph.getMDNLink(e.name);e.result?zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,result:e.result,status:i},""):"LOG"!==e.name&&zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,status:i},"");for(const t in e)"VisualState"!==t&&"result"!==t&&("commandArguments"===t&&Array.isArray(e.commandArguments)?Kh(r,e.name,e.commandArguments):Xh(r,t,e)||("stackTrace"===t&&Array.isArray(e.stackTrace)?zh(r,"stackTrace",n||e.stackTrace,""):"object"==typeof e[t]&&zh(r,t,e[t],"")));return r}(r.capture,null==i?void 0:i.VisualState,s);return s||this._resolveStackTraceAsync(r.capture),o}_resolveStackTraceAsync(e){const t=e.id;this._resolvedStackTraces.has(t)||this._resolvingStackTraces.has(t)||e.stackTrace&&0!==e.stackTrace.length&&(this._resolvingStackTraces.add(t),this._sourceMapResolver.resolveFrames(e.stackTrace).then(n=>{this._resolvingStackTraces.delete(t),this._resolvedStackTraces.set(t,n);let r=!1;for(let t=0;tObject.assign(Object.assign({},t),{commandDetailData:e}))}}).catch(()=>{this._resolvingStackTraces.delete(t)}))}_selectPreviousCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.previousCommandIndex<0||this.selectCommand(t.previousCommandIndex)}_selectNextCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.nextCommandIndex<0||this.selectCommand(t.nextCommandIndex)}_selectPreviousVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.previousVisualStateIndex<0||this.selectVisualState(t.previousVisualStateIndex)}_selectNextVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.nextVisualStateIndex<0||this.selectVisualState(t.nextVisualStateIndex)}_search(e){switch(this.store.getSnapshot().menuStatus){case 0:case 40:this._displayCurrentCapture();break;case 30:this._displayEndState();break;case 10:this._displayInformation();break;case 20:this._displayInitState()}this.store.setState(e=>Object.assign(Object.assign({},e),{searchText:""}))}}class gd{constructor(e,t={}){this.worker=e,this.captureTimeout=t.captureTimeout||1e4,this.disposed=!1,this.captureTimer=null,this.onCapture=new l,this.onCaptureStarted=new l,this.onError=new l,this.onFps=new l,this.onContextReady=new l,this.messageHandler=this.handleMessage.bind(this),this.worker.addEventListener("message",this.messageHandler)}triggerCapture(e=0,t=0,n=!1,r=!1){if(this.disposed)return;this.clearCaptureTimer();const i={type:"spector:trigger-capture",version:1,canvasIndex:e,commandCount:t,quickCapture:n,fullCapture:r};this.worker.postMessage(i),this.captureTimer=setTimeout(()=>{this.onError.trigger("Capture timed out after "+this.captureTimeout+"ms"),this.captureTimer=null},this.captureTimeout)}dispose(){this.disposed||(this.disposed=!0,this.clearCaptureTimer(),this.worker.removeEventListener("message",this.messageHandler),this.onCapture.clear(),this.onCaptureStarted.clear(),this.onError.clear(),this.onFps.clear(),this.onContextReady.clear())}handleMessage(e){const t=e.data;if(!function(e){return null!=e&&"object"==typeof e&&"string"==typeof e.type&&0===e.type.indexOf("spector:")}(t))return;const n=t;switch(n.type){case"spector:context-ready":this.onContextReady.trigger({canvasCount:n.canvasCount,canvasWidth:n.canvasWidth,canvasHeight:n.canvasHeight});break;case"spector:capture-started":this.onCaptureStarted.trigger(void 0);break;case"spector:capture-complete":this.clearCaptureTimer(),this.onCapture.trigger(n.capture);break;case"spector:error":this.clearCaptureTimer(),this.onError.trigger(n.error);break;case"spector:fps":this.onFps.trigger(n.fps)}}clearCaptureTimer(){null!=this.captureTimer&&(clearTimeout(this.captureTimer),this.captureTimer=null)}}var Ed=n(72),vd=n.n(Ed),Cd=n(825),Dd=n.n(Cd),Sd=n(659),Ad=n.n(Sd),_d=n(56),yd=n.n(_d),bd=n(540),Td=n.n(bd),Rd=n(113),xd=n.n(Rd),wd=n(377),Fd={};Fd.styleTagTransform=xd(),Fd.setAttributes=yd(),Fd.insert=Ad().bind(null,"html"),Fd.domAPI=Dd(),Fd.insertStyleElement=Td(),vd()(wd.A,Fd),wd.A&&wd.A.locals&&wd.A.locals;var Nd=n(160),Ld={};Ld.styleTagTransform=xd(),Ld.setAttributes=yd(),Ld.insert=Ad().bind(null,"html"),Ld.domAPI=Dd(),Ld.insertStyleElement=Td(),vd()(Nd.A,Ld),Nd.A&&Nd.A.locals&&Nd.A.locals;class Od{constructor(e){this.timeSpy=e,this.init()}spyXRSession(e){this.currentXRSession&&this.unspyXRSession();for(const e of at.getRequestAnimationFrameFunctionNames())y.resetOriginFunction(this.timeSpy.getSpiedScope(),e);this.timeSpy.spyRequestAnimationFrame("requestAnimationFrame",e),this.currentXRSession=e}unspyXRSession(){if(this.currentXRSession){y.resetOriginFunction(this.currentXRSession,"requestAnimationFrame"),this.currentXRSession=void 0;for(const e of at.getRequestAnimationFrameFunctionNames())this.timeSpy.spyRequestAnimationFrame(e,this.timeSpy.getSpiedScope())}}init(){if(!navigator.xr)return;class e extends XRWebGLLayer{constructor(e,t,n){super(e,t,n),this.glContext=t}getContext(){return this.glContext}}class t extends XRWebGLBinding{constructor(e,t){super(e,t),this.glContext=t}createProjectionLayer(e){const t=super.createProjectionLayer(e);return t.glContext=this.glContext,t}}window.XRWebGLLayer=e,window.XRWebGLBinding=t;const n=navigator.xr.requestSession;Object.defineProperty(navigator.xr,"requestSessionInternal",{writable:!0}),navigator.xr.requestSessionInternal=n,Object.defineProperty(navigator.xr,"requestSession",{writable:!0}),navigator.xr.requestSession=(e,t)=>((e,t)=>navigator.xr.requestSessionInternal(e,t).then(e=>{const t=e;return t._updateRenderState=e.updateRenderState,t.updateRenderState=e=>function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){if(e.baseLayer){const n=e.baseLayer;t.glContext=n.getContext()}if(e.layers)for(const n of e.layers){const e=n;e.glContext&&(t.glContext=e.glContext)}return t._updateRenderState(e)}),this.spyXRSession(t),e.addEventListener("end",()=>{this.unspyXRSession()}),Promise.resolve(e)}))(e,t)}}const Id={CaptureMenu:_t,ResultView:md};class kd{static getFirstAvailable3dContext(e){return this.tryGetContextFromHelperField(e)||this.tryGetContextFromCanvas(e,"webgl")||this.tryGetContextFromCanvas(e,"experimental-webgl")||this.tryGetContextFromCanvas(e,"webgl2")||this.tryGetContextFromCanvas(e,"experimental-webgl2")}static tryGetContextFromHelperField(e){const t=e instanceof HTMLCanvasElement?e.getAttribute("__spector_context_type"):e.__spector_context_type;if(t)return this.tryGetContextFromCanvas(e,t)}static tryGetContextFromCanvas(e,t){let n;try{n=e.getContext(t)}catch(e){}return n}constructor(e={}){this.noFrameTimeout=-1,this.options=Object.assign({enableXRCapture:!1},e),this.captureNextFrames=0,this.captureNextCommands=0,this.quickCapture=!1,this.fullCapture=!1,this.retry=0,this.contexts=[],this.workerBridges=new Map,this.timeSpy=new at,this.onCaptureStarted=new l,this.onCapture=new l,this.onError=new l,this.timeSpy.onFrameStart.add(this.onFrameStart,this),this.timeSpy.onFrameEnd.add(this.onFrameEnd,this),this.timeSpy.onError.add(this.onErrorInternal,this),ct.install(),this.options.enableXRCapture&&(this.xrSpy=new Od(this.timeSpy))}displayUI(e=!1){this.captureMenu||(this.getCaptureUI(),this.captureMenu.onPauseRequested.add(this.pause,this),this.captureMenu.onPlayRequested.add(this.play,this),this.captureMenu.onPlayNextFrameRequested.add(this.playNextFrame,this),this.captureMenu.onCaptureRequested.add(e=>{e&&(e.ref instanceof Worker?this.captureWorker(e.ref):this.captureCanvas(e.ref))},this),setInterval(()=>{this.captureMenu.setFPS(this.getFps())},1e3),e||this.captureMenu.trackPageCanvases(),this.captureMenu.display()),this.resultView||(this.getResultUI(),this.onCapture.add(e=>{this.resultView.display(),this.resultView.addCapture(e)}))}getResultUI(){return this.resultView||(this.resultView=new md,this.resultView.onSourceCodeChanged.add(e=>{this.rebuildProgramFromProgramId(e.programId,e.sourceVertex,e.sourceFragment,t=>{this.referenceNewProgram(e.programId,t),this.resultView.showSourceCodeError(null)},e=>{this.resultView.showSourceCodeError(e)})})),this.resultView}getCaptureUI(){return this.captureMenu||(this.captureMenu=new _t),this.captureMenu}rebuildProgramFromProgramId(e,t,n,r,i){const s=Pe.getFromGlobalStore(e);this.rebuildProgram(s,t,n,r,i)}rebuildProgram(e,t,n,r,i){o.rebuildProgram(e,t,n,r,i)}referenceNewProgram(e,t){Pe.updateInGlobalStore(e,t)}pause(){this.timeSpy.changeSpeedRatio(0)}play(){this.timeSpy.changeSpeedRatio(1)}playNextFrame(){this.timeSpy.playNextFrame()}drawOnlyEveryXFrame(e){this.timeSpy.changeSpeedRatio(e)}getFps(){return this.timeSpy.getFps()}spyCanvases(){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt,this.canvasSpy.onContextRequested.add(this.spyContext,this))}spyCanvas(e){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt(e),this.canvasSpy.onContextRequested.add(this.spyContext,this))}getAvailableContexts(){return this.contexts}setShaderCompileDelay(e){ct.install(),ct.setDelay(e)}clearShaderCompileDelay(){ct.setDelay(0)}getShaderCompileDelay(){return ct.getDelay()}captureCanvas(e,t=0,n=!1,r=!1){const i=this.getAvailableContextSpyByCanvas(e);if(i)this.captureContextSpy(i,t,n,r);else{const i=kd.getFirstAvailable3dContext(e);i?this.captureContext(i,t,n,r):a.error("No webgl context available on the chosen canvas.")}}captureContext(e,t=0,n=!1,r=!1){let i=this.getAvailableContextSpyByCanvas(e.canvas);i||(i=e.getIndexedParameter?new ot({context:e,version:2,recordAlways:!1}):new ot({context:e,version:1,recordAlways:!1}),i.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:i.context.canvas,contextSpy:i})),i&&this.captureContextSpy(i,t,n,r)}captureXRContext(e=0,t=!1,n=!1){this.captureContext(this.getXRContext(),e,t,n)}captureContextSpy(e,t=0,n=!1,r=!1){this.quickCapture=n,this.fullCapture=r,this.capturingContext?this.onErrorInternal("Already capturing a context."):(this.retry=0,this.capturingContext=e,this.capturingContext.setMarker(this.marker),(t=Math.min(t,1e4))>0?this.captureCommands(t):this.captureFrames(1),this.noFrameTimeout=setTimeout(()=>{t>0?this.stopCapture():this.capturingContext&&this.retry>1?this.onErrorInternal("No frames with gl commands detected. Try moving the camera."):this.onErrorInternal("No frames detected. Try moving the camera or implementing requestAnimationFrame.")},1e4))}captureNextFrame(e,t=!1,n=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,0,t,n):this.captureContext(e,0,t,n)}startCapture(e,t,n=!1,r=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,t,n,r):this.captureContext(e,t,n,r)}stopCapture(){if(this.capturingContext){const e=this.capturingContext.stopCapture();if(e.commands.length>0)return this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),this.triggerCapture(e),this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,e;0===this.captureNextCommands&&(this.retry++,this.captureFrames(1))}}setMarker(e){this.marker=e,this.capturingContext&&this.capturingContext.setMarker(e)}clearMarker(){this.marker=null,this.capturingContext&&this.capturingContext.clearMarker()}addRequestAnimationFrameFunctionName(e){this.timeSpy.addRequestAnimationFrameFunctionName(e)}setSpiedScope(e){this.timeSpy.setSpiedScope(e)}log(e){this.capturingContext&&this.capturingContext.log(e)}spyWorkers(e="spector.worker.bundle.js"){ut.startIntercepting(e)}stopSpyingWorkers(){ut.stopIntercepting()}spyWorker(e){let t=this.workerBridges.get(e);return t||(t=new gd(e),t.onCapture.add(e=>{this.triggerCapture(e)},this),t.onError.add(e=>{this.onErrorInternal(e)},this),t.onContextReady.add(t=>{if(this.captureMenu){const n=this.workerBridges.size;this.captureMenu.addCanvasInformation({id:"Worker "+n,width:t.canvasWidth,height:t.canvasHeight,ref:e})}},this),t.onFps.add(e=>{this.captureMenu&&this.captureMenu.setFPS(e)},this),this.workerBridges.set(e,t),t)}captureWorker(e,t=0,n=!1,r=!1){this.workerBridges.has(e)||this.spyWorker(e);const i=this;e.addEventListener("message",function t(n){n.data&&"spector:capture-complete"===n.data.type&&(e.removeEventListener("message",t),i.triggerCapture(n.data.capture))}),e.postMessage({type:"spector:trigger-capture",version:1,canvasIndex:0,commandCount:t,quickCapture:n,fullCapture:r})}captureFrames(e){this.captureNextFrames=e,this.captureNextCommands=0,this.playNextFrame()}captureCommands(e){this.captureNextFrames=0,this.captureNextCommands=e,this.play(),this.capturingContext?(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(e,this.quickCapture,this.fullCapture)):(this.onErrorInternal("No context to capture from."),this.captureNextCommands=0)}spyContext(e){let t=this.getAvailableContextSpyByCanvas(e.context.canvas);t||(t=new ot({context:e.context,version:e.contextVersion,recordAlways:!0}),t.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:t.context.canvas,contextSpy:t})),t.spy()}getAvailableContextSpyByCanvas(e){for(const t of this.contexts)if(t.canvas===e)return t.contextSpy}getXRContext(){return this.options.enableXRCapture||a.error("Cannot retrieve WebXR context if capturing WebXR is disabled."),this.xrSpy.currentXRSession||a.error("No currently active WebXR session."),this.xrSpy.currentXRSession.glContext}onFrameStart(){this.captureNextCommands>0||(this.captureNextFrames>0?(this.capturingContext&&(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(0,this.quickCapture,this.fullCapture)),this.captureNextFrames--):this.capturingContext=void 0)}onFrameEnd(){this.captureNextCommands>0||0===this.captureNextFrames&&this.stopCapture()}triggerCapture(e){this.captureMenu&&this.captureMenu.captureComplete(null),this.onCapture.trigger(e)}onErrorInternal(e){if(a.error(e),this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),!this.capturingContext)throw e;this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,this.retry=0,this.captureMenu&&this.captureMenu.captureComplete(e),this.onError.trigger(e)}}},180(e,t,n){e=n.nmd(e),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/lang"),s=e("../lib/event"),o='.ace_search {background-color: #ddd;color: #666;border: 1px solid #cbcbcb;border-top: 0 none;overflow: hidden;margin: 0;padding: 4px 6px 0 4px;position: absolute;top: 0;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {margin: 0 20px 4px 0;overflow: hidden;line-height: 1.9;}.ace_replace_form {margin-right: 0;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {border-radius: 3px 0 0 3px;background-color: white;color: black;border: 1px solid #cbcbcb;border-right: 0 none;outline: 0;padding: 0;font-size: inherit;margin: 0;line-height: inherit;padding: 0 6px;min-width: 17em;vertical-align: top;min-height: 1.8em;box-sizing: content-box;}.ace_searchbtn {border: 1px solid #cbcbcb;line-height: inherit;display: inline-block;padding: 0 6px;background: #fff;border-right: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;margin: 0;position: relative;color: #666;}.ace_searchbtn:last-child {border-radius: 0 3px 3px 0;border-right: 1px solid #cbcbcb;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn:hover {background-color: #eef1f6;}.ace_searchbtn.prev, .ace_searchbtn.next {padding: 0px 0.7em}.ace_searchbtn.prev:after, .ace_searchbtn.next:after {content: "";border: solid 2px #888;width: 0.5em;height: 0.5em;border-width: 2px 0 0 2px;display:inline-block;transform: rotate(-45deg);}.ace_searchbtn.next:after {border-width: 0 2px 2px 0 ;}.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;font: 16px/16px Arial;padding: 0;height: 14px;width: 14px;top: 9px;right: 7px;position: absolute;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;box-sizing: border-box!important;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;clear: both;}.ace_search_counter {float: left;font-family: arial;padding: 0 8px;}',a=e("../keyboard/hash_handler").HashHandler,l=e("../lib/keys");r.importCssString(o,"ace_searchbox");var u=function(e,t,n){var i=r.createElement("div");r.buildDom(["div",{class:"ace_search right"},["span",{action:"hide",class:"ace_searchbtn_close"}],["div",{class:"ace_search_form"},["input",{class:"ace_search_field",placeholder:"Search for",spellcheck:"false"}],["span",{action:"findPrev",class:"ace_searchbtn prev"},"​"],["span",{action:"findNext",class:"ace_searchbtn next"},"​"],["span",{action:"findAll",class:"ace_searchbtn",title:"Alt-Enter"},"All"]],["div",{class:"ace_replace_form"},["input",{class:"ace_search_field",placeholder:"Replace with",spellcheck:"false"}],["span",{action:"replaceAndFindNext",class:"ace_searchbtn"},"Replace"],["span",{action:"replaceAll",class:"ace_searchbtn"},"All"]],["div",{class:"ace_search_options"},["span",{action:"toggleReplace",class:"ace_button",title:"Toggle Replace mode",style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{class:"ace_search_counter"}],["span",{action:"toggleRegexpMode",class:"ace_button",title:"RegExp Search"},".*"],["span",{action:"toggleCaseSensitive",class:"ace_button",title:"CaseSensitive Search"},"Aa"],["span",{action:"toggleWholeWords",class:"ace_button",title:"Whole Word Search"},"\\b"],["span",{action:"searchInSelection",class:"ace_button",title:"Search In Selection"},"S"]]],i),this.element=i.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),r.importCssString(o,"ace_searchbox",e.container)};(function(){this.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},this.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;s.addListener(e,"mousedown",function(e){setTimeout(function(){t.activeInput.focus()},0),s.stopPropagation(e)}),s.addListener(e,"click",function(e){var n=(e.target||e.srcElement).getAttribute("action");n&&t[n]?t[n]():t.$searchBarKb.commands[n]&&t.$searchBarKb.commands[n].exec(t),s.stopPropagation(e)}),s.addCommandKeyListener(e,function(e,n,r){var i=l.keyCodeToString(r),o=t.$searchBarKb.findKeyCommand(n,i);o&&o.exec&&(o.exec(t),s.stopEvent(e))}),this.$onChange=i.delayedCall(function(){t.find(!1,!1)}),s.addListener(this.searchInput,"input",function(){t.$onChange.schedule(20)}),s.addListener(this.searchInput,"focus",function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()}),s.addListener(this.replaceInput,"focus",function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()})},this.$closeSearchBarKb=new a([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new a,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.editor.getReadOnly()||(e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus())},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),this.setSearchRange=function(e){this.searchRange=e,e?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(e){r.setCssClass(this.replaceOption,"checked",this.searchRange),r.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var t=this.editor.getReadOnly();this.replaceOption.style.display=t?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!t?"":"none",this.find(!1,!1,e)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,n){var i=!this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n,range:this.searchRange})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",i),this.editor._emit("findSearchBox",{match:!i}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,n=0,r=0;if(t){var i=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),s=e.session.doc.positionToIndex(e.selection.anchor);this.searchRange&&(s-=e.session.doc.positionToIndex(this.searchRange.start));for(var o,a=t.lastIndex=0;(o=t.exec(i))&&(n++,(a=o.index)<=s&&r++,!(n>999))&&(o[0]||(t.lastIndex=a+=1,!(a>=i.length))););}this.searchCounter.textContent=r+" of "+(n>999?"999+":n)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(u.prototype),t.SearchBox=u,t.Search=function(e,t){(e.searchBox||new u(e)).show(e.session.getTextRange(),t)}}),ace.require(["ace/ext/searchbox"],function(t){e&&(e.exports=t)})},49(e,t,n){e=n.nmd(e),ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=t.cFunctions="\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b",a=function(){var e=this.$keywords=this.createKeywordMapper({"keyword.control":"break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while|catch|operator|try|throw|using","storage.type":"asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|class|wchar_t|template|char16_t|char32_t","storage.modifier":"const|extern|register|restrict|static|volatile|inline|private|protected|public|friend|explicit|virtual|export|mutable|typename|constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local","keyword.operator":"and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace","variable.language":"this","constant.language":"NULL|true|false|TRUE|FALSE|nullptr"},"identifier"),t=/\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source,n="%"+/(\d+\$)?/.source+/[#0\- +']*/.source+/[,;:_]?/.source+/((-?\d+)|\*(-?\d+\$)?)?/.source+/(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source+/(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source+/(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source;this.$rules={start:[{token:"comment",regex:"//$",next:"start"},{token:"comment",regex:"//",next:"singleLineComment"},i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string",regex:"'(?:"+t+"|.)?'"},{token:"string.start",regex:'"',stateName:"qqstring",next:[{token:"string",regex:/\\\s*$/,next:"qqstring"},{token:"constant.language.escape",regex:t},{token:"constant.language.escape",regex:n},{token:"string.end",regex:'"|$',next:"start"},{defaultToken:"string"}]},{token:"string.start",regex:'R"\\(',stateName:"rawString",next:[{token:"string.end",regex:'\\)"',next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"keyword",regex:"#\\s*(?:include|import|pragma|line|define|undef|version)\\b",next:"directive"},{token:"keyword",regex:"#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b"},{token:"support.function.C99.c",regex:o},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*"},{token:"keyword.operator",regex:/--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],singleLineComment:[{token:"comment",regex:/\\$/,next:"singleLineComment"},{token:"comment",regex:/$/,next:"start"},{defaultToken:"comment"}],directive:[{token:"constant.other.multiline",regex:/\\/},{token:"constant.other.multiline",regex:/.*\\/},{token:"constant.other",regex:"\\s*<.+?>",next:"start"},{token:"constant.other",regex:'\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',next:"start"},{token:"constant.other",regex:"\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",next:"start"},{token:"constant.other",regex:/[^\\\/]+/,next:"start"}]},this.embedRules(i,"doc-",[i.getEndRule("start")]),this.normalizeRules()};r.inherits(a,s),t.c_cppHighlightRules=a}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var i=n[1].length,s=e.findMatchingBracket({row:t,column:i});if(!s||s.row==t)return 0;var o=this.$getIndent(e.getLine(s.row));e.replace(new r(t,0,t,i-1),o)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i,s=e.getLine(n);if(this.startRegionRe.test(s))return this.getCommentRegionBlock(e,s,n);if(i=s.match(this.foldingStartMarker)){var o=i.index;if(i[1])return this.openingBracketBlock(e,i[1],n,o);var a=e.getCommentFoldRange(n,o+i[0].length,1);return a&&!a.isMultiLine()&&(r?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(i=s.match(this.foldingStopMarker))?(o=i.index+i[0].length,i[1]?this.closingBracketBlock(e,i[1],n,o):e.getCommentFoldRange(n,o,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length,a=t+=1,l=e.getLength();++tu)break;var c=this.getFoldWidgetRange(e,"all",t);if(c){if(c.start.row<=s)break;if(c.isMultiLine())t=c.end.row;else if(r==u)break}a=t}}return new i(s,o,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\s*$/),s=e.getLength(),o=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++no)return new i(o,r,n,t.length)}}.call(o.prototype)}),ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./c_cpp_highlight_rules").c_cppHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&"comment"==s[s.length-1].type)return r;if("start"==e)(a=t.match(/^.*[\{\(\[]\s*$/))&&(r+=n);else if("doc-start"==e){if("start"==o)return"";var a;(a=t.match(/^\s*(\/?)\*/))&&(a[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/c_cpp"}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/glsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/c_cpp_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp_highlight_rules").c_cppHighlightRules,s=function(){var e=this.createKeywordMapper({"variable.language":"this",keyword:"layout|attribute|const|uniform|varying|break|continue|do|for|while|if|else|in|out|inout|float|int|void|bool|true|false|lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|samplerCube|struct","constant.language":"radians|degrees|sin|cos|tan|asin|acos|atan|pow|exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|normalize|faceforward|reflect|refract|matrixCompMult|lessThan|lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|texture2DProjLod|textureCube|textureCubeLod|gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|gl_DepthRangeParameters|gl_DepthRange|gl_Position|gl_PointSize|gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData"},"identifier");this.$rules=(new i).$rules,this.$rules.start.forEach(function(t){"function"==typeof t.token&&(t.token=e)})};r.inherits(s,i),t.glslHighlightRules=s}),ace.define("ace/mode/glsl",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/glsl_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp").Mode,s=e("./glsl_highlight_rules").glslHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.$id="ace/mode/glsl"}.call(u.prototype),t.Mode=u}),ace.require(["ace/mode/glsl"],function(t){e&&(e.exports=t)})},429(e,t,n){e=n.nmd(e),ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.require(["ace/theme/monokai"],function(t){e&&(e.exports=t)})}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r](s,s.exports,n),s.loaded=!0,s.exports}return n.amdD=function(){throw new Error("define cannot be used indirect")},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.nc=void 0,n(832),n(49),n(429),n(902),n(180),n(878)})()); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("SPECTOR",[],t):"object"==typeof exports?exports.SPECTOR=t():e.SPECTOR=t()}(self,()=>(()=>{var e={377(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.captureMenuComponent{position:absolute;padding:7px;z-index:99999;top:10px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuComponent.active{visibility:visible;display:block}.captureMenuComponent,.captureMenuComponent:after,.captureMenuComponent:before{box-sizing:content-box}.captureMenuLogComponent{position:absolute;padding:7px;z-index:80000;top:66px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuLogComponent.active{visibility:visible;display:block}.captureMenuLogComponent,.captureMenuLogComponent:after,.captureMenuLogComponent:before{box-sizing:content-box}.captureMenuLogComponent span.error{color:red}.canvasListComponent{float:left;width:50%;height:100%}.canvasListComponent [commandName=onCanvasSelection]{vertical-align:center;line-height:40px;white-space:nowrap;text-overflow:ellipsis;width:190px;display:inline-block;overflow:hidden;margin:0px 5px}.canvasListComponent [commandName=onCanvasSelection]:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.canvasListComponent ul{margin:0px;padding:7px;list-style:none;position:absolute;top:54px;left:-2px;width:400px;border:2px solid #222;background-color:#2c2c2c}.canvasListComponent ul li{margin:5px}.canvasListComponent ul li:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.captureMenuActionsComponent{float:left;width:30%;height:100%;margin-top:7.5px}.captureMenuActionsComponent div{float:left}.captureMenuActionsComponent [commandName=onCaptureRequested]{border-radius:50%;background:#2c2c2c;border:2px solid red;width:21px;height:21px}.captureMenuActionsComponent [commandName=onCaptureRequested]:hover{background:red;cursor:pointer;transition:background .3s;-webkit-transition:background .3s;-moz-transition:background .3s}.captureMenuActionsComponent [commandName=onPlayRequested],.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPlayRequested]:before,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{content:"";position:absolute;display:inline-block;margin-top:6px;margin-left:4px;width:7px;height:7px;border-top:2px solid #f9f9f9;border-right:2px solid #f9f9f9;background-color:#f9f9f9;-moz-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg);z-index:-20}.captureMenuActionsComponent [commandName=onPlayRequested]:after,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:after{content:"";position:absolute;display:inline-block;width:8px;height:20px;background-color:#2c2c2c;z-index:-10}.captureMenuActionsComponent [commandName=onPlayRequested]:hover,.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPauseRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPauseRequested]:before{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:12px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:after{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:7px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{background-color:#2c2c2c}.fpsCounterComponent{float:left;width:20%;vertical-align:center;line-height:40px;white-space:nowrap}',""]);const a=o},160(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,'.resultViewComponent{position:absolute;z-index:99999;border:1px solid #000;top:0;left:0;bottom:0;right:0;background-color:#222;opacity:1;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.resultViewComponent.active{visibility:visible;display:block}.resultViewComponent,.resultViewComponent:after,.resultViewComponent:before{box-sizing:content-box}.resultViewMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.resultViewMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.resultViewMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.resultViewMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.resultViewMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.resultViewMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.resultViewMenuComponent a.clearSearch{padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.resultViewMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}@media all and (max-width: 1024px){.resultViewMenuComponent .resultViewMenuOpen{display:block;visibility:visible}.resultViewMenuComponent li:not(.resultViewMenuSmall){display:none;visibility:hidden}.resultViewMenuComponent li{background:#2c2c2c}.resultViewMenuComponent li.searchContainer{background:rgb(69.5,69.5,69.5)}.resultViewMenuComponent{padding:0px;position:absolute;overflow-y:visible;top:0px;left:0px;right:0px;bottom:0px;z-index:999999;display:block}.resultViewMenuComponent a.active{background:#2c2c2c}}.resultViewMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:40px;position:relative;top:-1px;box-sizing:border-box}.resultViewMenuComponent input:focus{border:0;outline:0 none}.resultViewMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.resultViewMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.resultViewMenuComponent ::-webkit-input-placeholder{color:#ccc}.resultViewMenuComponent :-moz-placeholder{color:#ccc}.resultViewMenuComponent ::-moz-placeholder{color:#ccc}.resultViewMenuComponent :-ms-input-placeholder{color:#ccc}.resultViewContentComponent{position:absolute;top:40px;left:0;bottom:0;right:0}.informationColumnLeftComponent{position:absolute;top:0;left:0;bottom:0;right:50%;overflow:auto;overflow-x:hidden;overflow-y:visible}.informationColumnRightComponent{position:absolute;top:0;left:50%;bottom:0;right:0;overflow:auto;overflow-x:hidden;overflow-y:visible}.captureListComponent{position:absolute;top:40px;left:0;bottom:0;right:0;background:#222;z-index:9000;display:none;visibility:hidden;overflow-y:visible;overflow-x:hidden}.captureListComponent.active{display:block;visibility:visible}.captureListComponent .openCaptureFile{border:1px dashed #f9f9f9;display:block;margin:5px;padding:5px;text-align:center;font-style:italic}.captureListComponent .openCaptureFile span{line-height:100%;vertical-align:middle}.captureListComponent ul{margin:0px;padding:0px;list-style:none;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-start}.captureListComponent ul li{margin:5px;border:1px solid #606060}.captureListComponent ul li img{width:295px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;display:block}.captureListComponent ul li span{display:block;text-align:center;border:5px solid #222}.captureListComponent ul li span .captureListItemSave{color:#f9f9f9;font-size:16px;margin-left:10px;position:relative;padding:3px 8px 3px 32px}.captureListComponent ul li span .captureListItemSave:before,.captureListComponent ul li span .captureListItemSave:after{box-sizing:border-box;content:"";position:absolute}.captureListComponent ul li span .captureListItemSave:before{background:#222;border-color:#f9f9f9;border-style:solid;border-width:7px 2px 1px;border-radius:1px;height:16px;left:8px;top:5px;width:16px}.captureListComponent ul li span .captureListItemSave:after{background:#f9f9f9;border-color:#d9d9d9;border-style:solid;border-width:1px 1px 1px 4px;height:5px;left:13px;top:5px;width:7px}.captureListComponent ul li:hover{cursor:pointer}.captureListComponent ul li.active span{background:#f0640d;border:5px solid #f0640d}.captureListComponent ul li.active span .captureListItemSave:before{background:#f0640d}.captureListComponent ul li.active span .captureListItemSave:after{border-color:#f0640d}.visualStateListComponent{position:absolute;top:0;left:0;bottom:0;padding:5px;right:80%;overflow-y:visible;overflow-x:hidden}.visualStateListComponent ul{margin:0px;padding:0px;list-style:none}.visualStateListComponent ul li{margin:20px 15px 0px 15px;border:1px solid #606060}.visualStateListComponent ul li img{display:block;padding:0px;box-sizing:border-box;max-height:600px;width:100%;margin:0 auto;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.visualStateListComponent ul li:hover{cursor:pointer}.visualStateListComponent ul li span{border:5px solid #222;background:#222;box-sizing:border-box;display:inline-block;width:100%;margin:0px;padding:5px;word-wrap:break-word}.visualStateListComponent ul li.active{border:2px solid #f0640d}.commandListComponent{position:absolute;top:0;left:20%;right:40%;bottom:0;color:hsl(0,0%,82.6470588235%)}.commandListComponent ul{margin:0px;padding:0px;list-style:none;overflow-y:visible;overflow-x:hidden;height:100%}.commandListComponent ul li{padding:8px}.commandListComponent ul li span{word-wrap:break-word;line-height:22px}.commandListComponent ul li:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.commandListComponent ul li:nth-child(even){background:#2c2c2c}.commandListComponent ul li:nth-child(odd){background:#222}.commandListComponent ul li .important{font-weight:800}.commandListComponent ul li .important.deprecated{color:red}.commandListComponent ul li .important.unused{color:#ff0}.commandListComponent ul li .important.disabled{color:gray}.commandListComponent ul li .important.redundant{color:orange}.commandListComponent ul li .important.valid{color:#adff2f}.commandListComponent ul li .marker{font-size:16px;font-weight:900;color:#adff2f}.commandListComponent ul li.active{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.commandListComponent ul li.drawCall{background:#5db0d7;color:#222}.commandListComponent ul li a{margin-left:5px;margin-right:5px;color:#5db0d7;background:#222;padding:5px;font-weight:900;display:inline-block}.commandDetailComponent{position:absolute;top:0;left:60%;right:0;bottom:0;overflow-y:visible;overflow-x:hidden}.jsonGroupComponent{display:block;margin:10px;padding:10px;padding-bottom:5px}.jsonGroupComponent .jsonGroupComponentTitle{display:block;font-size:16px;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:5px;margin-bottom:5px;text-transform:capitalize}.jsonGroupComponent ul{margin:0px;padding:0px;list-style:none}.jsonGroupComponent ul li:nth-child(even){background:#222}.jsonGroupComponent ul li:nth-child(odd){background:#222}.jsonItemComponentKey{color:#f0640d}.jsonItemComponentValue{white-space:pre-wrap}.jsonItemImageHolder{width:50%;margin:auto}.jsonItemImageHolder .jsonItemImage{margin:5px;display:block;border:1px solid #606060;width:100%}.jsonItemImageHolder .jsonItemImage img{width:100%;display:block;margin:auto;max-width:256px;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px}.jsonItemImageHolder .jsonItemImage span{margin:0px;padding:5px;word-wrap:break-word;display:inline-block;width:100%;box-sizing:border-box}[commandName=onOpenSourceClicked]:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.jsonVisualStateItemComponent{text-align:center;padding:10px}.jsonVisualStateItemComponent img{background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.25, #c9c9c9), color-stop(0.25, transparent)),-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9)),-webkit-gradient(linear, 0 0, 100% 100%, color-stop(0.75, transparent), color-stop(0.75, #c9c9c9));background-image:-moz-linear-gradient(45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(-45deg, #d9d9d9 25%, transparent 25%),-moz-linear-gradient(45deg, transparent 75%, #d9d9d9 75%),-moz-linear-gradient(-45deg, transparent 75%, #d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0px 25px;border:1px solid #606060;margin:5px;width:100%;max-width:512px;max-height:800px}.jsonVisualStateItemComponent span{display:block}.jsonContentComponent{position:absolute;top:0;left:0;right:0;bottom:0;padding:10px;overflow-y:visible;overflow-x:hidden}.jsonItemComponentValue{word-break:break-all;white-space:normal}.jsonSourceItemComponentOpen{font-weight:bold;color:#5db0d7;text-decoration:underline}.sourceCodeMenuComponentContainer{position:absolute;left:0;top:0;bottom:48px;right:40%}.sourceCodeMenuComponentFooter{position:absolute;left:0;right:40%;bottom:0;padding:0 15px}.sourceCodeFormatError{color:#f0640d;margin-left:15px}.sourceCodeDiagnosticsNotice{color:#5db0d7;margin-left:15px}.sourceCodeDiagnosticsNotice a{color:#c9c9c9;text-decoration:underline}.sourceCodeMenuComponent{font-family:sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;display:flex;flex-flow:row wrap;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.sourceCodeMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.sourceCodeMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px 0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.sourceCodeMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.sourceCodeMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.sourceCodeMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.sourceCodeMenuComponent a.clearSearch{display:inline-block;padding:0px;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.sourceCodeMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}.sourceCodeMenuComponent input{border:0;font-family:sans-serif;font-weight:300;padding:0 20px 0 20px;background:rgb(69.5,69.5,69.5);color:#f9f9f9;height:100%;position:relative;top:-1px;box-sizing:border-box}.sourceCodeMenuComponent input:focus{border:0;outline:0 none}.sourceCodeMenuComponent .clearSearch{position:relative;background:rgba(0,0,0,0);display:inline;padding:0px;margin-left:-30px;z-index:9000;color:#f0640d}.sourceCodeMenuComponent .clearSearch:hover{background:rgba(0,0,0,0) !important}.sourceCodeMenuComponent ::-webkit-input-placeholder{color:#ccc}.sourceCodeMenuComponent :-moz-placeholder{color:#ccc}.sourceCodeMenuComponent ::-moz-placeholder{color:#ccc}.sourceCodeMenuComponent :-ms-input-placeholder{color:#ccc}.sourceCodeComponent{position:absolute;top:42px;left:0;bottom:48px;right:40%;background:#222;z-index:9000;overflow-x:visible;overflow:auto}.sourceCodeComponent .sourceCodeComponentTitle{font-size:16px;font-weight:800;line-height:50px;color:#f0640d;padding:1em;margin:.5em 0}.compareViewComponent{position:absolute;top:50px;left:0px;right:0px;bottom:0px;overflow:hidden;display:flex;flex-direction:column;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:13px}.compareViewComponent .compareViewEmpty,.compareViewComponent .compareViewEmptyRow,.compareViewComponent .compareDetailEmpty{padding:1em;color:#c9c9c9;text-align:center}.compareViewComponent .compareViewHeader{flex:0 0 auto;display:flex;align-items:center;gap:16px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid rgb(8.5,8.5,8.5);white-space:nowrap}.compareViewComponent .compareViewHeader .compareViewLabel{color:#5db0d7}.compareViewComponent .compareViewHeader .compareViewSummary span{margin-right:8px;font-weight:700}.compareViewComponent .compareViewHeader .compareViewSummary span.added{color:#adff2f}.compareViewComponent .compareViewHeader .compareViewSummary span.removed{color:#ff5a5a}.compareViewComponent .compareViewHeader .compareViewSummary span.changed{color:#f0640d}.compareViewComponent .compareViewHeader .compareViewSummary span.unchanged{color:#c9c9c9}.compareViewComponent .compareViewHeader .compareViewToggle{margin-left:auto;cursor:pointer;user-select:none}.compareViewComponent .compareViewHeader .compareViewToggle input{vertical-align:middle;margin-right:4px}.compareViewComponent .compareViewBody{flex:1 1 auto;display:flex;min-height:0}.compareViewComponent .compareViewLegend{flex:0 0 130px;box-sizing:border-box;padding:10px;background:#2c2c2c;border-right:2px solid #222}.compareViewComponent .compareViewLegend .compareLegendRow{display:flex;align-items:center;gap:8px;margin:8px 0}.compareViewComponent .compareViewLegend .compareLegendRow.unchanged{opacity:.5}.compareViewComponent .compareViewLegend .compareLegendChip{width:12px;height:12px;border-radius:2px;background:#c9c9c9}.compareViewComponent .compareViewLegend .added .compareLegendChip{background:#adff2f}.compareViewComponent .compareViewLegend .removed .compareLegendChip{background:#ff5a5a}.compareViewComponent .compareViewLegend .changed .compareLegendChip{background:#f0640d}.compareViewComponent .compareViewList{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;margin:0;padding:0;list-style:none}.compareViewComponent .compareViewList .compareRow{display:flex;align-items:baseline;padding:3px 10px;line-height:20px;cursor:pointer;white-space:nowrap}.compareViewComponent .compareViewList .compareRow:nth-child(odd){background:#222}.compareViewComponent .compareViewList .compareRow:nth-child(even){background:#2c2c2c}.compareViewComponent .compareViewList .compareRow .compareSign{flex:0 0 14px;font-weight:800}.compareViewComponent .compareViewList .compareRow .compareRowText{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.compareViewComponent .compareViewList .compareRow .compareCmdName{font-weight:700}.compareViewComponent .compareViewList .compareRow.added .compareSign,.compareViewComponent .compareViewList .compareRow.added .compareCmdName{color:#adff2f}.compareViewComponent .compareViewList .compareRow.removed .compareSign,.compareViewComponent .compareViewList .compareRow.removed .compareCmdName{color:#ff5a5a}.compareViewComponent .compareViewList .compareRow.changed .compareSign,.compareViewComponent .compareViewList .compareRow.changed .compareCmdName{color:#f0640d}.compareViewComponent .compareViewList .compareRow.unchanged{opacity:.55}.compareViewComponent .compareViewList .compareRow.selected{background:rgb(243.366798419,118.0861660079,40.233201581);color:#222}.compareViewComponent .compareViewList .compareRow.selected .compareSign,.compareViewComponent .compareViewList .compareRow.selected .compareCmdName{color:#222}.compareViewComponent .compareViewList .compareViewEmptyRow{cursor:default}.compareViewComponent .compareViewDetail{flex:0 0 42%;box-sizing:border-box;overflow-y:auto;border-left:2px solid #222;padding:4px 12px 12px}.compareViewComponent .compareViewDetail .compareDetailGroup{margin:12px 0}.compareViewComponent .compareViewDetail .compareDetailGroup ul{margin:0;padding:0;list-style:none}.compareViewComponent .compareViewDetail .compareDetailGroup li{padding:2px 0;white-space:pre-wrap;word-break:break-word}.compareViewComponent .compareViewDetail .compareDetailTitle{display:block;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin-bottom:6px;text-transform:capitalize}.compareViewComponent .compareViewDetail .compareDetailKey{color:#f0640d}.compareViewComponent .compareViewDetail .compareCmdName{font-weight:700}.compareViewComponent .compareViewDetail .compareCmdName.added{color:#adff2f}.compareViewComponent .compareViewDetail .compareCmdName.removed{color:#ff5a5a}.compareViewComponent .compareViewDetail .compareCmdName.changed{color:#f0640d}.compareViewComponent .compareViewDetail .compareArrow{color:#c9c9c9}.compareViewComponent .compareViewDetail .compareOld{opacity:.7;text-decoration:line-through}.compareViewComponent .compareViewDetail .compareNew{color:#f9f9f9}.compareViewComponent .compareViewDetail .compareCommandLink{color:#5db0d7;text-decoration:none;cursor:pointer;border-bottom:1px dotted currentColor}.compareViewComponent .compareViewDetail .compareCommandLink:hover{color:#f0640d}.compareViewComponent .compareViewDetail .compareTextureItem{padding-bottom:6px}.compareViewComponent .compareViewDetail .compareImageDiff{display:flex;align-items:center;margin-top:4px}.compareViewComponent .compareViewDetail .compareThumb{width:48px;height:48px;object-fit:contain;margin:2px 6px 2px 0;border:1px solid rgb(8.5,8.5,8.5);background:#222;image-rendering:pixelated}.jsonItemImageClickable{cursor:zoom-in}.textureViewerOverlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:100000;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.6);font-family:Consolas,monaco,monospace;font-size:13px;color:#f9f9f9}.textureViewerOverlay .textureViewerModal{width:min(900px,92vw);height:min(640px,90vh);display:flex;flex-direction:column;overflow:hidden;background:#222;border:1px solid #000;box-shadow:0 10px 40px rgba(0,0,0,.6)}.textureViewerOverlay .textureViewerHeader{flex:0 0 auto;display:flex;align-items:center;gap:12px;height:40px;padding:0 12px;background:#2c2c2c;border-bottom:2px solid #222}.textureViewerOverlay .textureViewerHeader .textureViewerTitle{color:#5db0d7}.textureViewerOverlay .textureViewerHeader .textureViewerMeta{color:#c9c9c9;font-size:12px}.textureViewerOverlay .textureViewerHeader .textureViewerClose{margin-left:auto;width:26px;height:26px;display:flex;align-items:center;justify-content:center;border-radius:3px;color:#c9c9c9;cursor:pointer}.textureViewerOverlay .textureViewerHeader .textureViewerClose:hover{color:#f9f9f9;background:hsla(0,0%,100%,.08)}.textureViewerOverlay .textureViewerToolbar{flex:0 0 auto;display:flex;align-items:center;flex-wrap:wrap;gap:14px;padding:8px 12px;background:#2c2c2c;border-bottom:1px solid #000;font-size:12px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup{display:flex;align-items:center;gap:6px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroup .lbl{color:#c9c9c9;margin-right:2px}.textureViewerOverlay .textureViewerToolbar .textureViewerGroupEnd{margin-left:auto}.textureViewerOverlay .textureViewerToolbar .channel{width:26px;height:24px;display:flex;align-items:center;justify-content:center;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#777;font-weight:800;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .channel.on.r{background:#e14b4b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.g{background:#4bd44b;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.b{background:#4b8fe1;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .channel.on.a{background:#dedede;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .tvBtn{height:24px;padding:0 10px;display:inline-flex;align-items:center;gap:6px;border:1px solid #000;border-radius:3px;background:#1b1b1b;color:#f9f9f9;cursor:pointer;user-select:none}.textureViewerOverlay .textureViewerToolbar .tvBtn:hover{background:#333}.textureViewerOverlay .textureViewerToolbar .tvBtn.active{background:#f0640d;color:#1a1a1a;border-color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary{border-color:#f0640d;color:#f0640d}.textureViewerOverlay .textureViewerToolbar .tvBtn.primary:hover{background:#f0640d;color:#1a1a1a}.textureViewerOverlay .textureViewerToolbar .seg{display:flex}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn{border-radius:0;border-right-width:0}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:first-child{border-radius:3px 0 0 3px}.textureViewerOverlay .textureViewerToolbar .seg .tvBtn:last-child{border-radius:0 3px 3px 0;border-right-width:1px}.textureViewerOverlay .textureViewerToolbar .zoomVal{min-width:44px;text-align:center;color:#c9c9c9}.textureViewerOverlay .textureViewerBody{flex:1 1 auto;display:flex;min-height:0}.textureViewerOverlay .textureViewerViewport{flex:1 1 auto;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#141414}.textureViewerOverlay .textureViewerViewport.checker{background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}.textureViewerOverlay .textureViewerCanvas{image-rendering:pixelated;cursor:crosshair;box-shadow:0 0 0 1px #000}.textureViewerOverlay .textureViewerLoupe{position:absolute;display:none;width:120px;height:120px;pointer-events:none;image-rendering:pixelated;border:1px solid #000;box-shadow:0 2px 8px rgba(0,0,0,.6);background:#000;left:16px;top:16px}.textureViewerOverlay .textureViewerRail{flex:0 0 210px;box-sizing:border-box;padding:12px;overflow-y:auto;background:#2c2c2c;border-left:2px solid #222}.textureViewerOverlay .textureViewerRail .railTitle{color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:4px;margin:0 0 8px;text-transform:capitalize}.textureViewerOverlay .textureViewerRail .kv{display:flex;justify-content:space-between;margin:4px 0}.textureViewerOverlay .textureViewerRail .kv .k{color:#f0640d}.textureViewerOverlay .textureViewerRail .kv .v{color:#f9f9f9}.textureViewerOverlay .textureViewerRail .swatch{width:100%;height:34px;margin:8px 0;border:1px solid #000;background-color:#777;background-image:linear-gradient(45deg, #555 25%, transparent 25%),linear-gradient(-45deg, #555 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #555 75%),linear-gradient(-45deg, transparent 75%, #555 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0}.textureViewerOverlay .textureViewerRail .swatch .swatchInner{width:100%;height:100%}.textureViewerOverlay .textureViewerRail .hint{color:#c9c9c9;margin-top:10px;line-height:1.5}',""]);const a=o},636(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([e.id,".ace-monokai {\n color: #f9f9f9;\n font-size: 14px;\n}\n\n.ace-monokai .ace_entity.ace_name.ace_tag,\n.ace-monokai .ace_keyword,\n.ace-monokai .ace_meta.ace_tag,\n.ace-monokai .ace_storage {\n color: #F0640D\n}\n\n.ace-monokai .ace_constant.ace_character,\n.ace-monokai .ace_constant.ace_other {\n color: #5db0d7;\n}\n\n.ace-monokai .ace_marker-layer .ace_selection {\n background: #a6e22e\n}\n\n.ace-monokai .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #a6e22e;\n}\n\n.ace-monokai .ace_marker-layer .ace_active-line {\n background: #2c2c2c\n}\n.ace-monokai .ace_gutter-active-line {\n background-color: #2c2c2c\n}\n.ace-monokai .ace_marker-layer .ace_selected-word {\n border: 1px solid #a6e22e\n}\n\n.ace-monokai .ace_constant.ace_language {\n color: #e6db74\n}\n.ace-monokai .ace_constant.ace_numeric {\n color: #ae81ff\n}\n\n.ace-monokai .ace_gutter {\n background: #222;\n color: #8F908A;\n}",""]);const a=o},314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var a=0;a0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},601(e){"use strict";e.exports=function(e){return e[1]}},832(e,t,n){e=n.nmd(e),function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,n,r){"string"==typeof e?(2==arguments.length&&(r=n),t.modules[e]||(t.payloads[e]=r,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var n,r,i=function(e,t,n){if("string"==typeof t){var r=a(e,t);if(null!=r)return n&&n(),r}else if("[object Array]"===Object.prototype.toString.call(t)){for(var i=[],o=0,l=t.length;o1&&function(e,t,n){if(Array.prototype.indexOf)return e.indexOf("",n);for(var r=0;r-1&&(n=RegExp(this.source,i.replace.call(((r=this).global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),"g","")),i.replace.call(e.slice(a.index),n,function(){for(var e=1;ea.index&&this.lastIndex--}return a},o||(RegExp.prototype.test=function(e){var t=i.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError("Function.prototype.bind called on incompatible "+t);var n=d.call(arguments,1),i=function(){if(this instanceof i){var r=t.apply(this,n.concat(d.call(arguments)));return Object(r)===r?r:this}return t.apply(e,n.concat(d.call(arguments)))};return t.prototype&&(r.prototype=t.prototype,i.prototype=new r,r.prototype=null),i});var i,s,o,a,l,u=Function.prototype.call,c=Array.prototype,h=Object.prototype,d=c.slice,f=u.bind(h.toString),p=u.bind(h.hasOwnProperty);if((l=p(h,"__defineGetter__"))&&(i=u.bind(h.__defineGetter__),s=u.bind(h.__defineSetter__),o=u.bind(h.__lookupGetter__),a=u.bind(h.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,n=[];if(n.splice.apply(n,e(20)),n.splice.apply(n,e(26)),t=n.length,n.splice(5,0,"XXX"),n.length,t+1==n.length)return!0}()){var m=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?m.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(d.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):null==e?e=0:e<0&&(e=Math.max(n+e,0)),e+ta)for(h=u;h--;)this[l+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else for(this.length=c+s,h=0;h>>0;if("[object Function]"!=f(e))throw new TypeError;for(;++i>>0,i=Array(r),s=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var o=0;o>>0,s=[],o=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var a=0;a>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0,i=arguments[1];if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");for(var s=0;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,s=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s++];break}if(++s>=r)throw new TypeError("reduce of empty array with no initial value")}for(;s>>0;if("[object Function]"!=f(e))throw new TypeError(e+" is not a function");if(!r&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,s=r-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s--];break}if(--s<0)throw new TypeError("reduceRight of empty array with no initial value")}do{s in this&&(i=e.call(void 0,i,n[s],s,t))}while(s--);return i}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=C&&"[object String]"==f(this)?this.split(""):L(this),n=t.length>>>0;if(!n)return-1;var r=0;for(arguments.length>1&&(r=N(arguments[1])),r=r>=0?r:Math.max(0,n+r);r>>0;if(!n)return-1;var r=n-1;for(arguments.length>1&&(r=Math.min(r,N(arguments[1]))),r=r>=0?r:n-Math.abs(r);r>=0;r--)if(r in t&&e===t[r])return r;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:h)}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(p(e,t)){var n;if(n={enumerable:!0,configurable:!0},l){var r=e.__proto__;e.__proto__=h;var i=o(e,t),s=a(e,t);if(e.__proto__=r,i||s)return i&&(n.get=i),s&&(n.set=s),n}return n.value=e[t],n}}),Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),Object.create||(g=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var n;if(null===e)n=g();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var r=function(){};r.prototype=e,(n=new r).__proto__=e}return void 0!==t&&Object.defineProperties(n,t),n}),Object.defineProperty){var S=D({}),A="undefined"==typeof document||D(document.createElement("div"));if(!S||!A)var _=Object.defineProperty}Object.defineProperty&&!_||(Object.defineProperty=function(e,t,n){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof n&&"function"!=typeof n||null===n)throw new TypeError("Property description must be an object: "+n);if(_)try{return _.call(Object,e,t,n)}catch(e){}if(p(n,"value"))if(l&&(o(e,t)||a(e,t))){var r=e.__proto__;e.__proto__=h,delete e[t],e[t]=n.value,e.__proto__=r}else e[t]=n.value;else{if(!l)throw new TypeError("getters & setters can not be defined on this javascript engine");p(n,"get")&&i(e,t,n.get),p(n,"set")&&s(e,t,n.set)}return e}),Object.defineProperties||(Object.defineProperties=function(e,t){for(var n in t)p(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=(E=Object.freeze,function(e){return"function"==typeof e?e:E(e)})}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";p(e,t);)t+="?";e[t]=!0;var n=p(e,t);return delete e[t],n}),!Object.keys){var y=!0,b=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],T=b.length;for(var R in{toString:null})y=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)p(e,n)&&t.push(n);if(y)for(var r=0,i=T;r0||-1)*Math.floor(Math.abs(e))),e}var L=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,n){"use strict";e("./regexp"),e("./es5-shim"),"undefined"==typeof Element||Element.prototype.remove||Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,n){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var r="object"==typeof navigator?navigator:{},i=(/mac|win|linux/i.exec(r.platform)||["other"])[0].toLowerCase(),s=r.userAgent||"",o=r.appName||"";t.isWin="win"==i,t.isMac="mac"==i,t.isLinux="linux"==i,t.isIE="Microsoft Internet Explorer"==o||o.indexOf("MSAppHost")>=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,t.isAIR=s.indexOf("AdobeAIR")>=0,t.isAndroid=s.indexOf("Android")>=0,t.isChromeOS=s.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./useragent");if(t.buildDom=function e(t,n,r){if("string"==typeof t&&t){var i=document.createTextNode(t);return n&&n.appendChild(i),i}if(!Array.isArray(t))return t;if("string"!=typeof t[0]||!t[0]){for(var s=[],o=0;o=1.5,"undefined"!=typeof document){var i=document.createElement("div");t.HI_DPI&&void 0!==i.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),r.isEdge||void 0===i.style.animationName||(t.HAS_CSS_ANIMATION=!0),i=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./oop"),i=function(){var e,t,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in n.FUNCTION_KEYS)e=n.FUNCTION_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);for(t in n.PRINTABLE_KEYS)e=n.PRINTABLE_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);return r.mixin(n,n.MODIFIER_KEYS),r.mixin(n,n.PRINTABLE_KEYS),r.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)n.KEY_MODS[t]=e.filter(function(e){return t&n.KEY_MODS[e]}).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();r.mixin(t,i),t.keyCodeToString=function(e){var t=i[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./keys"),i=e("./useragent"),s=null,o=0;t.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var r=function(){n.call(e,window.event)};n._wrapper=r,e.attachEvent("on"+t,r)}},t.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,n,r){function i(e){n&&n(e),r&&r(e),t.removeListener(document,"mousemove",n,!0),t.removeListener(document,"mouseup",i,!0),t.removeListener(document,"dragstart",i,!0)}return t.addListener(document,"mousemove",n,!0),t.addListener(document,"mouseup",i,!0),t.addListener(document,"dragstart",i,!0),i},t.addMouseWheelListener=function(e,n){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),n(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}n(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),n(e)})},t.addMultiMouseDownListener=function(e,n,r,s){var o,a,l,u=0,c={2:"dblclick",3:"tripleclick",4:"quadclick"};function h(e){if(0!==t.getButton(e)?u=0:e.detail>1?++u>4&&(u=1):u=1,i.isIE){var h=Math.abs(e.clientX-o)>5||Math.abs(e.clientY-a)>5;l&&!h||(u=1),l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),1==u&&(o=e.clientX,a=e.clientY)}if(e._clicks=u,r[s]("mousedown",e),u>4)u=0;else if(u>1)return r[s](c[u],e)}function d(e){u=2,l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),r[s]("mousedown",e),r[s](c[u],e)}Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",h),i.isOldIE&&t.addListener(e,"dblclick",d)})};var a=i.isMac&&i.isOpera&&!("KeyboardEvent"in window)?function(e){return(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)}:function(e){return(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};function l(e,t,n){var l=a(t);if(!i.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(l|=8),s.altGr){if(!(3&~l))return;s.altGr=0}if(18===n||17===n){var u="location"in t?t.location:t.keyLocation;17===n&&1===u?1==s[n]&&(o=t.timeStamp):18===n&&3===l&&2===u&&t.timeStamp-o<50&&(s.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),l||13!==n||3!==(u="location"in t?t.location:t.keyLocation)||(e(t,l,-n),!t.defaultPrevented)){if(i.isChromeOS&&8&l){if(e(t,l,n),t.defaultPrevented)return;l&=-9}return!!(l||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&e(t,l,n)}}function u(){s=Object.create(null)}if(t.getModifierString=function(e){return r.KEY_MODS[a(e)]},t.addCommandKeyListener=function(e,n){var r=t.addListener;if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var o=null;r(e,"keydown",function(e){o=e.keyCode}),r(e,"keypress",function(e){return l(n,e,o)})}else{var a=null;r(e,"keydown",function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=l(n,e,e.keyCode);return a=e.defaultPrevented,t}),r(e,"keypress",function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),r(e,"keyup",function(e){s[e.keyCode]=null}),s||(u(),r(window,"focus",u))}},"object"==typeof window&&window.postMessage&&!i.isOldIE){var c=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+c++,i=function(s){s.data==r&&(t.stopPropagation(s),t.removeListener(n,"message",i),e())};t.addListener(n,"message",i),n.postMessage(r,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function n(){t.$idleBlocked?setTimeout(n,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,n=e.end,r=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(r.row,r.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(r.row,r.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else this.end.rowt)var i={row:t+1,column:0};else this.start.row0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;nDate.now()-50)||(r=!1)},cancel:function(){r=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("../lib/dom"),o=e("../lib/lang"),a=e("../clipboard"),l=i.isChrome<18,u=i.isIE,c=i.isChrome>63,h=400,d=e("../lib/keys"),f=d.KEY_MODS,p=i.isIOS,m=p?/\s/:/\n/;t.TextInput=function(e,t){var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild);var g=!1,E=!1,v=!1,C=!1,D="";i.isMobile||(n.style.fontSize="1px");var S=!1,A=!1,_="",y=0,b=0,T=0;try{var R=document.activeElement===n}catch(e){}r.addListener(n,"blur",function(e){A||(t.onBlur(e),R=!1)}),r.addListener(n,"focus",function(e){if(!A){if(R=!0,i.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),i.isEdge?setTimeout(x):x()}}),this.$focusScroll=!1,this.focus=function(){if(D||c||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var t=0!=n.getBoundingClientRect().top}catch(e){return}var r=[];if(t)for(var i=n.parentElement;i&&1==i.nodeType;)r.push(i),i.setAttribute("ace_nocontext",!0),i=!i.parentElement&&i.getRootNode?i.getRootNode().host:i.parentElement;n.focus({preventScroll:!0}),t&&r.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="","0px"==n.style.top&&(n.style.top=e)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return R},t.on("beforeEndOperation",function(){t.curOp&&"insertstring"==t.curOp.command.name||(v&&(_=n.value="",U()),x())});var x=p?function(e){if(R&&(!g||e)&&!C){e||(e="");var r="\n ab"+e+"cde fg\n";r!=n.value&&(n.value=_=r);var i=4+(e.length||(t.selection.isEmpty()?0:1));4==y&&b==i||n.setSelectionRange(4,i),y=4,b=i}}:function(){if(!v&&!C&&(R||F)){v=!0;var e=t.selection,r=e.getRange(),i=e.cursor.row,s=r.start.column,o=r.end.column,a=t.session.getLine(i);if(r.start.row!=i){var l=t.session.getLine(i-1);s=r.start.rowi+1?u.length:o,o+=a.length+1,a=a+"\n"+u}a.length>h&&(s0&&_[h]==e[h];)h++,o--;for(l=l.slice(h),h=1;a>0&&_.length-h>y-1&&_[_.length-h]==e[e.length-h];)h++,a--;u-=h-1,c-=h-1;var d=l.length-h+1;return d<0&&(o=-d,d=0),l=l.slice(0,d),r||l||u||o||a||c?(C=!0,l&&!o&&!a&&!u&&!c||S?t.onTextInput(l):t.onTextInput(l,{extendLeft:o,extendRight:a,restoreStart:u,restoreEnd:c}),C=!1,_=e,y=i,b=s,T=c,l):""},L=function(e){if(v)return B();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var r=n.value,i=N(r,!0);(r.length>500||m.test(i))&&x()},O=function(e,t,n){var r=e.clipboardData||window.clipboardData;if(r&&!l){var i=u||n?"Text":"text/plain";try{return t?!1!==r.setData(i,t):r.getData(i)}catch(e){if(!n)return O(e,t,!0)}}},I=function(e,i){var s=t.getCopyText();if(!s)return r.preventDefault(e);O(e,s)?(p&&(x(s),g=s,setTimeout(function(){g=!1},10)),i?t.onCut():t.onCopy(),r.preventDefault(e)):(g=!0,n.value=s,n.select(),setTimeout(function(){g=!1,x(),i?t.onCut():t.onCopy()}))},k=function(e){I(e,!0)},M=function(e){I(e,!1)},P=function(e){var s=O(e);a.pasteCancelled()||("string"==typeof s?(s&&t.onPaste(s,e),i.isIE&&setTimeout(x),r.preventDefault(e)):(n.value="",E=!0))};r.addCommandKeyListener(n,t.onCommandKey.bind(t)),r.addListener(n,"select",function(e){v||(g?g=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=_.length&&e.value===_&&_&&e.selectionEnd!==b}(n)&&(t.selectAll(),x()))}),r.addListener(n,"input",L),r.addListener(n,"cut",k),r.addListener(n,"copy",M),r.addListener(n,"paste",P),"oncut"in n&&"oncopy"in n&&"onpaste"in n||r.addListener(e,"keydown",function(e){if((!i.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:M(e);break;case 86:P(e);break;case 88:k(e)}});var B=function(){if(v&&t.onCompositionUpdate&&!t.$readOnly){if(S)return $();if(v.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;N(e),v.markerRange&&(v.context&&(v.markerRange.start.column=v.selectionStart=v.context.compositionStartOffset),v.markerRange.end.column=v.markerRange.start.column+b-v.selectionStart+T)}}},U=function(e){t.onCompositionEnd&&!t.$readOnly&&(v=!1,t.onCompositionEnd(),t.off("mousedown",$),e&&L())};function $(){A=!0,n.blur(),n.focus(),A=!1}var G,V=o.delayedCall(B,50).schedule.bind(null,null);function W(){clearTimeout(G),G=setTimeout(function(){D&&(n.style.cssText=D,D=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()},0)}r.addListener(n,"compositionstart",function(e){if(!v&&t.onCompositionStart&&!t.$readOnly&&(v={},!S)){setTimeout(B,0),t.on("mousedown",$);var r=t.getSelectionRange();r.end.row=r.start.row,r.end.column=r.start.column,v.markerRange=r,v.selectionStart=y,t.onCompositionStart(v),v.useTextareaForIME?(n.value="",_="",y=0,b=0):(n.msGetInputContext&&(v.context=n.msGetInputContext()),n.getInputContext&&(v.context=n.getInputContext()))}}),r.addListener(n,"compositionupdate",B),r.addListener(n,"keyup",function(e){27==e.keyCode&&n.value.lengthb&&"\n"==_[s]?o=d.end:rb&&_.slice(0,s).split("\n").length>2?o=d.down:s>b&&" "==_[s-1]?(o=d.right,a=f.option):(s>b||s==b&&b!=y&&r==s)&&(o=d.right),r!==s&&(a|=f.shift),o){if(!t.onCommandKey({},a,o)&&t.commands){o=d.keyCodeToString(o);var l=t.commands.findKeyCommand(a,o);l&&t.execCommand(l)}y=r,b=s,x("")}}};document.addEventListener("selectionchange",s),t.on("destroy",function(){document.removeEventListener("selectionchange",s)})}(0,t,n)}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/useragent");function i(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function s(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)n=2*t.row-e.start.row-e.end.row;else n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,s=e.getButton();return 0!==s?((i.getSelectionRange().isEmpty()||1==s)&&i.selection.moveToPosition(n),void(2==s&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||i.isFocused()||(i.focus(),!this.$focusTimeout||this.$clickSelection||i.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(-1==r)e=this.$clickSelection.end;else if(1==r)e=this.$clickSelection.start;else{var i=s(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(i.start),a=this.$clickSelection.comparePoint(i.end);if(-1==o&&a<=0)t=this.$clickSelection.end,i.end.row==r.row&&i.end.column==r.column||(r=i.start);else if(1==a&&o>=0)t=this.$clickSelection.start,i.start.row==r.row&&i.start.column==r.column||(r=i.end);else if(-1==o&&1==a)r=i.end,t=i.start;else{var l=s(this.$clickSelection,r);r=l.cursor,t=l.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e,t,n,r,i=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,n=this.x,r=this.y,Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))),s=Date.now();(i>0||s-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session.getBracketRange(t);r?(r.isEmpty()&&(r.start.column--,r.end.column++),this.setState("select")):(r=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=r,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,s=i?e.wheelX/i:n.vx,o=i?e.wheelY/i:n.vy;i<550&&(s=(s+n.vx)/2,o=(o+n.vy)/2);var a=Math.abs(s/o),l=!1;return a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?n.allowed=r:r-n.allowed<550&&(Math.abs(s)<=1.5*Math.abs(n.vx)&&Math.abs(o)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=r):n.allowed=0),n.t=r,n.vx=s,n.vy=o,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(i.prototype),t.DefaultHandlers=i}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}(function(){this.$init=function(){return this.$element=r.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){r.addCssClass(this.getElement(),e)},this.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(i.prototype),t.Tooltip=i}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/event"),o=e("../tooltip").Tooltip;function a(e){o.call(this,e)}i.inherits(a,o),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),s=this.getHeight();(e+=15)+i>n&&(e-=e+i-n),(t+=15)+s>r&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=function(e){var t,n,i,o=e.editor,l=o.renderer.$gutterLayer,u=new a(o.container);function c(){t&&(t=clearTimeout(t)),i&&(u.hide(),i=null,o._signal("hideGutterTooltip",u),o.removeEventListener("mousewheel",c))}function h(e){u.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",function(t){if(o.isFocused()&&0==t.getButton()&&"foldWidgets"!=l.getRegion(t)){var n=t.getDocumentPosition().row,r=o.session.selection;if(t.getShiftKey())r.selectTo(n,0);else{if(2==t.domEvent.detail)return o.selectAll(),t.preventDefault();e.$clickSelection=o.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}),e.editor.setDefaultHandler("guttermousemove",function(s){var a=s.domEvent.target||s.domEvent.srcElement;if(r.hasCssClass(a,"ace_fold-widget"))return c();i&&e.$tooltipFollowsMouse&&h(s),n=s,t||(t=setTimeout(function(){t=null,n&&!e.isMousePressed?function(){var t=n.getDocumentPosition().row,r=l.$annotations[t];if(!r)return c();if(t==o.session.getLength()){var s=o.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(s>o.session.documentToScreenRow(a.row,a.column))return c()}if(i!=r)if(i=r.text.join("
"),u.setHtml(i),u.show(),o._signal("showGutterTooltip",u),o.on("mousewheel",c),e.$tooltipFollowsMouse)h(n);else{var d=n.domEvent.target.getBoundingClientRect(),f=u.getElement().style;f.left=d.right+"px",f.top=d.bottom+"px"}}():c()},50))}),s.addListener(o.renderer.$gutter,"mouseout",function(e){n=null,i&&!t&&(t=setTimeout(function(){t=null,c()},50))}),o.on("changeSession",c)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent");function o(e){var t=e.editor,n=r.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),t.addEventListener("mousedown",this.onMouseDown.bind(e));var o,l,u,c,h,d,f,p,m,g,E,v=t.container,C=0;function D(){var e=d;(function(e,n){var r=Date.now(),i=!n||e.row!=n.row,s=!n||e.column!=n.column;!g||i||s?(t.moveCursorToPosition(e),g=r,E={x:l,y:u}):a(E.x,E.y,l,u)>5?g=null:r-g>=200&&(t.renderer.scrollCursorIntoView(),g=null)})(d=t.renderer.screenToTextCoordinates(l,u),e),function(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,s=t.renderer.layerConfig.characterWidth,o=t.renderer.scroller.getBoundingClientRect(),a={x:{left:l-o.left,right:o.right-l},y:{top:u-o.top,bottom:o.bottom-u}},c=Math.min(a.x.left,a.x.right),h=Math.min(a.y.top,a.y.bottom),d={row:e.row,column:e.column};c/s<=2&&(d.column+=a.x.left=200&&t.renderer.scrollCursorIntoView(d):m=r:m=null}(d,e)}function S(){h=t.selection.toOrientedRange(),o=t.session.addMarker(h,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(c),D(),c=setInterval(D,20),C=0,i.addListener(document,"mousemove",y)}function A(){clearInterval(c),t.session.removeMarker(o),o=null,t.selection.fromOrientedRange(h),t.isFocused()&&!p&&t.$resetCursorStyle(),h=null,d=null,C=0,m=null,g=null,i.removeListener(document,"mousemove",y)}this.onDragStart=function(e){if(this.cancelDrag||!v.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}h=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?"copy":"copyMove",s.isOpera&&(t.container.appendChild(n),n.scrollTop=0),i.setDragImage&&i.setDragImage(n,0,0),s.isOpera&&t.container.removeChild(n),i.clearData(),i.setData("Text",t.session.getTextRange()),p=!0,this.setState("drag")},this.onDragEnd=function(e){if(v.draggable=!1,p=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;f||"move"!=n||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||S(),C++,e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&b(e.dataTransfer))return l=e.clientX,u=e.clientY,o||(S(),C++),null!==_&&(_=null),e.dataTransfer.dropEffect=f=T(e),i.preventDefault(e)},this.onDragLeave=function(e){if(--C<=0&&o)return A(),f=null,i.preventDefault(e)},this.onDrop=function(e){if(d){var n=e.dataTransfer;if(p)switch(f){case"move":h=h.contains(d.row,d.column)?{start:d,end:d}:t.moveText(h,d);break;case"copy":h=t.moveText(h,d,!0)}else{var r=n.getData("Text");h={start:d,end:t.session.insert(d,r)},t.focus(),f=null}return A(),i.preventDefault(e)}},i.addListener(v,"dragstart",this.onDragStart.bind(e)),i.addListener(v,"dragend",this.onDragEnd.bind(e)),i.addListener(v,"dragenter",this.onDragEnter.bind(e)),i.addListener(v,"dragover",this.onDragOver.bind(e)),i.addListener(v,"dragleave",this.onDragLeave.bind(e)),i.addListener(v,"drop",this.onDrop.bind(e));var _=null;function y(){null==_&&(_=setTimeout(function(){null!=_&&o&&A()},20))}function b(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function T(e){var t=["copy","copymove","all","uninitialized"],n=s.isMac?e.altKey:e.ctrlKey,r="uninitialized";try{r=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var i="none";return n&&t.indexOf(r)>=0?i="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(r)>=0?i="move":t.indexOf(r)>=0&&(i="copy"),i}}function a(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=s.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;s.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton();if(1===(e.domEvent.detail||1)&&0===r&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var i=e.domEvent.target||e.domEvent.srcElement;"unselectable"in i&&(i.unselectable="on"),t.getDragDelay()?(s.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(o.prototype),t.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./mouse_event").MouseEvent,i=e("../lib/dom");t.addTouchListeners=function(e,t){var n,s,o,a,l,u,c,h,d,f="scroll",p=0,m=0,g=0,E=0;function v(){var e,n,r;d||(e=window.navigator&&window.navigator.clipboard,n=!1,r=function(r){var s,o,a=r.target.getAttribute("action");if("more"==a||!n)return n=!n,s=t.getCopyText(),o=t.session.getUndoManager().hasUndo(),void d.replaceChild(i.buildDom(n?["span",!s&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],s&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],s&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],o&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),d.firstChild);"paste"==a?e.readText().then(function(e){t.execCommand(a,e)}):a&&("cut"!=a&&"copy"!=a||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(a)),d.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&t.focus()},d=i.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){f="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),r(e)},onclick:r},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container));var s=t.selection.cursor,o=t.renderer.textToScreenCoordinates(s.row,s.column),a=t.container.getBoundingClientRect();d.style.top=o.pageY-a.top-3+"px",d.style.right="10px",d.style.display="",d.firstChild.style.display="none",t.on("input",C)}function C(e){d&&(d.style.display="none"),t.off("input",C)}function D(){l=null,clearTimeout(l);var e=t.selection.getRange(),n=e.contains(c.row,c.column);!e.isEmpty()&&n||(t.selection.moveToPosition(c),t.selection.selectWord()),f="wait",v()}e.addEventListener("contextmenu",function(e){h&&t.textInput.getElement().focus()}),e.addEventListener("touchstart",function(e){var i=e.touches;if(l||i.length>1)return clearTimeout(l),l=null,o=-1,void(f="zoom");h=t.$mouseHandler.isMousePressed=!0;var u=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,v=e.timeStamp;a=v;var C=i[0],S=C.clientX,A=C.clientY;Math.abs(n-S)+Math.abs(s-A)>u&&(o=-1),n=e.clientX=S,s=e.clientY=A,g=E=0;var _=new r(e,t);if(c=_.getDocumentPosition(),v-o<500&&1==i.length&&!p)m++,e.preventDefault(),e.button=0,function(){l=null,clearTimeout(l),t.selection.moveToPosition(c);var e=m>=2?t.selection.getLineRange(c.row):t.session.getBracketRange(c);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),f="wait"}();else{m=0;var y=t.selection.cursor,b=t.selection.isEmpty()?y:t.selection.anchor,T=t.renderer.$cursorLayer.getPixelPosition(y,!0),R=t.renderer.$cursorLayer.getPixelPosition(b,!0),x=t.renderer.scroller.getBoundingClientRect(),w=function(e,t){return(e/=d)*e+(t=t/u-.75)*t};if(e.clientXN?"cursor":"anchor"),f=N<3.5?"anchor":F<3.5?"cursor":"scroll",l=setTimeout(D,450)}o=v}),e.addEventListener("touchend",function(e){h=t.$mouseHandler.isMousePressed=!1,u&&clearInterval(u),"zoom"==f?(f="",p=0):l?(t.selection.moveToPosition(c),p=0,v()):"scroll"==f?(p+=60,u=setInterval(function(){p--<=0&&(clearInterval(u),u=null),Math.abs(g)<.01&&(g=0),Math.abs(E)<.01&&(E=0),p<20&&(g*=.9),p<20&&(E*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*g,10*E),e==t.session.getScrollTop()&&(p=0)},10),e.preventDefault(),C()):v(),clearTimeout(l),l=null}),e.addEventListener("touchmove",function(e){l&&(clearTimeout(l),l=null);var i=e.touches;if(!(i.length>1||"zoom"==f)){var o=i[0],u=n-o.clientX,c=s-o.clientY;if("wait"==f){if(!(u*u+c*c>4))return e.preventDefault();f="cursor"}n=o.clientX,s=o.clientY,e.clientX=o.clientX,e.clientY=o.clientY;var h=e.timeStamp,d=h-a;if(a=h,"scroll"==f){var p=new r(e,t);p.speed=1,p.wheelX=u,p.wheelY=c,10*Math.abs(u)1&&(i=n[n.length-2]);var o=l[t+"Path"];return null==o?o=l.basePath:"/"==r&&(t=r=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+t+r+i+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,r){var i,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{i=e(n)}catch(e){}if(i&&!t.$loading[n])return r&&r(i);if(t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r),!(t.$loading[n].length>1)){var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var r=t.$loading[n];t.$loading[n]=null,r.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,o),a),u()}};var u=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),u=function(){})};function c(i){if(a&&a.document){l.packaged=i||e.packaged||r.packaged||a.define&&n.amdD.packaged;for(var s={},o="",u=document.currentScript||document._currentScript,c=(u&&u.ownerDocument||document).getElementsByTagName("script"),d=0;d=e){for(s=h+1;s=e;)s++;for(a=h,l=s-1;a=t.length||2!=(l=n[i-1])&&3!=l||2!=(u=t[i+1])&&3!=u?4:(s&&(u=3),u==l?u:4);case 10:return 2==(l=i>0?n[i-1]:5)&&i+10&&2==n[i-1])return 2;if(s)return 4;for(f=i+1,d=t.length;f=1425&&m<=2303||64286==m;if(l=t[f],g&&(1==l||7==l))return 1}return i<1||5==(l=t[i-1])?4:n[i-1];case 5:return s=!1,o=!0,r;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:s=!1;case h:return 4}}function g(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?t>191?0:d[t]:5==n?/[\u0591-\u05f4]/.test(e)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?12:/[\u0660-\u0669\u066b-\u066c]/.test(e)?3:1642==t?c:/[\u06f0-\u06f9]/.test(e)?2:7:32==n&&t<=8287?f[255&t]:254==n&&t>=65136?7:4}t.L=0,t.R=1,t.EN=2,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,n,c){if(e.length<2)return{};var d=e.split(""),f=new Array(d.length),E=new Array(d.length),v=[];r=c?1:0,function(e,t,n,c){var h=r?u:l,d=null,f=null,p=null,E=0,v=null,C=-1,D=null,S=null,A=[];if(!c)for(D=0,c=[];D0)if(16==v){for(D=C;D-1){for(D=C;D=0&&8==c[_];_--)t[_]=r}}(d,v,d.length,n);for(var C=0;C7&&n[C]<13||4===n[C]||n[C]===h)?v[C]=t.ON_R:C>0&&"ل"===d[C-1]&&/\u0622|\u0623|\u0625|\u0627/.test(d[C])&&(v[C-1]=v[C]=t.R_H,C++);for(d[d.length-1]===t.DOT&&(v[d.length-1]=t.B),"‫"===d[0]&&(v[0]=t.RLE),C=0;C=0&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,r=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===r;)r=n,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[e];s&&(void 0===t&&(t=this.getSplitIndex()),t>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&s[i]%2!=0&&i++;for(var a=0;at&&s[i]%2==0&&(o+=this.charWidths[s[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(e,t){var n,r=this.bidiMap,i=r.bidiLevels,s=[],o=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,u=!1,c=!1,h=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,f=0;f=a&&dn+s/2;){if(n+=s,r===i.length-1){s=0;break}s=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!=0&&i[r]%2==0?(e0&&i[r-1]%2==0&&i[r]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&0===s&&i[r-1]%2==0||!this.isRtlDir&&0===r&&i[r]%2!=0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!=0&&0!==s&&r--,t=this.bidiMap.logicalFromVisual[r]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(o.prototype),t.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")})};(function(){r.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},this.$setSelection=function(e,t,n,r){var i=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||s)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n,r="number"==typeof e?e:this.lead.row,i=this.session.getFoldLine(r);return i?(r=i.start.row,n=i.end.row):n=r,!0===t?new o(r,0,n,this.session.getLine(n).length):new o(r,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i)this.moveCursorTo(i.end.row,i.end.column);else{if(this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t)),t>=n.length)return this.moveCursorTo(e,n.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(s)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)}},this.$shortWordEndIndex=function(e){var t,n=0,r=/\s/,i=this.session.tokenRe;if(i.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&r.test(t);)n++;if(n<1)for(i.lastIndex=0;(t=e[n])&&!i.test(t);)if(i.lastIndex=0,n++,r.test(t)){if(n>2){n--;break}for(;(t=e[n])&&r.test(t);)n++;if(n>2)break}}return i.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do{e++,r=this.doc.getLine(e)}while(e0&&/^\s*$/.test(r));n=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(t,n-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n,r=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(r.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(r.column),r.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=r.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?r.column=this.$desiredColumn:this.$desiredColumn=r.column);var i=this.session.screenToDocumentPosition(r.row+e,r.column,n);0!==e&&0===t&&i.row===this.lead.row&&i.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[i.row]&&(i.row>0||e>0)&&i.row++,this.moveCursorTo(i.row,i.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch(e){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,n){"use strict";var r=e("./config"),i=2e3,s=function(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],r=[],i=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",a=[],l=0;l1?this.$applyToken:u.token),h>1&&(/\\\d/.test(u.regex)?c=u.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(h=1,c=this.removeCapturingGroups(u.regex)),u.splitRegex||"string"==typeof u.token||a.push(u)),s[i]=l,i+=h,r.push(c),u.onMatch||(u.onMatch=null)}}r.length||(s[0]=0,r.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){i=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var r=[],i=0,s=n.length;ic){var E=e.substring(c,g-m.length);d.type==f?d.value+=E:(d.type&&u.push(d),d={type:f,value:E})}for(var v=0;vi){for(h>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});c1&&n[0]!==r&&n.unshift("#tmp",r),{tokens:u,state:n.length?n:r}},this.reportError=r.reportError}).call(s.prototype),t.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var n in e){for(var r=e[n],i=0;i=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(void 0!==n)return n;for(n=0;t>0;)n+=e[t-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)}}).call(i.prototype),t.TokenIterator=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r,i=e("../../lib/oop"),s=e("../behaviour").Behaviour,o=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],u=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],c={},h={'"':'"',"'":"'"},d=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,c.rangeCount!=e.multiSelect.rangeCount&&(c={rangeCount:e.multiSelect.rangeCount})),c[t])return r=c[t];r=c[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},f=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},p=function(e){this.add("braces","insertion",function(t,n,i,s,o){var l=i.getCursorPosition(),u=s.doc.getLine(l.row);if("{"==o){d(i);var c=i.getSelectionRange(),h=s.doc.getTextRange(c);if(""!==h&&"{"!==h&&i.getWrapBehavioursEnabled())return f(c,h,"{","}");if(p.isSaneInsertion(i,s))return/[\]\}\)]/.test(u[l.column])||i.inMultiSelectMode||e&&e.braces?(p.recordAutoInsert(i,s,"}"),{text:"{}",selection:[1,1]}):(p.recordMaybeInsert(i,s,"{"),{text:"{",selection:[1,1]})}else if("}"==o){if(d(i),"}"==u.substring(l.column,l.column+1)&&null!==s.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&p.isAutoInsertedClosing(l,u,o))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==o||"\r\n"==o){d(i);var m="";if(p.isMaybeInsertedClosing(l,u)&&(m=a.stringRepeat("}",r.maybeInsertedBrackets),p.clearMaybeInsertedClosing()),"}"===u.substring(l.column,l.column+1)){var g=s.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!g)return null;var E=this.$getIndent(s.getLine(g.row))}else{if(!m)return void p.clearMaybeInsertedClosing();E=this.$getIndent(u)}var v=E+s.getTabString();return{text:"\n"+v+"\n"+E+m,selection:[1,v.length,1,v.length]}}p.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,i,s){var o=i.doc.getTextRange(s);if(!s.isMultiLine()&&"{"==o){if(d(n),"}"==i.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s;r.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if("("==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"(",")");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(")"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"("==s&&(d(n),")"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("brackets","insertion",function(e,t,n,r,i){if("["==i){d(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return f(s,o,"[","]");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if("]"==i){d(n);var a=n.getCursorPosition(),l=r.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==r.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,i))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&"["==s&&(d(n),"]"==r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)))return i.end.column++,i}),this.add("string_dquotes","insertion",function(e,t,n,r,i){var s=r.$mode.$quotes||h;if(1==i.length&&s[i]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(i))return;d(n);var o=i,a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(!(""===l||1==l.length&&s[l])&&n.getWrapBehavioursEnabled())return f(a,l,o,o);if(!l){var u=n.getCursorPosition(),c=r.doc.getLine(u.row),p=c.substring(u.column-1,u.column),m=c.substring(u.column,u.column+1),g=r.getTokenAt(u.row,u.column),E=r.getTokenAt(u.row,u.column+1);if("\\"==p&&g&&/escape/.test(g.type))return null;var v,C=g&&/string|escape/.test(g.type),D=!E||/string|escape/.test(E.type);if(m==o)(v=C!==D)&&/string\.end/.test(E.type)&&(v=!1);else{if(C&&!D)return null;if(C&&D)return null;var S=r.$mode.tokenRe;S.lastIndex=0;var A=S.test(p);S.lastIndex=0;var _=S.test(p);if(A||_)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;var y=c[u.column-2];if(p==o&&(y==o||S.test(y)))return null;v=!0}return{text:v?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.$mode.$quotes||h,o=r.doc.getTextRange(i);if(!i.isMultiLine()&&s.hasOwnProperty(o)&&(d(n),r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==o))return i.end.column++,i})};p.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new o(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",l)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var i=new o(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",l))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",u)},p.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},p.recordAutoInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isAutoInsertedClosing(i,s,r.autoInsertedLineEnd[0])||(r.autoInsertedBrackets=0),r.autoInsertedRow=i.row,r.autoInsertedLineEnd=n+s.substr(i.column),r.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var i=e.getCursorPosition(),s=t.doc.getLine(i.row);this.isMaybeInsertedClosing(i,s)||(r.maybeInsertedBrackets=0),r.maybeInsertedRow=i.row,r.maybeInsertedLineStart=s.substr(0,i.column)+n,r.maybeInsertedLineEnd=s.substr(i.column),r.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return r.autoInsertedBrackets>0&&e.row===r.autoInsertedRow&&n===r.autoInsertedLineEnd[0]&&t.substr(e.column)===r.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return r.maybeInsertedBrackets>0&&e.row===r.maybeInsertedRow&&t.substr(e.column)===r.maybeInsertedLineEnd&&t.substr(0,e.column)==r.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){r.autoInsertedLineEnd=r.autoInsertedLineEnd.substr(1),r.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){r&&(r.maybeInsertedBrackets=0,r.maybeInsertedRow=-1)},i.inherits(p,s),t.CstyleBehaviour=p}),ace.define("ace/unicode",["require","exports","module"],function(e,t,n){"use strict";for(var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,s=[],o=0;o2?r%u!=u-1:r%u==0})}else{if(!this.blockComment)return!1;var f=this.blockComment.start,p=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+l.escapeRegExp(f)+")"),g=new RegExp("(?:"+l.escapeRegExp(p)+")\\s*$"),E=function(e,t){C(e,t)||s&&!/\S/.test(e)||(i.insertInLine({row:t,column:e.length},p),i.insertInLine({row:t,column:a},f))},v=function(e,t){var n;(n=e.match(g))&&i.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(m))&&i.removeInLine(t,n[1].length,n[0].length)},C=function(e,n){if(m.test(e))return!0;for(var r=t.getTokens(n),i=0;ie.length&&(S=e.length)}),a==1/0&&(a=S,s=!1,o=!1),c&&a%u!=0&&(a=Math.floor(a/u)*u),D(o?v:E)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(i){!i.start&&i[0]&&(i=i[0]);var s,o,a=(m=new u(t,r.row,r.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var h,d;a&&/comment/.test(a.type);){if(-1!=(g=a.value.indexOf(i.start))){var f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g;h=new c(f,p,f,p+i.start.length);break}a=m.stepBackward()}var m;for(a=(m=new u(t,r.row,r.column)).getCurrentToken();a&&/comment/.test(a.type);){var g;if(-1!=(g=a.value.indexOf(i.end))){f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g,d=new c(f,p,f,p+i.end.length);break}a=m.stepForward()}d&&t.remove(d),h&&(t.remove(h),s=h.start.row,o=-i.start.length)}else o=i.start.length,s=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);l.start.row==s&&(l.start.column+=o),l.end.row==s&&(l.end.column+=o),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var n=e[t],i=n.prototype.$id,s=r.$modes[i];s||(r.$modes[i]=s=new n),r.$modes[t]||(r.$modes[t]=s),this.$embeds.push(t),this.$modes[t]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;tthis.row)){var n=function(t,n,r){var i="insert"==t.action,s=(i?1:-1)*(t.end.row-t.start.row),o=(i?1:-1)*(t.end.column-t.start.column),a=t.start,l=i?a:t.end;return e(n,a,r)?{row:n.row,column:n.column}:e(l,n,!r)?{row:n.row+s,column:n.column+(n.row==l.row?o:0)}:{row:a.row,column:a.column}}(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(e,t,n){var r;if(r=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=r.row||this.column!=r.column){var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=e("./anchor").Anchor,l=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new a(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();void 0===e?e=n:e<0?e=0:e>=n&&(e=n-1,t=void 0);var r=this.getLine(e);return null==t&&(t=r.length),{row:e,column:t=Math.min(Math.max(t,0),r.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof o||(e=o.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,r=n.length-t+1,i=e.start.row,s=e.start.column,o=0,a=0;o20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,-1==r&&(r=t),s<=r&&n.fireUpdateEvent(s,r)}}};(function(){r.implement(this,i),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens}}).call(s.prototype),t.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=(e("./lib/oop"),e("./range").Range),s=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,n,s){if(this.regExp)for(var o=s.firstRow,a=s.lastRow,l=o;l<=a;l++){var u=this.cache[l];null==u&&((u=r.getMatchOffsets(n.getLine(l),this.regExp)).length>this.MAX_RANGES&&(u=u.slice(0,this.MAX_RANGES)),u=u.map(function(e){return new i(l,e.offset,l,e.offset+e.length)}),this.cache[l]=u.length?u:"");for(var c=u.length;c--;)t.drawSingleLineMarker(e,u[c].toScreenRange(n),this.clazz,s)}}}).call(s.prototype),t.SearchHighlight=s}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range;function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var r,i,s=0,o=this.folds,a=!0;null==t&&(t=this.end.row,n=this.end.column);for(var l=0;l0)){var l=r(e,o.start);return 0===a?t&&0!==l?-s-2:s:l>0||0===l&&!t?s:-s-1}}return-s-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},this.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],n=this.ranges,i=(n=n.sort(function(e,t){return r(e.start,t.start)}))[0],s=1;s=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=r);o++);if("insert"==e.action){for(var l=i-r,u=-t.column+n.column;or);o++)if(c.start.row==r&&c.start.column>=t.column&&(c.start.column==t.column&&this.$bias<=0||(c.start.column+=u,c.start.row+=l)),c.end.row==r&&c.end.column>=t.column){if(c.end.column==t.column&&this.$bias<0)continue;c.end.column==t.column&&u>0&&oc.start.column&&c.end.column==s[o+1].start.column&&(c.end.column-=u),c.end.column+=u,c.end.row+=l}}else for(l=r-i,u=t.column-n.column;oi);o++)c.end.rowt.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=u,c.end.row+=l):c.end.row>i&&(c.end.row+=l),c.start.rowt.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=u,c.start.row+=l):c.start.row>i&&(c.start.row+=l);if(0!=l&&o=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;for(t&&(r=n.indexOf(t)),-1==r&&(r=0);r=e)return i}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,r=t-e+1,i=0;i=t){a=e?r-=t-a:r=0);break}o>=e&&(r-=a>=e?o-a:o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n,r=this.$foldData,o=!1;e instanceof s?n=e:(n=new s(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,u=n.end.row,c=n.end.column,h=this.getFoldAt(a,l,1),d=this.getFoldAt(u,c,-1);if(h&&d==h)return h.addSubFold(n);h&&!h.range.isStart(a,l)&&this.removeFold(h),d&&!d.range.isEnd(u,c)&&this.removeFold(d);var f=this.getFoldsInRange(n.range);f.length>0&&(this.removeFolds(f),f.forEach(function(e){n.addSubFold(e)}));for(var p=0;p0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;if(null==e?(n=new r(0,0,this.getLength(),0),t=!0):n="number"==typeof e?new r(e,0,e,this.getLine(e).length):"row"in e?r.fromPoints(e,e):e,i=this.getFoldsInRangeList(n),t)this.removeFolds(i);else for(var s=i;s.length;)this.expandFolds(s),s=this.getFoldsInRangeList(n);if(i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){null==r&&(r=e.start.row),null==i&&(i=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var s=this.doc,o="";return e.walk(function(e,t,n,a){if(!(tc)break}while(s&&l.test(s.type));s=i.stepBackward()}else s=i.getCurrentToken();return u.end.row=i.getCurrentTokenRow(),u.end.column=i.getCurrentTokenColumn()+s.value.length-2,u}},this.foldAll=function(e,t,n){null==n&&(n=1e5);var r=this.foldWidgets;if(r){t=t||this.getLength();for(var i=e=e||0;i=e){i=s.end.row;try{var o=this.addFold("...",s);o&&(o.collapseChildren=n)}catch(e){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};for(var r,i=e-1;i>=0;){var s=n[i];if(null==s&&(s=n[i]=this.getFoldWidget(i)),"start"==s){var o=this.getFoldWidgetRange(i);if(r||(r=o),o&&o.end.row>=e)break}i--}return{range:-1!==i&&o,firstRange:r}},this.onFoldWidgetClick=function(e,t){var n={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var r=t.target||t.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),r=this.getLine(e),i="end"===n?-1:1,s=this.getFoldAt(e,-1===i?0:r.length,i);if(s)return t.children||t.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()&&(s=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(s.range))return this.removeFold(s),s;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,u=a.range.end.row;this.foldAll(l,u,t.all?1e4:0)}else t.children?(u=o?o.end.row:this.getLength(),this.foldAll(e+1,u,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var r=this.getParentFoldRangeData(t,!0);if(n=r.range||r.firstRange){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold("...",n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){"use strict";var r=e("../token_iterator").TokenIterator,i=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(""==n)return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t,n=this.getLine(e.row),r=!0,s=n.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(o||(s=n.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),r=!1),!o)return null;if(o[1]){if(!(a=this.$findClosingBracket(o[1],e)))return null;t=i.fromPoints(e,a),r||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a;if(!(a=this.$findOpeningBracket(o[2],e)))return null;t=i.fromPoints(a,e),r||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn()-2,u=a.value;;){for(;l>=0;){var c=u.charAt(l);if(c==i){if(0==(s-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else c==e&&(s+=1);l-=1}do{a=o.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(u=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn();;){for(var u=a.value,c=u.length;ln&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>1,s=e[i];if(t>s)n=i+1;else{if(!(t=t);s++);return(n=r[s])?(n.index=s,n.start=i-n.value.length,n):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe)),r)var i=this.tokenRe;else i=/^\s+$/.test(n.slice(t-1,t+1))?/\s/:this.nonTokenRe;var s=t;if(s>0){do{s--}while(s>=0&&n.charAt(s).match(i));s++}for(var o=t;oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,s=this.$foldData[i],o=s?s.start.row:1/0,a=t.length,l=0;lo){if((l=s.end.row+1)>=a)break;o=(s=this.$foldData[i++])?s.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>r&&(r=n[l])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var r=e[n];"insert"==r.action||"remove"==r.action?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;ne.end.column&&(s.start.column+=u),s.end.row==e.end.row&&s.end.column>e.end.column&&(s.end.column+=u)),o&&s.start.row>=e.end.row&&(s.start.row+=o,s.end.row+=o)}if(s.end=this.insert(s.start,r),i.length){var a=e.start,l=s.start,u=(o=l.row-a.row,l.column-a.column);this.addFolds(i.map(function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=u),e.end.row==a.row&&(e.end.column+=u),e.start.row+=o,e.end.row+=o,e}))}return s},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},this.outdentRows=function(e){for(var t=e.collapseRows(),n=new c(0,0,0,0),r=this.getTabSize(),i=t.start.row;i<=t.end.row;++i){var s=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o0){var i;if((i=this.getRowFoldEnd(t+n))>this.doc.getLength()-1)return 0;r=i-t}else e=this.$clipRowToDocument(e),r=(t=this.$clipRowToDocument(t))-e+1;var s=new c(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(e){return(e=e.clone()).start.row+=r,e.end.row+=r,e}),a=0==n?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+r,a),o.length&&this.addFolds(o),r},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1&&(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,i=e.end,s=r.row,o=i.row,a=o-s,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[t?"$wrapData":"$rowLengthCache"].splice(s,a);var u=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var c=0;if(m=this.getFoldLine(i.row)){m.addRemoveChars(i.row,i.column,r.column-i.column),m.shiftRow(-a);var h=this.getFoldLine(s);h&&h!==m&&(h.merge(m),m=h),c=u.indexOf(m)+1}for(;c=i.row&&m.shiftRow(-a);o=s}else{var d=Array(a);d.unshift(s,0);var f=t?this.$wrapData:this.$rowLengthCache;if(f.splice.apply(f,d),u=this.$foldData,c=0,m=this.getFoldLine(s)){var p=m.range.compareInside(r.row,r.column);0==p?(m=m.split(r.row,r.column))&&(m.shiftRow(a),m.addRemoveChars(o,0,i.column-r.column)):-1==p&&(m.addRemoveChars(s,0,i.column-r.column),m.shiftRow(a)),c=u.indexOf(m)+1}for(;c=s&&m.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===n&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(m=this.getFoldLine(s))&&m.addRemoveChars(s,r.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),l},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(n,r){var i,s,o=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,u=this.$wrapLimit,c=n;for(r=Math.min(r,o.length-1);c<=r;)(s=this.getFoldLine(c,s))?(i=[],s.walk(function(n,r,s,a){var l;if(null!=n){(l=this.$getDisplayTokens(n,i.length))[0]=e;for(var u=1;u=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}this.$computeWrapSplits=function(n,r,i){if(0==n.length)return[];var s=[],o=n.length,a=0,l=0,u=this.$wrapAsCode,c=this.$indentedSoftWrap,h=r<=Math.max(2*i,8)||!1===c?0:Math.floor(r/2);function d(e){for(var t=e-a,r=a;rr-f;){var p=a+r-f;if(n[p-1]>=10&&n[p]>=10)d(p);else if(n[p]!=e&&n[p]!=t){for(var m=Math.max(p-(r-(r>>2)),a-1);p>m&&n[p]m&&n[p]m&&9==n[p];)p--}else for(;p>m&&n[p]<10;)p--;p>m?d(++p):(2==n[p=a+r]&&p--,d(p-f))}else{for(;p!=a-1&&n[p]!=e;p--);if(p>a){d(p);continue}for(p=a+r;p39&&o<48||o>57&&o<64?i.push(9):o>=4352&&n(o)?i.push(1,2):i.push(1)}return i},this.$getStringScreenWidth=function(e,t,r){if(0==t)return[0,0];var i,s;for(null==t&&(t=1/0),r=r||0,s=0;s=4352&&n(i)?r+=2:r+=1,!(r>t));s++);return[r,s]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0){a=u[c],s=this.$docRowCache[c];var d=e>u[h-1]}else d=!h;for(var f=this.getLength()-1,p=this.getNextFoldLine(s),m=p?p.start.row:1/0;a<=e&&!(a+(l=this.getRowLength(s))>e||s>=f);)a+=l,++s>m&&(s=p.end.row+1,m=(p=this.getNextFoldLine(s,p))?p.start.row:1/0),d&&(this.$docRowCache.push(s),this.$screenRowCache.push(a));if(p&&p.start.row<=s)r=this.getFoldDisplayLine(p),s=p.start.row;else{if(a+l<=e||s>f)return{row:f,column:this.getLine(f).length};r=this.getLine(s),p=null}var g=0,E=Math.floor(e-a);if(this.$useWrapMode){var v=this.$wrapData[s];v&&(i=v[E],E>0&&v.length&&(g=v.indent,o=v[E-1]||v[v.length-1],r=r.substring(o)))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+E,s,E)&&(t=this.$bidiHandler.offsetToCol(n)),o+=this.$getStringScreenWidth(r,t-g)[1],this.$useWrapMode&&o>=i&&(o=i-1),p?p.idxToPosition(o):{row:s,column:o}},this.documentToScreenPosition=function(e,t){if(void 0===t)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r,i=0,s=null;(r=this.getFoldAt(e,t,1))&&(e=r.start.row,t=r.start.column);var o,a=0,l=this.$docRowCache,u=this.$getRowCacheIndex(l,e),c=l.length;if(c&&u>=0){a=l[u],i=this.$screenRowCache[u];var h=e>l[c-1]}else h=!c;for(var d=this.getNextFoldLine(a),f=d?d.start.row:1/0;a=f){if((o=d.end.row+1)>e)break;f=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;i+=this.getRowLength(a),a=o,h&&(this.$docRowCache.push(a),this.$screenRowCache.push(i))}var p="";d&&a>=f?(p=this.getFoldDisplayLine(d,e,t),s=d.start.row):(p=this.getLine(e).substring(0,t),s=e);var m=0;if(this.$useWrapMode){var g=this.$wrapData[s];if(g){for(var E=0;p.length>=g[E];)i++,E++;p=p.substring(g[E-1]||0,p.length),m=E>0?g.indent:0}}return{row:i,column:m+this.$getStringScreenWidth(p)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,r=0,i=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);ri&&(r=t.end.row+1,i=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var o=this.$foldData,a=0;an);s++);return[r,s]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()},this.isFullWidth=n}.call(p.prototype),e("./edit_session/folding").Folding.call(p.prototype),e("./edit_session/bracket_match").BracketMatch.call(p.prototype),o.defineOptions(p.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=p}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(){this.$options={}};(function(){this.set=function(e){return i.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i,o){return r=new s(e,n,i,o),!(n==o&&t.start&&t.start.start&&0!=t.skipCurrent&&r.isEqual(t.start)&&(r=null,1))}),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],a=t.re;if(t.$isMultiLine){var l,u=a.length,c=i.length-u;e:for(var h=a.offset||0;h<=c;h++){for(var d=0;dm||(o.push(l=new s(h,m,h+u-1,g)),u>2&&(h=h+u-2))}}else for(var E=0;ES&&o[d].end.row==n.end.row;)d--;for(o=o.slice(E,d+1),E=0,d=o.length;E=a;n--)if(h(n,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(n=l,a=o.row;n>=a;n--)if(h(n,Number.MAX_VALUE,e))return}};else u=function(e){var n=o.row;if(!h(n,o.column,e)){for(n+=1;n<=l;n++)if(h(n,0,e))return;if(0!=t.wrap)for(n=a,l=o.row;n<=l;n++)if(h(n,0,e))return}};if(t.$isMultiLine)var c=n.length,h=function(t,i,s){var o=r?t-c+1:t;if(!(o<0)){var a=e.getLine(o),l=a.search(n[0]);if(!(!r&&li))return!!s(o,l,o+c-1,h)||void 0}}};else h=r?function(t,r,i){var s,o=e.getLine(t),a=[],l=0;for(n.lastIndex=0;s=n.exec(o);){var u=s[0].length;if(l=s.index,!u){if(l>=o.length)break;n.lastIndex=l+=1}if(s.index+u>r)break;a.push(s.index,u)}for(var c=a.length-1;c>=0;c-=2){var h=a[c-1];if(i(t,h,t,h+(u=a[c])))return!0}}:function(t,r,i){var s,o,a=e.getLine(t);for(n.lastIndex=r;o=n.exec(a);){var l=o[0].length;if(i(t,s=o.index,t,s+l))return!0;if(!l&&(n.lastIndex=s+=1,s>=a.length))return!1}};return{forEach:u}}}).call(o.prototype),t.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/keys"),i=e("../lib/useragent"),s=r.KEY_MODS;function o(e,t){this.platform=t||(i.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function a(e,t){o.call(this,e,t),this.$singleCommand=!1}a.prototype=o.prototype,function(){function e(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var n=e&&("string"==typeof e?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var s=r[i];if(s==e)delete r[i];else if(Array.isArray(s)){var o=s.indexOf(e);-1!=o&&(s.splice(o,1),1==s.length&&(r[i]=s[0]))}}},this.bindKey=function(e,t,n){if("object"==typeof e&&e&&(null==n&&(n=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach(function(e){var r="";if(-1!=e.indexOf(" ")){var i=e.split(/\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=s[t.hashId]+t.key;r+=(r?" ":"")+n,this._addCommandToBinding(r,"chainKeys")},this),r+=" "}var o=this.parseKeys(e),a=s[o.hashId]+o.key;this._addCommandToBinding(r+a,t,n)},this)},this._addCommandToBinding=function(t,n,r){var i,s=this.commandKeyBinding;if(n)if(!s[t]||this.$singleCommand)s[t]=n;else{Array.isArray(s[t])?-1!=(i=s[t].indexOf(n))&&s[t].splice(i,1):s[t]=[s[t]],"number"!=typeof r&&(r=e(n));var o=s[t];for(i=0;ir);i++);o.splice(i,0,n)}else delete s[t]},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(n){if("string"==typeof n)return this.bindKey(n,t);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=t),this.addCommand(n))}},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),i=r[n];if(r.FUNCTION_KEYS[i])n=r.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:n.toUpperCase(),hashId:-1}}for(var s=0,o=t.length;o--;){var a=r.KEY_MODS[t[o]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[o]+" in "+e),!1;s|=a}return{key:n,hashId:s}},this.findKeyCommand=function(e,t){var n=s[e]+t;return this.commandKeyBinding[n]},this.handleKeyboard=function(e,t,n,r){if(!(r<0)){var i=s[t]+n,o=this.commandKeyBinding[i];return e.$keyChain&&(e.$keyChain+=" "+i,o=this.commandKeyBinding[e.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(e.$keyChain&&(t&&4!=t||1!=n.length?(-1==t||r>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-i.length-1)),{command:o}):(e.$keyChain=e.$keyChain||i,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(o.prototype),t.HashHandler=o,t.MultiHashHandler=a}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){i.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};r.inherits(o,i),function(){r.implement(this,s),this.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var i={editor:t,command:e,args:n};return i.returnValue=this._emit("exec",i),this._signal("afterExec",i),!1!==i.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map(function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=e("../config"),s=e("../range").Range;function o(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(e){i.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,a=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(n.row),u=n.row+1;u<=i.row+1;u++){var c=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(u)));0!==c.length&&(c=" "+c),l+=c}i.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;o=i.lastRow||r.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var i=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&-1!==n.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var n=this;E.loadModule(["keybinding",e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||i.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=t.findMatchingBracket(e.getCursorPosition());if(n)var r=new f(n.row,n.column,n.row,n.column+1);else t.$mode.getMatching&&(r=t.$mode.getMatching(e.session));r&&(t.$bracketHighlight=t.addMarker(r,"ace_bracket","text"))}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=e.getCursorPosition(),r=new v(e.session,n.row,n.column),i=r.getCurrentToken();if(!i||!/\b(?:tag-open|tag-name)/.test(i.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1==i.type.indexOf("tag-open")||(i=r.stepForward())){var s=i.value,o=0,a=r.stepBackward();if("<"==a.value)do{a=i,(i=r.stepForward())&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"=0);else{do{i=a,a=r.stepBackward(),i&&i.value===s&&-1!==i.type.indexOf("tag-name")&&("<"===a.value?o++:"1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var n=new f(e.row,e.column,e.row,1/0);n.id=t.addMarker(n,"ace_active-line","screenLine"),t.$highlightLineMarker=n}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var n=t.start.column,r=t.end.column,i=e.getLine(t.start.row),s=i.substring(n,r);if(!(s.length>5e3)&&/[\w\d]/.test(s)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),a=i.substring(n-1,r+1);if(o.test(a))return o}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var r=this.selection.getAllRanges(),i=0;ia.search(/\S|$/)){var l=a.substr(i.column).search(/\S|$/);n.doc.removeInLine(i.row,i.column,i.column+l)}}this.clearSelection();var u=i.column,c=n.getState(i.row),h=(a=n.getLine(i.row),r.checkOutdent(c,a,e));if(n.insert(i,e),s&&s.selection&&(2==s.selection.length?this.selection.setSelectionRange(new f(i.row,u+s.selection[0],i.row,u+s.selection[1])):this.selection.setSelectionRange(new f(i.row+s.selection[0],s.selection[1],i.row+s.selection[2],s.selection[3]))),n.getDocument().isNewLine(e)){var d=r.getNextLineIndent(c,a.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},d)}h&&r.autoOutdent(c,n,i.row)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(e,t){var n;(t.extendLeft||t.extendRight)&&((n=this.selection.getRange()).start.column-=t.extendLeft,n.end.column+=t.extendRight,this.selection.setRange(n),e||n.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((n=this.selection.getRange()).start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,"deletion",this,n,t);if(0===t.end.column){var s=n.getTextRange(t);if("\n"==s[s.length-1]){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var n,r,i=this.session.getLine(e.row);tt.toLowerCase()?1:0});var i=new f(0,0,0,0);for(r=e.first;r<=e.last;r++){var s=t.getLine(r);i.start.row=r,i.end.row=r,i.end.column=s.length,t.replace(i,n[r-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var r=this.session.getLine(e);n.lastIndex=t)return{value:i[0],start:i.index,end:i.index+i[0].length}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new f(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var s=this.getNumberAt(t,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,a=s.start+s.value.length-o,l=parseFloat(s.value);l*=Math.pow(10,a),o!==s.end&&n=a&&o<=l&&(n=t,u.selection.clearSelection(),u.moveCursorTo(e,a+r),u.selection.selectTo(e,l+r)),a=l});for(var c,h=this.$toggleWordPairs,d=0;df+1)break;f=p.last}for(c--,a=this.session.$moveLines(d,f,t?0:e),t&&-1==e&&(h=c+1);h<=c;)o[h].moveBy(a,0),h++;t||(a=0),l+=a}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);!0===t?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):!1===t&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,i*r.lineHeight),null!=t&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new v(this.session,n.row,n.column),i=r.getCurrentToken(),s=i||r.stepForward();if(s){var o,a,l=!1,u={},c=n.column-s.start,h={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;c=0;--s)this.$tryReplace(n[s],e)&&r++;return this.selection.setSelectionRange(i),r},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return null!==(t=this.$search.replace(n,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&r.mixin(t,e);var i=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(i)||this.$search.$options.needle)||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var s=this.$search.find(this.session);return t.preventScroll?s:s?(this.revealRange(s,n),s):(t.backwards?i.start=i.end:i.end=i.start,void this.selection.setRange(i))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(e){var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var s=this.on("changeSelection",function(){r=!0}),o=this.renderer.on("beforeRender",function(){r&&(t=n.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,s=e.$cursorLayer.$pixelPos,o=e.layerConfig,a=s.top-o.offset;null!=(r=s.top>=0&&a+t.top<0||!(s.topwindow.innerHeight)&&null)&&(i.style.top=a+"px",i.style.left=s.left+"px",i.style.height=o.lineHeight+"px",i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",o))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,i.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},this.prompt=function(e,t,n){var r=this;E.loadModule("./ext/prompt",function(i){i.prompt(r,e,t,n)})}}.call(D.prototype),E.defineOptions(D.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?S.attach(this):S.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?S.attach(this):S.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.renderer.$composition||this.getValue();if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),i.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!e&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),i.addCssClass(this.container,"ace_hasPlaceholder");var t=i.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var S={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=D}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,n){this.$fromUndo||e!=this.$lastDelta&&(!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,r=n.length;r--;){var i=n[r][0];if(i.id<=e)break;i.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?a(e):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(r.prototype);var i=e("./range").Range,s=i.comparePoints;function o(e){return{row:e.row,column:e.column}}function a(e){if(e=e||this,Array.isArray(e))return e.map(a).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function u(e,t){var n="insert"==e.action,r="insert"==t.action;if(n&&r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}else if(!n&&r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.start,e.start)<=0))return null;d(e,t,1)}else if(!n&&!r)if(s(t.start,e.start)>=0)d(t,e,1);else{if(!(s(t.end,e.start)<=0))return null;d(e,t,-1)}return[t,e]}function c(e,t){for(var n=e.length;n--;)for(var r=0;r=0?d(e,t,-1):(s(e.start,t.start)<=0||d(e,i.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!n&&r)s(t.start,e.end)>=0?d(t,e,-1):(s(t.start,e.start)<=0||d(t,i.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!n&&!r)if(s(t.start,e.end)>=0)d(t,e,-1);else{var o,a;if(!(s(t.end,e.start)<=0))return s(e.start,t.start)<0&&(o=e,e=p(e,t.start)),s(e.end,t.end)>0&&(a=p(e,t.end)),f(t.end,e.start,e.end,-1),a&&!o&&(e.lines=a.lines,e.start=a.start,e.end=a.end,a=e),[t,o,a].filter(Boolean);d(e,t,-1)}return[t,e]}function d(e,t,n){f(e.start,t.start,t.end,n),f(e.end,t.start,t.end,n)}function f(e,t,n,r){e.row==(1==r?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function p(e,t){var n=e.lines,r=e.end;e.end=o(t);var i=e.end.row-e.start.row,s=n.splice(i,n.length),a=i?t.column:t.column-e.start.column;return n.push(s[0].substring(0,a)),s[0]=s[0].substr(a),{start:o(t),end:r,lines:s,action:e.action}}function m(e,t){t=function(e){return{start:o(e.start),end:o(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var n=e.length;n--;){for(var r=e[n],i=0;is&&(l=i.end.row+1,s=(i=t.getNextFoldLine(l,i))?i.start.row:1/0),l>r){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,e,this.session,u),this.$lines.push(o)),this.$renderCell(o,e,i,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,i=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(i=t.getLength()+r-1);var s=n?n.getWidth(t,i,e):i.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();(s+=o.left+o.right)===this.gutterWidth||isNaN(s)||(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(r.row>this.$cursorRow){var i=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&i&&i.start.row==t[n-1].row))break;r=t[n-1]}r.element.className="ace_gutter-active-line "+r.element.className,this.$cursorCell=r;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;if(this.oldLastRow=n,!t||r0;i--)this.$lines.shift();if(r>n)for(i=this.session.getFoldedRowCount(n+1,r);i>0;i--)this.$lines.pop();e.firstRowr&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,n){for(var r=[],i=t,s=this.session.getNextFoldLine(i),o=s?s.start.row:1/0;i>o&&(i=s.end.row+1,o=(s=this.session.getNextFoldLine(i,s))?s.start.row:1/0),!(i>n);){var a=this.$lines.createCell(i,e,this.session,u);this.$renderCell(a,e,s,i),r.push(a),i++}return r},this.$renderCell=function(e,t,n,i){var s=e.element,o=this.session,a=s.childNodes[0],l=s.childNodes[1],u=o.$firstLineNumber,c=o.$breakpoints,h=o.$decorations,d=o.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&o.foldWidgets,p=n?n.start.row:Number.MAX_VALUE,m="ace_gutter-cell ";if(this.$highlightGutterLine&&(i==this.$cursorRow||n&&i=p&&this.$cursorRow<=n.end.row)&&(m+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),c[i]&&(m+=c[i]),h[i]&&(m+=h[i]),this.$annotations[i]&&(m+=this.$annotations[i].className),s.className!=m&&(s.className=m),f){var g=f[i];null==g&&(g=f[i]=o.getFoldWidget(i))}if(g){m="ace_fold-widget ace_"+g,"start"==g&&i==p&&in.right-t.right?"foldWidgets":void 0}}).call(l.prototype),t.Gutter=l}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/dom"),s=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){function e(e,t,n,r){return(e?1:0)|(t?2:0)|(n?4:0)|(r?8:0)}this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},this.update=function(e){if(e){var t;for(var n in this.config=e,this.i=0,this.markers){var r=this.markers[n];if(r.range){var i=r.range.clipRows(e.firstRow,e.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),r.renderer){var s=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,s,e)}else"fullLine"==r.type?this.drawFullLineMarker(t,i,r.clazz,e):"screenLine"==r.type?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?"text"==r.type?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+" ace_start ace_br15",e)}else r.update(t,this,this.session,e)}if(-1!=this.i)for(;this.if,c==u),s,c==u?0:1,o)},this.drawMultiLineMarker=function(e,t,n,r,i){var s=this.$padding,o=r.lineHeight,a=this.$getTop(t.start.row,r),l=s+t.start.column*r.characterWidth;if(i=i||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((u=t.clone()).end.row=u.start.row,u.end.column=this.session.getLine(u.start.row).length,this.drawBidiSingleLineMarker(e,u,n+" ace_br1 ace_start",r,null,i)):this.elt(n+" ace_br1 ace_start","height:"+o+"px;right:0;top:"+a+"px;left:"+l+"px;"+(i||"")),this.session.$bidiHandler.isBidiRow(t.end.row)){var u;(u=t.clone()).start.row=u.end.row,u.start.column=0,this.drawBidiSingleLineMarker(e,u,n+" ace_br12",r,null,i)}else{a=this.$getTop(t.end.row,r);var c=t.end.column*r.characterWidth;this.elt(n+" ace_br12","height:"+o+"px;width:"+c+"px;top:"+a+"px;left:"+s+"px;"+(i||""))}if(!((o=(t.end.row-t.start.row-1)*r.lineHeight)<=0)){a=this.$getTop(t.start.row+1,r);var h=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+o+"px;right:0;top:"+a+"px;left:"+s+"px;"+(i||""))}},this.drawSingleLineMarker=function(e,t,n,r,i,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,i,s);var o=r.lineHeight,a=(t.end.column+(i||0)-t.start.column)*r.characterWidth,l=this.$getTop(t.start.row,r),u=this.$padding+t.start.column*r.characterWidth;this.elt(n,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+u+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(e,t,n,r,i,s){var o=r.lineHeight,a=this.$getTop(t.start.row,r),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(n,"height:"+o+"px;width:"+e.width+(i||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-s),this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))},this.drawScreenLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(i||""))}}).call(s.prototype),t.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=function(e){this.dom=i,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){r.implement(this,a),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;nc&&(a=l.end.row+1,c=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(a>i);){var h=s[o++];if(h){this.dom.removeChildren(h),this.$renderLine(h,a,a==c&&l),u&&(h.style.top=this.$lines.computeLineTop(a,e,this.session)+"px");var d=e.lineHeight*this.session.getRowLength(a)+"px";h.style.height!=d&&(u=!0,h.style.height=d)}a++}if(u)for(;o0;i--)this.$lines.shift();if(t.lastRow>e.lastRow)for(i=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);i>0;i--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,n){for(var r=[],s=t,o=this.session.getNextFoldLine(s),a=o?o.start.row:1/0;s>a&&(s=o.end.row+1,a=(o=this.session.getNextFoldLine(s,o))?o.start.row:1/0),!(s>n);){var l=this.$lines.createCell(s,e,this.session),u=l.element;this.dom.removeChildren(u),i.setStyle(u.style,"height",this.$lines.computeLineHeight(s,e,this.session)+"px"),i.setStyle(u.style,"top",this.$lines.computeLineTop(s,e,this.session)+"px"),this.$renderLine(u,s,s==a&&o),this.$useLineGroups()?u.className="ace_line_group":u.className="ace_line",r.push(l),s++}return r},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,n=e.lastRow,r=this.$lines;r.getLength();)r.pop();r.push(this.$renderLinesFragment(e,t,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,r){for(var i,o=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),u=0;i=a.exec(r);){var c=i[1],h=i[2],d=i[3],f=i[4],p=i[5];if(o.showInvisibles||!h){var m=u!=i.index?r.slice(u,i.index):"";if(u=i.index+i[0].length,m&&l.appendChild(this.dom.createTextNode(m,this.element)),c){var g=o.session.getScreenTabSize(t+i.index);l.appendChild(o.$tabStrings[g].cloneNode(!0)),t+=g-1}else h?o.showInvisibles?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",v.textContent=s.stringRepeat(o.SPACE_CHAR,h.length),l.appendChild(v)):l.appendChild(this.com.createTextNode(h,this.element)):d?((v=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",v.textContent=s.stringRepeat(o.SPACE_CHAR,d.length),l.appendChild(v)):f?(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className=o.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",v.textContent=o.showInvisibles?o.SPACE_CHAR:f,l.appendChild(v)):p&&(t+=1,(v=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",v.className="ace_cjk",v.textContent=p,l.appendChild(v))}}if(l.appendChild(this.dom.createTextNode(u?r.slice(u):r,this.element)),this.$textToken[n.type])e.appendChild(l);else{var E="ace_"+n.type.replace(/\./g," ace_"),v=this.dom.createElement("span");"fold"==n.type&&(v.style.width=n.value.length*this.config.characterWidth+"px"),v.className=E,v.appendChild(l),e.appendChild(v)}return t+r.length},this.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(" "==t[0]){for(var i=(r-=r%this.tabSize)/this.tabSize,s=0;s=o;)a=this.$renderToken(l,a,c,h.substring(0,o-r)),h=h.substring(o-r),r=o,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(s.stringRepeat(" ",n.indent),this.element)),a=0,o=n[++i]||Number.MAX_VALUE;0!=h.length&&(r+=h.length,a=this.$renderToken(l,a,c,h))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(e,t){var n=0,r=t[0],i=r.value;this.displayIndentGuides&&(i=this.renderIndentGuide(e,i)),i&&(n=this.$renderToken(e,n,r,i));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,r,i);n=this.$renderToken(e,n,r,i)}},this.$renderOverflowMessage=function(e,t,n,r,i){n&&this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=i?"":"",e.appendChild(s)},this.$renderLine=function(e,t,n){if(n||0==n||(n=this.session.getFoldLine(t)),n)var r=this.$getFoldLineTokens(t,n);else r=this.session.getTokens(t);var i=e;if(r.length){var s=this.session.getRowSplitData(t);s&&s.length?(this.$renderWrappedLine(e,r,s),i=e.lastChild):(i=e,this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i)),this.$renderSimpleLine(i,r))}else this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i));if(this.showInvisibles&&i){n&&(t=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,i.appendChild(o)}},this.$getFoldLineTokens=function(e,t){var n=this.session,r=[],i=n.getTokens(e);return t.walk(function(e,t,s,o,a){null!=e?r.push({type:"fold",value:e}):(a&&(i=n.getTokens(t)),i.length&&function(e,t,n){for(var i=0,s=0;s+e[i].value.lengthn-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),s=t+o.length,i+=1);sn?r.push({type:e[i].type,value:o.substring(0,n-s)}):r.push(e[i]),s+=o.length,i+=1}}(i,o,s))},t.end.row,this.session.getLine(t.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),t.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)r.setStyle(t[n].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){r.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){r.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&r.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}else this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||o.top<0)&&n>1)){var a=this.cursors[i++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,o,e,t[n],this.session):this.isCursorInView(o,e)?(r.setStyle(l,"display","block"),r.translate(a,o.left,o.top),r.setStyle(l,"width",Math.round(e.characterWidth)+"px"),r.setStyle(l,"height",e.lineHeight+"px")):r.setStyle(l,"display","none")}}for(;this.cursors.length>i;)this.removeCursor();var u=this.session.getOverwrite();this.$setOverwrite(u),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(i.prototype),t.Cursor=i}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,a=32768,l=function(e){this.element=i.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){r.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(l.prototype);var u=function(e,t){l.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=i.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};r.inherits(u,l),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>a?(this.coeff=a/e,e=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(u.prototype);var c=function(e,t){l.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};r.inherits(c,l),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(c.prototype),t.ScrollBar=u,t.ScrollBarV=u,t.ScrollBarH=c,t.VScrollBar=u,t.HScrollBar=c}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){"use strict";var r=e("./lib/event"),i=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(r.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(i.prototype),t.RenderLoop=i}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,u=256,c="function"==typeof ResizeObserver,h=200,d=t.FontMetrics=function(e){this.el=i.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.innerHTML=s.stringRepeat("X",u),this.$characterSize={width:0,height:0},c?this.$addObserver():this.checkForSizeChanges()};(function(){r.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){var n=t[0].contentRect;e.checkForSizeChanges({height:n.height,width:n.width/u})}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/u};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.innerHTML=s.stringRepeat(e,u),this.$main.getBoundingClientRect().width/u},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=i.buildDom([e(0,0),e(h,0),e(0,h),e(h,h)],this.el)},this.transformCoordinates=function(e,t){function n(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function r(e,t){return[e[0]-t[0],e[1]-t[1]]}function i(e,t){return[e[0]+t[0],e[1]+t[1]]}function s(e,t){return[e*t[0],e*t[1]]}function o(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=s(1/this.$getZoom(this.el),e)),this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),u=o(this.els[2]),c=o(this.els[3]),d=n(r(c,l),r(c,u),r(i(l,u),i(c,a))),f=s(1+d[0],r(l,a)),p=s(1+d[1],r(u,a));if(t){var m=t,g=d[0]*m[0]/h+d[1]*m[1]/h+1,E=i(s(m[0],f),s(m[1],p));return i(s(1/g/h,E),a)}var v=r(e,a),C=n(r(f,s(d[0],v)),r(p,s(d[1],v)),v);return s(h,C)}}).call(d.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./config"),o=e("./layer/gutter").Gutter,a=e("./layer/marker").Marker,l=e("./layer/text").Text,u=e("./layer/cursor").Cursor,c=e("./scrollbar").HScrollBar,h=e("./scrollbar").VScrollBar,d=e("./renderloop").RenderLoop,f=e("./layer/font_metrics").FontMetrics,p=e("./lib/event_emitter").EventEmitter,m='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;perspective: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);opacity: 0.7;transform-origin: left;text-indent: 10px;}',g=e("./lib/useragent"),E=g.isIE;i.importCssString(m,"ace_editor.css");var v=function(e,t){var n=this;this.container=e||i.createElement("div"),i.addCssClass(this.container,"ace_editor"),i.HI_DPI&&i.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=i.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=i.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=i.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var r=this.$textLayer=new l(this.content);this.canvas=r.element,this.$markerFront=new a(this.content),this.$cursorLayer=new u(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new f(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!g.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,p),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),i.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,n){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,r){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var i=this.container;r||(r=i.clientHeight||i.scrollHeight),n||(n=i.clientWidth||i.scrollWidth);var s=this.$updateCachedSize(e,t,n,r);if(!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var s=0,o=this.$size,a={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if(r&&(e||o.height!=r)&&(o.height=r,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL),n&&(e||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,i.setStyle(this.scrollBarH.element.style,"left",t+"px"),i.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),i.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";i.setStyle(this.scrollBarH.element.style,"right",l),i.setStyle(this.scroller.style,"right",l),i.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(s|=this.CHANGE_FULL)}return o.$dirty=!n||!r,s&&this._signal("resize",a),s},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=i.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=i.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var n=this.$cursorLayer.$pixelPos;if(n){t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var r=this.layerConfig,s=n.top,o=n.left;s-=r.offset;var a=t&&t.useTextareaForIME?this.lineHeight:E?0:1;if(s<0||s>r.height-a)i.translate(this.textarea,0,0);else{var l=1,u=this.$size.height-a;if(t)if(t.useTextareaForIME){var c=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(c)[0]}else s+=this.lineHeight+2;else s+=this.lineHeight;(o-=this.scrollLeft)>this.$size.scrollerWidth-l&&(o=this.$size.scrollerWidth-l),o+=this.gutterWidth+this.margin.left,i.setStyle(e,"height",a+"px"),i.setStyle(e,"width",l+"px"),i.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-l),Math.min(s,u))}}}else i.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},this.setMargin=function(e,t,n,r){var i=this.margin;i.top=0|e,i.bottom=0|t,i.right=0|r,i.left=0|n,i.v=i.top+i.bottom,i.h=i.left+i.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender"),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),i.translate(this.content,-this.scrollLeft,-n.offset);var s=n.width+2*this.$padding+"px",o=n.minHeight+"px";i.setStyle(this.content.style,"width",s),i.setStyle(this.content.style,"height",o)}if(e&this.CHANGE_H_SCROLL&&(i.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender");e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender")}else this.$changes|=e},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=!(n<=2*this.lineHeight)&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||r!=this.$vScroll){r!=this.$vScroll&&(this.$vScroll=r,this.scrollBarV.setVisible(r));var i=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,i,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength()*this.lineHeight,i=this.$getLongestLine(),s=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-i-2*this.$padding<0),o=this.$horizScroll!==s;o&&(this.$horizScroll=s,this.scrollBarH.setVisible(s));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,u=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;r+=u;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,r-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,i+2*this.$padding-t.scrollerWidth+c.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-r+u<0||this.scrollTop>c.top),d=a!==h;d&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var f,p,m=this.scrollTop%this.lineHeight,g=Math.ceil(l/this.lineHeight)-1,E=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),v=E+g,C=this.lineHeight;E=e.screenToDocumentRow(E,0);var D=e.getFoldLine(E);D&&(E=D.start.row),f=e.documentToScreenRow(E,0),p=e.getRowLength(E)*C,v=Math.min(e.screenToDocumentRow(v,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(v)*C+p,m=this.scrollTop-f*C;var S=0;return(this.layerConfig.width!=i||o)&&(S=this.CHANGE_H_SCROLL),(o||d)&&(S|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(i=this.$getLongestLine())),this.layerConfig={width:i,padding:this.$padding,firstRow:E,firstRowScreen:f,lastRow:v,lineHeight:C,characterWidth:this.characterWidth,minHeight:l,maxHeight:r,offset:m,gutterOffset:C?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/C)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(i-this.$padding),S},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1||tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t,n){if(0!==this.$size.scrollerHeight){var r=this.$cursorLayer.getPixelPosition(e),i=r.left,s=r.top,o=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+o>s?(t&&l+o>s+this.lineHeight&&(s-=t*this.$size.scrollerHeight),0===s&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):l+this.$size.scrollerHeight-ai?(i=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:a,side:s-a>0?1:-1,offsetX:i}},this.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),a=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),i)},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),s=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+s-this.scrollTop}},this.visualizeFocus=function(){i.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){i.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),e.useTextareaForIME=this.$useTextareaForIME,this.$useTextareaForIME?(i.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),i.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText,this.$composition=null,this.$cursorLayer.element.style.display="")},this.addToken=function(e,t,n,r){var i=this.session;i.bgTokenizer.lines[n]=null;var s={type:t,value:e},o=i.getTokens(n);if(null==r)o.push(s);else for(var a=0,l=0;l50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,n){var r=null,i=!1,a=Object.create(s),u=[],c=new l({messageBuffer:u,terminate:function(){},postMessage:function(e){u.push(e),r&&(i?setTimeout(h):h())}});c.setEmitSync=function(e){i=e};var h=function(){var e=u.shift();e.command?r[e.command].apply(r,e.args):e.event&&a._signal(e.event,e.data)};return a.postMessage=function(e){c.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},o.loadModule(["worker",t],function(e){for(r=new e[n](a);u.length;)h()}),c},t.WorkerClient=l,t.createWorker=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(e,t,n,r,i,s){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,i),this.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,s=t.start.column-this.pos.column;if(this.updateAnchors(e),i&&(this.length+=n),i&&!this.session.$fromUndo)if("insert"===e.action)for(var o=this.others.length-1;o>=0;o--){var a={row:(l=this.others[o]).row,column:l.column+s};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(o=this.others.length-1;o>=0;o--){var l;a={row:(l=this.others[o]).row,column:l.column+s},this.doc.remove(new r(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,i){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),i,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)}},this.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new r,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{n=this.getRange();var r=this.isBackwards(),s=n.start.row,o=n.end.row;if(s==o){if(r)var a=n.end,l=n.start;else a=n.start,l=n.end;return this.addRange(i.fromPoints(l,l)),void this.addRange(i.fromPoints(a,a))}var u=[],c=this.getLineRange(s,!0);c.start.column=n.start.column,u.push(c);for(var h=s+1;h1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(r,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],s=e.column0;)E--;if(E>0)for(var v=0;r[v].isEmpty();)v++;for(var C=E;C>=v;C--)r[C].isEmpty()&&r.splice(C,1)}return r}}.call(s.prototype);var d=e("./editor").Editor;function f(e,t){return e.row==t.row&&e.column==t.column}function p(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",o),e.commands.addCommands(u.defaultCommands),function(e){if(e.textInput){var t=e.textInput.getElement(),n=!1;a.addListener(t,"keydown",function(t){var i=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&i?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&r()}),a.addListener(t,"keyup",r),a.addListener(t,"blur",r)}function r(t){n&&(e.renderer.setMouseCursor(""),n=!1)}}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var r=e[n];if(r.marker){this.session.removeMarker(r.marker);var i=t.indexOf(r);-1!=i&&t.splice(i,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(u.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(u.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?r=n.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?r=n.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});else{var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return r}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var r,i=n&&n.keepOrder,o=1==n||n&&n.$byLines,a=this.session,l=this.selection,u=l.rangeList,c=(i?l:u).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var h=l._eventRegistry;l._eventRegistry={};var d=new s(a);this.inVirtualSelectionMode=!0;for(var f=c.length;f--;){if(o)for(;f>0&&c[f].start.row==c[f-1].end.row;)f--;d.fromOrientedRange(c[f]),d.index=f,this.selection=a.selection=d;var p=e.exec?e.exec(this,t||{}):e(this,t||{});r||void 0===p||(r=p),d.toOrientedRange(c[f])}d.detach(),this.selection=a.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=h,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),r}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],r=0;ro&&(o=n.column),rc?e.insert(r,l.stringRepeat(" ",s-c)):e.remove(new i(r.row,r.column,r.row,r.column-s+c)),t.start.column=t.end.column=o,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var c=this.selection.getRange(),h=c.start.row,d=c.end.row,f=h==d;if(f){var p,m=this.session.getLength();do{p=this.session.getLine(d)}while(/[=:]/.test(p)&&++d0);h<0&&(h=0),d>=m&&(d=m-1)}var g=this.session.removeFullLines(h,d);g=this.$reAlignText(g,f),this.session.insert({row:h,column:0},g.join("\n")+"\n"),f||(c.start.column=0,c.end.column=g[g.length-1].length),this.selection.setRange(c)}},this.$reAlignText=function(e,t){var n,r,i,s=!0,o=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==n?(n=t[1].length,r=t[2].length,i=t[3].length,t):(n+r+i!=t[1].length+t[2].length+t[3].length&&(o=!1),n!=t[1].length&&(s=!1),n>t[1].length&&(n=t[1].length),rt[3].length&&(i=t[3].length),t):[e]}).map(t?u:s?o?function(e){return e[2]?a(n+r-e[2].length)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:u:function(e){return e[2]?a(n)+e[2]+a(i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function a(e){return l.stringRepeat(" ",e)}function u(e){return e[2]?a(n)+e[2]+a(r-e[2].length+i)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=p,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){p(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,s=e.getLine(t),o=s.search(i);if(-1!=o){for(var a=n||s.length,l=e.getLength(),u=t,c=t;++tu){var f=e.getLine(c).length;return new r(u,a,c,f)}}},this.openingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i+1},a=e.$findClosingBracket(t,o,s);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>o.row&&(a.row--,a.column=e.getLine(a.row).length),r.fromPoints(o,a)}},this.closingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i},a=e.$findOpeningBracket(t,o);if(a)return a.column++,o.column--,r.fromPoints(a,o)}}).call(i.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function i(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}e("./range").Range,function(){this.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(n&&e.action){for(var r=e.data,i=r.start.row,s=r.end.row,o="add"==e.action,a=i+1;a0&&!r[i];)i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=s;o++){var a=r[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var u=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(u-=t.scrollLeft),a.el.style.left=u+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}.call(i.prototype),t.LineWidgets=i}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,n){"use strict";var r=e("../line_widgets").LineWidgets,i=e("../lib/dom"),s=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var o=e.getCursorPosition(),a=o.row,l=n.widgetManager.getWidgetsAtRow(a).filter(function(e){return"errorMarker"==e.type})[0];l?l.destroy():a-=t;var u,c=function(e,t,n){var r=e.getAnnotations().sort(s.comparePoints);if(r.length){var i=function(e,t,n){for(var r=0,i=e.length-1;r<=i;){var s=r+i>>1,o=n(t,e[s]);if(o>0)r=s+1;else{if(!(o<0))return s;i=s-1}}return-(r+1)}(r,{row:t,column:-1},s.comparePoints);i<0&&(i=-i-1),i>=r.length?i=n>0?0:r.length-1:0===i&&n<0&&(i=r.length-1);var o=r[i];if(o&&n){if(o.row===t){do{o=r[i+=n]}while(o&&o.row===t);if(!o)return r.slice()}var a=[];t=o.row;do{a[n<0?"unshift":"push"](o),o=r[i+=n]}while(o&&o.row==t);return a.length&&a}}}(n,a,t);if(c){var h=c[0];o.column=(h.pos&&"number"!=typeof h.column?h.pos.sc:h.column)||0,o.row=h.row,u=e.renderer.$gutterLayer.$annotations[o.row]}else{if(l)return;u={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(o.row),e.selection.moveToPosition(o);var d={row:o.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},f=d.el.appendChild(i.createElement("div")),p=d.el.appendChild(i.createElement("div"));p.className="error_widget_arrow "+u.className;var m=e.renderer.$cursorLayer.getPixelPosition(o).left;p.style.left=m+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",f.className="error_widget "+u.className,f.innerHTML=u.text.join("
"),f.appendChild(i.createElement("div"));var g=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(g),n.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(g),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t,r){"use strict";e("./lib/fixoldbrowsers");var i=e("./lib/dom"),s=e("./lib/event"),o=e("./range").Range,a=e("./editor").Editor,l=e("./edit_session").EditSession,u=e("./undomanager").UndoManager,c=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,t.define=n.amdD,t.edit=function(e,n){if("string"==typeof e){var r=e;if(!(e=document.getElementById(r)))throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof a)return e.env.editor;var o="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;o=l.value,e=i.createElement("pre"),l.parentNode.replaceChild(e,l)}else e&&(o=e.textContent,e.innerHTML="");var u=t.createEditSession(o),h=new a(new c(e),u,n),d={document:u,editor:h,onResize:h.resize.bind(h,null)};return l&&(d.textarea=l),s.addListener(window,"resize",d.onResize),h.on("destroy",function(){s.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),h.container.env=h.env=d,h},t.createEditSession=function(e,t){var n=new l(e,t);return n.setUndoManager(new u),n},t.Range=o,t.Editor=a,t.EditSession=l,t.UndoManager=u,t.VirtualRenderer=c,t.version=t.config.version}),ace.require(["ace/ace"],function(t){for(var n in t&&(t.config.init(!0),t.define=ace.define),window.ace||(window.ace=t),t)t.hasOwnProperty(n)&&(window.ace[n]=t[n]);window.ace.default=window.ace,e&&(e.exports=window.ace)}),e.exports={ace}},247(e,t,n){"use strict";var r=n(982),i=n(159),s=n(961);function o(e){var t="https://react.dev/errors/"+e;if(1P||(e.current=M[P],M[P]=null,P--)}function $(e,t){P++,M[P]=e.current,e.current=t}var G,V,W=B(null),H=B(null),j=B(null),z=B(null);function X(e,t){switch($(j,t),$(H,e),$(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=Eh(t=gh(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(W),$(W,e)}function K(){U(W),U(H),U(j)}function Y(e){null!==e.memoizedState&&$(z,e);var t=W.current,n=Eh(t,e.type);t!==n&&($(H,e),$(W,n))}function q(e){H.current===e&&(U(W),U(H)),z.current===e&&(U(z),ud._currentValue=k)}function Q(e){if(void 0===G)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);G=t&&t[1]||"",V=-1)":-1--i||l[r]!==u[i]){var c="\n"+l[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}}while(1<=r&&0<=i);break}}}finally{Z=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Q(n):""}function ee(e,t){switch(e.tag){case 26:case 27:case 5:return Q(e.type);case 16:return Q("Lazy");case 13:return e.child!==t&&null!==t?Q("Suspense Fallback"):Q("Suspense");case 19:return Q("SuspenseList");case 0:case 15:return J(e.type,!1);case 11:return J(e.type.render,!1);case 1:return J(e.type,!0);case 31:return Q("Activity");default:return""}}function te(e){try{var t="",n=null;do{t+=ee(e,n),n=e,e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var ne=Object.prototype.hasOwnProperty,re=r.unstable_scheduleCallback,ie=r.unstable_cancelCallback,se=r.unstable_shouldYield,oe=r.unstable_requestPaint,ae=r.unstable_now,le=r.unstable_getCurrentPriorityLevel,ue=r.unstable_ImmediatePriority,ce=r.unstable_UserBlockingPriority,he=r.unstable_NormalPriority,de=r.unstable_LowPriority,fe=r.unstable_IdlePriority,pe=r.log,me=r.unstable_setDisableYieldValue,ge=null,Ee=null;function ve(e){if("function"==typeof pe&&me(e),Ee&&"function"==typeof Ee.setStrictMode)try{Ee.setStrictMode(ge,e)}catch(e){}}var Ce=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(De(e)/Se|0)|0},De=Math.log,Se=Math.LN2,Ae=256,_e=262144,ye=4194304;function be(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Te(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var i=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var a=134217727&r;return 0!==a?0!==(r=a&~s)?i=be(r):0!==(o&=a)?i=be(o):n||0!==(n=a&~e)&&(i=be(n)):0!==(a=r&~s)?i=be(a):0!==o?i=be(o):n||0!==(n=r&~e)&&(i=be(n)),0===i?0:0!==t&&t!==i&&0===(t&s)&&((s=i&-i)>=(n=t&-t)||32===s&&4194048&n)?t:i}function Re(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function we(){var e=ye;return!(62914560&(ye<<=1))&&(ye=4194304),e}function Fe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ne(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Le(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ce(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function Oe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ce(n),i=1<=bn),xn=String.fromCharCode(32),wn=!1;function Fn(e,t){switch(e){case"keyup":return-1!==_n.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Ln=!1,On={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function In(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!On[e.type]:"textarea"===t}function kn(e,t,n,r){It?kt?kt.push(r):kt=[r]:It=r,0<(t=nh(t,"onChange")).length&&(n=new tn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Mn=null,Pn=null;function Bn(e){Kc(e,0)}function Un(e){if(ft(Qe(e)))return e}function $n(e,t){if("change"===e)return t}var Gn=!1;if($t){var Vn;if($t){var Wn="oninput"in document;if(!Wn){var Hn=document.createElement("div");Hn.setAttribute("oninput","return;"),Wn="function"==typeof Hn.oninput}Vn=Wn}else Vn=!1;Gn=Vn&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Jn(r)}}function tr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?tr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function nr(e){for(var t=pt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=pt((e=t.contentWindow).document)}return t}function rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var ir=$t&&"documentMode"in document&&11>=document.documentMode,sr=null,or=null,ar=null,lr=!1;function ur(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;lr||null==sr||sr!==pt(r)||(r="selectionStart"in(r=sr)&&rr(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},ar&&Zn(ar,r)||(ar=r,0<(r=nh(or,"onSelect")).length&&(t=new tn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=sr)))}function cr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var hr={animationend:cr("Animation","AnimationEnd"),animationiteration:cr("Animation","AnimationIteration"),animationstart:cr("Animation","AnimationStart"),transitionrun:cr("Transition","TransitionRun"),transitionstart:cr("Transition","TransitionStart"),transitioncancel:cr("Transition","TransitionCancel"),transitionend:cr("Transition","TransitionEnd")},dr={},fr={};function pr(e){if(dr[e])return dr[e];if(!hr[e])return e;var t,n=hr[e];for(t in n)if(n.hasOwnProperty(t)&&t in fr)return dr[e]=n[t];return e}$t&&(fr=document.createElement("div").style,"AnimationEvent"in window||(delete hr.animationend.animation,delete hr.animationiteration.animation,delete hr.animationstart.animation),"TransitionEvent"in window||delete hr.transitionend.transition);var mr=pr("animationend"),gr=pr("animationiteration"),Er=pr("animationstart"),vr=pr("transitionrun"),Cr=pr("transitionstart"),Dr=pr("transitioncancel"),Sr=pr("transitionend"),Ar=new Map,_r="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function yr(e,t){Ar.set(e,t),nt(t,[e])}_r.push("scrollEnd");var br="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Tr=[],Rr=0,xr=0;function wr(){for(var e=Rr,t=xr=Rr=0;t>=o,i-=o,ti=1<<32-Ce(t)+i|n<p?(m=h,h=null):m=h.sibling;var g=f(i,h,a[p],l);if(null===g){null===h&&(h=m);break}e&&h&&null===g.alternate&&t(i,h),o=s(g,o,p),null===c?u=g:c.sibling=g,c=g,h=m}if(p===a.length)return n(i,h),ci&&ri(i,p),u;if(null===h){for(;pm?(g=p,p=null):g=p.sibling;var C=f(i,p,v.value,u);if(null===C){null===p&&(p=g);break}e&&p&&null===C.alternate&&t(i,p),a=s(C,a,m),null===h?c=C:h.sibling=C,h=C,p=g}if(v.done)return n(i,p),ci&&ri(i,m),c;if(null===p){for(;!v.done;m++,v=l.next())null!==(v=d(i,v.value,u))&&(a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return ci&&ri(i,m),c}for(p=r(p);!v.done;m++,v=l.next())null!==(v=E(p,i,m,v.value,u))&&(e&&null!==v.alternate&&p.delete(null===v.key?m:v.key),a=s(v,a,m),null===h?c=v:h.sibling=v,h=v);return e&&p.forEach(function(e){return t(i,e)}),ci&&ri(i,m),c}(l,u,c=C.call(c),h)}if("function"==typeof c.then)return v(l,u,ls(c),h);if(c.$$typeof===D)return v(l,u,Li(l,c),h);cs(l,c)}return"string"==typeof c&&""!==c||"number"==typeof c||"bigint"==typeof c?(c=""+c,null!==u&&6===u.tag?(n(l,u.sibling),(h=i(u,c)).return=l,l=h):(n(l,u),(h=Wr(c,l.mode,h)).return=l,l=h),a(l)):n(l,u)}return function(e,t,n,r){try{as=0;var i=v(e,t,n,r);return os=null,i}catch(t){if(t===qi||t===Zi)throw t;var s=Pr(29,t,null,e.mode);return s.lanes=r,s.return=e,s}}}var ds=hs(!0),fs=hs(!1),ps=!1;function ms(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Es(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vs(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&du){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ir(e),Or(e,null,n),t}return Fr(e,r,t,n),Ir(e)}function Cs(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Oe(e,n)}}function Ds(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===s?i=s=o:s=s.next=o,n=n.next}while(null!==n);null===s?i=s=t:s=s.next=t}else i=s=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ss=!1;function As(){if(Ss&&null!==Wi)throw Wi}function _s(e,t,n,r){Ss=!1;var i=e.updateQueue;ps=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var l=a,u=l.next;l.next=null,null===o?s=u:o.next=u,o=l;var c=e.alternate;null!==c&&(a=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===a?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l)}if(null!==s){var h=i.baseState;for(o=0,c=u=l=null,a=s;;){var f=-536870913&a.lane,p=f!==a.lane;if(p?(mu&f)===f:(r&f)===f){0!==f&&f===Vi&&(Ss=!0),null!==c&&(c=c.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var m=e,g=a;f=t;var E=n;switch(g.tag){case 1:if("function"==typeof(m=g.payload)){h=m.call(E,h,f);break e}h=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(f="function"==typeof(m=g.payload)?m.call(E,h,f):m))break e;h=d({},h,f);break e;case 2:ps=!0}}null!==(f=a.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=i.callbacks)?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===c?(u=c=p,l=h):c=c.next=p,o|=f;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(p=a).next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}null===c&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null===s&&(i.shared.lanes=0),_u|=o,e.lanes=o,e.memoizedState=h}}function ys(e,t){if("function"!=typeof e)throw Error(o(191,e));e.call(t)}function bs(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;es?s:8;var o,a,l,u=O.T,c={};O.T=c,ca(e,!1,t,n);try{var h=i(),d=O.S;null!==d&&d(c,h),null!==h&&"object"==typeof h&&"function"==typeof h.then?ua(e,t,(o=r,a=[],l={status:"pending",value:null,reason:null,then:function(e){a.push(e)}},h.then(function(){l.status="fulfilled",l.value=o;for(var e=0;e<\/script>",s=s.removeChild(s.firstChild);break;case"select":s="string"==typeof r.is?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s="string"==typeof r.is?a.createElement(i,{is:r.is}):a.createElement(i)}}s[$e]=t,s[Ge]=r;e:for(a=t.child;null!==a;){if(5===a.tag||6===a.tag)s.appendChild(a.stateNode);else if(4!==a.tag&&27!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;null===a.sibling;){if(null===a.return||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=s;e:switch(hh(s,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&ol(t)}}return hl(t),al(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&ol(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));if(e=j.current,Ei(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(i=li))switch(i.tag){case 27:case 5:r=i.memoizedProps}e[$e]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||lh(e.nodeValue,n)))||pi(t,!0)}else(e=mh(e).createTextNode(r))[$e]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(r=Ei(t),null!==n){if(null===e){if(!r)throw Error(o(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(o(557));e[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Ps(t),t):(Ps(t),null);if(128&t.flags)throw Error(o(558))}return hl(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=Ei(t),null!==r&&null!==r.dehydrated){if(null===e){if(!i)throw Error(o(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(o(317));i[$e]=t}else vi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hl(t),i=!1}else i=Ci(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return 256&t.flags?(Ps(t),t):(Ps(t),null)}return Ps(t),128&t.flags?(t.lanes=n,t):(n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(i=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(i=r.alternate.memoizedState.cachePool.pool),s=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(s=r.memoizedState.cachePool.pool),s!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ul(t,t.updateQueue),hl(t),null);case 4:return K(),null===e&&Zc(t.stateNode.containerInfo),hl(t),null;case 10:return bi(t.type),hl(t),null;case 19:if(U(Bs),null===(r=t.memoizedState))return hl(t),null;if(i=!!(128&t.flags),null===(s=r.rendering))if(i)cl(r,!1);else{if(0!==Au||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(s=Us(e))){for(t.flags|=128,cl(r,!1),e=s.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)$r(n,e),n=n.sibling;return $(Bs,1&Bs.current|2),ci&&ri(t,r.treeForkCount),t.child}e=e.sibling}null!==r.tail&&ae()>Ou&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=Us(s))){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),cl(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!ci)return hl(t),null}else 2*ae()-r.renderingStartTime>Ou&&536870912!==n&&(t.flags|=128,i=!0,cl(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=r.last)?e.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ae(),e.sibling=null,n=Bs.current,$(Bs,i?1&n|2:1&n),ci&&ri(t,r.treeForkCount),e):(hl(t),null);case 22:case 23:return Ps(t),Fs(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?!!(536870912&n)&&!(128&t.flags)&&(hl(t),6&t.subtreeFlags&&(t.flags|=8192)):hl(t),null!==(n=t.updateQueue)&&ul(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&U(zi),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),bi(Pi),hl(t),null;case 25:case 30:return null}throw Error(o(156,t.tag))}function fl(e,t){switch(oi(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return bi(Pi),K(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return q(t),null;case 31:if(null!==t.memoizedState){if(Ps(t),null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Ps(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));vi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return U(Bs),null;case 4:return K(),null;case 10:return bi(t.type),null;case 22:case 23:return Ps(t),Fs(),null!==e&&U(zi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return bi(Pi),null;default:return null}}function pl(e,t){switch(oi(t),t.tag){case 3:bi(Pi),K();break;case 26:case 27:case 5:q(t);break;case 4:K();break;case 31:null!==t.memoizedState&&Ps(t);break;case 13:Ps(t);break;case 19:U(Bs);break;case 10:bi(t.type);break;case 22:case 23:Ps(t),Fs(),null!==e&&U(zi);break;case 24:bi(Pi)}}function ml(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var s=n.create,o=n.inst;r=s(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ac(t,t.return,e)}}function gl(e,t,n){try{var r=t.updateQueue,i=null!==r?r.lastEffect:null;if(null!==i){var s=i.next;r=s;do{if((r.tag&e)===e){var o=r.inst,a=o.destroy;if(void 0!==a){o.destroy=void 0,i=t;var l=n,u=a;try{u()}catch(e){Ac(i,l,e)}}}r=r.next}while(r!==s)}}catch(e){Ac(t,t.return,e)}}function El(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{bs(t,n)}catch(t){Ac(e,e.return,t)}}}function vl(e,t,n){n.props=Aa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ac(e,t,n)}}function Cl(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(n){Ac(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(n){Ac(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){Ac(e,t,n)}else n.current=null}function Sl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ac(e,e.return,t)}}function Al(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,a=null,l=null,u=null,c=null,h=null;for(p in n){var d=n[p];if(n.hasOwnProperty(p)&&null!=d)switch(p){case"checked":case"value":break;case"defaultValue":u=d;default:r.hasOwnProperty(p)||uh(e,t,p,null,r,d)}}for(var f in r){var p=r[f];if(d=n[f],r.hasOwnProperty(f)&&(null!=p||null!=d))switch(f){case"type":s=p;break;case"name":i=p;break;case"checked":c=p;break;case"defaultChecked":h=p;break;case"value":a=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(o(137,t));break;default:p!==d&&uh(e,t,f,p,r,d)}}return void Et(e,a,l,u,c,h,s,i);case"select":for(s in p=a=l=f=null,n)if(u=n[s],n.hasOwnProperty(s)&&null!=u)switch(s){case"value":break;case"multiple":p=u;default:r.hasOwnProperty(s)||uh(e,t,s,null,r,u)}for(i in r)if(s=r[i],u=n[i],r.hasOwnProperty(i)&&(null!=s||null!=u))switch(i){case"value":f=s;break;case"defaultValue":l=s;break;case"multiple":a=s;default:s!==u&&uh(e,t,i,s,r,u)}return t=l,n=a,r=p,void(null!=f?Dt(e,!!n,f,!1):!!r!=!!n&&(null!=t?Dt(e,!!n,t,!0):Dt(e,!!n,n?[]:"",!1)));case"textarea":for(l in p=f=null,n)if(i=n[l],n.hasOwnProperty(l)&&null!=i&&!r.hasOwnProperty(l))switch(l){case"value":case"children":break;default:uh(e,t,l,null,r,i)}for(a in r)if(i=r[a],s=n[a],r.hasOwnProperty(a)&&(null!=i||null!=s))switch(a){case"value":f=i;break;case"defaultValue":p=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(o(91));break;default:i!==s&&uh(e,t,a,i,r,s)}return void St(e,f,p);case"option":for(var m in n)f=n[m],n.hasOwnProperty(m)&&null!=f&&!r.hasOwnProperty(m)&&("selected"===m?e.selected=!1:uh(e,t,m,null,r,f));for(u in r)f=r[u],p=n[u],!r.hasOwnProperty(u)||f===p||null==f&&null==p||("selected"===u?e.selected=f&&"function"!=typeof f&&"symbol"!=typeof f:uh(e,t,u,f,r,p));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)f=n[g],n.hasOwnProperty(g)&&null!=f&&!r.hasOwnProperty(g)&&uh(e,t,g,null,r,f);for(c in r)if(f=r[c],p=n[c],r.hasOwnProperty(c)&&f!==p&&(null!=f||null!=p))switch(c){case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(o(137,t));break;default:uh(e,t,c,f,r,p)}return;default:if(Rt(t)){for(var E in n)f=n[E],n.hasOwnProperty(E)&&void 0!==f&&!r.hasOwnProperty(E)&&ch(e,t,E,void 0,r,f);for(h in r)f=r[h],p=n[h],!r.hasOwnProperty(h)||f===p||void 0===f&&void 0===p||ch(e,t,h,f,r,p);return}}for(var v in n)f=n[v],n.hasOwnProperty(v)&&null!=f&&!r.hasOwnProperty(v)&&uh(e,t,v,null,r,f);for(d in r)f=r[d],p=n[d],!r.hasOwnProperty(d)||f===p||null==f&&null==p||uh(e,t,d,f,r,p)}(r,e.type,n,t),r[Ge]=t}catch(t){Ac(e,e.return,t)}}function _l(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&bh(e.type)||4===e.tag}function yl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||_l(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&bh(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function bl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Nt));else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(bl(e,t,n),e=e.sibling;null!==e;)bl(e,t,n),e=e.sibling}function Tl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&bh(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Tl(e,t,n),e=e.sibling;null!==e;)Tl(e,t,n),e=e.sibling}function Rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);hh(t,r,n),t[$e]=e,t[Ge]=n}catch(t){Ac(e,e.return,t)}}var xl=!1,wl=!1,Fl=!1,Nl="function"==typeof WeakSet?WeakSet:Set,Ll=null;function Ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Xl(e,n),4&r&&ml(5,n);break;case 1:if(Xl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){Ac(n,n.return,e)}else{var i=Aa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ac(n,n.return,e)}}64&r&&El(n),512&r&&Cl(n,n.return);break;case 3:if(Xl(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{bs(e,t)}catch(e){Ac(n,n.return,e)}}break;case 27:null===t&&4&r&&Rl(n);case 26:case 5:Xl(e,n),null===t&&4&r&&Sl(n),512&r&&Cl(n,n.return);break;case 12:Xl(e,n);break;case 31:Xl(e,n),4&r&&Ul(e,n);break;case 13:Xl(e,n),4&r&&$l(e,n),64&r&&null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Tc.bind(null,n));break;case 22:if(!(r=null!==n.memoizedState||xl)){t=null!==t&&null!==t.memoizedState||wl,i=xl;var s=wl;xl=r,(wl=t)&&!s?Yl(e,n,!!(8772&n.subtreeFlags)):Xl(e,n),xl=i,wl=s}break;case 30:break;default:Xl(e,n)}}function Il(e){var t=e.alternate;null!==t&&(e.alternate=null,Il(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&Ke(t),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var kl=null,Ml=!1;function Pl(e,t,n){for(n=n.child;null!==n;)Bl(e,t,n),n=n.sibling}function Bl(e,t,n){if(Ee&&"function"==typeof Ee.onCommitFiberUnmount)try{Ee.onCommitFiberUnmount(ge,n)}catch(e){}switch(n.tag){case 26:wl||Dl(n,t),Pl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:wl||Dl(n,t);var r=kl,i=Ml;bh(n.type)&&(kl=n.stateNode,Ml=!1),Pl(e,t,n),Ph(n.stateNode),kl=r,Ml=i;break;case 5:wl||Dl(n,t);case 6:if(r=kl,i=Ml,kl=null,Pl(e,t,n),Ml=i,null!==(kl=r))if(Ml)try{(9===kl.nodeType?kl.body:"HTML"===kl.nodeName?kl.ownerDocument.body:kl).removeChild(n.stateNode)}catch(e){Ac(n,t,e)}else try{kl.removeChild(n.stateNode)}catch(e){Ac(n,t,e)}break;case 18:null!==kl&&(Ml?(Th(9===(e=kl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Gd(e)):Th(kl,n.stateNode));break;case 4:r=kl,i=Ml,kl=n.stateNode.containerInfo,Ml=!0,Pl(e,t,n),kl=r,Ml=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),wl||gl(4,n,t),Pl(e,t,n);break;case 1:wl||(Dl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&vl(n,t,r)),Pl(e,t,n);break;case 21:Pl(e,t,n);break;case 22:wl=(r=wl)||null!==n.memoizedState,Pl(e,t,n),wl=r;break;default:Pl(e,t,n)}}function Ul(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)){e=e.dehydrated;try{Gd(e)}catch(e){Ac(t,t.return,e)}}}function $l(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{Gd(e)}catch(e){Ac(t,t.return,e)}}function Gl(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Nl),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Nl),t;default:throw Error(o(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Rc.bind(null,e,t);t.then(r,r)}})}function Vl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r title"))),hh(s,r,n),s[$e]=e,Je(s),r=s;break e;case"link":var a=td("link","href",i).get(r+(n.href||""));if(a)for(var l=0;la)break;var c=l.transferSize,h=l.initiatorType;c&&dh(h)&&(o+=c*((l=l.responseEnd)id?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}(h,p)))return Uu=s,e.cancelPendingCommit=p(pc.bind(null,e,t,s,n,r,i,o,a,l,c,h,null,d,f)),void Qu(e,s,o,!u)}pc(e,t,s,n,r,i,o,a,l)}function qu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var r=0;rg&&(o=g,g=m,m=o);var E=er(a,m),v=er(a,g);if(E&&v&&(1!==f.rangeCount||f.anchorNode!==E.node||f.anchorOffset!==E.offset||f.focusNode!==v.node||f.focusOffset!==v.offset)){var C=h.createRange();C.setStart(E.node,E.offset),f.removeAllRanges(),m>g?(f.addRange(C),f.extend(v.node,v.offset)):(C.setEnd(v.node,v.offset),f.addRange(C))}}}}for(h=[],f=a;f=f.parentNode;)1===f.nodeType&&h.push({element:f,left:f.scrollLeft,top:f.scrollTop});for("function"==typeof a.focus&&a.focus(),a=0;an?32:n,O.T=null,n=Gu,Gu=null;var s=Pu,a=Uu;if(Mu=0,Bu=Pu=null,Uu=0,6&du)throw Error(o(331));var l=du;if(du|=4,au(s.current),Jl(s,s.current,a,n),du=l,kc(0,!1),Ee&&"function"==typeof Ee.onPostCommitFiberRoot)try{Ee.onPostCommitFiberRoot(ge,s)}catch(e){}return!0}finally{I.p=i,O.T=r,vc(e,t)}}function Sc(e,t,n){t=Xr(n,t),null!==(e=vs(e,t=xa(e.stateNode,t,2),2))&&(Ne(e,2),Ic(e))}function Ac(e,t,n){if(3===e.tag)Sc(e,e,n);else for(;null!==t;){if(3===t.tag){Sc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===ku||!ku.has(r))){e=Xr(n,e),null!==(r=vs(t,n=wa(2),2))&&(Fa(n,r,t,e),Ne(r,2),Ic(r));break}}t=t.return}}function _c(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hu;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(Du=!0,i.add(n),e=yc.bind(null,e,t,n),t.then(e,e))}function yc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,fu===e&&(mu&n)===n&&(4===Au||3===Au&&(62914560&mu)===mu&&300>ae()-Nu?!(2&du)&&ec(e,0):bu|=n,Ru===mu&&(Ru=0)),Ic(e)}function bc(e,t){0===t&&(t=we()),null!==(e=Lr(e,t))&&(Ne(e,t),Ic(e))}function Tc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),bc(e,n)}function Rc(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}null!==r&&r.delete(t),bc(e,n)}var xc=null,wc=null,Fc=!1,Nc=!1,Lc=!1,Oc=0;function Ic(e){e!==wc&&null===e.next&&(null===wc?xc=wc=e:wc=wc.next=e),Nc=!0,Fc||(Fc=!0,_h(function(){6&du?re(ue,Mc):Pc()}))}function kc(e,t){if(!Lc&&Nc){Lc=!0;do{for(var n=!1,r=xc;null!==r;){if(!t)if(0!==e){var i=r.pendingLanes;if(0===i)var s=0;else{var o=r.suspendedLanes,a=r.pingedLanes;s=(1<<31-Ce(42|e)+1)-1,s=201326741&(s&=i&~(o&~a))?201326741&s|1:s?2|s:0}0!==s&&(n=!0,$c(r,s))}else s=mu,!(3&(s=Te(r,r===fu?s:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Re(r,s)||(n=!0,$c(r,s));r=r.next}}while(n);Lc=!1}}function Mc(){Pc()}function Pc(){Nc=Fc=!1;var e,t=0;0!==Oc&&((e=window.event)&&"popstate"===e.type?e!==Ch&&(Ch=e,1):(Ch=null,0))&&(t=Oc);for(var n=ae(),r=null,i=xc;null!==i;){var s=i.next,o=Bc(i,n);0===o?(i.next=null,null===r?xc=s:r.next=s,null===s&&(wc=r)):(r=i,(0!==t||3&o)&&(Nc=!0)),i=s}0!==Mu&&5!==Mu||kc(t,!1),0!==Oc&&(Oc=0)}function Bc(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=-62914561&e.pendingLanes;0 title"):null)}function rd(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var id=0;function sd(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)ad(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var od=null;function ad(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,od=new Map,t.forEach(ld,e),od=null,sd.call(e))}function ld(e,t){if(!(4&t.state.loading)){var n=od.get(e);if(n)var r=n.get(null);else{n=new Map,od.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s>>1,i=e[r];if(!(0>>1;rs(l,n))us(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[a]=n,r=a);else{if(!(us(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var u=[],c=[],h=1,d=null,f=3,p=!1,m=!1,g=!1,E=!1,v="function"==typeof setTimeout?setTimeout:null,C="function"==typeof clearTimeout?clearTimeout:null,D="undefined"!=typeof setImmediate?setImmediate:null;function S(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function A(e){if(g=!1,S(e),!m)if(null!==r(u))m=!0,y||(y=!0,_());else{var t=r(c);null!==t&&L(A,t.startTime-e)}}var _,y=!1,b=-1,T=5,R=-1;function x(){return!(!E&&t.unstable_now()-Re&&x());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var a=o(d.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof a){d.callback=a,S(e),n=!0;break t}d===r(u)&&i(u),S(e)}else i(u);d=r(u)}if(null!==d)n=!0;else{var l=r(c);null!==l&&L(A,l.startTime-e),n=!1}}break e}finally{d=null,f=s,p=!1}n=void 0}}finally{n?_():y=!1}}}if("function"==typeof D)_=function(){D(w)};else if("undefined"!=typeof MessageChannel){var F=new MessageChannel,N=F.port2;F.port1.onmessage=w,_=function(){N.postMessage(null)}}else _=function(){v(w,0)};function L(e,n){b=v(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125o?(e.sortIndex=s,n(c,e),null===r(u)&&e===r(c)&&(g?(C(b),b=-1):g=!0,L(A,s-o))):(e.sortIndex=a,n(u,e),m||p||(m=!0,y||(y=!0,_()))),e},t.unstable_shouldYield=x,t.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}},982(e,t,n){"use strict";e.exports=n(477)},902(e,t,n){"use strict";var r=n(72),i=n.n(r),s=n(825),o=n.n(s),a=n(659),l=n.n(a),u=n(56),c=n.n(u),h=n(540),d=n.n(h),f=n(113),p=n.n(f),m=n(636),g={};g.styleTagTransform=p(),g.setAttributes=c(),g.insert=l().bind(null,"html"),g.domAPI=o(),g.insertStyleElement=d(),i()(m.A,g),m.A&&m.A.locals&&m.A.locals},72(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},878(e,t,n){"use strict";n.r(t),n.d(t,{EmbeddedFrontend:()=>Id,Spector:()=>kd});var r={};n.r(r),n.d(r,{LX:()=>Jo,ll:()=>ea});var i,s={};n.r(s),n.d(s,{SyntaxError:()=>Xc,parse:()=>Yc});class o{static isBuildableProgram(e){return!!e&&!!e[this.rebuildProgramFunctionName]}static rebuildProgram(e,t,n,r,i){this.isBuildableProgram(e)&&e[this.rebuildProgramFunctionName](t,n,r,i)}}o.rebuildProgramFunctionName="__SPECTOR_rebuildProgram",function(e){e[e.noLog=0]="noLog",e[e.error=1]="error",e[e.warning=2]="warning",e[e.info=3]="info"}(i||(i={}));class a{static error(e,...t){this.level>0&&console.error(e,t)}static warn(e,...t){this.level>1&&console.warn(e,t)}static info(e,...t){this.level>2&&console.log(e,t)}}a.level=i.warning;class l{constructor(){this.callbacks=[],this.counter=-1}add(e,t){return this.counter++,t&&(e=e.bind(t)),this.callbacks[this.counter]=e,this.counter}remove(e){delete this.callbacks[e]}clear(){this.callbacks={}}trigger(e){for(const t in this.callbacks)this.callbacks.hasOwnProperty(t)&&this.callbacks[t](e)}}class u{constructor(){if("undefined"!=typeof performance&&performance.now)this.nowFunction=()=>performance.now();else{const e=new Date;this.nowFunction=e.getTime.bind(e)}}static get now(){return u.instance.nowFunction()}}u.instance=new u;class c{constructor(e){this.options=e}appendAnalysis(e){e.analyses=e.analyses||[];const t=this.getAnalysis(e);e.analyses.push(t)}getAnalysis(e){const t={analyserName:this.analyserName};return this.appendToAnalysis(e,t),t}}class h extends c{get analyserName(){return h.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={};for(const t of e.commands)n[t.name]=n[t.name]||0,n[t.name]++;const r=Object.keys(n).map(e=>[e,n[e]]);r.sort((e,t)=>{const n=t[1]-e[1];return 0===n?e[0].localeCompare(t[0]):n});for(const e of r)t[e[0]]=e[1]}}h.analyserName="Commands";const d=["drawArrays","drawElements","drawArraysInstanced","drawArraysInstancedANGLE","drawElementsInstanced","drawElementsInstancedANGLE","drawRangeElements","multiDrawArraysWEBGL","multiDrawElementsWEBGL","multiDrawArraysInstancedWEBGL","multiDrawElementsInstancedWEBGL","multiDrawArraysInstancedBaseInstanceWEBGL","multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL","drawArraysInstancedBaseInstanceWEBGL","drawElementsInstancedBaseVertexBaseInstanceWEBGL"];class f extends c{get analyserName(){return f.analyserName}appendToAnalysis(e,t){if(e.commands){t.total=e.commands.length,t.draw=0,t.clear=0;for(const n of e.commands)"clear"===n.name?t.clear++:d.indexOf(n.name)>-1&&t.draw++}}}f.analyserName="CommandsSummary";class p{static isWebGlConstant(e){return null!==g[e]&&void 0!==g[e]}static stringifyWebGlConstant(e,t){if(null==e)return"";if(0===e){return this.zeroMeaningByCommand[t]||"0"}if(1===e){return this.oneMeaningByCommand[t]||"1"}const n=g[e];return n?n.name:e+""}}p.DEPTH_BUFFER_BIT={name:"DEPTH_BUFFER_BIT",value:256,description:"Passed to clear to clear the current depth buffer."},p.STENCIL_BUFFER_BIT={name:"STENCIL_BUFFER_BIT",value:1024,description:"Passed to clear to clear the current stencil buffer."},p.COLOR_BUFFER_BIT={name:"COLOR_BUFFER_BIT",value:16384,description:"Passed to clear to clear the current color buffer."},p.POINTS={name:"POINTS",value:0,description:"Passed to drawElements or drawArrays to draw single points."},p.LINES={name:"LINES",value:1,description:"Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it."},p.LINE_LOOP={name:"LINE_LOOP",value:2,description:"Passed to drawElements or drawArrays to draw lines. Each set of two vertices is treated as a separate line segment."},p.LINE_STRIP={name:"LINE_STRIP",value:3,description:"Passed to drawElements or drawArrays to draw a connected group of line segments from the first vertex to the last."},p.TRIANGLES={name:"TRIANGLES",value:4,description:"Passed to drawElements or drawArrays to draw triangles. Each set of three vertices creates a separate triangle."},p.TRIANGLE_STRIP={name:"TRIANGLE_STRIP",value:5,description:"Passed to drawElements or drawArrays to draw a connected group of triangles."},p.TRIANGLE_FAN={name:"TRIANGLE_FAN",value:6,description:"Passed to drawElements or drawArrays to draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan."},p.ZERO={name:"ZERO",value:0,description:"Passed to blendFunc or blendFuncSeparate to turn off a component."},p.ONE={name:"ONE",value:1,description:"Passed to blendFunc or blendFuncSeparate to turn on a component."},p.SRC_COLOR={name:"SRC_COLOR",value:768,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source elements color."},p.ONE_MINUS_SRC_COLOR={name:"ONE_MINUS_SRC_COLOR",value:769,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source elements color."},p.SRC_ALPHA={name:"SRC_ALPHA",value:770,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the source's alpha."},p.ONE_MINUS_SRC_ALPHA={name:"ONE_MINUS_SRC_ALPHA",value:771,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source's alpha."},p.DST_ALPHA={name:"DST_ALPHA",value:772,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's alpha."},p.ONE_MINUS_DST_ALPHA={name:"ONE_MINUS_DST_ALPHA",value:773,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's alpha."},p.DST_COLOR={name:"DST_COLOR",value:774,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's color."},p.ONE_MINUS_DST_COLOR={name:"ONE_MINUS_DST_COLOR",value:775,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's color."},p.SRC_ALPHA_SATURATE={name:"SRC_ALPHA_SATURATE",value:776,description:"Passed to blendFunc or blendFuncSeparate to multiply a component by the minimum of source's alpha or one minus the destination's alpha."},p.CONSTANT_COLOR={name:"CONSTANT_COLOR",value:32769,description:"Passed to blendFunc or blendFuncSeparate to specify a constant color blend function."},p.ONE_MINUS_CONSTANT_COLOR={name:"ONE_MINUS_CONSTANT_COLOR",value:32770,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant color blend function."},p.CONSTANT_ALPHA={name:"CONSTANT_ALPHA",value:32771,description:"Passed to blendFunc or blendFuncSeparate to specify a constant alpha blend function."},p.ONE_MINUS_CONSTANT_ALPHA={name:"ONE_MINUS_CONSTANT_ALPHA",value:32772,description:"Passed to blendFunc or blendFuncSeparate to specify one minus a constant alpha blend function."},p.FUNC_ADD={name:"FUNC_ADD",value:32774,description:"Passed to blendEquation or blendEquationSeparate to set an addition blend function."},p.FUNC_SUBSTRACT={name:"FUNC_SUBSTRACT",value:32778,description:"Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination)."},p.FUNC_REVERSE_SUBTRACT={name:"FUNC_REVERSE_SUBTRACT",value:32779,description:"Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source)."},p.BLEND_EQUATION={name:"BLEND_EQUATION",value:32777,description:"Passed to getParameter to get the current RGB blend function."},p.BLEND_EQUATION_RGB={name:"BLEND_EQUATION_RGB",value:32777,description:"Passed to getParameter to get the current RGB blend function. Same as BLEND_EQUATION"},p.BLEND_EQUATION_ALPHA={name:"BLEND_EQUATION_ALPHA",value:34877,description:"Passed to getParameter to get the current alpha blend function. Same as BLEND_EQUATION"},p.BLEND_DST_RGB={name:"BLEND_DST_RGB",value:32968,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_SRC_RGB={name:"BLEND_SRC_RGB",value:32969,description:"Passed to getParameter to get the current destination RGB blend function."},p.BLEND_DST_ALPHA={name:"BLEND_DST_ALPHA",value:32970,description:"Passed to getParameter to get the current destination alpha blend function."},p.BLEND_SRC_ALPHA={name:"BLEND_SRC_ALPHA",value:32971,description:"Passed to getParameter to get the current source alpha blend function."},p.BLEND_COLOR={name:"BLEND_COLOR",value:32773,description:"Passed to getParameter to return a the current blend color."},p.ARRAY_BUFFER_BINDING={name:"ARRAY_BUFFER_BINDING",value:34964,description:"Passed to getParameter to get the array buffer binding."},p.ELEMENT_ARRAY_BUFFER_BINDING={name:"ELEMENT_ARRAY_BUFFER_BINDING",value:34965,description:"Passed to getParameter to get the current element array buffer."},p.LINE_WIDTH={name:"LINE_WIDTH",value:2849,description:"Passed to getParameter to get the current lineWidth (set by the lineWidth method)."},p.ALIASED_POINT_SIZE_RANGE={name:"ALIASED_POINT_SIZE_RANGE",value:33901,description:"Passed to getParameter to get the current size of a point drawn with gl.POINTS"},p.ALIASED_LINE_WIDTH_RANGE={name:"ALIASED_LINE_WIDTH_RANGE",value:33902,description:"Passed to getParameter to get the range of available widths for a line. Returns a length-2 array with the lo value at 0, and hight at 1."},p.CULL_FACE_MODE={name:"CULL_FACE_MODE",value:2885,description:"Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK"},p.FRONT_FACE={name:"FRONT_FACE",value:2886,description:"Passed to getParameter to determine the current value of frontFace. Should return CW or CCW."},p.DEPTH_RANGE={name:"DEPTH_RANGE",value:2928,description:"Passed to getParameter to return a length-2 array of floats giving the current depth range."},p.DEPTH_WRITEMASK={name:"DEPTH_WRITEMASK",value:2930,description:"Passed to getParameter to determine if the depth write mask is enabled."},p.DEPTH_CLEAR_VALUE={name:"DEPTH_CLEAR_VALUE",value:2931,description:"Passed to getParameter to determine the current depth clear value."},p.DEPTH_FUNC={name:"DEPTH_FUNC",value:2932,description:"Passed to getParameter to get the current depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_CLEAR_VALUE={name:"STENCIL_CLEAR_VALUE",value:2961,description:"Passed to getParameter to get the value the stencil will be cleared to."},p.STENCIL_FUNC={name:"STENCIL_FUNC",value:2962,description:"Passed to getParameter to get the current stencil function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL."},p.STENCIL_FAIL={name:"STENCIL_FAIL",value:2964,description:"Passed to getParameter to get the current stencil fail function. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_FAIL={name:"STENCIL_PASS_DEPTH_FAIL",value:2965,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test fail. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_PASS_DEPTH_PASS={name:"STENCIL_PASS_DEPTH_PASS",value:2966,description:"Passed to getParameter to get the current stencil fail function should the depth buffer test pass. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP."},p.STENCIL_REF={name:"STENCIL_REF",value:2967,description:"Passed to getParameter to get the reference value used for stencil tests."},p.STENCIL_VALUE_MASK={name:"STENCIL_VALUE_MASK",value:2963,description:" "},p.STENCIL_WRITEMASK={name:"STENCIL_WRITEMASK",value:2968,description:" "},p.STENCIL_BACK_FUNC={name:"STENCIL_BACK_FUNC",value:34816,description:" "},p.STENCIL_BACK_FAIL={name:"STENCIL_BACK_FAIL",value:34817,description:" "},p.STENCIL_BACK_PASS_DEPTH_FAIL={name:"STENCIL_BACK_PASS_DEPTH_FAIL",value:34818,description:" "},p.STENCIL_BACK_PASS_DEPTH_PASS={name:"STENCIL_BACK_PASS_DEPTH_PASS",value:34819,description:" "},p.STENCIL_BACK_REF={name:"STENCIL_BACK_REF",value:36003,description:" "},p.STENCIL_BACK_VALUE_MASK={name:"STENCIL_BACK_VALUE_MASK",value:36004,description:" "},p.STENCIL_BACK_WRITEMASK={name:"STENCIL_BACK_WRITEMASK",value:36005,description:" "},p.VIEWPORT={name:"VIEWPORT",value:2978,description:"Returns an Int32Array with four elements for the current viewport dimensions."},p.SCISSOR_BOX={name:"SCISSOR_BOX",value:3088,description:"Returns an Int32Array with four elements for the current scissor box dimensions."},p.COLOR_CLEAR_VALUE={name:"COLOR_CLEAR_VALUE",value:3106,description:" "},p.COLOR_WRITEMASK={name:"COLOR_WRITEMASK",value:3107,description:" "},p.UNPACK_ALIGNMENT={name:"UNPACK_ALIGNMENT",value:3317,description:" "},p.PACK_ALIGNMENT={name:"PACK_ALIGNMENT",value:3333,description:" "},p.MAX_TEXTURE_SIZE={name:"MAX_TEXTURE_SIZE",value:3379,description:" "},p.MAX_VIEWPORT_DIMS={name:"MAX_VIEWPORT_DIMS",value:3386,description:" "},p.SUBPIXEL_BITS={name:"SUBPIXEL_BITS",value:3408,description:" "},p.RED_BITS={name:"RED_BITS",value:3410,description:" "},p.GREEN_BITS={name:"GREEN_BITS",value:3411,description:" "},p.BLUE_BITS={name:"BLUE_BITS",value:3412,description:" "},p.ALPHA_BITS={name:"ALPHA_BITS",value:3413,description:" "},p.DEPTH_BITS={name:"DEPTH_BITS",value:3414,description:" "},p.STENCIL_BITS={name:"STENCIL_BITS",value:3415,description:" "},p.POLYGON_OFFSET_UNITS={name:"POLYGON_OFFSET_UNITS",value:10752,description:" "},p.POLYGON_OFFSET_FACTOR={name:"POLYGON_OFFSET_FACTOR",value:32824,description:" "},p.TEXTURE_BINDING_2D={name:"TEXTURE_BINDING_2D",value:32873,description:" "},p.SAMPLE_BUFFERS={name:"SAMPLE_BUFFERS",value:32936,description:" "},p.SAMPLES={name:"SAMPLES",value:32937,description:" "},p.SAMPLE_COVERAGE_VALUE={name:"SAMPLE_COVERAGE_VALUE",value:32938,description:" "},p.SAMPLE_COVERAGE_INVERT={name:"SAMPLE_COVERAGE_INVERT",value:32939,description:" "},p.COMPRESSED_TEXTURE_FORMATS={name:"COMPRESSED_TEXTURE_FORMATS",value:34467,description:" "},p.VENDOR={name:"VENDOR",value:7936,description:" "},p.RENDERER={name:"RENDERER",value:7937,description:" "},p.VERSION={name:"VERSION",value:7938,description:" "},p.IMPLEMENTATION_COLOR_READ_TYPE={name:"IMPLEMENTATION_COLOR_READ_TYPE",value:35738,description:" "},p.IMPLEMENTATION_COLOR_READ_FORMAT={name:"IMPLEMENTATION_COLOR_READ_FORMAT",value:35739,description:" "},p.BROWSER_DEFAULT_WEBGL={name:"BROWSER_DEFAULT_WEBGL",value:37444,description:" "},p.STATIC_DRAW={name:"STATIC_DRAW",value:35044,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and not change often."},p.STREAM_DRAW={name:"STREAM_DRAW",value:35040,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to not be used often."},p.DYNAMIC_DRAW={name:"DYNAMIC_DRAW",value:35048,description:"Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and change often."},p.ARRAY_BUFFER={name:"ARRAY_BUFFER",value:34962,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.ELEMENT_ARRAY_BUFFER={name:"ELEMENT_ARRAY_BUFFER",value:34963,description:"Passed to bindBuffer or bufferData to specify the type of buffer being used."},p.BUFFER_SIZE={name:"BUFFER_SIZE",value:34660,description:"Passed to getBufferParameter to get a buffer's size."},p.BUFFER_USAGE={name:"BUFFER_USAGE",value:34661,description:"Passed to getBufferParameter to get the hint for the buffer passed in when it was created."},p.CURRENT_VERTEX_ATTRIB={name:"CURRENT_VERTEX_ATTRIB",value:34342,description:"Passed to getVertexAttrib to read back the current vertex attribute."},p.VERTEX_ATTRIB_ARRAY_ENABLED={name:"VERTEX_ATTRIB_ARRAY_ENABLED",value:34338,description:" "},p.VERTEX_ATTRIB_ARRAY_SIZE={name:"VERTEX_ATTRIB_ARRAY_SIZE",value:34339,description:" "},p.VERTEX_ATTRIB_ARRAY_STRIDE={name:"VERTEX_ATTRIB_ARRAY_STRIDE",value:34340,description:" "},p.VERTEX_ATTRIB_ARRAY_TYPE={name:"VERTEX_ATTRIB_ARRAY_TYPE",value:34341,description:" "},p.VERTEX_ATTRIB_ARRAY_NORMALIZED={name:"VERTEX_ATTRIB_ARRAY_NORMALIZED",value:34922,description:" "},p.VERTEX_ATTRIB_ARRAY_POINTER={name:"VERTEX_ATTRIB_ARRAY_POINTER",value:34373,description:" "},p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING={name:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",value:34975,description:" "},p.CULL_FACE={name:"CULL_FACE",value:2884,description:"Passed to enable/disable to turn on/off culling. Can also be used with getParameter to find the current culling method."},p.FRONT={name:"FRONT",value:1028,description:"Passed to cullFace to specify that only front faces should be drawn."},p.BACK={name:"BACK",value:1029,description:"Passed to cullFace to specify that only back faces should be drawn."},p.FRONT_AND_BACK={name:"FRONT_AND_BACK",value:1032,description:"Passed to cullFace to specify that front and back faces should be drawn."},p.BLEND={name:"BLEND",value:3042,description:"Passed to enable/disable to turn on/off blending. Can also be used with getParameter to find the current blending method."},p.DEPTH_TEST={name:"DEPTH_TEST",value:2929,description:"Passed to enable/disable to turn on/off the depth test. Can also be used with getParameter to query the depth test."},p.DITHER={name:"DITHER",value:3024,description:"Passed to enable/disable to turn on/off dithering. Can also be used with getParameter to find the current dithering method."},p.POLYGON_OFFSET_FILL={name:"POLYGON_OFFSET_FILL",value:32823,description:"Passed to enable/disable to turn on/off the polygon offset. Useful for rendering hidden-line images, decals, and or solids with highlighted edges. Can also be used with getParameter to query the scissor test."},p.SAMPLE_ALPHA_TO_COVERAGE={name:"SAMPLE_ALPHA_TO_COVERAGE",value:32926,description:"Passed to enable/disable to turn on/off the alpha to coverage. Used in multi-sampling alpha channels."},p.SAMPLE_COVERAGE={name:"SAMPLE_COVERAGE",value:32928,description:"Passed to enable/disable to turn on/off the sample coverage. Used in multi-sampling."},p.SCISSOR_TEST={name:"SCISSOR_TEST",value:3089,description:"Passed to enable/disable to turn on/off the scissor test. Can also be used with getParameter to query the scissor test."},p.STENCIL_TEST={name:"STENCIL_TEST",value:2960,description:"Passed to enable/disable to turn on/off the stencil test. Can also be used with getParameter to query the stencil test."},p.NO_ERROR={name:"NO_ERROR",value:0,description:"Returned from getError."},p.INVALID_ENUM={name:"INVALID_ENUM",value:1280,description:"Returned from getError."},p.INVALID_VALUE={name:"INVALID_VALUE",value:1281,description:"Returned from getError."},p.INVALID_OPERATION={name:"INVALID_OPERATION",value:1282,description:"Returned from getError."},p.OUT_OF_MEMORY={name:"OUT_OF_MEMORY",value:1285,description:"Returned from getError."},p.CONTEXT_LOST_WEBGL={name:"CONTEXT_LOST_WEBGL",value:37442,description:"Returned from getError."},p.CW={name:"CW",value:2304,description:"Passed to frontFace to specify the front face of a polygon is drawn in the clockwise direction"},p.CCW={name:"CCW",value:2305,description:"Passed to frontFace to specify the front face of a polygon is drawn in the counter clockwise direction"},p.DONT_CARE={name:"DONT_CARE",value:4352,description:"There is no preference for this behavior."},p.FASTEST={name:"FASTEST",value:4353,description:"The most efficient behavior should be used."},p.NICEST={name:"NICEST",value:4354,description:"The most correct or the highest quality option should be used."},p.GENERATE_MIPMAP_HINT={name:"GENERATE_MIPMAP_HINT",value:33170,description:"Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap()."},p.BYTE={name:"BYTE",value:5120,description:" "},p.UNSIGNED_BYTE={name:"UNSIGNED_BYTE",value:5121,description:" "},p.SHORT={name:"SHORT",value:5122,description:" "},p.UNSIGNED_SHORT={name:"UNSIGNED_SHORT",value:5123,description:" "},p.INT={name:"INT",value:5124,description:" "},p.UNSIGNED_INT={name:"UNSIGNED_INT",value:5125,description:" "},p.FLOAT={name:"FLOAT",value:5126,description:" "},p.DEPTH_COMPONENT={name:"DEPTH_COMPONENT",value:6402,description:" "},p.ALPHA={name:"ALPHA",value:6406,description:" "},p.RGB={name:"RGB",value:6407,description:" "},p.RGBA={name:"RGBA",value:6408,description:" "},p.LUMINANCE={name:"LUMINANCE",value:6409,description:" "},p.LUMINANCE_ALPHA={name:"LUMINANCE_ALPHA",value:6410,description:" "},p.UNSIGNED_SHORT_4_4_4_4={name:"UNSIGNED_SHORT_4_4_4_4",value:32819,description:" "},p.UNSIGNED_SHORT_5_5_5_1={name:"UNSIGNED_SHORT_5_5_5_1",value:32820,description:" "},p.UNSIGNED_SHORT_5_6_5={name:"UNSIGNED_SHORT_5_6_5",value:33635,description:" "},p.FRAGMENT_SHADER={name:"FRAGMENT_SHADER",value:35632,description:"Passed to createShader to define a fragment shader."},p.VERTEX_SHADER={name:"VERTEX_SHADER",value:35633,description:"Passed to createShader to define a vertex shader"},p.COMPILE_STATUS={name:"COMPILE_STATUS",value:35713,description:"Passed to getShaderParamter to get the status of the compilation. Returns false if the shader was not compiled. You can then query getShaderInfoLog to find the exact error"},p.DELETE_STATUS={name:"DELETE_STATUS",value:35712,description:"Passed to getShaderParamter to determine if a shader was deleted via deleteShader. Returns true if it was, false otherwise."},p.LINK_STATUS={name:"LINK_STATUS",value:35714,description:"Passed to getProgramParameter after calling linkProgram to determine if a program was linked correctly. Returns false if there were errors. Use getProgramInfoLog to find the exact error."},p.VALIDATE_STATUS={name:"VALIDATE_STATUS",value:35715,description:"Passed to getProgramParameter after calling validateProgram to determine if it is valid. Returns false if errors were found."},p.ATTACHED_SHADERS={name:"ATTACHED_SHADERS",value:35717,description:"Passed to getProgramParameter after calling attachShader to determine if the shader was attached correctly. Returns false if errors occurred."},p.COMPLETION_STATUS_KHR={name:"COMPLETION_STATUS_KHR",value:37297,description:"Passed to getProgramParameter (KHR_parallel_shader_compile) to query whether an asynchronous shader/program link has completed. Returns true once the program is ready to use without blocking."},p.ACTIVE_ATTRIBUTES={name:"ACTIVE_ATTRIBUTES",value:35721,description:"Passed to getProgramParameter to get the number of attributes active in a program."},p.ACTIVE_UNIFORMS={name:"ACTIVE_UNIFORMS",value:35718,description:"Passed to getProgramParamter to get the number of uniforms active in a program."},p.MAX_VERTEX_ATTRIBS={name:"MAX_VERTEX_ATTRIBS",value:34921,description:" "},p.MAX_VERTEX_UNIFORM_VECTORS={name:"MAX_VERTEX_UNIFORM_VECTORS",value:36347,description:" "},p.MAX_VARYING_VECTORS={name:"MAX_VARYING_VECTORS",value:36348,description:" "},p.MAX_COMBINED_TEXTURE_IMAGE_UNITS={name:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",value:35661,description:" "},p.MAX_VERTEX_TEXTURE_IMAGE_UNITS={name:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",value:35660,description:" "},p.MAX_TEXTURE_IMAGE_UNITS={name:"MAX_TEXTURE_IMAGE_UNITS",value:34930,description:"Implementation dependent number of maximum texture units. At least 8."},p.MAX_FRAGMENT_UNIFORM_VECTORS={name:"MAX_FRAGMENT_UNIFORM_VECTORS",value:36349,description:" "},p.SHADER_TYPE={name:"SHADER_TYPE",value:35663,description:" "},p.SHADING_LANGUAGE_VERSION={name:"SHADING_LANGUAGE_VERSION",value:35724,description:" "},p.CURRENT_PROGRAM={name:"CURRENT_PROGRAM",value:35725,description:" "},p.NEVER={name:"NEVER",value:512,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn."},p.ALWAYS={name:"ALWAYS",value:519,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn."},p.LESS={name:"LESS",value:513,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value."},p.EQUAL={name:"EQUAL",value:514,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value."},p.LEQUAL={name:"LEQUAL",value:515,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value."},p.GREATER={name:"GREATER",value:516,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value."},p.GEQUAL={name:"GEQUAL",value:518,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value."},p.NOTEQUAL={name:"NOTEQUAL",value:517,description:"Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value."},p.KEEP={name:"KEEP",value:7680,description:" "},p.REPLACE={name:"REPLACE",value:7681,description:" "},p.INCR={name:"INCR",value:7682,description:" "},p.DECR={name:"DECR",value:7683,description:" "},p.INVERT={name:"INVERT",value:5386,description:" "},p.INCR_WRAP={name:"INCR_WRAP",value:34055,description:" "},p.DECR_WRAP={name:"DECR_WRAP",value:34056,description:" "},p.NEAREST={name:"NEAREST",value:9728,description:" "},p.LINEAR={name:"LINEAR",value:9729,description:" "},p.NEAREST_MIPMAP_NEAREST={name:"NEAREST_MIPMAP_NEAREST",value:9984,description:" "},p.LINEAR_MIPMAP_NEAREST={name:"LINEAR_MIPMAP_NEAREST",value:9985,description:" "},p.NEAREST_MIPMAP_LINEAR={name:"NEAREST_MIPMAP_LINEAR",value:9986,description:" "},p.LINEAR_MIPMAP_LINEAR={name:"LINEAR_MIPMAP_LINEAR",value:9987,description:" "},p.TEXTURE_MAG_FILTER={name:"TEXTURE_MAG_FILTER",value:10240,description:" "},p.TEXTURE_MIN_FILTER={name:"TEXTURE_MIN_FILTER",value:10241,description:" "},p.TEXTURE_WRAP_S={name:"TEXTURE_WRAP_S",value:10242,description:" "},p.TEXTURE_WRAP_T={name:"TEXTURE_WRAP_T",value:10243,description:" "},p.TEXTURE_2D={name:"TEXTURE_2D",value:3553,description:" "},p.TEXTURE={name:"TEXTURE",value:5890,description:" "},p.TEXTURE_CUBE_MAP={name:"TEXTURE_CUBE_MAP",value:34067,description:" "},p.TEXTURE_BINDING_CUBE_MAP={name:"TEXTURE_BINDING_CUBE_MAP",value:34068,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_X={name:"TEXTURE_CUBE_MAP_POSITIVE_X",value:34069,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_X={name:"TEXTURE_CUBE_MAP_NEGATIVE_X",value:34070,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Y={name:"TEXTURE_CUBE_MAP_POSITIVE_Y",value:34071,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Y={name:"TEXTURE_CUBE_MAP_NEGATIVE_Y",value:34072,description:" "},p.TEXTURE_CUBE_MAP_POSITIVE_Z={name:"TEXTURE_CUBE_MAP_POSITIVE_Z",value:34073,description:" "},p.TEXTURE_CUBE_MAP_NEGATIVE_Z={name:"TEXTURE_CUBE_MAP_NEGATIVE_Z",value:34074,description:" "},p.MAX_CUBE_MAP_TEXTURE_SIZE={name:"MAX_CUBE_MAP_TEXTURE_SIZE",value:34076,description:" "},p.TEXTURE0={name:"TEXTURE0",value:33984,description:"A texture unit."},p.TEXTURE1={name:"TEXTURE1",value:33985,description:"A texture unit."},p.TEXTURE2={name:"TEXTURE2",value:33986,description:"A texture unit."},p.TEXTURE3={name:"TEXTURE3",value:33987,description:"A texture unit."},p.TEXTURE4={name:"TEXTURE4",value:33988,description:"A texture unit."},p.TEXTURE5={name:"TEXTURE5",value:33989,description:"A texture unit."},p.TEXTURE6={name:"TEXTURE6",value:33990,description:"A texture unit."},p.TEXTURE7={name:"TEXTURE7",value:33991,description:"A texture unit."},p.TEXTURE8={name:"TEXTURE8",value:33992,description:"A texture unit."},p.TEXTURE9={name:"TEXTURE9",value:33993,description:"A texture unit."},p.TEXTURE10={name:"TEXTURE10",value:33994,description:"A texture unit."},p.TEXTURE11={name:"TEXTURE11",value:33995,description:"A texture unit."},p.TEXTURE12={name:"TEXTURE12",value:33996,description:"A texture unit."},p.TEXTURE13={name:"TEXTURE13",value:33997,description:"A texture unit."},p.TEXTURE14={name:"TEXTURE14",value:33998,description:"A texture unit."},p.TEXTURE15={name:"TEXTURE15",value:33999,description:"A texture unit."},p.TEXTURE16={name:"TEXTURE16",value:34e3,description:"A texture unit."},p.TEXTURE17={name:"TEXTURE17",value:34001,description:"A texture unit."},p.TEXTURE18={name:"TEXTURE18",value:34002,description:"A texture unit."},p.TEXTURE19={name:"TEXTURE19",value:34003,description:"A texture unit."},p.TEXTURE20={name:"TEXTURE20",value:34004,description:"A texture unit."},p.TEXTURE21={name:"TEXTURE21",value:34005,description:"A texture unit."},p.TEXTURE22={name:"TEXTURE22",value:34006,description:"A texture unit."},p.TEXTURE23={name:"TEXTURE23",value:34007,description:"A texture unit."},p.TEXTURE24={name:"TEXTURE24",value:34008,description:"A texture unit."},p.TEXTURE25={name:"TEXTURE25",value:34009,description:"A texture unit."},p.TEXTURE26={name:"TEXTURE26",value:34010,description:"A texture unit."},p.TEXTURE27={name:"TEXTURE27",value:34011,description:"A texture unit."},p.TEXTURE28={name:"TEXTURE28",value:34012,description:"A texture unit."},p.TEXTURE29={name:"TEXTURE29",value:34013,description:"A texture unit."},p.TEXTURE30={name:"TEXTURE30",value:34014,description:"A texture unit."},p.TEXTURE31={name:"TEXTURE31",value:34015,description:"A texture unit."},p.ACTIVE_TEXTURE={name:"ACTIVE_TEXTURE",value:34016,description:"The current active texture unit."},p.REPEAT={name:"REPEAT",value:10497,description:" "},p.CLAMP_TO_EDGE={name:"CLAMP_TO_EDGE",value:33071,description:" "},p.MIRRORED_REPEAT={name:"MIRRORED_REPEAT",value:33648,description:" "},p.FLOAT_VEC2={name:"FLOAT_VEC2",value:35664,description:" "},p.FLOAT_VEC3={name:"FLOAT_VEC3",value:35665,description:" "},p.FLOAT_VEC4={name:"FLOAT_VEC4",value:35666,description:" "},p.INT_VEC2={name:"INT_VEC2",value:35667,description:" "},p.INT_VEC3={name:"INT_VEC3",value:35668,description:" "},p.INT_VEC4={name:"INT_VEC4",value:35669,description:" "},p.BOOL={name:"BOOL",value:35670,description:" "},p.BOOL_VEC2={name:"BOOL_VEC2",value:35671,description:" "},p.BOOL_VEC3={name:"BOOL_VEC3",value:35672,description:" "},p.BOOL_VEC4={name:"BOOL_VEC4",value:35673,description:" "},p.FLOAT_MAT2={name:"FLOAT_MAT2",value:35674,description:" "},p.FLOAT_MAT3={name:"FLOAT_MAT3",value:35675,description:" "},p.FLOAT_MAT4={name:"FLOAT_MAT4",value:35676,description:" "},p.SAMPLER_2D={name:"SAMPLER_2D",value:35678,description:" "},p.SAMPLER_CUBE={name:"SAMPLER_CUBE",value:35680,description:" "},p.LOW_FLOAT={name:"LOW_FLOAT",value:36336,description:" "},p.MEDIUM_FLOAT={name:"MEDIUM_FLOAT",value:36337,description:" "},p.HIGH_FLOAT={name:"HIGH_FLOAT",value:36338,description:" "},p.LOW_INT={name:"LOW_INT",value:36339,description:" "},p.MEDIUM_INT={name:"MEDIUM_INT",value:36340,description:" "},p.HIGH_INT={name:"HIGH_INT",value:36341,description:" "},p.FRAMEBUFFER={name:"FRAMEBUFFER",value:36160,description:" "},p.RENDERBUFFER={name:"RENDERBUFFER",value:36161,description:" "},p.RGBA4={name:"RGBA4",value:32854,description:" "},p.RGB5_A1={name:"RGB5_A1",value:32855,description:" "},p.RGB565={name:"RGB565",value:36194,description:" "},p.DEPTH_COMPONENT16={name:"DEPTH_COMPONENT16",value:33189,description:" "},p.STENCIL_INDEX={name:"STENCIL_INDEX",value:6401,description:" "},p.STENCIL_INDEX8={name:"STENCIL_INDEX8",value:36168,description:" "},p.DEPTH_STENCIL={name:"DEPTH_STENCIL",value:34041,description:" "},p.RENDERBUFFER_WIDTH={name:"RENDERBUFFER_WIDTH",value:36162,description:" "},p.RENDERBUFFER_HEIGHT={name:"RENDERBUFFER_HEIGHT",value:36163,description:" "},p.RENDERBUFFER_INTERNAL_FORMAT={name:"RENDERBUFFER_INTERNAL_FORMAT",value:36164,description:" "},p.RENDERBUFFER_RED_SIZE={name:"RENDERBUFFER_RED_SIZE",value:36176,description:" "},p.RENDERBUFFER_GREEN_SIZE={name:"RENDERBUFFER_GREEN_SIZE",value:36177,description:" "},p.RENDERBUFFER_BLUE_SIZE={name:"RENDERBUFFER_BLUE_SIZE",value:36178,description:" "},p.RENDERBUFFER_ALPHA_SIZE={name:"RENDERBUFFER_ALPHA_SIZE",value:36179,description:" "},p.RENDERBUFFER_DEPTH_SIZE={name:"RENDERBUFFER_DEPTH_SIZE",value:36180,description:" "},p.RENDERBUFFER_STENCIL_SIZE={name:"RENDERBUFFER_STENCIL_SIZE",value:36181,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",value:36048,description:" "},p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME={name:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",value:36049,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",value:36050,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",value:36051,description:" "},p.COLOR_ATTACHMENT0={name:"COLOR_ATTACHMENT0",value:36064,description:" "},p.DEPTH_ATTACHMENT={name:"DEPTH_ATTACHMENT",value:36096,description:" "},p.STENCIL_ATTACHMENT={name:"STENCIL_ATTACHMENT",value:36128,description:" "},p.DEPTH_STENCIL_ATTACHMENT={name:"DEPTH_STENCIL_ATTACHMENT",value:33306,description:" "},p.NONE={name:"NONE",value:0,description:" "},p.FRAMEBUFFER_COMPLETE={name:"FRAMEBUFFER_COMPLETE",value:36053,description:" "},p.FRAMEBUFFER_INCOMPLETE_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",value:36054,description:" "},p.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT={name:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",value:36055,description:" "},p.FRAMEBUFFER_INCOMPLETE_DIMENSIONS={name:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",value:36057,description:" "},p.FRAMEBUFFER_UNSUPPORTED={name:"FRAMEBUFFER_UNSUPPORTED",value:36061,description:" "},p.FRAMEBUFFER_BINDING={name:"FRAMEBUFFER_BINDING",value:36006,description:" "},p.RENDERBUFFER_BINDING={name:"RENDERBUFFER_BINDING",value:36007,description:" "},p.MAX_RENDERBUFFER_SIZE={name:"MAX_RENDERBUFFER_SIZE",value:34024,description:" "},p.INVALID_FRAMEBUFFER_OPERATION={name:"INVALID_FRAMEBUFFER_OPERATION",value:1286,description:" "},p.UNPACK_FLIP_Y_WEBGL={name:"UNPACK_FLIP_Y_WEBGL",value:37440,description:" "},p.UNPACK_PREMULTIPLY_ALPHA_WEBGL={name:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",value:37441,description:" "},p.UNPACK_COLORSPACE_CONVERSION_WEBGL={name:"UNPACK_COLORSPACE_CONVERSION_WEBGL",value:37443,description:" "},p.READ_BUFFER={name:"READ_BUFFER",value:3074,description:" "},p.UNPACK_ROW_LENGTH={name:"UNPACK_ROW_LENGTH",value:3314,description:" "},p.UNPACK_SKIP_ROWS={name:"UNPACK_SKIP_ROWS",value:3315,description:" "},p.UNPACK_SKIP_PIXELS={name:"UNPACK_SKIP_PIXELS",value:3316,description:" "},p.PACK_ROW_LENGTH={name:"PACK_ROW_LENGTH",value:3330,description:" "},p.PACK_SKIP_ROWS={name:"PACK_SKIP_ROWS",value:3331,description:" "},p.PACK_SKIP_PIXELS={name:"PACK_SKIP_PIXELS",value:3332,description:" "},p.TEXTURE_BINDING_3D={name:"TEXTURE_BINDING_3D",value:32874,description:" "},p.UNPACK_SKIP_IMAGES={name:"UNPACK_SKIP_IMAGES",value:32877,description:" "},p.UNPACK_IMAGE_HEIGHT={name:"UNPACK_IMAGE_HEIGHT",value:32878,description:" "},p.MAX_3D_TEXTURE_SIZE={name:"MAX_3D_TEXTURE_SIZE",value:32883,description:" "},p.MAX_ELEMENTS_VERTICES={name:"MAX_ELEMENTS_VERTICES",value:33e3,description:" "},p.MAX_ELEMENTS_INDICES={name:"MAX_ELEMENTS_INDICES",value:33001,description:" "},p.MAX_TEXTURE_LOD_BIAS={name:"MAX_TEXTURE_LOD_BIAS",value:34045,description:" "},p.MAX_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_FRAGMENT_UNIFORM_COMPONENTS",value:35657,description:" "},p.MAX_VERTEX_UNIFORM_COMPONENTS={name:"MAX_VERTEX_UNIFORM_COMPONENTS",value:35658,description:" "},p.MAX_ARRAY_TEXTURE_LAYERS={name:"MAX_ARRAY_TEXTURE_LAYERS",value:35071,description:" "},p.MIN_PROGRAM_TEXEL_OFFSET={name:"MIN_PROGRAM_TEXEL_OFFSET",value:35076,description:" "},p.MAX_PROGRAM_TEXEL_OFFSET={name:"MAX_PROGRAM_TEXEL_OFFSET",value:35077,description:" "},p.MAX_VARYING_COMPONENTS={name:"MAX_VARYING_COMPONENTS",value:35659,description:" "},p.FRAGMENT_SHADER_DERIVATIVE_HINT={name:"FRAGMENT_SHADER_DERIVATIVE_HINT",value:35723,description:" "},p.RASTERIZER_DISCARD={name:"RASTERIZER_DISCARD",value:35977,description:" "},p.VERTEX_ARRAY_BINDING={name:"VERTEX_ARRAY_BINDING",value:34229,description:" "},p.MAX_VERTEX_OUTPUT_COMPONENTS={name:"MAX_VERTEX_OUTPUT_COMPONENTS",value:37154,description:" "},p.MAX_FRAGMENT_INPUT_COMPONENTS={name:"MAX_FRAGMENT_INPUT_COMPONENTS",value:37157,description:" "},p.MAX_SERVER_WAIT_TIMEOUT={name:"MAX_SERVER_WAIT_TIMEOUT",value:37137,description:" "},p.MAX_ELEMENT_INDEX={name:"MAX_ELEMENT_INDEX",value:36203,description:" "},p.RED={name:"RED",value:6403,description:" "},p.RGB8={name:"RGB8",value:32849,description:" "},p.RGBA8={name:"RGBA8",value:32856,description:" "},p.RGB10_A2={name:"RGB10_A2",value:32857,description:" "},p.TEXTURE_3D={name:"TEXTURE_3D",value:32879,description:" "},p.TEXTURE_WRAP_R={name:"TEXTURE_WRAP_R",value:32882,description:" "},p.TEXTURE_MIN_LOD={name:"TEXTURE_MIN_LOD",value:33082,description:" "},p.TEXTURE_MAX_LOD={name:"TEXTURE_MAX_LOD",value:33083,description:" "},p.TEXTURE_BASE_LEVEL={name:"TEXTURE_BASE_LEVEL",value:33084,description:" "},p.TEXTURE_MAX_LEVEL={name:"TEXTURE_MAX_LEVEL",value:33085,description:" "},p.TEXTURE_COMPARE_MODE={name:"TEXTURE_COMPARE_MODE",value:34892,description:" "},p.TEXTURE_COMPARE_FUNC={name:"TEXTURE_COMPARE_FUNC",value:34893,description:" "},p.SRGB={name:"SRGB",value:35904,description:" "},p.SRGB8={name:"SRGB8",value:35905,description:" "},p.SRGB8_ALPHA8={name:"SRGB8_ALPHA8",value:35907,description:" "},p.COMPARE_REF_TO_TEXTURE={name:"COMPARE_REF_TO_TEXTURE",value:34894,description:" "},p.RGBA32F={name:"RGBA32F",value:34836,description:" "},p.RGB32F={name:"RGB32F",value:34837,description:" "},p.RGBA16F={name:"RGBA16F",value:34842,description:" "},p.RGB16F={name:"RGB16F",value:34843,description:" "},p.TEXTURE_2D_ARRAY={name:"TEXTURE_2D_ARRAY",value:35866,description:" "},p.TEXTURE_BINDING_2D_ARRAY={name:"TEXTURE_BINDING_2D_ARRAY",value:35869,description:" "},p.R11F_G11F_B10F={name:"R11F_G11F_B10F",value:35898,description:" "},p.RGB9_E5={name:"RGB9_E5",value:35901,description:" "},p.RGBA32UI={name:"RGBA32UI",value:36208,description:" "},p.RGB32UI={name:"RGB32UI",value:36209,description:" "},p.RGBA16UI={name:"RGBA16UI",value:36214,description:" "},p.RGB16UI={name:"RGB16UI",value:36215,description:" "},p.RGBA8UI={name:"RGBA8UI",value:36220,description:" "},p.RGB8UI={name:"RGB8UI",value:36221,description:" "},p.RGBA32I={name:"RGBA32I",value:36226,description:" "},p.RGB32I={name:"RGB32I",value:36227,description:" "},p.RGBA16I={name:"RGBA16I",value:36232,description:" "},p.RGB16I={name:"RGB16I",value:36233,description:" "},p.RGBA8I={name:"RGBA8I",value:36238,description:" "},p.RGB8I={name:"RGB8I",value:36239,description:" "},p.RED_INTEGER={name:"RED_INTEGER",value:36244,description:" "},p.RGB_INTEGER={name:"RGB_INTEGER",value:36248,description:" "},p.RGBA_INTEGER={name:"RGBA_INTEGER",value:36249,description:" "},p.R8={name:"R8",value:33321,description:" "},p.RG8={name:"RG8",value:33323,description:" "},p.R16F={name:"R16F",value:33325,description:" "},p.R32F={name:"R32F",value:33326,description:" "},p.RG16F={name:"RG16F",value:33327,description:" "},p.RG32F={name:"RG32F",value:33328,description:" "},p.R8I={name:"R8I",value:33329,description:" "},p.R8UI={name:"R8UI",value:33330,description:" "},p.R16I={name:"R16I",value:33331,description:" "},p.R16UI={name:"R16UI",value:33332,description:" "},p.R32I={name:"R32I",value:33333,description:" "},p.R32UI={name:"R32UI",value:33334,description:" "},p.RG8I={name:"RG8I",value:33335,description:" "},p.RG8UI={name:"RG8UI",value:33336,description:" "},p.RG16I={name:"RG16I",value:33337,description:" "},p.RG16UI={name:"RG16UI",value:33338,description:" "},p.RG32I={name:"RG32I",value:33339,description:" "},p.RG32UI={name:"RG32UI",value:33340,description:" "},p.R8_SNORM={name:"R8_SNORM",value:36756,description:" "},p.RG8_SNORM={name:"RG8_SNORM",value:36757,description:" "},p.RGB8_SNORM={name:"RGB8_SNORM",value:36758,description:" "},p.RGBA8_SNORM={name:"RGBA8_SNORM",value:36759,description:" "},p.RGB10_A2UI={name:"RGB10_A2UI",value:36975,description:" "},p.TEXTURE_IMMUTABLE_FORMAT={name:"TEXTURE_IMMUTABLE_FORMAT",value:37167,description:" "},p.TEXTURE_IMMUTABLE_LEVELS={name:"TEXTURE_IMMUTABLE_LEVELS",value:33503,description:" "},p.UNSIGNED_INT_2_10_10_10_REV={name:"UNSIGNED_INT_2_10_10_10_REV",value:33640,description:" "},p.UNSIGNED_INT_10F_11F_11F_REV={name:"UNSIGNED_INT_10F_11F_11F_REV",value:35899,description:" "},p.UNSIGNED_INT_5_9_9_9_REV={name:"UNSIGNED_INT_5_9_9_9_REV",value:35902,description:" "},p.FLOAT_32_UNSIGNED_INT_24_8_REV={name:"FLOAT_32_UNSIGNED_INT_24_8_REV",value:36269,description:" "},p.UNSIGNED_INT_24_8={name:"UNSIGNED_INT_24_8",value:34042,description:" "},p.HALF_FLOAT={name:"HALF_FLOAT",value:5131,description:" "},p.RG={name:"RG",value:33319,description:" "},p.RG_INTEGER={name:"RG_INTEGER",value:33320,description:" "},p.INT_2_10_10_10_REV={name:"INT_2_10_10_10_REV",value:36255,description:" "},p.CURRENT_QUERY={name:"CURRENT_QUERY",value:34917,description:" "},p.QUERY_RESULT={name:"QUERY_RESULT",value:34918,description:" "},p.QUERY_RESULT_AVAILABLE={name:"QUERY_RESULT_AVAILABLE",value:34919,description:" "},p.ANY_SAMPLES_PASSED={name:"ANY_SAMPLES_PASSED",value:35887,description:" "},p.ANY_SAMPLES_PASSED_CONSERVATIVE={name:"ANY_SAMPLES_PASSED_CONSERVATIVE",value:36202,description:" "},p.MAX_DRAW_BUFFERS={name:"MAX_DRAW_BUFFERS",value:34852,description:" "},p.DRAW_BUFFER0={name:"DRAW_BUFFER0",value:34853,description:" "},p.DRAW_BUFFER1={name:"DRAW_BUFFER1",value:34854,description:" "},p.DRAW_BUFFER2={name:"DRAW_BUFFER2",value:34855,description:" "},p.DRAW_BUFFER3={name:"DRAW_BUFFER3",value:34856,description:" "},p.DRAW_BUFFER4={name:"DRAW_BUFFER4",value:34857,description:" "},p.DRAW_BUFFER5={name:"DRAW_BUFFER5",value:34858,description:" "},p.DRAW_BUFFER6={name:"DRAW_BUFFER6",value:34859,description:" "},p.DRAW_BUFFER7={name:"DRAW_BUFFER7",value:34860,description:" "},p.DRAW_BUFFER8={name:"DRAW_BUFFER8",value:34861,description:" "},p.DRAW_BUFFER9={name:"DRAW_BUFFER9",value:34862,description:" "},p.DRAW_BUFFER10={name:"DRAW_BUFFER10",value:34863,description:" "},p.DRAW_BUFFER11={name:"DRAW_BUFFER11",value:34864,description:" "},p.DRAW_BUFFER12={name:"DRAW_BUFFER12",value:34865,description:" "},p.DRAW_BUFFER13={name:"DRAW_BUFFER13",value:34866,description:" "},p.DRAW_BUFFER14={name:"DRAW_BUFFER14",value:34867,description:" "},p.DRAW_BUFFER15={name:"DRAW_BUFFER15",value:34868,description:" "},p.MAX_COLOR_ATTACHMENTS={name:"MAX_COLOR_ATTACHMENTS",value:36063,description:" "},p.COLOR_ATTACHMENT1={name:"COLOR_ATTACHMENT1",value:36065,description:" "},p.COLOR_ATTACHMENT2={name:"COLOR_ATTACHMENT2",value:36066,description:" "},p.COLOR_ATTACHMENT3={name:"COLOR_ATTACHMENT3",value:36067,description:" "},p.COLOR_ATTACHMENT4={name:"COLOR_ATTACHMENT4",value:36068,description:" "},p.COLOR_ATTACHMENT5={name:"COLOR_ATTACHMENT5",value:36069,description:" "},p.COLOR_ATTACHMENT6={name:"COLOR_ATTACHMENT6",value:36070,description:" "},p.COLOR_ATTACHMENT7={name:"COLOR_ATTACHMENT7",value:36071,description:" "},p.COLOR_ATTACHMENT8={name:"COLOR_ATTACHMENT8",value:36072,description:" "},p.COLOR_ATTACHMENT9={name:"COLOR_ATTACHMENT9",value:36073,description:" "},p.COLOR_ATTACHMENT10={name:"COLOR_ATTACHMENT10",value:36074,description:" "},p.COLOR_ATTACHMENT11={name:"COLOR_ATTACHMENT11",value:36075,description:" "},p.COLOR_ATTACHMENT12={name:"COLOR_ATTACHMENT12",value:36076,description:" "},p.COLOR_ATTACHMENT13={name:"COLOR_ATTACHMENT13",value:36077,description:" "},p.COLOR_ATTACHMENT14={name:"COLOR_ATTACHMENT14",value:36078,description:" "},p.COLOR_ATTACHMENT15={name:"COLOR_ATTACHMENT15",value:36079,description:" "},p.SAMPLER_3D={name:"SAMPLER_3D",value:35679,description:" "},p.SAMPLER_2D_SHADOW={name:"SAMPLER_2D_SHADOW",value:35682,description:" "},p.SAMPLER_2D_ARRAY={name:"SAMPLER_2D_ARRAY",value:36289,description:" "},p.SAMPLER_2D_ARRAY_SHADOW={name:"SAMPLER_2D_ARRAY_SHADOW",value:36292,description:" "},p.SAMPLER_CUBE_SHADOW={name:"SAMPLER_CUBE_SHADOW",value:36293,description:" "},p.INT_SAMPLER_2D={name:"INT_SAMPLER_2D",value:36298,description:" "},p.INT_SAMPLER_3D={name:"INT_SAMPLER_3D",value:36299,description:" "},p.INT_SAMPLER_CUBE={name:"INT_SAMPLER_CUBE",value:36300,description:" "},p.INT_SAMPLER_2D_ARRAY={name:"INT_SAMPLER_2D_ARRAY",value:36303,description:" "},p.UNSIGNED_INT_SAMPLER_2D={name:"UNSIGNED_INT_SAMPLER_2D",value:36306,description:" "},p.UNSIGNED_INT_SAMPLER_3D={name:"UNSIGNED_INT_SAMPLER_3D",value:36307,description:" "},p.UNSIGNED_INT_SAMPLER_CUBE={name:"UNSIGNED_INT_SAMPLER_CUBE",value:36308,description:" "},p.UNSIGNED_INT_SAMPLER_2D_ARRAY={name:"UNSIGNED_INT_SAMPLER_2D_ARRAY",value:36311,description:" "},p.MAX_SAMPLES={name:"MAX_SAMPLES",value:36183,description:" "},p.SAMPLER_BINDING={name:"SAMPLER_BINDING",value:35097,description:" "},p.PIXEL_PACK_BUFFER={name:"PIXEL_PACK_BUFFER",value:35051,description:" "},p.PIXEL_UNPACK_BUFFER={name:"PIXEL_UNPACK_BUFFER",value:35052,description:" "},p.PIXEL_PACK_BUFFER_BINDING={name:"PIXEL_PACK_BUFFER_BINDING",value:35053,description:" "},p.PIXEL_UNPACK_BUFFER_BINDING={name:"PIXEL_UNPACK_BUFFER_BINDING",value:35055,description:" "},p.COPY_READ_BUFFER={name:"COPY_READ_BUFFER",value:36662,description:" "},p.COPY_WRITE_BUFFER={name:"COPY_WRITE_BUFFER",value:36663,description:" "},p.COPY_READ_BUFFER_BINDING={name:"COPY_READ_BUFFER_BINDING",value:36662,description:" "},p.COPY_WRITE_BUFFER_BINDING={name:"COPY_WRITE_BUFFER_BINDING",value:36663,description:" "},p.FLOAT_MAT2x3={name:"FLOAT_MAT2x3",value:35685,description:" "},p.FLOAT_MAT2x4={name:"FLOAT_MAT2x4",value:35686,description:" "},p.FLOAT_MAT3x2={name:"FLOAT_MAT3x2",value:35687,description:" "},p.FLOAT_MAT3x4={name:"FLOAT_MAT3x4",value:35688,description:" "},p.FLOAT_MAT4x2={name:"FLOAT_MAT4x2",value:35689,description:" "},p.FLOAT_MAT4x3={name:"FLOAT_MAT4x3",value:35690,description:" "},p.UNSIGNED_INT_VEC2={name:"UNSIGNED_INT_VEC2",value:36294,description:" "},p.UNSIGNED_INT_VEC3={name:"UNSIGNED_INT_VEC3",value:36295,description:" "},p.UNSIGNED_INT_VEC4={name:"UNSIGNED_INT_VEC4",value:36296,description:" "},p.UNSIGNED_NORMALIZED={name:"UNSIGNED_NORMALIZED",value:35863,description:" "},p.SIGNED_NORMALIZED={name:"SIGNED_NORMALIZED",value:36764,description:" "},p.VERTEX_ATTRIB_ARRAY_INTEGER={name:"VERTEX_ATTRIB_ARRAY_INTEGER",value:35069,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR={name:"VERTEX_ATTRIB_ARRAY_DIVISOR",value:35070,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_MODE={name:"TRANSFORM_FEEDBACK_BUFFER_MODE",value:35967,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",value:35968,description:" "},p.TRANSFORM_FEEDBACK_VARYINGS={name:"TRANSFORM_FEEDBACK_VARYINGS",value:35971,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_START={name:"TRANSFORM_FEEDBACK_BUFFER_START",value:35972,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_SIZE={name:"TRANSFORM_FEEDBACK_BUFFER_SIZE",value:35973,description:" "},p.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN={name:"TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",value:35976,description:" "},p.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS={name:"MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",value:35978,description:" "},p.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS={name:"MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",value:35979,description:" "},p.INTERLEAVED_ATTRIBS={name:"INTERLEAVED_ATTRIBS",value:35980,description:" "},p.SEPARATE_ATTRIBS={name:"SEPARATE_ATTRIBS",value:35981,description:" "},p.TRANSFORM_FEEDBACK_BUFFER={name:"TRANSFORM_FEEDBACK_BUFFER",value:35982,description:" "},p.TRANSFORM_FEEDBACK_BUFFER_BINDING={name:"TRANSFORM_FEEDBACK_BUFFER_BINDING",value:35983,description:" "},p.TRANSFORM_FEEDBACK={name:"TRANSFORM_FEEDBACK",value:36386,description:" "},p.TRANSFORM_FEEDBACK_PAUSED={name:"TRANSFORM_FEEDBACK_PAUSED",value:36387,description:" "},p.TRANSFORM_FEEDBACK_ACTIVE={name:"TRANSFORM_FEEDBACK_ACTIVE",value:36388,description:" "},p.TRANSFORM_FEEDBACK_BINDING={name:"TRANSFORM_FEEDBACK_BINDING",value:36389,description:" "},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",value:33296,description:" "},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",value:33297,description:" "},p.FRAMEBUFFER_ATTACHMENT_RED_SIZE={name:"FRAMEBUFFER_ATTACHMENT_RED_SIZE",value:33298,description:" "},p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE={name:"FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",value:33299,description:" "},p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE={name:"FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",value:33300,description:" "},p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE={name:"FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",value:33301,description:" "},p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE={name:"FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",value:33302,description:" "},p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE={name:"FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",value:33303,description:" "},p.FRAMEBUFFER_DEFAULT={name:"FRAMEBUFFER_DEFAULT",value:33304,description:" "},p.DEPTH24_STENCIL8={name:"DEPTH24_STENCIL8",value:35056,description:" "},p.DRAW_FRAMEBUFFER_BINDING={name:"DRAW_FRAMEBUFFER_BINDING",value:36006,description:" "},p.READ_FRAMEBUFFER={name:"READ_FRAMEBUFFER",value:36008,description:" "},p.DRAW_FRAMEBUFFER={name:"DRAW_FRAMEBUFFER",value:36009,description:" "},p.READ_FRAMEBUFFER_BINDING={name:"READ_FRAMEBUFFER_BINDING",value:36010,description:" "},p.RENDERBUFFER_SAMPLES={name:"RENDERBUFFER_SAMPLES",value:36011,description:" "},p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER={name:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",value:36052,description:" "},p.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE={name:"FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",value:36182,description:" "},p.UNIFORM_BUFFER={name:"UNIFORM_BUFFER",value:35345,description:" "},p.UNIFORM_BUFFER_BINDING={name:"UNIFORM_BUFFER_BINDING",value:35368,description:" "},p.UNIFORM_BUFFER_START={name:"UNIFORM_BUFFER_START",value:35369,description:" "},p.UNIFORM_BUFFER_SIZE={name:"UNIFORM_BUFFER_SIZE",value:35370,description:" "},p.MAX_VERTEX_UNIFORM_BLOCKS={name:"MAX_VERTEX_UNIFORM_BLOCKS",value:35371,description:" "},p.MAX_FRAGMENT_UNIFORM_BLOCKS={name:"MAX_FRAGMENT_UNIFORM_BLOCKS",value:35373,description:" "},p.MAX_COMBINED_UNIFORM_BLOCKS={name:"MAX_COMBINED_UNIFORM_BLOCKS",value:35374,description:" "},p.MAX_UNIFORM_BUFFER_BINDINGS={name:"MAX_UNIFORM_BUFFER_BINDINGS",value:35375,description:" "},p.MAX_UNIFORM_BLOCK_SIZE={name:"MAX_UNIFORM_BLOCK_SIZE",value:35376,description:" "},p.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS={name:"MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",value:35377,description:" "},p.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS={name:"MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",value:35379,description:" "},p.UNIFORM_BUFFER_OFFSET_ALIGNMENT={name:"UNIFORM_BUFFER_OFFSET_ALIGNMENT",value:35380,description:" "},p.ACTIVE_UNIFORM_BLOCKS={name:"ACTIVE_UNIFORM_BLOCKS",value:35382,description:" "},p.UNIFORM_TYPE={name:"UNIFORM_TYPE",value:35383,description:" "},p.UNIFORM_SIZE={name:"UNIFORM_SIZE",value:35384,description:" "},p.UNIFORM_BLOCK_INDEX={name:"UNIFORM_BLOCK_INDEX",value:35386,description:" "},p.UNIFORM_OFFSET={name:"UNIFORM_OFFSET",value:35387,description:" "},p.UNIFORM_ARRAY_STRIDE={name:"UNIFORM_ARRAY_STRIDE",value:35388,description:" "},p.UNIFORM_MATRIX_STRIDE={name:"UNIFORM_MATRIX_STRIDE",value:35389,description:" "},p.UNIFORM_IS_ROW_MAJOR={name:"UNIFORM_IS_ROW_MAJOR",value:35390,description:" "},p.UNIFORM_BLOCK_BINDING={name:"UNIFORM_BLOCK_BINDING",value:35391,description:" "},p.UNIFORM_BLOCK_DATA_SIZE={name:"UNIFORM_BLOCK_DATA_SIZE",value:35392,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORMS={name:"UNIFORM_BLOCK_ACTIVE_UNIFORMS",value:35394,description:" "},p.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES={name:"UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",value:35395,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",value:35396,description:" "},p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER={name:"UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",value:35398,description:" "},p.OBJECT_TYPE={name:"OBJECT_TYPE",value:37138,description:" "},p.SYNC_CONDITION={name:"SYNC_CONDITION",value:37139,description:" "},p.SYNC_STATUS={name:"SYNC_STATUS",value:37140,description:" "},p.SYNC_FLAGS={name:"SYNC_FLAGS",value:37141,description:" "},p.SYNC_FENCE={name:"SYNC_FENCE",value:37142,description:" "},p.SYNC_GPU_COMMANDS_COMPLETE={name:"SYNC_GPU_COMMANDS_COMPLETE",value:37143,description:" "},p.UNSIGNALED={name:"UNSIGNALED",value:37144,description:" "},p.SIGNALED={name:"SIGNALED",value:37145,description:" "},p.ALREADY_SIGNALED={name:"ALREADY_SIGNALED",value:37146,description:" "},p.TIMEOUT_EXPIRED={name:"TIMEOUT_EXPIRED",value:37147,description:" "},p.CONDITION_SATISFIED={name:"CONDITION_SATISFIED",value:37148,description:" "},p.WAIT_FAILED={name:"WAIT_FAILED",value:37149,description:" "},p.SYNC_FLUSH_COMMANDS_BIT={name:"SYNC_FLUSH_COMMANDS_BIT",value:1,description:" "},p.COLOR={name:"COLOR",value:6144,description:" "},p.DEPTH={name:"DEPTH",value:6145,description:" "},p.STENCIL={name:"STENCIL",value:6146,description:" "},p.MIN={name:"MIN",value:32775,description:" "},p.MAX={name:"MAX",value:32776,description:" "},p.DEPTH_COMPONENT24={name:"DEPTH_COMPONENT24",value:33190,description:" "},p.STREAM_READ={name:"STREAM_READ",value:35041,description:" "},p.STREAM_COPY={name:"STREAM_COPY",value:35042,description:" "},p.STATIC_READ={name:"STATIC_READ",value:35045,description:" "},p.STATIC_COPY={name:"STATIC_COPY",value:35046,description:" "},p.DYNAMIC_READ={name:"DYNAMIC_READ",value:35049,description:" "},p.DYNAMIC_COPY={name:"DYNAMIC_COPY",value:35050,description:" "},p.DEPTH_COMPONENT32F={name:"DEPTH_COMPONENT32F",value:36012,description:" "},p.DEPTH32F_STENCIL8={name:"DEPTH32F_STENCIL8",value:36013,description:" "},p.INVALID_INDEX={name:"INVALID_INDEX",value:4294967295,description:" "},p.TIMEOUT_IGNORED={name:"TIMEOUT_IGNORED",value:-1,description:" "},p.MAX_CLIENT_WAIT_TIMEOUT_WEBGL={name:"MAX_CLIENT_WAIT_TIMEOUT_WEBGL",value:37447,description:" "},p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE={name:"VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",value:35070,description:"Describes the frequency divisor used for instanced rendering.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_VENDOR_WEBGL={name:"UNMASKED_VENDOR_WEBGL",value:37445,description:"Passed to getParameter to get the vendor string of the graphics driver.",extensionName:"ANGLE_instanced_arrays"},p.UNMASKED_RENDERER_WEBGL={name:"UNMASKED_RENDERER_WEBGL",value:37446,description:"Passed to getParameter to get the renderer string of the graphics driver.",extensionName:"WEBGL_debug_renderer_info"},p.MAX_TEXTURE_MAX_ANISOTROPY_EXT={name:"MAX_TEXTURE_MAX_ANISOTROPY_EXT",value:34047,description:"Returns the maximum available anisotropy.",extensionName:"EXT_texture_filter_anisotropic"},p.TEXTURE_MAX_ANISOTROPY_EXT={name:"TEXTURE_MAX_ANISOTROPY_EXT",value:34046,description:"Passed to texParameter to set the desired maximum anisotropy for a texture.",extensionName:"EXT_texture_filter_anisotropic"},p.COMPRESSED_RGB_S3TC_DXT1_EXT={name:"COMPRESSED_RGB_S3TC_DXT1_EXT",value:33776,description:"A DXT1-compressed image in an RGB image format.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT1_EXT={name:"COMPRESSED_RGBA_S3TC_DXT1_EXT",value:33777,description:"A DXT1-compressed image in an RGB image format with a simple on/off alpha value.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT3_EXT={name:"COMPRESSED_RGBA_S3TC_DXT3_EXT",value:33778,description:"A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_RGBA_S3TC_DXT5_EXT={name:"COMPRESSED_RGBA_S3TC_DXT5_EXT",value:33779,description:"A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.",extensionName:"WEBGL_compressed_texture_s3tc"},p.COMPRESSED_R11_EAC={name:"COMPRESSED_R11_EAC",value:37488,description:"One-channel (red) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_R11_EAC={name:"COMPRESSED_SIGNED_R11_EAC",value:37489,description:"One-channel (red) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RG11_EAC={name:"COMPRESSED_RG11_EAC",value:37490,description:"Two-channel (red and green) unsigned format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SIGNED_RG11_EAC={name:"COMPRESSED_SIGNED_RG11_EAC",value:37491,description:"Two-channel (red and green) signed format compression.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_ETC2={name:"COMPRESSED_RGB8_ETC2",value:37492,description:"Compresses RBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGBA8_ETC2_EAC={name:"COMPRESSED_RGBA8_ETC2_EAC",value:37493,description:"Compresses RGBA8 data. The RGB part is encoded the same as RGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ETC2={name:"COMPRESSED_SRGB8_ETC2",value:37494,description:"Compresses sRBG8 data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC={name:"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",value:37495,description:"Compresses sRGBA8 data. The sRGB part is encoded the same as SRGB_ETC2, but the alpha part is encoded separately.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37496,description:"Similar to RGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2={name:"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",value:37497,description:"Similar to SRGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.",extensionName:"WEBGL_compressed_texture_etc"},p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_4BPPV1_IMG",value:35840,description:"RGB compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",value:35842,description:"RGBA compression in 4-bit mode. One block for each 4×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGB_PVRTC_2BPPV1_IMG",value:35841,description:"RGB compression in 2-bit mode. One block for each 8×4 pixels.",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG={name:"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",value:35843,description:"RGBA compression in 2-bit mode. One block for each 8×4 pixe",extensionName:"WEBGL_compressed_texture_pvrtc"},p.COMPRESSED_RGB_ETC1_WEBGL={name:"COMPRESSED_RGB_ETC1_WEBGL",value:36196,description:"Compresses 24-bit RGB data with no alpha channel.",extensionName:"WEBGL_compressed_texture_etc1"},p.COMPRESSED_RGB_ATC_WEBGL={name:"COMPRESSED_RGB_ATC_WEBGL",value:35986,description:"Compresses RGB textures with no alpha channel.",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",value:35986,description:"Compresses RGBA textures using explicit alpha encoding (useful when alpha transitions are sharp).",extensionName:"WEBGL_compressed_texture_atc"},p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL={name:"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",value:34798,description:"Compresses RGBA textures using interpolated alpha encoding (useful when alpha transitions are gradient).",extensionName:"WEBGL_compressed_texture_atc"},p.UNSIGNED_INT_24_8_WEBGL={name:"UNSIGNED_INT_24_8_WEBGL",value:34042,description:"Unsigned integer type for 24-bit depth texture data.",extensionName:"WEBGL_depth_texture"},p.HALF_FLOAT_OES={name:"HALF_FLOAT_OES",value:36193,description:"Half floating-point type (16-bit).",extensionName:"OES_texture_half_float"},p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT={name:"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",value:33297,description:" ",extensionName:"WEBGL_color_buffer_float"},p.UNSIGNED_NORMALIZED_EXT={name:"UNSIGNED_NORMALIZED_EXT",value:35863,description:" ",extensionName:"WEBGL_color_buffer_float"},p.MIN_EXT={name:"MIN_EXT",value:32775,description:"Produces the minimum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.MAX_EXT={name:"MAX_EXT",value:32776,description:"Produces the maximum color components of the source and destination colors.",extensionName:"EXT_blend_minmax"},p.SRGB_EXT={name:"SRGB_EXT",value:35904,description:"Unsized sRGB format that leaves the precision up to the driver.",extensionName:"EXT_sRGB"},p.SRGB_ALPHA_EXT={name:"SRGB_ALPHA_EXT",value:35906,description:"Unsized sRGB format with unsized alpha component.",extensionName:"EXT_sRGB"},p.SRGB8_ALPHA8_EXT={name:"SRGB8_ALPHA8_EXT",value:35907,description:"Sized (8-bit) sRGB and alpha formats.",extensionName:"EXT_sRGB"},p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT={name:"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",value:33296,description:"Returns the framebuffer color encoding.",extensionName:"EXT_sRGB"},p.FRAGMENT_SHADER_DERIVATIVE_HINT_OES={name:"FRAGMENT_SHADER_DERIVATIVE_HINT_OES",value:35723,description:"Indicates the accuracy of the derivative calculation for the GLSL built-in functions: dFdx, dFdy, and fwidth.",extensionName:"OES_standard_derivatives"},p.COLOR_ATTACHMENT0_WEBGL={name:"COLOR_ATTACHMENT0_WEBGL",value:36064,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT1_WEBGL={name:"COLOR_ATTACHMENT1_WEBGL",value:36065,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT2_WEBGL={name:"COLOR_ATTACHMENT2_WEBGL",value:36066,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT3_WEBGL={name:"COLOR_ATTACHMENT3_WEBGL",value:36067,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT4_WEBGL={name:"COLOR_ATTACHMENT4_WEBGL",value:36068,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT5_WEBGL={name:"COLOR_ATTACHMENT5_WEBGL",value:36069,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT6_WEBGL={name:"COLOR_ATTACHMENT6_WEBGL",value:36070,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT7_WEBGL={name:"COLOR_ATTACHMENT7_WEBGL",value:36071,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT8_WEBGL={name:"COLOR_ATTACHMENT8_WEBGL",value:36072,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT9_WEBGL={name:"COLOR_ATTACHMENT9_WEBGL",value:36073,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT10_WEBGL={name:"COLOR_ATTACHMENT10_WEBGL",value:36074,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT11_WEBGL={name:"COLOR_ATTACHMENT11_WEBGL",value:36075,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT12_WEBGL={name:"COLOR_ATTACHMENT12_WEBGL",value:36076,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT13_WEBGL={name:"COLOR_ATTACHMENT13_WEBGL",value:36077,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT14_WEBGL={name:"COLOR_ATTACHMENT14_WEBGL",value:36078,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.COLOR_ATTACHMENT15_WEBGL={name:"COLOR_ATTACHMENT15_WEBGL",value:36079,description:"Framebuffer color attachment point",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER0_WEBGL={name:"DRAW_BUFFER0_WEBGL",value:34853,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER1_WEBGL={name:"DRAW_BUFFER1_WEBGL",value:34854,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER2_WEBGL={name:"DRAW_BUFFER2_WEBGL",value:34855,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER3_WEBGL={name:"DRAW_BUFFER3_WEBGL",value:34856,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER4_WEBGL={name:"DRAW_BUFFER4_WEBGL",value:34857,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER5_WEBGL={name:"DRAW_BUFFER5_WEBGL",value:34858,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER6_WEBGL={name:"DRAW_BUFFER6_WEBGL",value:34859,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER7_WEBGL={name:"DRAW_BUFFER7_WEBGL",value:34860,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER8_WEBGL={name:"DRAW_BUFFER8_WEBGL",value:34861,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER9_WEBGL={name:"DRAW_BUFFER9_WEBGL",value:34862,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER10_WEBGL={name:"DRAW_BUFFER10_WEBGL",value:34863,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER11_WEBGL={name:"DRAW_BUFFER11_WEBGL",value:34864,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER12_WEBGL={name:"DRAW_BUFFER12_WEBGL",value:34865,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER13_WEBGL={name:"DRAW_BUFFER13_WEBGL",value:34866,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER14_WEBGL={name:"DRAW_BUFFER14_WEBGL",value:34867,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.DRAW_BUFFER15_WEBGL={name:"DRAW_BUFFER15_WEBGL",value:34868,description:"Draw buffer",extensionName:"WEBGL_draw_buffers"},p.MAX_COLOR_ATTACHMENTS_WEBGL={name:"MAX_COLOR_ATTACHMENTS_WEBGL",value:36063,description:"Maximum number of framebuffer color attachment points",extensionName:"WEBGL_draw_buffers"},p.MAX_DRAW_BUFFERS_WEBGL={name:"MAX_DRAW_BUFFERS_WEBGL",value:34852,description:"Maximum number of draw buffers",extensionName:"WEBGL_draw_buffers"},p.VERTEX_ARRAY_BINDING_OES={name:"VERTEX_ARRAY_BINDING_OES",value:34229,description:"The bound vertex array object (VAO).",extensionName:"VERTEX_ARRAY_BINDING_OES"},p.QUERY_COUNTER_BITS_EXT={name:"QUERY_COUNTER_BITS_EXT",value:34916,description:"The number of bits used to hold the query result for the given target.",extensionName:"EXT_disjoint_timer_query"},p.CURRENT_QUERY_EXT={name:"CURRENT_QUERY_EXT",value:34917,description:"The currently active query.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_EXT={name:"QUERY_RESULT_EXT",value:34918,description:"The query result.",extensionName:"EXT_disjoint_timer_query"},p.QUERY_RESULT_AVAILABLE_EXT={name:"QUERY_RESULT_AVAILABLE_EXT",value:34919,description:"A Boolean indicating whether or not a query result is available.",extensionName:"EXT_disjoint_timer_query"},p.TIME_ELAPSED_EXT={name:"TIME_ELAPSED_EXT",value:35007,description:"Elapsed time (in nanoseconds).",extensionName:"EXT_disjoint_timer_query"},p.TIMESTAMP_EXT={name:"TIMESTAMP_EXT",value:36392,description:"The current time.",extensionName:"EXT_disjoint_timer_query"},p.GPU_DISJOINT_EXT={name:"GPU_DISJOINT_EXT",value:36795,description:"A Boolean indicating whether or not the GPU performed any disjoint operation.",extensionName:"EXT_disjoint_timer_query"},p.zeroMeaningByCommand={getError:"NO_ERROR",blendFunc:"ZERO",blendFuncSeparate:"ZERO",readBuffer:"NONE",getFramebufferAttachmentParameter:"NONE",texParameterf:"NONE",texParameteri:"NONE",drawArrays:"POINTS",drawElements:"POINTS",drawArraysInstanced:"POINTS",drawArraysInstancedAngle:"POINTS",drawBuffers:"POINTS",drawElementsInstanced:"POINTS",drawRangeElements:"POINTS"},p.oneMeaningByCommand={blendFunc:"ONE",blendFuncSeparate:"ONE",drawArrays:"LINES",drawElements:"LINES",drawArraysInstanced:"LINES",drawArraysInstancedAngle:"LINES",drawBuffers:"LINES",drawElementsInstanced:"LINES",drawRangeElements:"LINES"};const m={},g={};!function(){for(const e in p)if(p.hasOwnProperty(e)){const t=p[e];m[t.name]=t,g[t.value]=t}}();class E extends c{get analyserName(){return E.analyserName}appendToAnalysis(e,t){if(!e.commands)return;const n={total:0,totalTriangles:0,totalTriangleStrip:0,totalTriangleFan:0,totalLines:0,totalLineStrip:0,totalLineLoop:0,totalPoints:0};for(const t of e.commands)"drawArrays"===t.name&&t.commandArguments.length>=3||"drawArraysInstanced"===t.name&&t.commandArguments.length>=3||"drawArraysInstancedANGLE"===t.name&&t.commandArguments.length>=3?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[2]):"drawElements"===t.name&&t.commandArguments.length>=2||"drawElementsInstanced"===t.name&&t.commandArguments.length>=2||"drawElementsInstancedANGLE"===t.name&&t.commandArguments.length>=2?this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[1]):"drawRangeElements"===t.name&&t.commandArguments.length>=4&&this.appendToPrimitives(n,t.commandArguments[0],t.commandArguments[3]);t.total=n.total,t.triangles=n.totalTriangles,t.triangleStrip=n.totalTriangleStrip,t.triangleFan=n.totalTriangleFan,t.lines=n.totalLines,t.lineStrip=n.totalLineStrip,t.lineLoop=n.totalLineLoop,t.points=n.totalPoints}appendToPrimitives(e,t,n){t===p.POINTS.value?e.totalPoints+=n:t===p.LINES.value?e.totalLines+=n:t===p.LINE_STRIP.value?e.totalLineStrip+=n:t===p.LINE_LOOP.value?e.totalLineLoop+=n:t===p.TRIANGLES.value?e.totalTriangles+=n:t===p.TRIANGLE_STRIP.value?e.totalTriangleStrip+=n:t===p.TRIANGLE_FAN.value&&(e.totalTriangleFan+=n),e.total+=n}}E.analyserName="Primitives";class v{constructor(e){this.contextInformation=e,this.analysers=[],this.initAnalysers()}appendAnalyses(e){for(const t in this.analysers)this.analysers.hasOwnProperty(t)&&this.analysers[t].appendAnalysis(e)}initAnalysers(){this.analysers.push(new h(this.contextInformation),new f(this.contextInformation),new E(this.contextInformation))}}class C{static getStackTrace(e=0,t=0){const n=[];try{throw new Error("Errorator.")}catch(e){if(e.stack){const t=e.stack.split("\n");for(let e=0,r=t.length;e0;t++)n.shift();for(let e=0;e0;e++)n.pop()}return n}}class D{static getWebGlObjectTag(e){return e[D.SPECTOROBJECTTAGKEY]}static attachWebGlObjectTag(e,t){t.displayText=D.stringifyWebGlObjectTag(t),e[D.SPECTOROBJECTTAGKEY]=t}static stringifyWebGlObjectTag(e){return e?`${e.typeName} - ID: ${e.id}`:"No tag available."}}D.SPECTOROBJECTTAGKEY="__SPECTOR_Object_TAG";class S{get type(){return("undefined"!=typeof globalThis?globalThis:self)[this.typeName]||null}constructor(){this.id=0}tagWebGlObject(e){if(!this.type)return;let t;if(!e)return t;if(t=D.getWebGlObjectTag(e),t)return t;if(e instanceof this.type){const n=this.getNextId();return t={typeName:this.typeName,id:n},D.attachWebGlObjectTag(e,t),t}return t}getNextId(){return this.id++}}class A{constructor(e){this.options=e}createCapture(e,t,n){const r=C.getStackTrace(4,1),i=0===e.name.indexOf("uniform")?this.stringifyUniform(e.arguments):this.stringify(e.arguments,e.result),s={id:t,startTime:e.startTime,commandEndTime:e.endTime,endTime:0,name:e.name,commandArguments:e.arguments,result:e.result,stackTrace:r,status:0,marker:n,text:i};this.transformCapture(s);for(let e=0;e50&&(s.commandArguments[e]="Array Length: "+t.length)}if(s.commandArguments){const e=[];for(let t=0;t0&&(n+=": "+this.stringifyArgs(e).join(", ")),null!=t&&(n+=" -> "+this.stringifyResult(t)),n}stringifyUniform(e){let t=this.spiedCommandName;if(e&&e.length>0){const n=[];n.push(this.stringifyValue(e[0]));for(let t=1;t0&&"number"==typeof s)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");else{const e=this.stringifyValue(s);r.push(e)}}return r}}_.commandName="bufferSubData";class y{static storeOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]||(e[n]=e[t])}static resetOriginFunction(e,t){if(!e)return;if(!e[t])return;const n=this.getOriginFunctionName(t);e[n]&&(e[t]=e[n],delete e[n])}static storePrototypeOriginFunction(e,t){if(!e)return;if(!e.prototype[t])return;const n=this.getOriginFunctionName(t);e.prototype[n]||(e.prototype[n]=e.prototype[t])}static executePrototypeOriginFunction(e,t,n,r){if(!e)return;const i=this.getOriginFunctionName(n);return t.prototype[i]?(e[i]||(e[i]=t.prototype[i]),this.executeFunction(e,i,r)):void 0}static executeOriginFunction(e,t,n){if(!e)return;const r=this.getOriginFunctionName(t);return e[r]?this.executeFunction(e,r,n):void 0}static executeFunction(e,t,n){const r=n;if(void 0===r||0===r.length)return e[t]();switch(r.length){case 1:return e[t](r[0]);case 2:return e[t](r[0],r[1]);case 3:return e[t](r[0],r[1],r[2]);case 4:return e[t](r[0],r[1],r[2],r[3]);case 5:return e[t](r[0],r[1],r[2],r[3],r[4]);case 6:return e[t](r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6]);case 8:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]);case 9:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8]);case 10:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9]);case 11:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10]);case 12:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11]);case 13:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12]);case 14:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13]);case 15:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14]);case 16:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);case 17:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16]);case 18:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17]);case 19:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18]);case 20:return e[t](r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15],r[16],r[17],r[18],r[19]);default:return e[t].apply(e,r)}}static getOriginFunctionName(e){return this.originFunctionPrefix+e}}y.originFunctionPrefix="__SPECTOR_Origin_";class b extends A{get spiedCommandName(){return b.commandName}stringifyArgs(e){const t=[];if(e.length>0){const n=e[0],r=this.stringifyValue(n);t.push(r)}if(e.length>1){const n=""+e[1];t.push(n)}return e.length>2&&t.push(e[2]),t}}b.commandName="bindAttribLocation";class T extends A{get spiedCommandName(){return T.commandName}stringifyArgs(e){const t=[],n=this.options.context.getParameter(p.READ_FRAMEBUFFER_BINDING.value),r=this.options.tagWebGlObject(n);t.push("READ FROM: "+this.stringifyValue(r));const i=this.options.context.getParameter(p.DRAW_FRAMEBUFFER_BINDING.value),s=this.options.tagWebGlObject(i);t.push("WRITE TO: "+this.stringifyValue(s));for(let n=0;n<8;n++)t.push(e[n]);return(e[8]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[8]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[8]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t.push(p.stringifyWebGlConstant(e[9],"blitFrameBuffer")),t}}T.commandName="blitFrameBuffer";class R extends A{get spiedCommandName(){return R.commandName}stringifyArgs(e){const t=[];return(e[0]&p.DEPTH_BUFFER_BIT.value)===p.DEPTH_BUFFER_BIT.value&&t.push(p.DEPTH_BUFFER_BIT.name),(e[0]&p.STENCIL_BUFFER_BIT.value)===p.STENCIL_BUFFER_BIT.value&&t.push(p.STENCIL_BUFFER_BIT.name),(e[0]&p.COLOR_BUFFER_BIT.value)===p.COLOR_BUFFER_BIT.value&&t.push(p.COLOR_BUFFER_BIT.name),t}}R.commandName="clear";class x{static getProgramData(e,t){const n={LINK_STATUS:e.getProgramParameter(t,p.LINK_STATUS.value),VALIDATE_STATUS:e.getProgramParameter(t,p.VALIDATE_STATUS.value),infoLog:e.getProgramInfoLog(t)||""},r=e.getAttachedShaders(t)||[],i=new Array(2);let s=0;for(const t of r){const n=this.getShaderData(e,t);s+=n.source.length,n.shaderType===p.FRAGMENT_SHADER.name?i[1]=n:i[0]=n}return{programStatus:n,shaders:i,length:s}}static getShaderData(e,t){const n=e.getShaderSource(t)||"",r=e.getExtension("WEBGL_debug_shaders"),i=r?r.getTranslatedShaderSource(t):null,s=e.getShaderParameter(t,p.SHADER_TYPE.value)===p.FRAGMENT_SHADER.value;let o=t&&t.__SPECTOR_Metadata&&t.__SPECTOR_Metadata.name?t.__SPECTOR_Metadata.name:this.readNameFromShaderSource(n);return o||(o=s?"Fragment":"Vertex"),{COMPILE_STATUS:e.getShaderParameter(t,p.COMPILE_STATUS.value),shaderType:s?p.FRAGMENT_SHADER.name:p.VERTEX_SHADER.name,name:o,source:n,translatedSource:i,infoLog:e.getShaderInfoLog(t)||""}}static readNameFromShaderSource(e){try{let t,n="";const r=/#define[\s]+SHADER_NAME[\s]+([\S]+)(\n|$)/gi;if(t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),""===n){const r=/#define[\s]+SHADER_NAME_B64[\s]+([\S]+)(\n|$)/gi;t=r.exec(e),null!==t&&(t.index===r.lastIndex&&r.lastIndex++,n=t[1]),n&&(n=decodeURIComponent(atob(n)))}return n}catch(e){return null}}}class w extends A{constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.shader=x.getShaderData(this.options.context,t)}finally{n&&n(!0)}}getShaderDisplayText(e){return this.stringifyValue(e.commandArguments[0])}}class F extends w{get spiedCommandName(){return F.commandName}transformCapture(e){if(super.transformCapture(e),e.shader){const t=e.shader.COMPILE_STATUS?"compiled":"failed";e.text=`${this.spiedCommandName}: ${this.getShaderDisplayText(e)} -> ${t}`}}}F.commandName="compileShader";const N=["lineWidth"];class L extends A{get spiedCommandName(){return this.internalSpiedCommandName}constructor(e,t){super(e),this.internalSpiedCommandName=t,this.isDeprecated=N.indexOf(this.spiedCommandName)>-1}transformCapture(e){this.isDeprecated&&(e.status=50)}}class O extends A{get spiedCommandName(){return O.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}O.commandName="disableVertexAttribArray";class I extends A{get spiedCommandName(){return I.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(e[1]+" indices"),t.push(e[2]),t}}I.commandName="drawArrays";class k extends A{get spiedCommandName(){return k.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}k.commandName="drawArraysInstanced";class M extends A{get spiedCommandName(){return M.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstancedANGLE")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t}}M.commandName="drawArraysInstancedANGLE";class P extends A{get spiedCommandName(){return P.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElements")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElements")),t.push(e[3]),t}}P.commandName="drawElements";class B extends A{get spiedCommandName(){return B.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstancedANGLE")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstancedANGLE")),t.push(e[3]),t.push(e[4]),t}}B.commandName="drawElementsInstancedANGLE";class U extends A{get spiedCommandName(){return U.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t}}U.commandName="drawElementsInstanced";class $ extends A{get spiedCommandName(){return $.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawRangeElements")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(p.stringifyWebGlConstant(e[4],"drawRangeElements")),t.push(e[5]),t}}$.commandName="drawRangeElements";class G extends A{get spiedCommandName(){return G.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}G.commandName="getActiveAttrib";class V extends A{get spiedCommandName(){return V.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}V.commandName="getActiveUniform";class W extends A{get spiedCommandName(){return W.commandName}stringifyResult(e){var t;if(null!=e)return null!==(t=null==e?void 0:e.toFixed(0))&&void 0!==t?t:"0"}}W.commandName="getAttribLocation";class H extends A{get spiedCommandName(){return H.commandName}stringifyResult(e){return e?"true":"false"}}H.commandName="getExtension";class j extends A{get spiedCommandName(){return j.commandName}stringifyResult(e){if(!e)return"null";const t=D.getWebGlObjectTag(e);return t?t.displayText:e}}j.commandName="getParameter";class z extends A{get spiedCommandName(){return z.commandName}stringifyResult(e){if(e)return`min: ${e.rangeMin}, max: ${e.rangeMax}, precision: ${e.precision}`}}z.commandName="getShaderPrecisionFormat";class X extends w{get spiedCommandName(){return X.commandName}stringifyResult(e){if("string"!=typeof e||0===e.trim().length)return"No messages";const t=e.split(/\r?\n/).filter(e=>e.trim().length>0).length;return t+(1===t?" message":" messages")}}X.commandName="getShaderInfoLog";class K extends A{get spiedCommandName(){return K.commandName}stringifyResult(e){if(e)return`name: ${e.name}, size: ${e.size}, type: ${e.type}`}}K.commandName="getTransformFeedbackVarying";class Y extends A{get spiedCommandName(){return Y.commandName}constructor(e){super(e)}transformCapture(e){const t=e.commandArguments[0];if(!t)return;const n=this.options.toggleCapture;n&&n(!1);try{e.program=x.getProgramData(this.options.context,t)}finally{n&&n(!0)}const r=e.program.programStatus.LINK_STATUS?"linked":"failed";e.text=`${this.spiedCommandName}: ${this.stringifyValue(t)} -> ${r}`}}Y.commandName="linkProgram";class q extends A{get spiedCommandName(){return q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"multiDrawArraysInstancedBaseInstanceWEBGL")),t.push(`drawCount=${e[9]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t}}q.commandName="multiDrawArraysInstancedBaseInstanceWEBGL";class Q extends A{get spiedCommandName(){return Q.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[7]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t}}Q.commandName="multiDrawArraysInstancedWEBGL";class Z extends A{get spiedCommandName(){return Z.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(`drawCount=${e[5]}`),t.push(e[2]),t.push(e[4]),t}}Z.commandName="multiDrawArraysWEBGL";class J extends A{get spiedCommandName(){return J.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[11]}`),t.push(e[2]),t.push(e[4]),t.push(e[6]),t.push(e[8]),t.push(e[10]),t}}J.commandName="multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL";class ee extends A{get spiedCommandName(){return ee.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[8]}`),t.push(e[2]),t.push(e[5]),t.push(e[7]),t}}ee.commandName="multiDrawElementsInstancedWEBGL";class te extends A{get spiedCommandName(){return te.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArrays")),t.push(p.stringifyWebGlConstant(e[3],"drawArrays")),t.push(`drawCount=${e[6]}`),t.push(e[2]),t.push(e[5]),t}}te.commandName="multiDrawElementsWEBGL";class ne extends A{get spiedCommandName(){return ne.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawArraysInstanced")),t.push(e[1]),t.push(e[2]),t.push(e[3]),t.push(`baseInstance = ${e[4]}`),t}}ne.commandName="drawArraysInstancedBaseInstanceWEBGL";class re extends A{get spiedCommandName(){return re.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"drawElementsInstanced")),t.push(e[1]+" indices"),t.push(p.stringifyWebGlConstant(e[2],"drawElementsInstanced")),t.push(e[3]),t.push(e[4]),t.push(`baseVertex = ${e[5]}`),t.push(`baseInstance = ${e[6]}`),t}}re.commandName="drawElementsInstancedBaseVertexBaseInstanceWEBGL";class ie extends A{get spiedCommandName(){return ie.commandName}stringifyArgs(e){var t,n;const r=[];for(let i=0;i<4;i++)r.push(null!==(n=null===(t=e[i])||void 0===t?void 0:t.toFixed(0))&&void 0!==n?n:"0");return r}}function se(e){return null==e?"":`${e.toFixed(0)} (0b${(e>>>0).toString(2)})`}ie.commandName="scissor";class oe extends A{get spiedCommandName(){return oe.commandName}stringifyArgs(e){const t=[];return t.push(se(e[0])),t}}oe.commandName="stencilMask";class ae extends A{get spiedCommandName(){return ae.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilMaskSeparate")),t.push(se(e[1])),t}}ae.commandName="stencilMaskSeparate";class le extends A{get spiedCommandName(){return le.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFunc")),t.push(se(e[1])),t.push(se(e[2])),t}}le.commandName="stencilFunc";class ue extends A{get spiedCommandName(){return ue.commandName}stringifyArgs(e){const t=[];return t.push(p.stringifyWebGlConstant(e[0],"stencilFuncSeparate")),t.push(p.stringifyWebGlConstant(e[1],"stencilFuncSeparate")),t.push(se(e[2])),t.push(se(e[3])),t}}ue.commandName="stencilFuncSeparate";class ce extends A{get spiedCommandName(){return ce.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t.push(e[1]),t.push(p.stringifyWebGlConstant(e[2],"vertexAttribPointer")),t.push(e[3]),t.push(e[4]),t.push(e[5]),t}}ce.commandName="vertexAttribPointer";class he extends A{get spiedCommandName(){return he.commandName}stringifyArgs(e){const t=[];for(let n=0;n<4;n++)t.push(e[n].toFixed(0));return t}}he.commandName="viewport";class de extends A{get spiedCommandName(){return de.commandName}stringifyArgs(e){const t=[];return t.push(e[0]),t}}de.commandName="enableVertexAttribArray";class fe extends w{get spiedCommandName(){return fe.commandName}stringifyArgs(e){const t="string"==typeof e[1]?e[1]:"";return[this.stringifyValue(e[0]),t.length+" chars"]}transformCapture(e){super.transformCapture(e);const t=e.commandArguments[1];e.shader&&"string"==typeof t&&(e.shader.source=t,e.shader.COMPILE_STATUS=null,e.shader.translatedSource="",e.shader.infoLog="")}}fe.commandName="shaderSource";class pe{constructor(e){this.spiedCommandName=e.spiedCommandName,this.spiedCommandRunningContext=e.spiedCommandRunningContext,this.spiedCommand=this.spiedCommandRunningContext[this.spiedCommandName],y.storeOriginFunction(this.spiedCommandRunningContext,this.spiedCommandName),this.callback=e.callback,this.commandOptions={context:e.context,contextVersion:e.contextVersion,extensions:e.extensions,toggleCapture:e.toggleCapture},this.initCustomCommands(),this.initCommand()}spy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.overloadedCommand}unSpy(){this.spiedCommandRunningContext[this.spiedCommandName]=this.spiedCommand}createCapture(e,t,n){return this.command.createCapture(e,t,n)}initCommand(){pe.customCommandsConstructors[this.spiedCommandName]?this.command=pe.customCommandsConstructors[this.spiedCommandName](this.commandOptions):this.command=new L(this.commandOptions,this.spiedCommandName),this.overloadedCommand=this.getSpy()}getSpy(){const e=this;return function(){const t=u.now,n=y.executeOriginFunction(e.spiedCommandRunningContext,e.spiedCommandName,arguments),r=u.now;try{const i={name:e.spiedCommandName,arguments,result:n,startTime:t,endTime:r};e.callback(e,i)}catch(e){}return n}}initCustomCommands(){pe.customCommandsConstructors||(pe.customCommandsConstructors={[b.commandName]:e=>new b(e),[T.commandName]:e=>new T(e),[_.commandName]:e=>new _(e),[R.commandName]:e=>new R(e),[F.commandName]:e=>new F(e),[O.commandName]:e=>new O(e),[I.commandName]:e=>new I(e),[k.commandName]:e=>new k(e),[M.commandName]:e=>new M(e),[P.commandName]:e=>new P(e),[U.commandName]:e=>new U(e),[B.commandName]:e=>new B(e),[$.commandName]:e=>new $(e),[G.commandName]:e=>new G(e),[V.commandName]:e=>new V(e),[W.commandName]:e=>new W(e),[H.commandName]:e=>new H(e),[j.commandName]:e=>new j(e),[X.commandName]:e=>new X(e),[z.commandName]:e=>new z(e),[K.commandName]:e=>new K(e),[Y.commandName]:e=>new Y(e),[q.commandName]:e=>new q(e),[Q.commandName]:e=>new Q(e),[Z.commandName]:e=>new Z(e),[J.commandName]:e=>new J(e),[ee.commandName]:e=>new ee(e),[te.commandName]:e=>new te(e),[ne.commandName]:e=>new ne(e),[re.commandName]:e=>new re(e),[ie.commandName]:e=>new ie(e),[fe.commandName]:e=>new fe(e),[oe.commandName]:e=>new oe(e),[ae.commandName]:e=>new ae(e),[le.commandName]:e=>new le(e),[ue.commandName]:e=>new ue(e),[ce.commandName]:e=>new ce(e),[he.commandName]:e=>new he(e),[de.commandName]:e=>new de(e)})}}class me{constructor(e){this.options=e,this.context=e.context,this.contextVersion=e.contextVersion,this.extensions=e.extensions,this.toggleCapture=e.toggleCapture,this.consumeCommands=this.getConsumeCommands(),this.changeCommandsByState=this.getChangeCommandsByState(),this.commandNameToStates=this.getCommandNameToStates()}get requireStartAndStopStates(){return!0}startCapture(e,t,n){return this.quickCapture=t,this.fullCapture=n,this.capturedCommandsByState={},e&&this.requireStartAndStopStates&&(this.currentState={},this.readFromContextNoSideEffects()),this.copyCurrentStateToPrevious(),this.currentState={},this.previousState}stopCapture(){return this.requireStartAndStopStates&&this.readFromContextNoSideEffects(),this.analyse(void 0),this.currentState}registerCallbacks(e){for(const t in this.changeCommandsByState)if(this.changeCommandsByState.hasOwnProperty(t))for(const n of this.changeCommandsByState[t])e[n]=e[n]||[],e[n].push(this.onChangeCommand.bind(this));for(const t of this.consumeCommands)e[t]=e[t]||[],e[t].push(this.onConsumeCommand.bind(this))}getStateData(){return this.currentState}getConsumeCommands(){return[]}getChangeCommandsByState(){return{}}copyCurrentStateToPrevious(){this.currentState&&(this.previousState=this.currentState)}onChangeCommand(e){const t=this.commandNameToStates[e.name];for(const n of t){if(!this.isValidChangeCommand(e,n))return;this.capturedCommandsByState[n]=this.capturedCommandsByState[n]||[],this.capturedCommandsByState[n].push(e)}}isValidChangeCommand(e,t){return!0}onConsumeCommand(e){this.isValidConsumeCommand(e)&&(this.readFromContextNoSideEffects(),this.analyse(e),this.storeCommandIds(),e[this.stateName]=this.currentState,this.startCapture(!1,this.quickCapture,this.fullCapture))}isValidConsumeCommand(e){return this.lastCommandName=null==e?void 0:e.name,!0}analyse(e){for(const t in this.capturedCommandsByState)if(this.capturedCommandsByState.hasOwnProperty(t)){const n=this.capturedCommandsByState[t],r=n.length-1;if(r>=0)if(e){for(let t=0;t1&&this.parameters.push(this.getWebgl2Parameters());const e={};for(let t=1;t<=this.contextVersion&&!(t>this.parameters.length);t++)if(this.parameters[t-1])for(const n of this.parameters[t-1])if(n.changeCommands)for(const t of n.changeCommands)e[n.constant.name]=e[n.constant.name]||[],e[n.constant.name].push(t);return e}readFromContext(){for(let e=1;e<=this.contextVersion&&!(e>this.parameters.length);e++)for(const t of this.parameters[e-1]){const e=this.readParameterFromContext(t);if(null==e){const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n;continue}const n=D.getWebGlObjectTag(e);if(n)this.currentState[t.constant.name]=n;else{const n=this.stringifyParameterValue(e,t);this.currentState[t.constant.name]=n}}}readParameterFromContext(e){return e.constant.extensionName&&!this.extensions[e.constant.extensionName]?`Extension ${e.constant.extensionName} is unavailable.`:this.context.getParameter(e.constant.value)}stringifyParameterValue(e,t){if(null===e)return"null";if(void 0===e)return"undefined";if(30===t.returnType)return se(e);if("number"==typeof e&&p.isWebGlConstant(e)){if(20===t.returnType){const n=t.changeCommands&&t.changeCommands[0]||"";return p.stringifyWebGlConstant(e,n)}return e}if(e.length&&"string"!=typeof e){const t=[];for(let n=0;n1?r=this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value):this.context.getFramebufferAttachmentParameter(t,n,p.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.value)===p.RENDERBUFFER.value&&(r=e.getRenderbufferParameter(e.RENDERBUFFER,e.RENDERBUFFER_STENCIL_SIZE))):r=this.readParameterFromContext({constant:p.STENCIL_BITS}),this.currentState[p.STENCIL_BITS.name]=""+r}isValidChangeCommand(e,t){return"enable"===e.name||"disable"===e.name?e.commandArguments[0]===p.STENCIL_TEST.value:"stencilOp"===e.name||"stencilOpSeparate"===e.name?xe.stencilOpStates.indexOf(e.commandArguments[0])>0:"stencilFunc"===e.name||"stencilFuncSeparate"===e.name?xe.stencilFuncStates.indexOf(e.commandArguments[0])>0:"stencilMask"!==e.name&&"stencilMaskSeparate"!==e.name||xe.stencilMaskStates.indexOf(e.commandArguments[0])>0}getConsumeCommands(){return d}isStateEnable(e,t){return this.context.isEnabled(p.STENCIL_TEST.value)}}xe.stateName="StencilState",xe.stencilOpStates=[p.STENCIL_BACK_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_FAIL.value,p.STENCIL_BACK_PASS_DEPTH_PASS.value,p.STENCIL_FAIL.value,p.STENCIL_PASS_DEPTH_FAIL.value,p.STENCIL_PASS_DEPTH_PASS.value],xe.stencilFuncStates=[p.STENCIL_BACK_FUNC.value,p.STENCIL_BACK_REF.value,p.STENCIL_BACK_VALUE_MASK.value,p.STENCIL_FUNC.value,p.STENCIL_REF.value,p.STENCIL_VALUE_MASK.value],xe.stencilMaskStates=[p.STENCIL_BACK_WRITEMASK.value,p.STENCIL_WRITEMASK.value];class we{static isSupportedCombination(e,t,n){return e=e||p.UNSIGNED_BYTE.value,((t=t||p.RGBA.value)===p.RGB.value||t===p.RGBA.value)&&(n===p.RGB.value||n===p.RGBA.value||n===p.RGBA8.value||n===p.RGBA16F.value||n===p.RGBA32F.value||n===p.RGB16F.value||n===p.RGB32F.value||n===p.R11F_G11F_B10F.value||n===p.SRGB8.value||n===p.SRGB8_ALPHA8.value)&&this.isSupportedComponentType(e)}static readPixels(e,t,n,r,i,s){e.getError(),s===p.UNSIGNED_NORMALIZED.value&&(s=p.UNSIGNED_BYTE.value);const o=r*i*4;let a;if(s===p.UNSIGNED_BYTE.value?a=new Uint8Array(o):(s=p.FLOAT.value,a=new Float32Array(o)),e.readPixels(t,n,r,i,e.RGBA,s,a),e.getError())return;if(s===p.UNSIGNED_BYTE.value)return a;const l=new Uint8Array(r*i*4);for(let e=0;e1){const e=this.context.getParameter(p.MAX_DRAW_BUFFERS.value);for(let n=0;n1?this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value):p.UNSIGNED_BYTE.value;l===p.RENDERBUFFER.value?this.readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,c,u):l===p.TEXTURE.value&&this.readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,c,u)}readFrameBufferAttachmentFromRenderBuffer(e,t,n,r,i,s,o,a,l,u){let c=0,h=0;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,c=e.samples,h=e.internalFormat,!c&&!we.isSupportedCombination(l,p.RGBA.value,h))return}else s+=r,o+=i;if(r=i=0,c){const a=e,u=e.createRenderbuffer(),c=e.getParameter(e.RENDERBUFFER_BINDING);e.bindRenderbuffer(e.RENDERBUFFER,u),e.renderbufferStorage(e.RENDERBUFFER,h,s,o),e.bindRenderbuffer(e.RENDERBUFFER,c),e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u);const d=a.getParameter(a.READ_FRAMEBUFFER_BINDING),f=a.getParameter(a.DRAW_FRAMEBUFFER_BINDING);a.bindFramebuffer(a.READ_FRAMEBUFFER,t),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,this.captureFrameBuffer),a.blitFramebuffer(0,0,s,o,0,0,s,o,e.COLOR_BUFFER_BIT,e.NEAREST),a.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),a.bindFramebuffer(a.READ_FRAMEBUFFER,d),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,f),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t),e.deleteRenderbuffer(u)}else e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),e.framebufferRenderbuffer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,p.RENDERBUFFER.value,u),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,0,0,l),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}readFrameBufferAttachmentFromTexture(e,t,n,r,i,s,o,a,l,u){let c=0;this.contextVersion>1&&(c=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value));const h=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL.value),d=this.context.getFramebufferAttachmentParameter(a,n.value,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE.value);d>0?g[d].name:p.TEXTURE_2D.name;let f=!1,m=l;if(u.__SPECTOR_Object_CustomData){const e=u.__SPECTOR_Object_CustomData;if(s=e.width,o=e.height,void 0!==e.type&&(m=e.type),f=e.target===p.TEXTURE_2D_ARRAY.name,!we.isSupportedCombination(e.type,e.format,e.internalFormat))return}else s+=r,o+=i;r=i=0,e.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer),c>0||f?e.framebufferTextureLayer(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,u,h,c):e.framebufferTexture2D(p.FRAMEBUFFER.value,p.COLOR_ATTACHMENT0.value,d||p.TEXTURE_2D.value,u,h),this.context.checkFramebufferStatus(p.FRAMEBUFFER.value)===p.FRAMEBUFFER_COMPLETE.value&&this.getCapture(e,n.name,r,i,s,o,d,c,m),e.bindFramebuffer(p.FRAMEBUFFER.value,t)}getCapture(e,t,n,r,i,s,o,l,u){i=Math.floor(i),s=Math.floor(s);const c={attachmentName:t,src:null,textureCubeMapFace:o?g[o].name:null,textureLayer:l,raw:null};if(!this.quickCapture)try{const t=we.readPixels(e,n,r,i,s,u);if(t){c.raw=Ne.encode(t,i,s),this.workingCanvas.width=i,this.workingCanvas.height=s;const e=this.workingContext2D.createImageData(i,s);if(e.data.set(t),this.workingContext2D.putImageData(e,0,0),this.fullCapture)this.captureCanvas.width=this.workingCanvas.width,this.captureCanvas.height=this.workingCanvas.height;else{const e=i/s;e<1?(this.captureCanvas.width=Le.captureBaseSize*e,this.captureCanvas.height=Le.captureBaseSize):e>1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this.captureContext2D.drawImage(this.workingCanvas,0,0,i,s,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",c.src=Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D)}}catch(e){a.warn("Spector can not capture the visual state: "+e)}this.currentState.Attachments.push(c)}analyse(e){}}Le.stateName="VisualState",Le.captureBaseSize=256;class Oe{constructor(e){this.context=e.context,this.captureFrameBuffer=e.context.createFramebuffer(),this.workingCanvas=Fe.createCanvas(1,1),this.workingContext2D=Fe.get2DContext(this.workingCanvas),this.captureCanvas=Fe.createCanvas(1,1),this.captureContext2D=Fe.get2DContext(this.captureCanvas),Fe.setImageSmoothing(this.captureContext2D,!0)}appendTextureState(e,t,n=null,r){if(!t)return;const i=t.__SPECTOR_Object_CustomData;if(i&&(this.fullCapture=r,i.type&&(e.textureType=this.getWebGlConstant(i.type)),i.format&&(e.format=this.getWebGlConstant(i.format)),i.internalFormat&&(e.internalFormat=this.getWebGlConstant(i.internalFormat)),e.width=i.width,e.height=i.height,i.depth&&(e.depth=i.depth),n)){const r="NEAREST"===e.samplerMagFilter||"NEAREST"===e.magFilter,s=this.getTextureVisualState(n,t,i,r);if(s){e.visual=s.visual;for(const t in s.visualPixels)if(s.visualPixels.hasOwnProperty(t)){e.visualPixels=s.visualPixels;break}}}}getTextureVisualState(e,t,n,r){try{const i=this.context,s={},o={};if(!we.isSupportedCombination(n.type,n.format,n.internalFormat))return{visual:s,visualPixels:o};const a=this.context.getParameter(p.FRAMEBUFFER_BINDING.value);i.bindFramebuffer(p.FRAMEBUFFER.value,this.captureFrameBuffer);try{const a=0,l=n.width,u=n.height;if(e===p.TEXTURE_3D&&n.depth){const e=i;for(let c=0;c2&&c2&&c1?(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize/e):(this.captureCanvas.width=Le.captureBaseSize,this.captureCanvas.height=Le.captureBaseSize)}return this.captureCanvas.width=Math.max(this.captureCanvas.width,1),this.captureCanvas.height=Math.max(this.captureCanvas.height,1),this.captureContext2D.globalCompositeOperation="copy",this.captureContext2D.scale(1,-1),this.captureContext2D.translate(0,-this.captureCanvas.height),this._setSmoothing(!o),this.captureContext2D.drawImage(this.workingCanvas,0,0,r,i,0,0,this.captureCanvas.width,this.captureCanvas.height),this.captureContext2D.setTransform(1,0,0,1,0,0),this.captureContext2D.globalCompositeOperation="source-over",{src:Fe.canvasToDataURL(this.captureCanvas,this.captureContext2D),raw:l}}catch(e){}return{src:void 0,raw:null}}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}_setSmoothing(e){Fe.setImageSmoothing(this.captureContext2D,e)}}Oe.captureBaseSize=64,Oe.cubeMapFaces=[p.TEXTURE_CUBE_MAP_POSITIVE_X,p.TEXTURE_CUBE_MAP_POSITIVE_Y,p.TEXTURE_CUBE_MAP_POSITIVE_Z,p.TEXTURE_CUBE_MAP_NEGATIVE_X,p.TEXTURE_CUBE_MAP_NEGATIVE_Y,p.TEXTURE_CUBE_MAP_NEGATIVE_Z];class Ie{constructor(e){this.context=e.context}getUboValue(e,t,n,r){const i=Ie.uboTypes[r];if(!i)return;const s=new i.arrayBufferView(n*i.lengthMultiplier),o=this.context,a=o.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,e);if(a){const n=o.getIndexedParameter(p.UNIFORM_BUFFER_START.value,e),r=o.getParameter(p.UNIFORM_BUFFER_BINDING.value);try{o.bindBuffer(p.UNIFORM_BUFFER.value,a),o.getBufferSubData(p.UNIFORM_BUFFER.value,n+t,s)}catch(e){return}r&&o.bindBuffer(p.UNIFORM_BUFFER.value,r)}return Array.prototype.slice.call(s)}}Ie.uboTypes={[p.BOOL.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.BOOL_VEC2.value]:{arrayBufferView:Uint8Array,lengthMultiplier:2},[p.BOOL_VEC3.value]:{arrayBufferView:Uint8Array,lengthMultiplier:3},[p.BOOL_VEC4.value]:{arrayBufferView:Uint8Array,lengthMultiplier:4},[p.INT.value]:{arrayBufferView:Int32Array,lengthMultiplier:1},[p.INT_VEC2.value]:{arrayBufferView:Int32Array,lengthMultiplier:2},[p.INT_VEC3.value]:{arrayBufferView:Int32Array,lengthMultiplier:3},[p.INT_VEC4.value]:{arrayBufferView:Int32Array,lengthMultiplier:4},[p.UNSIGNED_INT.value]:{arrayBufferView:Uint32Array,lengthMultiplier:1},[p.UNSIGNED_INT_VEC2.value]:{arrayBufferView:Uint32Array,lengthMultiplier:2},[p.UNSIGNED_INT_VEC3.value]:{arrayBufferView:Uint32Array,lengthMultiplier:3},[p.UNSIGNED_INT_VEC4.value]:{arrayBufferView:Uint32Array,lengthMultiplier:4},[p.FLOAT.value]:{arrayBufferView:Float32Array,lengthMultiplier:1},[p.FLOAT_VEC2.value]:{arrayBufferView:Float32Array,lengthMultiplier:2},[p.FLOAT_VEC3.value]:{arrayBufferView:Float32Array,lengthMultiplier:3},[p.FLOAT_VEC4.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2.value]:{arrayBufferView:Float32Array,lengthMultiplier:4},[p.FLOAT_MAT2x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT2x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT3.value]:{arrayBufferView:Float32Array,lengthMultiplier:9},[p.FLOAT_MAT3x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:6},[p.FLOAT_MAT3x4.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.FLOAT_MAT4.value]:{arrayBufferView:Float32Array,lengthMultiplier:16},[p.FLOAT_MAT4x2.value]:{arrayBufferView:Float32Array,lengthMultiplier:8},[p.FLOAT_MAT4x3.value]:{arrayBufferView:Float32Array,lengthMultiplier:12},[p.SAMPLER_2D.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1},[p.SAMPLER_CUBE.value]:{arrayBufferView:Uint8Array,lengthMultiplier:1}};class ke extends S{get typeName(){return"WebGLBuffer"}}class Me extends S{get typeName(){return"WebGLFramebuffer"}}class Pe extends S{get typeName(){return"WebGLProgram"}static saveInGlobalStore(e){const t=D.getWebGlObjectTag(e);t&&(this.store[t.id]=e)}static getFromGlobalStore(e){return this.store[e]}static updateInGlobalStore(e,t){if(!t)return;const n=this.getFromGlobalStore(e);if(!n)return;const r=D.getWebGlObjectTag(n);r&&(D.attachWebGlObjectTag(t,r),this.store[r.id]=t)}}Pe.store={};class Be extends S{get typeName(){return"WebGLQuery"}}class Ue extends S{get typeName(){return"WebGLRenderbuffer"}}class $e extends S{get typeName(){return"WebGLSampler"}}class Ge extends S{get typeName(){return"WebGLShader"}}class Ve extends S{get typeName(){return"WebGLSync"}}class We extends S{get typeName(){return"WebGLTexture"}}class He extends S{get typeName(){return"WebGLTransformFeedback"}}class je extends S{get typeName(){return"WebGLUniformLocation"}}class ze extends S{get typeName(){return"WebGLVertexArrayObject"}}class Xe extends me{get stateName(){return Xe.stateName}get requireStartAndStopStates(){return!1}constructor(e){super(e),this.drawCallTextureInputState=new Oe(e),this.drawCallUboInputState=new Ie(e)}getConsumeCommands(){return d}getChangeCommandsByState(){return{}}readFromContext(){var e,t;const n=this.context.getParameter(p.CURRENT_PROGRAM.value);if(!n)return;this.currentState.frameBuffer=this.readFrameBufferFromContext();const r=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData:x.getProgramData(this.context,n);if(this.currentState.programStatus=Object.assign({},r.programStatus),this.currentState.programStatus.program=this.getSpectorData(n),this.currentState.programStatus.RECOMPILABLE=o.isBuildableProgram(n),this.currentState.programStatus.RECOMPILABLE&&Pe.saveInGlobalStore(n),this.currentState.shaders=r.shaders,(null===(e=this.lastCommandName)||void 0===e?void 0:e.indexOf("Elements"))>=0){const e=this.context.getParameter(this.context.ELEMENT_ARRAY_BUFFER_BINDING);e&&(this.currentState.elementArray={},this.currentState.elementArray.arrayBuffer=this.getSpectorData(e))}const i=this.context.getProgramParameter(n,p.ACTIVE_ATTRIBUTES.value);this.currentState.attributes=[];for(let e=0;e1){const e=this.context.getProgramParameter(n,p.ACTIVE_UNIFORM_BLOCKS.value);this.currentState.uniformBlocks=[];for(let t=0;t1){const e=this.context;t.colorAttachments=[];const n=e.getParameter(p.MAX_DRAW_BUFFERS.value);for(let e=0;e1&&(r.alphaSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE.value),r.blueSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE.value),r.encoding=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.value)),r.componentType=this.getWebGlConstant(this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.value)),r.depthSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE.value),r.greenSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE.value),r.redSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_RED_SIZE.value),r.stencilSize=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE.value),n===p.TEXTURE.value&&(r.textureLayer=this.context.getFramebufferAttachmentParameter(t,e,p.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER.value))),r}readAttributeFromContext(e,t){const n=this.context.getActiveAttrib(e,t),r=this.context.getAttribLocation(e,n.name);if(-1===r)return{name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:-1};const i=this.context.getVertexAttrib(r,p.CURRENT_VERTEX_ATTRIB.value),s=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING.value),o={name:n.name,size:n.size,type:this.getWebGlConstant(n.type),location:r,offsetPointer:this.context.getVertexAttribOffset(r,p.VERTEX_ATTRIB_ARRAY_POINTER.value),bufferBinding:this.getSpectorData(s),enabled:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_ENABLED.value),arraySize:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_SIZE.value),stride:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_STRIDE.value),arrayType:this.getWebGlConstant(this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_TYPE.value)),normalized:this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_NORMALIZED.value),vertexAttrib:Array.prototype.slice.call(i)};return this.extensions[p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.extensionName]?o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE.value):this.contextVersion>1&&(o.integer=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_INTEGER.value),o.divisor=this.context.getVertexAttrib(r,p.VERTEX_ATTRIB_ARRAY_DIVISOR.value)),this.appendBufferCustomData(o,s),o}readUniformFromContext(e,t){const n=this.context.getActiveUniform(e,t),r=this.context.getUniformLocation(e,n.name);if(r){if(n.size>1&&n.name&&n.name.indexOf("[0]")===n.name.length-3){const t=[];for(let r=0;r1){r.baseLevel=this.context.getTexParameter(t.value,p.TEXTURE_BASE_LEVEL.value),r.immutable=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_FORMAT.value),r.immutableLevels=this.context.getTexParameter(t.value,p.TEXTURE_IMMUTABLE_LEVELS.value),r.maxLevel=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LEVEL.value);const e=this.context.getParameter(p.SAMPLER_BINDING.value);if(e){r.sampler=this.getSpectorData(e);const t=this.context;r.samplerMaxLod=t.getSamplerParameter(e,p.TEXTURE_MAX_LOD.value),r.samplerMinLod=t.getSamplerParameter(e,p.TEXTURE_MIN_LOD.value),r.samplerCompareFunc=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_FUNC.value)),r.samplerCompareMode=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_COMPARE_MODE.value)),r.samplerWrapS=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_S.value)),r.samplerWrapT=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_T.value)),r.samplerWrapR=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_WRAP_R.value)),r.samplerMagFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MAG_FILTER.value)),r.samplerMinFilter=this.getWebGlConstant(t.getSamplerParameter(e,p.TEXTURE_MIN_FILTER.value))}else r.maxLod=this.context.getTexParameter(t.value,p.TEXTURE_MAX_LOD.value),r.minLod=this.context.getTexParameter(t.value,p.TEXTURE_MIN_LOD.value),r.compareFunc=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_FUNC.value)),r.compareMode=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_COMPARE_MODE.value)),r.wrapR=this.getWebGlConstant(this.context.getTexParameter(t.value,p.TEXTURE_WRAP_R.value))}const i=this.getTextureStorage(t);if(i){const e=this.quickCapture?null:t;this.drawCallTextureInputState.appendTextureState(r,i,e,this.fullCapture)}return this.context.activeTexture(n),r}getTextureStorage(e){return e===p.TEXTURE_2D?this.context.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP?this.context.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):e===p.TEXTURE_3D?this.context.getParameter(p.TEXTURE_BINDING_3D.value):e===p.TEXTURE_2D_ARRAY?this.context.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):void 0}readUniformsFromContextIntoState(e,t,n,r){const i=this.context,s=i.getActiveUniforms(e,t,p.UNIFORM_TYPE.value),o=i.getActiveUniforms(e,t,p.UNIFORM_SIZE.value),a=i.getActiveUniforms(e,t,p.UNIFORM_BLOCK_INDEX.value),l=i.getActiveUniforms(e,t,p.UNIFORM_OFFSET.value),u=i.getActiveUniforms(e,t,p.UNIFORM_ARRAY_STRIDE.value),c=i.getActiveUniforms(e,t,p.UNIFORM_MATRIX_STRIDE.value),h=i.getActiveUniforms(e,t,p.UNIFORM_IS_ROW_MAJOR.value);for(let d=0;d-1&&(t.blockName=i.getActiveUniformBlockName(e,t.blockIndice)),t.offset=l[d],t.arrayStride=u[d],t.matrixStride=c[d],t.rowMajor=h[d],t.blockIndice>-1){const e=r[a[d]].bindingPoint;t.value=this.drawCallUboInputState.getUboValue(e,t.offset,t.size,s[d])}}}readTransformFeedbackFromContext(e,t){const n=this.context,r=n.getTransformFeedbackVarying(e,t),i=n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value,t),s={name:r.name,size:r.size,type:this.getWebGlConstant(r.type),buffer:this.getSpectorData(i),bufferSize:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_SIZE.value,t),bufferStart:n.getIndexedParameter(p.TRANSFORM_FEEDBACK_BUFFER_START.value,t)};return this.appendBufferCustomData(s,i),s}readUniformBlockFromContext(e,t){const n=this.context,r=n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_BINDING.value),i=n.getIndexedParameter(p.UNIFORM_BUFFER_BINDING.value,r),s={name:n.getActiveUniformBlockName(e,t),bindingPoint:r,size:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_DATA_SIZE.value),activeUniformCount:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_ACTIVE_UNIFORMS.value),vertex:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER.value),fragment:n.getActiveUniformBlockParameter(e,t,p.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER.value),buffer:this.getSpectorData(i)};return this.appendBufferCustomData(s,i),s}appendBufferCustomData(e,t){if(t){const n=t.__SPECTOR_Object_CustomData;n&&(n.usage&&(e.bufferUsage=this.getWebGlConstant(n.usage)),e.bufferLength=n.length,n.offset&&(e.bufferOffset=n.offset),n.sourceLength&&(e.bufferSourceLength=n.sourceLength))}}getWebGlConstant(e){const t=g[e];return t?t.name:e}}Xe.stateName="DrawCall",Xe.samplerTypes={[p.SAMPLER_2D.value]:p.TEXTURE_2D,[p.SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.SAMPLER_3D.value]:p.TEXTURE_3D,[p.SAMPLER_2D_SHADOW.value]:p.TEXTURE_2D,[p.SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_2D_ARRAY_SHADOW.value]:p.TEXTURE_2D_ARRAY,[p.SAMPLER_CUBE_SHADOW.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY,[p.UNSIGNED_INT_SAMPLER_2D.value]:p.TEXTURE_2D,[p.UNSIGNED_INT_SAMPLER_3D.value]:p.TEXTURE_3D,[p.UNSIGNED_INT_SAMPLER_CUBE.value]:p.TEXTURE_CUBE_MAP,[p.UNSIGNED_INT_SAMPLER_2D_ARRAY.value]:p.TEXTURE_2D_ARRAY};class Ke{constructor(e){this.contextInformation=e,this.stateTrackers=[],this.onCommandCapturedCallbacks={},this.initStateTrackers()}startCapture(e,t,n){for(const r of this.stateTrackers){const i=r.startCapture(!0,t,n);r.requireStartAndStopStates&&(e.initState[r.stateName]=i)}}stopCapture(e){for(const t of this.stateTrackers){const n=t.stopCapture();t.requireStartAndStopStates&&(e.endState[t.stateName]=n)}}captureState(e){const t=this.onCommandCapturedCallbacks[e.name];if(t)for(const n of t)n(e)}initStateTrackers(){this.stateTrackers.push(new Ee(this.contextInformation),new ve(this.contextInformation),new Ce(this.contextInformation),new De(this.contextInformation),new Se(this.contextInformation),new Ae(this.contextInformation),new _e(this.contextInformation),new ye(this.contextInformation),new be(this.contextInformation),new Te(this.contextInformation),new Re(this.contextInformation),new xe(this.contextInformation),new Le(this.contextInformation),new Xe(this.contextInformation));for(const e of this.stateTrackers)e.registerCallbacks(this.onCommandCapturedCallbacks)}}class Ye{static initializeByteSizeFormat(){this.byteSizePerInternalFormat||(this.byteSizePerInternalFormat={[p.R8.value]:1,[p.R16F.value]:2,[p.R32F.value]:4,[p.R8UI.value]:1,[p.RG8.value]:2,[p.RG16F.value]:4,[p.RG32F.value]:8,[p.ALPHA.value]:1,[p.RGB.value]:3,[p.RGBA.value]:4,[p.LUMINANCE.value]:1,[p.LUMINANCE_ALPHA.value]:2,[p.DEPTH_COMPONENT.value]:1,[p.DEPTH_STENCIL.value]:2,[p.SRGB_EXT.value]:3,[p.SRGB_ALPHA_EXT.value]:4,[p.RGB8.value]:3,[p.SRGB8.value]:3,[p.RGB565.value]:2,[p.R11F_G11F_B10F.value]:4,[p.RGB9_E5.value]:2,[p.RGB16F.value]:6,[p.RGB32F.value]:12,[p.RGB8UI.value]:3,[p.RGBA8.value]:4,[p.RGB5_A1.value]:2,[p.RGBA16F.value]:8,[p.RGBA32F.value]:16,[p.RGBA8UI.value]:4,[p.COMPRESSED_R11_EAC.value]:4,[p.COMPRESSED_SIGNED_R11_EAC.value]:4,[p.COMPRESSED_RG11_EAC.value]:4,[p.COMPRESSED_SIGNED_RG11_EAC.value]:4,[p.COMPRESSED_RGB8_ETC2.value]:4,[p.COMPRESSED_RGBA8_ETC2_EAC.value]:4,[p.COMPRESSED_SRGB8_ETC2.value]:4,[p.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC.value]:4,[p.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]:4,[p.COMPRESSED_RGB_S3TC_DXT1_EXT.value]:.5,[p.COMPRESSED_RGBA_S3TC_DXT3_EXT.value]:1,[p.COMPRESSED_RGBA_S3TC_DXT5_EXT.value]:1,[p.COMPRESSED_RGB_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG.value]:.5,[p.COMPRESSED_RGB_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG.value]:.25,[p.COMPRESSED_RGB_ETC1_WEBGL.value]:.5,[p.COMPRESSED_RGB_ATC_WEBGL.value]:.5,[p.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL.value]:1,[p.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL.value]:1})}constructor(e){this.options=e,this.createCommandNames=this.getCreateCommandNames(),this.updateCommandNames=this.getUpdateCommandNames(),this.deleteCommandNames=this.getDeleteCommandNames(),this.startTime=u.now,this.memoryPerSecond={},this.totalMemory=0,this.frameMemory=0,this.capturing=!1,Ye.initializeByteSizeFormat()}registerCallbacks(e){for(const t of this.createCommandNames)e[t]=e[t]||[],e[t].push(this.createWithoutSideEffects.bind(this));for(const t of this.updateCommandNames)e[t]=e[t]||[],e[t].push(this.updateWithoutSideEffects.bind(this));for(const t of this.deleteCommandNames)e[t]=e[t]||[],e[t].push(this.deleteWithoutSideEffects.bind(this))}startCapture(){this.frameMemory=0,this.capturing=!0}stopCapture(){this.frameMemory=0,this.capturing=!1}appendRecordedInformation(e){e.frameMemory[this.objectName]=this.frameMemory,e.memory[this.objectName]=this.memoryPerSecond}create(e){}createWithoutSideEffects(e){this.options.toggleCapture(!1);try{this.create(e)}finally{this.options.toggleCapture(!0)}}updateWithoutSideEffects(e){if(e&&0!==e.arguments.length){this.options.toggleCapture(!1);try{const t=e.arguments[0],n=this.getBoundInstance(t);if(!n)return;if(!D.getWebGlObjectTag(n))return;const r=this.getWebGlConstant(t),i=this.update(e,r,n);this.changeMemorySize(i)}finally{this.options.toggleCapture(!0)}}}deleteWithoutSideEffects(e){if(!e||!e.arguments||e.arguments.length<1)return;const t=e.arguments[0];if(t){this.options.toggleCapture(!1);try{const e=this.delete(t);this.changeMemorySize(-e)}finally{this.options.toggleCapture(!0)}}}changeMemorySize(e){this.totalMemory+=e,this.capturing&&(this.frameMemory+=e);const t=u.now-this.startTime,n=Math.round(t/1e3);this.memoryPerSecond[n]=this.totalMemory}getWebGlConstant(e){const t=g[e];return t?t.name:e+""}getByteSizeForInternalFormat(e){return Ye.byteSizePerInternalFormat[e]||4}readPixelStoreState(){const e=this.options.context,t={UNPACK_FLIP_Y_WEBGL:e.getParameter(p.UNPACK_FLIP_Y_WEBGL.value),UNPACK_PREMULTIPLY_ALPHA_WEBGL:e.getParameter(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL.value),UNPACK_COLORSPACE_CONVERSION_WEBGL:e.getParameter(p.UNPACK_COLORSPACE_CONVERSION_WEBGL.value),UNPACK_ALIGNMENT:e.getParameter(p.UNPACK_ALIGNMENT.value)};return e instanceof WebGL2RenderingContext&&(t.UNPACK_ROW_LENGTH=e.getParameter(p.UNPACK_ROW_LENGTH.value),t.UNPACK_IMAGE_HEIGHT=e.getParameter(p.UNPACK_IMAGE_HEIGHT.value),t.UNPACK_SKIP_PIXELS=e.getParameter(p.UNPACK_SKIP_PIXELS.value),t.UNPACK_SKIP_ROWS=e.getParameter(p.UNPACK_SKIP_ROWS.value),t.UNPACK_SKIP_IMAGES=e.getParameter(p.UNPACK_SKIP_IMAGES.value)),t}}class qe extends Ye{get objectName(){return"Buffer"}getCreateCommandNames(){return["createBuffer"]}getUpdateCommandNames(){return["bufferData"]}getDeleteCommandNames(){return["deleteBuffer"]}getBoundInstance(e){const t=this.options.context;return e===p.ARRAY_BUFFER.value?t.getParameter(p.ARRAY_BUFFER_BINDING.value):e===p.ELEMENT_ARRAY_BUFFER.value?t.getParameter(p.ELEMENT_ARRAY_BUFFER_BINDING.value):e===p.COPY_READ_BUFFER.value?t.getParameter(p.COPY_READ_BUFFER_BINDING.value):e===p.COPY_WRITE_BUFFER.value?t.getParameter(p.COPY_WRITE_BUFFER_BINDING.value):e===p.TRANSFORM_FEEDBACK_BUFFER.value?t.getParameter(p.TRANSFORM_FEEDBACK_BUFFER_BINDING.value):e===p.UNIFORM_BUFFER.value?t.getParameter(p.UNIFORM_BUFFER_BINDING.value):e===p.PIXEL_PACK_BUFFER.value?t.getParameter(p.PIXEL_PACK_BUFFER_BINDING.value):e===p.PIXEL_UNPACK_BUFFER.value?t.getParameter(p.PIXEL_UNPACK_BUFFER_BINDING.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(t,e);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){const n=this.getLength(t);return t.arguments.length>=4?{target:e,length:n,usage:t.arguments[2],offset:t.arguments[3],sourceLength:t.arguments[1]?t.arguments[1].length:-1}:3===t.arguments.length?{target:e,length:n,usage:t.arguments[2]}:void 0}getLength(e){const t=e.arguments[1],n=e.arguments[3],r=e.arguments[4];if("number"==typeof t)return t;if("number"==typeof r&&r>0)return r;const i=t.byteLength||t.length||0;return"number"==typeof n&&n>0?i-n:i}}class Qe extends Ye{get objectName(){return"Renderbuffer"}getCreateCommandNames(){return["createRenderbuffer"]}getUpdateCommandNames(){return["renderbufferStorage","renderbufferStorageMultisample"]}getDeleteCommandNames(){return["deleteRenderbuffer"]}getBoundInstance(e){const t=this.options.context;if(e===p.RENDERBUFFER.value)return t.getParameter(p.RENDERBUFFER_BINDING.value)}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){const r=this.getCustomData(e,t);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return r.length=r.width*r.height*this.getByteSizeForInternalFormat(r.internalFormat),n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t){return 4===e.arguments.length?{target:t,internalFormat:e.arguments[1],width:e.arguments[2],height:e.arguments[3],length:0,samples:0}:{target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,samples:e.arguments[1]}}}class Ze extends Ye{get objectName(){return"Texture2d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage2D","compressedTexImage2D","texStorage2D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D.value?t.getParameter(p.TEXTURE_BINDING_2D.value):e===p.TEXTURE_CUBE_MAP_POSITIVE_X.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Y.value||e===p.TEXTURE_CUBE_MAP_POSITIVE_Z.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_X.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Y.value||e===p.TEXTURE_CUBE_MAP_NEGATIVE_Z.value?t.getParameter(p.TEXTURE_BINDING_CUBE_MAP.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target===p.TEXTURE_2D_ARRAY.name||t.target===p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else{const e="TEXTURE_2D"===t?1:6;let n=r.internalFormat;n===p.RGBA.value&&(r.type===p.FLOAT.value&&(n=p.RGBA32F.value),r.type===p.HALF_FLOAT_OES.value&&(n=p.RGBA16F.value)),r.length=r.width*r.height*e*this.getByteSizeForInternalFormat(n)}return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage2D"===e.name?this.getTexImage2DCustomData(e,t,n):"compressedTexImage2D"===e.name?this.getCompressedTexImage2DCustomData(e,t,n):"texStorage2D"===e.name?this.getTexStorage2DCustomData(e,t,n):void 0}getTexStorage2DCustomData(e,t,n){let r;return 5===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!1}),r}getCompressedTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=7&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],length:0,isCompressed:!0}),r}getTexImage2DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8?r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],format:e.arguments[6],type:e.arguments[7],length:0,isCompressed:!1}:6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[5].width,height:e.arguments[5].height,format:e.arguments[3],type:e.arguments[4],length:0,isCompressed:!1}),r}}class Je extends Ye{get objectName(){return"Texture3d"}getCreateCommandNames(){return["createTexture"]}getUpdateCommandNames(){return["texImage3D","compressedTexImage3D","texStorage3D"]}getDeleteCommandNames(){return["deleteTexture"]}getBoundInstance(e){const t=this.options.context;return e===p.TEXTURE_2D_ARRAY.value?t.getParameter(p.TEXTURE_BINDING_2D_ARRAY.value):e===p.TEXTURE_3D.value?t.getParameter(p.TEXTURE_BINDING_3D.value):void 0}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.target!==p.TEXTURE_2D_ARRAY.name&&t.target!==p.TEXTURE_3D.name?0:t.length:0}update(e,t,n){if(e.arguments.length>=2&&0!==e.arguments[1])return 0;const r=this.getCustomData(e,t,n);if(!r)return 0;r.pixelStoreState=this.readPixelStoreState();const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;if(r.isCompressed){if(e.arguments.length>=7){const t=e.arguments[6];r.length="number"==typeof t?t:null==t?void 0:t.byteLength}}else r.length=r.width*r.height*r.depth*this.getByteSizeForInternalFormat(r.internalFormat);return r.length=0|r.length,n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e,t,n){return"texImage3D"===e.name?this.getTexImage3DCustomData(e,t,n):"compressedTexImage3D"===e.name?this.getCompressedTexImage3DCustomData(e,t,n):"texStorage3D"===e.name?this.getTexStorage3DCustomData(e,t,n):void 0}getTexStorage3DCustomData(e,t,n){let r;return 6===e.arguments.length&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!1}),r}getCompressedTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=8&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],length:0,isCompressed:!0}),r}getTexImage3DCustomData(e,t,n){if(0!==e.arguments[1])return;let r;return e.arguments.length>=9&&(r={target:t,internalFormat:e.arguments[2],width:e.arguments[3],height:e.arguments[4],depth:e.arguments[5],format:e.arguments[7],type:e.arguments[8],length:0,isCompressed:!1}),r}}class et extends Ye{get objectName(){return"Program"}getCreateCommandNames(){return["createProgram"]}getUpdateCommandNames(){return["linkProgram"]}getDeleteCommandNames(){return["deleteProgram"]}getBoundInstance(e){return e}delete(e){const t=e.__SPECTOR_Object_CustomData;return t?t.length:0}update(e,t,n){if(e.arguments.length>=1&&!e.arguments[0])return 0;const r=this.getCustomData(n);if(!r)return 0;const i=n.__SPECTOR_Object_CustomData?n.__SPECTOR_Object_CustomData.length:0;return n.__SPECTOR_Object_CustomData=r,r.length-i}getCustomData(e){const t=this.options.context;return x.getProgramData(t,e)}}class tt{constructor(e){this.contextInformation=e,this.onCommandCallbacks={},this.recorders=[],this.initRecorders()}recordCommand(e){const t=this.onCommandCallbacks[e.name];if(t)for(const n of t)n(e)}startCapture(){for(const e of this.recorders)e.startCapture()}stopCapture(){for(const e of this.recorders)e.stopCapture()}appendRecordedInformation(e){for(const t of this.recorders)t.appendRecordedInformation(e)}initRecorders(){this.recorders.push(new qe(this.contextInformation),new Qe(this.contextInformation),new Ze(this.contextInformation),new Je(this.contextInformation),new et(this.contextInformation));for(const e of this.recorders)e.registerCallbacks(this.onCommandCallbacks)}}class nt{constructor(e){this.contextInformation=e,this.webGlObjects=[],this.initWebglObjects()}tagWebGlObjects(e){for(const t of this.webGlObjects){for(let n=0;n0&&this.currentCapture.commands.length===this.maxCommands&&this.onMaxCommand.trigger(this)}}}spyContext(e){const t=[];for(const n in e)n&&t.push(n);for(let n=0;n{this.spyRequestAnimationFrame("requestAnimationFrame",e.display)})}spyRequestAnimationFrame(e,t){const n=this;y.storeOriginFunction(t,e),t[e]=function(){const r=arguments[0],i=n.getCallback(n,r,()=>{n.spiedScope[e](r)});return y.executeOriginFunction(t,e,[i])}}spySetTimer(e){const t=this,n=this.spiedScope,r="setTimeout"===e;y.storeOriginFunction(n,e),n[e]=function(){const i=arguments[0],s=arguments[1],o=Array.prototype.slice.call(arguments);return at.setTimerCommonValues.indexOf(s)>-1&&(o[0]=t.getCallback(t,i,r?()=>{n[e](i)}:null)),y.executeOriginFunction(n,e,o)}}getCallback(e,t,n=null){return function(){const r=u.now;if(e.lastFrame=++e.lastFrame%e.speedRatio,e.willPlayNextFrame||e.speedRatio&&!e.lastFrame){try{e.onFrameStart.trigger(e)}catch(t){e.onError.trigger(t)}try{t.apply(e.spiedScope,arguments)}catch(t){e.onError.trigger(t)}e.lastSixtyFramesCurrentIndex=(e.lastSixtyFramesCurrentIndex+1)%at.fpsWindowSize,e.lastSixtyFramesDuration[e.lastSixtyFramesCurrentIndex]=r-e.lastSixtyFramesPreviousStart;try{e.onFrameEnd.trigger(e)}catch(t){e.onError.trigger(t)}e.willPlayNextFrame=!1}else n&&n();e.lastSixtyFramesPreviousStart=r}}}at.requestAnimationFrameFunctions=["requestAnimationFrame","msRequestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame"],at.setTimerFunctions=["setTimeout","setInterval"],at.setTimerCommonValues=[0,15,16,33,32,40],at.fpsWindowSize=60;class lt{constructor(e){this.canvas=e,this.onContextRequested=new l,this.init()}init(){const e=this,t=function(){const t="undefined"!=typeof HTMLCanvasElement&&this instanceof HTMLCanvasElement?HTMLCanvasElement:OffscreenCanvas,n=e.canvas?y.executeOriginFunction(this,"getContext",arguments):y.executePrototypeOriginFunction(this,t,"getContext",arguments);if(arguments.length>0){const e=arguments[0];if("webgl"!==e&&"experimental-webgl"!==e&&"webgl2"!==e&&"experimental-webgl2"!==e)return n}if(n){const t=Array.prototype.slice.call(arguments),r="webgl2"===t[0]||"experimental-webgl2"===t[0]?2:1;e.onContextRequested.trigger({context:n,contextVersion:r})}return n};this.canvas?(y.storeOriginFunction(this.canvas,"getContext"),this.canvas.getContext=t):("undefined"!=typeof HTMLCanvasElement&&(y.storePrototypeOriginFunction(HTMLCanvasElement,"getContext"),HTMLCanvasElement.prototype.getContext=t),"undefined"!=typeof OffscreenCanvas&&(y.storePrototypeOriginFunction(OffscreenCanvas,"getContext"),OffscreenCanvas.prototype.getContext=t))}}class ut{static startIntercepting(e){if(ut.intercepting||"undefined"==typeof Worker)return;const t=Worker,n=new Proxy(t,{construct(t,r,i){if(ut.workerProxy!==n)return Reflect.construct(t,r,i);const s=r[0],o="string"==typeof s?s:"Worker",a=e=>(ut.spiedWorkers.push({worker:e,originalUrl:o}),e),l=()=>a(Reflect.construct(t,r,i));if(i!==n||"string"!=typeof s||r.length>2||void 0!==r[1])return l();let u;try{const t="undefined"==typeof document?location.href:document.baseURI,n=new URL(s,t);if(e&&/^https?:$/.test(n.protocol)&&n.origin===location.origin){const r=new URL(e,t).href;n.hash="";const i=new XMLHttpRequest;if(i.open("GET",n.href,!1),i.send(),ut.isJavaScriptResponse(i,n.href)&&!i.getResponseHeader("Content-Security-Policy")&&!i.getResponseHeader("Content-Security-Policy-Report-Only")&&ut.shouldInjectSource(i.responseText)){const e=new XMLHttpRequest;if(e.open("GET",r,!1),e.send(),ut.isJavaScriptResponse(e,r)){const e="try { importScripts("+JSON.stringify(r)+'); } catch (e) { console.warn("[Spector.js] Worker auto-injection failed:", e); }\n';u=URL.createObjectURL(new Blob([e,i.responseText],{type:"application/javascript"}))}}}}catch(e){console.warn("[Spector.js] Could not inject into Worker ("+o+"):",e)}if(u){let e;try{e=Reflect.construct(t,[u],i)}catch(e){return URL.revokeObjectURL(u),l()}return setTimeout(()=>URL.revokeObjectURL(u),5e3),a(e)}return l()}});globalThis.Worker=n,ut.originalWorkerConstructor=t,ut.workerProxy=n,ut.intercepting=!0}static stopIntercepting(){if(!ut.intercepting)return;const e=ut.workerProxy;if(ut.workerProxy=void 0,ut.intercepting=!1,globalThis.Worker===e)try{globalThis.Worker=ut.originalWorkerConstructor}catch(e){}}static isJavaScriptResponse(e,t){const n=(e.getResponseHeader("Content-Type")||"").split(";")[0].trim();return 200===e.status&&e.responseURL===t&&/^(?:text|application)\/(?:x-)?(?:java|ecma)script$/i.test(n)}static shouldInjectSource(e){return!/\b(?:import|importScripts|Worker|SharedWorker|location|fetch|Request|XMLHttpRequest|WebSocket|EventSource|crossOriginIsolated|SharedArrayBuffer|Atomics|WebAssembly|eval|Function)\b|\\u|["']use strict["']|^(?:\uFEFF)?#!/.test(e)}static getSpiedWorkers(){return ut.spiedWorkers}static isIntercepting(){return ut.intercepting}}ut.spiedWorkers=[],ut.intercepting=!1;class ct{static getDelay(){return ct.delayMs}static setDelay(e){ct.delayMs="number"==typeof e&&e>0?e:0}static shouldForceIncomplete(e,t,n,r){return!(r<=0)&&e===p.COMPLETION_STATUS_KHR.value&&void 0!==t&&n-tthis._state,this.subscribe=e=>(this._listeners.add(e),()=>{this._listeners.delete(e)}),this._state=e}setState(e){this._state=e(this._state),this._emitChange()}setSnapshot(e){this._state=e,this._emitChange()}_emitChange(){for(const e of this._listeners)e()}}function pt(e){return(0,dt.useSyncExternalStore)(e.subscribe,e.getSnapshot)}var mt=n(848);const gt=(0,dt.createContext)(null);function Et(){const e=(0,dt.useContext)(gt);if(!e)throw new Error("CaptureMenuContext not provided — CaptureMenuRoot must be rendered inside CaptureMenuContext.Provider");return e}function vt({canvas:e}){const t=Et();return(0,mt.jsx)("li",{onClick:()=>t.handleCanvasSelected(e),children:(0,mt.jsx)("span",{children:`Id: ${e.id} - Size: ${e.width}*${e.height}`})})}function Ct(){const e=Et(),t=pt(e.store),n=t.selectedCanvas?`${t.selectedCanvas.id} (${t.selectedCanvas.width}*${t.selectedCanvas.height})`:"Choose Canvas...";return(0,mt.jsxs)("div",{className:"canvasListComponent",children:[(0,mt.jsx)("span",{commandName:"onCanvasSelection",onClick:e.handleCanvasListToggle,children:n}),(0,mt.jsx)("ul",{style:{display:t.showCanvasList?"block":"none",visibility:t.showCanvasList?"visible":"hidden"},children:t.canvases.map((e,t)=>(0,mt.jsx)(vt,{canvas:e},e.id||t))})]})}function Dt(){const e=Et(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"captureMenuActionsComponent",children:[(0,mt.jsx)("div",{commandName:"onCaptureRequested",onClick:e.handleCaptureRequested}),t.isPlaying?(0,mt.jsx)("div",{commandName:"onPauseRequested",onClick:e.handlePauseRequested}):(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("div",{commandName:"onPlayRequested",onClick:e.handlePlayRequested}),(0,mt.jsx)("div",{commandName:"onPlayNextFrameRequested",onClick:e.handlePlayNextFrameRequested})]})]})}function St(){const e=pt(Et().store);return(0,mt.jsxs)("span",{className:"fpsCounterComponent",children:[e.fps.toFixed(2)," Fps"]})}function At(){const e=pt(Et().store);return(0,mt.jsxs)("div",{children:[(0,mt.jsxs)("div",{className:"captureMenuComponent "+(e.visible?"active":""),children:[(0,mt.jsx)(Ct,{}),(0,mt.jsx)(Dt,{}),(0,mt.jsx)(St,{})]}),(0,mt.jsx)("div",{className:"captureMenuLogComponent "+(e.logVisible?"active":""),children:(0,mt.jsx)("span",{className:e.logLevel===i.error?"error":"",children:e.logText})})]})}class _t{constructor(e={}){this.options=e,this.handleCanvasListToggle=()=>{this.store.getSnapshot(),this.store.setState(e=>Object.assign(Object.assign({},e),{selectedCanvas:null,showCanvasList:!e.showCanvasList,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!e.showCanvasList&&!this._hideLog})),this.onCanvasSelected.trigger(null),this._isTrackingCanvas&&this.trackPageCanvases()},this.handleCanvasSelected=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{selectedCanvas:e,showCanvasList:!1,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)},this.handleCaptureRequested=()=>{const e=this.getSelectedCanvasInformation();e&&this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.PleaseWaitHelpText,logVisible:!this._hideLog})),setTimeout(()=>{this.onCaptureRequested.trigger(e)},200)},this.handlePauseRequested=()=>{this.onPauseRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!1}))},this.handlePlayRequested=()=>{this.onPlayRequested.trigger(this.getSelectedCanvasInformation()),this.store.setState(e=>Object.assign(Object.assign({},e),{isPlaying:!0}))},this.handlePlayNextFrameRequested=()=>{this.onPlayNextFrameRequested.trigger(this.getSelectedCanvasInformation())},this._rootPlaceHolder=e.rootPlaceHolder||document.body,this._hideLog=!!e.hideLog,this._isTrackingCanvas=!1,this._extraCanvasEntries=[],this.onCanvasSelected=new l,this.onCaptureRequested=new l,this.onPauseRequested=new l,this.onPlayRequested=new l,this.onPlayNextFrameRequested=new l,this.store=new ft({visible:!0,logText:_t.SelectCanvasHelpText,logLevel:i.info,logVisible:!this._hideLog,canvases:[],selectedCanvas:null,showCanvasList:!1,isPlaying:!0,fps:0}),this._container=document.createElement("div"),this._container.className="spector-react-capture-menu",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(gt.Provider,{value:this},(0,dt.createElement)(At)))}getSelectedCanvasInformation(){return this.store.getSnapshot().selectedCanvas}trackPageCanvases(){if(this._isTrackingCanvas=!0,document.body){const e=document.body.querySelectorAll("canvas");this.updateCanvasesList(e)}}updateCanvasesList(e){const t=[];for(let n=0;nObject.assign(Object.assign({},n),{canvases:t,selectedCanvas:e,logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e)}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}captureComplete(e){e?this.store.setState(t=>Object.assign(Object.assign({},t),{logLevel:i.error,logText:e,logVisible:!this._hideLog})):this.store.setState(e=>Object.assign(Object.assign({},e),{logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog}))}setFPS(e){this.store.setState(t=>Object.assign(Object.assign({},t),{fps:e}))}_updateCanvasesInternal(e){for(const t of this._extraCanvasEntries)e.push(t);this.store.getSnapshot().showCanvasList?this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e})):1===e.length?(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:e[0],logLevel:i.info,logText:_t.ActionsHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(e[0])):(this.store.setState(t=>Object.assign(Object.assign({},t),{canvases:e,selectedCanvas:null,logLevel:i.info,logText:_t.SelectCanvasHelpText,logVisible:!this._hideLog})),this.onCanvasSelected.trigger(null))}}_t.SelectCanvasHelpText="Please, select a canvas in the list above.",_t.ActionsHelpText="Record with the red button, you can also pause or continue playing the current scene.",_t.PleaseWaitHelpText="Capturing, be patient (this can take up to 3 minutes)...";const yt=(0,dt.createContext)(null);function bt(){const e=(0,dt.useContext)(yt);if(!e)throw new Error("ResultViewContext not provided — ResultViewRoot must be rendered inside ResultViewContext.Provider");return e}function Tt(){const e=bt(),t=pt(e.store),n=(0,dt.useRef)(null),r=(0,dt.useCallback)(e=>{e.preventDefault();const t=e.currentTarget.parentElement,n=t.parentElement;if(!n)return;const r=n.querySelectorAll("li:not(.resultViewMenuSmall)");if("true"===t.getAttribute("open")){t.setAttribute("open","false");for(let e=0;e{e.handleSearchTextChange(t.target.value)},[e]),s=(0,dt.useCallback)(t=>{t.stopPropagation(),e.handleSearchTextChange("")},[e]),o=(0,dt.useCallback)(t=>n=>{n.preventDefault(),e.handleMenuStatusChange(t)},[e]),a=(0,dt.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),e.handleClose()},[e]);return(0,mt.jsxs)("ul",{className:"resultViewMenuComponent",ref:n,children:[(0,mt.jsx)("li",{className:"resultViewMenuOpen resultViewMenuSmall",children:(0,mt.jsx)("a",{href:"#",role:"button",onClick:r,children:"Menu"})}),(0,mt.jsxs)("li",{className:"searchContainer",children:[(0,mt.jsx)("input",{type:"text",placeholder:"Search...",value:t.searchText,commandName:"onSearchTextChanged",commandEventBinding:"change",onChange:i}),(0,mt.jsx)("a",{className:"clearSearch",commandName:"onSearchTextCleared",onClick:s,children:"X"})]}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:0===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCapturesClicked",onClick:o(0),children:"Captures"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:10===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInformationClicked",onClick:o(10),children:"Information"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:20===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onInitStateClicked",onClick:o(20),children:"Init State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:40===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCommandsClicked",onClick:o(40),children:"Commands"+(t.commandCount>0?" ("+t.commandCount+")":"")})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:60===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onCompareClicked",onClick:o(60),children:"Compare"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:30===t.menuStatus?"active":"",href:"#",role:"button",commandName:"onEndStateClicked",onClick:o(30),children:"End State"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{role:"button",commandName:"onCloseClicked",onClick:a,children:"Close"})})]})}function Rt({children:e}){return(0,mt.jsx)("div",{className:"resultViewContentComponent",children:e})}function xt({capture:e,active:t,onCaptureSelected:n,onSaveRequested:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),r()},[r]),s=(0,dt.useCallback)(()=>{n()},[n]),o=new Date(e.startTime).toTimeString().split(" ")[0];return(0,mt.jsxs)("li",{className:t?"active":"",onClick:s,children:[e.endState.VisualState.Attachments?e.endState.VisualState.Attachments.map((e,t)=>(0,mt.jsx)("img",{src:encodeURI(e.src)},t)):(0,mt.jsx)("span",{children:e.endState.VisualState.FrameBufferStatus}),(0,mt.jsxs)("span",{children:[o,(0,mt.jsx)("a",{href:"#",className:"captureListItemSave",commandName:"onSaveRequested",onClick:i})]})]})}function wt({active:e,captures:t,onCaptureSelected:n,onSaveRequested:r,onCaptureLoaded:i}){const s=(0,dt.useRef)(null),o=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault()},[]),l=(0,dt.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),function(e,t){let n=null;if(e&&e.dataTransfer&&e.dataTransfer.files&&(n=e.dataTransfer.files),e&&e.target&&e.target.files&&(n=e.target.files),n&&n.length>0)for(let e=0;e{a.error("Error while reading file: "+r.name+e)},i.onload=e=>{try{const n=JSON.parse(e.target.result);t(n)}catch(e){a.error("Error while reading file: "+r.name+e)}},i.readAsText(r)}}(e.nativeEvent,i)},[i]);return(0,mt.jsxs)("div",{className:"captureListComponent "+(e?"active":""),children:[(0,mt.jsx)("div",{className:"openCaptureFile",ref:s,onDragEnter:o,onDragOver:o,onDrop:l,children:(0,mt.jsx)("span",{children:"Drag files here to open a previously saved capture."})}),(0,mt.jsx)("ul",{children:t.map((e,t)=>(0,mt.jsx)(xt,{capture:e.capture,active:e.active,onCaptureSelected:()=>n(t),onSaveRequested:()=>r(e.capture)},t))})]})}function Ft({children:e}){return(0,mt.jsx)("div",{className:"visualStateListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Nt({item:e,onVisualStateSelected:t}){const n=(0,dt.useRef)(null);(0,dt.useEffect)(()=>{e.active&&n.current&&setTimeout(()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const r=(0,dt.useCallback)(()=>{t()},[t]),i=e.VisualState;return(0,mt.jsxs)("li",{ref:n,className:e.active?"active":"",onClick:r,commandName:"onVisualStateSelected",children:[i.Attachments?i.Attachments.map((e,t)=>e.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{src:encodeURI(e.src)}),i.Attachments.length>1&&(0,mt.jsx)("span",{children:e.attachmentName}),!!e.textureLayer&&(0,mt.jsx)("span",{children:"Layer: "+e.textureLayer}),!!e.textureCubeMapFace&&(0,mt.jsx)("span",{children:e.textureCubeMapFace})]},t):null):(0,mt.jsx)("span",{children:i.FrameBufferStatus}),(0,mt.jsx)("span",{children:i.FrameBuffer?"Frame buffer: "+i.FrameBuffer.__SPECTOR_Object_TAG.id:"Canvas frame buffer"})]})}function Lt({children:e}){return(0,mt.jsx)("div",{className:"commandListComponent",children:(0,mt.jsx)("ul",{children:e})})}function Ot({command:e,onCommandSelected:t,onVertexSelected:n,onFragmentSelected:r,onShaderSelected:i}){var s;const o=(0,dt.useRef)(null),a=e.capture,l=function(e){switch(e){case 50:return"deprecated";case 10:return"unused";case 20:return"disabled";case 30:return"redundant";case 40:return"valid";default:return"unknown"}}(a.status),u=!!a.VisualState;let c="";u&&(c=" drawCall"),e.active&&(c=" active"),(0,dt.useEffect)(()=>{e.active&&o.current&&setTimeout(()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.scrollIntoView({block:"nearest"})},1)},[e.active]);const h=(0,dt.useCallback)(e=>{t()},[t]),d=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==n||n()},[n]),f=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==r||r()},[r]),p=(0,dt.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),null==i||i()},[i]);let m=null;if(u&&"clear"!==a.name)try{const e=a.DrawCall.shaders[0],t=a.DrawCall.shaders[1];m=(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)("a",{href:"#",onClick:d,children:e.name}),(0,mt.jsx)("a",{href:"#",onClick:f,children:t.name})]})}catch(e){}const g=(null===(s=a.shader)||void 0===s?void 0:s.source)?(0,mt.jsx)("a",{href:"#",commandName:"onShaderSourceSelected",onClick:p,children:"Source"}):null;return(0,mt.jsxs)("li",{ref:o,className:c,onClick:h,commandName:"onCommandSelected",children:[a.marker&&(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.marker+" "}),"LOG"===a.name?(0,mt.jsx)("span",{className:`${l} marker important`,style:{fontWeight:1e3},children:a.text+" "}):(0,mt.jsx)("span",{dangerouslySetInnerHTML:{__html:a.text.replace(a.name,`${a.name}`)}}),g,m]})}function It({children:e}){return(0,mt.jsx)("div",{className:"commandDetailComponent",children:e})}function kt({left:e,children:t}){return(0,mt.jsx)("div",{className:e?"informationColumnLeftComponent":"informationColumnRightComponent",children:t})}function Mt({children:e}){return(0,mt.jsx)("div",{className:"jsonContentComponent",children:e})}function Pt(e,t,n,r){return{row:Math.max(0,parseInt(t,10)-1),column:n?Math.max(0,parseInt(n,10)-1):0,text:r.trim()||e,type:e.toLowerCase()}}var Bt,Ut,$t=Object.create,Gt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor,Wt=Object.getOwnPropertyNames,Ht=Object.getPrototypeOf,jt=Object.prototype.hasOwnProperty,zt=e=>{throw TypeError(e)},Xt=(e,t)=>{for(var n in t)Gt(e,n,{get:t[n],enumerable:!0})},Kt=(e,t,n)=>(((e,t)=>{t.has(e)||zt("Cannot access private method")})(e,t),n),Yt=(Bt=e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=/\r\n|[\n\r\u2028\u2029]/;e.codeFrameColumns=function(e,n,r={}){let i=new Proxy({},{get:()=>e=>e}),s=e.split(t),{start:o,end:a,markerLines:l}=function(e,t,n){let r=Object.assign({column:0,line:-1},e.start),i=Object.assign({},r,e.end),{linesAbove:s=2,linesBelow:o=3}=n||{},a=r.line,l=r.column,u=i.line,c=i.column,h=Math.max(a-(s+1),0),d=Math.min(t.length,u+o);-1===a&&(h=0),-1===u&&(d=t.length);let f=u-a,p={};if(f)for(let e=0;e<=f;e++){let n=e+a;if(l)if(0===e){let e=t[n-1].length;p[n]=[l,e-l+1]}else if(e===f)p[n]=[0,c];else{let r=t[n-e].length;p[n]=[0,r]}else p[n]=!0}else p[a]=l===c?!l||[l,0]:[l,c-l];return{start:h,end:d,markerLines:p}}(n,s,r),u=n.start&&"number"==typeof n.start.column,c=String(a).length,h=e.split(t,a).slice(o,a).map((e,t)=>{let n=o+1+t,s=` ${` ${n}`.slice(-c)} |`,a=l[n],u=!l[n+1];if(a){let t="";if(Array.isArray(a)){let n=e.slice(0,Math.max(a[0]-1,0)).replace(/[^\t]/g," "),o=a[1]||1;t=["\n ",i.gutter(s.replace(/\d/g," "))," ",n,i.marker("^").repeat(o)].join(""),u&&r.message&&(t+=" "+i.message(r.message))}return[i.marker(">"),i.gutter(s),e.length>0?` ${e}`:"",t].join("")}return` ${i.gutter(s)}${e.length>0?` ${e}`:""}`}).join("\n");return r.message&&!u&&(h=`${" ".repeat(c+1)}${r.message}\n${h}`),h}},()=>(Ut||Bt((Ut={exports:{}}).exports),Ut.exports));Xt({},{__debug:()=>Hs,check:()=>Vs,doc:()=>vs,format:()=>Gs,formatWithCursor:()=>$s,getSupportInfo:()=>Ws,util:()=>_s,version:()=>As});var qt=(e,t,n,r)=>{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Qt=class{diff(e,t,n={}){let r;"function"==typeof n?(r=n,n={}):"callback"in n&&(r=n.callback);let i=this.castInput(e,n),s=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),a=this.removeEmpty(this.tokenize(s,n));return this.diffWithOptionsObj(o,a,n,r)}diffWithOptionsObj(e,t,n,r){var i;let s=e=>(e=this.postProcess(e,n),r?void setTimeout(function(){r(e)},0):e),o=t.length,a=e.length,l=1,u=o+a;null!=n.maxEditLength&&(u=Math.min(u,n.maxEditLength));let c=null!==(i=n.timeout)&&void 0!==i?i:1/0,h=Date.now()+c,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=a&&f+1>=o)return s(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,g=()=>{for(let r=Math.max(p,-l);r<=Math.min(m,l);r+=2){let i,l=d[r-1],u=d[r+1];l&&(d[r-1]=void 0);let c=!1;if(u){let e=u.oldPos-r;c=u&&0<=e&&e=a&&f+1>=o)return s(this.buildValues(i.lastComponent,t,e))||!0;d[r]=i,i.oldPos+1>=a&&(m=Math.min(m,r-1)),f+1>=o&&(p=Math.max(p,r+1))}else d[r]=void 0}l++};if(r)!function e(){setTimeout(function(){if(l>u||Date.now()>h)return r(void 0);g()||e()},0)}();else for(;l<=u&&Date.now()<=h;){let e=g();if(e)return e}}addToPath(e,t,n,r,i){let s=e.lastComponent;return s&&!i.oneChangePerToken&&s.added===t&&s.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:s.count+1,added:t,removed:n,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:s}}}extractCommon(e,t,n,r,i){let s=t.length,o=n.length,a=e.oldPos,l=a-r,u=0;for(;l+1e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(a,a+e.count));a+=e.count,e.added||(l+=e.count)}}return i}},Zt=new class extends Qt{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Jt(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}function en(e,t){let n;switch(t){case"\n":n=/\n/gu;break;case"\r":n=/\r/gu;break;case"\r\n":n=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let r=e.match(n);return r?r.length:0}var tn="string",nn="array",rn="cursor",sn="indent",on="align",an="trim",ln="group",un="fill",cn="if-break",hn="indent-if-break",dn="line-suffix",fn="line-suffix-boundary",pn="line",mn="label",gn="break-parent",En=new Set([rn,sn,on,an,ln,un,cn,hn,dn,fn,pn,mn,gn]),vn=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},Cn=function(e){if("string"==typeof e)return tn;if(Array.isArray(e))return nn;if(!e)return;let{type:t}=e;return En.has(t)?t:void 0};var Dn=class extends Error{name="InvalidDocError";constructor(e){super(function(e){let t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(Cn(e))throw new Error("doc is valid.");let n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;let r=(e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e))([...En].map(e=>`'${e}'`));return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},Sn=Dn,An={},_n=function(e,t,n,r){let i=[e];for(;i.length>0;){let e=i.pop();if(e===An){n(i.pop());continue}n&&i.push(e,An);let s=Cn(e);if(!s)throw new Sn(e);if(!1!==(null==t?void 0:t(e)))switch(s){case nn:case un:{let t=s===nn?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case cn:i.push(e.flatContents,e.breakContents);break;case ln:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case on:case sn:case hn:case mn:case dn:i.push(e.contents);break;case tn:case rn:case an:case fn:case pn:case gn:break;default:throw new Sn(e)}}};function yn(e,t){if("string"==typeof e)return t(e);let n=new Map;return function e(r){if(n.has(r))return n.get(r);let i=function(n){switch(Cn(n)){case nn:return t(n.map(e));case un:return t({...n,parts:n.parts.map(e)});case cn:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case ln:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case on:case sn:case hn:case mn:case dn:return t({...n,contents:e(n.contents)});case tn:case rn:case an:case fn:case pn:case gn:return t(n);default:throw new Sn(n)}}(r);return n.set(r,i),i}(e)}function bn(e,t,n){let r=n,i=!1;return _n(e,function(e){if(i)return!1;let n=t(e);void 0!==n&&(i=!0,r=n)}),r}function Tn(e){if(e.type===ln&&e.break||e.type===pn&&e.hard||e.type===gn)return!0}function Rn(e){if(e.length>0){let t=vn(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function xn(e){return e.type!==pn||e.hard?e.type===cn?e.flatContents:e:e.soft?"":" "}function wn(e){for(e=[...e];e.length>=2&&vn(!1,e,-2).type===pn&&vn(!1,e,-1).type===gn;)e.length-=2;if(e.length>0){let t=Fn(vn(!1,e,-1));e[e.length-1]=t}return e}function Fn(e){switch(Cn(e)){case sn:case hn:case ln:case dn:case mn:{let t=Fn(e.contents);return{...e,contents:t}}case cn:return{...e,breakContents:Fn(e.breakContents),flatContents:Fn(e.flatContents)};case un:return{...e,parts:wn(e.parts)};case nn:return wn(e);case tn:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return tfunction(e){switch(Cn(e)){case un:if(e.parts.every(e=>""===e))return"";break;case ln:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===ln&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case on:case sn:case hn:case dn:if(!e.contents)return"";break;case cn:if(!e.flatContents&&!e.breakContents)return"";break;case nn:{let t=[];for(let n of e){if(!n)continue;let[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof vn(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case tn:case rn:case an:case fn:case pn:case mn:case gn:break;default:throw new Sn(e)}return e}(e))}(e))}function Ln(e){if(e.type===pn)return!0}function On(e,t){return e.type===mn?{...e,contents:t(e.contents)}:t(e)}var In=()=>{},kn=In,Mn=In,Pn=In;function Bn(e){return kn(e),{type:sn,contents:e}}function Un(e,t){return kn(t),{type:on,contents:t,n:e}}function $n(e,t={}){return kn(e),Mn(t.expandedStates,!0),{type:ln,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Gn(e){return kn(e),{type:dn,contents:e}}var Vn={type:fn},Wn={type:gn},Hn={type:an},jn={type:pn,hard:!0},zn={type:pn,hard:!0,literal:!0},Xn={type:pn},Kn={type:pn,soft:!0},Yn=[jn,Wn],qn=[zn,Wn],Qn={type:rn};function Zn(e,t){kn(e),Mn(t);let n=[];for(let r=0;r0){for(let e=0;e!(function(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}(e)||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e)),nr=/[^\x20-\x7F]/u,rr=function(e){if(!e)return 0;if(!nr.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(let n of e){let e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=tr(e)?1:2)}return t},ir=Symbol("MODE_BREAK"),sr=Symbol("MODE_FLAT"),or=Symbol("cursor"),ar=Symbol("DOC_FILL_PRINTED_LENGTH");function lr(e,t){return cr(e,{type:"indent"},t)}function ur(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?cr(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:cr(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function cr(e,t,n){let r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t],i="",s=0,o=0,a=0;for(let e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function hr(e){let t=0,n=0,r=e.length;e:for(;r--;){let i=e[r];if(i!==or)for(let n=i.length-1;n>=0;n--){let s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(or);return t}function dr(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length,a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}let{mode:e,doc:u}=a.pop(),c=Cn(u);switch(c){case tn:l.push(u),n-=rr(u);break;case nn:case un:{let t=c===nn?u:u.parts,n=u[ar]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case sn:case on:case hn:case mn:a.push({mode:e,doc:u.contents});break;case an:n+=hr(l);break;case ln:{if(s&&u.break)return!1;let t=u.break?ir:e,n=u.expandedStates&&t===ir?vn(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case cn:{let t=(u.groupId?i[u.groupId]||sr:e)===ir?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case pn:if(e===ir||u.hard)return!0;u.soft||(l.push(" "),n--);break;case dn:r=!0;break;case fn:if(r)return!1}}return!1}function fr(e,t){let n={},r=t.printWidth,i=Jt(t.endOfLine),s=0,o=[{ind:{value:"",length:0,queue:[]},mode:ir,doc:e}],a=[],l=!1,u=[],c=0;for(function(e){let t=new Set,n=[];_n(e,function(e){if(e.type===gn&&Rn(n),e.type===ln){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===ln&&n.pop().break&&Rn(n)},!0)}(e);o.length>0;){let{ind:e,mode:h,doc:d}=o.pop();switch(Cn(d)){case tn:{let e="\n"!==i?qt(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=rr(e));break}case nn:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case rn:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(or),c++;break;case sn:o.push({ind:lr(e,t),mode:h,doc:d.contents});break;case on:o.push({ind:ur(e,d.n,t),mode:h,doc:d.contents});break;case an:s-=hr(a);break;case ln:switch(h){case sr:if(!l){o.push({ind:e,mode:d.break?ir:sr,doc:d.contents});break}case ir:{l=!1;let t={ind:e,mode:sr,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&dr(t,o,i,a,n))o.push(t);else if(d.expandedStates){let t=vn(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:ir,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:ir,doc:t});break}{let t=d.expandedStates[r],s={ind:e,mode:sr,doc:t};if(dr(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:ir,doc:d.contents});break}}d.id&&(n[d.id]=vn(!1,o,-1).mode);break;case un:{let t=r-s,i=d[ar]??0,{parts:a}=d,l=a.length-i;if(0===l)break;let c=a[i+0],f=a[i+1],p={ind:e,mode:sr,doc:c},m={ind:e,mode:ir,doc:c},g=dr(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}let E={ind:e,mode:sr,doc:f},v={ind:e,mode:ir,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}let C=a[i+2],D={ind:e,mode:h,doc:{...d,[ar]:i+2}};dr({ind:e,mode:sr,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case cn:case hn:{let t=d.groupId?n[d.groupId]:h;if(t===ir){let t=d.type===cn?d.breakContents:d.negate?d.contents:Bn(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===sr){let t=d.type===cn?d.flatContents:d.negate?Bn(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case dn:u.push({ind:e,mode:h,doc:d.contents});break;case fn:u.length>0&&o.push({ind:e,mode:h,doc:jn});break;case pn:switch(h){case sr:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case ir:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=hr(a),a.push(i+e.value),s=e.length)}break;case mn:o.push({ind:e,mode:h,doc:d.contents});break;case gn:break;default:throw new Sn(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}let h=a.indexOf(or);if(-1!==h){let e=a.indexOf(or,h+1);if(-1===e)return{formatted:a.filter(e=>e!==or).join("")};let t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}var pr,mr,gr,Er=function(e,t,n=0){let r=0;for(let i=n;i=0;n-=2)if(!Array.isArray(t[n])&&--e<0)return n;return-1},gr=function*(){let{stack:e}=this;for(let t=e.length-3;t>=0;t-=2){let n=e[t];Array.isArray(n)||(yield n)}};var vr=class{constructor(e){((e,t)=>{t.has(e)?zt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,void 0)})(this,pr),this.stack=[e]}get key(){let{stack:e,siblings:t}=this;return vn(!1,e,null===t?-2:-4)??null}get index(){return null===this.siblings?null:vn(!1,this.stack,-2)}get node(){return vn(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return null!==this.siblings}get siblings(){let{stack:e}=this,t=vn(!1,e,-3);return Array.isArray(t)?t:null}get next(){let{siblings:e}=this;return null===e?null:e[this.index+1]}get previous(){let{siblings:e}=this;return null===e?null:e[this.index-1]}get isFirst(){return 0===this.index}get isLast(){let{siblings:e,index:t}=this;return null!==e&&t===e.length-1}get isRoot(){return 1===this.stack.length}get root(){return this.stack[0]}get ancestors(){return[...Kt(this,pr,gr).call(this)]}getName(){let{stack:e}=this,{length:t}=e;return t>1?vn(!1,e,-2):null}getValue(){return vn(!1,this.stack,-1)}getNode(e=0){let t=Kt(this,pr,mr).call(this,e);return-1===t?null:this.stack[t]}getParentNode(e=0){return this.getNode(e+1)}call(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{return e(this)}finally{n.length=r}}callParent(e,t=0){let n=Kt(this,pr,mr).call(this,t+1),r=this.stack.splice(n+1);try{return e(this)}finally{this.stack.push(...r)}}each(e,...t){let{stack:n}=this,{length:r}=n,i=vn(!1,n,-1);for(let e of t)i=i[e],n.push(e,i);try{for(let t=0;t{n[r]=e(t,r,i)},...t),n}match(...e){let t=this.stack.length-1,n=null,r=this.stack[t--];for(let i of e){if(void 0===r)return!1;let e=null;if("number"==typeof n&&(e=n,n=this.stack[t--],r=this.stack[t--]),i&&!i(r,n,e))return!1;n=this.stack[t--],r=this.stack[t--]}return!0}findAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return t}hasAncestor(e){for(let t of Kt(this,pr,gr).call(this))if(e(t))return!0;return!1}},Cr=new Proxy(()=>{},{get:()=>Cr}),Dr=Cr;function*Sr(e,t){let{getVisitorKeys:n,filter:r=()=>!0}=t,i=e=>function(e){return null!==e&&"object"==typeof e}(e)&&r(e);for(let t of n(e)){let n=e[t];if(Array.isArray(n))for(let e of n)i(e)&&(yield e);else i(n)&&(yield n)}}function Ar(e){return(t,n,r)=>{let i=!(null==r||!r.backwards);if(!1===n)return!1;let{length:s}=t,o=n;for(;o>=0&&oObject.keys(e).filter(e=>!wr.has(e)),Nr=function(e){return e?t=>e(t,wr):Fr};function Lr(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=function(e){let t=e.type||e.kind||"(unknown type)",n=String(e.name||e.id&&("object"==typeof e.id?e.id.name:e.id)||e.key&&("object"==typeof e.key?e.key.name:e.key)||e.value&&("object"==typeof e.value?"":String(e.value))||e.operator||"");return n.length>20&&(n=n.slice(0,19)+"…"),t+(n?" "+n:"")}(e)}function Or(e,t){t.leading=!0,t.trailing=!1,Lr(e,t)}function Ir(e,t,n){t.leading=!1,t.trailing=!1,n&&(t.marker=n),Lr(e,t)}function kr(e,t){t.leading=!1,t.trailing=!0,Lr(e,t)}var Mr=new WeakMap;function Pr(e,t){if(Mr.has(e))return Mr.get(e);let{printer:{getCommentChildNodes:n,canAttachComment:r,getVisitorKeys:i},locStart:s,locEnd:o}=t;if(!r)return[];let a=((null==n?void 0:n(e,t))??[...Sr(e,{getVisitorKeys:Nr(i)})]).flatMap(e=>r(e)?[e]:Pr(e,t));return a.sort((e,t)=>s(e)-s(t)||o(e)-o(t)),Mr.set(e,a),a}function Br(e,t,n,r){let i,s,{locStart:o,locEnd:a}=n,l=o(t),u=a(t),c=Pr(e,n),h=0,d=c.length;for(;h>1,r=c[e],f=o(r),p=a(r);if(f<=l&&u<=p)return Br(r,t,n,r);if(p<=l)i=r,h=e+1;else{if(!(u<=f))throw new Error("Comment location overlaps with node location");s=r,d=e}}if("TemplateLiteral"===(null==r?void 0:r.type)){let{quasis:e}=r,o=Hr(e,t,n);i&&Hr(e,i,n)!==o&&(i=null),s&&Hr(e,s,n)!==o&&(s=null)}return{enclosingNode:r,precedingNode:i,followingNode:s}}var Ur=()=>!1,$r=e=>!/[\S\n\u2028\u2029]/u.test(e);function Gr(e,t,n,r){let{comment:i,precedingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=o(i);if(s)for(let t=r-1;t>=0;t--){let{comment:r,precedingNode:i}=n[t];if(i!==s||!$r(e.slice(a(r),l)))break;l=o(r)}return xr(e,l,{backwards:!0})}function Vr(e,t,n,r){let{comment:i,followingNode:s}=n[r],{locStart:o,locEnd:a}=t,l=a(i);if(s)for(let t=r+1;t0;--s){let{comment:i,precedingNode:u,followingNode:c}=e[s-1];Dr.strictEqual(u,o),Dr.strictEqual(c,a);let h=t.originalText.slice(t.locEnd(i),l);if(!((null==(r=(n=t.printer).isGap)?void 0:r.call(n,h,t))??/^[\s(]*$/u.test(h)))break;l=t.locStart(i)}for(let[t,{comment:n}]of e.entries())t1&&e.comments.sort((e,n)=>t.locStart(e)-t.locStart(n));e.length=0}function Hr(e,t,n){let r=n.locStart(t)-1;for(let t=1;t"string"==typeof e||"function"==typeof e,choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>"string"==typeof e||"object"==typeof e,cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:"Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.",cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:"Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.",cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function qr({plugins:e=[],showDeprecated:t=!1}={}){let n=e.flatMap(e=>e.languages??[]),r=[];for(let i of function(e){let t=[];for(let[n,r]of Object.entries(e)){let e={name:n,...r};Array.isArray(e.default)&&(e.default=vn(!1,e.default,-1).value),t.push(e)}return t}(Object.assign({},...e.map(({options:e})=>e),Yr)))!t&&i.deprecated||(Array.isArray(i.choices)&&(t||(i.choices=i.choices.filter(e=>!e.deprecated)),"parser"===i.name&&(i.choices=[...i.choices,...Qr(i.choices,n,e)])),i.pluginDefaults=Object.fromEntries(e.filter(e=>{var t;return void 0!==(null==(t=e.defaultOptions)?void 0:t[i.name])}).map(e=>[e.name,e.defaultOptions[i.name]])),r.push(i));return{languages:n,options:r}}function*Qr(e,t,n){let r=new Set(e.map(e=>e.value));for(let e of t)if(e.parsers)for(let t of e.parsers)if(!r.has(t)){r.add(t);let i=n.find(e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t)),s=e.name;null!=i&&i.name&&(s+=` (plugin: ${i.name})`),yield{value:t,description:s}}}var Zr,Jr,ei,ti,ni,ri="windows"===(null==(Zr=globalThis.Deno)?void 0:Zr.build.os)||(null==(ei=null==(Jr=globalThis.navigator)?void 0:Jr.platform)?void 0:ei.startsWith("Win"))||(null==(ni=null==(ti=globalThis.process)?void 0:ti.platform)?void 0:ni.startsWith("win"))||!1;function ii(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function si(e,t){if(!t)return;let n=(e=>String(e).split(/[/\\]/u).pop())(t).toLowerCase();return e.find(({filenames:e})=>null==e?void 0:e.some(e=>e.toLowerCase()===n))??e.find(({extensions:e})=>null==e?void 0:e.some(e=>n.endsWith(e)))}function oi(e,t){if(t){if(String(t).startsWith("file:"))try{t=function(e){return ri?function(e){e=ii(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return""!==e.hostname&&(t=`\\\\${e.hostname}${t}`),t}(e):function(e){return e=ii(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}(e)}(t)}catch{return}if("string"==typeof t)return e.find(({isSupported:e})=>null==e?void 0:e({filepath:t}))}}var ai=function(e,t){let n=((e,t)=>{if(!e||null!=t)return t.toReversed||!Array.isArray(t)?t.toReversed():[...t].reverse()})(!1,e.plugins).flatMap(e=>e.languages??[]),r=function(e,t){if(t)return e.find(({name:e})=>e.toLowerCase()===t)??e.find(({aliases:e})=>null==e?void 0:e.includes(t))??e.find(({extensions:e})=>null==e?void 0:e.includes(`.${t}`))}(n,t.language)??si(n,t.physicalFile)??si(n,t.file)??oi(n,t.physicalFile)??oi(n,t.file)??void t.physicalFile;return null==r?void 0:r.parsers[0]},li={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(e=>li.value(e)).join(", ")}]`;let t=Object.keys(e);return 0===t.length?"{}":`{ ${t.map(t=>`${li.key(t)}: ${li.value(e[t])}`).join(", ")} }`},pair:({key:e,value:t})=>li.value({[e]:t})},ui=new Proxy(String,{get:()=>ui}),ci=ui,hi=Symbol.for("vnopts.VALUE_NOT_EXIST"),di=Symbol.for("vnopts.VALUE_UNCHANGED"),fi=" ".repeat(2);function pi(e,t,n,r){return[`Invalid ${ci.red(r.key(e))} value.`,`Expected ${ci.blue(n)},`,`but received ${t===hi?ci.gray("nothing"):ci.red(r.value(t))}.`].join(" ")}function mi({text:e,list:t},n){let r=[];return e&&r.push(`- ${ci.blue(e)}`),t&&r.push([`- ${ci.blue(t.title)}:`].concat(t.values.map(e=>mi(e,n-fi.length).replace(/^|\n/g,`$&${fi}`))).join("\n")),gi(r,n)}function gi(e,t){if(1===e.length)return e[0];let[n,r]=e,[i,s]=e.map(e=>e.split("\n",1)[0].length);return i>t&&i>s?r:n}var Ei=[],vi=[],Ci=(e,t,{descriptor:n,logger:r,schemas:i})=>{let s=[`Ignored unknown option ${ci.yellow(n.pair({key:e,value:t}))}.`],o=Object.keys(i).sort().find(t=>function(e,t){if(e===t)return 0;let n=e;e.length>t.length&&(e=t,t=n);let r=e.length,i=t.length;for(;r>0&&e.charCodeAt(~-r)===t.charCodeAt(~-i);)r--,i--;let s=0;for(;sa?u>a?a+1:u:u>l?l+1:u;return a}(e,t)<3);o&&s.push(`Did you mean ${ci.blue(n.key(o))}?`),r.warn(s.join(" "))},Di=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"],Si=class{static create(e){return function(e,t){let n=new e(t),r=Object.create(n);for(let e of Di)e in t&&(r[e]=Ai(t[e],n,Si.prototype[e].length));return r}(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,t){return!1}deprecated(e,t){return!1}forward(e,t){}redirect(e,t){}overlap(e,t,n){return e}preprocess(e,t){return e}postprocess(e,t){return di}};function Ai(e,t,n){return"function"==typeof e?(...r)=>e(...r.slice(0,n-1),t,...r.slice(n-1)):()=>e}var _i=class extends Si{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},yi=class extends Si{expected(){return"anything"}validate(){return!0}},bi=class extends Si{constructor({valueSchema:e,name:t=e.name,...n}){super({...n,name:t}),this._valueSchema=e}expected(e){let{text:t,list:n}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:t&&`an array of ${t}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(e,t){if(!Array.isArray(e))return!1;let n=[];for(let r of e){let e=t.normalizeValidateResult(this._valueSchema.validate(r,t),r);!0!==e&&n.push(e.value)}return 0===n.length||{value:n}}deprecated(e,t){let n=[];for(let r of e){let e=t.normalizeDeprecatedResult(this._valueSchema.deprecated(r,t),r);!1!==e&&n.push(...e.map(({value:e})=>({value:[e]})))}return n}forward(e,t){let n=[];for(let r of e){let e=t.normalizeForwardResult(this._valueSchema.forward(r,t),r);n.push(...e.map(Ti))}return n}redirect(e,t){let n=[],r=[];for(let i of e){let e=t.normalizeRedirectResult(this._valueSchema.redirect(i,t),i);"remain"in e&&n.push(e.remain),r.push(...e.redirect.map(Ti))}return 0===n.length?{redirect:r}:{redirect:r,remain:n}}overlap(e,t){return e.concat(t)}};function Ti({from:e,to:t}){return{from:[e],to:t}}var Ri=class extends Si{expected(){return"true or false"}validate(e){return"boolean"==typeof e}};function xi(e,t){let n=Object.create(null);for(let r of e){let e=r[t];if(n[e])throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n[e]=r}return n}function wi(e,t){if(e===t)return 0;let n=typeof e,r=typeof t,i=["undefined","object","boolean","number","string"];return n!==r?i.indexOf(n)-i.indexOf(r):"string"!==n?Number(e)-Number(t):e.localeCompare(t)}function Fi(e){return void 0===e?{}:e}function Ni(e){if("string"==typeof e)return{text:e};let{text:t,list:n}=e;return function(e){if(!e)throw new Error("Unexpected `expected` result, there should be at least one field.")}(void 0!==(t||n)),n?{text:t,list:{title:n.title,values:n.values.map(Ni)}}:{text:t}}function Li(e,t){return!0===e||(!1===e?{value:t}:e)}function Oi(e,t,n=!1){return!1!==e&&(!0===e?!!n||[{value:t}]:"value"in e?[e]:0!==e.length&&e)}function Ii(e,t){return"string"==typeof e||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function ki(e,t){return void 0===e?[]:Array.isArray(e)?e.map(e=>Ii(e,t)):[Ii(e,t)]}function Mi(e,t){let n=ki("object"==typeof e&&"redirect"in e?e.redirect:e,t);return 0===n.length?{remain:t,redirect:n}:"object"==typeof e&&"remain"in e?{remain:e.remain,redirect:n}:{redirect:n}}var Pi,Bi=class extends Si{constructor(e){super(e),this._choices=function(e,t){let n=new Map;for(let r of e){let e=r[t];if(n.has(e))throw new Error(`Duplicate ${t} ${JSON.stringify(e)}`);n.set(e,r)}return n}(e.choices.map(e=>e&&"object"==typeof e?e:{value:e}),"value")}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(e=>this._choices.get(e)).filter(({hidden:e})=>!e).map(e=>e.value).sort(wi).map(e.value),n=t.slice(0,-2),r=t.slice(-2);return{text:n.concat(r.join(" or ")).join(", "),list:{title:"one of the following values",values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return!(!t||!t.deprecated)&&{value:e}}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},Ui=class extends Si{expected(){return"a number"}validate(e,t){return"number"==typeof e}},$i=class extends Ui{expected(){return"an integer"}validate(e,t){return!0===t.normalizeValidateResult(super.validate(e,t),e)&&function(e){return e===Math.floor(e)}(e)}},Gi=class extends Si{expected(){return"a string"}validate(e){return"string"==typeof e}},Vi=li,Wi=Ci,Hi=(e,t,n)=>{let{text:r,list:i}=n.normalizeExpectedResult(n.schemas[e].expected(n)),s=[];return r&&s.push(pi(e,t,r,n.descriptor)),i&&s.push([pi(e,t,i.title,n.descriptor)].concat(i.values.map(e=>mi(e,n.loggerPrintWidth))).join("\n")),gi(s,n.loggerPrintWidth)},ji=(e,t,{descriptor:n})=>{let r=[`${ci.yellow("string"==typeof e?n.key(e):n.pair(e))} is deprecated`];return t&&r.push(`we now treat it as ${ci.blue("string"==typeof t?n.key(t):n.pair(t))}`),r.join("; ")+"."},zi=class{constructor(e,t){let{logger:n=console,loggerPrintWidth:r=80,descriptor:i=Vi,unknown:s=Wi,invalid:o=Hi,deprecated:a=ji,missing:l=()=>!1,required:u=()=>!1,preprocess:c=e=>e,postprocess:h=()=>di}=t||{};this._utils={descriptor:i,logger:n||{warn:()=>{}},loggerPrintWidth:r,schemas:xi(e,"name"),normalizeDefaultResult:Fi,normalizeExpectedResult:Ni,normalizeDeprecatedResult:Oi,normalizeForwardResult:ki,normalizeRedirectResult:Mi,normalizeValidateResult:Li},this._unknownHandler=s,this._invalidHandler=function(e){return(...t)=>{let n=e(...t);return"string"==typeof n?new Error(n):n}}(o),this._deprecatedHandler=a,this._identifyMissing=(e,t)=>!(e in t)||l(e,t),this._identifyRequired=u,this._preprocess=c,this._postprocess=h,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=function(){let e=Object.create(null);return t=>{let n=JSON.stringify(t);return!!e[n]||(e[n]=!0,!1)}}()}normalize(e){let t={},n=[this._preprocess(e,this._utils)],r=()=>{for(;0!==n.length;){let e=n.shift(),r=this._applyNormalization(e,t);n.push(...r)}};r();for(let e of Object.keys(this._utils.schemas)){let r=this._utils.schemas[e];if(!(e in t)){let t=Fi(r.default(this._utils));"value"in t&&n.push({[e]:t.value})}}r();for(let e of Object.keys(this._utils.schemas)){if(!(e in t))continue;let n=this._utils.schemas[e],r=t[e],i=n.postprocess(r,this._utils);i!==di&&(this._applyValidation(i,e,n),t[e]=i)}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let n=[],{knownKeys:r,unknownKeys:i}=this._partitionOptionKeys(e);for(let i of r){let r=this._utils.schemas[i],s=r.preprocess(e[i],this._utils);this._applyValidation(s,i,r);let o=({from:e,to:t})=>{n.push("string"==typeof t?{[t]:e}:{[t.key]:t.value})},a=({value:e,redirectTo:t})=>{let n=Oi(r.deprecated(e,this._utils),s,!0);if(!1!==n)if(!0===n)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,t,this._utils));else for(let{value:e}of n){let n={key:i,value:e};if(!this._hasDeprecationWarned(n)){let r="string"==typeof t?{key:t,value:e}:t;this._utils.logger.warn(this._deprecatedHandler(n,r,this._utils))}}};ki(r.forward(s,this._utils),s).forEach(o);let l=Mi(r.redirect(s,this._utils),s);if(l.redirect.forEach(o),"remain"in l){let e=l.remain;t[i]=i in t?r.overlap(t[i],e,this._utils):e,a({value:e})}for(let{from:e,to:t}of l.redirect)a({value:e,redirectTo:t})}for(let r of i){let i=e[r];this._applyUnknownHandler(r,i,t,(e,t)=>{n.push({[e]:t})})}return n}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,hi,this._utils)}_partitionOptionKeys(e){let[t,n]=function(e,t){let n=[],r=[];for(let i of e)t(i)?n.push(i):r.push(i);return[n,r]}(Object.keys(e).filter(t=>!this._identifyMissing(t,e)),e=>e in this._utils.schemas);return{knownKeys:t,unknownKeys:n}}_applyValidation(e,t,n){let r=Li(n.validate(e,this._utils),e);if(!0!==r)throw this._invalidHandler(t,r.value,this._utils)}_applyUnknownHandler(e,t,n,r){let i=this._unknownHandler(e,t,this._utils);if(i)for(let e of Object.keys(i)){if(this._identifyMissing(e,i))continue;let t=i[e];e in this._utils.schemas?r(e,t):n[e]=t}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==di){if(t.delete)for(let n of t.delete)delete e[n];if(t.override){let{knownKeys:n,unknownKeys:r}=this._partitionOptionKeys(t.override);for(let r of n){let n=t.override[r];this._applyValidation(n,r,this._utils.schemas[r]),e[r]=n}for(let n of r){let r=t.override[n];this._applyUnknownHandler(n,r,e,(t,n)=>{let r=this._utils.schemas[t];this._applyValidation(n,t,r),e[t]=n})}}}}};function Xi(e,{isCLI:t,optionInfos:n,FlagSchema:r}){let i,{name:s}=e,o={name:s},a={};switch(e.type){case"int":i=$i,t&&(o.preprocess=Number);break;case"string":case"path":i=Gi;break;case"choice":i=Bi,o.choices=e.choices.map(t=>null!=t&&t.redirect?{...t,redirect:{to:{key:e.name,value:t.redirect}}}:t);break;case"boolean":i=Ri;break;case"flag":i=r,o.flags=n.flatMap(e=>[e.alias,e.description&&e.name,e.oppositeDescription&&`no-${e.name}`].filter(Boolean));break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?o.validate=(t,n,r)=>e.exception(t)||n.validate(t,r):o.validate=(e,t,n)=>void 0===e||t.validate(e,n),e.redirect&&(a.redirect=t=>t?{to:"string"==typeof e.redirect?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(a.deprecated=!0),t&&!e.array){let e=o.preprocess||(e=>e);o.preprocess=(t,n,r)=>n.preprocess(e(Array.isArray(t)?vn(!1,t,-1):t),r)}return e.array?bi.create({...t?{preprocess:e=>Array.isArray(e)?e:[e]}:{},...a,valueSchema:i.create(o)}):i.create({...o,...a})}var Ki=(e,t,n)=>{if(!e||null!=t){if(t.findLast)return t.findLast(n);for(let e=t.length-1;e>=0;e--){let r=t[e];if(n(r,e,t))return r}}};function Yi(e,t){if(!t)throw new Error("parserName is required.");let n=Ki(!1,e,e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t));if(n)return n;let r=`Couldn't resolve parser "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}function qi({plugins:e,parser:t}){return Qi(Yi(e,t),t)}function Qi(e,t){let n=e.parsers[t];return"function"==typeof n?n():n}var Zi={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null},Ji=async function(e,t={}){var n;let r={...e};if(!r.parser){if(!r.filepath)throw new Kr("No parser and no file path given, couldn't infer a parser.");if(r.parser=ai(r,{physicalFile:r.filepath}),!r.parser)throw new Kr(`No parser could be inferred for file "${r.filepath}".`)}let i=qr({plugins:e.plugins,showDeprecated:!0}).options,s={...Zi,...Object.fromEntries(i.filter(e=>void 0!==e.default).map(e=>[e.name,e.default]))},o=Yi(r.plugins,r.parser),a=await Qi(o,r.parser);r.astFormat=a.astFormat,r.locEnd=a.locEnd,r.locStart=a.locStart;let l=null!=(n=o.printers)&&n[a.astFormat]?o:function(e,t){if(!t)throw new Error("astFormat is required.");let n=Ki(!1,e,e=>e.printers&&Object.prototype.hasOwnProperty.call(e.printers,t));if(n)return n;let r=`Couldn't find plugin for AST format "${t}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Xr(r)}(r.plugins,a.astFormat),u=await function(e,t){let n=e.printers[t];return"function"==typeof n?n():n}(l,a.astFormat);r.printer=u;let c={...s,...l.defaultOptions?Object.fromEntries(Object.entries(l.defaultOptions).filter(([,e])=>void 0!==e)):{}};for(let[e,t]of Object.entries(c))(null===r[e]||void 0===r[e])&&(r[e]=t);return"json"===r.parser&&(r.trailingComma="none"),function(e,t,{logger:n=!1,isCLI:r=!1,passThrough:i=!1,FlagSchema:s,descriptor:o}={}){if(r){if(!s)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=li;let a=i?Array.isArray(i)?(e,t)=>i.includes(e)?{[e]:t}:void 0:(e,t)=>({[e]:t}):(e,t,n)=>{let{_:r,...i}=n.schemas;return Ci(e,t,{...n,schemas:i})},l=function(e,{isCLI:t,FlagSchema:n}){let r=[];t&&r.push(yi.create({name:"_"}));for(let i of e)r.push(Xi(i,{isCLI:t,optionInfos:e,FlagSchema:n})),i.alias&&t&&r.push(_i.create({name:i.alias,sourceName:i.name}));return r}(t,{isCLI:r,FlagSchema:s}),u=new zi(l,{logger:n,unknown:a,descriptor:o}),c=!1!==n;c&&Pi&&(u._hasDeprecationWarned=Pi);let h=u.normalize(e);return c&&(Pi=u._hasDeprecationWarned),h}(r,i,{passThrough:Object.keys(Zi),...t})},es=((e,t,n)=>(n=null!=e?$t(Ht(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of Wt(t))!jt.call(e,n)&&void 0!==n&&Gt(e,n,{get:()=>t[n],enumerable:!(r=Vt(t,n))||r.enumerable});return e})(Gt(n,"default",{value:e,enumerable:!0}),e)))(Yt()),ts=async function(e,t){let n,r=await qi(t),i=r.preprocess?r.preprocess(e,t):e;t.originalText=i;try{n=await r.parse(i,t,t)}catch(t){!function(e,t){let{loc:n}=e;if(n){let r=(0,es.codeFrameColumns)(t,n,{highlightCode:!0});throw e.message+="\n"+r,e.codeFrame=r,e}throw e}(t,e)}return{text:i,ast:n}};async function ns(e,t){({ast:e}=await is(e,t));let n=new Map,r=new vr(e),i=()=>{},s=new Map;await async function(e,t,n,r,i){let{embeddedLanguageFormatting:s,printer:{embed:o,hasPrettierIgnore:a=()=>!1,getVisitorKeys:l}}=n;if(!o||"auto"!==s)return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let u=Nr(o.getVisitorKeys??l),c=[];!function t(){let{node:r}=e;if(null===r||"object"!=typeof r||a(e))return;for(let n of u(r))Array.isArray(r[n])?e.each(t,n):e.call(t,n);let s=o(e,n);if(s){if("function"==typeof s)return void c.push({print:s,node:r,pathStack:[...e.stack]});i.set(r,s)}}();let h=e.stack;for(let{print:r,node:s,pathStack:o}of c)try{e.stack=o;let a=await r(d,t,e,n);a&&i.set(s,a)}catch(e){if(globalThis.PRETTIER_DEBUG)throw e}function d(e,t){return async function(e,t,n,r){let i=await Ji({...n,...t,parentParser:n.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:s}=await ts(e,i);return Nn(await r(s,i))}(e,t,n,r)}e.stack=h}(r,a,t,ns,s);let o=await rs(r,t,a,void 0,s);if(function(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:n}=e;for(let e of t){if(!e.printed&&!n.has(e))throw new Error('Comment "'+e.value.trim()+'" was not printed. Please report this error!');delete e.printed}}(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return[Qn,o];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[o,Qn]}return o;function a(e,t){return void 0===e||e===r?l(t):Array.isArray(e)?r.call(()=>l(t),...e):r.call(()=>l(t),e)}function l(e){i(r);let o=r.node;if(null==o)return"";let l=o&&"object"==typeof o&&void 0===e;if(l&&n.has(o))return n.get(o);let u=rs(r,t,a,e,s);return l&&n.set(o,u),u}}function rs(e,t,n,r,i){var s;let o,{node:a}=e,{printer:l}=t;switch(o=null!=(s=l.hasPrettierIgnore)&&s.call(l,e)?function(e,t){let{originalText:n,[Symbol.for("comments")]:r,locStart:i,locEnd:s,[Symbol.for("printedComments")]:o}=t,{node:a}=e,l=i(a),u=s(a);for(let e of r)i(e)>=l&&s(e)<=u&&o.add(e);return n.slice(l,u)}(e,t):i.has(a)?i.get(a):l.print(e,t,n,r),a){case t.cursorNode:o=On(o,e=>[Qn,e,Qn]);break;case t.nodeBeforeCursor:o=On(o,e=>[e,Qn]);break;case t.nodeAfterCursor:o=On(o,e=>[Qn,e])}return l.printComment&&(!l.willPrintOwnComments||!l.willPrintOwnComments(e,t))&&(o=function(e,t,n){let{leading:r,trailing:i}=function(e,t){let n=e.node;if(!n)return{};let r=t[Symbol.for("printedComments")];if(0===(n.comments||[]).filter(e=>!r.has(e)).length)return{leading:"",trailing:""};let i,s=[],o=[];return e.each(()=>{let n=e.node;if(null!=r&&r.has(n))return;let{leading:a,trailing:l}=n;a?s.push(function(e,t){var n;let r=e.node,i=[zr(e,t)],{printer:s,originalText:o,locStart:a,locEnd:l}=t;if(null==(n=s.isBlockComment)?void 0:n.call(s,r)){let e=xr(o,l(r))?xr(o,a(r),{backwards:!0})?Yn:Xn:" ";i.push(e)}else i.push(Yn);let u=Rr(o,yr(o,l(r)));return!1!==u&&xr(o,u)&&i.push(Yn),i}(e,t)):l&&(i=function(e,t,n){var r;let i=e.node,s=zr(e,t),{printer:o,originalText:a,locStart:l}=t,u=null==(r=o.isBlockComment)?void 0:r.call(o,i);if(null!=n&&n.hasLineSuffix&&(null==n||!n.isBlock)||xr(a,l(i),{backwards:!0})){let e=jr(a,l(i));return{doc:Gn([Yn,e?Yn:"",s]),isBlock:u,hasLineSuffix:!0}}return!u||null!=n&&n.hasLineSuffix?{doc:[Gn([" ",s]),Wn],isBlock:u,hasLineSuffix:!0}:{doc:[" ",s],isBlock:u,hasLineSuffix:!1}}(e,t,i),o.push(i.doc))},"comments"),{leading:s,trailing:o}}(e,n);return r||i?On(t,e=>[r,e,i]):t}(e,o,t)),o}async function is(e,t){let n=e.comments??[];t[Symbol.for("comments")]=n,t[Symbol.for("printedComments")]=new Set,function(e,t){let{comments:n}=e;if(delete e.comments,!function(e){return Array.isArray(e)&&e.length>0}(n)||!t.printer.canAttachComment)return;let r=[],{printer:{experimentalFeatures:{avoidAstMutation:i=!1}={},handleComments:s={}},originalText:o}=t,{ownLine:a=Ur,endOfLine:l=Ur,remaining:u=Ur}=s,c=n.map((r,i)=>({...Br(e,r,t),comment:r,text:o,options:t,ast:e,isLastComment:n.length-1===i}));for(let[e,t]of c.entries()){let n,{comment:s,precedingNode:o,enclosingNode:h,followingNode:d,text:f,options:p,ast:m,isLastComment:g}=t;if(i?n=[t]:(s.enclosingNode=h,s.precedingNode=o,s.followingNode=d,n=[s,f,p,m,g]),Gr(f,p,c,e))s.placement="ownLine",a(...n)||(d?Or(d,s):o?kr(o,s):Ir(h||m,s));else if(Vr(f,p,c,e))s.placement="endOfLine",l(...n)||(o?kr(o,s):d?Or(d,s):Ir(h||m,s));else if(s.placement="remaining",!u(...n))if(o&&d){let e=r.length;e>0&&r[e-1].followingNode!==d&&Wr(r,p),r.push(t)}else o?kr(o,s):d?Or(d,s):Ir(h||m,s)}if(Wr(r,t),!i)for(let e of n)delete e.precedingNode,delete e.enclosingNode,delete e.followingNode}(e,t);let{printer:{preprocess:r}}=t;return{ast:e=r?await r(e,t):e,comments:n}}var ss=function(e,t){let{cursorOffset:n,locStart:r,locEnd:i}=t,s=Nr(t.printer.getVisitorKeys),o=e=>r(e)<=n&&i(e)>=n,a=e,l=[e];for(let t of function*(e,t){let n=[e];for(let e=0;e0&&(void 0===u||void 0===c);){a=l.pop();let e=void 0!==u,t=void 0!==c;for(let o of Sr(a,{getVisitorKeys:s})){if(!e){let e=i(o);e<=n&&e>h&&(u=o,h=e)}if(!t){let e=r(o);e>=n&&e{if(!e||null!=t){if(t.findLastIndex)return t.findLastIndex(n);for(let e=t.length-1;e>=0;e--)if(n(t[e],e,t))return e;return-1}})(!1,e,e=>"Program"!==e.type&&"File"!==e.type);return-1===t?e:e.slice(0,t+1)}function as(e,t,n,r,i=[],s){let{locStart:o,locEnd:a}=n,l=o(e),u=a(e);if(!(t>u||t=0&&(t={...t,...ss(r,t)});let s=await ns(r,t);n>0&&(s=Jn([Yn,s],n,t.tabWidth));let o=fr(s,t);if(n>0){let e=o.formatted.trim();void 0!==o.cursorNodeStart&&(o.cursorNodeStart-=o.formatted.indexOf(e),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>e.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=e+Jt(t.endOfLine)}let a=t[Symbol.for("comments")];if(t.cursorOffset>=0){let e,n,r,s;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&o.cursorNodeText)if(r=o.cursorNodeStart,s=o.cursorNodeText,t.cursorNode)e=t.locStart(t.cursorNode),n=i.slice(e,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");e=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let r=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):i.length;n=i.slice(e,r)}else e=0,n=i,r=0,s=o.formatted;let l=t.cursorOffset-e;if(n===s)return{formatted:o.formatted,cursorOffset:r+l,comments:a};let u=n.split("");u.splice(l,0,hs);let c=function(e,t){return Zt.diff(e,t,void 0)}(u,s.split("")),h=r;for(let e of c)if(e.removed){if(e.value.includes(hs))break}else h+=e.count;return{formatted:o.formatted,cursorOffset:h,comments:a}}return{formatted:o.formatted,cursorOffset:-1,comments:a}}function fs(e,t,n){return"number"!=typeof t||Number.isNaN(t)||t<0||t>e.length?n:t}function ps(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i}=t;return n=fs(e,n,-1),r=fs(e,r,0),i=fs(e,i,e.length),{...t,cursorOffset:n,rangeStart:r,rangeEnd:i}}function ms(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s}=ps(e,t),o="\ufeff"===e.charAt(0);if(o&&(e=e.slice(1),n--,r--,i--),"auto"===s&&(s=function(e){let t=e.indexOf("\r");return-1!==t?"\n"===e.charAt(t+1)?"crlf":"cr":"lf"}(e)),e.includes("\r")){let t=t=>en(e.slice(0,Math.max(t,0)),"\r\n");n-=t(n),r-=t(r),i-=t(i),e=function(e){return qt(!1,e,/\r\n?/gu,"\n")}(e)}return{hasBOM:o,text:e,options:ps(e,{...t,cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:s})}}async function gs(e,t){let n=await qi(t);return!n.hasPragma||n.hasPragma(e)}async function Es(e,t){let n,{hasBOM:r,text:i,options:s}=ms(e,await Ji(t));return s.rangeStart>=s.rangeEnd&&""!==i||s.requirePragma&&!await gs(i,s)||s.checkIgnorePragma&&await async function(e,t){var n;let r=await qi(t);return null==(n=r.hasIgnorePragma)?void 0:n.call(r,e)}(i,s)?{formatted:e,cursorOffset:t.cursorOffset,comments:[]}:(s.rangeStart>0||s.rangeEndr);let a=e.slice(r,i).search(/\S/u),l=-1===a;if(!l)for(r+=a;i>r&&!/\S/u.test(e[i-1]);--i);let u,c,h=as(n,r,t,(e,n)=>cs(t,e,n),[],"rangeStart"),d=l?h:as(n,i,t,e=>cs(t,e),[],"rangeEnd");if(!h||!d)return{rangeStart:0,rangeEnd:0};if((({parser:e})=>"json"===e||"json5"===e||"jsonc"===e||"json-stringify"===e)(t)){let e=function(e,t){let n=[e.node,...e.parentNodes],r=new Set([t.node,...t.parentNodes]);return n.find(e=>ls.has(e.type)&&r.has(e))}(h,d);u=e,c=e}else({startNode:u,endNode:c}=function(e,t,{locStart:n,locEnd:r}){let i=e.node,s=t.node;if(i===s)return{startNode:i,endNode:s};let o=n(e.node);for(let e of os(t.parentNodes)){if(!(n(e)>=o))break;s=e}let a=r(t.node);for(let t of os(e.parentNodes)){if(!(r(t)<=a))break;if(i=t,i===s)break}return{startNode:i,endNode:s}}(h,d,t));return{rangeStart:Math.min(s(u),s(c)),rangeEnd:Math.max(o(u),o(c))}}(r,t,n),o=r.slice(i,s),a=Math.min(i,r.lastIndexOf("\n",i)+1),l=r.slice(a,i).match(/^\s*/u)[0],u=Er(l,t.tabWidth),c=await ds(o,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>i&&t.cursorOffset<=s?t.cursorOffset-i:-1,endOfLine:"lf"},u),h=c.formatted.trimEnd(),{cursorOffset:d}=t;d>s?d+=h.length-o.length:c.cursorOffset>=0&&(d=c.cursorOffset+i);let f=r.slice(0,i)+h+r.slice(s);if("lf"!==t.endOfLine){let e=Jt(t.endOfLine);d>=0&&"\r\n"===e&&(d+=en(f.slice(0,d),"\n")),f=qt(!1,f,"\n",e)}return{formatted:f,cursorOffset:d,comments:c.comments}}(i,s):(!s.requirePragma&&s.insertPragma&&s.printer.insertPragma&&!await gs(i,s)&&(i=s.printer.insertPragma(i)),n=await ds(i,s)),r&&(n.formatted="\ufeff"+n.formatted,n.cursorOffset>=0&&n.cursorOffset++),n)}var vs={};Xt(vs,{builders:()=>Cs,printer:()=>Ds,utils:()=>Ss});var Cs={join:Zn,line:Xn,softline:Kn,hardline:Yn,literalline:qn,group:$n,conditionalGroup:function(e,t){return $n(e[0],{...t,expandedStates:e})},fill:function(e){return Pn(e),{type:un,parts:e}},lineSuffix:Gn,lineSuffixBoundary:Vn,cursor:Qn,breakParent:Wn,ifBreak:function(e,t="",n={}){return kn(e),""!==t&&kn(t),{type:cn,breakContents:e,flatContents:t,groupId:n.groupId}},trim:Hn,indent:Bn,indentIfBreak:function(e,t){return kn(e),{type:hn,contents:e,groupId:t.groupId,negate:t.negate}},align:Un,addAlignmentToDoc:Jn,markAsRoot:function(e){return Un({type:"root"},e)},dedentToRoot:function(e){return Un(Number.NEGATIVE_INFINITY,e)},dedent:function(e){return Un(-1,e)},hardlineWithoutBreakParent:jn,literallineWithoutBreakParent:zn,label:function(e,t){return kn(t),e?{type:mn,label:e,contents:t}:t},concat:e=>e},Ds={printDocToString:fr},Ss={willBreak:function(e){return bn(e,Tn,!1)},traverseDoc:_n,findInDoc:bn,mapDoc:yn,removeLines:function(e){return yn(e,xn)},stripTrailingHardline:Nn,replaceEndOfLine:function(e,t=qn){return yn(e,e=>"string"==typeof e?Zn(t,e.split("\n")):e)},canBreak:function(e){return bn(e,Ln,!1)}},As="3.6.2",_s={};Xt(_s,{addDanglingComment:()=>Ir,addLeadingComment:()=>Or,addTrailingComment:()=>kr,getAlignmentSize:()=>Er,getIndentSize:()=>xs,getMaxContinuousCount:()=>ws,getNextNonSpaceNonCommentCharacter:()=>Fs,getNextNonSpaceNonCommentCharacterIndex:()=>Ms,getPreferredQuote:()=>Ls,getStringWidth:()=>rr,hasNewline:()=>xr,hasNewlineInRange:()=>Os,hasSpaces:()=>Is,isNextLineEmpty:()=>Bs,isNextLineEmptyAfterIndex:()=>Rs,isPreviousLineEmpty:()=>Ps,makeString:()=>ks,skip:()=>Ar,skipEverythingButNewLine:()=>Tr,skipInlineComment:()=>ys,skipNewline:()=>Rr,skipSpaces:()=>yr,skipToLineEnd:()=>br,skipTrailingComment:()=>bs,skipWhitespace:()=>_r});var ys=function(e,t){if(!1===t)return!1;if("/"===e.charAt(t)&&"*"===e.charAt(t+1))for(let n=t+2;nMath.max(e,n.length/t.length),0)},Fs=function(e,t){let n=Ts(e,t);return!1===n?"":e.charAt(n)},Ns="'",Ls=function(e,t){let n=!0===t||t===Ns?Ns:'"',r=n===Ns?'"':Ns,i=0,s=0;for(let t of e)t===n?i++:t===r&&s++;return i>s?r:n},Os=function(e,t,n){for(let r=t;ri===r?i:s===t?"\\"+s:s||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(i)?i:"\\"+i));return t+i+t};function Ms(e,t){return 2===arguments.length||"number"==typeof t?Ts(e,t):function(e,t,n){return Ts(e,n(t))}(...arguments)}function Ps(e,t){return 2===arguments.length||"number"==typeof t?jr(e,t):function(e,t,n){return jr(e,n(t))}(...arguments)}function Bs(e,t){return 2===arguments.length||"number"==typeof t?Rs(e,t):function(e,t,n){return Rs(e,n(t))}(...arguments)}function Us(e,t=1){return async(...n)=>{let r=n[t]??{},i=r.plugins??[];return n[t]={...r,plugins:Array.isArray(i)?i:Object.values(i)},e(...n)}}var $s=Us(Es);async function Gs(e,t){let{formatted:n}=await $s(e,{...t,cursorOffset:-1});return n}async function Vs(e,t){return await Gs(e,t)===e}var Ws=Us(qr,0),Hs={parse:Us(async function(e,t,n){let{text:r,options:i}=ms(e,await Ji(t)),s=await ts(r,i);return n&&(n.preprocessForPrint&&(s.ast=await is(s.ast,i)),n.massage&&(s.ast=function(e,t){let{printer:{massageAstNode:n,getVisitorKeys:r}}=t;if(!n)return e;let i=Nr(r),s=n.ignoredProperties??new Set;return function e(t,r){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>e(t,r)).filter(Boolean);let o={},a=new Set(i(t));for(let n in t)!Object.prototype.hasOwnProperty.call(t,n)||s.has(n)||(a.has(n)?o[n]=e(t[n],t):o[n]=t[n]);let l=n(t,o,r);return null!==l?l??o:void 0}(e)}(s.ast,i))),s}),formatAST:Us(async function(e,t){return t=await Ji(t),fr(await ns(e,t),t)}),formatDoc:Us(async function(e,t){let n=function(e){let t=Object.create(null),n=new Set;return function e(t,n,i){var s,o;if("string"==typeof t)return JSON.stringify(t);if(Array.isArray(t)){let n=t.map(e).filter(Boolean);return 1===n.length?n[0]:`[${n.join(", ")}]`}if(t.type===pn){let e=(null==(s=null==i?void 0:i[n+1])?void 0:s.type)===gn;return t.literal?e?"literalline":"literallineWithoutBreakParent":t.hard?e?"hardline":"hardlineWithoutBreakParent":t.soft?"softline":"line"}if(t.type===gn)return(null==(o=null==i?void 0:i[n-1])?void 0:o.type)===pn&&i[n-1].hard?void 0:"breakParent";if(t.type===an)return"trim";if(t.type===sn)return"indent("+e(t.contents)+")";if(t.type===on)return t.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+e(t.contents)+")":t.n<0?"dedent("+e(t.contents)+")":"root"===t.n.type?"markAsRoot("+e(t.contents)+")":"align("+JSON.stringify(t.n)+", "+e(t.contents)+")";if(t.type===cn)return"ifBreak("+e(t.breakContents)+(t.flatContents?", "+e(t.flatContents):"")+(t.groupId?(t.flatContents?"":', ""')+`, { groupId: ${r(t.groupId)} }`:"")+")";if(t.type===hn){let n=[];t.negate&&n.push("negate: true"),t.groupId&&n.push(`groupId: ${r(t.groupId)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return`indentIfBreak(${e(t.contents)}${i})`}if(t.type===ln){let n=[];t.break&&"propagated"!==t.break&&n.push("shouldBreak: true"),t.id&&n.push(`id: ${r(t.id)}`);let i=n.length>0?`, { ${n.join(", ")} }`:"";return t.expandedStates?`conditionalGroup([${t.expandedStates.map(t=>e(t)).join(",")}]${i})`:`group(${e(t.contents)}${i})`}if(t.type===un)return`fill([${t.parts.map(t=>e(t)).join(", ")}])`;if(t.type===dn)return"lineSuffix("+e(t.contents)+")";if(t.type===fn)return"lineSuffixBoundary";if(t.type===mn)return`label(${JSON.stringify(t.label)}, ${e(t.contents)})`;if(t.type===rn)return"cursor";throw new Error("Unknown doc type "+t.type)}(er(e));function r(e){if("symbol"!=typeof e)return JSON.stringify(String(e));if(e in t)return t[e];let r=e.description||"symbol";for(let i=0;;i++){let s=r+(i>0?` #${i}`:"");if(!n.has(s))return n.add(s),t[e]=`Symbol.for(${JSON.stringify(s)})`}}}(e),{formatted:r}=await Es(n,{...t,parser:"__js_expression"});return r}),printToDoc:Us(async function(e,t){t=await Ji(t);let{ast:n}=await ts(e,t);return t.cursorOffset>=0&&(t={...t,...ss(n,t)}),ns(n,t)}),printDocToString:Us(async function(e,t){return fr(e,await Ji(t))})},js=Object.defineProperty;((e,t)=>{for(var n in t)js(e,n,{get:t[n],enumerable:!0})})({},{builders:()=>Jo,printer:()=>ea,utils:()=>ta});var zs="string",Xs="array",Ks="cursor",Ys="indent",qs="align",Qs="trim",Zs="group",Js="fill",eo="if-break",to="indent-if-break",no="line-suffix",ro="line-suffix-boundary",io="line",so="label",oo="break-parent",ao=new Set([Ks,Ys,qs,Qs,Zs,Js,eo,to,no,ro,io,so,oo]),lo=(e,t,n)=>{if(!e||null!=t)return Array.isArray(t)||"string"==typeof t?t[n<0?t.length+n:n]:t.at(n)},uo=function(e){if("string"==typeof e)return zs;if(Array.isArray(e))return Xs;if(!e)return;const{type:t}=e;return ao.has(t)?t:void 0};var co=class extends Error{name="InvalidDocError";constructor(e){super(function(e){const t=null===e?"null":typeof e;if("string"!==t&&"object"!==t)return`Unexpected doc '${t}', \nExpected it to be 'string' or 'object'.`;if(uo(e))throw new Error("doc is valid.");const n=Object.prototype.toString.call(e);if("[object Object]"!==n)return`Unexpected doc '${n}'.`;const r=(i=[...ao].map(e=>`'${e}'`),new Intl.ListFormat("en-US",{type:"disjunction"}).format(i));var i;return`Unexpected doc.type '${e.type}'.\nExpected it to be ${r}.`}(e)),this.doc=e}},ho={},fo=function(e,t,n,r){const i=[e];for(;i.length>0;){const e=i.pop();if(e===ho){n(i.pop());continue}n&&i.push(e,ho);const s=uo(e);if(!s)throw new co(e);if(!1!==(null==t?void 0:t(e)))switch(s){case Xs:case Js:{const t=s===Xs?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case eo:i.push(e.flatContents,e.breakContents);break;case Zs:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case qs:case Ys:case to:case so:case no:i.push(e.contents);break;case zs:case Ks:case Qs:case ro:case io:case oo:break;default:throw new co(e)}}};function po(e,t){if("string"==typeof e)return t(e);const n=new Map;return function e(r){if(n.has(r))return n.get(r);const i=function(n){switch(uo(n)){case Xs:return t(n.map(e));case Js:return t({...n,parts:n.parts.map(e)});case eo:return t({...n,breakContents:e(n.breakContents),flatContents:e(n.flatContents)});case Zs:{let{expandedStates:r,contents:i}=n;return r?(r=r.map(e),i=r[0]):i=e(i),t({...n,contents:i,expandedStates:r})}case qs:case Ys:case to:case so:case no:return t({...n,contents:e(n.contents)});case zs:case Ks:case Qs:case ro:case io:case oo:return t(n);default:throw new co(n)}}(r);return n.set(r,i),i}(e)}function mo(e,t,n){let r=n,i=!1;return fo(e,function(e){if(i)return!1;const n=t(e);void 0!==n&&(i=!0,r=n)}),r}function go(e){return!(e.type!==Zs||!e.break)||!(e.type!==io||!e.hard)||e.type===oo||void 0}function Eo(e){if(e.length>0){const t=lo(!1,e,-1);t.expandedStates||t.break||(t.break="propagated")}return null}function vo(e){return e.type!==io||e.hard?e.type===eo?e.flatContents:e:e.soft?"":" "}function Co(e){for(e=[...e];e.length>=2&&lo(!1,e,-2).type===io&&lo(!1,e,-1).type===oo;)e.length-=2;if(e.length>0){const t=Do(lo(!1,e,-1));e[e.length-1]=t}return e}function Do(e){switch(uo(e)){case Ys:case to:case Zs:case no:case so:{const t=Do(e.contents);return{...e,contents:t}}case eo:return{...e,breakContents:Do(e.breakContents),flatContents:Do(e.flatContents)};case Js:return{...e,parts:Co(e.parts)};case Xs:return Co(e);case zs:return function(e){let t=e.length;for(;t>0&&("\r"===e[t-1]||"\n"===e[t-1]);)t--;return t{},_o=Ao,yo=Ao,bo=Ao;function To(e){return _o(e),{type:Ys,contents:e}}function Ro(e,t){return _o(t),{type:qs,contents:t,n:e}}function xo(e,t={}){return _o(e),yo(t.expandedStates,!0),{type:Zs,id:t.id,contents:e,break:Boolean(t.shouldBreak),expandedStates:t.expandedStates}}var wo={type:ro},Fo={type:oo},No={type:Qs},Lo={type:io,hard:!0},Oo={type:io,hard:!0,literal:!0},Io={type:io},ko={type:io,soft:!0},Mo=[Lo,Fo],Po=[Oo,Fo],Bo={type:Ks};function Uo(e,t){_o(e),yo(t);const n=[];for(let r=0;r{if(!e||null!=t)return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},Go=e=>{return!(12288===(t=e)||t>=65281&&t<=65376||t>=65504&&t<=65510||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e));var t},Vo=/[^\x20-\x7F]/u,Wo=function(e){if(!e)return 0;if(!Vo.test(e))return e.length;e=e.replace(/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g," ");let t=0;for(const n of e){const e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||(t+=Go(e)?1:2)}return t},Ho=Symbol("MODE_BREAK"),jo=Symbol("MODE_FLAT"),zo=Symbol("cursor"),Xo=Symbol("DOC_FILL_PRINTED_LENGTH");function Ko(e,t){return qo(e,{type:"indent"},t)}function Yo(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||{value:"",length:0,queue:[]}:t<0?qo(e,{type:"dedent"},n):t?"root"===t.type?{...e,root:e}:qo(e,{type:"string"==typeof t?"stringAlign":"numberAlign",n:t},n):e}function qo(e,t,n){const r="dedent"===t.type?e.queue.slice(0,-1):[...e.queue,t];let i="",s=0,o=0,a=0;for(const e of r)switch(e.type){case"indent":c(),n.useTabs?l(1):u(n.tabWidth);break;case"stringAlign":c(),i+=e.n,s+=e.n.length;break;case"numberAlign":o+=1,a+=e.n;break;default:throw new Error(`Unexpected type '${e.type}'`)}return h(),{...e,value:i,length:s,queue:r};function l(e){i+="\t".repeat(e),s+=n.tabWidth*e}function u(e){i+=" ".repeat(e),s+=e}function c(){n.useTabs?(o>0&&l(o),d()):h()}function h(){a>0&&u(a),d()}function d(){o=0,a=0}}function Qo(e){let t=0,n=0,r=e.length;e:for(;r--;){const i=e[r];if(i!==zo)for(let n=i.length-1;n>=0;n--){const s=i[n];if(" "!==s&&"\t"!==s){e[r]=i.slice(0,n+1);break e}t++}else n++}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(zo);return t}function Zo(e,t,n,r,i,s){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length;const a=[e],l=[];for(;n>=0;){if(0===a.length){if(0===o)return!0;a.push(t[--o]);continue}const{mode:e,doc:u}=a.pop(),c=uo(u);switch(c){case zs:l.push(u),n-=Wo(u);break;case Xs:case Js:{const t=c===Xs?u:u.parts,n=u[Xo]??0;for(let r=t.length-1;r>=n;r--)a.push({mode:e,doc:t[r]});break}case Ys:case qs:case to:case so:a.push({mode:e,doc:u.contents});break;case Qs:n+=Qo(l);break;case Zs:{if(s&&u.break)return!1;const t=u.break?Ho:e,n=u.expandedStates&&t===Ho?lo(!1,u.expandedStates,-1):u.contents;a.push({mode:t,doc:n});break}case eo:{const t=(u.groupId?i[u.groupId]||jo:e)===Ho?u.breakContents:u.flatContents;t&&a.push({mode:e,doc:t});break}case io:if(e===Ho||u.hard)return!0;u.soft||(l.push(" "),n--);break;case no:r=!0;break;case ro:if(r)return!1}}return!1}var Jo={join:Uo,line:Io,softline:ko,hardline:Mo,literalline:Po,group:xo,conditionalGroup:function(e,t){return xo(e[0],{...t,expandedStates:e})},fill:function(e){return bo(e),{type:Js,parts:e}},lineSuffix:function(e){return _o(e),{type:no,contents:e}},lineSuffixBoundary:wo,cursor:Bo,breakParent:Fo,ifBreak:function(e,t="",n={}){return _o(e),""!==t&&_o(t),{type:eo,breakContents:e,flatContents:t,groupId:n.groupId}},trim:No,indent:To,indentIfBreak:function(e,t){return _o(e),{type:to,contents:e,groupId:t.groupId,negate:t.negate}},align:Ro,addAlignmentToDoc:function(e,t,n){_o(e);let r=e;if(t>0){for(let e=0;ee},ea={printDocToString:function(e,t){const n={},r=t.printWidth,i=function(e){switch(e){case"cr":return"\r";case"crlf":return"\r\n";default:return"\n"}}(t.endOfLine);let s=0;const o=[{ind:{value:"",length:0,queue:[]},mode:Ho,doc:e}],a=[];let l=!1;const u=[];let c=0;for(function(e){const t=new Set,n=[];fo(e,function(e){if(e.type===oo&&Eo(n),e.type===Zs){if(n.push(e),t.has(e))return!1;t.add(e)}},function(e){e.type===Zs&&n.pop().break&&Eo(n)},!0)}(e);o.length>0;){const{ind:e,mode:h,doc:d}=o.pop();switch(uo(d)){case zs:{const e="\n"!==i?$o(!1,d,"\n",i):d;a.push(e),o.length>0&&(s+=Wo(e));break}case Xs:for(let t=d.length-1;t>=0;t--)o.push({ind:e,mode:h,doc:d[t]});break;case Ks:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(zo),c++;break;case Ys:o.push({ind:Ko(e,t),mode:h,doc:d.contents});break;case qs:o.push({ind:Yo(e,d.n,t),mode:h,doc:d.contents});break;case Qs:s-=Qo(a);break;case Zs:switch(h){case jo:if(!l){o.push({ind:e,mode:d.break?Ho:jo,doc:d.contents});break}case Ho:{l=!1;const t={ind:e,mode:jo,doc:d.contents},i=r-s,a=u.length>0;if(!d.break&&Zo(t,o,i,a,n))o.push(t);else if(d.expandedStates){const t=lo(!1,d.expandedStates,-1);if(d.break){o.push({ind:e,mode:Ho,doc:t});break}for(let r=1;r=d.expandedStates.length){o.push({ind:e,mode:Ho,doc:t});break}{const t=d.expandedStates[r],s={ind:e,mode:jo,doc:t};if(Zo(s,o,i,a,n)){o.push(s);break}}}}else o.push({ind:e,mode:Ho,doc:d.contents});break}}d.id&&(n[d.id]=lo(!1,o,-1).mode);break;case Js:{const t=r-s,i=d[Xo]??0,{parts:a}=d,l=a.length-i;if(0===l)break;const c=a[i+0],f=a[i+1],p={ind:e,mode:jo,doc:c},m={ind:e,mode:Ho,doc:c},g=Zo(p,[],t,u.length>0,n,!0);if(1===l){g?o.push(p):o.push(m);break}const E={ind:e,mode:jo,doc:f},v={ind:e,mode:Ho,doc:f};if(2===l){g?o.push(E,p):o.push(v,m);break}const C=a[i+2],D={ind:e,mode:h,doc:{...d,[Xo]:i+2}};Zo({ind:e,mode:jo,doc:[c,f,C]},[],t,u.length>0,n,!0)?o.push(D,E,p):g?o.push(D,v,p):o.push(D,v,m);break}case eo:case to:{const t=d.groupId?n[d.groupId]:h;if(t===Ho){const t=d.type===eo?d.breakContents:d.negate?d.contents:To(d.contents);t&&o.push({ind:e,mode:h,doc:t})}if(t===jo){const t=d.type===eo?d.flatContents:d.negate?To(d.contents):d.contents;t&&o.push({ind:e,mode:h,doc:t})}break}case no:u.push({ind:e,mode:h,doc:d.contents});break;case ro:u.length>0&&o.push({ind:e,mode:h,doc:Lo});break;case io:switch(h){case jo:if(!d.hard){d.soft||(a.push(" "),s+=1);break}l=!0;case Ho:if(u.length>0){o.push({ind:e,mode:h,doc:d},...u.reverse()),u.length=0;break}d.literal?e.root?(a.push(i,e.root.value),s=e.root.length):(a.push(i),s=0):(s-=Qo(a),a.push(i+e.value),s=e.length)}break;case so:o.push({ind:e,mode:h,doc:d.contents});break;case oo:break;default:throw new co(d)}0===o.length&&u.length>0&&(o.push(...u.reverse()),u.length=0)}const h=a.indexOf(zo);if(-1!==h){const e=a.indexOf(zo,h+1);if(-1===e)return{formatted:a.filter(e=>e!==zo).join("")};const t=a.slice(0,h).join(""),n=a.slice(h+1,e).join("");return{formatted:t+n+a.slice(e+1).join(""),cursorNodeStart:t.length,cursorNodeText:n}}return{formatted:a.join("")}}},ta={willBreak:function(e){return mo(e,go,!1)},traverseDoc:fo,findInDoc:mo,mapDoc:po,removeLines:function(e){return po(e,vo)},stripTrailingHardline:function(e){return Do(function(e){return po(e,e=>function(e){switch(uo(e)){case Js:if(e.parts.every(e=>""===e))return"";break;case Zs:if(!(e.contents||e.id||e.break||e.expandedStates))return"";if(e.contents.type===Zs&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case qs:case Ys:case to:case no:if(!e.contents)return"";break;case eo:if(!e.flatContents&&!e.breakContents)return"";break;case Xs:{const t=[];for(const n of e){if(!n)continue;const[e,...r]=Array.isArray(n)?n:[n];"string"==typeof e&&"string"==typeof lo(!1,t,-1)?t[t.length-1]+=e:t.push(e),t.push(...r)}return 0===t.length?"":1===t.length?t[0]:t}case zs:case Ks:case Qs:case ro:case io:case so:case oo:break;default:throw new co(e)}return e}(e))}(e))},replaceEndOfLine:function(e,t=Po){return po(e,e=>"string"==typeof e?Uo(t,e.split("\n")):e)},canBreak:function(e){return mo(e,So,!1)}};function na(e){function t(){}t.prototype=e;const n=new t;function r(){return typeof n.bar}return r(),r(),e}class ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class ia extends ra{constructor(e){super([]),this.idx=1,Object.assign(this,ma(e))}set definition(e){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class sa extends ra{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ma(e))}}class oa extends ra{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ma(e))}}class aa extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class la extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ua extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ca extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class ha extends ra{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ma(e))}}class da extends ra{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ma(e))}}class fa{constructor(e){this.idx=1,Object.assign(this,ma(e))}accept(e){e.visit(this)}}function pa(e){function t(e){return e.map(pa)}if(e instanceof ia){const t={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return"string"==typeof e.label&&(t.label=e.label),t}if(e instanceof oa)return{type:"Alternative",definition:t(e.definition)};if(e instanceof aa)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof la)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof ua)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ha)return{type:"RepetitionWithSeparator",idx:e.idx,separator:pa(new fa({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ca)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof da)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof fa){const t={type:"Terminal",name:e.terminalType.name,label:(n=e.terminalType,"string"==typeof(r=n).LABEL&&""!==r.LABEL?n.LABEL:n.name),idx:e.idx};"string"==typeof e.label&&(t.terminalLabel=e.label);const i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=i instanceof RegExp?i.source:i),t}if(e instanceof sa)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match");var n,r}function ma(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}class ga{visit(e){const t=e;switch(t.constructor){case ia:return this.visitNonTerminal(t);case oa:return this.visitAlternative(t);case aa:return this.visitOption(t);case la:return this.visitRepetitionMandatory(t);case ua:return this.visitRepetitionMandatoryWithSeparator(t);case ha:return this.visitRepetitionWithSeparator(t);case ca:return this.visitRepetition(t);case da:return this.visitAlternation(t);case fa:return this.visitTerminal(t);case sa:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Ea(e,t=[]){return!!(e instanceof aa||e instanceof ca||e instanceof ha)||(e instanceof da?e.definition.some(e=>Ea(e,t)):!(e instanceof ia&&t.includes(e))&&e instanceof ra&&(e instanceof ia&&t.push(e),e.definition.every(e=>Ea(e,t))))}function va(e){if(e instanceof ia)return"SUBRULE";if(e instanceof aa)return"OPTION";if(e instanceof da)return"OR";if(e instanceof la)return"AT_LEAST_ONE";if(e instanceof ua)return"AT_LEAST_ONE_SEP";if(e instanceof ha)return"MANY_SEP";if(e instanceof ca)return"MANY";if(e instanceof fa)return"CONSUME";throw Error("non exhaustive match")}class Ca{walk(e,t=[]){e.definition.forEach((n,r)=>{const i=e.definition.slice(r+1);if(n instanceof ia)this.walkProdRef(n,i,t);else if(n instanceof fa)this.walkTerminal(n,i,t);else if(n instanceof oa)this.walkFlat(n,i,t);else if(n instanceof aa)this.walkOption(n,i,t);else if(n instanceof la)this.walkAtLeastOne(n,i,t);else if(n instanceof ua)this.walkAtLeastOneSep(n,i,t);else if(n instanceof ha)this.walkManySep(n,i,t);else if(n instanceof ca)this.walkMany(n,i,t);else{if(!(n instanceof da))throw Error("non exhaustive match");this.walkOr(n,i,t)}})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new aa({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=Da(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);e.definition.forEach(e=>{const t=new oa({definition:[e]});this.walk(t,r)})}}function Da(e,t,n){return[new aa({definition:[new fa({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Sa(e){if(e instanceof ia)return Sa(e.referencedRule);if(e instanceof fa)return[e.terminalType];if(function(e){return e instanceof oa||e instanceof aa||e instanceof ca||e instanceof la||e instanceof ua||e instanceof ha||e instanceof fa||e instanceof sa}(e))return function(e){let t=[];const n=e.definition;let r,i=0,s=n.length>i,o=!0;for(;s&&o;)r=n[i],o=Ea(r),t=t.concat(Sa(r)),i+=1,s=n.length>i;return[...new Set(t)]}(e);if(function(e){return e instanceof da}(e))return function(e){const t=e.definition.map(e=>Sa(e));return[...new Set(t.flat())]}(e);throw Error("non exhaustive match")}const Aa="_~IN~_";class _a extends Ca{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=(i=e.referencedRule,s=e.idx,i.name+s+Aa+this.topProd.name);var i,s;const o=t.concat(n),a=Sa(new oa({definition:o}));this.follows[r]=a}}function ya(e){return e.charCodeAt(0)}function ba(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function Ta(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t],e[t]=!0}function Ra(e){if(void 0===e)throw Error("Internal Error - Should never get here!");return!0}function xa(){throw Error("Internal Error - Should never get here!")}function wa(e){return"Character"===e.type}const Fa=[];for(let e=ya("0");e<=ya("9");e++)Fa.push(e);const Na=[ya("_")].concat(Fa);for(let e=ya("a");e<=ya("z");e++)Na.push(e);for(let e=ya("A");e<=ya("Z");e++)Na.push(e);const La=[ya(" "),ya("\f"),ya("\n"),ya("\r"),ya("\t"),ya("\v"),ya("\t"),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya(" "),ya("\u2028"),ya("\u2029"),ya(" "),ya(" "),ya(" "),ya("\ufeff")],Oa=/[0-9a-fA-F]/,Ia=/[0-9]/,ka=/[1-9]/;class Ma{visitChildren(e){for(const t in e){const n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}function Pa(e){console&&console.error&&console.error(`Error: ${e}`)}function Ba(e){console&&console.warn&&console.warn(`Warning: ${e}`)}let Ua={};const $a=new class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Ta(n,"global");break;case"i":Ta(n,"ignoreCase");break;case"m":Ta(n,"multiLine");break;case"u":Ta(n,"unicode");break;case"y":Ta(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":let t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}}Ra(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return xa()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;Ra(t)}if(!0!==e||void 0!==t)return Ra(t)?("?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t):void 0}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),Ra(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):xa()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ya("\n"),ya("\r"),ya("\u2028"),ya("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=Fa;break;case"D":e=Fa,t=!0;break;case"s":e=La;break;case"S":e=La,t=!0;break;case"w":e=Na;break;case"W":e=Na,t=!0}return Ra(e)?{type:"Set",value:e,complement:t}:xa()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ya("\f");break;case"n":e=ya("\n");break;case"r":e=ya("\r");break;case"t":e=ya("\t");break;case"v":e=ya("\v")}return Ra(e)?{type:"Character",value:e}:xa()}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:ya("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:ya(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:ya(this.popChar())}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const t=this.classAtom();if(t.type,wa(t)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,wa(n)){if(n.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};function Ga(e){const t=e.toString();if(Ua.hasOwnProperty(t))return Ua[t];{const e=$a.pattern(t);return Ua[t]=e,e}}const Va="Complement Sets are not supported for first char optimization",Wa='Unable to use "first char" lexer optimizations:\n';function Ha(e,t=!1){try{const t=Ga(e);return ja(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===Va)t&&Ba(`${Wa}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),Pa(`${Wa}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function ja(e,t,n){switch(e.type){case"Disjunction":for(let r=0;r{if("number"==typeof e)za(e,t,n);else{const r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)za(e,t,n);else{for(let e=r.from;e<=r.to&&e=ul){const e=r.from>=ul?r.from:ul,n=r.to,i=hl(e),s=hl(n);for(let e=i;e<=s;e++)t[e]=e}}}});break;case"Group":ja(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}const o=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===Ka(s)||"Group"!==s.type&&!1===o)break}break;default:throw Error("non exhaustive match!")}return Object.values(t)}function za(e,t,n){const r=hl(e);t[r]=r,!0===n&&function(e,t){const n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){const e=hl(r.charCodeAt(0));t[e]=e}else{const e=n.toLowerCase();if(e!==n){const n=hl(e.charCodeAt(0));t[n]=n}}}(e,t)}function Xa(e,t){return e.value.find(e=>{if("number"==typeof e)return t.includes(e);{const n=e;return void 0!==t.find(e=>n.from<=e&&e<=n.to)}})}function Ka(e){const t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(Array.isArray(e.value)?e.value.every(Ka):Ka(e.value))}class Ya extends Ma{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e);case"Lookbehind":return void this.visitLookbehind(e);case"NegativeLookbehind":return void this.visitNegativeLookbehind(e)}super.visitChildren(e)}}visitCharacter(e){this.targetCharCodes.includes(e.value)&&(this.found=!0)}visitSet(e){e.complement?void 0===Xa(e,this.targetCharCodes)&&(this.found=!0):void 0!==Xa(e,this.targetCharCodes)&&(this.found=!0)}}function qa(e,t){if(t instanceof RegExp){const n=Ga(t),r=new Ya(e);return r.visit(n),r.found}for(const n of t){const t=n.charCodeAt(0);if(e.includes(t))return!0}return!1}const Qa="PATTERN",Za="defaultMode",Ja="modes";const el=/[^\\][$]/,tl=/[^\\[][\^]|^\^/;function nl(e){const t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function rl(e){const t=e.PATTERN;if(t instanceof RegExp)return!1;if("function"==typeof t)return!0;if(Object.hasOwn(t,"exec"))return!0;if("string"==typeof t)return!1;throw Error("non exhaustive match")}function il(e){return"string"==typeof e&&1===e.length&&e.charCodeAt(0)}const sl={test:function(e){const t=e.length;for(let n=this.lastIndex;n"string"==typeof e?e.charCodeAt(0):e)}function ll(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}const ul=256;let cl=[];function hl(e){return ee.CATEGORIES).flat().filter(Boolean);const e=n.filter(e=>!t.includes(e));t=t.concat(e),0===e.length?r=!1:n=e}return t}(e);!function(e){e.forEach(e=>{var t;Cl(e)||(gl[ml]=e,e.tokenTypeIdx=ml++),Dl(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Dl(e)||(e.CATEGORIES=[]),t=e,Object.hasOwn(null!=t?t:{},"categoryMatches")||(e.categoryMatches=[]),function(e){return Object.hasOwn(null!=e?e:{},"categoryMatchesMap")}(e)||(e.categoryMatchesMap={})})}(t),function(e){e.forEach(e=>{vl([],e)})}(t),function(e){e.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(t=>{e.categoryMatches.push(gl[t].tokenTypeIdx)})})}(t),t.forEach(e=>{e.isParent=e.categoryMatches.length>0})}function vl(e,t){e.forEach(e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),t.CATEGORIES.forEach(n=>{const r=e.concat(t);r.includes(n)||vl(r,n)})}function Cl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}function Dl(e){return Object.hasOwn(null!=e?e:{},"CATEGORIES")}function Sl(e){return Object.hasOwn(null!=e?e:{},"tokenTypeIdx")}var Al;!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"}(Al||(Al={}));const _l={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:{buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i,s)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`},traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(_l);class yl{constructor(e,t=_l){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=Object.assign({},_l,t);const n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,r=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===_l.lineTerminatorsPattern)this.config.lineTerminatorsPattern=sl;else if(this.config.lineTerminatorCharacters===_l.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Array.isArray(e)?n={modes:{defaultMode:[...e]},defaultMode:Za}:(r=!1,n=Object.assign({},e))}),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){const t=[];return Object.hasOwn(e,Za)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+Za+"> property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(e,Ja)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:Al.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(e,Ja)&&Object.hasOwn(e,Za)&&!Object.hasOwn(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${Za}: <${e.defaultMode}>which does not exist\n`,type:Al.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(e,Ja)&&Object.keys(e.modes).forEach(n=>{const r=e.modes[n];r.forEach((e,i)=>{void 0===e?t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:Al.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(e,"LONGER_ALT")&&(Array.isArray(e.LONGER_ALT)?e.LONGER_ALT:[e.LONGER_ALT]).forEach(i=>{void 0===i||r.includes(i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${e.name}> outside of mode <${n}>\n`,type:Al.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(function(e,t,n){const r=[];let i=!1;const s=Object.values(e.modes||{}).flat().filter(Boolean).filter(e=>e[Qa]!==yl.NA),o=al(n);return t&&s.forEach(e=>{const t=ol(e,o);if(!1!==t){const n=function(e,t){if(t.issue===Al.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===Al.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else Object.hasOwn(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):qa(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:Al.NO_LINE_BREAKS_FLAGS}),r}(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},Object.entries(n.modes).forEach(([e,t])=>{n.modes[e]=t.filter(e=>void 0!==e)});const i=Object.keys(n.modes);if(Object.entries(n.modes).forEach(([e,n])=>{this.TRACE_INIT(`Mode: <${e}> processing`,()=>{if(this.modes.push(e),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e,t){let n=[];const r=function(e){const t=e.filter(e=>!Object.hasOwn(e,Qa));return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:Al.MISSING_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(e);n=n.concat(r.errors);const i=function(e){const t=e.filter(e=>{const t=e[Qa];return!(t instanceof RegExp||"function"==typeof t||Object.hasOwn(t,"exec")||"string"==typeof t)});return{errors:t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Al.INVALID_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[];const n=e.filter(e=>e[Qa]instanceof RegExp);return t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return el.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){class t extends Ma{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return e.filter(e=>{const n=e.PATTERN;try{const e=Ga(n),r=new t;return r.visit(e),r.found}catch(e){return tl.test(n.source)}}).map(e=>({message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Al.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){return e.filter(e=>{const t=e[Qa];return t instanceof RegExp&&(t.multiline||t.global)}).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Al.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){const t=[];let n=e.map(n=>e.reduce((e,r)=>(n.PATTERN.source!==r.PATTERN.source||t.includes(r)||r.PATTERN===yl.NA||(t.push(r),e.push(r)),e),[]));return n=n.filter(Boolean),n.filter(e=>e.length>1).map(e=>{const t=e.map(e=>e.name);return{message:`The same RegExp pattern ->${e[0].PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,type:Al.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}(n)),t=t.concat(function(e){return e.filter(e=>e.PATTERN.test("")).map(e=>({message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:Al.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}(n)),t}(s)),n=n.concat(function(e){const t=e.filter(e=>{if(!Object.hasOwn(e,"GROUP"))return!1;const t=e.GROUP;return t!==yl.SKIPPED&&t!==yl.NA&&!("string"==typeof t)});return t.map(e=>({message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Al.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}(s)),n=n.concat(function(e,t){return e.filter(e=>void 0!==e.PUSH_MODE&&!t.includes(e.PUSH_MODE)).map(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:Al.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}(s,t)),n=n.concat(function(e){const t=[],n=e.reduce((e,t,n)=>{const r=t.PATTERN;return r===yl.NA||("string"==typeof r?e.push({str:r,idx:n,tokenType:t}):r instanceof RegExp&&(i=r,void 0===[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(e=>-1!==i.source.indexOf(e)))&&e.push({str:r.source,idx:n,tokenType:t})),e;var i},[]);return e.forEach((e,r)=>{n.forEach(({str:n,idx:i,tokenType:s})=>{if(r${s.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:Al.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}})}),t}(s)),n}(n,i))}),0===this.lexerDefinitionErrors.length){let r;El(n),this.TRACE_INIT("analyzeTokenTypes",()=>{r=function(e,t){const n=(t=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:(e,t)=>t()},t)).tracer;let r;n("initCharCodeToOptimizedIndexMap",()=>{!function(){if(0===cl.length){cl=new Array(65536);for(let e=0;e<65536;e++)cl[e]=e>255?255+~~(e/255):e}}()}),n("Reject Lexer.NA",()=>{r=e.filter(e=>e[Qa]!==yl.NA)});let i,s,o,a,l,u,c,h,d,f,p,m=!1;n("Transform Patterns",()=>{m=!1,i=r.map(e=>{const t=e[Qa];if(t instanceof RegExp){const e=t.source;return 1!==e.length||"^"===e||"$"===e||"."===e||t.ignoreCase?2!==e.length||"\\"!==e[0]||["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(e[1])?nl(t):e[1]:e}if("function"==typeof t)return m=!0,{exec:t};if("object"==typeof t)return m=!0,t;if("string"==typeof t){if(1===t.length)return t;{const e=t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return nl(new RegExp(e))}}throw Error("non exhaustive match")})}),n("misc mapping",()=>{s=r.map(e=>e.tokenTypeIdx),o=r.map(e=>{const t=e.GROUP;if(t!==yl.SKIPPED){if("string"==typeof t)return t;if(void 0===t)return!1;throw Error("non exhaustive match")}}),a=r.map(e=>{const t=e.LONGER_ALT;if(t)return Array.isArray(t)?t.map(e=>r.indexOf(e)):[r.indexOf(t)]}),l=r.map(e=>e.PUSH_MODE),u=r.map(e=>Object.hasOwn(e,"POP_MODE"))}),n("Line Terminator Handling",()=>{const e=al(t.lineTerminatorCharacters);c=r.map(e=>!1),"onlyOffset"!==t.positionTracking&&(c=r.map(t=>Object.hasOwn(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===ol(t,e)&&qa(e,t.PATTERN)))}),n("Misc Mapping #2",()=>{h=r.map(rl),d=i.map(il),f=r.reduce((e,t)=>{const n=t.GROUP;return"string"==typeof n&&n!==yl.SKIPPED&&(e[n]=[]),e},{}),p=i.map((e,t)=>({pattern:i[t],longerAlt:a[t],canLineTerminator:c[t],isCustom:h[t],short:d[t],group:o[t],push:l[t],pop:u[t],tokenTypeIdx:s[t],tokenType:r[t]}))});let g=!0,E=[];return t.safeMode||n("First Char Optimization",()=>{E=r.reduce((e,n,r)=>{if("string"==typeof n.PATTERN){const t=hl(n.PATTERN.charCodeAt(0));ll(e,t,p[r])}else if(Array.isArray(n.START_CHARS_HINT)){let t;n.START_CHARS_HINT.forEach(n=>{const i=hl("string"==typeof n?n.charCodeAt(0):n);t!==i&&(t=i,ll(e,i,p[r]))})}else if(n.PATTERN instanceof RegExp)if(n.PATTERN.unicode)g=!1,t.ensureOptimizations&&Pa(`${Wa}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const i=Ha(n.PATTERN,t.ensureOptimizations);0===i.length&&(g=!1),i.forEach(t=>{ll(e,t,p[r])})}else t.ensureOptimizations&&Pa(`${Wa}\tTokenType: <${n.name}> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return e},[])}),{emptyGroups:f,patternIdxToConfig:p,charCodeToPatternIdxToConfig:E,hasCustom:m,canBeOptimized:g}}(n,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[e]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[e]=r.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[e]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}this.lexerDefinitionWarning.forEach(e=>{Ba(e.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(r&&(this.handleModes=()=>{}),!1===this.trackStartLines&&(this.computeNewColumn=e=>e),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=()=>{}),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const e=Object.entries(this.canModeBeOptimized).reduce((e,[t,n])=>(!1===n&&e.push(t),e),[]);if(t.ensureOptimizations&&e.length>0)throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Ua={}}),this.TRACE_INIT("toFastProperties",()=>{na(this)})})}tokenize(e,t=this.defaultMode){if(this.lexerDefinitionErrors.length>0){const e=this.lexerDefinitionErrors.map(e=>e.message).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,s,o,a,l,u,c,h,d,f,p,m,g;const E=e,v=E.length;let C=0,D=0;const S=this.hasCustom?0:Math.floor(e.length/10),A=new Array(S),_=[];let y=this.trackStartLines?1:void 0,b=this.trackStartLines?1:void 0;const T=function(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(!Array.isArray(r))throw Error("non exhaustive match");t[n]=[]}),t}(this.emptyGroups),R=this.trackStartLines,x=this.config.lineTerminatorsPattern;let w=0,F=[],N=[];const L=[],O=[];Object.freeze(O);let I=!1;const k=e=>{if(1===L.length&&void 0===e.tokenType.PUSH_MODE){const t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);_.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{L.pop();const e=L.at(-1);F=this.patternIdxToConfig[e],N=this.charCodeToPatternIdxToConfig[e],w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}};function M(e){L.push(e),N=this.charCodeToPatternIdxToConfig[e],F=this.patternIdxToConfig[e],w=F.length,w=F.length;const t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;I=!(!N||!t)}let P;M.call(this,t);const B=this.config.recoveryEnabled;for(;Ca.length){a=s,c=s.length,l=u,P=t;break}}}break}}if(-1!==c){if(h=P.group,void 0!==h&&(a=null!==a?a:e.substring(C,C+c),d=P.tokenTypeIdx,f=this.createTokenInstance(a,C,d,P.tokenType,y,b,c),this.handlePayload(f,l),!1===h?D=this.addToken(A,D,f):T[h].push(f)),!0===R&&!0===P.canLineTerminator){let t,n,r=0;x.lastIndex=0;do{a=null!==a?a:e.substring(C,C+c),t=x.test(a),!0===t&&(n=x.lastIndex-1,r++)}while(!0===t);0!==r?(y+=r,b=c-n,this.updateTokenEndLineColumnLocation(f,h,n,r,y,b,c)):b=this.computeNewColumn(b,c)}else b=this.computeNewColumn(b,c);C+=c,this.handleModes(P,k,M,f)}else{const t=C,n=y,i=b;let s=!1===B;for(;!1===s&&C`Expecting ${Tl(e)?`--\x3e ${bl(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>"Redundant input, expecting EOF but found: "+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o="\nbut found: '"+t[0].image+"'";return r?s+r+o:s+`one of these possible Token sequences:\n${e.reduce((e,t)=>e.concat(t),[]).map(e=>`[${e.map(e=>bl(e)).join(", ")}]`).map((e,t)=>` ${t+1}. ${e}`).join("\n")}`+o},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ",s="\nbut found: '"+t[0].image+"'";return n?i+n+s:i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map(e=>`[${e.map(e=>bl(e)).join(",")}]`).join(" ,")}>`+s}};Object.freeze(Bl);const Ul={buildRuleNotFoundError:(e,t)=>"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"},$l={buildDuplicateFoundError(e,t){const n=e.name,r=t[0],i=r.idx,s=va(r),o=(a=r)instanceof fa?a.terminalType.name:a instanceof ia?a.nonTerminalName:"";var a;let l=`->${s}${i>0?i:""}<- ${o?`with argument: ->${o}<-`:""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,"\n"),l},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){const t=e.prefixPath.map(e=>bl(e)).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){const t=0===e.alternation.idx?"":e.alternation.idx,n=0===e.prefixPath.length;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule,\n`;return r+=n?"These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n":`<${e.prefixPath.map(e=>bl(e)).join(", ")}> may appears as a prefix path in all these alternatives.\n`,r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError(e){let t=va(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>"deprecated",buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){const t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${t} --\x3e ${e.leftRecursionPath.map(e=>e.name).concat([t]).join(" --\x3e ")}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>"deprecated",buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof sa?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};class Gl extends ga{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:rc.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Vl extends Ca{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){0===this.ruleStack.length?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Wl extends Vl{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const e=t.concat(n),r=new oa({definition:e});this.possibleTokTypes=Sa(r),this.found=!0}}}class Hl extends Ca{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class jl extends Hl{walkMany(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}}class zl extends Hl{walkManySep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}}class Xl extends Hl{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}}class Kl extends Hl{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){const e=t.concat(n)[0];this.result.isEndOfRule=void 0===e,e instanceof fa&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}}function Yl(e,t,n=[]){n=[...n];let r=[],i=0;function s(s){const o=Yl(s.concat(e.slice(i+1)),t,n);return r.concat(o)}for(;n.length{0!==e.definition.length&&(r=s(e.definition))}),r;if(!(t instanceof fa))throw Error("non exhaustive match");n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:e.slice(i)}),r}function ql(e,t,n,r){const i=[...n];i.push(e.name);const s=[...r];return s.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:s}}var Ql;function Zl(e){if(e instanceof aa||"Option"===e)return Ql.OPTION;if(e instanceof ca||"Repetition"===e)return Ql.REPETITION;if(e instanceof la||"RepetitionMandatory"===e)return Ql.REPETITION_MANDATORY;if(e instanceof ua||"RepetitionMandatoryWithSeparator"===e)return Ql.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ha||"RepetitionWithSeparator"===e)return Ql.REPETITION_WITH_SEPARATOR;if(e instanceof da||"Alternation"===e)return Ql.ALTERNATION;throw Error("non exhaustive match")}function Jl(e,t,n,r){const i=e.length,s=e.every(e=>e.every(e=>1===e.length));if(t)return function(t){const r=t.map(e=>e.GATE);for(let t=0;te.flat()).reduce((e,t,n)=>(t.forEach(t=>{t.tokenTypeIdx in e||(e[t.tokenTypeIdx]=n),t.categoryMatches.forEach(t=>{Object.hasOwn(e,t)||(e[t]=n)})}),e),{});return function(){const e=this.LA_FAST(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t1===e.length),i=e.length;if(r&&!n){const t=e.flat();if(1===t.length&&0===t[0].categoryMatches.length){const e=t[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===e}}{const e=t.reduce((e,t,n)=>(e[t.tokenTypeIdx]=!0,t.categoryMatches.forEach(t=>{e[t]=!0}),e),[]);return function(){const t=this.LA_FAST(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;nYl([e],1)),r=ru(n.length),i=n.map(e=>{const t={};return e.forEach(e=>{iu(e.partialPath).forEach(e=>{t[e]=!0})}),t});let s=n;for(let e=1;e<=t;e++){const n=s;s=ru(n.length);for(let o=0;o{iu(e.partialPath).forEach(e=>{i[o][e]=!0})})}}}}return r}function au(e,t,n,r){const i=new nu(e,Ql.ALTERNATION,r);return t.accept(i),ou(i.result,n)}function lu(e,t,n,r){const i=new nu(e,n);t.accept(i);const s=i.result,o=new tu(t,e,n).startWalking();return ou([new oa({definition:s}),new oa({definition:o})],r)}function uu(e,t){e:for(let n=0;ne.every(e=>e.every(e=>0===e.categoryMatches.length)))}function hu(e){return`${va(e)}_#_${e.idx}_#_${du(e)}`}function du(e){return e instanceof fa?e.terminalType.name:e instanceof ia?e.nonTerminalName:""}class fu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function pu(e,t,n,r=[]){const i=[],s=mu(t.definition);if(0===s.length)return[];{const t=e.name;s.includes(e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:rc.LEFT_RECURSION,ruleName:t});const o=r.concat([e]),a=s.filter(e=>!o.includes(e)).flatMap(t=>{const i=[...r];return i.push(t),pu(e,t,n,i)});return i.concat(a)}}function mu(e){let t=[];if(0===e.length)return t;const n=e[0];if(n instanceof ia)t.push(n.referencedRule);else if(n instanceof oa||n instanceof aa||n instanceof la||n instanceof ua||n instanceof ha||n instanceof ca)t=t.concat(mu(n.definition));else if(n instanceof da)t=n.definition.map(e=>mu(e.definition)).flat();else if(!(n instanceof fa))throw Error("non exhaustive match");const r=Ea(n),i=e.length>1;if(r&&i){const n=e.slice(1);return t.concat(mu(n))}return t}class gu extends ga{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}class Eu extends ga{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}const vu="MismatchedTokenException",Cu="NoViableAltException",Du="EarlyExitException",Su="NotAllInputParsedException",Au=[vu,Cu,Du,Su];function _u(e){return Au.includes(e.name)}Object.freeze(Au);class yu extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class bu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=vu}}class Tu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Cu}}class Ru extends yu{constructor(e,t){super(e,t),this.name=Su}}class xu extends yu{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Du}}const wu={},Fu="InRuleRecoveryException";class Nu extends Error{constructor(e){super(e),this.name=Fu}}function Lu(e,t,n,r,i,s,o){const a=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[a];if(void 0===l){const e=this.getCurrRuleFullName();l=new s(this.getGAstProductions()[e],i).startWalking(),this.firstAfterRepMap[a]=l}let u=l.token,c=l.occurrence;const h=l.isEndOfRule;0===this.RULE_STACK_IDX&&h&&void 0===u&&(u=Ml,c=1),void 0!==u&&void 0!==c&&this.shouldInRepetitionRecoveryBeTried(u,c,o)&&this.tryInRepetitionRecovery(e,t,n,u)}const Ou=1024,Iu=1280,ku=1536;function Mu(e,t,n){return n|t|e}class Pu{constructor(e){var t;this.maxLookahead=null!==(t=null==e?void 0:e.maxLookahead)&&void 0!==t?t:tc.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(0===t.length){const n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return e.flatMap(e=>pu(e,e,$l))}validateEmptyOrAlternatives(e){return e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.slice(0,-1).flatMap((r,i)=>0===function(e,t,n){const r="EXIT_NONE_TERMINAL",i=[r],s="EXIT_ALTERNATIVE";let o=!1;const a=t.length,l=a-1-1,u=[],c=[];for(c.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});0!==c.length;){const e=c.pop();if(e===s){o&&c.at(-1).idx<=l&&c.pop();continue}const h=e.def,d=e.idx,f=e.ruleStack,p=e.occurrenceStack;if(0===h.length)continue;const m=h[0];if(m===r){const e={idx:d,def:h.slice(1),ruleStack:f.slice(0,-1),occurrenceStack:p.slice(0,-1)};c.push(e)}else if(m instanceof fa)if(d=0;e--){const t={idx:d,def:m.definition[e].definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p};c.push(t),c.push(s)}else if(m instanceof oa)c.push({idx:d,def:m.definition.concat(h.slice(1)),ruleStack:f,occurrenceStack:p});else{if(!(m instanceof sa))throw Error("non exhaustive match");c.push(ql(m,d,f,p))}}return u}([r],[],fl).length?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:rc.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}(e,$l))}validateAmbiguousAlternationAlternatives(e,t){return e.flatMap(e=>function(e,t,n){const r=new gu;e.accept(r);let i=r.alternations;i=i.filter(e=>!0!==e.ignoreAmbiguities);return i.flatMap(r=>{const i=r.idx,s=r.maxLookahead||t,o=au(i,e,s,r),a=function(e,t,n,r){const i=[];return e.reduce((n,r,s)=>(!0===t.definition[s].ignoreAmbiguities||r.forEach(r=>{const o=[s];e.forEach((e,n)=>{s!==n&&uu(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&o.push(n)}),o.length>1&&!uu(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]).map(e=>{const i=e.alts.map(e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}(o,r,e,n),l=function(e,t,n,r){const i=e.reduce((e,t,n)=>{const r=t.map(e=>({idx:n,path:e}));return e.concat(r)},[]);return i.flatMap(e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];const s=e.idx,o=e.path;return i.filter(e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx{const n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}));var n,r}).map(e=>{const i=[e.idx+1,s+1],o=0===t.idx?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:rc.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})})}(o,r,e,n);return a.concat(l)})}(e,t,$l))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){const r=[];return e.forEach(e=>{const i=new Eu;e.accept(i),i.allProductions.forEach(i=>{const s=Zl(i),o=i.maxLookahead||t;if(0===lu(i.idx,e,s,o)[0].flat().length){const t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:rc.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}(e,t,$l)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,s){const o=au(e,t,n);return s(o,r,cu(o)?pl:fl,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Jl)}buildLookaheadForOptional(e){return function(e,t,n,r,i,s){const o=lu(e,t,i,n),a=cu(o)?pl:fl;return s(o[0],a,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Zl(e.prodType),eu)}}const Bu=new class extends ga{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function Uu(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset"function"==typeof e.GATE);return s.hasPredicates=o,n.definition.push(s),i.forEach(e=>{const t=new oa({definition:[]});s.definition.push(t),Object.hasOwn(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Object.hasOwn(e,"GATE")&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),Hu}function Zu(e){return 0===e?"":`${e}`}function Ju(e){if(e<0||e>zu){const t=new Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${zu+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}const ec=Pl(Ml,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ec);const tc=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Bl,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),nc=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var rc,ic,sc;!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"}(rc||(rc={}));class oc{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const t=this.className;this.TRACE_INIT("toFastProps",()=>{na(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(e=>{const t=this[e].originalGrammarAction;let n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=function(e){const t=Object.assign({errMsgProvider:Ul},e),n={};return e.rules.forEach(e=>{n[e.name]=e}),function(e,t){const n=new Gl(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(0===n.length&&!1===this.skipValidations){const e=function(e){var t;const n=null!==(t=e.errMsgProvider)&&void 0!==t?t:$l;return function(e,t,n,r){const i=e.flatMap(e=>function(e,t){const n=new fu;e.accept(n);const r=n.allProductions,i=Object.groupBy(r,hu),s=Object.fromEntries(Object.entries(i).filter(([e,t])=>t.length>1));return Object.values(s).map(n=>{const r=n[0],i=t.buildDuplicateFoundError(e,n),s=va(r),o={message:i,type:rc.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:s,occurrence:r.idx},a=du(r);return a&&(o.parameter=a),o})}(e,n)),s=function(e,t,n){const r=[],i=t.map(e=>e.name);return e.forEach(e=>{const t=e.name;if(i.includes(t)){const i=n.buildNamespaceConflictError(e);r.push({message:i,type:rc.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}(e,t,n),o=e.flatMap(e=>function(e,t){const n=new gu;return e.accept(n),n.alternations.flatMap(n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:rc.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}(e,n)),a=e.flatMap(t=>function(e,t,n,r){const i=[],s=t.reduce((t,n)=>n.name===e.name?t+1:t,0);if(s>1){const t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:rc.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n));return i.concat(s,o,a)}(e.rules,e.tokenTypes,n,e.grammarName)}({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:$l,grammarName:t}),n=function(e){return e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}).map(e=>Object.assign({type:rc.CUSTOM_LOOKAHEAD_VALIDATION},e))}({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(e,n)}}),0===this.definitionErrors.length&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const e=function(e){const t={};return e.forEach(e=>{const n=new _a(e).startWalking();Object.assign(t,n)}),t}(Object.values(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var e,t;null===(t=(e=this.lookaheadStrategy).initialize)||void 0===t||t.call(e,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!oc.DEFER_DEFINITION_ERRORS_HANDLING&&0!==this.definitionErrors.length)throw e=this.definitionErrors.map(e=>e.message),new Error(`Parser Definition Errors detected:\n ${e.join("\n-------------------------------\n")}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initGastRecorder(t),n.initPerformanceTracer(t),Object.hasOwn(t,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=Object.hasOwn(t,"skipValidations")?t.skipValidations:tc.skipValidations}}oc.DEFER_DEFINITION_ERRORS_HANDLING=!1,ic=oc,sc=[class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:tc.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Lu)}getTokenToInsert(e){const t=Pl(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let a=!1;const l=this.LA_FAST(1);let u=this.LA_FAST(1);const c=()=>{const e=this.LA(0),t=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),n=new bu(t,l,this.LA(0));n.resyncedTokens=o.slice(0,-1),this.SAVE_ERROR(n)};for(;!a;){if(this.tokenMatcher(u,r))return void c();if(n.call(this))return c(),void e.apply(this,t);this.tokenMatcher(u,i)?a=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o))}this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA_FAST(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getNextPossibleTokenTypes(e){const t=e.ruleStack[0],n=this.getGAstProductions()[t];return new Wl(n,e).startWalking()}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new Nu("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(0===t.length)return!1;const n=this.LA_FAST(1);return void 0!==t.find(e=>this.tokenMatcher(n,e))}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(t).includes(e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA_FAST(1),n=2;for(;;){const r=e.find(e=>fl(t,e));if(void 0!==r)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(0===this.RULE_STACK_IDX)return wu;const e=this.currRuleShortName,t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK,n=this.RULE_STACK_IDX+1,r=new Array(n);for(let i=0;ithis.getFollowSetFromFollowKey(e)).flat()}getFollowSetFromFollowKey(e){if(e===wu)return[Ml];const t=e.ruleName+e.idxInCallingRule+Aa+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Ml)||t.push(e),t}reSyncTo(e){const t=[];let n=this.LA_FAST(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return t.slice(0,-1)}attemptInRepetitionRecovery(e,t,n,r,i,s,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){const e=this.RULE_STACK_IDX+1,t=new Array(e);for(let n=0;n{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{const{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:o}=function(e){Bu.reset(),e.accept(Bu);const t=Bu.dslMethods;return Bu.reset(),t}(e);t.forEach(t=>{const n=0===t.idx?"":t.idx;this.TRACE_INIT(`${va(t)}${n}`,()=>{const n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=Mu(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),n.forEach(t=>{this.computeLookaheadFunc(e,t.idx,768,"Repetition",t.maxLookahead,va(t))}),r.forEach(t=>{this.computeLookaheadFunc(e,t.idx,512,"Option",t.maxLookahead,va(t))}),i.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Ou,"RepetitionMandatory",t.maxLookahead,va(t))}),s.forEach(t=>{this.computeLookaheadFunc(e,t.idx,ku,"RepetitionMandatoryWithSeparator",t.maxLookahead,va(t))}),o.forEach(t=>{this.computeLookaheadFunc(e,t.idx,Iu,"RepetitionWithSeparator",t.maxLookahead,va(t))})})})}computeLookaheadFunc(e,t,n,r,i,s){this.TRACE_INIT(`${s}${0===t?"":t}`,()=>{const s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=Mu(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,s)})}getKeyForAutomaticLookahead(e,t){return Mu(this.currRuleShortName,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:tc.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=$u,this.setNodeLocationFromNode=$u,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Uu,this.setNodeLocationFromNode=Uu,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{}}else this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{}}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA_FAST(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];var r,i,s;i=t,s=e,void 0===(r=n).children[s]?r.children[s]=[i]:r.children[s].push(i),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(void 0===this.baseCstVisitorConstructor){const e=function(e,t){const n=function(){};Gu(n,e+"BaseSemantics");const r={visit:function(e,t){if(Array.isArray(e)&&(e=e[0]),void 0!==e)return this[e.name](e.children,t)},validateVisitor:function(){const e=function(e,t){const n=function(e,t){return t.filter(t=>"function"==typeof e[t]==0).map(t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Wu.MISSING_METHOD,methodName:t})).filter(Boolean)}(e,t);return n}(this,t);if(0!==e.length){const t=e.map(e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g,"\n\t")}`)}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(void 0===this.baseCstVisitorWithDefaultsConstructor){const e=function(e,t,n){const r=function(){};Gu(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return t.forEach(e=>{i[e]=Vu}),(r.prototype=i).constructor=r,r}(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):ec}LA_FAST(e){const t=this.currIdx+e;return this.tokVector[t]}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?ec:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=pl,this.subruleIdx=0,this.currRuleShortName=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(Array.isArray(e)){if(0===e.length)throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(Array.isArray(e))this.tokensMap=e.reduce((e,t)=>(e[t.name]=t,e),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(Sl)){const t=Object.values(e.modes).flat(),n=[...new Set(t)];this.tokensMap=n.reduce((e,t)=>(e[t.name]=t,e),{})}else{if("object"!=typeof e||null===e)throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=Object.assign({},e)}this.tokensMap.EOF=Ml;const n=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every(e=>{var t;return 0==(null===(t=e.categoryMatches)||void 0===t?void 0:t.length)});this.tokenMatcher=n?pl:fl,El(Object.values(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const r=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:nc.resyncEnabled,i=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:nc.recoveryValueFunc,s=this.ruleShortNameIdx<<12;let o;return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,o=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n);const r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...t){this.onBeforeParse(e);try{return o.apply(this,t)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:t,coreRule:o})}invokeRuleCatch(e,t,n){const r=0===this.RULE_STACK_IDX,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(_u(e)){const t=e;if(i){const r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){const e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){const n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof e){r=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(Ou,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,Ou,e,Xl)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(ku,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,Ql.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Kl],t,ku,e,Kl)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.getLaFuncFromCache(n);if("function"!=typeof t){r=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let s=!0;for(;!0===i.call(this)&&!0===s;)s=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,jl,s)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(Iu,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){r.call(this);const t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,zl],t,Iu,e,zl)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,ku,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(256,t),r=Array.isArray(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX]),this.cstFinallyStateUpdate()}subruleInternal(e,t,n){let r;try{const i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.coreRule.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw _u(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{const t=this.LA_FAST(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r;const i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new bu(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;{const r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===Fu?n:e}}}saveRecogState(){const e=this.errors,t=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);const t=e.RULE_STACK;for(let e=0;e=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX])}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=n,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.cstInvocationStateUpdate(t)}isBackTracking(){return 0!==this.isBackTrackingStack.length}getCurrRuleFullName(){const e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ml)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let e=0;e${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:rc.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){var n;const r=null!==(n=e.coreRule)&&void 0!==n?n:e;return function(){this.isBackTrackingStack.push(1);const e=this.saveRecogState();try{return r.apply(this,t),!0}catch(e){if(_u(e))return!1;throw e}finally{this.reloadRecogState(e),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Object.values(this.gastProductionsCache).map(pa)}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:tc.errorMessageProvider}SAVE_ERROR(e){if(_u(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName(),i=lu(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],s=[];for(let e=1;e<=this.maxLookahead;e++)s.push(this.LA(e));const o=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:s,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new xu(o,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName(),r=au(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));const s=this.LA(0),o=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:s,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Tu(o,this.LA(1),s))}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const n=t>0?t:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return ec}topLevelRuleRecord(e,t){try{const n=new sa({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}}optionInternalRecord(e,t){return qu.call(this,aa,e,t)}atLeastOneInternalRecord(e,t){qu.call(this,la,t,e)}atLeastOneSepFirstInternalRecord(e,t){qu.call(this,ua,t,e,ju)}manyInternalRecord(e,t){qu.call(this,ca,t,e)}manySepFirstInternalRecord(e,t){qu.call(this,ha,t,e,ju)}orInternalRecord(e,t){return Qu.call(this,e,t)}subruleInternalRecord(e,t,n){if(Ju(t),!e||!Object.hasOwn(e,"ruleName")){const n=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=e.ruleName,s=new ia({idx:t,nonTerminalName:i,label:null==n?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(s),this.outputCst?Yu:Hu}consumeInternalRecord(e,t,n){if(Ju(t),!Cl(e)){const n=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}const r=this.recordingProdStack.at(-1),i=new fa({idx:t,terminalType:e,label:null==n?void 0:n.LABEL});return r.definition.push(i),Ku}},class{initPerformanceTracer(e){if(Object.hasOwn(e,"traceInitPerf")){const t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=tc.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent`);const{time:r,value:i}=dl(t),s=r>10?console.warn:console.log;return this.traceInitIndent time: ${r}ms`),this.traceInitIndent--,i}return t()}}],sc.forEach(e=>{const t=e.prototype;Object.getOwnPropertyNames(t).forEach(n=>{if("constructor"===n)return;const r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(ic.prototype,n,r):ic.prototype[n]=e.prototype[n]})});class ac extends oc{constructor(e,t=tc){const n=Object.assign({},t);n.outputCst=!1,super(e,n)}}function lc(e){return void 0!==e.lineNoCont?e.lineNoCont:e.startLine}class uc{visit(e){return e&&this[e.kind](e)}arraySpecifier(e){this.visit(e.size)}binaryExpression(e){this.visit(e.lhs),this.visit(e.rhs)}methodCall(e){this.visit(e.on),this.visit(e.functionCall)}functionCall(e){this.visit(e.callee);for(const t of e.args)this.visit(t)}arrayAccess(e){this.visit(e.on),this.visit(e.index)}translationUnit(e){for(const t of e.declarations)this.visit(t)}assignmentExpression(e){this.visit(e.lhs),this.visit(e.rhs)}fieldAccess(e){this.visit(e.on)}conditionalExpression(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}postfixExpression(e){this.visit(e.on)}commaExpression(e){this.visit(e.lhs),this.visit(e.rhs)}unaryExpression(e){this.visit(e.on)}functionDefinition(e){this.visit(e.returnType);for(const t of e.params)this.visit(t);this.visit(e.body)}functionPrototype(e){this.visit(e.returnType);for(const t of e.params)this.visit(t)}parameterDeclaration(e){this.visit(e.arraySpecifier),this.visit(e.typeSpecifier)}typeSpecifier(e){hc(e.typeSpecifierNonArray)&&this.visit(e.typeSpecifierNonArray),this.visit(e.arraySpecifier)}compoundStatement(e){for(const t of e.statements)this.visit(t)}returnStatement(e){this.visit(e.what)}continueStatement(e){}breakStatement(e){}discardStatement(e){}declarator(e){this.visit(e.arraySpecifier),this.visit(e.init)}doWhileStatement(e){this.visit(e.statement),this.visit(e.conditionExpression)}whileStatement(e){this.visit(e.conditionExpression),this.visit(e.statement)}forStatement(e){this.visit(e.initExpression),this.visit(e.conditionExpression),this.visit(e.loopExpression),this.visit(e.statement)}expressionStatement(e){this.visit(e.expression)}initDeclaratorListDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}precisionDeclaration(e){this.visit(e.typeSpecifierNoPrec)}selectionStatement(e){this.visit(e.condition),this.visit(e.yes),this.visit(e.no)}storageQualifier(e){}switchStatement(e){this.visit(e.initExpression);for(const t of e.cases)this.visit(t)}caseLabel(e){this.visit(e.case_)}caseBlock(e){this.visit(e.caseLabel);for(const t of e.statements)this.visit(t)}fullySpecifiedType(e){this.visit(e.typeQualifier),this.visit(e.typeSpecifier)}typeQualifier(e){this.visit(e.storageQualifier),this.visit(e.layoutQualifier)}structSpecifier(e){for(const t of e.declarations)this.visit(t)}layoutQualifier(e){}invariantDeclaration(e){}structDeclaration(e){this.visit(e.fsType);for(const t of e.declarators)this.visit(t)}variableExpression(e){}constantExpression(e){}uniformBlock(e){this.visit(e.typeQualifier);for(const t of e.declarations)this.visit(t);this.visit(e.arraySpecifier)}ppDefine(e){this.visit(e.node)}ppDir(e){}ppExtension(e){}ppCall(e){}ppPragma(e){}}function cc(e){return"tokenType"in e}function hc(e){return"kind"in e}function dc(e,t){const n=e.split("\n"),r=t.startLine,i=t.endLine;return"./src/compiler.lambda:"+r+":"+(t.startColumn-1)+"\n"+n.map((e,t)=>[t+1,e]).slice(r-2,i+2).map(([e,n])=>{var s,o,a;return e>=r&&e<=i&&(s=n,o=6+(r===e?t.startColumn-1:0),a=6+(i===e?t.endColumn:n.length),n=s+"\n"+"-".repeat(o)+"^".repeat(a-o)),(""+e).padStart(5)+" "+n}).join("\n")}const fc=["active","asm","atomic_uint","attribute","cast","class","coherent","common","double","dvec2","dvec3","dvec4","enum","extern","external","filter","fixed","fvec2","fvec3","fvec4","goto","half","hvec2","hvec3","hvec4","iimage1D","iimage1DArray","iimage2D","iimage2DArray","iimage3D","iimageBuffer","iimageCube","image1D","image1DArray","image2D","image2DArray","image3D","imageBuffer","imageCube","inline","input","interface","isampler1D","isampler1DArray","isampler2DMS","isampler2DMSArray","isampler2DRect","isamplerBuffer","long","namespace","noinline","noperspective","output","partition","patch","public","readonly","resource","restrict","sample","sampler1D","sampler1DArray","sampler1DArrayShadow","sampler1DShadow","sampler2DMS","sampler2DMSArray","sampler2DRect","sampler2DRectShadow","sampler3DRect","samplerBuffer","short","sizeof","static","subroutine","superp","template","this","typedef","uimage1D","uimage1DArray","uimage2D","uimage2DArray","uimage3D","uimageBuffer","uimageCube","union","unsigned","usampler1D","usampler1DArray","usampler2DMS","usampler2DMSArray","usampler2DRect","usamplerBuffer","using","volatile","volatile","writeonly"];var pc;!function(e){e.ASSIGN_OP=kl({name:"ASSIGN_OP",pattern:yl.NA}),e.UNARY_OP=kl({name:"UNARY_OP",pattern:yl.NA}),e.POSTFIX_OP=kl({name:"POSTFIX_OP",pattern:yl.NA}),e.PRECISION_QUALIFIER=kl({name:"PRECISION_QUALIFIER",pattern:yl.NA}),e.INTERPOLATION_QUALIFIER=kl({name:"INTERPOLATION_QUALIFIER",pattern:yl.NA}),e.MULTIPLICATIVE_OP=kl({name:"MULTIPLICATIVE_OP",pattern:yl.NA}),e.ADDITIVE_OP=kl({name:"ADDITIVE_OP",pattern:yl.NA}),e.SHIFT_OP=kl({name:"SHIFT_OP",pattern:yl.NA}),e.RELATIONAL_OP=kl({name:"RELATIONAL_OP",pattern:yl.NA}),e.EQUALITY_OP=kl({name:"EQUALITY_OP",pattern:yl.NA}),e.PARAMETER_QUALIFIER=kl({name:"PARAMETER_QUALIFIER",pattern:yl.NA}),e.WHITESPACE=kl({name:"WHITESPACE",pattern:/\s+/,group:yl.SKIPPED}),e.LINE_COMMENT=kl({name:"LINE_COMMENT",pattern:/\/\/[^\r\n]*/,group:"COMMENTS"}),e.MULTILINE_COMMENT=kl({name:"MULTILINE_COMMENT",pattern:/\/\*[\s\S]*?\*\//,group:"COMMENTS"}),e.MULASSIGN=kl({name:"MULASSIGN",pattern:"*=",label:"'*='",categories:e.ASSIGN_OP}),e.DIVASSIGN=kl({name:"DIVASSIGN",pattern:"/=",label:"'/='",categories:e.ASSIGN_OP}),e.MODASSIGN=kl({name:"MODASSIGN",pattern:"%=",label:"'%='",categories:e.ASSIGN_OP}),e.ADDASSIGN=kl({name:"ADDASSIGN",pattern:"+=",label:"'+='",categories:e.ASSIGN_OP}),e.SUBASSIGN=kl({name:"SUBASSIGN",pattern:"-=",label:"'-='",categories:e.ASSIGN_OP}),e.LEFTASSIGN=kl({name:"LEFTASSIGN",pattern:"<<=",label:"'<<='",categories:e.ASSIGN_OP}),e.RIGHTASSIGN=kl({name:"RIGHTASSIGN",pattern:">>=",label:"'>>='",categories:e.ASSIGN_OP}),e.ANDASSIGN=kl({name:"ANDASSIGN",pattern:"&=",label:"'&='",categories:e.ASSIGN_OP}),e.XORASSIGN=kl({name:"XORASSIGN",pattern:"^=",label:"'^='",categories:e.ASSIGN_OP}),e.ORASSIGN=kl({name:"ORASSIGN",pattern:"|=",label:"'|='",categories:e.ASSIGN_OP}),e.INC_OP=kl({name:"INC_OP",pattern:"++",label:"'++'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.QUESTION=kl({name:"QUESTION",pattern:"?",label:"'?'"}),e.COLON=kl({name:"COLON",pattern:":",label:"':'"}),e.DEC_OP=kl({name:"DEC_OP",pattern:"--",label:"'--'",categories:[e.UNARY_OP,e.POSTFIX_OP]}),e.AND_OP=kl({name:"AND_OP",pattern:"&&",label:"'&&'"}),e.XOR_OP=kl({name:"XOR_OP",pattern:"^^",label:"'^^'"}),e.OR_OP=kl({name:"OR_OP",pattern:"||",label:"'||'"}),e.LEFT_OP=kl({name:"LEFT_OP",pattern:"<<",label:"'<<'",categories:e.SHIFT_OP}),e.RIGHT_OP=kl({name:"RIGHT_OP",pattern:">>",label:"'>>'",categories:e.SHIFT_OP}),e.EQ_OP=kl({name:"EQ_OP",pattern:"==",label:"'=='",categories:e.EQUALITY_OP}),e.NE_OP=kl({name:"NE_OP",pattern:"!=",label:"'!='",categories:e.EQUALITY_OP}),e.LE_OP=kl({name:"LE_OP",pattern:"<=",label:"'<='",categories:e.RELATIONAL_OP}),e.GE_OP=kl({name:"GE_OP",pattern:">=",label:"'>='",categories:e.RELATIONAL_OP}),e.LEFT_ANGLE=kl({name:"LEFT_ANGLE",pattern:"<",label:"'<'",categories:e.RELATIONAL_OP}),e.RIGHT_ANGLE=kl({name:"RIGHT_ANGLE",pattern:">",label:"'>'",categories:e.RELATIONAL_OP}),e.PLUS=kl({name:"PLUS",pattern:"+",label:"'+'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.TILDE=kl({name:"TILDE",pattern:"~",label:"'~'",categories:e.UNARY_OP}),e.BANG=kl({name:"BANG",pattern:"!",label:"'!'",categories:e.UNARY_OP}),e.CARET=kl({name:"CARET",pattern:"^",label:"'^'"}),e.AMPERSAND=kl({name:"AND",pattern:"&",label:"'&'"}),e.VERTICAL_BAR=kl({name:"VERTICAL_BAR",pattern:"|",label:"'|'"}),e.SLASH=kl({name:"SLASH",pattern:"/",label:"'/'",categories:e.MULTIPLICATIVE_OP}),e.PERCENT=kl({name:"PERCENT",pattern:"%",label:"'%'",categories:e.MULTIPLICATIVE_OP}),e.STAR=kl({name:"STAR",pattern:"*",label:"'*'",categories:e.MULTIPLICATIVE_OP}),e.DASH=kl({name:"DASH",pattern:"-",label:"'-'",categories:[e.UNARY_OP,e.ADDITIVE_OP]}),e.COMMA=kl({name:"COMMA",pattern:",",label:"','"}),e.EQUAL=kl({name:"EQUAL",pattern:"=",label:"'='",categories:e.ASSIGN_OP}),e.LEFT_PAREN=kl({name:"LEFT_PAREN",pattern:"(",label:"'('"}),e.RIGHT_PAREN=kl({name:"RIGHT_PAREN",pattern:")",label:"')'"}),e.LEFT_BRACKET=kl({name:"LEFT_BRACKET",pattern:"[",label:"'['"}),e.RIGHT_BRACKET=kl({name:"RIGHT_BRACKET",pattern:"]",label:"']'"}),e.LEFT_BRACE=kl({name:"LEFT_BRACE",pattern:"{",label:"'{'"}),e.RIGHT_BRACE=kl({name:"RIGHT_BRACE",pattern:"}",label:"'}'"}),e.SEMICOLON=kl({name:"SEMICOLON",pattern:";",label:"';'"}),e.IDENTIFIER=kl({name:"IDENTIFIER",pattern:yl.NA}),e.NON_PP_IDENTIFIER=kl({name:"NON_PP_IDENTIFIER",pattern:/[a-z_]\w*/i,categories:e.IDENTIFIER}),e.PP=kl({name:"PP",pattern:yl.NA,categories:e.IDENTIFIER});const t=(t,n)=>kl({name:t,pattern:n,categories:e.PP,longer_alt:e.NON_PP_IDENTIFIER});e.DEFINE=t("DEFINE","define"),e.UNDEF=t("UNDEF","undef"),e.ENDIF=t("ENDIF","endif"),e.IFDEF=t("IFDEF","ifdef"),e.IFNDEF=t("IFNDEF","ifndef"),e.ELIF=t("ELIF","elif"),e.ERROR=t("ERROR","error"),e.VERSION=t("VERSION","version"),e.PRAGMA_DIRECTIVE=kl({name:"PRAGMA_DIRECTIVE",pattern:/#\s*pragma\s+[^\r\n]*/}),e.LINE=t("LINE","line"),e.EXTENSION=t("EXTENSION","extension"),e.INCLUDE=t("INCLUDE","include"),e.HASH_INCLUDE_MODULE=kl({name:"HASH_INCLUDE_MODULE",pattern:/#\s*include\s*<[\w\-./\\$@ ]+>/}),e.HASH=kl({name:"HASH",pattern:"#"}),e.KEYWORD=kl({name:"KEYWORD",pattern:yl.NA});const n=(t,n)=>kl({name:t,pattern:t.toLowerCase(),label:"'"+t.toLowerCase()+"'",longer_alt:e.NON_PP_IDENTIFIER,categories:n?[e.KEYWORD,n]:e.KEYWORD});e.CONST=n("CONST"),e.UNIFORM=n("UNIFORM"),e.LAYOUT=n("LAYOUT"),e.CENTROID=n("CENTROID"),e.FLAT=n("FLAT",e.INTERPOLATION_QUALIFIER),e.SMOOTH=n("SMOOTH",e.INTERPOLATION_QUALIFIER),e.BREAK=n("BREAK"),e.CONTINUE=n("CONTINUE"),e.DO=n("DO"),e.PRECISION=n("PRECISION"),e.FOR=n("FOR"),e.WHILE=n("WHILE"),e.SWITCH=n("SWITCH"),e.CASE=n("CASE"),e.DEFAULT=n("DEFAULT"),e.IF=n("IF"),e.ELSE=n("ELSE"),e.INVARIANT=n("INVARIANT"),e.INOUT=n("INOUT",e.PARAMETER_QUALIFIER),e.OUT=n("OUT",e.PARAMETER_QUALIFIER),e.VOID=n("VOID"),e.STRUCT=n("STRUCT"),e.DISCARD=n("DISCARD"),e.RETURN=n("RETURN"),e.LOWP=n("LOWP",e.PRECISION_QUALIFIER),e.MEDIUMP=n("MEDIUMP",e.PRECISION_QUALIFIER),e.HIGHP=n("HIGHP",e.PRECISION_QUALIFIER),e.CONSTANT=kl({name:"CONSTANT",pattern:yl.NA}),e.BASIC_TYPE=kl({name:"BASIC_TYPE",pattern:yl.NA});const r=t=>kl({name:t.toUpperCase(),pattern:t,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE});e.BOOL=r("bool"),e.INT=r("int"),e.FLOAT=r("float"),e.MAT2X3=r("mat2x3"),e.MAT2X4=r("mat2x4"),e.MAT2X2=kl({name:"mat2x2".toUpperCase(),pattern:/mat2(?:x2)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat2"}),e.MAT3X2=r("mat3x2"),e.MAT3X4=r("mat3x4"),e.MAT3X3=kl({name:"mat3x3".toUpperCase(),pattern:/mat3(?:x3)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat3"}),e.MAT4X2=r("mat4x2"),e.MAT4X3=r("mat4x3"),e.MAT4X4=kl({name:"MAT4X4",pattern:/mat4(?:x4)?/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.BASIC_TYPE,label:"mat4"}),e.VEC2=r("vec2"),e.VEC3=r("vec3"),e.VEC4=r("vec4"),e.IVEC2=r("ivec2"),e.IVEC3=r("ivec3"),e.IVEC4=r("ivec4"),e.BVEC2=r("bvec2"),e.BVEC3=r("bvec3"),e.BVEC4=r("bvec4"),e.UINT=r("uint"),e.UVEC2=r("uvec2"),e.UVEC3=r("uvec3"),e.UVEC4=r("uvec4"),e.USAMPLERCUBE=r("usamplerCube"),e.USAMPLER3D=r("usampler3D"),e.USAMPLER2DARRAY=r("usampler2DArray"),e.USAMPLER2D=r("usampler2D"),e.SAMPLERCUBESHADOW=r("samplerCubeShadow"),e.SAMPLERCUBE=r("samplerCube"),e.SAMPLER3D=r("sampler3D"),e.SAMPLER2DSHADOW=r("sampler2DShadow"),e.SAMPLER2DARRAYSHADOW=r("sampler2DArrayShadow"),e.SAMPLER2DARRAY=r("sampler2DArray"),e.SAMPLER2D=r("sampler2D"),e.ISAMPLERCUBE=r("isamplerCube"),e.ISAMPLER3D=r("isampler3D"),e.ISAMPLER2DARRAY=r("isampler2DArray"),e.ISAMPLER2D=r("isampler2D"),e.IN=n("IN",e.PARAMETER_QUALIFIER),e.VARYING=n("VARYING"),e.ATTRIBUTE=n("ATTRIBUTE"),e.BOOLCONSTANT=kl({name:"BOOLCONSTANT",pattern:/true|false/,longer_alt:e.NON_PP_IDENTIFIER,categories:e.CONSTANT}),e.FLOATCONSTANT=kl({name:"FLOATCONSTANT",pattern:/((\d+\.\d*|\.\d+)(e[+-]?\d+)?|\d+e[+-]?\d+)f?/i,categories:e.CONSTANT}),e.DOT=kl({name:"DOT",pattern:".",label:"'.'"}),e.UINTCONSTANT=kl({name:"UINTCONSTANT",pattern:/0x[\da-f]+u|\d+u/i,categories:e.CONSTANT}),e.INTCONSTANT=kl({name:"INTCONSTANT",pattern:/0x[\da-f]+|\d+/i,categories:e.CONSTANT}),e.STRING=kl({name:"STRING",pattern:/"([^"\\]+|\\")+"/})}(pc||(pc={}));const mc=Object.values(pc).filter(e=>e!==pc.NON_PP_IDENTIFIER).flatMap(e=>Array.isArray(e)?e:[e]);mc.push(pc.NON_PP_IDENTIFIER);const gc=new yl(mc,{ensureOptimizations:!1});new class extends uc{constructor(){super(...arguments),this.markError=()=>{}}eval(e,t,n){return this.isDefined=t,this.markError=n,super.visit(e)}constantExpression(e){if(e.const_.tokenType!==pc.INTCONSTANT)throw new Error("XX");return+e.const_.image}unaryExpression(e){switch(e.op.tokenType){case pc.NON_PP_IDENTIFIER:return+this.isDefined(e.on.var.image);case pc.DASH:return-this.visit(e.on);case pc.TILDE:return~this.visit(e.on);case pc.BANG:return+!this.visit(e.on);case pc.PLUS:return this.visit(e.on);default:throw new Error(e.op.tokenType.name)}}binaryExpression(e){const t=this.visit(e.lhs);switch(e.op.tokenType){case pc.AND_OP:return t&&this.visit(e.rhs);case pc.OR_OP:return t||this.visit(e.rhs);default:{const n=this.visit(e.rhs);return 0|function(e,t,n){switch(e){case pc.PLUS:return t+n;case pc.DASH:return t-n;case pc.STAR:return t*n;case pc.PERCENT:return t%n;case pc.SLASH:return t/n;case pc.LEFT_OP:return t<>n;case pc.EQ_OP:return t===n;case pc.NE_OP:return t!==n;case pc.LE_OP:return t<=n;case pc.GE_OP:return t>=n;case pc.LEFT_ANGLE:return tn;case pc.XOR_OP:return t!==n;case pc.AND_OP:return t&&n;case pc.OR_OP:return t||n;case pc.AMPERSAND:return t&n;case pc.CARET:return t^n;case pc.VERTICAL_BAR:return t|n;default:throw new Error}}(e.op.tokenType,t,n)}}}variableExpression(e){return this.markError("P0001",e.var,"undefined identifier "+e.var.image),0}};const Ec=new class extends ac{getTokensOnLine(){const e=[],t=lc(this.LA(0));let n;for(;lc(n=this.LA(1))===t;)e.push(n),this.SKIP_TOKEN();return e}constructor(){super(mc,{skipValidations:!0}),this.multiplicativeExpression=this.RR("multiplicativeExpression",()=>this.LEFT_ASSOC(this.preprocessing?this.ppUnaryExpression:this.unaryExpression,pc.MULTIPLICATIVE_OP)),this.additiveExpression=this.RR("additiveExpression",()=>this.LEFT_ASSOC(this.multiplicativeExpression,pc.ADDITIVE_OP)),this.shiftExpression=this.RR("shiftExpression",()=>this.LEFT_ASSOC(this.additiveExpression,pc.SHIFT_OP)),this.relationalExpression=this.RR("relationalExpression",()=>this.LEFT_ASSOC(this.shiftExpression,pc.RELATIONAL_OP)),this.equalityExpression=this.RR("equalityExpression",()=>this.LEFT_ASSOC(this.relationalExpression,pc.EQUALITY_OP)),this.andExpression=this.RR("andExpression",()=>this.LEFT_ASSOC(this.equalityExpression,pc.AMPERSAND)),this.exclusiveOrExpression=this.RR("exclusiveOrExpression",()=>this.LEFT_ASSOC(this.andExpression,pc.CARET)),this.inclusiveOrExpression=this.RR("inclusiveOrExpression",()=>this.LEFT_ASSOC(this.exclusiveOrExpression,pc.VERTICAL_BAR)),this.logicalAndExpression=this.RR("logicalAndExpression",()=>this.LEFT_ASSOC(this.inclusiveOrExpression,pc.AND_OP)),this.logicalXorExpression=this.RR("logicalXorExpression",()=>this.LEFT_ASSOC(this.logicalAndExpression,pc.XOR_OP)),this.logicalOrExpression=this.RR("logicalOrExpression",()=>this.LEFT_ASSOC(this.logicalXorExpression,pc.OR_OP)),this.assignmentExpression=this.RR("assignmentExpression",()=>{const e=this.SUBRULE(this.conditionalExpression);return this.OPTION(()=>{const t=this.CONSUME(pc.ASSIGN_OP),n=this.SUBRULE1(this.assignmentExpression);return{kind:"assignmentExpression",lhs:e,op:t,rhs:n}})??e}),this.expression=this.RR("expression",()=>{let e;return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.SUBRULE(this.assignmentExpression);return e=e?{kind:"commaExpression",lhs:e,rhs:t}:t}}),e}),this.conditionalExpression=this.RR("conditionalExpression",()=>{const e=this.SUBRULE1(this.logicalOrExpression);return this.OPTION(()=>({kind:"conditionalExpression",condition:e,QUESTION:this.CONSUME(pc.QUESTION),yes:this.SUBRULE2(this.expression),COLON:this.CONSUME(pc.COLON),no:this.SUBRULE3(this.assignmentExpression)}))??e}),this.switchStatement=this.RR("switchStatement",()=>{this.CONSUME(pc.SWITCH),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);this.CONSUME(pc.RIGHT_PAREN),this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.caseBlock))),this.CONSUME(pc.RIGHT_BRACE),{kind:"switchStatement",initExpression:e,cases:t}}),this.caseBlock=this.RR("caseBlock",()=>{const e=this.SUBRULE(this.caseLabel),t=[];return this.MANY1(()=>t.push(this.SUBRULE(this.statement))),{kind:"caseBlock",caseLabel:e,statements:t}}),this.jumpStatement=this.RR("jumpStatement",()=>{const e=this.OR([{ALT:()=>(this.CONSUME(pc.CONTINUE),{kind:"continueStatement"})},{ALT:()=>(this.CONSUME(pc.BREAK),{kind:"breakStatement"})},{ALT:()=>(this.CONSUME(pc.DISCARD),{kind:"discardStatement"})},{ALT:()=>(this.CONSUME(pc.RETURN),{kind:"returnStatement",what:this.OPTION(()=>this.SUBRULE(this.expression))})}]);return this.CONSUME(pc.SEMICOLON),e}),this.primaryExpression=this.RR("primaryExpression",()=>this.OR([{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),e}},{ALT:()=>({kind:"variableExpression",var:this.CONSUME(pc.IDENTIFIER)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.CONSTANT)})}])),this.constantExpression=this.RR("constantExpression",()=>this.SUBRULE(this.conditionalExpression)),this.layoutQualifier=this.RR("layoutQualifier",()=>{this.CONSUME(pc.LAYOUT),this.CONSUME(pc.LEFT_PAREN);const e=[];return this.AT_LEAST_ONE_SEP({SEP:pc.COMMA,DEF:()=>{const t=this.CONSUME(pc.IDENTIFIER);let n;this.OPTION(()=>{this.CONSUME(pc.EQUAL),n=this.OR([{ALT:()=>this.CONSUME(pc.INTCONSTANT)},{ALT:()=>this.CONSUME(pc.UINTCONSTANT)}])}),e.push({IDENTIFIER:t,init:n})}}),this.CONSUME(pc.RIGHT_PAREN),{kind:"layoutQualifier",layoutQualifierIds:e}}),this.storageQualifier=this.RR("storageQualifier",()=>{let e,t,n,r,i,s,o;return this.OR([{ALT:()=>e=this.CONSUME(pc.CONST)},{ALT:()=>{t=this.OPTION(()=>this.CONSUME(pc.CENTROID)),this.OR9([{ALT:()=>n=this.CONSUME(pc.IN)},{ALT:()=>r=this.CONSUME(pc.OUT)},{ALT:()=>s=this.CONSUME(pc.VARYING)},{ALT:()=>o=this.CONSUME(pc.ATTRIBUTE)}])}},{ALT:()=>i=this.CONSUME(pc.UNIFORM)}]),{kind:"storageQualifier",CONST:e,CENTROID:t,IN:n,OUT:r,VARYING:s,ATTRIBUTE:o,UNIFORM:i}}),this.typeQualifier=this.RR("typeQualifier",()=>{let e,t,n,r;return this.OR([{ALT:()=>e=this.SUBRULE(this.storageQualifier)},{ALT:()=>{t=this.SUBRULE1(this.layoutQualifier),e=this.OPTION1(()=>this.SUBRULE2(this.storageQualifier))}},{ALT:()=>{n=this.CONSUME(pc.INTERPOLATION_QUALIFIER),e=this.OPTION2(()=>this.SUBRULE3(this.storageQualifier))}},{ALT:()=>{r=this.CONSUME(pc.INVARIANT),n=this.OPTION3(()=>this.CONSUME1(pc.INTERPOLATION_QUALIFIER)),e=this.SUBRULE7(this.storageQualifier)}}]),{kind:"typeQualifier",storageQualifier:e,layoutQualifier:t,interpolationQualifier:n,invariantQualifier:r}}),this.precisionQualifier=this.RR("precisionQualifier",()=>this.CONSUME(pc.PRECISION_QUALIFIER)),this.arraySpecifier=this.RR("arraySpecifier",()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.OPTION3(()=>this.SUBRULE(this.constantExpression));return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arraySpecifier",size:e}}),this.typeSpecifierNonArray=this.RR("typeSpecifierNonArray",()=>this.OR([{ALT:()=>this.CONSUME(pc.BASIC_TYPE)},{ALT:()=>this.CONSUME(pc.VOID)},{ALT:()=>this.SUBRULE(this.structSpecifier)},{ALT:()=>this.CONSUME(pc.IDENTIFIER)}])),this.typeSpecifierNoPrec=this.RR("typeSpecifierNoPrec",()=>{const e=this.SUBRULE(this.typeSpecifierNonArray);return{kind:"typeSpecifier",precisionQualifier:void 0,arraySpecifier:this.OPTION1(()=>this.SUBRULE(this.arraySpecifier)),typeSpecifierNonArray:e}}),this.functionCall=this.RR("functionCall",()=>{const e=this.SUBRULE(this.typeSpecifierNoPrec);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({DEF:()=>t.push(this.SUBRULE(this.assignmentExpression)),SEP:pc.COMMA}),this.CONSUME(pc.RIGHT_PAREN),{kind:"functionCall",callee:e,args:t}}),this.functionCallHeader=this.RULE("functionCallHeader",()=>{this.SUBRULE(this.typeSpecifierNoPrec),this.CONSUME(pc.LEFT_PAREN)}),this.postfixExpression=this.RR("postfixExpression",()=>{const e=this.LA(1);let t=this.OR1([{GATE:this.BACKTRACK(this.functionCallHeader),ALT:()=>this.SUBRULE1(this.functionCall)},{ALT:()=>this.SUBRULE(this.primaryExpression)}]);return this.MANY(()=>{t=this.OR2([{ALT:()=>{this.CONSUME(pc.LEFT_BRACKET);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_BRACKET),{kind:"arrayAccess",on:t,index:e}}},{ALT:()=>{this.CONSUME1(pc.DOT);const e=this.SUBRULE2(this.functionCall);return{kind:"methodCall",on:t,functionCall:e}}},{ALT:()=>{this.CONSUME2(pc.DOT);const e=this.CONSUME(pc.IDENTIFIER);return{kind:"fieldAccess",on:t,field:e}}},{ALT:()=>{const e=this.CONSUME(pc.POSTFIX_OP);return{kind:"postfixExpression",on:t,op:e}}}]),this.FINALIZE(t,e)}),t}),this.unaryExpression=this.RR("unaryExpression",()=>this.OR([{ALT:()=>this.SUBRULE1(this.postfixExpression)},{ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.UNARY_OP),on:this.SUBRULE2(this.unaryExpression)})}])),this.ppUnaryExpression=this.RR("ppUnaryExpression",()=>this.OR([{GATE:()=>this.LA(1).tokenType===pc.NON_PP_IDENTIFIER&&"defined"===this.LA(1).image,ALT:()=>({kind:"unaryExpression",op:this.CONSUME(pc.IDENTIFIER),on:{kind:"variableExpression",var:this.OR1([{ALT:()=>this.SUBRULE(this.ppIdentifier)},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE1(this.ppIdentifier);return this.CONSUME(pc.RIGHT_PAREN),e}}])}})},{ALT:()=>({kind:"unaryExpression",op:this.OR2([{ALT:()=>this.CONSUME(pc.PLUS)},{ALT:()=>this.CONSUME(pc.DASH)},{ALT:()=>this.CONSUME(pc.TILDE)},{ALT:()=>this.CONSUME(pc.BANG)}]),on:this.SUBRULE2(this.ppUnaryExpression)})},{ALT:()=>this.SUBRULE(this.ppPrimaryExpression)}])),this.ppPrimaryExpression=this.RR("ppPrimaryExpression",()=>this.OR([{ALT:()=>({kind:"variableExpression",var:this.SUBRULE(this.ppIdentifier)})},{ALT:()=>({kind:"constantExpression",const_:this.CONSUME(pc.INTCONSTANT)})},{ALT:()=>{this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.ppConstantExpression);return this.CONSUME(pc.RIGHT_PAREN),e}}])),this.ppConstantExpression=this.RR("ppConstantExpression",()=>{try{return this.preprocessing=!0,this.LEFT_ASSOC(this.logicalAndExpression,pc.OR_OP)}finally{this.preprocessing=!1}}),this.typeSpecifier=this.RR("typeSpecifier",()=>{const e=this.OPTION(()=>this.SUBRULE(this.precisionQualifier)),t=this.SUBRULE(this.typeSpecifierNoPrec);return Object.assign({},t,{precisionQualifier:e})}),this.parameterDeclaration=this.RR("parameterDeclaration",()=>{const e=this.OPTION(()=>this.CONSUME(pc.CONST)),t=this.OPTION1(()=>this.CONSUME(pc.PARAMETER_QUALIFIER)),n=this.SUBRULE(this.typeSpecifier);let r,i;return this.OPTION2(()=>{r=this.CONSUME2(pc.IDENTIFIER),i=this.OPTION3(()=>this.SUBRULE(this.arraySpecifier))}),{kind:"parameterDeclaration",parameterTypeQualifier:e,pName:r,arraySpecifier:i,parameterQualifier:t,typeSpecifier:n}}),this.fullySpecifiedType=this.RR("fullySpecifiedType",()=>({kind:"fullySpecifiedType",typeQualifier:this.OPTION(()=>this.SUBRULE(this.typeQualifier)),typeSpecifier:this.SUBRULE(this.typeSpecifier)})),this.structDeclaration=this.RR("structDeclaration",()=>{const e=this.SUBRULE(this.fullySpecifiedType),t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME(pc.IDENTIFIER),arraySpecifier:this.OPTION(()=>this.SUBRULE(this.arraySpecifier)),init:void 0};return t.push(e),e})}),this.CONSUME(pc.SEMICOLON),{kind:"structDeclaration",fsType:e,declarators:t}}),this.structSpecifier=this.RR("structSpecifier",()=>{this.CONSUME(pc.STRUCT);const e=this.OPTION2(()=>this.CONSUME(pc.IDENTIFIER));this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),{kind:"structSpecifier",name:e,declarations:t}}),this.initializer=this.RR("initializer",()=>this.SUBRULE(this.assignmentExpression)),this.singleDeclaration=this.RULE("singleDeclaration",()=>this.OR([{ALT:()=>{this.SUBRULE(this.fullySpecifiedType),this.OPTION1(()=>{this.CONSUME1(pc.IDENTIFIER),this.OPTION2(()=>{this.CONSUME(pc.LEFT_BRACKET),this.OPTION3(()=>this.SUBRULE(this.constantExpression)),this.CONSUME(pc.RIGHT_BRACKET)}),this.OPTION4(()=>{this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)})})}},{ALT:()=>({kind:"invariantDeclaration",INVARIANT:this.CONSUME(pc.INVARIANT),IDENTIFIER:this.CONSUME2(pc.IDENTIFIER)})}])),this.initDeclaratorList=this.RR("initDeclaratorList",()=>this.SUBRULE(this.externalDeclaration,{ARGS:[!1,!1]})),this.expressionStatement=this.RR("expressionStatement",()=>{const e=this.OPTION(()=>this.SUBRULE(this.expression));return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:e}}),this.condition=this.RR("condition",()=>this.OR({MAX_LOOKAHEAD:4,DEF:[{GATE:this.BACKTRACK(this.singleDeclaration),ALT:()=>{const e=this.SUBRULE2(this.fullySpecifiedType),t=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.EQUAL),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:[{kind:"declarator",name:t,init:this.SUBRULE3(this.initializer),arraySpecifier:void 0}]}}},{ALT:()=>this.SUBRULE(this.expression)}]})),this.caseLabel=this.RR("caseLabel",()=>this.OR([{ALT:()=>{this.CONSUME(pc.CASE);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.COLON),{kind:"caseLabel",case_:e}}},{ALT:()=>(this.CONSUME2(pc.DEFAULT),this.CONSUME2(pc.COLON),{kind:"caseLabel",case_:void 0})}])),this.selectionStatement=this.RR("selectionStatement",()=>{this.CONSUME(pc.IF),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.expression);return this.CONSUME(pc.RIGHT_PAREN),{kind:"selectionStatement",condition:e,yes:this.SUBRULE2(this.statement,{ARGS:[!0]}),no:this.OPTION(()=>(this.CONSUME(pc.ELSE),this.SUBRULE3(this.statement,{ARGS:[!0]})))}}),this.statement=this.RR("statement",e=>this.OR([{ALT:()=>this.SUBRULE(this.ppDirective),IGNORE_AMBIGUITIES:!0},{ALT:()=>{const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.SEMICOLON),{kind:"expressionStatement",expression:{kind:"variableExpression",var:e}}},IGNORE_AMBIGUITIES:!0},{GATE:this.BACKTRACK(this.expressionStatement),ALT:()=>this.SUBRULE(this.expressionStatement)},{ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.selectionStatement)},{ALT:()=>this.SUBRULE(this.switchStatement)},{ALT:()=>this.SUBRULE(this.iterationStatement)},{ALT:()=>this.SUBRULE(this.jumpStatement)},{ALT:()=>this.SUBRULE(this.compoundStatement,{ARGS:[!!e]})}])),this.compoundStatement=this.RR("compoundStatement",e=>{if("object"==typeof e)throw new Error;this.CONSUME(pc.LEFT_BRACE);const t=[];return this.MANY(()=>t.push(this.SUBRULE(this.statement))),this.CONSUME(pc.RIGHT_BRACE),{kind:"compoundStatement",statements:t,newScope:!!e}}),this.iterationStatement=this.RR("iterationStatement",()=>this.OR([{ALT:()=>{this.CONSUME(pc.WHILE),this.CONSUME(pc.LEFT_PAREN);const e=this.SUBRULE(this.condition);return this.CONSUME(pc.RIGHT_PAREN),{kind:"whileStatement",conditionExpression:e,statement:this.SUBRULE(this.statement)}}},{ALT:()=>{this.CONSUME2(pc.DO);const e=this.SUBRULE2(this.statement,{ARGS:[!0]});this.CONSUME2(pc.WHILE),this.CONSUME2(pc.LEFT_PAREN);const t=this.SUBRULE2(this.expression);return this.CONSUME2(pc.RIGHT_PAREN),this.CONSUME2(pc.SEMICOLON),{kind:"doWhileStatement",statement:e,conditionExpression:t}}},{ALT:()=>{this.CONSUME3(pc.FOR),this.CONSUME3(pc.LEFT_PAREN);const e=this.OR3([{GATE:this.BACKTRACK(this.initDeclaratorList),ALT:()=>this.SUBRULE(this.initDeclaratorList)},{ALT:()=>this.SUBRULE(this.expressionStatement)}]),t=this.OPTION3(()=>this.SUBRULE3(this.condition));this.CONSUME4(pc.SEMICOLON);const n=this.OPTION4(()=>this.SUBRULE4(this.expression));return this.CONSUME3(pc.RIGHT_PAREN),{kind:"forStatement",initExpression:e,conditionExpression:t,loopExpression:n,statement:this.SUBRULE3(this.statement)}}}])),this.translationUnit=this.RR("translationUnit",()=>{const e=[];return this.AT_LEAST_ONE(()=>e.push(this.SUBRULE(this.externalDeclaration,{ARGS:[!0,!0]}))),{kind:"translationUnit",declarations:e}}),this.uniformBlock=this.RR("uniformBlock",()=>{const e=this.SUBRULE(this.typeQualifier),t=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_BRACE);const n=[];let r,i;return this.MANY(()=>n.push(this.SUBRULE(this.structDeclaration))),this.CONSUME(pc.RIGHT_BRACE),this.OPTION(()=>{r=this.CONSUME1(pc.IDENTIFIER),i=this.OPTION1(()=>this.SUBRULE(this.arraySpecifier))}),this.CONSUME(pc.SEMICOLON),{kind:"uniformBlock",typeQualifier:e,blockName:t,declarations:n,namespace:r,arraySpecifier:i}}),this.uniformBlockHeader=this.RULE("uniformBlockHeader",()=>{this.OPTION(()=>this.SUBRULE(this.layoutQualifier)),this.CONSUME(pc.UNIFORM),this.CONSUME(pc.IDENTIFIER),this.CONSUME(pc.LEFT_BRACE)}),this.typeQualifierDeclaration=this.RR("typeQualifierDeclaration",()=>{const e=this.SUBRULE(this.typeQualifier);return this.CONSUME(pc.SEMICOLON),{kind:"typeQualifierDeclaration",typeQualifier:e}}),this.externalDeclaration=this.RR("externalDeclaration",(e,t)=>this.OR([{ALT:()=>this.SUBRULE(this.ppCall)},{ALT:()=>this.SUBRULE(this.ppDirective)},{GATE:this.BACKTRACK(this.typeQualifierDeclaration),ALT:()=>this.SUBRULE(this.typeQualifierDeclaration)},{GATE:e?this.BACKTRACK(this.uniformBlockHeader):()=>!1,ALT:()=>this.SUBRULE(this.uniformBlock)},{ALT:()=>{const e=this.SUBRULE(this.fullySpecifiedType);return this.OR2([{GATE:t?void 0:()=>!1,ALT:()=>{const t=this.CONSUME1(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const n=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>n.push(this.SUBRULE(this.parameterDeclaration))}),this.CONSUME(pc.RIGHT_PAREN),this.OR3([{ALT:()=>(this.CONSUME(pc.SEMICOLON),{kind:"functionPrototype",name:t,returnType:e,params:n})},{ALT:()=>{const r=this.SUBRULE(this.compoundStatement);return{kind:"functionDefinition",name:t,returnType:e,params:n,body:r}},IGNORE_AMBIGUITIES:!1}])}},{ALT:()=>{const t=[];return this.MANY_SEP2({SEP:pc.COMMA,DEF:this.ANNOTATE(()=>{const e={kind:"declarator",name:this.CONSUME3(pc.IDENTIFIER),arraySpecifier:this.OPTION5(()=>this.SUBRULE(this.arraySpecifier)),init:this.OPTION7(()=>(this.CONSUME(pc.EQUAL),this.SUBRULE(this.initializer)))};return t.push(e),e})}),this.CONSUME2(pc.SEMICOLON),{kind:"initDeclaratorListDeclaration",fsType:e,declarators:t}}}])}},{ALT:()=>{this.CONSUME(pc.PRECISION);const e=this.CONSUME(pc.PRECISION_QUALIFIER),t=this.SUBRULE(this.typeSpecifierNoPrec);return this.CONSUME3(pc.SEMICOLON),{kind:"precisionDeclaration",precisionQualifier:e,typeSpecifierNoPrec:t}}}])),this.ppDefine=this.RR("ppDefine",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.DEFINE);const e=this.CONSUME(pc.IDENTIFIER),t=this.LA(1).tokenType===pc.LEFT_PAREN&&e.endOffset+1===this.LA(1).startOffset,n={kind:"ppDefine",what:e,params:this.OPTION({GATE:()=>t,DEF:()=>{this.CONSUME(pc.LEFT_PAREN);const e=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>e.push(this.SUBRULE(this.ppIdentifier))}),this.CONSUME(pc.RIGHT_PAREN),e}}),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(n),n}),this.ppInclude=this.RR("ppInclude",()=>{let e="";return this.OR([{ALT:()=>{const t=this.CONSUME(pc.HASH_INCLUDE_MODULE);e=t.image.substring(t.image.indexOf("<"))}},{ALT:()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.INCLUDE),e=this.CONSUME(pc.STRING).image}}]),{kind:"ppInclude",what:e}}),this.ppCall=this.RR("ppCall",()=>{const e=this.CONSUME(pc.IDENTIFIER);this.CONSUME(pc.LEFT_PAREN);const t=[];return this.MANY_SEP({SEP:pc.COMMA,DEF:()=>{const e=[];this.MANY(()=>this.OR({DEF:[{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>e.push(this.CONSUME(pc.BASIC_TYPE))},{ALT:()=>e.push(this.CONSUME(pc.ASSIGN_OP))},{ALT:()=>e.push(this.CONSUME(pc.SHIFT_OP))},{ALT:()=>e.push(this.CONSUME(pc.CONSTANT))},{ALT:()=>e.push(this.CONSUME(pc.KEYWORD))},{ALT:()=>e.push(this.CONSUME2(pc.IDENTIFIER))}]})),t.push({tokens:e,node:void 0})},MAX_LOOKAHEAD:1}),this.CONSUME(pc.RIGHT_PAREN),{kind:"ppCall",callee:e,args:t}}),this.ppCallArg=this.RULE("ppCallArg",()=>{const e=[];return e.push(this.CONSUME(pc.LEFT_PAREN)),this.MANY(()=>this.OR([{ALT:()=>{const t=this.SUBRULE(this.ppCallArg);this.ACTION(()=>e.push(...t))}},{ALT:()=>(e.push(this.LA(1)),this.SKIP_TOKEN())}])),e.push(this.CONSUME(pc.RIGHT_PAREN)),e}),this.ppNone=this.RR("ppNone",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.ELSE)},{ALT:()=>this.CONSUME(pc.ENDIF)}]),tokens:[],node:void 0};return this.ppDefs.push(e),e}),this.ppMulti=this.RR("ppMulti",()=>{this.CONSUME(pc.HASH);const e={kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IF)},{ALT:()=>this.CONSUME(pc.ELIF)},{ALT:()=>this.CONSUME(pc.ERROR)},{ALT:()=>this.CONSUME(pc.VERSION)},{ALT:()=>this.CONSUME(pc.LINE)}]),tokens:this.getTokensOnLine(),node:void 0};return this.ppDefs.push(e),e}),this.ppPragma=this.RR("ppPragma",()=>({kind:"ppPragma",dir:this.CONSUME(pc.PRAGMA_DIRECTIVE)})),this.ppSingle=this.RR("ppSingle",()=>(this.CONSUME(pc.HASH),{kind:"ppDir",dir:this.OR([{ALT:()=>this.CONSUME(pc.IFDEF)},{ALT:()=>this.CONSUME(pc.IFNDEF)}]),tokens:[this.CONSUME(pc.IDENTIFIER)],node:void 0})),this.ppExtension=this.RR("ppExtension",()=>{this.CONSUME(pc.HASH),this.CONSUME(pc.EXTENSION);const e=this.CONSUME(pc.IDENTIFIER);return this.CONSUME(pc.COLON),{kind:"ppExtension",extension:e,behavior:this.CONSUME1(pc.IDENTIFIER)}}),this.ppDirective=this.RR("ppDirective",()=>this.OR([{ALT:()=>this.SUBRULE(this.ppDefine)},{ALT:()=>this.SUBRULE(this.ppExtension)},{ALT:()=>this.SUBRULE(this.ppNone)},{ALT:()=>this.SUBRULE(this.ppSingle)},{ALT:()=>this.SUBRULE(this.ppMulti)},{ALT:()=>this.SUBRULE(this.ppPragma)},{ALT:()=>this.SUBRULE(this.ppInclude)}])),this.ppIdentifier=this.RR("ppIdentifier",()=>this.OR([{ALT:()=>this.CONSUME(pc.IDENTIFIER)},{ALT:()=>this.CONSUME(pc.KEYWORD)},{ALT:()=>this.CONSUME(pc.BASIC_TYPE)}])),this.ppDefs=[],this.performSelfAnalysis()}reset(){super.reset(),this.ppDefs=[],this.backtracking=!1,this.preprocessing=!1}LEFT_ASSOC(e,t){const n=this.LA(1);let r=this.SUBRULE1(e);return this.MANY(()=>{const i=this.CONSUME(t),s=this.SUBRULE2(e);return r={kind:"binaryExpression",lhs:r,rhs:s,op:i,firstToken:n,lastToken:this.LA(0)},r}),r}ANNOTATE(e){return(...t)=>{const n=this.LA(1),r=e(...t);return r&&hc(r)&&!r.firstToken&&this.FINALIZE(r,n),r}}BACKTRACK(e,t){const n=super.BACKTRACK(e,t);return function(){try{return this.backtracking=!0,n.call(this)}finally{this.backtracking=!1}}}RR(e,t,n){return super.RULE(e,this.ANNOTATE(t),n)}FINALIZE(e,t){this.RECORDING_PHASE||this.backtracking||(e.firstToken=t,e.lastToken=this.LA(0))}isAtEof(){return this.LA(1).tokenType===Ml}};const{ll:{printDocToString:vc},LX:{indentIfBreak:Cc,group:Dc,indent:Sc,join:Ac,line:_c,softline:yc,hardline:bc,fill:Tc,lineSuffixBoundary:Rc}}=r,xc=new class extends uc{constructor(){super(...arguments),this.result=void 0}visit(e){if(!this.result){const t=this.result=[];return super.visit(e),this.result=void 0,t}e&&this.result.push(e)}};function wc(e){return(cc(e)?e:e.lastToken).endOffset+1}const Fc={"glsl-parser":{parse(e,t){const n=function(e){const t=function(e){const t=[];let n="",r=0,i=0;return{result:e.replace(/\\(\r\n|\n\r|\r|\n)(.*?)(?:(?=\\?[\r\n])|$)/g,(s,o,a,l)=>{r++,i+=function(e,t){let n=t;for(;n>=0&&"\r"!==e[n]&&"\n"!==e[n];)n--;return t-n-1}(e,l),t.push({originalOffset:l+1+o.length,newOffset:l-n.length,length:a.length,lineDiff:-r,columnDiff:i}),n+=" "+o;let u="";return e.length>l+s.length&&"\\"===e[l+s.length]||(u=n,n="",r=0,i=0),a+u}),changes:t}}(e),n=gc.tokenize(t.result);!function(e,t){if(t.errors.length)throw new Error("LEXER ERROR: "+t.errors.map(t=>t.message+":\n"+dc(e,{startLine:t.line,startColumn:t.column,endLine:t.line,endColumn:t.column+t.length})).join())}(t.result,n),function(e,t){let n=0;function r(e,t){const n=t.originalOffset-t.newOffset;e.startOffset>=t.newOffset&&(e.lineNoCont=e.startLine,e.startOffset+=n,e.startLine-=t.lineDiff,e.startColumn-=t.columnDiff),e.endOffset+=n,e.endLine-=t.lineDiff,e.endColumn-=t.columnDiff}for(const i of t){for(;e[n]&&e[n].endOffset0)throw new Error("PARSE ERROR: "+t.map(t=>t.message+"\n"+t.context.ruleStack.join(" > ")+"\n"+dc(e,t.token)).join("\n"))}(t.result,Ec.errors);const i=Ec.ppDefs;function s(e,t){Ec.input=e;const n=t(Ec);return Ec.isAtEof()&&0===Ec.errors.length?n:void 0}for(const e of i)e.node=s(e.tokens,e=>e.externalDeclaration(!0,!0))??s(e.tokens,e=>e.statement())??s(e.tokens,e=>e.expression());return r.comments=n.groups.COMMENTS,r}(e);return n.comments?.forEach(e=>e.value=JSON.stringify(e)),n},astFormat:"glsl-ast",locStart:function(e){return(cc(e)?e:e.firstToken).startOffset},locEnd:wc}};function Nc(e){switch(e){case pc.STAR:case pc.SLASH:case pc.PERCENT:return 4;case pc.PLUS:case pc.DASH:return 5;case pc.LEFT_OP:case pc.RIGHT_OP:return 6;case pc.LEFT_ANGLE:case pc.RIGHT_ANGLE:case pc.LE_OP:case pc.GE_OP:return 7;case pc.EQ_OP:case pc.NE_OP:return 8;case pc.AMPERSAND:return 9;case pc.CARET:return 10;case pc.VERTICAL_BAR:return 11;case pc.AND_OP:case pc.XOR_OP:return 12;case pc.OR_OP:return 13;case pc.COMMA:return 17;default:throw new Error}}function Lc(e,t){switch(e.kind){default:return 1;case"variableExpression":return t?.find(t=>t.image===e.var.image)?18:1;case"arrayAccess":case"functionCall":case"fieldAccess":case"postfixExpression":return 2;case"unaryExpression":return 3;case"binaryExpression":return Nc(e.op.tokenType);case"conditionalExpression":return 15;case"assignmentExpression":return 16;case"commaExpression":return 17}}function Oc(e,t){return t?["(",e,")"]:e}function Ic(e,t,n,r){const i="binaryExpression"===n.kind&&"binaryExpression"===n.lhs.kind&&Nc(n.lhs.op.tokenType)===Nc(n.op.tokenType)||"commaExpression"===n.kind&&"commaExpression"===n.lhs.kind,s="binaryExpression"===n.kind?n.op.tokenType:pc.COMMA;let o;return i?(o=e.call(e=>Ic(e,t,e.getValue(),r),"lhs"),o.push("commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))),o):[Oc(e.call(t,"lhs"),Lc(n.lhs,r)>Nc(s)),"commaExpression"===n.kind?",":[" ",e.call(t,"op")],_c,Oc(e.call(t,"rhs"),Lc(n.rhs,r)>=Nc(s))]}function kc(e,t,n){return"expressionStatement"!==e.kind||e.expression?"compoundStatement"===e.kind||n?[" ",t]:Sc([_c,t]):";"}function Mc(e,t){return vc(e,Object.assign({},t,{printWidth:t.printWidth-2})).formatted.trim().replace(/^.*(?=[\r\n])/gm,e=>e+" ".repeat(t.printWidth-2-e.length+1)+"\\")}function Pc(e){return"assignmentExpression"===e.kind}function Bc(e){return"assignmentExpression"===e.kind||"declarator"===e.kind}function Uc(e,t,n,r,i,s){const o=function(e,t,n){if(!n)return"only-left";const r=!Pc(n);return e.match(Pc,Bc,e=>!r||"expressionStatement"!==e.kind&&"initDeclaratorListDeclaration"!==e.kind)?r?"chain-tail":"chain":!r&&Pc(n.rhs)||(t.originalText,0)||"binaryExpression"===n.kind||"commaExpression"===n.kind||"conditionalExpression"===n.kind&&"binaryExpression"===n.condition.kind?"break-after-operator":"constantExpression"===n.kind?"never-break-after-operator":"fluid"}(e,t,s);switch(o){case"break-after-operator":return Dc([Dc(n),r,Dc(Sc([_c,i]))]);case"never-break-after-operator":return Dc([Dc(n),r," ",i]);case"fluid":{const e=Symbol("assignment");return Dc([Dc(n),r,Dc(Sc(_c),{id:e}),Rc,Cc(i,{groupId:e})])}case"chain":return[Dc(n),r,_c,i];case"chain-tail":return[Dc(n),r,Sc([_c,i])];case"only-left":return n;default:throw new Error}}const $c={"glsl-ast":{print(e,t,n){const r=t.inMacro,i=e.getValue();if(!i)return[];if(cc(i))return i.image;const s=t=>e.call(n,t);try{switch(i.kind){case"translationUnit":{const r=[];return e.each((e,i)=>{const s=e.getValue();r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc),r.push(bc)},"declarations"),r}case"precisionDeclaration":return["precision ",i.precisionQualifier.image," ",e.call(n,"typeSpecifierNoPrec"),";"];case"fullySpecifiedType":{const e=[];return i.typeQualifier&&e.push(s("typeQualifier")," "),e.push(s("typeSpecifier")),e}case"typeSpecifier":{const e=[];return i.precisionQualifier&&e.push(i.precisionQualifier.image," "),e.push(s("typeSpecifierNonArray")),i.arraySpecifier&&e.push(s("arraySpecifier")),e}case"typeQualifier":{const e=[];return i.invariantQualifier&&e.push("invariant"),i.interpolationQualifier&&e.push(i.interpolationQualifier.image),i.layoutQualifier&&e.push(s("layoutQualifier")),i.storageQualifier&&e.push(s("storageQualifier")),Ac(" ",e)}case"storageQualifier":{const t=[];return i.CONST&&t.push("const"),i.CENTROID&&e.getParentNode().interpolationQualifier?.tokenType!==pc.FLAT&&t.push("centroid"),i.IN&&t.push("in"),i.OUT&&t.push("out"),i.VARYING&&t.push("varying"),i.ATTRIBUTE&&t.push("attribute"),i.UNIFORM&&t.push("uniform"),Ac(" ",t)}case"functionPrototype":case"functionDefinition":return[Dc([s("returnType")," ",s("name"),"(",Sc([yc,Ac([",",_c],e.map(n,"params"))]),yc,")"]),"functionPrototype"===i.kind?";":[" ",s("body")]];case"parameterDeclaration":return[i.parameterTypeQualifier?[s("parameterTypeQualifier")," "]:"",i.parameterQualifier?.tokenType===pc.OUT||i.parameterQualifier?.tokenType===pc.INOUT?i.parameterQualifier?.image+" ":"",s("typeSpecifier")," ",s("pName"),s("arraySpecifier")];case"initDeclaratorListDeclaration":case"structDeclaration":{const t=e.map(n,"declarators"),r="forStatement"===e.getParentNode().kind,o=i.declarators.some(e=>e.init);return Dc([s("fsType"),0===t.length?"":" ",1===t.length?t:Dc(Sc(Ac([",",o&&!r?bc:_c],t))),";"])}case"declarator":{const n=s("arraySpecifier"),r=[i.name.image,n];return Uc(e,t,r," =",s("init"),i.init)}case"arraySpecifier":return Dc(["[",Sc([yc,s("size")]),yc,"]"]);case"arrayAccess":return[Oc(s("on"),Lc(i.on,r)>2),"[",s("index"),"]"];case"structSpecifier":{const r=[];return e.each((e,i,s)=>{const o=e.getValue();r.push(bc),r.push(n(e)),i!==s.length-1&&_s.isNextLineEmpty(t.originalText,o,wc)&&r.push(bc)},"declarations"),Dc(["struct",i.name?" "+i.name.image:""," {",Sc(r),bc,"}"])}case"compoundStatement":{const r=[],s=!!i.comments?.some(e=>!e.leading&&!e.trailing&&!e.printed);return e.each((e,i)=>{const s=e.getValue();0!==i&&r.push(bc),r.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&r.push(bc)},"statements"),s&&e.each(e=>{const t=e.getValue();t.leading||t.trailing||(r.push(n(e)),t.printed=!0)},"comments"),Dc(["{",r.length?[Sc([bc,r]),bc]:"","}"])}case"returnStatement":return i.what?["return"," ",s("what"),";"]:"return;";case"breakStatement":return"break;";case"continueStatement":return"continue;";case"discardStatement":return"discard;";case"selectionStatement":{const e=[],t=kc(i.yes,s("yes"),!1),n=Dc(["if (",Dc([Sc([yc,s("condition")]),yc]),")",t]);if(e.push(n),i.no){const t=i.yes.comments?.some(e=>e.trailing&&e.tokenType===pc.LINE_COMMENT)||i.yes.comments?.findLast(e=>!e.leading&&!e.trailing)?.tokenType===pc.LINE_COMMENT,n="compoundStatement"===i.yes.kind&&!t;e.push(n?" ":bc),e.push("else",Dc(kc(i.no,s("no"),"selectionStatement"===i.no.kind)))}return e}case"forStatement":{const e=kc(i.statement,s("statement"),!1),t=!1,n=t?[t,yc]:"";return"expressionStatement"!==i.initExpression.kind||i.initExpression.expression||i.conditionExpression||i.loopExpression?[n,Dc(["for (",Dc([Sc([yc,s("initExpression"),_c,s("conditionExpression"),";",_c,s("loopExpression")]),yc]),")",e])]:[n,Dc(["for (;;)",e])]}case"whileStatement":{const e=kc(i.statement,s("statement"),!1);return["while (",Dc(s("conditionExpression")),")",e]}case"doWhileStatement":return["do ",s("statement")," while (",Dc(s("conditionExpression")),");"];case"functionCall":return function(t){const r=e.map(n,"args");let i,o;if(void 0===t.callee.arraySpecifier&&cc(t.callee.typeSpecifierNonArray)&&void 0!==(i=function(e){switch(e){case pc.MAT2X2:return[2,2];case pc.MAT2X3:return[2,3];case pc.MAT2X4:return[2,4];case pc.MAT3X2:return[3,2];case pc.MAT3X3:return[3,3];case pc.MAT3X4:return[3,4];case pc.MAT4X2:return[4,2];case pc.MAT4X3:return[4,3];case pc.MAT4X4:return[4,4];default:return}}(t.callee.typeSpecifierNonArray.tokenType))&&i[0]*i[1]===t.args.length){const e=t.args.every(e=>"constantExpression"===e.kind&&(e.const_.tokenType===pc.FLOATCONSTANT||e.const_.tokenType===pc.INTCONSTANT)||"unaryExpression"===e.kind&&(e.op.tokenType===pc.PLUS||e.op.tokenType===pc.DASH)&&"constantExpression"===e.on.kind&&(e.on.const_.tokenType===pc.FLOATCONSTANT||e.on.const_.tokenType===pc.INTCONSTANT));if(e){const e=[],n=[];let s=0,a=0;for(let i=0;i2),".",s("functionCall")];case"postfixExpression":return[Oc(s("on"),Lc(i.on,r)>2),s("op")];case"unaryExpression":return[s("op"),Oc(s("on"),Lc(i.on,r)>3)];case"assignmentExpression":{const n=s("lhs");return Uc(e,t,n," "+i.op.image,s("rhs"),i.rhs)}case"conditionalExpression":return[Oc(s("condition"),Lc(i.condition,r)>=15),Sc([_c,"? ",s("yes"),_c,": ",s("no")])];case"commaExpression":case"binaryExpression":{const t=Ic(e,n,i,r),s=e.getParentNode();if("selectionStatement"===s.kind||"whileStatement"===s.kind||"switchStatement"===s.kind||"doWhileStatement"===s.kind)return t;const o=()=>{const t=e.getParentNode();return!!t&&("functionCall"===t.kind&&"commaExpression"===i.kind||"binaryExpression"===t.kind&&((n=t.op.tokenType)===pc.CARET||n===pc.VERTICAL_BAR||n===pc.AMPERSAND));var n},a=e.getParentNode(1);if("returnStatement"===s.kind||"forStatement"===s.kind||"conditionalExpression"===s.kind&&"returnStatement"!==a.kind&&"functionCall"!==a.kind||"assignmentExpression"===s.kind||"declarator"===s.kind)return Dc(t);{const e=t.slice(0,1),n=t.slice(e.length);return Dc(Oc([...e,Sc(n)],o()))}}case"expressionStatement":return[s("expression"),";"];case"fieldAccess":return[Oc(s("on"),Lc(i.on,r)>2),".",s("field")];case"constantExpression":{const e=i.const_;return e.tokenType===pc.FLOATCONSTANT?function(e){const t=e.indexOf(".");return 0===t&&(e="0"+e),e=e.replace("E","e"),-1!==t&&(e=(e=(e=(e=e.replace(".e","e")).replace(/(?=4):Tc(Ac(_c,e.map(n,"tokens")))])]);return t.inMacro=void 0,Mc(r,t)}case"ppDir":return Mc(Dc(["#",i.dir.image," ",Sc(i.node?s("node"):Tc(Ac(_c,e.map(n,"tokens"))))]),t);case"ppPragma":return i.dir.image.replace(/^#\s+/,"#").replace(/^#pragma\s{2,}/,"#pragma ");case"ppCall":return Dc([i.callee.image,"(",Ac([",",_c],e.map((e,t,n)=>n[t].tokens.map(e=>e.image),"args")),")"]);case"ppInclude":return["#include ",i.what];case"ppExtension":return["#extension ",i.extension.image," : ",i.behavior.image];case"switchStatement":return["switch (",Dc([Sc([yc,s("initExpression")]),yc]),") {",i.cases.length?Sc([bc,Ac(bc,e.map(n,"cases"))]):"",bc,"}"];case"caseBlock":{const r=s("caseLabel"),i=[];return e.each((e,r)=>{const s=e.getValue();i.push(bc),i.push(n(e)),_s.isNextLineEmpty(t.originalText,s,wc)&&i.push(bc)},"statements"),[r,Sc(i)]}case"caseLabel":return void 0===i.case_?"default:":["case ",s("case_"),":"];case"layoutQualifier":return["layout(",Ac(", ",i.layoutQualifierIds.map(e=>void 0===e.init?e.IDENTIFIER.image:[e.IDENTIFIER.image," = ",e.init.image])),")"];case"uniformBlock":return[s("typeQualifier")," ",i.blockName.image," {",Sc([bc,Ac(bc,e.map(n,"declarations"))]),bc,"};"];case"typeQualifierDeclaration":return[s("typeQualifier"),";"];default:throw new Error("unexpected n type "+i.kind+"\n"+JSON.stringify(i).substring(0,100))}}catch(e){throw console.error("error printing "+JSON.stringify(i).substring(0,100)+"\n"),e}},embed(e,t){const n=e.getValue();return!cc(n)||n.tokenType!==pc.LINE_COMMENT&&n.tokenType!==pc.MULTILINE_COMMENT?null:(e,t,n,r)=>{}},getVisitorKeys:(e,t)=>cc(e)?[]:Object.keys(e).filter(e=>!t.has(e)),getCommentChildNodes:e=>cc(e)?[]:xc.visit(e),canAttachComment:e=>!0,printComment:function(e,t){const n=e.getValue();return n.tokenType===pc.MULTILINE_COMMENT&&"*"===n.image[2]?"/**\n"+n.image.substring(3,n.image.length-2).split("\n").map(e=>" *"===e?"":e.startsWith(" * ")?e.substring(3):e).join("\n").trim().split("\n").map(e=>""===e?" *":" * "+e).join("\n")+"\n */":n.image},hasPrettierIgnore(e){const t=e.getValue();return(t&&hc(t)&&t.comments?.some(e=>/\/\/\s*prettier-ignore\b.*/.test(e.image)))??!1}}},Gc={parsers:Fc,printers:$c};function Vc(e){return e.replace(/^([^\n]*;)\n(?=(?:[A-Za-z_]\w*\s+)+[A-Za-z_]\w*\s*\()/gm,"$1\n\n").replace(/^}\n(?=\S)/gm,"}\n\n")}var Wc,Hc,jc=(Wc={program:function(e){return jc(e.program)+jc(e.wsEnd)},segment:function(e){return jc(e.blocks)},text:function(e){return jc(e.text)},literal:function(e){return jc(e.wsStart)+jc(e.literal)+jc(e.wsEnd)},identifier:function(e){return jc(e.identifier)+jc(e.wsEnd)},binary:function(e){return jc(e.left)+jc(e.operator)+jc(e.right)},group:function(e){return jc(e.lp)+jc(e.expression)+jc(e.rp)},unary:function(e){return jc(e.operator)+jc(e.expression)},unary_defined:function(e){return jc(e.operator)+jc(e.lp)+jc(e.identifier)+jc(e.rp)},int_constant:function(e){return jc(e.token)+jc(e.wsEnd)},elseif:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},if:function(e){return jc(e.token)+jc(e.expression)+jc(e.wsEnd)+jc(e.body)},ifdef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},ifndef:function(e){return jc(e.token)+jc(e.identifier)+jc(e.wsEnd)+jc(e.body)},else:function(e){return jc(e.token)+jc(e.wsEnd)+jc(e.body)},error:function(e){return jc(e.error)+jc(e.message)+jc(e.wsEnd)},undef:function(e){return jc(e.undef)+jc(e.identifier)+jc(e.wsEnd)},define:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.body)+jc(e.wsEnd)},define_arguments:function(e){return jc(e.wsStart)+jc(e.define)+jc(e.identifier)+jc(e.lp)+jc(e.args)+jc(e.rp)+jc(e.body)+jc(e.wsEnd)},conditional:function(e){return jc(e.wsStart)+jc(e.ifPart)+jc(e.elseIfParts)+jc(e.elsePart)+jc(e.endif)+jc(e.wsEnd)},version:function(e){return jc(e.version)+jc(e.value)+jc(e.profile)+jc(e.wsEnd)},pragma:function(e){return jc(e.pragma)+jc(e.body)+jc(e.wsEnd)},line:function(e){return jc(e.line)+jc(e.value)+jc(e.wsEnd)},extension:function(e){return jc(e.extension)+jc(e.name)+jc(e.colon)+jc(e.behavior)+jc(e.wsEnd)}},Hc=function(e){return"string"==typeof e?e:null==e?"":Array.isArray(e)?e.map(Hc).join(""):e.type in Wc?Wc[e.type](e):"NO GENERATOR FOR ".concat(e.type)+e});const zc=jc;function Xc(e,t,n,r){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Xc.prototype),i.expected=t,i.found=n,i.location=r,i.name="SyntaxError",i}function Kc(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}function Yc(e,t){var n,r={},i=(t=void 0!==t?t:{}).grammarSource,s={program:An,constant_expression:hr},o=An,a="<<",l=">>",u="<=",c=">=",h="==",d="!=",f="&&",p="||",m="(",g=")",E=",",v="!",C="-",D="~",S="+",A="*",_="/",y="%",b="<",T=">",R="|",x="^",w="&",F=":",N="#",L="define",O="line",I="undef",k="error",M="pragma",P="defined",B="if",U="ifdef",$="ifndef",G="elif",V="else",W="endif",H="version",j="extension",z="0",X="//",K="/*",Y="*/",q=/^[A-Za-z_]/,Q=/^[A-Za-z_0-9]/,Z=/^[uU]/,J=/^[1-9]/,ee=/^[0-7]/,te=/^[xX]/,ne=/^[0-9a-fA-F]/,re=/^[0-9]/,ie=/^[\n\r]/,se=/^[^\n\r]/,oe=/^[ \t]/,ae=gn("<<",!1),le=gn(">>",!1),ue=gn("<=",!1),ce=gn(">=",!1),he=gn("==",!1),de=gn("!=",!1),fe=gn("&&",!1),pe=gn("||",!1),me=gn("(",!1),ge=gn(")",!1),Ee=gn(",",!1),ve=gn("!",!1),Ce=gn("-",!1),De=gn("~",!1),Se=gn("+",!1),Ae=gn("*",!1),_e=gn("/",!1),ye=gn("%",!1),be=gn("<",!1),Te=gn(">",!1),Re=gn("|",!1),xe=gn("^",!1),we=gn("&",!1),Fe=gn(":",!1),Ne=gn("#",!1),Le=gn("define",!1),Oe=(gn("include",!1),gn("line",!1)),Ie=gn("undef",!1),ke=gn("error",!1),Me=gn("pragma",!1),Pe=gn("defined",!1),Be=gn("if",!1),Ue=gn("ifdef",!1),$e=gn("ifndef",!1),Ge=gn("elif",!1),Ve=gn("else",!1),We=gn("endif",!1),He=gn("version",!1),je=gn("extension",!1),ze=En([["A","Z"],["a","z"],"_"],!1,!1),Xe=En([["A","Z"],["a","z"],"_",["0","9"]],!1,!1),Ke=vn("number"),Ye=En(["u","U"],!1,!1),qe=En([["1","9"]],!1,!1),Qe=gn("0",!1),Ze=En([["0","7"]],!1,!1),Je=En(["x","X"],!1,!1),et=En([["0","9"],["a","f"],["A","F"]],!1,!1),tt=En([["0","9"]],!1,!1),nt=vn("control line"),rt=En(["\n","\r"],!1,!1),it=vn("token string"),st=En(["\n","\r"],!0,!1),ot=vn("text"),at=vn("if"),lt=vn("primary expression"),ut=vn("unary expression"),ct=vn("multiplicative expression"),ht=vn("additive expression"),dt=vn("shift expression"),ft=vn("relational expression"),pt=vn("equality expression"),mt=vn("and expression"),gt=vn("exclusive or expression"),Et=vn("inclusive or expression"),vt=vn("logical and expression"),Ct=vn("logical or expression"),Dt=vn("constant expression"),St=vn("whitespace or comment"),At=gn("//",!1),_t=gn("/*",!1),yt=gn("*/",!1),bt={type:"any"},Tt=vn("whitespace"),Rt=En([" ","\t"],!1,!1),xt=function(e,t){return gr("program",{program:e.blocks,wsEnd:t})},wt=function(e,t){return gr("int_constant",{token:e,wsEnd:t})},Ft=function(e,t){return gr("literal",{literal:e,wsEnd:t})},Nt=function(e){return"#"},Lt=function(e,t,n){return gr("literal",{literal:t,wsStart:e,wsEnd:n})},Ot=function(e,t){return gr("identifier",{identifier:e,wsEnd:t})},It=function(e){return gr("identifier",{identifier:e})},kt=function(e){return gr("text",{text:e.join("")})},Mt=function(e){return gr("segment",{blocks:e})},Pt=function(e,t,n,r,i){return[r,...i.flat()]},Bt=function(e,t,n,r,i,s){return gr("define_arguments",{define:e,identifier:t,lp:n,args:r||[],rp:i,body:s})},Ut=function(e,t,n){return gr("define",{define:e,identifier:t,body:n})},$t=function(e,t){return gr("line",{line:e,value:t})},Gt=function(e,t){return gr("undef",{undef:e,identifier:t})},Vt=function(e,t){return gr("error",{error:e,message:t})},Wt=function(e,t){return gr("pragma",{pragma:e,body:t})},Ht=function(e,t,n){return gr("version",{version:e,value:t,profile:n})},jt=function(e,t,n,r){return gr("extension",{extension:e,name:t,colon:n,behavior:r})},zt=function(e,t){return{...e,wsEnd:t}},Xt=function(e,t,n){return{...e,body:n,wsEnd:t}},Kt=function(e,t,n,r,i){return gr("elseif",{token:t,expression:n,wsEnd:r,body:i})},Yt=function(e,t,n,r,i){return gr("else",{token:n,wsEnd:r,body:i})},qt=function(e,t,n,r,i){return gr("conditional",{ifPart:e,elseIfParts:t,elsePart:n,endif:r,wsEnd:i})},Qt=function(e,t){return gr("ifdef",{token:e,identifier:t})},Zt=function(e,t){return gr("ifndef",{token:e,identifier:t})},Jt=function(e,t){return gr("if",{token:e,expression:t})},en=function(e,t,n){return gr("group",{lp:e,expression:t,rp:n})},tn=function(e,t,n,r){return gr("unary_defined",{operator:e,lp:t,identifier:n,rp:r})},nn=function(e,t){return gr("unary",{operator:e,expression:t})},rn=function(e,t){return Cr(e,t)},sn=function(e,t){return vr(e,t)},on=function(e,t,n){return Er(t,n)},an=function(e,t){return Er(e,t.flat())},ln=function(e){return e},un=function(e){return e},cn=0,hn=[{line:1,column:1}],dn=0,fn=[],pn=0,mn={};if("startRule"in t){if(!(t.startRule in s))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=s[t.startRule]}function gn(e,t){return{type:"literal",text:e,ignoreCase:t}}function En(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function vn(e){return{type:"other",description:e}}function Cn(t){var n,r=hn[t];if(r)return r;for(n=t-1;!hn[n];)n--;for(r={line:(r=hn[n]).line,column:r.column};ndn&&(dn=cn,fn=[]),fn.push(e))}function An(){var e,t,n,i=75*cn+0,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Qn())!==r?(n=dr(),e=xt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}function _n(){var t,n,i,s=75*cn+2,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===a?(n=a,cn+=2):(n=r,0===pn&&Sn(ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function yn(){var t,n,i,s=75*cn+3,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===l?(n=l,cn+=2):(n=r,0===pn&&Sn(le)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function bn(){var t,n,i,s=75*cn+4,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===u?(n=u,cn+=2):(n=r,0===pn&&Sn(ue)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Tn(){var t,n,i,s=75*cn+5,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===c?(n=c,cn+=2):(n=r,0===pn&&Sn(ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Rn(){var t,n,i,s=75*cn+6,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===h?(n=h,cn+=2):(n=r,0===pn&&Sn(he)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function xn(){var t,n,i,s=75*cn+7,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===d?(n=d,cn+=2):(n=r,0===pn&&Sn(de)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function wn(){var t,n,i,s=75*cn+8,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===f?(n=f,cn+=2):(n=r,0===pn&&Sn(fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Fn(){var t,n,i,s=75*cn+9,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,e.substr(cn,2)===p?(n=p,cn+=2):(n=r,0===pn&&Sn(pe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Nn(){var t,n,i,s=75*cn+10,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,40===e.charCodeAt(cn)?(n=m,cn++):(n=r,0===pn&&Sn(me)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Ln(){var t,n,i,s=75*cn+11,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,41===e.charCodeAt(cn)?(n=g,cn++):(n=r,0===pn&&Sn(ge)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function On(){var t,n,i,s=75*cn+12,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,44===e.charCodeAt(cn)?(n=E,cn++):(n=r,0===pn&&Sn(Ee)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function In(){var t,n,i,s=75*cn+14,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,45===e.charCodeAt(cn)?(n=C,cn++):(n=r,0===pn&&Sn(Ce)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function kn(){var t,n,i,s=75*cn+16,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,43===e.charCodeAt(cn)?(n=S,cn++):(n=r,0===pn&&Sn(Se)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Mn(){var t,n,i,s=75*cn+17,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,42===e.charCodeAt(cn)?(n=A,cn++):(n=r,0===pn&&Sn(Ae)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Pn(){var t,n,i,s=75*cn+18,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,47===e.charCodeAt(cn)?(n=_,cn++):(n=r,0===pn&&Sn(_e)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Bn(){var t,n,i,s=75*cn+19,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,37===e.charCodeAt(cn)?(n=y,cn++):(n=r,0===pn&&Sn(ye)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Un(){var t,n,i,s=75*cn+20,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,60===e.charCodeAt(cn)?(n=b,cn++):(n=r,0===pn&&Sn(be)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function $n(){var t,n,i,s=75*cn+21,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,62===e.charCodeAt(cn)?(n=T,cn++):(n=r,0===pn&&Sn(Te)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Gn(){var t,n,i,s=75*cn+22,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,124===e.charCodeAt(cn)?(n=R,cn++):(n=r,0===pn&&Sn(Re)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Vn(){var t,n,i,s=75*cn+23,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,94===e.charCodeAt(cn)?(n=x,cn++):(n=r,0===pn&&Sn(xe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Wn(){var t,n,i,s=75*cn+24,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,38===e.charCodeAt(cn)?(n=w,cn++):(n=r,0===pn&&Sn(we)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function Hn(){var t,n,i,s=75*cn+26,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,35===e.charCodeAt(cn)?(i=N,cn++):(i=r,0===pn&&Sn(Ne)),(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Nt(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}function jn(){var t,n,i,s,o,a,l=75*cn+27,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===L?(a=L,cn+=6):(a=r,0===pn&&Sn(Le)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function zn(){var t,n,i,s,o,a,l=75*cn+37,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===G?(a=G,cn+=4):(a=r,0===pn&&Sn(Ge)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}function Xn(){var t,n,i,s,o,a,l=75*cn+42,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r?(i=dr(),t=Ot(n,i)):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t}function Kn(){var t,n,i,s,o=75*cn+44,a=mn[o];return a?(cn=a.nextPos,a.result):(pn++,t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+46,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,J.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(qe)),i!==r){for(s=[],o=qn();o!==r;)s.push(o),o=qn();n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o=75*cn+47,a=mn[o];if(a)return cn=a.nextPos,a.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r){for(i=[],ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));s!==r;)i.push(s),ee.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(Ze));t=n=[n,i]}else cn=t,t=r;return mn[o]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),(t=n!==r?e.substring(t,cn):n)===r&&(t=cn,n=cn,i=function(){var t,n,i,s,o,a=75*cn+48,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,48===e.charCodeAt(cn)?(n=z,cn++):(n=r,0===pn&&Sn(Qe)),n!==r)if(te.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Je)),i!==r){for(s=[],ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));o!==r;)s.push(o),ne.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(et));t=n=[n,i,s]}else cn=t,t=r;else cn=t,t=r;return mn[a]={nextPos:cn,result:t},t}(),i!==r?((s=Yn())===r&&(s=null),n=i=[i,s]):(cn=n,n=r),t=n!==r?e.substring(t,cn):n)),pn--,t===r&&(n=r,0===pn&&Sn(Ke)),mn[o]={nextPos:cn,result:t},t)}function Yn(){var t,n=75*cn+45,i=mn[n];return i?(cn=i.nextPos,i.result):(Z.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(Ye)),mn[n]={nextPos:cn,result:t},t)}function qn(){var t,n=75*cn+49,i=mn[n];return i?(cn=i.nextPos,i.result):(re.test(e.charAt(cn))?(t=e.charAt(cn),cn++):(t=r,0===pn&&Sn(tt)),mn[n]={nextPos:cn,result:t},t)}function Qn(){var e,t,n,i,s,o=75*cn+50,a=mn[o];if(a)return cn=a.nextPos,a.result;if(cn,t=[],(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}if(n!==r){for(;n!==r;)if(t.push(n),(n=Zn())===r){if(n=cn,i=[],(s=er())!==r)for(;s!==r;)i.push(s),s=er();else i=r;i!==r&&(i=kt(i)),n=i}}else t=r;return t!==r&&(t=Mt(t)),e=t,mn[o]={nextPos:cn,result:e},e}function Zn(){var t,n,i,s,o,a,l,u,c,h,d,f=75*cn+51,p=mn[f];if(p)return cn=p.nextPos,p.result;if(pn++,t=function(){var t,n,i,s,o,a,l,u,c=75*cn+54,h=mn[c];if(h)return cn=h.nextPos,h.result;if(t=cn,n=cn,i=function(){var t,n,i,s=75*cn+55,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+35,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===U?(a=U,cn+=5):(a=r,0===pn&&Sn(Ue)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Qt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+36,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===$?(a=$,cn+=6):(a=r,0===pn&&Sn($e)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r&&(i=Xn())!==r?t=Zt(n,i):(cn=t,t=r),t===r&&(t=cn,n=function(){var t,n,i,s,o,a,l=75*cn+34,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,2)===B?(a=B,cn+=2):(a=r,0===pn&&Sn(Be)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),n!==r?((i=Jn())===r&&(i=null),t=Jt(n,i)):(cn=t,t=r))),pn--,t===r&&(n=r,0===pn&&Sn(at)),mn[s]={nextPos:cn,result:t},t)}(),i!==r?(ie.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(rt)),s!==r?((o=Qn())===r&&(o=null),n=Xt(i,s,o)):(cn=n,n=r)):(cn=n,n=r),n!==r){for(i=[],s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=zn())!==r&&(a=Jn())!==r?(ie.test(e.charAt(cn))?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(rt)),l!==r?((u=Qn())===r&&(u=null),s=Kt(n,o,a,l,u)):(cn=s,s=r)):(cn=s,s=r);s=cn,o=function(){var t,n,i,s,o,a,l=75*cn+38,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===V?(a=V,cn+=4):(a=r,0===pn&&Sn(Ve)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a!==r?((l=Qn())===r&&(l=null),s=Yt(n,i,o,a,l)):(cn=s,s=r)):(cn=s,s=r),s===r&&(s=null),o=function(){var t,n,i,s,o,a,l=75*cn+39,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===W?(a=W,cn+=5):(a=r,0===pn&&Sn(We)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),o!==r?(ie.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(rt)),a===r&&(a=null),t=qt(n,i,s,o,a)):(cn=t,t=r)}else cn=t,t=r;return mn[c]={nextPos:cn,result:t},t}(),t===r){if(t=cn,n=cn,(i=jn())!==r)if(s=function(){var t,n,i,s,o,a,l=75*cn+43,u=mn[l];if(u)return cn=u.nextPos,u.result;if(cn,n=cn,i=cn,q.test(e.charAt(cn))?(s=e.charAt(cn),cn++):(s=r,0===pn&&Sn(ze)),s!==r){for(o=[],Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));a!==r;)o.push(a),Q.test(e.charAt(cn))?(a=e.charAt(cn),cn++):(a=r,0===pn&&Sn(Xe));i=s=[s,o]}else cn=i,i=r;return(n=i!==r?e.substring(n,cn):i)!==r&&(n=It(n)),t=n,mn[l]={nextPos:cn,result:t},t}(),s!==r)if((o=Nn())!==r){if(a=cn,(l=Xn())!==r){for(u=[],c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);c!==r;)u.push(c),c=cn,(h=On())!==r&&(d=Xn())!==r?c=h=[h,d]:(cn=c,c=r);a=Pt(i,s,o,l,u)}else cn=a,a=r;a===r&&(a=null),(l=Ln())!==r?((u=Jn())===r&&(u=null),n=Bt(i,s,o,a,l,u)):(cn=n,n=r)}else cn=n,n=r;else cn=n,n=r;else cn=n,n=r;if(n===r&&(n=cn,(i=jn())!==r&&(s=Xn())!==r?((o=Jn())===r&&(o=null),n=Ut(i,s,o)):(cn=n,n=r),n===r)){if(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+29,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,4)===O?(a=O,cn+=4):(a=r,0===pn&&Sn(Oe)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r){if(s=cn,o=[],(a=qn())!==r)for(;a!==r;)o.push(a),a=qn();else o=r;(s=o!==r?e.substring(s,cn):o)!==r?n=$t(i,s):(cn=n,n=r)}else cn=n,n=r;n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+30,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===I?(a=I,cn+=5):(a=r,0===pn&&Sn(Ie)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?n=Gt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+31,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,5)===k?(a=k,cn+=5):(a=r,0===pn&&Sn(ke)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Vt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+32,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,6)===M?(a=M,cn+=6):(a=r,0===pn&&Sn(Me)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Jn())!==r?n=Wt(i,s):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+40,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,7)===H?(a=H,cn+=7):(a=r,0===pn&&Sn(He)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Kn())!==r?((o=Jn())===r&&(o=null),n=Ht(i,s,o)):(cn=n,n=r),n===r&&(n=cn,i=function(){var t,n,i,s,o,a,l=75*cn+41,u=mn[l];return u?(cn=u.nextPos,u.result):(t=cn,n=dr(),i=cn,s=cn,(o=Hn())!==r?(e.substr(cn,9)===j?(a=j,cn+=9):(a=r,0===pn&&Sn(je)),a!==r?s=o=[o,a]:(cn=s,s=r)):(cn=s,s=r),(i=s!==r?e.substring(i,cn):s)!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[l]={nextPos:cn,result:t},t)}(),i!==r&&(s=Xn())!==r?(o=function(){var t,n,i,s=75*cn+25,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,58===e.charCodeAt(cn)?(n=F,cn++):(n=r,0===pn&&Sn(Fe)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),o!==r&&(a=Jn())!==r?n=jt(i,s,o,a):(cn=n,n=r)):(cn=n,n=r))))))}n!==r?(ie.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(rt)),i===r&&(i=null),t=zt(n,i)):(cn=t,t=r)}return pn--,t===r&&(n=r,0===pn&&Sn(nt)),mn[f]={nextPos:cn,result:t},t}function Jn(){var t,n,i,s=75*cn+52,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st)),i!==r)for(;i!==r;)n.push(i),se.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(st));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(it)),mn[s]={nextPos:cn,result:t},t}function er(){var t,n,i,s,o,a,l=75*cn+53,u=mn[l];if(u)return cn=u.nextPos,u.result;if(pn++,t=cn,n=cn,i=cn,pn++,s=cn,(o=pr())===r&&(o=null),35===e.charCodeAt(cn)?(a=N,cn++):(a=r,0===pn&&Sn(Ne)),a!==r?s=o=[o,a]:(cn=s,s=r),pn--,s===r?i=void 0:(cn=i,i=r),i!==r){if(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st)),o!==r)for(;o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));else s=r;s!==r?(ie.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(rt)),o===r&&(o=null),n=i=[i,s,o]):(cn=n,n=r)}else cn=n,n=r;return n===r&&(ie.test(e.charAt(cn))?(n=e.charAt(cn),cn++):(n=r,0===pn&&Sn(rt))),t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(ot)),mn[l]={nextPos:cn,result:t},t}function tr(){var t,n,i,s,o,a=75*cn+57,l=mn[a];return l?(cn=l.nextPos,l.result):(pn++,t=cn,n=function(){var t,n,i,s,o=75*cn+33,a=mn[o];return a?(cn=a.nextPos,a.result):(t=cn,n=dr(),e.substr(cn,7)===P?(i=P,cn+=7):(i=r,0===pn&&Sn(Pe)),i!==r&&(s=mr())!==r?t=Lt(n,i,s):(cn=t,t=r),mn[o]={nextPos:cn,result:t},t)}(),n!==r?((i=Nn())===r&&(i=null),(s=Xn())!==r?((o=Ln())===r&&(o=null),t=tn(n,i,s,o)):(cn=t,t=r)):(cn=t,t=r),t===r&&(t=cn,(n=kn())===r&&(n=In())===r&&(n=function(){var t,n,i,s=75*cn+13,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,33===e.charCodeAt(cn)?(n=v,cn++):(n=r,0===pn&&Sn(ve)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}(),n===r&&(n=function(){var t,n,i,s=75*cn+15,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,126===e.charCodeAt(cn)?(n=D,cn++):(n=r,0===pn&&Sn(De)),n!==r?(i=dr(),t=Ft(n,i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}())),n!==r&&(i=tr())!==r?t=nn(n,i):(cn=t,t=r),t===r&&(t=function(){var e,t,n,i,s=75*cn+56,o=mn[s];return o?(cn=o.nextPos,o.result):(pn++,e=function(){var e,t,n,i=75*cn+1,s=mn[i];return s?(cn=s.nextPos,s.result):(e=cn,(t=Kn())!==r?(n=dr(),e=wt(t,n)):(cn=e,e=r),mn[i]={nextPos:cn,result:e},e)}(),e===r&&(e=cn,(t=Nn())!==r&&(n=hr())!==r&&(i=Ln())!==r?e=en(t,n,i):(cn=e,e=r),e===r&&(e=Xn())),pn--,e===r&&(t=r,0===pn&&Sn(lt)),mn[s]={nextPos:cn,result:e},e)}())),pn--,t===r&&(n=r,0===pn&&Sn(ut)),mn[a]={nextPos:cn,result:t},t)}function nr(){var e,t,n,i,s,o,a=75*cn+58,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=tr())!==r){for(n=[],i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Mn())===r&&(s=Pn())===r&&(s=Bn()),s!==r&&(o=tr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ct)),mn[a]={nextPos:cn,result:e},e}function rr(){var e,t,n,i,s,o,a=75*cn+59,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=nr())!==r){for(n=[],i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=kn())===r&&(s=In()),s!==r&&(o=nr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ht)),mn[a]={nextPos:cn,result:e},e}function ir(){var e,t,n,i,s,o,a=75*cn+60,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=rr())!==r){for(n=[],i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=yn())===r&&(s=_n()),s!==r&&(o=rr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(dt)),mn[a]={nextPos:cn,result:e},e}function sr(){var e,t,n,i,s,o,a=75*cn+61,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ir())!==r){for(n=[],i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=bn())===r&&(s=Tn())===r&&(s=Un())===r&&(s=$n()),s!==r&&(o=ir())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(ft)),mn[a]={nextPos:cn,result:e},e}function or(){var e,t,n,i,s,o,a=75*cn+62,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=sr())!==r){for(n=[],i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Rn())===r&&(s=xn()),s!==r&&(o=sr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(pt)),mn[a]={nextPos:cn,result:e},e}function ar(){var e,t,n,i,s,o,a=75*cn+63,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=or())!==r){for(n=[],i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Wn())!==r&&(o=or())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(mt)),mn[a]={nextPos:cn,result:e},e}function lr(){var e,t,n,i,s,o,a=75*cn+64,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ar())!==r){for(n=[],i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Vn())!==r&&(o=ar())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(gt)),mn[a]={nextPos:cn,result:e},e}function ur(){var e,t,n,i,s,o,a=75*cn+65,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=lr())!==r){for(n=[],i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Gn())!==r&&(o=lr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Et)),mn[a]={nextPos:cn,result:e},e}function cr(){var e,t,n,i,s,o,a=75*cn+66,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=ur())!==r){for(n=[],i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=wn())!==r&&(o=ur())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(vt)),mn[a]={nextPos:cn,result:e},e}function hr(){var e,t=75*cn+68,n=mn[t];return n?(cn=n.nextPos,n.result):(pn++,e=function(){var e,t,n,i,s,o,a=75*cn+67,l=mn[a];if(l)return cn=l.nextPos,l.result;if(pn++,e=cn,(t=cr())!==r){for(n=[],i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=Fn())!==r&&(o=cr())!==r?i=s=[s,o]:(cn=i,i=r);e=rn(t,n)}else cn=e,e=r;return pn--,e===r&&(t=r,0===pn&&Sn(Ct)),mn[a]={nextPos:cn,result:e},e}(),pn--,e===r&&0===pn&&Sn(Dt),mn[t]={nextPos:cn,result:e},e)}function dr(){var e,t,n,i,s,o,a=75*cn+69,l=mn[a];if(l)return cn=l.nextPos,l.result;for(pn++,cn,(t=pr())===r&&(t=null),n=[],i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);i!==r;)n.push(i),i=cn,(s=fr())!==r?((o=pr())===r&&(o=null),i=s=[s,o]):(cn=i,i=r);return e=sn(t,n),pn--,t=r,0===pn&&Sn(St),mn[a]={nextPos:cn,result:e},e}function fr(){var t,n,i,s,o,a,l=75*cn+70,u=mn[l];if(u)return cn=u.nextPos,u.result;if(t=function(){var t,n,i,s,o,a=75*cn+71,l=mn[a];if(l)return cn=l.nextPos,l.result;if(t=cn,n=cn,e.substr(cn,2)===X?(i=X,cn+=2):(i=r,0===pn&&Sn(At)),i!==r){for(s=[],se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));o!==r;)s.push(o),se.test(e.charAt(cn))?(o=e.charAt(cn),cn++):(o=r,0===pn&&Sn(st));n=i=[i,s]}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[a]={nextPos:cn,result:t},t}(),t===r)if(t=cn,n=function(){var t,n,i,s,o,a,l,u=75*cn+72,c=mn[u];if(c)return cn=c.nextPos,c.result;if(t=cn,n=cn,e.substr(cn,2)===K?(i=K,cn+=2):(i=r,0===pn&&Sn(_t)),i!==r){for(s=[],o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);o!==r;)s.push(o),o=cn,a=cn,pn++,e.substr(cn,2)===Y?(l=Y,cn+=2):(l=r,0===pn&&Sn(yt)),pn--,l===r?a=void 0:(cn=a,a=r),a!==r?(e.length>cn?(l=e.charAt(cn),cn++):(l=r,0===pn&&Sn(bt)),l!==r?o=ln(l):(cn=o,o=r)):(cn=o,o=r);e.substr(cn,2)===Y?(o=Y,cn+=2):(o=r,0===pn&&Sn(yt)),o!==r?n=i=[i,s,o]:(cn=n,n=r)}else cn=n,n=r;return t=n!==r?e.substring(t,cn):n,mn[u]={nextPos:cn,result:t},t}(),n!==r){for(i=[],s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);s!==r;)i.push(s),s=cn,(o=pr())!==r&&(a=fr())!==r?s=on(n,o,a):(cn=s,s=r);t=an(n,i)}else cn=t,t=r;return mn[l]={nextPos:cn,result:t},t}function pr(){var t,n,i,s=75*cn+73,o=mn[s];if(o)return cn=o.nextPos,o.result;if(pn++,t=cn,n=[],oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt)),i!==r)for(;i!==r;)n.push(i),oe.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Rt));else n=r;return t=n!==r?e.substring(t,cn):n,pn--,t===r&&(n=r,0===pn&&Sn(Tt)),mn[s]={nextPos:cn,result:t},t}function mr(){var t,n,i,s=75*cn+74,o=mn[s];return o?(cn=o.nextPos,o.result):(t=cn,n=cn,pn++,Q.test(e.charAt(cn))?(i=e.charAt(cn),cn++):(i=r,0===pn&&Sn(Xe)),pn--,i===r?n=void 0:(cn=n,n=r),n!==r?(i=dr(),t=un(i)):(cn=t,t=r),mn[s]={nextPos:cn,result:t},t)}e=lh(e);const gr=(e,t)=>({type:e,...t}),Er=(...e)=>e.flat().filter(e=>null!=e&&""!==e&&0!==e.length),vr=(...e)=>{return(t=Er(e.flat())).length>1?t:t[0];var t},Cr=(...e)=>e.flat().reduce((e,[t,n])=>({type:"binary",operator:t,left:e,right:n}));if((n=o())!==r&&cn===e.length)return n;throw n!==r&&cn0){for(t=1,n=1;ts.length)throw new Error("'".concat(t,"': Too many arguments for macro"));if(u.length>":return t(n)>>t(r);case"<":return t(n)":return t(n)>t(r);case"<=":return t(n)<=t(r);case">=":return t(n)>=t(r);case"==":return t(n)==t(r);case"!=":return t(n)!=t(r);case"&":return t(n)&t(r);case"^":return t(n)^t(r);case"|":return t(n)|t(r);case"&&":return t(n)&&t(r);case"||":return t(n)||t(r);default:throw new Error("Preprocessing error: Unknown binary operator ".concat(i))}},unary:function(e,t){switch(e.operator.literal){case"+":return t(e.expression);case"-":return-1*t(e.expression);case"!":return!t(e.expression);case"~":return~t(e.expression);default:throw new Error("Preprocessing error: Unknown unary operator ".concat(e.operator.literal))}}},(r=function(e){var t=n[e.type];if(!t)throw new Error("No evaluate() evaluator for ".concat(e.type));return t(e,r)})(e);var n,r}((n=sh(r,t).trim(),eh(s)(n,{grammarSource:"expression",startRule:"constant_expression"})),t)},lh=function(e,t){return void 0===t&&(t={}),e.replace(/\\[\n\r]/g,"")},uh=function(e,t){void 0===t&&(t={});var n,r,i,s,o=Object.entries(t.defines||{}).reduce(function(e,t){var n,r=t[0],i=t[1];return th(th({},e),((n={})[r]={body:i},n))},{}),a=(void 0===(n=t.preserve)&&(n={}),function(e){var t=null==n?void 0:n[e.node.type];return"function"==typeof t?t(e):t});return r={conditional:{enter:function(e){var t=e,n=t.node;a(t)||(function(e,t){return"if"===t.type?!!t.expression&&oh(ah(t.expression,e)):"ifdef"===t.type?t.identifier.identifier in e:"ifndef"===t.type?!(t.identifier.identifier in e):void 0}(o,n.ifPart)?t.replaceWith(n.ifPart.body):n.elseIfParts.reduce(function(e,n){return e||oh(ah(n.expression,o))&&(t.replaceWith(n.body),!0)},!1)||(n.elsePart?t.replaceWith(n.elsePart.body):t.remove()))}},text:{enter:function(e){var t=e;t.node.text=sh(t.node.text,o)}},define_arguments:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body,s=n.args;o[r]={args:s,body:i},!a(t)&&t.remove()}},define:{enter:function(e){var t=e,n=t.node,r=n.identifier.identifier,i=n.body;o[r]={body:i},!a(t)&&t.remove()}},undef:{enter:function(e){var t=e;delete o[t.node.identifier.identifier],!a(t)&&t.remove()}},error:{enter:function(e){var n=e;if(t.stopOnError)throw new Error(n.node.message);!a(n)&&n.remove()}},pragma:{enter:function(e){var t=e;!a(t)&&t.remove()}},version:{enter:function(e){var t=e;!a(t)&&t.remove()}},extension:{enter:function(e){var t=e;!a(t)&&t.remove()}},line:{enter:function(e){var t=e;!a(t)&&t.remove()}}},i=!1,(s=function(e,t,n,o,a){var l;if(!i){var u=r[e.type],c=function(e,t,n,r,i){return{node:e,parent:t,parentPath:n,key:r,index:i,stop:function(){this.stopped=!0},skip:function(){this.skipped=!0},remove:function(){this.removed=!0},replaceWith:function(e){this.replaced=e},findParent:function(e){return n?e(n)?n:n.findParent(e):n}}}(e,t,n,o,a),h=t;if(null==u?void 0:u.enter){if(u.enter(c),c.removed){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));return"number"==typeof a?h[o].splice(a,1):h[o]=null,c}if(c.replaced){if(!o||!t)throw new Error("Asked to remove ".concat(e," but no parent key was present in ").concat(t));"number"==typeof a?h[o].splice(a,1,c.replaced):h[o]=c.replaced}if(c.skipped)return c}if(c.stopped)i=!0;else if(c.replaced){var d=c.replaced;s(d,t,n,o,a)}else Object.entries(e).filter(function(e){return e[0],function(e){return function(e){return!!(null==e?void 0:e.type)}(e)||Array.isArray(e)}(e[1])}).forEach(function(t){var n=t[0],r=t[1];if(Array.isArray(r))for(var o=0,a=0;o-a{let e=!0;return n?(i({source:o,formatted:null,error:""}),function(e){return Gs(e,{parser:"glsl-parser",plugins:[Gc],printWidth:80,tabWidth:4,useTabs:!1}).then(Vc)}(o).then(t=>{e&&i({source:o,formatted:t,error:""})}).catch(t=>{if(!e)return;const n=dh(t);a.error("shader formatting failed: "+n),i({source:o,formatted:null,error:n})}),()=>{e=!1}):(i({source:o,formatted:null,error:""}),()=>{e=!1})},[n,o]);const c=n&&r.source===o?r.formatted:null;return{source:c||o,formatted:!!c,preprocessed:u,error:(r.source===o?r.error:"")||l}}(C.source,C.preprocessed,e.beautify),S=D.source,A=C.edited,_=[e.fragment?e.sourceFragmentLog:e.sourceVertexLog,e.programLog].filter(e=>!!e).join("\n"),y=!e.translated&&!D.preprocessed&&!D.formatted,b=function(e,t,n,r){return!(e||t||!n||r)}(t,A,_,y);(0,dt.useLayoutEffect)(()=>{g.current={programId:e.programId,sourceVertex:e.sourceVertex,sourceFragment:e.sourceFragment}},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!d.current)return;if(!f.current){const e=ace.edit(d.current);e.setTheme("ace/theme/monokai"),e.getSession().setMode("ace/mode/glsl"),e.setShowPrintMargin(!1),f.current=e}const t=f.current;t.setReadOnly(!e.editable||e.translated),t.getValue()!==S&&t.setValue(S,-1);const n=()=>{const n=t.getValue();e.fragment?m.current.fragment=n:m.current.vertex=n,v(t=>e.fragment?t.fragment?t:Object.assign(Object.assign({},t),{fragment:!0}):t.vertex?t:Object.assign(Object.assign({},t),{vertex:!0})),function(e,t,n,r){e&&n(!1),t&&r(!1)}(e.beautify,e.preprocessed,c,h),-1!==p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{if(p.current=-1,!function(e,t){return e.programId===t.programId&&e.sourceVertex===t.sourceVertex&&e.sourceFragment===t.sourceFragment}(g.current,e))return;const t={sourceVertex:m.current.vertex,sourceFragment:m.current.fragment,translatedSourceVertex:e.translatedSourceVertex,translatedSourceFragment:e.translatedSourceFragment,programId:e.programId};u(t)},1500)},r=e.editable&&!e.translated;return r&&t.getSession().on("change",n),()=>{r&&t.getSession().off("change",n)}},[S,e.editable,e.translated,e.fragment,e.beautify,e.preprocessed,e.sourceVertex,e.sourceFragment,e.translatedSourceVertex,e.translatedSourceFragment,e.programId,c,h,u]),(0,dt.useEffect)(()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),m.current={baseProgramId:e.programId,baseVertex:e.sourceVertex,baseFragment:e.sourceFragment,vertex:e.sourceVertex,fragment:e.sourceFragment},v({vertex:!1,fragment:!1})},[e.programId,e.sourceFragment,e.sourceVertex]),(0,dt.useEffect)(()=>{if(!f.current)return;const e=t||(y&&!A?_:"");f.current.getSession().setAnnotations(function(e){if(!e)return[];const t=[],n=e.split(/\r?\n/);for(const e of n){const n=e.replace(/\0/g,"").trim();if(!n)continue;let r=/^(error|warning|info)\s*:\s*\d+\s*:\s*(\d+)(?:\s*:\s*(\d+))?\s*:\s*(.*)$/i.exec(n);if(r){t.push(Pt(r[1],r[2],r[3],r[4]));continue}if(r=/^\d+\s*\(\s*(\d+)\s*\)\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[2],r[1],"",r[3]));continue}if(r=/^\d+\s*:\s*(\d+)(?:\s*\(\s*(\d+)\s*\))?\s*:\s*(error|warning|info)\b\s*:?\s*(.*)$/i.exec(n),r){t.push(Pt(r[3],r[1],r[2],r[4]));continue}const i=/\b(error|warning|info)\b/i.exec(n);t.push({row:0,column:0,text:n,type:i?i[1].toLowerCase():"info"})}return t}(e))},[_,y,t,D.formatted,D.preprocessed,A,e.beautify,e.fragment,e.programLog,e.sourceFragmentLog,e.sourceVertexLog,e.translated]),(0,dt.useEffect)(()=>()=>{-1!==p.current&&(clearTimeout(p.current),p.current=-1),f.current&&(f.current.destroy(),f.current=null)},[]);const T=(0,dt.useCallback)(e=>{e.preventDefault(),n()},[n]),R=(0,dt.useCallback)(e=>{e.preventDefault(),r()},[r]),x=(0,dt.useCallback)(e=>{e.preventDefault(),null==i||i()},[i]),w=(0,dt.useCallback)(e=>{e.preventDefault(),null==o||o()},[o]),F=(0,dt.useCallback)(e=>{e.preventDefault(),l()},[l]),N=!e.singleShader||!e.fragment,L=!e.singleShader||e.fragment,O=D.error;return(0,mt.jsxs)("div",{className:"sourceCodeComponentContainer",children:[(0,mt.jsx)("div",{className:"sourceCodeMenuComponentContainer",children:(0,mt.jsxs)("ul",{className:"sourceCodeMenuComponent",children:[N&&e.translatedSourceVertex&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:!e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedVertexSourceClicked",onClick:x,children:"Translated Vertex"})}),L&&e.translatedSourceFragment&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&e.translated?"active":"",href:"#",role:"button",commandName:"onTranslatedFragmentSourceClicked",onClick:w,children:"Translated Fragment"})}),N&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment||e.translated?"":"active",href:"#",role:"button",commandName:"onVertexSourceClicked",onClick:T,children:"Vertex"})}),L&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{className:e.fragment&&!e.translated?"active":"",href:"#",role:"button",commandName:"onFragmentSourceClicked",onClick:R,children:"Fragment"})}),(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onSourceCodeCloseClicked",onClick:F,children:"Close"})})]})}),(0,mt.jsx)("div",{className:"sourceCodeComponent",ref:d}),(0,mt.jsx)(hh,{beautify:e.beautify,capturedDiagnosticsHidden:b,fragment:e.fragment,preprocessed:e.preprocessed,processingError:O,onBeautifyChanged:c,onFragmentSourceClicked:r,onPreprocessChanged:h,onVertexSourceClicked:n})]})}function hh({beautify:e,capturedDiagnosticsHidden:t,fragment:n,preprocessed:r,processingError:i,onBeautifyChanged:s,onFragmentSourceClicked:o,onPreprocessChanged:a,onVertexSourceClicked:l}){const u=(0,dt.useCallback)(e=>{s(e.target.checked)},[s]),c=(0,dt.useCallback)(e=>{a(e.target.checked)},[a]),h=(0,dt.useCallback)(e=>{e.preventDefault(),(n?o:l)(),s(!1),a(!1)},[n,s,o,a,l]);return(0,mt.jsx)("div",{className:"sourceCodeMenuComponentFooter",children:(0,mt.jsxs)("p",{children:[(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onBeautifyChanged",checked:e,onChange:u})," Beautify"]}),(0,mt.jsxs)("label",{children:[(0,mt.jsx)("input",{type:"checkbox",commandName:"onPreprocessChanged",checked:r,onChange:c})," Preprocess"]}),i&&(0,mt.jsx)("span",{className:"sourceCodeFormatError",role:"alert",title:i,children:"Shader processing failed"}),t&&(0,mt.jsxs)("span",{className:"sourceCodeDiagnosticsNotice",role:"status",children:["Captured diagnostics hidden."," ",(0,mt.jsx)("a",{href:"#",role:"button",commandName:"onShowCapturedDiagnostics",onClick:h,children:"Show original with diagnostics"})]})]})})}function dh(e){return e instanceof Error?e.message:String(e)}function fh({title:e,children:t}){const n=e?e.replace(/([A-Z])/g," $1").trim():"";return(0,mt.jsxs)("div",{className:"jsonGroupComponent",children:[(0,mt.jsx)("div",{className:"jsonGroupComponentTitle",children:n}),(0,mt.jsx)("ul",{children:t})]})}function ph({itemKey:e,value:t}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsx)("span",{className:"jsonItemComponentValue",children:t})]})}function mh({itemKey:e,value:t,pixelated:n,raw:r}){const i=bt();return(0,mt.jsx)("li",{className:"jsonItemImageHolder",children:(0,mt.jsxs)("div",{className:"jsonItemImage jsonItemImageClickable",children:[(0,mt.jsx)("img",{src:t,style:n?{imageRendering:"pixelated"}:void 0,title:"Open in texture viewer",onClick:()=>i.openTextureViewer({src:t,label:e,pixelated:n,raw:r||null})}),(0,mt.jsx)("span",{children:e})]})})}function gh({itemKey:e,value:t,help:n}){return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("span",{className:"jsonItemComponentValue",children:[t+" (",(0,mt.jsx)("a",{href:n,target:"_blank",className:"jsonSourceItemComponentOpen",children:"Open help page"}),")"]})]})}function Eh({visualState:e}){const t=bt();return(0,mt.jsxs)("div",{className:"jsonVisualStateItemComponent",children:[e.Attachments?e.Attachments.map((n,r)=>n.src?(0,mt.jsxs)(dt.Fragment,{children:[(0,mt.jsx)("img",{className:"jsonItemImageClickable",src:encodeURI(n.src),title:"Open in texture viewer",onClick:()=>t.openTextureViewer({src:n.src,label:n.attachmentName||"Attachment",pixelated:!1,raw:n.raw||null})}),e.Attachments.length>1&&(0,mt.jsx)("span",{children:n.attachmentName})]},r):null):(0,mt.jsx)("span",{children:e.FrameBufferStatus}),(0,mt.jsx)("span",{children:e.FrameBuffer?e.FrameBuffer.__SPECTOR_Object_TAG.displayText:"Canvas frame buffer"})]})}function vh({itemKey:e,shader:t,programLog:n,onOpen:r}){const i=(0,dt.useCallback)(e=>{e.preventDefault(),null==r||r(t,n)},[r,n,t]),s=t.source?t.source.length:0,o=`${t.name||"Shader"} (${s} chars)`;return(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"jsonItemComponentKey",children:e+": "}),(0,mt.jsxs)("a",{href:"#",role:"button",className:"jsonSourceItemComponentOpen",commandName:"onShaderSourceOpen",onClick:i,children:["Open ",o]})]})}function Ch({items:e,onShaderSourceOpen:t}){return e&&0!==e.length?(0,mt.jsx)(mt.Fragment,{children:e.map((e,n)=>{switch(e.type){case"group":return(0,mt.jsx)(fh,{title:e.title,children:(0,mt.jsx)(Ch,{items:e.children,onShaderSourceOpen:t})},n);case"item":return(0,mt.jsx)(ph,{itemKey:e.key,value:e.value},n);case"image":return(0,mt.jsx)(mh,{itemKey:e.key,value:e.value,pixelated:e.pixelated,raw:e.raw},n);case"help":return(0,mt.jsx)(gh,{itemKey:e.key,value:e.value,help:e.help},n);case"shaderSource":return(0,mt.jsx)(vh,{itemKey:e.key,shader:e.shader,programLog:e.programLog,onOpen:t},n);case"visualState":return(0,mt.jsx)(Eh,{visualState:e.visualState},n);default:return null}})}):null}const Dh={added:"+",removed:"-",changed:"~",unchanged:" "};function Sh(e){const t=void 0===e.indexA?"_":String(e.indexA),n=void 0===e.indexB?"_":String(e.indexB);return e.type+"#"+t+"#"+n}function Ah(e){return!(!e.previousImage&&!e.currentImage)}function _h(){const e=bt(),t=pt(e.store),[n,r]=(0,dt.useState)(null);if((0,dt.useEffect)(()=>{r(null)},[t.compareRows]),!t.canCompare)return(0,mt.jsx)("div",{className:"compareViewComponent",children:(0,mt.jsx)("div",{className:"compareViewEmpty",children:"Capture the same page at least twice, then select a capture to compare it against the previous one."})});const{added:i,removed:s,changed:o,unchanged:a}=t.compareSummary,l=t.compareOnlyDifferences?t.compareRows.filter(e=>"unchanged"!==e.type):t.compareRows,u=l.find(e=>Sh(e)===n)||(l.length>0?l[0]:null),c=u?Sh(u):"";return(0,mt.jsxs)("div",{className:"compareViewComponent",children:[(0,mt.jsxs)("div",{className:"compareViewHeader",children:[(0,mt.jsx)("span",{className:"compareViewLabel",children:t.compareLabel}),(0,mt.jsxs)("span",{className:"compareViewSummary",children:[(0,mt.jsxs)("span",{className:"added",children:["+",i]}),(0,mt.jsxs)("span",{className:"removed",children:["-",s]}),(0,mt.jsxs)("span",{className:"changed",children:["~",o]}),(0,mt.jsxs)("span",{className:"unchanged",children:["=",a]})]}),(0,mt.jsxs)("label",{className:"compareViewToggle",children:[(0,mt.jsx)("input",{type:"checkbox",checked:t.compareOnlyDifferences,onChange:t=>e.handleCompareOnlyDifferencesChange(t.target.checked)}),"Differences only"]})]}),(0,mt.jsxs)("div",{className:"compareViewBody",children:[(0,mt.jsx)(yh,{}),(0,mt.jsx)("ul",{className:"compareViewList",children:0===l.length?(0,mt.jsx)("li",{className:"compareViewEmptyRow",children:"No differences between these two captures."}):l.map(e=>{const t=Sh(e);return(0,mt.jsx)(bh,{row:e,selected:t===c,onSelect:()=>r(t)},t)})}),(0,mt.jsx)("div",{className:"compareViewDetail",children:u?(0,mt.jsx)(Th,{row:u,onSelectCommand:e.handleCompareCommandSelected,onOpenTexture:(t,n)=>e.openTextureViewer({src:t,label:n,pixelated:!1,raw:null})}):(0,mt.jsx)("div",{className:"compareDetailEmpty",children:"Select a call to see its details."})})]})]})}function yh(){return(0,mt.jsxs)("div",{className:"compareViewLegend",children:[(0,mt.jsxs)("div",{className:"compareLegendRow added",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Added"]}),(0,mt.jsxs)("div",{className:"compareLegendRow removed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Removed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow changed",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Changed"]}),(0,mt.jsxs)("div",{className:"compareLegendRow unchanged",children:[(0,mt.jsx)("span",{className:"compareLegendChip"})," Unchanged"]})]})}function bh(e){const{row:t,selected:n,onSelect:r}=e,i="removed"===t.type?t.previousText:t.currentText,s=i&&0===i.indexOf(t.name)?i.slice(t.name.length):"",o="compareRow "+t.type+(n?" selected":"");return(0,mt.jsxs)("li",{className:o,onClick:r,title:i,children:[(0,mt.jsx)("span",{className:"compareSign",children:Dh[t.type]}),(0,mt.jsxs)("span",{className:"compareRowText",children:[(0,mt.jsx)("span",{className:"compareCmdName",children:t.name}),s]})]})}function Th(e){const{row:t,onSelectCommand:n,onOpenTexture:r}=e,i=t.fieldDiffs||[],s=i.filter(e=>!Ah(e)),o=i.filter(Ah),a="changed"===t.type&&t.previousText!==t.currentText,l="removed"===t.type?t.previousText:t.currentText;return(0,mt.jsxs)("div",{className:"compareDetail",children:[(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Command"}),(0,mt.jsxs)("ul",{children:[(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"name"}),":"," ",(0,mt.jsx)("span",{className:"compareCmdName "+t.type,children:t.name})]}),(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:"call"}),":"," ",a?(0,mt.jsxs)("span",{className:"compareTextChange",children:[(0,mt.jsx)("span",{className:"compareOld",children:t.previousText}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:t.currentText})]}):(0,mt.jsx)("span",{className:"compareNew",children:l})]}),void 0!==t.commandId&&(0,mt.jsx)("li",{children:(0,mt.jsx)("a",{href:"#",className:"compareCommandLink",title:"Show this command in the Commands view",onClick:e=>{e.preventDefault(),n(t.commandId)},children:"Show in Commands view →"})})]})]}),s.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Uniform & state changes"}),(0,mt.jsx)("ul",{children:s.map((e,t)=>(0,mt.jsxs)("li",{children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),":"," ",(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),(0,mt.jsx)("span",{className:"compareNew",children:e.current})]},t))})]}),o.length>0&&(0,mt.jsxs)("div",{className:"compareDetailGroup",children:[(0,mt.jsx)("div",{className:"compareDetailTitle",children:"Texture changes"}),(0,mt.jsx)("ul",{children:o.map((e,t)=>(0,mt.jsxs)("li",{className:"compareTextureItem",children:[(0,mt.jsx)("span",{className:"compareDetailKey",children:e.path}),(0,mt.jsxs)("div",{className:"compareImageDiff",children:[e.previousImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.previousImage,title:"Open in texture viewer",onClick:()=>r(e.previousImage,e.path+" (previous)")}):(0,mt.jsx)("span",{className:"compareOld",children:e.previous}),(0,mt.jsx)("span",{className:"compareArrow",children:" → "}),e.currentImage?(0,mt.jsx)("img",{className:"compareThumb jsonItemImageClickable",src:e.currentImage,title:"Open in texture viewer",onClick:()=>r(e.currentImage,e.path+" (current)")}):(0,mt.jsx)("span",{className:"compareNew",children:e.current})]})]},t))})]})]})}function Rh(e){const t=(255&e).toString(16);return 1===t.length?"0"+t:t}function xh(e,t,n,r){return"#"+Rh(e)+Rh(t)+Rh(n)+Rh(r)}function wh(e,t,n,r){const i=e=>(e/255).toFixed(2);return i(e)+", "+i(t)+", "+i(n)+", "+i(r)}function Fh(){const e=bt(),t=pt(e.store).textureViewer;return t.open?(0,mt.jsx)(Lh,{viewer:t,onClose:e.closeTextureViewer}):null}const Nh=120;function Lh(e){const{viewer:t,onClose:n}=e,r=(0,dt.useRef)(null),i=(0,dt.useRef)(null),s=(0,dt.useRef)(null),o=(0,dt.useRef)(null),[a,l]=(0,dt.useState)({r:!0,g:!0,b:!0,a:!0}),[u,c]=(0,dt.useState)(1),[h,d]=(0,dt.useState)("checker"),[f,p]=(0,dt.useState)(null),[m,g]=(0,dt.useState)(null),[E,v]=(0,dt.useState)(!1);(0,dt.useEffect)(()=>{let e=!1;const n=t=>{e||(o.current=t,p({width:t.width,height:t.height}),c(kh(t.width,t.height)),v(!0))};if(t.raw){const r=function(e){try{if(!e.data||e.width<=0||e.height<=0)return null;const t=function(e){const t=atob(e),n=new Uint8ClampedArray(t.length);for(let e=0;e{e=!0}}const r=new Image;return r.onload=()=>{const e=document.createElement("canvas");e.width=r.naturalWidth||1,e.height=r.naturalHeight||1;const t=e.getContext("2d");if(!t)return;t.drawImage(r,0,0);const i=t.getImageData(0,0,e.width,e.height);n({data:new Uint8ClampedArray(i.data),width:e.width,height:e.height})},r.src=t.src,()=>{e=!0}},[t.src,t.raw]),(0,dt.useEffect)(()=>{const e=o.current,t=r.current;if(!E||!e||!t)return;const n=function(e,t,n){let r=e.current;return r||(r=document.createElement("canvas"),e.current=r),r.width!==t&&(r.width=t),r.height!==n&&(r.height=n),r}(s,e.width,e.height),i=n.getContext("2d"),l=t.getContext("2d");if(!i||!l)return;const c=function(e,t){const n=new Uint8ClampedArray(e.length),r=t.a&&!t.r&&!t.g&&!t.b;for(let i=0;i{const e=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]);const C="textureViewerViewport"+("checker"===h?" checker":""),D="black"===h?{background:"#000"}:"white"===h?{background:"#fff"}:void 0;return(0,mt.jsx)("div",{className:"textureViewerOverlay",onClick:n,children:(0,mt.jsxs)("div",{className:"textureViewerModal",onClick:e=>e.stopPropagation(),children:[(0,mt.jsxs)("div",{className:"textureViewerHeader",children:[(0,mt.jsx)("span",{className:"textureViewerTitle",children:t.label}),(0,mt.jsxs)("span",{className:"textureViewerMeta",children:[f?f.width+" × "+f.height:"",!t.raw&&f?" · thumbnail":""]}),(0,mt.jsx)("span",{className:"textureViewerClose",title:"Close (Esc)",onClick:n,children:"✕"})]}),(0,mt.jsxs)("div",{className:"textureViewerToolbar",children:[(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Channels"}),(0,mt.jsx)(Oh,{channel:"r",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"g",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"b",mask:a,setMask:l}),(0,mt.jsx)(Oh,{channel:"a",mask:a,setMask:l})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"tvBtn",title:"Force alpha = 1 to reveal RGB hidden behind transparency",onClick:()=>l({r:!0,g:!0,b:!0,a:!1}),children:"Opaque"}),(0,mt.jsx)("span",{className:"tvBtn",title:"Show the alpha channel as grayscale",onClick:()=>l({r:!1,g:!1,b:!1,a:!0}),children:"Alpha → gray"})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"BG"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)(Ih,{value:"checker",glyph:"▦",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"black",glyph:"■",background:h,setBackground:d}),(0,mt.jsx)(Ih,{value:"white",glyph:"□",background:h,setBackground:d})]})]}),(0,mt.jsxs)("div",{className:"textureViewerGroup",children:[(0,mt.jsx)("span",{className:"lbl",children:"Zoom"}),(0,mt.jsxs)("div",{className:"seg",children:[(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.max(1,e/2)),children:"−"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(f?kh(f.width,f.height):1),children:"Fit"}),(0,mt.jsx)("span",{className:"tvBtn",onClick:()=>c(e=>Math.min(32,2*e)),children:"+"})]}),(0,mt.jsxs)("span",{className:"zoomVal",children:[Math.round(100*u),"%"]})]}),(0,mt.jsx)("div",{className:"textureViewerGroup textureViewerGroupEnd",children:(0,mt.jsx)("span",{className:"tvBtn primary",onClick:()=>{const e=s.current;e&&e.toBlob(e=>{if(!e)return;const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=((t.label||"texture").replace(/[^a-z0-9_\-]+/gi,"_").replace(/^_+|_+$/g,"")||"texture")+".png",r.click(),setTimeout(()=>URL.revokeObjectURL(n),0)})},children:"⭳ Save PNG"})})]}),(0,mt.jsxs)("div",{className:"textureViewerBody",children:[(0,mt.jsxs)("div",{className:C,style:D,children:[(0,mt.jsx)("canvas",{ref:r,className:"textureViewerCanvas",onMouseMove:e=>{const t=o.current,n=r.current,a=i.current,l=s.current;if(!t||!n)return;const c=n.getBoundingClientRect(),h=Math.floor((e.clientX-c.left)/u),d=Math.floor((e.clientY-c.top)/u);if(h<0||d<0||h>=t.width||d>=t.height)return g(null),void(a&&(a.style.display="none"));const f=4*(d*t.width+h);g({x:h,y:d,r:t.data[f],g:t.data[f+1],b:t.data[f+2],a:t.data[f+3]}),function(e,t,n,r){if(!e||!t)return;const i=e.getContext("2d");if(!i)return;i.imageSmoothingEnabled=!1,i.clearRect(0,0,Nh,Nh),i.drawImage(t,n-7,r-7,15,15,0,0,Nh,Nh),i.strokeStyle="#F0640D",i.lineWidth=2,i.strokeRect(56,56,8,8),e.style.display="block"}(a,l,h,d)},onMouseLeave:()=>{g(null),i.current&&(i.current.style.display="none")}}),(0,mt.jsx)("canvas",{ref:i,className:"textureViewerLoupe",width:Nh,height:Nh})]}),(0,mt.jsxs)("div",{className:"textureViewerRail",children:[(0,mt.jsx)("div",{className:"railTitle",children:"Pixel inspector"}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"position"}),(0,mt.jsx)("span",{className:"v",children:m?m.x+", "+m.y:"—"})]}),(0,mt.jsx)("div",{className:"swatch",children:(0,mt.jsx)("div",{className:"swatchInner",style:m?{background:"rgba("+m.r+","+m.g+","+m.b+","+m.a/255+")"}:void 0})}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"R"}),(0,mt.jsx)("span",{className:"v",children:m?m.r:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"G"}),(0,mt.jsx)("span",{className:"v",children:m?m.g:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"B"}),(0,mt.jsx)("span",{className:"v",children:m?m.b:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"A"}),(0,mt.jsx)("span",{className:"v",children:m?m.a:"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"hex"}),(0,mt.jsx)("span",{className:"v",children:m?xh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"kv",children:[(0,mt.jsx)("span",{className:"k",children:"norm"}),(0,mt.jsx)("span",{className:"v",children:m?wh(m.r,m.g,m.b,m.a):"—"})]}),(0,mt.jsxs)("div",{className:"hint",children:["Move over the texture to sample pixels. Toggle channels to isolate RGB / alpha.",(0,mt.jsx)("b",{children:" Opaque"})," reveals colour hidden behind transparency (#183)."]})]})]})]})})}function Oh(e){const{channel:t,mask:n,setMask:r}=e,i=n[t],s="channel "+t+(i?" on":"");return(0,mt.jsx)("span",{className:s,onClick:()=>r(Object.assign(Object.assign({},n),{[t]:!i})),children:t.toUpperCase()})}function Ih(e){const{value:t,glyph:n,background:r,setBackground:i}=e;return(0,mt.jsx)("span",{className:"tvBtn"+(r===t?" active":""),onClick:()=>i(t),children:n})}function kh(e,t){return Math.max(1,Math.min(16,Math.floor(480/Math.max(e,t))||1))}function Mh(){const e=bt(),t=pt(e.store);return(0,mt.jsxs)("div",{className:"resultViewComponent "+(t.visible?"active":""),children:[(0,mt.jsx)(Tt,{}),(0,mt.jsxs)(Rt,{children:[0===t.menuStatus&&(0,mt.jsx)(wt,{active:!0,captures:t.captures,onCaptureSelected:t=>{e.selectCapture(t),e.handleMenuStatusChange(40)},onSaveRequested:e.handleSaveRequested,onCaptureLoaded:e.handleCaptureLoaded}),40===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(Ft,{children:t.visualStates.map((t,n)=>(0,mt.jsx)(Nt,{item:t,onVisualStateSelected:()=>e.handleVisualStateSelected(n)},n))}),(0,mt.jsx)(Lt,{children:t.commands.map((t,n)=>(0,mt.jsx)(Ot,{command:t,onCommandSelected:()=>e.handleCommandSelected(n),onVertexSelected:()=>e.handleVertexSelected(n),onFragmentSelected:()=>e.handleFragmentSelected(n),onShaderSelected:()=>e.handleShaderSelected(n)},n))}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]}),10===t.menuStatus&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(kt,{left:!0,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationLeft})})}),(0,mt.jsx)(kt,{left:!1,children:(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.informationRight})})})]}),20===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.initStateData})}),30===t.menuStatus&&(0,mt.jsx)(Mt,{children:(0,mt.jsx)(Ch,{items:t.endStateData})}),60===t.menuStatus&&(0,mt.jsx)(_h,{}),50===t.menuStatus&&t.sourceCodeState&&(0,mt.jsxs)(mt.Fragment,{children:[(0,mt.jsx)(ch,{state:t.sourceCodeState,errorMessage:t.sourceCodeError,onVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!1),onFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!1),onTranslatedVertexSourceClicked:()=>e.handleSourceCodeTabChange(!1,!0),onTranslatedFragmentSourceClicked:()=>e.handleSourceCodeTabChange(!0,!0),onCloseClicked:e.handleSourceCodeClose,onSourceCodeChanged:e.handleSourceCodeChanged,onBeautifyChanged:e.handleBeautifyChanged,onPreprocessChanged:e.handlePreprocessChanged}),(0,mt.jsx)(It,{children:(0,mt.jsx)(Ch,{items:t.commandDetailData,onShaderSourceOpen:e.handleShaderSourceOpen})})]})]}),(0,mt.jsx)(Fh,{})]})}class Ph{static getMDNLink(e){const t=Ph.WebGL2Functions[e];if(t)return Ph.WebGL2RootUrl+t;const n=Ph.WebGLFunctions[e];if(n)return Ph.WebGLRootUrl+n;const r=Ph.AngleInstancedArraysExtFunctions[e];return r?Ph.AngleInstancedArraysExtRootUrl+r:Ph.WebGLRootUrl+e}}Ph.WebGL2RootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/",Ph.WebGLRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/",Ph.AngleInstancedArraysExtRootUrl="https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/",Ph.WebGL2Functions={beginQuery:"beginQuery",beginTransformFeedback:"beginTransformFeedback",bindBufferBase:"bindBufferBase",bindBufferRange:"bindBufferRange",bindSampler:"bindSampler",bindTransformFeedback:"bindTransformFeedback",bindVertexArray:"bindVertexArray",blitFramebuffer:"blitFramebuffer",clearBufferfv:"clearBuffer",clearBufferiv:"clearBuffer",clearBufferuiv:"clearBuffer",clearBufferfi:"clearBuffer",clientWaitSync:"clientWaitSync",compressedTexImage3D:"compressedTexImage3D",compressedTexSubImage3D:"compressedTexSubImage3D",copyBufferSubData:"copyBufferSubData",copyTexSubImage3D:"copyTexSubImage3D",createQuery:"createQuery",createSampler:"createSampler",createTransformFeedback:"createTransformFeedback",createVertexArray:"createVertexArray",deleteQuery:"deleteQuery",deleteSampler:"deleteSampler",deleteSync:"deleteSync",deleteTransformFeedback:"deleteTransformFeedback",deleteVertexArray:"deleteVertexArray",drawArraysInstanced:"drawArraysInstanced",drawBuffers:"drawBuffers",drawElementsInstanced:"drawElementsInstanced",drawRangeElements:"drawRangeElements",endQuery:"endQuery",endTransformFeedback:"endTransformFeedback",fenceSync:"fenceSync",framebufferTextureLayer:"framebufferTextureLayer",getActiveUniformBlockName:"getActiveUniformBlockName",getActiveUniformBlockParameter:"getActiveUniformBlockParameter",getActiveUniforms:"getActiveUniforms",getBufferSubData:"getBufferSubData",getFragDataLocation:"getFragDataLocation",getIndexedParameter:"getIndexedParameter",getInternalformatParameter:"getInternalformatParameter",getQuery:"getQuery",getQueryParameter:"getQueryParameter",getSamplerParameter:"getSamplerParameter",getSyncParameter:"getSyncParameter",getTransformFeedbackVarying:"getTransformFeedbackVarying",getUniformBlockIndex:"getUniformBlockIndex",getUniformIndices:"getUniformIndices",invalidateFramebuffer:"invalidateFramebuffer",invalidateSubFramebuffer:"invalidateSubFramebuffer",isQuery:"isQuery",isSampler:"isSampler",isSync:"isSync",isTransformFeedback:"isTransformFeedback",isVertexArray:"isVertexArray",pauseTransformFeedback:"pauseTransformFeedback",readBuffer:"readBuffer",renderbufferStorageMultisample:"renderbufferStorageMultisample",resumeTransformFeedback:"resumeTransformFeedback",samplerParameteri:"samplerParameter",samplerParameterf:"samplerParameter",texImage3D:"texImage3D",texStorage2D:"texStorage2D",texStorage3D:"texStorage3D",texSubImage3D:"texSubImage3D",transformFeedbackVaryings:"transformFeedbackVaryings",uniform1ui:"uniform",uniform2ui:"uniform",uniform3ui:"uniform",uniform4ui:"uniform",uniform1fv:"uniform",uniform2fv:"uniform",uniform3fv:"uniform",uniform4fv:"uniform",uniform1iv:"uniform",uniform2iv:"uniform",uniform3iv:"uniform",uniform4iv:"uniform",uniform1uiv:"uniform",uniform2uiv:"uniform",uniform3uiv:"uniform",uniform4uiv:"uniform",uniformBlockBinding:"uniformBlockBinding",uniformMatrix2fv:"uniformMatrix",uniformMatrix3x2fv:"uniformMatrix",uniformMatrix4x2fv:"uniformMatrix",uniformMatrix2x3fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4x3fv:"uniformMatrix",uniformMatrix2x4fv:"uniformMatrix",uniformMatrix3x4fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttribDivisor:"vertexAttribDivisor",vertexAttribI4i:"vertexAttribI",vertexAttribI4ui:"vertexAttribI",vertexAttribI4iv:"vertexAttribI",vertexAttribI4uiv:"vertexAttribI",vertexAttribIPointer:"vertexAttribIPointer",waitSync:"waitSync"},Ph.WebGLFunctions={uniform1f:"uniform",uniform1fv:"uniform",uniform1i:"uniform",uniform1iv:"uniform",uniform2f:"uniform",uniform2fv:"uniform",uniform2i:"uniform",uniform2iv:"uniform",uniform3f:"uniform",uniform3i:"uniform",uniform3iv:"uniform",uniform4f:"uniform",uniform4fv:"uniform",uniform4i:"uniform",uniform4iv:"uniform",uniformMatrix2fv:"uniformMatrix",uniformMatrix3fv:"uniformMatrix",uniformMatrix4fv:"uniformMatrix",vertexAttrib1f:"vertexAttrib",vertexAttrib2f:"vertexAttrib",vertexAttrib3f:"vertexAttrib",vertexAttrib4f:"vertexAttrib",vertexAttrib1fv:"vertexAttrib",vertexAttrib2fv:"vertexAttrib",vertexAttrib3fv:"vertexAttrib",vertexAttrib4fv:"vertexAttrib"},Ph.AngleInstancedArraysExtFunctions={drawArraysInstancedANGLE:"drawArraysInstancedANGLE",drawElementsInstancedANGLE:"drawElementsInstancedANGLE",vertexAttribDivisorANGLE:"vertexAttribDivisorANGLE"};const Bh={activeTexture:[["texture"]],attachShader:[["program","shader"]],beginQuery:[["target","query"]],beginTransformFeedback:[["primitiveMode"]],bindAttribLocation:[["program","index","name"]],bindBuffer:[["target","buffer"]],bindBufferBase:[["target","index","buffer"]],bindBufferRange:[["target","index","buffer","offset","size"]],bindFramebuffer:[["target","framebuffer"]],bindRenderbuffer:[["target","renderbuffer"]],bindSampler:[["unit","sampler"]],bindTexture:[["target","texture"]],bindTransformFeedback:[["target","tf"]],bindVertexArray:[["array"]],blendColor:[["red","green","blue","alpha"]],blendEquation:[["mode"]],blendEquationSeparate:[["modeRGB","modeAlpha"]],blendFunc:[["sfactor","dfactor"]],blendFuncSeparate:[["srcRGB","dstRGB","srcAlpha","dstAlpha"]],blitFramebuffer:[["srcX0","srcY0","srcX1","srcY1","dstX0","dstY0","dstX1","dstY1","mask","filter"]],bufferData:[["target","data","usage"],["target","size","usage"],["target","srcData","usage"],["target","srcData","usage","srcOffset","length"]],bufferSubData:[["target","dstByteOffset","srcData"],["target","offset","data"],["target","dstByteOffset","srcData","srcOffset","length"]],checkFramebufferStatus:[["target"]],clear:[["mask"]],clearBufferfi:[["buffer","drawbuffer","depth","stencil"]],clearBufferfv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferiv:[["buffer","drawbuffer","values","srcOffset"]],clearBufferuiv:[["buffer","drawbuffer","values","srcOffset"]],clearColor:[["red","green","blue","alpha"]],clearDepth:[["depth"]],clearStencil:[["s"]],clientWaitSync:[["sync","flags","timeout"]],colorMask:[["red","green","blue","alpha"]],compileShader:[["shader"]],compressedTexImage2D:[["target","level","internalformat","width","height","border","data"],["target","level","internalformat","width","height","border","imageSize","offset"],["target","level","internalformat","width","height","border","srcData","srcOffset","srcLengthOverride"]],compressedTexImage3D:[["target","level","internalformat","width","height","depth","border","imageSize","offset"],["target","level","internalformat","width","height","depth","border","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage2D:[["target","level","xoffset","yoffset","width","height","format","data"],["target","level","xoffset","yoffset","width","height","format","imageSize","offset"],["target","level","xoffset","yoffset","width","height","format","srcData","srcOffset","srcLengthOverride"]],compressedTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","imageSize","offset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","srcData","srcOffset","srcLengthOverride"]],copyBufferSubData:[["readTarget","writeTarget","readOffset","writeOffset","size"]],copyTexImage2D:[["target","level","internalformat","x","y","width","height","border"]],copyTexSubImage2D:[["target","level","xoffset","yoffset","x","y","width","height"]],copyTexSubImage3D:[["target","level","xoffset","yoffset","zoffset","x","y","width","height"]],createBuffer:[[]],createFramebuffer:[[]],createProgram:[[]],createQuery:[[]],createRenderbuffer:[[]],createSampler:[[]],createShader:[["type"]],createTexture:[[]],createTransformFeedback:[[]],createVertexArray:[[]],cullFace:[["mode"]],deleteBuffer:[["buffer"]],deleteFramebuffer:[["framebuffer"]],deleteProgram:[["program"]],deleteQuery:[["query"]],deleteRenderbuffer:[["renderbuffer"]],deleteSampler:[["sampler"]],deleteShader:[["shader"]],deleteSync:[["sync"]],deleteTexture:[["texture"]],deleteTransformFeedback:[["tf"]],deleteVertexArray:[["vertexArray"]],depthFunc:[["func"]],depthMask:[["flag"]],depthRange:[["zNear","zFar"]],detachShader:[["program","shader"]],disable:[["cap"]],disableVertexAttribArray:[["index"]],drawArrays:[["mode","first","count"]],drawArraysInstanced:[["mode","first","count","instanceCount"]],drawBuffers:[["buffers"]],drawElements:[["mode","count","type","offset"]],drawElementsInstanced:[["mode","count","type","offset","instanceCount"]],drawRangeElements:[["mode","start","end","count","type","offset"]],enable:[["cap"]],enableVertexAttribArray:[["index"]],endQuery:[["target"]],endTransformFeedback:[[]],fenceSync:[["condition","flags"]],finish:[[]],flush:[[]],framebufferRenderbuffer:[["target","attachment","renderbuffertarget","renderbuffer"]],framebufferTexture2D:[["target","attachment","textarget","texture","level"]],framebufferTextureLayer:[["target","attachment","texture","level","layer"]],frontFace:[["mode"]],generateMipmap:[["target"]],getActiveAttrib:[["program","index"]],getActiveUniform:[["program","index"]],getActiveUniformBlockName:[["program","uniformBlockIndex"]],getActiveUniformBlockParameter:[["program","uniformBlockIndex","pname"]],getActiveUniforms:[["program","uniformIndices","pname"]],getAttachedShaders:[["program"]],getAttribLocation:[["program","name"]],getBufferParameter:[["target","pname"]],getBufferSubData:[["target","srcByteOffset","dstBuffer","dstOffset","length"]],getContextAttributes:[[]],getError:[[]],getExtension:[["extensionName"],["name"]],getFragDataLocation:[["program","name"]],getFramebufferAttachmentParameter:[["target","attachment","pname"]],getIndexedParameter:[["target","index"]],getInternalformatParameter:[["target","internalformat","pname"]],getParameter:[["pname"]],getProgramInfoLog:[["program"]],getProgramParameter:[["program","pname"]],getQuery:[["target","pname"]],getQueryParameter:[["query","pname"]],getRenderbufferParameter:[["target","pname"]],getSamplerParameter:[["sampler","pname"]],getShaderInfoLog:[["shader"]],getShaderParameter:[["shader","pname"]],getShaderPrecisionFormat:[["shadertype","precisiontype"]],getShaderSource:[["shader"]],getSupportedExtensions:[[]],getSyncParameter:[["sync","pname"]],getTexParameter:[["target","pname"]],getTransformFeedbackVarying:[["program","index"]],getUniform:[["program","location"]],getUniformBlockIndex:[["program","uniformBlockName"]],getUniformIndices:[["program","uniformNames"]],getUniformLocation:[["program","name"]],getVertexAttrib:[["index","pname"]],getVertexAttribOffset:[["index","pname"]],hint:[["target","mode"]],invalidateFramebuffer:[["target","attachments"]],invalidateSubFramebuffer:[["target","attachments","x","y","width","height"]],isBuffer:[["buffer"]],isContextLost:[[]],isEnabled:[["cap"]],isFramebuffer:[["framebuffer"]],isProgram:[["program"]],isQuery:[["query"]],isRenderbuffer:[["renderbuffer"]],isSampler:[["sampler"]],isShader:[["shader"]],isSync:[["sync"]],isTexture:[["texture"]],isTransformFeedback:[["tf"]],isVertexArray:[["vertexArray"]],lineWidth:[["width"]],linkProgram:[["program"]],pauseTransformFeedback:[[]],pixelStorei:[["pname","param"]],polygonOffset:[["factor","units"]],readBuffer:[["src"]],readPixels:[["x","y","width","height","format","type","dstData"],["x","y","width","height","format","type","offset"],["x","y","width","height","format","type","pixels"],["x","y","width","height","format","type","dstData","dstOffset"]],renderbufferStorage:[["target","internalformat","width","height"]],renderbufferStorageMultisample:[["target","samples","internalformat","width","height"]],resumeTransformFeedback:[[]],sampleCoverage:[["value","invert"]],samplerParameterf:[["sampler","pname","param"]],samplerParameteri:[["sampler","pname","param"]],scissor:[["x","y","width","height"]],shaderSource:[["shader","source"]],stencilFunc:[["func","ref","mask"]],stencilFuncSeparate:[["face","func","ref","mask"]],stencilMask:[["mask"]],stencilMaskSeparate:[["face","mask"]],stencilOp:[["fail","zfail","zpass"]],stencilOpSeparate:[["face","fail","zfail","zpass"]],texImage2D:[["target","level","internalformat","format","type","source"],["target","level","internalformat","width","height","border","format","type","pboOffset"],["target","level","internalformat","width","height","border","format","type","pixels"],["target","level","internalformat","width","height","border","format","type","source"],["target","level","internalformat","width","height","border","format","type","srcData","srcOffset"]],texImage3D:[["target","level","internalformat","width","height","depth","border","format","type","pboOffset"],["target","level","internalformat","width","height","depth","border","format","type","source"],["target","level","internalformat","width","height","depth","border","format","type","srcData"],["target","level","internalformat","width","height","depth","border","format","type","srcData","srcOffset"]],texParameterf:[["target","pname","param"]],texParameteri:[["target","pname","param"]],texStorage2D:[["target","levels","internalformat","width","height"]],texStorage3D:[["target","levels","internalformat","width","height","depth"]],texSubImage2D:[["target","level","xoffset","yoffset","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","pboOffset"],["target","level","xoffset","yoffset","width","height","format","type","pixels"],["target","level","xoffset","yoffset","width","height","format","type","source"],["target","level","xoffset","yoffset","width","height","format","type","srcData","srcOffset"]],texSubImage3D:[["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","pboOffset"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","source"],["target","level","xoffset","yoffset","zoffset","width","height","depth","format","type","srcData","srcOffset"]],transformFeedbackVaryings:[["program","varyings","bufferMode"]],uniform1f:[["location","x"]],uniform1fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1i:[["location","x"]],uniform1iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform1ui:[["location","v0"]],uniform1uiv:[["location","data","srcOffset","srcLength"]],uniform2f:[["location","x","y"]],uniform2fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2i:[["location","x","y"]],uniform2iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform2ui:[["location","v0","v1"]],uniform2uiv:[["location","data","srcOffset","srcLength"]],uniform3f:[["location","x","y","z"]],uniform3fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3i:[["location","x","y","z"]],uniform3iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform3ui:[["location","v0","v1","v2"]],uniform3uiv:[["location","data","srcOffset","srcLength"]],uniform4f:[["location","x","y","z","w"]],uniform4fv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4i:[["location","x","y","z","w"]],uniform4iv:[["location","v"],["location","data","srcOffset","srcLength"]],uniform4ui:[["location","v0","v1","v2","v3"]],uniform4uiv:[["location","data","srcOffset","srcLength"]],uniformBlockBinding:[["program","uniformBlockIndex","uniformBlockBinding"]],uniformMatrix2fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x3fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix2x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix3x4fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4fv:[["location","transpose","value"],["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x2fv:[["location","transpose","data","srcOffset","srcLength"]],uniformMatrix4x3fv:[["location","transpose","data","srcOffset","srcLength"]],useProgram:[["program"]],validateProgram:[["program"]],vertexAttrib1f:[["index","x"]],vertexAttrib1fv:[["index","values"]],vertexAttrib2f:[["index","x","y"]],vertexAttrib2fv:[["index","values"]],vertexAttrib3f:[["index","x","y","z"]],vertexAttrib3fv:[["index","values"]],vertexAttrib4f:[["index","x","y","z","w"]],vertexAttrib4fv:[["index","values"]],vertexAttribDivisor:[["index","divisor"]],vertexAttribI4i:[["index","x","y","z","w"]],vertexAttribI4iv:[["index","values"]],vertexAttribI4ui:[["index","x","y","z","w"]],vertexAttribI4uiv:[["index","values"]],vertexAttribIPointer:[["index","size","type","stride","offset"]],vertexAttribPointer:[["index","size","type","normalized","stride","offset"]],viewport:[["x","y","width","height"]],waitSync:[["sync","flags","timeout"]]};class Uh{static getNames(e,t){const n=Bh[e];if(!n||0===n.length)return null;for(const e of n)if(e.length===t)return e;let r=null;for(const e of n)e.length>=t&&(null===r||e.lengthi.length&&(i=e);return i}static getName(e,t,n){const r=Uh.getNames(e,n);return r&&t>=0&&t{const e={};for(let t=0;t<64;t++)e["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;return e})();class qh{constructor(e){this.sources=e.sources||[],this.names=e.names||[],this.sourceRoot=e.sourceRoot||"",this.lines=qh.parseMappings(e.mappings||"")}originalPositionFor(e,t){const n={source:null,line:null,column:null,name:null},r=e-1;if(r<0||r>=this.lines.length)return n;const i=this.lines[r];if(!i||0===i.length)return n;const s=this.findSegment(i,t);if(!s)return n;const o=s.sourceIndex>=0&&s.sourceIndex=0&&s.nameIndex>1,o=e[s];o.generatedColumn<=t?(i=o,n=s+1):r=s-1}return i}static parseMappings(e){const t=[];let n=0,r=0,i=0,s=0;const o=e.split(";");for(let e=0;e0){const e=a.split(",");for(let t=0;t=4&&(n+=o[1],r+=o[2],i+=o[3],a.sourceIndex=n,a.originalLine=r,a.originalColumn=i,o.length>=5&&(s+=o[4],a.nameIndex=s)),l.push(a)}}l.sort((e,t)=>e.generatedColumn-t.generatedColumn),t.push(l)}return t}static decodeSegment(e){const t=[];let n=0;for(;n>>=1,t.push(o?-r:r)}return t}}var Qh=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})};class Zh{constructor(e){this.cache=new Map,this.inflight=new Map,this.fetchFn=e||("undefined"!=typeof fetch?fetch.bind(globalThis):void 0)}resolveFrames(e){return Qh(this,void 0,void 0,function*(){return e&&0!==e.length?Promise.all(e.map(e=>this.resolveFrame(e))):e||[]})}resolveFrame(e){return Qh(this,void 0,void 0,function*(){const t=Zh.parseFrame(e);if(!t)return e;let n;try{n=yield this.getConsumer(t.url)}catch(t){return e}if(!n)return e;const r=n.originalPositionFor(t.line,t.column);return r.source&&null!==r.line?Zh.formatFrame(t.functionName,r.name,r.source,r.line,r.column||0):e})}static parseFrame(e){if(!e)return null;let t=e.match(/^(.*?)\s*\((.+):(\d+):(\d+)\)\s*$/);return t?{functionName:t[1].trim(),url:t[2],line:parseInt(t[3],10),column:parseInt(t[4],10)}:(t=e.match(/^\s*(.+):(\d+):(\d+)\s*$/),t?{functionName:"",url:t[1].trim(),line:parseInt(t[2],10),column:parseInt(t[3],10)}:null)}static formatFrame(e,t,n,r,i){const s=t||e,o=n+":"+r+":"+i;return s?s+" ("+o+")":o}getConsumer(e){return Qh(this,void 0,void 0,function*(){if(this.cache.has(e))return this.cache.get(e);const t=this.inflight.get(e);if(t)return t;const n=this.loadConsumer(e).then(t=>(this.cache.set(e,t),this.inflight.delete(e),t)).catch(()=>(this.cache.set(e,null),this.inflight.delete(e),null));return this.inflight.set(e,n),n})}loadConsumer(e){return Qh(this,void 0,void 0,function*(){if(!this.fetchFn)return null;const t=yield this.fetchFn(e);if(!t.ok)return null;const n=yield t.text(),r=Zh.extractSourceMappingURL(n);if(!r)return null;let i;if(0===r.indexOf("data:"))i=Zh.parseDataUri(r);else{const t=Zh.resolveUrl(r,e),n=yield this.fetchFn(t);if(!n.ok)return null;i=yield n.json()}return i&&"string"==typeof i.mappings?new qh(i):null})}static extractSourceMappingURL(e){const t=/\/\/[#@]\s*sourceMappingURL=(\S+)\s*$/gm;let n,r=null;for(;null!==(n=t.exec(e));)r=n[1];return r}static parseDataUri(e){const t=e.indexOf(",");if(-1===t)return null;const n=e.substring(0,t),r=e.substring(t+1);try{const e=/;base64/i.test(n)?Zh.decodeBase64(r):decodeURIComponent(r);return JSON.parse(e)}catch(e){return null}}static decodeBase64(e){if("function"==typeof atob)return atob(e);const t=globalThis.Buffer;if(t)return t.from(e,"base64").toString("utf-8");throw new Error("No base64 decoder available.")}static resolveUrl(e,t){try{return new URL(e,t).href}catch(t){return e}}}function Jh(e){return e&&(e.text||e.name)||""}function ed(e,t){const n=[];if(!e||!t)return n;const r=e.DrawCall,i=t.DrawCall;ad("uniform",r&&r.uniforms,i&&i.uniforms,n),ad("uniformBlock",r&&r.uniformBlocks,i&&i.uniformBlocks,n);const s=sd(e,t);for(const r of s){if(td[r])continue;const i=e[r],s=t[r];(rd(i)||rd(s))&&od(i,s,r,n)}return n}const td={id:!0,name:!0,commandArguments:!0,result:!0,status:!0,marker:!0,text:!0,startTime:!0,commandEndTime:!0,endTime:!0,stackTrace:!0,consumeCommandId:!0,VisualState:!0},nd={__SPECTOR_Object_TAG:!0,__SPECTOR_Object_CustomData:!0,__SPECTOR_Metadata:!0,customData:!0,visual:!0,visualPixels:!0,VisualState:!0,texture:!0,sampler:!0,location:!0,source:!0,translatedSource:!0,analyserName:!0,uniforms:!0,uniformBlocks:!0,length:!0};function rd(e){return null!==e&&"object"==typeof e}function id(e){if(!rd(e))return null;const t=e.__SPECTOR_Object_TAG||("string"==typeof e.typeName&&"id"in e?e:null);return t&&"string"==typeof t.typeName?t.typeName:null}function sd(e,t){const n=[],r={},i=e=>{if(rd(e))for(const t in e)e.hasOwnProperty(t)&&!r[t]&&(r[t]=!0,n.push(t))};return i(e),i(t),n}function od(e,t,n,r,i=0){const s=id(e),o=id(t);if(null!==s||null!==o){const e=null!==s?s:"(absent)",t=null!==o?o:"(absent)";return void(e!==t&&r.push({path:n,previous:e,current:t}))}const a=rd(e),l=rd(t);if(!a&&!l){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}if(a!==l||i>=8){const i=dd(e),s=dd(t);return void(i!==s&&r.push({path:n,previous:i,current:s}))}for(const s of sd(e,t))nd[s]||od(e?e[s]:void 0,t?t[s]:void 0,n+"."+s,r,i+1)}function ad(e,t,n,r){const i=hd(t),s=hd(n),o=[],a={};for(const e in i)i.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const e in s)s.hasOwnProperty(e)&&!a[e]&&(a[e]=!0,o.push(e));for(const t of o){const n=i.hasOwnProperty(t)?i[t]:void 0,o=s.hasOwnProperty(t)?s[t]:void 0,a=n?dd(n.value):"(absent)",l=o?dd(o.value):"(absent)";a!==l&&r.push({path:e+" "+t,previous:a,current:l}),ld(e+" "+t,n,o,r)}}function ld(e,t,n,r){const i=t&&t.texture,s=n&&n.texture;(rd(i)||rd(s))&&cd(e+" texture",i,s,r);const o=t&&t.textures,a=n&&n.textures,l=Array.isArray(o)?o.length:0,u=Array.isArray(a)?a.length:0,c=Math.max(l,u);for(let t=0;t0?o[t]:void 0,u>0?a[t]:void 0,r)}const ud=["width","height","depth","format","internalFormat","textureType"];function cd(e,t,n,r){(rd(t)||rd(n))&&(function(e,t,n,r){for(const i of ud){const s=t?t[i]:void 0,o=n?n[i]:void 0;if(void 0===s&&void 0===o)continue;const a=dd(s),l=dd(o);a!==l&&r.push({path:e+" "+i,previous:a,current:l})}}(e,t,n,r),function(e,t,n,r){if(rd(t)||rd(n))for(const i of sd(t,n)){const s=t?t[i]:void 0,o=n?n[i]:void 0,a="string"==typeof s,l="string"==typeof o;(a||l)&&s!==o&&r.push({path:e+" ("+i+")",previous:a?"(image)":"(absent)",current:l?"(image)":"(absent)",previousImage:a?s:void 0,currentImage:l?o:void 0})}}(e,t&&t.visual,n&&n.visual,r))}function hd(e){const t={};if(Array.isArray(e))for(const n of e)n&&"string"==typeof n.name&&(t[n.name]=n);return t}function dd(e){if(void 0===e)return"(absent)";if(null===e)return"null";try{return JSON.stringify(e)}catch(t){return String(e)}}function fd(e,t){for(let n=0;n{if(this.store.getSnapshot().currentCapture)switch(e){case 0:this._displayCaptures();break;case 40:this._displayCurrentCapture();break;case 10:this._displayInformation();break;case 20:this._displayInitState();break;case 30:this._displayEndState();break;case 60:this._displayCompare()}else this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))},this.handleSearchTextChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{searchText:e})),this._search(e)},this.handleCompareOnlyDifferencesChange=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{compareOnlyDifferences:e}))},this.handleCompareCommandSelected=e=>{null!=e&&(this._currentCommandId=e,this._displayCurrentCapture())},this.handleCommandSelected=e=>{this.selectCommand(e)},this.openTextureViewer=e=>{this.store.setState(t=>Object.assign(Object.assign({},t),{textureViewer:{open:!0,src:e.src,label:e.label,pixelated:e.pixelated,raw:e.raw||null}}))},this.closeTextureViewer=()=>{this.store.setState(e=>Object.assign(Object.assign({},e),{textureViewer:Object.assign(Object.assign({},e.textureViewer),{open:!1})}))},this.handleVisualStateSelected=e=>{this.selectVisualState(e)},this.handleVertexSelected=e=>{this.selectCommand(e),this._openShader(!1)},this.handleFragmentSelected=e=>{this.selectCommand(e),this._openShader(!0)},this.handleShaderSelected=e=>{var t;const n=null===(t=this.store.getSnapshot().commands[e])||void 0===t?void 0:t.capture.shader;n&&(this.selectCommand(e),this._openCapturedShader(n))},this.handleShaderSourceOpen=(e,t)=>{this._openCapturedShader(e,t)},this.handleSourceCodeChanged=e=>{this.onSourceCodeChanged.trigger(e)},this.handleSourceCodeClose=()=>{this._displayCurrentCapture()},this.handleSourceCodeTabChange=(e,t)=>{this.store.setState(n=>n.sourceCodeState?Object.assign(Object.assign({},n),{sourceCodeState:Object.assign(Object.assign({},n.sourceCodeState),{fragment:e,translated:t})}):n)},this.handleBeautifyChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{beautify:e})}):t)},this.handlePreprocessChanged=e=>{this.store.setState(t=>t.sourceCodeState?Object.assign(Object.assign({},t),{sourceCodeState:Object.assign(Object.assign({},t.sourceCodeState),{preprocessed:e})}):t)},this.handleSaveRequested=e=>{this.saveCapture(e)},this.handleCaptureLoaded=e=>{this.addCapture(e)},this.handleClose=()=>{this.hide()},this._rootPlaceHolder=e||document.body,this.onSourceCodeChanged=new l,this.store=new ft(Object.assign({},pd)),this._container=document.createElement("div"),this._container.className="spector-react-result-view",this._rootPlaceHolder.appendChild(this._container),this._root=(0,ht.createRoot)(this._container),this._root.render((0,dt.createElement)(yt.Provider,{value:this},(0,dt.createElement)(Mh))),this._rootPlaceHolder.addEventListener("keydown",e=>{if(40!==this.store.getSnapshot().menuStatus)return;const t=e.keyCode;38===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousCommand()):40===t?(e.preventDefault(),e.stopPropagation(),this._selectNextCommand()):33===t?(e.preventDefault(),e.stopPropagation(),this._selectPreviousVisualState()):34===t&&(e.preventDefault(),e.stopPropagation(),this._selectNextVisualState())})}display(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!0}))}hide(){this.store.setState(e=>Object.assign(Object.assign({},e),{visible:!1}))}addCapture(e){return this.store.setState(t=>{const n=t.captures.map(e=>({capture:e.capture,active:!1}));return Object.assign(Object.assign({},t),{captures:[{capture:e,active:!0},...n],currentCapture:e})}),this._currentCommandId=-1,this._displayCurrentCapture(),0}selectCapture(e){this._currentCommandId=-1,this.store.setState(t=>{var n,r;const i=t.captures.map((t,n)=>({capture:t.capture,active:n===e}));return Object.assign(Object.assign({},t),{captures:i,currentCapture:null!==(r=null===(n=i[e])||void 0===n?void 0:n.capture)&&void 0!==r?r:null})}),this._displayCurrentCapture()}selectCommand(e){const t=this.store.getSnapshot();if(e<0||e>=t.commands.length)return;const n=t.commands[e];this._currentCommandId=n.capture.id;const r=n.visualStateIndex,i=this._buildCommandDetail(e,t.commands,t.visualStates);this.store.setState(t=>Object.assign(Object.assign({},t),{commands:t.commands.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentCommandIndex:e,visualStates:t.visualStates.map((e,t)=>e.active!==(t===r)?Object.assign(Object.assign({},e),{active:t===r}):e),currentVisualStateIndex:r,commandDetailData:i}))}selectVisualState(e){const t=this.store.getSnapshot();if(e<0||e>=t.visualStates.length)return;const n=t.visualStates[e].commandIndex;if(n===Number.MIN_VALUE)return void this._displayInitState();if(n===Number.MAX_VALUE)return void this._displayEndState();n>=0&&(this._currentCommandId=t.commands[n].capture.id);const r=n>=0?this._buildCommandDetail(n,t.commands,t.visualStates):t.commandDetailData;this.store.setState(t=>Object.assign(Object.assign({},t),{visualStates:t.visualStates.map((t,n)=>t.active!==(n===e)?Object.assign(Object.assign({},t),{active:n===e}):t),currentVisualStateIndex:e,commands:n>=0?t.commands.map((e,t)=>e.active!==(t===n)?Object.assign(Object.assign({},e),{active:t===n}):e):t.commands,currentCommandIndex:n>=0?n:t.currentCommandIndex,commandDetailData:r}))}showSourceCodeError(e){this.store.setState(t=>Object.assign(Object.assign({},t),{sourceCodeError:e}))}saveCapture(e){const t=JSON.stringify(e,null,4),n=new Blob([t],{type:"octet/stream"}),r="capture "+new Date(e.startTime).toTimeString().split(" ")[0]+".json",i=document.createElement("a"),s=window.URL.createObjectURL(n);i.setAttribute("href",s),i.setAttribute("download",r),i.click()}_displayCaptures(){this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:0}))}_displayCompare(){const e=this.store.getSnapshot(),t=e.captures.findIndex(e=>e.active),n=t>=0?e.captures[t]:null,r=n?e.captures[t+1]:null;if(!n||!r)return void this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:60,canCompare:!1,compareRows:[],compareSummary:{added:0,removed:0,changed:0,unchanged:0},compareLabel:""}));const i=function(e,t){const n=function(e,t){const n=e.length,r=t.length,i=e.map(Jh),s=t.map(Jh),o=[];for(let e=0;e<=n;e++)o.push(new Array(r+1).fill(0));for(let e=n-1;e>=0;e--)for(let t=r-1;t>=0;t--)o[e][t]=i[e]===s[t]?o[e+1][t+1]+1:Math.max(o[e+1][t],o[e][t+1]);const a=[];let l=[];const u=()=>{for(const e of l)a.push(e);l=[]};let c=0,h=0;for(;c0?a.push({type:"changed",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id,fieldDiffs:n}):a.push({type:"unchanged",name:t[h].name,previousText:e[c].text,currentText:t[h].text,indexA:c,indexB:h,commandId:t[h].id}),c++,h++}else if(o[c+1][h]>=o[c][h+1])l.push({type:"removed",name:e[c].name,previousText:e[c].text,indexA:c}),c++;else{const n=fd(l,t[h].name);n?a.push({type:"changed",name:t[h].name,previousText:n.previousText,currentText:t[h].text,indexA:n.indexA,indexB:h,commandId:t[h].id,fieldDiffs:ed(e[n.indexA],t[h])}):(u(),a.push({type:"added",name:t[h].name,currentText:t[h].text,indexB:h,commandId:t[h].id})),h++}for(;cObject.assign(Object.assign({},e),{menuStatus:60,canCompare:!0,compareRows:i.rows,compareSummary:i.summary,compareLabel:s}))}static _captureLabel(e){try{return new Date(e.startTime).toTimeString().split(" ")[0]}catch(e){return"capture"}}_displayInformation(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];zh(n,"Canvas",t.canvas,e.searchText),zh(n,"Context",t.context,e.searchText);const r=[];for(const n of t.analyses){const t="Primitives"===n.analyserName?"Vertices count":n.analyserName;zh(r,t,n,e.searchText)}zh(r,"Frame Memory Changes",t.frameMemory,e.searchText),zh(r,"Total Memory (seconds since application start: bytes)",t.memory,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:10,commandCount:t.commands.length,informationLeft:n,informationRight:r}))}_displayInitState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.initState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:20,commandCount:t.commands.length,initStateData:n}))}_displayEndState(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=[];jh(n,t.endState,e.searchText),this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:30,commandCount:t.commands.length,endStateData:n}))}_displayCurrentCapture(){const e=this.store.getSnapshot(),t=e.currentCapture;if(!t)return;const n=e.searchText,r=e.captures.map(e=>({capture:e.capture,active:e.capture===t})),i=[];i.push({VisualState:t.initState.VisualState,time:t.startTime,commandIndex:Number.MIN_VALUE,active:!1,previousVisualStateIndex:-1,nextVisualStateIndex:-1});const s=[];let o=0,a=!1,l=-1,u=-1;for(let e=0;e0?c-1:-1,nextCommandIndex:-1,visualStateIndex:o,active:!1};if(c>0&&(s[c-1].nextCommandIndex=c),r.VisualState){const e=i.length,t=i.length-1,n={VisualState:r.VisualState,time:r.endTime,commandIndex:c,active:!1,previousVisualStateIndex:t,nextVisualStateIndex:-1};i[t].nextVisualStateIndex=e,i.push(n),o=e,a=!0}else a||(i[0].commandIndex=c,a=!0);h.visualStateIndex=o,s.push(h),(-1===this._currentCommandId&&0===c||this._currentCommandId===r.id)&&(l=c,u=o)}l>=0&&(s[l].active=!0,this._currentCommandId=s[l].capture.id),u>=0&&(i[u].active=!0);let c=[];l>=0&&(c=this._buildCommandDetail(l,s,i)),this.store.setState(e=>Object.assign(Object.assign({},e),{captures:r,menuStatus:40,commandCount:t.commands.length,commands:s,currentCommandIndex:l,visualStates:i,currentVisualStateIndex:u,sourceCodeState:null,sourceCodeError:"",commandDetailData:c}))}_openShader(e){const t=this.store.getSnapshot();if(t.currentCommandIndex<0||t.currentCommandIndex>=t.commands.length)return;const n=t.commands[t.currentCommandIndex].capture.DrawCall;if(!n||!n.shaders||n.shaders.length<2)return;const r={programId:n.programStatus.program.__SPECTOR_Object_TAG.id,nameVertex:n.shaders[0].name,nameFragment:n.shaders[1].name,sourceVertex:n.shaders[0].source,sourceFragment:n.shaders[1].source,translatedSourceVertex:n.shaders[0].translatedSource,translatedSourceFragment:n.shaders[1].translatedSource,fragment:e,translated:!1,editable:n.programStatus.RECOMPILABLE,beautify:!0,preprocessed:!1,singleShader:!1,sourceVertexLog:n.shaders[0].infoLog||"",sourceFragmentLog:n.shaders[1].infoLog||"",programLog:n.programStatus.infoLog||""},i=this._buildCommandDetail(t.currentCommandIndex,t.commands,t.visualStates);this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:"",commandDetailData:i}))}_openCapturedShader(e,t=""){if(!e||"string"!=typeof e.source)return;const n="FRAGMENT_SHADER"===e.shaderType,r={programId:-1,nameVertex:n?"":e.name,nameFragment:n?e.name:"",sourceVertex:n?"":e.source,sourceFragment:n?e.source:"",translatedSourceVertex:n?"":e.translatedSource||"",translatedSourceFragment:n&&e.translatedSource||"",fragment:n,translated:!1,editable:!1,beautify:!0,preprocessed:!1,singleShader:!0,sourceVertexLog:n?"":e.infoLog||"",sourceFragmentLog:n&&e.infoLog||"",programLog:t};this.store.setState(e=>Object.assign(Object.assign({},e),{menuStatus:50,sourceCodeState:r,sourceCodeError:""}))}_buildCommandDetail(e,t,n){if(e<0||e>=t.length)return[];const r=t[e],i=n[r.visualStateIndex],s=this._resolvedStackTraces.get(r.capture.id),o=function(e,t,n){const r=[];t&&r.push({type:"visualState",visualState:t});let i="Unknown";switch(e.status){case 50:i="Deprecated";break;case 10:i="Unused";break;case 20:i="Disabled";break;case 30:i="Redundant";break;case 40:i="Valid"}const s=Ph.getMDNLink(e.name);e.result?zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,result:e.result,status:i},""):"LOG"!==e.name&&zh(r,"Global",{name:{help:s,name:e.name},duration:e.commandEndTime-e.startTime,status:i},"");for(const t in e)"VisualState"!==t&&"result"!==t&&("commandArguments"===t&&Array.isArray(e.commandArguments)?Kh(r,e.name,e.commandArguments):Xh(r,t,e)||("stackTrace"===t&&Array.isArray(e.stackTrace)?zh(r,"stackTrace",n||e.stackTrace,""):"object"==typeof e[t]&&zh(r,t,e[t],"")));return r}(r.capture,null==i?void 0:i.VisualState,s);return s||this._resolveStackTraceAsync(r.capture),o}_resolveStackTraceAsync(e){const t=e.id;this._resolvedStackTraces.has(t)||this._resolvingStackTraces.has(t)||e.stackTrace&&0!==e.stackTrace.length&&(this._resolvingStackTraces.add(t),this._sourceMapResolver.resolveFrames(e.stackTrace).then(n=>{this._resolvingStackTraces.delete(t),this._resolvedStackTraces.set(t,n);let r=!1;for(let t=0;tObject.assign(Object.assign({},t),{commandDetailData:e}))}}).catch(()=>{this._resolvingStackTraces.delete(t)}))}_selectPreviousCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.previousCommandIndex<0||this.selectCommand(t.previousCommandIndex)}_selectNextCommand(){const e=this.store.getSnapshot();if(e.currentCommandIndex<0)return;const t=e.commands[e.currentCommandIndex];t.nextCommandIndex<0||this.selectCommand(t.nextCommandIndex)}_selectPreviousVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.previousVisualStateIndex<0||this.selectVisualState(t.previousVisualStateIndex)}_selectNextVisualState(){const e=this.store.getSnapshot();if(e.currentVisualStateIndex<0)return;const t=e.visualStates[e.currentVisualStateIndex];t.nextVisualStateIndex<0||this.selectVisualState(t.nextVisualStateIndex)}_search(e){switch(this.store.getSnapshot().menuStatus){case 0:case 40:this._displayCurrentCapture();break;case 30:this._displayEndState();break;case 10:this._displayInformation();break;case 20:this._displayInitState()}this.store.setState(e=>Object.assign(Object.assign({},e),{searchText:""}))}}class gd{constructor(e,t={}){this.worker=e,this.captureTimeout=t.captureTimeout||1e4,this.disposed=!1,this.captureTimer=null,this.onCapture=new l,this.onCaptureStarted=new l,this.onError=new l,this.onFps=new l,this.onContextReady=new l,this.messageHandler=this.handleMessage.bind(this),this.worker.addEventListener("message",this.messageHandler)}triggerCapture(e=0,t=0,n=!1,r=!1){if(this.disposed)return;this.clearCaptureTimer();const i={type:"spector:trigger-capture",version:1,canvasIndex:e,commandCount:t,quickCapture:n,fullCapture:r};this.worker.postMessage(i),this.captureTimer=setTimeout(()=>{this.onError.trigger("Capture timed out after "+this.captureTimeout+"ms"),this.captureTimer=null},this.captureTimeout)}dispose(){this.disposed||(this.disposed=!0,this.clearCaptureTimer(),this.worker.removeEventListener("message",this.messageHandler),this.onCapture.clear(),this.onCaptureStarted.clear(),this.onError.clear(),this.onFps.clear(),this.onContextReady.clear())}handleMessage(e){const t=e.data;if(!function(e){return null!=e&&"object"==typeof e&&"string"==typeof e.type&&0===e.type.indexOf("spector:")}(t))return;const n=t;switch(n.type){case"spector:context-ready":this.onContextReady.trigger({canvasCount:n.canvasCount,canvasWidth:n.canvasWidth,canvasHeight:n.canvasHeight});break;case"spector:capture-started":this.onCaptureStarted.trigger(void 0);break;case"spector:capture-complete":this.clearCaptureTimer(),this.onCapture.trigger(n.capture);break;case"spector:error":this.clearCaptureTimer(),this.onError.trigger(n.error);break;case"spector:fps":this.onFps.trigger(n.fps)}}clearCaptureTimer(){null!=this.captureTimer&&(clearTimeout(this.captureTimer),this.captureTimer=null)}}var Ed=n(72),vd=n.n(Ed),Cd=n(825),Dd=n.n(Cd),Sd=n(659),Ad=n.n(Sd),_d=n(56),yd=n.n(_d),bd=n(540),Td=n.n(bd),Rd=n(113),xd=n.n(Rd),wd=n(377),Fd={};Fd.styleTagTransform=xd(),Fd.setAttributes=yd(),Fd.insert=Ad().bind(null,"html"),Fd.domAPI=Dd(),Fd.insertStyleElement=Td(),vd()(wd.A,Fd),wd.A&&wd.A.locals&&wd.A.locals;var Nd=n(160),Ld={};Ld.styleTagTransform=xd(),Ld.setAttributes=yd(),Ld.insert=Ad().bind(null,"html"),Ld.domAPI=Dd(),Ld.insertStyleElement=Td(),vd()(Nd.A,Ld),Nd.A&&Nd.A.locals&&Nd.A.locals;class Od{constructor(e){this.timeSpy=e,this.init()}spyXRSession(e){this.currentXRSession&&this.unspyXRSession();for(const e of at.getRequestAnimationFrameFunctionNames())y.resetOriginFunction(this.timeSpy.getSpiedScope(),e);this.timeSpy.spyRequestAnimationFrame("requestAnimationFrame",e),this.currentXRSession=e}unspyXRSession(){if(this.currentXRSession){y.resetOriginFunction(this.currentXRSession,"requestAnimationFrame"),this.currentXRSession=void 0;for(const e of at.getRequestAnimationFrameFunctionNames())this.timeSpy.spyRequestAnimationFrame(e,this.timeSpy.getSpiedScope())}}init(){if(!navigator.xr)return;class e extends XRWebGLLayer{constructor(e,t,n){super(e,t,n),this.glContext=t}getContext(){return this.glContext}}class t extends XRWebGLBinding{constructor(e,t){super(e,t),this.glContext=t}createProjectionLayer(e){const t=super.createProjectionLayer(e);return t.glContext=this.glContext,t}}window.XRWebGLLayer=e,window.XRWebGLBinding=t;const n=navigator.xr.requestSession;Object.defineProperty(navigator.xr,"requestSessionInternal",{writable:!0}),navigator.xr.requestSessionInternal=n,Object.defineProperty(navigator.xr,"requestSession",{writable:!0}),navigator.xr.requestSession=(e,t)=>((e,t)=>navigator.xr.requestSessionInternal(e,t).then(e=>{const t=e;return t._updateRenderState=e.updateRenderState,t.updateRenderState=e=>function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){if(e.baseLayer){const n=e.baseLayer;t.glContext=n.getContext()}if(e.layers)for(const n of e.layers){const e=n;e.glContext&&(t.glContext=e.glContext)}return t._updateRenderState(e)}),this.spyXRSession(t),e.addEventListener("end",()=>{this.unspyXRSession()}),Promise.resolve(e)}))(e,t)}}const Id={CaptureMenu:_t,ResultView:md};class kd{static getFirstAvailable3dContext(e){return this.tryGetContextFromHelperField(e)||this.tryGetContextFromCanvas(e,"webgl")||this.tryGetContextFromCanvas(e,"experimental-webgl")||this.tryGetContextFromCanvas(e,"webgl2")||this.tryGetContextFromCanvas(e,"experimental-webgl2")}static tryGetContextFromHelperField(e){const t=e instanceof HTMLCanvasElement?e.getAttribute("__spector_context_type"):e.__spector_context_type;if(t)return this.tryGetContextFromCanvas(e,t)}static tryGetContextFromCanvas(e,t){let n;try{n=e.getContext(t)}catch(e){}return n}constructor(e={}){this.noFrameTimeout=-1,this.options=Object.assign({enableXRCapture:!1},e),this.captureNextFrames=0,this.captureNextCommands=0,this.quickCapture=!1,this.fullCapture=!1,this.retry=0,this.contexts=[],this.workerBridges=new Map,this.timeSpy=new at,this.onCaptureStarted=new l,this.onCapture=new l,this.onError=new l,this.timeSpy.onFrameStart.add(this.onFrameStart,this),this.timeSpy.onFrameEnd.add(this.onFrameEnd,this),this.timeSpy.onError.add(this.onErrorInternal,this),ct.install(),this.options.enableXRCapture&&(this.xrSpy=new Od(this.timeSpy))}displayUI(e=!1){this.captureMenu||(this.getCaptureUI(),this.captureMenu.onPauseRequested.add(this.pause,this),this.captureMenu.onPlayRequested.add(this.play,this),this.captureMenu.onPlayNextFrameRequested.add(this.playNextFrame,this),this.captureMenu.onCaptureRequested.add(e=>{e&&(e.ref instanceof Worker?this.captureWorker(e.ref):this.captureCanvas(e.ref))},this),setInterval(()=>{this.captureMenu.setFPS(this.getFps())},1e3),e||this.captureMenu.trackPageCanvases(),this.captureMenu.display()),this.resultView||(this.getResultUI(),this.onCapture.add(e=>{this.resultView.display(),this.resultView.addCapture(e)}))}getResultUI(){return this.resultView||(this.resultView=new md,this.resultView.onSourceCodeChanged.add(e=>{this.rebuildProgramFromProgramId(e.programId,e.sourceVertex,e.sourceFragment,t=>{this.referenceNewProgram(e.programId,t),this.resultView.showSourceCodeError(null)},e=>{this.resultView.showSourceCodeError(e)})})),this.resultView}getCaptureUI(){return this.captureMenu||(this.captureMenu=new _t),this.captureMenu}rebuildProgramFromProgramId(e,t,n,r,i){const s=Pe.getFromGlobalStore(e);this.rebuildProgram(s,t,n,r,i)}rebuildProgram(e,t,n,r,i){o.rebuildProgram(e,t,n,r,i)}referenceNewProgram(e,t){Pe.updateInGlobalStore(e,t)}pause(){this.timeSpy.changeSpeedRatio(0)}play(){this.timeSpy.changeSpeedRatio(1)}playNextFrame(){this.timeSpy.playNextFrame()}drawOnlyEveryXFrame(e){this.timeSpy.changeSpeedRatio(e)}getFps(){return this.timeSpy.getFps()}spyCanvases(){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt,this.canvasSpy.onContextRequested.add(this.spyContext,this))}spyCanvas(e){this.canvasSpy?this.onErrorInternal("Already spying canvas."):(this.canvasSpy=new lt(e),this.canvasSpy.onContextRequested.add(this.spyContext,this))}getAvailableContexts(){return this.contexts}setShaderCompileDelay(e){ct.install(),ct.setDelay(e)}clearShaderCompileDelay(){ct.setDelay(0)}getShaderCompileDelay(){return ct.getDelay()}captureCanvas(e,t=0,n=!1,r=!1){const i=this.getAvailableContextSpyByCanvas(e);if(i)this.captureContextSpy(i,t,n,r);else{const i=kd.getFirstAvailable3dContext(e);i?this.captureContext(i,t,n,r):a.error("No webgl context available on the chosen canvas.")}}captureContext(e,t=0,n=!1,r=!1){let i=this.getAvailableContextSpyByCanvas(e.canvas);i||(i=e.getIndexedParameter?new ot({context:e,version:2,recordAlways:!1}):new ot({context:e,version:1,recordAlways:!1}),i.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:i.context.canvas,contextSpy:i})),i&&this.captureContextSpy(i,t,n,r)}captureXRContext(e=0,t=!1,n=!1){this.captureContext(this.getXRContext(),e,t,n)}captureContextSpy(e,t=0,n=!1,r=!1){this.quickCapture=n,this.fullCapture=r,this.capturingContext?this.onErrorInternal("Already capturing a context."):(this.retry=0,this.capturingContext=e,this.capturingContext.setMarker(this.marker),(t=Math.min(t,1e4))>0?this.captureCommands(t):this.captureFrames(1),this.noFrameTimeout=setTimeout(()=>{t>0?this.stopCapture():this.capturingContext&&this.retry>1?this.onErrorInternal("No frames with gl commands detected. Try moving the camera."):this.onErrorInternal("No frames detected. Try moving the camera or implementing requestAnimationFrame.")},1e4))}captureNextFrame(e,t=!1,n=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,0,t,n):this.captureContext(e,0,t,n)}startCapture(e,t,n=!1,r=!1){e instanceof HTMLCanvasElement||self.OffscreenCanvas&&e instanceof OffscreenCanvas?this.captureCanvas(e,t,n,r):this.captureContext(e,t,n,r)}stopCapture(){if(this.capturingContext){const e=this.capturingContext.stopCapture();if(e.commands.length>0)return this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),this.triggerCapture(e),this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,e;0===this.captureNextCommands&&(this.retry++,this.captureFrames(1))}}setMarker(e){this.marker=e,this.capturingContext&&this.capturingContext.setMarker(e)}clearMarker(){this.marker=null,this.capturingContext&&this.capturingContext.clearMarker()}addRequestAnimationFrameFunctionName(e){this.timeSpy.addRequestAnimationFrameFunctionName(e)}setSpiedScope(e){this.timeSpy.setSpiedScope(e)}log(e){this.capturingContext&&this.capturingContext.log(e)}spyWorkers(e="spector.worker.bundle.js"){ut.startIntercepting(e)}stopSpyingWorkers(){ut.stopIntercepting()}spyWorker(e){let t=this.workerBridges.get(e);return t||(t=new gd(e),t.onCapture.add(e=>{this.triggerCapture(e)},this),t.onError.add(e=>{this.onErrorInternal(e)},this),t.onContextReady.add(t=>{if(this.captureMenu){const n=this.workerBridges.size;this.captureMenu.addCanvasInformation({id:"Worker "+n,width:t.canvasWidth,height:t.canvasHeight,ref:e})}},this),t.onFps.add(e=>{this.captureMenu&&this.captureMenu.setFPS(e)},this),this.workerBridges.set(e,t),t)}captureWorker(e,t=0,n=!1,r=!1){this.spyWorker(e).triggerCapture(0,t,n,r)}captureFrames(e){this.captureNextFrames=e,this.captureNextCommands=0,this.playNextFrame()}captureCommands(e){this.captureNextFrames=0,this.captureNextCommands=e,this.play(),this.capturingContext?(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(e,this.quickCapture,this.fullCapture)):(this.onErrorInternal("No context to capture from."),this.captureNextCommands=0)}spyContext(e){let t=this.getAvailableContextSpyByCanvas(e.context.canvas);t||(t=new ot({context:e.context,version:e.contextVersion,recordAlways:!0}),t.onMaxCommand.add(this.stopCapture,this),this.contexts.push({canvas:t.context.canvas,contextSpy:t})),t.spy()}getAvailableContextSpyByCanvas(e){for(const t of this.contexts)if(t.canvas===e)return t.contextSpy}getXRContext(){return this.options.enableXRCapture||a.error("Cannot retrieve WebXR context if capturing WebXR is disabled."),this.xrSpy.currentXRSession||a.error("No currently active WebXR session."),this.xrSpy.currentXRSession.glContext}onFrameStart(){this.captureNextCommands>0||(this.captureNextFrames>0?(this.capturingContext&&(this.onCaptureStarted.trigger(void 0),this.capturingContext.startCapture(0,this.quickCapture,this.fullCapture)),this.captureNextFrames--):this.capturingContext=void 0)}onFrameEnd(){this.captureNextCommands>0||0===this.captureNextFrames&&this.stopCapture()}triggerCapture(e){this.captureMenu&&this.captureMenu.captureComplete(null),this.onCapture.trigger(e)}onErrorInternal(e){if(a.error(e),this.noFrameTimeout>-1&&clearTimeout(this.noFrameTimeout),!this.capturingContext)throw e;this.capturingContext=void 0,this.captureNextFrames=0,this.captureNextCommands=0,this.retry=0,this.captureMenu&&this.captureMenu.captureComplete(e),this.onError.trigger(e)}}},180(e,t,n){e=n.nmd(e),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/lang"),s=e("../lib/event"),o='.ace_search {background-color: #ddd;color: #666;border: 1px solid #cbcbcb;border-top: 0 none;overflow: hidden;margin: 0;padding: 4px 6px 0 4px;position: absolute;top: 0;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {margin: 0 20px 4px 0;overflow: hidden;line-height: 1.9;}.ace_replace_form {margin-right: 0;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {border-radius: 3px 0 0 3px;background-color: white;color: black;border: 1px solid #cbcbcb;border-right: 0 none;outline: 0;padding: 0;font-size: inherit;margin: 0;line-height: inherit;padding: 0 6px;min-width: 17em;vertical-align: top;min-height: 1.8em;box-sizing: content-box;}.ace_searchbtn {border: 1px solid #cbcbcb;line-height: inherit;display: inline-block;padding: 0 6px;background: #fff;border-right: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;margin: 0;position: relative;color: #666;}.ace_searchbtn:last-child {border-radius: 0 3px 3px 0;border-right: 1px solid #cbcbcb;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn:hover {background-color: #eef1f6;}.ace_searchbtn.prev, .ace_searchbtn.next {padding: 0px 0.7em}.ace_searchbtn.prev:after, .ace_searchbtn.next:after {content: "";border: solid 2px #888;width: 0.5em;height: 0.5em;border-width: 2px 0 0 2px;display:inline-block;transform: rotate(-45deg);}.ace_searchbtn.next:after {border-width: 0 2px 2px 0 ;}.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;font: 16px/16px Arial;padding: 0;height: 14px;width: 14px;top: 9px;right: 7px;position: absolute;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;box-sizing: border-box!important;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;clear: both;}.ace_search_counter {float: left;font-family: arial;padding: 0 8px;}',a=e("../keyboard/hash_handler").HashHandler,l=e("../lib/keys");r.importCssString(o,"ace_searchbox");var u=function(e,t,n){var i=r.createElement("div");r.buildDom(["div",{class:"ace_search right"},["span",{action:"hide",class:"ace_searchbtn_close"}],["div",{class:"ace_search_form"},["input",{class:"ace_search_field",placeholder:"Search for",spellcheck:"false"}],["span",{action:"findPrev",class:"ace_searchbtn prev"},"​"],["span",{action:"findNext",class:"ace_searchbtn next"},"​"],["span",{action:"findAll",class:"ace_searchbtn",title:"Alt-Enter"},"All"]],["div",{class:"ace_replace_form"},["input",{class:"ace_search_field",placeholder:"Replace with",spellcheck:"false"}],["span",{action:"replaceAndFindNext",class:"ace_searchbtn"},"Replace"],["span",{action:"replaceAll",class:"ace_searchbtn"},"All"]],["div",{class:"ace_search_options"},["span",{action:"toggleReplace",class:"ace_button",title:"Toggle Replace mode",style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{class:"ace_search_counter"}],["span",{action:"toggleRegexpMode",class:"ace_button",title:"RegExp Search"},".*"],["span",{action:"toggleCaseSensitive",class:"ace_button",title:"CaseSensitive Search"},"Aa"],["span",{action:"toggleWholeWords",class:"ace_button",title:"Whole Word Search"},"\\b"],["span",{action:"searchInSelection",class:"ace_button",title:"Search In Selection"},"S"]]],i),this.element=i.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),r.importCssString(o,"ace_searchbox",e.container)};(function(){this.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},this.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;s.addListener(e,"mousedown",function(e){setTimeout(function(){t.activeInput.focus()},0),s.stopPropagation(e)}),s.addListener(e,"click",function(e){var n=(e.target||e.srcElement).getAttribute("action");n&&t[n]?t[n]():t.$searchBarKb.commands[n]&&t.$searchBarKb.commands[n].exec(t),s.stopPropagation(e)}),s.addCommandKeyListener(e,function(e,n,r){var i=l.keyCodeToString(r),o=t.$searchBarKb.findKeyCommand(n,i);o&&o.exec&&(o.exec(t),s.stopEvent(e))}),this.$onChange=i.delayedCall(function(){t.find(!1,!1)}),s.addListener(this.searchInput,"input",function(){t.$onChange.schedule(20)}),s.addListener(this.searchInput,"focus",function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()}),s.addListener(this.replaceInput,"focus",function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()})},this.$closeSearchBarKb=new a([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new a,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.editor.getReadOnly()||(e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus())},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),this.setSearchRange=function(e){this.searchRange=e,e?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(e){r.setCssClass(this.replaceOption,"checked",this.searchRange),r.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var t=this.editor.getReadOnly();this.replaceOption.style.display=t?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!t?"":"none",this.find(!1,!1,e)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,n){var i=!this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n,range:this.searchRange})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",i),this.editor._emit("findSearchBox",{match:!i}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,n=0,r=0;if(t){var i=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),s=e.session.doc.positionToIndex(e.selection.anchor);this.searchRange&&(s-=e.session.doc.positionToIndex(this.searchRange.start));for(var o,a=t.lastIndex=0;(o=t.exec(i))&&(n++,(a=o.index)<=s&&r++,!(n>999))&&(o[0]||(t.lastIndex=a+=1,!(a>=i.length))););}this.searchCounter.textContent=r+" of "+(n>999?"999+":n)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(u.prototype),t.SearchBox=u,t.Search=function(e,t){(e.searchBox||new u(e)).show(e.session.getTextRange(),t)}}),ace.require(["ace/ext/searchbox"],function(t){e&&(e.exports=t)})},49(e,t,n){e=n.nmd(e),ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=t.cFunctions="\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b",a=function(){var e=this.$keywords=this.createKeywordMapper({"keyword.control":"break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while|catch|operator|try|throw|using","storage.type":"asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|class|wchar_t|template|char16_t|char32_t","storage.modifier":"const|extern|register|restrict|static|volatile|inline|private|protected|public|friend|explicit|virtual|export|mutable|typename|constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local","keyword.operator":"and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace","variable.language":"this","constant.language":"NULL|true|false|TRUE|FALSE|nullptr"},"identifier"),t=/\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source,n="%"+/(\d+\$)?/.source+/[#0\- +']*/.source+/[,;:_]?/.source+/((-?\d+)|\*(-?\d+\$)?)?/.source+/(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source+/(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source+/(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source;this.$rules={start:[{token:"comment",regex:"//$",next:"start"},{token:"comment",regex:"//",next:"singleLineComment"},i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string",regex:"'(?:"+t+"|.)?'"},{token:"string.start",regex:'"',stateName:"qqstring",next:[{token:"string",regex:/\\\s*$/,next:"qqstring"},{token:"constant.language.escape",regex:t},{token:"constant.language.escape",regex:n},{token:"string.end",regex:'"|$',next:"start"},{defaultToken:"string"}]},{token:"string.start",regex:'R"\\(',stateName:"rawString",next:[{token:"string.end",regex:'\\)"',next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"keyword",regex:"#\\s*(?:include|import|pragma|line|define|undef|version)\\b",next:"directive"},{token:"keyword",regex:"#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b"},{token:"support.function.C99.c",regex:o},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*"},{token:"keyword.operator",regex:/--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],singleLineComment:[{token:"comment",regex:/\\$/,next:"singleLineComment"},{token:"comment",regex:/$/,next:"start"},{defaultToken:"comment"}],directive:[{token:"constant.other.multiline",regex:/\\/},{token:"constant.other.multiline",regex:/.*\\/},{token:"constant.other",regex:"\\s*<.+?>",next:"start"},{token:"constant.other",regex:'\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',next:"start"},{token:"constant.other",regex:"\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",next:"start"},{token:"constant.other",regex:/[^\\\/]+/,next:"start"}]},this.embedRules(i,"doc-",[i.getEndRule("start")]),this.normalizeRules()};r.inherits(a,s),t.c_cppHighlightRules=a}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var i=n[1].length,s=e.findMatchingBracket({row:t,column:i});if(!s||s.row==t)return 0;var o=this.$getIndent(e.getLine(s.row));e.replace(new r(t,0,t,i-1),o)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i,s=e.getLine(n);if(this.startRegionRe.test(s))return this.getCommentRegionBlock(e,s,n);if(i=s.match(this.foldingStartMarker)){var o=i.index;if(i[1])return this.openingBracketBlock(e,i[1],n,o);var a=e.getCommentFoldRange(n,o+i[0].length,1);return a&&!a.isMultiLine()&&(r?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(i=s.match(this.foldingStopMarker))?(o=i.index+i[0].length,i[1]?this.closingBracketBlock(e,i[1],n,o):e.getCommentFoldRange(n,o,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length,a=t+=1,l=e.getLength();++tu)break;var c=this.getFoldWidgetRange(e,"all",t);if(c){if(c.start.row<=s)break;if(c.isMultiLine())t=c.end.row;else if(r==u)break}a=t}}return new i(s,o,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\s*$/),s=e.getLength(),o=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++no)return new i(o,r,n,t.length)}}.call(o.prototype)}),ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./c_cpp_highlight_rules").c_cppHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&"comment"==s[s.length-1].type)return r;if("start"==e)(a=t.match(/^.*[\{\(\[]\s*$/))&&(r+=n);else if("doc-start"==e){if("start"==o)return"";var a;(a=t.match(/^\s*(\/?)\*/))&&(a[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/c_cpp"}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/glsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/c_cpp_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp_highlight_rules").c_cppHighlightRules,s=function(){var e=this.createKeywordMapper({"variable.language":"this",keyword:"layout|attribute|const|uniform|varying|break|continue|do|for|while|if|else|in|out|inout|float|int|void|bool|true|false|lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|samplerCube|struct","constant.language":"radians|degrees|sin|cos|tan|asin|acos|atan|pow|exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|normalize|faceforward|reflect|refract|matrixCompMult|lessThan|lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|texture2DProjLod|textureCube|textureCubeLod|gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|gl_DepthRangeParameters|gl_DepthRange|gl_Position|gl_PointSize|gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData"},"identifier");this.$rules=(new i).$rules,this.$rules.start.forEach(function(t){"function"==typeof t.token&&(t.token=e)})};r.inherits(s,i),t.glslHighlightRules=s}),ace.define("ace/mode/glsl",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/glsl_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./c_cpp").Mode,s=e("./glsl_highlight_rules").glslHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=(e("../range").Range,e("./behaviour/cstyle").CstyleBehaviour),l=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};r.inherits(u,i),function(){this.$id="ace/mode/glsl"}.call(u.prototype),t.Mode=u}),ace.require(["ace/mode/glsl"],function(t){e&&(e.exports=t)})},429(e,t,n){e=n.nmd(e),ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.require(["ace/theme/monokai"],function(t){e&&(e.exports=t)})}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r](s,s.exports,n),s.loaded=!0,s.exports}return n.amdD=function(){throw new Error("define cannot be used indirect")},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.nc=void 0,n(832),n(49),n(429),n(902),n(180),n(878)})()); \ No newline at end of file diff --git a/mcp/package-lock.json b/mcp/package-lock.json index 6b1c605..b22e203 100644 --- a/mcp/package-lock.json +++ b/mcp/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@spectorjs/mcp-server", + "name": "@spectorjs/mcp", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@spectorjs/mcp-server", + "name": "@spectorjs/mcp", "version": "1.0.0", "dependencies": { "@modelcontextprotocol/sdk": "^1.30.0", diff --git a/readme.md b/readme.md index f649949..cdda788 100644 --- a/readme.md +++ b/readme.md @@ -266,7 +266,9 @@ spector.spyWorkers('spector.worker.bundle.js'); // spector.stopSpyingWorkers(); ``` -> **⚠️ Experimental — can alter Worker behavior:** Blob wrapping changes the Worker's `self.location` and can affect credentials or CSP/CORS-dependent code. For same-origin module Worker entry points, the extension initializes Spector in a loader and imports the application module from its original URL, preserving relative imports and `import.meta.url`; startup messages are queued until the module is ready. Module sources with direct nested Worker construction are bypassed because their URL resolution may still depend on `self.location`. Conservative source checks cannot inspect every dependency or establish safety and are **not a compatibility guarantee**. Constructor interception itself can change JavaScript semantics. Leave auto-injection off for native behavior; prefer the [manual API](#worker-offscreencanvas-manual-api--recommended) when you control the Worker source. For module Workers, load the worker bundle using `import` instead of `importScripts`. +> **⚠️ Experimental — can alter Worker behavior:** Both auto-injection paths only consider primitive string URLs for same-origin HTTP(S) classic Workers without options. Module Workers, URL objects, custom options, subclasses, redirects, blob/data/cross-origin URLs, strict scripts, and recognizable URL-sensitive code use native construction. Dynamic imports, `importScripts`, nested Workers, `location`, `Request`, `fetch`, XHR, WebSocket/EventSource, and isolation-sensitive APIs are bypassed rather than rewritten. There is no `postMessage` override or startup message queue. Conservative source checks are **not a compatibility guarantee**: computed names can evade them, source and bundle preflights add synchronous requests, and blob wrapping still changes the worker global and script error locations. Known preflight failures fall back before creating a blob, but asynchronous CSP/startup failures cannot transparently fall back after construction. Leave auto-injection off for native behavior; prefer the [manual API](#worker-offscreencanvas-manual-api--recommended) when you control the Worker source. For module Workers, explicitly load the worker bundle using `import` instead of `importScripts`. + +Application scripts served with CSP (including report-only policies) stay native. Bundle import failures are caught so the application can still start, but preflight cannot guarantee injection, undo partially executed instrumentation, or recover a blob Worker blocked by CSP. Stopping `spyWorkers()` deactivates retained interceptor references without overwriting a newer third-party Worker wrapper. ### API Reference diff --git a/sample/js/workerAutoInject/safeClassic.js b/sample/js/workerAutoInject/safeClassic.js index 98402c6..0616958 100644 --- a/sample/js/workerAutoInject/safeClassic.js +++ b/sample/js/workerAutoInject/safeClassic.js @@ -4,6 +4,5 @@ self.onmessage = function () { self.postMessage({ value: gl ? "safe-classic-ok" : "webgl-unavailable", - workerLocation: self.location.href, }); }; diff --git a/sample/js/workerAutoInjectHarness.js b/sample/js/workerAutoInjectHarness.js index 74925db..087a6ce 100644 --- a/sample/js/workerAutoInjectHarness.js +++ b/sample/js/workerAutoInjectHarness.js @@ -7,7 +7,7 @@ var modeHint = document.getElementById("mode-hint"); constructorElement.textContent = constructorName; - modeHint.textContent = constructorName === "Worker" + modeHint.textContent = !window.__SPECTOR_Workers ? "Native Worker constructor detected. Auto-injection appears to be off." : "A Worker proxy is active. Auto-injection appears to be on."; diff --git a/sample/workerAutoInject.html b/sample/workerAutoInject.html index 505df08..ab94e32 100644 --- a/sample/workerAutoInject.html +++ b/sample/workerAutoInject.html @@ -141,7 +141,7 @@

Worker auto-injection compatibility

Setup

    -
  1. Open chrome://extensions and load E:\Babylon\Spector.js\extensions unpacked.
  2. +
  3. Open chrome://extensions and load this repository's extensions directory unpacked.
  4. Enable Spector.js on this page from the extension popup.
  5. Use Auto-inject Workers (experimental) in the popup. Changing it reloads this tab.
  6. Run all tests with the option off, then enable it and run them again.
  7. @@ -151,7 +151,7 @@

    Setup

    Current Worker constructor: checking... -

    The native constructor should be named Worker when auto-injection is off.

    +

    Checking whether extension Worker interception is active.

    diff --git a/src/backend/spies/workerSpy.ts b/src/backend/spies/workerSpy.ts index b02beb5..e620601 100644 --- a/src/backend/spies/workerSpy.ts +++ b/src/backend/spies/workerSpy.ts @@ -4,226 +4,134 @@ interface ISpiedWorker { } /** - * Intercepts Worker constructor on the main thread to inject Spector. - * - * This is a best-effort mechanism. It will fail in cases of: - * - CORS restrictions on Worker scripts - * - CSP policies blocking blob: URLs - * - Module Workers (type: 'module') - * - * The primary API is manual: spector.spyWorker(worker). - * Auto-injection is an explicit opt-in for simple cases, not a transparent - * replacement: blob wrapping and constructor interception can change behavior. + * Explicit, experimental Worker auto-injection for simple classic scripts. + * Module Workers, URL objects, options and URL-sensitive sources stay native. + * Blob wrapping still changes the worker global and may fail under CSP. + * Prefer manual instrumentation with spector.spyWorker(worker). */ export class WorkerSpy { private static readonly spiedWorkers: ISpiedWorker[] = []; private static originalWorkerConstructor: typeof Worker; - private static workerBundleUrl: string; + private static workerProxy: typeof Worker; private static intercepting: boolean = false; /** - * Start intercepting Worker construction. + * Start intercepting simple classic Worker construction. * @param workerBundleUrl URL to the spector.worker.bundle.js file */ public static startIntercepting(workerBundleUrl: string): void { - if (WorkerSpy.intercepting) { + if (WorkerSpy.intercepting || typeof Worker === "undefined") { return; } - if (typeof Worker === "undefined") { - return; - } - - WorkerSpy.workerBundleUrl = workerBundleUrl; - WorkerSpy.originalWorkerConstructor = Worker; - WorkerSpy.intercepting = true; - - const OriginalWorker = Worker; - // Replace the global Worker constructor - (globalThis as any).Worker = function SpectorWorkerProxy(scriptURL: string | URL, options?: WorkerOptions): Worker { - // Don't intercept module workers — importScripts doesn't work there - if (options && options.type === "module") { - return new OriginalWorker(scriptURL, options); - } - - const urlStr = scriptURL.toString(); + const originalWorkerConstructor = Worker; + const workerProxy = new Proxy(originalWorkerConstructor, { + construct(target, args, newTarget) { + // Other libraries may retain this proxy after stop/restart. + if (WorkerSpy.workerProxy !== workerProxy) { + return Reflect.construct(target, args, newTarget); + } + const scriptURL = args[0]; + const urlStr = typeof scriptURL === "string" ? scriptURL : "Worker"; + const record = (worker: Worker): Worker => { + WorkerSpy.spiedWorkers.push({ worker, originalUrl: urlStr }); + return worker; + }; + const fallback = (): Worker => record(Reflect.construct(target, args, newTarget)); + + // Inspecting options or coercing objects here changes WebIDL's + // getter/conversion order. Subclasses also keep native new.target. + if (newTarget !== workerProxy || typeof scriptURL !== "string" || + args.length > 2 || args[1] !== undefined) { + return fallback(); + } - try { - // Resolve the original script URL to absolute (so we can use it - // both as a fetch URL and as a base for rewriting relative imports). - let absoluteScriptUrl: string; + let blobUrl: string; try { - absoluteScriptUrl = new URL(urlStr, location.href).href; - } catch { - return new OriginalWorker(scriptURL, options); + const base = typeof document === "undefined" ? location.href : document.baseURI; + const url = new URL(scriptURL, base); + if (workerBundleUrl && /^https?:$/.test(url.protocol) && url.origin === location.origin) { + const bundleUrl = new URL(workerBundleUrl, base).href; + url.hash = ""; + const xhr = new XMLHttpRequest(); + xhr.open("GET", url.href, false); + xhr.send(); + if (WorkerSpy.isJavaScriptResponse(xhr, url.href) && + !xhr.getResponseHeader("Content-Security-Policy") && + !xhr.getResponseHeader("Content-Security-Policy-Report-Only") && + WorkerSpy.shouldInjectSource(xhr.responseText)) { + const bundleXhr = new XMLHttpRequest(); + bundleXhr.open("GET", bundleUrl, false); + bundleXhr.send(); + const bundleAvailable = WorkerSpy.isJavaScriptResponse(bundleXhr, bundleUrl); + if (bundleAvailable) { + // XHR uses connect-src; importScripts uses script-src. + // A later load/execution failure must not abort the app. + const importLine = "try { importScripts(" + JSON.stringify(bundleUrl) + + "); } catch (e) { console.warn(\"[Spector.js] Worker auto-injection failed:\", e); }\n"; + blobUrl = URL.createObjectURL(new Blob([importLine, xhr.responseText], + { type: "application/javascript" })); + } + } + } + } catch (e) { + // tslint:disable-next-line:no-console + console.warn("[Spector.js] Could not inject into Worker (" + urlStr + "):", e); } - // Fetch the worker script and prepend Spector import - const xhr = new XMLHttpRequest(); - xhr.open("GET", absoluteScriptUrl, false); // synchronous - xhr.send(); - - if (xhr.status === 200 && WorkerSpy.shouldInjectSource(xhr.responseText)) { - // Rewrite static `importScripts(...)` calls in source so - // relative / root-relative URLs work when the worker runs - // from a `blob:` URL. - const rewrittenSource = WorkerSpy.rewriteImportScripts(xhr.responseText, absoluteScriptUrl); - - // Runtime guard: webpack and other bundlers compute chunk - // URLs at runtime and pass them straight to importScripts. - // We can't statically rewrite those, so we wrap - // `self.importScripts` to resolve every URL against the - // original worker location before delegating to the real - // implementation. We also override `self.location` lookups - // by exposing a synthetic `__SPECTOR_workerBaseUrl` that - // bundlers reading `self.location.href` could pick up. - const runtimeShim = - "(function(){\n" + - " var __spectorBase = " + JSON.stringify(absoluteScriptUrl) + ";\n" + - " self.__SPECTOR_workerBaseUrl = __spectorBase;\n" + - " function __spectorResolve(u) {\n" + - " if (u == null) return u;\n" + - " if (typeof u !== \"string\") {\n" + - " if (u instanceof URL) return u;\n" + - " try { u = String(u); } catch (e) { return u; }\n" + - " }\n" + - " if (/^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i.test(u)) return u;\n" + - " try { return new URL(u, __spectorBase).href; }\n" + - " catch (e) { return u; }\n" + - " }\n" + - " self.__SPECTOR_resolveWorkerUrl = __spectorResolve;\n" + - " var __origImportScripts = self.importScripts;\n" + - " if (typeof __origImportScripts === \"function\") {\n" + - " self.importScripts = function() {\n" + - " var args = new Array(arguments.length);\n" + - " for (var i = 0; i < arguments.length; i++) args[i] = __spectorResolve(arguments[i]);\n" + - " return __origImportScripts.apply(self, args);\n" + - " };\n" + - " }\n" + - " var __origFetch = self.fetch;\n" + - " if (typeof __origFetch === \"function\") {\n" + - " self.fetch = function(input, init) {\n" + - " try {\n" + - " if (typeof input === \"string\") {\n" + - " input = __spectorResolve(input);\n" + - " } else if (input && typeof input === \"object\" && \"url\" in input && typeof Request === \"function\") {\n" + - " var r = input;\n" + - " var resolved = __spectorResolve(r.url);\n" + - " if (resolved !== r.url) input = new Request(resolved, r);\n" + - " }\n" + - " } catch (e) { /* fall through with original input */ }\n" + - " return __origFetch.call(self, input, init);\n" + - " };\n" + - " }\n" + - " if (typeof XMLHttpRequest === \"function\" && XMLHttpRequest.prototype && XMLHttpRequest.prototype.open) {\n" + - " var __origXhrOpen = XMLHttpRequest.prototype.open;\n" + - " XMLHttpRequest.prototype.open = function(method, url) {\n" + - " var args = Array.prototype.slice.call(arguments);\n" + - " args[1] = __spectorResolve(url);\n" + - " return __origXhrOpen.apply(this, args);\n" + - " };\n" + - " }\n" + - " if (typeof Worker === \"function\") {\n" + - " var __OrigWorker = Worker;\n" + - " self.Worker = function(scriptURL, options) {\n" + - " var resolved = __spectorResolve(scriptURL);\n" + - " return new __OrigWorker(resolved, options);\n" + - " };\n" + - " self.Worker.prototype = __OrigWorker.prototype;\n" + - " }\n" + - "})();\n"; - - const spectorImport = "importScripts(" + JSON.stringify(WorkerSpy.workerBundleUrl) + ");\n"; - const modifiedScript = runtimeShim + spectorImport + rewrittenSource; - const blob = new Blob([modifiedScript], { type: "application/javascript" }); - const blobUrl = URL.createObjectURL(blob); - - const spiedWorker = new OriginalWorker(blobUrl, options); - - WorkerSpy.spiedWorkers.push({ - worker: spiedWorker, - originalUrl: urlStr, - }); - - return spiedWorker; + if (blobUrl) { + let worker: Worker; + try { + worker = Reflect.construct(target, [blobUrl], newTarget); + } catch (e) { + URL.revokeObjectURL(blobUrl); + return fallback(); + } + setTimeout(() => URL.revokeObjectURL(blobUrl), 5000); + return record(worker); } - } - catch (e) { - // tslint:disable-next-line:no-console - console.warn("[Spector.js] Could not inject into Worker (" + urlStr + "):", e); - } - - // Fallback: create original Worker without Spector - const fallbackWorker = new OriginalWorker(scriptURL, options); - WorkerSpy.spiedWorkers.push({ - worker: fallbackWorker, - originalUrl: urlStr, - }); - return fallbackWorker; - }; - - // Preserve instanceof checks - (globalThis as any).Worker.prototype = OriginalWorker.prototype; + return fallback(); + }, + }); + (globalThis as any).Worker = workerProxy; + WorkerSpy.originalWorkerConstructor = originalWorkerConstructor; + WorkerSpy.workerProxy = workerProxy; + WorkerSpy.intercepting = true; } - /** Stop intercepting Worker construction. */ + /** Deactivate interception without overwriting a later third-party constructor. */ public static stopIntercepting(): void { if (!WorkerSpy.intercepting) { return; } - (globalThis as any).Worker = WorkerSpy.originalWorkerConstructor; + const workerProxy = WorkerSpy.workerProxy; + WorkerSpy.workerProxy = undefined; WorkerSpy.intercepting = false; + if ((globalThis as any).Worker === workerProxy) { + try { + (globalThis as any).Worker = WorkerSpy.originalWorkerConstructor; + } catch (e) { + // A third party may have made the property read-only. The + // installed proxy is already inactive and forwards natively. + } + } } - /** - * Rewrite every URL passed to `importScripts(...)` in the worker source - * to an absolute URL resolved against the worker's original location. - * - * Without this, when the worker is loaded from a `blob:` URL, calls like - * `importScripts("/scripts/foo.js")` or `importScripts("./bar.js")` - * resolve against the blob URL — which has no meaningful path — and the - * browser throws `The URL '...' is invalid`. - * - * Handles single, double, and template (no-interpolation) string literals, - * and multiple comma-separated arguments. - */ - private static rewriteImportScripts(source: string, baseUrl: string): string { - // Match `importScripts(...)` and rewrite each string literal argument. - // We deliberately keep this regex permissive — argument list is - // re-tokenised inside the replacer. - const importScriptsPattern = /importScripts\s*\(([^)]*)\)/g; - const stringLiteralPattern = /(['"`])((?:\\.|(?!\1).)*)\1/g; - - return source.replace(importScriptsPattern, (match, argList: string) => { - const rewrittenArgs = argList.replace(stringLiteralPattern, (_lit, quote: string, value: string) => { - // Skip rewriting if it contains any escape that suggests - // template interpolation — we can't statically resolve those. - if (quote === "`" && value.indexOf("${") !== -1) { - return _lit; - } - let resolved: string; - try { - resolved = new URL(value, baseUrl).href; - } catch { - return _lit; - } - return quote + resolved + quote; - }); - return "importScripts(" + rewrittenArgs + ")"; - }); + /** Check a synchronous preflight without accepting redirects or non-script MIME types. */ + private static isJavaScriptResponse(xhr: XMLHttpRequest, requestedUrl: string): boolean { + const mime = (xhr.getResponseHeader("Content-Type") || "").split(";")[0].trim(); + return xhr.status === 200 && xhr.responseURL === requestedUrl && + /^(?:text|application)\/(?:x-)?(?:java|ecma)script$/i.test(mime); } /** - * Best-effort bypass for recognizable dynamic imports and nested Workers. - * This is not a safety check: aliases, dependencies, and other syntax can - * evade detection. Only leaving interception disabled preserves the native - * Worker constructor and its behavior. + * Bypass recognizable URL-dependent code instead of emulating native APIs. + * Token checks cover comments between tokens and ordinary aliases, but not + * arbitrary computed names. False positives intentionally stay native. + * Strict directives and hashbangs cannot be preserved by prepending code. */ private static shouldInjectSource(source: string): boolean { - const dynamicImportPattern = /\bimport\s*(?:\/\*[\s\S]*?\*\/\s*)?\(/; - const nestedWorkerPattern = /\bnew\s+(?:(?:self|globalThis)\s*\.\s*)?(?:Worker|SharedWorker)\s*\(/; - - return !dynamicImportPattern.test(source) && !nestedWorkerPattern.test(source); + return !/\b(?:import|importScripts|Worker|SharedWorker|location|fetch|Request|XMLHttpRequest|WebSocket|EventSource|crossOriginIsolated|SharedArrayBuffer|Atomics|WebAssembly|eval|Function)\b|\\u|["']use strict["']|^(?:\uFEFF)?#!/.test(source); } /** Get all Workers that were created while intercepting. */ diff --git a/src/spector.ts b/src/spector.ts index 041a277..ebf4f56 100644 --- a/src/spector.ts +++ b/src/spector.ts @@ -478,8 +478,9 @@ export class Spector { /** * Explicitly opt in to intercepting new Worker() calls to auto-inject Spector. - * Experimental/best-effort: can change Worker behavior and fails for some - * CORS/CSP policies. Module Workers are not injected. Prefer spyWorker(). + * Experimental/best-effort: only simple same-origin classic scripts with + * string URLs and no options are candidates. Module Workers stay native. + * Blob wrapping can still change behavior or fail under CSP. Prefer spyWorker(). * @param workerBundleUrl URL to spector.worker.bundle.js */ public spyWorkers(workerBundleUrl: string = "spector.worker.bundle.js"): void { @@ -487,7 +488,7 @@ export class Spector { } /** - * Stop intercepting Worker construction. + * Stop intercepting Worker construction without replacing later third-party wrappers. */ public stopSpyingWorkers(): void { WorkerSpy.stopIntercepting(); @@ -538,8 +539,7 @@ export class Spector { /** * Capture a frame from a Worker's WebGL context. - * Uses direct postMessage to bypass the main-thread spy chain, - * which ensures a full frame is captured. + * Uses the Worker's bridge to send the request and publish its result once. */ public captureWorker( worker: Worker, @@ -547,31 +547,7 @@ export class Spector { quickCapture: boolean = false, fullCapture: boolean = false, ): void { - // Ensure bridge exists for UI integration - if (!this.workerBridges.has(worker)) { - this.spyWorker(worker); - } - - // Listen for capture result directly on the Worker - // (bypasses the Spector spy chain for reliable full-frame capture) - // tslint:disable-next-line:no-this-assignment - const self = this; - worker.addEventListener("message", function captureHandler(e: MessageEvent) { - if (e.data && e.data.type === "spector:capture-complete") { - worker.removeEventListener("message", captureHandler); - self.triggerCapture(e.data.capture); - } - }); - - // Send trigger directly to Worker - worker.postMessage({ - type: "spector:trigger-capture", - version: 1, - canvasIndex: 0, - commandCount, - quickCapture, - fullCapture, - }); + this.spyWorker(worker).triggerCapture(0, commandCount, quickCapture, fullCapture); } private captureFrames(frameCount: number): void { diff --git a/test/e2e/fixtures/worker-module-manual.js b/test/e2e/fixtures/worker-module-manual.js new file mode 100644 index 0000000..ebcda6a --- /dev/null +++ b/test/e2e/fixtures/worker-module-manual.js @@ -0,0 +1,2 @@ +import "/dist/spector.worker.bundle.js"; +import "./worker-module-offscreen.js"; diff --git a/test/e2e/fixtures/worker-module-startup.js b/test/e2e/fixtures/worker-module-startup.js new file mode 100644 index 0000000..1dd63c5 --- /dev/null +++ b/test/e2e/fixtures/worker-module-startup.js @@ -0,0 +1,11 @@ +import { value } from "./worker-module-safe-dependency.js"; + +const received = await new Promise((resolve) => { + self.onmessage = (event) => resolve({ data: event.data, trusted: event.isTrusted }); +}); +self.postMessage({ + ...received, + value, + moduleURL: import.meta.url, + workerURL: self.location.href, +}); diff --git a/test/e2e/fixtures/worker-url-apis.js b/test/e2e/fixtures/worker-url-apis.js new file mode 100644 index 0000000..d104870 --- /dev/null +++ b/test/e2e/fixtures/worker-url-apis.js @@ -0,0 +1,18 @@ +importScripts("./worker-spector-stub.js", "./worker-spector-stub.js"); + +self.onmessage = async () => { + try { + const request = new Request("./worker-module-offscreen-data.txt"); + const fetched = await (await fetch(request)).text(); + const xhr = new XMLHttpRequest(); + const loaded = new Promise((resolve, reject) => { + xhr.onload = () => resolve(xhr.responseText); + xhr.onerror = reject; + }); + xhr.open("GET", "./worker-module-offscreen-data.txt"); + xhr.send(); + self.postMessage({ fetched, loaded: await loaded, requestURL: request.url, workerURL: self.location.href }); + } catch (error) { + self.postMessage({ error: String(error) }); + } +}; diff --git a/test/e2e/workerExtension.spec.ts b/test/e2e/workerExtension.spec.ts new file mode 100644 index 0000000..f4e622d --- /dev/null +++ b/test/e2e/workerExtension.spec.ts @@ -0,0 +1,207 @@ +import { chromium, expect, test } from "@playwright/test"; +import { resolve } from "path"; + +test("installed extension persists opt-in through the real popup, background and isolated worlds", async ({}, testInfo) => { + const extensionPath = resolve(__dirname, "../../extensions"); + const context = await chromium.launchPersistentContext(testInfo.outputPath("profile"), { + channel: "chromium", + headless: true, + args: [ + `--disable-extensions-except=${extensionPath}`, + `--load-extension=${extensionPath}`, + "--use-gl=angle", + "--use-angle=swiftshader", + ], + }); + try { + const background = context.serviceWorkers()[0] || await context.waitForEvent("serviceworker"); + const extensionId = new URL(background.url()).host; + const page = await context.newPage(); + await page.addInitScript(() => { + if (window.top === window) { + document.addEventListener("DOMContentLoaded", () => { + const frame = document.createElement("iframe"); + frame.src = "http://127.0.0.1:1337/test/e2e/fixtures/worker-host.html"; + document.body.append(frame); + }); + } + }); + const errors: string[] = []; + page.on("pageerror", (error) => errors.push(error.message)); + await page.goto("http://localhost:1337/test/e2e/fixtures/worker-host.html"); + expect(await page.evaluate(() => Worker === Worker.prototype.constructor)).toBe(true); + expect(await page.evaluate(() => (window as any).earlyWorkerResult)) + .toEqual({ value: "safe-ok", injected: false }); + + await page.evaluate(() => sessionStorage.setItem("SPECTOR_LOADED", "true")); + await page.reload(); + await page.waitForFunction(() => !!(window as any).spector); + const bridgeUrl = await page.locator("#TexturesId_SpectorWorkerBundleUrl").first().inputValue(); + expect(bridgeUrl).toBe(`chrome-extension://${extensionId}/spector.worker.bundle.js`); + + // A cross-origin frame starts without the top frame's session setting. + const childFrame = () => page.frames().find((frame) => frame.url().startsWith("http://127.0.0.1:1337/"))!; + expect(await childFrame().evaluate(() => sessionStorage.getItem("SPECTOR_WORKERAUTOINJECT"))).toBeNull(); + + const popup = await context.newPage(); + await popup.goto(`chrome-extension://${extensionId}/popup.html`); + const checkbox = popup.getByRole("checkbox", { name: "Auto-inject Workers (experimental)", exact: true }); + const focusTab = async () => background.evaluate(async () => { + const chrome = (globalThis as any).chrome; + const tabs = await chrome.tabs.query({}); + const tab = tabs.find((candidate: any) => candidate.url === "http://localhost:1337/test/e2e/fixtures/worker-host.html"); + await chrome.tabs.update(tab.id, { active: true }); + }); + await focusTab(); + await popup.evaluate(() => (globalThis as any).refreshCanvases()); + await expect(checkbox).not.toBeChecked(); + + // This test opens popup.html as a background tab. A physical click would + // activate that tab, unlike a real action popup, and target the wrong tab. + await Promise.all([ + page.waitForEvent("load"), + checkbox.evaluate((input: HTMLInputElement) => input.click()), + ]); + await page.waitForFunction(() => !!(window as any).spector); + expect(await page.evaluate(() => sessionStorage.getItem("SPECTOR_WORKERAUTOINJECT"))).toBe("true"); + expect(await page.evaluate(() => (window as any).__SPECTOR_Workers[0].injected)).toBe(true); + expect(await childFrame().evaluate(() => sessionStorage.getItem("SPECTOR_WORKERAUTOINJECT"))).toBe("true"); + // The parser-created Worker ran with the real extension bundle, not a stub. + expect(await page.evaluate(() => (window as any).earlyWorkerResult)) + .toEqual({ value: "safe-ok", injected: false }); + + await page.reload(); + await page.waitForFunction(() => !!(window as any).spector); + expect(await page.evaluate(() => (window as any).__SPECTOR_Workers[0].injected)).toBe(true); + expect(await page.evaluate(() => new Promise((resolve, reject) => { + const worker = new Worker("/sample/js/workerAutoInject/safeClassic.js"); + const timer = setTimeout(() => { worker.terminate(); reject(new Error("No instrumented context")); }, 10000); + worker.onmessage = (event) => { + if (event.data?.type === "spector:context-ready") { + clearTimeout(timer); + worker.terminate(); + resolve(true); + } + }; + worker.onerror = (event) => { clearTimeout(timer); worker.terminate(); reject(new Error(event.message)); }; + worker.postMessage("start"); + }))).toBe(true); + const captureResult = await page.evaluate(() => new Promise<{ count: number; commands: number[] }>((resolve, reject) => { + const worker = new Worker("./worker-module-manual.js", { type: "module" }); + const canvas = new OffscreenCanvas(16, 16); + const captures: any[] = []; + const timer = setTimeout(() => { worker.terminate(); reject(new Error("No extension capture")); }, 15000); + const onCapture = (event: Event) => { + captures.push((event as CustomEvent).detail.capture); + if (captures.length === 1) { + setTimeout(() => { + clearTimeout(timer); + worker.terminate(); + document.removeEventListener("SpectorOnCaptureEvent", onCapture); + resolve({ count: captures.length, commands: captures.map(capture => capture.commands?.length) }); + }, 100); + } + }; + document.addEventListener("SpectorOnCaptureEvent", onCapture); + worker.onmessage = (event) => { + if (event.data?.type === "spector:context-ready") { + const index = (window as any).__SPECTOR_Canvases.findIndex((entry: any) => entry.__spector_worker === worker); + (document.getElementById("SPECTOR_COMMUNICATION") as HTMLInputElement).value = String(index); + (document.getElementById("SPECTOR_COMMUNICATION_COMMANDCOUNT") as HTMLInputElement).value = "6"; + (document.getElementById("SPECTOR_COMMUNICATION_QUICKCAPTURE") as HTMLInputElement).value = "true"; + document.dispatchEvent(new CustomEvent("SpectorRequestCaptureEvent")); + } + }; + worker.postMessage({ type: "init", canvas }, [canvas]); + })); + expect(captureResult).toEqual({ count: 1, commands: [6] }); + + const unlinkedCanvas = await page.evaluate(() => { + const unrelated = new Worker("/test/e2e/fixtures/worker-safe.js"); + const native = new Worker("/test/e2e/fixtures/worker-module-safe.js", { type: "module" }); + const canvas = document.createElement("canvas"); + document.body.append(canvas); + const offscreen = canvas.transferControlToOffscreen(); + native.postMessage({ canvas: offscreen }, [offscreen]); + document.dispatchEvent(new CustomEvent("SpectorRequestCanvasListEvent")); + const canvases = (window as any).__SPECTOR_Canvases; + const index = canvases.indexOf(canvas); + const requests: unknown[] = []; + const postMessage = unrelated.postMessage.bind(unrelated); + unrelated.postMessage = (message: unknown) => { + requests.push(message); + postMessage(message); + }; + const errors: string[] = []; + document.addEventListener("SpectorOnErrorEvent", (event) => { + errors.push((event as CustomEvent).detail.errorString); + }, { once: true }); + (document.getElementById("SPECTOR_COMMUNICATION") as HTMLInputElement).value = String(index); + document.dispatchEvent(new CustomEvent("SpectorRequestCaptureEvent")); + const linked = Object.hasOwn(canvas, "__spector_worker"); + unrelated.terminate(); + native.terminate(); + canvas.remove(); + return { index, requests, errors, linked }; + }); + expect(unlinkedCanvas.index).toBeGreaterThanOrEqual(0); + expect(unlinkedCanvas.requests).toEqual([]); + expect(unlinkedCanvas.linked).toBe(false); + expect(unlinkedCanvas.errors).toEqual([expect.stringContaining("Worker is unknown")]); + + const restrictedStartup = await page.evaluate(() => new Promise((resolve, reject) => { + const policy = document.createElement("meta"); + policy.httpEquiv = "Content-Security-Policy"; + policy.content = "worker-src 'self' blob:; script-src 'none'; connect-src 'self' chrome-extension:"; + document.head.append(policy); + const xhr = new XMLHttpRequest(); + xhr.open("GET", (document.getElementById("TexturesId_SpectorWorkerBundleUrl") as HTMLInputElement).value, false); + xhr.send(); + const worker = new Worker("/sample/js/workerAutoInject/safeClassic.js"); + const timer = setTimeout(() => { worker.terminate(); reject(new Error("No restricted Worker startup")); }, 10000); + let contexts = 0; + worker.onmessage = (event) => { + if (event.data?.type === "spector:context-ready") { contexts++; } + if (event.data?.value) { + clearTimeout(timer); + worker.terminate(); + resolve({ status: xhr.status, contexts, value: event.data.value }); + } + }; + worker.onerror = (event) => { clearTimeout(timer); worker.terminate(); reject(new Error(event.message)); }; + worker.postMessage("start"); + })); + // Chromium allows web-accessible extension scripts here even though an + // HTTP bundle's importScripts is blocked by the same script-src policy. + expect(restrictedStartup).toEqual({ status: 200, contexts: 1, value: "safe-classic-ok" }); + // A subframe's different setting must not become the popup's default. + await childFrame().evaluate(() => sessionStorage.setItem("SPECTOR_WORKERAUTOINJECT", "false")); + await childFrame().goto(childFrame().url()); + await focusTab(); + await popup.reload(); + await popup.evaluate(() => (globalThis as any).refreshCanvases()); + await expect(checkbox).toBeChecked(); + + await Promise.all([ + page.waitForEvent("load"), + checkbox.evaluate((input: HTMLInputElement) => input.click()), + ]); + await page.waitForFunction(() => !!(window as any).spector); + expect(await page.evaluate(() => Worker === Worker.prototype.constructor)).toBe(true); + expect(await page.evaluate(() => sessionStorage.getItem("SPECTOR_WORKERAUTOINJECT"))).toBe("false"); + await focusTab(); + await popup.reload(); + await popup.evaluate(() => (globalThis as any).refreshCanvases()); + await expect(checkbox).not.toBeChecked(); + await page.evaluate(() => { + document.addEventListener("SpectorRequestPauseEvent", () => { + (window as any).__pauseRoutedToTopFrame = true; + }); + }); + await popup.evaluate(() => (globalThis as any).pause({ ref: { frameId: "0" } })); + await page.waitForFunction(() => (window as any).__pauseRoutedToTopFrame === true); + expect(errors).toEqual([]); + } finally { + await context.close(); + } +}); diff --git a/test/e2e/workerInterception.spec.ts b/test/e2e/workerInterception.spec.ts index 00bd292..b070302 100644 --- a/test/e2e/workerInterception.spec.ts +++ b/test/e2e/workerInterception.spec.ts @@ -1,6 +1,8 @@ import { expect, Page, test } from "@playwright/test"; import { readFileSync } from "fs"; import { join } from "path"; +import { createServer } from "http"; +import { AddressInfo } from "net"; interface IWorkerResult { value?: string; @@ -10,10 +12,6 @@ interface IWorkerResult { const fixtureRoot = "/test/e2e/fixtures"; const contentScript = readFileSync(join(__dirname, "..", "..", "extensions", "contentScript.js"), "utf8"); -const moduleWorkerInjector = readFileSync( - join(__dirname, "..", "..", "extensions", "moduleWorkerInjector.js"), - "utf8", -); async function installExtensionWorkerProxy(page: Page, enabled?: boolean): Promise { // One init script fixes the ordering: native snapshot -> session setting -> @@ -25,7 +23,6 @@ async function installExtensionWorkerProxy(page: Page, enabled?: boolean): Promi sessionStorage.setItem("SPECTOR_CAPTUREOFFSCREEN", "true"); ${enabled === undefined ? "" : `sessionStorage.setItem("SPECTOR_WORKERAUTOINJECT", "${enabled}");`} } - ${moduleWorkerInjector} ${contentScript} `); await page.goto(`${fixtureRoot}/worker-host.html`); @@ -107,11 +104,11 @@ for (const enabled of [undefined, false, true]) { })).toBe(false); }); - test("injects a static-import module Worker only after opt-in", async ({ page }) => { + test("leaves static-import module Workers native even after opt-in", async ({ page }) => { const result = await runWorker(page, "worker-module-safe.js", { type: "module" }); - expect(result).toEqual({ value: "module-ok", injected: enabled === true }); + expect(result).toEqual({ value: "module-ok", injected: false }); expect(preflightRequests.some((url) => url.endsWith("worker-module-safe.js"))) - .toBe(enabled === true); + .toBe(false); }); }); } @@ -153,6 +150,7 @@ test("off mode preserves native subclassing, statics, invocation errors and coer native: inspect(NativeWorker), }; }); + expect(result.identical).toBe(true); expect(result.staticValue).toBe("unchanged"); expect(result.actual).toEqual(result.native); @@ -162,12 +160,52 @@ test("off mode preserves native subclassing, statics, invocation errors and coer expect(result.actual.missingArgumentError).toContain("TypeError"); }); -test("opt-in captures a transferred OffscreenCanvas in a module Worker", async ({ page }) => { +test("opt-in preserves native message cloning, transfer and validation timing", async ({ page }) => { await installExtensionWorkerProxy(page, true); - await page.evaluate(() => { - const bundle = document.getElementById("TexturesId_SpectorWorkerBundleUrl") as HTMLInputElement; - bundle.value = `${location.origin}/.temp/spector.worker.bundle.js`; + const result = await page.evaluate(() => { + const worker = new Worker("./worker-module-safe.js", { type: "module" }); + const buffer = new ArrayBuffer(8); + worker.postMessage(buffer, [buffer]); + let cloneError = ""; + try { worker.postMessage(() => {}); } catch (error) { cloneError = (error as Error).name; } + const ownPostMessage = Object.hasOwn(worker, "postMessage"); + worker.terminate(); + return { detached: buffer.byteLength === 0, cloneError, ownPostMessage }; + }); + expect(result).toEqual({ detached: true, cloneError: "DataCloneError", ownPostMessage: false }); +}); + +test("opt-in fallback does not inspect options or coerce URL objects before the native constructor", async ({ page }) => { + await installExtensionWorkerProxy(page, true); + const result = await page.evaluate(() => { + const inspect = (Ctor: typeof Worker) => { + const calls: string[] = []; + const url = { + [Symbol.toPrimitive](hint: string) { calls.push("url:" + hint); return "./worker-safe.js"; }, + toString() { throw new Error("Unexpected toString"); }, + }; + const options = { + get credentials(): RequestCredentials { calls.push("credentials"); return "omit"; }, + get name() { calls.push("name"); return "named"; }, + get type(): WorkerType { calls.push("type"); return "module"; }, + }; + try { + class Child extends Ctor {} + const worker = new Child(url as any, options); + const subclass = worker instanceof Child; + worker.terminate(); + return { calls, subclass }; + } catch (error) { + return { calls, error: String(error) }; + } + }; + return { actual: inspect(Worker), native: inspect((window as any).__nativeWorker) }; }); + expect(result.actual).toEqual(result.native); +}); + +test("manual instrumentation captures a transferred OffscreenCanvas in a native module Worker", async ({ page }) => { + await installExtensionWorkerProxy(page, true); const result = await page.evaluate<{ commands: number; names: string[] }, string>((scriptUrl) => { return new Promise((resolve, reject) => { @@ -200,7 +238,7 @@ test("opt-in captures a transferred OffscreenCanvas in a module Worker", async ( }); worker.postMessage({ type: "init", canvas: offscreen }, [offscreen]); }); - }, `${fixtureRoot}/worker-module-offscreen.js`); + }, `${fixtureRoot}/worker-module-manual.js`); expect(result.commands).toBeGreaterThan(3); expect(result.names).toContain("drawArrays"); @@ -299,3 +337,384 @@ test("popup exposes the experimental opt-in as an unchecked, labeled checkbox", expect(hint.y + hint.height).toBeLessThanOrEqual(footer.y); expect(footer.y + footer.height).toBeLessThanOrEqual(550); }); + +for (const mode of ["extension", "api"]) { + test.describe(`${mode} conservative opt-in`, () => { + test.beforeEach(async ({ page }) => { + if (mode === "extension") { + await installExtensionWorkerProxy(page, true); + } else { + await page.addInitScript("window.__nativeWorker = Worker;"); + await page.goto(`${fixtureRoot}/worker-host.html`); + await page.addScriptTag({ url: "/dist/spector.bundle.js" }); + await page.evaluate(() => { + const spector = new (window as any).SPECTOR.Spector(); + spector.spyWorkers("/test/e2e/fixtures/worker-spector-stub.js"); + (window as any).__testSpector = spector; + }); + } + }); + + test("preserves constructor errors, descriptors, URL conversion and getter order", async ({ page }) => { + const results = await page.evaluate(() => { + const Native = (window as any).__nativeWorker; + Native.customStatic = 42; + const inspect = (Ctor: typeof Worker) => { + const calls: string[] = []; + const url = { + [Symbol.toPrimitive](hint: string) { calls.push("url:" + hint); return "./worker-safe.js"; }, + toString() { throw new Error("extra conversion"); }, + }; + const options = { + get credentials(): RequestCredentials { calls.push("credentials"); return "same-origin"; }, + get name() { calls.push("name"); return "child"; }, + get type(): WorkerType { calls.push("type"); return "classic"; }, + }; + class Child extends Ctor {} + Object.defineProperty(Child.prototype, "addEventListener", { + get() { throw new Error("unexpected instance method access"); }, + }); + const worker = new Child(url as any, options); + const subclass = worker instanceof Child; + worker.terminate(); + const errors: string[] = []; + for (const construct of [ + () => (Ctor as any)(), + () => new (Ctor as any)(), + () => new Ctor("./worker-safe.js", { get type(): WorkerType { throw new Error("getter"); } }), + ]) { + try { construct(); } catch (error) { errors.push(String(error)); } + } + return { calls, subclass, errors, keys: Object.getOwnPropertyNames(Ctor), + name: Object.getOwnPropertyDescriptor(Ctor, "name"), staticValue: (Ctor as any).customStatic }; + }; + return { actual: inspect(Worker), native: inspect(Native) }; + }); + expect(results.actual).toEqual(results.native); + }); + + test("leaves startup messages, cloning, transfers and top-level await native", async ({ page }) => { + const result = await page.evaluate(() => new Promise((resolve, reject) => { + const worker = new Worker("./worker-module-startup.js", { type: "module" }); + const timeout = setTimeout(() => { worker.terminate(); reject(new Error("startup deadlock")); }, 5000); + const data = { value: 1, buffer: new ArrayBuffer(8) }; + let detached = false; + let cloneError = ""; + worker.onmessage = (event) => { + clearTimeout(timeout); + worker.terminate(); + resolve({ result: event.data, detached, cloneError, ownPostMessage: Object.hasOwn(worker, "postMessage") }); + }; + worker.onerror = (event) => { clearTimeout(timeout); worker.terminate(); reject(new Error(event.message)); }; + worker.postMessage(data, { transfer: [data.buffer] }); + detached = data.buffer.byteLength === 0; + data.value = 2; + try { worker.postMessage(() => {}); } catch (error) { cloneError = (error as Error).name; } + })); + expect(result).toMatchObject({ detached: true, cloneError: "DataCloneError", ownPostMessage: false, + result: { data: { value: 1 }, trusted: true, value: "module-ok" } }); + expect(result.result.moduleURL).toBe(result.result.workerURL); + expect(result.result.moduleURL).toMatch(/\/worker-module-startup\.js$/); + }); + + test("preserves relative importScripts, Request, fetch and XHR semantics", async ({ page }) => { + const result = await runWorker(page, "worker-url-apis.js"); + expect(result.fetched.trim()).toBe("ready"); + expect(result.loaded.trim()).toBe("ready"); + expect(result.requestURL).toMatch(/\/fixtures\/worker-module-offscreen-data\.txt$/); + expect(result.workerURL).toMatch(/\/fixtures\/worker-url-apis\.js$/); + }); + + test("keeps native workers usable when CSP blocks preflight", async ({ page }) => { + await page.evaluate(() => { + const policy = document.createElement("meta"); + policy.httpEquiv = "Content-Security-Policy"; + policy.content = "worker-src 'self'; connect-src 'none'"; + document.head.append(policy); + }); + expect(await runWorker(page, "worker-safe.js")).toEqual({ value: "safe-ok", injected: false }); + expect(await runWorker(page, "worker-module-safe.js", { type: "module" })) + .toEqual({ value: "module-ok", injected: false }); + }); + + test("keeps the application running when CSP blocks only the bundle import", async ({ page }) => { + await page.evaluate(() => { + const policy = document.createElement("meta"); + policy.httpEquiv = "Content-Security-Policy"; + policy.content = "worker-src 'self' blob:; script-src 'none'; connect-src 'self'"; + document.head.append(policy); + }); + expect(await runWorker(page, "worker-safe.js")) + .toEqual({ value: "safe-ok", injected: false }); + }); + + test("keeps the application running when a preflighted bundle throws during execution", async ({ page }) => { + const warnings: string[] = []; + page.on("console", (message) => { + if (message.type() === "warning") { + warnings.push(message.text()); + } + }); + await page.route("**/worker-spector-stub.js", (route) => route.fulfill({ + contentType: "text/javascript", + body: 'throw new Error("instrumentation startup failed");', + })); + expect(await runWorker(page, "worker-safe.js")) + .toEqual({ value: "safe-ok", injected: false }); + expect(warnings).toEqual(expect.arrayContaining([ + expect.stringContaining("[Spector.js] Worker auto-injection failed:"), + ])); + }); + + test("preserves native HTTP charset decoding of Worker scripts", async ({ page }) => { + await page.route("**/worker-encoding.js", (route) => route.fulfill({ + contentType: "text/javascript; charset=windows-1252", + body: Buffer.from('onmessage = () => postMessage("café");', "utf8"), + })); + const native = await page.evaluate(() => new Promise((resolve, reject) => { + const worker = new (window as any).__nativeWorker("./worker-encoding.js"); + worker.onmessage = (event: MessageEvent) => { worker.terminate(); resolve(event.data); }; + worker.onerror = (event: ErrorEvent) => { worker.terminate(); reject(new Error(event.message)); }; + worker.postMessage("start"); + })); + expect(await runWorker(page, "worker-encoding.js")).toBe(native); + }); + + test("retains the application Worker's response CSP", async ({ page }) => { + await page.route("**/worker-response-csp.js", (route) => route.fulfill({ + contentType: "text/javascript", + headers: { "Content-Security-Policy": "script-src 'none'" }, + body: 'onmessage = () => { setTimeout("self.ran = true", 0); setTimeout(() => postMessage(self.ran === true), 50); };', + })); + const native = await page.evaluate(() => new Promise((resolve, reject) => { + const worker = new (window as any).__nativeWorker("./worker-response-csp.js"); + worker.onmessage = (event: MessageEvent) => { worker.terminate(); resolve(event.data); }; + worker.onerror = (event: ErrorEvent) => { worker.terminate(); reject(new Error(event.message)); }; + worker.postMessage("start"); + })); + expect(native).toBe(false); + expect(await runWorker(page, "worker-response-csp.js")).toBe(native); + }); + + test("bypasses commented dynamic imports and aliased nested workers", async ({ page }) => { + const original = readFileSync(join(__dirname, "fixtures/worker-dynamic-import.js"), "utf8"); + await page.route("**/worker-dynamic-import.js", (route) => route.fulfill({ + contentType: "text/javascript", body: original.replace('import(', 'import // comment\n/* comment */ ('), + })); + expect(await runWorker(page, "worker-dynamic-import.js")) + .toEqual({ value: "dynamic-ok", injected: false }); + await page.route("**/worker-module-parent.js", (route) => route.fulfill({ + contentType: "text/javascript", + body: 'import "./worker-nested-alias.js";', + })); + await page.route("**/worker-nested-alias.js", (route) => route.fulfill({ + contentType: "text/javascript", + body: 'const Child = Worker; const child = new Child("./worker-nested-child.js", {type:"module"}); child.onmessage = e => postMessage(e.data);', + })); + expect(await runWorker(page, "worker-module-parent.js", { type: "module" })).toBe("nested-ok"); + }); + + test("does not preflight blob/data URLs, URL objects, custom options or cross-origin URLs", async ({ page }) => { + const preflights: string[] = []; + page.on("request", (request) => { + if (request.resourceType() === "xhr") { preflights.push(request.url()); } + }); + const results = await page.evaluate(async () => { + const source = 'onmessage = () => postMessage("ok")'; + const blob = URL.createObjectURL(new Blob([source], { type: "text/javascript" })); + const results = []; + for (const url of [blob, "data:text/javascript," + encodeURIComponent(source), new URL("./worker-safe.js", location.href)]) { + results.push(await new Promise((resolve, reject) => { + const worker = new Worker(url); + worker.onmessage = (event) => { worker.terminate(); resolve(event.data); }; + worker.onerror = (event) => { worker.terminate(); reject(new Error(event.message)); }; + worker.postMessage("start"); + })); + } + URL.revokeObjectURL(blob); + new Worker("./worker-safe.js", { name: "native" }).terminate(); + let crossOriginError = ""; + try { new Worker(location.href.replace("localhost", "127.0.0.1")); } catch (error) { crossOriginError = (error as Error).name; } + return { results, crossOriginError }; + }); + expect(results.results).toEqual(["ok", "ok", { value: "safe-ok", injected: false }]); + expect(results.crossOriginError).toBe("SecurityError"); + expect(preflights).toEqual([]); + }); + + test("uses document.baseURI and leaves strict scripts native", async ({ page }) => { + await page.evaluate(() => { + const base = document.createElement("base"); + base.href = "/"; + document.head.append(base); + }); + expect(await runWorker(page, "worker-safe.js")).toEqual({ value: "safe-ok", injected: true }); + const relativeResult = await page.evaluate(() => new Promise((resolve, reject) => { + const worker = new Worker("test/e2e/fixtures/worker-safe.js"); + worker.onmessage = (event) => { worker.terminate(); resolve(event.data); }; + worker.onerror = (event) => { worker.terminate(); reject(new Error(event.message)); }; + worker.postMessage("start"); + })); + expect(relativeResult).toEqual({ value: "safe-ok", injected: true }); + await page.route("**/worker-strict.js", (route) => route.fulfill({ + contentType: "text/javascript", + body: '"use strict"; onmessage = function() { postMessage({ strict: (function() {return this})() === undefined }); };', + })); + expect(await runWorker(page, "worker-strict.js")).toEqual({ strict: true }); + }); + + test("leaves HTTP redirects to the native Worker loader", async ({ page }) => { + // Real HTTP redirects are needed: intercepted Worker redirects do + // not reliably resume through Chromium's DevTools Fetch domain. + const server = createServer((request, response) => { + if (request.url === "/redirect.js") { + response.writeHead(302, { location: "/worker.js" }).end(); + } else if (request.url === "/worker.js") { + response.writeHead(200, { "Content-Type": "text/javascript" }); + response.end('onmessage = () => postMessage({ value: "redirect-ok", injected: self.__spectorTestInjected === true });'); + } else { + response.writeHead(200, { "Content-Type": "text/html" }); + response.end(''); + } + }); + await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve)); + try { + await page.goto(`http://127.0.0.1:${(server.address() as AddressInfo).port}/`); + if (mode === "api") { + await page.addScriptTag({ url: "http://localhost:1337/dist/spector.bundle.js" }); + await page.evaluate(() => new (window as any).SPECTOR.Spector() + .spyWorkers("http://localhost:1337/test/e2e/fixtures/worker-spector-stub.js")); + } + const result = await page.evaluate(() => new Promise((resolve, reject) => { + const worker = new Worker("./redirect.js"); + worker.onmessage = (event) => { worker.terminate(); resolve(event.data); }; + worker.onerror = (event) => { worker.terminate(); reject(new Error(event.message)); }; + worker.postMessage("start"); + })); + expect(result).toEqual({ value: "redirect-ok", injected: false }); + } finally { + await new Promise((resolve) => server.close(() => resolve())); + } + }); + + test("does not lose application startup when the instrumentation bundle cannot load", async ({ page }) => { + await page.evaluate((testMode) => { + const missingBundle = "/test/e2e/fixtures/missing-worker-bundle.js"; + if (testMode === "extension") { + (document.getElementById("TexturesId_SpectorWorkerBundleUrl") as HTMLInputElement).value = + missingBundle; + } else { + const spector = (window as any).__testSpector; + spector.stopSpyingWorkers(); + spector.spyWorkers(missingBundle); + } + }, mode); + const result = await page.evaluate((scriptUrl) => new Promise((resolve, reject) => { + const created: string[] = []; + const create = URL.createObjectURL.bind(URL); + URL.createObjectURL = (blob) => { + const url = create(blob); + created.push(url); + return url; + }; + const worker = new Worker(scriptUrl); + worker.onmessage = (event) => { + worker.terminate(); + resolve({ message: event.data, created }); + }; + worker.onerror = (event) => { + worker.terminate(); + reject(new Error(event.message)); + }; + worker.postMessage("start"); + }), `${fixtureRoot}/worker-safe.js`); + expect(result).toEqual({ + message: { value: "safe-ok", injected: false }, + created: [], + }); + }); + + test("preserves native error delivery and reclaims injection blob URLs", async ({ page }) => { + await page.route("**/worker-throws.js", (route) => route.fulfill({ + contentType: "text/javascript", body: 'throw new Error("application startup failed")', + })); + const result = await page.evaluate(() => new Promise((resolve) => { + const created: string[] = []; + const revoked: string[] = []; + const create = URL.createObjectURL.bind(URL); + const revoke = URL.revokeObjectURL.bind(URL); + URL.createObjectURL = (blob) => { const url = create(blob); created.push(url); return url; }; + URL.revokeObjectURL = (url) => { revoked.push(url); revoke(url); }; + const worker = new Worker("./worker-throws.js"); + worker.onerror = (event) => { + event.preventDefault(); + worker.terminate(); + setTimeout(() => resolve({ message: event.message, trusted: event.isTrusted, created, revoked }), 5100); + }; + })); + expect(result.message).toContain("application startup failed"); + expect(result.trusted).toBe(true); + expect(result.created).toHaveLength(1); + expect(result.revoked).toEqual(expect.arrayContaining(result.created)); + }); + }); +} + +test("stopping interception preserves third-party wrappers and deactivates retained proxies", async ({ page }) => { + await page.goto(`${fixtureRoot}/worker-host.html`); + await page.addScriptTag({ url: "/dist/spector.bundle.js" }); + await page.evaluate(() => { + const spector = new (window as any).SPECTOR.Spector(); + spector.spyWorkers("/test/e2e/fixtures/worker-spector-stub.js"); + const retainedProxy = Worker; + const thirdParty = new Proxy(Worker, {}); + (window as any).Worker = thirdParty; + spector.stopSpyingWorkers(); + (window as any).__stopResult = Worker === thirdParty; + (window as any).__retainedProxy = retainedProxy; + (window as any).__testSpector = spector; + }); + expect(await page.evaluate(() => (window as any).__stopResult)).toBe(true); + const preflights: string[] = []; + page.on("request", (request) => { + if (request.resourceType() === "xhr") { preflights.push(request.url()); } + }); + expect(await runWorker(page, "worker-safe.js")).toEqual({ value: "safe-ok", injected: false }); + expect(preflights).toEqual([]); + // Restart must not reactivate the retained, nested interceptor. + await page.evaluate(() => (window as any).__testSpector.spyWorkers("/test/e2e/fixtures/worker-spector-stub.js")); + expect(await runWorker(page, "worker-safe.js")).toEqual({ value: "safe-ok", injected: true }); + expect(preflights).toHaveLength(2); + expect(await page.evaluate(() => new Promise((resolve, reject) => { + const worker = new (window as any).__retainedProxy("./worker-safe.js"); + worker.onmessage = (event: MessageEvent) => { worker.terminate(); resolve(event.data); }; + worker.onerror = (event: ErrorEvent) => { worker.terminate(); reject(new Error(event.message)); }; + worker.postMessage("start"); + }))).toEqual({ value: "safe-ok", injected: false }); + expect(preflights).toHaveLength(2); +}); + +test("captureWorker publishes each manual module Worker capture exactly once", async ({ page }) => { + await page.goto(`${fixtureRoot}/worker-host.html`); + await page.addScriptTag({ url: "/dist/spector.bundle.js" }); + const captures = await page.evaluate(() => new Promise((resolve, reject) => { + const worker = new Worker("./worker-module-manual.js", { type: "module" }); + const spector = new (window as any).SPECTOR.Spector(); + const canvas = new OffscreenCanvas(16, 16); + const timer = setTimeout(() => { worker.terminate(); reject(new Error("No capture")); }, 10000); + let captures = 0; + spector.onCapture.add(() => { + captures++; + if (captures === 1) { + setTimeout(() => { clearTimeout(timer); worker.terminate(); resolve(captures); }, 100); + } + }); + worker.onmessage = (event) => { + if (event.data?.type === "spector:context-ready") { + spector.captureWorker(worker, 6, true); + } + }; + worker.postMessage({ type: "init", canvas }, [canvas]); + })); + expect(captures).toBe(1); +}); diff --git a/test/unit/backend/spies/workerSpy.test.ts b/test/unit/backend/spies/workerSpy.test.ts index 0d09933..0d7e7b8 100644 --- a/test/unit/backend/spies/workerSpy.test.ts +++ b/test/unit/backend/spies/workerSpy.test.ts @@ -58,6 +58,53 @@ describe("WorkerSpy", () => { expect(WorkerSpy.isIntercepting()).toBe(false); }); + it("does not overwrite a third-party wrapper on stop or reactivate retained proxies on restart", () => { + WorkerSpy.startIntercepting("spector.worker.bundle.js"); + const retainedProxy = Worker; + const thirdParty = new Proxy(Worker, {}); + (globalThis as any).Worker = thirdParty; + WorkerSpy.stopIntercepting(); + expect(Worker).toBe(thirdParty); + + const count = WorkerSpy.getSpiedWorkers().length; + new Worker("worker.js"); + expect(WorkerSpy.getSpiedWorkers()).toHaveLength(count); + WorkerSpy.startIntercepting("spector.worker.bundle.js"); + new retainedProxy("worker.js"); + expect(WorkerSpy.getSpiedWorkers()).toHaveLength(count); + new Worker("worker.js", { name: "native" }); + expect(WorkerSpy.getSpiedWorkers()).toHaveLength(count + 1); + WorkerSpy.stopIntercepting(); + expect(Worker).toBe(thirdParty); + WorkerSpy.getSpiedWorkers().splice(count); + }); + + it("does not claim to intercept when installing the proxy fails", () => { + const descriptor = Object.getOwnPropertyDescriptor(globalThis, "Worker")!; + Object.defineProperty(globalThis, "Worker", { ...descriptor, writable: false }); + try { + expect(() => WorkerSpy.startIntercepting("spector.worker.bundle.js")).toThrow(TypeError); + expect(WorkerSpy.isIntercepting()).toBe(false); + } finally { + Object.defineProperty(globalThis, "Worker", descriptor); + } + }); + + it("deactivates a proxy even if a third party makes the Worker property read-only", () => { + WorkerSpy.startIntercepting("spector.worker.bundle.js"); + const descriptor = Object.getOwnPropertyDescriptor(globalThis, "Worker")!; + Object.defineProperty(globalThis, "Worker", { ...descriptor, writable: false }); + try { + expect(() => WorkerSpy.stopIntercepting()).not.toThrow(); + expect(WorkerSpy.isIntercepting()).toBe(false); + const count = WorkerSpy.getSpiedWorkers().length; + new Worker("worker.js"); + expect(WorkerSpy.getSpiedWorkers()).toHaveLength(count); + } finally { + Object.defineProperty(globalThis, "Worker", descriptor); + } + }); + it("getSpiedWorkers returns empty array initially", () => { expect(WorkerSpy.getSpiedWorkers()).toEqual([]); }); @@ -74,69 +121,6 @@ describe("WorkerSpy", () => { expect(WorkerSpy.isIntercepting()).toBe(false); }); - describe("rewriteImportScripts", () => { - // The method is private but accessible for unit testing via cast. - const rewrite = (WorkerSpy as any).rewriteImportScripts.bind(WorkerSpy) as - (source: string, baseUrl: string) => string; - - const baseUrl = "http://localhost:8081/scripts/index.worker.js"; - - it("rewrites a root-relative URL to absolute", () => { - const out = rewrite('importScripts("/scripts/foo.js");', baseUrl); - expect(out).toBe('importScripts("http://localhost:8081/scripts/foo.js");'); - }); - - it("rewrites a relative URL to absolute", () => { - const out = rewrite('importScripts("./foo.js");', baseUrl); - expect(out).toBe('importScripts("http://localhost:8081/scripts/foo.js");'); - }); - - it("leaves an already-absolute URL untouched", () => { - const out = rewrite('importScripts("https://cdn.example.com/lib.js");', baseUrl); - expect(out).toBe('importScripts("https://cdn.example.com/lib.js");'); - }); - - it("rewrites multiple comma-separated URLs", () => { - const out = rewrite( - 'importScripts("/a.js", "./b.js", "https://x/c.js");', - baseUrl, - ); - expect(out).toBe( - 'importScripts("http://localhost:8081/a.js", "http://localhost:8081/scripts/b.js", "https://x/c.js");', - ); - }); - - it("supports single-quoted strings", () => { - const out = rewrite("importScripts('/foo.js');", baseUrl); - expect(out).toBe("importScripts('http://localhost:8081/foo.js');"); - }); - - it("supports template literals without interpolation", () => { - const out = rewrite("importScripts(`/foo.js`);", baseUrl); - expect(out).toBe("importScripts(`http://localhost:8081/foo.js`);"); - }); - - it("leaves template literals with interpolation untouched", () => { - const src = "importScripts(`/scripts/${name}.js`);"; - expect(rewrite(src, baseUrl)).toBe(src); - }); - - it("leaves source without importScripts unchanged", () => { - const src = 'self.addEventListener("message", () => {});'; - expect(rewrite(src, baseUrl)).toBe(src); - }); - - it("rewrites multiple importScripts calls", () => { - const out = rewrite( - 'importScripts("/a.js");\nself.x = 1;\nimportScripts("./b.js");', - baseUrl, - ); - expect(out).toBe( - 'importScripts("http://localhost:8081/a.js");\nself.x = 1;\nimportScripts("http://localhost:8081/scripts/b.js");', - ); - }); - }); - describe("shouldInjectSource (best-effort bypass)", () => { const shouldInjectSource = (WorkerSpy as any).shouldInjectSource.bind(WorkerSpy) as (source: string) => boolean; @@ -154,6 +138,26 @@ describe("WorkerSpy", () => { expect(shouldInjectSource('new Worker("./child.js", { type: "module" });')).toBe(false); expect(shouldInjectSource('new self.SharedWorker("./child.js");')).toBe(false); }); + + it.each([ + 'import // comment\n("./dep.js")', + 'import /* first */ /* second */ ("./dep.js")', + 'const Child = Worker; new Child("./child.js")', + 'new /* comment */ self.Worker("./child.js")', + 'importScripts("./dependency.js")', + 'fetch(new Request("./data"))', + 'new XMLHttpRequest().open("GET", "./data")', + 'new WebSocket("/socket")', + 'new EventSource("/events")', + 'new URL("./child.js", self.location.href)', + 'postMessage({ isolated: crossOriginIsolated, buffer: typeof SharedArrayBuffer })', + 'WebAssembly.compile(bytes)', + '"use strict"; self.onmessage = function() {}', + '#!/usr/bin/env node\nself.onmessage = function() {}', + '\uFEFF#!/usr/bin/env node\nself.onmessage = function() {}', + ])("bypasses sources whose URL or script semantics cannot be preserved: %s", (source) => { + expect(shouldInjectSource(source)).toBe(false); + }); }); it("passes module Workers to the native constructor unchanged", () => { diff --git a/test/unit/extensions/moduleWorkerInjector.test.ts b/test/unit/extensions/moduleWorkerInjector.test.ts index 11121f5..cd8d8df 100644 --- a/test/unit/extensions/moduleWorkerInjector.test.ts +++ b/test/unit/extensions/moduleWorkerInjector.test.ts @@ -1,136 +1,31 @@ -/** - * Tests for moduleWorkerInjector.js — import rewriting logic. - * - * We load the injector in a jsdom-like environment and test the - * rewriteImports / resolveSpecifier functions directly. - */ - -// Load the module injector — it attaches to window.__SPECTOR_ModuleInjector -require("../../../extensions/moduleWorkerInjector"); - -const injector = (window as any).__SPECTOR_ModuleInjector; - -describe("SpectorModuleInjector", () => { - describe("resolveSpecifier", () => { - const base = "https://example.com/app/worker.js"; - - it("resolves ./ relative specifiers", () => { - expect(injector.resolveSpecifier("./engine.js", base)) - .toBe("https://example.com/app/engine.js"); - }); - - it("resolves ../ relative specifiers", () => { - expect(injector.resolveSpecifier("../utils/math.js", base)) - .toBe("https://example.com/utils/math.js"); - }); - - it("leaves absolute URLs untouched", () => { - expect(injector.resolveSpecifier("https://cdn.example.com/lib.js", base)) - .toBe("https://cdn.example.com/lib.js"); - }); - - it("leaves bare specifiers untouched", () => { - expect(injector.resolveSpecifier("three", base)).toBe("three"); - expect(injector.resolveSpecifier("@babylonjs/core", base)).toBe("@babylonjs/core"); - }); - }); - - describe("rewriteImports", () => { - const base = "https://example.com/app/worker.js"; - - it("rewrites static named imports", () => { - const src = `import { Engine } from './engine.js';`; - const result = injector.rewriteImports(src, base); - expect(result).toBe(`import { Engine } from 'https://example.com/app/engine.js';`); - }); - - it("rewrites static default imports", () => { - const src = `import Scene from "../scene.js";`; - const result = injector.rewriteImports(src, base); - expect(result).toBe(`import Scene from "https://example.com/scene.js";`); - }); - - it("rewrites side-effect imports", () => { - const src = `import './polyfill.js';`; - const result = injector.rewriteImports(src, base); - expect(result).toBe(`import 'https://example.com/app/polyfill.js';`); - }); - - it("rewrites export-from statements", () => { - const src = `export { render } from './renderer.js';`; - const result = injector.rewriteImports(src, base); - expect(result).toBe(`export { render } from 'https://example.com/app/renderer.js';`); - }); - - it("rewrites export-star statements", () => { - const src = `export * from '../utils.js';`; - const result = injector.rewriteImports(src, base); - expect(result).toBe(`export * from 'https://example.com/utils.js';`); - }); - - it("rewrites dynamic imports", () => { - const src = `const m = await import('./module.js');`; - const result = injector.rewriteImports(src, base); - expect(result).toBe(`const m = await import('https://example.com/app/module.js');`); - }); - - it("leaves absolute URL imports unchanged", () => { - const src = `import { x } from 'https://cdn.example.com/lib.js';`; - const result = injector.rewriteImports(src, base); - expect(result).toBe(src); - }); - - it("leaves bare specifiers unchanged", () => { - const src = `import * as THREE from 'three';`; - const result = injector.rewriteImports(src, base); - expect(result).toBe(src); - }); - - it("handles multiple imports in one source", () => { - const src = [ - `import { Engine } from './engine.js';`, - `import Scene from '../scene.js';`, - `import 'https://cdn.example.com/polyfill.js';`, - `const m = await import('./lazy.js');`, - ].join("\n"); - - const result = injector.rewriteImports(src, base); - expect(result).toContain("'https://example.com/app/engine.js'"); - expect(result).toContain("'https://example.com/scene.js'"); - expect(result).toContain("'https://cdn.example.com/polyfill.js'"); - expect(result).toContain("'https://example.com/app/lazy.js'"); - }); - - it("preserves non-import code", () => { - const src = `const x = 42;\nconsole.log('hello');\nimport { y } from './y.js';`; - const result = injector.rewriteImports(src, base); - expect(result).toContain("const x = 42;"); - expect(result).toContain("console.log('hello');"); - expect(result).toContain("'https://example.com/app/y.js'"); - }); - - it("handles double-quoted specifiers", () => { - const src = `import { x } from "./foo.js";`; - const result = injector.rewriteImports(src, base); - expect(result).toBe(`import { x } from "https://example.com/app/foo.js";`); - }); +import { readFileSync } from "fs"; +import { join } from "path"; +import { runInNewContext } from "vm"; + +describe("Module Worker native fallback", () => { + const source = readFileSync(join(__dirname, "../../../extensions/moduleWorkerInjector.js"), "utf8"); + + it("does not inspect inputs, fetch source, wrap messages, or generate blobs", () => { + const world: any = {}; + runInNewContext(source, world); + const scriptURL = { toString() { throw new Error("Unexpected conversion"); } }; + const options = { get type() { throw new Error("Unexpected options read"); } }; + const worker = {}; + const OriginalWorker = jest.fn(() => worker); + + expect(world.SpectorModuleInjector.injectModuleWorker(scriptURL, options, "", OriginalWorker)) + .toEqual({ worker, injected: false }); + expect(OriginalWorker).toHaveBeenCalledTimes(1); + expect(OriginalWorker).toHaveBeenCalledWith(scriptURL, options); }); - describe("canSafelyInject", () => { - it("allows a module entry point with static relative imports", () => { - expect(injector.canSafelyInject(`import init from "./scene.js";`)).toBe(true); - }); - - it("allows import.meta URL dependencies loaded from the original module URL", () => { - expect(injector.canSafelyInject( - `const url = new URL("./asset.bin", import.meta.url);`, - )).toBe(true); - }); + it("propagates native constructor errors without retrying", () => { + const world: any = {}; + runInNewContext(source, world); + const error = new TypeError("native error"); + const OriginalWorker = jest.fn(() => { throw error; }); - it("rejects nested Worker construction", () => { - expect(injector.canSafelyInject( - `new Worker(new URL("./child.js", import.meta.url), { type: "module" });`, - )).toBe(false); - }); + expect(() => world.SpectorModuleInjector.injectModuleWorker("", {}, "", OriginalWorker)).toThrow(error); + expect(OriginalWorker).toHaveBeenCalledTimes(1); }); }); diff --git a/test/unit/extensions/workerAutoInject.test.ts b/test/unit/extensions/workerAutoInject.test.ts index 40abcc6..6f9cab6 100644 --- a/test/unit/extensions/workerAutoInject.test.ts +++ b/test/unit/extensions/workerAutoInject.test.ts @@ -37,6 +37,7 @@ function createWorld(storage = createStorage()) { const nativeWorker = jest.fn(function() { this.addEventListener = jest.fn(); }); + nativeWorker.prototype.addEventListener = jest.fn(); const nativeGetContext = jest.fn(); const world: any = { document: document.implementation.createHTMLDocument(), @@ -161,7 +162,7 @@ describe("Extension Worker auto-injection opt-in", () => { expect(world.__SPECTOR_Workers[0].injected).toBe(false); }); - it("uses the module injector after explicit opt-in", () => { + it("leaves module Workers native even when an injector is available", () => { const world = createWorld(createStorage({ [settingKey]: "true" })); const nativeWorker = world.Worker; const injectedWorker = { @@ -176,17 +177,78 @@ describe("Extension Worker auto-injection opt-in", () => { const worker = new world.Worker("./worker.js", { type: "module" }); - expect(worker).toBe(injectedWorker); - expect(nativeWorker).not.toHaveBeenCalled(); - expect(world.__SPECTOR_ModuleInjector.injectModuleWorker).toHaveBeenCalledWith( - "./worker.js", - { type: "module" }, - "https://extension.test/spector.worker.bundle.js", - nativeWorker, - ); - expect(world.__SPECTOR_Workers[0].injected).toBe(true); + expect(worker).not.toBe(injectedWorker); + expect(nativeWorker).toHaveBeenCalledWith("./worker.js", { type: "module" }); + expect(world.__SPECTOR_ModuleInjector.injectModuleWorker).not.toHaveBeenCalled(); + expect(world.XMLHttpRequest).not.toHaveBeenCalled(); + expect(world.__SPECTOR_Workers[0].injected).toBe(false); + }); + + it("publishes a Worker capture once, as an object, with numeric command count", () => { + const world = createWorld(createStorage({ [settingKey]: "true", SPECTOR_LOADED: "true" })); + const onMessage = world.Worker.prototype.addEventListener; + const observable = { add: jest.fn() }; + world.SPECTOR = { + Spector: function() { + return { spyCanvases: jest.fn(), onError: observable, onCapture: observable }; + }, + }; + loadScript(world, "contentScript.js"); + world.setTimeout.mock.calls.find((call: any[]) => call[1] === 0)[0](); + const worker = new world.Worker("./worker.js", { type: "module" }); + worker.postMessage = jest.fn(); + world.__SPECTOR_Workers[0].injected = true; + world.__SPECTOR_Canvases.push({ __spector_worker: worker }); + world.document.body.innerHTML = ` + + + + `; + const published = jest.fn(); + world.document.addEventListener("SpectorOnCaptureEvent", published); + world.document.dispatchEvent(new CustomEvent("SpectorRequestCaptureEvent")); + + expect(worker.postMessage).toHaveBeenCalledWith({ + type: "spector:trigger-capture", version: 1, canvasIndex: 0, + commandCount: 6, quickCapture: true, fullCapture: false, + }); + expect(worker.addEventListener).not.toHaveBeenCalled(); + const capture = { commands: [{ name: "drawArrays" }] }; + onMessage.mock.calls[0][1]({ data: { type: "spector:capture-complete", capture } }); + expect(published).toHaveBeenCalledTimes(1); + expect(published.mock.calls[0][0].detail.capture).toBe(capture); }); + it("never routes an unlinked transferred canvas to an unrelated injected Worker", () => { + const world = createWorld(createStorage({ [settingKey]: "true", SPECTOR_LOADED: "true" })); + const observable = { add: jest.fn() }; + world.SPECTOR = { + Spector: function() { + return { spyCanvases: jest.fn(), onError: observable, onCapture: observable }; + }, + }; + loadScript(world, "contentScript.js"); + world.setTimeout.mock.calls.find((call: any[]) => call[1] === 0)[0](); + const worker = new world.Worker("./worker.js", { type: "module" }); + worker.postMessage = jest.fn(); + world.__SPECTOR_Workers[0].injected = true; + const canvas = { __spector_transferred: true }; + world.__SPECTOR_Canvases.push(canvas); + world.document.body.innerHTML = ` + + + + `; + const error = jest.fn(); + world.document.addEventListener("SpectorOnErrorEvent", error); + + world.document.dispatchEvent(new CustomEvent("SpectorRequestCaptureEvent")); + + expect(worker.postMessage).not.toHaveBeenCalled(); + expect(canvas).not.toHaveProperty("__spector_worker"); + expect(error).toHaveBeenCalledTimes(1); + expect(error.mock.calls[0][0].detail.errorString).toContain("Worker is unknown"); + }); it("starts the popup unchecked and treats older reports as off", () => { const popup = loadPopup(); const checkbox = popup.document.getElementById("workerAutoInject"); @@ -253,6 +315,41 @@ describe("Extension Worker auto-injection opt-in", () => { expect(background.browser.runtime.sendMessage.mock.calls.at(-1)[0].data.workerAutoInject).toBe(false); }); + it("reports a canvas-free frame's setting before Spector is loaded", () => { + const proxy = createWorld(createStorage({ [settingKey]: "true" })); + loadScript(proxy, "contentScriptProxy.js"); + + proxy.refreshCanvases(); + + expect(proxy.browser.runtime.sendMessage.mock.calls.at(-1)[0]) + .toMatchObject({ canvases: [], workerAutoInject: true }); + }); + + it("replaces top-frame state after navigation instead of retaining document IDs", () => { + const background = createWorld(); + loadScript(background, "background.js"); + const receive = background.browser.runtime.onMessage.addListener.mock.calls[0][0]; + const sender = { id: "extension", frameId: 0, tab: { id: 7 } }; + receive({ canvases: [], workerAutoInject: true, uniqueId: 200 }, sender, jest.fn()); + receive({ canvases: [], workerAutoInject: false, uniqueId: 100 }, sender, jest.fn()); + + background.refreshCanvases(); + + expect(Object.keys(background.tabInfo[7])).toEqual(["0"]); + expect(background.browser.runtime.sendMessage.mock.calls.at(-1)[0].data.workerAutoInject).toBe(false); + }); + + it.each(["background.js", "popup.js"])("agrees on frame zero in replies from %s", (file) => { + const world = createWorld(); + loadScript(world, file); + const receive = world.browser.runtime.onMessage.addListener.mock.calls[0][0]; + const reply = jest.fn(); + + receive({ canvases: [], uniqueId: 123 }, { frameId: 0, tab: { id: 7 } }, reply); + + expect(reply).toHaveBeenCalledWith({ frameId: "0" }); + }); + it("clears capture history when the browser starts", () => { const background = createWorld(); loadScript(background, "background.js"); From 881073557b40d2725b459d1ac969913a1bee50b0 Mon Sep 17 00:00:00 2001 From: sebavan Date: Fri, 25 Sep 2026 12:01:41 -0700 Subject: [PATCH 3/3] version prep --- documentation/changeLogs.md | 7 +++++++ extensions/manifest.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- readme.md | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/documentation/changeLogs.md b/documentation/changeLogs.md index 9ebe1f5..af0a01c 100644 --- a/documentation/changeLogs.md +++ b/documentation/changeLogs.md @@ -4,6 +4,13 @@ Please, find below the per release summary of the contribution added to the project per version. Each of the listed versions is having its corresponding tag in the repo. +## v0.9.35 + +* Fix [relative dynamic imports in Workers](https://github.com/BabylonJS/Spector.js/issues/394) and [nested module Workers](https://github.com/BabylonJS/Spector.js/issues/395) by keeping extension Worker construction native unless experimental auto-injection is explicitly enabled; module Workers always stay native. +* Add a default-off **Auto-inject Workers (experimental)** extension setting, with native fallbacks for ineligible classic Workers, URL-sensitive scripts, detectable CSP restrictions, and failed preflights. +* Fix Worker and OffscreenCanvas capture routing so Worker captures are delivered once and an unlinked transferred canvas cannot select an unrelated Worker. +* Clear saved extension captures on browser restart and handle messages to closed tabs without extension errors. + ## v0.9.33 * Improve [shader debugging](https://github.com/BabylonJS/Spector.js/issues/283) with source links, compiler diagnostics, and parser-backed formatting diff --git a/extensions/manifest.json b/extensions/manifest.json index 5edfe8c..7f76960 100644 --- a/extensions/manifest.json +++ b/extensions/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "minimum_chrome_version": "100", "name" : "Spector.js", - "version" : "0.9.33", + "version" : "0.9.35", "homepage_url": "http://spector.babylonjs.com/", "description" : "Explore and Troubleshoot your WebGL scenes easily.", "author": "@SpectorJS", diff --git a/package-lock.json b/package-lock.json index 2c28c94..0dbc68c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "spectorjs", - "version": "0.9.33", + "version": "0.9.35", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "spectorjs", - "version": "0.9.33", + "version": "0.9.35", "license": "MIT", "dependencies": { "@shaderfrog/glsl-parser": "^7.0.1", diff --git a/package.json b/package.json index 58a9067..ace84ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "spectorjs", - "version": "0.9.33", + "version": "0.9.35", "description": "Explore and Troubleshoot your WebGL scenes easily.", "keywords": [ "webgl", diff --git a/readme.md b/readme.md index cdda788..4aa64ee 100644 --- a/readme.md +++ b/readme.md @@ -118,7 +118,7 @@ You are all set. You can open your `index.html` file and see the inspector runni ###### [Back to top](#table-of-content) ### CDN -Feel free to leverage the jsDelivr CDN to use the library from your own projects: [https://cdn.jsdelivr.net/npm/spectorjs@0.9.33/dist/spector.bundle.js](https://cdn.jsdelivr.net/npm/spectorjs@0.9.33/dist/spector.bundle.js) +Feel free to leverage the jsDelivr CDN to use the library from your own projects: [https://cdn.jsdelivr.net/npm/spectorjs@0.9.35/dist/spector.bundle.js](https://cdn.jsdelivr.net/npm/spectorjs@0.9.35/dist/spector.bundle.js) ### Repo If you prefer to host your own version, the library is available in the [dist](https://github.com/BabylonJS/Spector.js/blob/master/dist/spector.bundle.js) folder of the repo.